PageSourceSearch

https://app.century.tech/assets/RLP-CBB91O_B.js

js century.tech collected 2026-10-01 11:25:55 UTC 46,498 bytes, 1 lines download raw bytes

1import{j as e,c as F,R as be,_ as Me,o as Re,I as Ce,v as Rt,P as Ct,N as Tt,id as It,h as me,bo as vt,f6 as ae,e as m,a1 as Q,r as u,bf as At,b8 as nt,L as Le,aJ as Mt,bc as Lt,bd as _t,be as Pt,a_ as _e,a$ as Pe,b0 as Ee,aD as ot,b4 as Et,ie as kt,aj as it,m as ke,M as Oe,ae as k,a as at,an as ct,Y as Ot,ig as Ft,ih as Dt,X as K,e1 as Ht,ii as Bt,ad as Te,bw as xe,a3 as lt,ao as Gt,g as Wt,G as Vt,a8 as Ut,fX as Ie,aB as qt,a4 as $t,cc as Yt,gS as Xt,bv as Be,bx as Ge,bl as zt}from"./index-BWLcZZIp.js";import{a7 as ve,al as Ae,cx as Fe,W as v,z as Kt,cy as Jt,cz as Qt,cA as Y,cB as B,aq as Zt,as as es,ar as ts,Y as ss,ah as X,E as rs,bL as ns,bM as os,aA as is,bN as as,bH as cs,cC as ye,cD as dt,ak as ls,ap as ds,D as ut,cE as us,bp as hs,u as ht,y as gs,bw as We}from"./AppTemplate-DUlEOhgX.js";import{C as Ve}from"./CognitiveMessage-DCA-tUUE.js";import{T as W}from"./useLogin-vwrO0p24.js";import{C as ms,d as ps,w as fs,a as J,u as js}from"./ErrorBoundary-animBvaW.js";import{N as gt,a as E}from"./NuggetType-DHBff5rR.js";import{N as bs,U as xs}from"./rlp.graphql-CuZ-nwlR.js";import{T as ys,a as Ss}from"./Tooltipped-CLq_y3pL.js";import{u as mt}from"./useQuery-BMvceQDr.js";import{S as ce}from"./SwitchRow-Be9p1taf.js";import{D as Se}from"./DropdownControls-BAtv6MPV.js";import{h as pt,u as Ns,a as Ue,F as qe}from"./handleApolloError-97tZxEjZ.js";import{u as ws,j as Rs,i as Cs,k as Ts}from"./useMathsPrepB2B-Cg5vDalm.js";import{C as Is}from"./CourseSketch-9D-64mLj.js";import{M as le,a as de}from"./MPAssessmentList-BDYk575r.js";import"./AccessIllustration-Cs37n9AU.js";import"./SessionError-Qwv_8uTK.js";import"./ThumbnailList-DHqyVvcH.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"[email protected]"};var s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="c958996a-617f-414a-903f-5415d430e684",t._sentryDebugIdIdentifier="sentry-dbid-c958996a-617f-414a-903f-5415d430e684")}catch{}})();const vs=({children:t,classNameExt:s,qa:r})=>e.jsx("div",{className:F("cds-mp-assessment-panel",s&&s),"data-testid":r,children:t}),As=({children:t,classNameExt:s,qa:r})=>e.jsx("div",{className:F("cds-mp-assessment-panel__body",s&&s),"data-testid":r,children:t}),Z=Object.assign(vs,{Body:As});Z.Body.displayName="MPAssessmentPanel.Body";const Ms=()=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"200",height:"200",viewBox:"0 0 200 200",children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"linearGradient-1",x1:"50.758%",x2:"50.758%",y1:"-.75%",y2:"100.25%",children:[e.jsx("stop",{offset:"0%",stopColor:"#3023AE"}),e.jsx("stop",{offset:"47.525%",stopColor:"#53A0FD"}),e.jsx("stop",{offset:"100%",stopColor:"#51E3EC"})]}),e.jsxs("linearGradient",{id:"linearGradient-2",x1:"26.994%",x2:"90.052%",y1:"41.357%",y2:"77.135%",children:[e.jsx("stop",{offset:"0%",stopColor:"#0086FF"}),e.jsx("stop",{offset:"100%",stopColor:"#A822FF"})]}),e.jsxs("radialGradient",{id:"radialGradient-3",cx:"26.994%",cy:"41.357%",r:"72.501%",fx:"26.994%",fy:"41.357%",children:[e.jsx("stop",{offset:"0%",stopColor:"#2C6DFA"}),e.jsx("stop",{offset:"100%",stopColor:"#8635FB"})]}),e.jsx("circle",{id:"path-4",cx:"100",cy:"100",r:"34"}),e.jsxs("filter",{id:"filter-5",width:"120.6%",height:"120.6%",x:"-10.3%",y:"-7.4%",filterUnits:"objectBoundingBox",children:[e.jsx("feOffset",{dy:"2",in:"SourceAlpha",result:"shadowOffsetOuter1"}),e.jsx("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"2"}),e.jsx("feColorMatrix",{in:"shadowBlurOuter1",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.356148098 0"})]}),e.jsx("circle",{id:"path-6",cx:"100",cy:"100",r:"24"}),e.jsxs("filter",{id:"filter-7",width:"129.2%",height:"129.2%",x:"-14.6%",y:"-10.4%",filterUnits:"objectBoundingBox",children:[e.jsx("feOffset",{dy:"2",in:"SourceAlpha",result:"shadowOffsetOuter1"}),e.jsx("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"2"}),e.jsx("feComposite",{in:"shadowBlurOuter1",in2:"SourceAlpha",operator:"out",result:"shadowBlurOuter1"}),e.jsx("feColorMatrix",{in:"shadowBlurOuter1",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"})]})]}),e.jsx("g",{id:"Page-1",fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1",children:e.jsxs("g",{id:"cai",children:[e.jsx("path",{d:"M0 0H200V200H0z"}),e.jsx("circle",{id:"ring-outer-3",cx:"100",cy:"100",r:"91",stroke:"url
1(#linearGradient-1)",strokeDasharray:"204",strokeWidth:"3",transform:"rotate(90 100 100)"}),e.jsx("circle",{id:"ring-outer-2",cx:"100",cy:"100",r:"96",stroke:"#3D60F6",strokeDasharray:"160,5000",strokeWidth:"3",transform:"rotate(90 100 100)"}),e.jsx("circle",{id:"ring-outer-1",cx:"100",cy:"100",r:"84",stroke:"url(#linearGradient-2)",strokeDasharray:"1.019999980926514,3.069999933242798",strokeWidth:"5",transform:"rotate(90 100 100)"}),e.jsxs("g",{id:"center-l",children:[e.jsx("use",{fill:"#000",filter:"url(#filter-5)",xlinkHref:"#path-4"}),e.jsx("use",{fill:"url(#radialGradient-3)",xlinkHref:"#path-4"})]}),e.jsxs("g",{id:"center-s",children:[e.jsx("use",{fill:"#000",filter:"url(#filter-7)",xlinkHref:"#path-6"}),e.jsx("use",{fill:"#FFF",fillOpacity:"0.204",xlinkHref:"#path-6"})]})]})})]}),Ls=({children:t,classNameExt:s,isDone:r,qa:o})=>e.jsxs("div",{className:F("cds-cai",r&&"cds-cai--done",s&&s),"data-testid":o,children:[e.jsx("div",{className:"cds-cai__spinner",children:e.jsx(Ms,{})}),e.jsx("div",{className:"cds-cai__console",children:t})]}),_s=({children:t,qa:s})=>e.jsx("div",{className:"cds-cai__console-section","data-test-id":s,children:t}),Ps=({children:t,qa:s})=>e.jsx("p",{className:"cds-cai__subject","data-testid":s,children:t}),Es=({children:t,qa:s})=>e.jsx("div",{className:"cds-cai__subjects","data-testid":s,children:t}),ks=({children:t,qa:s})=>e.jsx("div",{className:"cds-cai__verb","data-testid":s,children:t}),P=Object.assign(Ls,{ConsoleSection:_s,Subject:Ps,Subjects:Es,Verb:ks});P.ConsoleSection.displayName="CAI.ConsoleSection";P.Subject.displayName="CAI.Subject";P.Subjects.displayName="CAI.Subjects";P.Verb.displayName="CAI.Verb";const Os=({children:t,classNameExt:s,qa:r})=>e.jsx("div",{className:F("cds-learn-home-row",s&&s),"data-testid":r,children:t}),Fs=({children:t,qa:s,stackOrder:r})=>e.jsx("div",{className:"cds-learn-home-row__col","data-testid":s,style:{"--stack-order":r},children:t}),te=Object.assign(Os,{Col:Fs});te.Col.displayName="LearnHomeRow.Col";const Ds=be.forwardRef((t,s)=>{var{children:r,classNameExt:o,isActive:n,qa:a}=t,c=Me(t,["children","classNameExt","isActive","qa"]);return e.jsx("div",Object.assign({className:F("cds-rp-nugget",n&&"cds-rp-nugget--active",o&&o),"data-testid":a,ref:s},c,{children:r}))}),Hs=({ariaLabel:t,children:s,completionPercentage:r,qa:o,scorePercentage:n})=>e.jsxs("div",{className:"cds-rp-nugget__figure","aria-label":t,"data-testid":o,children:[e.jsx("div",{className:"cds-rp-nugget__thumbnail",children:s}),e.jsx("div",{className:"cds-rp-nugget__completion",children:e.jsx(ve,{diameter:140,thickness:3,percentage:r??0,type:Ae.COMPLETION})}),e.jsx("div",{className:"cds-rp-nugget__score",children:e.jsx(ve,{diameter:160,thickness:3,percentage:n??0,type:Ae.SCORE})})]}),Bs=({children:t,qa:s})=>e.jsx("h3",{className:"cds-rp-nugget__title","data-testid":s,children:t}),ee=Object.assign(Ds,{Figure:Hs,Title:Bs});ee.Figure.displayName="RPNugget.Figure";ee.Title.displayName="RPNugget.Title";const Gs=({children:t,classNameExt:s,qa:r,subject:o})=>e.jsx("dl",{className:F("cds-rp-nugget-info-list",s&&s),"data-testid":r,"data-subject":Fe(o),children:t}),Ws=({children:t,qa:s})=>e.jsx("div",{className:"cds-rp-nugget-info-list__item","data-testid":s,children:t}),Vs=({children:t,qa:s})=>e.jsx("dt",{className:"cds-rp-nugget-info-list__title","data-testid":s,children:t}),Us=({children:t,qa:s})=>e.jsx("dd",{className:"cds-rp-nugget-info-list__description","data-testid":s,children:t}),T=Object.assign(Gs,{Item:Ws,Title:Vs,Description:Us});T.Item.displayName="RPNuggetInfoList.Item";T.Title.displayName="RPNuggetInfoList.Title";T.Description.displayName="RPNuggetInfoList.Description";const qs=({children:t,classNameExt:s,qa:r})=>e.jsx("div",{className:F("cds-rp-nugget-list",s&&s),"data-testid":r,children:t}),$s=be.forwardRef((t,s)=>{var{children:r,qa:o,contentRef:n,isHidden:a}=t,c=Me(t,["children","qa","contentRef","isHidden"]);const i=["cds-rp-nugget-list__wrapper"];return a&&i.push("cds-rp-nugget-list__wrapper--hidden"),e.jsx("div",{className:i.join(" "),children:e.jsx("div",Object.assign({className:"cds-rp-nugget-list__scroll-container","data-testid":o,ref:s}
1,c,{children:e.jsx("ul",{className:"cds-rp-nugget-list__content",ref:n,children:r})}))})}),Ys=({children:t,qa:s})=>e.jsx("li",{className:"cds-rp-nugget-list__item","data-testid":s,children:t}),Xs=({children:t,disabled:s,qa:r})=>{const o=["cds-rp-nugget-list__controls"];return s&&o.push("cds-rp-nugget-list__controls--disabled"),e.jsx("div",{className:o.join(" "),"data-testid":r,children:t})},zs=be.forwardRef((t,s)=>{var{children:r,qa:o,direction:n}=t,a=Me(t,["children","qa","direction"]);return e.jsxs("button",Object.assign({className:`cds-rp-nugget-list__control cds-rp-nugget-list__control--${n}`,"data-testid":o,type:"button",ref:s},a,{children:[e.jsx(Re,{icon:n==="left"?Rt:Ct,size:Ce.MEDIUM}),e.jsx("span",{className:"cds-rp-nugget-list__label",children:r})]}))}),O=Object.assign(qs,{Content:$s,Item:Ys,Controls:Xs,Control:zs});O.Content.displayName="RPNuggetList.Content";O.Item.displayName="RPNuggetList.Item";O.Controls.displayName="RPNuggetList.Controls";O.Control.displayName="RPNuggetList.Control";const Ks=({children:t,classNameExt:s,qa:r})=>e.jsx("div",{className:F("cds-rp-recommendations-list",s&&s),"data-testid":r,children:t}),Js=({children:t,qa:s})=>e.jsx("div",{className:"cds-rp-recommendations-list__item","data-testid":s,children:t}),Qs=({children:t,qa:s})=>e.jsx("div",{className:"cds-rp-recommendations-list__icon","data-testid":s,children:t}),Zs=({children:t,qa:s})=>e.jsx("dl",{className:"cds-rp-recommendations-list__body","data-testid":s,children:t}),er=({children:t,qa:s})=>e.jsx("dt",{className:"cds-rp-recommendations-list__title","data-testid":s,children:t}),tr=({children:t,qa:s})=>e.jsx("dd",{className:"cds-rp-recommendations-list__description","data-testid":s,children:t}),D=Object.assign(Ks,{Item:Js,Icon:Qs,Body:Zs,Title:er,Description:tr});D.Item.displayName="RPRecommendationsList.Item";D.Icon.displayName="RPRecommendationsList.Icon";D.Body.displayName="RPRecommendationsList.Body";D.Title.displayName="RPRecommendationsList.Title";D.Description.displayName="RPRecommendationsList.Description";const sr=({children:t,classNameExt:s,isFullHeight:r,qa:o})=>e.jsx("div",{className:F("cds-rp-widget",r&&"cds-rp-widget--full-height",s&&s),"data-testid":o,children:t}),rr=({children:t,classNameExt:s,qa:r,subject:o})=>e.jsx("div",{className:F("cds-subject-filter-switch",s&&s),"data-testid":r,"data-subject":Fe(o),children:t}),nr=({children:t,qa:s})=>e.jsx("div",{className:"cds-subject-filter-switch cds-subject-filter-switch--all","data-testid":s,children:t}),pe=Object.assign(rr,{All:nr});pe.displayName="SubjectFilterSwitch";pe.All.displayName="SubjectFilterSwitch.All";const or=({children:t,classNameExt:s,qa:r})=>e.jsxs("button",{type:"button",className:F("cds-subject-filter-toggle",s&&s),"data-testid":r,children:[e.jsx("ul",{className:"cds-subject-filter-toggle__list",children:t}),e.jsx("div",{className:"cds-subject-filter-toggle__caret",children:e.jsx(Re,{icon:Tt,size:Ce.SMALL})}),e.jsx("div",{className:"cds-subject-filter-toggle__icon",children:e.jsx(Re,{icon:It,size:Ce.MEDIUM})})]}),ir=({children:t,qa:s,isActive:r,subject:o})=>{const n=["cds-subject-filter-toggle__subject"];return r&&n.push("cds-subject-filter-toggle__subject--active"),e.jsx("li",{className:n.join(" "),"data-subject":Fe(o),"data-testid":s,children:t})},fe=Object.assign(or,{Subject:ir});fe.displayName="SubjectFilterToggle";fe.Subject.displayName="SubjectFilterToggle.Subject";const ft=be.forwardRef(({ariaLabel:t,body:s,children:r,classNameExt:o,ctaLabel:n,href:a,illustration:c,onCtaClick:i,qa:l,rel:d,target:h,title:p},S)=>{const f=d??(h==="_blank"?"noreferrer noopener":void 0);return e.jsx(v,{qa:l,classNameExt:F("cds-ui-promo-widget",o),children:e.jsx(v.Body,{isVerticallyCentred:!0,children:e.jsxs("div",{className:"cds-ui-promo-widget__content",children:[c!=null&&c!==!1&&e.jsx("div",{className:"cds-ui-promo-widget__art","aria-hidden":"true",children:c}),e.jsxs("div",{className:"cds-ui-promo-widget__copy",children:[e.jsx(v.Title,{children:p}),e.jsx(W.Paragraph,{classNameExt:"cds-ui-promo-widget__body",children:s}),r,e.jsx(me,{ref:S,as:"a",href:a,target:h,rel:f,variant:"secondary",size:"small",icon:vt,reversed:!0,onClick:i,"aria-label":t??n,qa:l!==void 0?`${l}-cta`:void 0,classNameExt:"cds-ui-promo-widget__cta",children:n})]})]})})})});ft.displayName="PromoWidget";const ar=t=>`/learn/my-path/study-groups/${t.studyGroupId}/nuggets/${t.nuggetId}/`,cr=t=>{switch(t.assignmentType){case"essay":return e.jsx(m,{id:"misc-helpers-essay",defaultMessage:"Task"});case"nuggets":return t.totalNuggets>1?e.jsx(m,{id:"misc-helpers-nuggets",defaultMessage:"{totalNuggets} Nuggets",values:{totalNuggets:t.totalNuggets}}):e.jsx(m,{id:"misc-helpers-nugget",defaultMessage:"Nugget"});default:return t.assignmentType}},lr=(t,s=1/0)=>{const r=t.filter(c=>Math.abs(ae(c.deadline))<=s).sort((c,i)=>c.deadline<i.deadline?-1:1),o=r.filter(c=>ae(c.deadline)===0),n=r.filter(c=>ae(c.deadline)<0),a=r.filter(c=>ae(c.deadline)>0);return[...o,...n,...a]},dr=()=>{const{formatMessage:t}=Q(),s=Kt(),r=u.useCallback(async(i,l)=>{const d=await Jt(i,s,l);return lr(d)},[s]),{data:o,loading:n,error:a,load:c}=At(r,!0);return a?e.jsx(ue,{children:e.jsx(nt,{action:c,error:t({id:"learn-assignments-could-not-load-due",defaultMessage:"Could not load due assignments"})})}
1):n?e.jsx(ue,{children:e.jsx(Le,{type:"widget"})}):o?.length?e.jsx(ue,{children:e.jsxs(Y,{children:[e.jsxs(Y.Header,{children:[e.jsx(Y.HeaderSubject,{children:t({id:"learn-assignments-due-list-subject",defaultMessage:"Subject"})}),e.jsx(Y.HeaderType,{children:t({id:"learn-assignments-due-list-material",defaultMessage:"Material"})}),e.jsx(Y.HeaderDate,{children:t({id:"learn-assignments-due-list-due",defaultMessage:"Due"})})]}),e.jsx(Y.Body,{children:o.map((i,l)=>e.jsx(Mt,{"data-testid":"due-assignment-item",to:i.isLegacy?{pathname:ar(i),search:"modeOverride=assignment"}:{pathname:`/learn/my-path/assignments/${i.assignmentId}`},state:i.isLegacy?{reason:"assignment",viewLocation:"Homepage"}:void 0,children:e.jsxs(B,{children:[e.jsxs(B.Header,{children:[e.jsxs(e.Fragment,{children:[e.jsx(B.HeaderSubject,{assignmentSubject:i.subject,children:t({id:`label-subject-${i.subject}`,defaultMessage:i.subjectName})}),e.jsx(B.HeaderType,{children:cr(i)})]}),e.jsx(B.HeaderDate,{children:e.jsx(Zt,{dateTime:i.deadline,timeFormat:ts.RELATIVE_TODAY,relativeSurroundingDays:!0,includeTimeWithComma:!0,displayMode:es.SHORT_WITH_DAY})})]}),e.jsxs(B.Body,{children:[e.jsx(B.Title,{children:i.name}),e.jsxs(B.Description,{children:[e.jsx(ss,{allowedTypes:Lt,children:i.description}),i.progress>0&&e.jsxs(X,{children:[e.jsxs(X.Collection,{children:[e.jsx(ve,{percentage:i.progress,diameter:14,thickness:2,type:Ae.COMPLETION}),e.jsx(B.StatusLabel,{qa:"completion-count-label",children:i?.completion?.total&&i?.completion?.count?e.jsx(m,{id:"completion-count-label",defaultMessage:"{completed} of {total} completed",values:{completed:i.completion.count,total:i.completion.total}}):e.jsx(m,{id:"chart-percentage-label",defaultMessage:"{value}%",values:{value:Math.round(i.progress)}})})]}),!!i?.completion?.count&&e.jsx(X.Collection,{children:e.jsx(rs,{percentage:_t(i.completion.score),hasBar:!1,qa:"score-percentage"})})]})]}),i?.isOverdue&&e.jsx(B.Status,{qa:"item-status",children:e.jsxs(X,{qa:"item-group",children:[e.jsx(X.Collection,{children:e.jsxs(ns,{variant:is.WARNING,size:os.SMALL,qa:"overdue-icon",children:[e.jsx(as,{}),e.jsx(m,{id:"assignment-status-ended",defaultMessage:"Overdue"})]})}),e.jsx(X.Collection,{children:e.jsx(ms,{variant:ps.WARNING,children:e.jsx(W.Helper,{noMargin:!0,qa:"overdue-date",children:e.jsx(m,{id:"complete-by-date",defaultMessage:"Complete by {date}",values:{date:Pt(i?.closeAt)}})})})})]})})]})]})},`due-assignment-${l}`))})]})}):e.jsx(ue,{children:e.jsx(Qt,{children:e.jsx(W.Placeholder,{children:t({id:"learn-assignments-no-assignments-yet",defaultMessage:"No assignments yet!"})})})})},ue=({children:t})=>{const s=cs();return e.jsx(te.Col,{stackOrder:2,children:e.jsxs(ye,{qa:"rlp-due-assignments-panel",children:[e.jsxs(ye.Header,{children:[e.jsx(m,{id:"learn-assignments-due-assignments",defaultMessage:"Due Assignments"}),e.jsx(v.Help,{children:e.jsx(_e,{qa:"assignments-widget-info-button",label:e.jsx(m,{id:"help-tooltip-label",defaultMessage:"Help"}),placement:Ee.BOTTOM_END,triggerIcon:Pe.HELP,children:e.jsx(W.Lead,{noMargin:!0,children:e.jsx(m,{id:s?"my-path-due-assignments-widget-tooltip-content":"learn-assignments-widget-tooltip-content",defaultMessage:s?"Here you can find assignments that you haven’t completed yet. To help you stay focused, it only shows the ones that are currently due or that you’ve missed. Assignments will disappear from this list as you complete them. To see all your assignments, go to the Assignments page.":"Here you can find the assignments that you haven’t completed yet. To help you stay focused, it only shows you the ones that are due in the next 2 weeks or that you’ve missed in past 2 weeks. As you complete them they will disappear from this list. To see all your assignments go to the Assignments page."})})})})]}),e.jsx(ye.Body,{children:t})]})})},ur=()=>{const t=ot(),s=Et();return e.jsx(te.Col,{stackOrder:1,children:e.jsx(v,{qa:"rlp-streaks-widget",children:e.jsx(v.Body,{children:e.jsx(kt,{userid:t,accesstoken:s})})})})},hr=(t,s)=>[{icon:E.RLP_ORDERINGFACTOR_DIAGNOSTICASSESSMENT,header:{id:"rlp-help-diagnostic-assessment-heading",defaultMessage:"Diagnostic Assessment"},body:{id:"rlp-help-diagnostic-assessment-body",defaultMessage:"Answer these questions so we know your strengths and areas for improvement."}},{icon:E.RLP_ORDERINGFACTOR_SCHEMEOFWORK,header:t?{id:"rlp-help-set-by-heading-b2c",defaultMessage:"Set for you"}:{id:"rlp-help-set-by-heading",defaultMessage:"Set by Teacher"},body:t?{id:"rlp-help-set-by-body-b2c",defaultMessage:"You've been set these nuggets as they're important for you to study."}:{id:"rlp-help-set-by-body",defaultMessage:"Your teacher has chosen these nuggets as important for you to study."}},{icon:E.RLP_ORDERINGFACTOR_FAILUREADAPTATION,header:{id:"rlp-help-focus-heading",defaultMessage:"Focus on"},body:{id:"rlp-help-focus-body",defaultMessage:"Nuggets to fill the gaps in your knowledge and skills."}},...s?[{icon:E.RLP_ORDERINGFACTOR_STRETCHRECOMMENDATION,header:{id:"rlp-help-stretch-heading",defaultMessage:"Stretch with"},body:{id:"rlp-help-stretch-body",defaultMessage:"Nuggets to challenge and stretch 
1you within a topic of strength."}}]:[],{icon:E.RLP_ORDERINGFACTOR_SPACEDLEARNING,header:{id:"rlp-help-memory-boost-heading",defaultMessage:"Memory Boost"},body:{id:"rlp-help-memory-boost-body",defaultMessage:"It's time to revisit these nuggets to make sure you don't forget them."}}],gr=t=>{const s=it();return e.jsx(D,{children:hr(s,t.hasRlpFocusAndStretch).filter(r=>!s||!r.excludeForB2C).map(r=>e.jsxs(D.Item,{children:[e.jsx(D.Icon,{children:e.jsx(gt,{icon:r.icon})}),e.jsxs(D.Body,{children:[e.jsx(D.Title,{children:e.jsx(m,{id:r.header.id,defaultMessage:r.header.defaultMessage})}),e.jsx(D.Description,{children:e.jsx(m,{id:r.body.id,defaultMessage:r.body.defaultMessage})})]})]},r.header.id))})},mr=t=>.5*(1-Math.cos(Math.PI*t)),pr=500,jt=()=>"scrollBehavior"in document.documentElement.style,bt={_elementScroll:void 0,get elementScroll(){return this._elementScroll||(this._elementScroll=HTMLElement.prototype.scroll||HTMLElement.prototype.scrollTo||function(t,s){this.scrollLeft=t,this.scrollTop=s})},_elementScrollIntoView:void 0,get elementScrollIntoView(){return this._elementScrollIntoView||(this._elementScrollIntoView=HTMLElement.prototype.scrollIntoView)}},xt=t=>{[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach(r=>t(r))},yt=()=>{var t,s,r;return(r=(s=(t=window.performance)===null||t===void 0?void 0:t.now)===null||s===void 0?void 0:s.call(t))!==null&&r!==void 0?r:Date.now()},St=t=>{const r=(yt()-t.timeStamp)/(t.duration||pr);if(r>1){t.method(t.targetX,t.targetY),t.callback();return}const o=(t.timingFunc||mr)(r),n=t.startX+(t.targetX-t.startX)*o,a=t.startY+(t.targetY-t.startY)*o;t.method(n,a),t.rafId=requestAnimationFrame(()=>{St(t)})},je=t=>isFinite(t)?Number(t):0,Nt=t=>{const s=typeof t;return t!==null&&(s==="object"||s==="function")},wt=(t,s)=>{var r,o;const n=bt.elementScroll.bind(t);if(s.left===void 0&&s.top===void 0)return;const a=t.scrollLeft,c=t.scrollTop,i=je((r=s.left)!==null&&r!==void 0?r:a),l=je((o=s.top)!==null&&o!==void 0?o:c);if(s.behavior!=="smooth")return n(i,l);const d=()=>{window.removeEventListener("wheel",p),window.removeEventListener("touchmove",p)},h={timeStamp:yt(),duration:s.duration,startX:a,startY:c,targetX:i,targetY:l,rafId:0,method:n,timingFunc:s.timingFunc,callback:d},p=()=>{cancelAnimationFrame(h.rafId),d()};window.addEventListener("wheel",p,{passive:!0,once:!0}),window.addEventListener("touchmove",p,{passive:!0,once:!0}),St(h)},$e=(t,s)=>{const r=je(s.left||0)+t.scrollLeft,o=je(s.top||0)+t.scrollTop;return wt(t,{...s,left:r,top:o})},fr=t=>{jt()||xt(s=>s.scrollBy=function(){if(arguments.length===1){const a=arguments[0];if(!Nt(a))throw new TypeError("Failed to execute 'scrollBy' on 'Element': parameter 1 ('options') is not an object.");return $e(this,{...a,...t})}const o=Number(arguments[0]),n=Number(arguments[1]);return $e(this,{left:o,top:n})})},jr=t=>{switch(t){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},br=(t,s,r)=>{let[o,n]=[t.block||"start",t.inline||"nearest"],a=0;switch(r||(a^=2),s){case 0:a=a>>1|(a&1)<<1,[o,n]=[n,o];break;case 1:case 3:a^=1;break;case 4:a^=2;break}return[o,n].map((c,i)=>{switch(c){case"center":return 1;case"nearest":return 0;default:{const l=a>>i&1;return c==="start"==!l?2:3}}})},he=(t,s,r,o,n,a,c,i)=>a<t&&c>s||a>t&&c<s?0:a<=t&&i<=r||c>=s&&i>=r?a-t-o:c>s&&i<r||a<t&&i>r?c-s+n:0,Ye=t=>t!=="visible"&&t!=="clip",xr=t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch{return null}},yr=t=>{const s=xr(t);return s?s.clientHeight<t.scrollHeight||s.clientWidth<t.scrollWidth:!1},Ne=(t,s)=>t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth?Ye(s.overflowY)||Ye(s.overflowX)||yr(t):!1,Xe=t=>{const s=t.parentNode;return s!==null&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s.host:s},ze=(t,s)=>t<-s?-s:t>s?s:t,Sr=t=>t in document.documentElement.style,Nr=()=>["scroll-margin","scroll-snap-margin"].filter(Sr)[0],wr=(t,s)=>{const{top:r,right:o,bottom:n,left:a}=t.getBoundingClientRect(),[c,i,l,d]=["top","right","bottom","left"].map(h=>{const p=Nr(),S=s.getPropertyValue(`${p}-${h}`);return parseInt(S,10)||0});return[r-c,o+i,n+l,a-d]},Rr=(t,s)=>{if(t.isConnected===!1)return;const r=document.scrollingElement||document.documentElement,o=[],n=getComputedStyle(document.documentElement);for(let j=Xe(t);j!==null;j=Xe(j)){if(j===r){o.push(j);break}const C=getComputedStyle(j);if(!(j===document.body&&Ne(j,C)&&!Ne(document.documentElement,n))&&(Ne(j,C)&&o.push(j),C.position==="fixed"))break}
1const a=window.visualViewport?window.visualViewport.width:innerWidth,c=window.visualViewport?window.visualViewport.height:innerHeight,i=window.scrollX||window.pageXOffset,l=window.scrollY||window.pageYOffset,d=getComputedStyle(t),[h,p,S,f]=wr(t,d),g=S-h,y=p-f,I=jr(d.writingMode||d.getPropertyValue("-webkit-writing-mode")||d.getPropertyValue("-ms-writing-mode")),N=d.direction!=="rtl",[b,A]=br(s,I,N);let x=(()=>{switch(A){case 1:return h+g/2;case 2:case 0:return h;case 3:return S}})(),w=(()=>{switch(b){case 1:return f+y/2;case 3:return p;case 2:case 0:return f}})();const H=[];o.forEach(j=>{const{height:C,width:R,top:M,right:V,bottom:G,left:U}=j.getBoundingClientRect(),q=getComputedStyle(j),$=parseInt(q.borderLeftWidth,10),se=parseInt(q.borderTopWidth,10),re=parseInt(q.borderRightWidth,10),ne=parseInt(q.borderBottomWidth,10);let L=0,_=0;const oe="offsetWidth"in j?j.offsetWidth-j.clientWidth-$-re:0,ie="offsetHeight"in j?j.offsetHeight-j.clientHeight-se-ne:0;if(r===j){switch(A){case 2:{L=x;break}case 3:{L=x-c;break}case 1:{L=x-c/2;break}case 0:{L=he(l,l+c,c,se,ne,l+x,l+x+g,g);break}}switch(b){case 2:{_=w;break}case 3:{_=w-a;break}case 1:{_=w-a/2;break}case 0:{_=he(i,i+a,a,$,re,i+w,i+w+y,y);break}}L+=l,_+=i}else{switch(A){case 2:{L=x-M-se;break}case 3:{L=x-G+ne+ie;break}case 1:{L=x-(M+C/2)+ie/2;break}case 0:{L=he(M,G,C,se,ne+ie,x,x+g,g);break}}switch(b){case 2:{_=w-U-$;break}case 3:{_=w-V+re+oe;break}case 1:{_=w-(U+R/2)+oe/2;break}case 0:{_=he(U,V,R,$,re+oe,w,w+y,y);break}}const{scrollLeft:De,scrollTop:He}=j;L=ze(He+L,j.scrollHeight-C+ie),_=ze(De+_,j.scrollWidth-R+oe),x+=He-L,w+=De-_}H.push(()=>wt(j,{...s,top:L,left:_}))}),H.forEach(j=>j())},Cr=t=>{if(jt())return;const s=bt.elementScrollIntoView;xt(r=>r.scrollIntoView=function(){const n=arguments[0];return arguments.length===1&&Nt(n)?Rr(this,{...n,...t}):s.apply(this,arguments)})},Tr=(t,s)=>{ke.track(Oe.RLPNuggetStarted,{[k.CourseId]:t.courseId,[k.CourseName]:t.courseName,[k.NuggetId]:t.nuggetId,[k.NuggetName]:t.nuggetName,[k.CourseSubject]:t.subjectName,[k.CourseLevel]:t.levelName,[k.RLPReason]:t.originalType,[k.NuggetIndex]:s})};function Ir(t){const s=Q(),o=u.useContext(dt).deviceType,{nugget:n,isActive:a,onClick:c,index:i}=t,l=at(),d=()=>{Tr(n,i),l(`${n.url}?startedFrom=${n.orderingFactorType}`,{state:{reason:n.orderingFactorType,viewLocation:"Homepage"}})},h=u.useRef(),p=u.useRef(null);return Cr(),u.useEffect(()=>{a&&p.current&&(p.current.focus({preventScroll:!0}),h.current&&(o==="desktop"?h.current.scrollIntoView({inline:"nearest",block:"nearest",behavior:"smooth"}):h.current.scrollIntoView({inline:"center",block:"nearest",behavior:"auto"})))},[a,p,o]),e.jsx(O.Item,{children:e.jsxs(ee,{isActive:a,onClick:c,ref:h,children:[e.jsx(_e,{label:"Nugget information",triggerIcon:Pe.INFO,placement:Ee.BOTTOM_END,qa:"nugget-info-button-open",children:e.jsxs(T,{subject:n.subjectName,children:[e.jsxs(T.Item,{children:[e.jsx(T.Title,{children:e.jsx(m,{id:"rlp-item-info-course",defaultMessage:"Course"})}),e.jsx(T.Description,{children:n.courseName})]}),e.jsxs(T.Item,{children:[e.jsx(T.Title,{children:e.jsx(m,{id:"rlp-item-info-topic",defaultMessage:"Topic"})}),e.jsx(T.Description,{children:n.strandName})]}),e.jsxs(T.Item,{children:[e.jsx(T.Title,{children:e.jsx(m,{id:"rlp-item-info-completion",defaultMessage:"Completion"})}),e.jsx(T.Description,{children:n.completion.text})]}),e.jsxs(T.Item,{children:[e.jsx(T.Title,{children:e.jsx(m,{id:"rlp-item-info-last-score",defaultMessage:"Last Score"})}),e.jsx(T.Description,{children:n.lastScore.text})]}),e.jsxs(T.Item,{children:[e.jsx(T.Title,{children:e.jsx(m,{id:"rlp-item-info-best-score",defaultMessage:"Best Score"})}),e.jsx(T.Description,{children:n.bestScore.text})]})]})}),e.jsxs(ee.Figure,{completionPercentage:n.completion.number,scorePercentage:n.lastScore.number,children:[e.jsx(ls,{item:{subject:{name:n.subjectName},iconCode:n.iconCode,iconUrl:n.iconUrl}}),vr(n.type)?null:e.jsx(ys,{label:s.formatMessage(Mr(n.type,n.originalType)),position:Ss.N,children:e.jsx(gt,{icon:Ar(n.type,n.originalType)})})]}),e.jsx(ds,{subjectName:n.subjectName}),e.jsx(ee.Title,{children:n.nuggetName}),e.jsx(me,{size:"small",variant:"primary",aria:s.formatMessage({id:"rlp-item-btn-start-aria-label",defaultMessage:`${n.nuggetName}
1 start now`},{name:n.nuggetName}),ref:p,onClick:d,qa:"start-nugget-button",children:e.jsx(m,{id:"rlp-item-btn-start",defaultMessage:"Start"})})]})})}const vr=t=>t==="rlp-orderingfactor-courseorder",Ar=(t,s="")=>{if(s==="SchemeOfWork"&&t==="rlp-orderingfactor-diagnosticassessment")return E.RLP_ORDERINGFACTOR_SCHEMEOFWORK;switch(t){case"rlp-orderingfactor-assignment":return E.RLP_ORDERINGFACTOR_ASSIGNMENT;case"rlp-orderingfactor-diagnosticassessment":return E.RLP_ORDERINGFACTOR_DIAGNOSTICASSESSMENT;case"rlp-orderingfactor-schemeofwork":return E.RLP_ORDERINGFACTOR_SCHEMEOFWORK;case"rlp-orderingfactor-spacedlearning":return E.RLP_ORDERINGFACTOR_SPACEDLEARNING;case"rlp-orderingfactor-focusrecommendation":return E.RLP_ORDERINGFACTOR_FAILUREADAPTATION;case"rlp-orderingfactor-stretchrecommendation":return E.RLP_ORDERINGFACTOR_STRETCHRECOMMENDATION;default:return E.RLP_ORDERINGFACTOR_FAILUREADAPTATION}},Mr=(t,s="")=>s==="SchemeOfWork"&&t==="rlp-orderingfactor-diagnosticassessment"?{id:"rlp-orderingfactor-schemeofwork",defaultMessage:"Set by Teacher"}:{id:t,defaultMessage:t},Lr=t=>{const s=t.courses[0].subject.name,r=t.courses[0].level.name,o=t.courses[0].name,n=t.courses[0].c
1ourseId,a=t.nugget.nuggetId,c=t.courses[0]?.strands[0]?.name||"",i=t.orderingFactorMainContributor.orderingFactorOriginalType,l=t.orderingFactorMainContributor.orderingFactorType,d=we(t.lastResult?.percentComplete),h=we(t.activity?.lastAttempt?.percentScore),p=we(t.activity?.bestAttempt?.percentScore),S=t.nugget.name,f=t.nugget.nuggetId,g=`/learn/my-path/study-groups/${t.courses[0].studyGroupIds[0].studyGroupId}/nuggets/${t.nugget.nuggetId}/`,y=t.orderingFactorMainContributor.orderingFactorType,I=t.courses[0]?.icon?.iconCode,N=t.courses[0]?.icon?.url;return{id:a,subjectName:s,levelName:r,courseId:n,courseName:o,strandName:c,completion:d,lastScore:h,bestScore:p,nuggetName:S,nuggetId:f,url:g,type:y,iconCode:I,iconUrl:N,originalType:i,orderingFactorType:l}},we=t=>{if(t){const s=_r(t);return{number:s,text:`${s}%`}}return{number:0,text:"N/A"}},_r=t=>Math.round(t/100),Pr=t=>{const r=ct()?.firstName,o=Q(),[n]=u.useState(t.isDone);if(n)return null;const a=Ke(Or),c=Ke(Fr),i=r&&r.length?o.formatMessage({id:"rlp-cai-addressee-with-name"},{user:r}):o.formatMessage({id:"rlp-cai-addressee-without-name"});return e.jsxs(P,{isDone:t.isDone,children:[e.jsxs(P.ConsoleSection,{children:[e.jsx(P.Verb,{children:e.jsx(m,{id:"rlp-cai-heading-1",defaultMessage:"Analysing"})}),e.jsx(P.Subjects,{children:a.map(l=>e.jsx(P.Subject,{children:e.jsx(m,{id:l,values:{user:i}})},l))})]},"analysing"),e.jsxs(P.ConsoleSection,{children:[e.jsx(P.Verb,{children:e.jsx(m,{id:"rlp-cai-heading-2",defaultMessage:"Optimising"})}),e.jsx(P.Subjects,{children:c.map(l=>e.jsx(P.Subject,{children:e.jsx(m,{id:l,values:{user:i}})},l))})]},"optimising")]})},Er=u.memo(Pr,(t,s)=>t.isDone===s.isDone),kr=3,Ke=t=>{const s=[];for(;s.length<kr;){const r=Math.floor(Math.random()*(t.length-1));s.indexOf(r)===-1&&s.push(r)}return s.map(r=>t[r])},Or=["rlp-cai-analysing-phrase1","rlp-cai-analysing-phrase2","rlp-cai-analysing-phrase3","rlp-cai-analysing-phrase4","rlp-cai-analysing-phrase5","rlp-cai-optimising-phrase2","rlp-cai-optimising-phrase3","rlp-cai-optimising-phrase4","rlp-cai-optimising-phrase5","rlp-cai-optimising-phrase6","rlp-cai-analysing-phrase11","rlp-cai-analysing-phrase12"],Fr=["rlp-cai-analysing-phrase2","rlp-cai-optimising-phrase2","rlp-cai-optimising-phrase3","rlp-cai-optimising-phrase4","rlp-cai-optimising-phrase5","rlp-cai-optimising-phrase6","rlp-cai-analysing-phrase11","rlp-cai-optimising-phrase8"],Dr=(t,s,r,o)=>{const n=o.current;u.useEffect(()=>{if(n){const a=c=>{(c.key==="ArrowRight"||c.key==="ArrowLeft")&&c.preventDefault()};return n?.addEventListener("keydown",a),()=>n?.removeEventListener("keydown",a)}},[n]),u.useEffect(()=>{const a=c=>{if(c.key!=="ArrowRight"&&c.key!=="ArrowLeft"||t===null||!s)return;c.preventDefault();const i=c.key==="ArrowRight"?1:-1,l=t+i;l>=0&&l<s&&r(l)};return document.addEventListener("keyup",a),()=>document.removeEventListener("keyup",a)},[t,r,s])},Je=150,Hr=t=>{const s=u.useRef(null),[r,o]=u.useState("none");fr();const n=l=>{const d=t.current;if(!d)return;let h=284*(l==="left"?-1:1);const p=d.scrollWidth,f=d.scrollLeft+h;h<0&&f<Je&&(h=h+f/150),h>0&&p-f<Je&&(h=h+p-f),t.current&&t.current.scrollBy({behavior:"smooth",left:h})},a=u.useCallback(()=>{if(t?.current&&s?.current){const l=s.current.getBoundingClientRect(),d=t.current.getBoundingClientRect();l.left<d.left&&l.right>d.right?o("both"):l.left<d.left?o("left"):l.right>d.right?o("right"):o("none")}},[t]);return{scrub:n,disableScrubLeft:r!=="both"&&r!=="left",disableScrubRight:r!=="both"&&r!=="right",determineOverflow:a,scrollContent:s}},Qe=3400,Ze=1e3;var z=(t=>(t[t.CAI_SHOWING=0]="CAI_SHOWING",t[t.COMPLETE=1]="COMPLETE",t[t.NUGGET_LIST_PHASE_OUT=2]="NUGGET_LIST_PHASE_OUT",t))(z||{});const Br=(t,s)=>{const[r,o]=u.useState(0),n=u.useRef(!0),a=u.useRef(null),[c,i]=u.useState(void 0),[l,d]=u.useState(!1);return u.useEffect(()=>{if(n.current!==t){if(t){o(2),a.current=setTimeout(()=>{d(!1),o(0)},Ze),n.current=!0;return}a.current&&clearTimeout(a.current),r===2&&(d(!1),setTimeout(()=>{d(!0)},Qe)),o(1),n.current=!1}},[t,r]),u.useEffect(()=>{r===0&&setTimeout(()=>{d(!0)},Qe)},[r]),u.useEffect(()=>{if(s||!t){i(s);return}const h=setTimeout(()=>{i(s)},Ze);return()=>clearTimeout(h)},[s,t]),{transitionPhase:l?r:0,nuggetsWithTransitionDelay:c}},et=70,Gr=(t,s,r)=>{const[o,n]=u.useState(!1),{deviceType:a}=u.useContext(dt),c=()=>{n(!0),setTimeout(()=>{n(!1)},500)};return u.useEffect(()=>{const i=t.current;if(!i||o||a==="desktop")return;const l=()=>{const p=s.current?.children;if(!i)return;const{left:S,right:f}=i.getBoundingClientRect(),{scrollLeft:g,scrollWidth:y,clientWidth:I}=i;if(p){if(g<et){r(0);return}if(y-I-g<et){r(Array.from(p).length-1);return}const N=Array.from(p).map(A=>{const{left:x,right:w}=A.getBoundingClientRect();return Math.abs(tt(S,f)-tt(x,w))});let b=0;
1N.forEach((A,x)=>{A<N[b]&&(b=x)}),r(b)}};let d;const h=()=>{window.clearTimeout(d),d=setTimeout(()=>{l()},66)};return i.addEventListener("scroll",h),()=>i.removeEventListener("scroll",h)},[t,r,s,o,a]),{pauseScrollEvents:c}},tt=(t,s)=>(t+s)/2,Wr=t=>{const{userId:s,filteredSubjects:r,auth:o,hideSubjectFilters:n}=t,a=Object.keys(r).filter(V=>r[V].selected);let i=Ot(o,"learn-home","rlpMode")||null||"default";const[l,d]=u.useState(null),h=Bt(),p=Ft(h),{rPMode:S}=u.useContext(Dt),f=u.useRef(null),g=K(o,"focus-and-stretch","rlp");!p&&S&&(i=S);const{loading:y,error:I,data:N}=mt(bs,{variables:{input:{userId:s,subjectIds:n?void 0:a,mode:i,focusAndStretchInjectionEnabled:g,studyGroupStatus:"current",courseTypes:["standard"],offset:0,limit:10}},context:{clientName:"roentgen"},fetchPolicy:"no-cache"});u.useEffect(()=>{N?.nuggetPath?.nuggets&&d(0)},[N,d]),Dr(l,N?.nuggetPath?.nuggets?.length,d,f);const b=N?.nuggetPath?.nuggets,{scrub:A,determineOverflow:x,disableScrubLeft:w,disableScrubRight:H,scrollContent:j}=Hr(f),{transitionPhase:C,nuggetsWithTransitionDelay:R}=Br(y,b);u.useEffect(()=>{C===z.COMPLETE&&x()},[x,C]);const{pauseScrollEvents:M}=Gr(f,j,d);return I||!y&&(!b||b.length===0)?e.jsx(O,{children:e.jsx(O.Content,{children:e.jsx(W.Placeholder,{children:e.jsx(m,{id:a.length===0?"rlp-no-subjects":"rlp-no-nuggets",defaultMessage:"No recommended nuggets right now"})})})}):e.jsxs(O,{children:[C!==z.NUGGET_LIST_PHASE_OUT&&e.jsx(Er,{isDone:C===z.COMPLETE}),e.jsx(O.Content,{isHidden:C===z.NUGGET_LIST_PHASE_OUT,onScroll:Ht.debounce(x,100),ref:f,contentRef:j,children:R&&C!==z.CAI_SHOWING&&R.length>0&&R.map((V,G)=>{const U=Lr(V);return e.jsx(Ir,{index:G,nugget:U,isActive:G===l,onClick:()=>{M(),d(G)}},G)})}),e.jsxs(O.Controls,{disabled:y,children:[e.jsx(O.Control,{qa:"scrub-prev",onClick:()=>A("left"),disabled:w,direction:"left",children:e.jsx(m,{id:"scrub-left",defaultMessage:"Scrub Left"})}),e.jsx(O.Control,{qa:"scrub-next",onClick:()=>A("right"),disabled:H,direction:"right",children:e.jsx(m,{id:"scrub-right",defaultMessage:"Scrub Right"})})]})]})},Vr=(t,s,r)=>{ke.track(Oe.RLPFilterApplied,{[k.SubjectsSelected]:t||"N/A",[k.SubjectsDeselected]:s||"N/A",[k.SubjectsChanged]:r||"N/A"})},Ur=t=>{const{subjects:s,subjectFilter:r,applyFilter:o}=t,[n,a]=u.useState(r),[c,i]=u.useState(r);u.useEffect(()=>{a(r),i(r)},[r]);const l=()=>{i(r)},d=g=>{i(y=>({...y,[g]:{...y[g],selected:!y[g].selected}}))},h=g=>{const y=Object.keys(g).filter(b=>!!g[b]?.selected).map(b=>g[b]?.name).join(";"),I=Object.keys(g).filter(b=>!g[b]?.selected).map(b=>g[b]?.name).join(";"),N=Object.keys(g).filter(b=>g[b]?.selected!==n[b]?.selected).map(b=>g[b]?.name).join(";");o(c),Vr(y,I,N)},p=u.useMemo(()=>s.every(g=>!!c[g.labelId]?.selected),[s,c]),S=u.useMemo(()=>!s.some(g=>c[g.labelId]?.selected===!0),[s,c]),f=u.useCallback(()=>{const g={...c};s.forEach(y=>{g[y.labelId]={...g[y.labelId],selected:!p}}),i(g)},[c,s,p]);return e.jsxs(Te,{onToggle:l,alignEnd:!0,itemSelector:"label > input",children:[e.jsx(Te.Toggle,{children:e.jsx(fe,{children:s.map(g=>e.jsx(fe.Subject,{subject:g.name,isActive:!!c[g.labelId]?.selected,children:e.jsx(ut,{subjectName:g.name})},g.name))})}),e.jsx(qr,{subjects:s,temporarySubjectFilter:c,areAllSubjectsSelected:p,isApplyDisabled:S,toggleSubject:d,rlpFilterApplied:h,toggleAllSubjects:f})]})};function qr(t){const{subjects:s,temporarySubjectFilter:r,areAllSubjectsSelected:o,isApplyDisabled:n,toggleSubject:a,rlpFilterApplied:c,toggleAllSubjects:i}=t;return e.jsxs(Te.Content,{qa:"subjects-dropdown-content",children:[e.jsx(us,{children:e.jsx(m,{id:"rlp-filter-heading",defaultMessage:"Subjects"})}),e.jsxs(xe,{children:[s.length>0&&e.jsx(xe.Item,{children:e.jsx(pe.All,{children:e.jsxs(ce,{qa:"rlp-filter-all-subjects-toggle",children:[e.jsx("input",{type:"checkbox",disabled:s.length===0,checked:o,onChange:i,"data-testid":"all-subjects-toggle-checkbox"}),e.jsx(ce.Label,{children:e.jsx(m,{id:"rlp-filter-all-subjects-toggle",defaultMessage:"All Subjects"})})]})})}),s.map((l,d)=>e.jsx(xe.Item,{children:e.jsx(pe,{subject:l.name,children:e.jsxs(ce,{children:[e.jsx("input",{type:"checkbox",disabled:!1,checked:!!r[l.labelId]?.selected,onChange:()=>a(l.labelId),"data-testid":"subject-toggle-checkbox"}),e.jsx(ce.Label,{children:e.jsx(ut,{subjectName:l.name})})]})})},d))]}),e.jsxs(Se,{children:[e.jsx(Se.Btn,{type:"button",variant:"default",size:"small",onClick:()=>{},onKeyDown:l=>{l.key==="Tab"&&l.stopPropagation()},children:e.jsx(m,{id:"btn-cancel",defaultMessage:"Cancel"})}),e.jsx(Se.Btn,{type:"button",variant:"secondary",size:"small",onClick:()=>{n||c(r)}
1,qa:"subject-filter-apply-button",disabled:n,children:e.jsx(m,{id:"rlp-filter-btn-apply",defaultMessage:"Apply"})})]})]})}const $r=t=>{const r=ct()?.firstName,o=lt(),n=Gt(o),{subjectFilterMap:a,setSubjectFilterMap:c}=hs(),[i,l]=u.useState(!1),d=K(o,"learn-home","hideSubjectFilter"),h=K(o,"focus-and-stretch","rlp"),{loading:p,error:S,data:f,refetch:g}=mt(xs,{context:{clientName:"roentgen"},variables:{input:{userId:n,courseTypes:["standard"]}},fetchPolicy:"network-only",skip:!!d}),y=u.useMemo(()=>f?.userSubjects?.subjects?.slice().sort((I,N)=>I.name.toLowerCase()<N.name.toLowerCase()?-1:1),[f]);if(u.useEffect(()=>{if(f&&f.userSubjects){const I={...a};let N=!1;if(f.userSubjects.subjects.forEach(x=>{I[x.labelId]===void 0&&(I[x.labelId]={name:x.name,selected:!0},N=!0)}),!(f.userSubjects.subjects.map(x=>x.labelId).sort().toString()===Object.keys(a).sort().toString())){const x=f.userSubjects.subjects.reduce((w,H)=>(w[H.labelId]={name:H.name,selected:!0},w),{});c(x)}N&&c(I)}},[f]),S){if(i)throw pt(S,"loading Recommended Path nuggets"),S;g(),l(!0)}return e.jsx(sr,{isFullHeight:t.isFullHeight,qa:"rlp-recommended-path-widget",children:e.jsxs(v,{children:[e.jsxs(v.Header,{children:[e.jsxs(v.Title,{isCentred:!0,children:[e.jsx(Xr,{userName:r}),e.jsx(v.Help,{children:e.jsxs(_e,{label:e.jsx(m,{id:"help-tooltip-label",defaultMessage:"Help"}),placement:Ee.BOTTOM_END,triggerIcon:Pe.HELP,qa:"recommended-path-info-button",children:[e.jsx(W.Lead,{children:e.jsx(m,{id:"rlp-help-opening",defaultMessage:"Here are the nuggets that CENTURY thinks you should study next based on how you learn best and what you've already studied:"})}),e.jsx(gr,{hasRlpFocusAndStretch:h})]})})]}),e.jsx(v.Controls,{children:!p&&f&&!d&&e.jsx(Ur,{subjects:y||[],subjectFilter:a,applyFilter:c})})]}),!p&&(d||f?.userSubjects.subjects.length===Object.keys(a).length)&&e.jsx(v.Body,{children:e.jsx(Wr,{hideSubjectFilters:d,auth:o,userId:n,filteredSubjects:a})})]})})},Yr=fs($r),Xr=t=>{const{deviceType:s}=ht(),{userName:r}=t;return!r||r.length===0?s==="phone"?e.jsx(m,{id:"main-menu-learn-my-path",defaultMessage:"My Path"}):e.jsx(m,{id:"rlp-scrubber-heading-without-name",defaultMessage:"My Recommended Path"}):s==="phone"?e.jsx(m,{id:"main-menu-learn-my-path",defaultMessage:"My Path"}):e.jsx(m,{id:"rlp-scrubber-heading-with-name",defaultMessage:`${r}'s Recommended Path`,values:{user:r}})};function zr(t){const s=Wt("/users/smart-assessments/me");return Vt({url:s,token:t}).catch(r=>{throw Ut(r?.message),r})}const ge=t=>{const{children:s,hasOneTitle:r}=t;return e.jsx(te.Col,{stackOrder:1,children:e.jsxs(v,{qa:"rlp-focus-and-stretch-widget",children:[r&&e.jsx(v.Header,{children:e.jsx(v.Title,{isCentred:!0,children:e.jsx(m,{id:"rlp-focus-and-stretch-header",defaultMessage:"Focus and Stretch"})})}),e.jsx(v.Body,{isScrollable:!0,children:s})]})})},st="my-path",rt="Homepage",Kr=()=>{const[t,s]=u.useState(!1),r=ot(),o=Ns(r),{data:n,loading:a,error:c,refetch:i}=o,{formatMessage:l}=Q();if(c){if(t)return pt(c,"loading Focus and Stretch widget on my-path page"),e.jsx(ge,{hasOneTitle:!0,children:e.jsx(nt,{action:()=>i(),error:l({id:"could-not-load-rlp-focus-and-stretch",defaultMessage:"Couldn't load Focus and Stretch Nuggets"})})});i(),s(!0)}return a?e.jsx(ge,{hasOneTitle:!0,children:e.jsx(Ie,{children:e.jsx(Le,{type:"widget"})})}):!n?.focusAndStretch?.focus?.length&&!n?.focusAndStretch?.stretch?.length&&!a||!n?.focusAndStretch?e.jsx(ge,{hasOneTitle:!0,children:e.jsx(Ie,{children:e.jsx(W.Placeholder,{children:e.jsx(m,{id:"no-focus-and-stretch-data-message",defaultMessage:"Sorry, there has not been enough activity for this yet"})})})}):e.jsx(ge,{hasOneTitle:!1,children:e.jsxs(J,{children:[e.jsxs(J.Col,{xs:12,md:6,children:[e.jsx("h4",{style:{minHeight:"20%"},children:e.jsx(m,{id:"kt-focus-header",defaultMessage:"Focus on to Improve"})}),n?.focusAndStretch?.focus.length>0?e.jsx(Ue,{FocusStretchNuggetsList:n?.focusAndStretch?.focus,mode:qe.FOCUS,pathArea:st,enableNuggetLink:!0,viewLocation:rt}):e.jsx(W.Placeholder,{children:e.jsx(m,{id:"no-focus-and-stretch-data-message",defaultMessage:"Sorry, there has not been enough activity for this yet"})})]}),e.jsxs(J.Col,{xs:12,md:6,children:[e.jsx("h4",{style:{minHeight:"20%"},children:e.jsx(m,{id:"kt-stretch-header",defaultMessage:"Stretch With"})}
1),n?.focusAndStretch?.stretch?.length>0?e.jsx(Ue,{FocusStretchNuggetsList:n?.focusAndStretch?.stretch,mode:qe.STRETCH,pathArea:st,enableNuggetLink:!0,viewLocation:rt}):e.jsx(W.Placeholder,{children:e.jsx(m,{id:"no-focus-and-stretch-data-message",defaultMessage:"Sorry, there has not been enough activity for this yet"})})]})]})})},Jr=()=>{const t=Q(),{setRefreshTokenCookie:s}=ws(),r=()=>{ke.track(Oe.StudentMathsPrepWidgetGoToClicked,{[k.Source]:"student-widget"}),s()};return e.jsx(ft,{qa:"maths-prep-student-widget",title:e.jsx(m,{id:"rlp-maths-prep-widget-title",defaultMessage:"Maths Prep"}),body:e.jsx(m,{id:"rlp-maths-prep-widget-text",defaultMessage:"Practise real exam questions and get your written method marked instantly."}),ctaLabel:t.formatMessage({id:"rlp-maths-prep-widget-go-to-button",defaultMessage:"Start practising"}),ariaLabel:t.formatMessage({id:"rlp-maths-prep-widget-go-to-button-aria",defaultMessage:"Start practising (opens in a new tab)"}),href:Rs("student-widget"),target:"_blank",onCtaClick:r,illustration:e.jsx(Is,{ink:"gradient",hasEchoes:!0})})},jn=()=>{const t=lt(),s=qt(),r=gs(),o=K(t,"learn-dashboard","enableAchievements"),n=K(t,"focus-and-stretch","myPath"),a=Cs(),c=Ts(),i=K(t,"cognitive-message","isEnabled",!0)&&$t(t),l=Q(),d=u.useMemo(()=>Yt(t),[t]),[h,p]=u.useState(d?null:[]),[S,f]=u.useState(d),[g,y]=u.useState(!1),[I,N]=u.useState(1),[b,A]=u.useState(null),{deviceType:x}=ht(),w=at(),H=it();js("learn-my-path"),u.useEffect(()=>{s&&d&&b===null&&t.accessToken&&Xt(s,t.accessToken).then(R=>{A(!R.length)})},[s,t.accessToken,d,b]),u.useEffect(()=>{!h&&d&&t&&(f(!0),y(!1),zr(t.accessToken).then(R=>p(R.filter(M=>M.status.status!=="Completed"))).catch(()=>y(!0)).finally(()=>f(!1)))},[h,d,t,I]);const j=u.useMemo(()=>e.jsx(Yr,{isFullHeight:!r&&!o&&!n}),[r,o,n]);if(!t.accessTokenData)return null;if(d&&(S||b===null))return e.jsx(Le,{type:"fullpage"});const C=d?g?e.jsx(Z,{qa:"rlp--assessments",children:e.jsx(Z.Body,{children:e.jsx(le,{children:e.jsx(le.Item,{children:e.jsxs(de,{children:[e.jsx(de.Title,{children:l.formatMessage({id:"generic-page-data-error",defaultMessage:"Some of the information on this page may not have loaded properly."})}),e.jsx(me,{variant:"secondary",onClick:()=>N(R=>++R),disabled:S,loading:S,children:l.formatMessage({id:"learn-assignments-button-retry",defaultMessage:"RETRY"})})]})})})})}):h&&h?.length>0?e.jsx(Z,{qa:"rlp--assessments",children:e.jsx(Z.Body,{children:e.jsx(le,{children:h?.map(R=>{const M=R.status.status==="Not Started",V=l.formatMessage({id:`assessments--${M?"start":"resume"}-btn-message`,defaultMessage:`{assessmentName} ${M?"start":"resume"} now`},{assessmentName:R.name}),G=l.formatMessage({id:`assessments--${M?"start":"resume"}-btn`,defaultMessage:`${M?"start":"resume"}`},{assessmentName:R.name}),U=`/learn/assessments/${R.smartAssessmentId}/${M?"start":""}`,q=$=>{$.preventDefault(),w(U)};return e.jsx(le.Item,{children:e.jsxs(de,{children:[e.jsx(de.Title,{children:R.name}),e.jsx(me,{as:"a",href:U,onClick:q,variant:"secondary",size:"small",type:"button",aria:V,children:G})]})},R.smartAssessmentId)})})})}):null:null;return d&&b&&!a?e.jsxs(Be,{children:[e.jsx(Ge,{children:e.jsx(Ie,{pageContentWidth:"large",children:C})}),e.jsx(We,{}),i&&e.jsx(Ve,{})]}):e.jsxs(Be,{children:[e.jsx(Ge,{children:e.jsxs(zt,{children:[!C&&j,!!C&&e.jsxs(J,{children:[e.jsx(J.Col,{xs:12,md:4,fillSpace:x==="desktop",fullHeightContent:x!=="desktop",children:C}),e.jsx(J.Col,{xs:12,md:8,children:j})]}),e.jsxs(te,{children:[r&&e.jsx(dr,{}),c&&e.jsx(Jr,{}),!a&&n&&!H&&e.jsx(Kr,{}),H&&o&&!n&&e.jsx(ur,{})]})]})}),e.jsx(We,{}),i&&e.jsx(Ve,{})]})};export{jn 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.