PageSourceSearch

https://edupark.ai/static/js/9373.4c42e6ef.chunk.js

js edupark.ai collected 2026-10-05 12:15:43 UTC 47,162 bytes, 291 lines download raw bytes

1"use strict";(globalThis.webpackChunkedupark_client||=[]).push([[9373],{79373(e,t,r){r.r(t),r.d(t,{default:()=>re});var s=r(58878),a=r(71813),n=r(1856),l=r(81618),i=r(81524),o=r(89500),d=r(73381),c=r(1060),u=r(41868),m=r(65852),x=r(19765);const p=x.J1`
2  query GetPracticePoolStats($moduleId: ID!) {
3    getPracticePoolStats(moduleId: $moduleId) {
4      success
5      sessionStats {
6        correct
7        attempted
8        accuracy
9      }
10      overallStats {
11        correct
12        attempted
13        accuracy
14      }
15      allTierProgress {
16        tier
17        currentStreak
18        bestStreak
19        completed
20        attempts
21        correct
22      }
23      masteryStatus
24      error
25    }
26  }
27`,b=x.J1`
28  query GetPracticePoolQuestion(
29    $moduleId: ID!
30    $difficultyTiers: [String!]
31  ) {
32    getPracticePoolQuestion(
33      moduleId: $moduleId
34      difficultyTiers: $difficultyTiers
35    ) {
36      success
37      question {
38        id
39        isLearningProblem
40        content {
41          type
42          description
43          image_src
44          image_alt
45          width
46          height
47          svg_content
48          svg_description
49          svg_caption
50          svg_width
51          svg_config
52          table_headers
53          table_rows
54          table_footnote
55          table_title
56          table_column_group {
57            label
58            columns
59          }
60        }
61        options {
62          label
63          text
64        }
65        difficultyTier
66        remainingCount
67        correctAnswer
68      }
69      tierProgress {
70        currentStreak
71        bestStreak
72        completed
73      }
74      error
75      # revoked-student-read-only: ENTITLEMENT_DENIED_CODE on a read-only
76      # refusal, null on any other failure — the ONLY signal a caller may
77      # key a refusal off (never the free-text 'error').
78      errorCode
79    }
80  }
81`,g=x.J1`
82  query GetPracticeAttemptHistory(
83    $moduleId: ID!
84    $limit: Int
85    $offset: Int
86    $difficultyTier: String
87    $isCorrect: Boolean
88  ) {
89    getPracticeAttemptHistory(
90      moduleId: $moduleId
91      limit: $limit
92      offset: $offset
93      difficultyTier: $difficultyTier
94      isCorrect: $isCorrect
95    ) {
96      success
97      attempts {
98        id
99        learningProblemId
100        selectedAnswer
101        isCorrect
102        timeSpentSeconds
103        difficultyTier
104        createdAt
105        problemContent {
106          type
107          description
108          image_src
109          image_alt
110          width
111          height
112          svg_content
113          svg_description
114          svg_caption
115          svg_width
116          svg_config
117          table_headers
118          table_rows
119          table_footnote
120          table_title
121          table_column_group {
122            label
123            columns
124          }
125        }
126        problemOptions {
127          label
128          text
129        }
130        correctAnswer
131        explanationBlocks
132      }
133      totalCount
134      error
135    }
136  }
137`,h=x.J1`
138  mutation SubmitPracticePoolAnswer(
139    $moduleId: ID!
140    $problemId: ID
141    $learningProblemId: ID
142    $selectedAnswer: String!
143    $timeSpentSeconds: Int
144  ) {
145    submitPracticePoolAnswer(
146      moduleId: $moduleId
147      problemId: $problemId
148      learningProblemId: $learningProblemId
149      selectedAnswer: $selectedAnswer
150      timeSpentSeconds: $timeSpentSeconds
151    ) {
152      success
153      # revoked-student-read-only: the read-only refusal is PAYLOAD-shaped
154      # ({ success: false, error, errorCode: ENTITLEMENT_DENIED_CODE }) —
155      # PracticePoolBlock keys the grant-stop treatment off 'errorCode'
156      # alone ('error' is selected below with the rest of the payload);
157      # a { success: false } with a null code is an ordinary failure.
158      errorCode
159      isCorrect
160      correctAnswer
161      explanation
162      explanationBlocks
163      visualExplanation {
164        steps {
165          stepNumber
166          title
167          instruction
168          highlights {
169            target
170            ranges {
171              start
172              end
173              text
174            }
175            answerIndex
176            color
177            style
178          }
179          concept
180          conceptExplanation
181          equationTransform {
182            before
183            operation
184            after
185            highlightParts {
186              before {
187                latex
188                color
189              }
190              after {
191                latex
192                color
193              }
194            }
195          }
196          learningModuleId
197          learningModules {
198            id
199            concept
200            title
201          }
202          keyFormulas {
203            name
204            latex
205            description
206          }
207          diagramHighlights {
208            elementId
209            action
210            color
211            annotation
212          }
213          diagramContent {
214            mode
215            svgContent
216            title
217          }
218          phase
219          givenInfo
220          findTarget
221          verificationCheck
222          mathWorkLines
223          eliminateAnswers
224          answerAnnotations {
225            answerIndex
226            label
227            type
228          }
229          passageSimplifications {
230            range {
231              start
232              end
233            }
234            simplified
235          }
236          passageCrossouts {
237            start
238            end
239          }
240          calloutTarget
241          highlightLegend {
242            color
243            label
244          }
245        }
246        wrongAnswerExplanations {
247          answerIndex
248          label
249          explanation
250          commonMisconception
251          mistakeType
252          commonMistake
253        }
254        correctAnswerExplanation {
255          answerIndex
256          label
257          explanation
258          keyInsight
259        }
260        keyFormulas {
261          name
262          latex
263          description
264        }
265        relatedModules {
266          id
267          title
268        }
269      }
270      ruleReference
271      sessionStats {
272        correct
273        attempted
274        accuracy
275      }
276      overallStats {
277        correct
278        attempted
279        accuracy
280      }
281      currentStreak
282      bestStreak
283      rollingAccuracy
284      masteryAchieved
285      masteryStatus
286      tierCompleted
287      suggestedNextTier
288      error
289    }
290  }
291`;var v=r(88874),f=r(78334),k=r(39018),y=r(80525),j=r(28779),w=r(22215),N=r(54079),S=r(87668),A=r(38557),C=r(25602),P=r(90782);const T=e=>
291{switch(e){case"foundation":return"Foundation";case"intermediate":return"Intermediate";case"advanced":return"Advanced";default:return e}},$=e=>{switch(e){case"foundation":return"bg-success-100 dark:bg-success-800/30 text-success-700 dark:text-success-200";case"intermediate":return"bg-warning-100 dark:bg-warning-800/30 text-warning-700 dark:text-warning-200";case"advanced":return"bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300";default:return"bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400"}},I=e=>{const t=e.find(e=>"text"===e.type&&e.description);return(null===t||void 0===t?void 0:t.description)||"Practice problem"},_=e=>{let{attempt:t,isExpanded:r,onToggle:s,onTryAgain:a}=e;return(0,P.jsxs)("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden",children:[(0,P.jsxs)("button",{onClick:s,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-neutral-50 dark:hover:bg-neutral-800/50 transition-colors",children:[(0,P.jsx)("div",{className:"flex-shrink-0",children:t.isCorrect?(0,P.jsx)("div",{className:"w-6 h-6 rounded-full bg-success-100 dark:bg-success-800/30 flex items-center justify-center",children:(0,P.jsx)(w.A,{className:"w-3.5 h-3.5 text-success-600 dark:text-success-500"})}):(0,P.jsx)("div",{className:"w-6 h-6 rounded-full bg-error-100 dark:bg-error-800/30 flex items-center justify-center",children:(0,P.jsx)(N.A,{className:"w-3.5 h-3.5 text-error-600 dark:text-error-500"})})}),(0,P.jsx)("span",{className:"flex-1 text-sm text-neutral-700 dark:text-neutral-300 min-w-0 overflow-hidden",style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"},children:(0,P.jsx)(v.A,{content:I(t.problemContent),mode:"auto"})}),(0,P.jsx)("span",{className:`flex-shrink-0 text-xs font-medium px-2 py-0.5 rounded-full ${$(t.difficultyTier)}`,children:T(t.difficultyTier)}),(0,P.jsx)("span",{className:"flex-shrink-0 text-xs text-neutral-400 dark:text-neutral-500 w-16 text-right",children:(0,j.fw)(t.createdAt)}),(0,P.jsx)("div",{className:"flex-shrink-0 text-neutral-400 dark:text-neutral-500",children:r?(0,P.jsx)(S.A,{className:"w-4 h-4"}):(0,P.jsx)(A.A,{className:"w-4 h-4"})})]}),r&&(0,P.jsxs)("div",{className:"px-4 pb-4 border-t border-neutral-200 dark:border-neutral-700",children:[(0,P.jsx)("div",{className:"mt-4 mb-4",children:(0,P.jsx)(f.A,{content:t.problemContent})}),(0,P.jsx)("div",{className:"space-y-2 mb-4",children:t.problemOptions.map(e=>{const r=t.correctAnswer===e.label,s=t.selectedAnswer===e.label;let a="bg-neutral-50 dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 text-neutral-500 dark:text-neutral-400";return r?a="bg-success-50 dark:bg-success-800/20 border-success-500 dark:border-success-600 text-success-800 dark:text-success-100":s&&(a="bg-error-50 dark:bg-error-800/20 border-error-500 dark:border-error-600 text-error-800 dark:text-error-100"),(0,P.jsx)("div",{className:`p-3 rounded-lg border-2 ${a}`,children:(0,P.jsxs)("div",{className:"flex items-start gap-3",children:[(0,P.jsxs)("span",{className:"font-bold text-sm",children:[e.label,"."]}),(0,P.jsx)("span",{className:"flex-1 text-sm",children:(0,P.jsx)(v.A,{content:e.text,mode:"auto"})}),r&&(0,P.jsx)("span",{className:"text-success-600 dark:text-success-500 font-bold text-sm",children:"\u2713"}),s&&!r&&(0,P.jsx)("span",{className:"text-error-600 dark:text-error-500 font-bold text-sm",children:"\u2717"})]})},e.label)})}),t.explanationBlocks&&t.explanationBlocks.length>0&&(0,P.jsxs)("div",{className:"mb-4 p-3 bg-primary-50 dark:bg-primary-900/10 rounded-lg border border-primary-200 dark:border-primary-800",children:[(0,P.jsx)("h5",{className:"text-sm font-semibold text-primary-900 dark:text-primary-200 mb-2",children:"Explanation"}),(0,P.jsx)("div",{className:"text-sm text-primary-800 dark:text-primary-300",children:t.explanationBlocks.map((e,t)=>(0,P.jsx)("div",{className:"mb-1",children:(0,P.jsx)(v.A,{content:e,mode:"auto"})},t))})]}),(0,P.jsxs)("button",{onClick:e=>{e.stopPropagation(),a(t)},className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-primary-900/20 hover:bg-primary-100 dark:hover:bg-primary-900/30 rounded-lg transition-colors",children:[(0,P.jsx)(C.A,{className:"w-3.5 h-3.5"}),"Try Again"]})]})]})};var E=r(26892),q=r(98639),M=r(67122);const L=e=>{let{moduleId:t,onTryAgain:r,refreshTrigger:a}=e;
291const[n,l]=(0,s.useState)(!1),[i,o]=(0,s.useState)("all"),[d,c]=(0,s.useState)("all"),[m,x]=(0,s.useState)(1),[p,b]=(0,s.useState)(new Set),[h,v]=(0,s.useState)(!1),[f,{data:k,loading:y}]=(0,u._)(g,{...(0,q.X)("oneshot")}),j=(0,s.useCallback)((e,r,s)=>{const a={moduleId:t,limit:10,offset:10*(e-1)};"all"!==r&&(a.difficultyTier=r),"correct"===s&&(a.isCorrect=!0),"incorrect"===s&&(a.isCorrect=!1),f({variables:a})},[t,f]);(0,s.useEffect)(()=>{h&&j(m,i,d)},[m,i,d,h,j]),(0,s.useEffect)(()=>{h&&a>0&&j(m,i,d)},[a,h,m,i,d,j]);const w=null===k||void 0===k?void 0:k.getPracticeAttemptHistory,N=(null===w||void 0===w?void 0:w.attempts)||[],C=(null===w||void 0===w?void 0:w.totalCount)||0,T=Math.ceil(C/10),$=e=>{r({id:e.learningProblemId,learningProblemId:e.learningProblemId,content:e.problemContent,options:e.problemOptions,difficultyTier:e.difficultyTier})};return(0,P.jsxs)("div",{className:"mt-6",children:[(0,P.jsxs)("button",{onClick:()=>{const e=!n;l(e),e&&!h&&(v(!0),j(1,i,d))},className:"w-full flex items-center justify-between px-4 py-3 bg-neutral-50 dark:bg-neutral-800/50 hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-lg border border-neutral-200 dark:border-neutral-700 transition-colors",children:[(0,P.jsxs)("span",{className:"text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Previously Attempted",h&&C>0?` (${C})`:""]}),n?(0,P.jsx)(S.A,{className:"w-4 h-4 text-neutral-500 dark:text-neutral-400"}):(0,P.jsx)(A.A,{className:"w-4 h-4 text-neutral-500 dark:text-neutral-400"})]}),n&&(0,P.jsxs)("div",{className:"mt-3",children:[(0,P.jsxs)("div",{className:"flex flex-wrap gap-4 mb-4",children:[(0,P.jsx)("div",{className:"flex flex-wrap gap-1",children:[{value:"all",label:"All"},{value:"foundation",label:"Foundation"},{value:"intermediate",label:"Intermediate"},{value:"advanced",label:"Advanced"}].map(e=>(0,P.jsx)("button",{onClick:()=>{return t=e.value,o(t),x(1),void b(new Set);var t},className:"px-3 py-1 text-xs font-medium rounded-full transition-colors "+(i===e.value?"bg-brand text-white":"bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dar
291k:text-neutral-400 hover:bg-neutral-200 dark:hover:bg-neutral-700"),children:e.label},e.value))}),(0,P.jsx)("div",{className:"flex flex-wrap gap-1",children:[{value:"all",label:"All"},{value:"correct",label:"Correct"},{value:"incorrect",label:"Incorrect"}].map(e=>(0,P.jsx)("button",{onClick:()=>{return t=e.value,c(t),x(1),void b(new Set);var t},className:"px-3 py-1 text-xs font-medium rounded-full transition-colors "+(d===e.value?"bg-brand text-white":"bg-neutral-100 dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 hover:bg-neutral-200 dark:hover:bg-neutral-700"),children:e.label},e.value))})]}),y&&0===N.length&&(0,P.jsx)("div",{className:"space-y-2 py-2",children:[0,1,2].map(e=>(0,P.jsx)(M.l1,{className:"h-16 w-full",rounded:"lg"},e))}),N.length>0&&(0,P.jsx)("div",{className:"space-y-2",children:N.map(e=>(0,P.jsx)(_,{attempt:e,isExpanded:p.has(e.id),onToggle:()=>{return t=e.id,void b(e=>{const r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r});var t},onTryAgain:$},e.id))}),!y&&0===N.length&&(0,P.jsx)("div",{className:"text-center py-8 text-neutral-500 dark:text-neutral-400 text-sm",children:"all"!==i||"all"!==d?"No attempts match the selected filters.":"No practice attempts yet. Start practicing above!"}),T>1&&(0,P.jsx)(E.A,{currentPage:m,totalPages:T,totalCount:C,loading:y,onPageChange:x,itemsPerPage:10,itemLabel:"attempts"})]})]})};r(38231);var R=r(46521),D=(r(35973),r(58404),r(46900),r(83759),r(63926),r(81127),r(94696),r(53346),r(60654)),B=r(25191),F=r(88737),O=r(49350),z=r(54966);const H=e=>{let{isOpen:t,onClose:r,moduleTitle:a,tagId:n,tagName:l,tagTypes:i,conceptUnderstandingBefore:o,practiceHref:d}=e;const u=(0,k.Zp)(),{data:m,refetch:x}=(0,c.IT)(z.eF,{variables:{tag_types:null!==i&&void 0!==i?i:["topic","subtopic","concept"]},skip:!t,...(0,q.X)("session")});(0,s.useEffect)(()=>{t&&x()},[t,x]);const{conceptUnderstanding:p,resolvedTagName:b}=(0,s.useMemo)(()=>{var e,t,r,s;const a=(null!==(e=null===m||void 0===m||null===(t=m.getUserExamTagPerformances)||void 0===t?void 0:t.tag_performances)&&void 0!==e?e:[]).find(e=>e.tag_id===n);return{conceptUnderstanding:"number"===typeof(null===a||void 0===a?void 0:a.concept_understanding)?a.concept_understanding:0,resolvedTagName:null!==(r=null!==(s=null===a||void 0===a?void 0:a.tag_name)&&void 0!==s?s:l)&&void 0!==r?r:"this topic"}},[m,n,l]),g=(h=p,Math.round(100*Math.max(0,Math.min(1,h))).toString());var h;const v=(0,s.useMemo)(()=>{if("number"!==typeof o)return null;const e=p-o;return e<=0?null:Math.round(100*e)},[p,o]);return(0,P.jsx)(O.a,{isOpen:t,onClose:r,size:"md","aria-label":"Lesson complete",children:(0,P.jsxs)("div",{className:"text-center py-2",children:[(0,P.jsx)("div",{className:"w-16 h-16 bg-success-100 rounded-full flex items-center justify-center mx-auto mb-3",children:(0,P.jsx)(D.A,{size:32,className:"text-success-600"})}),(0,P.jsx)("h2",{className:"text-xl font-bold text-neutral-900 mb-1",children:"Lesson complete"}),a&&(0,P.jsx)("p",{className:"text-sm text-neutral-600 mb-4",children:a}),(0,P.jsxs)("div",{className:"bg-primary-50 rounded-xl px-4 py-4 mb-5 text-left",children:[(0,P.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,P.jsxs)("span",{className:"text-sm font-medium text-neutral-700",children:["Concept readiness \u2014 ",b]}),(0,P.jsxs)("span",{className:"text-sm font-semibold text-primary-700",children:[null!==v?`+${v}% \xb7 `:"",g,"%"]})]}),(0,P.jsx)("div",{className:"w-full h-2 bg-neutral-200 rounded-full overflow-hidden",children:(0,P.jsx)("div",{className:"h-full bg-primary-500 transition-all duration-500",style:{width:`${g}%`}})}),(0,P.jsx)("p",{className:"text-xs text-neutral-500 mt-3",children:"Practice this topic next to bank the gain."})]}),(0,P.jsxs)("div",{className:"flex flex-col gap-3 max-w-xs mx-auto",children:[(0,P.jsxs)("button",{type:"button",onClick:()=>{r(),u(d||`/home/practice?tag=${encodeURIComponent(n)}`)},className:"w-full px-4 py-3 bg-brand text-white font-semibold rounded-xl hover:bg-brand-hover transition-colors flex items-center justify-center gap-2",children:[(0,P.jsx)(B.A,{size:18}),"Practice now",(0,P.jsx)(F.A,{size:16})]}),(0,P.jsx)("button",{type:"button",onClick:r,className:"w-full px-4 py-2.5 bg-neutral-100 text-neutral-700 font-medium rounded-xl hover:bg-neutral-200 transition-colors",children:"Skip"})]})]})})};var U=r(79447),G=r(34566),Q=r(79696),X=r(9089),Y=r(76531);function V(e,t){if(!Array.isArray(e))return"";const r=e.filter(e=>"passage"===e.type).map(e=>e.description||""),s=[];for(const n of e)if("svg"===n.type)n.svg_description&&s.push(n.svg_description);else if("table"===n.type&&Array.isArray(n.table_headers)&&n.table_headers.length>0){const e=[n.table_headers.join(" | ")];if(Array.isArray(n.table_rows))for(const t of n.table_rows)e.push(t.join(" | "));s.push(e.join("\n"))}const a=e.filter(e=>"text"===e.type).map(e=>e.description||"");return[...r,...s,...a].join(t)}var J=r(62824),W=r(74027),K=r(23476),Z=r(45155);function ee(e,t){const r=t.match(/\(1\)\s*(.+?)\s{2,}\(2\)\s*(.+?)(?:\s{2,}
291\(3\)\s*(.+))?$/),s=r?[r[1],r[2],r[3]].filter(Boolean):[t],a=t.length>0,n=e.split(/_{2,}/);if(n.length<2)return e;const l=[];for(let i=0;i<n.length;i++)l.push(n[i]),i<n.length-1&&a&&i<s.length?l.push((0,P.jsx)("span",{className:"inline-block min-w-[4em] text-center",children:(0,P.jsx)("span",{className:"font-semibold text-primary-400 underline decoration-blue-400/50 underline-offset-2",children:s[i]})},`fill-${i}`)):i<n.length-1&&l.push((0,P.jsx)("span",{className:"inline-block min-w-[4em] text-center",children:"________"},`blank-${i}`));return(0,P.jsx)(P.Fragment,{children:l})}function te(e){const t=e.find(e=>("question"===e.type||"text"===e.type)&&e.description&&/most nearly mean/i.test(e.description));if(null===t||void 0===t||!t.description)return e;const r=t.description.match(/(?:what does|the (?:word|phrase))\s+[''']([^''']+)[''']|[''']([^''']+)[''']\s+most nearly mean/i),s=(null===r||void 0===r?void 0:r[1])||(null===r||void 0===r?void 0:r[2]);if(!s)return e;const a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(?<![<\\w])\\b(${a})\\b(?![\\w>])`,"gi");return e.map(e=>{if(("passage"===e.type||"question"===e.type||"text"===e.type)&&e.description){const t=e.description.replace(n,"<u>$1</u>");if(t!==e.description)return{...e,description:t}}return e})}const re=e=>{var t,r,x,g,j,w,N,S,A,C;let{moduleId:T,skillTags:$,conceptTagIds:I,explanationMode:_="auto",difficultyTiers:E,showDifficultySelector:D=!0,showSessionProgress:B=!0,showOverallProgress:F=!0,immediateFeedback:O=!0,showExplanation:z=!0,graduateLink:re,ruleReferenceLink:ie,onMasteryAchieved:oe,onAssignmentProgress:de,onLearnTierProgress:ce,assignmentContext:ue,hasUnderlyingAssignment:me,practiceMode:xe,onPracticeModeChange:pe,onAskAITutor:be,orgReadOnly:ge=!1,orgGrantStopHeadline:he,moduleLockExemption:ve="none"}=e;const{t:fe}=(0,a.B)(),ke=ge&&"none"===ve,ye=ge&&"unknown"===ve,je=(0,s.useMemo)(()=>{if(me)return["foundation","intermediate","advanced"];if(!ue)return E;const e=["foundation","intermediate","advanced"].filter(e=>(ue.tierRequirements[e]||0)>0);return e.length>0?e:E},[me,ue,E]),[we,Ne]=(0,s.useState)(je.length>0?je[0]:"foundation"),[Se,Ae]=(0,s.useState)(new Set),[Ce,Pe]=(0,s.useState)(!1),[Te,$e]=(0,s.useState)(!1),[Ie,_e]=(0,s.useState)(null),[Ee,qe]=(0,s.useState)(!1),[Me,Le]=(0,s.useState)(""),[Re,De]=(0,s.useState)(!1),[Be,Fe]=(0,s.useState)(null),[Oe,ze]=(0,s.useState)(Date.now()),[He,Ue]=(0,s.useState)(!1),[Ge,Qe]=(0,s.useState)(!1),[Xe,Ye]=(0,s.useState)(null),[Ve,Je]=(0,s.useState)({sessionStats:null,overallStats:null}),[We,Ke]=(0,s.useState)(""),[Ze,et]=(0,s.useState)(null),[tt,rt]=(0,s.useState)("text"),[st,at]=(0,s.useState)(!1),{report:nt,showTrackItLink:lt}=(0,Q.V)(null===Ie||void 0===Ie?void 0:Ie.id,null!==Ie&&void 0!==Ie&&Ie.isLearningProblem?"learning_problems":"problems",!!Ie),[it,ot]=(0,s.useState)(null),[dt,ct]=(0,s.useState)({currentStreak:0,bestStreak:0,rollingAccuracy:0,masteryStatus:"in_progress",streakRequired:5}),[ut,mt]=(0,s.useState)(0),[xt,pt]=(0,s.useState)({}),bt=(0,s.useRef)([]),[gt,ht]=(0,s.useState)(null);(0,s.useEffect)(()=>{ht(ue?{...ue.tierProgress}:null)},[ue]);const{data:vt}=(0,c.IT)(p,{variables:{moduleId:T},...(0,q.X)("session")});(0,s.useEffect)(()=>{var e;if(null!==vt&&void 0!==vt&&null!==(e=vt.getPracticePoolStats)&&void 0!==e&&e.success){Je({sessionStats:vt.getPracticePoolStats.sessionStats,overallStats:vt.getPracticePoolStats.overallStats});const e=vt.getPracticePoolStats.allTierProgress||[];bt.current=e;const a=new Set,n={};for(const l of e){var t,r,s;l.completed&&a.add(l.tier),n[l.tier]=null!==(t=l.currentStreak)&&void 0!==t?t:0,null===ce||void 0===ce||ce({tier:l.tier,current_streak:null!==(r=l.currentStreak)&&void 0!==r?r:0,best_streak:null!==(s=l.bestStreak)&&void 0!==s?s:0,completed:!!l.completed})}if(Ae(a),pt(n),!Ce){const t=je.find(e=>!a.has(e)),r=a.size>0?t||je[je.length-1]:je[0];a.size>0&&Ne(r);const s=e.find(e=>e.tier===r);s&&ct(e=>({...e,currentStreak:s.currentStreak,bestStreak:s.bestStreak,rollingAccuracy:s.attempts>0?s.correct/s.attempts:0,masteryStatus:vt.getPracticePoolStats.masteryStatus||(a.has(je[je.length-1])?"mastered":"in_progress")})),Pe(!0)}}},[vt,je,Ce]);const[ft,{loading:kt,data:yt}]=(0,u._)(b,{...(0,q.X)("oneshot"),nextFetchPolicy:"network-only",onError:e=>{console.error("Failed to fetch practice pool question:",e.message,e),qe(!1)}});(0,s.useEffect)(()=>
291{if(!yt)return;const e=null===yt||void 0===yt?void 0:yt.getPracticePoolQuestion;if(null!==e&&void 0!==e&&e.tierProgress){var t;ct(t=>({...t,currentStreak:e.tierProgress.currentStreak,bestStreak:e.tierProgress.bestStreak}));const a=null===(t=e.question)||void 0===t?void 0:t.difficultyTier;if(e.tierProgress.completed&&a&&Ae(e=>new Set([...e,a])),a){var r,s;const t=null!==(r=e.tierProgress.currentStreak)&&void 0!==r?r:0,n=Math.max(null!==(s=e.tierProgress.bestStreak)&&void 0!==s?s:0,t),l=bt.current.find(e=>e.tier===a);if(l){const r={...l,currentStreak:t,bestStreak:n,completed:!!e.tierProgress.completed||l.completed};bt.current=bt.current.map(e=>e.tier===a?r:e)}pt(e=>({...e,[a]:t})),null===ce||void 0===ce||ce({tier:a,current_streak:t,best_streak:n,completed:!!e.tierProgress.completed})}}null!==e&&void 0!==e&&e.success?(_e(e.question),Le(""),De(!1),ze(Date.now()),Ue(!1)):(0,Y.O)(e)?(Qe(!0),Ue(!1),_e(null)):(Ue(!0),_e(null)),qe(!1)},[yt]);const[jt,{loading:wt}]=(0,m.n)(h,{onCompleted:e=>{var t;if(null!==e&&void 0!==e&&null!==(t=e.submitPracticePoolAnswer)&&void 0!==t&&t.success){const t=e.submitPracticePoolAnswer;var r,s,a,n;if(Fe({isCorrect:t.isCorrect,correctAnswer:t.correctAnswer,explanation:t.explanation,explanationBlocks:t.explanationBlocks,visualExplanation:t.visualExplanation,ruleReference:t.ruleReference,sessionStats:t.sessionStats,overallStats:t.overallStats,currentStreak:t.currentStreak,bestStreak:t.bestStreak,rollingAccuracy:t.rollingAccuracy,masteryAchieved:t.masteryAchieved,masteryStatus:t.masteryStatus,tierCompleted:t.tierCompleted,suggestedNextTier:t.suggestedNextTier}),De(!0),ot(null),void 0!==t.currentStreak)ct({currentStreak:null!==(r=t.currentStreak)&&void 0!==r?r:0,bestStreak:null!==(s=t.bestStreak)&&void 0!==s?s:0,rollingAccuracy:null!==(a=t.rollingAccuracy)&&void 0!==a?a:0,masteryStatus:null!==(n=t.masteryStatus)&&void 0!==n?n:"in_progress",streakRequired:5});if(t.tierCompleted&&Ae(e=>new Set([...e,we])),we&&void 0!==t.currentStreak){var l,i,o,d;const e=null!==(l=t.currentStreak)&&void 0!==l?l:0,r=Math.max(null!==(i=t.bestStreak)&&void 0!==i?i:0,e),s=bt.current.find(e=>e.tier===we),a={tier:we,currentStreak:e,bestStreak:r,completed:!!t.tierCompleted||!(null===s||void 0===s||!s.completed),attempts:null!==(o=null===s||void 0===s?void 0:s.attempts)&&void 0!==o?o:0,correct:null!==(d=null===s||void 0===s?void 0:s.correct)&&void 0!==d?d:0};bt.current=s?bt.current.map(e=>e.tier===we?a:e):[...bt.current,a],pt(t=>({...t,[we]:e})),null===ce||void 0===ce||ce({tier:we,current_streak:a.currentStreak,best_streak:a.bestStreak,completed:a.completed})}if(t.masteryAchieved&&oe&&oe(),t.tierCompleted&&null===t.suggestedNextTier&&$e(!0),t.tierCompleted&&t.suggestedNextTier){const e=St(t.suggestedNextTier);Ze&&clearTimeout(Ze),Ke(`${St(we)} complete! Continue to ${e} below.`);const r=setTimeout(()=>{Ke(""),et(null)},5e3);et(r)}if(t.isCorrect&&gt&&we){const e=we;if(e in gt){const t={...gt,[e]:gt[e]+1};ht(t),null===de||void 0===de||de(t)}}mt(e=>e+1)}else if(null!==e&&void 0!==e&&e.submitPracticePoolAnswer&&!e.submitPracticePoolAnswer.success){var c;const t=e.submitPracticePoolAnswer,r=(0,Y.O)(t);console.error("Submit answer failed:",null!==(c=t.errorCode)&&void 0!==c?c:null,t.error),Ye({message:(0,Y.$)(t,fe("Couldn't record your answer. Please try again.")),refusal:r})}},onError:e=>{console.error("Submit answer mutation error:",e.message,e),Ye({message:fe("Couldn't record your answer. Please try again."),refusal:!1})}});(0,s.useEffect)(()=>{!Ce||ke||ye||(Ye(null),Fe(e=>(e&&Je(t=>{var r,s;return{sessionStats:null!==(r=e.sessionStats)&&void 0!==r?r:t.sessionStats,overallStats:null!==(s=e.overallStats)&&void 0!==s?s:t.overallStats}}),null)),qe(!0),ft({variables:{moduleId:T,difficultyTiers:[we]}}))},[T,we,Ce,ft,ke,ye]),(0,s.useEffect)(()=>()=>{Ze&&clearTimeout(Ze)},[Ze]);const Nt=e=>{if(ke||!D&&!ue)return;e!==we&&qe(!0),Ne(e);const t=bt.current.find(t=>t.tier===e);ct(t?e=>({...e,currentStreak:t.currentStreak,bestStreak:t.bestStreak,rollingAccuracy:t.attempts>0?t.correct/t.attempts:0}):e=>({...e,currentStreak:0,bestStreak:0,rollingAccuracy:0}))},St=e=>
291{switch(e){case"foundation":return"Foundation";case"intermediate":return"Intermediate";case"advanced":return"Advanced";default:return e}},At=(0,s.useMemo)(()=>{if(!ue)return null;return{nextRequiredTier:["foundation","intermediate","advanced"].find(e=>{const t=ue.tierRequirements[e]||0,r=gt&&gt[e]||0;return t>0&&r<t})||null}},[ue,gt]),Ct=He&&je.length>1;return(0,P.jsxs)(P.Fragment,{children:[We&&(0,P.jsxs)("div",{className:"fixed top-4 left-1/2 transform -translate-x-1/2 z-50 transition-all duration-300 ease-out",style:{animation:"slideDown 0.3s ease-out"},children:[(0,P.jsx)("style",{children:"\n            @keyframes slideDown {\n              from {\n                opacity: 0;\n                transform: translateX(-50%) translateY(-20px);\n              }\n              to {\n                opacity: 1;\n                transform: translateX(-50%) translateY(0);\n              }\n            }\n          "}),(0,P.jsx)("div",{className:"px-6 py-3 bg-success-600 dark:bg-success-700 text-white rounded-lg shadow-lg flex items-center gap-2 max-w-md",children:(0,P.jsx)("span",{className:"font-medium",children:We})})]}),(0,P.jsx)("div",{className:"my-4 sm:my-8 p-3 sm:p-6 rounded-lg border "+(ue?"bg-indigo-50/30 dark:bg-indigo-950/10 border-indigo-200 dark:border-indigo-800":me?"bg-primary-50/30 dark:bg-primary-950/10 border-primary-200 dark:border-primary-800":"bg-surface-raised dark:bg-gray-850 border-neutral-200 dark:border-neutral-700"),children:ye?(0,P.jsxs)("div",{"data-testid":"practice-pool-lock-pending",className:"space-y-3",children:[(0,P.jsx)(Z.l,{className:"h-16 w-full",rounded:"lg"}),(0,P.jsx)(Z.l,{className:"h-5 w-48",rounded:"md"})]}):ke||Ge?(0,P.jsx)(K.D,{headline:he||(0,J.NU)(fe,null),helpLine:(0,J.I7)(fe,null)}):(0,P.jsxs)(P.Fragment,{children:[me&&pe&&(0,P.jsxs)("div",{className:"mb-4 flex flex-col items-center gap-1",children:[(0,P.jsxs)("div",{className:"inline-flex rounded-lg border border-neutral-200 dark:border-neutral-700 bg-neutral-100 dark:bg-neutral-900 p-0.5",role:"tablist","aria-label":fe("Practice mode"),children:[(0,P.jsxs)("button",{type:"button",role:"tab","aria-selected":"assignment"===xe,onClick:()=>pe("assignment"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-colors "+("assignment"===xe?"bg-surface-raised dark:bg-neutral-800 text-indigo-700 dark:text-indigo-300 shadow-sm":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200"),title:"Focus on your teacher's assignment \u2014 required vs optional tiers, cumulative progress toward the bar.",children:[(0,P.jsx)(n.A,{size:12}),"Assignment"]}),(0,P.jsxs)("button",{type:"button",role:"tab","aria-selected":"practice"===xe,onClick:()=>pe("practice"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-colors "+("practice"===xe?"bg-surface-raised dark:bg-neutral-800 text-primary-700 dark:text-primary-300 shadow-sm":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200"),title:fe("Practice for module mastery \u2014 answer 5 in a row correctly to master each level. Answers still count toward any active assignment."),children:[(0,P.jsx)(l.A,{size:12}),"Practice"]})]}),"practice"===xe&&(0,P.jsx)("div",{className:"text-[10px] text-neutral-500 dark:text-neutral-400 italic",children:"Answers still count toward your assignment progress."})]}),ue?(0,P.jsxs)("div",{className:"mb-6",children:[(0,P.jsx)("div",{className:"flex flex-wrap gap-2 mb-3",children:["foundation","intermediate","advanced"].map(e=>{const t=ue.tierRequirements[e]||0,r=gt?Math.min(gt[e]||0,t):0,s=t>0&&r>=t,a=we===e;return t>0?(0,P.jsx)(le,{label:St(e),done:r,total:t,isSelected:a,isComplete:s,accent:"indigo",onClick:()=>Nt(e)},e):(0,P.jsx)("button",{onClick:()=>Nt(e),className:`${se} border-dashed ${a?"border-neutral-400 bg-neutral-50 dark:bg-neutral-800 dark:border-neutral-500":"border-neutral-200 dark:border-neutral-700 hover:border-neutral-300 dark:hover:border-neutral-600"}`,children:(0,P.jsxs)("div",{className:ae,children:[(0,P.jsx)("span",{className:`${ne} ${a?"text-neutral-700 dark:text-neutral-300":"text-neutral-400 dark:text-neutral-500"}`,children:St(e)}),(0,P.jsx)("span",{className:"text-[10px] text-neutral-400 dark:text-neutral-500",children:"Not required"})]})},e)})}),(0,P.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:(()=>{const e=we,t=ue.tierRequirements[e]||0,r=St(we).toLowerCase();if(0===t)return`${St(we)} isn't required by this assignment \u2014 practice here for extra mastery.`;const s=gt?Math.min(gt[e]||0,t):0,a=Math.max(0,t-s);if(a>0)return 0===s?`Answer ${t} ${r} question${1!==t?"s":""} correctly to finish this requirement.`:`${a} more correct ${r} answer${1!==a?"s":""} needed to finish this requirement.`;const n=null!==At&&void 0!==At&&At.nextRequiredTier?`Switch to ${St(At.nextRequiredTier).toLowerCase()} next.`:"All requirements done!";return`${St(we)} requirement complete \u2713 ${n}`})()})]}):(0,P.jsxs)(P.Fragment,{children:[D&&je.length>0&&(0,P.jsx)("div",{className:"flex flex-wrap gap-2 mb-3",children:je.map(e=>{var t;const r=null!==(t=xt[e])&&void 0!==t?t:0,s=dt.streakRequired||5,a=Se.has(e),n=St(e),l=a?`${n}: mastered`:`${n}: streak ${r} of ${s}`;return(0,P.jsx)(le,{label:n,done:r,total:s,isSelected:we===e,isComplete:a,accent:"blue",onClick:()=>Nt(e),ariaLabel:l},e)})}),"not_started"!==dt.masteryStatus&&("mastered"===dt.masteryStatus||Be||dt.currentStreak>0||dt.bestStreak>0)&&(0,P.jsx)("div",{className:"mb-4 sm:mb-6",children:"mastered"===dt.masteryStatus?(0,P.jsxs)("div",{className:"p-3 sm:p-4 roun
291ded-lg border border-warning-200 dark:border-warning-800 bg-warning-50/30 dark:bg-warning-800/10",children:[(0,P.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,P.jsx)("svg",{className:"w-4 h-4 sm:w-5 sm:h-5 text-warning-600 dark:text-warning-500",fill:"currentColor",viewBox:"0 0 24 24",children:(0,P.jsx)("path",{d:"M5 3h14c0 0 .5 0 .5.5S19 6 17 8c-1 1-2.5 1.5-4 1.7V12c2.2.5 4 2 4 3v1H7v-1c0-1 1.8-2.5 4-3V9.7C9.5 9.5 8 9 7 8 5 6 4.5 3.5 4.5 3.5S5 3 5 3zM9 17h6v2H9v-2z"})}),(0,P.jsx)("span",{className:"font-bold text-sm sm:text-base text-warning-700 dark:text-warning-200",children:"Mastered"})]}),(0,P.jsx)("p",{className:"text-xs sm:text-sm text-neutral-600 dark:text-neutral-400",children:"You've demonstrated mastery of this concept. Keep practicing to stay sharp!"})]}):(0,P.jsxs)("div",{className:"p-3 sm:p-4 bg-surface-sunken dark:bg-neutral-800/50 rounded-lg border border-border dark:border-neutral-700",children:[(0,P.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1.5 sm:gap-2 mb-2 sm:mb-3",children:[(0,P.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-4",children:[(0,P.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide text-text-subtle dark:text-text-subtle",children:St(we)}),(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[(0,P.jsx)("span",{className:"text-xs sm:text-sm",children:"\ud83d\udd25"}),(0,P.jsxs)("span",{className:"text-xs sm:text-sm font-medium text-text-muted dark:text-text-subtle",children:["Streak: ",(0,P.jsx)("span",{className:"font-bold text-warning-600 dark:text-warning-500",children:dt.currentStreak}),"/",dt.streakRequired]})]}),(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[(0,P.jsx)("span",{className:"text-xs sm:text-sm",children:"\ud83d\udcca"}),(0,P.jsxs)("span",{className:"text-xs sm:text-sm font-medium text-text-muted dark:text-text-subtle",children:["Accuracy: ",(0,P.jsxs)("span",{className:"font-bold text-primary-600 dark:text-primary-400",children:[Math.round(100*dt.rollingAccuracy),"%"]})]})]})]}),dt.bestStreak>0&&(0,P.jsxs)("span",{className:"text-xs text-text-subtle dark:text-text-subtle",children:["Best: ",dt.bestStreak]})]}),(0,P.jsx)("div",{className:"w-full bg-neutral-200 dark:bg-neutral-700 rounded-full h-1.5 sm:h-2",children:(0,P.jsx)("div",{className:"h-1.5 sm:h-2 rounded-full transition-all duration-500 ease-out bg-gradient-to-r from-warning-500 to-warning-600 dark:from-warning-500 dark:to-warning-600",style:{width:`${Math.min(dt.currentStreak/dt.streakRequired*100,100)}%`}})}),(0,P.jsx)("p",{className:"mt-1.5 sm:mt-2 text-xs text-text-subtle dark:text-text-subtle",children:dt.currentStreak>=dt.streakRequired?"advanced"===we?"Streak target reached! Maintain 80% accuracy to achieve mastery.":'Tier complete! Click "Next Question" to advance.':dt.streakRequired-dt.currentStreak+" more correct in a row to complete this tier"})]})}),(Be||Ve.overallStats&&Ve.overallStats.attempted>0)&&(B||F)&&(0,P.jsxs)("div",{className:"-mt-2 mb-4 sm:mb-6 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-neutral-500 dark:text-neutral-400",children:[B&&(0,P.jsxs)("span",{children:["Today"," ",(0,P.jsxs)("span",{className:"font-medium text-neutral-700 dark:text-neutral-300",children:[(null===(t=(null===Be||void 0===Be?void 0:Be.sessionStats)||Ve.sessionStats)||void 0===t?void 0:t.correct)||0,"/",(null===(r=(null===Be||void 0===Be?void 0:Be.sessionStats)||Ve.sessionStats)||void 0===r?void 0:r.attempted)||0]})]}),B&&F&&(0,P.jsx)("span",{"aria-hidden":"true",children:"\xb7"}),F&&(0,P.jsxs)("span",{children:["All-time"," ",(0,P.jsxs)("span",{className:"font-medium text-neutral-700 dark:text-neutral-300",children:[(null===(x=(null===Be||void 0===Be?void 0:Be.overallStats)||Ve.overallStats)||void 0===x?void 0:x.correct)||0,"/",(null===(g=(null===Be||void 0===Be?void 0:Be.overallStats)||Ve.overallStats)||void 0===g?void 0:g.attempted)||0]})," ","(",(Tt=(null===(j=(null===Be||void 0===Be?void 0:Be.overallStats)||Ve.overallStats)||void 0===j?void 0:j.accuracy)||0,`${Math.round(100*Tt)}%`),")"]})]})]}),He&&!kt&&(0,P.jsx)("div",{className:"text-center py-12",children:ue?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"text-5xl mb-4",children:"\ud83d\udccb"}),(0,P.jsxs)("h3",{className:"text-lg font-bold text-neutral-900 dark:text-neutral-100 mb-2",children:["No ",St(we).toLowerCase()," questions available yet"]}),(0,P.jsxs)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400 mb-4",children:["This module doesn't have ",St(we).toLowerCase(),"-level problems.",Ct&&" Try selecting another level above."]})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"text-6xl mb-4",children:"\ud83c\udf89"}),(0,P.jsx)("h3",{className:"text-xl font-bold text-neutral-900 dark:text-neutral-100 mb-2",children:"Great Work!"}
291),(0,P.jsx)("p",{className:"text-neutral-600 dark:text-neutral-400 mb-4",children:Ct?"You've completed all questions in the selected difficulty tier. Try selecting another tier above!":"No more questions available in the selected difficulty tier. Come back later for more practice!"}),re&&!Ct&&(0,P.jsx)(k.N_,{to:re,className:"inline-block px-6 py-3 bg-brand hover:bg-brand-hover text-white font-medium rounded-lg transition-colors",children:"Continue to Next Level \u2192"})]})}),(kt||Ee)&&(0,P.jsx)("div",{className:"py-4",children:(0,P.jsx)(M.D4,{})}),Xe&&(0,P.jsx)(W.l,{tone:Xe.refusal?"warning":"error",icon:Xe.refusal?i.A:o.A,title:Xe.message,className:"mb-4"}),Ie&&!kt&&!Ee&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"mb-4 sm:mb-6",children:null!==(w=Ie.content)&&void 0!==w&&null!==(N=w[0])&&void 0!==N&&null!==(S=N.description)&&void 0!==S&&S.includes("___")?(0,P.jsx)("p",{className:"text-base leading-relaxed transition-opacity duration-150",children:ee(Ie.content[0].description,it&&!Re&&(null===(A=Ie.options.find(e=>e.label===it))||void 0===A?void 0:A.text)||"")}):(0,P.jsx)(f.A,{content:te((Pt=Ie.content,Pt.map(e=>{if(("passage"===e.type||"question"===e.type||"text"===e.type)&&e.description){let t=e.description;if(t=t.replace(/\[underlined sentence:\s*(.*?)\]/gi,"<u>$1</u>"),t=t.replace(/\[([^\]]{20,})\](?!\()/g,"<u>$1</u>"),t!==e.description)return{...e,description:t}}return e})))})}),(0,P.jsx)("div",{className:"space-y-2 sm:space-y-3 mb-4 sm:mb-6",children:Ie.options.map(e=>(0,P.jsx)("button",{onClick:()=>!Re&&Le(e.label),onMouseEnter:()=>!Re&&ot(e.label),onMouseLeave:()=>ot(null),disabled:Re,className:"w-full text-left p-3 sm:p-4 rounded-lg border-2 transition-colors "+(Re?(null===Be||void 0===Be?void 0:Be.correctAnswer)===e.label?"bg-success-100 dark:bg-success-800/30 border-success-500 dark:border-success-600 text-success-800 dark:text-success-100":Me===e.label?"bg-error-100 dark:bg-error-800/30 border-error-500 dark:border-error-600 text-error-800 dark:text-error-100":"bg-neutral-50 dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 text-neutral-500 dark:text-neutral-400":Me===e.label?"bg-primary-100 dark:bg-primary-900/30 border-primary-500 dark:border-primary-600 text-primary-900 dark:text-primary-100":"bg-surface-raised dark:bg-gray-850 border-neutral-200 dark:border-neutral-700 text-neutral-900 dark:text-neutral-100 hover:border-primary-400 dark:hover:border-primary-500"),children:(0,P.jsxs)("div",{className:"flex items-start gap-3",children:[(0,P.jsxs)("span",{className:"font-bold text-base sm:text-lg",children:[e.label,"."]}),(0,P.jsx)("span",{className:"flex-1",children:(0,P.jsx)(v.A,{content:e.text,mode:"auto"})}),!1,Re&&(null===Be||void 0===Be?void 0:Be.correctAnswer)===e.label&&(0,P.jsx)("span",{className:"text-success-600 dark:text-success-500 font-bold",children:"\u2713"}),Re&&Me===e.label&&(null===Be||void 0===Be?void 0:Be.correctAnswer)!==e.label&&(0,P.jsx)("span",{className:"text-error-600 dark:text-error-500 font-bold",children:"\u2717"})]})},e.label))}),Re&&Be&&O&&(0,P.jsxs)("div",{className:"mb-4 sm:mb-6 p-3 sm:p-4 rounded-lg border "+(Be.isCorrect?"bg-success-50 dark:bg-success-800/20 border-success-200 dark:border-success-700":"bg-error-50 dark:bg-error-800/20 border-error-200 dark:border-error-700"),children:[(0,P.jsx)("h4",{className:"font-bold mb-2 "+(Be.isCorrect?"text-success-800 dark:text-success-100":"text-error-800 dark:text-error-100"),children:Be.isCorrect?"Correct! \ud83c\udf89":"Incorrect"}),!Be.isCorrect&&(0,P.jsxs)("p",{className:"text-error-800 dark:text-error-200 mb-2",children:["The correct answer is"," ",(0,P.jsx)("strong",{children:Be.correctAnswer})]}),z&&(Be.explanationBlocks||Be.explanation||Be.visualExplanation)&&(0,P.jsxs)("div",{className:"mt-3",children:[Be.visualExplanation&&(null===(C=Be.visualExplanation.steps)||void 0===C?void 0:C.length)>0&&(0,P.jsxs)("div",{className:"flex gap-2 mb-3",children:[(Be.explanationBlocks||Be.explanation)&&(0,P.jsx)("button",{onClick:()=>rt("text"),className:"px-3 py-1.5 text-sm font-medium rounded-md transition-colors "+("text"===tt?"bg-surface-raised dark:bg-neutral-700 text-text dark:text-text-subtle shadow-sm":"text-text-muted dark:text-text-subtle hover:text-text dark:hover:text-text-subtle"),children:"\ud83d\udcdd Text"}),(0,P.jsx)("button",{onClick:()=>rt("visual"),className:"px-3 py-1.5 text-sm font-medium rounded-md transition-colors "+("visual"===tt?"bg-surface-raised dark:bg-neutral-700 text-text dark:text-text-subtle shadow-sm":"text-text-muted dark:text-text-subtle hover:text-text dark:hover:text-text-subtle"),children:"\ud83c\udfaf Visual Guide"})]}),"text"===tt&&(0,P.jsx)("div",{className:"text-text-muted dark:text-text-subtle",children:Be.explanationBlocks&&Be.explanationBlocks.length>0?Be.explanationBlocks.map((e,t)=>(0,P.jsx)("div",{className:"mb-2",children:(0,P.jsx)(v.A,{content:e,mode:"auto"})},t)):Be.explanation?(0,P.jsx)(v.A,{content:Be.explanation,mode:"auto"}):null}
291),"visual"===tt&&Be.visualExplanation&&Ie&&(0,P.jsx)(y.Uw,{visualExplanation:Be.visualExplanation,problemContent:Ie.content,questionText:V(Ie.content,"\n\n"),answerChoices:Ie.options.map(e=>e.text),correctAnswerIndex:Ie.options.findIndex(e=>e.label===Be.correctAnswer)})]}),ie&&Be.ruleReference&&(0,P.jsx)("div",{className:"mt-3",children:(0,P.jsx)(k.N_,{to:ie,className:"text-primary-600 dark:text-primary-400 hover:underline text-sm",children:"View Grammar Rule Reference \u2192"})}),be&&Ie&&Be&&(0,P.jsx)("div",{className:"mt-3",children:(0,P.jsx)(R.N,{onClick:()=>{const e=V(Ie.content,"\n"),t=Ie.options.map(e=>e.text);be({questionText:e,options:t,studentAnswer:Me,correctAnswer:Be.correctAnswer,isCorrect:Be.isCorrect})}})})]}),(0,P.jsx)("div",{className:"flex gap-3 items-center",children:Re?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("button",{onClick:()=>{if(null!==Be&&void 0!==Be&&Be.tierCompleted&&null!==Be&&void 0!==Be&&Be.suggestedNextTier)return qe(!0),void Ne(Be.suggestedNextTier);qe(!0),ft({variables:{moduleId:T,difficultyTiers:[we]}})},className:"flex-1 px-4 py-2.5 sm:px-6 sm:py-3 bg-brand hover:bg-brand-hover text-white font-medium rounded-lg transition-colors",children:null!==Be&&void 0!==Be&&Be.tierCompleted&&null!==Be&&void 0!==Be&&Be.suggestedNextTier?`Continue to ${St(Be.suggestedNextTier)} \u2192`:"Next Question \u2192"}),(0,P.jsx)(G.r,{status:null===nt||void 0===nt?void 0:nt.status,outcome:null===nt||void 0===nt?void 0:nt.outcome}),(0,P.jsxs)("button",{onClick:()=>at(!0),className:"flex items-center justify-center text-neutral-400 hover:text-neutral-600 hover:bg-neutral-100 dark:hover:text-neutral-300 dark:hover:bg-neutral-800 rounded-md transition-colors w-8 h-8 sm:w-auto sm:h-auto sm:px-3 sm:py-1.5 sm:gap-1.5",title:fe("Report Issue"),"aria-label":fe("Report a problem"),children:[(0,P.jsx)(d.A,{size:14,className:"sm:w-4 sm:h-4"}),(0,P.jsx)("span",{className:"hidden sm:inline text-xs font-medium",children:fe("Report")})]})]}):(0,P.jsx)("button",{onClick:async()=>{if(ke||!Me||!Ie)return;const e=Math.floor((Date.now()-Oe)/1e3);Ye(null);try{await jt({variables:{moduleId:T,problemId:Ie.isLearningProblem?void 0:Ie.id,learningProblemId:Ie.isLearningProblem?Ie.id:void 0,selectedAnswer:Me,timeSpentSeconds:e}})}catch(t){console.error("Failed to submit answer:",t)}},disabled:!Me||wt,className:"flex-1 px-4 py-2.5 sm:px-6 sm:py-3 bg-brand hover:bg-brand-hover disabled:bg-neutral-400 disabled:cursor-not-allowed text-white font-medium rounded-lg transition-colors",children:wt?"Submitting...":"Submit Answer"})})]})]})}),(0,P.jsx)(L,{moduleId:T,onTryAgain:e=>{_e({id:e.id,isLearningProblem:!0,content:e.content,options:e.options,difficultyTier:e.difficultyTier,remainingCount:0}),Ne(e.difficultyTier),Le(""),De(!1),Fe(null),ze(Date.now()),Ue(!1),qe(!1),window.scrollTo({top:0,behavior:"smooth"})},refreshTrigger:ut}),Ie&&(0,P.jsx)(U.A,{isOpen:st,onClose:()=>at(!1),problemId:Ie.id,problemSource:Ie.isLearningProblem?"learning_problems":"problems",existingReport:nt&&!(0,X.TQ)(nt.status)?nt:null,showTrackItLink:lt}),(null===I||void 0===I?void 0:I[0])&&(0,P.jsx)(H,{isOpen:Te,onClose:()=>$e(!1),moduleTitle:void 0,tagId:I[0]})]});var Pt,Tt},se="flex-1 min-w-fit p-2 sm:p-3 rounded-xl border-2 transition-all text-left",ae="flex flex-col items-start gap-0.5 sm:flex-row sm:items-center sm:justify-between sm:gap-2",ne="text-xs font-semibold uppercase tracking-normal sm:tracking-wide",le=e=>{let{label:t,done:r,total:s,isSelected:a,isComplete:n,accent:l,onClick:i,ariaLabel:o}=e;const d=s>0?Math.min(r/s*100,100):0,c="indigo"===l?"border-indigo-400 bg-indigo-50 dark:bg-indigo-900/20 dark:border-indigo-600":"border-primary-400 bg-primary-50 dark:bg-primary-900/20 dark:border-primary-600",u="indigo"===l?"border-indigo-200 dark:border-indigo-800 hover:border-indigo-300 dark:hover:border-indigo-700":"border-primary-200 dark:border-primary-800 hover:border-primary-300 dark:hover:border-primary-700",m="indigo"===l?a?"text-indigo-700 dark:text-indigo-300":"text-indigo-600 dark:text-indigo-400":a?"text-primary-700 dark:text-primary-300":"text-primary-600 dark:text-primary-400",x="indigo"===l?"bg-indigo-100 dark:bg-indigo-900/40":"bg-primary-100 dark:bg-primary-900/40",p="indigo"===l?"bg-indigo-500 dark:bg-indigo-400":"bg-primary-500 dark:bg-primary-400";return(0,P.jsxs)("button",{onClick:i,"aria-label":o,className:`${se} ${a?n?"border-success-500 bg-success-50 dark:bg-success-800/20 dark:border-success-600":c:n?"border-success-200 dark:border-success-700 hover:border-success-200":u}`,children:[(0,P.jsxs)("div",{className:`${ae} mb-1.5`,children:[(0,P.jsx)("span",{className:`${ne} ${a?"text-neutral-900 dark:text-neutral-100":"text-neutral-700 dark:text-neutral-300"}`,children:t}),n?(0,P.jsx)("span",{className:"text-success-600 dark:text-success-500 text-sm",children:"\u2713"}):(0,P.jsxs)("span",{className:`text-xs font-medium ${m}`,children:[r,"/",s]})]}),(0,P.jsx)("div",{className:`w-full h-1.5 ${x} rounded-full overflow-hidden`,children:(0,P.jsx)("div",{className:`h-1.5 rounded-full transition-all duration-500 ${n?"bg-success-500 dark:bg-success-500":p}`,style:{width:`${d}%`}})})]})}}}]);

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.