@edpire/sdk 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import"./chunk-76CZ6Z7T.mjs";import Ao from"react";import{createRoot as No}from"react-dom/client";import{useCallback as ko,useMemo as hl,useState as gl}from"react";import{cloneElement as fo,isValidElement as ho,useCallback as Je,useEffect as kt,useMemo as Le,useRef as Ir,useState as je}from"react";import{jsx as hr}from"react/jsx-runtime";import{useEffect as ft,useMemo as mc,useRef as uc}from"react";import Do from"mitt";var Oe=class{constructor(){this.emitter=Do(),this.answers=new Map}emit(r){if(r.type==="answer:changed")this.answers.set(r.answer.nodeId,r.answer);else if(r.type==="answers:reset")this.answers.clear();else if(r.type==="answers:prefill")for(let t of r.answers)this.answers.set(t.nodeId,t);this.emitter.emit(r.type,r)}on(r,t){this.emitter.on(r,t)}off(r,t){this.emitter.off(r,t)}getAllAnswers(){return Array.from(this.answers.values())}clearAnswers(){this.answers.clear(),this.emit({type:"answers:reset"})}prefillAnswers(r){this.emit({type:"answers:prefill",answers:r})}submitAnswers(){this.emit({type:"answer:submitted",answers:this.getAllAnswers(),timestamp:Date.now()})}},$n="__edpireGlobalAnswerBus",zn=globalThis,Or=zn[$n]??(zn[$n]=new Oe);import{jsx as jo}from"react/jsx-runtime";import{createContext as Fo,useContext as Oo}from"react";var Dn="__edpireAnswerBusContext",jn=globalThis,Fn=jn[Dn]??(jn[Dn]=Fo(Or));function le(){return Oo(Fn)}function Br({children:e,bus:r=new Oe}){return jo(Fn.Provider,{value:r,children:e})}import{jsx as me,jsxs as nr}from"react/jsx-runtime";import{Fragment as ks,useState as na,useEffect as Ot,useMemo as Rs}from"react";import Be from"clsx";import{jsx as B,jsxs as Xn}from"react/jsx-runtime";import Bo from"katex";import"katex/dist/contrib/mhchem.js";var Wo={"\\d":"\\mathrm{d}","\\R":"\\mathbb{R}","\\N":"\\mathbb{N}","\\Z":"\\mathbb{Z}","\\Q":"\\mathbb{Q}","\\C":"\\mathbb{C}"};function Ze(e,r,t=!0){try{return Bo.renderToString(e,{displayMode:r,output:t?"htmlAndMathml":"html",throwOnError:!1,errorColor:"#cc0000",macros:Wo,strict:!1})}catch(n){return`<span class="katex-error" style="color:#cc0000" title="${String(n)}">${e}</span>`}}function E(e){return`calc(${typeof e=="number"?`${e}px`:e} * var(--edp-scale, 1))`}function re(e){return{width:E(e),height:E(e)}}function Ee(e){if(e==null||e==="")return;if(typeof e=="number")return E(e);let r=String(e).trim();return/^\d+(\.\d+)?px$/.test(r)?E(r):r}import{createContext as qo}from"react";var kr=qo(!1),Wr="1px solid #d1d5db",Ho="#f3f4f6",Uo="#e3e1dc",Vo="var(--card, #fff)",er="edp-table-first",On={overflowX:"auto",margin:`${E("1.25rem")} 0`},Bn={left:!1,right:!1,held:0,rtl:!1};function Wn(e,r,t,n=0){return{left:r.left<e.left-1,right:r.right>e.right+1,held:n,rtl:t}}function qn(e,r){return Math.max(80,Math.round((e-r)*.8))}var Mt={borderCollapse:"separate",borderSpacing:0,width:"100%",tableLayout:"auto",fontSize:E("0.875rem"),lineHeight:1.3,borderBlockStart:Wr,borderInlineStart:Wr};function Rr(e){let r=e.gray?Uo:e.header?Ho:e.sticky?Vo:void 0;return{borderBlockEnd:Wr,borderInlineEnd:Wr,padding:`${E("4px")} ${E("6px")}`,verticalAlign:"middle",overflowWrap:"normal",wordBreak:"normal",hyphens:"manual",...r?{background:r}:{},...e.header?{fontWeight:600}:{},...e.sticky?{position:"sticky",insetInlineStart:0,zIndex:1}:{}}}function Sr(e){return Object.entries(e).map(([r,t])=>`${r.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}:${t}`).join(";")}function It(e){let r=[],t=new Set,n=[];(e??[]).forEach((o,i)=>{let c=0;(o.content??[]).forEach(l=>{for(;n[i]?.[c];)c++;let d=Math.max(1,l.attrs?.colspan??1),p=Math.max(1,l.attrs?.rowspan??1);for(let m=i;m<i+p;m++){let g=n[m]??(n[m]=[]);for(let u=c;u<c+d;u++)g[u]=!0}for(let m=0;m<d;m++){let g=l.attrs?.colwidth?.[m];g&&r[c+m]==null&&(r[c+m]=g)}c===0&&d===1&&t.add(l),c+=d})});let a=n.reduce((o,i)=>Math.max(o,i.length),0);return{columnWidths:r.some(o=>o!=null)?Array.from({length:a},(o,i)=>r[i]??null):[],stickyCells:t}}function $t(e){return e.replace(/(\d) (?=\d)/g,"$1\xA0").replace(/(\d) (?=[\p{L}%\p{Sc}]{1,3}(?![\p{L}\p{N}]))/gu,"$1\xA0")}import{jsx as Ie,jsxs as Dt}from"react/jsx-runtime";import{useCallback as Ko,useEffect as Xo,useLayoutEffect as Jo,useRef as Zo,useState as es}from"react";import{jsx as Go}from"react/jsx-runtime";import{createContext as Qo,useContext as Hn}from"react";var dr={submitButton:"Submit",showHint:"Show hint",clickToRemove:"Click to remove",blankAnswerAria:"Your answer",aiEvaluationInProgress:"AI evaluation in progress\u2026",aiEvaluationInProgressAria:"AI evaluation in progress",shortAnswerPlaceholder:"Short answer\u2026",longAnswerPlaceholder:"Write your answer here\u2026",minWordsLabel:e=>`Min: ${e}`,wordBank:"Word Bank",chooseN:e=>`(choose ${e})`,annexDefaultLabel:"Documents",annexOpen:e=>`Open ${e}`,annexClose:"Close",referenceInPanel:e=>`This exercise's text is in ${e}.`,readReference:"Read it",referenceForExercise:e=>`Exercise ${e}`,choiceLetters:"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),tableScrollLeft:"Show the columns on the left",tableScrollRight:"Show the columns on the right",mathChecking:"Checking your answer\u2026",mathCorrect:"Correct",mathIncorrect:"Incorrect",openResponseTextPlaceholder:"Write your answer here\u2026",openResponseWords:"words",openResponseChars:"chars",openResponseDropZoneLabel:"Drag & drop files here, or",openResponseDropZoneBrowse:"browse",openResponseUploading:"Uploading\u2026",openResponseNoSubmission:"No submission",openResponseFile:"File",openResponseAttachFile:"Attach a file",openResponseAttachFiles:"Attach files",openResponseAttachedFiles:"Attached files",openResponseTypeImage:"Image",openResponseTypePdf:"PDF",openResponseTypeAudio:"Audio",openResponseTypeVideo:"Video",openResponseTypeVideoLink:"Video link",openResponseVideoLinkPlaceholder:"Paste YouTube or Vimeo URL\u2026",openResponseAddVideoLink:"Add",openResponseTapToRecord:"Tap to start recording",openResponseTapToRecordScreen:"Click to start screen recording",openResponseRequestingPermission:"Requesting permission\u2026",openResponsePermissionDenied:"Microphone/camera access denied. Please allow access in your browser settings.",openResponseMediaHandlerRequired:"A media handler is required to save recordings.",openResponseStopRecording:"Stop",openResponseReRecord:"Re-record",openResponseConfirmRecording:"Use this recording",openResponseRecordingSubmitted:"Recording submitted",openResponseAwaitingReview:"Submitted, awaiting teacher review",openResponseTeacherFeedbackLabel:"Teacher feedback",openResponseGradeThisResponse:"Grade this response",openResponseGradeScoreLabel:e=>`Score (max ${e})`,openResponseGradeFeedbackLabel:"Feedback (optional)",openResponseGradeFeedbackPlaceholder:"Add feedback for the student\u2026",openResponseSubmitGrade:"Submit Grade",openResponseGradeSubmitted:(e,r)=>`Grade submitted: ${e} / ${r}`,openResponseRubricTitle:"Rubric",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} pts`,openResponseAiSuggestionTitle:"AI Pre-grading Suggestion",openResponseAiSuggestedScore:(e,r)=>`Suggested score: ${e} / ${r}`,openResponseAiEvidence:"Evidence:",openResponseAiApplySuggestion:"Apply suggestion",openResponseStudentAnswerTitle:"Student answer"};var qr={submitButton:"Valider",showHint:"Voir l'indice",clickToRemove:"Cliquer pour retirer",blankAnswerAria:"Votre r\xE9ponse",aiEvaluationInProgress:"\xC9valuation IA en cours\u2026",aiEvaluationInProgressAria:"\xC9valuation IA en cours",shortAnswerPlaceholder:"R\xE9ponse courte\u2026",longAnswerPlaceholder:"\xC9crivez votre r\xE9ponse ici\u2026",minWordsLabel:e=>`Min. : ${e}`,wordBank:"Banque de mots",chooseN:e=>`(choisir ${e})`,annexDefaultLabel:"Documents",annexOpen:e=>`Ouvrir ${e}`,annexClose:"Fermer",referenceInPanel:e=>`Le texte de cet exercice est dans \xAB ${e} \xBB.`,readReference:"Le lire",referenceForExercise:e=>`Exercice ${e}`,choiceLetters:"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),tableScrollLeft:"Voir les colonnes de gauche",tableScrollRight:"Voir les colonnes de droite",mathChecking:"V\xE9rification de votre r\xE9ponse\u2026",mathCorrect:"Juste",mathIncorrect:"Faux",openResponseTextPlaceholder:"\xC9crivez votre r\xE9ponse ici\u2026",openResponseWords:"mots",openResponseChars:"car.",openResponseDropZoneLabel:"Glissez-d\xE9posez des fichiers ici, ou",openResponseDropZoneBrowse:"parcourir",openResponseUploading:"Envoi en cours\u2026",openResponseNoSubmission:"Aucun fichier d\xE9pos\xE9",openResponseFile:"Fichier",openResponseAttachFile:"Joindre un fichier",openResponseAttachFiles:"Joindre des fichiers",openResponseAttachedFiles:"Fichiers joints",openResponseTypeImage:"Image",openResponseTypePdf:"PDF",openResponseTypeAudio:"Audio",openResponseTypeVideo:"Vid\xE9o",openResponseTypeVideoLink:"Lien vid\xE9o",openResponseVideoLinkPlaceholder:"Coller un lien YouTube ou Vimeo\u2026",openResponseAddVideoLink:"Ajouter",openResponseTapToRecord:"Appuyer pour d\xE9marrer l'enregistrement",openResponseTapToRecordScreen:"Cliquer pour d\xE9marrer l'enregistrement d'\xE9cran",openResponseRequestingPermission:"Demande d'autorisation\u2026",openResponsePermissionDenied:"Acc\xE8s au micro/cam\xE9ra refus\xE9. Autorise l'acc\xE8s dans les param\xE8tres du navigateur.",openResponseMediaHandlerRequired:"Un gestionnaire de m\xE9dias est requis pour sauvegarder les enregistrements.",openResponseStopRecording:"Arr\xEAter",openResponseReRecord:"R\xE9enregistrer",openResponseConfirmRecording:"Utiliser cet enregistrement",openResponseRecordingSubmitted:"Enregistrement soumis",openResponseAwaitingReview:"Soumis, en attente de correction par l'enseignant",openResponseTeacherFeedbackLabel:"Commentaire de l'enseignant",openResponseGradeThisResponse:"Corriger cette r\xE9ponse",openResponseGradeScoreLabel:e=>`Note (max ${e})`,openResponseGradeFeedbackLabel:"Commentaire (facultatif)",openResponseGradeFeedbackPlaceholder:"Ajouter un commentaire pour l'\xE9l\xE8ve\u2026",openResponseSubmitGrade:"Valider la note",openResponseGradeSubmitted:(e,r)=>`Note envoy\xE9e : ${e} / ${r}`,openResponseRubricTitle:"Grille d'\xE9valuation",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} pts`,openResponseAiSuggestionTitle:"Suggestion de correction par IA",openResponseAiSuggestedScore:(e,r)=>`Score sugg\xE9r\xE9 : ${e} / ${r}`,openResponseAiEvidence:"Extrait :",openResponseAiApplySuggestion:"Appliquer la suggestion",openResponseStudentAnswerTitle:"R\xE9ponse de l'\xE9l\xE8ve"};var Hr={submitButton:"\u0625\u0631\u0633\u0627\u0644",showHint:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062A\u0644\u0645\u064A\u062D",clickToRemove:"\u0627\u0646\u0642\u0631 \u0644\u0644\u0625\u0632\u0627\u0644\u0629",blankAnswerAria:"\u0625\u062C\u0627\u0628\u062A\u0643",aiEvaluationInProgress:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A\u2026",aiEvaluationInProgressAria:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",shortAnswerPlaceholder:"\u0625\u062C\u0627\u0628\u0629 \u0642\u0635\u064A\u0631\u0629\u2026",longAnswerPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627\u2026",minWordsLabel:e=>`\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649: ${e}`,wordBank:"\u0628\u0646\u0643 \u0627\u0644\u0643\u0644\u0645\u0627\u062A",chooseN:e=>`(\u0627\u062E\u062A\u0631 ${e})`,annexDefaultLabel:"\u0627\u0644\u0645\u0633\u062A\u0646\u062F\u0627\u062A",annexOpen:e=>`\u0641\u062A\u062D ${e}`,annexClose:"\u0625\u063A\u0644\u0627\u0642",referenceInPanel:e=>`\u0646\u0635 \u0647\u0630\u0627 \u0627\u0644\u062A\u0645\u0631\u064A\u0646 \u0641\u064A \xAB${e}\xBB.`,readReference:"\u0627\u0642\u0631\u0623\u0647",referenceForExercise:e=>`\u0627\u0644\u062A\u0645\u0631\u064A\u0646 ${e}`,choiceLetters:["\u0623","\u0628","\u062C","\u062F","\u0647\u0640","\u0648","\u0632","\u062D","\u0637","\u064A","\u0643","\u0644","\u0645","\u0646","\u0633","\u0639","\u0641","\u0635","\u0642","\u0631","\u0634","\u062A","\u062B","\u062E","\u0630","\u0636","\u0638","\u063A"],tableScrollLeft:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0639\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",tableScrollRight:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0639\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",mathChecking:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0646 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",mathCorrect:"\u0635\u062D\u064A\u062D",mathIncorrect:"\u062E\u0637\u0623",openResponseTextPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627\u2026",openResponseWords:"\u0643\u0644\u0645\u0629",openResponseChars:"\u062D\u0631\u0641",openResponseDropZoneLabel:"\u0627\u0633\u062D\u0628 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0648\u0623\u0641\u0644\u062A\u0647\u0627 \u0647\u0646\u0627\u060C \u0623\u0648",openResponseDropZoneBrowse:"\u062A\u0635\u0641\u0651\u062D",openResponseUploading:"\u062C\u0627\u0631\u064D \u0627\u0644\u0631\u0641\u0639\u2026",openResponseNoSubmission:"\u0644\u0627 \u064A\u0648\u062C\u062F \u062A\u0633\u0644\u064A\u0645",openResponseFile:"\u0645\u0644\u0641",openResponseAttachFile:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641",openResponseAttachFiles:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",openResponseAttachedFiles:"\u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0627\u0644\u0645\u0631\u0641\u0642\u0629",openResponseTypeImage:"\u0635\u0648\u0631\u0629",openResponseTypePdf:"PDF",openResponseTypeAudio:"\u0635\u0648\u062A",openResponseTypeVideo:"\u0641\u064A\u062F\u064A\u0648",openResponseTypeVideoLink:"\u0631\u0627\u0628\u0637 \u0641\u064A\u062F\u064A\u0648",openResponseVideoLinkPlaceholder:"\u0627\u0644\u0635\u0642 \u0631\u0627\u0628\u0637 \u064A\u0648\u062A\u064A\u0648\u0628 \u0623\u0648 Vimeo\u2026",openResponseAddVideoLink:"\u0625\u0636\u0627\u0641\u0629",openResponseTapToRecord:"\u0627\u0646\u0642\u0631 \u0644\u0628\u062F\u0621 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseTapToRecordScreen:"\u0627\u0646\u0642\u0631 \u0644\u0628\u062F\u0621 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0634\u0627\u0634\u0629",openResponseRequestingPermission:"\u062C\u0627\u0631\u064D \u0637\u0644\u0628 \u0627\u0644\u0625\u0630\u0646\u2026",openResponsePermissionDenied:"\u062A\u0645 \u0631\u0641\u0636 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u064A\u0643\u0631\u0648\u0641\u0648\u0646/\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627. \u064A\u064F\u0631\u062C\u0649 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0627\u0644\u0648\u0635\u0648\u0644 \u0645\u0646 \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0645\u062A\u0635\u0641\u062D.",openResponseMediaHandlerRequired:"\u064A\u0644\u0632\u0645 \u0645\u0639\u0627\u0644\u062C \u0648\u0633\u0627\u0626\u0637 \u0644\u062D\u0641\u0638 \u0627\u0644\u062A\u0633\u062C\u064A\u0644\u0627\u062A.",openResponseStopRecording:"\u0625\u064A\u0642\u0627\u0641",openResponseReRecord:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseConfirmRecording:"\u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0647\u0630\u0627 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseRecordingSubmitted:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseAwaitingReview:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u060C \u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631 \u0645\u0631\u0627\u062C\u0639\u0629 \u0627\u0644\u0645\u0639\u0644\u0645",openResponseTeacherFeedbackLabel:"\u0645\u0644\u0627\u062D\u0638\u0627\u062A \u0627\u0644\u0645\u0639\u0644\u0645",openResponseGradeThisResponse:"\u062A\u0635\u062D\u064A\u062D \u0647\u0630\u0647 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",openResponseGradeScoreLabel:e=>`\u0627\u0644\u062F\u0631\u062C\u0629 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 ${e})`,openResponseGradeFeedbackLabel:"\u0645\u0644\u0627\u062D\u0638\u0627\u062A (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",openResponseGradeFeedbackPlaceholder:"\u0623\u0636\u0641 \u0645\u0644\u0627\u062D\u0638\u0627\u062A \u0644\u0644\u0637\u0627\u0644\u0628\u2026",openResponseSubmitGrade:"\u0627\u0639\u062A\u0645\u0627\u062F \u0627\u0644\u062F\u0631\u062C\u0629",openResponseGradeSubmitted:(e,r)=>`\u062A\u0645 \u0627\u0639\u062A\u0645\u0627\u062F \u0627\u0644\u062F\u0631\u062C\u0629: ${e} / ${r}`,openResponseRubricTitle:"\u0633\u0644\u0651\u0645 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} \u0646\u0642\u0637\u0629`,openResponseAiSuggestionTitle:"\u0627\u0642\u062A\u0631\u0627\u062D \u0627\u0644\u062A\u0635\u062D\u064A\u062D \u0627\u0644\u0645\u0633\u0628\u0642 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",openResponseAiSuggestedScore:(e,r)=>`\u0627\u0644\u062F\u0631\u062C\u0629 \u0627\u0644\u0645\u0642\u062A\u0631\u062D\u0629: ${e} / ${r}`,openResponseAiEvidence:"\u0627\u0644\u0623\u062F\u0644\u0629:",openResponseAiApplySuggestion:"\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0627\u0642\u062A\u0631\u0627\u062D",openResponseStudentAnswerTitle:"\u0625\u062C\u0627\u0628\u0629 \u0627\u0644\u0637\u0627\u0644\u0628"};var Yo={en:dr,fr:qr,ar:Hr},zt=Qo(null);function Z(){return Hn(zt)??dr}function _r(e){let r=Hn(zt);return e&&Yo[e]||r||dr}function Cr({locale:e,children:r}){let t=_r(e);return Go(zt.Provider,{value:t,children:r})}var rs=typeof window<"u"?Jo:Xo;function Un({side:e}){return Ie("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Ie("path",{d:e==="left"?"M15 6l-6 6 6 6":"M9 6l6 6-6 6"})})}function Vn({children:e}){let r=Z(),t=Zo(null),[n,a]=es(Bn),s=Ko(()=>{let p=t.current,m=p?.querySelector("table");if(!p||!m)return;let g=p.querySelector(`.${er}`),u=Wn(p.getBoundingClientRect(),m.getBoundingClientRect(),getComputedStyle(p).direction==="rtl",g?g.getBoundingClientRect().width:0);a(b=>b.left===u.left&&b.right===u.right&&b.held===u.held&&b.rtl===u.rtl?b:u)},[]);rs(()=>{let p=t.current;if(!p)return;s(),p.addEventListener("scroll",s,{passive:!0});let m=typeof ResizeObserver<"u"?new ResizeObserver(s):null;m?.observe(p);let g=p.querySelector("table");return g&&m?.observe(g),()=>{p.removeEventListener("scroll",s),m?.disconnect()}},[s]);let o=p=>{let m=t.current;m&&m.scrollBy({left:p*qn(m.clientWidth,n.held),behavior:"smooth"})},i=n.left||n.right,c=p=>i?Ie("div",{className:`edp-table-arrows edp-table-arrows--${p}`,children:Dt("span",{dir:"ltr",className:"edp-table-arrows__pair",children:[Ie("button",{type:"button",className:"edp-table-arrow",onClick:()=>o(-1),disabled:!n.left,"aria-label":r.tableScrollLeft,children:Ie(Un,{side:"left"})}),Ie("button",{type:"button",className:"edp-table-arrow",onClick:()=>o(1),disabled:!n.right,"aria-label":r.tableScrollRight,children:Ie(Un,{side:"right"})})]})}):null,l=n.rtl?0:n.held,d=n.rtl?n.held:0;return Dt("div",{className:"edp-table-frame",style:{margin:`${E("1.25rem")} 0`},children:[c("top"),Dt("div",{style:{position:"relative"},children:[Ie("div",{ref:t,className:"edp-table-scroll",style:{overflowX:"auto"},children:e}),n.left&&Ie("span",{className:"edp-table-shade edp-table-shade--left",style:{left:l},"aria-hidden":"true"}),n.right&&Ie("span",{className:"edp-table-shade edp-table-shade--right",style:{right:d},"aria-hidden":"true"})]}),c("bottom")]})}var Gn={1:{fontSize:"1.75em",fontWeight:700,lineHeight:1.2,margin:"0.6em 0 0.4em"},2:{fontSize:"1.4em",fontWeight:700,lineHeight:1.25,margin:"0.6em 0 0.35em"},3:{fontSize:"1.15em",fontWeight:600,lineHeight:1.3,margin:"0.5em 0 0.3em"}},Qn={border:"#2563eb",background:"#e0f2fe"},Yn={border:"#dc2626",background:"#fee2e2"};function ts(e){return{display:"inline-block",verticalAlign:"middle",border:`2px solid ${e?.border||Qn.border}`,background:e?.background||Qn.background,borderRadius:E("4px"),padding:"0.17em 0.37em"}}function ns(e){let r=e?.shape==="circle"?"50%":"9999px";return{display:"inline-block",verticalAlign:"middle",border:`2px solid ${e?.border||Yn.border}`,background:e?.background||Yn.background,borderRadius:r,padding:"0.15em 0.45em"}}function as(e,r){if(!(!e&&!r))return{...e?{textAlign:e}:{},...r?{margin:0}:{}}}function Se(e,r,t){return B("div",{className:"exercise-content",children:e.content.map((n,a)=>xe(n,`node-${a}`,r,t))})}var os=/^[\u00a0\u202f ]?[.,;:!?\u2026)\]}\u00bb\u201d\u2019%\u060c\u061b\u061f]+/,ss=new Set(["blank","inlineChoiceSet"]);function Kn(e,r,t,n){let a=[],s=e??[];for(let o=0;o<s.length;o++){let i=s[o],c=s[o+1],l=ss.has(i.type)&&c?.type==="text"?os.exec(c.text??"")?.[0]:void 0;if(!l||!c){a.push(xe(i,`${r}-${o}`,t,n));continue}let d=(c.text??"").slice(l.length);a.push(Xn("span",{style:{whiteSpace:"nowrap"},children:[B("span",{style:{whiteSpace:"normal"},children:xe(i,`${r}-${o}-a`,t,n)}),xe({...c,text:l},`${r}-${o}-p`,t,n)]},`${r}-${o}`)),d&&a.push(xe({...c,text:d},`${r}-${o+1}`,t,n)),o++}return a}function xe(e,r,t,n){switch(e.type){case"choiceSet":case"inlineChoiceSet":return B(Vr,{node:e,validationFeedback:t?.get(e.id)},r);case"blank":return e.attrs.mode==="typed"?B(Gr,{node:e,validationFeedback:t?.get(e.id)},r):B(Qr,{node:e,validationFeedback:t?.get(e.id)},r);case"blankPool":return B(Yr,{node:e},r);case"inlinePool":return B(Kr,{node:e},r);case"matchingSet":return B(Xr,{node:e,validationFeedback:t?.get(e.id)},r);case"aiAnswerInput":return B(Jr,{node:e,validationFeedback:t?.get(e.id)},r);case"openResponseNode":return B(Zr,{node:e,validationFeedback:t?.get(e.id),readOnly:n?.readOnly,mediaHandler:n?.mediaHandler},r);case"mathResponse":return B(et,{nodeId:e.id,placeholder:e.attrs?.placeholder,hint:e.attrs?.hint,validationFeedback:t?.get(e.id),readOnly:n?.readOnly},r);case"codingResponse":return B(rt,{node:e,validationFeedback:t?.get(e.id),readOnly:n?.readOnly,executor:n?.codeExecutor},r);case"aiEvaluationConfig":return null;case"paragraph":{let a=e.attrs,s=a?.textAlign,o=a?.dir||void 0;return B("p",{dir:o,style:as(s,n?.inTable),children:Kn(e.content,r,t,n)},r)}case"heading":{let a=e.attrs.level??1,s=`h${a}`,o=e.attrs,i=o?.textAlign,c=o?.dir||void 0,l=Gn[a]??Gn[3];return B(s,{dir:c,style:{...l,...i?{textAlign:i}:{}},children:Kn(e.content,r,t,n)},r)}case"blockquote":{let a=e.attrs,s=a?.dir||void 0,o=a?.textAlign;return B("blockquote",{dir:s,style:{borderInlineStart:"3px solid #d6d3cc",paddingInlineStart:"1em",margin:"0.75em 0",color:"#565b66",fontStyle:"italic",...o?{textAlign:o}:{}},children:e.content?.map((i,c)=>xe(i,`${r}-${c}`,t,n))},r)}case"text":{let a=e,s=n?.inTable?$t(a.text??""):a.text??"",o=a.marks??[];if(o.length===0)return B("span",{children:s},r);let i={};for(let l of o)l.type==="textStyle"&&(l.attrs?.color&&(i.color=l.attrs.color),l.attrs?.fontSize&&(i.fontSize=l.attrs.fontSize),l.attrs?.fontFamily&&(i.fontFamily=l.attrs.fontFamily));let c=s;for(let l of o)switch(l.type){case"bold":c=B("strong",{children:c});break;case"italic":c=B("em",{children:c});break;case"underline":c=B("u",{children:c});break;case"strike":c=B("s",{children:c});break;case"code":c=B("code",{children:c});break;case"subscript":c=B("sub",{children:c});break;case"superscript":c=B("sup",{children:c});break;case"boxedText":c=B("span",{style:ts(l.attrs),children:c});break;case"circleText":c=B("span",{style:ns(l.attrs),children:c});break}return B("span",{style:Object.keys(i).length>0?i:void 0,children:c},r)}case"hardBreak":return B("br",{},r);case"resizableImage":return B("img",{src:e.attrs?.src||void 0,alt:e.attrs?.alt||"",style:{display:"inline-block",verticalAlign:"middle",width:Ee(e.attrs?.width||void 0)??"auto",height:Ee(e.attrs?.height||void 0)??"auto",maxWidth:"100%"}},r);case"resizableAudio":return B("span",{style:{display:"inline-flex",verticalAlign:"middle",alignItems:"center",background:"#f1f5f9",borderRadius:E("8px"),padding:`${E("4px")} ${E("8px")}`,maxWidth:"100%"},children:B("audio",{controls:!0,src:e.attrs?.src||void 0,style:{display:"block",width:E("320px"),maxWidth:"100%"}})},r);case"resizableVideo":return B("video",{src:e.attrs?.src||void 0,controls:!0,style:{display:"inline-block",verticalAlign:"middle",width:Ee(e.attrs?.width||void 0)??"auto",height:Ee(e.attrs?.height||void 0)??"auto",maxWidth:"100%"}},r);case"youtubeEmbed":return B("iframe",{src:`https://www.youtube.com/embed/${e.attrs?.videoId||""}`,width:e.attrs?.width||480,height:e.attrs?.height||270,allowFullScreen:!0,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",style:{display:"inline-block",verticalAlign:"middle",border:0,width:Ee(e.attrs?.width||480),height:Ee(e.attrs?.height||270)}},r);case"inlineMath":return B("span",{dir:"ltr",style:{unicodeBidi:"isolate",display:"inline-block"},className:"math-inline",dangerouslySetInnerHTML:{__html:Ze(e.attrs?.latex??"",!1,!0)}},r);case"blockMath":return B("div",{dir:"ltr",style:{unicodeBidi:"isolate",textAlign:"center",margin:"1em 0"},className:"math-block",dangerouslySetInnerHTML:{__html:Ze(e.attrs?.latex??"",!0,!0)}},r);case"variable":return B("span",{className:"variable",children:`{${e.attrs?.name}}`},r);default:{let a=e;if(a.type==="bulletList")return B("ul",{style:{listStyleType:"disc",paddingLeft:"1.5em",margin:"0.5em 0"},children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))},r);if(a.type==="orderedList")return B("ol",{style:{listStyleType:"decimal",paddingLeft:"1.5em",margin:"0.5em 0"},children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))},r);if(a.type==="listItem")return B("li",{children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))},r);if(a.type==="table"){let s=It(a.content),o={...n,inTable:!0,stickyCells:s.stickyCells};return B(Vn,{children:Xn("table",{style:Mt,children:[s.columnWidths.length>0&&B("colgroup",{children:s.columnWidths.map((i,c)=>B("col",{style:i?{width:E(i)}:void 0},c))}),B("tbody",{children:a.content?.map((i,c)=>xe(i,`${r}-${c}`,t,o))})]})},r)}return a.type==="tableRow"?B("tr",{children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))},r):a.type==="tableCell"?B("td",{colSpan:a.attrs?.colspan,rowSpan:a.attrs?.rowspan,className:n?.stickyCells?.has(a)?er:void 0,style:Rr({header:!1,gray:!!a.attrs?.gray,sticky:!!n?.stickyCells?.has(a)}),children:B(kr.Provider,{value:!0,children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))})},r):a.type==="tableHeader"?B("th",{colSpan:a.attrs?.colspan,rowSpan:a.attrs?.rowspan,className:n?.stickyCells?.has(a)?er:void 0,style:Rr({header:!0,gray:!!a.attrs?.gray,sticky:!!n?.stickyCells?.has(a)}),children:B(kr.Provider,{value:!0,children:a.content?.map((s,o)=>xe(s,`${r}-${o}`,t,n))})},r):(console.warn(`Unknown node type during interpretation: ${e.type}`),null)}}}function te(e,r){return e.map(t=>{if(t.type==="text"){let n=rr(r?.inTable?$t(t.text??""):t.text??""),a=t.marks??[],s=[];for(let o of a)o.type==="textStyle"&&(o.attrs?.color&&s.push(`color:${o.attrs.color}`),o.attrs?.fontSize&&s.push(`font-size:${o.attrs.fontSize}`),o.attrs?.fontFamily&&s.push(`font-family:${o.attrs.fontFamily}`));s.length>0&&(n=`<span style="${s.join(";")}">${n}</span>`);for(let o of a)switch(o.type){case"bold":n=`<strong>${n}</strong>`;break;case"italic":n=`<em>${n}</em>`;break;case"underline":n=`<u>${n}</u>`;break;case"strike":n=`<s>${n}</s>`;break;case"code":n=`<code>${n}</code>`;break;case"subscript":n=`<sub>${n}</sub>`;break;case"superscript":n=`<sup>${n}</sup>`;break;case"boxedText":{let i=o.attrs?.border||"#2563eb",c=o.attrs?.background||"#e0f2fe";n=`<span style="display:inline-block;vertical-align:middle;border:2px solid ${i};background:${c};border-radius:${E("4px")};padding:0.17em 0.37em">${n}</span>`;break}case"circleText":{let i=o.attrs?.border||"#dc2626",c=o.attrs?.background||"#fee2e2",l=o.attrs?.shape==="circle"?"50%":"9999px";n=`<span style="display:inline-block;vertical-align:middle;border:2px solid ${i};background:${c};border-radius:${l};padding:0.15em 0.45em">${n}</span>`;break}}return n}if(t.type==="paragraph"){let n=t.content?te(t.content,r):"",a=t.attrs?.dir,s=t.attrs?.textAlign,o=a?` dir="${a}"`:"",i=[s?`text-align:${s}`:"",r?.inTable?"margin:0":""].filter(Boolean).join(";"),c=i?` style="${i}"`:"";return r?.stripParagraphs?n:`<p${o}${c}>${n}</p>`}if(t.type==="hardBreak")return"<br/>";if(t.type==="table"){let n=It(t.content),a=t.content?te(t.content,{...r,inTable:!0,stickyCells:n.stickyCells}):"",s=n.columnWidths.length?`<colgroup>${n.columnWidths.map(o=>o?`<col style="width:${E(o)}">`:"<col>").join("")}</colgroup>`:"";return`<div style="${Sr(On)}"><table style="${Sr(Mt)}">${s}<tbody>${a}</tbody></table></div>`}if(t.type==="tableRow")return`<tr>${t.content?te(t.content,r):""}</tr>`;if(t.type==="tableCell"){let n=t.content?te(t.content,r):"",a=t.attrs?.colspan?` colspan="${t.attrs.colspan}"`:"",s=t.attrs?.rowspan?` rowspan="${t.attrs.rowspan}"`:"",o=!!r?.stickyCells?.has(t),i=o?` class="${er}"`:"";return`<td${a}${s}${i} style="${Sr(Rr({header:!1,gray:!!t.attrs?.gray,sticky:o}))}">${n}</td>`}if(t.type==="tableHeader"){let n=t.content?te(t.content,r):"",a=t.attrs?.colspan?` colspan="${t.attrs.colspan}"`:"",s=t.attrs?.rowspan?` rowspan="${t.attrs.rowspan}"`:"",o=!!r?.stickyCells?.has(t),i=o?` class="${er}"`:"";return`<th${a}${s}${i} style="${Sr(Rr({header:!0,gray:!!t.attrs?.gray,sticky:o}))}">${n}</th>`}if(t.type==="bulletList")return`<ul style="list-style-type:disc;padding-left:1.5em">${t.content?te(t.content,r):""}</ul>`;if(t.type==="orderedList")return`<ol style="list-style-type:decimal;padding-left:1.5em">${t.content?te(t.content,r):""}</ol>`;if(t.type==="listItem")return`<li>${t.content?te(t.content,r):""}</li>`;if(t.type==="blockquote"){let n=t.content?te(t.content,r):"";return`<blockquote${t.attrs?.dir?` dir="${t.attrs.dir}"`:""} style="border-inline-start:3px solid #d6d3cc;padding-inline-start:1em;margin:0.75em 0;color:#565b66;font-style:italic">${n}</blockquote>`}if(t.type==="resizableImage"){let n=t.attrs??{},a=Ur(n.width),s=Ur(n.height);return`<img src="${rr(n.src??"")}" alt="${rr(n.alt??"")}" style="display:inline-block;vertical-align:middle;max-width:100%;${a?`width:${a};`:""}${s?`height:${s};`:""}"/>`}if(t.type==="resizableAudio"){let n=t.attrs??{};return`<span style="display:inline-flex;vertical-align:middle;align-items:center;background:#f1f5f9;border-radius:${E("8px")};padding:${E("4px")} ${E("8px")};max-width:100%"><audio controls src="${rr(n.src??"")}" style="display:block;width:${E("320px")};max-width:100%"></audio></span>`}if(t.type==="resizableVideo"){let n=t.attrs??{},a=Ur(n.width),s=Ur(n.height);return`<video src="${rr(n.src??"")}" controls style="display:inline-block;vertical-align:middle;max-width:100%;${a?`width:${a};`:""}${s?`height:${s};`:""}"></video>`}if(t.type==="youtubeEmbed"){let n=t.attrs??{};return`<iframe src="https://www.youtube.com/embed/${rr(n.videoId??"")}" width="${n.width||480}" height="${n.height||270}" allowfullscreen frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" style="display:inline-block;vertical-align:middle;border:0;width:${Ee(n.width||480)};height:${Ee(n.height||270)}"></iframe>`}return t.type==="inlineMath"?`<span dir="ltr" class="math-inline" style="unicode-bidi:isolate;display:inline-block">${Ze(t.attrs?.latex??"",!1,!0)}</span>`:t.type==="blockMath"?`<div dir="ltr" class="math-block" style="unicode-bidi:isolate;text-align:center;margin:1em 0">${Ze(t.attrs?.latex??"",!0,!0)}</div>`:t.type==="variable"?`<span class="variable">{${rr(t.attrs?.name??"")}}</span>`:""}).join("")}function Ur(e){return e==null||e===""?null:Ee(e)??null}function rr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}import{jsx as is}from"react/jsx-runtime";import{createContext as cs,useContext as Jn,useMemo as Zn}from"react";var ls={sm:.875,md:1,lg:1.25,xl:1.5},jt=cs(null);function ds(e,r){let t={...e??{}};if(r)for(let[n,a]of Object.entries(r))a!==void 0&&(t[n]=a);return t}function ps(e){return typeof e=="number"?Number.isFinite(e)&&e>0?e:1:e?ls[e]??1:1}function _e(e){let r=e??{};return{scale:ps(r.size),sizeSet:r.size!==void 0,choiceLabels:r.choiceLabels??"marks",choiceColumns:r.choiceColumns,layoutBy:r.layoutBy??"window",motion:r.motion??"full",shuffleSeed:r.shuffleSeed}}function we(e){let r=Jn(jt);return Zn(()=>ds(r,e),[r,e?.size,e?.choiceLabels,e?.choiceColumns,e?.layoutBy,e?.motion,e?.shuffleSeed])}function ke(){let e=Jn(jt);return Zn(()=>_e(e),[e])}function Re({display:e,children:r}){let t=we(e);return is(jt.Provider,{value:t,children:r})}function Ce(e){if(e.sizeSet)return{"--edp-scale":String(e.scale)}}function tr(){let{motion:e}=ke();return{hop:e==="none"?"":"animate-hop",shake:e==="full"?"animate-shake":"",wobble:e==="full"?"animate-wobble":""}}function ms(e){let r=2166136261;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}function us(e){return()=>{e=e+1831565813|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296}}function Ar(e,r){let t=[...e],n=us(ms(r));for(let a=t.length-1;a>0;a--){let s=Math.floor(n()*(a+1));[t[a],t[s]]=[t[s],t[a]]}return t}import{Fragment as ea,jsx as oe,jsxs as fs}from"react/jsx-runtime";import{useState as tt,useEffect as ta,useRef as ra,useLayoutEffect as hs,useCallback as gs}from"react";import{createPortal as bs}from"react-dom";import xs from"clsx";var ys=typeof window<"u"?hs:ta;function Ft({node:e}){if(e.type==="text"){if(!e.marks||e.marks.length===0)return oe(ea,{children:e.text});let r=e.text||"";for(let t of e.marks)t.type==="bold"?r=oe("strong",{children:r}):t.type==="italic"?r=oe("em",{children:r}):t.type==="underline"?r=oe("u",{children:r}):t.type==="strike"?r=oe("s",{children:r}):t.type==="textStyle"&&t.attrs?.color&&(r=oe("span",{style:{color:t.attrs.color},children:r}));return oe(ea,{children:r})}return e.type==="paragraph"?oe("span",{className:"block",children:e.content?.map((r,t)=>oe(Ft,{node:r},t))??oe("br",{})}):e.type==="hardBreak"?oe("br",{}):e.content?oe("span",{className:"block",children:e.content.map((r,t)=>oe(Ft,{node:r},t))}):null}function vs({nodes:e}){return oe("span",{className:"block space-y-1",style:{color:"var(--ink, #1d2025)"},children:e.map((r,t)=>oe(Ft,{node:r},t))})}function ws(e,r,t,n=8){let a=e.top-r.height-n;a<n&&(a=e.bottom+n);let s=e.left+e.width/2-r.width/2;return s=Math.max(n,Math.min(s,t-r.width-n)),{top:a,left:s}}function Ye({hint:e}){let r=Z(),[t,n]=tt(!1),[a,s]=tt(!1),[o,i]=tt(null),[c,l]=tt({}),d=ra(null),p=ra(null);ta(()=>{if(!a)return;let w=x=>{let _=x.target;d.current&&!d.current.contains(_)&&p.current&&!p.current.contains(_)&&(s(!1),n(!1))};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[a]);let m=gs(()=>{let w=d.current,x=p.current;!w||!x||i(ws(w.getBoundingClientRect(),x.getBoundingClientRect(),window.innerWidth))},[]);ys(()=>{if(!t){i(null);return}let w=d.current;if(w){let x=getComputedStyle(w);l({direction:x.direction,fontFamily:x.fontFamily,"--edp-scale":x.getPropertyValue("--edp-scale").trim()||"1"})}return m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[t,m]);let g=()=>n(!0),u=()=>{a||n(!1)},b=w=>{w.stopPropagation(),a?(s(!1),n(!1)):(s(!0),n(!0))},v=t&&typeof document<"u"?bs(oe("span",{className:"edpire-scope",style:{...c,display:"contents"},children:oe("span",{ref:p,role:"tooltip",className:"player-blank-hint-pop",onClick:w=>w.stopPropagation(),onMouseEnter:g,onMouseLeave:u,style:{position:"fixed",top:o?o.top:0,left:o?o.left:0,bottom:"auto",transform:"none",margin:0,visibility:o?"visible":"hidden"},children:oe(vs,{nodes:e})})}),document.body):null;return fs("span",{ref:d,className:"relative inline-flex items-center align-middle",onMouseEnter:g,onMouseLeave:u,children:[oe("button",{type:"button",onClick:b,className:xs("player-blank-hint-btn select-none",a&&"player-blank-hint-btn--pinned"),"aria-label":r.showHint,"aria-expanded":t,children:"?"}),v]})}function $e({hint:e}){return!e||e.length===0?null:oe(Ye,{hint:e})}function Ss(e){return[...e].map(r=>({v:r,r:Math.random()})).sort((r,t)=>r.r-t.r).map(r=>r.v)}var _s=e=>e.replace(/ {2,}/g,r=>"&nbsp;".repeat(r.length-1)+" "),Cs=new Set(["image","resizableImage","resizableVideo","youtubeEmbed"]);function sa(e){return(e??[]).some(r=>Cs.has(r?.type)||sa(r?.content))}var aa=()=>me("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:me("path",{d:"M5 13l4 4L19 7"})}),oa=()=>me("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:me("path",{d:"M6 6l12 12M18 6L6 18"})});function Vr({node:e,validationFeedback:r}){let t=le(),n=Z(),a=ke(),s=tr(),{id:o,content:i,attrs:c}=e,l=c.shuffle??!1,d="prompt"in c?c.prompt:void 0,p="separator"in c?c.separator??"/":"/",m="pickLimit"in c&&c.pickLimit?c.pickLimit:1,g="layout"in c?c.layout??"row":"row",u=e.type==="inlineChoiceSet",b=JSON.stringify(i),v=l&&a.shuffleSeed!==void 0,w=Rs(()=>v?Ar(i,`${a.shuffleSeed}:${o}`):null,[v,a.shuffleSeed,o,b]),[x,_]=na(i);Ot(()=>{v||_(l?Ss(i):i)},[l,v,b]);let h=w??x,[y,C]=na(new Set),T=r?.showFeedback??!1,$=r?.correctChoiceIds||[];Ot(()=>{let D=X=>{let P=X.answers.find(F=>F.nodeId===o&&F.type==="choiceSet");P&&"selectedIds"in P.answer&&C(new Set(P.answer.selectedIds))};return t.on("answers:prefill",D),()=>t.off("answers:prefill",D)},[o,t]),Ot(()=>{t.emit({type:"answer:changed",answer:{nodeId:o,type:"choiceSet",timestamp:Date.now(),answer:{selectedIds:Array.from(y)}}})},[y,o,t]);let R=D=>{T||C(X=>{let k=new Set(X);return m===1?k.has(D)?k.delete(D):(k.clear(),k.add(D)):k.has(D)?k.delete(D):k.size<m&&k.add(D),k})},f=D=>_s(te(D.content)),M=D=>{let X=y.has(D),k=$.includes(D);return T?k&&X?"correct":k&&!X?"correct-unchosen":!k&&X?"incorrect":"muted":X?"selected":"idle"},A={idle:"",selected:"player-choice--selected",correct:Be("player-choice--correct",s.hop),"correct-unchosen":"player-choice--correct-unchosen",incorrect:Be("player-choice--incorrect",s.shake),muted:"player-choice--muted"},H={idle:"",selected:"player-inline-choice--selected",correct:Be("player-inline-choice--correct",s.hop),"correct-unchosen":"player-inline-choice--correct-unchosen",incorrect:Be("player-inline-choice--incorrect",s.shake),muted:"player-inline-choice--muted"};if(u)return nr("span",{className:"inline-choice",children:[d&&nr("span",{className:"mr-2 font-medium",children:[d,m>1?me("span",{className:"ml-1 opacity-60",children:n.chooseN(m)}):null]}),h.map((D,X)=>nr(ks,{children:[me("button",{type:"button",disabled:T,onClick:()=>R(D.id),className:Be("player-inline-choice",H[M(D.id)]),"aria-pressed":y.has(D.id),dangerouslySetInnerHTML:{__html:f(D)}}),X<h.length-1&&me("span",{className:"mx-1",children:p})]},D.id)),c.hint&&c.hint.length>0&&me(Ye,{hint:c.hint})]});let S=a.layoutBy==="box",N=a.choiceColumns?Math.min(a.choiceColumns,h.length):0,O=N?{gridAutoRows:"1fr",gridTemplateColumns:`repeat(${N}, minmax(0, 1fr))`}:{gridAutoRows:"1fr"},z=h.some(D=>sa(D.content)),q=a.choiceLabels==="letters",Q=D=>n.choiceLetters[D]??String(D+1);return nr("div",{className:Be("cs-player my-4 space-y-3",S&&"cs-player--box"),children:[d&&nr("p",{className:"font-medium",children:[d,m>1?nr("span",{className:"ml-2 text-sm opacity-70",children:["(choose ",m,")"]}):null]}),c.hint&&c.hint.length>0&&me(Ye,{hint:c.hint}),me("div",{className:Be("cs-player__grid",g==="row"&&"cs-player__grid--row"),style:O,children:h.map((D,X)=>{let k=M(D.id),P=k==="incorrect"?"incorrect":k==="correct"||k==="correct-unchosen"?"correct":null;return nr("button",{type:"button",disabled:T,onClick:()=>R(D.id),className:Be("player-choice",z&&"player-choice--tile",A[k]),"aria-pressed":y.has(D.id),children:[me("span",{className:Be("player-choice__mark",m>1?"player-choice__mark--box":"player-choice__mark--radio",q&&"player-choice__mark--letter"),children:q?Q(X):k==="incorrect"?me(oa,{}):me(aa,{})}),me("span",{className:"player-choice__text",dangerouslySetInnerHTML:{__html:f(D)}}),q&&P&&me("span",{className:`player-choice__verdict player-choice__verdict--${P}`,"aria-hidden":"true",children:P==="incorrect"?me(oa,{}):me(aa,{})})]},D.id)})})]})}import{jsx as We,Fragment as As,jsxs as Bt}from"react/jsx-runtime";import{useContext as Ns,useState as Es,useEffect as Wt,useRef as Ts,useCallback as Ps}from"react";import ar from"clsx";function Gr({node:e,validationFeedback:r}){let t=le(),n=Z(),a=tr(),{id:s,attrs:o}=e,{placeholder:i="___",width:c="auto",hint:l}=o,d=Ts(null),p=i.trim().split(/\s+/).filter(Boolean).length,m=Ns(kr),g=!m&&c==="auto"&&p>=4,[u,b]=Es(""),v=r?.showFeedback??!1,w=r?.state,x=w==="validating",_=r?.displayAnswer,h=r?.message;Wt(()=>{let $=R=>{let M=R.answers.find(A=>A.nodeId===s&&A.type==="blank");M&&"mode"in M.answer&&M.answer.mode==="typed"&&"text"in M.answer&&b(M.answer.text)};return t.on("answers:prefill",$),()=>t.off("answers:prefill",$)},[s,t]),Wt(()=>{t.emit({type:"answer:changed",answer:{nodeId:s,type:"blank",timestamp:Date.now(),answer:{mode:"typed",text:u}}})},[u,s,t]);let y=$=>{b($.target.value)},C=Ps(()=>{let $=d.current;$&&($.style.height="auto",$.style.height=`${$.scrollHeight}px`)},[]);Wt(()=>{C()},[u,C]);let T=v&&!x;return Bt("span",{className:m?"player-blank-cell":ar("inline-flex flex-wrap items-center gap-x-1 gap-y-0.5 align-middle max-w-full",g&&"w-full"),children:[We("span",{className:m?"player-blank-cell__box":ar("relative inline-block shrink-0 min-w-0 max-w-full",g&&"w-full flex-1"),children:T?We("span",{className:ar("player-typed-blank-feedback",m&&"player-typed-blank-feedback--cell",g&&"w-full",w==="correct"&&ar("player-typed-blank-feedback--correct",a.hop),w==="partial"&&"player-typed-blank-feedback--partial",w==="incorrect"&&ar("player-typed-blank-feedback--incorrect",a.wobble)),children:u||We("span",{className:"opacity-40",children:i})}):Bt(As,{children:[We("textarea",{ref:d,"aria-label":n.blankAnswerAria,placeholder:i,value:u,onChange:y,disabled:v,rows:1,wrap:m?"off":void 0,className:ar("player-typed-blank",m&&"player-typed-blank--cell",g&&"w-full",x&&"player-typed-blank--pending"),style:m?void 0:c!=="auto"?{width:c}:g?{width:"100%"}:{width:`${Math.max(7,u.length+1)}ch`,maxWidth:"100%"}}),!u&&!x&&!m&&We("span",{className:"absolute right-1 top-1/2 -translate-y-1/2 pointer-events-none text-sm",style:{color:"var(--ink-faint, #8d93a0)"},children:"\u270E"}),x&&We("span",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:We("span",{className:"player-typed-blank-spinner","aria-label":n.aiEvaluationInProgressAria})})]})}),v&&w==="incorrect"&&_&&Bt("span",{className:"player-blank-reveal",children:["(",_,")"]}),v&&h&&We("span",{className:ar("player-blank-feedback",w==="correct"&&"player-blank-feedback--correct",w==="partial"&&"player-blank-feedback--partial",w==="incorrect"&&"player-blank-feedback--incorrect"),children:h}),l&&l.length>0&&We(Ye,{hint:l})]})}import{jsx as at,Fragment as da,jsxs as Ht}from"react/jsx-runtime";import{useEffect as pa}from"react";import ot from"clsx";import{useDroppable as js,useDndContext as Fs}from"@dnd-kit/core";import{jsx as Ls}from"react/jsx-runtime";import{createContext as Ms,useCallback as Ke,useContext as Is,useEffect as $s,useMemo as ia,useRef as zs,useState as qt}from"react";import{useDndMonitor as Ds}from"@dnd-kit/core";var la=Ms(null);function ze(){let e=Is(la);if(!e)throw new Error("usePool must be used within a PoolProvider");return e}function ca(e){let r={};for(let t of e??[])t.type==="blank"&&"mode"in t.answer&&t.answer.mode==="choice"&&"choiceId"in t.answer&&t.answer.choiceId&&(r[t.nodeId]={choiceId:t.answer.choiceId,poolId:t.answer.poolId||"",value:t.answer.value||""});return r}function nt({children:e,initialAnswers:r}){let t=le(),n=ia(()=>ca(r),[r]),[a,s]=qt(n),[o,i]=qt({}),[c,l]=qt({}),d=zs(new Set);$s(()=>{let h=y=>{let C=ca(y.answers);Object.keys(C).length!==0&&s(T=>{if(!Object.entries(C).some(([f,M])=>T[f]?.choiceId!==M.choiceId||T[f]?.poolId!==M.poolId||T[f]?.value!==M.value))return T;let R={...T,...C};return i(f=>{let M={...f};for(let[A,H]of Object.entries(f)){let S=new Set(Object.values(R).filter(N=>N.poolId===A).map(N=>N.choiceId));M[A]={...H,available:new Set(H.choices.map(N=>N.id).filter(N=>!S.has(N)))}}return M}),R})};return t.on("answers:prefill",h),()=>t.off("answers:prefill",h)},[t]);let p=Ke((h,y)=>{i(C=>{let T=C[h];if(!T){let A=new Set;for(let S of Object.values(a))S.poolId===h&&A.add(S.choiceId);let H=new Set(y.map(S=>S.id).filter(S=>!A.has(S)));return{...C,[h]:{choices:y,available:H}}}let $=new Set(T.choices.map(A=>A.id)),R=new Set(y.map(A=>A.id));if(!(y.some(A=>!$.has(A.id))||T.choices.some(A=>!R.has(A.id))))return C;let M=new Set;for(let A of T.available)R.has(A)&&M.add(A);for(let A of y)$.has(A.id)||M.add(A.id);return{...C,[h]:{choices:y,available:M}}})},[a]),m=Ke((h,y)=>{l(C=>{let T=C[h]??[];return T.includes(y)?C:{...C,[h]:[...T,y]}}),!d.current.has(y)&&!a[y]&&(d.current.add(y),t.emit({type:"answer:changed",answer:{nodeId:y,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:h,value:""}}}))},[a,t]),g=Ke(h=>(c[h]??[]).find(C=>!a[C])??null,[c,a]),u=Ke((h,y,C,T)=>{s($=>{let R=$[h];return R&&i(f=>{let M=f[R.poolId];if(!M)return f;let A=new Set(M.available);return A.add(R.choiceId),{...f,[R.poolId]:{...M,available:A}}}),{...$,[h]:{choiceId:C,value:T,poolId:y}}}),i($=>{let R=$[y];if(!R)return $;let f=new Set(R.available);return f.delete(C),{...$,[y]:{...R,available:f}}}),t.emit({type:"answer:changed",answer:{nodeId:h,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:C,poolId:y,value:T}}})},[t]),b=Ke(h=>{let y=a[h];if(!y)return;let{poolId:C,choiceId:T}=y;i($=>{let R=$[C];if(!R)return $;let f=new Set(R.available);return f.add(T),{...$,[C]:{...R,available:f}}}),s($=>{let{[h]:R,...f}=$;return f}),t.emit({type:"answer:changed",answer:{nodeId:h,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:C,value:""}}})},[a,t]),v=Ke((h,y)=>o[h]?.available.has(y)??!1,[o]),w=Ke((h,y)=>o[h]?.choices.find(C=>C.id===y),[o]),x=Ke(()=>{s({}),i(h=>{let y={};for(let[C,T]of Object.entries(h))y[C]={choices:T.choices,available:new Set(T.choices.map($=>$.id))};return y});for(let[h,y]of Object.entries(c))for(let C of y)t.emit({type:"answer:changed",answer:{nodeId:C,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:h,value:""}}})},[c,t]);Ds({onDragEnd(h){window.dispatchEvent(new CustomEvent("dnd-drop",{detail:{active:h.active,over:h.over}}))}});let _=ia(()=>({blanks:a,pools:o,registerPool:p,registerBlank:m,fill:u,back:b,isAvailable:v,getChoice:w,firstEmptyBlank:g,resetAllAnswers:x}),[a,o,p,m,u,b,v,w,g,x]);return Ls(la.Provider,{value:_,children:e})}function Qr({node:e,validationFeedback:r}){let{id:t,attrs:n}=e,{poolId:a,placeholder:s="___",hint:o}=n,{blanks:i,fill:c,back:l,getChoice:d,registerBlank:p}=ze(),m=Z(),g=tr(),u=i[t],b=!!u?.choiceId,v=r?.showFeedback??!1,w=r?.state,x=r?.correctChoiceIds??[],_=v&&w==="incorrect"&&x.length>0?d(a||"",x[0]):void 0,h=_?_.html.replace(/<\/?[^>]+(>|$)/g,""):void 0,{setNodeRef:y,isOver:C}=js({id:t,data:{type:"blank",blankId:t,poolId:a}}),{active:T}=Fs(),$=!!T&&T.data.current?.poolId===a;return pa(()=>{p(a||"",t)},[a,t,p]),pa(()=>{let M=A=>{let H=A,{active:S,over:N}=H.detail||{};if(!N||N.id!==t)return;let{choiceId:O,poolId:z}=S?.data.current||{};if(!O||z!==a)return;let q=d(a||"",O);if(!q)return;let Q=q.html.replace(/<\/?[^>]+(>|$)/g,"");c(t,a||"",O,Q)};return window.addEventListener("dnd-drop",M),()=>window.removeEventListener("dnd-drop",M)},[t,a,d,c]),Ht(da,{children:[at("span",{ref:y,onClick:()=>{b&&!v&&l(t)},className:ot("player-choice-blank",C&&"player-choice-blank--over",!C&&$&&!b&&!v&&"player-choice-blank--target",b&&!v&&!C&&"player-choice-blank--filled",v&&w==="correct"&&ot("player-choice-blank--correct",g.hop),v&&w==="partial"&&ot("player-choice-blank--partial",g.hop),v&&w==="incorrect"&&ot("player-choice-blank--incorrect",g.wobble)),title:b&&!v?m.clickToRemove:void 0,"data-node-id":t,"data-pool-id":a,children:b?Ht(da,{children:[at("span",{children:u.value}),!v&&at("span",{className:"player-choice-blank__clear",children:"\xD7"})]}):s}),h&&Ht("span",{className:"player-blank-reveal",children:["(",h,")"]}),at($e,{hint:o})]})}import{jsx as Gt,jsxs as Vs}from"react/jsx-runtime";import{useEffect as va,useRef as Gs,useState as Qs}from"react";import Ys from"clsx";import{jsx as ya,jsxs as qs}from"react/jsx-runtime";import Hs from"clsx";import{useDraggable as Us}from"@dnd-kit/core";import{jsx as or,jsxs as ma}from"react/jsx-runtime";import{useEffect as ua,useState as fa}from"react";import Os from"clsx";var ha="edpire:tap-hint-placed",ga=2;function Bs(e){let t=(()=>{try{return Number(e?.getItem(ha))||0}catch{return 0}})(),n=new Set,a=new Set,s=()=>n.forEach(o=>o());return{done:()=>t>=ga,placed:()=>t,recordPlacement(){if(!(t>=ga)){t+=1;try{e?.setItem(ha,String(t))}catch{}s()}},setOnScreen(o,i){let c=a.has(o);i!==c&&(i?a.add(o):a.delete(o),s())},owner(){let o=null;for(let i of a)(!o||i.compareDocumentPosition(o)&4)&&(o=i);return o},subscribe(o){return n.add(o),()=>{n.delete(o)}}}}var Ut=null;function Vt(){if(!Ut){let e=null;try{e=typeof window<"u"?window.localStorage:null}catch{e=null}Ut=Bs(e)}return Ut}function ba(){typeof window>"u"||Vt().recordPlacement()}function Ws(){try{return window.matchMedia("(hover: none) and (pointer: coarse)").matches}catch{return!1}}function st(e,r){let[,t]=fa(0),[n,a]=fa(!1);if(ua(()=>{a(Ws())},[]),ua(()=>{let o=e.current;if(!n||!o)return;let i=Vt();if(i.done())return;let c=i.subscribe(()=>t(d=>d+1));if(!r||typeof IntersectionObserver>"u")return()=>{i.setOnScreen(o,!1),c()};let l=new IntersectionObserver(d=>{for(let p of d)i.setOnScreen(o,p.isIntersecting)},{threshold:.6});return l.observe(o),()=>{l.disconnect(),i.setOnScreen(o,!1),c()}},[e,n,r]),!n||!r||typeof window>"u")return!1;let s=Vt();return!s.done()&&s.owner()===e.current}function xa(){let{motion:e}=ke();return ma("span",{className:Os("player-tap-hint",e==="none"&&"player-tap-hint--still"),"aria-hidden":"true",children:[or("span",{className:"player-tap-hint__ripple"}),or("svg",{className:"player-tap-hint__hand",viewBox:"0 0 24 24",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[{stroke:"#ffffff",strokeWidth:4.5},{stroke:"currentColor",strokeWidth:1.75}].map((r,t)=>ma("g",{...r,children:[or("path",{d:"M22 14a8 8 0 0 1-8 8"}),or("path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2"}),or("path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1"}),or("path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10"}),or("path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"})]},t))})]})}function pr({poolId:e,data:r,isInline:t=!1,tapHint:n=!1}){let{isAvailable:a,firstEmptyBlank:s,fill:o}=ze(),{id:i,html:c}=r,l=!a(e,i),{setNodeRef:d,attributes:p,listeners:m,transform:g,isDragging:u}=Us({id:i,data:{type:"choice",choiceId:i,poolId:e,html:c},disabled:l});if(l)return null;let b=_=>_.replace(/<\/?[^>]+(>|$)/g,""),v=()=>{let _=s(e);if(_){let h=b(c);o(_,e,i,h),ba()}},w=g?{transform:`translate3d(${g.x}px, ${g.y}px, 0)`}:void 0;return qs(t?"span":"div",{ref:d,style:w,className:Hs("player-bank-pill",u&&"player-bank-pill--dragging",n&&!u&&"player-bank-pill--hinted",t&&"mx-1"),...p,...m,onClick:v,children:[ya("span",{dangerouslySetInnerHTML:{__html:c},className:"pointer-events-none whitespace-pre-wrap break-words"}),n&&!u&&ya(xa,{})]})}function Yr({node:e}){let r=Z(),{id:t,attrs:n,content:a}=e,{shuffle:s=!0,equalWidth:o=!1}=n,{registerPool:i,isAvailable:c}=ze(),l=Gs(null),[d,p]=Qs(()=>a.map(u=>({id:u.id,html:te(u.content)})));va(()=>{let u=a.map(b=>({id:b.id,html:te(b.content)}));p(s?[...u].map(b=>({v:b,r:Math.random()})).sort((b,v)=>b.r-v.r).map(b=>b.v):u)},[s,JSON.stringify(a)]),va(()=>{i(t,d)},[t,d,i]);let m=d.find(u=>c(t,u.id))?.id,g=st(l,m!==void 0);return Vs("div",{ref:l,className:"player-word-bank",children:[Gt("div",{className:"player-word-bank__label",children:r.wordBank}),Gt("div",{className:Ys("player-word-bank__items",o&&"player-word-bank__items--grid"),children:d.map(u=>Gt(pr,{poolId:t,data:u,tapHint:g&&u.id===m},u.id))})]})}import{jsx as Qt,jsxs as Ks}from"react/jsx-runtime";import{useEffect as wa,useRef as Xs,useState as Js}from"react";function Kr({node:e}){let{id:r,attrs:t,content:n}=e,{shuffle:a=!0,separator:s=" "}=t,{registerPool:o,isAvailable:i}=ze(),c=Xs(null),[l,d]=Js(()=>n.map(g=>({id:g.id,html:te(g.content,{stripParagraphs:!0})})));wa(()=>{let g=n.map(u=>({id:u.id,html:te(u.content,{stripParagraphs:!0})}));d(a?[...g].map(u=>({v:u,r:Math.random()})).sort((u,b)=>u.r-b.r).map(u=>u.v):g)},[a,JSON.stringify(n)]),wa(()=>{o(r,l)},[r,l,o]);let p=l.find(g=>i(r,g.id))?.id,m=st(c,p!==void 0);return Qt("span",{ref:c,style:{display:"inline-flex",flexWrap:"wrap",gap:E("0.25rem"),alignItems:"center"},children:l.map((g,u)=>Ks("span",{children:[Qt(pr,{poolId:r,data:g,isInline:!0,tapHint:m&&g.id===p}),u<l.length-1&&Qt("span",{children:s})]},g.id))})}import{jsx as mr,jsxs as Xt}from"react/jsx-runtime";import{useState as Jt,useEffect as Zt,useMemo as ti}from"react";import{Check as ni,X as ai}from"lucide-react";import{jsx as ue,jsxs as sr}from"react/jsx-runtime";import{useState as Yt,useMemo as Kt,useRef as it,useCallback as Zs,useLayoutEffect as ei}from"react";var ka="#1d2025",Ra="#8d93a0",Sa="#1f8a4c",_a="#d23b2b",ri=11;function Ca({leftItems:e,rightItems:r,connections:t,direction:n,disabled:a,feedback:s,onConnectionsChange:o}){let[i,c]=Yt(null),[l,d]=Yt(null),[p,m]=Yt(new Map),g=it(null),u=it(new Map),b=it("mouse"),v=s?.showFeedback??!1,w=Kt(()=>{let k=new Map;if(s?.pairFeedback)for(let P of s.pairFeedback)k.set(`${P.leftId}-${P.rightId}`,P.correct);return k},[s]),x=Kt(()=>{let k=new Map;return s?.correctPairings?.forEach(P=>k.set(P.leftId,P.rightId)),k},[s]),_=Kt(()=>{let k=new Map;return s?.correctPairings?.forEach(P=>k.set(P.rightId,P.leftId)),k},[s]),h=new Map,y=new Map;t.forEach((k,P)=>{h.set(k.leftId,P),y.set(k.rightId,P)});let C=k=>{let P=t[k];if(!v||!P)return null;let F=w.get(`${P.leftId}-${P.rightId}`);return F===!0?"correct":F===!1?"incorrect":null},T=Zs(()=>{if(!g.current)return;let k=g.current.getBoundingClientRect(),P=new Map;u.current.forEach((F,U)=>{if(F){let G=F.getBoundingClientRect();P.set(U,new DOMRect(G.left-k.left,G.top-k.top,G.width,G.height))}}),m(P)},[]);ei(()=>{T();let k=new ResizeObserver(T);return g.current&&k.observe(g.current),()=>k.disconnect()},[T,t,e,r]);let $=8,R=(k,P)=>{let F=p.get(k);if(!F)return null;let U=F.y+F.height/2;return P==="left"?{x:F.x+F.width,y:U}:{x:F.x-$,y:U}},f=(k,P)=>{if(a)return;let U=(P==="left"?h:y).has(k),G=i?.id===k&&i?.side===P,be=i!==null&&i.side!==P;if(G){c(null);return}if(be){let ie=P==="right"?i.id:k,ae=P==="left"?i.id:k,ee=t.filter(ne=>ne.leftId!==ie&&ne.rightId!==ae);ee.push({leftId:ie,rightId:ae}),o(ee),c(null);return}if(U&&!i){let ie=P==="left"?t.filter(ae=>ae.leftId!==k):t.filter(ae=>ae.rightId!==k);o(ie);return}c({id:k,side:P})},M=it(null),A=(k,P,F)=>{if(a||(b.current=F.pointerType,F.pointerType==="touch"))return;F.currentTarget.setPointerCapture(F.pointerId);let U=g.current.getBoundingClientRect();M.current={x:F.clientX-U.left,y:F.clientY-U.top},d({fromId:k,fromSide:P,x:F.clientX-U.left,y:F.clientY-U.top,overId:null,overSide:null})},H=k=>{if(!l)return;let P=g.current.getBoundingClientRect(),F=k.clientX-P.left,U=k.clientY-P.top,G=l.fromSide==="left"?"right":"left",be=G==="left"?e:r,ie=null,ae=null;for(let ee of be){let ne=p.get(ee.id);if(ne&&F>=ne.x&&F<=ne.x+ne.width&&U>=ne.y&&U<=ne.y+ne.height){ie=ee.id,ae=G;break}}d(ee=>ee?{...ee,x:F,y:U,overId:ie,overSide:ae}:null)},S=k=>{if(!l)return;let P=g.current.getBoundingClientRect(),F=k.clientX-P.left,U=k.clientY-P.top,G=M.current;if((G?Math.hypot(F-G.x,U-G.y):999)<8){d(null),f(l.fromId,l.fromSide);return}if(l.overId&&l.overSide){let ie=l.fromSide==="left"?l.fromId:l.overId,ae=l.fromSide==="right"?l.fromId:l.overId,ee=t.filter(ne=>ne.leftId!==ie&&ne.rightId!==ae);ee.push({leftId:ie,rightId:ae}),o(ee)}d(null),c(null)},N=(k,P)=>{if(!v)return null;let U=(P==="left"?h:y).get(k.id);if(U!==void 0){let G=t[U];if(w.get(`${G.leftId}-${G.rightId}`)===!0)return null}if(P==="left"){let G=x.get(k.id);return r.find(be=>be.id===G)?.content??null}else{let G=_.get(k.id);return e.find(be=>be.id===G)?.content??null}},O=(k,P)=>{let U=(P==="left"?h:y).get(k.id),G=U!==void 0,be=i?.id===k.id&&i?.side===P,ie=i!==null&&i.side!==P&&!G,ae=l?.overId===k.id&&l?.overSide===P,ee=G?C(U):null,ne=G?U+1:null,Ne="matching-player__item";G&&(Ne+=" matching-player__item--matched"),ee==="correct"&&(Ne+=" matching-player__item--correct"),ee==="incorrect"&&(Ne+=" matching-player__item--incorrect"),be&&(Ne+=" matching-player__item--selected"),(ie||ae)&&(Ne+=" matching-player__item--available"),a&&(Ne+=" matching-player__item--disabled");let Ge=N(k,P);return sr("button",{ref:V=>{V?u.current.set(k.id,V):u.current.delete(k.id)},type:"button",className:Ne,onPointerDown:V=>A(k.id,P,V),onClick:()=>{b.current==="touch"&&f(k.id,P)},"aria-pressed":be,children:[P==="right"&&ue("span",{className:"matching-player__connector matching-player__connector--right","aria-hidden":!0,children:sr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[ue("circle",{cx:"9",cy:"9",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.08"}),ue("path",{d:"M12 9H6M8.5 6.5L6 9l2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),G&&P==="left"&&ue("span",{className:"matching-player__pair-num","aria-hidden":!0,children:ne}),ue("span",{className:"matching-player__item-text",dangerouslySetInnerHTML:{__html:te(k.content)}}),Ge&&sr("span",{className:"matching-player__correct-hint",children:["(",ue("span",{dangerouslySetInnerHTML:{__html:te(Ge)}}),")"]}),G&&P==="right"&&ue("span",{className:"matching-player__pair-num","aria-hidden":!0,children:ne}),P==="left"&&ue("span",{className:"matching-player__connector matching-player__connector--left","aria-hidden":!0,children:sr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[ue("circle",{cx:"9",cy:"9",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.08"}),ue("path",{d:"M6 9h6M9.5 6.5L12 9l-2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]},k.id)},z=n==="ltr"?e:r,q=n==="ltr"?r:e,Q=n==="ltr"?"left":"right",D=n==="ltr"?"right":"left";return sr("div",{ref:g,className:`matching-player__arena${l?" matching-player__arena--dragging":""}`,onPointerMove:H,onPointerUp:S,children:[sr("svg",{className:"matching-player__svg","aria-hidden":!0,children:[ue("defs",{children:[["mp-arrow-ink",ka],["mp-arrow-correct",Sa],["mp-arrow-incorrect",_a],["mp-arrow-ghost",Ra]].map(([k,P])=>ue("marker",{id:k,markerUnits:"userSpaceOnUse",markerWidth:"11",markerHeight:"9",refX:"0",refY:"4.5",orient:"auto",children:ue("polygon",{points:"0 0, 11 4.5, 0 9",fill:P})},k))}),t.map(k=>{let P=R(k.leftId,"left"),F=R(k.rightId,"right");if(!P||!F)return null;let U=F.x-ri,G=Math.max(16,Math.abs(U-P.x)*.4),be=`M ${P.x} ${P.y} C ${P.x+G} ${P.y}, ${U-G} ${F.y}, ${U} ${F.y}`,ie=v?w.get(`${k.leftId}-${k.rightId}`):void 0;return ue("path",{d:be,stroke:ie===!0?Sa:ie===!1?_a:ka,strokeWidth:"2.5",fill:"none",markerEnd:`url(#${ie===!0?"mp-arrow-correct":ie===!1?"mp-arrow-incorrect":"mp-arrow-ink"})`},`${k.leftId}-${k.rightId}`)}),l&&(()=>{let k=R(l.fromId,l.fromSide);if(!k)return null;let P=Math.abs(l.x-k.x)*.35,F=`M ${k.x} ${k.y} C ${k.x+P} ${k.y}, ${l.x-P} ${l.y}, ${l.x} ${l.y}`;return ue("path",{d:F,stroke:Ra,strokeWidth:"2",strokeDasharray:"6 4",fill:"none",markerEnd:"url(#mp-arrow-ghost)"})})()]}),sr("div",{className:"matching-player__columns",children:[ue("div",{className:"matching-player__column",children:z.map(k=>O(k,Q))}),ue("div",{className:"matching-player__column",children:q.map(k=>O(k,D))})]})]})}var Aa=e=>Number.isInteger(e)?String(e):e.toFixed(2);function Na(e){return[...e].map(r=>({v:r,r:Math.random()})).sort((r,t)=>r.r-t.r).map(r=>r.v)}function Xr({node:e,validationFeedback:r}){let t=le(),{shuffleSeed:n,layoutBy:a}=ke(),{id:s,attrs:o,leftItems:i,rightItems:c}=e,{direction:l,shuffle:d,hint:p}=o,m=JSON.stringify(i),g=JSON.stringify(c),u=d&&n!==void 0,b=ti(()=>u?{left:Ar(i,`${n}:${s}:left`),right:Ar(c,`${n}:${s}:right`)}:null,[u,n,s,m,g]),[v,w]=Jt(i),[x,_]=Jt(c);Zt(()=>{u||(d?(w(Na(i)),_(Na(c))):(w(i),_(c)))},[d,u,m,g]);let h=b?.left??v,y=b?.right??x,[C,T]=Jt([]),$=r?.showFeedback??!1;Zt(()=>{let S=N=>{let z=N.answers.find(q=>q.nodeId===s&&q.type==="matchingSet");z&&"connections"in z.answer&&T(z.answer.connections)};return t.on("answers:prefill",S),()=>t.off("answers:prefill",S)},[t,s]),Zt(()=>{t.emit({type:"answer:changed",answer:{nodeId:s,type:"matchingSet",timestamp:Date.now(),answer:{connections:C}}})},[t,s,C]);let R=S=>{$||T(S)},f=r?.score,M=r?.maxScore,A=$&&f!=null&&M!=null,H=A?f>=M?"correct":f>0?"partial":"incorrect":null;return Xt("div",{className:a==="box"?"matching-player matching-player--box":"matching-player",children:[p&&p.length>0&&mr("div",{className:"matching-player-hintrow",children:mr($e,{hint:p})}),mr(Ca,{leftItems:h,rightItems:y,connections:C,direction:l,disabled:$,feedback:r,onConnectionsChange:R}),A&&Xt("div",{className:"matching-player-feedback matching-player-feedback--"+H,children:[H==="correct"&&mr(ni,{size:15,style:re(15)}),H==="incorrect"&&mr(ai,{size:15,style:re(15)}),mr("span",{children:H==="correct"?"All matched":H==="partial"?"Partial credit":"Not matched"}),Xt("span",{className:"matching-player-score",children:[Aa(f)," / ",Aa(M)]})]})]})}import{jsxs as ur,jsx as De,Fragment as oi}from"react/jsx-runtime";import{useState as Ea,useEffect as en,useRef as si,useCallback as Ta}from"react";import ct from"clsx";function Jr({node:e,validationFeedback:r}){let t=le(),n=Z(),{id:a,attrs:s}=e,{placeholder:o,minWords:i=0,maxWords:c=500,hint:l}=s,[d,p]=Ea(""),[m,g]=Ea(0),u=r?.showFeedback??!1,b=r?.state,v=c<=30,w=Ta(f=>f.trim().split(/\s+/).filter(Boolean).length,[]);en(()=>{let f=M=>{let H=M.answers?.find(S=>S.nodeId===a&&S.type==="aiAnswer");if(H&&H.answer?.text!=null){let S=H.answer.text;p(S),g(w(S))}};return t.on("answers:prefill",f),()=>t.off("answers:prefill",f)},[a,t,w]),en(()=>{let f=()=>{p(""),g(0)};return t.on("answers:reset",f),()=>t.off("answers:reset",f)},[t]);let x=si(null),_=Ta((f,M)=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{t.emit({type:"answer:changed",answer:{nodeId:a,type:"aiAnswer",timestamp:Date.now(),answer:{text:f,wordCount:M}}})},300)},[a,t]);en(()=>{t.emit({type:"answer:changed",answer:{nodeId:a,type:"aiAnswer",timestamp:Date.now(),answer:{text:"",wordCount:0}}})},[]);let h=f=>{if(u)return;let M=w(f);p(f),g(M),_(f,M)},y=b==="validating",C=ct("player-ai-count",m>c&&"player-ai-count--over"),T=!u||y?"":b==="correct"?"player-ai-input--correct":b==="incorrect"?"player-ai-input--incorrect":b==="partial"?"player-ai-input--partial":"",$=b==="correct"?"player-ai-feedback--correct":b==="incorrect"?"player-ai-feedback--incorrect":b==="partial"?"player-ai-feedback--partial":"",R=f=>Number.isInteger(f)?String(f):f.toFixed(2);return ur("div",{className:"player-ai",children:[ur("div",{className:"player-ai-counts",children:[ur("span",{className:C,children:[m," / ",c," ",n.openResponseWords]}),i>0&&m<i&&De("span",{className:"player-ai-count player-ai-count--min",children:n.minWordsLabel(i)}),De("span",{style:{marginInlineStart:"auto"},children:De($e,{hint:l})})]}),v?De("input",{type:"text",value:d,onChange:f=>h(f.target.value),placeholder:o??n.shortAnswerPlaceholder,"aria-label":n.blankAnswerAria,disabled:u,className:ct("player-ai-input",T)}):De("textarea",{value:d,onChange:f=>h(f.target.value),placeholder:o??n.longAnswerPlaceholder,"aria-label":n.blankAnswerAria,disabled:u,rows:5,className:ct("player-ai-input player-ai-input--multiline",T)}),u&&r&&De("div",{className:ct("player-ai-feedback",$),children:y?ur("div",{className:"player-ai-validating",children:[De("span",{className:"player-ai-spinner"}),De("span",{children:n.aiEvaluationInProgress})]}):ur(oi,{children:[r.message&&De("p",{className:"player-ai-message",children:r.message}),r.score!=null&&r.maxScore!=null&&De("div",{className:"player-ai-score-row",children:ur("span",{className:"player-ai-score",children:[R(r.score)," / ",R(r.maxScore)]})})]})})]})}import{jsx as I,jsxs as Y}from"react/jsx-runtime";import{useState as ve,useEffect as Pe,useRef as Te,useCallback as lt}from"react";import{useEditor as ii,EditorContent as ci}from"@tiptap/react";import li from"@tiptap/starter-kit";import qe from"clsx";import{FolderOpen as di,Mic as pi,Video as Ma,Monitor as mi,Clock as ui,Image as fi,FileText as Ia,Music as hi,Link2 as gi}from"lucide-react";function $a(e){return e.trim().split(/\s+/).filter(Boolean).length}function za(e){return e.length}function bi(e){let r=t=>t.map(n=>(n.text??"")+(n.content?r(n.content):"")).join(" ");return $a(r(e))}function xi(e){let r=t=>t.map(n=>(n.text??"")+(n.content?r(n.content):"")).join("");return za(r(e))}function Pa(e){if(!isFinite(e.duration)){e.currentTime=1e101;let r=()=>{e.currentTime=0,e.removeEventListener("timeupdate",r)};e.addEventListener("timeupdate",r)}}function yi(e){return/youtube\.com|youtu\.be/i.test(e)?"youtube":/vimeo\.com/i.test(e)?"vimeo":"other"}function vi(e){let r=e.match(/[?&]v=([^&]+)/)||e.match(/youtu\.be\/([^?]+)/)||e.match(/embed\/([^?]+)/);return r?r[1]:null}function La(e){let r=Math.floor(e/60),t=e%60;return`${r}:${t.toString().padStart(2,"0")}`}function Zr({node:e,validationFeedback:r,readOnly:t=!1,mediaHandler:n}){let a=le(),s=Z(),{id:o,attrs:i}=e,{mode:c,placeholder:l,allowFormatting:d,wordLimit:p,characterLimit:m,allowedTypes:g,allowMultiple:u,fileInstructions:b,maxDuration:v,hint:w}=i,x=t||(r?.showFeedback??!1),_=r?.state,h=Te(null),y=lt(f=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{let M=f.files?.map(A=>({url:A.url,mimeType:A.kind==="videoLink"?"video/x-link":A.mimeType,name:A.kind==="videoLink"?void 0:A.name,duration:A.kind==="videoLink"?void 0:A.duration}));a.emit({type:"answer:changed",answer:{nodeId:o,type:"openResponse",timestamp:Date.now(),answer:{...f,files:M}}})},300)},[o,a]);Pe(()=>{y({})},[]);let[C,T]=ve([]);Pe(()=>{(c==="file"||c==="text+file")&&c==="file"&&y({files:C})},[C,c]),Pe(()=>{let f=()=>{T([])};return a.on("answers:reset",f),()=>a.off("answers:reset",f)},[a]),Pe(()=>{let f=M=>{let H=(M.answers??[]).find(S=>S.nodeId===o&&S.type==="openResponse");H?.answer?.files&&T(H.answer.files)};return a.on("answers:prefill",f),()=>a.off("answers:prefill",f)},[o,a]);let $=r?.showFeedback,R=qe(!$&&"player-or-field--pre",$&&_==="correct"&&"player-or-field--correct",$&&_==="partial"&&"player-or-field--partial",$&&_==="incorrect"&&"player-or-field--incorrect",$&&_==="awaiting_review"&&"player-or-field--review");return Y("div",{className:"my-3 space-y-2",children:[!x&&w&&w.length>0&&I("div",{className:"flex justify-end",children:I(Ye,{hint:w})}),c==="text"&&I(Da,{nodeId:o,placeholder:l,allowFormatting:d,wordLimit:p,characterLimit:m,isDisabled:x,feedbackBorderClass:R,emitAnswer:f=>y({text:f}),answerBus:a}),c==="file"&&I(rn,{allowedTypes:g??["image"],allowMultiple:!!u,fileInstructions:b,isDisabled:x,feedbackBorderClass:R,files:C,setFiles:T,mediaHandler:n,t:s}),(c==="audio"||c==="video"||c==="screen")&&I(_i,{kind:c,maxDuration:v,isDisabled:x,feedbackBorderClass:R,mediaHandler:n,emitAnswer:f=>y({recording:f}),t:s}),c==="text+file"&&I(Si,{nodeId:o,placeholder:l,allowFormatting:d,wordLimit:p,characterLimit:m,allowedTypes:g??["image"],allowMultiple:!!u,fileInstructions:b,isDisabled:x,feedbackBorderClass:R,files:C,setFiles:T,emitAnswer:y,answerBus:a,mediaHandler:n,t:s}),r?.showFeedback&&_==="awaiting_review"&&Y("div",{className:"flex items-center gap-2 text-sm border rounded px-3 py-2",style:{color:"var(--almost-ink, #8a5a08)",background:"var(--almost-soft, #fbf1dc)",borderColor:"var(--almost, #c8810e)"},children:[I(ui,{size:15,style:re(15),className:"animate-pulse"}),I("span",{children:s.openResponseAwaitingReview})]}),r?.showFeedback&&_!=="awaiting_review"&&r.teacherFeedback&&I(Ci,{feedback:r.teacherFeedback,feedbackState:_,score:r.score,t:s})]})}function Da({nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,isDisabled:s,feedbackBorderClass:o,emitAnswer:i,answerBus:c}){let l=Z(),[d,p]=ve(""),[m,g]=ve(0),[u,b]=ve(0),v=Te(null),w=lt(()=>{let N=v.current;N&&(N.style.height="auto",N.style.height=`${N.scrollHeight}px`)},[]),x=ii({extensions:[li.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1})],immediatelyRender:!1,editable:!s,content:"",onUpdate({editor:N}){if(s)return;let z=N.getJSON().content??[],q=bi(z),Q=xi(z);g(q),b(Q),i({content:z,wordCount:q})}});Pe(()=>{x&&x.setEditable(!s)},[s,x]);let _=Te(null);Pe(()=>{x&&_.current!==null&&(x.commands.setContent({type:"doc",content:_.current}),_.current=null)},[x]),Pe(()=>{let N=O=>{let z=(O.answers??[]).find(Q=>Q.nodeId===e&&Q.type==="openResponse");if(!z?.answer?.text)return;let q=z.answer.text.content??[];if(t)x?x.commands.setContent({type:"doc",content:q}):_.current=q;else{let Q=q.flatMap(D=>D.content?.map(X=>X.text??"")??[D.text??""]).join(`
2
- `);p(Q),setTimeout(w,0)}};return c.on("answers:prefill",N),()=>c.off("answers:prefill",N)},[e,c,t,x]),Pe(()=>{let N=()=>{t&&x?x.commands.clearContent():(p(""),setTimeout(w,0)),g(0),b(0)};return c.on("answers:reset",N),()=>c.off("answers:reset",N)},[c,t,x,w]);let h=!!n,y=!!a&&!n,C=h?m:u,T=h?n?.max:a?.max,$=h?n?.min:a?.min,R=T!=null&&C>T,f=T!=null&&C>=T*.8&&!R,M=$!=null&&C<$&&C>0,A="text-xs tabular-nums",H=R?{color:"var(--pen, #d23b2b)",fontWeight:500}:f||M?{color:"var(--almost, #c8810e)"}:{color:"var(--ink-faint, #8d93a0)"},S=h?T?`${m} / ${T} ${l.openResponseWords}`:$?`${m} ${l.openResponseWords} (min. ${$})`:`${m} ${l.openResponseWords}`:y?T?`${u} / ${T} ${l.openResponseChars}`:`${u} ${l.openResponseChars}`:null;return t?Y("div",{className:"relative",children:[Y("div",{className:qe("rounded border transition-colors min-h-[120px]",o),children:[!s&&Y("div",{className:"sticky top-0 z-10 flex gap-1 px-2 pt-1.5 pb-1 border-b border-gray-100 bg-white rounded-t",children:[[{label:"B",cmd:"toggleBold",style:"font-bold"},{label:"I",cmd:"toggleItalic",style:"italic"}].map(({label:N,cmd:O,style:z})=>I("button",{type:"button",onMouseDown:q=>{q.preventDefault(),x?.chain().focus()?.[O]().run()},className:`text-xs px-1.5 py-0.5 rounded hover:bg-gray-100 ${z}`,children:N},N)),I("button",{type:"button",onMouseDown:N=>{N.preventDefault(),x?.chain().focus().toggleBulletList().run()},className:"text-xs px-1.5 py-0.5 rounded hover:bg-gray-100",children:"\u2022\u2014"})]}),I(ci,{editor:x,className:"prose prose-sm max-w-none p-3 outline-none [&_.ProseMirror]:min-h-[80px] [&_.ProseMirror]:outline-none"})]}),S&&I("div",{className:qe("absolute bottom-2 right-3",A),style:H,children:S})]}):Y("div",{className:"relative",children:[I("textarea",{ref:v,value:d,onChange:N=>{if(s)return;let O=N.target.value;p(O);let z=$a(O),q=za(O);g(z),b(q),w(),i({content:[{type:"paragraph",content:[{type:"text",text:O}]}],wordCount:z})},onInput:w,disabled:s,placeholder:r||l.openResponseTextPlaceholder,rows:4,style:{resize:"none",overflow:"hidden"},className:qe("w-full px-3 py-2 text-base min-h-[100px] rounded border transition-colors outline-none",o,s&&"cursor-default")}),S&&I("div",{className:qe("absolute bottom-2 right-3",A),children:S})]})}var wi={image:"image/*",pdf:"application/pdf",audio:"audio/*",video:"video/*"},ki={image:I(fi,{size:12,style:re(12)}),pdf:I(Ia,{size:12,style:re(12)}),audio:I(hi,{size:12,style:re(12)}),video:I(Ma,{size:12,style:re(12)}),videoLink:I(gi,{size:12,style:re(12)})};function rn({allowedTypes:e,allowMultiple:r,fileInstructions:t,isDisabled:n,files:a,setFiles:s,mediaHandler:o,t:i,compact:c=!1}){let l=Te(null),[d,p]=ve(!1),[m,g]=ve(!1),[u,b]=ve(""),v=e.some(f=>f!=="videoLink"),w=e.includes("videoLink"),x=r||a.length===0,_=e.filter(f=>f!=="videoLink").map(f=>wi[f]).filter(Boolean).join(","),h=lt(f=>{s(M=>r?[...M,f]:[f])},[r,s]),y=lt(f=>{s(M=>M.filter((A,H)=>H!==f))},[s]),C=async f=>{if(!(!x||n)){p(!0);try{let M=f.type.startsWith("image/")?"image":f.type==="application/pdf"?"document":f.type.startsWith("audio/")?"audio":f.type.startsWith("video/")?"video":"file";if(o){let A=await o.upload(f,M);h({kind:"file",url:A.url,mimeType:A.mimeType??f.type,name:f.name})}else{let A=URL.createObjectURL(f);h({kind:"file",url:A,mimeType:f.type,name:f.name})}}finally{p(!1)}}},T=async f=>{if(f.preventDefault(),g(!1),n||!x)return;let M=f.dataTransfer.files?.[0];M&&await C(M)},$=()=>{let f=u.trim();f&&(h({kind:"videoLink",url:f,platform:yi(f)}),b(""))},R={image:i.openResponseTypeImage,pdf:i.openResponseTypePdf,audio:i.openResponseTypeAudio,video:i.openResponseTypeVideo,videoLink:i.openResponseTypeVideoLink};return Y("div",{className:"space-y-2",children:[t&&!c&&I("p",{className:"text-sm text-gray-600 italic",children:t}),a.length>0&&I("div",{className:c?"flex flex-wrap gap-1.5":"space-y-2",children:a.map((f,M)=>I(Ri,{file:f,onRemove:n?void 0:()=>y(M),compact:c,t:i},M))}),!n&&x&&Y("div",{className:"space-y-2",children:[v&&!c&&Y("div",{onDragOver:f=>{f.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:T,className:"border-2 border-dashed rounded-lg p-6 text-center transition-colors cursor-pointer",style:{borderColor:m?"var(--ink-faint, #8d93a0)":"var(--line-strong, #d6d3cc)",background:m?"var(--ui-muted, #f5f4f1)":"transparent"},onClick:()=>l.current?.click(),children:[I(di,{size:26,className:"mx-auto mb-2",style:{...re(26),color:"var(--ink-soft, #565b66)"}}),I("p",{className:"text-sm font-medium",style:{color:"var(--ink-soft, #565b66)"},children:i.openResponseDropZoneLabel}),I("p",{className:"text-xs hover:underline mt-0.5",style:{color:"var(--ink, #1d2025)"},children:i.openResponseDropZoneBrowse}),d&&I("p",{className:"text-xs mt-1 animate-pulse",style:{color:"var(--ink-faint, #8d93a0)"},children:i.openResponseUploading}),I("div",{className:"flex flex-wrap justify-center gap-1.5 mt-3",children:e.filter(f=>f!=="videoLink").map(f=>Y("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 bg-gray-100 text-gray-600 rounded-full",children:[ki[f]," ",R[f]]},f))})]}),v&&c&&I("button",{type:"button",onClick:()=>l.current?.click(),disabled:d,className:"text-xs px-3 py-1.5 rounded border border-dashed disabled:opacity-50",style:{borderColor:"var(--line-strong, #d6d3cc)",color:"var(--ink-soft, #565b66)"},children:d?i.openResponseUploading:`+ ${i.openResponseAttachFile}`}),I("input",{ref:l,type:"file",accept:_,onChange:async f=>{let M=f.target.files?.[0];M&&(await C(M),f.target.value="")},className:"hidden"}),w&&Y("div",{className:"flex gap-2 flex-wrap",children:[I("input",{type:"url",value:u,onChange:f=>b(f.target.value),placeholder:i.openResponseVideoLinkPlaceholder,className:"flex-1 text-sm border rounded px-2 py-1.5 outline-none",style:{borderColor:"var(--line-strong, #d6d3cc)"},onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),$())}}),I("button",{type:"button",onClick:$,disabled:!u.trim(),className:"text-sm px-3 py-1.5 rounded text-white disabled:opacity-50",style:{background:"var(--ink, #1d2025)"},children:i.openResponseAddVideoLink})]})]}),n&&a.length===0&&I("p",{className:"text-sm text-gray-400 text-center py-3",children:i.openResponseNoSubmission})]})}function Ri({file:e,onRemove:r,compact:t,t:n}){if(e.kind==="videoLink"){let a=e.platform==="youtube"?vi(e.url):null;return Y("div",{className:qe("bg-white rounded border border-gray-200",t?"px-2 py-1 flex items-center gap-1.5":"p-3 space-y-1"),children:[a&&!t&&I("iframe",{src:`https://www.youtube.com/embed/${a}`,width:240,height:135,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"rounded w-full"}),I("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 underline truncate block max-w-[200px]",children:e.url}),r&&I("button",{type:"button",onClick:r,className:"ml-auto text-gray-400 hover:text-rose-500 text-xs",children:"\u2715"})]})}return Y("div",{className:qe("bg-white rounded border border-gray-200",t?"px-2 py-1 flex items-center gap-1.5":"p-2 flex items-center gap-2"),children:[e.mimeType?.startsWith("image/")?I("img",{src:e.url,alt:e.name??"upload",className:t?"h-6 w-6 object-cover rounded":"h-16 w-16 object-cover rounded"}):e.mimeType?.startsWith("audio/")?I("audio",{src:e.url,controls:!0,className:t?"hidden":"h-8 max-w-[240px]"}):e.mimeType?.startsWith("video/")?I("video",{src:e.url,controls:!0,className:t?"hidden":"h-16 max-w-[240px] rounded"}):I(Ia,{size:20,style:{...re(20),color:"var(--ink-soft, #565b66)"}}),Y("div",{className:"flex-1 min-w-0",children:[I("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-700 truncate block hover:underline",children:e.name??n.openResponseFile}),t&&e.mimeType?.startsWith("audio/")&&I("audio",{src:e.url,controls:!0,className:"h-6 max-w-[160px] mt-0.5"})]}),r&&I("button",{type:"button",onClick:r,className:"ml-auto text-gray-400 hover:text-rose-500 text-xs shrink-0",children:"\u2715"})]})}function Si({nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,allowedTypes:s,allowMultiple:o,fileInstructions:i,isDisabled:c,feedbackBorderClass:l,files:d,setFiles:p,emitAnswer:m,answerBus:g,mediaHandler:u,t:b}){let[v,w]=ve(null),[x,_]=ve(!1);return Pe(()=>{m({...v&&{text:v},files:d.length>0?d:void 0})},[v,d]),Y("div",{className:"space-y-2",children:[I(Da,{nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,isDisabled:c,feedbackBorderClass:l,emitAnswer:h=>w(h),answerBus:g}),!c&&Y("div",{children:[Y("button",{type:"button",onClick:()=>_(!x),className:"flex items-center gap-1.5 text-xs",style:{color:"var(--ink-soft, #565b66)"},children:[I("span",{children:x?"\u25BE":"\u25B8"}),Y("span",{children:[b.openResponseAttachFiles,d.length>0&&I("span",{className:"ml-1 rounded-full px-1.5 py-0.5 text-[10px]",style:{background:"var(--ui-muted, #f5f4f1)",color:"var(--ink, #1d2025)"},children:d.length})]})]}),x&&I("div",{className:"mt-1.5",children:I(rn,{allowedTypes:s,allowMultiple:o,fileInstructions:i,isDisabled:c,feedbackBorderClass:l,files:d,setFiles:p,mediaHandler:u,t:b,compact:!0})})]}),c&&d.length>0&&Y("div",{className:"space-y-1",children:[I("p",{className:"text-xs text-gray-500 font-medium",children:b.openResponseAttachedFiles}),I(rn,{allowedTypes:s,allowMultiple:o,isDisabled:!0,feedbackBorderClass:l,files:d,setFiles:p,t:b,compact:!0})]})]})}function _i({kind:e,maxDuration:r,isDisabled:t,feedbackBorderClass:n,mediaHandler:a,emitAnswer:s,t:o}){let[i,c]=ve("idle"),[l,d]=ve(0),[p,m]=ve(null),[g,u]=ve("audio/webm"),[b,v]=ve(null),w=Te(null),x=Te(null),_=Te([]),h=Te(null),y=Te(null),C=Te(null),T=Te(0);Pe(()=>()=>{$(),h.current&&clearInterval(h.current),cancelAnimationFrame(T.current)},[]),Pe(()=>{i==="recording"&&e==="audio"&&x.current&&H(x.current)},[i]);let $=()=>{x.current?.getTracks().forEach(S=>S.stop()),x.current=null},R=async()=>{if(!a){v(o.openResponseMediaHandlerRequired);return}v(null),c("requesting");try{let S;if(e==="screen"){let z=await navigator.mediaDevices.getDisplayMedia({video:{cursor:"always"},audio:!1});try{let Q=(await navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0];Q&&z.addTrack(Q)}catch{}z.getVideoTracks()[0]?.addEventListener("ended",()=>{w.current?.state==="recording"&&f()}),S=z,y.current&&(y.current.srcObject=S,y.current.play())}else e==="video"?(S=await navigator.mediaDevices.getUserMedia({audio:!0,video:{facingMode:"environment"}}),y.current&&(y.current.srcObject=S,y.current.play())):S=await navigator.mediaDevices.getUserMedia({audio:!0});x.current=S;let N=e==="audio"?"audio/webm":"video/webm";u(N);let O=new MediaRecorder(S,{mimeType:N});w.current=O,_.current=[],O.ondataavailable=z=>{z.data.size>0&&_.current.push(z.data)},O.onstop=()=>{let z=new Blob(_.current,{type:N}),q=URL.createObjectURL(z);m(q),c("reviewing"),$(),cancelAnimationFrame(T.current)},O.start(200),c("recording"),d(0),h.current=setInterval(()=>{d(z=>{let q=z+1;return r&&q>=r&&f(),q})},1e3)}catch{c("idle"),v(o.openResponsePermissionDenied)}},f=()=>{h.current&&(clearInterval(h.current),h.current=null),w.current?.stop()},M=async()=>{if(!p||!a)return;c("submitted");let N=await(await fetch(p)).blob(),O=e==="screen"?"video":e,z=new File([N],"recording.webm",{type:g}),q=await a.upload(z,O);URL.revokeObjectURL(p),s({url:q.url,mimeType:q.mimeType??g,duration:l,kind:O})},A=()=>{p&&URL.revokeObjectURL(p),m(null),d(0),c("idle")},H=S=>{let N=new AudioContext,O=N.createMediaStreamSource(S),z=N.createAnalyser();z.fftSize=64,O.connect(z);let q=new Uint8Array(z.frequencyBinCount),Q=C.current;if(!Q)return;let D=()=>{z.getByteFrequencyData(q);let X=Q.getContext("2d");if(!X)return;X.clearRect(0,0,Q.width,Q.height);let k=Q.width/q.length*2.5,P=0;for(let F=0;F<q.length;F++){let U=q[F]/255*Q.height;X.fillStyle="#1d2025",X.fillRect(P,Q.height-U,k,U),P+=k+1}T.current=requestAnimationFrame(D)};D()};return t?I("div",{className:qe("rounded border p-4 text-center text-sm text-gray-400",n),children:o.openResponseRecordingSubmitted}):Y("div",{className:qe("rounded border p-4 space-y-3",n),children:[b&&I("p",{className:"text-sm",style:{color:"var(--pen, #d23b2b)"},children:b}),(e==="video"||e==="screen")&&i==="recording"&&I("video",{ref:y,muted:!0,className:"w-full rounded max-h-48 bg-black",playsInline:!0}),e==="audio"&&i==="recording"&&I("canvas",{ref:C,width:300,height:48,className:"w-full rounded bg-gray-900"}),i==="reviewing"&&p&&(e==="audio"?I("audio",{src:p,controls:!0,className:"w-full",onLoadedMetadata:S=>Pa(S.currentTarget)}):I("video",{src:p,controls:!0,className:"w-full rounded max-h-48",onLoadedMetadata:S=>Pa(S.currentTarget)})),Y("div",{className:"flex items-center justify-center gap-3",children:[i==="idle"&&Y("button",{type:"button",onClick:R,className:"flex flex-col items-center gap-1 px-6 py-3 rounded-full font-medium text-white transition-colors",style:{background:"var(--ink, #1d2025)"},children:[e==="audio"?I(pi,{size:22,style:re(22)}):e==="screen"?I(mi,{size:22,style:re(22)}):I(Ma,{size:22,style:re(22)}),I("span",{className:"text-sm",children:e==="screen"?o.openResponseTapToRecordScreen:o.openResponseTapToRecord})]}),i==="requesting"&&I("p",{className:"text-sm text-gray-500 animate-pulse",children:o.openResponseRequestingPermission}),i==="recording"&&Y("div",{className:"flex flex-col items-center gap-2",children:[Y("div",{className:"flex items-center gap-2 font-mono text-lg",style:{color:"var(--pen, #d23b2b)"},children:[I("span",{className:"animate-pulse",children:"\u25CF"}),I("span",{children:La(l)}),r&&Y("span",{className:"text-sm",style:{color:"var(--ink-faint, #8d93a0)"},children:["/ ",La(r)]})]}),I("button",{type:"button",onClick:f,className:"px-5 py-2 rounded-full text-white text-sm font-medium",style:{background:"var(--pen, #d23b2b)"},children:o.openResponseStopRecording})]}),i==="reviewing"&&Y("div",{className:"flex gap-2",children:[I("button",{type:"button",onClick:A,className:"px-4 py-1.5 rounded border text-sm",style:{borderColor:"var(--line-strong, #d6d3cc)",color:"var(--ink, #1d2025)"},children:o.openResponseReRecord}),I("button",{type:"button",onClick:M,className:"px-4 py-1.5 rounded text-white text-sm",style:{background:"var(--ink, #1d2025)"},children:o.openResponseConfirmRecording})]}),i==="submitted"&&Y("p",{className:"text-sm",style:{color:"var(--ok, #1f8a4c)"},children:["\u2713 ",o.openResponseRecordingSubmitted]})]})]})}function Ci({feedback:e,feedbackState:r,score:t,t:n}){let a=r==="correct"?{bg:"var(--ok-soft, #ecf8f0)",border:"var(--ok, #1f8a4c)",ink:"var(--ok, #1f8a4c)"}:r==="incorrect"?{bg:"var(--pen-soft, #fdeeec)",border:"var(--pen, #d23b2b)",ink:"var(--pen, #d23b2b)"}:{bg:"var(--almost-soft, #fbf1dc)",border:"var(--almost, #c8810e)",ink:"var(--almost-ink, #8a5a08)"};return Y("div",{className:"rounded p-3 text-sm border",style:{background:a.bg,borderColor:a.border,color:"var(--ink, #1d2025)"},children:[I("p",{className:"text-xs font-medium mb-1 opacity-70",children:n.openResponseTeacherFeedbackLabel}),e.flatMap(s=>s.content?.map(o=>o.text??"")??[s.text??""]).join(" "),t!=null&&Y("div",{className:"mt-1 text-right",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:E("1.4rem"),lineHeight:1,color:a.ink},children:[t," pts"]})]})}import{jsx as ir,jsxs as He,Fragment as ja}from"react/jsx-runtime";import{useEffect as tn,useMemo as Ai,useRef as Ni,useState as Fa}from"react";function Ei(e){return e?.showFeedback?e.state==="validating"?"validating":e.state==="correct"?"correct":e.state==="incorrect"?"incorrect":"idle":"idle"}function et({nodeId:e,placeholder:r,hint:t,validationFeedback:n,readOnly:a=!1}){let s=Z(),o=le(),i=Ni(null),[c,l]=Fa(""),[d,p]=Fa(!1),m=Ei(n),g=n?.score,u=n?.maxScore,b=h=>Number.isInteger(h)?String(h):h.toFixed(2),v=n?.displayAnswer,w=Ai(()=>v?Ze(v,!1):"",[v]);tn(()=>{import("mathlive").then(()=>{p(!0)}).catch(()=>{})},[]),tn(()=>{let h=y=>{let C=y.answers?.find(T=>T.nodeId===e&&T.type==="mathResponse");C?.answer?.latex!==void 0&&(l(C.answer.latex),i.current&&(i.current.value=C.answer.latex))};return o.on("answers:prefill",h),()=>o.off("answers:prefill",h)},[o,e]),tn(()=>{o.emit({type:"answer:changed",answer:{nodeId:e,type:"mathResponse",timestamp:Date.now(),answer:{latex:c}}})},[c,e,o]);let x=h=>{let y=h.target?.value??"";l(y)},_=m==="correct"?"player-math-field--correct":m==="incorrect"?"player-math-field--incorrect":m==="validating"?"player-math-field--validating":"";return He("div",{dir:"ltr",className:"math-response-player",children:[He("span",{style:{display:"inline-flex",alignItems:"center",gap:E("0.4rem")},children:[ir("div",{className:"player-math-field"+(_?" "+_:"")+(a?" player-math-field--readonly":""),children:d?ir("math-field",{ref:i,value:c,onInput:x,"virtual-keyboard-mode":"onfocus","smart-fence":"true",className:"player-math-field__input",style:{opacity:a?.7:1,pointerEvents:a?"none":"auto"}}):ir("input",{type:"text",value:c,onChange:h=>l(h.target.value),placeholder:r||"Enter LaTeX (e.g. \\frac{x^2}{2})",readOnly:a,className:"player-math-field__fallback"})}),ir($e,{hint:t})]}),n?.showFeedback&&He("div",{className:"player-math-feedback player-math-feedback--"+m,children:[m==="validating"&&He(ja,{children:[ir("span",{className:"player-math-spinner"}),ir("span",{children:s.mathChecking})]}),m==="correct"&&He(ja,{children:[He("span",{children:["\u2713 ",s.mathCorrect]}),g!=null&&He("span",{className:"player-math-score",children:[b(g),u!=null?` / ${b(u)}`:""]})]}),m==="incorrect"&&He("span",{children:["\u2717 ",s.mathIncorrect]}),m==="incorrect"&&w&&He("span",{className:"player-blank-reveal player-math-reveal",children:["(",ir("span",{dangerouslySetInnerHTML:{__html:w}}),")"]})]})]})}import{jsx as K,jsxs as de,Fragment as Tr}from"react/jsx-runtime";import{useCallback as Vi,useEffect as Gi,useRef as Qi,useState as Er}from"react";import{Play as Yi,Lock as Ki,Check as an,X as Wa}from"lucide-react";function mt(e,r){if(e===r)return!0;if(e===null||r===null||typeof e!=typeof r||typeof e!="object")return!1;let t=Array.isArray(e),n=Array.isArray(r);if(t!==n)return!1;if(t&&n){let c=e,l=r;return c.length!==l.length?!1:c.every((d,p)=>mt(d,l[p]))}let a=e,s=r,o=Object.keys(a),i=Object.keys(s);return o.length!==i.length?!1:o.every(c=>mt(a[c],s[c]))}var Ti=`
1
+ import"./chunk-76CZ6Z7T.mjs";import mi from"react";import{createRoot as fi}from"react-dom/client";import{useCallback as ci,useMemo as wd,useState as kd}from"react";import{cloneElement as Xo,isValidElement as Jo,useCallback as Ue,useEffect as Xt,useMemo as Te,useRef as pr,useState as Be}from"react";import{jsx as zr}from"react/jsx-runtime";import{useEffect as Vn,useMemo as xl,useRef as yl}from"react";import Ci from"mitt";var Je=class{constructor(){this.emitter=Ci(),this.answers=new Map}emit(r){if(r.type==="answer:changed")this.answers.set(r.answer.nodeId,r.answer);else if(r.type==="answers:reset")this.answers.clear();else if(r.type==="answers:prefill")for(let t of r.answers)this.answers.set(t.nodeId,t);this.emitter.emit(r.type,r)}on(r,t){this.emitter.on(r,t)}off(r,t){this.emitter.off(r,t)}getAllAnswers(){return Array.from(this.answers.values())}clearAnswers(){this.answers.clear(),this.emit({type:"answers:reset"})}prefillAnswers(r){this.emit({type:"answers:prefill",answers:r})}submitAnswers(){this.emit({type:"answer:submitted",answers:this.getAllAnswers(),timestamp:Date.now()})}},va="__edpireGlobalAnswerBus",wa=globalThis,ft=wa[va]??(wa[va]=new Je);import{jsx as _i}from"react/jsx-runtime";import{createContext as Ni,useContext as Ai}from"react";var ka="__edpireAnswerBusContext",Ra=globalThis,Sa=Ra[ka]??(Ra[ka]=Ni(ft));function ye(){return Ai(Sa)}function ht({children:e,bus:r=new Je}){return _i(Sa.Provider,{value:r,children:e})}import{jsx as ve,jsxs as Er}from"react/jsx-runtime";import{Fragment as bs,useState as Wa,useEffect as Rn,useMemo as xs}from"react";import Ze from"clsx";import{jsx as Q,jsxs as Da}from"react/jsx-runtime";import{jsx as Me,jsxs as un}from"react/jsx-runtime";import{createContext as Mi,useCallback as mn,useContext as Li,useEffect as Yr,useMemo as Ii,useRef as Pr,useState as hr}from"react";import{Pause as $i,Play as zi,RotateCcw as Di}from"lucide-react";import{jsx as Pi}from"react/jsx-runtime";import{createContext as Ti,useContext as Ca}from"react";var Ar={submitButton:"Submit",showHint:"Show hint",clickToRemove:"Click to remove",blankAnswerAria:"Your answer",aiEvaluationInProgress:"AI evaluation in progress\u2026",aiEvaluationInProgressAria:"AI evaluation in progress",shortAnswerPlaceholder:"Short answer\u2026",longAnswerPlaceholder:"Write your answer here\u2026",minWordsLabel:e=>`Min: ${e}`,wordBank:"Word Bank",chooseN:e=>`(choose ${e})`,annexDefaultLabel:"Documents",annexOpen:e=>`Open ${e}`,annexClose:"Close",referenceInPanel:e=>`This exercise's text is in ${e}.`,readReference:"Read it",referenceForExercise:e=>`Exercise ${e}`,choiceLetters:"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),tableScrollLeft:"Show the columns on the left",tableScrollRight:"Show the columns on the right",mathChecking:"Checking your answer\u2026",mathCorrect:"Correct",mathIncorrect:"Incorrect",openResponseTextPlaceholder:"Write your answer here\u2026",openResponseWords:"words",openResponseChars:"chars",openResponseDropZoneLabel:"Drag & drop files here, or",openResponseDropZoneBrowse:"browse",openResponseUploading:"Uploading\u2026",openResponseNoSubmission:"No submission",openResponseFile:"File",openResponseAttachFile:"Attach a file",openResponseAttachFiles:"Attach files",openResponseAttachedFiles:"Attached files",openResponseTypeImage:"Image",openResponseTypePdf:"PDF",openResponseTypeAudio:"Audio",openResponseTypeVideo:"Video",openResponseTypeVideoLink:"Video link",openResponseVideoLinkPlaceholder:"Paste YouTube or Vimeo URL\u2026",openResponseAddVideoLink:"Add",openResponseTapToRecord:"Tap to start recording",openResponseTapToRecordScreen:"Click to start screen recording",openResponseRequestingPermission:"Requesting permission\u2026",openResponsePermissionDenied:"Microphone/camera access denied. Please allow access in your browser settings.",openResponseMediaHandlerRequired:"A media handler is required to save recordings.",openResponseStopRecording:"Stop",openResponseReRecord:"Re-record",openResponseConfirmRecording:"Use this recording",openResponseRecordingSubmitted:"Recording submitted",openResponseAwaitingReview:"Submitted, awaiting teacher review",openResponseTeacherFeedbackLabel:"Teacher feedback",openResponseGradeThisResponse:"Grade this response",openResponseGradeScoreLabel:e=>`Score (max ${e})`,openResponseGradeFeedbackLabel:"Feedback (optional)",openResponseGradeFeedbackPlaceholder:"Add feedback for the student\u2026",openResponseSubmitGrade:"Submit Grade",openResponseGradeSubmitted:(e,r)=>`Grade submitted: ${e} / ${r}`,openResponseRubricTitle:"Rubric",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} pts`,openResponseAiSuggestionTitle:"AI Pre-grading Suggestion",openResponseAiSuggestedScore:(e,r)=>`Suggested score: ${e} / ${r}`,openResponseAiEvidence:"Evidence:",openResponseAiApplySuggestion:"Apply suggestion",openResponseStudentAnswerTitle:"Student answer",audioPlay:"Play",audioPause:"Pause",audioReplay:"Play again",audioSpeed:e=>`Speed ${e}`,audioRate:e=>`${e}\xD7`,audioPosition:"Position in the audio",audioTimeOf:(e,r)=>`${e} of ${r}`,audioPlaysLeft:e=>e===1?"1 play left":`${e} plays left`,audioNoPlaysLeft:"No plays left",audioUnavailable:"This audio can't be played.",recorderUpTo:e=>`Up to ${e}`,recorderRecord:"Record",recorderRecordingAria:"Recording",recorderSaving:e=>`Saving ${e}%`,recorderSaved:"Saved",recorderRecordAgain:"Record again",recorderCancel:"Cancel",recorderFailed:"Your recording wasn't saved. Check your connection.",recorderRetry:"Try again",recorderUnsupported:"This browser can't record. Try an up-to-date Chrome, Safari or Firefox.",recorderUnavailableHere:"Recording isn't available here.",recorderNone:"No recording"};var gt={submitButton:"Valider",showHint:"Voir l'indice",clickToRemove:"Cliquer pour retirer",blankAnswerAria:"Votre r\xE9ponse",aiEvaluationInProgress:"\xC9valuation IA en cours\u2026",aiEvaluationInProgressAria:"\xC9valuation IA en cours",shortAnswerPlaceholder:"R\xE9ponse courte\u2026",longAnswerPlaceholder:"\xC9crivez votre r\xE9ponse ici\u2026",minWordsLabel:e=>`Min. : ${e}`,wordBank:"Banque de mots",chooseN:e=>`(choisir ${e})`,annexDefaultLabel:"Documents",annexOpen:e=>`Ouvrir ${e}`,annexClose:"Fermer",referenceInPanel:e=>`Le texte de cet exercice est dans \xAB ${e} \xBB.`,readReference:"Le lire",referenceForExercise:e=>`Exercice ${e}`,choiceLetters:"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),tableScrollLeft:"Voir les colonnes de gauche",tableScrollRight:"Voir les colonnes de droite",mathChecking:"V\xE9rification de votre r\xE9ponse\u2026",mathCorrect:"Juste",mathIncorrect:"Faux",openResponseTextPlaceholder:"\xC9crivez votre r\xE9ponse ici\u2026",openResponseWords:"mots",openResponseChars:"car.",openResponseDropZoneLabel:"Glissez-d\xE9posez des fichiers ici, ou",openResponseDropZoneBrowse:"parcourir",openResponseUploading:"Envoi en cours\u2026",openResponseNoSubmission:"Aucun fichier d\xE9pos\xE9",openResponseFile:"Fichier",openResponseAttachFile:"Joindre un fichier",openResponseAttachFiles:"Joindre des fichiers",openResponseAttachedFiles:"Fichiers joints",openResponseTypeImage:"Image",openResponseTypePdf:"PDF",openResponseTypeAudio:"Audio",openResponseTypeVideo:"Vid\xE9o",openResponseTypeVideoLink:"Lien vid\xE9o",openResponseVideoLinkPlaceholder:"Coller un lien YouTube ou Vimeo\u2026",openResponseAddVideoLink:"Ajouter",openResponseTapToRecord:"Appuyer pour d\xE9marrer l'enregistrement",openResponseTapToRecordScreen:"Cliquer pour d\xE9marrer l'enregistrement d'\xE9cran",openResponseRequestingPermission:"Demande d'autorisation\u2026",openResponsePermissionDenied:"Acc\xE8s au micro ou \xE0 la cam\xE9ra refus\xE9. Autorisez-le dans les r\xE9glages du navigateur.",openResponseMediaHandlerRequired:"Un gestionnaire de m\xE9dias est requis pour sauvegarder les enregistrements.",openResponseStopRecording:"Arr\xEAter",openResponseReRecord:"R\xE9enregistrer",openResponseConfirmRecording:"Utiliser cet enregistrement",openResponseRecordingSubmitted:"Enregistrement soumis",openResponseAwaitingReview:"Soumis, en attente de correction par l'enseignant",openResponseTeacherFeedbackLabel:"Commentaire de l'enseignant",openResponseGradeThisResponse:"Corriger cette r\xE9ponse",openResponseGradeScoreLabel:e=>`Note (max ${e})`,openResponseGradeFeedbackLabel:"Commentaire (facultatif)",openResponseGradeFeedbackPlaceholder:"Ajouter un commentaire pour l'\xE9l\xE8ve\u2026",openResponseSubmitGrade:"Valider la note",openResponseGradeSubmitted:(e,r)=>`Note envoy\xE9e : ${e} / ${r}`,openResponseRubricTitle:"Grille d'\xE9valuation",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} pts`,openResponseAiSuggestionTitle:"Suggestion de correction par IA",openResponseAiSuggestedScore:(e,r)=>`Score sugg\xE9r\xE9 : ${e} / ${r}`,openResponseAiEvidence:"Extrait :",openResponseAiApplySuggestion:"Appliquer la suggestion",openResponseStudentAnswerTitle:"R\xE9ponse de l'\xE9l\xE8ve",audioPlay:"\xC9couter",audioPause:"Pause",audioReplay:"R\xE9\xE9couter",audioSpeed:e=>`Vitesse ${e}`,audioRate:e=>`${String(e).replace(".",",")}\xD7`,audioPosition:"Position dans l'audio",audioTimeOf:(e,r)=>`${e} sur ${r}`,audioPlaysLeft:e=>e===1?"1 \xE9coute restante":`${e} \xE9coutes restantes`,audioNoPlaysLeft:"Plus d'\xE9coute restante",audioUnavailable:"Impossible de lire cet audio.",recorderUpTo:e=>`Jusqu'\xE0 ${e}`,recorderRecord:"Enregistrer",recorderRecordingAria:"Enregistrement en cours",recorderSaving:e=>`Envoi ${e}\u202F%`,recorderSaved:"Enregistr\xE9",recorderRecordAgain:"Recommencer",recorderCancel:"Annuler",recorderFailed:"Votre enregistrement n'a pas \xE9t\xE9 envoy\xE9. V\xE9rifiez votre connexion.",recorderRetry:"R\xE9essayer",recorderUnsupported:"Ce navigateur ne peut pas enregistrer. Essayez Chrome, Safari ou Firefox \xE0 jour.",recorderUnavailableHere:"L'enregistrement n'est pas disponible ici.",recorderNone:"Aucun enregistrement"};var bt={submitButton:"\u0625\u0631\u0633\u0627\u0644",showHint:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062A\u0644\u0645\u064A\u062D",clickToRemove:"\u0627\u0646\u0642\u0631 \u0644\u0644\u0625\u0632\u0627\u0644\u0629",blankAnswerAria:"\u0625\u062C\u0627\u0628\u062A\u0643",aiEvaluationInProgress:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A\u2026",aiEvaluationInProgressAria:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",shortAnswerPlaceholder:"\u0625\u062C\u0627\u0628\u0629 \u0642\u0635\u064A\u0631\u0629\u2026",longAnswerPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627\u2026",minWordsLabel:e=>`\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649: ${e}`,wordBank:"\u0628\u0646\u0643 \u0627\u0644\u0643\u0644\u0645\u0627\u062A",chooseN:e=>`(\u0627\u062E\u062A\u0631 ${e})`,annexDefaultLabel:"\u0627\u0644\u0645\u0633\u062A\u0646\u062F\u0627\u062A",annexOpen:e=>`\u0641\u062A\u062D ${e}`,annexClose:"\u0625\u063A\u0644\u0627\u0642",referenceInPanel:e=>`\u0646\u0635 \u0647\u0630\u0627 \u0627\u0644\u062A\u0645\u0631\u064A\u0646 \u0641\u064A \xAB${e}\xBB.`,readReference:"\u0627\u0642\u0631\u0623\u0647",referenceForExercise:e=>`\u0627\u0644\u062A\u0645\u0631\u064A\u0646 ${e}`,choiceLetters:["\u0623","\u0628","\u062C","\u062F","\u0647\u0640","\u0648","\u0632","\u062D","\u0637","\u064A","\u0643","\u0644","\u0645","\u0646","\u0633","\u0639","\u0641","\u0635","\u0642","\u0631","\u0634","\u062A","\u062B","\u062E","\u0630","\u0636","\u0638","\u063A"],tableScrollLeft:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0639\u0644\u0649 \u0627\u0644\u064A\u0633\u0627\u0631",tableScrollRight:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u0639\u0645\u062F\u0629 \u0639\u0644\u0649 \u0627\u0644\u064A\u0645\u064A\u0646",mathChecking:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0646 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",mathCorrect:"\u0635\u062D\u064A\u062D",mathIncorrect:"\u062E\u0637\u0623",openResponseTextPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643 \u0647\u0646\u0627\u2026",openResponseWords:"\u0643\u0644\u0645\u0629",openResponseChars:"\u062D\u0631\u0641",openResponseDropZoneLabel:"\u0627\u0633\u062D\u0628 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0648\u0623\u0641\u0644\u062A\u0647\u0627 \u0647\u0646\u0627\u060C \u0623\u0648",openResponseDropZoneBrowse:"\u062A\u0635\u0641\u0651\u062D",openResponseUploading:"\u062C\u0627\u0631\u064D \u0627\u0644\u0631\u0641\u0639\u2026",openResponseNoSubmission:"\u0644\u0627 \u064A\u0648\u062C\u062F \u062A\u0633\u0644\u064A\u0645",openResponseFile:"\u0645\u0644\u0641",openResponseAttachFile:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641",openResponseAttachFiles:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",openResponseAttachedFiles:"\u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0627\u0644\u0645\u0631\u0641\u0642\u0629",openResponseTypeImage:"\u0635\u0648\u0631\u0629",openResponseTypePdf:"PDF",openResponseTypeAudio:"\u0635\u0648\u062A",openResponseTypeVideo:"\u0641\u064A\u062F\u064A\u0648",openResponseTypeVideoLink:"\u0631\u0627\u0628\u0637 \u0641\u064A\u062F\u064A\u0648",openResponseVideoLinkPlaceholder:"\u0627\u0644\u0635\u0642 \u0631\u0627\u0628\u0637 \u064A\u0648\u062A\u064A\u0648\u0628 \u0623\u0648 Vimeo\u2026",openResponseAddVideoLink:"\u0625\u0636\u0627\u0641\u0629",openResponseTapToRecord:"\u0627\u0646\u0642\u0631 \u0644\u0628\u062F\u0621 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseTapToRecordScreen:"\u0627\u0646\u0642\u0631 \u0644\u0628\u062F\u0621 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0634\u0627\u0634\u0629",openResponseRequestingPermission:"\u062C\u0627\u0631\u064D \u0637\u0644\u0628 \u0627\u0644\u0625\u0630\u0646\u2026",openResponsePermissionDenied:"\u062A\u0645 \u0631\u0641\u0636 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u064A\u0643\u0631\u0648\u0641\u0648\u0646/\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627. \u064A\u064F\u0631\u062C\u0649 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0627\u0644\u0648\u0635\u0648\u0644 \u0645\u0646 \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0645\u062A\u0635\u0641\u062D.",openResponseMediaHandlerRequired:"\u064A\u0644\u0632\u0645 \u0645\u0639\u0627\u0644\u062C \u0648\u0633\u0627\u0626\u0637 \u0644\u062D\u0641\u0638 \u0627\u0644\u062A\u0633\u062C\u064A\u0644\u0627\u062A.",openResponseStopRecording:"\u0625\u064A\u0642\u0627\u0641",openResponseReRecord:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseConfirmRecording:"\u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0647\u0630\u0627 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseRecordingSubmitted:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",openResponseAwaitingReview:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u060C \u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631 \u0645\u0631\u0627\u062C\u0639\u0629 \u0627\u0644\u0645\u0639\u0644\u0645",openResponseTeacherFeedbackLabel:"\u0645\u0644\u0627\u062D\u0638\u0627\u062A \u0627\u0644\u0645\u0639\u0644\u0645",openResponseGradeThisResponse:"\u062A\u0635\u062D\u064A\u062D \u0647\u0630\u0647 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",openResponseGradeScoreLabel:e=>`\u0627\u0644\u062F\u0631\u062C\u0629 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 ${e})`,openResponseGradeFeedbackLabel:"\u0645\u0644\u0627\u062D\u0638\u0627\u062A (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",openResponseGradeFeedbackPlaceholder:"\u0623\u0636\u0641 \u0645\u0644\u0627\u062D\u0638\u0627\u062A \u0644\u0644\u0637\u0627\u0644\u0628\u2026",openResponseSubmitGrade:"\u0627\u0639\u062A\u0645\u0627\u062F \u0627\u0644\u062F\u0631\u062C\u0629",openResponseGradeSubmitted:(e,r)=>`\u062A\u0645 \u0627\u0639\u062A\u0645\u0627\u062F \u0627\u0644\u062F\u0631\u062C\u0629: ${e} / ${r}`,openResponseRubricTitle:"\u0633\u0644\u0651\u0645 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",openResponseRubricCriterionPoints:(e,r)=>`${e} / ${r} \u0646\u0642\u0637\u0629`,openResponseAiSuggestionTitle:"\u0627\u0642\u062A\u0631\u0627\u062D \u0627\u0644\u062A\u0635\u062D\u064A\u062D \u0627\u0644\u0645\u0633\u0628\u0642 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",openResponseAiSuggestedScore:(e,r)=>`\u0627\u0644\u062F\u0631\u062C\u0629 \u0627\u0644\u0645\u0642\u062A\u0631\u062D\u0629: ${e} / ${r}`,openResponseAiEvidence:"\u0627\u0644\u0623\u062F\u0644\u0629:",openResponseAiApplySuggestion:"\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0627\u0642\u062A\u0631\u0627\u062D",openResponseStudentAnswerTitle:"\u0625\u062C\u0627\u0628\u0629 \u0627\u0644\u0637\u0627\u0644\u0628",audioPlay:"\u062A\u0634\u063A\u064A\u0644",audioPause:"\u0625\u064A\u0642\u0627\u0641 \u0645\u0624\u0642\u062A",audioReplay:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0627\u0633\u062A\u0645\u0627\u0639",audioSpeed:e=>`\u0627\u0644\u0633\u0631\u0639\u0629 ${e}`,audioRate:e=>`${e}\xD7`,audioPosition:"\u0627\u0644\u0645\u0648\u0636\u0639 \u0641\u064A \u0627\u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",audioTimeOf:(e,r)=>`${e} \u0645\u0646 ${r}`,audioPlaysLeft:e=>e===1?"\u0628\u0642\u064A \u0627\u0633\u062A\u0645\u0627\u0639 \u0648\u0627\u062D\u062F":e===2?"\u0628\u0642\u064A \u0627\u0633\u062A\u0645\u0627\u0639\u0627\u0646":`\u0628\u0642\u064A\u062A ${e} \u0627\u0633\u062A\u0645\u0627\u0639\u0627\u062A`,audioNoPlaysLeft:"\u0644\u0645 \u064A\u0628\u0642 \u0623\u064A \u0627\u0633\u062A\u0645\u0627\u0639",audioUnavailable:"\u062A\u0639\u0630\u0631 \u062A\u0634\u063A\u064A\u0644 \u0647\u0630\u0627 \u0627\u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u0635\u0648\u062A\u064A.",recorderUpTo:e=>`\u062D\u062A\u0649 ${e}`,recorderRecord:"\u062A\u0633\u062C\u064A\u0644",recorderRecordingAria:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0633\u062C\u064A\u0644",recorderSaving:e=>`\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644 ${e}\u066A`,recorderSaved:"\u062A\u0645 \u0627\u0644\u062D\u0641\u0638",recorderRecordAgain:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0633\u062C\u064A\u0644",recorderCancel:"\u0625\u0644\u063A\u0627\u0621",recorderFailed:"\u0644\u0645 \u064A\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u062A\u0633\u062C\u064A\u0644\u0643. \u062A\u062D\u0642\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643.",recorderRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",recorderUnsupported:"\u0644\u0627 \u064A\u0645\u0643\u0646 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D \u0627\u0644\u062A\u0633\u062C\u064A\u0644. \u062C\u0631\u0651\u0628 \u0625\u0635\u062F\u0627\u0631\u064B\u0627 \u062D\u062F\u064A\u062B\u064B\u0627 \u0645\u0646 Chrome \u0623\u0648 Safari \u0623\u0648 Firefox.",recorderUnavailableHere:"\u0627\u0644\u062A\u0633\u062C\u064A\u0644 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D \u0647\u0646\u0627.",recorderNone:"\u0644\u0627 \u064A\u0648\u062C\u062F \u062A\u0633\u062C\u064A\u0644"};var Ei={en:Ar,fr:gt,ar:bt},pn=Ti(null);function ie(){return Ca(pn)??Ar}function Qr(e){let r=Ca(pn);return e&&Ei[e]||r||Ar}function Gr({locale:e,children:r}){let t=Qr(e);return Pi(pn.Provider,{value:t,children:r})}var _a=Mi(null);function xt({initial:e,onChange:r,children:t}){let n=Pr({...e??{}}),a=Pr(r);a.current=r;let o=Ii(()=>({get:i=>n.current[i]??0,set:(i,s)=>{n.current={...n.current,[i]:s},a.current?.(n.current)}}),[]);return Me(_a.Provider,{value:o,children:t})}var fn=[.75,1,1.25,1.5],hn=.5;function Tr(e){if(!Number.isFinite(e)||e<0)return"0:00";let r=Math.round(e);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var gn="edpire:audio-play";function Qe({src:e,maxPlays:r,learnerSpeed:t,speed:n,allowSeek:a,durationHint:o,playsKey:i,playsUsed:s,onPlaysUsedChange:c,disabled:l=!1,label:p,className:u}){let d=ie(),h=Li(_a),m=i??e,b=r&&r>0?Math.floor(r):0,w=a!==!1,R=t!==!1,v=n&&n>=.25&&n<=4?n:1,C=Pr(null),x=Pr(null),[S,k]=hr(!1),[_,T]=hr(0),[F,g]=hr(o&&o>0?o:0),[E,f]=hr(!1),[q,A]=hr(!1),[L,G]=hr(v),[B,V]=hr(()=>s??h?.get(m)??0),K=Pr(!1),le=Pr(!1);Yr(()=>{s!==void 0&&V(s)},[s]),Yr(()=>G(v),[v]),Yr(()=>{C.current&&(C.current.playbackRate=L)},[L]),Yr(()=>{A(!1),f(!1),T(0),k(!1),K.current=!1,o&&o>0||g(0);let D=C.current;D&&D.readyState>=1&&Number.isFinite(D.duration)&&D.duration>0&&g(D.duration)},[e]),Yr(()=>{let D=J=>{let Z=C.current;Z&&J.detail!==Z&&!Z.paused&&Z.pause()};return window.addEventListener(gn,D),()=>window.removeEventListener(gn,D)},[]);let xe=b>0&&B>=b&&!K.current,P=b>0?Math.max(0,b-B):null,y=l||q||xe,O=mn(()=>{if(b===0)return!0;if(B>=b)return!1;let D=B+1;return V(D),K.current=!0,s===void 0&&h?.set(m,D),c?.(D),!0},[b,B,s,h,m,c]),j=mn(()=>{let D=C.current;if(!D||l||q)return;if(!D.paused){D.pause();return}(E||D.currentTime<hn)&&!K.current&&!O()||((E||D.currentTime>=(D.duration||1/0))&&(D.currentTime=0),f(!1),D.playbackRate=L,window.dispatchEvent(new CustomEvent(gn,{detail:D})),D.play().catch(()=>k(!1)))},[l,q,E,O,L]),z=F>0?F:0,oe=z>0?Math.min(1,_/z):0,re=mn(D=>{let J=C.current;if(!J||!w||y||z===0)return;let Z=Math.max(0,Math.min(z,D));if(b>0&&Z<hn&&_>=hn&&K.current&&(K.current=!1,!J.paused&&!O())){J.pause();return}J.currentTime=Z,T(Z),f(!1)},[w,y,z,b,_,O]),se=D=>{let J=x.current;if(!J)return 0;let Z=J.getBoundingClientRect(),H=getComputedStyle(J).direction==="rtl"?(Z.right-D)/Z.width:(D-Z.left)/Z.width;return Math.max(0,Math.min(1,H))},de=D=>{!w||y||z===0||(D.preventDefault(),le.current=!0,D.currentTarget.setPointerCapture(D.pointerId),re(se(D.clientX)*z))},U=D=>{le.current&&re(se(D.clientX)*z)},Y=()=>{le.current=!1},me=D=>{if(!w||y||z===0)return;let J=x.current?getComputedStyle(x.current).direction==="rtl":!1,Z=5,pe=null;D.key==="ArrowRight"?pe=_+(J?-Z:Z):D.key==="ArrowLeft"?pe=_+(J?Z:-Z):D.key==="ArrowUp"?pe=_+Z:D.key==="ArrowDown"?pe=_-Z:D.key==="Home"?pe=0:D.key==="End"&&(pe=z),pe!==null&&(D.preventDefault(),re(pe))},ee=()=>{let D=fn.indexOf(L);G(fn[(D+1)%fn.length]??1)},te=(S||_>0)&&!E&&z>0,ce=Tr(te?z-_:z),ze=S?Me($i,{size:18,fill:"currentColor",strokeWidth:0,"aria-hidden":!0}):E&&!xe?Me(Di,{size:18,"aria-hidden":!0}):Me(zi,{size:18,fill:"currentColor",strokeWidth:0,"aria-hidden":!0,style:{marginInlineStart:2}}),Ee=S?d.audioPause:E?d.audioReplay:d.audioPlay;return un("span",{role:"group","aria-label":p,className:`edp-audio${y?" edp-audio--off":""}${u?` ${u}`:""}`,"data-audio-player":"",children:[un("span",{className:"edp-audio-bar",children:[Me("button",{type:"button",className:"edp-audio-play",onClick:j,disabled:y,"aria-label":Ee,children:ze}),un("span",{ref:x,className:`edp-audio-track${w&&!y?" edp-audio-track--seek":""}`,role:"slider",tabIndex:w&&!y?0:-1,"aria-label":d.audioPosition,"aria-valuemin":0,"aria-valuemax":Math.round(z),"aria-valuenow":Math.round(_),"aria-valuetext":d.audioTimeOf(Tr(_),Tr(z)),"aria-disabled":!w||y,onPointerDown:de,onPointerMove:U,onPointerUp:Y,onPointerCancel:Y,onKeyDown:me,children:[Me("span",{className:"edp-audio-rail",children:Me("span",{className:"edp-audio-fill",style:{width:`${oe*100}%`}})}),w&&!y&&z>0&&Me("span",{className:"edp-audio-thumb",style:{insetInlineStart:`${oe*100}%`}})]}),Me("span",{className:"edp-audio-time",dir:"ltr",children:ce}),R&&!q&&Me("button",{type:"button",className:"edp-audio-speed",dir:"ltr",onClick:ee,disabled:l,"aria-label":d.audioSpeed(d.audioRate(L)),children:d.audioRate(L)})]}),(q||P!==null)&&Me("span",{className:"edp-audio-note","aria-live":"polite",children:Me("bdi",{children:q?d.audioUnavailable:P===0&&!K.current?d.audioNoPlaysLeft:d.audioPlaysLeft(P??0)})}),Me("audio",{ref:C,src:e||void 0,preload:"metadata",onLoadedMetadata:D=>{let J=D.currentTarget;J.playbackRate=L,Number.isFinite(J.duration)&&J.duration>0?g(J.duration):Fi(J,Z=>g(pe=>pe>0?pe:Z))},onDurationChange:D=>{let J=D.currentTarget.duration;Number.isFinite(J)&&J>0&&g(J)},onTimeUpdate:D=>{le.current||T(D.currentTarget.currentTime)},onPlay:()=>k(!0),onPause:()=>k(!1),onEnded:()=>{k(!1),f(!0),K.current=!1,T(z)},onError:()=>{e&&A(!0)}})]})}function Fi(e,r){let t=()=>{e.removeEventListener("timeupdate",t),Number.isFinite(e.duration)&&e.duration>0&&r(e.duration),e.currentTime=0};e.addEventListener("timeupdate",t);try{e.currentTime=1e101}catch{e.removeEventListener("timeupdate",t)}}import ji from"katex";import"katex/dist/contrib/mhchem.js";var Oi={"\\d":"\\mathrm{d}","\\R":"\\mathbb{R}","\\N":"\\mathbb{N}","\\Z":"\\mathbb{Z}","\\Q":"\\mathbb{Q}","\\C":"\\mathbb{C}"};function gr(e,r,t=!0){try{return ji.renderToString(e,{displayMode:r,output:t?"htmlAndMathml":"html",throwOnError:!1,errorColor:"#cc0000",macros:Oi,strict:!1})}catch(n){return`<span class="katex-error" style="color:#cc0000" title="${String(n)}">${e}</span>`}}function I(e){return`calc(${typeof e=="number"?`${e}px`:e} * var(--edp-scale, 1))`}function fe(e){return{width:I(e),height:I(e)}}function We(e){if(e==null||e==="")return;if(typeof e=="number")return I(e);let r=String(e).trim();return/^\d+(\.\d+)?px$/.test(r)?I(r):r}import{createContext as Bi}from"react";var Kr=Bi(!1),yt="1px solid #d1d5db",qi="#f3f4f6",Wi="#e3e1dc",Ui="var(--card, #fff)",br="edp-table-first",Na={overflowX:"auto",margin:`${I("1.25rem")} 0`},Aa={left:!1,right:!1,held:0,rtl:!1};function Pa(e,r,t,n=0){return{left:r.left<e.left-1,right:r.right>e.right+1,held:n,rtl:t}}function Ta(e,r){return Math.max(80,Math.round((e-r)*.8))}var bn={borderCollapse:"separate",borderSpacing:0,width:"100%",tableLayout:"auto",fontSize:I("0.875rem"),lineHeight:1.3,borderBlockStart:yt,borderInlineStart:yt};function Xr(e){let r=e.gray?Wi:e.header?qi:e.sticky?Ui:void 0;return{borderBlockEnd:yt,borderInlineEnd:yt,padding:`${I("4px")} ${I("6px")}`,verticalAlign:"middle",overflowWrap:"normal",wordBreak:"normal",hyphens:"manual",...r?{background:r}:{},...e.header?{fontWeight:600}:{},...e.sticky?{position:"sticky",insetInlineStart:0,zIndex:1}:{}}}function Jr(e){return Object.entries(e).map(([r,t])=>`${r.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}:${t}`).join(";")}function xn(e){let r=[],t=new Set,n=[];(e??[]).forEach((i,s)=>{let c=0;(i.content??[]).forEach(l=>{for(;n[s]?.[c];)c++;let p=Math.max(1,l.attrs?.colspan??1),u=Math.max(1,l.attrs?.rowspan??1);for(let d=s;d<s+u;d++){let h=n[d]??(n[d]=[]);for(let m=c;m<c+p;m++)h[m]=!0}for(let d=0;d<p;d++){let h=l.attrs?.colwidth?.[d];h&&r[c+d]==null&&(r[c+d]=h)}c===0&&p===1&&t.add(l),c+=p})});let a=n.reduce((i,s)=>Math.max(i,s.length),0);return{columnWidths:r.some(i=>i!=null)?Array.from({length:a},(i,s)=>r[s]??null):[],stickyCells:t}}function yn(e){return e.replace(/(\d) (?=\d)/g,"$1\xA0").replace(/(\d) (?=[\p{L}%\p{Sc}]{1,3}(?![\p{L}\p{N}]))/gu,"$1\xA0")}import{jsx as Ge,jsxs as vn}from"react/jsx-runtime";import{useCallback as Hi,useEffect as Vi,useLayoutEffect as Qi,useRef as Gi,useState as Yi}from"react";var Ki=typeof window<"u"?Qi:Vi;function Ea({side:e}){return Ge("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:Ge("path",{d:e==="left"?"M15 6l-6 6 6 6":"M9 6l6 6-6 6"})})}function Ma({children:e}){let r=ie(),t=Gi(null),[n,a]=Yi(Aa),o=Hi(()=>{let u=t.current,d=u?.querySelector("table");if(!u||!d)return;let h=u.querySelector(`.${br}`),m=Pa(u.getBoundingClientRect(),d.getBoundingClientRect(),getComputedStyle(u).direction==="rtl",h?h.getBoundingClientRect().width:0);a(b=>b.left===m.left&&b.right===m.right&&b.held===m.held&&b.rtl===m.rtl?b:m)},[]);Ki(()=>{let u=t.current;if(!u)return;o(),u.addEventListener("scroll",o,{passive:!0});let d=typeof ResizeObserver<"u"?new ResizeObserver(o):null;d?.observe(u);let h=u.querySelector("table");return h&&d?.observe(h),()=>{u.removeEventListener("scroll",o),d?.disconnect()}},[o]);let i=u=>{let d=t.current;d&&d.scrollBy({left:u*Ta(d.clientWidth,n.held),behavior:"smooth"})},s=n.left||n.right,c=u=>s?Ge("div",{className:`edp-table-arrows edp-table-arrows--${u}`,children:vn("span",{dir:"ltr",className:"edp-table-arrows__pair",children:[Ge("button",{type:"button",className:"edp-table-arrow",onClick:()=>i(-1),disabled:!n.left,"aria-label":r.tableScrollLeft,children:Ge(Ea,{side:"left"})}),Ge("button",{type:"button",className:"edp-table-arrow",onClick:()=>i(1),disabled:!n.right,"aria-label":r.tableScrollRight,children:Ge(Ea,{side:"right"})})]})}):null,l=n.rtl?0:n.held,p=n.rtl?n.held:0;return vn("div",{className:"edp-table-frame",style:{margin:`${I("1.25rem")} 0`},children:[c("top"),vn("div",{style:{position:"relative"},children:[Ge("div",{ref:t,className:"edp-table-scroll",style:{overflowX:"auto"},children:e}),n.left&&Ge("span",{className:"edp-table-shade edp-table-shade--left",style:{left:l},"aria-hidden":"true"}),n.right&&Ge("span",{className:"edp-table-shade edp-table-shade--right",style:{right:p},"aria-hidden":"true"})]}),c("bottom")]})}var La={1:{fontSize:"1.75em",fontWeight:700,lineHeight:1.2,margin:"0.6em 0 0.4em"},2:{fontSize:"1.4em",fontWeight:700,lineHeight:1.25,margin:"0.6em 0 0.35em"},3:{fontSize:"1.15em",fontWeight:600,lineHeight:1.3,margin:"0.5em 0 0.3em"}},Ia={border:"#2563eb",background:"#e0f2fe"},$a={border:"#dc2626",background:"#fee2e2"};function Xi(e){return{display:"inline-block",verticalAlign:"middle",border:`2px solid ${e?.border||Ia.border}`,background:e?.background||Ia.background,borderRadius:I("4px"),padding:"0.17em 0.37em"}}function Ji(e){let r=e?.shape==="circle"?"50%":"9999px";return{display:"inline-block",verticalAlign:"middle",border:`2px solid ${e?.border||$a.border}`,background:e?.background||$a.background,borderRadius:r,padding:"0.15em 0.45em"}}function Zi(e,r){if(!(!e&&!r))return{...e?{textAlign:e}:{},...r?{margin:0}:{}}}function De(e,r,t){return Q("div",{className:"exercise-content",children:e.content.map((n,a)=>Ne(n,`node-${a}`,r,t))})}var es=/^[\u00a0\u202f ]?[.,;:!?\u2026)\]}\u00bb\u201d\u2019%\u060c\u061b\u061f]+/,rs=new Set(["blank","inlineChoiceSet"]);function za(e,r,t,n){let a=[],o=e??[];for(let i=0;i<o.length;i++){let s=o[i],c=o[i+1],l=rs.has(s.type)&&c?.type==="text"?es.exec(c.text??"")?.[0]:void 0;if(!l||!c){a.push(Ne(s,`${r}-${i}`,t,n));continue}let p=(c.text??"").slice(l.length);a.push(Da("span",{style:{whiteSpace:"nowrap"},children:[Q("span",{style:{whiteSpace:"normal"},children:Ne(s,`${r}-${i}-a`,t,n)}),Ne({...c,text:l},`${r}-${i}-p`,t,n)]},`${r}-${i}`)),p&&a.push(Ne({...c,text:p},`${r}-${i+1}`,t,n)),i++}return a}function Ne(e,r,t,n){switch(e.type){case"choiceSet":case"inlineChoiceSet":return Q(wt,{node:e,validationFeedback:t?.get(e.id)},r);case"blank":return e.attrs.mode==="typed"?Q(kt,{node:e,validationFeedback:t?.get(e.id)},r):Q(Rt,{node:e,validationFeedback:t?.get(e.id)},r);case"blankPool":return Q(St,{node:e},r);case"inlinePool":return Q(Ct,{node:e},r);case"matchingSet":return Q(_t,{node:e,validationFeedback:t?.get(e.id)},r);case"aiAnswerInput":return Q(Nt,{node:e,validationFeedback:t?.get(e.id)},r);case"openResponseNode":return Q(At,{node:e,validationFeedback:t?.get(e.id),readOnly:n?.readOnly,mediaHandler:n?.mediaHandler},r);case"mathResponse":return Q(Pt,{nodeId:e.id,placeholder:e.attrs?.placeholder,hint:e.attrs?.hint,validationFeedback:t?.get(e.id),readOnly:n?.readOnly},r);case"codingResponse":return Q(Tt,{node:e,validationFeedback:t?.get(e.id),readOnly:n?.readOnly,executor:n?.codeExecutor},r);case"aiEvaluationConfig":return null;case"paragraph":{let a=e.attrs,o=a?.textAlign,i=a?.dir||void 0;return Q("p",{dir:i,style:Zi(o,n?.inTable),children:za(e.content,r,t,n)},r)}case"heading":{let a=e.attrs.level??1,o=`h${a}`,i=e.attrs,s=i?.textAlign,c=i?.dir||void 0,l=La[a]??La[3];return Q(o,{dir:c,style:{...l,...s?{textAlign:s}:{}},children:za(e.content,r,t,n)},r)}case"blockquote":{let a=e.attrs,o=a?.dir||void 0,i=a?.textAlign;return Q("blockquote",{dir:o,style:{borderInlineStart:"3px solid #d6d3cc",paddingInlineStart:"1em",margin:"0.75em 0",color:"#565b66",fontStyle:"italic",...i?{textAlign:i}:{}},children:e.content?.map((s,c)=>Ne(s,`${r}-${c}`,t,n))},r)}case"text":{let a=e,o=n?.inTable?yn(a.text??""):a.text??"",i=a.marks??[];if(i.length===0)return Q("span",{children:o},r);let s={};for(let l of i)l.type==="textStyle"&&(l.attrs?.color&&(s.color=l.attrs.color),l.attrs?.fontSize&&(s.fontSize=l.attrs.fontSize),l.attrs?.fontFamily&&(s.fontFamily=l.attrs.fontFamily));let c=o;for(let l of i)switch(l.type){case"bold":c=Q("strong",{children:c});break;case"italic":c=Q("em",{children:c});break;case"underline":c=Q("u",{children:c});break;case"strike":c=Q("s",{children:c});break;case"code":c=Q("code",{children:c});break;case"subscript":c=Q("sub",{children:c});break;case"superscript":c=Q("sup",{children:c});break;case"boxedText":c=Q("span",{style:Xi(l.attrs),children:c});break;case"circleText":c=Q("span",{style:Ji(l.attrs),children:c});break}return Q("span",{style:Object.keys(s).length>0?s:void 0,children:c},r)}case"hardBreak":return Q("br",{},r);case"resizableImage":return Q("img",{src:e.attrs?.src||void 0,alt:e.attrs?.alt||"",style:{display:"inline-block",verticalAlign:"middle",width:We(e.attrs?.width||void 0)??"auto",height:We(e.attrs?.height||void 0)??"auto",maxWidth:"100%"}},r);case"resizableAudio":{let a=e.attrs??{src:""},o=n?.readOnly===!0;return Q(Qe,{src:a.src||"",maxPlays:o?null:a.maxPlays,learnerSpeed:a.learnerSpeed,speed:a.speed,allowSeek:o?null:a.allowSeek},r)}case"resizableVideo":return Q("video",{src:e.attrs?.src||void 0,controls:!0,style:{display:"inline-block",verticalAlign:"middle",width:We(e.attrs?.width||void 0)??"auto",height:We(e.attrs?.height||void 0)??"auto",maxWidth:"100%"}},r);case"youtubeEmbed":return Q("iframe",{src:`https://www.youtube.com/embed/${e.attrs?.videoId||""}`,width:e.attrs?.width||480,height:e.attrs?.height||270,allowFullScreen:!0,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",style:{display:"inline-block",verticalAlign:"middle",border:0,width:We(e.attrs?.width||480),height:We(e.attrs?.height||270)}},r);case"inlineMath":return Q("span",{dir:"ltr",style:{unicodeBidi:"isolate",display:"inline-block"},className:"math-inline",dangerouslySetInnerHTML:{__html:gr(e.attrs?.latex??"",!1,!0)}},r);case"blockMath":return Q("div",{dir:"ltr",style:{unicodeBidi:"isolate",textAlign:"center",margin:"1em 0"},className:"math-block",dangerouslySetInnerHTML:{__html:gr(e.attrs?.latex??"",!0,!0)}},r);case"variable":return Q("span",{className:"variable",children:`{${e.attrs?.name}}`},r);default:{let a=e;if(a.type==="bulletList")return Q("ul",{style:{listStyleType:"disc",paddingLeft:"1.5em",margin:"0.5em 0"},children:a.content?.map((o,i)=>Ne(o,`${r}-${i}`,t,n))},r);if(a.type==="orderedList")return Q("ol",{style:{listStyleType:"decimal",paddingLeft:"1.5em",margin:"0.5em 0"},children:a.content?.map((o,i)=>Ne(o,`${r}-${i}`,t,n))},r);if(a.type==="listItem")return Q("li",{children:a.content?.map((o,i)=>Ne(o,`${r}-${i}`,t,n))},r);if(a.type==="table"){let o=xn(a.content),i={...n,inTable:!0,stickyCells:o.stickyCells};return Q(Ma,{children:Da("table",{style:bn,children:[o.columnWidths.length>0&&Q("colgroup",{children:o.columnWidths.map((s,c)=>Q("col",{style:s?{width:I(s)}:void 0},c))}),Q("tbody",{children:a.content?.map((s,c)=>Ne(s,`${r}-${c}`,t,i))})]})},r)}return a.type==="tableRow"?Q("tr",{children:a.content?.map((o,i)=>Ne(o,`${r}-${i}`,t,n))},r):a.type==="tableCell"?Q("td",{colSpan:a.attrs?.colspan,rowSpan:a.attrs?.rowspan,className:n?.stickyCells?.has(a)?br:void 0,style:Xr({header:!1,gray:!!a.attrs?.gray,sticky:!!n?.stickyCells?.has(a)}),children:Q(Kr.Provider,{value:!0,children:a.content?.map((o,i)=>Ne(o,`${r}-${i}`,t,n))})},r):a.type==="tableHeader"?Q("th",{colSpan:a.attrs?.colspan,rowSpan:a.attrs?.rowspan,className:n?.stickyCells?.has(a)?br:void 0,style:Xr({header:!0,gray:!!a.attrs?.gray,sticky:!!n?.stickyCells?.has(a)}),children:Q(Kr.Provider,{value:!0,children:a.content?.map((o,i)=>Ne(o,`${r}-${i}`,t,n))})},r):(console.warn(`Unknown node type during interpretation: ${e.type}`),null)}}}function ue(e,r){return e.map(t=>{if(t.type==="text"){let n=xr(r?.inTable?yn(t.text??""):t.text??""),a=t.marks??[],o=[];for(let i of a)i.type==="textStyle"&&(i.attrs?.color&&o.push(`color:${i.attrs.color}`),i.attrs?.fontSize&&o.push(`font-size:${i.attrs.fontSize}`),i.attrs?.fontFamily&&o.push(`font-family:${i.attrs.fontFamily}`));o.length>0&&(n=`<span style="${o.join(";")}">${n}</span>`);for(let i of a)switch(i.type){case"bold":n=`<strong>${n}</strong>`;break;case"italic":n=`<em>${n}</em>`;break;case"underline":n=`<u>${n}</u>`;break;case"strike":n=`<s>${n}</s>`;break;case"code":n=`<code>${n}</code>`;break;case"subscript":n=`<sub>${n}</sub>`;break;case"superscript":n=`<sup>${n}</sup>`;break;case"boxedText":{let s=i.attrs?.border||"#2563eb",c=i.attrs?.background||"#e0f2fe";n=`<span style="display:inline-block;vertical-align:middle;border:2px solid ${s};background:${c};border-radius:${I("4px")};padding:0.17em 0.37em">${n}</span>`;break}case"circleText":{let s=i.attrs?.border||"#dc2626",c=i.attrs?.background||"#fee2e2",l=i.attrs?.shape==="circle"?"50%":"9999px";n=`<span style="display:inline-block;vertical-align:middle;border:2px solid ${s};background:${c};border-radius:${l};padding:0.15em 0.45em">${n}</span>`;break}}return n}if(t.type==="paragraph"){let n=t.content?ue(t.content,r):"",a=t.attrs?.dir,o=t.attrs?.textAlign,i=a?` dir="${a}"`:"",s=[o?`text-align:${o}`:"",r?.inTable?"margin:0":""].filter(Boolean).join(";"),c=s?` style="${s}"`:"";return r?.stripParagraphs?n:`<p${i}${c}>${n}</p>`}if(t.type==="hardBreak")return"<br/>";if(t.type==="table"){let n=xn(t.content),a=t.content?ue(t.content,{...r,inTable:!0,stickyCells:n.stickyCells}):"",o=n.columnWidths.length?`<colgroup>${n.columnWidths.map(i=>i?`<col style="width:${I(i)}">`:"<col>").join("")}</colgroup>`:"";return`<div style="${Jr(Na)}"><table style="${Jr(bn)}">${o}<tbody>${a}</tbody></table></div>`}if(t.type==="tableRow")return`<tr>${t.content?ue(t.content,r):""}</tr>`;if(t.type==="tableCell"){let n=t.content?ue(t.content,r):"",a=t.attrs?.colspan?` colspan="${t.attrs.colspan}"`:"",o=t.attrs?.rowspan?` rowspan="${t.attrs.rowspan}"`:"",i=!!r?.stickyCells?.has(t),s=i?` class="${br}"`:"";return`<td${a}${o}${s} style="${Jr(Xr({header:!1,gray:!!t.attrs?.gray,sticky:i}))}">${n}</td>`}if(t.type==="tableHeader"){let n=t.content?ue(t.content,r):"",a=t.attrs?.colspan?` colspan="${t.attrs.colspan}"`:"",o=t.attrs?.rowspan?` rowspan="${t.attrs.rowspan}"`:"",i=!!r?.stickyCells?.has(t),s=i?` class="${br}"`:"";return`<th${a}${o}${s} style="${Jr(Xr({header:!0,gray:!!t.attrs?.gray,sticky:i}))}">${n}</th>`}if(t.type==="bulletList")return`<ul style="list-style-type:disc;padding-left:1.5em">${t.content?ue(t.content,r):""}</ul>`;if(t.type==="orderedList")return`<ol style="list-style-type:decimal;padding-left:1.5em">${t.content?ue(t.content,r):""}</ol>`;if(t.type==="listItem")return`<li>${t.content?ue(t.content,r):""}</li>`;if(t.type==="blockquote"){let n=t.content?ue(t.content,r):"";return`<blockquote${t.attrs?.dir?` dir="${t.attrs.dir}"`:""} style="border-inline-start:3px solid #d6d3cc;padding-inline-start:1em;margin:0.75em 0;color:#565b66;font-style:italic">${n}</blockquote>`}if(t.type==="resizableImage"){let n=t.attrs??{},a=vt(n.width),o=vt(n.height);return`<img src="${xr(n.src??"")}" alt="${xr(n.alt??"")}" style="display:inline-block;vertical-align:middle;max-width:100%;${a?`width:${a};`:""}${o?`height:${o};`:""}"/>`}if(t.type==="resizableAudio"){let n=t.attrs??{};return`<audio controls preload="metadata" src="${xr(n.src??"")}" style="display:inline-block;vertical-align:middle;width:${I("260px")};max-width:100%;height:${I("36px")}"></audio>`}if(t.type==="resizableVideo"){let n=t.attrs??{},a=vt(n.width),o=vt(n.height);return`<video src="${xr(n.src??"")}" controls style="display:inline-block;vertical-align:middle;max-width:100%;${a?`width:${a};`:""}${o?`height:${o};`:""}"></video>`}if(t.type==="youtubeEmbed"){let n=t.attrs??{};return`<iframe src="https://www.youtube.com/embed/${xr(n.videoId??"")}" width="${n.width||480}" height="${n.height||270}" allowfullscreen frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" style="display:inline-block;vertical-align:middle;border:0;width:${We(n.width||480)};height:${We(n.height||270)}"></iframe>`}return t.type==="inlineMath"?`<span dir="ltr" class="math-inline" style="unicode-bidi:isolate;display:inline-block">${gr(t.attrs?.latex??"",!1,!0)}</span>`:t.type==="blockMath"?`<div dir="ltr" class="math-block" style="unicode-bidi:isolate;text-align:center;margin:1em 0">${gr(t.attrs?.latex??"",!0,!0)}</div>`:t.type==="variable"?`<span class="variable">{${xr(t.attrs?.name??"")}}</span>`:""}).join("")}function vt(e){return e==null||e===""?null:We(e)??null}function xr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}import{jsx as ts}from"react/jsx-runtime";import{createContext as ns,useContext as Fa,useMemo as ja}from"react";var as={sm:.875,md:1,lg:1.25,xl:1.5},wn=ns(null);function os(e,r){let t={...e??{}};if(r)for(let[n,a]of Object.entries(r))a!==void 0&&(t[n]=a);return t}function is(e){return typeof e=="number"?Number.isFinite(e)&&e>0?e:1:e?as[e]??1:1}function Fe(e){let r=e??{};return{scale:is(r.size),sizeSet:r.size!==void 0,choiceLabels:r.choiceLabels??"marks",choiceColumns:r.choiceColumns,layoutBy:r.layoutBy??"window",motion:r.motion??"full",shuffleSeed:r.shuffleSeed}}function Le(e){let r=Fa(wn);return ja(()=>os(r,e),[r,e?.size,e?.choiceLabels,e?.choiceColumns,e?.layoutBy,e?.motion,e?.shuffleSeed])}function Ie(){let e=Fa(wn);return ja(()=>Fe(e),[e])}function $e({display:e,children:r}){let t=Le(e);return ts(wn.Provider,{value:t,children:r})}function je(e){if(e.sizeSet)return{"--edp-scale":String(e.scale)}}function yr(){let{motion:e}=Ie();return{hop:e==="none"?"":"animate-hop",shake:e==="full"?"animate-shake":"",wobble:e==="full"?"animate-wobble":""}}function ss(e){let r=2166136261;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}function cs(e){return()=>{e=e+1831565813|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296}}function Zr(e,r){let t=[...e],n=cs(ss(r));for(let a=t.length-1;a>0;a--){let o=Math.floor(n()*(a+1));[t[a],t[o]]=[t[o],t[a]]}return t}import{Fragment as Oa,jsx as he,jsxs as ls}from"react/jsx-runtime";import{useState as Et,useEffect as qa,useRef as Ba,useLayoutEffect as ds,useCallback as ps}from"react";import{createPortal as us}from"react-dom";import ms from"clsx";var fs=typeof window<"u"?ds:qa;function kn({node:e}){if(e.type==="text"){if(!e.marks||e.marks.length===0)return he(Oa,{children:e.text});let r=e.text||"";for(let t of e.marks)t.type==="bold"?r=he("strong",{children:r}):t.type==="italic"?r=he("em",{children:r}):t.type==="underline"?r=he("u",{children:r}):t.type==="strike"?r=he("s",{children:r}):t.type==="textStyle"&&t.attrs?.color&&(r=he("span",{style:{color:t.attrs.color},children:r}));return he(Oa,{children:r})}return e.type==="paragraph"?he("span",{className:"block",children:e.content?.map((r,t)=>he(kn,{node:r},t))??he("br",{})}):e.type==="hardBreak"?he("br",{}):e.content?he("span",{className:"block",children:e.content.map((r,t)=>he(kn,{node:r},t))}):null}function hs({nodes:e}){return he("span",{className:"block space-y-1",style:{color:"var(--ink, #1d2025)"},children:e.map((r,t)=>he(kn,{node:r},t))})}function gs(e,r,t,n=8){let a=e.top-r.height-n;a<n&&(a=e.bottom+n);let o=e.left+e.width/2-r.width/2;return o=Math.max(n,Math.min(o,t-r.width-n)),{top:a,left:o}}function cr({hint:e}){let r=ie(),[t,n]=Et(!1),[a,o]=Et(!1),[i,s]=Et(null),[c,l]=Et({}),p=Ba(null),u=Ba(null);qa(()=>{if(!a)return;let R=v=>{let C=v.target;p.current&&!p.current.contains(C)&&u.current&&!u.current.contains(C)&&(o(!1),n(!1))};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[a]);let d=ps(()=>{let R=p.current,v=u.current;!R||!v||s(gs(R.getBoundingClientRect(),v.getBoundingClientRect(),window.innerWidth))},[]);fs(()=>{if(!t){s(null);return}let R=p.current;if(R){let v=getComputedStyle(R);l({direction:v.direction,fontFamily:v.fontFamily,"--edp-scale":v.getPropertyValue("--edp-scale").trim()||"1"})}return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[t,d]);let h=()=>n(!0),m=()=>{a||n(!1)},b=R=>{R.stopPropagation(),a?(o(!1),n(!1)):(o(!0),n(!0))},w=t&&typeof document<"u"?us(he("span",{className:"edpire-scope",style:{...c,display:"contents"},children:he("span",{ref:u,role:"tooltip",className:"player-blank-hint-pop",onClick:R=>R.stopPropagation(),onMouseEnter:h,onMouseLeave:m,style:{position:"fixed",top:i?i.top:0,left:i?i.left:0,bottom:"auto",transform:"none",margin:0,visibility:i?"visible":"hidden"},children:he(hs,{nodes:e})})}),document.body):null;return ls("span",{ref:p,className:"relative inline-flex items-center align-middle",onMouseEnter:h,onMouseLeave:m,children:[he("button",{type:"button",onClick:b,className:ms("player-blank-hint-btn select-none",a&&"player-blank-hint-btn--pinned"),"aria-label":r.showHint,"aria-expanded":t,children:"?"}),w]})}function Ye({hint:e}){return!e||e.length===0?null:he(cr,{hint:e})}function ys(e){return[...e].map(r=>({v:r,r:Math.random()})).sort((r,t)=>r.r-t.r).map(r=>r.v)}var vs=e=>e.replace(/ {2,}/g,r=>"&nbsp;".repeat(r.length-1)+" "),ws=new Set(["image","resizableImage","resizableVideo","youtubeEmbed"]);function Va(e){return(e??[]).some(r=>ws.has(r?.type)||Va(r?.content))}var Ua=()=>ve("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:ve("path",{d:"M5 13l4 4L19 7"})}),Ha=()=>ve("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:ve("path",{d:"M6 6l12 12M18 6L6 18"})});function wt({node:e,validationFeedback:r}){let t=ye(),n=ie(),a=Ie(),o=yr(),{id:i,content:s,attrs:c}=e,l=c.shuffle??!1,p="prompt"in c?c.prompt:void 0,u="separator"in c?c.separator??"/":"/",d="pickLimit"in c&&c.pickLimit?c.pickLimit:1,h=c.hideCount===!0,m=h||d>1,b=!h&&d>1,w="layout"in c?c.layout??"row":"row",R=e.type==="inlineChoiceSet",v=JSON.stringify(s),C=l&&a.shuffleSeed!==void 0,x=xs(()=>C?Zr(s,`${a.shuffleSeed}:${i}`):null,[C,a.shuffleSeed,i,v]),[S,k]=Wa(s);Rn(()=>{C||k(l?ys(s):s)},[l,C,v]);let _=x??S,[T,F]=Wa(new Set),g=r?.showFeedback??!1,E=r?.correctChoiceIds||[];Rn(()=>{let y=O=>{let z=O.answers.find(oe=>oe.nodeId===i&&oe.type==="choiceSet");z&&"selectedIds"in z.answer&&F(new Set(z.answer.selectedIds))};return t.on("answers:prefill",y),()=>t.off("answers:prefill",y)},[i,t]),Rn(()=>{t.emit({type:"answer:changed",answer:{nodeId:i,type:"choiceSet",timestamp:Date.now(),answer:{selectedIds:Array.from(T)}}})},[T,i,t]);let f=y=>{g||F(O=>{let j=new Set(O);return m?j.has(y)?j.delete(y):(h||j.size<d)&&j.add(y):j.has(y)?j.delete(y):(j.clear(),j.add(y)),j})},q=y=>vs(ue(y.content)),A=y=>{let O=T.has(y),j=E.includes(y);return g?j&&O?"correct":j&&!O?"correct-unchosen":!j&&O?"incorrect":"muted":O?"selected":"idle"},L={idle:"",selected:"player-choice--selected",correct:Ze("player-choice--correct",o.hop),"correct-unchosen":"player-choice--correct-unchosen",incorrect:Ze("player-choice--incorrect",o.shake),muted:"player-choice--muted"},G={idle:"",selected:"player-inline-choice--selected",correct:Ze("player-inline-choice--correct",o.hop),"correct-unchosen":"player-inline-choice--correct-unchosen",incorrect:Ze("player-inline-choice--incorrect",o.shake),muted:"player-inline-choice--muted"};if(R)return Er("span",{className:"inline-choice",children:[p&&Er("span",{className:"mr-2 font-medium",children:[p,b?ve("span",{className:"ms-1 opacity-60",children:n.chooseN(d)}):null]}),_.map((y,O)=>Er(bs,{children:[ve("button",{type:"button",disabled:g,onClick:()=>f(y.id),className:Ze("player-inline-choice",G[A(y.id)]),"aria-pressed":T.has(y.id),dangerouslySetInnerHTML:{__html:q(y)}}),O<_.length-1&&ve("span",{className:"mx-1",children:u})]},y.id)),c.hint&&c.hint.length>0&&ve(cr,{hint:c.hint})]});let B=a.layoutBy==="box",V=a.choiceColumns?Math.min(a.choiceColumns,_.length):0,K=V?{gridAutoRows:"1fr",gridTemplateColumns:`repeat(${V}, minmax(0, 1fr))`}:{gridAutoRows:"1fr"},le=_.some(y=>Va(y.content)),xe=a.choiceLabels==="letters",P=y=>n.choiceLetters[y]??String(y+1);return Er("div",{className:Ze("cs-player my-4 space-y-3",B&&"cs-player--box"),children:[p&&Er("p",{className:"font-medium",children:[p,b?ve("span",{className:"ms-2 text-sm opacity-70",children:n.chooseN(d)}):null]}),c.hint&&c.hint.length>0&&ve(cr,{hint:c.hint}),ve("div",{className:Ze("cs-player__grid",w==="row"&&"cs-player__grid--row"),style:K,children:_.map((y,O)=>{let j=A(y.id),z=j==="incorrect"?"incorrect":j==="correct"||j==="correct-unchosen"?"correct":null;return Er("button",{type:"button",disabled:g,onClick:()=>f(y.id),className:Ze("player-choice",le&&"player-choice--tile",L[j]),"aria-pressed":T.has(y.id),children:[ve("span",{className:Ze("player-choice__mark",m?"player-choice__mark--box":"player-choice__mark--radio",xe&&"player-choice__mark--letter"),children:xe?P(O):j==="incorrect"?ve(Ha,{}):ve(Ua,{})}),ve("span",{className:"player-choice__text",dangerouslySetInnerHTML:{__html:q(y)}}),xe&&z&&ve("span",{className:`player-choice__verdict player-choice__verdict--${z}`,"aria-hidden":"true",children:z==="incorrect"?ve(Ha,{}):ve(Ua,{})})]},y.id)})})]})}import{jsx as er,Fragment as ks,jsxs as Sn}from"react/jsx-runtime";import{useContext as Rs,useState as Ss,useEffect as Cn,useRef as Cs,useCallback as _s}from"react";import vr from"clsx";function kt({node:e,validationFeedback:r}){let t=ye(),n=ie(),a=yr(),{id:o,attrs:i}=e,{placeholder:s="___",width:c="auto",hint:l}=i,p=Cs(null),u=s.trim().split(/\s+/).filter(Boolean).length,d=Rs(Kr),h=!d&&c==="auto"&&u>=4,[m,b]=Ss(""),w=r?.showFeedback??!1,R=r?.state,v=R==="validating",C=r?.displayAnswer,x=r?.message;Cn(()=>{let T=F=>{let E=F.answers.find(f=>f.nodeId===o&&f.type==="blank");E&&"mode"in E.answer&&E.answer.mode==="typed"&&"text"in E.answer&&b(E.answer.text)};return t.on("answers:prefill",T),()=>t.off("answers:prefill",T)},[o,t]),Cn(()=>{t.emit({type:"answer:changed",answer:{nodeId:o,type:"blank",timestamp:Date.now(),answer:{mode:"typed",text:m}}})},[m,o,t]);let S=T=>{b(T.target.value)},k=_s(()=>{let T=p.current;T&&(T.style.height="auto",T.style.height=`${T.scrollHeight}px`)},[]);Cn(()=>{k()},[m,k]);let _=w&&!v;return Sn("span",{className:d?"player-blank-cell":vr("inline-flex flex-wrap items-center gap-x-1 gap-y-0.5 align-middle max-w-full",h&&"w-full"),children:[er("span",{className:d?"player-blank-cell__box":vr("relative inline-block shrink-0 min-w-0 max-w-full",h&&"w-full flex-1"),children:_?er("span",{className:vr("player-typed-blank-feedback",d&&"player-typed-blank-feedback--cell",h&&"w-full",R==="correct"&&vr("player-typed-blank-feedback--correct",a.hop),R==="partial"&&"player-typed-blank-feedback--partial",R==="incorrect"&&vr("player-typed-blank-feedback--incorrect",a.wobble)),children:m||er("span",{className:"opacity-40",children:s})}):Sn(ks,{children:[er("textarea",{ref:p,"aria-label":n.blankAnswerAria,placeholder:s,value:m,onChange:S,disabled:w,rows:1,wrap:d?"off":void 0,className:vr("player-typed-blank",d&&"player-typed-blank--cell",h&&"w-full",v&&"player-typed-blank--pending"),style:d?void 0:c!=="auto"?{width:c}:h?{width:"100%"}:{width:`${Math.max(7,m.length+1)}ch`,maxWidth:"100%"}}),!m&&!v&&!d&&er("span",{className:"absolute right-1 top-1/2 -translate-y-1/2 pointer-events-none text-sm",style:{color:"var(--ink-faint, #8d93a0)"},children:"\u270E"}),v&&er("span",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:er("span",{className:"player-typed-blank-spinner","aria-label":n.aiEvaluationInProgressAria})})]})}),w&&R==="incorrect"&&C&&Sn("span",{className:"player-blank-reveal",children:["(",C,")"]}),w&&x&&er("span",{className:vr("player-blank-feedback",R==="correct"&&"player-blank-feedback--correct",R==="partial"&&"player-blank-feedback--partial",R==="incorrect"&&"player-blank-feedback--incorrect"),children:x}),l&&l.length>0&&er(cr,{hint:l})]})}import{jsx as Lt,Fragment as Ka,jsxs as Nn}from"react/jsx-runtime";import{useEffect as Xa}from"react";import It from"clsx";import{useDroppable as Ls,useDndContext as Is}from"@dnd-kit/core";import{jsx as Ns}from"react/jsx-runtime";import{createContext as As,useCallback as lr,useContext as Ps,useEffect as Ts,useMemo as Qa,useRef as Es,useState as _n}from"react";import{useDndMonitor as Ms}from"@dnd-kit/core";var Ya=As(null);function Ke(){let e=Ps(Ya);if(!e)throw new Error("usePool must be used within a PoolProvider");return e}function Ga(e){let r={};for(let t of e??[])t.type==="blank"&&"mode"in t.answer&&t.answer.mode==="choice"&&"choiceId"in t.answer&&t.answer.choiceId&&(r[t.nodeId]={choiceId:t.answer.choiceId,poolId:t.answer.poolId||"",value:t.answer.value||""});return r}function Mt({children:e,initialAnswers:r}){let t=ye(),n=Qa(()=>Ga(r),[r]),[a,o]=_n(n),[i,s]=_n({}),[c,l]=_n({}),p=Es(new Set);Ts(()=>{let x=S=>{let k=Ga(S.answers);Object.keys(k).length!==0&&o(_=>{if(!Object.entries(k).some(([g,E])=>_[g]?.choiceId!==E.choiceId||_[g]?.poolId!==E.poolId||_[g]?.value!==E.value))return _;let F={..._,...k};return s(g=>{let E={...g};for(let[f,q]of Object.entries(g)){let A=new Set(Object.values(F).filter(L=>L.poolId===f).map(L=>L.choiceId));E[f]={...q,available:new Set(q.choices.map(L=>L.id).filter(L=>!A.has(L)))}}return E}),F})};return t.on("answers:prefill",x),()=>t.off("answers:prefill",x)},[t]);let u=lr((x,S)=>{s(k=>{let _=k[x];if(!_){let f=new Set;for(let A of Object.values(a))A.poolId===x&&f.add(A.choiceId);let q=new Set(S.map(A=>A.id).filter(A=>!f.has(A)));return{...k,[x]:{choices:S,available:q}}}let T=new Set(_.choices.map(f=>f.id)),F=new Set(S.map(f=>f.id));if(!(S.some(f=>!T.has(f.id))||_.choices.some(f=>!F.has(f.id))))return k;let E=new Set;for(let f of _.available)F.has(f)&&E.add(f);for(let f of S)T.has(f.id)||E.add(f.id);return{...k,[x]:{choices:S,available:E}}})},[a]),d=lr((x,S)=>{l(k=>{let _=k[x]??[];return _.includes(S)?k:{...k,[x]:[..._,S]}}),!p.current.has(S)&&!a[S]&&(p.current.add(S),t.emit({type:"answer:changed",answer:{nodeId:S,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:x,value:""}}}))},[a,t]),h=lr(x=>(c[x]??[]).find(k=>!a[k])??null,[c,a]),m=lr((x,S,k,_)=>{o(T=>{let F=T[x];return F&&s(g=>{let E=g[F.poolId];if(!E)return g;let f=new Set(E.available);return f.add(F.choiceId),{...g,[F.poolId]:{...E,available:f}}}),{...T,[x]:{choiceId:k,value:_,poolId:S}}}),s(T=>{let F=T[S];if(!F)return T;let g=new Set(F.available);return g.delete(k),{...T,[S]:{...F,available:g}}}),t.emit({type:"answer:changed",answer:{nodeId:x,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:k,poolId:S,value:_}}})},[t]),b=lr(x=>{let S=a[x];if(!S)return;let{poolId:k,choiceId:_}=S;s(T=>{let F=T[k];if(!F)return T;let g=new Set(F.available);return g.add(_),{...T,[k]:{...F,available:g}}}),o(T=>{let{[x]:F,...g}=T;return g}),t.emit({type:"answer:changed",answer:{nodeId:x,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:k,value:""}}})},[a,t]),w=lr((x,S)=>i[x]?.available.has(S)??!1,[i]),R=lr((x,S)=>i[x]?.choices.find(k=>k.id===S),[i]),v=lr(()=>{o({}),s(x=>{let S={};for(let[k,_]of Object.entries(x))S[k]={choices:_.choices,available:new Set(_.choices.map(T=>T.id))};return S});for(let[x,S]of Object.entries(c))for(let k of S)t.emit({type:"answer:changed",answer:{nodeId:k,type:"blank",timestamp:Date.now(),answer:{mode:"choice",choiceId:"",poolId:x,value:""}}})},[c,t]);Ms({onDragEnd(x){window.dispatchEvent(new CustomEvent("dnd-drop",{detail:{active:x.active,over:x.over}}))}});let C=Qa(()=>({blanks:a,pools:i,registerPool:u,registerBlank:d,fill:m,back:b,isAvailable:w,getChoice:R,firstEmptyBlank:h,resetAllAnswers:v}),[a,i,u,d,m,b,w,R,h,v]);return Ns(Ya.Provider,{value:C,children:e})}function Rt({node:e,validationFeedback:r}){let{id:t,attrs:n}=e,{poolId:a,placeholder:o="___",hint:i}=n,{blanks:s,fill:c,back:l,getChoice:p,registerBlank:u}=Ke(),d=ie(),h=yr(),m=s[t],b=!!m?.choiceId,w=r?.showFeedback??!1,R=r?.state,v=r?.correctChoiceIds??[],C=w&&R==="incorrect"&&v.length>0?p(a||"",v[0]):void 0,x=C?C.html.replace(/<\/?[^>]+(>|$)/g,""):void 0,{setNodeRef:S,isOver:k}=Ls({id:t,data:{type:"blank",blankId:t,poolId:a}}),{active:_}=Is(),T=!!_&&_.data.current?.poolId===a;return Xa(()=>{u(a||"",t)},[a,t,u]),Xa(()=>{let E=f=>{let q=f,{active:A,over:L}=q.detail||{};if(!L||L.id!==t)return;let{choiceId:G,poolId:B}=A?.data.current||{};if(!G||B!==a)return;let V=p(a||"",G);if(!V)return;let K=V.html.replace(/<\/?[^>]+(>|$)/g,"");c(t,a||"",G,K)};return window.addEventListener("dnd-drop",E),()=>window.removeEventListener("dnd-drop",E)},[t,a,p,c]),Nn(Ka,{children:[Lt("span",{ref:S,onClick:()=>{b&&!w&&l(t)},className:It("player-choice-blank",k&&"player-choice-blank--over",!k&&T&&!b&&!w&&"player-choice-blank--target",b&&!w&&!k&&"player-choice-blank--filled",w&&R==="correct"&&It("player-choice-blank--correct",h.hop),w&&R==="partial"&&It("player-choice-blank--partial",h.hop),w&&R==="incorrect"&&It("player-choice-blank--incorrect",h.wobble)),title:b&&!w?d.clickToRemove:void 0,"data-node-id":t,"data-pool-id":a,children:b?Nn(Ka,{children:[Lt("span",{children:m.value}),!w&&Lt("span",{className:"player-choice-blank__clear",children:"\xD7"})]}):o}),x&&Nn("span",{className:"player-blank-reveal",children:["(",x,")"]}),Lt(Ye,{hint:i})]})}import{jsx as Tn,jsxs as Bs}from"react/jsx-runtime";import{useEffect as io,useRef as qs,useState as Ws}from"react";import Us from"clsx";import{jsx as oo,jsxs as Fs}from"react/jsx-runtime";import js from"clsx";import{useDraggable as Os}from"@dnd-kit/core";import{jsx as wr,jsxs as Ja}from"react/jsx-runtime";import{useEffect as Za,useState as eo}from"react";import $s from"clsx";var ro="edpire:tap-hint-placed",to=2;function zs(e){let t=(()=>{try{return Number(e?.getItem(ro))||0}catch{return 0}})(),n=new Set,a=new Set,o=()=>n.forEach(i=>i());return{done:()=>t>=to,placed:()=>t,recordPlacement(){if(!(t>=to)){t+=1;try{e?.setItem(ro,String(t))}catch{}o()}},setOnScreen(i,s){let c=a.has(i);s!==c&&(s?a.add(i):a.delete(i),o())},owner(){let i=null;for(let s of a)(!i||s.compareDocumentPosition(i)&4)&&(i=s);return i},subscribe(i){return n.add(i),()=>{n.delete(i)}}}}var An=null;function Pn(){if(!An){let e=null;try{e=typeof window<"u"?window.localStorage:null}catch{e=null}An=zs(e)}return An}function no(){typeof window>"u"||Pn().recordPlacement()}function Ds(){try{return window.matchMedia("(hover: none) and (pointer: coarse)").matches}catch{return!1}}function $t(e,r){let[,t]=eo(0),[n,a]=eo(!1);if(Za(()=>{a(Ds())},[]),Za(()=>{let i=e.current;if(!n||!i)return;let s=Pn();if(s.done())return;let c=s.subscribe(()=>t(p=>p+1));if(!r||typeof IntersectionObserver>"u")return()=>{s.setOnScreen(i,!1),c()};let l=new IntersectionObserver(p=>{for(let u of p)s.setOnScreen(i,u.isIntersecting)},{threshold:.6});return l.observe(i),()=>{l.disconnect(),s.setOnScreen(i,!1),c()}},[e,n,r]),!n||!r||typeof window>"u")return!1;let o=Pn();return!o.done()&&o.owner()===e.current}function ao(){let{motion:e}=Ie();return Ja("span",{className:$s("player-tap-hint",e==="none"&&"player-tap-hint--still"),"aria-hidden":"true",children:[wr("span",{className:"player-tap-hint__ripple"}),wr("svg",{className:"player-tap-hint__hand",viewBox:"0 0 24 24",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[{stroke:"#ffffff",strokeWidth:4.5},{stroke:"currentColor",strokeWidth:1.75}].map((r,t)=>Ja("g",{...r,children:[wr("path",{d:"M22 14a8 8 0 0 1-8 8"}),wr("path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2"}),wr("path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1"}),wr("path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10"}),wr("path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"})]},t))})]})}function Mr({poolId:e,data:r,isInline:t=!1,tapHint:n=!1}){let{isAvailable:a,firstEmptyBlank:o,fill:i}=Ke(),{id:s,html:c}=r,l=!a(e,s),{setNodeRef:p,attributes:u,listeners:d,transform:h,isDragging:m}=Os({id:s,data:{type:"choice",choiceId:s,poolId:e,html:c},disabled:l});if(l)return null;let b=C=>C.replace(/<\/?[^>]+(>|$)/g,""),w=()=>{let C=o(e);if(C){let x=b(c);i(C,e,s,x),no()}},R=h?{transform:`translate3d(${h.x}px, ${h.y}px, 0)`}:void 0;return Fs(t?"span":"div",{ref:p,style:R,className:js("player-bank-pill",m&&"player-bank-pill--dragging",n&&!m&&"player-bank-pill--hinted",t&&"mx-1"),...u,...d,onClick:w,children:[oo("span",{dangerouslySetInnerHTML:{__html:c},className:"pointer-events-none whitespace-pre-wrap break-words"}),n&&!m&&oo(ao,{})]})}function St({node:e}){let r=ie(),{id:t,attrs:n,content:a}=e,{shuffle:o=!0,equalWidth:i=!1}=n,{registerPool:s,isAvailable:c}=Ke(),l=qs(null),[p,u]=Ws(()=>a.map(m=>({id:m.id,html:ue(m.content)})));io(()=>{let m=a.map(b=>({id:b.id,html:ue(b.content)}));u(o?[...m].map(b=>({v:b,r:Math.random()})).sort((b,w)=>b.r-w.r).map(b=>b.v):m)},[o,JSON.stringify(a)]),io(()=>{s(t,p)},[t,p,s]);let d=p.find(m=>c(t,m.id))?.id,h=$t(l,d!==void 0);return Bs("div",{ref:l,className:"player-word-bank",children:[Tn("div",{className:"player-word-bank__label",children:r.wordBank}),Tn("div",{className:Us("player-word-bank__items",i&&"player-word-bank__items--grid"),children:p.map(m=>Tn(Mr,{poolId:t,data:m,tapHint:h&&m.id===d},m.id))})]})}import{jsx as En,jsxs as Hs}from"react/jsx-runtime";import{useEffect as so,useRef as Vs,useState as Qs}from"react";function Ct({node:e}){let{id:r,attrs:t,content:n}=e,{shuffle:a=!0,separator:o=" "}=t,{registerPool:i,isAvailable:s}=Ke(),c=Vs(null),[l,p]=Qs(()=>n.map(h=>({id:h.id,html:ue(h.content,{stripParagraphs:!0})})));so(()=>{let h=n.map(m=>({id:m.id,html:ue(m.content,{stripParagraphs:!0})}));p(a?[...h].map(m=>({v:m,r:Math.random()})).sort((m,b)=>m.r-b.r).map(m=>m.v):h)},[a,JSON.stringify(n)]),so(()=>{i(r,l)},[r,l,i]);let u=l.find(h=>s(r,h.id))?.id,d=$t(c,u!==void 0);return En("span",{ref:c,style:{display:"inline-flex",flexWrap:"wrap",gap:I("0.25rem"),alignItems:"center"},children:l.map((h,m)=>Hs("span",{children:[En(Mr,{poolId:r,data:h,isInline:!0,tapHint:d&&h.id===u}),m<l.length-1&&En("span",{children:o})]},h.id))})}import{jsx as Lr,jsxs as In}from"react/jsx-runtime";import{useState as $n,useEffect as zn,useMemo as Xs}from"react";import{Check as Js,X as Zs}from"lucide-react";import{jsx as Re,jsxs as kr}from"react/jsx-runtime";import{useState as Mn,useMemo as Ln,useRef as zt,useCallback as Gs,useLayoutEffect as Ys}from"react";var co="#1d2025",lo="#8d93a0",po="#1f8a4c",uo="#d23b2b",Ks=11;function mo({leftItems:e,rightItems:r,connections:t,direction:n,disabled:a,feedback:o,onConnectionsChange:i}){let[s,c]=Mn(null),[l,p]=Mn(null),[u,d]=Mn(new Map),h=zt(null),m=zt(new Map),b=zt("mouse"),w=o?.showFeedback??!1,R=Ln(()=>{let P=new Map;if(o?.pairFeedback)for(let y of o.pairFeedback)P.set(`${y.leftId}-${y.rightId}`,y.correct);return P},[o]),v=Ln(()=>{let P=new Map;return o?.correctPairings?.forEach(y=>P.set(y.leftId,y.rightId)),P},[o]),C=Ln(()=>{let P=new Map;return o?.correctPairings?.forEach(y=>P.set(y.rightId,y.leftId)),P},[o]),x=new Map,S=new Map;t.forEach((P,y)=>{x.set(P.leftId,y),S.set(P.rightId,y)});let k=P=>{let y=t[P];if(!w||!y)return null;let O=R.get(`${y.leftId}-${y.rightId}`);return O===!0?"correct":O===!1?"incorrect":null},_=Gs(()=>{if(!h.current)return;let P=h.current.getBoundingClientRect(),y=new Map;m.current.forEach((O,j)=>{if(O){let z=O.getBoundingClientRect();y.set(j,new DOMRect(z.left-P.left,z.top-P.top,z.width,z.height))}}),d(y)},[]);Ys(()=>{_();let P=new ResizeObserver(_);return h.current&&P.observe(h.current),()=>P.disconnect()},[_,t,e,r]);let T=8,F=(P,y)=>{let O=u.get(P);if(!O)return null;let j=O.y+O.height/2;return y==="left"?{x:O.x+O.width,y:j}:{x:O.x-T,y:j}},g=(P,y)=>{if(a)return;let j=(y==="left"?x:S).has(P),z=s?.id===P&&s?.side===y,oe=s!==null&&s.side!==y;if(z){c(null);return}if(oe){let re=y==="right"?s.id:P,se=y==="left"?s.id:P,de=t.filter(U=>U.leftId!==re&&U.rightId!==se);de.push({leftId:re,rightId:se}),i(de),c(null);return}if(j&&!s){let re=y==="left"?t.filter(se=>se.leftId!==P):t.filter(se=>se.rightId!==P);i(re);return}c({id:P,side:y})},E=zt(null),f=(P,y,O)=>{if(a||(b.current=O.pointerType,O.pointerType==="touch"))return;O.currentTarget.setPointerCapture(O.pointerId);let j=h.current.getBoundingClientRect();E.current={x:O.clientX-j.left,y:O.clientY-j.top},p({fromId:P,fromSide:y,x:O.clientX-j.left,y:O.clientY-j.top,overId:null,overSide:null})},q=P=>{if(!l)return;let y=h.current.getBoundingClientRect(),O=P.clientX-y.left,j=P.clientY-y.top,z=l.fromSide==="left"?"right":"left",oe=z==="left"?e:r,re=null,se=null;for(let de of oe){let U=u.get(de.id);if(U&&O>=U.x&&O<=U.x+U.width&&j>=U.y&&j<=U.y+U.height){re=de.id,se=z;break}}p(de=>de?{...de,x:O,y:j,overId:re,overSide:se}:null)},A=P=>{if(!l)return;let y=h.current.getBoundingClientRect(),O=P.clientX-y.left,j=P.clientY-y.top,z=E.current;if((z?Math.hypot(O-z.x,j-z.y):999)<8){p(null),g(l.fromId,l.fromSide);return}if(l.overId&&l.overSide){let re=l.fromSide==="left"?l.fromId:l.overId,se=l.fromSide==="right"?l.fromId:l.overId,de=t.filter(U=>U.leftId!==re&&U.rightId!==se);de.push({leftId:re,rightId:se}),i(de)}p(null),c(null)},L=(P,y)=>{if(!w)return null;let j=(y==="left"?x:S).get(P.id);if(j!==void 0){let z=t[j];if(R.get(`${z.leftId}-${z.rightId}`)===!0)return null}if(y==="left"){let z=v.get(P.id);return r.find(oe=>oe.id===z)?.content??null}else{let z=C.get(P.id);return e.find(oe=>oe.id===z)?.content??null}},G=(P,y)=>{let j=(y==="left"?x:S).get(P.id),z=j!==void 0,oe=s?.id===P.id&&s?.side===y,re=s!==null&&s.side!==y&&!z,se=l?.overId===P.id&&l?.overSide===y,de=z?k(j):null,U=z?j+1:null,Y="matching-player__item";z&&(Y+=" matching-player__item--matched"),de==="correct"&&(Y+=" matching-player__item--correct"),de==="incorrect"&&(Y+=" matching-player__item--incorrect"),oe&&(Y+=" matching-player__item--selected"),(re||se)&&(Y+=" matching-player__item--available"),a&&(Y+=" matching-player__item--disabled");let me=L(P,y);return kr("button",{ref:ee=>{ee?m.current.set(P.id,ee):m.current.delete(P.id)},type:"button",className:Y,onPointerDown:ee=>f(P.id,y,ee),onClick:()=>{b.current==="touch"&&g(P.id,y)},"aria-pressed":oe,children:[y==="right"&&Re("span",{className:"matching-player__connector matching-player__connector--right","aria-hidden":!0,children:kr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[Re("circle",{cx:"9",cy:"9",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.08"}),Re("path",{d:"M12 9H6M8.5 6.5L6 9l2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),z&&y==="left"&&Re("span",{className:"matching-player__pair-num","aria-hidden":!0,children:U}),Re("span",{className:"matching-player__item-text",dangerouslySetInnerHTML:{__html:ue(P.content)}}),me&&kr("span",{className:"matching-player__correct-hint",children:["(",Re("span",{dangerouslySetInnerHTML:{__html:ue(me)}}),")"]}),z&&y==="right"&&Re("span",{className:"matching-player__pair-num","aria-hidden":!0,children:U}),y==="left"&&Re("span",{className:"matching-player__connector matching-player__connector--left","aria-hidden":!0,children:kr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[Re("circle",{cx:"9",cy:"9",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"currentColor",fillOpacity:"0.08"}),Re("path",{d:"M6 9h6M9.5 6.5L12 9l-2.5 2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]},P.id)},B=n==="ltr"?e:r,V=n==="ltr"?r:e,K=n==="ltr"?"left":"right",le=n==="ltr"?"right":"left";return kr("div",{ref:h,className:`matching-player__arena${l?" matching-player__arena--dragging":""}`,onPointerMove:q,onPointerUp:A,children:[kr("svg",{className:"matching-player__svg","aria-hidden":!0,children:[Re("defs",{children:[["mp-arrow-ink",co],["mp-arrow-correct",po],["mp-arrow-incorrect",uo],["mp-arrow-ghost",lo]].map(([P,y])=>Re("marker",{id:P,markerUnits:"userSpaceOnUse",markerWidth:"11",markerHeight:"9",refX:"0",refY:"4.5",orient:"auto",children:Re("polygon",{points:"0 0, 11 4.5, 0 9",fill:y})},P))}),t.map(P=>{let y=F(P.leftId,"left"),O=F(P.rightId,"right");if(!y||!O)return null;let j=O.x-Ks,z=Math.max(16,Math.abs(j-y.x)*.4),oe=`M ${y.x} ${y.y} C ${y.x+z} ${y.y}, ${j-z} ${O.y}, ${j} ${O.y}`,re=w?R.get(`${P.leftId}-${P.rightId}`):void 0;return Re("path",{d:oe,stroke:re===!0?po:re===!1?uo:co,strokeWidth:"2.5",fill:"none",markerEnd:`url(#${re===!0?"mp-arrow-correct":re===!1?"mp-arrow-incorrect":"mp-arrow-ink"})`},`${P.leftId}-${P.rightId}`)}),l&&(()=>{let P=F(l.fromId,l.fromSide);if(!P)return null;let y=Math.abs(l.x-P.x)*.35,O=`M ${P.x} ${P.y} C ${P.x+y} ${P.y}, ${l.x-y} ${l.y}, ${l.x} ${l.y}`;return Re("path",{d:O,stroke:lo,strokeWidth:"2",strokeDasharray:"6 4",fill:"none",markerEnd:"url(#mp-arrow-ghost)"})})()]}),kr("div",{className:"matching-player__columns",children:[Re("div",{className:"matching-player__column",children:B.map(P=>G(P,K))}),Re("div",{className:"matching-player__column",children:V.map(P=>G(P,le))})]})]})}var fo=e=>Number.isInteger(e)?String(e):e.toFixed(2);function ho(e){return[...e].map(r=>({v:r,r:Math.random()})).sort((r,t)=>r.r-t.r).map(r=>r.v)}function _t({node:e,validationFeedback:r}){let t=ye(),{shuffleSeed:n,layoutBy:a}=Ie(),{id:o,attrs:i,leftItems:s,rightItems:c}=e,{direction:l,shuffle:p,hint:u}=i,d=JSON.stringify(s),h=JSON.stringify(c),m=p&&n!==void 0,b=Xs(()=>m?{left:Zr(s,`${n}:${o}:left`),right:Zr(c,`${n}:${o}:right`)}:null,[m,n,o,d,h]),[w,R]=$n(s),[v,C]=$n(c);zn(()=>{m||(p?(R(ho(s)),C(ho(c))):(R(s),C(c)))},[p,m,d,h]);let x=b?.left??w,S=b?.right??v,[k,_]=$n([]),T=r?.showFeedback??!1;zn(()=>{let A=L=>{let B=L.answers.find(V=>V.nodeId===o&&V.type==="matchingSet");B&&"connections"in B.answer&&_(B.answer.connections)};return t.on("answers:prefill",A),()=>t.off("answers:prefill",A)},[t,o]),zn(()=>{t.emit({type:"answer:changed",answer:{nodeId:o,type:"matchingSet",timestamp:Date.now(),answer:{connections:k}}})},[t,o,k]);let F=A=>{T||_(A)},g=r?.score,E=r?.maxScore,f=T&&g!=null&&E!=null,q=f?g>=E?"correct":g>0?"partial":"incorrect":null;return In("div",{className:a==="box"?"matching-player matching-player--box":"matching-player",children:[u&&u.length>0&&Lr("div",{className:"matching-player-hintrow",children:Lr(Ye,{hint:u})}),Lr(mo,{leftItems:x,rightItems:S,connections:k,direction:l,disabled:T,feedback:r,onConnectionsChange:F}),f&&In("div",{className:"matching-player-feedback matching-player-feedback--"+q,children:[q==="correct"&&Lr(Js,{size:15,style:fe(15)}),q==="incorrect"&&Lr(Zs,{size:15,style:fe(15)}),Lr("span",{children:q==="correct"?"All matched":q==="partial"?"Partial credit":"Not matched"}),In("span",{className:"matching-player-score",children:[fo(g)," / ",fo(E)]})]})]})}import{jsxs as Ir,jsx as Xe,Fragment as ec}from"react/jsx-runtime";import{useState as go,useEffect as Dn,useRef as rc,useCallback as bo}from"react";import Dt from"clsx";function Nt({node:e,validationFeedback:r}){let t=ye(),n=ie(),{id:a,attrs:o}=e,{placeholder:i,minWords:s=0,maxWords:c=500,hint:l}=o,[p,u]=go(""),[d,h]=go(0),m=r?.showFeedback??!1,b=r?.state,w=c<=30,R=bo(g=>g.trim().split(/\s+/).filter(Boolean).length,[]);Dn(()=>{let g=E=>{let q=E.answers?.find(A=>A.nodeId===a&&A.type==="aiAnswer");if(q&&q.answer?.text!=null){let A=q.answer.text;u(A),h(R(A))}};return t.on("answers:prefill",g),()=>t.off("answers:prefill",g)},[a,t,R]),Dn(()=>{let g=()=>{u(""),h(0)};return t.on("answers:reset",g),()=>t.off("answers:reset",g)},[t]);let v=rc(null),C=bo((g,E)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{t.emit({type:"answer:changed",answer:{nodeId:a,type:"aiAnswer",timestamp:Date.now(),answer:{text:g,wordCount:E}}})},300)},[a,t]);Dn(()=>{t.emit({type:"answer:changed",answer:{nodeId:a,type:"aiAnswer",timestamp:Date.now(),answer:{text:"",wordCount:0}}})},[]);let x=g=>{if(m)return;let E=R(g);u(g),h(E),C(g,E)},S=b==="validating",k=Dt("player-ai-count",d>c&&"player-ai-count--over"),_=!m||S?"":b==="correct"?"player-ai-input--correct":b==="incorrect"?"player-ai-input--incorrect":b==="partial"?"player-ai-input--partial":"",T=b==="correct"?"player-ai-feedback--correct":b==="incorrect"?"player-ai-feedback--incorrect":b==="partial"?"player-ai-feedback--partial":"",F=g=>Number.isInteger(g)?String(g):g.toFixed(2);return Ir("div",{className:"player-ai",children:[Ir("div",{className:"player-ai-counts",children:[Ir("span",{className:k,children:[d," / ",c," ",n.openResponseWords]}),s>0&&d<s&&Xe("span",{className:"player-ai-count player-ai-count--min",children:n.minWordsLabel(s)}),Xe("span",{style:{marginInlineStart:"auto"},children:Xe(Ye,{hint:l})})]}),w?Xe("input",{type:"text",value:p,onChange:g=>x(g.target.value),placeholder:i??n.shortAnswerPlaceholder,"aria-label":n.blankAnswerAria,disabled:m,className:Dt("player-ai-input",_)}):Xe("textarea",{value:p,onChange:g=>x(g.target.value),placeholder:i??n.longAnswerPlaceholder,"aria-label":n.blankAnswerAria,disabled:m,rows:5,className:Dt("player-ai-input player-ai-input--multiline",_)}),m&&r&&Xe("div",{className:Dt("player-ai-feedback",T),children:S?Ir("div",{className:"player-ai-validating",children:[Xe("span",{className:"player-ai-spinner"}),Xe("span",{children:n.aiEvaluationInProgress})]}):Ir(ec,{children:[r.message&&Xe("p",{className:"player-ai-message",children:r.message}),r.score!=null&&r.maxScore!=null&&Xe("div",{className:"player-ai-score-row",children:Ir("span",{className:"player-ai-score",children:[F(r.score)," / ",F(r.maxScore)]})})]})})]})}import{jsx as M,jsxs as X,Fragment as et}from"react/jsx-runtime";import{useState as Ae,useEffect as Pe,useRef as Ce,useCallback as Ft}from"react";import{useEditor as tc,EditorContent as nc}from"@tiptap/react";import ac from"@tiptap/starter-kit";import rr from"clsx";import{FolderOpen as oc,Mic as ic,Video as xo,Monitor as sc,Clock as cc,Image as lc,FileText as yo,Music as dc,Link2 as pc,Check as uc,AlertCircle as mc}from"lucide-react";function vo(e){return e.trim().split(/\s+/).filter(Boolean).length}function wo(e){return e.length}function fc(e){let r=t=>t.map(n=>(n.text??"")+(n.content?r(n.content):"")).join(" ");return vo(r(e))}function hc(e){let r=t=>t.map(n=>(n.text??"")+(n.content?r(n.content):"")).join("");return wo(r(e))}function gc(e){return/youtube\.com|youtu\.be/i.test(e)?"youtube":/vimeo\.com/i.test(e)?"vimeo":"other"}function bc(e){let r=e.match(/[?&]v=([^&]+)/)||e.match(/youtu\.be\/([^?]+)/)||e.match(/embed\/([^?]+)/);return r?r[1]:null}function Fn(e){let r=Math.floor(e/60),t=e%60;return`${r}:${t.toString().padStart(2,"0")}`}function At({node:e,validationFeedback:r,readOnly:t=!1,mediaHandler:n}){let a=ye(),o=ie(),{id:i,attrs:s}=e,{mode:c,placeholder:l,allowFormatting:p,wordLimit:u,characterLimit:d,allowedTypes:h,allowMultiple:m,fileInstructions:b,maxDuration:w,hint:R}=s,v=t||(r?.showFeedback??!1),C=r?.state,x=Ce(null),S=Ft(g=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{let E=g.files?.map(f=>({url:f.url,mimeType:f.kind==="videoLink"?"video/x-link":f.mimeType,name:f.kind==="videoLink"?void 0:f.name,duration:f.kind==="videoLink"?void 0:f.duration}));a.emit({type:"answer:changed",answer:{nodeId:i,type:"openResponse",timestamp:Date.now(),answer:{...g,files:E}}})},300)},[i,a]);Pe(()=>{S({})},[]);let[k,_]=Ae([]);Pe(()=>{(c==="file"||c==="text+file")&&c==="file"&&S({files:k})},[k,c]),Pe(()=>{let g=()=>{_([])};return a.on("answers:reset",g),()=>a.off("answers:reset",g)},[a]),Pe(()=>{let g=E=>{let q=(E.answers??[]).find(A=>A.nodeId===i&&A.type==="openResponse");q&&(x.current&&(clearTimeout(x.current),x.current=null),q.answer?.files&&_(q.answer.files))};return a.on("answers:prefill",g),()=>a.off("answers:prefill",g)},[i,a]);let T=r?.showFeedback,F=rr(!T&&"player-or-field--pre",T&&C==="correct"&&"player-or-field--correct",T&&C==="partial"&&"player-or-field--partial",T&&C==="incorrect"&&"player-or-field--incorrect",T&&C==="awaiting_review"&&"player-or-field--review");return X("div",{className:"my-3 space-y-2",children:[!v&&R&&R.length>0&&M("div",{className:"flex justify-end",children:M(cr,{hint:R})}),c==="text"&&M(ko,{nodeId:i,placeholder:l,allowFormatting:p,wordLimit:u,characterLimit:d,isDisabled:v,feedbackBorderClass:F,emitAnswer:g=>S({text:g}),answerBus:a}),c==="file"&&M(jn,{allowedTypes:h??["image"],allowMultiple:!!m,fileInstructions:b,isDisabled:v,feedbackBorderClass:F,files:k,setFiles:_,mediaHandler:n,t:o}),(c==="audio"||c==="video"||c==="screen")&&M(Nc,{nodeId:i,answerBus:a,kind:c,maxDuration:w,isDisabled:v,feedbackBorderClass:F,mediaHandler:n,emitAnswer:g=>S({recording:g}),t:o}),c==="text+file"&&M(wc,{nodeId:i,placeholder:l,allowFormatting:p,wordLimit:u,characterLimit:d,allowedTypes:h??["image"],allowMultiple:!!m,fileInstructions:b,isDisabled:v,feedbackBorderClass:F,files:k,setFiles:_,emitAnswer:S,answerBus:a,mediaHandler:n,t:o}),r?.showFeedback&&C==="awaiting_review"&&X("div",{className:"flex items-center gap-2 text-sm border rounded px-3 py-2",style:{color:"var(--almost-ink, #8a5a08)",background:"var(--almost-soft, #fbf1dc)",borderColor:"var(--almost, #c8810e)"},children:[M(cc,{size:15,style:fe(15),className:"animate-pulse"}),M("span",{children:o.openResponseAwaitingReview})]}),r?.showFeedback&&C!=="awaiting_review"&&r.teacherFeedback&&M(Ac,{feedback:r.teacherFeedback,feedbackState:C,score:r.score,t:o})]})}function ko({nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,isDisabled:o,feedbackBorderClass:i,emitAnswer:s,answerBus:c}){let l=ie(),[p,u]=Ae(""),[d,h]=Ae(0),[m,b]=Ae(0),w=Ce(null),R=Ft(()=>{let L=w.current;L&&(L.style.height="auto",L.style.height=`${L.scrollHeight}px`)},[]),v=tc({extensions:[ac.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1})],immediatelyRender:!1,editable:!o,content:"",onUpdate({editor:L}){if(o)return;let B=L.getJSON().content??[],V=fc(B),K=hc(B);h(V),b(K),s({content:B,wordCount:V})}});Pe(()=>{v&&v.setEditable(!o)},[o,v]);let C=Ce(null);Pe(()=>{v&&C.current!==null&&(v.commands.setContent({type:"doc",content:C.current}),C.current=null)},[v]),Pe(()=>{let L=G=>{let B=(G.answers??[]).find(K=>K.nodeId===e&&K.type==="openResponse");if(!B?.answer?.text)return;let V=B.answer.text.content??[];if(t)v?v.commands.setContent({type:"doc",content:V}):C.current=V;else{let K=V.flatMap(le=>le.content?.map(xe=>xe.text??"")??[le.text??""]).join(`
2
+ `);u(K),setTimeout(R,0)}};return c.on("answers:prefill",L),()=>c.off("answers:prefill",L)},[e,c,t,v]),Pe(()=>{let L=()=>{t&&v?v.commands.clearContent():(u(""),setTimeout(R,0)),h(0),b(0)};return c.on("answers:reset",L),()=>c.off("answers:reset",L)},[c,t,v,R]);let x=!!n,S=!!a&&!n,k=x?d:m,_=x?n?.max:a?.max,T=x?n?.min:a?.min,F=_!=null&&k>_,g=_!=null&&k>=_*.8&&!F,E=T!=null&&k<T&&k>0,f="text-xs tabular-nums",q=F?{color:"var(--pen, #d23b2b)",fontWeight:500}:g||E?{color:"var(--almost, #c8810e)"}:{color:"var(--ink-faint, #8d93a0)"},A=x?_?`${d} / ${_} ${l.openResponseWords}`:T?`${d} ${l.openResponseWords} (min. ${T})`:`${d} ${l.openResponseWords}`:S?_?`${m} / ${_} ${l.openResponseChars}`:`${m} ${l.openResponseChars}`:null;return t?X("div",{className:"relative",children:[X("div",{className:rr("rounded border transition-colors min-h-[120px]",i),children:[!o&&X("div",{className:"sticky top-0 z-10 flex gap-1 px-2 pt-1.5 pb-1 border-b border-gray-100 bg-white rounded-t",children:[[{label:"B",cmd:"toggleBold",style:"font-bold"},{label:"I",cmd:"toggleItalic",style:"italic"}].map(({label:L,cmd:G,style:B})=>M("button",{type:"button",onMouseDown:V=>{V.preventDefault(),v?.chain().focus()?.[G]().run()},className:`text-xs px-1.5 py-0.5 rounded hover:bg-gray-100 ${B}`,children:L},L)),M("button",{type:"button",onMouseDown:L=>{L.preventDefault(),v?.chain().focus().toggleBulletList().run()},className:"text-xs px-1.5 py-0.5 rounded hover:bg-gray-100",children:"\u2022\u2014"})]}),M(nc,{editor:v,className:"prose prose-sm max-w-none p-3 outline-none [&_.ProseMirror]:min-h-[80px] [&_.ProseMirror]:outline-none"})]}),A&&M("div",{className:rr("absolute bottom-2 right-3",f),style:q,children:A})]}):X("div",{className:"relative",children:[M("textarea",{ref:w,value:p,onChange:L=>{if(o)return;let G=L.target.value;u(G);let B=vo(G),V=wo(G);h(B),b(V),R(),s({content:[{type:"paragraph",content:[{type:"text",text:G}]}],wordCount:B})},onInput:R,disabled:o,placeholder:r||l.openResponseTextPlaceholder,rows:4,style:{resize:"none",overflow:"hidden"},className:rr("w-full px-3 py-2 text-base min-h-[100px] rounded border transition-colors outline-none",i,o&&"cursor-default")}),A&&M("div",{className:rr("absolute bottom-2 right-3",f),children:A})]})}var xc={image:"image/*",pdf:"application/pdf",audio:"audio/*",video:"video/*"},yc={image:M(lc,{size:12,style:fe(12)}),pdf:M(yo,{size:12,style:fe(12)}),audio:M(dc,{size:12,style:fe(12)}),video:M(xo,{size:12,style:fe(12)}),videoLink:M(pc,{size:12,style:fe(12)})};function jn({allowedTypes:e,allowMultiple:r,fileInstructions:t,isDisabled:n,files:a,setFiles:o,mediaHandler:i,t:s,compact:c=!1}){let l=Ce(null),[p,u]=Ae(!1),[d,h]=Ae(!1),[m,b]=Ae(""),w=e.some(g=>g!=="videoLink"),R=e.includes("videoLink"),v=r||a.length===0,C=e.filter(g=>g!=="videoLink").map(g=>xc[g]).filter(Boolean).join(","),x=Ft(g=>{o(E=>r?[...E,g]:[g])},[r,o]),S=Ft(g=>{o(E=>E.filter((f,q)=>q!==g))},[o]),k=async g=>{if(!(!v||n)){u(!0);try{let E=g.type.startsWith("image/")?"image":g.type==="application/pdf"?"document":g.type.startsWith("audio/")?"audio":g.type.startsWith("video/")?"video":"file";if(i){let f=await i.upload(g,E);x({kind:"file",url:f.url,mimeType:f.mimeType??g.type,name:g.name})}else{let f=URL.createObjectURL(g);x({kind:"file",url:f,mimeType:g.type,name:g.name})}}finally{u(!1)}}},_=async g=>{if(g.preventDefault(),h(!1),n||!v)return;let E=g.dataTransfer.files?.[0];E&&await k(E)},T=()=>{let g=m.trim();g&&(x({kind:"videoLink",url:g,platform:gc(g)}),b(""))},F={image:s.openResponseTypeImage,pdf:s.openResponseTypePdf,audio:s.openResponseTypeAudio,video:s.openResponseTypeVideo,videoLink:s.openResponseTypeVideoLink};return X("div",{className:"space-y-2",children:[t&&!c&&M("p",{className:"text-sm text-gray-600 italic",children:t}),a.length>0&&M("div",{className:c?"flex flex-wrap gap-1.5":"space-y-2",children:a.map((g,E)=>M(vc,{file:g,onRemove:n?void 0:()=>S(E),compact:c,t:s},E))}),!n&&v&&X("div",{className:"space-y-2",children:[w&&!c&&X("div",{onDragOver:g=>{g.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:_,className:"border-2 border-dashed rounded-lg p-6 text-center transition-colors cursor-pointer",style:{borderColor:d?"var(--ink-faint, #8d93a0)":"var(--line-strong, #d6d3cc)",background:d?"var(--ui-muted, #f5f4f1)":"transparent"},onClick:()=>l.current?.click(),children:[M(oc,{size:26,className:"mx-auto mb-2",style:{...fe(26),color:"var(--ink-soft, #565b66)"}}),M("p",{className:"text-sm font-medium",style:{color:"var(--ink-soft, #565b66)"},children:s.openResponseDropZoneLabel}),M("p",{className:"text-xs hover:underline mt-0.5",style:{color:"var(--ink, #1d2025)"},children:s.openResponseDropZoneBrowse}),p&&M("p",{className:"text-xs mt-1 animate-pulse",style:{color:"var(--ink-faint, #8d93a0)"},children:s.openResponseUploading}),M("div",{className:"flex flex-wrap justify-center gap-1.5 mt-3",children:e.filter(g=>g!=="videoLink").map(g=>X("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 bg-gray-100 text-gray-600 rounded-full",children:[yc[g]," ",F[g]]},g))})]}),w&&c&&M("button",{type:"button",onClick:()=>l.current?.click(),disabled:p,className:"text-xs px-3 py-1.5 rounded border border-dashed disabled:opacity-50",style:{borderColor:"var(--line-strong, #d6d3cc)",color:"var(--ink-soft, #565b66)"},children:p?s.openResponseUploading:`+ ${s.openResponseAttachFile}`}),M("input",{ref:l,type:"file",accept:C,onChange:async g=>{let E=g.target.files?.[0];E&&(await k(E),g.target.value="")},className:"hidden"}),R&&X("div",{className:"flex gap-2 flex-wrap",children:[M("input",{type:"url",value:m,onChange:g=>b(g.target.value),placeholder:s.openResponseVideoLinkPlaceholder,className:"flex-1 text-sm border rounded px-2 py-1.5 outline-none",style:{borderColor:"var(--line-strong, #d6d3cc)"},onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),T())}}),M("button",{type:"button",onClick:T,disabled:!m.trim(),className:"text-sm px-3 py-1.5 rounded text-white disabled:opacity-50",style:{background:"var(--ink, #1d2025)"},children:s.openResponseAddVideoLink})]})]}),n&&a.length===0&&M("p",{className:"text-sm text-gray-400 text-center py-3",children:s.openResponseNoSubmission})]})}function vc({file:e,onRemove:r,compact:t,t:n}){if(e.kind==="videoLink"){let a=e.platform==="youtube"?bc(e.url):null;return X("div",{className:rr("bg-white rounded border border-gray-200",t?"px-2 py-1 flex items-center gap-1.5":"p-3 space-y-1"),children:[a&&!t&&M("iframe",{src:`https://www.youtube.com/embed/${a}`,width:240,height:135,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"rounded w-full"}),M("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 underline truncate block max-w-[200px]",children:e.url}),r&&M("button",{type:"button",onClick:r,className:"ml-auto text-gray-400 hover:text-rose-500 text-xs",children:"\u2715"})]})}return X("div",{className:rr("bg-white rounded border border-gray-200",t?"px-2 py-1 flex items-center gap-1.5":"p-2 flex items-center gap-2"),children:[e.mimeType?.startsWith("image/")?M("img",{src:e.url,alt:e.name??"upload",className:t?"h-6 w-6 object-cover rounded":"h-16 w-16 object-cover rounded"}):e.mimeType?.startsWith("audio/")?t?null:M("span",{className:"flex-1 min-w-0",children:M(Qe,{src:e.url,durationHint:e.duration})}):e.mimeType?.startsWith("video/")?M("video",{src:e.url,controls:!0,className:t?"hidden":"h-16 max-w-[240px] rounded"}):M(yo,{size:20,style:{...fe(20),color:"var(--ink-soft, #565b66)"}}),X("div",{className:"flex-1 min-w-0",children:[M("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-700 truncate block hover:underline",children:e.name??n.openResponseFile}),t&&e.mimeType?.startsWith("audio/")&&M(Qe,{src:e.url,durationHint:e.duration})]}),r&&M("button",{type:"button",onClick:r,className:"ml-auto text-gray-400 hover:text-rose-500 text-xs shrink-0",children:"\u2715"})]})}function wc({nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,allowedTypes:o,allowMultiple:i,fileInstructions:s,isDisabled:c,feedbackBorderClass:l,files:p,setFiles:u,emitAnswer:d,answerBus:h,mediaHandler:m,t:b}){let[w,R]=Ae(null),[v,C]=Ae(!1);return Pe(()=>{d({...w&&{text:w},files:p.length>0?p:void 0})},[w,p]),X("div",{className:"space-y-2",children:[M(ko,{nodeId:e,placeholder:r,allowFormatting:t,wordLimit:n,characterLimit:a,isDisabled:c,feedbackBorderClass:l,emitAnswer:x=>R(x),answerBus:h}),!c&&X("div",{children:[X("button",{type:"button",onClick:()=>C(!v),className:"flex items-center gap-1.5 text-xs",style:{color:"var(--ink-soft, #565b66)"},children:[M("span",{children:v?"\u25BE":"\u25B8"}),X("span",{children:[b.openResponseAttachFiles,p.length>0&&M("span",{className:"ml-1 rounded-full px-1.5 py-0.5 text-[10px]",style:{background:"var(--ui-muted, #f5f4f1)",color:"var(--ink, #1d2025)"},children:p.length})]})]}),v&&M("div",{className:"mt-1.5",children:M(jn,{allowedTypes:o,allowMultiple:i,fileInstructions:s,isDisabled:c,feedbackBorderClass:l,files:p,setFiles:u,mediaHandler:m,t:b,compact:!0})})]}),c&&p.length>0&&X("div",{className:"space-y-1",children:[M("p",{className:"text-xs text-gray-500 font-medium",children:b.openResponseAttachedFiles}),M(jn,{allowedTypes:o,allowMultiple:i,isDisabled:!0,feedbackBorderClass:l,files:p,setFiles:u,t:b,compact:!0})]})]})}var kc=180,Rc={audio:["audio/webm;codecs=opus","audio/webm","audio/mp4;codecs=mp4a.40.2","audio/mp4","audio/aac","audio/ogg;codecs=opus"],video:["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm","video/mp4"]};function Sc(e){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Rc[e].find(r=>MediaRecorder.isTypeSupported(r))}function Cc(e,r){let t=e.split(";")[0].trim().toLowerCase();return t.endsWith("/webm")?"webm":t.endsWith("/ogg")?"ogg":t.endsWith("/aac")?"aac":t.endsWith("/mp4")?r==="audio"?"m4a":"mp4":"webm"}function _c(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function Nc({nodeId:e,kind:r,maxDuration:t,isDisabled:n,feedbackBorderClass:a,mediaHandler:o,emitAnswer:i,answerBus:s,t:c}){let l=r==="audio"?"audio":"video",p=t&&t>0?t:r==="audio"?kc:null,[u,d]=Ae("idle"),[h,m]=Ae(null),[b,w]=Ae(null),[R,v]=Ae(0),[C,x]=Ae(null),[S,k]=Ae(null),_=Ce(null),T=Ce(null),F=Ce([]),g=Ce(0),E=Ce(null),f=Ce(null),q=Ce(null),A=Ce(null),L=Ce(0),G=Ce(null),B=Ce(null),V=Ce(null);Pe(()=>{let U=me=>{let te=(me.answers??[]).find(ce=>ce.nodeId===e&&ce.type==="openResponse")?.answer?.recording;te?.url&&(m(te),d("saved"))},Y=()=>{G.current?.abort(),m(null),w(null),k(null),d("idle")};return s.on("answers:prefill",U),s.on("answers:reset",Y),()=>{s.off("answers:prefill",U),s.off("answers:reset",Y)}},[e,s]);let K=()=>{cancelAnimationFrame(L.current);let U=A.current;A.current=null,U&&U.state!=="closed"&&U.close().catch(()=>{})},le=()=>{T.current?.getTracks().forEach(U=>U.stop()),T.current=null};Pe(()=>()=>{E.current&&clearInterval(E.current),K(),le(),G.current?.abort()},[]),Pe(()=>{let U=b?.url;return()=>{U&&URL.revokeObjectURL(U)}},[b?.url]);let xe=U=>{let Y=q.current,me=window.AudioContext||window.webkitAudioContext;if(!Y||!me)return;let ee;try{ee=new me}catch{return}A.current=ee;let te=ee.createAnalyser();te.fftSize=512,ee.createMediaStreamSource(U).connect(te);let ce=new Uint8Array(te.fftSize),ze=window.devicePixelRatio||1,Ee=Math.max(1,Y.clientWidth),D=Math.max(1,Y.clientHeight);Y.width=Math.round(Ee*ze),Y.height=Math.round(D*ze);let J=Y.getContext("2d");if(!J)return;J.scale(ze,ze);let Z=3,pe=2,H=[],st=Math.floor(Ee/(Z+pe)),qr=0,Wr=ur=>{if(L.current=requestAnimationFrame(Wr),ur-qr<50)return;qr=ur,te.getByteTimeDomainData(ce);let _r=0;for(let ir=0;ir<ce.length;ir++){let Nr=(ce[ir]-128)/128;_r+=Nr*Nr}H.push(Math.min(1,Math.sqrt(_r/ce.length)*3)),H.length>st&&H.shift(),J.clearRect(0,0,Ee,D),J.fillStyle="#1d2025";let ct=Ee-H.length*(Z+pe);H.forEach((ir,Nr)=>{let Ur=Math.max(2,ir*D);J.fillRect(ct+Nr*(Z+pe),(D-Ur)/2,Z,Ur)})};L.current=requestAnimationFrame(Wr)};Pe(()=>{u==="recording"&&r==="audio"&&T.current&&xe(T.current)},[u]);let P=async(U,Y)=>{if(!o)return;let me=new AbortController;G.current=me,B.current={file:U,duration:Y},k(null),x(0),d("uploading");try{let ee=await o.upload(U,l,{onProgress:ce=>{me.signal.aborted||x(Math.max(0,Math.min(1,ce)))},signal:me.signal});if(me.signal.aborted)return;let te={url:ee.url,mimeType:ee.mimeType??U.type,duration:Y,kind:l};B.current=null,m(te),d("saved"),i(te)}catch(ee){if(me.signal.aborted||_c(ee))return;d("failed"),k(c.recorderFailed)}finally{x(null)}},y=()=>{G.current?.abort(),B.current=null,w(null),x(null),d(V.current?"saved":"idle")},O=()=>{let U=B.current;U&&P(U.file,U.duration)},j=()=>{E.current&&(clearInterval(E.current),E.current=null);let U=_.current;U&&U.state!=="inactive"&&U.stop()},z=async()=>{if(!o){k(c.recorderUnavailableHere);return}if(!(typeof MediaRecorder<"u"&&typeof navigator<"u"&&!!navigator.mediaDevices?.getUserMedia&&(r!=="screen"||!!navigator.mediaDevices.getDisplayMedia))){k(c.recorderUnsupported);return}G.current?.abort(),V.current=h,k(null),d("requesting");let Y;try{if(r==="screen"){Y=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!1});try{let ce=(await navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0];ce&&Y.addTrack(ce)}catch{}Y.getVideoTracks()[0]?.addEventListener("ended",()=>j())}else r==="video"?Y=await navigator.mediaDevices.getUserMedia({audio:!0,video:{facingMode:"user"}}):Y=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(te){let ce=te?.name;d(h?"saved":"idle"),k(ce==="NotAllowedError"||ce==="SecurityError"||ce==="NotFoundError"?c.openResponsePermissionDenied:c.recorderUnsupported);return}let me=Sc(l),ee;try{ee=me?new MediaRecorder(Y,{mimeType:me}):new MediaRecorder(Y)}catch{try{ee=new MediaRecorder(Y)}catch{Y.getTracks().forEach(te=>te.stop()),d(h?"saved":"idle"),k(c.recorderUnsupported);return}}T.current=Y,_.current=ee,F.current=[],ee.ondataavailable=te=>{te.data.size>0&&F.current.push(te.data)},ee.onstop=()=>{let te=Math.max(1,Math.round((performance.now()-g.current)/1e3)),ce=ee.mimeType||me||`${l}/webm`,ze=new Blob(F.current,{type:ce});if(F.current=[],K(),le(),f.current&&(f.current.srcObject=null),ze.size===0){d(V.current?"saved":"idle"),k(c.recorderUnsupported);return}let Ee=new File([ze],`recording.${Cc(ce,l)}`,{type:ce});w({url:URL.createObjectURL(ze),duration:te}),P(Ee,te)},ee.start(250),g.current=performance.now(),v(0),d("recording"),E.current=setInterval(()=>{let te=(performance.now()-g.current)/1e3;v(te),p&&te>=p&&j()},200)};Pe(()=>{let U=f.current;u==="recording"&&U&&T.current&&(U.srcObject=T.current,U.play().catch(()=>{}))},[u]);let oe=b?.url??h?.url??null,re=b?.duration??h?.duration??null,se=oe?l==="audio"?M(Qe,{src:oe,durationHint:re}):M("video",{src:oe,controls:!0,playsInline:!0,preload:"metadata"}):null;if(n)return M("div",{className:rr("edp-rec",a),children:h?l==="audio"?M(Qe,{src:h.url,durationHint:h.duration}):M("video",{src:h.url,controls:!0,playsInline:!0,preload:"metadata"}):M("p",{className:"edp-rec-message",children:c.recorderNone})});let de=r==="audio"?M(ic,{"aria-hidden":!0}):r==="screen"?M(sc,{"aria-hidden":!0}):M(xo,{"aria-hidden":!0});return X("div",{className:rr("edp-rec",a),children:[(u==="idle"||u==="requesting")&&X("div",{className:"edp-rec-idle",children:[M("button",{type:"button",className:"edp-rec-record",onClick:z,disabled:u==="requesting"||!o,"aria-label":r==="screen"?c.openResponseTapToRecordScreen:c.recorderRecord,children:de}),M("span",{className:"edp-rec-label",children:u==="requesting"?c.openResponseRequestingPermission:c.recorderRecord}),p&&M("span",{className:"edp-rec-limit",children:c.recorderUpTo(Fn(p))}),!o&&M("p",{className:"edp-rec-message",children:c.recorderUnavailableHere})]}),u==="recording"&&X(et,{children:[l==="video"&&M("video",{ref:f,muted:!0,playsInline:!0}),X("div",{className:"edp-rec-live",role:"status","aria-label":c.recorderRecordingAria,children:[r==="audio"?M("canvas",{ref:q,className:"edp-rec-level","aria-hidden":!0}):M("span",{style:{flex:1}}),X("span",{className:"edp-rec-clock",dir:"ltr",children:[M("span",{className:"edp-rec-dot","aria-hidden":!0}),Fn(Math.floor(R)),p&&X("small",{children:["/ ",Fn(p)]})]}),X("button",{type:"button",className:"edp-rec-stop",onClick:j,children:[M("i",{"aria-hidden":!0}),c.openResponseStopRecording]})]})]}),(u==="uploading"||u==="saved"||u==="failed")&&X(et,{children:[se,X("div",{className:"edp-rec-foot",children:[u==="uploading"&&X(et,{children:[M("span",{className:"edp-rec-status","aria-live":"polite",children:C&&C>0?c.recorderSaving(Math.round(C*100)):c.openResponseUploading}),M("span",{className:"edp-rec-progress","aria-hidden":!0,children:M("span",{style:{width:`${Math.round((C??0)*100)}%`}})}),M("button",{type:"button",className:"edp-rec-link",onClick:y,children:c.recorderCancel})]}),u==="saved"&&X(et,{children:[X("span",{className:"edp-rec-status edp-rec-status--ok","aria-live":"polite",children:[M(uc,{size:16,"aria-hidden":!0}),c.recorderSaved]}),M("button",{type:"button",className:"edp-rec-link",onClick:z,children:c.recorderRecordAgain})]}),u==="failed"&&X(et,{children:[X("span",{className:"edp-rec-status edp-rec-status--error",role:"alert",children:[M(mc,{size:16,"aria-hidden":!0}),S??c.recorderFailed]}),X("span",{style:{display:"inline-flex",gap:"1rem"},children:[M("button",{type:"button",className:"edp-rec-link",onClick:O,children:c.recorderRetry}),M("button",{type:"button",className:"edp-rec-link",onClick:z,children:c.recorderRecordAgain})]})]})]})]}),S&&u!=="failed"&&M("p",{className:"edp-rec-message",role:"alert",children:S})]})}function Ac({feedback:e,feedbackState:r,score:t,t:n}){let a=r==="correct"?{bg:"var(--ok-soft, #ecf8f0)",border:"var(--ok, #1f8a4c)",ink:"var(--ok, #1f8a4c)"}:r==="incorrect"?{bg:"var(--pen-soft, #fdeeec)",border:"var(--pen, #d23b2b)",ink:"var(--pen, #d23b2b)"}:{bg:"var(--almost-soft, #fbf1dc)",border:"var(--almost, #c8810e)",ink:"var(--almost-ink, #8a5a08)"};return X("div",{className:"rounded p-3 text-sm border",style:{background:a.bg,borderColor:a.border,color:"var(--ink, #1d2025)"},children:[M("p",{className:"text-xs font-medium mb-1 opacity-70",children:n.openResponseTeacherFeedbackLabel}),e.flatMap(o=>o.content?.map(i=>i.text??"")??[o.text??""]).join(" "),t!=null&&X("div",{className:"mt-1 text-right",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:I("1.4rem"),lineHeight:1,color:a.ink},children:[t," pts"]})]})}import{jsx as Rr,jsxs as tr,Fragment as Ro}from"react/jsx-runtime";import{useEffect as On,useMemo as Pc,useRef as Tc,useState as So}from"react";function Ec(e){return e?.showFeedback?e.state==="validating"?"validating":e.state==="correct"?"correct":e.state==="incorrect"?"incorrect":"idle":"idle"}function Pt({nodeId:e,placeholder:r,hint:t,validationFeedback:n,readOnly:a=!1}){let o=ie(),i=ye(),s=Tc(null),[c,l]=So(""),[p,u]=So(!1),d=Ec(n),h=n?.score,m=n?.maxScore,b=x=>Number.isInteger(x)?String(x):x.toFixed(2),w=n?.displayAnswer,R=Pc(()=>w?gr(w,!1):"",[w]);On(()=>{import("mathlive").then(()=>{u(!0)}).catch(()=>{})},[]),On(()=>{let x=S=>{let k=S.answers?.find(_=>_.nodeId===e&&_.type==="mathResponse");k?.answer?.latex!==void 0&&(l(k.answer.latex),s.current&&(s.current.value=k.answer.latex))};return i.on("answers:prefill",x),()=>i.off("answers:prefill",x)},[i,e]),On(()=>{i.emit({type:"answer:changed",answer:{nodeId:e,type:"mathResponse",timestamp:Date.now(),answer:{latex:c}}})},[c,e,i]);let v=x=>{let S=x.target?.value??"";l(S)},C=d==="correct"?"player-math-field--correct":d==="incorrect"?"player-math-field--incorrect":d==="validating"?"player-math-field--validating":"";return tr("div",{dir:"ltr",className:"math-response-player",children:[tr("span",{style:{display:"inline-flex",alignItems:"center",gap:I("0.4rem")},children:[Rr("div",{className:"player-math-field"+(C?" "+C:"")+(a?" player-math-field--readonly":""),children:p?Rr("math-field",{ref:s,value:c,onInput:v,"virtual-keyboard-mode":"onfocus","smart-fence":"true",className:"player-math-field__input",style:{opacity:a?.7:1,pointerEvents:a?"none":"auto"}}):Rr("input",{type:"text",value:c,onChange:x=>l(x.target.value),placeholder:r||"Enter LaTeX (e.g. \\frac{x^2}{2})",readOnly:a,className:"player-math-field__fallback"})}),Rr(Ye,{hint:t})]}),n?.showFeedback&&tr("div",{className:"player-math-feedback player-math-feedback--"+d,children:[d==="validating"&&tr(Ro,{children:[Rr("span",{className:"player-math-spinner"}),Rr("span",{children:o.mathChecking})]}),d==="correct"&&tr(Ro,{children:[tr("span",{children:["\u2713 ",o.mathCorrect]}),h!=null&&tr("span",{className:"player-math-score",children:[b(h),m!=null?` / ${b(m)}`:""]})]}),d==="incorrect"&&tr("span",{children:["\u2717 ",o.mathIncorrect]}),d==="incorrect"&&R&&tr("span",{className:"player-blank-reveal player-math-reveal",children:["(",Rr("span",{dangerouslySetInnerHTML:{__html:R}}),")"]})]})]})}import{jsx as ae,jsxs as we,Fragment as nt}from"react/jsx-runtime";import{useCallback as Gc,useEffect as Yc,useRef as Kc,useState as tt}from"react";import{Play as Xc,Lock as Jc,Check as qn,X as No}from"lucide-react";function Bt(e,r){if(e===r)return!0;if(e===null||r===null||typeof e!=typeof r||typeof e!="object")return!1;let t=Array.isArray(e),n=Array.isArray(r);if(t!==n)return!1;if(t&&n){let c=e,l=r;return c.length!==l.length?!1:c.every((p,u)=>Bt(p,l[u]))}let a=e,o=r,i=Object.keys(a),s=Object.keys(o);return i.length!==s.length?!1:i.every(c=>Bt(a[c],o[c]))}var Mc=`
3
3
  "use strict";
4
4
 
5
5
  // Capture console output for stdio mode
@@ -36,15 +36,15 @@ self.onmessage = async function(e) {
36
36
  self.postMessage({ testId, passed: false, stderr: String(err), errored: true, durationMs: Date.now() - start });
37
37
  }
38
38
  };
39
- `;async function Pi(e,r,t,n,a,s,o,i,c){return new Promise(l=>{let d=new Blob([Ti],{type:"text/javascript"}),p=URL.createObjectURL(d),m=new Worker(p),g=setTimeout(()=>{m.terminate(),URL.revokeObjectURL(p),l({testId:n,passed:!1,stderr:`Execution timed out after ${c}ms`,errored:!0})},c);m.onmessage=u=>{clearTimeout(g),m.terminate(),URL.revokeObjectURL(p);let b=u.data;if(r==="function"&&!b.errored){let v=mt(b.actual,s);l({testId:n,passed:v,actual:b.actual,stderr:b.stderr,durationMs:b.durationMs})}else l({testId:n,passed:b.passed??!1,actualStdout:b.actualStdout,stderr:b.stderr,durationMs:b.durationMs,errored:b.errored})},m.onerror=u=>{clearTimeout(g),m.terminate(),URL.revokeObjectURL(p),l({testId:n,passed:!1,stderr:u.message,errored:!0})},m.postMessage({testId:n,source:e,mode:r,entryFunction:t,args:a,expectedStdout:i,timeout:c})})}var Li="0.27.7";function Mi(){let e=globalThis.EDPIRE_PYODIDE_INDEX_URL;return typeof e=="string"&&e?e.endsWith("/")?e:e+"/":`https://cdn.jsdelivr.net/pyodide/v${globalThis.EDPIRE_PYODIDE_VERSION||Li}/full/`}var Nr=null;function Ii(e){return typeof globalThis.loadPyodide=="function"?Promise.resolve():Nr||(Nr=new Promise((r,t)=>{if(typeof document>"u"){t(new Error("Pyodide can only be loaded in a browser environment"));return}let n=document.createElement("script");n.src=`${e}pyodide.js`,n.async=!0,n.onload=()=>r(),n.onerror=()=>{Nr=null,t(new Error(`Failed to load Pyodide from ${n.src}`))},document.head.appendChild(n)}),Nr)}var dt=null;async function $i(){if(dt)return dt;let e=Mi();await Ii(e);let r=globalThis.loadPyodide;if(typeof r!="function")throw new Error("Pyodide global not available after loading the CDN script");return dt=await r({indexURL:e}),dt}async function zi(e,r,t,n,a,s,o,i,c){let l=Date.now();try{let d=await $i();if(r==="stdio"){d.runPython(`
39
+ `;async function Lc(e,r,t,n,a,o,i,s,c){return new Promise(l=>{let p=new Blob([Mc],{type:"text/javascript"}),u=URL.createObjectURL(p),d=new Worker(u),h=setTimeout(()=>{d.terminate(),URL.revokeObjectURL(u),l({testId:n,passed:!1,stderr:`Execution timed out after ${c}ms`,errored:!0})},c);d.onmessage=m=>{clearTimeout(h),d.terminate(),URL.revokeObjectURL(u);let b=m.data;if(r==="function"&&!b.errored){let w=Bt(b.actual,o);l({testId:n,passed:w,actual:b.actual,stderr:b.stderr,durationMs:b.durationMs})}else l({testId:n,passed:b.passed??!1,actualStdout:b.actualStdout,stderr:b.stderr,durationMs:b.durationMs,errored:b.errored})},d.onerror=m=>{clearTimeout(h),d.terminate(),URL.revokeObjectURL(u),l({testId:n,passed:!1,stderr:m.message,errored:!0})},d.postMessage({testId:n,source:e,mode:r,entryFunction:t,args:a,expectedStdout:s,timeout:c})})}var Ic="0.27.7";function $c(){let e=globalThis.EDPIRE_PYODIDE_INDEX_URL;return typeof e=="string"&&e?e.endsWith("/")?e:e+"/":`https://cdn.jsdelivr.net/pyodide/v${globalThis.EDPIRE_PYODIDE_VERSION||Ic}/full/`}var rt=null;function zc(e){return typeof globalThis.loadPyodide=="function"?Promise.resolve():rt||(rt=new Promise((r,t)=>{if(typeof document>"u"){t(new Error("Pyodide can only be loaded in a browser environment"));return}let n=document.createElement("script");n.src=`${e}pyodide.js`,n.async=!0,n.onload=()=>r(),n.onerror=()=>{rt=null,t(new Error(`Failed to load Pyodide from ${n.src}`))},document.head.appendChild(n)}),rt)}var jt=null;async function Dc(){if(jt)return jt;let e=$c();await zc(e);let r=globalThis.loadPyodide;if(typeof r!="function")throw new Error("Pyodide global not available after loading the CDN script");return jt=await r({indexURL:e}),jt}async function Fc(e,r,t,n,a,o,i,s,c){let l=Date.now();try{let p=await Dc();if(r==="stdio"){p.runPython(`
40
40
  import sys, io
41
41
  _stdout_capture = io.StringIO()
42
42
  sys.stdout = _stdout_capture
43
- `),o&&d.runPython(`
43
+ `),i&&p.runPython(`
44
44
  import io
45
- sys.stdin = io.StringIO(${JSON.stringify(o)})
46
- `),d.runPython(e);let p=d.runPython("_stdout_capture.getvalue()");d.runPython("sys.stdout = sys.__stdout__");let m=p.trim()===(i||"").trim();return{testId:n,passed:m,actualStdout:p,durationMs:Date.now()-l}}else{d.runPython(e);let p=(a||[]).map(u=>JSON.stringify(u)).join(", "),m=d.runPython(`${t}(${p})`),g=mt(m,s);return{testId:n,passed:g,actual:m,durationMs:Date.now()-l}}}catch(d){return{testId:n,passed:!1,stderr:String(d),errored:!0,durationMs:Date.now()-l}}}var pt=null;async function Di(){if(pt)return pt;let e=await import("./sql-wasm-browser-NICPVFVD.mjs");return pt=await(e.default??e)(),pt}async function ji(e,r,t,n){let a=Date.now();try{let s=await Di(),o=new s.Database;t&&o.run(t);let c=o.exec(e).flatMap(d=>d.values.map(p=>p.map(String).join("|"))).join(`
47
- `),l=c.trim()===(n||"").trim();return o.close(),{testId:r,passed:l,actualStdout:c,durationMs:Date.now()-a}}catch(s){return{testId:r,passed:!1,stderr:String(s),errored:!0,durationMs:Date.now()-a}}}async function Fi(e){let{transform:r}=await import("./esm-RQP7AIMT.mjs");return r(e,{transforms:["typescript"]}).code}var fr=class{supports(r){return["javascript","typescript","python","sql"].includes(r)}async run(r){let{language:t,source:n,mode:a,entryFunction:s,tests:o,timeoutMs:i=5e3}=r;if(!this.supports(t))return o.map(d=>({testId:d.id,passed:!1,stderr:`Language "${t}" cannot run in-browser. Configure a RemoteExecutor for compiled languages.`,errored:!0}));let c=n;if(t==="typescript")try{c=await Fi(n)}catch(d){return o.map(p=>({testId:p.id,passed:!1,stderr:`TypeScript compile error: ${d.message}`,errored:!0}))}let l=[];for(let d of o){let p;t==="python"?p=await zi(c,a,s,d.id,d.args,d.expectedReturn,d.stdin,d.expectedStdout,i):t==="sql"?p=await ji(c,d.id,d.stdin,d.expectedStdout):p=await Pi(c,a,s,d.id,d.args,d.expectedReturn,d.stdin,d.expectedStdout,i),l.push(p)}return l}};import{jsx as Oa}from"react/jsx-runtime";import{forwardRef as Oi,useEffect as Bi,useImperativeHandle as Wi,useRef as qi,useState as Hi}from"react";function Ui(e){return{javascript:"javascript",typescript:"typescript",python:"python",sql:"sql",java:"java",cpp:"cpp",go:"go"}[e]??"plaintext"}var nn=Oi(function({value:r,onChange:t,language:n="javascript",readOnly:a=!1,readOnlyRanges:s,placeholder:o,height:i=300,className:c,autoFocus:l},d){let[p,m]=Hi(null),{scale:g}=ke(),u=qi(null);Bi(()=>{import("./dist-RXTJ74FF.mjs").then(x=>{m(()=>x.default)}).catch(()=>{})},[]),Wi(d,()=>({getValue(){return u.current?.getValue?.()??r},focus(){u.current?.focus?.()},insert(x){let _=u.current;if(!_)return;let h=_.getSelection();_.executeEdits("insert",[{range:h,text:x,forceMoveMarkers:!0}])}}));function b(x){u.current=x,l&&x.focus(),s?.length&&x.onDidAttemptReadOnlyEdit(()=>{})}function v(x){t(x??"")}let w=typeof i=="number"?i*g:i;return p?Oa(p,{className:c,height:w,language:Ui(n),value:r,onChange:v,onMount:b,options:{readOnly:a,minimap:{enabled:!1},fontSize:14*g,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}}):Oa("textarea",{className:c,value:r,onChange:x=>t(x.target.value),readOnly:a,placeholder:o,style:{width:"100%",height:typeof i=="number"?E(i):i,fontFamily:"monospace",fontSize:E(14),padding:E("0.5rem"),border:"1px solid #e2e8f0",borderRadius:E("0.375rem"),resize:"vertical",background:a?"#f8fafc":"white",boxSizing:"border-box"},autoFocus:l})});var Xi=new fr;function Ji(e){return e?.showFeedback?e.state??"idle":"idle"}function Ba(e){let r={};for(let t of e.attrs.starters??[])r[t.language]=t.code;return r}function Zi({sample:e,result:r,mode:t}){let n=r?.passed,a=r?.errored,s=r!==void 0,o=s?a?"var(--almost, #c8810e)":n?"var(--ok, #1f8a4c)":"var(--pen, #d23b2b)":"var(--ink-faint, #8d93a0)",i=s?a?"\u26A0":null:"\u25CB";return de("div",{style:{padding:`${E("0.5rem")} ${E("0.75rem")}`,borderBottom:"1px solid var(--line, #e7e5e0)",fontSize:E("0.8125rem"),fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:[de("div",{style:{display:"flex",alignItems:"center",gap:E("0.5rem")},children:[K("span",{style:{color:o,fontWeight:700,fontSize:E("0.875rem"),display:"inline-flex"},children:i??(n?K(an,{size:15,style:re(15)}):K(Wa,{size:15}))}),K("span",{style:{fontWeight:600,color:"var(--ink, #1d2025)"},children:e.name??`Test ${e.id}`})]}),s&&!n&&de("div",{style:{marginTop:E("0.25rem"),paddingLeft:E("1.5rem")},children:[t==="function"?K(Tr,{children:r?.actual!==void 0&&de("div",{style:{color:"var(--ink-soft, #565b66)"},children:[K("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"got: "}),K("span",{style:{color:"var(--pen, #d23b2b)"},children:JSON.stringify(r.actual)}),K("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:" expected: "}),K("span",{style:{color:"var(--ok, #1f8a4c)"},children:JSON.stringify(e.expectedReturn)})]})}):K(Tr,{children:r?.actualStdout!==void 0&&de("div",{style:{color:"var(--ink-soft, #565b66)"},children:[de("div",{children:[K("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"got: "}),K("span",{style:{color:"var(--pen, #d23b2b)",whiteSpace:"pre-wrap"},children:r.actualStdout||"(empty)"})]}),de("div",{children:[K("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"expected: "}),K("span",{style:{color:"var(--ok, #1f8a4c)",whiteSpace:"pre-wrap"},children:e.expectedStdout||"(empty)"})]})]})}),r?.stderr&&K("div",{style:{color:"var(--almost-ink, #8a5a08)",marginTop:E("0.125rem"),whiteSpace:"pre-wrap"},children:r.stderr})]})]})}function rt({node:e,validationFeedback:r,readOnly:t=!1,executor:n=Xi,gradingTests:a}){let s=le(),o=Qi(null),{attrs:i}=e,c=e.id,[l,d]=Er(i.defaultLanguage),[p,m]=Er(()=>Ba(e)),[g,u]=Er([]),[b,v]=Er(!1),[w,x]=Er(!1),_=p[l]??"",h=Ji(r);Gi(()=>{let S=O=>{let z=O.answers?.find(q=>q.nodeId===c&&q.type==="codingResponse");z?.answer&&(z.answer.language&&d(z.answer.language),z.answer.sourceByLanguage&&m(z.answer.sourceByLanguage),z.answer.testResults&&u(z.answer.testResults))},N=()=>{m(Ba(e)),u([]),x(!1)};return s.on("answers:prefill",S),s.on("answers:reset",N),()=>{s.off("answers:prefill",S),s.off("answers:reset",N)}},[s,c,e]);let y=Vi((S,N,O)=>{s.emit({type:"answer:changed",answer:{nodeId:c,type:"codingResponse",timestamp:Date.now(),answer:{language:S,sourceByLanguage:N,source:N[S]??"",testResults:O}}})},[s,c]),C=S=>{let N={...p,[l]:S};m(N),y(l,N,g)},T=S=>{d(S),u([]),y(S,p,[])},$=async()=>{if(b)return;v(!0),u([]);let S=a??i.visibleSamples??[];if(S.length===0){v(!1);return}try{let N=await n.run({language:l,source:_,mode:i.testMode,entryFunction:i.entryFunction,tests:S,timeoutMs:5e3});u(N),y(l,p,N)}catch(N){let O=S.map(z=>({testId:z.id,passed:!1,stderr:String(N),errored:!0}));u(O),y(l,p,O)}finally{v(!1)}},R=()=>{w||(x(!0),y(l,p,g))},f=(a??[]).filter(S=>S.hidden).length,M=f>0?g.filter(S=>(a??[]).find(O=>O.id===S.testId)?.hidden&&S.passed).length:0,A=a?a.filter(S=>!S.hidden):i.visibleSamples??[],H=h==="correct"?"var(--ok, #1f8a4c)":h==="partial"?"var(--almost, #c8810e)":h==="incorrect"?"var(--pen, #d23b2b)":"var(--line-strong, #d6d3cc)";return de("div",{style:{margin:`${E("0.75rem")} 0`,border:`1px solid ${H}`,borderRadius:E("0.875rem"),overflow:"hidden",transition:"border-color 0.2s"},children:[de("div",{style:{background:"var(--ui-muted, #f5f4f1)",borderBottom:"1px solid var(--line, #e7e5e0)",padding:`${E("0.5rem")} ${E("0.75rem")}`,display:"flex",alignItems:"center",gap:E("0.5rem"),flexWrap:"wrap"},children:[K("div",{style:{display:"flex",gap:E("0.25rem")},children:i.languages.map(S=>K("button",{onClick:()=>!t&&T(S),disabled:t,style:{padding:`${E("0.2rem")} ${E("0.6rem")}`,borderRadius:E("0.375rem"),border:"1px solid",borderColor:l===S?"var(--ink, #1d2025)":"var(--line, #e7e5e0)",background:l===S?"var(--ink, #1d2025)":"var(--card, #fff)",color:l===S?"#fff":"var(--ink-soft, #565b66)",fontSize:E("0.75rem"),fontWeight:600,cursor:t?"default":"pointer",fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:S},S))}),K("div",{style:{flex:1}}),K($e,{hint:i.hint}),!t&&de(Tr,{children:[de("button",{onClick:$,disabled:b,style:{padding:`${E("0.25rem")} ${E("0.75rem")}`,borderRadius:E("0.5rem"),border:"1px solid var(--line-strong, #d6d3cc)",background:b?"var(--ui-muted, #f5f4f1)":"var(--card, #fff)",color:"var(--ink, #1d2025)",fontSize:E("0.8125rem"),fontWeight:600,cursor:b?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",gap:E("0.35rem")},children:[K(Yi,{size:13,style:re(13)})," ",b?"Running\u2026":"Run"]}),de("button",{onClick:R,disabled:w,style:{padding:`${E("0.3rem")} ${E("0.85rem")}`,borderRadius:E("0.5rem"),border:"none",background:w?"var(--ok-soft, #ecf8f0)":"var(--ink, #1d2025)",color:w?"var(--ok, #1f8a4c)":"#fff",fontSize:E("0.8125rem"),fontWeight:600,cursor:w?"default":"pointer",display:"inline-flex",alignItems:"center",gap:E("0.35rem")},children:[w&&K(an,{size:13,style:re(13)})," ",w?"Submitted":"Submit"]})]})]}),K(nn,{ref:o,value:_,onChange:C,language:l,readOnly:t,readOnlyRanges:i.starters.find(S=>S.language===l)?.readOnlyRanges,height:320}),(g.length>0||A.length>0)&&de("div",{style:{borderTop:"1px solid var(--line, #e7e5e0)",background:"var(--paper, #fbfaf7)"},children:[K("div",{style:{padding:`${E("0.5rem")} ${E("0.75rem")}`,fontSize:E("0.7rem"),fontWeight:700,color:"var(--ink-faint, #8d93a0)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Test Results"}),A.map(S=>K(Zi,{sample:S,result:g.find(N=>N.testId===S.id),mode:i.testMode},S.id)),f>0&&de("div",{style:{padding:`${E("0.5rem")} ${E("0.75rem")}`,fontSize:E("0.8125rem"),color:"var(--ink-soft, #565b66)",borderTop:"1px solid var(--line, #e7e5e0)",fontStyle:"italic",display:"flex",alignItems:"center",gap:E("0.4rem")},children:[K(Ki,{size:13,style:re(13)})," Hidden tests: ",M,"/",f," passed"]})]}),r?.showFeedback&&de("div",{style:{padding:`${E("0.55rem")} ${E("0.75rem")}`,fontSize:E("0.85rem"),fontWeight:600,borderTop:"1px solid var(--line, #e7e5e0)",display:"flex",alignItems:"center",gap:E("0.45rem"),background:h==="correct"?"var(--ok-soft, #ecf8f0)":h==="partial"?"var(--almost-soft, #fbf1dc)":h==="incorrect"?"var(--pen-soft, #fdeeec)":"transparent",color:h==="correct"?"var(--ok, #1f8a4c)":h==="partial"?"var(--almost-ink, #8a5a08)":h==="incorrect"?"var(--pen, #d23b2b)":"var(--ink-soft, #565b66)"},children:[h==="correct"&&de(Tr,{children:[K(an,{size:15,style:re(15)})," All tests passed"]}),h==="partial"&&"Partial credit",h==="incorrect"&&de(Tr,{children:[K(Wa,{size:15,style:re(15)})," Tests failed"]}),h==="validating"&&"Evaluating\u2026",h==="awaiting_review"&&"Awaiting teacher review",r.score!==void 0&&de("span",{style:{marginLeft:"auto",fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:E("1.5rem"),lineHeight:1},children:[r.score," / ",r.maxScore??i.maxScore]})]})]})}import{Fragment as tc,jsx as cn,jsxs as nc}from"react/jsx-runtime";import{createContext as ac,useContext as oc}from"react";import{DndContext as sc,MouseSensor as ic,TouchSensor as cc,KeyboardSensor as lc,useSensor as ln,useSensors as dc}from"@dnd-kit/core";import{jsx as on}from"react/jsx-runtime";import{DragOverlay as ec,useDndContext as rc}from"@dnd-kit/core";function sn(){let{active:e}=rc();if(!e)return null;let r=e.data.current?.html??"";return on(ec,{dropAnimation:null,children:on("div",{style:{display:"inline-block",padding:"0.375rem 0.75rem",borderRadius:"9999px",backgroundColor:"white",border:"1px solid #e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"grabbing",maxWidth:"20rem"},children:on("span",{dangerouslySetInnerHTML:{__html:r},style:{pointerEvents:"none",whiteSpace:"nowrap",lineHeight:"1.25"}})})})}var qa=ac(!1),pc={acceleration:3,threshold:{x:0,y:.25}};function ut({children:e}){let r=oc(qa),t=ln(ic,{activationConstraint:{distance:8}}),n=ln(cc,{activationConstraint:{delay:250,tolerance:5}}),a=ln(lc),s=dc(t,n,a);return r?cn(tc,{children:e}):cn(qa.Provider,{value:!0,children:nc(sc,{sensors:s,autoScroll:pc,children:[e,cn(sn,{})]})})}function gr({content:e,onAnswersChange:r,onSubmit:t,answerBus:n,namespace:a,initialAnswers:s,validationFeedback:o,className:i="",locale:c,readOnly:l=!1,mediaHandler:d,codeExecutor:p,display:m}){let g=we(m),u=mc(()=>_e(g),[g]),b=uc(null);b.current||(b.current=new Oe);let v=n??b.current;ft(()=>{s&&s.length>0&&v.prefillAnswers(s)},[s,v]),ft(()=>{if(!r)return;let x=()=>{let _=v.getAllAnswers();r(_)};return v.on("answer:changed",x),()=>v.off("answer:changed",x)},[v,r]),ft(()=>{if(!t)return;let x=_=>{t(_.answers)};return v.on("answer:submitted",x),()=>v.off("answer:submitted",x)},[v,t]),ft(()=>{document.querySelectorAll("[data-audio]").forEach(_=>{let h=_.querySelector("audio"),y=_.querySelector("svg");!h||!y||(_.onclick=()=>{h.paused?(h.play(),y.innerHTML='<path d="M6 4h4v16H6zm8 0h4v16h-4z"/>',y.dataset.icon="pause"):(h.pause(),y.innerHTML='<path d="M6 4v16l12-8z"/>',y.dataset.icon="play")},h.onended=()=>{y.innerHTML='<path d="M6 4v16l12-8z"/>',y.dataset.icon="play"})})},[e]);let w=Se(e,o,{readOnly:l,mediaHandler:d,codeExecutor:p});return hr(Cr,{locale:c,children:hr(Re,{display:g,children:hr(Br,{bus:v,children:hr(ut,{children:hr(nt,{initialAnswers:s,children:hr("div",{className:`question-runtime ${i}${u.sizeSet?" edp-scaled":""}`,"data-namespace":a,style:{fontSize:E("1.125rem"),lineHeight:"1.75",...Ce(u)},children:w})})})})})})}import{jsx as br,jsxs as bt}from"react/jsx-runtime";import{memo as bc,useCallback as Qa,useMemo as xc,useRef as Ga}from"react";var Ha={words:80,media:1,tableRows:6},fc=new Set(["resizableImage","resizableVideo","youtubeEmbed"]);function Ua(e){let r={words:0,media:0,tableRows:0},t=n=>{if(typeof n.text=="string"&&(r.words+=n.text.split(/\s+/).filter(a=>/[\p{L}\p{N}]/u.test(a)).length),n.type&&fc.has(n.type)&&r.media++,n.type==="table"){let a=(n.content??[]).filter(s=>s.type==="tableRow").length;r.tableRows=Math.max(r.tableRows,a)}for(let a of n.content??[])t(a)};return e&&t(e),r}function Pr(e,r=Ha){let t=Ua(e);return t.words>r.words||t.media>r.media||t.tableRows>r.tableRows}import{createContext as hc,useContext as gc}from"react";var Va=hc(null),ht=Va.Provider;function gt(){return gc(Va)}function xt({exercise:e,onAnswersChange:r,validationFeedback:t,renderSharedContext:n,renderQuestion:a,renderSeparator:s,className:o="",locale:i,display:c}){let l=we(c),d=xc(()=>_e(l),[l]),p=Ga(new Map),m=Ga({exercise:e,onAnswersChange:r});m.current={exercise:e,onAnswersChange:r};let g=Qa((x,_)=>{p.current.set(x,_);let{exercise:h,onAnswersChange:y}=m.current;if(y){let C={exerciseId:h.id,questionAnswers:h.questions.map(T=>({questionId:T.id,answers:p.current.get(T.id)??[]}))};y(C)}},[]),u=gt(),b=_r(i),v=!!(u&&e.sharedContext&&Pr(e.sharedContext)),w=e.sharedContext?v?bt("p",{className:"exercise-reference-cue",children:[br("span",{children:b.referenceInPanel(u.label)})," ",bt("button",{type:"button",className:"exercise-reference-cue__link",onClick:()=>u.showExerciseReference(e.id),children:[b.readReference,br("span",{"aria-hidden":"true",className:"exercise-reference-cue__arrow",children:"\u203A"})]})]}):br("div",{className:"exercise-shared-context",children:Se(e.sharedContext)}):null;return br(Re,{display:l,children:bt("div",{className:`exercise-runtime ${o}`,style:Ce(d),children:[w&&(n?n(w):w),e.questions.map((x,_)=>{let h=t?.get(x.id),y=br(yc,{questionId:x.id,content:x.content,onQuestionAnswers:g,validationFeedback:h,locale:i},x.id);return bt("div",{children:[a?a(x,y,_):y,s&&_<e.questions.length-1?s(_):null]},x.id)})]})})}var yc=bc(function({questionId:r,onQuestionAnswers:t,...n}){let a=Qa(s=>t(r,s),[t,r]);return br(gr,{...n,onAnswersChange:a})});import{jsx as dn,jsxs as vc}from"react/jsx-runtime";import{useCallback as wc,useEffect as kc,useMemo as Rc,useRef as Ya}from"react";function Xe({assessment:e,onAnswersChange:r,validationFeedback:t,renderExercise:n,renderSharedContext:a,renderSeparator:s,className:o="",brandingConfig:i,locale:c,display:l}){let d=Ya(new Map),p=we(l),m=Rc(()=>_e(p),[p]);kc(()=>{if(!i?.fontUrl)return;let v=`edpire-brand-font-${i.fontUrl.replace(/\W/g,"").slice(-24)}`;if(document.getElementById(v))return;let w=document.createElement("link");w.id=v,w.rel="stylesheet",w.href=i.fontUrl,document.head.appendChild(w)},[i?.fontUrl]);let g={...Ce(m)};i?.fontFamily&&(g["--brand-font"]=i.fontFamily);let u=Ya({assessment:e,onAnswersChange:r});u.current={assessment:e,onAnswersChange:r};let b=wc(v=>{d.current.set(v.exerciseId,v);let{assessment:w,onAnswersChange:x}=u.current;if(x){let _={exerciseAnswers:w.exercises.map(h=>d.current.get(h.id)??{exerciseId:h.id,questionAnswers:[]})};x(_)}},[]);return dn(Re,{display:p,children:dn("div",{className:`assessment-runtime ${o}`,style:Object.keys(g).length?g:void 0,children:e.exercises.map((v,w)=>{let x=t?.get(v.id),_=dn(xt,{exercise:v,onAnswersChange:b,validationFeedback:x,renderSharedContext:a?h=>a(h,v):void 0,locale:c},v.id);return vc("div",{children:[n?n(v,_,w):_,s&&w<e.exercises.length-1?s(w):null]},v.id)})})})}import{jsx as Ka}from"react/jsx-runtime";import{useMemo as Sc}from"react";function xr({content:e,className:r,display:t}){let n=we(t),a=Sc(()=>_e(n),[n]);return Ka(Re,{display:n,children:Ka("div",{className:`content-view ${r??""}`,style:Ce(a),children:Se(e)})})}import{jsx as Lr,Fragment as Xa,jsxs as yt}from"react/jsx-runtime";import{useMemo as _c}from"react";function Mr({item:e,className:r,renderFigureLabel:t,display:n}){let a=we(n),s=_c(()=>_e(a),[a]);return Lr(Re,{display:a,children:yt("div",{className:`annex-item-view ${r??""}${s.sizeSet?" edp-scaled":""}`,style:Ce(s),children:[e.type==="text-document"&&yt(Xa,{children:[e.title&&Lr("h3",{className:"text-base font-semibold mb-2",children:e.title}),Se(e.content)]}),e.type==="figure"&&yt("figure",{children:[Se(e.content),Lr("figcaption",{children:t?t(e.label):Lr("span",{children:e.label})})]}),e.type==="rich-block"&&yt(Xa,{children:[e.title&&Lr("h3",{className:"text-base font-semibold mb-2",children:e.title}),Se(e.content)]})]})})}import{jsx as Yu,jsxs as Ku}from"react/jsx-runtime";import{useState as Ju}from"react";import{jsx as af,jsxs as of}from"react/jsx-runtime";import{useState as cf,useCallback as lf,useMemo as df}from"react";import{useEditor as mf,EditorContent as uf}from"@tiptap/react";import hf from"@tiptap/starter-kit";import{jsx as yf,jsxs as vf,Fragment as wf}from"react/jsx-runtime";import{useMemo as Rf,useState as Sf}from"react";import{Send as go,Loader2 as fn,BarChart2 as bo,CheckCircle2 as nl,XCircle as al,RotateCcw as ol,X as hn,Clock as vr,AlertTriangle as sl,Check as il,CloudOff as cl}from"lucide-react";import{clsx as Lc}from"clsx";import{twMerge as Mc}from"tailwind-merge";function se(...e){return Mc(Lc(e))}import{Fragment as jc,jsx as ge,jsxs as pn}from"react/jsx-runtime";function Ic({accent:e}){return ge("div",{style:{width:48,height:48,borderRadius:"50%",border:`4px solid ${e}33`,borderTopColor:e,animation:"edpire-spin 0.8s linear infinite"}})}function $c({accent:e}){return ge("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[0,1,2].map(r=>ge("div",{style:{width:12,height:12,borderRadius:"50%",background:e,animation:`edpire-bounce 1.2s ease-in-out ${r*.2}s infinite`}},r))})}function zc({accent:e}){return pn("div",{style:{position:"relative",width:48,height:48},children:[[0,1].map(r=>ge("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.4,animation:`edpire-pulse 1.6s ease-out ${r*.8}s infinite`}},r)),ge("div",{style:{position:"absolute",inset:"25%",borderRadius:"50%",background:e}})]})}function Dc({accent:e}){return ge("div",{style:{display:"flex",gap:4,alignItems:"flex-end",height:40},children:[0,1,2,3].map(r=>ge("div",{style:{width:8,borderRadius:4,background:e,animation:`edpire-bars 1s ease-in-out ${r*.15}s infinite`}},r))})}function Ja({visible:e,bgColor:r="rgba(0,0,0,0.55)",accentColor:t="#6366f1",text:n="Evaluating your answers\u2026",aiText:a="Some answers are being reviewed by AI, this may take a few seconds.",spinnerTheme:s="default",animationUrl:o,hasAiNodes:i=!1,contained:c=!1}){return e?pn(jc,{children:[ge("style",{children:`
45
+ sys.stdin = io.StringIO(${JSON.stringify(i)})
46
+ `),p.runPython(e);let u=p.runPython("_stdout_capture.getvalue()");p.runPython("sys.stdout = sys.__stdout__");let d=u.trim()===(s||"").trim();return{testId:n,passed:d,actualStdout:u,durationMs:Date.now()-l}}else{p.runPython(e);let u=(a||[]).map(m=>JSON.stringify(m)).join(", "),d=p.runPython(`${t}(${u})`),h=Bt(d,o);return{testId:n,passed:h,actual:d,durationMs:Date.now()-l}}}catch(p){return{testId:n,passed:!1,stderr:String(p),errored:!0,durationMs:Date.now()-l}}}var Ot=null;async function jc(){if(Ot)return Ot;let e=await import("./sql-wasm-browser-NICPVFVD.mjs");return Ot=await(e.default??e)(),Ot}async function Oc(e,r,t,n){let a=Date.now();try{let o=await jc(),i=new o.Database;t&&i.run(t);let c=i.exec(e).flatMap(p=>p.values.map(u=>u.map(String).join("|"))).join(`
47
+ `),l=c.trim()===(n||"").trim();return i.close(),{testId:r,passed:l,actualStdout:c,durationMs:Date.now()-a}}catch(o){return{testId:r,passed:!1,stderr:String(o),errored:!0,durationMs:Date.now()-a}}}async function Bc(e){let{transform:r}=await import("./esm-RQP7AIMT.mjs");return r(e,{transforms:["typescript"]}).code}var $r=class{supports(r){return["javascript","typescript","python","sql"].includes(r)}async run(r){let{language:t,source:n,mode:a,entryFunction:o,tests:i,timeoutMs:s=5e3}=r;if(!this.supports(t))return i.map(p=>({testId:p.id,passed:!1,stderr:`Language "${t}" cannot run in-browser. Configure a RemoteExecutor for compiled languages.`,errored:!0}));let c=n;if(t==="typescript")try{c=await Bc(n)}catch(p){return i.map(u=>({testId:u.id,passed:!1,stderr:`TypeScript compile error: ${p.message}`,errored:!0}))}let l=[];for(let p of i){let u;t==="python"?u=await Fc(c,a,o,p.id,p.args,p.expectedReturn,p.stdin,p.expectedStdout,s):t==="sql"?u=await Oc(c,p.id,p.stdin,p.expectedStdout):u=await Lc(c,a,o,p.id,p.args,p.expectedReturn,p.stdin,p.expectedStdout,s),l.push(u)}return l}};import{jsx as Co}from"react/jsx-runtime";import{forwardRef as qc,useEffect as Wc,useImperativeHandle as Uc,useRef as Hc,useState as Vc}from"react";function Qc(e){return{javascript:"javascript",typescript:"typescript",python:"python",sql:"sql",java:"java",cpp:"cpp",go:"go"}[e]??"plaintext"}var Bn=qc(function({value:r,onChange:t,language:n="javascript",readOnly:a=!1,readOnlyRanges:o,placeholder:i,height:s=300,className:c,autoFocus:l},p){let[u,d]=Vc(null),{scale:h}=Ie(),m=Hc(null);Wc(()=>{import("./dist-RXTJ74FF.mjs").then(v=>{d(()=>v.default)}).catch(()=>{})},[]),Uc(p,()=>({getValue(){return m.current?.getValue?.()??r},focus(){m.current?.focus?.()},insert(v){let C=m.current;if(!C)return;let x=C.getSelection();C.executeEdits("insert",[{range:x,text:v,forceMoveMarkers:!0}])}}));function b(v){m.current=v,l&&v.focus(),o?.length&&v.onDidAttemptReadOnlyEdit(()=>{})}function w(v){t(v??"")}let R=typeof s=="number"?s*h:s;return u?Co(u,{className:c,height:R,language:Qc(n),value:r,onChange:w,onMount:b,options:{readOnly:a,minimap:{enabled:!1},fontSize:14*h,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on"}}):Co("textarea",{className:c,value:r,onChange:v=>t(v.target.value),readOnly:a,placeholder:i,style:{width:"100%",height:typeof s=="number"?I(s):s,fontFamily:"monospace",fontSize:I(14),padding:I("0.5rem"),border:"1px solid #e2e8f0",borderRadius:I("0.375rem"),resize:"vertical",background:a?"#f8fafc":"white",boxSizing:"border-box"},autoFocus:l})});var Zc=new $r;function el(e){return e?.showFeedback?e.state??"idle":"idle"}function _o(e){let r={};for(let t of e.attrs.starters??[])r[t.language]=t.code;return r}function rl({sample:e,result:r,mode:t}){let n=r?.passed,a=r?.errored,o=r!==void 0,i=o?a?"var(--almost, #c8810e)":n?"var(--ok, #1f8a4c)":"var(--pen, #d23b2b)":"var(--ink-faint, #8d93a0)",s=o?a?"\u26A0":null:"\u25CB";return we("div",{style:{padding:`${I("0.5rem")} ${I("0.75rem")}`,borderBottom:"1px solid var(--line, #e7e5e0)",fontSize:I("0.8125rem"),fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:[we("div",{style:{display:"flex",alignItems:"center",gap:I("0.5rem")},children:[ae("span",{style:{color:i,fontWeight:700,fontSize:I("0.875rem"),display:"inline-flex"},children:s??(n?ae(qn,{size:15,style:fe(15)}):ae(No,{size:15}))}),ae("span",{style:{fontWeight:600,color:"var(--ink, #1d2025)"},children:e.name??`Test ${e.id}`})]}),o&&!n&&we("div",{style:{marginTop:I("0.25rem"),paddingLeft:I("1.5rem")},children:[t==="function"?ae(nt,{children:r?.actual!==void 0&&we("div",{style:{color:"var(--ink-soft, #565b66)"},children:[ae("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"got: "}),ae("span",{style:{color:"var(--pen, #d23b2b)"},children:JSON.stringify(r.actual)}),ae("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:" expected: "}),ae("span",{style:{color:"var(--ok, #1f8a4c)"},children:JSON.stringify(e.expectedReturn)})]})}):ae(nt,{children:r?.actualStdout!==void 0&&we("div",{style:{color:"var(--ink-soft, #565b66)"},children:[we("div",{children:[ae("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"got: "}),ae("span",{style:{color:"var(--pen, #d23b2b)",whiteSpace:"pre-wrap"},children:r.actualStdout||"(empty)"})]}),we("div",{children:[ae("span",{style:{color:"var(--ink-faint, #8d93a0)"},children:"expected: "}),ae("span",{style:{color:"var(--ok, #1f8a4c)",whiteSpace:"pre-wrap"},children:e.expectedStdout||"(empty)"})]})]})}),r?.stderr&&ae("div",{style:{color:"var(--almost-ink, #8a5a08)",marginTop:I("0.125rem"),whiteSpace:"pre-wrap"},children:r.stderr})]})]})}function Tt({node:e,validationFeedback:r,readOnly:t=!1,executor:n=Zc,gradingTests:a}){let o=ye(),i=Kc(null),{attrs:s}=e,c=e.id,[l,p]=tt(s.defaultLanguage),[u,d]=tt(()=>_o(e)),[h,m]=tt([]),[b,w]=tt(!1),[R,v]=tt(!1),C=u[l]??"",x=el(r);Yc(()=>{let A=G=>{let B=G.answers?.find(V=>V.nodeId===c&&V.type==="codingResponse");B?.answer&&(B.answer.language&&p(B.answer.language),B.answer.sourceByLanguage&&d(B.answer.sourceByLanguage),B.answer.testResults&&m(B.answer.testResults))},L=()=>{d(_o(e)),m([]),v(!1)};return o.on("answers:prefill",A),o.on("answers:reset",L),()=>{o.off("answers:prefill",A),o.off("answers:reset",L)}},[o,c,e]);let S=Gc((A,L,G)=>{o.emit({type:"answer:changed",answer:{nodeId:c,type:"codingResponse",timestamp:Date.now(),answer:{language:A,sourceByLanguage:L,source:L[A]??"",testResults:G}}})},[o,c]),k=A=>{let L={...u,[l]:A};d(L),S(l,L,h)},_=A=>{p(A),m([]),S(A,u,[])},T=async()=>{if(b)return;w(!0),m([]);let A=a??s.visibleSamples??[];if(A.length===0){w(!1);return}try{let L=await n.run({language:l,source:C,mode:s.testMode,entryFunction:s.entryFunction,tests:A,timeoutMs:5e3});m(L),S(l,u,L)}catch(L){let G=A.map(B=>({testId:B.id,passed:!1,stderr:String(L),errored:!0}));m(G),S(l,u,G)}finally{w(!1)}},F=()=>{R||(v(!0),S(l,u,h))},g=(a??[]).filter(A=>A.hidden).length,E=g>0?h.filter(A=>(a??[]).find(G=>G.id===A.testId)?.hidden&&A.passed).length:0,f=a?a.filter(A=>!A.hidden):s.visibleSamples??[],q=x==="correct"?"var(--ok, #1f8a4c)":x==="partial"?"var(--almost, #c8810e)":x==="incorrect"?"var(--pen, #d23b2b)":"var(--line-strong, #d6d3cc)";return we("div",{style:{margin:`${I("0.75rem")} 0`,border:`1px solid ${q}`,borderRadius:I("0.875rem"),overflow:"hidden",transition:"border-color 0.2s"},children:[we("div",{style:{background:"var(--ui-muted, #f5f4f1)",borderBottom:"1px solid var(--line, #e7e5e0)",padding:`${I("0.5rem")} ${I("0.75rem")}`,display:"flex",alignItems:"center",gap:I("0.5rem"),flexWrap:"wrap"},children:[ae("div",{style:{display:"flex",gap:I("0.25rem")},children:s.languages.map(A=>ae("button",{onClick:()=>!t&&_(A),disabled:t,style:{padding:`${I("0.2rem")} ${I("0.6rem")}`,borderRadius:I("0.375rem"),border:"1px solid",borderColor:l===A?"var(--ink, #1d2025)":"var(--line, #e7e5e0)",background:l===A?"var(--ink, #1d2025)":"var(--card, #fff)",color:l===A?"#fff":"var(--ink-soft, #565b66)",fontSize:I("0.75rem"),fontWeight:600,cursor:t?"default":"pointer",fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:A},A))}),ae("div",{style:{flex:1}}),ae(Ye,{hint:s.hint}),!t&&we(nt,{children:[we("button",{onClick:T,disabled:b,style:{padding:`${I("0.25rem")} ${I("0.75rem")}`,borderRadius:I("0.5rem"),border:"1px solid var(--line-strong, #d6d3cc)",background:b?"var(--ui-muted, #f5f4f1)":"var(--card, #fff)",color:"var(--ink, #1d2025)",fontSize:I("0.8125rem"),fontWeight:600,cursor:b?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",gap:I("0.35rem")},children:[ae(Xc,{size:13,style:fe(13)})," ",b?"Running\u2026":"Run"]}),we("button",{onClick:F,disabled:R,style:{padding:`${I("0.3rem")} ${I("0.85rem")}`,borderRadius:I("0.5rem"),border:"none",background:R?"var(--ok-soft, #ecf8f0)":"var(--ink, #1d2025)",color:R?"var(--ok, #1f8a4c)":"#fff",fontSize:I("0.8125rem"),fontWeight:600,cursor:R?"default":"pointer",display:"inline-flex",alignItems:"center",gap:I("0.35rem")},children:[R&&ae(qn,{size:13,style:fe(13)})," ",R?"Submitted":"Submit"]})]})]}),ae(Bn,{ref:i,value:C,onChange:k,language:l,readOnly:t,readOnlyRanges:s.starters.find(A=>A.language===l)?.readOnlyRanges,height:320}),(h.length>0||f.length>0)&&we("div",{style:{borderTop:"1px solid var(--line, #e7e5e0)",background:"var(--paper, #fbfaf7)"},children:[ae("div",{style:{padding:`${I("0.5rem")} ${I("0.75rem")}`,fontSize:I("0.7rem"),fontWeight:700,color:"var(--ink-faint, #8d93a0)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Test Results"}),f.map(A=>ae(rl,{sample:A,result:h.find(L=>L.testId===A.id),mode:s.testMode},A.id)),g>0&&we("div",{style:{padding:`${I("0.5rem")} ${I("0.75rem")}`,fontSize:I("0.8125rem"),color:"var(--ink-soft, #565b66)",borderTop:"1px solid var(--line, #e7e5e0)",fontStyle:"italic",display:"flex",alignItems:"center",gap:I("0.4rem")},children:[ae(Jc,{size:13,style:fe(13)})," Hidden tests: ",E,"/",g," passed"]})]}),r?.showFeedback&&we("div",{style:{padding:`${I("0.55rem")} ${I("0.75rem")}`,fontSize:I("0.85rem"),fontWeight:600,borderTop:"1px solid var(--line, #e7e5e0)",display:"flex",alignItems:"center",gap:I("0.45rem"),background:x==="correct"?"var(--ok-soft, #ecf8f0)":x==="partial"?"var(--almost-soft, #fbf1dc)":x==="incorrect"?"var(--pen-soft, #fdeeec)":"transparent",color:x==="correct"?"var(--ok, #1f8a4c)":x==="partial"?"var(--almost-ink, #8a5a08)":x==="incorrect"?"var(--pen, #d23b2b)":"var(--ink-soft, #565b66)"},children:[x==="correct"&&we(nt,{children:[ae(qn,{size:15,style:fe(15)})," All tests passed"]}),x==="partial"&&"Partial credit",x==="incorrect"&&we(nt,{children:[ae(No,{size:15,style:fe(15)})," Tests failed"]}),x==="validating"&&"Evaluating\u2026",x==="awaiting_review"&&"Awaiting teacher review",r.score!==void 0&&we("span",{style:{marginLeft:"auto",fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:I("1.5rem"),lineHeight:1},children:[r.score," / ",r.maxScore??s.maxScore]})]})]})}import{Fragment as al,jsx as qt,jsxs as ol}from"react/jsx-runtime";import{createContext as il,useContext as sl,useEffect as cl}from"react";import{DndContext as ll,MouseSensor as dl,TouchSensor as pl,KeyboardSensor as ul,useDndContext as ml,useSensor as Hn,useSensors as fl}from"@dnd-kit/core";import{jsx as Wn}from"react/jsx-runtime";import{DragOverlay as tl,useDndContext as nl}from"@dnd-kit/core";function Un(){let{active:e}=nl();if(!e)return null;let r=e.data.current?.html??"";return Wn(tl,{dropAnimation:null,children:Wn("div",{style:{display:"inline-block",padding:"0.375rem 0.75rem",borderRadius:"9999px",backgroundColor:"white",border:"1px solid #e5e7eb",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",cursor:"grabbing",maxWidth:"20rem"},children:Wn("span",{dangerouslySetInnerHTML:{__html:r},style:{pointerEvents:"none",whiteSpace:"nowrap",lineHeight:"1.25"}})})})}function hl(e,r,t){let n=[],a=new Set,o=i=>{a.has(i)||(a.add(i),t(i)==="smooth"&&(n.push([i,i.style.scrollBehavior]),i.style.scrollBehavior="auto"))};for(let i=e;i;i=i.parentElement)o(i);return r&&o(r),()=>{for(let[i,s]of n)i.style.scrollBehavior=s}}function gl(){let{activeNode:e}=ml();return cl(()=>{if(!(!e||typeof document>"u"))return hl(e,document.scrollingElement,r=>getComputedStyle(r).scrollBehavior)},[e]),null}var Ao=il(!1),bl={acceleration:3,threshold:{x:0,y:.25}};function Wt({children:e}){let r=sl(Ao),t=Hn(dl,{activationConstraint:{distance:8}}),n=Hn(pl,{activationConstraint:{delay:250,tolerance:5}}),a=Hn(ul),o=fl(t,n,a);return r?qt(al,{children:e}):qt(Ao.Provider,{value:!0,children:ol(ll,{sensors:o,autoScroll:bl,children:[e,qt(Un,{}),qt(gl,{})]})})}function Dr({content:e,onAnswersChange:r,onSubmit:t,answerBus:n,namespace:a,initialAnswers:o,validationFeedback:i,className:s="",locale:c,readOnly:l=!1,mediaHandler:p,codeExecutor:u,display:d}){let h=Le(d),m=xl(()=>Fe(h),[h]),b=yl(null);b.current||(b.current=new Je);let w=n??b.current;Vn(()=>{o&&o.length>0&&w.prefillAnswers(o)},[o,w]),Vn(()=>{if(!r)return;let v=()=>{let C=w.getAllAnswers();r(C)};return w.on("answer:changed",v),()=>w.off("answer:changed",v)},[w,r]),Vn(()=>{if(!t)return;let v=C=>{t(C.answers)};return w.on("answer:submitted",v),()=>w.off("answer:submitted",v)},[w,t]);let R=De(e,i,{readOnly:l,mediaHandler:p,codeExecutor:u});return zr(Gr,{locale:c,children:zr($e,{display:h,children:zr(ht,{bus:w,children:zr(Wt,{children:zr(Mt,{initialAnswers:o,children:zr("div",{className:`question-runtime ${s}${m.sizeSet?" edp-scaled":""}`,"data-namespace":a,style:{fontSize:I("1.125rem"),lineHeight:"1.75",...je(m)},children:R})})})})})})}import{jsx as Fr,jsxs as Vt}from"react/jsx-runtime";import{memo as Rl,useCallback as Lo,useMemo as Sl,useRef as Mo}from"react";var Po={words:80,media:1,tableRows:6},vl=new Set(["resizableImage","resizableVideo","youtubeEmbed"]);function To(e){let r={words:0,media:0,tableRows:0},t=n=>{if(typeof n.text=="string"&&(r.words+=n.text.split(/\s+/).filter(a=>/[\p{L}\p{N}]/u.test(a)).length),n.type&&vl.has(n.type)&&r.media++,n.type==="table"){let a=(n.content??[]).filter(o=>o.type==="tableRow").length;r.tableRows=Math.max(r.tableRows,a)}for(let a of n.content??[])t(a)};return e&&t(e),r}function at(e,r=Po){let t=To(e);return t.words>r.words||t.media>r.media||t.tableRows>r.tableRows}import{createContext as wl,useContext as kl}from"react";var Eo=wl(null),Ut=Eo.Provider;function Ht(){return kl(Eo)}function Qt({exercise:e,onAnswersChange:r,validationFeedback:t,renderSharedContext:n,renderQuestion:a,renderSeparator:o,className:i="",locale:s,display:c}){let l=Le(c),p=Sl(()=>Fe(l),[l]),u=Mo(new Map),d=Mo({exercise:e,onAnswersChange:r});d.current={exercise:e,onAnswersChange:r};let h=Lo((v,C)=>{u.current.set(v,C);let{exercise:x,onAnswersChange:S}=d.current;if(S){let k={exerciseId:x.id,questionAnswers:x.questions.map(_=>({questionId:_.id,answers:u.current.get(_.id)??[]}))};S(k)}},[]),m=Ht(),b=Qr(s),w=!!(m&&e.sharedContext&&at(e.sharedContext)),R=e.sharedContext?w?Vt("p",{className:"exercise-reference-cue",children:[Fr("span",{children:b.referenceInPanel(m.label)})," ",Vt("button",{type:"button",className:"exercise-reference-cue__link",onClick:()=>m.showExerciseReference(e.id),children:[b.readReference,Fr("span",{"aria-hidden":"true",className:"exercise-reference-cue__arrow",children:"\u203A"})]})]}):Fr("div",{className:"exercise-shared-context",children:De(e.sharedContext)}):null;return Fr($e,{display:l,children:Vt("div",{className:`exercise-runtime ${i}`,style:je(p),children:[R&&(n?n(R):R),e.questions.map((v,C)=>{let x=t?.get(v.id),S=Fr(Cl,{questionId:v.id,content:v.content,onQuestionAnswers:h,validationFeedback:x,locale:s},v.id);return Vt("div",{children:[a?a(v,S,C):S,o&&C<e.questions.length-1?o(C):null]},v.id)})]})})}var Cl=Rl(function({questionId:r,onQuestionAnswers:t,...n}){let a=Lo(o=>t(r,o),[t,r]);return Fr(Dr,{...n,onAnswersChange:a})});import{jsx as Qn,jsxs as _l}from"react/jsx-runtime";import{useCallback as Nl,useEffect as Al,useMemo as Pl,useRef as Io}from"react";function dr({assessment:e,onAnswersChange:r,validationFeedback:t,renderExercise:n,renderSharedContext:a,renderSeparator:o,className:i="",brandingConfig:s,locale:c,display:l}){let p=Io(new Map),u=Le(l),d=Pl(()=>Fe(u),[u]);Al(()=>{if(!s?.fontUrl)return;let w=`edpire-brand-font-${s.fontUrl.replace(/\W/g,"").slice(-24)}`;if(document.getElementById(w))return;let R=document.createElement("link");R.id=w,R.rel="stylesheet",R.href=s.fontUrl,document.head.appendChild(R)},[s?.fontUrl]);let h={...je(d)};s?.fontFamily&&(h["--brand-font"]=s.fontFamily);let m=Io({assessment:e,onAnswersChange:r});m.current={assessment:e,onAnswersChange:r};let b=Nl(w=>{p.current.set(w.exerciseId,w);let{assessment:R,onAnswersChange:v}=m.current;if(v){let C={exerciseAnswers:R.exercises.map(x=>p.current.get(x.id)??{exerciseId:x.id,questionAnswers:[]})};v(C)}},[]);return Qn($e,{display:u,children:Qn("div",{className:`assessment-runtime ${i}`,style:Object.keys(h).length?h:void 0,children:e.exercises.map((w,R)=>{let v=t?.get(w.id),C=Qn(Qt,{exercise:w,onAnswersChange:b,validationFeedback:v,renderSharedContext:a?x=>a(x,w):void 0,locale:c},w.id);return _l("div",{children:[n?n(w,C,R):C,o&&R<e.exercises.length-1?o(R):null]},w.id)})})})}import{jsx as $o}from"react/jsx-runtime";import{useMemo as Tl}from"react";function jr({content:e,className:r,display:t}){let n=Le(t),a=Tl(()=>Fe(n),[n]);return $o($e,{display:n,children:$o("div",{className:`content-view ${r??""}`,style:je(a),children:De(e)})})}import{jsx as ot,Fragment as zo,jsxs as Gt}from"react/jsx-runtime";import{useMemo as El}from"react";function it({item:e,className:r,renderFigureLabel:t,display:n}){let a=Le(n),o=El(()=>Fe(a),[a]);return ot($e,{display:a,children:Gt("div",{className:`annex-item-view ${r??""}${o.sizeSet?" edp-scaled":""}`,style:je(o),children:[e.type==="text-document"&&Gt(zo,{children:[e.title&&ot("h3",{className:"text-base font-semibold mb-2",children:e.title}),De(e.content)]}),e.type==="figure"&&Gt("figure",{children:[De(e.content),ot("figcaption",{children:t?t(e.label):ot("span",{children:e.label})})]}),e.type==="rich-block"&&Gt(zo,{children:[e.title&&ot("h3",{className:"text-base font-semibold mb-2",children:e.title}),De(e.content)]})]})})}import{jsx as lh,jsxs as dh}from"react/jsx-runtime";import{useState as uh}from"react";import{jsx as xh,jsxs as yh}from"react/jsx-runtime";import{useState as wh,useCallback as kh,useMemo as Rh}from"react";import{useEditor as Ch,EditorContent as _h}from"@tiptap/react";import Ah from"@tiptap/starter-kit";import{jsx as Lh,jsxs as Ih,Fragment as $h}from"react/jsx-runtime";import{useMemo as Dh,useState as Fh}from"react";import{Send as Zo,Loader2 as ra,BarChart2 as ta,CheckCircle2 as ei,XCircle as dd,RotateCcw as pd,X as na,Clock as Br,AlertTriangle as ud,AlertCircle as md,Check as fd,CloudOff as hd}from"lucide-react";import{clsx as Fl}from"clsx";import{twMerge as jl}from"tailwind-merge";function ge(...e){return jl(Fl(e))}function Sr(e,r,t){return r?.trim()||e("exercise",{index:t+1})}import{Fragment as Ul,jsx as _e,jsxs as Gn}from"react/jsx-runtime";function Ol({accent:e}){return _e("div",{style:{width:48,height:48,borderRadius:"50%",border:`4px solid ${e}33`,borderTopColor:e,animation:"edpire-spin 0.8s linear infinite"}})}function Bl({accent:e}){return _e("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[0,1,2].map(r=>_e("div",{style:{width:12,height:12,borderRadius:"50%",background:e,animation:`edpire-bounce 1.2s ease-in-out ${r*.2}s infinite`}},r))})}function ql({accent:e}){return Gn("div",{style:{position:"relative",width:48,height:48},children:[[0,1].map(r=>_e("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.4,animation:`edpire-pulse 1.6s ease-out ${r*.8}s infinite`}},r)),_e("div",{style:{position:"absolute",inset:"25%",borderRadius:"50%",background:e}})]})}function Wl({accent:e}){return _e("div",{style:{display:"flex",gap:4,alignItems:"flex-end",height:40},children:[0,1,2,3].map(r=>_e("div",{style:{width:8,borderRadius:4,background:e,animation:`edpire-bars 1s ease-in-out ${r*.15}s infinite`}},r))})}function Do({visible:e,bgColor:r="rgba(0,0,0,0.55)",accentColor:t="#6366f1",text:n="Evaluating your answers\u2026",aiText:a="Some answers are being reviewed by AI, this may take a few seconds.",spinnerTheme:o="default",animationUrl:i,hasAiNodes:s=!1,contained:c=!1}){return e?Gn(Ul,{children:[_e("style",{children:`
48
48
  @keyframes edpire-spin {
49
49
  to { transform: rotate(360deg); }
50
50
  }
@@ -60,7 +60,20 @@ sys.stdin = io.StringIO(${JSON.stringify(o)})
60
60
  0%, 100% { height: 12px; }
61
61
  50% { height: 40px; }
62
62
  }
63
- `}),ge("div",{style:{background:r},className:`${c?"absolute":"fixed"} inset-0 z-[60] flex items-center justify-center`,children:pn("div",{className:"flex flex-col items-center gap-5 bg-white rounded-2xl shadow-2xl px-10 py-8 max-w-xs text-center",children:[(()=>{if(o)return ge("img",{src:o,alt:"",className:"w-24 h-24 object-contain"});switch(s){case"dots":return ge($c,{accent:t});case"pulse":return ge(zc,{accent:t});case"bars":return ge(Dc,{accent:t});default:return ge(Ic,{accent:t})}})(),ge("p",{className:"text-sm font-semibold text-slate-800",children:n}),i&&ge("p",{className:"text-xs text-slate-500 leading-snug",children:a})]})})]}):null}import{useCallback as Za,useEffect as Fc,useMemo as eo,useRef as vt,useState as Oc}from"react";import{BookOpen as ro,X as Bc}from"lucide-react";import{Fragment as qc,jsx as ce,jsxs as Ae}from"react/jsx-runtime";function mn(e){return e.exercises.flatMap((r,t)=>r.sharedContext&&Pr(r.sharedContext)?[{id:r.id,index:t,content:r.sharedContext}]:[])}var to=()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;function Wc(e){e.removeAttribute("data-flash"),e.offsetWidth,e.setAttribute("data-flash","true"),setTimeout(()=>e.removeAttribute("data-flash"),1200)}function no({assessment:e,isSubmitted:r,setAnswers:t,validationFeedback:n,renderExercise:a,renderSeparator:s,primaryColor:o,contained:i=!1,locale:c,contentMaxWidth:l,t:d,footer:p}){let[m,g]=Oc(!1),u=e.annex,b=u?.tabLabel||d("annexDocuments"),v=eo(()=>mn(e),[e]),w=vt(null),x=vt(null),_=vt(null),h=vt(null),y=()=>(w.current?.getClientRects().length??0)>0,C=Za((A,H)=>{let S=A?.querySelector(`[data-reference-for="${CSS.escape(H)}"]`);if(!A||!S)return;let N=S.getBoundingClientRect().top-A.getBoundingClientRect().top+A.scrollTop-12;A.scrollTo({top:N,behavior:to()?"auto":"smooth"}),Wc(S)},[]),T=Za(A=>{if(y()){C(x.current,A);return}g(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>C(h.current,A)))},[C]),$=A=>{let H=y()?w.current:_.current;y()||g(!1),Array.from(H?.querySelectorAll(`[data-exercise-id="${CSS.escape(A)}"]`)??[]).find(N=>N.getClientRects().length>0)?.scrollIntoView({behavior:to()?"auto":"smooth",block:"start"})};Fc(()=>{let A=w.current;if(!A||v.length===0||typeof IntersectionObserver>"u")return;let H=i?A:null,S=new Set(v.map(z=>z.id)),N=null,O=new IntersectionObserver(z=>{if(!y())return;let Q=z.filter(D=>D.isIntersecting&&S.has(D.target.dataset.exerciseId??"")).sort((D,X)=>D.boundingClientRect.top-X.boundingClientRect.top)[0]?.target?.dataset.exerciseId;!Q||Q===N||(N=Q,C(x.current,Q))},{root:H,rootMargin:"0px 0px -60% 0px"});return A.querySelectorAll("[data-exercise-id]").forEach(z=>O.observe(z)),()=>O.disconnect()},[v,C,i]);let R=eo(()=>({label:b,showExerciseReference:T}),[b,T]),f=Ae(qc,{children:[u?.items.map(A=>ce(Mr,{item:A},A.id)),u?.items.length&&v.length?ce("div",{className:"border-t border-[#e7e5e0]"}):null,v.map(A=>Ae("section",{"data-reference-for":A.id,className:"-mx-3 flex flex-col gap-2 rounded-[10px] px-3 py-2 transition-colors duration-700 data-[flash=true]:bg-[#fbf1dc] data-[flash=true]:duration-150",children:[ce("button",{type:"button",onClick:()=>$(A.id),className:"self-start cursor-pointer text-xs font-bold uppercase tracking-widest text-[#565b66] underline-offset-4 hover:text-[#1d2025] hover:underline focus-visible:outline-2 focus-visible:outline-[#1d2025] rounded-sm",children:d("exercise",{index:A.index+1})}),ce(xr,{content:A.content})]},A.id))]}),M=ce(Xe,{assessment:e,onAnswersChange:r?void 0:t,validationFeedback:n,renderExercise:a,renderSeparator:s,locale:c});return ce(ht,{value:R,children:Ae("div",{className:se("@container flex-1 min-h-0 flex",i&&"relative"),children:[Ae("div",{ref:w,className:se("hidden @6xl:flex flex-1 min-w-0 gap-4 p-4 bg-[#f5f4f1] items-start",i&&"overflow-y-auto"),children:[Ae("div",{className:se("flex-1 sticky flex flex-col bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",i?"top-4 max-h-[calc(100svh-6rem)]":"top-[calc(var(--edp-bar)+1rem)] max-h-[calc(100dvh-var(--edp-bar)-2rem)]"),children:[Ae("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-[#e7e5e0] flex-shrink-0",children:[ce(ro,{size:14,className:"text-[#8d93a0]"}),ce("span",{className:"text-xs font-bold text-[#565b66] uppercase tracking-widest",children:b})]}),ce("div",{ref:x,className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:f})]}),ce("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),ce("div",{className:"flex-1 min-w-0 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:Ae("div",{className:"px-6 py-5 flex flex-col gap-4",children:[M,p]})})]}),Ae("div",{className:se("@6xl:hidden flex-1 min-w-0 relative",i&&"overflow-hidden"),children:[ce("div",{ref:_,className:se(i&&"absolute inset-0 overflow-y-auto"),children:Ae("div",{className:"mx-auto px-5 py-5 flex flex-col gap-4",style:{maxWidth:l},children:[M,p]})}),m&&ce("div",{className:se("inset-0 z-30 bg-black/25",i?"absolute":"fixed"),onClick:()=>g(!1)}),Ae("div",{role:"dialog","aria-label":b,"aria-hidden":!m,className:se("top-1/2 start-2 -translate-y-1/2 z-40 w-[88%] bg-[#f1efe9] rounded-2xl shadow-2xl flex flex-col overflow-hidden transition-transform duration-300 ease-in-out",i?"absolute":"fixed",m?"translate-x-0":"-translate-x-[110%] rtl:translate-x-[110%]"),children:[Ae("div",{className:"flex items-center justify-between px-5 py-3 flex-shrink-0",children:[ce("span",{className:"text-sm font-bold text-[#1d2025]",children:b}),ce("button",{onClick:()=>g(!1),"aria-label":d("close"),className:"p-1 text-[#8d93a0] hover:text-[#1d2025] rounded-lg transition-colors",children:ce(Bc,{size:18})})]}),ce("div",{ref:h,className:"overflow-y-auto max-h-[calc(100dvh-8rem)] px-5 pb-5 flex flex-col gap-5",children:f})]})]}),!m&&Ae("button",{onClick:()=>g(!0),"aria-label":b,style:{transform:"translateY(-50%)",...o?{backgroundColor:o}:{}},className:se("@6xl:hidden top-1/2 start-0 z-20 flex flex-col items-center gap-1 py-3 px-1.5 bg-[#1d2025] text-white text-[10px] font-bold uppercase tracking-wider rounded-e-lg shadow-md hover:bg-[#31353c] transition-colors",i?"absolute":"fixed"),children:[ce(ro,{size:12}),ce("span",{style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:b})]})]})})}import{useState as Hc}from"react";import{BookOpen as ao,Plus as Uc,X as Vc}from"lucide-react";import{jsx as fe,jsxs as Ue}from"react/jsx-runtime";function oo({assessment:e,isSubmitted:r,setAnswers:t,validationFeedback:n,renderExercise:a,renderSeparator:s,primaryColor:o,contained:i=!1,locale:c,contentMaxWidth:l,t:d,onAddAnnex:p,footer:m}){let[g,u]=Hc(!1),b=fe(Xe,{assessment:e,onAnswersChange:r?void 0:t,validationFeedback:n,renderExercise:a,renderSeparator:s,locale:c});if(g)return fe("div",{className:"flex-1 overflow-y-auto",children:Ue("div",{className:"mx-auto p-6 flex flex-col gap-4",style:{maxWidth:l},children:[b,m]})});let v=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),p())},w=_=>Ue("span",{style:o?{backgroundColor:o}:void 0,className:se("flex-none inline-flex items-center gap-1.5 rounded-lg bg-[#1d2025] text-white font-semibold shadow-sm group-hover:shadow-md transition-shadow",_?"px-3 py-1.5 text-xs":"mt-1 px-3.5 py-2 text-xs"),children:[fe(Uc,{size:13}),d("annexEmptyCta")]}),x=_=>fe("button",{type:"button",onClick:h=>{h.stopPropagation(),u(!0)},"aria-label":d("annexEmptyDismiss"),title:d("annexEmptyDismiss"),className:se("flex-none flex items-center justify-center w-7 h-7 rounded-lg text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] transition-colors cursor-pointer",_&&"absolute top-2 end-2 z-10"),children:fe(Vc,{size:15})});return Ue("div",{className:se("@container flex-1 min-h-0 flex",i&&"relative"),children:[Ue("div",{className:"hidden @6xl:flex flex-1 gap-4 p-4 bg-[#f5f4f1] items-start overflow-y-auto",children:[fe("div",{className:"flex-1 sticky top-4 flex min-h-[200px] max-h-[calc(100svh-6rem)]",children:Ue("div",{role:"button",tabIndex:0,onClick:p,onKeyDown:v,className:"group relative flex-1 w-full flex flex-col items-center justify-center gap-3 text-center rounded-[14px] border-2 border-dashed border-[#d6d3cc] bg-white/60 hover:border-[#8d93a0] hover:bg-white transition-colors cursor-pointer px-6 py-8 outline-none focus-visible:ring-2 focus-visible:ring-[#8d93a0] focus-visible:ring-offset-2",children:[x(!0),fe("span",{className:"flex items-center justify-center w-11 h-11 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:fe(ao,{size:20})}),fe("span",{className:"text-sm font-bold text-[#565b66]",children:d("annexEmptyTitle")}),fe("span",{className:"text-xs text-[#8d93a0] max-w-[32ch] leading-relaxed",children:d("annexEmptyBody")}),w(!1)]})}),fe("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),fe("div",{className:"flex-1 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:Ue("div",{className:"px-6 py-5 flex flex-col gap-4",children:[b,m]})})]}),fe("div",{className:"@6xl:hidden flex-1 overflow-y-auto",children:Ue("div",{className:"mx-auto px-5 py-5 flex flex-col gap-4",style:{maxWidth:l},children:[Ue("div",{role:"button",tabIndex:0,onClick:p,onKeyDown:v,className:"group flex items-center gap-3 rounded-[14px] border-2 border-dashed border-[#d6d3cc] bg-white/60 hover:border-[#8d93a0] hover:bg-white transition-colors cursor-pointer px-4 py-2.5 outline-none focus-visible:ring-2 focus-visible:ring-[#8d93a0]",children:[fe("span",{className:"flex-none flex items-center justify-center w-9 h-9 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:fe(ao,{size:16})}),Ue("div",{className:"flex-1 min-w-0",children:[fe("div",{className:"text-xs font-bold text-[#565b66]",children:d("annexEmptyTitle")}),fe("div",{className:"text-[11px] text-[#8d93a0] leading-snug",children:d("annexEmptyBody")})]}),w(!0),x(!1)]}),b,m]})})]})}function wt(e){let r=new Map;for(let t of e){let n=new Map;for(let a of t.questions){let s=new Map;for(let o of a.nodeResults){let i={state:o.status,showFeedback:!0,score:o.score,...o.feedback!==void 0?{message:o.feedback}:{},...o.displayAnswer!==void 0?{displayAnswer:o.displayAnswer}:{},...o.teacherFeedback!==void 0?{teacherFeedback:o.teacherFeedback}:{}};o.detail?.type==="choiceSet"?i.correctChoiceIds=o.detail.correctChoiceIds:o.detail?.type==="matchingSet"&&(i.pairFeedback=o.detail.pairFeedback,i.correctPairings=o.detail.correctPairings),s.set(o.nodeId,i)}n.set(a.questionId,s)}r.set(t.exerciseId,n)}return r}import{Lightbulb as Gc}from"lucide-react";import{jsx as un,jsxs as so}from"react/jsx-runtime";function Qc(e){return e.length===0||e.some(r=>r.status==="awaiting_review")?null:e.every(r=>r.status==="correct")?"correct":e.some(r=>r.score>0)?"partial":"incorrect"}function io({content:e,nodeResults:r,label:t}){let n=Qc(r);return so("div",{className:`player-ai-feedback mt-3 mb-3${n?` player-ai-feedback--${n}`:""}`,children:[so("p",{className:"flex items-center gap-1.5 text-xs font-semibold",children:[un(Gc,{size:14,"aria-hidden":!0}),t]}),un("div",{className:"text-[#1d2025]",children:un(xr,{content:e})})]})}var Yc=new Set(["choiceSet","inlineChoiceSet","blank","aiAnswerInput","matchingSet","openResponseNode","mathResponse","codingResponse"]),Kc=new Set(["blankPool","inlinePool"]);function Xc(e){switch(e.type){case"choiceSet":case"inlineChoiceSet":return e.answer.selectedIds.length>0;case"blank":return e.answer.mode==="choice"?e.answer.choiceId.length>0:e.answer.text.trim().length>0;case"matchingSet":return e.answer.connections.length>0;case"aiAnswer":return e.answer.text.trim().length>0;case"openResponse":{let r=e.answer;return r.recording||r.files&&r.files.length>0?!0:(r.text?.wordCount??0)>0}case"mathResponse":return e.answer.latex.trim().length>0;case"codingResponse":return e.answer.source.trim().length>0;default:{let r=e;return!0}}}function Jc(e){let r=0,t=n=>{if(Array.isArray(n)){for(let o of n)t(o);return}if(!n||typeof n!="object")return;let{type:a,content:s}=n;if(typeof a=="string"){if(Yc.has(a)){r+=1;return}if(Kc.has(a))return}s!==void 0&&t(s)};return t(e),r}function co(e,r){let t=new Map;for(let a of r?.exerciseAnswers??[])for(let s of a.questionAnswers){let o=t.get(s.questionId);o||(o=new Set,t.set(s.questionId,o));for(let i of s.answers)Xc(i)&&o.add(i.nodeId)}let n=[];return e.exercises.forEach((a,s)=>{a.questions.forEach((o,i)=>{let c=Jc(o.content);c!==0&&(t.get(o.id)?.size??0)<c&&n.push({questionId:o.id,exerciseIndex:s,questionIndex:i,only:a.questions.length===1})})}),n}var Zc={exercise:"Exercise {index}",question:"Question {index}",points:"pts","points.one":"pt",submit:"Submit Assessment",submitting:"Submitting...",confirmTitle:"Submit Assessment",confirmDescription:"Are you sure you want to submit? You cannot change your answers after submitting.",unansweredOne:"1 question is not fully answered.",unansweredMany:"{count} questions are not fully answered.",unansweredMore:"and {count} more",confirmSubmit:"Submit",confirmCancel:"Cancel",assessmentPassed:"Assessment passed",assessmentNotPassed:"Assessment not passed",awaitingReview:"Awaiting review",awaitingReviewDesc:"Your teacher is reviewing your open responses. Your final score will be available once grading is complete.",beingMarked:"Being marked",beingMarkedDesc:"Some answers are still being marked. Your final score will be available once every answer is marked.",pendingReview:"Pending review",viewFullReport:"View Full Report",explanation:"Explanation",poweredBy:"Powered by Edpire",evaluating:"Evaluating your answers\u2026",aiEvaluating:"Some answers are being reviewed by AI, this may take a few seconds.",reset:"Reset",back:"Back",annexDocuments:"Documents",annexEmptyTitle:"No reference yet",annexEmptyBody:"A text, figure, table or document that stays in view across the whole assessment while students answer.",annexEmptyCta:"Add reference",annexEmptyDismiss:"Hide","timeUp.title":"Time's up","timeUp.submitting":"Submitting your answers\u2026",yourScore:"Your score",answersSaving:"Saving\u2026",answersSaved:"Answers saved",answersNotSaved:"Your answers aren't being saved. Check your connection.",resumeRestored:"Welcome back. Your answers are here.",resumeFresh:"Welcome back.",resumeTimeLeft:"The clock kept running: {minutes} min left.",close:"Close"},el={exercise:"Exercice {index}",question:"Question {index}",points:"pts","points.one":"pt",submit:"Soumettre l'\xE9valuation",submitting:"Soumission...",confirmTitle:"Soumettre l'\xE9valuation",confirmDescription:"\xCAtes-vous s\xFBr de vouloir soumettre ? Vous ne pourrez pas modifier vos r\xE9ponses.",unansweredOne:"1 question n'est pas enti\xE8rement remplie.",unansweredMany:"{count} questions ne sont pas enti\xE8rement remplies.",unansweredMore:"et {count} autres",confirmSubmit:"Soumettre",confirmCancel:"Annuler",assessmentPassed:"\xC9valuation r\xE9ussie",assessmentNotPassed:"\xC9valuation non r\xE9ussie",awaitingReview:"En attente de correction",awaitingReviewDesc:"Votre professeur examine vos r\xE9ponses ouvertes. Votre note finale sera disponible une fois la correction termin\xE9e.",beingMarked:"Correction en cours",beingMarkedDesc:"Certaines r\xE9ponses sont encore en cours de correction. Votre note finale sera disponible d\xE8s que toutes les r\xE9ponses seront corrig\xE9es.",pendingReview:"En attente de correction",viewFullReport:"Voir le rapport complet",explanation:"Explication",poweredBy:"Propuls\xE9 par Edpire",evaluating:"\xC9valuation de vos r\xE9ponses\u2026",aiEvaluating:"Certaines r\xE9ponses sont examin\xE9es par l'IA, cela peut prendre quelques secondes.",reset:"R\xE9initialiser",back:"Retour",annexDocuments:"Documents",annexEmptyTitle:"Aucune annexe pour l'instant",annexEmptyBody:"Un texte, une figure, un tableau ou un document qui reste visible pour toute l'\xE9valuation pendant que les \xE9l\xE8ves r\xE9pondent.",annexEmptyCta:"Ajouter une annexe",annexEmptyDismiss:"Masquer","timeUp.title":"Temps \xE9coul\xE9","timeUp.submitting":"Envoi de vos r\xE9ponses\u2026",yourScore:"Votre score",answersSaving:"Enregistrement\u2026",answersSaved:"R\xE9ponses enregistr\xE9es",answersNotSaved:"Vos r\xE9ponses ne sont pas enregistr\xE9es. V\xE9rifiez votre connexion.",resumeRestored:"Bon retour. Vos r\xE9ponses sont l\xE0.",resumeFresh:"Bon retour.",resumeTimeLeft:"Le chrono a continu\xE9 : il reste {minutes} min.",close:"Fermer"},rl={exercise:"\u062A\u0645\u0631\u064A\u0646 {index}",question:"\u0633\u0624\u0627\u0644 {index}",points:"\u0646\u0642\u0637\u0629","points.two":"\u0646\u0642\u0637\u062A\u0627\u0646","points.few":"\u0646\u0642\u0627\u0637",submit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",submitting:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644...",confirmTitle:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",confirmDescription:"\u0647\u0644 \u0623\u0646\u062A \u0645\u062A\u0623\u0643\u062F \u0645\u0646 \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u061F \u0644\u0646 \u062A\u062A\u0645\u0643\u0646 \u0645\u0646 \u062A\u063A\u064A\u064A\u0631 \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0628\u0639\u062F \u0627\u0644\u0625\u0631\u0633\u0627\u0644.",unansweredOne:"\u0644\u0645 \u062A\u064F\u0643\u0645\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0639\u0646 \u0633\u0624\u0627\u0644 \u0648\u0627\u062D\u062F.",unansweredMany:"\u0644\u0645 \u062A\u064F\u0643\u0645\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0639\u0646 {count} \u0645\u0646 \u0627\u0644\u0623\u0633\u0626\u0644\u0629.",unansweredMore:"\u0648{count} \u0623\u062E\u0631\u0649",confirmSubmit:"\u0625\u0631\u0633\u0627\u0644",confirmCancel:"\u0625\u0644\u063A\u0627\u0621",assessmentPassed:"\u0627\u062C\u062A\u064A\u0627\u0632 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",assessmentNotPassed:"\u0644\u0645 \u064A\u062A\u0645 \u0627\u062C\u062A\u064A\u0627\u0632 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",awaitingReview:"\u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",awaitingReviewDesc:"\u064A\u0642\u0648\u0645 \u0645\u0639\u0644\u0645\u0643 \u0628\u0645\u0631\u0627\u062C\u0639\u0629 \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0627\u0644\u0645\u0641\u062A\u0648\u062D\u0629. \u0633\u062A\u0638\u0647\u0631 \u0639\u0644\u0627\u0645\u062A\u0643 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 \u0628\u0639\u062F \u0627\u0643\u062A\u0645\u0627\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D.",beingMarked:"\u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D",beingMarkedDesc:"\u0628\u0639\u0636 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A \u0645\u0627 \u0632\u0627\u0644\u062A \u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D. \u0633\u062A\u0638\u0647\u0631 \u0639\u0644\u0627\u0645\u062A\u0643 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 \u0628\u0639\u062F \u062A\u0635\u062D\u064A\u062D \u062C\u0645\u064A\u0639 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A.",pendingReview:"\u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D",viewFullReport:"\u0639\u0631\u0636 \u0627\u0644\u062A\u0642\u0631\u064A\u0631 \u0627\u0644\u0643\u0627\u0645\u0644",explanation:"\u0634\u0631\u062D",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 Edpire",evaluating:"\u062C\u0627\u0631\u064D \u062A\u0642\u064A\u064A\u0645 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u2026",aiEvaluating:"\u0628\u0639\u0636 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A \u0642\u064A\u062F \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A\u060C \u0642\u062F \u064A\u0633\u062A\u063A\u0631\u0642 \u0630\u0644\u0643 \u0628\u0636\u0639 \u062B\u0648\u0627\u0646\u064D.",reset:"\u0625\u0639\u0627\u062F\u0629 \u062A\u0639\u064A\u064A\u0646",back:"\u0631\u062C\u0648\u0639",annexDocuments:"\u0627\u0644\u0645\u0633\u062A\u0646\u062F\u0627\u062A",annexEmptyTitle:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u064F\u0644\u062D\u064E\u0642 \u0628\u0639\u062F",annexEmptyBody:"\u0646\u0635 \u0623\u0648 \u0635\u0648\u0631\u0629 \u0623\u0648 \u062C\u062F\u0648\u0644 \u0623\u0648 \u0645\u0633\u062A\u0646\u062F \u064A\u0628\u0642\u0649 \u0638\u0627\u0647\u0631\u064B\u0627 \u0637\u0648\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0623\u062B\u0646\u0627\u0621 \u0625\u062C\u0627\u0628\u0629 \u0627\u0644\u0637\u0644\u0627\u0628.",annexEmptyCta:"\u0625\u0636\u0627\u0641\u0629 \u0645\u064F\u0644\u062D\u064E\u0642",annexEmptyDismiss:"\u0625\u062E\u0641\u0627\u0621","timeUp.title":"\u0627\u0646\u062A\u0647\u0649 \u0627\u0644\u0648\u0642\u062A","timeUp.submitting":"\u062C\u0627\u0631\u064D \u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u2026",yourScore:"\u0646\u062A\u064A\u062C\u062A\u0643",answersSaving:"\u062C\u0627\u0631\u064D \u0627\u0644\u062D\u0641\u0638\u2026",answersSaved:"\u062A\u0645 \u062D\u0641\u0638 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",answersNotSaved:"\u0644\u0627 \u064A\u062A\u0645 \u062D\u0641\u0638 \u0625\u062C\u0627\u0628\u0627\u062A\u0643. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643.",resumeRestored:"\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643. \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0647\u0646\u0627.",resumeFresh:"\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643.",resumeTimeLeft:"\u0627\u0633\u062A\u0645\u0631\u0651 \u0627\u0644\u0645\u0624\u0642\u0651\u062A: \u062A\u0628\u0642\u0651\u0649 {minutes} \u062F\u0642\u064A\u0642\u0629.",close:"\u0625\u063A\u0644\u0627\u0642"},yr={en:Zc,fr:el,ar:rl};function tl(e,r,t){let a=(yr[e]??yr.en)[r]??yr.en[r]??r;return t?Object.entries(t).reduce((s,[o,i])=>s.replace(`{${o}}`,String(i)),a):a}function lo(e,r){let t=new Intl.PluralRules(e).select(r),n=yr[e]??yr.en;return n[`points.${t}`]??n.points??yr.en.points}function po(e){return(r,t)=>tl(e,r,t)}function mo(e){return e==="ar"}var uo="48rem";function cr(e,{insertAt:r}={}){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",r==="top"&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}cr(`:root{--ink: #1d2025;--ink-soft: #565b66;--ink-faint: #8d93a0;--ui-muted: #f5f4f1;--line: #e7e5e0;--line-strong: #d6d3cc;--ok: #1f8a4c;--ok-soft: #ecf8f0;--pen: #d23b2b;--pen-soft: #fdeeec;--almost: #c8810e;--almost-ink: #8a5a08;--almost-soft: #fbf1dc;--font-hand: "Caveat", cursive}@keyframes answer-shake{10%,90%{transform:translate(-2px)}20%,80%{transform:translate(4px)}30%,50%,70%{transform:translate(-6px)}40%,60%{transform:translate(6px)}}@keyframes hop{0%,to{transform:translateY(0) scale(1)}40%{transform:translateY(-6%) scale(1.05)}}@keyframes wobble{0%,to{transform:translate(0)}15%,85%{transform:translate(-4px)}30%,70%{transform:translate(4px)}45%,55%{transform:translate(-2px)}}.animate-shake{animation:answer-shake .4s both}.animate-hop{animation:hop .5s ease-out}.animate-wobble{animation:wobble .5s ease}.cs-player__grid{display:grid;gap:calc(.75rem * var(--edp-scale, 1));grid-template-columns:repeat(1,minmax(0,1fr))}@media(min-width:40rem){:where(.cs-player:not(.cs-player--box)) .cs-player__grid--row{grid-template-columns:repeat(2,minmax(0,1fr))}}.cs-player--box{container-type:inline-size}@container (min-width: 35.5em){.cs-player--box .cs-player__grid--row{grid-template-columns:repeat(2,minmax(0,1fr))}}.player-choice{position:relative;display:inline-flex;align-items:center;gap:calc(.75rem * var(--edp-scale, 1));flex-wrap:wrap;width:100%;padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1));border:1.5px solid var(--line, #e7e5e0);border-radius:calc(.75rem * var(--edp-scale, 1));background-color:#fff;color:var(--ink, #1d2025);cursor:pointer;user-select:none;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease;font-weight:500;text-align:start}.player-choice:hover:not(:disabled){background-color:var(--ui-muted, #f5f4f1);border-color:var(--line-strong, #d6d3cc)}.player-choice:disabled{cursor:default}.player-choice>img{flex-shrink:0}.player-choice__mark{flex:none;display:grid;place-items:center;width:calc(20px * var(--edp-scale, 1));height:calc(20px * var(--edp-scale, 1));border:1.5px solid var(--ink-faint, #8d93a0);background:#fff;color:#fff;transition:border-color .15s,background .15s}.player-choice__mark--radio{border-radius:999px}.player-choice__mark--box{border-radius:calc(6px * var(--edp-scale, 1))}.player-choice__mark>svg{width:calc(13px * var(--edp-scale, 1));height:calc(13px * var(--edp-scale, 1));opacity:0}.player-choice__text{flex:1;min-width:0}.player-choice{height:100%}.player-choice__text img,.player-choice__text video,.player-choice__text iframe{max-height:calc(120px * var(--edp-scale, 1));width:auto;max-width:100%}.player-choice--tile{flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:calc(.5rem * var(--edp-scale, 1));padding:calc(1rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1))}.player-choice--tile .player-choice__mark{position:absolute;top:calc(.5rem * var(--edp-scale, 1));inset-inline-start:calc(.5rem * var(--edp-scale, 1))}.player-choice--tile .player-choice__text{flex:0 1 auto;width:100%;text-align:center}.player-choice--tile .player-choice__text img,.player-choice--tile .player-choice__text video,.player-choice--tile .player-choice__text iframe{display:block!important;margin-inline:auto;margin-bottom:calc(.4rem * var(--edp-scale, 1))}.player-choice--selected{background-color:var(--ui-muted, #f5f4f1);border-color:var(--ink, #1d2025)}.player-choice--selected .player-choice__mark{border-color:var(--ink, #1d2025);background:var(--ink, #1d2025)}.player-choice--selected .player-choice__mark>svg{opacity:1}.player-choice--correct{background-color:var(--ok-soft, #ecf8f0);border-color:var(--ok, #1f8a4c)}.player-choice--correct .player-choice__mark{border-color:var(--ok, #1f8a4c);background:var(--ok, #1f8a4c)}.player-choice--correct .player-choice__mark>svg{opacity:1}.player-choice--correct-unchosen{background-color:#fff;border-color:var(--ok, #1f8a4c);border-style:dashed}.player-choice--correct-unchosen .player-choice__mark{border-color:var(--ok, #1f8a4c)}.player-choice--incorrect{background-color:var(--pen-soft, #fdeeec);border-color:var(--pen, #d23b2b)}.player-choice--incorrect .player-choice__mark{border-color:var(--pen, #d23b2b);background:var(--pen, #d23b2b)}.player-choice--incorrect .player-choice__mark>svg{opacity:1}.player-choice--muted{opacity:.55}.player-choice--partial{background-color:var(--ok-soft, #ecf8f0);border-color:var(--ok, #1f8a4c)}.player-choice--disabled{cursor:default}.player-choice__mark--letter{width:calc(1.625rem * var(--edp-scale, 1));height:calc(1.625rem * var(--edp-scale, 1));color:var(--ink, #1d2025);font-size:.8em;font-weight:700;line-height:1}.player-choice--selected .player-choice__mark--letter,.player-choice--correct .player-choice__mark--letter,.player-choice--incorrect .player-choice__mark--letter{color:#fff}.player-choice--correct-unchosen .player-choice__mark--letter{color:var(--ok, #1f8a4c)}.player-choice__verdict{flex:none;display:grid;place-items:center;margin-inline-start:auto}.player-choice__verdict>svg{width:calc(1.125rem * var(--edp-scale, 1));height:calc(1.125rem * var(--edp-scale, 1))}.player-choice__verdict--correct{color:var(--ok, #1f8a4c)}.player-choice__verdict--incorrect{color:var(--pen, #d23b2b)}.player-choice--tile .player-choice__verdict{position:absolute;top:calc(.5rem * var(--edp-scale, 1));inset-inline-end:calc(.5rem * var(--edp-scale, 1));margin:0}.player-inline-choice{display:inline-flex;align-items:center;gap:calc(.25rem * var(--edp-scale, 1));padding:.05em .55em;border:1.5px solid var(--line-strong, #d6d3cc);border-radius:999px;background:#fff;color:var(--ink, #1d2025);font-size:.9em;line-height:inherit;cursor:pointer;user-select:none;transition:border-color .15s,background .15s}.player-inline-choice:hover:not(:disabled){background:var(--ui-muted, #f5f4f1)}.player-inline-choice:disabled{cursor:default}.player-inline-choice--selected{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-inline-choice--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-inline-choice--correct-unchosen{border-color:var(--ok, #1f8a4c);border-style:dashed}.player-inline-choice--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-inline-choice--muted{opacity:.55}.player-inline-choice:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.player-blank-input{display:inline-block;min-width:3ch;padding:calc(.25rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border:none;border-bottom:2px solid var(--line-strong, #d6d3cc);background-color:transparent;font-size:inherit;font-family:inherit;transition:all .2s ease;outline:none}.player-blank-input:focus{border-bottom-color:var(--ink, #1d2025);background-color:var(--ui-muted, #f5f4f1)}.player-blank-input--correct{border-bottom-color:var(--ok, #1f8a4c);background-color:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-blank-input--incorrect{border-bottom-color:var(--pen, #d23b2b);background-color:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-blank-input:disabled{opacity:.7;cursor:not-allowed}.player-typed-blank{display:inline-block;min-width:7ch;max-width:100%;padding:0 calc(.25rem * var(--edp-scale, 1));font-weight:600;text-align:center;line-height:1.25;border:1px solid var(--line-strong, #d6d3cc);border-bottom-width:2px;border-radius:calc(2px * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);outline:none;resize:none;overflow:hidden;vertical-align:middle}.player-typed-blank::placeholder{color:var(--ink-faint, #8d93a0);font-weight:500}.player-typed-blank:focus{border-color:var(--ink, #1d2025)}.player-typed-blank--pending{border-color:var(--ink-faint, #8d93a0);background:var(--card, #ffffff)}.player-blank-cell{display:flex;flex-wrap:wrap;align-items:center;gap:calc(.125rem * var(--edp-scale, 1)) calc(.25rem * var(--edp-scale, 1));width:100%}.player-blank-cell__box{position:relative;display:block;flex:1 1 100%;min-width:0}.player-typed-blank--cell{display:block;box-sizing:border-box;width:100%;min-width:6.5ch;padding:calc(1px * var(--edp-scale, 1)) calc(2px * var(--edp-scale, 1));font:inherit;font-weight:600;line-height:1.3;white-space:nowrap;overflow-x:hidden}.player-typed-blank-feedback--cell{display:block;box-sizing:border-box;width:max-content;min-width:100%;max-width:none;white-space:nowrap;overflow:visible}.player-blank-cell .player-blank-reveal{white-space:nowrap;font-size:.9em}.edp-table-arrows{display:flex;justify-content:flex-end}.edp-table-arrows--top{margin-bottom:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrows--bottom{margin-top:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrows__pair{display:inline-flex;gap:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrow{display:inline-flex;align-items:center;justify-content:center;width:calc(1.875rem * var(--edp-scale, 1));height:calc(1.875rem * var(--edp-scale, 1));padding:0;border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--card, #ffffff);color:var(--ink, #1d2025);cursor:pointer;transition:border-color .15s,background .15s,opacity .15s;-webkit-tap-highlight-color:transparent}.edp-table-arrow:hover:not(:disabled){border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.edp-table-arrow:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.edp-table-arrow:disabled{opacity:.35;cursor:default}.edp-table-shade{position:absolute;top:0;bottom:0;width:calc(1.5rem * var(--edp-scale, 1));pointer-events:none;z-index:2}.edp-table-shade--left{background:linear-gradient(to right,#1d202529,#1d202500)}.edp-table-shade--right{background:linear-gradient(to left,#1d202529,#1d202500)}@media(max-width:640px){.edp-table-first{max-width:38vw}}.player-typed-blank-feedback{display:inline-block;min-width:2ch;max-width:100%;padding:0 calc(.25rem * var(--edp-scale, 1));font-weight:600;text-align:center;line-height:1.25;border:1px solid var(--line-strong, #d6d3cc);border-bottom-width:2px;border-radius:calc(2px * var(--edp-scale, 1));overflow-x:auto;cursor:default;vertical-align:middle}.player-typed-blank-feedback--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-typed-blank-feedback--partial{border-color:var(--ok, #1f8a4c);border-style:dashed;background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-typed-blank-feedback--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b);text-decoration:line-through}.player-typed-blank-spinner{display:inline-block;width:calc(.75rem * var(--edp-scale, 1));height:calc(.75rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:999px;animation:blank-spin .7s linear infinite}@keyframes blank-spin{to{transform:rotate(360deg)}}.player-blank-reveal{font-weight:700;color:var(--ok, #1f8a4c);font-size:.875em;word-break:break-word;min-width:0}.player-blank-feedback{display:inline-block;font-size:.8em;font-weight:500;line-height:1.3;padding:calc(2px * var(--edp-scale, 1)) calc(8px * var(--edp-scale, 1));border-radius:999px;word-break:break-word;min-width:0;background:var(--ui-muted, #f5f4f1);color:var(--ink-soft, #565b66)}.player-blank-feedback--correct{background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-blank-feedback--incorrect{background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-blank-hint-btn{width:calc(1rem * var(--edp-scale, 1));height:calc(1rem * var(--edp-scale, 1));border:0;border-radius:999px;background:#fbbf24;color:#fff;font-size:calc(10px * var(--edp-scale, 1));font-weight:700;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s}.player-blank-hint-btn:hover,.player-blank-hint-btn--pinned{background:#f59e0b}.player-blank-hint-pop{position:absolute;bottom:100%;left:50%;transform:translate(-50%);margin-bottom:calc(.5rem * var(--edp-scale, 1));z-index:9999;min-width:calc(180px * var(--edp-scale, 1));max-width:calc(300px * var(--edp-scale, 1));width:max-content;background:#fffbeb;border:1px solid #fde68a;border-radius:calc(14px * var(--edp-scale, 1));box-shadow:0 8px 24px #92400e2e;padding:calc(.5rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));color:#78350f}.matching-player-hintrow{display:flex;justify-content:flex-start;margin-bottom:calc(.4rem * var(--edp-scale, 1))}.player-choice-blank{display:inline-flex;align-items:center;justify-content:center;min-width:4ch;padding:calc(.1rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border:2px dashed var(--line-strong, #d6d3cc);border-radius:calc(.5rem * var(--edp-scale, 1));color:var(--ink-faint, #8d93a0);background:transparent;transition:border-color .15s,background .15s,transform .15s,color .15s;vertical-align:middle}.player-choice-blank--target{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-choice-blank--over{border-style:solid;border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1);transform:scale(1.05)}.player-choice-blank--filled{border-style:solid;border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);cursor:pointer}.player-choice-blank--correct,.player-choice-blank--partial{border-style:solid;border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-choice-blank--incorrect{border-style:solid;border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-choice-blank__clear{margin-inline-start:calc(.25rem * var(--edp-scale, 1));opacity:0;font-size:calc(.75rem * var(--edp-scale, 1));line-height:1;transition:opacity .12s}.player-choice-blank--filled:hover .player-choice-blank__clear{opacity:.6}.player-word-bank{margin:calc(1rem * var(--edp-scale, 1)) 0;position:relative;border:1px solid var(--line, #e7e5e0);border-radius:calc(14px * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1))}.player-word-bank__label{margin-bottom:calc(.5rem * var(--edp-scale, 1));font-size:.7em;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft, #565b66);user-select:none}.player-word-bank__items{display:flex;flex-wrap:wrap;gap:calc(.5rem * var(--edp-scale, 1))}.player-word-bank__items--grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(calc(10rem * var(--edp-scale, 1)),1fr));gap:calc(.5rem * var(--edp-scale, 1))}.player-bank-pill{display:inline-block;padding:calc(.35rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--card, #ffffff);color:var(--ink, #1d2025);user-select:none;-webkit-touch-callout:none;touch-action:manipulation;cursor:grab;transition:border-color .15s,background .15s,box-shadow .15s}.player-bank-pill:hover{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-bank-pill--dragging{opacity:.5;cursor:grabbing;box-shadow:0 8px 24px #1d20252e}.player-bank-pill--hinted{position:relative}.player-tap-hint{position:absolute;left:calc(50% - 10px * var(--edp-scale, 1));top:50%;width:calc(30px * var(--edp-scale, 1));height:calc(30px * var(--edp-scale, 1));z-index:2;pointer-events:none;color:var(--ink, #1d2025)}.player-tap-hint__hand{display:block;width:100%;height:100%;opacity:.92;filter:drop-shadow(0 2px 3px rgba(29,32,37,.25));transform-origin:33% 8%;animation:edp-tap-hand 1.8s ease-in-out infinite}.player-tap-hint__ripple{position:absolute;left:calc(10px * var(--edp-scale, 1) - 11px);top:-11px;width:22px;height:22px;border-radius:999px;border:2px solid var(--ink, #1d2025);opacity:0;animation:edp-tap-ripple 1.8s ease-out infinite}@keyframes edp-tap-hand{0%,to{transform:translateY(12px)}30%{transform:translateY(0) scale(1)}38%{transform:translateY(1px) scale(.88)}48%{transform:translateY(0) scale(1)}75%{transform:translateY(12px)}}@keyframes edp-tap-ripple{0%,34%{opacity:0;transform:scale(.4)}40%{opacity:.45;transform:scale(.6)}70%{opacity:0;transform:scale(1.5)}to{opacity:0}}.player-tap-hint--still .player-tap-hint__hand,.player-tap-hint--still .player-tap-hint__ripple{animation:none}@media(prefers-reduced-motion:reduce){.player-tap-hint__hand,.player-tap-hint__ripple{animation:none}}.exercise-runtime{font-family:var(--brand-font, "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif);font-size:calc(1.25rem * var(--edp-scale, 1));line-height:1.6;color:#1f2937}.exercise-runtime input,.exercise-runtime textarea{font-family:inherit}@media(min-width:640px){.exercise-runtime{font-size:calc(1.5rem * var(--edp-scale, 1))}}@media(min-width:768px){.exercise-runtime{font-size:calc(1.5rem * var(--edp-scale, 1))}}@media(min-width:1024px){.exercise-runtime{font-size:calc(2.25rem * var(--edp-scale, 1))}}@media(min-width:1280px){.exercise-runtime{font-size:calc(2.25rem * var(--edp-scale, 1))}}.exercise-runtime :lang(ar),.exercise-runtime [lang=ar],.exercise-runtime [dir=rtl]{direction:rtl;font-family:Arial,Scheherazade New,Amiri,sans-serif;text-align:right}.exercise-runtime p{margin:.5em 0;min-height:1.5em}.exercise-runtime p:empty:after{content:"\\a0";display:inline-block;min-height:1em}.exercise-runtime strong{font-weight:600;color:inherit}.exercise-runtime em{font-style:italic}.exercise-runtime ul,.exercise-runtime ol{list-style:revert;margin-left:calc(1.25rem * var(--edp-scale, 1));padding-left:0}.exercise-runtime img{max-width:100%;height:auto;vertical-align:middle;display:inline-block;margin:0 calc(4px * var(--edp-scale, 1))}.exercise-runtime .inline-math{display:inline-block;vertical-align:middle;margin:0 calc(2px * var(--edp-scale, 1))}.exercise-runtime .math-formula{display:flex;justify-content:center;margin:1em 0}.choice-set-player{margin:calc(1rem * var(--edp-scale, 1)) 0}.choice-set-player__prompt{font-weight:600;margin-bottom:calc(.75rem * var(--edp-scale, 1));color:#374151}.choice-set-player__prompt-hint{margin-left:calc(.5rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));opacity:.7;font-weight:400}.choice-set-player__choices{display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-scale, 1))}.choice-set-player__choices--grid{display:grid;gap:calc(.75rem * var(--edp-scale, 1));grid-template-columns:1fr}@media(min-width:640px){.choice-set-player__choices--grid{grid-template-columns:repeat(2,1fr)}}.choice-set-player--inline{display:inline-flex;align-items:center;gap:calc(.5rem * var(--edp-scale, 1));flex-wrap:wrap}.choice-set-player--inline .player-choice{width:auto;padding:calc(.5rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1))}.player-choice:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.player-blank-input:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}@media(prefers-contrast:high){.player-choice{border-width:3px}.player-choice--correct{border-color:#15803d}.player-choice--incorrect{border-color:#991b1b}}@media(prefers-reduced-motion:reduce){.animate-shake,.animate-hop,.animate-wobble{animation:none}.player-choice{transition:none}}@media print{.exercise-runtime{font-size:12pt;color:#000}.player-choice{border:1px solid black;background-color:#fff;page-break-inside:avoid}.player-choice--correct:after{content:" \\2713";font-weight:700}.player-choice--incorrect:after{content:" \\2717";font-weight:700}}.matching-player{margin:calc(1rem * var(--edp-scale, 1)) 0}.matching-player-feedback{display:flex;align-items:center;gap:calc(.45rem * var(--edp-scale, 1));margin-top:calc(.6rem * var(--edp-scale, 1));padding:calc(.55rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));font-size:calc(.85rem * var(--edp-scale, 1));font-weight:600}.matching-player-feedback--correct{color:var(--ok, #1f8a4c);border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.matching-player-feedback--partial{color:var(--almost-ink, #8a5a08);border-color:var(--almost, #c8810e);background:var(--almost-soft, #fbf1dc)}.matching-player-feedback--incorrect{color:var(--pen, #d23b2b);border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.matching-player-score{margin-inline-start:auto;font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));line-height:1}.matching-player__instruction{display:none}.matching-player__arena{position:relative;display:flex;flex-direction:column;gap:calc(.5rem * var(--edp-scale, 1))}.matching-player__arena--dragging{user-select:none;touch-action:none}.matching-player__svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:1}.matching-player__columns{display:grid;grid-template-columns:1fr 1fr;gap:calc(5rem * var(--edp-scale, 1));align-items:start;position:relative}.matching-player__column{display:flex;flex-direction:column;gap:calc(.5rem * var(--edp-scale, 1))}.matching-player__item{display:flex;align-items:center;flex-wrap:wrap;gap:calc(.5rem * var(--edp-scale, 1));width:100%;padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1));border:2px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--card, #ffffff);text-align:left;transition:border-color .15s,background .15s,box-shadow .15s,transform .1s;font-size:inherit;font-family:inherit;color:var(--ink, #1d2025);min-height:calc(52px * var(--edp-scale, 1));user-select:none;-webkit-tap-highlight-color:transparent}.matching-player__item:not(.matching-player__item--disabled){cursor:grab}.matching-player__item:not(.matching-player__item--disabled):active{cursor:grabbing}.matching-player__item:hover:not(.matching-player__item--disabled){border-color:var(--line-strong, #d6d3cc);background:var(--ui-muted, #f5f4f1)}.matching-player__item--selected{border-color:var(--ink, #1d2025)!important;background:var(--ui-muted, #f5f4f1)!important;box-shadow:0 0 0 3px #1d20251f;transform:scale(1.02)}.matching-player__item--available{border-color:var(--ink-faint, #8d93a0);border-style:dashed}.matching-player__item--available:hover{border-color:var(--ink, #1d2025);border-style:solid;background:var(--ui-muted, #f5f4f1)}.matching-player__item--matched{border-width:2px;border-color:var(--ink, #1d2025)}.matching-player__item--matched:hover:not(.matching-player__item--disabled){background:var(--ui-muted, #f5f4f1)}.matching-player__item--correct,.matching-player__item--correct:hover{border-color:var(--ok, #1f8a4c)!important;background:var(--ok-soft, #ecf8f0)!important}.matching-player__item--incorrect,.matching-player__item--incorrect:hover{border-color:var(--pen, #d23b2b)!important;background:var(--pen-soft, #fdeeec)!important}.matching-player__item--disabled{cursor:default;pointer-events:none}.matching-player__item-text{flex:1;min-width:0;line-height:1.4}.matching-player__item-text p{margin:0}.matching-player__pair-num{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:calc(22px * var(--edp-scale, 1));height:calc(22px * var(--edp-scale, 1));border-radius:50%;font-size:calc(.7rem * var(--edp-scale, 1));font-weight:700;line-height:1;background:var(--ink, #1d2025);color:#fff}.matching-player__item--correct .matching-player__pair-num{background:var(--ok, #1f8a4c)}.matching-player__item--incorrect .matching-player__pair-num{background:var(--pen, #d23b2b)}.matching-player__connector{flex-shrink:0;color:var(--ink-faint, #8d93a0);display:flex;align-items:center;transition:color .2s,transform .2s;border-radius:50%}.matching-player__item:hover .matching-player__connector{color:var(--ink, #1d2025);transform:scale(1.25)}.matching-player__connector--left{order:10;margin-left:calc(6px * var(--edp-scale, 1))}.matching-player__connector--right{order:-1;margin-right:calc(6px * var(--edp-scale, 1))}.matching-player__connector svg{width:calc(18px * var(--edp-scale, 1));height:calc(18px * var(--edp-scale, 1))}.matching-player__correct-hint{width:100%;order:20;font-weight:700;color:var(--ok, #1f8a4c);font-size:.82em;line-height:1.4;padding-top:.1em;word-break:break-word}.matching-player__correct-hint p{display:inline;margin:0}.matching-player__item:focus-visible{outline:3px solid var(--ink, #1d2025);outline-offset:2px}.blank-correct-hint{display:inline;font-weight:700;color:var(--ok, #1f8a4c);font-size:.875em;margin-left:.3em;word-break:break-word}@keyframes matching-pulse{0%{opacity:.5}to{opacity:1}}@media(prefers-reduced-motion:reduce){.matching-player__item{transition:none}}@media(max-width:600px){:where(.matching-player:not(.matching-player--box)) .matching-player__columns{gap:calc(1rem * var(--edp-scale, 1))}:where(.matching-player:not(.matching-player--box)) .matching-player__item{padding:calc(.5rem * var(--edp-scale, 1)) calc(.6rem * var(--edp-scale, 1));min-height:calc(44px * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));gap:calc(.35rem * var(--edp-scale, 1))}.matching-player__item:not(.matching-player__item--disabled){cursor:pointer}.matching-player__item:not(.matching-player__item--disabled):active{cursor:pointer}:where(.matching-player:not(.matching-player--box)) .matching-player__connector svg{width:calc(15px * var(--edp-scale, 1));height:calc(15px * var(--edp-scale, 1))}}.matching-player--box{container-type:inline-size}@container (max-width: 33.3em){.matching-player--box .matching-player__columns{gap:calc(1rem * var(--edp-scale, 1))}.matching-player--box .matching-player__item{padding:calc(.5rem * var(--edp-scale, 1)) calc(.6rem * var(--edp-scale, 1));min-height:calc(44px * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));gap:calc(.35rem * var(--edp-scale, 1))}.matching-player--box .matching-player__connector svg{width:calc(15px * var(--edp-scale, 1));height:calc(15px * var(--edp-scale, 1))}}.math-response-player{margin:calc(.5rem * var(--edp-scale, 1)) 0}.player-math-field{border:2px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));padding:calc(.375rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));background:var(--card, #ffffff);transition:border-color .2s ease,background .2s ease}.player-math-field:focus-within{border-color:var(--ink, #1d2025)}.player-math-field--readonly{background:var(--ui-muted, #f5f4f1)}.player-math-field__input{width:100%;min-height:calc(2.5rem * var(--edp-scale, 1));font-size:calc(1.1rem * var(--edp-scale, 1));outline:none;--primary: var(--ink, #1d2025);--caret-color: var(--ink, #1d2025);--selection-background-color: var(--ink-soft, #565b66);--contains-highlight-background-color: var(--ui-muted, #f5f4f1)}.player-math-field__input::part(virtual-keyboard-toggle),.player-math-field__input::part(menu-toggle){color:var(--ink-faint, #8d93a0)}.player-math-field__fallback{width:100%;border:none;outline:none;font-size:calc(1rem * var(--edp-scale, 1));font-family:monospace;background:transparent;color:var(--ink, #1d2025)}.player-math-field--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-math-field--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-math-field--validating{border-color:var(--ink-faint, #8d93a0)}.player-math-feedback{margin-top:calc(.4rem * var(--edp-scale, 1));font-size:calc(.8rem * var(--edp-scale, 1));font-weight:600;display:flex;align-items:center;gap:calc(.4rem * var(--edp-scale, 1))}.player-math-feedback--correct{color:var(--ok, #1f8a4c)}.player-math-feedback--incorrect{color:var(--pen, #d23b2b)}.player-math-feedback--validating{color:var(--ink-soft, #565b66)}.player-math-score{margin-inline-start:auto;font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));line-height:1;color:var(--ok, #1f8a4c)}.player-math-spinner{display:inline-block;width:calc(.9rem * var(--edp-scale, 1));height:calc(.9rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:50%;animation:player-math-spin .7s linear infinite}@keyframes player-math-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.player-math-spinner{animation:none}}.player-ai{margin:calc(1rem * var(--edp-scale, 1)) 0;padding:calc(.5rem * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-radius:calc(.875rem * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1)}.player-ai-counts{display:flex;justify-content:flex-end;gap:calc(.5rem * var(--edp-scale, 1))}.player-ai-count{font-size:calc(.75rem * var(--edp-scale, 1));font-weight:600;padding:calc(.1rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border-radius:999px;background:var(--card, #ffffff);border:1px solid var(--line, #e7e5e0);color:var(--ink-soft, #565b66)}.player-ai-count--over{color:var(--pen, #d23b2b);border-color:var(--pen, #d23b2b)}.player-ai-count--min{color:var(--ink-faint, #8d93a0)}.player-ai-input{width:100%;box-sizing:border-box;padding:calc(.5rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));font-size:calc(1rem * var(--edp-scale, 1));border:1px solid var(--line-strong, #d6d3cc);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--card, #ffffff);color:var(--ink, #1d2025);outline:none;transition:border-color .2s ease,background .2s ease}.player-ai-input::placeholder{color:var(--ink-faint, #8d93a0)}.player-ai-input:focus{border-color:var(--ink, #1d2025)}.player-ai-input--multiline{min-height:calc(120px * var(--edp-scale, 1));resize:vertical}.player-ai-input:disabled{cursor:default}.player-ai-input--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-ai-input--partial{border-color:var(--almost, #c8810e);border-style:dashed;background:var(--almost-soft, #fbf1dc)}.player-ai-input--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-ai-feedback{display:flex;flex-direction:column;gap:calc(.25rem * var(--edp-scale, 1));padding:calc(.75rem * var(--edp-scale, 1));border-radius:calc(.5rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);background:var(--card, #ffffff);color:var(--ink, #1d2025)}.player-ai-feedback--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-ai-feedback--partial{border-color:var(--almost, #c8810e);background:var(--almost-soft, #fbf1dc);color:var(--almost-ink, #8a5a08)}.player-ai-feedback--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-ai-message{margin:0}.player-ai-score-row{display:flex;justify-content:flex-end}.player-ai-score{font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));font-weight:600;line-height:1;padding:0 calc(.35rem * var(--edp-scale, 1));color:inherit}.player-ai-validating{display:flex;align-items:center;gap:calc(.5rem * var(--edp-scale, 1));padding:calc(.25rem * var(--edp-scale, 1)) 0;color:var(--ink-soft, #565b66)}.player-ai-spinner{display:inline-block;width:calc(.9rem * var(--edp-scale, 1));height:calc(.9rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:999px;animation:ai-answer-spin .7s linear infinite}@keyframes ai-answer-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.player-ai-spinner{animation:none}}.player-or-field--pre{border-color:var(--line-strong, #d6d3cc)!important}.player-or-field--correct{border-color:var(--ok, #1f8a4c)!important;background:var(--ok-soft, #ecf8f0)!important}.player-or-field--partial,.player-or-field--review{border-color:var(--almost, #c8810e)!important;background:var(--almost-soft, #fbf1dc)!important}.player-or-field--review{border-style:dashed!important}.player-or-field--incorrect{border-color:var(--pen, #d23b2b)!important;background:var(--pen-soft, #fdeeec)!important}.edp-scaled .text-xs{font-size:calc(.75rem * var(--edp-scale, 1));line-height:calc(1 / .75)}.edp-scaled .text-sm{font-size:calc(.875rem * var(--edp-scale, 1));line-height:calc(1.25 / .875)}.edp-scaled .text-base{font-size:calc(1rem * var(--edp-scale, 1));line-height:1.5}.edp-scaled .text-lg{font-size:calc(1.125rem * var(--edp-scale, 1));line-height:calc(1.75 / 1.125)}.edp-scaled .text-\\[10px\\]{font-size:calc(10px * var(--edp-scale, 1))}.edp-scaled .prose-sm{font-size:calc(.875rem * var(--edp-scale, 1))}.edp-scaled .p-2{padding:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .p-3{padding:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .p-4{padding:calc(1rem * var(--edp-scale, 1))}.edp-scaled .p-6{padding:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .pb-1{padding-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .pt-1\\.5{padding-top:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .px-1\\.5{padding-left:calc(.375rem * var(--edp-scale, 1));padding-right:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .px-2{padding-left:calc(.5rem * var(--edp-scale, 1));padding-right:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .px-3{padding-left:calc(.75rem * var(--edp-scale, 1));padding-right:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .px-4{padding-left:calc(1rem * var(--edp-scale, 1));padding-right:calc(1rem * var(--edp-scale, 1))}.edp-scaled .px-5{padding-left:calc(1.25rem * var(--edp-scale, 1));padding-right:calc(1.25rem * var(--edp-scale, 1))}.edp-scaled .px-6{padding-left:calc(1.5rem * var(--edp-scale, 1));padding-right:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .py-0\\.5{padding-top:calc(.125rem * var(--edp-scale, 1));padding-bottom:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .py-1{padding-top:calc(.25rem * var(--edp-scale, 1));padding-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .py-1\\.5{padding-top:calc(.375rem * var(--edp-scale, 1));padding-bottom:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .py-2{padding-top:calc(.5rem * var(--edp-scale, 1));padding-bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .py-3{padding-top:calc(.75rem * var(--edp-scale, 1));padding-bottom:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .mb-1{margin-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .mb-2{margin-bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .ml-1{margin-left:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .ml-2{margin-left:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .mr-2{margin-right:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .mt-0\\.5{margin-top:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .mt-1{margin-top:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .mt-1\\.5{margin-top:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .mt-3{margin-top:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .mx-1{margin-left:calc(.25rem * var(--edp-scale, 1));margin-right:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .my-3{margin-top:calc(.75rem * var(--edp-scale, 1));margin-bottom:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .my-4{margin-top:calc(1rem * var(--edp-scale, 1));margin-bottom:calc(1rem * var(--edp-scale, 1))}.edp-scaled .gap-1{gap:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .gap-1\\.5{gap:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .gap-2{gap:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .gap-3{gap:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .gap-x-1{column-gap:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .gap-y-0\\.5{row-gap:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .w-6{width:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .w-16{width:calc(4rem * var(--edp-scale, 1))}.edp-scaled .h-6{height:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .h-8{height:calc(2rem * var(--edp-scale, 1))}.edp-scaled .h-16{height:calc(4rem * var(--edp-scale, 1))}.edp-scaled .max-h-48{max-height:calc(12rem * var(--edp-scale, 1))}.edp-scaled .right-1{right:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .right-3{right:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .bottom-2{bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .max-w-\\[160px\\]{max-width:calc(160px * var(--edp-scale, 1))}.edp-scaled .max-w-\\[200px\\]{max-width:calc(200px * var(--edp-scale, 1))}.edp-scaled .max-w-\\[240px\\]{max-width:calc(240px * var(--edp-scale, 1))}.edp-scaled .min-h-\\[100px\\]{min-height:calc(100px * var(--edp-scale, 1))}.edp-scaled .min-h-\\[120px\\]{min-height:calc(120px * var(--edp-scale, 1))}.edp-scaled .\\[\\&_\\.ProseMirror\\]\\:min-h-\\[80px\\] .ProseMirror{min-height:calc(80px * var(--edp-scale, 1))}.math-inline,.math-block,.math-response-player,.katex,.katex-display{direction:ltr;unicode-bidi:isolate}.exercise-shared-context{font-size:calc(1.125rem * var(--edp-scale, 1));margin-bottom:calc(1rem * var(--edp-scale, 1))}.exercise-reference-cue{display:flex;flex-wrap:wrap;align-items:baseline;gap:calc(.25rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));margin:0 0 calc(1rem * var(--edp-scale, 1));padding:calc(.625rem * var(--edp-scale, 1)) calc(.875rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-inline-start:3px solid var(--ink-soft, #565b66);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);color:var(--ink-soft, #565b66);font-size:calc(1rem * var(--edp-scale, 1));line-height:1.5}.exercise-reference-cue__link{font:inherit;font-weight:600;color:var(--ink, #1d2025);background:none;border:0;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.exercise-reference-cue__link:hover{text-decoration-thickness:2px}.exercise-reference-cue__link:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px;border-radius:2px}.exercise-reference-cue__arrow{display:inline-block;margin-inline-start:.25em}.exercise-reference-cue__arrow:dir(rtl){transform:scaleX(-1)}
64
- `);import"katex/dist/katex.min.css";cr(`.edpire-annex-layout{display:flex;flex:1;min-width:0;height:100%;overflow:hidden;position:relative}.edpire-annex-main{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column}.edpire-annex-panel{width:38%;min-width:calc(280px * var(--edp-scale, 1));max-width:calc(480px * var(--edp-scale, 1));flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid #e5e7eb;background:#fff;overflow:hidden}.edpire-annex-panel__header{flex-shrink:0;padding:calc(12px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));border-bottom:1px solid #f3f4f6;background:#f9fafb}.edpire-annex-panel__header-label{font-size:calc(11px * var(--edp-scale, 1));font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#6b7280}.edpire-annex-panel__scroll{flex:1;overflow-y:auto;padding:calc(24px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(32px * var(--edp-scale, 1))}.edpire-annex-tab,.edpire-annex-drawer,.edpire-annex-backdrop{display:none}@media(max-width:1023px){.edpire-annex-panel{display:none}.edpire-annex-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(8px * var(--edp-scale, 1));position:fixed;left:0;top:50%;transform:translateY(-50%);z-index:40;background:var(--edpire-annex-tab-bg, #2563eb);color:var(--edpire-annex-tab-color, #ffffff);border:none;border-radius:0 calc(10px * var(--edp-scale, 1)) calc(10px * var(--edp-scale, 1)) 0;padding:calc(18px * var(--edp-scale, 1)) calc(10px * var(--edp-scale, 1));cursor:pointer;box-shadow:2px 2px 16px #0000002e;transition:filter .15s}.edpire-annex-tab:hover{filter:brightness(.88)}.edpire-annex-tab__label{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:calc(11px * var(--edp-scale, 1));font-weight:700;letter-spacing:.07em;text-transform:uppercase;white-space:nowrap}.edpire-annex-drawer{display:flex;flex-direction:column;position:fixed;left:0;top:0;bottom:0;width:min(84vw,calc(440px * var(--edp-scale, 1)));background:#fff;z-index:50;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1);box-shadow:4px 0 32px #00000021;overflow:hidden}.edpire-annex-drawer--open{transform:translate(0)}.edpire-annex-drawer__header{display:flex;align-items:center;justify-content:space-between;padding:calc(16px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));border-bottom:1px solid #f3f4f6;background:#f9fafb;flex-shrink:0}.edpire-annex-drawer__label{font-size:calc(13px * var(--edp-scale, 1));font-weight:700;color:#111827}.edpire-annex-drawer__close{display:flex;align-items:center;justify-content:center;width:calc(28px * var(--edp-scale, 1));height:calc(28px * var(--edp-scale, 1));background:none;border:none;cursor:pointer;font-size:calc(20px * var(--edp-scale, 1));line-height:1;color:#9ca3af;border-radius:calc(6px * var(--edp-scale, 1));transition:color .15s,background .15s}.edpire-annex-drawer__close:hover{color:#111827;background:#f3f4f6}.edpire-annex-drawer__scroll{flex:1;overflow-y:auto;padding:calc(24px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(32px * var(--edp-scale, 1))}.edpire-annex-backdrop{display:block;position:fixed;inset:0;background:#00000061;z-index:45;cursor:pointer}}
65
- `);cr(`/*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){.edpire-scope *,.edpire-scope :before,.edpire-scope :after,.edpire-scope ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{.edpire-scope{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-900:oklch(41.4% .112 45.904);--color-blue-600:oklch(54.6% .245 262.881);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}.edpire-scope .\\@container{container-type:inline-size}.edpire-scope .pointer-events-none{pointer-events:none}.edpire-scope .collapse{visibility:collapse}.edpire-scope .invisible{visibility:hidden}.edpire-scope .visible{visibility:visible}.edpire-scope .absolute{position:absolute}.edpire-scope .fixed{position:fixed}.edpire-scope .relative{position:relative}.edpire-scope .static{position:static}.edpire-scope .sticky{position:sticky}.edpire-scope .inset-0{inset:calc(var(--spacing) * 0)}.edpire-scope .start{inset-inline-start:var(--spacing)}.edpire-scope .start-0{inset-inline-start:calc(var(--spacing) * 0)}.edpire-scope .start-2{inset-inline-start:calc(var(--spacing) * 2)}.edpire-scope .end{inset-inline-end:var(--spacing)}.edpire-scope .end-2{inset-inline-end:calc(var(--spacing) * 2)}.edpire-scope .top-0{top:calc(var(--spacing) * 0)}.edpire-scope .top-1\\/2{top:50%}.edpire-scope .top-2{top:calc(var(--spacing) * 2)}.edpire-scope .top-4{top:calc(var(--spacing) * 4)}.edpire-scope .top-\\[calc\\(var\\(--edp-bar\\)\\+1rem\\)\\]{top:calc(var(--edp-bar) + 1rem)}.edpire-scope .right-1{right:calc(var(--spacing) * 1)}.edpire-scope .right-3{right:calc(var(--spacing) * 3)}.edpire-scope .bottom-2{bottom:calc(var(--spacing) * 2)}.edpire-scope .isolate{isolation:isolate}.edpire-scope .z-10{z-index:10}.edpire-scope .z-20{z-index:20}.edpire-scope .z-30{z-index:30}.edpire-scope .z-40{z-index:40}.edpire-scope .z-50{z-index:50}.edpire-scope .z-\\[60\\]{z-index:60}.edpire-scope .container{width:100%}@media(min-width:40rem){.edpire-scope .container{max-width:40rem}}@media(min-width:48rem){.edpire-scope .container{max-width:48rem}}@media(min-width:64rem){.edpire-scope .container{max-width:64rem}}@media(min-width:80rem){.edpire-scope .container{max-width:80rem}}@media(min-width:96rem){.edpire-scope .container{max-width:96rem}}.edpire-scope .-mx-3{margin-inline:calc(var(--spacing) * -3)}.edpire-scope .mx-1{margin-inline:calc(var(--spacing) * 1)}.edpire-scope .mx-4{margin-inline:calc(var(--spacing) * 4)}.edpire-scope .mx-auto{margin-inline:auto}.edpire-scope .my-1{margin-block:calc(var(--spacing) * 1)}.edpire-scope .my-3{margin-block:calc(var(--spacing) * 3)}.edpire-scope .my-4{margin-block:calc(var(--spacing) * 4)}.edpire-scope .ms-2{margin-inline-start:calc(var(--spacing) * 2)}.edpire-scope .ms-auto{margin-inline-start:auto}.edpire-scope .mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.edpire-scope .mt-1{margin-top:calc(var(--spacing) * 1)}.edpire-scope .mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.edpire-scope .mt-2{margin-top:calc(var(--spacing) * 2)}.edpire-scope .mt-3{margin-top:calc(var(--spacing) * 3)}.edpire-scope .mt-px{margin-top:1px}.edpire-scope .mr-2{margin-right:calc(var(--spacing) * 2)}.edpire-scope .mb-1{margin-bottom:calc(var(--spacing) * 1)}.edpire-scope .mb-2{margin-bottom:calc(var(--spacing) * 2)}.edpire-scope .mb-3{margin-bottom:calc(var(--spacing) * 3)}.edpire-scope .mb-5{margin-bottom:calc(var(--spacing) * 5)}.edpire-scope .ml-1{margin-left:calc(var(--spacing) * 1)}.edpire-scope .ml-2{margin-left:calc(var(--spacing) * 2)}.edpire-scope .ml-auto{margin-left:auto}.edpire-scope .block{display:block}.edpire-scope .contents{display:contents}.edpire-scope .flex{display:flex}.edpire-scope .grid{display:grid}.edpire-scope .hidden{display:none}.edpire-scope .inline{display:inline}.edpire-scope .inline-block{display:inline-block}.edpire-scope .inline-flex{display:inline-flex}.edpire-scope .table{display:table}.edpire-scope .h-2{height:calc(var(--spacing) * 2)}.edpire-scope .h-3{height:calc(var(--spacing) * 3)}.edpire-scope .h-4{height:calc(var(--spacing) * 4)}.edpire-scope .h-5{height:calc(var(--spacing) * 5)}.edpire-scope .h-6{height:calc(var(--spacing) * 6)}.edpire-scope .h-7{height:calc(var(--spacing) * 7)}.edpire-scope .h-8{height:calc(var(--spacing) * 8)}.edpire-scope .h-9{height:calc(var(--spacing) * 9)}.edpire-scope .h-11{height:calc(var(--spacing) * 11)}.edpire-scope .h-16{height:calc(var(--spacing) * 16)}.edpire-scope .h-24{height:calc(var(--spacing) * 24)}.edpire-scope .h-\\[600px\\]{height:600px}.edpire-scope .h-dvh{height:100dvh}.edpire-scope .h-full{height:100%}.edpire-scope .h-screen{height:100vh}.edpire-scope .max-h-48{max-height:calc(var(--spacing) * 48)}.edpire-scope .max-h-\\[calc\\(100dvh-8rem\\)\\]{max-height:calc(100dvh - 8rem)}.edpire-scope .max-h-\\[calc\\(100dvh-var\\(--edp-bar\\)-2rem\\)\\]{max-height:calc(100dvh - var(--edp-bar) - 2rem)}.edpire-scope .max-h-\\[calc\\(100svh-6rem\\)\\]{max-height:calc(100svh - 6rem)}.edpire-scope .min-h-0{min-height:calc(var(--spacing) * 0)}.edpire-scope .min-h-\\[72px\\]{min-height:72px}.edpire-scope .min-h-\\[100px\\]{min-height:100px}.edpire-scope .min-h-\\[120px\\]{min-height:120px}.edpire-scope .min-h-\\[200px\\]{min-height:200px}.edpire-scope .min-h-dvh{min-height:100dvh}.edpire-scope .w-3{width:calc(var(--spacing) * 3)}.edpire-scope .w-4{width:calc(var(--spacing) * 4)}.edpire-scope .w-5{width:calc(var(--spacing) * 5)}.edpire-scope .w-6{width:calc(var(--spacing) * 6)}.edpire-scope .w-7{width:calc(var(--spacing) * 7)}.edpire-scope .w-9{width:calc(var(--spacing) * 9)}.edpire-scope .w-11{width:calc(var(--spacing) * 11)}.edpire-scope .w-12{width:calc(var(--spacing) * 12)}.edpire-scope .w-16{width:calc(var(--spacing) * 16)}.edpire-scope .w-24{width:calc(var(--spacing) * 24)}.edpire-scope .w-\\[88\\%\\]{width:88%}.edpire-scope .w-full{width:100%}.edpire-scope .w-px{width:1px}.edpire-scope .max-w-3xl{max-width:var(--container-3xl)}.edpire-scope .max-w-\\[32ch\\]{max-width:32ch}.edpire-scope .max-w-\\[160px\\]{max-width:160px}.edpire-scope .max-w-\\[200px\\]{max-width:200px}.edpire-scope .max-w-\\[240px\\]{max-width:240px}.edpire-scope .max-w-full{max-width:100%}.edpire-scope .max-w-none{max-width:none}.edpire-scope .max-w-sm{max-width:var(--container-sm)}.edpire-scope .max-w-xs{max-width:var(--container-xs)}.edpire-scope .min-w-0{min-width:calc(var(--spacing) * 0)}.edpire-scope .min-w-\\[80px\\]{min-width:80px}.edpire-scope .min-w-\\[140px\\]{min-width:140px}.edpire-scope .flex-1{flex:1}.edpire-scope .flex-none{flex:none}.edpire-scope .flex-shrink-0,.edpire-scope .shrink-0{flex-shrink:0}.edpire-scope .grow{flex-grow:1}.edpire-scope .-translate-x-\\[110\\%\\]{--tw-translate-x: -110% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.edpire-scope .animate-pulse{animation:var(--animate-pulse)}.edpire-scope .animate-spin{animation:var(--animate-spin)}.edpire-scope .cursor-default{cursor:default}.edpire-scope .cursor-pointer{cursor:pointer}.edpire-scope .resize{resize:both}.edpire-scope .flex-col{flex-direction:column}.edpire-scope .flex-wrap{flex-wrap:wrap}.edpire-scope .items-baseline{align-items:baseline}.edpire-scope .items-center{align-items:center}.edpire-scope .items-start{align-items:flex-start}.edpire-scope .justify-between{justify-content:space-between}.edpire-scope .justify-center{justify-content:center}.edpire-scope .justify-end{justify-content:flex-end}.edpire-scope .gap-0\\.5{gap:calc(var(--spacing) * .5)}.edpire-scope .gap-1{gap:calc(var(--spacing) * 1)}.edpire-scope .gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.edpire-scope .gap-2{gap:calc(var(--spacing) * 2)}.edpire-scope .gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.edpire-scope .gap-3{gap:calc(var(--spacing) * 3)}.edpire-scope .gap-4{gap:calc(var(--spacing) * 4)}.edpire-scope .gap-5{gap:calc(var(--spacing) * 5)}.edpire-scope .gap-6{gap:calc(var(--spacing) * 6)}.edpire-scope :where(.edpire-scope .space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope :where(.edpire-scope .space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope :where(.edpire-scope .space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope .gap-x-1{column-gap:calc(var(--spacing) * 1)}.edpire-scope .gap-x-4{column-gap:calc(var(--spacing) * 4)}.edpire-scope .gap-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.edpire-scope .gap-y-2{row-gap:calc(var(--spacing) * 2)}.edpire-scope .self-start{align-self:flex-start}.edpire-scope .self-stretch{align-self:stretch}.edpire-scope .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.edpire-scope .overflow-auto{overflow:auto}.edpire-scope .overflow-hidden{overflow:hidden}.edpire-scope .overflow-y-auto{overflow-y:auto}.edpire-scope .rounded{border-radius:.25rem}.edpire-scope .rounded-2xl{border-radius:var(--radius-2xl)}.edpire-scope .rounded-\\[10px\\]{border-radius:10px}.edpire-scope .rounded-\\[14px\\]{border-radius:14px}.edpire-scope .rounded-full{border-radius:3.40282e38px}.edpire-scope .rounded-lg{border-radius:var(--radius-lg)}.edpire-scope .rounded-md{border-radius:var(--radius-md)}.edpire-scope .rounded-sm{border-radius:var(--radius-sm)}.edpire-scope .rounded-xl{border-radius:var(--radius-xl)}.edpire-scope .rounded-e-lg{border-start-end-radius:var(--radius-lg);border-end-end-radius:var(--radius-lg)}.edpire-scope .rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.edpire-scope .border{border-style:var(--tw-border-style);border-width:1px}.edpire-scope .border-2{border-style:var(--tw-border-style);border-width:2px}.edpire-scope .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.edpire-scope .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.edpire-scope .border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.edpire-scope .border-dashed{--tw-border-style:dashed;border-style:dashed}.edpire-scope .border-\\[\\#c5e8d1\\]{border-color:#c5e8d1}.edpire-scope .border-\\[\\#d6d3cc\\]{border-color:#d6d3cc}.edpire-scope .border-\\[\\#e7e5e0\\]{border-color:#e7e5e0}.edpire-scope .border-\\[\\#f2e2bf\\]{border-color:#f2e2bf}.edpire-scope .border-\\[\\#f6cfc9\\]{border-color:#f6cfc9}.edpire-scope .border-amber-200{border-color:var(--color-amber-200)}.edpire-scope .border-gray-100{border-color:var(--color-gray-100)}.edpire-scope .border-gray-200{border-color:var(--color-gray-200)}.edpire-scope .border-gray-300{border-color:var(--color-gray-300)}.edpire-scope .bg-\\[\\#1d2025\\]{background-color:#1d2025}.edpire-scope .bg-\\[\\#e7e5e0\\]{background-color:#e7e5e0}.edpire-scope .bg-\\[\\#ecf8f0\\]{background-color:#ecf8f0}.edpire-scope .bg-\\[\\#f1efe9\\]{background-color:#f1efe9}.edpire-scope .bg-\\[\\#f2e2bf\\]{background-color:#f2e2bf}.edpire-scope .bg-\\[\\#f5f4f1\\]{background-color:#f5f4f1}.edpire-scope .bg-\\[\\#fbf1dc\\]{background-color:#fbf1dc}.edpire-scope .bg-\\[\\#fbfaf7\\]{background-color:#fbfaf7}.edpire-scope .bg-\\[\\#fdeeec\\]{background-color:#fdeeec}.edpire-scope .bg-amber-50{background-color:var(--color-amber-50)}.edpire-scope .bg-black{background-color:var(--color-black)}.edpire-scope .bg-black\\/25{background-color:#00000040}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-black\\/25{background-color:color-mix(in oklab,var(--color-black) 25%,transparent)}}.edpire-scope .bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-black\\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.edpire-scope .bg-gray-50{background-color:var(--color-gray-50)}.edpire-scope .bg-gray-100{background-color:var(--color-gray-100)}.edpire-scope .bg-gray-300{background-color:var(--color-gray-300)}.edpire-scope .bg-gray-900{background-color:var(--color-gray-900)}.edpire-scope .bg-red-950\\/80{background-color:#460809cc}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-red-950\\/80{background-color:color-mix(in oklab,var(--color-red-950) 80%,transparent)}}.edpire-scope .bg-white{background-color:var(--color-white)}.edpire-scope .bg-white\\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-white\\/60{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.edpire-scope .object-contain{object-fit:contain}.edpire-scope .object-cover{object-fit:cover}.edpire-scope .p-1{padding:calc(var(--spacing) * 1)}.edpire-scope .p-1\\.5{padding:calc(var(--spacing) * 1.5)}.edpire-scope .p-2{padding:calc(var(--spacing) * 2)}.edpire-scope .p-3{padding:calc(var(--spacing) * 3)}.edpire-scope .p-4{padding:calc(var(--spacing) * 4)}.edpire-scope .p-6{padding:calc(var(--spacing) * 6)}.edpire-scope .px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.edpire-scope .px-2{padding-inline:calc(var(--spacing) * 2)}.edpire-scope .px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.edpire-scope .px-3{padding-inline:calc(var(--spacing) * 3)}.edpire-scope .px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.edpire-scope .px-4{padding-inline:calc(var(--spacing) * 4)}.edpire-scope .px-5{padding-inline:calc(var(--spacing) * 5)}.edpire-scope .px-6{padding-inline:calc(var(--spacing) * 6)}.edpire-scope .px-10{padding-inline:calc(var(--spacing) * 10)}.edpire-scope .py-0\\.5{padding-block:calc(var(--spacing) * .5)}.edpire-scope .py-1{padding-block:calc(var(--spacing) * 1)}.edpire-scope .py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.edpire-scope .py-2{padding-block:calc(var(--spacing) * 2)}.edpire-scope .py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.edpire-scope .py-3{padding-block:calc(var(--spacing) * 3)}.edpire-scope .py-5{padding-block:calc(var(--spacing) * 5)}.edpire-scope .py-8{padding-block:calc(var(--spacing) * 8)}.edpire-scope .ps-2{padding-inline-start:calc(var(--spacing) * 2)}.edpire-scope .ps-\\[23px\\]{padding-inline-start:23px}.edpire-scope .pe-2\\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.edpire-scope .pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.edpire-scope .pt-2{padding-top:calc(var(--spacing) * 2)}.edpire-scope .pb-1{padding-bottom:calc(var(--spacing) * 1)}.edpire-scope .pb-5{padding-bottom:calc(var(--spacing) * 5)}.edpire-scope .pl-2{padding-left:calc(var(--spacing) * 2)}.edpire-scope .text-center{text-align:center}.edpire-scope .text-right{text-align:right}.edpire-scope .text-start{text-align:start}.edpire-scope .align-middle{vertical-align:middle}.edpire-scope .font-mono{font-family:var(--font-mono)}.edpire-scope .font-sans{font-family:var(--font-sans)}.edpire-scope .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.edpire-scope .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.edpire-scope .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.edpire-scope .text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.edpire-scope .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.edpire-scope .text-\\[1\\.6rem\\]{font-size:1.6rem}.edpire-scope .text-\\[10px\\]{font-size:10px}.edpire-scope .text-\\[11px\\]{font-size:11px}.edpire-scope .leading-none{--tw-leading:1;line-height:1}.edpire-scope .leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.edpire-scope .leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.edpire-scope .font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.edpire-scope .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.edpire-scope .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.edpire-scope .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.edpire-scope .tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.edpire-scope .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.edpire-scope .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.edpire-scope .tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.edpire-scope .break-words{overflow-wrap:break-word}.edpire-scope .whitespace-pre-wrap{white-space:pre-wrap}.edpire-scope .text-\\[\\#1d2025\\]{color:#1d2025}.edpire-scope .text-\\[\\#1f8a4c\\]{color:#1f8a4c}.edpire-scope .text-\\[\\#8a5a08\\]{color:#8a5a08}.edpire-scope .text-\\[\\#8d93a0\\]{color:#8d93a0}.edpire-scope .text-\\[\\#565b66\\]{color:#565b66}.edpire-scope .text-\\[\\#a32b1e\\]{color:#a32b1e}.edpire-scope .text-\\[\\#c8810e\\]{color:#c8810e}.edpire-scope .text-\\[\\#d23b2b\\]{color:#d23b2b}.edpire-scope .text-amber-900{color:var(--color-amber-900)}.edpire-scope .text-blue-600{color:var(--color-blue-600)}.edpire-scope .text-gray-400{color:var(--color-gray-400)}.edpire-scope .text-gray-500{color:var(--color-gray-500)}.edpire-scope .text-gray-600{color:var(--color-gray-600)}.edpire-scope .text-gray-700{color:var(--color-gray-700)}.edpire-scope .text-gray-800{color:var(--color-gray-800)}.edpire-scope .text-red-200{color:var(--color-red-200)}.edpire-scope .text-red-300{color:var(--color-red-300)}.edpire-scope .text-slate-500{color:var(--color-slate-500)}.edpire-scope .text-slate-800{color:var(--color-slate-800)}.edpire-scope .text-white{color:var(--color-white)}.edpire-scope .uppercase{text-transform:uppercase}.edpire-scope .italic{font-style:italic}.edpire-scope .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.edpire-scope .line-through{text-decoration-line:line-through}.edpire-scope .underline{text-decoration-line:underline}.edpire-scope .underline-offset-2{text-underline-offset:2px}.edpire-scope .underline-offset-4{text-underline-offset:4px}.edpire-scope .opacity-40{opacity:.4}.edpire-scope .opacity-60{opacity:.6}.edpire-scope .opacity-70{opacity:.7}.edpire-scope .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .outline{outline-style:var(--tw-outline-style);outline-width:1px}.edpire-scope .grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.edpire-scope .backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.edpire-scope .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .duration-300{--tw-duration:.3s;transition-duration:.3s}.edpire-scope .duration-700{--tw-duration:.7s;transition-duration:.7s}.edpire-scope .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.edpire-scope .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.edpire-scope .outline-none{--tw-outline-style:none;outline-style:none}.edpire-scope .select-none{-webkit-user-select:none;user-select:none}.edpire-scope .\\[--edp-bar\\:0px\\]{--edp-bar:0px}.edpire-scope :is(.edpire-scope .group-open\\:rotate-90):is(:where(.group):is([open],.edpire-scope :popover-open,.edpire-scope :open) *){rotate:90deg}@media(hover:hover){.edpire-scope :is(.edpire-scope .group-hover\\:text-\\[\\#1d2025\\]):is(:where(.group):hover *){color:#1d2025}.edpire-scope :is(.edpire-scope .group-hover\\:shadow-md):is(:where(.group):hover *){--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope :is(.edpire-scope .hover\\:border-\\[\\#8d93a0\\]):hover{border-color:#8d93a0}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#31353c\\]):hover{background-color:#31353c}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#e7e5e0\\]):hover{background-color:#e7e5e0}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#f1efe9\\]):hover{background-color:#f1efe9}.edpire-scope :is(.edpire-scope .hover\\:bg-gray-100):hover{background-color:var(--color-gray-100)}.edpire-scope :is(.edpire-scope .hover\\:bg-white):hover{background-color:var(--color-white)}.edpire-scope :is(.edpire-scope .hover\\:text-\\[\\#1d2025\\]):hover{color:#1d2025}.edpire-scope :is(.edpire-scope .hover\\:text-gray-700):hover{color:var(--color-gray-700)}.edpire-scope :is(.edpire-scope .hover\\:text-rose-500):hover{color:var(--color-rose-500)}.edpire-scope :is(.edpire-scope .hover\\:underline):hover{text-decoration-line:underline}}.edpire-scope :is(.edpire-scope .focus\\:outline-none):focus{--tw-outline-style:none;outline-style:none}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-2):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-\\[\\#8d93a0\\]):focus-visible{--tw-ring-color:#8d93a0}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-offset-2):focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.edpire-scope :is(.edpire-scope .focus-visible\\:outline-2):focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.edpire-scope :is(.edpire-scope .focus-visible\\:outline-\\[\\#1d2025\\]):focus-visible{outline-color:#1d2025}.edpire-scope :is(.edpire-scope .disabled\\:cursor-not-allowed):disabled{cursor:not-allowed}.edpire-scope :is(.edpire-scope .disabled\\:opacity-50):disabled{opacity:.5}.edpire-scope :is(.edpire-scope .data-\\[flash\\=true\\]\\:bg-\\[\\#fbf1dc\\])[data-flash=true]{background-color:#fbf1dc}.edpire-scope :is(.edpire-scope .data-\\[flash\\=true\\]\\:duration-150)[data-flash=true]{--tw-duration:.15s;transition-duration:.15s}@media(min-width:40rem){.edpire-scope .sm\\:block{display:block}.edpire-scope .sm\\:hidden{display:none}.edpire-scope .sm\\:inline{display:inline}.edpire-scope .sm\\:inline-flex{display:inline-flex}.edpire-scope .sm\\:flex-row{flex-direction:row}.edpire-scope .sm\\:flex-nowrap{flex-wrap:nowrap}.edpire-scope .sm\\:items-center{align-items:center}.edpire-scope .sm\\:gap-4{gap:calc(var(--spacing) * 4)}.edpire-scope .sm\\:px-4{padding-inline:calc(var(--spacing) * 4)}.edpire-scope .sm\\:px-6{padding-inline:calc(var(--spacing) * 6)}.edpire-scope .sm\\:py-4{padding-block:calc(var(--spacing) * 4)}.edpire-scope .sm\\:text-\\[2rem\\]{font-size:2rem}}@container (min-width:72rem){.edpire-scope .\\@6xl\\:flex{display:flex}.edpire-scope .\\@6xl\\:hidden{display:none}}.edpire-scope :is(.edpire-scope .rtl\\:translate-x-\\[110\\%\\]):where(:dir(rtl),.edpire-scope [dir=rtl],.edpire-scope [dir=rtl] *){--tw-translate-x:110%;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror\\]\\:min-h-\\[80px\\]) .ProseMirror{min-height:80px}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror\\]\\:outline-none) .ProseMirror{--tw-outline-style:none;outline-style:none}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:pointer-events-none) .ProseMirror p.is-editor-empty:first-child:before{pointer-events:none}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:float-left) .ProseMirror p.is-editor-empty:first-child:before{float:left}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:h-0) .ProseMirror p.is-editor-empty:first-child:before{height:calc(var(--spacing) * 0)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:text-gray-400) .ProseMirror p.is-editor-empty:first-child:before{color:var(--color-gray-400)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:content-\\[attr\\(data-placeholder\\)\\]) .ProseMirror p.is-editor-empty:first-child:before{--tw-content:attr(data-placeholder);content:var(--tw-content)}.edpire-scope :is(.edpire-scope .\\[\\&_\\[data-exercise-id\\]\\]\\:scroll-mt-\\[calc\\(var\\(--edp-bar\\)\\+0\\.75rem\\)\\]) [data-exercise-id],.edpire-scope :is(.edpire-scope .\\[\\&_\\[data-question-id\\]\\]\\:scroll-mt-\\[calc\\(var\\(--edp-bar\\)\\+0\\.75rem\\)\\]) [data-question-id]{scroll-margin-top:calc(var(--edp-bar) + .75rem)}@layer base{.edpire-scope *,.edpire-scope :after,.edpire-scope :before,.edpire-scope ::backdrop{border-color:var(--color-gray-200,currentColor)}.edpire-scope ::file-selector-button{border-color:var(--color-gray-200,currentColor)}}@supports not (height:100dvh){.edpire-scope .h-dvh{height:100vh}}.edpire-scope :where(span:has(>textarea.player-typed-blank)){line-height:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
66
- `);import{Fragment as bn,jsx as L,jsxs as W}from"react/jsx-runtime";var ll="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234f46e5'%3E%3Cpath d='M12 2L2 7v10l10 5 10-5V7L12 2zm0 2.18L19.5 8 12 11.82 4.5 8 12 4.18zM4 9.6l7 3.5v7.3L4 16.9V9.6zm9 10.8v-7.3l7-3.5v7.3L13 20.4z'/%3E%3C/svg%3E";function dl(e){for(let r of e.exercises)for(let t of r.questions)if((t.content.content??[]).some(a=>a.type==="aiAnswerInput"))return!0;return!1}function vo(e){let r=e;return typeof r.totalMaxScore=="number"?r.totalMaxScore:(r.answerKeys??[]).reduce((t,n)=>t+(n.scoring?.maxScore??0),0)}function xo(e){return e.questions.reduce((r,t)=>r+vo(t),0)}function Ve(e){return Number.isInteger(e)?String(e):parseFloat(e.toFixed(2)).toString()}var gn=5;function wo(e){return e==="full"?"#1f8a4c":e==="partial"?"#c8810e":"#d23b2b"}function pl({outcome:e}){let r=e==="full"?"M20 54 L41 75 L82 24":e==="none"?"M27 27 L73 73 M73 27 L27 73":"M14 58 C29 33 40 33 52 51 C64 69 74 69 88 42";return L("svg",{width:14,height:14,viewBox:"0 0 100 100",fill:"none",stroke:wo(e),strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:L("path",{d:r})})}function ml({score:e,weight:r,unit:t,t:n}){if(e){if(e.awaiting)return W("span",{className:"inline-flex items-center gap-1 rounded-lg border border-[#f2e2bf] bg-[#fbf1dc] px-2 py-0.5 text-xs font-semibold text-[#8a5a08]",children:[L(vr,{size:11}),n("pendingReview")]});let a=e.m>0&&e.s>=e.m?"full":e.s>0?"partial":"none";return W("span",{className:"inline-flex items-center gap-1.5 rounded-lg border border-[#e7e5e0] bg-[#f5f4f1] ps-2 pe-2.5 py-0.5",children:[L(pl,{outcome:a}),W("span",{className:"font-bold leading-none",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.05rem",color:wo(a)},children:[Ve(e.s)," / ",Ve(e.m)]})]})}return r>0?W("span",{className:"text-xs font-semibold tabular-nums text-[#8d93a0]",children:[Ve(r)," ",t(r)]}):null}function yo(e){let r=new Map;for(let t of e?.exerciseAnswers??[])for(let n of t.questionAnswers)r.set(n.questionId,n.answers);return r}function ul(e,r){return r.size===0?e:{exerciseAnswers:e.exerciseAnswers.map(t=>({...t,questionAnswers:t.questionAnswers.map(n=>n.answers.length===0&&r.has(n.questionId)?{...n,answers:r.get(n.questionId)}:n)}))}}function fl({timeLimitMinutes:e,startedAt:r,onExpire:t}){let n=e*6e4,a=new Date(r).getTime()+n,[s,o]=je(()=>Math.max(a-Date.now(),0)),i=Ir(t);i.current=t,kt(()=>{if(s<=0){i.current();return}let b=setInterval(()=>{let v=Math.max(a-Date.now(),0);o(v),v<=0&&(clearInterval(b),i.current())},1e3);return()=>clearInterval(b)},[a]);let c=s/n,l=c<.1?"bg-[#fdeeec] text-[#a32b1e] border-[#f6cfc9] animate-pulse":c<.25?"bg-[#fbf1dc] text-[#8a5a08] border-[#f2e2bf]":"bg-[#f5f4f1] text-[#565b66] border-[#e7e5e0]",d=Math.ceil(s/1e3),p=Math.floor(d/3600),m=Math.floor(d%3600/60),g=d%60,u=p>0?`${p}:${String(m).padStart(2,"0")}:${String(g).padStart(2,"0")}`:`${m}:${String(g).padStart(2,"0")}`;return W("span",{className:se("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-xs font-bold tabular-nums transition-colors",l),children:[L(vr,{size:12}),u]})}function Rt({assessment:e,meta:r,locale:t="en",branding:n,timeLimitMinutes:a,startedAt:s,initialAnswers:o,onAnswersChange:i,saveState:c,resumed:l=!1,onSubmit:d,review:p,onViewReport:m,reportLabel:g,onBack:u,backLabel:b,allowReset:v,onReset:w,overlayConfig:x,contained:_=!1,layout:h,onClose:y,mediaHandler:C,onAddAnnex:T,fallbackLogoUrl:$}){let R=Le(()=>po(t),[t]),f=Je(j=>lo(t,j),[t]),M=mo(t)?"rtl":"ltr",A=Ir(null),H=Ir(null);kt(()=>{let j=H.current,J=A.current;if(!j||!J||typeof ResizeObserver>"u")return;let pe=()=>J.style.setProperty("--edp-bar",`${j.offsetHeight}px`);pe();let ye=new ResizeObserver(pe);return ye.observe(j),()=>ye.disconnect()},[]);let S=h?.maxWidth??uo,N=n?.branding?.primaryColor,O=n?.branding?.accentColor,z=n?.branding?.fontFamily,q=n?.branding?.fontUrl,Q=n?.branding?.showPoweredBy!==!1;kt(()=>{if(!q||typeof document>"u"||document.querySelector(`link[href="${q}"]`))return;let J=document.createElement("link");J.rel="stylesheet",J.href=q,document.head.appendChild(J)},[q]);let[D,X]=je(()=>p?.answers??o??{exerciseAnswers:[]}),[k]=je(()=>p?new Map:yo(o)),P=Ir(i);P.current=i;let F=Je(j=>{let J=ul(j,k);X(J),P.current?.(J)},[k]),[U,G]=je(null);kt(()=>{G(Date.now())},[]);let[be,ie]=je(l&&!p),ae=Le(()=>{if(U===null||!a||a<=0||!s)return null;let j=new Date(s).getTime()+a*6e4-U;return j>0?Math.max(1,Math.floor(j/6e4)):null},[U,a,s]),[ee,ne]=je(!1),[Ne,Ge]=je(!1),[V,wn]=je(p?.result??null),kn=Le(()=>yo(p?.answers),[p]),[Rn,$r]=je(null),[_t,Sn]=je(!1),_n=Ir(!1),To=Le(()=>dl(e),[e]),Cn=Le(()=>Ne?co(e,D):[],[Ne,e,D]),wr=Cn.length,Po=Je(j=>{Ge(!1);let J=A.current?.querySelectorAll(`[data-question-id="${CSS.escape(j)}"]`),pe=Array.from(J??[]).find(ye=>ye.getClientRects().length>0);pe&&requestAnimationFrame(()=>pe.scrollIntoView({block:"start",behavior:"smooth"}))},[]),Ct=Le(()=>e.exercises.reduce((j,J)=>j+xo(J),0),[e]),At=Le(()=>V?wt(V.exerciseFeedback):void 0,[V]),An=Le(()=>{let j=new Map;for(let J of V?.exerciseFeedback??[])for(let pe of J.questions)pe.explanation&&j.set(pe.questionId,pe);return j},[V]),Nn=Le(()=>{if(!V)return{};let j={};for(let J of V.exerciseFeedback){let pe=0,ye=0,he=!1;for(let lr of J.questions)for(let Fe of lr.nodeResults)pe+=Fe.score,ye+=Fe.maxScore,Fe.status==="awaiting_review"&&(he=!0);j[J.exerciseId]={score:pe,maxScore:ye,awaiting:he}}return j},[V]),En=Le(()=>{if(!V)return{};let j={};for(let J of V.exerciseFeedback)for(let pe of J.questions){let ye=0,he=0,lr=!1;for(let Fe of pe.nodeResults)ye+=Fe.score,he+=Fe.maxScore,Fe.status==="awaiting_review"&&(lr=!0);j[pe.questionId]={score:ye,maxScore:he,awaiting:lr}}return j},[V]),Lo=Je(async()=>{ne(!0),$r(null);try{let j=await d(D);wn(j),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch(j){$r(j instanceof Error?j.message:R("confirmCancel"))}finally{ne(!1),Ge(!1)}},[D,d,R]),Tn=Je(()=>{!V||!m||m(V)},[V,m]),Mo=Je(()=>{_n.current||ee||V||(_n.current=!0,Sn(!0),Ge(!1),typeof document<"u"&&document.activeElement?.blur(),setTimeout(()=>{ne(!0),$r(null),d(D).then(j=>{wn(j),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}).catch(j=>{$r(j instanceof Error?j.message:"submit_error")}).finally(()=>{ne(!1),Sn(!1)})},800))},[D,ee,d,V]),Nt=Je((j,J,pe)=>{let ye=xo(j),he=Nn[j.id],lr=j.questions.length>1,Fe=ho(J)?fo(J,{renderQuestion:(jr,Pt,$o)=>{let Qe=jr.id,Pn=k.get(Qe),Ln={...C?{mediaHandler:C}:{},...p?{initialAnswers:kn.get(Qe)??[],readOnly:!0}:Pn?{initialAnswers:Pn}:{}},Mn=Object.keys(Ln).length>0&&ho(Pt)?fo(Pt,Ln):Pt,Lt=An.get(Qe),In=Lt?.explanation?L(io,{content:Lt.explanation,nodeResults:Lt.nodeResults,label:R("explanation")}):null;if(!lr)return W("div",{"data-question-id":Qe,children:[Mn,In]},Qe);let Fr=En[Qe],zo=vo(jr);return W("div",{"data-question-id":Qe,children:[W("div",{className:"flex items-center gap-2.5 mb-3",children:[L("span",{className:"inline-flex items-center rounded-lg border border-[#e7e5e0] bg-[#f1efe9] px-3 py-1 text-xs font-bold tracking-tight text-[#1d2025]",children:R("question",{index:$o+1})}),L(ml,{score:Fr?{s:Fr.score,m:Fr.maxScore,awaiting:Fr.awaiting}:null,weight:zo,unit:f,t:R})]}),Mn,In]},Qe)},renderSeparator:jr=>L("div",{className:"border-t border-[#e7e5e0] my-1"},`qsep-${jr}`)}):J;return W("div",{"data-exercise-id":j.id,className:"bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[W("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#f1efe9] border-b border-[#e7e5e0]",style:O?{backgroundColor:O}:void 0,children:[L("span",{className:"text-sm font-bold text-[#1d2025]",children:R("exercise",{index:pe+1})}),he?.awaiting?W("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-[#8a5a08] bg-[#fbf1dc] border border-[#f2e2bf] rounded-full px-2 py-0.5",children:[L(vr,{size:11}),R("pendingReview")]}):he?W("span",{className:"font-bold leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.15rem",color:he.maxScore>0&&he.score>=he.maxScore?"#1f8a4c":he.maxScore>0&&he.score>0?"#c8810e":he.maxScore>0?"#d23b2b":"#8d93a0"},children:[Ve(he.score)," / ",Ve(he.maxScore)]}):ye>0?W("span",{className:"text-xs font-semibold text-[#8d93a0] tabular-nums",children:["/ ",Ve(ye)," ",f(ye)]}):null]}),L("div",{className:"p-4",children:Fe})]},j.id)},[R,f,Nn,En,O,C,p,kn,k,An]),Io=Le(()=>mn(e).length>0,[e]),Et=Je(j=>W("div",{className:"flex items-center gap-3 py-2",children:[L("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"}),L("span",{className:"text-[10px] font-bold text-[#8d93a0] uppercase tracking-widest",children:R("exercise",{index:j+2})}),L("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"})]},`sep-${j}`),[R]),Tt=Q?L("p",{className:"pt-2 pb-1 text-center text-xs text-[#8d93a0] select-none",children:R("poweredBy")}):null,Me=V!==null,zr=V?.showVerdict!==!1,Dr=zr?V?.passed?"#1f8a4c":"#d23b2b":"#1d2025";return L("div",{className:"edpire-scope",style:{display:"contents"},children:W("div",{ref:A,dir:M,className:se("flex flex-col [--edp-bar:0px] [&_[data-exercise-id]]:scroll-mt-[calc(var(--edp-bar)+0.75rem)] [&_[data-question-id]]:scroll-mt-[calc(var(--edp-bar)+0.75rem)]",_?"h-full":"min-h-dvh"),style:z?{fontFamily:z}:void 0,children:[L(Ja,{visible:ee&&!_t,hasAiNodes:To,text:R("evaluating"),aiText:R("aiEvaluating"),contained:_,...x}),_t&&W("div",{className:se("fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-red-950/80 backdrop-blur-sm",_&&"absolute"),children:[L(vr,{size:40,className:"text-red-300"}),L("p",{className:"text-xl font-black text-white tracking-tight",children:R("timeUp.title")}),L("p",{className:"text-sm text-red-200",children:R("timeUp.submitting")})]}),W("div",{ref:H,className:"sticky top-0 z-10 flex-shrink-0 flex items-center justify-between px-4 py-2.5 border-b border-[#e7e5e0] bg-[#fbfaf7]",style:O?{backgroundColor:O}:void 0,children:[W("div",{className:"flex items-center gap-3",children:[L("img",{src:n?.logoUrl??$??ll,alt:n?.name??"Edpire",width:24,height:24,loading:"lazy",className:"rounded object-contain"}),W("div",{children:[L("h1",{className:"text-sm font-bold text-[#1d2025]",children:r.title}),L("p",{className:"text-[11px] text-[#8d93a0]",children:Ct>0&&W("span",{className:"ms-2 font-semibold text-[#565b66]",children:["/ ",Ve(Ct)," ",f(Ct)]})})]}),!Me&&U!==null&&a&&a>0&&s&&L(fl,{timeLimitMinutes:a,startedAt:s,onExpire:Mo}),!Me&&(c==="saving"||c==="saved")&&W("span",{role:"status",className:"hidden sm:inline-flex items-center gap-1 text-[11px] font-medium text-[#8d93a0]",children:[c==="saved"?L(il,{size:12}):L(fn,{size:12,className:"animate-spin"}),R(c==="saved"?"answersSaved":"answersSaving")]})]}),W("div",{className:"flex items-center gap-2",children:[v&&W("button",{onClick:w,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium text-[#565b66] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:[L(ol,{size:13}),R("reset")]}),(!Me||p)&&u&&W("button",{onClick:u,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium text-[#565b66] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:[L(hn,{size:13}),b??R("back")]}),y&&L("button",{onClick:y,className:"p-1.5 text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:L(hn,{size:15})}),!Me&&L("button",{onClick:()=>Ge(!0),disabled:ee,style:N?{backgroundColor:N}:void 0,className:"flex flex-shrink-0 items-center gap-2 px-3.5 sm:px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors disabled:opacity-50",children:ee?W(bn,{children:[L(fn,{size:14,className:"animate-spin"}),R("submitting")]}):W(bn,{children:[L(go,{size:14}),L("span",{className:"sm:hidden",children:R("confirmSubmit")}),L("span",{className:"hidden sm:inline",children:R("submit")})]})})]})]}),Rn&&L("div",{className:"flex-shrink-0 bg-[#fdeeec] border-b border-[#f6cfc9] px-4 py-2 text-sm text-[#a32b1e]",children:Rn}),!Me&&c==="failed"&&W("div",{role:"alert",className:"flex-shrink-0 flex items-center gap-2 bg-[#fbf1dc] border-b border-[#f2e2bf] px-4 py-2 text-sm font-semibold text-[#8a5a08]",children:[L(cl,{size:15,className:"flex-shrink-0"}),R("answersNotSaved")]}),!Me&&be&&(k.size>0||ae!==null)&&W("div",{role:"status",className:"flex-shrink-0 flex items-center gap-2 bg-[#f5f4f1] border-b border-[#e7e5e0] px-4 py-2 text-sm text-[#1d2025]",children:[ae!==null&&L(vr,{size:15,className:"flex-shrink-0 text-[#565b66]"}),W("span",{className:"flex-1 min-w-0",children:[k.size>0?R("resumeRestored"):R("resumeFresh"),ae!==null&&W(bn,{children:[" ",R("resumeTimeLeft",{minutes:ae})]})]}),L("button",{type:"button",onClick:()=>ie(!1),"aria-label":R("close"),className:"flex-shrink-0 p-1 rounded-md text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#e7e5e0] transition-colors",children:L(hn,{size:14})})]}),Me&&V&&(V.awaitingManualGrading?L("div",{className:"flex-shrink-0 border-b bg-[#fbf1dc] border-[#f2e2bf]",children:L("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:S},children:W("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 sm:gap-4",children:[W("div",{className:"flex items-center gap-2",children:[L(vr,{size:20,className:"text-[#c8810e] flex-shrink-0"}),L("span",{className:"text-sm font-semibold text-[#8a5a08]",children:V.aiPending?R("beingMarked"):R("awaitingReview")})]}),L("div",{className:"hidden sm:block w-px h-8 bg-[#f2e2bf]"}),L("p",{className:"text-sm text-[#8a5a08] flex-1 min-w-0",children:V.aiPending?R("beingMarkedDesc"):R("awaitingReviewDesc")}),m&&W("button",{onClick:Tn,style:N?{backgroundColor:N}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[L(bo,{size:14}),g??R("viewFullReport")]})]})})}):L("div",{className:se("flex-shrink-0 border-b",zr?V.passed?"bg-[#ecf8f0] border-[#c5e8d1]":"bg-[#fdeeec] border-[#f6cfc9]":"bg-[#f5f4f1] border-[#e7e5e0]"),children:L("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:S},children:W("div",{className:"flex flex-wrap sm:flex-nowrap items-center gap-x-4 gap-y-2",children:[W("div",{className:"flex items-center gap-2",children:[zr?V.passed?L(nl,{size:20,className:"text-[#1f8a4c] flex-shrink-0"}):L(al,{size:20,className:"text-[#d23b2b] flex-shrink-0"}):null,L("span",{className:"text-sm font-semibold",style:{color:Dr},children:zr?V.passed?R("assessmentPassed"):R("assessmentNotPassed"):R("yourScore")})]}),L("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),W("div",{className:"flex items-baseline gap-1.5",children:[W("span",{className:"leading-none tabular-nums text-[1.6rem] sm:text-[2rem]",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',color:Dr},children:[Ve(V.totalScore)," / ",Ve(V.maxScore)]}),L("span",{className:"text-sm text-[#8d93a0] font-medium",children:f(V.maxScore)})]}),W("div",{className:"flex-1 flex items-center gap-3 min-w-[140px]",children:[L("div",{className:"flex-1 h-2 bg-[#e7e5e0] rounded-full overflow-hidden min-w-[80px]",children:L("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${V.percentage}%`,backgroundColor:Dr}})}),W("span",{className:"text-sm font-bold tabular-nums flex-shrink-0",style:{color:Dr},children:[V.percentage,"%"]})]}),m&&W("button",{onClick:Tn,style:N?{backgroundColor:N}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[L(bo,{size:14}),g??R("viewFullReport")]})]})})})),L("div",{className:se("flex-1 flex flex-col",_&&"overflow-hidden",_t&&"pointer-events-none opacity-60"),children:e.annex||Io?L(no,{assessment:e,isSubmitted:Me,setAnswers:F,validationFeedback:At,renderExercise:Nt,renderSeparator:Et,primaryColor:N,contained:_,locale:t,contentMaxWidth:S,t:R,footer:Tt}):T?L(oo,{assessment:e,isSubmitted:Me,setAnswers:F,validationFeedback:At,renderExercise:Nt,renderSeparator:Et,primaryColor:N,contained:_,locale:t,contentMaxWidth:S,t:R,onAddAnnex:T,footer:Tt}):L("div",{className:se("flex-1",_&&"overflow-y-auto"),children:W("div",{className:"mx-auto p-6 flex flex-col gap-4",style:{maxWidth:S},children:[L(Xe,{assessment:e,onAnswersChange:Me?void 0:F,validationFeedback:At,renderExercise:Nt,renderSeparator:Et,locale:t}),Tt]})})}),Ne&&L("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:W("div",{role:"dialog","aria-modal":"true","aria-labelledby":"edpire-submit-confirm-title",className:"bg-white rounded-[14px] shadow-xl p-6 max-w-sm mx-4",children:[L("h3",{id:"edpire-submit-confirm-title",className:"text-base font-bold text-[#1d2025] mb-2",children:R("confirmTitle")}),wr>0&&W("div",{className:"text-sm text-[#8a5a08] bg-[#fbf1dc] border border-[#f2e2bf] rounded-lg px-3 py-2 mb-3",children:[W("p",{className:"flex items-start gap-2 font-semibold",children:[L(sl,{size:15,className:"flex-shrink-0 mt-px"}),L("span",{children:wr===1?R("unansweredOne"):R("unansweredMany",{count:wr})})]}),W("ul",{className:"mt-1 ps-[23px] flex flex-col gap-0.5",children:[Cn.slice(0,gn).map(j=>L("li",{children:L("button",{type:"button",onClick:()=>Po(j.questionId),className:"text-start underline underline-offset-2 hover:text-[#1d2025] cursor-pointer",children:j.only?R("exercise",{index:j.exerciseIndex+1}):`${R("exercise",{index:j.exerciseIndex+1})} \xB7 ${R("question",{index:j.questionIndex+1})}`})},j.questionId)),wr>gn&&L("li",{children:R("unansweredMore",{count:wr-gn})})]})]}),L("p",{className:"text-sm text-[#565b66] mb-5",children:R("confirmDescription")}),W("div",{className:"flex gap-3 justify-end",children:[L("button",{onClick:()=>Ge(!1),className:"px-4 py-2 text-sm font-medium text-[#565b66] hover:bg-[#f1efe9] rounded-lg transition-colors",children:R("confirmCancel")}),W("button",{onClick:Lo,disabled:ee,style:N?{backgroundColor:N}:void 0,className:"flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors disabled:opacity-50",children:[ee?L(fn,{size:14,className:"animate-spin"}):L(go,{size:14}),R("confirmSubmit")]})]})]})})]})})}function St(e){return(e??[]).map(r=>({exerciseId:r.exercise_id,questions:r.questions.map(t=>({questionId:t.question_id,...t.explanation?{explanation:t.explanation}:{},nodeResults:t.node_results.map(n=>({nodeId:n.node_id,status:n.status,score:n.score,maxScore:n.max_score,...n.feedback!==void 0?{feedback:n.feedback}:{},...n.display_answer!==void 0?{displayAnswer:n.display_answer}:{},...n.detail!==void 0?{detail:n.detail}:{},...n.teacher_feedback!==void 0?{teacherFeedback:n.teacher_feedback}:{}}))}))}))}import{jsx as bl}from"react/jsx-runtime";function xn(e,r){let t=St(e.exercise_feedback);return{submissionId:e.submission_id,totalScore:e.score,maxScore:e.max_score,percentage:e.percentage,passed:e.passed,returnUrl:r??null,exerciseFeedback:t,awaitingManualGrading:e.awaiting_manual_grading??!1,aiPending:e.ai_pending??!1}}function yn(e){return{annex:e.annex??void 0,exercises:e.exercises.map(r=>({id:r.id,sharedContext:r.sharedContext,questions:r.questions.map(t=>({id:t.id,version:"1.0",content:t.content,answerKeys:[]}))}))}}function Ro({token:e,data:r,baseUrl:t,options:n}){let{locale:a,branding:s,returnUrl:o,reportLabel:i,backLabel:c,onBack:l,overlayConfig:d,layout:p,mediaHandler:m,onComplete:g,onError:u}=n,b=s??r.branding??void 0,v=a??r.meta.language??"en",w=hl(()=>yn(r.assessment),[r]),[x]=gl(()=>new Date().toISOString()),_=ko(async y=>{let C=await fetch(`${t}/api/v1/embed/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,answers:y})});if(!C.ok){let $=await C.json().catch(()=>({})),R=typeof $.error=="string"?$.error:"Submission failed",f=C.status===401?"TOKEN_INVALID":C.status===409?"TOKEN_USED":C.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";throw u?.({code:f,message:R}),new Error(R)}let T=await C.json();return g?.(T),xn(T,o)},[t,e,g,u,o]),h=ko(y=>{if(o)try{let C=new URL(o);C.searchParams.set("submission_id",y.submissionId),y.awaitingManualGrading||(C.searchParams.set("score",String(y.totalScore)),C.searchParams.set("max_score",String(y.maxScore))),window.location.href=C.toString()}catch{window.location.href=o}},[o]);return bl(Rt,{assessment:w,meta:{title:r.meta.title,category:r.meta.category??null},locale:v,branding:b,timeLimitMinutes:r.meta.settings.time_limit_minutes,startedAt:x,onSubmit:_,onViewReport:o?h:void 0,reportLabel:i,onBack:l,backLabel:c,overlayConfig:d,layout:p,mediaHandler:m})}import{useMemo as So}from"react";import{jsx as yl}from"react/jsx-runtime";function xl(){return Promise.reject(new Error("A review cannot be submitted"))}function _o({review:e,locale:r,branding:t,layout:n,onBack:a,backLabel:s}){let o=So(()=>yn(e.assessment),[e]),i=So(()=>({answers:e.answers,result:xn({submission_id:e.submission.id,score:e.submission.score,max_score:e.submission.max_score,percentage:e.submission.percentage,passed:e.submission.passed,awaiting_manual_grading:e.submission.awaiting_manual_grading,ai_pending:e.submission.ai_pending,exercise_feedback:e.exercise_feedback})}),[e]),c=r??e.meta.language??"en";return yl(Rt,{assessment:o,meta:{title:e.meta.title,category:e.meta.category??null},locale:c,branding:t??e.branding??void 0,review:i,onSubmit:xl,onBack:a,backLabel:s,layout:n})}import kl from"react";import{createRoot as Rl}from"react-dom/client";import vl,{useMemo as wl}from"react";import"katex/dist/katex.min.css";import{jsx as vn}from"react/jsx-runtime";var Co=vl.memo(function({content:r,onAnswersChange:t,feedback:n,initialAnswers:a,readOnly:s,className:o,dir:i}){let c=wl(()=>{if(n)return new Map(Object.entries(n))},[n]),l=vn(gr,{content:r,onAnswersChange:t,initialAnswers:a,validationFeedback:c,readOnly:s,className:o});return vn("div",{className:"edpire-scope",style:{display:"contents"},children:i?vn("div",{dir:i,children:l}):l})});function Sl(e){let{container:r,content:t,onAnswersChange:n,feedback:a,initialAnswers:s,readOnly:o,dir:i}=e,c=typeof r=="string"?document.querySelector(r):r;if(!c)throw new Error(`EdpireSDK.renderQuestion: container not found: ${String(r)}`);let l={content:t,onAnswersChange:n,feedback:a,initialAnswers:s,readOnly:o,dir:i},d=Rl(c);function p(){d.render(kl.createElement(Co,l))}return p(),{setContent(m){l={...l,content:m,feedback:null},p()},setFeedback(m){l={...l,feedback:m},p()},setInitialAnswers(m){l={...l,initialAnswers:m},p()},unmount(){d.unmount()}}}function _l(e){let r=[],t=0;for(let n of e.exercises)for(let a of n.questions)r.push({exerciseId:n.id,questionId:a.id,content:a.content_ast,points:a.points,sequenceNumber:a.sequence_number,index:t++});return r}function Cl(e){let r=wt(St(e.exercise_feedback)),t=new Map;for(let s of e.answers.exerciseAnswers)for(let o of s.questionAnswers)t.set(o.questionId,o.answers);let n=[],a=0;for(let s of e.assessment.exercises){let o=r.get(s.id);for(let i of s.questions){let c=o?.get(i.id),l=e.exercise_feedback.find(u=>u.exercise_id===s.id)?.questions.find(u=>u.question_id===i.id),d=l?.node_results??[],p=0,m=0,g=!1;for(let u of d)p+=u.score,m+=u.max_score,u.status==="awaiting_review"&&(g=!0);n.push({exerciseId:s.id,questionId:i.id,content:i.content,sharedContext:s.sharedContext??null,explanation:l?.explanation??null,answers:t.get(i.id)??[],feedback:c?Object.fromEntries(c):{},score:p,maxScore:m,status:g?"awaiting_review":m===0?"unscored":p>=m?"correct":p>0?"partial":"incorrect",index:a++})}}return n}function Al(e){let r=new Map;for(let t of e)r.has(t.exerciseId)||r.set(t.exerciseId,[]),r.get(t.exerciseId).push({questionId:t.questionId,answers:t.answers});return{exerciseAnswers:Array.from(r.entries()).map(([t,n])=>({exerciseId:t,questionAnswers:n}))}}var Nl="https://edpire.com";function Eo(e,r,t){e.textContent="";let n=document.createElement("div");n.style.cssText="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif";let a=document.createElement("div");if(a.textContent=r,n.appendChild(a),t){let s=document.createElement("div");s.style.cssText="margin-top:8px;font-size:13px;color:#6b7280",s.textContent=t,n.appendChild(s)}e.appendChild(n)}var Ng={mount(e){let{token:r,container:t,baseUrl:n=Nl,onError:a}=e,s=typeof t=="string"?document.querySelector(t):t;if(!s){let l={code:"UNKNOWN",message:`Container not found: ${t}`};return a?.(l),{unmount:()=>{}}}let o=null,i=!1;function c(){if(i)return;i=!0;let l=o;o=null,setTimeout(()=>{l?.unmount()},0)}return(async()=>{s.innerHTML='<div style="padding:32px;text-align:center;color:#6b7280;font-family:sans-serif">Loading assessment\u2026</div>';let l;try{let d=await fetch(`${n}/api/v1/embed/assessments?token=${encodeURIComponent(r)}`,{method:"GET"});if(!d.ok){let p=await d.json().catch(()=>({})),m=typeof p.error=="string"?p.error:"Failed to load assessment",g=d.status===401?"TOKEN_INVALID":d.status===403?"ORIGIN_NOT_ALLOWED":d.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";a?.({code:g,message:m});let u=g==="ORIGIN_NOT_ALLOWED"?`Add ${typeof location<"u"?location.origin:"this origin"} to Allowed Embed Origins in Edpire, under Integrations then Origins.`:"";Eo(s,m,u);return}l=await d.json()}catch{a?.({code:"NETWORK_ERROR",message:"Failed to connect to Edpire"}),Eo(s,"Failed to connect to Edpire. Please try again.","");return}i||(s.innerHTML="",o=No(s),o.render(Ao.createElement(Ro,{token:r,data:l,baseUrl:n,options:e})))})(),{unmount:c}},review(e){let{container:r,...t}=e,n=typeof r=="string"?document.querySelector(r):r;if(!n)return{unmount:()=>{}};n.textContent="";let a=No(n);return a.render(Ao.createElement(_o,t)),{unmount(){let s=a;a=null,setTimeout(()=>s?.unmount(),0)}}}};export{Ng as EdpireAssessment,Al as buildSubmitPayload,_l as flattenAssessment,Cl as flattenReview,Sl as renderQuestion};
63
+ `}),_e("div",{style:{background:r},className:`${c?"absolute":"fixed"} inset-0 z-[60] flex items-center justify-center`,children:Gn("div",{className:"flex flex-col items-center gap-5 bg-white rounded-2xl shadow-2xl px-10 py-8 max-w-xs text-center",children:[(()=>{if(i)return _e("img",{src:i,alt:"",className:"w-24 h-24 object-contain"});switch(o){case"dots":return _e(Bl,{accent:t});case"pulse":return _e(ql,{accent:t});case"bars":return _e(Wl,{accent:t});default:return _e(Ol,{accent:t})}})(),_e("p",{className:"text-sm font-semibold text-slate-800",children:n}),s&&_e("p",{className:"text-xs text-slate-500 leading-snug",children:a})]})})]}):null}import{useCallback as Fo,useEffect as Hl,useMemo as jo,useRef as Yt,useState as Vl}from"react";import{BookOpen as Oo,X as Ql}from"lucide-react";import{Fragment as Yl,jsx as be,jsxs as Oe}from"react/jsx-runtime";function Yn(e){return e.exercises.flatMap((r,t)=>r.sharedContext&&at(r.sharedContext)?[{id:r.id,index:t,title:r.title,content:r.sharedContext}]:[])}var Bo=()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;function Gl(e){e.removeAttribute("data-flash"),e.offsetWidth,e.setAttribute("data-flash","true"),setTimeout(()=>e.removeAttribute("data-flash"),1200)}function qo({assessment:e,isSubmitted:r,setAnswers:t,validationFeedback:n,renderExercise:a,renderSeparator:o,primaryColor:i,contained:s=!1,locale:c,contentMaxWidth:l,t:p,footer:u}){let[d,h]=Vl(!1),m=e.annex,b=m?.tabLabel||p("annexDocuments"),w=jo(()=>Yn(e),[e]),R=Yt(null),v=Yt(null),C=Yt(null),x=Yt(null),S=()=>(R.current?.getClientRects().length??0)>0,k=Fo((f,q)=>{let A=f?.querySelector(`[data-reference-for="${CSS.escape(q)}"]`);if(!f||!A)return;let L=A.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop-12;f.scrollTo({top:L,behavior:Bo()?"auto":"smooth"}),Gl(A)},[]),_=Fo(f=>{if(S()){k(v.current,f);return}h(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>k(x.current,f)))},[k]),T=f=>{let q=S()?R.current:C.current;S()||h(!1),Array.from(q?.querySelectorAll(`[data-exercise-id="${CSS.escape(f)}"]`)??[]).find(L=>L.getClientRects().length>0)?.scrollIntoView({behavior:Bo()?"auto":"smooth",block:"start"})};Hl(()=>{let f=R.current;if(!f||w.length===0||typeof IntersectionObserver>"u")return;let q=s?f:null,A=new Set(w.map(B=>B.id)),L=null,G=new IntersectionObserver(B=>{if(!S())return;let K=B.filter(le=>le.isIntersecting&&A.has(le.target.dataset.exerciseId??"")).sort((le,xe)=>le.boundingClientRect.top-xe.boundingClientRect.top)[0]?.target?.dataset.exerciseId;!K||K===L||(L=K,k(v.current,K))},{root:q,rootMargin:"0px 0px -60% 0px"});return f.querySelectorAll("[data-exercise-id]").forEach(B=>G.observe(B)),()=>G.disconnect()},[w,k,s]);let F=jo(()=>({label:b,showExerciseReference:_}),[b,_]),g=Oe(Yl,{children:[m?.items.map(f=>be(it,{item:f},f.id)),m?.items.length&&w.length?be("div",{className:"border-t border-[#e7e5e0]"}):null,w.map(f=>Oe("section",{"data-reference-for":f.id,className:"-mx-3 flex flex-col gap-2 rounded-[10px] px-3 py-2 transition-colors duration-700 data-[flash=true]:bg-[#fbf1dc] data-[flash=true]:duration-150",children:[be("button",{type:"button",onClick:()=>T(f.id),className:"self-start cursor-pointer text-xs font-bold uppercase tracking-widest text-[#565b66] underline-offset-4 hover:text-[#1d2025] hover:underline focus-visible:outline-2 focus-visible:outline-[#1d2025] rounded-sm",children:be("span",{dir:"auto",children:Sr(p,f.title,f.index)})}),be(jr,{content:f.content})]},f.id))]}),E=be(dr,{assessment:e,onAnswersChange:r?void 0:t,validationFeedback:n,renderExercise:a,renderSeparator:o,locale:c});return be(Ut,{value:F,children:Oe("div",{className:ge("@container flex-1 min-h-0 flex",s&&"relative"),children:[Oe("div",{ref:R,className:ge("hidden @6xl:flex flex-1 min-w-0 gap-4 p-4 bg-[#f5f4f1] items-start",s&&"overflow-y-auto"),children:[Oe("div",{className:ge("flex-1 sticky flex flex-col bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",s?"top-4 max-h-[calc(100svh-6rem)]":"top-[calc(var(--edp-bar)+1rem)] max-h-[calc(100dvh-var(--edp-bar)-2rem)]"),children:[Oe("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-[#e7e5e0] flex-shrink-0",children:[be(Oo,{size:14,className:"text-[#8d93a0]"}),be("span",{className:"text-xs font-bold text-[#565b66] uppercase tracking-widest",children:b})]}),be("div",{ref:v,className:"flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-6",children:g})]}),be("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),be("div",{className:"flex-1 min-w-0 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:Oe("div",{className:"px-6 py-5 flex flex-col gap-4",children:[E,u]})})]}),Oe("div",{className:ge("@6xl:hidden flex-1 min-w-0 relative",s&&"overflow-hidden"),children:[be("div",{ref:C,className:ge(s&&"absolute inset-0 overflow-y-auto"),children:Oe("div",{className:"mx-auto px-5 py-5 flex flex-col gap-4",style:{maxWidth:l},children:[E,u]})}),d&&be("div",{className:ge("inset-0 z-30 bg-black/25",s?"absolute":"fixed"),onClick:()=>h(!1)}),Oe("div",{role:"dialog","aria-label":b,"aria-hidden":!d,className:ge("top-1/2 start-2 -translate-y-1/2 z-40 w-[88%] bg-[#f1efe9] rounded-2xl shadow-2xl flex flex-col overflow-hidden transition-transform duration-300 ease-in-out",s?"absolute":"fixed",d?"translate-x-0":"-translate-x-[110%] rtl:translate-x-[110%]"),children:[Oe("div",{className:"flex items-center justify-between px-5 py-3 flex-shrink-0",children:[be("span",{className:"text-sm font-bold text-[#1d2025]",children:b}),be("button",{onClick:()=>h(!1),"aria-label":p("close"),className:"p-1 text-[#8d93a0] hover:text-[#1d2025] rounded-lg transition-colors",children:be(Ql,{size:18})})]}),be("div",{ref:x,className:"overflow-y-auto max-h-[calc(100dvh-8rem)] px-5 pb-5 flex flex-col gap-5",children:g})]})]}),!d&&Oe("button",{onClick:()=>h(!0),"aria-label":b,style:{transform:"translateY(-50%)",...i?{backgroundColor:i}:{}},className:ge("@6xl:hidden top-1/2 start-0 z-20 flex flex-col items-center gap-1 py-3 px-1.5 bg-[#1d2025] text-white text-[10px] font-bold uppercase tracking-wider rounded-e-lg shadow-md hover:bg-[#31353c] transition-colors",s?"absolute":"fixed"),children:[be(Oo,{size:12}),be("span",{style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:b})]})]})})}import{useState as Kl}from"react";import{BookOpen as Wo,Plus as Xl,X as Jl}from"lucide-react";import{jsx as Se,jsxs as nr}from"react/jsx-runtime";function Uo({assessment:e,isSubmitted:r,setAnswers:t,validationFeedback:n,renderExercise:a,renderSeparator:o,primaryColor:i,contained:s=!1,locale:c,contentMaxWidth:l,t:p,onAddAnnex:u,footer:d}){let[h,m]=Kl(!1),b=Se(dr,{assessment:e,onAnswersChange:r?void 0:t,validationFeedback:n,renderExercise:a,renderSeparator:o,locale:c});if(h)return Se("div",{className:"flex-1 overflow-y-auto",children:nr("div",{className:"mx-auto p-6 flex flex-col gap-4",style:{maxWidth:l},children:[b,d]})});let w=C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),u())},R=C=>nr("span",{style:i?{backgroundColor:i}:void 0,className:ge("flex-none inline-flex items-center gap-1.5 rounded-lg bg-[#1d2025] text-white font-semibold shadow-sm group-hover:shadow-md transition-shadow",C?"px-3 py-1.5 text-xs":"mt-1 px-3.5 py-2 text-xs"),children:[Se(Xl,{size:13}),p("annexEmptyCta")]}),v=C=>Se("button",{type:"button",onClick:x=>{x.stopPropagation(),m(!0)},"aria-label":p("annexEmptyDismiss"),title:p("annexEmptyDismiss"),className:ge("flex-none flex items-center justify-center w-7 h-7 rounded-lg text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] transition-colors cursor-pointer",C&&"absolute top-2 end-2 z-10"),children:Se(Jl,{size:15})});return nr("div",{className:ge("@container flex-1 min-h-0 flex",s&&"relative"),children:[nr("div",{className:"hidden @6xl:flex flex-1 gap-4 p-4 bg-[#f5f4f1] items-start overflow-y-auto",children:[Se("div",{className:"flex-1 sticky top-4 flex min-h-[200px] max-h-[calc(100svh-6rem)]",children:nr("div",{role:"button",tabIndex:0,onClick:u,onKeyDown:w,className:"group relative flex-1 w-full flex flex-col items-center justify-center gap-3 text-center rounded-[14px] border-2 border-dashed border-[#d6d3cc] bg-white/60 hover:border-[#8d93a0] hover:bg-white transition-colors cursor-pointer px-6 py-8 outline-none focus-visible:ring-2 focus-visible:ring-[#8d93a0] focus-visible:ring-offset-2",children:[v(!0),Se("span",{className:"flex items-center justify-center w-11 h-11 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:Se(Wo,{size:20})}),Se("span",{className:"text-sm font-bold text-[#565b66]",children:p("annexEmptyTitle")}),Se("span",{className:"text-xs text-[#8d93a0] max-w-[32ch] leading-relaxed",children:p("annexEmptyBody")}),R(!1)]})}),Se("div",{className:"w-px bg-[#e7e5e0] flex-shrink-0 self-stretch my-1 rounded-full"}),Se("div",{className:"flex-1 bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm",children:nr("div",{className:"px-6 py-5 flex flex-col gap-4",children:[b,d]})})]}),Se("div",{className:"@6xl:hidden flex-1 overflow-y-auto",children:nr("div",{className:"mx-auto px-5 py-5 flex flex-col gap-4",style:{maxWidth:l},children:[nr("div",{role:"button",tabIndex:0,onClick:u,onKeyDown:w,className:"group flex items-center gap-3 rounded-[14px] border-2 border-dashed border-[#d6d3cc] bg-white/60 hover:border-[#8d93a0] hover:bg-white transition-colors cursor-pointer px-4 py-2.5 outline-none focus-visible:ring-2 focus-visible:ring-[#8d93a0]",children:[Se("span",{className:"flex-none flex items-center justify-center w-9 h-9 rounded-full bg-[#f1efe9] text-[#8d93a0] group-hover:text-[#1d2025] transition-colors",children:Se(Wo,{size:16})}),nr("div",{className:"flex-1 min-w-0",children:[Se("div",{className:"text-xs font-bold text-[#565b66]",children:p("annexEmptyTitle")}),Se("div",{className:"text-[11px] text-[#8d93a0] leading-snug",children:p("annexEmptyBody")})]}),R(!0),v(!1)]}),b,d]})})]})}function Kt(e){let r=new Map;for(let t of e){let n=new Map;for(let a of t.questions){let o=new Map;for(let i of a.nodeResults){let s={state:i.status,showFeedback:!0,score:i.score,...i.feedback!==void 0?{message:i.feedback}:{},...i.displayAnswer!==void 0?{displayAnswer:i.displayAnswer}:{},...i.teacherFeedback!==void 0?{teacherFeedback:i.teacherFeedback}:{}};i.detail?.type==="choiceSet"?s.correctChoiceIds=i.detail.correctChoiceIds:i.detail?.type==="matchingSet"&&(s.pairFeedback=i.detail.pairFeedback,s.correctPairings=i.detail.correctPairings),o.set(i.nodeId,s)}n.set(a.questionId,o)}r.set(t.exerciseId,n)}return r}import{Lightbulb as Zl}from"lucide-react";import{jsx as Kn,jsxs as Ho}from"react/jsx-runtime";function ed(e){return e.length===0||e.some(r=>r.status==="awaiting_review")?null:e.every(r=>r.status==="correct")?"correct":e.some(r=>r.status==="partial"||r.status==="correct"||(r.score??0)>0)?"partial":"incorrect"}function Vo({content:e,nodeResults:r,label:t}){let n=ed(r);return Ho("div",{className:`player-ai-feedback mt-3 mb-3${n?` player-ai-feedback--${n}`:""}`,children:[Ho("p",{className:"flex items-center gap-1.5 text-xs font-semibold",children:[Kn(Zl,{size:14,"aria-hidden":!0}),t]}),Kn("div",{className:"text-[#1d2025]",children:Kn(jr,{content:e})})]})}import{jsx as ar,jsxs as Xn}from"react/jsx-runtime";function Qo({t:e,rtl:r,showClose:t,onContinue:n,continueLabel:a,primaryColor:o}){return Xn("div",{role:"status",className:"edp-thanks flex-1 flex items-center justify-center px-6 py-16",children:[ar("style",{children:rd}),Xn("div",{className:"flex flex-col items-center text-center",style:{maxWidth:"26rem"},children:[Xn("div",{className:"relative",style:{width:120,height:120},"aria-hidden":!0,children:[ar("svg",{className:"edp-thanks-blob absolute inset-0 overflow-visible",viewBox:"0 0 200 200",width:"120",height:"120",children:ar("path",{d:"M104 14c44 2 80 34 82 80s-34 94-86 92S12 150 16 98 58 12 104 14z",fill:"#ffd64a"})}),ar("svg",{className:"absolute inset-0 overflow-visible",viewBox:"0 0 100 100",width:"120",height:"120",children:ar("path",{className:"edp-thanks-check",d:"M26 54l17 17 33-39",fill:"none",stroke:"#1d2025",strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round",pathLength:1})})]}),ar("h2",{className:"edp-thanks-stamp mt-4 text-[#1d2025]",style:r?{fontSize:36,fontWeight:700,lineHeight:1.3,transform:"rotate(-3deg)"}:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:56,fontWeight:600,lineHeight:1,transform:"rotate(-4deg)"},children:e("formThanks")}),ar("p",{className:"edp-thanks-rise mt-4 text-base text-[#565b66]",style:{animationDelay:"750ms"},children:e("formThanksDesc")}),t&&!n&&ar("p",{className:"edp-thanks-rise mt-1 text-sm text-[#8a8f99]",style:{animationDelay:"850ms"},children:e("formThanksClose")}),n&&ar("button",{onClick:n,style:{animationDelay:"850ms",...o?{backgroundColor:o}:{}},className:"edp-thanks-rise mt-6 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:a??e("continue")})]})]})}var rd=`
64
+ @keyframes edp-thanks-blob-in { from { transform: scale(0) rotate(-25deg); } }
65
+ @keyframes edp-thanks-draw { to { stroke-dashoffset: 0; } }
66
+ @keyframes edp-thanks-stamp-in { from { opacity: 0; transform: scale(1.8) rotate(-4deg); } }
67
+ @keyframes edp-thanks-rise-in { from { opacity: 0; transform: translateY(6px); } }
68
+ .edp-thanks .edp-thanks-blob { transform-origin: 50% 50%; animation: edp-thanks-blob-in 450ms cubic-bezier(.34,1.56,.64,1) 100ms both; }
69
+ .edp-thanks .edp-thanks-check { stroke-dasharray: 1; stroke-dashoffset: 1; animation: edp-thanks-draw 500ms cubic-bezier(.2,.8,.2,1) 300ms forwards; }
70
+ .edp-thanks .edp-thanks-stamp { animation: edp-thanks-stamp-in 350ms cubic-bezier(.34,1.56,.64,1) 550ms both; }
71
+ .edp-thanks .edp-thanks-rise { animation: edp-thanks-rise-in 240ms cubic-bezier(.2,.8,.2,1) both; }
72
+ @media (prefers-reduced-motion: reduce) {
73
+ .edp-thanks * { animation: none !important; }
74
+ .edp-thanks .edp-thanks-check { stroke-dashoffset: 0; }
75
+ }
76
+ `;var td=new Set(["choiceSet","inlineChoiceSet","blank","aiAnswerInput","matchingSet","openResponseNode","mathResponse","codingResponse"]),nd=new Set(["blankPool","inlinePool"]);function ad(e){switch(e.type){case"choiceSet":case"inlineChoiceSet":return e.answer.selectedIds.length>0;case"blank":return e.answer.mode==="choice"?e.answer.choiceId.length>0:e.answer.text.trim().length>0;case"matchingSet":return e.answer.connections.length>0;case"aiAnswer":return e.answer.text.trim().length>0;case"openResponse":{let r=e.answer;return r.recording||r.files&&r.files.length>0?!0:(r.text?.wordCount??0)>0}case"mathResponse":return e.answer.latex.trim().length>0;case"codingResponse":return e.answer.source.trim().length>0;default:{let r=e;return!0}}}function od(e){let r=0,t=n=>{if(Array.isArray(n)){for(let i of n)t(i);return}if(!n||typeof n!="object")return;let{type:a,content:o}=n;if(typeof a=="string"){if(td.has(a)){r+=1;return}if(nd.has(a))return}o!==void 0&&t(o)};return t(e),r}function Jn(e,r){let t=new Map;for(let a of r?.exerciseAnswers??[])for(let o of a.questionAnswers){let i=t.get(o.questionId);i||(i=new Set,t.set(o.questionId,i));for(let s of o.answers)ad(s)&&i.add(s.nodeId)}let n=[];return e.exercises.forEach((a,o)=>{a.questions.forEach((i,s)=>{let c=od(i.content);c!==0&&(t.get(i.id)?.size??0)<c&&n.push({questionId:i.id,exerciseIndex:o,...a.title?{exerciseTitle:a.title}:{},questionIndex:s,only:a.questions.length===1})})}),n}function Zn(e,r,t){let n=new Set(t);return n.size===0?[]:Jn(e,r).filter(a=>n.has(a.questionId))}var id={exercise:"Exercise {index}",question:"Question {index}",points:"pts","points.one":"pt",submit:"Submit Assessment",submitting:"Submitting...",confirmTitle:"Submit Assessment",confirmDescription:"Are you sure you want to submit? You cannot change your answers after submitting.",unansweredOne:"1 question is not fully answered.",unansweredMany:"{count} questions are not fully answered.",unansweredMore:"and {count} more",confirmSubmit:"Submit",confirmCancel:"Cancel",assessmentPassed:"Assessment passed",assessmentNotPassed:"Assessment not passed",awaitingReview:"Awaiting review",awaitingReviewDesc:"Your teacher is reviewing your open responses. Your final score will be available once grading is complete.",submittedNoScore:"Your answers are in",submittedNoScoreDesc:"No score on this one: see below what you got right and what to look at again.",formThanks:"Thank you!",formThanksDesc:"Your answers have been sent.",formThanksClose:"You can close this page.",formSubmit:"Send",formSending:"Sending\u2026",formConfirmTitle:"Send your answers?",formConfirmDescription:"You won't be able to change them after sending.",required:"Required",requiredMissing:"This question is required",requiredBlocked:"A required question is unanswered: answer it, then send again.",continue:"Continue",beingMarked:"Being marked",beingMarkedDesc:"Some answers are still being marked. Your final score will be available once every answer is marked.",pendingReview:"Pending review",viewFullReport:"View Full Report",explanation:"Explanation",poweredBy:"Powered by Edpire",evaluating:"Evaluating your answers\u2026",aiEvaluating:"Some answers are being reviewed by AI, this may take a few seconds.",reset:"Reset",back:"Back",annexDocuments:"Documents",annexEmptyTitle:"No reference yet",annexEmptyBody:"A text, figure, table or document that stays in view across the whole assessment while students answer.",annexEmptyCta:"Add reference",annexEmptyDismiss:"Hide","timeUp.title":"Time's up","timeUp.submitting":"Submitting your answers\u2026",yourScore:"Your score",answersSaving:"Saving\u2026",answersSaved:"Answers saved",answersNotSaved:"Your answers aren't being saved. Check your connection.",resumeRestored:"Welcome back. Your answers are here.",resumeFresh:"Welcome back.",resumeTimeLeft:"The clock kept running: {minutes} min left.",close:"Close"},sd={exercise:"Exercice {index}",question:"Question {index}",points:"pts","points.one":"pt",submit:"Soumettre l'\xE9valuation",submitting:"Soumission...",confirmTitle:"Soumettre l'\xE9valuation",confirmDescription:"\xCAtes-vous s\xFBr de vouloir soumettre ? Vous ne pourrez pas modifier vos r\xE9ponses.",unansweredOne:"1 question n'est pas enti\xE8rement remplie.",unansweredMany:"{count} questions ne sont pas enti\xE8rement remplies.",unansweredMore:"et {count} autres",confirmSubmit:"Soumettre",confirmCancel:"Annuler",assessmentPassed:"\xC9valuation r\xE9ussie",assessmentNotPassed:"\xC9valuation non r\xE9ussie",awaitingReview:"En attente de correction",awaitingReviewDesc:"Votre professeur examine vos r\xE9ponses ouvertes. Votre note finale sera disponible une fois la correction termin\xE9e.",submittedNoScore:"Vos r\xE9ponses sont envoy\xE9es",submittedNoScoreDesc:"Pas de note pour celle-ci : voyez ci-dessous ce qui est juste et ce qu'il faut revoir.",formThanks:"Merci !",formThanksDesc:"Vos r\xE9ponses ont bien \xE9t\xE9 envoy\xE9es.",formThanksClose:"Vous pouvez fermer cette page.",formSubmit:"Envoyer",formSending:"Envoi\u2026",formConfirmTitle:"Envoyer vos r\xE9ponses ?",formConfirmDescription:"Vous ne pourrez plus les modifier ensuite.",required:"Obligatoire",requiredMissing:"R\xE9ponse obligatoire",requiredBlocked:"Une question obligatoire est sans r\xE9ponse : r\xE9pondez-y, puis envoyez \xE0 nouveau.",continue:"Continuer",beingMarked:"Correction en cours",beingMarkedDesc:"Certaines r\xE9ponses sont encore en cours de correction. Votre note finale sera disponible d\xE8s que toutes les r\xE9ponses seront corrig\xE9es.",pendingReview:"En attente de correction",viewFullReport:"Voir le rapport complet",explanation:"Explication",poweredBy:"Propuls\xE9 par Edpire",evaluating:"\xC9valuation de vos r\xE9ponses\u2026",aiEvaluating:"Certaines r\xE9ponses sont examin\xE9es par l'IA, cela peut prendre quelques secondes.",reset:"R\xE9initialiser",back:"Retour",annexDocuments:"Documents",annexEmptyTitle:"Aucune annexe pour l'instant",annexEmptyBody:"Un texte, une figure, un tableau ou un document qui reste visible pour toute l'\xE9valuation pendant que les \xE9l\xE8ves r\xE9pondent.",annexEmptyCta:"Ajouter une annexe",annexEmptyDismiss:"Masquer","timeUp.title":"Temps \xE9coul\xE9","timeUp.submitting":"Envoi de vos r\xE9ponses\u2026",yourScore:"Votre score",answersSaving:"Enregistrement\u2026",answersSaved:"R\xE9ponses enregistr\xE9es",answersNotSaved:"Vos r\xE9ponses ne sont pas enregistr\xE9es. V\xE9rifiez votre connexion.",resumeRestored:"Bon retour. Vos r\xE9ponses sont l\xE0.",resumeFresh:"Bon retour.",resumeTimeLeft:"Le chrono a continu\xE9 : il reste {minutes} min.",close:"Fermer"},cd={exercise:"\u062A\u0645\u0631\u064A\u0646 {index}",question:"\u0633\u0624\u0627\u0644 {index}",points:"\u0646\u0642\u0637\u0629","points.two":"\u0646\u0642\u0637\u062A\u0627\u0646","points.few":"\u0646\u0642\u0627\u0637",submit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",submitting:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644...",confirmTitle:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",confirmDescription:"\u0647\u0644 \u0623\u0646\u062A \u0645\u062A\u0623\u0643\u062F \u0645\u0646 \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u061F \u0644\u0646 \u062A\u062A\u0645\u0643\u0646 \u0645\u0646 \u062A\u063A\u064A\u064A\u0631 \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0628\u0639\u062F \u0627\u0644\u0625\u0631\u0633\u0627\u0644.",unansweredOne:"\u0644\u0645 \u062A\u064F\u0643\u0645\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0639\u0646 \u0633\u0624\u0627\u0644 \u0648\u0627\u062D\u062F.",unansweredMany:"\u0644\u0645 \u062A\u064F\u0643\u0645\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0639\u0646 {count} \u0645\u0646 \u0627\u0644\u0623\u0633\u0626\u0644\u0629.",unansweredMore:"\u0648{count} \u0623\u062E\u0631\u0649",confirmSubmit:"\u0625\u0631\u0633\u0627\u0644",confirmCancel:"\u0625\u0644\u063A\u0627\u0621",assessmentPassed:"\u0627\u062C\u062A\u064A\u0627\u0632 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",assessmentNotPassed:"\u0644\u0645 \u064A\u062A\u0645 \u0627\u062C\u062A\u064A\u0627\u0632 \u0627\u0644\u062A\u0642\u064A\u064A\u0645",awaitingReview:"\u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u062A\u0635\u062D\u064A\u062D",awaitingReviewDesc:"\u064A\u0642\u0648\u0645 \u0645\u0639\u0644\u0645\u0643 \u0628\u0645\u0631\u0627\u062C\u0639\u0629 \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0627\u0644\u0645\u0641\u062A\u0648\u062D\u0629. \u0633\u062A\u0638\u0647\u0631 \u0639\u0644\u0627\u0645\u062A\u0643 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 \u0628\u0639\u062F \u0627\u0643\u062A\u0645\u0627\u0644 \u0627\u0644\u062A\u0635\u062D\u064A\u062D.",submittedNoScore:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643",submittedNoScoreDesc:"\u0644\u0627 \u0639\u0644\u0627\u0645\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u062A\u0642\u064A\u064A\u0645: \u0627\u0646\u0638\u0631 \u0623\u062F\u0646\u0627\u0647 \u0645\u0627 \u0623\u062C\u0628\u062A \u0639\u0646\u0647 \u0628\u0634\u0643\u0644 \u0635\u062D\u064A\u062D \u0648\u0645\u0627 \u064A\u062C\u0628 \u0645\u0631\u0627\u062C\u0639\u062A\u0647.",formThanks:"\u0634\u0643\u0631\u064B\u0627 \u0644\u0643!",formThanksDesc:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643.",formThanksClose:"\u064A\u0645\u0643\u0646\u0643 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0635\u0641\u062D\u0629.",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSending:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",formConfirmTitle:"\u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u061F",formConfirmDescription:"\u0644\u0646 \u062A\u062A\u0645\u0643\u0646 \u0645\u0646 \u062A\u0639\u062F\u064A\u0644\u0647\u0627 \u0628\u0639\u062F \u0627\u0644\u0625\u0631\u0633\u0627\u0644.",required:"\u0645\u0637\u0644\u0648\u0628",requiredMissing:"\u0647\u0630\u0627 \u0633\u0624\u0627\u0644 \u0645\u0637\u0644\u0648\u0628",requiredBlocked:"\u0633\u0624\u0627\u0644 \u0645\u0637\u0644\u0648\u0628 \u0628\u0644\u0627 \u0625\u062C\u0627\u0628\u0629: \u0623\u062C\u0628 \u0639\u0646\u0647 \u062B\u0645 \u0623\u0631\u0633\u0644 \u0645\u0646 \u062C\u062F\u064A\u062F.",continue:"\u0645\u062A\u0627\u0628\u0639\u0629",beingMarked:"\u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D",beingMarkedDesc:"\u0628\u0639\u0636 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A \u0645\u0627 \u0632\u0627\u0644\u062A \u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D. \u0633\u062A\u0638\u0647\u0631 \u0639\u0644\u0627\u0645\u062A\u0643 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 \u0628\u0639\u062F \u062A\u0635\u062D\u064A\u062D \u062C\u0645\u064A\u0639 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A.",pendingReview:"\u0642\u064A\u062F \u0627\u0644\u062A\u0635\u062D\u064A\u062D",viewFullReport:"\u0639\u0631\u0636 \u0627\u0644\u062A\u0642\u0631\u064A\u0631 \u0627\u0644\u0643\u0627\u0645\u0644",explanation:"\u0634\u0631\u062D",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 Edpire",evaluating:"\u062C\u0627\u0631\u064D \u062A\u0642\u064A\u064A\u0645 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u2026",aiEvaluating:"\u0628\u0639\u0636 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A \u0642\u064A\u062F \u0627\u0644\u0645\u0631\u0627\u062C\u0639\u0629 \u0628\u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A\u060C \u0642\u062F \u064A\u0633\u062A\u063A\u0631\u0642 \u0630\u0644\u0643 \u0628\u0636\u0639 \u062B\u0648\u0627\u0646\u064D.",reset:"\u0625\u0639\u0627\u062F\u0629 \u062A\u0639\u064A\u064A\u0646",back:"\u0631\u062C\u0648\u0639",annexDocuments:"\u0627\u0644\u0645\u0633\u062A\u0646\u062F\u0627\u062A",annexEmptyTitle:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u064F\u0644\u062D\u064E\u0642 \u0628\u0639\u062F",annexEmptyBody:"\u0646\u0635 \u0623\u0648 \u0635\u0648\u0631\u0629 \u0623\u0648 \u062C\u062F\u0648\u0644 \u0623\u0648 \u0645\u0633\u062A\u0646\u062F \u064A\u0628\u0642\u0649 \u0638\u0627\u0647\u0631\u064B\u0627 \u0637\u0648\u0627\u0644 \u0627\u0644\u062A\u0642\u064A\u064A\u0645 \u0623\u062B\u0646\u0627\u0621 \u0625\u062C\u0627\u0628\u0629 \u0627\u0644\u0637\u0644\u0627\u0628.",annexEmptyCta:"\u0625\u0636\u0627\u0641\u0629 \u0645\u064F\u0644\u062D\u064E\u0642",annexEmptyDismiss:"\u0625\u062E\u0641\u0627\u0621","timeUp.title":"\u0627\u0646\u062A\u0647\u0649 \u0627\u0644\u0648\u0642\u062A","timeUp.submitting":"\u062C\u0627\u0631\u064D \u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A\u0643\u2026",yourScore:"\u0646\u062A\u064A\u062C\u062A\u0643",answersSaving:"\u062C\u0627\u0631\u064D \u0627\u0644\u062D\u0641\u0638\u2026",answersSaved:"\u062A\u0645 \u062D\u0641\u0638 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",answersNotSaved:"\u0644\u0627 \u064A\u062A\u0645 \u062D\u0641\u0638 \u0625\u062C\u0627\u0628\u0627\u062A\u0643. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643.",resumeRestored:"\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643. \u0625\u062C\u0627\u0628\u0627\u062A\u0643 \u0647\u0646\u0627.",resumeFresh:"\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0639\u0648\u062F\u062A\u0643.",resumeTimeLeft:"\u0627\u0633\u062A\u0645\u0631\u0651 \u0627\u0644\u0645\u0624\u0642\u0651\u062A: \u062A\u0628\u0642\u0651\u0649 {minutes} \u062F\u0642\u064A\u0642\u0629.",close:"\u0625\u063A\u0644\u0627\u0642"},Or={en:id,fr:sd,ar:cd};function ld(e,r,t){let a=(Or[e]??Or.en)[r]??Or.en[r]??r;return t?Object.entries(t).reduce((o,[i,s])=>o.replace(`{${i}}`,String(s)),a):a}function Go(e,r){let t=new Intl.PluralRules(e).select(r),n=Or[e]??Or.en;return n[`points.${t}`]??n.points??Or.en.points}function Yo(e){return(r,t)=>ld(e,r,t)}function ea(e){return e==="ar"}var Ko="48rem";function Cr(e,{insertAt:r}={}){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",r==="top"&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Cr(`:root{--ink: #1d2025;--ink-soft: #565b66;--ink-faint: #8d93a0;--ui-muted: #f5f4f1;--line: #e7e5e0;--line-strong: #d6d3cc;--ok: #1f8a4c;--ok-soft: #ecf8f0;--pen: #d23b2b;--pen-soft: #fdeeec;--almost: #c8810e;--almost-ink: #8a5a08;--almost-soft: #fbf1dc;--font-hand: "Caveat", cursive}@keyframes answer-shake{10%,90%{transform:translate(-2px)}20%,80%{transform:translate(4px)}30%,50%,70%{transform:translate(-6px)}40%,60%{transform:translate(6px)}}@keyframes hop{0%,to{transform:translateY(0) scale(1)}40%{transform:translateY(-6%) scale(1.05)}}@keyframes wobble{0%,to{transform:translate(0)}15%,85%{transform:translate(-4px)}30%,70%{transform:translate(4px)}45%,55%{transform:translate(-2px)}}.animate-shake{animation:answer-shake .4s both}.animate-hop{animation:hop .5s ease-out}.animate-wobble{animation:wobble .5s ease}.cs-player__grid{display:grid;gap:calc(.75rem * var(--edp-scale, 1));grid-template-columns:repeat(1,minmax(0,1fr))}@media(min-width:40rem){:where(.cs-player:not(.cs-player--box)) .cs-player__grid--row{grid-template-columns:repeat(2,minmax(0,1fr))}}.cs-player--box{container-type:inline-size}@container (min-width: 35.5em){.cs-player--box .cs-player__grid--row{grid-template-columns:repeat(2,minmax(0,1fr))}}.player-choice{position:relative;display:inline-flex;align-items:center;gap:calc(.75rem * var(--edp-scale, 1));flex-wrap:wrap;width:100%;padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1));border:1.5px solid var(--line, #e7e5e0);border-radius:calc(.75rem * var(--edp-scale, 1));background-color:#fff;color:var(--ink, #1d2025);cursor:pointer;user-select:none;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease;font-weight:500;text-align:start}.player-choice:hover:not(:disabled){background-color:var(--ui-muted, #f5f4f1);border-color:var(--line-strong, #d6d3cc)}.player-choice:disabled{cursor:default}.player-choice>img{flex-shrink:0}.player-choice__mark{flex:none;display:grid;place-items:center;width:calc(20px * var(--edp-scale, 1));height:calc(20px * var(--edp-scale, 1));border:1.5px solid var(--ink-faint, #8d93a0);background:#fff;color:#fff;transition:border-color .15s,background .15s}.player-choice__mark--radio{border-radius:999px}.player-choice__mark--box{border-radius:calc(6px * var(--edp-scale, 1))}.player-choice__mark>svg{width:calc(13px * var(--edp-scale, 1));height:calc(13px * var(--edp-scale, 1));opacity:0}.player-choice__text{flex:1;min-width:0}.player-choice{height:100%}.player-choice__text img,.player-choice__text video,.player-choice__text iframe{max-height:calc(120px * var(--edp-scale, 1));width:auto;max-width:100%}.player-choice--tile{flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:calc(.5rem * var(--edp-scale, 1));padding:calc(1rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1))}.player-choice--tile .player-choice__mark{position:absolute;top:calc(.5rem * var(--edp-scale, 1));inset-inline-start:calc(.5rem * var(--edp-scale, 1))}.player-choice--tile .player-choice__text{flex:0 1 auto;width:100%;text-align:center}.player-choice--tile .player-choice__text img,.player-choice--tile .player-choice__text video,.player-choice--tile .player-choice__text iframe{display:block!important;margin-inline:auto;margin-bottom:calc(.4rem * var(--edp-scale, 1))}.player-choice--selected{background-color:var(--ui-muted, #f5f4f1);border-color:var(--ink, #1d2025)}.player-choice--selected .player-choice__mark{border-color:var(--ink, #1d2025);background:var(--ink, #1d2025)}.player-choice--selected .player-choice__mark>svg{opacity:1}.player-choice--correct{background-color:var(--ok-soft, #ecf8f0);border-color:var(--ok, #1f8a4c)}.player-choice--correct .player-choice__mark{border-color:var(--ok, #1f8a4c);background:var(--ok, #1f8a4c)}.player-choice--correct .player-choice__mark>svg{opacity:1}.player-choice--correct-unchosen{background-color:#fff;border-color:var(--ok, #1f8a4c);border-style:dashed}.player-choice--correct-unchosen .player-choice__mark{border-color:var(--ok, #1f8a4c)}.player-choice--incorrect{background-color:var(--pen-soft, #fdeeec);border-color:var(--pen, #d23b2b)}.player-choice--incorrect .player-choice__mark{border-color:var(--pen, #d23b2b);background:var(--pen, #d23b2b)}.player-choice--incorrect .player-choice__mark>svg{opacity:1}.player-choice--muted{opacity:.55}.player-choice--partial{background-color:var(--ok-soft, #ecf8f0);border-color:var(--ok, #1f8a4c)}.player-choice--disabled{cursor:default}.player-choice__mark--letter{width:calc(1.625rem * var(--edp-scale, 1));height:calc(1.625rem * var(--edp-scale, 1));color:var(--ink, #1d2025);font-size:.8em;font-weight:700;line-height:1}.player-choice--selected .player-choice__mark--letter,.player-choice--correct .player-choice__mark--letter,.player-choice--incorrect .player-choice__mark--letter{color:#fff}.player-choice--correct-unchosen .player-choice__mark--letter{color:var(--ok, #1f8a4c)}.player-choice__verdict{flex:none;display:grid;place-items:center;margin-inline-start:auto}.player-choice__verdict>svg{width:calc(1.125rem * var(--edp-scale, 1));height:calc(1.125rem * var(--edp-scale, 1))}.player-choice__verdict--correct{color:var(--ok, #1f8a4c)}.player-choice__verdict--incorrect{color:var(--pen, #d23b2b)}.player-choice--tile .player-choice__verdict{position:absolute;top:calc(.5rem * var(--edp-scale, 1));inset-inline-end:calc(.5rem * var(--edp-scale, 1));margin:0}.player-inline-choice{display:inline-flex;align-items:center;gap:calc(.25rem * var(--edp-scale, 1));padding:.05em .55em;border:1.5px solid var(--line-strong, #d6d3cc);border-radius:999px;background:#fff;color:var(--ink, #1d2025);font-size:.9em;line-height:inherit;cursor:pointer;user-select:none;transition:border-color .15s,background .15s}.player-inline-choice:hover:not(:disabled){background:var(--ui-muted, #f5f4f1)}.player-inline-choice:disabled{cursor:default}.player-inline-choice--selected{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-inline-choice--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-inline-choice--correct-unchosen{border-color:var(--ok, #1f8a4c);border-style:dashed}.player-inline-choice--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-inline-choice--muted{opacity:.55}.player-inline-choice:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.player-blank-input{display:inline-block;min-width:3ch;padding:calc(.25rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border:none;border-bottom:2px solid var(--line-strong, #d6d3cc);background-color:transparent;font-size:inherit;font-family:inherit;transition:all .2s ease;outline:none}.player-blank-input:focus{border-bottom-color:var(--ink, #1d2025);background-color:var(--ui-muted, #f5f4f1)}.player-blank-input--correct{border-bottom-color:var(--ok, #1f8a4c);background-color:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-blank-input--incorrect{border-bottom-color:var(--pen, #d23b2b);background-color:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-blank-input:disabled{opacity:.7;cursor:not-allowed}.player-typed-blank{display:inline-block;min-width:7ch;max-width:100%;padding:0 calc(.25rem * var(--edp-scale, 1));font-weight:600;text-align:center;line-height:1.25;border:1px solid var(--line-strong, #d6d3cc);border-bottom-width:2px;border-radius:calc(2px * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);outline:none;resize:none;overflow:hidden;vertical-align:middle}.player-typed-blank::placeholder{color:var(--ink-faint, #8d93a0);font-weight:500}.player-typed-blank:focus{border-color:var(--ink, #1d2025)}.player-typed-blank--pending{border-color:var(--ink-faint, #8d93a0);background:var(--card, #ffffff)}.player-blank-cell{display:flex;flex-wrap:wrap;align-items:center;gap:calc(.125rem * var(--edp-scale, 1)) calc(.25rem * var(--edp-scale, 1));width:100%}.player-blank-cell__box{position:relative;display:block;flex:1 1 100%;min-width:0}.player-typed-blank--cell{display:block;box-sizing:border-box;width:100%;min-width:6.5ch;padding:calc(1px * var(--edp-scale, 1)) calc(2px * var(--edp-scale, 1));font:inherit;font-weight:600;line-height:1.3;white-space:nowrap;overflow-x:hidden}.player-typed-blank-feedback--cell{display:block;box-sizing:border-box;width:max-content;min-width:100%;max-width:none;white-space:nowrap;overflow:visible}.player-blank-cell .player-blank-reveal{white-space:nowrap;font-size:.9em}.edp-table-arrows{display:flex;justify-content:flex-end}.edp-table-arrows--top{margin-bottom:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrows--bottom{margin-top:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrows__pair{display:inline-flex;gap:calc(.375rem * var(--edp-scale, 1))}.edp-table-arrow{display:inline-flex;align-items:center;justify-content:center;width:calc(1.875rem * var(--edp-scale, 1));height:calc(1.875rem * var(--edp-scale, 1));padding:0;border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--card, #ffffff);color:var(--ink, #1d2025);cursor:pointer;transition:border-color .15s,background .15s,opacity .15s;-webkit-tap-highlight-color:transparent}.edp-table-arrow:hover:not(:disabled){border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.edp-table-arrow:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.edp-table-arrow:disabled{opacity:.35;cursor:default}.edp-table-shade{position:absolute;top:0;bottom:0;width:calc(1.5rem * var(--edp-scale, 1));pointer-events:none;z-index:2}.edp-table-shade--left{background:linear-gradient(to right,#1d202529,#1d202500)}.edp-table-shade--right{background:linear-gradient(to left,#1d202529,#1d202500)}@media(max-width:640px){.edp-table-first{max-width:38vw}}.player-typed-blank-feedback{display:inline-block;min-width:2ch;max-width:100%;padding:0 calc(.25rem * var(--edp-scale, 1));font-weight:600;text-align:center;line-height:1.25;border:1px solid var(--line-strong, #d6d3cc);border-bottom-width:2px;border-radius:calc(2px * var(--edp-scale, 1));overflow-x:auto;cursor:default;vertical-align:middle}.player-typed-blank-feedback--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-typed-blank-feedback--partial{border-color:var(--ok, #1f8a4c);border-style:dashed;background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-typed-blank-feedback--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b);text-decoration:line-through}.player-typed-blank-spinner{display:inline-block;width:calc(.75rem * var(--edp-scale, 1));height:calc(.75rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:999px;animation:blank-spin .7s linear infinite}@keyframes blank-spin{to{transform:rotate(360deg)}}.player-blank-reveal{font-weight:700;color:var(--ok, #1f8a4c);font-size:.875em;word-break:break-word;min-width:0}.player-blank-feedback{display:inline-block;font-size:.8em;font-weight:500;line-height:1.3;padding:calc(2px * var(--edp-scale, 1)) calc(8px * var(--edp-scale, 1));border-radius:999px;word-break:break-word;min-width:0;background:var(--ui-muted, #f5f4f1);color:var(--ink-soft, #565b66)}.player-blank-feedback--correct{background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-blank-feedback--incorrect{background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-blank-hint-btn{width:calc(1rem * var(--edp-scale, 1));height:calc(1rem * var(--edp-scale, 1));border:0;border-radius:999px;background:#fbbf24;color:#fff;font-size:calc(10px * var(--edp-scale, 1));font-weight:700;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s}.player-blank-hint-btn:hover,.player-blank-hint-btn--pinned{background:#f59e0b}.player-blank-hint-pop{position:absolute;bottom:100%;left:50%;transform:translate(-50%);margin-bottom:calc(.5rem * var(--edp-scale, 1));z-index:9999;min-width:calc(180px * var(--edp-scale, 1));max-width:calc(300px * var(--edp-scale, 1));width:max-content;background:#fffbeb;border:1px solid #fde68a;border-radius:calc(14px * var(--edp-scale, 1));box-shadow:0 8px 24px #92400e2e;padding:calc(.5rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));color:#78350f}.matching-player-hintrow{display:flex;justify-content:flex-start;margin-bottom:calc(.4rem * var(--edp-scale, 1))}.player-choice-blank{display:inline-flex;align-items:center;justify-content:center;min-width:4ch;padding:calc(.1rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border:2px dashed var(--line-strong, #d6d3cc);border-radius:calc(.5rem * var(--edp-scale, 1));color:var(--ink-faint, #8d93a0);background:transparent;transition:border-color .15s,background .15s,transform .15s,color .15s;vertical-align:middle}.player-choice-blank--target{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-choice-blank--over{border-style:solid;border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1);transform:scale(1.05)}.player-choice-blank--filled{border-style:solid;border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);cursor:pointer}.player-choice-blank--correct,.player-choice-blank--partial{border-style:solid;border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-choice-blank--incorrect{border-style:solid;border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-choice-blank__clear{margin-inline-start:calc(.25rem * var(--edp-scale, 1));opacity:0;font-size:calc(.75rem * var(--edp-scale, 1));line-height:1;transition:opacity .12s}.player-choice-blank--filled:hover .player-choice-blank__clear{opacity:.6}.player-word-bank{margin:calc(1rem * var(--edp-scale, 1)) 0;position:relative;border:1px solid var(--line, #e7e5e0);border-radius:calc(14px * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1))}.player-word-bank__label{margin-bottom:calc(.5rem * var(--edp-scale, 1));font-size:.7em;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft, #565b66);user-select:none}.player-word-bank__items{display:flex;flex-wrap:wrap;gap:calc(.5rem * var(--edp-scale, 1))}.player-word-bank__items--grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(calc(10rem * var(--edp-scale, 1)),1fr));gap:calc(.5rem * var(--edp-scale, 1))}.player-bank-pill{display:inline-block;padding:calc(.35rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--card, #ffffff);color:var(--ink, #1d2025);user-select:none;-webkit-touch-callout:none;touch-action:manipulation;cursor:grab;transition:border-color .15s,background .15s,box-shadow .15s}.player-bank-pill:hover{border-color:var(--ink, #1d2025);background:var(--ui-muted, #f5f4f1)}.player-bank-pill--dragging{opacity:.5;cursor:grabbing;box-shadow:0 8px 24px #1d20252e}.player-bank-pill--hinted{position:relative}.player-tap-hint{position:absolute;left:calc(50% - 10px * var(--edp-scale, 1));top:50%;width:calc(30px * var(--edp-scale, 1));height:calc(30px * var(--edp-scale, 1));z-index:2;pointer-events:none;color:var(--ink, #1d2025)}.player-tap-hint__hand{display:block;width:100%;height:100%;opacity:.92;filter:drop-shadow(0 2px 3px rgba(29,32,37,.25));transform-origin:33% 8%;animation:edp-tap-hand 1.8s ease-in-out infinite}.player-tap-hint__ripple{position:absolute;left:calc(10px * var(--edp-scale, 1) - 11px);top:-11px;width:22px;height:22px;border-radius:999px;border:2px solid var(--ink, #1d2025);opacity:0;animation:edp-tap-ripple 1.8s ease-out infinite}@keyframes edp-tap-hand{0%,to{transform:translateY(12px)}30%{transform:translateY(0) scale(1)}38%{transform:translateY(1px) scale(.88)}48%{transform:translateY(0) scale(1)}75%{transform:translateY(12px)}}@keyframes edp-tap-ripple{0%,34%{opacity:0;transform:scale(.4)}40%{opacity:.45;transform:scale(.6)}70%{opacity:0;transform:scale(1.5)}to{opacity:0}}.player-tap-hint--still .player-tap-hint__hand,.player-tap-hint--still .player-tap-hint__ripple{animation:none}@media(prefers-reduced-motion:reduce){.player-tap-hint__hand,.player-tap-hint__ripple{animation:none}}.exercise-runtime{font-family:var(--brand-font, "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif);font-size:calc(1.25rem * var(--edp-scale, 1));line-height:1.6;color:#1f2937}.exercise-runtime input,.exercise-runtime textarea{font-family:inherit}@media(min-width:640px){.exercise-runtime{font-size:calc(1.5rem * var(--edp-scale, 1))}}@media(min-width:768px){.exercise-runtime{font-size:calc(1.5rem * var(--edp-scale, 1))}}@media(min-width:1024px){.exercise-runtime{font-size:calc(2.25rem * var(--edp-scale, 1))}}@media(min-width:1280px){.exercise-runtime{font-size:calc(2.25rem * var(--edp-scale, 1))}}.exercise-runtime :lang(ar),.exercise-runtime [lang=ar],.exercise-runtime [dir=rtl]{direction:rtl;font-family:Arial,Scheherazade New,Amiri,sans-serif;text-align:right}.exercise-runtime p{margin:.5em 0;min-height:1.5em}.exercise-runtime p:empty:after{content:"\\a0";display:inline-block;min-height:1em}.exercise-runtime strong{font-weight:600;color:inherit}.exercise-runtime em{font-style:italic}.exercise-runtime ul,.exercise-runtime ol{list-style:revert;margin-left:calc(1.25rem * var(--edp-scale, 1));padding-left:0}.exercise-runtime img{max-width:100%;height:auto;vertical-align:middle;display:inline-block;margin:0 calc(4px * var(--edp-scale, 1))}.exercise-runtime .inline-math{display:inline-block;vertical-align:middle;margin:0 calc(2px * var(--edp-scale, 1))}.exercise-runtime .math-formula{display:flex;justify-content:center;margin:1em 0}.choice-set-player{margin:calc(1rem * var(--edp-scale, 1)) 0}.choice-set-player__prompt{font-weight:600;margin-bottom:calc(.75rem * var(--edp-scale, 1));color:#374151}.choice-set-player__prompt-hint{margin-left:calc(.5rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));opacity:.7;font-weight:400}.choice-set-player__choices{display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-scale, 1))}.choice-set-player__choices--grid{display:grid;gap:calc(.75rem * var(--edp-scale, 1));grid-template-columns:1fr}@media(min-width:640px){.choice-set-player__choices--grid{grid-template-columns:repeat(2,1fr)}}.choice-set-player--inline{display:inline-flex;align-items:center;gap:calc(.5rem * var(--edp-scale, 1));flex-wrap:wrap}.choice-set-player--inline .player-choice{width:auto;padding:calc(.5rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1))}.player-choice:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.player-blank-input:focus-visible{outline:2px solid #3b82f6;outline-offset:2px}@media(prefers-contrast:high){.player-choice{border-width:3px}.player-choice--correct{border-color:#15803d}.player-choice--incorrect{border-color:#991b1b}}@media(prefers-reduced-motion:reduce){.animate-shake,.animate-hop,.animate-wobble{animation:none}.player-choice{transition:none}}@media print{.exercise-runtime{font-size:12pt;color:#000}.player-choice{border:1px solid black;background-color:#fff;page-break-inside:avoid}.player-choice--correct:after{content:" \\2713";font-weight:700}.player-choice--incorrect:after{content:" \\2717";font-weight:700}}.matching-player{margin:calc(1rem * var(--edp-scale, 1)) 0}.matching-player-feedback{display:flex;align-items:center;gap:calc(.45rem * var(--edp-scale, 1));margin-top:calc(.6rem * var(--edp-scale, 1));padding:calc(.55rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));font-size:calc(.85rem * var(--edp-scale, 1));font-weight:600}.matching-player-feedback--correct{color:var(--ok, #1f8a4c);border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.matching-player-feedback--partial{color:var(--almost-ink, #8a5a08);border-color:var(--almost, #c8810e);background:var(--almost-soft, #fbf1dc)}.matching-player-feedback--incorrect{color:var(--pen, #d23b2b);border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.matching-player-score{margin-inline-start:auto;font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));line-height:1}.matching-player__instruction{display:none}.matching-player__arena{position:relative;display:flex;flex-direction:column;gap:calc(.5rem * var(--edp-scale, 1))}.matching-player__arena--dragging{user-select:none;touch-action:none}.matching-player__svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:1}.matching-player__columns{display:grid;grid-template-columns:1fr 1fr;gap:calc(5rem * var(--edp-scale, 1));align-items:start;position:relative}.matching-player__column{display:flex;flex-direction:column;gap:calc(.5rem * var(--edp-scale, 1))}.matching-player__item{display:flex;align-items:center;flex-wrap:wrap;gap:calc(.5rem * var(--edp-scale, 1));width:100%;padding:calc(.75rem * var(--edp-scale, 1)) calc(1rem * var(--edp-scale, 1));border:2px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--card, #ffffff);text-align:left;transition:border-color .15s,background .15s,box-shadow .15s,transform .1s;font-size:inherit;font-family:inherit;color:var(--ink, #1d2025);min-height:calc(52px * var(--edp-scale, 1));user-select:none;-webkit-tap-highlight-color:transparent}.matching-player__item:not(.matching-player__item--disabled){cursor:grab}.matching-player__item:not(.matching-player__item--disabled):active{cursor:grabbing}.matching-player__item:hover:not(.matching-player__item--disabled){border-color:var(--line-strong, #d6d3cc);background:var(--ui-muted, #f5f4f1)}.matching-player__item--selected{border-color:var(--ink, #1d2025)!important;background:var(--ui-muted, #f5f4f1)!important;box-shadow:0 0 0 3px #1d20251f;transform:scale(1.02)}.matching-player__item--available{border-color:var(--ink-faint, #8d93a0);border-style:dashed}.matching-player__item--available:hover{border-color:var(--ink, #1d2025);border-style:solid;background:var(--ui-muted, #f5f4f1)}.matching-player__item--matched{border-width:2px;border-color:var(--ink, #1d2025)}.matching-player__item--matched:hover:not(.matching-player__item--disabled){background:var(--ui-muted, #f5f4f1)}.matching-player__item--correct,.matching-player__item--correct:hover{border-color:var(--ok, #1f8a4c)!important;background:var(--ok-soft, #ecf8f0)!important}.matching-player__item--incorrect,.matching-player__item--incorrect:hover{border-color:var(--pen, #d23b2b)!important;background:var(--pen-soft, #fdeeec)!important}.matching-player__item--disabled{cursor:default;pointer-events:none}.matching-player__item-text{flex:1;min-width:0;line-height:1.4}.matching-player__item-text p{margin:0}.matching-player__pair-num{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:calc(22px * var(--edp-scale, 1));height:calc(22px * var(--edp-scale, 1));border-radius:50%;font-size:calc(.7rem * var(--edp-scale, 1));font-weight:700;line-height:1;background:var(--ink, #1d2025);color:#fff}.matching-player__item--correct .matching-player__pair-num{background:var(--ok, #1f8a4c)}.matching-player__item--incorrect .matching-player__pair-num{background:var(--pen, #d23b2b)}.matching-player__connector{flex-shrink:0;color:var(--ink-faint, #8d93a0);display:flex;align-items:center;transition:color .2s,transform .2s;border-radius:50%}.matching-player__item:hover .matching-player__connector{color:var(--ink, #1d2025);transform:scale(1.25)}.matching-player__connector--left{order:10;margin-left:calc(6px * var(--edp-scale, 1))}.matching-player__connector--right{order:-1;margin-right:calc(6px * var(--edp-scale, 1))}.matching-player__connector svg{width:calc(18px * var(--edp-scale, 1));height:calc(18px * var(--edp-scale, 1))}.matching-player__correct-hint{width:100%;order:20;font-weight:700;color:var(--ok, #1f8a4c);font-size:.82em;line-height:1.4;padding-top:.1em;word-break:break-word}.matching-player__correct-hint p{display:inline;margin:0}.matching-player__item:focus-visible{outline:3px solid var(--ink, #1d2025);outline-offset:2px}.blank-correct-hint{display:inline;font-weight:700;color:var(--ok, #1f8a4c);font-size:.875em;margin-left:.3em;word-break:break-word}@keyframes matching-pulse{0%{opacity:.5}to{opacity:1}}@media(prefers-reduced-motion:reduce){.matching-player__item{transition:none}}@media(max-width:600px){:where(.matching-player:not(.matching-player--box)) .matching-player__columns{gap:calc(1rem * var(--edp-scale, 1))}:where(.matching-player:not(.matching-player--box)) .matching-player__item{padding:calc(.5rem * var(--edp-scale, 1)) calc(.6rem * var(--edp-scale, 1));min-height:calc(44px * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));gap:calc(.35rem * var(--edp-scale, 1))}.matching-player__item:not(.matching-player__item--disabled){cursor:pointer}.matching-player__item:not(.matching-player__item--disabled):active{cursor:pointer}:where(.matching-player:not(.matching-player--box)) .matching-player__connector svg{width:calc(15px * var(--edp-scale, 1));height:calc(15px * var(--edp-scale, 1))}}.matching-player--box{container-type:inline-size}@container (max-width: 33.3em){.matching-player--box .matching-player__columns{gap:calc(1rem * var(--edp-scale, 1))}.matching-player--box .matching-player__item{padding:calc(.5rem * var(--edp-scale, 1)) calc(.6rem * var(--edp-scale, 1));min-height:calc(44px * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));gap:calc(.35rem * var(--edp-scale, 1))}.matching-player--box .matching-player__connector svg{width:calc(15px * var(--edp-scale, 1));height:calc(15px * var(--edp-scale, 1))}}.math-response-player{margin:calc(.5rem * var(--edp-scale, 1)) 0}.player-math-field{border:2px solid var(--line, #e7e5e0);border-radius:calc(.625rem * var(--edp-scale, 1));padding:calc(.375rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));background:var(--card, #ffffff);transition:border-color .2s ease,background .2s ease}.player-math-field:focus-within{border-color:var(--ink, #1d2025)}.player-math-field--readonly{background:var(--ui-muted, #f5f4f1)}.player-math-field__input{width:100%;min-height:calc(2.5rem * var(--edp-scale, 1));font-size:calc(1.1rem * var(--edp-scale, 1));outline:none;--primary: var(--ink, #1d2025);--caret-color: var(--ink, #1d2025);--selection-background-color: var(--ink-soft, #565b66);--contains-highlight-background-color: var(--ui-muted, #f5f4f1)}.player-math-field__input::part(virtual-keyboard-toggle),.player-math-field__input::part(menu-toggle){color:var(--ink-faint, #8d93a0)}.player-math-field__fallback{width:100%;border:none;outline:none;font-size:calc(1rem * var(--edp-scale, 1));font-family:monospace;background:transparent;color:var(--ink, #1d2025)}.player-math-field--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-math-field--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-math-field--validating{border-color:var(--ink-faint, #8d93a0)}.player-math-feedback{margin-top:calc(.4rem * var(--edp-scale, 1));font-size:calc(.8rem * var(--edp-scale, 1));font-weight:600;display:flex;align-items:center;gap:calc(.4rem * var(--edp-scale, 1))}.player-math-feedback--correct{color:var(--ok, #1f8a4c)}.player-math-feedback--incorrect{color:var(--pen, #d23b2b)}.player-math-feedback--validating{color:var(--ink-soft, #565b66)}.player-math-score{margin-inline-start:auto;font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));line-height:1;color:var(--ok, #1f8a4c)}.player-math-spinner{display:inline-block;width:calc(.9rem * var(--edp-scale, 1));height:calc(.9rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:50%;animation:player-math-spin .7s linear infinite}@keyframes player-math-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.player-math-spinner{animation:none}}.player-ai{margin:calc(1rem * var(--edp-scale, 1)) 0;padding:calc(.5rem * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-radius:calc(.875rem * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1)}.player-ai-counts{display:flex;justify-content:flex-end;gap:calc(.5rem * var(--edp-scale, 1))}.player-ai-count{font-size:calc(.75rem * var(--edp-scale, 1));font-weight:600;padding:calc(.1rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));border-radius:999px;background:var(--card, #ffffff);border:1px solid var(--line, #e7e5e0);color:var(--ink-soft, #565b66)}.player-ai-count--over{color:var(--pen, #d23b2b);border-color:var(--pen, #d23b2b)}.player-ai-count--min{color:var(--ink-faint, #8d93a0)}.player-ai-input{width:100%;box-sizing:border-box;padding:calc(.5rem * var(--edp-scale, 1)) calc(.75rem * var(--edp-scale, 1));font-size:calc(1rem * var(--edp-scale, 1));border:1px solid var(--line-strong, #d6d3cc);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--card, #ffffff);color:var(--ink, #1d2025);outline:none;transition:border-color .2s ease,background .2s ease}.player-ai-input::placeholder{color:var(--ink-faint, #8d93a0)}.player-ai-input:focus{border-color:var(--ink, #1d2025)}.player-ai-input--multiline{min-height:calc(120px * var(--edp-scale, 1));resize:vertical}.player-ai-input:disabled{cursor:default}.player-ai-input--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0)}.player-ai-input--partial{border-color:var(--almost, #c8810e);border-style:dashed;background:var(--almost-soft, #fbf1dc)}.player-ai-input--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec)}.player-ai-feedback{display:flex;flex-direction:column;gap:calc(.25rem * var(--edp-scale, 1));padding:calc(.75rem * var(--edp-scale, 1));border-radius:calc(.5rem * var(--edp-scale, 1));font-size:calc(.875rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);background:var(--card, #ffffff);color:var(--ink, #1d2025)}.player-ai-feedback--correct{border-color:var(--ok, #1f8a4c);background:var(--ok-soft, #ecf8f0);color:var(--ok, #1f8a4c)}.player-ai-feedback--partial{border-color:var(--almost, #c8810e);background:var(--almost-soft, #fbf1dc);color:var(--almost-ink, #8a5a08)}.player-ai-feedback--incorrect{border-color:var(--pen, #d23b2b);background:var(--pen-soft, #fdeeec);color:var(--pen, #d23b2b)}.player-ai-message{margin:0}.player-ai-score-row{display:flex;justify-content:flex-end}.player-ai-score{font-family:var(--font-hand, "Caveat", cursive);font-size:calc(1.5rem * var(--edp-scale, 1));font-weight:600;line-height:1;padding:0 calc(.35rem * var(--edp-scale, 1));color:inherit}.player-ai-validating{display:flex;align-items:center;gap:calc(.5rem * var(--edp-scale, 1));padding:calc(.25rem * var(--edp-scale, 1)) 0;color:var(--ink-soft, #565b66)}.player-ai-spinner{display:inline-block;width:calc(.9rem * var(--edp-scale, 1));height:calc(.9rem * var(--edp-scale, 1));border:2px solid var(--ink-faint, #8d93a0);border-top-color:transparent;border-radius:999px;animation:ai-answer-spin .7s linear infinite}@keyframes ai-answer-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.player-ai-spinner{animation:none}}.player-or-field--pre{border-color:var(--line-strong, #d6d3cc)!important}.player-or-field--correct{border-color:var(--ok, #1f8a4c)!important;background:var(--ok-soft, #ecf8f0)!important}.player-or-field--partial,.player-or-field--review{border-color:var(--almost, #c8810e)!important;background:var(--almost-soft, #fbf1dc)!important}.player-or-field--review{border-style:dashed!important}.player-or-field--incorrect{border-color:var(--pen, #d23b2b)!important;background:var(--pen-soft, #fdeeec)!important}.edp-scaled .text-xs{font-size:calc(.75rem * var(--edp-scale, 1));line-height:calc(1 / .75)}.edp-scaled .text-sm{font-size:calc(.875rem * var(--edp-scale, 1));line-height:calc(1.25 / .875)}.edp-scaled .text-base{font-size:calc(1rem * var(--edp-scale, 1));line-height:1.5}.edp-scaled .text-lg{font-size:calc(1.125rem * var(--edp-scale, 1));line-height:calc(1.75 / 1.125)}.edp-scaled .text-\\[10px\\]{font-size:calc(10px * var(--edp-scale, 1))}.edp-scaled .prose-sm{font-size:calc(.875rem * var(--edp-scale, 1))}.edp-scaled .p-2{padding:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .p-3{padding:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .p-4{padding:calc(1rem * var(--edp-scale, 1))}.edp-scaled .p-6{padding:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .pb-1{padding-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .pt-1\\.5{padding-top:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .px-1\\.5{padding-left:calc(.375rem * var(--edp-scale, 1));padding-right:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .px-2{padding-left:calc(.5rem * var(--edp-scale, 1));padding-right:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .px-3{padding-left:calc(.75rem * var(--edp-scale, 1));padding-right:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .px-4{padding-left:calc(1rem * var(--edp-scale, 1));padding-right:calc(1rem * var(--edp-scale, 1))}.edp-scaled .px-5{padding-left:calc(1.25rem * var(--edp-scale, 1));padding-right:calc(1.25rem * var(--edp-scale, 1))}.edp-scaled .px-6{padding-left:calc(1.5rem * var(--edp-scale, 1));padding-right:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .py-0\\.5{padding-top:calc(.125rem * var(--edp-scale, 1));padding-bottom:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .py-1{padding-top:calc(.25rem * var(--edp-scale, 1));padding-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .py-1\\.5{padding-top:calc(.375rem * var(--edp-scale, 1));padding-bottom:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .py-2{padding-top:calc(.5rem * var(--edp-scale, 1));padding-bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .py-3{padding-top:calc(.75rem * var(--edp-scale, 1));padding-bottom:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .mb-1{margin-bottom:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .mb-2{margin-bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .ml-1{margin-left:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .ml-2{margin-left:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .mr-2{margin-right:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .mt-0\\.5{margin-top:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .mt-1{margin-top:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .mt-1\\.5{margin-top:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .mt-3{margin-top:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .mx-1{margin-left:calc(.25rem * var(--edp-scale, 1));margin-right:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .my-3{margin-top:calc(.75rem * var(--edp-scale, 1));margin-bottom:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .my-4{margin-top:calc(1rem * var(--edp-scale, 1));margin-bottom:calc(1rem * var(--edp-scale, 1))}.edp-scaled .gap-1{gap:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .gap-1\\.5{gap:calc(.375rem * var(--edp-scale, 1))}.edp-scaled .gap-2{gap:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .gap-3{gap:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .gap-x-1{column-gap:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .gap-y-0\\.5{row-gap:calc(.125rem * var(--edp-scale, 1))}.edp-scaled .w-6{width:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .w-16{width:calc(4rem * var(--edp-scale, 1))}.edp-scaled .h-6{height:calc(1.5rem * var(--edp-scale, 1))}.edp-scaled .h-8{height:calc(2rem * var(--edp-scale, 1))}.edp-scaled .h-16{height:calc(4rem * var(--edp-scale, 1))}.edp-scaled .max-h-48{max-height:calc(12rem * var(--edp-scale, 1))}.edp-scaled .right-1{right:calc(.25rem * var(--edp-scale, 1))}.edp-scaled .right-3{right:calc(.75rem * var(--edp-scale, 1))}.edp-scaled .bottom-2{bottom:calc(.5rem * var(--edp-scale, 1))}.edp-scaled .max-w-\\[160px\\]{max-width:calc(160px * var(--edp-scale, 1))}.edp-scaled .max-w-\\[200px\\]{max-width:calc(200px * var(--edp-scale, 1))}.edp-scaled .max-w-\\[240px\\]{max-width:calc(240px * var(--edp-scale, 1))}.edp-scaled .min-h-\\[100px\\]{min-height:calc(100px * var(--edp-scale, 1))}.edp-scaled .min-h-\\[120px\\]{min-height:calc(120px * var(--edp-scale, 1))}.edp-scaled .\\[\\&_\\.ProseMirror\\]\\:min-h-\\[80px\\] .ProseMirror{min-height:calc(80px * var(--edp-scale, 1))}.math-inline,.math-block,.math-response-player,.katex,.katex-display{direction:ltr;unicode-bidi:isolate}.exercise-shared-context{font-size:calc(1.125rem * var(--edp-scale, 1));margin-bottom:calc(1rem * var(--edp-scale, 1))}.exercise-reference-cue{display:flex;flex-wrap:wrap;align-items:baseline;gap:calc(.25rem * var(--edp-scale, 1)) calc(.5rem * var(--edp-scale, 1));margin:0 0 calc(1rem * var(--edp-scale, 1));padding:calc(.625rem * var(--edp-scale, 1)) calc(.875rem * var(--edp-scale, 1));border:1px solid var(--line, #e7e5e0);border-inline-start:3px solid var(--ink-soft, #565b66);border-radius:calc(.625rem * var(--edp-scale, 1));background:var(--ui-muted, #f5f4f1);color:var(--ink-soft, #565b66);font-size:calc(1rem * var(--edp-scale, 1));line-height:1.5}.exercise-reference-cue__link{font:inherit;font-weight:600;color:var(--ink, #1d2025);background:none;border:0;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.exercise-reference-cue__link:hover{text-decoration-thickness:2px}.exercise-reference-cue__link:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px;border-radius:2px}.exercise-reference-cue__arrow{display:inline-block;margin-inline-start:.25em}.exercise-reference-cue__arrow:dir(rtl){transform:scaleX(-1)}.edp-audio{--edp-a: var(--edp-scale, 1);display:flex;flex-direction:column;gap:calc(.25rem * var(--edp-a));width:100%;max-width:100%;margin:calc(.5rem * var(--edp-a)) 0;font-size:calc(.875rem * var(--edp-a));line-height:1.4;vertical-align:middle}.edp-audio-bar{display:flex;align-items:center;gap:calc(.75rem * var(--edp-a));min-width:0;padding:calc(.375rem * var(--edp-a));padding-inline-end:calc(.75rem * var(--edp-a));background:#fff;border:1px solid var(--line, #e7e5e0);border-radius:999px}.edp-audio-play{flex:none;display:inline-flex;align-items:center;justify-content:center;width:calc(2.75rem * var(--edp-a));height:calc(2.75rem * var(--edp-a));border:0;border-radius:999px;background:var(--ink, #1d2025);color:#fff;cursor:pointer;transition:transform 90ms ease-out,background-color .18s ease-out}.edp-audio-play:hover:not(:disabled){background:#33373e}.edp-audio-play:active:not(:disabled){transform:scale(.94)}.edp-audio-play:focus-visible,.edp-audio-speed:focus-visible,.edp-audio-track:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:2px}.edp-audio-play:disabled{background:var(--line-strong, #d6d3cc);cursor:not-allowed}.edp-audio-play svg{width:calc(1.125rem * var(--edp-a));height:calc(1.125rem * var(--edp-a))}.edp-audio-track{position:relative;flex:1 1 auto;min-width:calc(3rem * var(--edp-a));height:calc(2rem * var(--edp-a));display:flex;align-items:center;touch-action:none;border-radius:4px}.edp-audio-track--seek{cursor:pointer}.edp-audio-rail{position:relative;display:block;width:100%;height:4px;border-radius:999px;background:var(--line, #e7e5e0);overflow:hidden}.edp-audio-fill{position:absolute;inset-block:0;inset-inline-start:0;background:var(--ink, #1d2025);border-radius:999px}.edp-audio-thumb{position:absolute;top:50%;width:12px;height:12px;margin-inline-start:-6px;margin-top:-6px;border-radius:999px;background:var(--ink, #1d2025);box-shadow:0 0 0 3px #fff;transition:transform .15s ease-out;pointer-events:none}.edp-audio-track--seek:hover .edp-audio-thumb,.edp-audio-track--seek:focus-visible .edp-audio-thumb{transform:scale(1.25)}.edp-audio-time{flex:none;min-width:2.6em;text-align:end;font-variant-numeric:tabular-nums;color:var(--ink-soft, #565b66);unicode-bidi:isolate}.edp-audio-speed{flex:none;min-width:3.1em;height:calc(1.75rem * var(--edp-a));padding:0 .5em;border:1px solid var(--line-strong, #d6d3cc);border-radius:999px;background:var(--ui-muted, #f5f4f1);color:var(--ink, #1d2025);font:inherit;font-size:.85em;font-weight:600;font-variant-numeric:tabular-nums;cursor:pointer;transition:border-color .18s ease-out}.edp-audio-speed:hover:not(:disabled){border-color:var(--ink-faint, #8d93a0)}.edp-audio-speed:active:not(:disabled){transform:scale(.97)}.edp-audio-note{display:block;margin:0;padding-inline-start:calc(.75rem * var(--edp-a));font-size:.9em;color:var(--ink-soft, #565b66)}.edp-audio--off .edp-audio-bar{background:var(--ui-muted, #f5f4f1)}.edp-audio--off .edp-audio-fill{background:var(--ink-faint, #8d93a0)}@media(max-width:380px){.edp-audio-bar{gap:calc(.5rem * var(--edp-a))}}@media(pointer:coarse){.edp-audio-speed{height:calc(2.5rem * var(--edp-a));min-width:3.6em}}.edp-rec{--edp-a: var(--edp-scale, 1);display:flex;flex-direction:column;gap:calc(.75rem * var(--edp-a));padding:calc(1rem * var(--edp-a));border:1px solid var(--line, #e7e5e0);border-radius:14px;background:#fff;font-size:calc(.9375rem * var(--edp-a));line-height:1.4}.edp-rec .edp-audio{margin:0}.edp-rec-idle{display:flex;flex-direction:column;align-items:center;gap:calc(.5rem * var(--edp-a));padding:calc(.5rem * var(--edp-a)) 0}.edp-rec-record{display:inline-flex;align-items:center;justify-content:center;width:calc(4rem * var(--edp-a));height:calc(4rem * var(--edp-a));border:0;border-radius:999px;background:var(--pen, #d23b2b);color:#fff;cursor:pointer;box-shadow:0 0 0 5px var(--pen-soft, #fdeeec);transition:transform 90ms ease-out,box-shadow .18s ease-out}.edp-rec-record:hover:not(:disabled){box-shadow:0 0 0 7px var(--pen-soft, #fdeeec)}.edp-rec-record:active:not(:disabled){transform:scale(.95)}.edp-rec-record:disabled{background:var(--line-strong, #d6d3cc);box-shadow:none;cursor:not-allowed}.edp-rec-record svg{width:calc(1.6rem * var(--edp-a));height:calc(1.6rem * var(--edp-a))}.edp-rec-record:focus-visible,.edp-rec-stop:focus-visible,.edp-rec-link:focus-visible{outline:2px solid var(--ink, #1d2025);outline-offset:3px}.edp-rec-label{font-weight:600;color:var(--ink, #1d2025)}.edp-rec-limit{font-size:.9em;color:var(--ink-soft, #565b66);font-variant-numeric:tabular-nums}.edp-rec-live{display:flex;align-items:center;gap:calc(.75rem * var(--edp-a))}.edp-rec-level{flex:1 1 auto;min-width:0;width:100%;height:calc(2.5rem * var(--edp-a));display:block}.edp-rec-clock{flex:none;display:inline-flex;align-items:center;gap:.4em;font-variant-numeric:tabular-nums;color:var(--ink, #1d2025);unicode-bidi:isolate}.edp-rec-clock small{color:var(--ink-faint, #8d93a0);font-size:.9em}.edp-rec-dot{width:.6em;height:.6em;border-radius:999px;background:var(--pen, #d23b2b);animation:edp-rec-dot 1.2s ease-in-out infinite}@keyframes edp-rec-dot{50%{opacity:.35}}.edp-rec-stop{flex:none;display:inline-flex;align-items:center;gap:.45em;height:calc(2.5rem * var(--edp-a));padding:0 1em;border:1px solid var(--ink, #1d2025);border-radius:999px;background:var(--ink, #1d2025);color:#fff;font:inherit;font-weight:600;cursor:pointer}.edp-rec-stop{transition:background-color .18s ease-out,transform 90ms ease-out}.edp-rec-stop:hover{background:#33373e}.edp-rec-stop:active{transform:scale(.97)}.edp-rec-stop i{display:inline-block;width:.7em;height:.7em;border-radius:2px;background:currentColor}.edp-rec-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:calc(.5rem * var(--edp-a)) calc(1rem * var(--edp-a));min-height:1.75em}.edp-rec-status{display:inline-flex;align-items:center;gap:.4em;color:var(--ink-soft, #565b66)}.edp-rec-status--ok{color:var(--ok, #1f8a4c);font-weight:600}.edp-rec-status--error{color:var(--ink, #1d2025)}.edp-rec-status--error svg{color:var(--ink, #1d2025);flex:none}.edp-rec-progress{flex:1 1 8rem;height:4px;border-radius:999px;background:var(--line, #e7e5e0);overflow:hidden}.edp-rec-progress>span{display:block;height:100%;background:var(--ink, #1d2025);transition:width .15s ease-out}.edp-rec-link{font:inherit;font-weight:600;color:var(--ink, #1d2025);background:none;border:0;padding:.25em 0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.edp-rec-link:hover{text-decoration-thickness:2px}@media(pointer:coarse){.edp-rec-link{min-height:2.5rem;padding:0 .25em}}.edp-rec-level:dir(rtl){transform:scaleX(-1)}.edp-rec-message{margin:0;color:var(--ink-soft, #565b66);text-align:center}.edp-rec video{width:100%;max-height:16rem;border-radius:10px;background:#000}@media(prefers-reduced-motion:reduce){.edp-rec-dot{animation:none}.edp-audio-play,.edp-audio-thumb,.edp-rec-record,.edp-rec-stop,.edp-rec-progress>span{transition:none}}
77
+ `);import"katex/dist/katex.min.css";Cr(`.edpire-annex-layout{display:flex;flex:1;min-width:0;height:100%;overflow:hidden;position:relative}.edpire-annex-main{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column}.edpire-annex-panel{width:38%;min-width:calc(280px * var(--edp-scale, 1));max-width:calc(480px * var(--edp-scale, 1));flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid #e5e7eb;background:#fff;overflow:hidden}.edpire-annex-panel__header{flex-shrink:0;padding:calc(12px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));border-bottom:1px solid #f3f4f6;background:#f9fafb}.edpire-annex-panel__header-label{font-size:calc(11px * var(--edp-scale, 1));font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#6b7280}.edpire-annex-panel__scroll{flex:1;overflow-y:auto;padding:calc(24px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(32px * var(--edp-scale, 1))}.edpire-annex-tab,.edpire-annex-drawer,.edpire-annex-backdrop{display:none}@media(max-width:1023px){.edpire-annex-panel{display:none}.edpire-annex-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(8px * var(--edp-scale, 1));position:fixed;left:0;top:50%;transform:translateY(-50%);z-index:40;background:var(--edpire-annex-tab-bg, #2563eb);color:var(--edpire-annex-tab-color, #ffffff);border:none;border-radius:0 calc(10px * var(--edp-scale, 1)) calc(10px * var(--edp-scale, 1)) 0;padding:calc(18px * var(--edp-scale, 1)) calc(10px * var(--edp-scale, 1));cursor:pointer;box-shadow:2px 2px 16px #0000002e;transition:filter .15s}.edpire-annex-tab:hover{filter:brightness(.88)}.edpire-annex-tab__label{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:calc(11px * var(--edp-scale, 1));font-weight:700;letter-spacing:.07em;text-transform:uppercase;white-space:nowrap}.edpire-annex-drawer{display:flex;flex-direction:column;position:fixed;left:0;top:0;bottom:0;width:min(84vw,calc(440px * var(--edp-scale, 1)));background:#fff;z-index:50;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1);box-shadow:4px 0 32px #00000021;overflow:hidden}.edpire-annex-drawer--open{transform:translate(0)}.edpire-annex-drawer__header{display:flex;align-items:center;justify-content:space-between;padding:calc(16px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));border-bottom:1px solid #f3f4f6;background:#f9fafb;flex-shrink:0}.edpire-annex-drawer__label{font-size:calc(13px * var(--edp-scale, 1));font-weight:700;color:#111827}.edpire-annex-drawer__close{display:flex;align-items:center;justify-content:center;width:calc(28px * var(--edp-scale, 1));height:calc(28px * var(--edp-scale, 1));background:none;border:none;cursor:pointer;font-size:calc(20px * var(--edp-scale, 1));line-height:1;color:#9ca3af;border-radius:calc(6px * var(--edp-scale, 1));transition:color .15s,background .15s}.edpire-annex-drawer__close:hover{color:#111827;background:#f3f4f6}.edpire-annex-drawer__scroll{flex:1;overflow-y:auto;padding:calc(24px * var(--edp-scale, 1)) calc(20px * var(--edp-scale, 1));display:flex;flex-direction:column;gap:calc(32px * var(--edp-scale, 1))}.edpire-annex-backdrop{display:block;position:fixed;inset:0;background:#00000061;z-index:45;cursor:pointer}}
78
+ `);Cr(`/*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){.edpire-scope *,.edpire-scope :before,.edpire-scope :after,.edpire-scope ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{.edpire-scope{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-900:oklch(41.4% .112 45.904);--color-blue-600:oklch(54.6% .245 262.881);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}.edpire-scope .\\@container{container-type:inline-size}.edpire-scope .pointer-events-none{pointer-events:none}.edpire-scope .collapse{visibility:collapse}.edpire-scope .invisible{visibility:hidden}.edpire-scope .visible{visibility:visible}.edpire-scope .absolute{position:absolute}.edpire-scope .fixed{position:fixed}.edpire-scope .relative{position:relative}.edpire-scope .static{position:static}.edpire-scope .sticky{position:sticky}.edpire-scope .inset-0{inset:calc(var(--spacing) * 0)}.edpire-scope .start{inset-inline-start:var(--spacing)}.edpire-scope .start-0{inset-inline-start:calc(var(--spacing) * 0)}.edpire-scope .start-2{inset-inline-start:calc(var(--spacing) * 2)}.edpire-scope .end{inset-inline-end:var(--spacing)}.edpire-scope .end-2{inset-inline-end:calc(var(--spacing) * 2)}.edpire-scope .top-0{top:calc(var(--spacing) * 0)}.edpire-scope .top-1\\/2{top:50%}.edpire-scope .top-2{top:calc(var(--spacing) * 2)}.edpire-scope .top-4{top:calc(var(--spacing) * 4)}.edpire-scope .top-\\[calc\\(var\\(--edp-bar\\)\\+1rem\\)\\]{top:calc(var(--edp-bar) + 1rem)}.edpire-scope .right-1{right:calc(var(--spacing) * 1)}.edpire-scope .right-3{right:calc(var(--spacing) * 3)}.edpire-scope .bottom-2{bottom:calc(var(--spacing) * 2)}.edpire-scope .isolate{isolation:isolate}.edpire-scope .z-10{z-index:10}.edpire-scope .z-20{z-index:20}.edpire-scope .z-30{z-index:30}.edpire-scope .z-40{z-index:40}.edpire-scope .z-50{z-index:50}.edpire-scope .z-\\[60\\]{z-index:60}.edpire-scope .container{width:100%}@media(min-width:40rem){.edpire-scope .container{max-width:40rem}}@media(min-width:48rem){.edpire-scope .container{max-width:48rem}}@media(min-width:64rem){.edpire-scope .container{max-width:64rem}}@media(min-width:80rem){.edpire-scope .container{max-width:80rem}}@media(min-width:96rem){.edpire-scope .container{max-width:96rem}}.edpire-scope .-mx-3{margin-inline:calc(var(--spacing) * -3)}.edpire-scope .mx-1{margin-inline:calc(var(--spacing) * 1)}.edpire-scope .mx-4{margin-inline:calc(var(--spacing) * 4)}.edpire-scope .mx-auto{margin-inline:auto}.edpire-scope .my-1{margin-block:calc(var(--spacing) * 1)}.edpire-scope .my-3{margin-block:calc(var(--spacing) * 3)}.edpire-scope .my-4{margin-block:calc(var(--spacing) * 4)}.edpire-scope .ms-0\\.5{margin-inline-start:calc(var(--spacing) * .5)}.edpire-scope .ms-1{margin-inline-start:calc(var(--spacing) * 1)}.edpire-scope .ms-2{margin-inline-start:calc(var(--spacing) * 2)}.edpire-scope .ms-auto{margin-inline-start:auto}.edpire-scope .mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.edpire-scope .mt-1{margin-top:calc(var(--spacing) * 1)}.edpire-scope .mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.edpire-scope .mt-2{margin-top:calc(var(--spacing) * 2)}.edpire-scope .mt-3{margin-top:calc(var(--spacing) * 3)}.edpire-scope .mt-4{margin-top:calc(var(--spacing) * 4)}.edpire-scope .mt-6{margin-top:calc(var(--spacing) * 6)}.edpire-scope .mt-px{margin-top:1px}.edpire-scope .mr-2{margin-right:calc(var(--spacing) * 2)}.edpire-scope .mb-1{margin-bottom:calc(var(--spacing) * 1)}.edpire-scope .mb-2{margin-bottom:calc(var(--spacing) * 2)}.edpire-scope .mb-3{margin-bottom:calc(var(--spacing) * 3)}.edpire-scope .mb-5{margin-bottom:calc(var(--spacing) * 5)}.edpire-scope .ml-1{margin-left:calc(var(--spacing) * 1)}.edpire-scope .ml-auto{margin-left:auto}.edpire-scope .line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.edpire-scope .block{display:block}.edpire-scope .contents{display:contents}.edpire-scope .flex{display:flex}.edpire-scope .grid{display:grid}.edpire-scope .hidden{display:none}.edpire-scope .inline{display:inline}.edpire-scope .inline-block{display:inline-block}.edpire-scope .inline-flex{display:inline-flex}.edpire-scope .table{display:table}.edpire-scope .h-2{height:calc(var(--spacing) * 2)}.edpire-scope .h-3{height:calc(var(--spacing) * 3)}.edpire-scope .h-4{height:calc(var(--spacing) * 4)}.edpire-scope .h-5{height:calc(var(--spacing) * 5)}.edpire-scope .h-6{height:calc(var(--spacing) * 6)}.edpire-scope .h-7{height:calc(var(--spacing) * 7)}.edpire-scope .h-8{height:calc(var(--spacing) * 8)}.edpire-scope .h-9{height:calc(var(--spacing) * 9)}.edpire-scope .h-11{height:calc(var(--spacing) * 11)}.edpire-scope .h-16{height:calc(var(--spacing) * 16)}.edpire-scope .h-24{height:calc(var(--spacing) * 24)}.edpire-scope .h-\\[600px\\]{height:600px}.edpire-scope .h-dvh{height:100dvh}.edpire-scope .h-full{height:100%}.edpire-scope .h-screen{height:100vh}.edpire-scope .max-h-48{max-height:calc(var(--spacing) * 48)}.edpire-scope .max-h-\\[calc\\(100dvh-8rem\\)\\]{max-height:calc(100dvh - 8rem)}.edpire-scope .max-h-\\[calc\\(100dvh-var\\(--edp-bar\\)-2rem\\)\\]{max-height:calc(100dvh - var(--edp-bar) - 2rem)}.edpire-scope .max-h-\\[calc\\(100svh-6rem\\)\\]{max-height:calc(100svh - 6rem)}.edpire-scope .min-h-0{min-height:calc(var(--spacing) * 0)}.edpire-scope .min-h-\\[72px\\]{min-height:72px}.edpire-scope .min-h-\\[100px\\]{min-height:100px}.edpire-scope .min-h-\\[120px\\]{min-height:120px}.edpire-scope .min-h-\\[200px\\]{min-height:200px}.edpire-scope .min-h-dvh{min-height:100dvh}.edpire-scope .w-3{width:calc(var(--spacing) * 3)}.edpire-scope .w-4{width:calc(var(--spacing) * 4)}.edpire-scope .w-5{width:calc(var(--spacing) * 5)}.edpire-scope .w-6{width:calc(var(--spacing) * 6)}.edpire-scope .w-7{width:calc(var(--spacing) * 7)}.edpire-scope .w-9{width:calc(var(--spacing) * 9)}.edpire-scope .w-11{width:calc(var(--spacing) * 11)}.edpire-scope .w-12{width:calc(var(--spacing) * 12)}.edpire-scope .w-16{width:calc(var(--spacing) * 16)}.edpire-scope .w-24{width:calc(var(--spacing) * 24)}.edpire-scope .w-\\[88\\%\\]{width:88%}.edpire-scope .w-full{width:100%}.edpire-scope .w-px{width:1px}.edpire-scope .max-w-3xl{max-width:var(--container-3xl)}.edpire-scope .max-w-\\[32ch\\]{max-width:32ch}.edpire-scope .max-w-\\[200px\\]{max-width:200px}.edpire-scope .max-w-\\[240px\\]{max-width:240px}.edpire-scope .max-w-full{max-width:100%}.edpire-scope .max-w-none{max-width:none}.edpire-scope .max-w-sm{max-width:var(--container-sm)}.edpire-scope .max-w-xs{max-width:var(--container-xs)}.edpire-scope .min-w-0{min-width:calc(var(--spacing) * 0)}.edpire-scope .min-w-\\[80px\\]{min-width:80px}.edpire-scope .min-w-\\[140px\\]{min-width:140px}.edpire-scope .flex-1{flex:1}.edpire-scope .flex-none{flex:none}.edpire-scope .flex-shrink-0,.edpire-scope .shrink-0{flex-shrink:0}.edpire-scope .grow{flex-grow:1}.edpire-scope .-translate-x-\\[110\\%\\]{--tw-translate-x: -110% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope .transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.edpire-scope .animate-pulse{animation:var(--animate-pulse)}.edpire-scope .animate-spin{animation:var(--animate-spin)}.edpire-scope .cursor-default{cursor:default}.edpire-scope .cursor-pointer{cursor:pointer}.edpire-scope .resize{resize:both}.edpire-scope .flex-col{flex-direction:column}.edpire-scope .flex-wrap{flex-wrap:wrap}.edpire-scope .items-baseline{align-items:baseline}.edpire-scope .items-center{align-items:center}.edpire-scope .items-start{align-items:flex-start}.edpire-scope .justify-between{justify-content:space-between}.edpire-scope .justify-center{justify-content:center}.edpire-scope .justify-end{justify-content:flex-end}.edpire-scope .gap-0\\.5{gap:calc(var(--spacing) * .5)}.edpire-scope .gap-1{gap:calc(var(--spacing) * 1)}.edpire-scope .gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.edpire-scope .gap-2{gap:calc(var(--spacing) * 2)}.edpire-scope .gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.edpire-scope .gap-3{gap:calc(var(--spacing) * 3)}.edpire-scope .gap-4{gap:calc(var(--spacing) * 4)}.edpire-scope .gap-5{gap:calc(var(--spacing) * 5)}.edpire-scope .gap-6{gap:calc(var(--spacing) * 6)}.edpire-scope :where(.edpire-scope .space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope :where(.edpire-scope .space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope :where(.edpire-scope .space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.edpire-scope .gap-x-1{column-gap:calc(var(--spacing) * 1)}.edpire-scope .gap-x-4{column-gap:calc(var(--spacing) * 4)}.edpire-scope .gap-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.edpire-scope .gap-y-2{row-gap:calc(var(--spacing) * 2)}.edpire-scope .self-start{align-self:flex-start}.edpire-scope .self-stretch{align-self:stretch}.edpire-scope .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.edpire-scope .overflow-auto{overflow:auto}.edpire-scope .overflow-hidden{overflow:hidden}.edpire-scope .overflow-visible{overflow:visible}.edpire-scope .overflow-y-auto{overflow-y:auto}.edpire-scope .rounded{border-radius:.25rem}.edpire-scope .rounded-2xl{border-radius:var(--radius-2xl)}.edpire-scope .rounded-\\[10px\\]{border-radius:10px}.edpire-scope .rounded-\\[14px\\]{border-radius:14px}.edpire-scope .rounded-full{border-radius:3.40282e38px}.edpire-scope .rounded-lg{border-radius:var(--radius-lg)}.edpire-scope .rounded-md{border-radius:var(--radius-md)}.edpire-scope .rounded-sm{border-radius:var(--radius-sm)}.edpire-scope .rounded-xl{border-radius:var(--radius-xl)}.edpire-scope .rounded-e-lg{border-start-end-radius:var(--radius-lg);border-end-end-radius:var(--radius-lg)}.edpire-scope .rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.edpire-scope .border{border-style:var(--tw-border-style);border-width:1px}.edpire-scope .border-2{border-style:var(--tw-border-style);border-width:2px}.edpire-scope .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.edpire-scope .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.edpire-scope .border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.edpire-scope .border-dashed{--tw-border-style:dashed;border-style:dashed}.edpire-scope .border-\\[\\#c5e8d1\\]{border-color:#c5e8d1}.edpire-scope .border-\\[\\#d6d3cc\\]{border-color:#d6d3cc}.edpire-scope .border-\\[\\#e7e5e0\\]{border-color:#e7e5e0}.edpire-scope .border-\\[\\#f2e2bf\\]{border-color:#f2e2bf}.edpire-scope .border-\\[\\#f6cfc9\\]{border-color:#f6cfc9}.edpire-scope .border-amber-200{border-color:var(--color-amber-200)}.edpire-scope .border-gray-100{border-color:var(--color-gray-100)}.edpire-scope .border-gray-200{border-color:var(--color-gray-200)}.edpire-scope .border-gray-300{border-color:var(--color-gray-300)}.edpire-scope .bg-\\[\\#1d2025\\]{background-color:#1d2025}.edpire-scope .bg-\\[\\#e7e5e0\\]{background-color:#e7e5e0}.edpire-scope .bg-\\[\\#ecf8f0\\]{background-color:#ecf8f0}.edpire-scope .bg-\\[\\#f1efe9\\]{background-color:#f1efe9}.edpire-scope .bg-\\[\\#f2e2bf\\]{background-color:#f2e2bf}.edpire-scope .bg-\\[\\#f5f4f1\\]{background-color:#f5f4f1}.edpire-scope .bg-\\[\\#fbf1dc\\]{background-color:#fbf1dc}.edpire-scope .bg-\\[\\#fbfaf7\\]{background-color:#fbfaf7}.edpire-scope .bg-\\[\\#fdeeec\\]{background-color:#fdeeec}.edpire-scope .bg-amber-50{background-color:var(--color-amber-50)}.edpire-scope .bg-black\\/25{background-color:#00000040}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-black\\/25{background-color:color-mix(in oklab,var(--color-black) 25%,transparent)}}.edpire-scope .bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-black\\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.edpire-scope .bg-gray-50{background-color:var(--color-gray-50)}.edpire-scope .bg-gray-100{background-color:var(--color-gray-100)}.edpire-scope .bg-gray-300{background-color:var(--color-gray-300)}.edpire-scope .bg-red-950\\/80{background-color:#460809cc}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-red-950\\/80{background-color:color-mix(in oklab,var(--color-red-950) 80%,transparent)}}.edpire-scope .bg-white{background-color:var(--color-white)}.edpire-scope .bg-white\\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.edpire-scope .bg-white\\/60{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.edpire-scope .object-contain{object-fit:contain}.edpire-scope .object-cover{object-fit:cover}.edpire-scope .p-1{padding:calc(var(--spacing) * 1)}.edpire-scope .p-1\\.5{padding:calc(var(--spacing) * 1.5)}.edpire-scope .p-2{padding:calc(var(--spacing) * 2)}.edpire-scope .p-3{padding:calc(var(--spacing) * 3)}.edpire-scope .p-4{padding:calc(var(--spacing) * 4)}.edpire-scope .p-6{padding:calc(var(--spacing) * 6)}.edpire-scope .px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.edpire-scope .px-2{padding-inline:calc(var(--spacing) * 2)}.edpire-scope .px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.edpire-scope .px-3{padding-inline:calc(var(--spacing) * 3)}.edpire-scope .px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.edpire-scope .px-4{padding-inline:calc(var(--spacing) * 4)}.edpire-scope .px-5{padding-inline:calc(var(--spacing) * 5)}.edpire-scope .px-6{padding-inline:calc(var(--spacing) * 6)}.edpire-scope .px-10{padding-inline:calc(var(--spacing) * 10)}.edpire-scope .py-0\\.5{padding-block:calc(var(--spacing) * .5)}.edpire-scope .py-1{padding-block:calc(var(--spacing) * 1)}.edpire-scope .py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.edpire-scope .py-2{padding-block:calc(var(--spacing) * 2)}.edpire-scope .py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.edpire-scope .py-3{padding-block:calc(var(--spacing) * 3)}.edpire-scope .py-5{padding-block:calc(var(--spacing) * 5)}.edpire-scope .py-8{padding-block:calc(var(--spacing) * 8)}.edpire-scope .py-16{padding-block:calc(var(--spacing) * 16)}.edpire-scope .ps-2{padding-inline-start:calc(var(--spacing) * 2)}.edpire-scope .ps-\\[23px\\]{padding-inline-start:23px}.edpire-scope .pe-2\\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.edpire-scope .pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.edpire-scope .pt-2{padding-top:calc(var(--spacing) * 2)}.edpire-scope .pb-1{padding-bottom:calc(var(--spacing) * 1)}.edpire-scope .pb-5{padding-bottom:calc(var(--spacing) * 5)}.edpire-scope .pl-2{padding-left:calc(var(--spacing) * 2)}.edpire-scope .text-center{text-align:center}.edpire-scope .text-right{text-align:right}.edpire-scope .text-start{text-align:start}.edpire-scope .align-middle{vertical-align:middle}.edpire-scope .font-sans{font-family:var(--font-sans)}.edpire-scope .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.edpire-scope .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.edpire-scope .text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.edpire-scope .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.edpire-scope .text-\\[1\\.6rem\\]{font-size:1.6rem}.edpire-scope .text-\\[10px\\]{font-size:10px}.edpire-scope .text-\\[11px\\]{font-size:11px}.edpire-scope .leading-none{--tw-leading:1;line-height:1}.edpire-scope .leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.edpire-scope .leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.edpire-scope .font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.edpire-scope .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.edpire-scope .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.edpire-scope .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.edpire-scope .tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.edpire-scope .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.edpire-scope .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.edpire-scope .tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.edpire-scope .\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.edpire-scope .break-words{overflow-wrap:break-word}.edpire-scope .whitespace-pre-wrap{white-space:pre-wrap}.edpire-scope .text-\\[\\#1d2025\\]{color:#1d2025}.edpire-scope .text-\\[\\#1f8a4c\\]{color:#1f8a4c}.edpire-scope .text-\\[\\#8a5a08\\]{color:#8a5a08}.edpire-scope .text-\\[\\#8a8f99\\]{color:#8a8f99}.edpire-scope .text-\\[\\#8d93a0\\]{color:#8d93a0}.edpire-scope .text-\\[\\#565b66\\]{color:#565b66}.edpire-scope .text-\\[\\#a32b1e\\]{color:#a32b1e}.edpire-scope .text-\\[\\#c8810e\\]{color:#c8810e}.edpire-scope .text-\\[\\#d23b2b\\]{color:#d23b2b}.edpire-scope .text-amber-900{color:var(--color-amber-900)}.edpire-scope .text-blue-600{color:var(--color-blue-600)}.edpire-scope .text-gray-400{color:var(--color-gray-400)}.edpire-scope .text-gray-500{color:var(--color-gray-500)}.edpire-scope .text-gray-600{color:var(--color-gray-600)}.edpire-scope .text-gray-700{color:var(--color-gray-700)}.edpire-scope .text-gray-800{color:var(--color-gray-800)}.edpire-scope .text-red-200{color:var(--color-red-200)}.edpire-scope .text-red-300{color:var(--color-red-300)}.edpire-scope .text-slate-500{color:var(--color-slate-500)}.edpire-scope .text-slate-800{color:var(--color-slate-800)}.edpire-scope .text-white{color:var(--color-white)}.edpire-scope .uppercase{text-transform:uppercase}.edpire-scope .italic{font-style:italic}.edpire-scope .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.edpire-scope .line-through{text-decoration-line:line-through}.edpire-scope .underline{text-decoration-line:underline}.edpire-scope .underline-offset-2{text-underline-offset:2px}.edpire-scope .underline-offset-4{text-underline-offset:4px}.edpire-scope .opacity-40{opacity:.4}.edpire-scope .opacity-60{opacity:.6}.edpire-scope .opacity-70{opacity:.7}.edpire-scope .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope .outline{outline-style:var(--tw-outline-style);outline-width:1px}.edpire-scope .grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.edpire-scope .backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.edpire-scope .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.edpire-scope .duration-300{--tw-duration:.3s;transition-duration:.3s}.edpire-scope .duration-700{--tw-duration:.7s;transition-duration:.7s}.edpire-scope .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.edpire-scope .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.edpire-scope .outline-none{--tw-outline-style:none;outline-style:none}.edpire-scope .select-none{-webkit-user-select:none;user-select:none}.edpire-scope .\\[--edp-bar\\:0px\\]{--edp-bar:0px}.edpire-scope :is(.edpire-scope .group-open\\:rotate-90):is(:where(.group):is([open],.edpire-scope :popover-open,.edpire-scope :open) *){rotate:90deg}@media(hover:hover){.edpire-scope :is(.edpire-scope .group-hover\\:text-\\[\\#1d2025\\]):is(:where(.group):hover *){color:#1d2025}.edpire-scope :is(.edpire-scope .group-hover\\:shadow-md):is(:where(.group):hover *){--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope :is(.edpire-scope .hover\\:border-\\[\\#8d93a0\\]):hover{border-color:#8d93a0}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#31353c\\]):hover{background-color:#31353c}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#e7e5e0\\]):hover{background-color:#e7e5e0}.edpire-scope :is(.edpire-scope .hover\\:bg-\\[\\#f1efe9\\]):hover{background-color:#f1efe9}.edpire-scope :is(.edpire-scope .hover\\:bg-gray-100):hover{background-color:var(--color-gray-100)}.edpire-scope :is(.edpire-scope .hover\\:bg-white):hover{background-color:var(--color-white)}.edpire-scope :is(.edpire-scope .hover\\:text-\\[\\#1d2025\\]):hover{color:#1d2025}.edpire-scope :is(.edpire-scope .hover\\:text-gray-700):hover{color:var(--color-gray-700)}.edpire-scope :is(.edpire-scope .hover\\:text-rose-500):hover{color:var(--color-rose-500)}.edpire-scope :is(.edpire-scope .hover\\:underline):hover{text-decoration-line:underline}}.edpire-scope :is(.edpire-scope .focus\\:outline-none):focus{--tw-outline-style:none;outline-style:none}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-2):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-\\[\\#8d93a0\\]):focus-visible{--tw-ring-color:#8d93a0}.edpire-scope :is(.edpire-scope .focus-visible\\:ring-offset-2):focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.edpire-scope :is(.edpire-scope .focus-visible\\:outline-2):focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.edpire-scope :is(.edpire-scope .focus-visible\\:outline-\\[\\#1d2025\\]):focus-visible{outline-color:#1d2025}.edpire-scope :is(.edpire-scope .disabled\\:cursor-not-allowed):disabled{cursor:not-allowed}.edpire-scope :is(.edpire-scope .disabled\\:opacity-50):disabled{opacity:.5}.edpire-scope :is(.edpire-scope .data-\\[flash\\=true\\]\\:bg-\\[\\#fbf1dc\\])[data-flash=true]{background-color:#fbf1dc}.edpire-scope :is(.edpire-scope .data-\\[flash\\=true\\]\\:duration-150)[data-flash=true]{--tw-duration:.15s;transition-duration:.15s}@media(min-width:40rem){.edpire-scope .sm\\:block{display:block}.edpire-scope .sm\\:hidden{display:none}.edpire-scope .sm\\:inline{display:inline}.edpire-scope .sm\\:inline-flex{display:inline-flex}.edpire-scope .sm\\:flex-row{flex-direction:row}.edpire-scope .sm\\:flex-nowrap{flex-wrap:nowrap}.edpire-scope .sm\\:items-center{align-items:center}.edpire-scope .sm\\:gap-4{gap:calc(var(--spacing) * 4)}.edpire-scope .sm\\:px-4{padding-inline:calc(var(--spacing) * 4)}.edpire-scope .sm\\:px-6{padding-inline:calc(var(--spacing) * 6)}.edpire-scope .sm\\:py-4{padding-block:calc(var(--spacing) * 4)}.edpire-scope .sm\\:text-\\[2rem\\]{font-size:2rem}}@container (min-width:72rem){.edpire-scope .\\@6xl\\:flex{display:flex}.edpire-scope .\\@6xl\\:hidden{display:none}}.edpire-scope :is(.edpire-scope .rtl\\:translate-x-\\[110\\%\\]):where(:dir(rtl),.edpire-scope [dir=rtl],.edpire-scope [dir=rtl] *){--tw-translate-x:110%;translate:var(--tw-translate-x) var(--tw-translate-y)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror\\]\\:min-h-\\[80px\\]) .ProseMirror{min-height:80px}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror\\]\\:outline-none) .ProseMirror{--tw-outline-style:none;outline-style:none}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:pointer-events-none) .ProseMirror p.is-editor-empty:first-child:before{pointer-events:none}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:float-left) .ProseMirror p.is-editor-empty:first-child:before{float:left}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:h-0) .ProseMirror p.is-editor-empty:first-child:before{height:calc(var(--spacing) * 0)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:text-gray-400) .ProseMirror p.is-editor-empty:first-child:before{color:var(--color-gray-400)}.edpire-scope :is(.edpire-scope .\\[\\&_\\.ProseMirror_p\\.is-editor-empty\\:first-child\\:\\:before\\]\\:content-\\[attr\\(data-placeholder\\)\\]) .ProseMirror p.is-editor-empty:first-child:before{--tw-content:attr(data-placeholder);content:var(--tw-content)}.edpire-scope :is(.edpire-scope .\\[\\&_\\[data-exercise-id\\]\\]\\:scroll-mt-\\[calc\\(var\\(--edp-bar\\)\\+0\\.75rem\\)\\]) [data-exercise-id],.edpire-scope :is(.edpire-scope .\\[\\&_\\[data-question-id\\]\\]\\:scroll-mt-\\[calc\\(var\\(--edp-bar\\)\\+0\\.75rem\\)\\]) [data-question-id]{scroll-margin-top:calc(var(--edp-bar) + .75rem)}@layer base{.edpire-scope *,.edpire-scope :after,.edpire-scope :before,.edpire-scope ::backdrop{border-color:var(--color-gray-200,currentColor)}.edpire-scope ::file-selector-button{border-color:var(--color-gray-200,currentColor)}}@supports not (height:100dvh){.edpire-scope .h-dvh{height:100vh}}.edpire-scope :where(span:has(>textarea.player-typed-blank)){line-height:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
79
+ `);import{Fragment as oa,jsx as N,jsxs as W}from"react/jsx-runtime";var gd="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234f46e5'%3E%3Cpath d='M12 2L2 7v10l10 5 10-5V7L12 2zm0 2.18L19.5 8 12 11.82 4.5 8 12 4.18zM4 9.6l7 3.5v7.3L4 16.9V9.6zm9 10.8v-7.3l7-3.5v7.3L13 20.4z'/%3E%3C/svg%3E";function bd(e){for(let r of e.exercises)for(let t of r.questions)if((t.content.content??[]).some(a=>a.type==="aiAnswerInput"))return!0;return!1}function ii(e){let r=e;return typeof r.totalMaxScore=="number"?r.totalMaxScore:(r.answerKeys??[]).reduce((t,n)=>t+(n.scoring?.maxScore??0),0)}function ri(e){return e.questions.reduce((r,t)=>r+ii(t),0)}function or(e){return Number.isInteger(e)?String(e):parseFloat(e.toFixed(2)).toString()}var aa=5;function ti({label:e}){return N("span",{className:"ms-0.5 text-[#d23b2b]",title:e,"aria-label":e,children:"*"})}function si(e){return e==="full"?"#1f8a4c":e==="partial"?"#c8810e":"#d23b2b"}function ni({outcome:e}){let r=e==="full"?"M20 54 L41 75 L82 24":e==="none"?"M27 27 L73 73 M73 27 L27 73":"M14 58 C29 33 40 33 52 51 C64 69 74 69 88 42";return N("svg",{width:14,height:14,viewBox:"0 0 100 100",fill:"none",stroke:si(e),strokeWidth:9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:N("path",{d:r})})}function xd({score:e,weight:r,unit:t,t:n,hidden:a=!1}){if(e){if(e.awaiting)return W("span",{className:"inline-flex items-center gap-1 rounded-lg border border-[#f2e2bf] bg-[#fbf1dc] px-2 py-0.5 text-xs font-semibold text-[#8a5a08]",children:[N(Br,{size:11}),n("pendingReview")]});let o=a?e.outcome:e.m>0&&e.s>=e.m?"full":e.s>0?"partial":"none";return a?N("span",{className:"inline-flex items-center rounded-lg border border-[#e7e5e0] bg-[#f5f4f1] px-2 py-1",children:N(ni,{outcome:o})}):W("span",{className:"inline-flex items-center gap-1.5 rounded-lg border border-[#e7e5e0] bg-[#f5f4f1] ps-2 pe-2.5 py-0.5",children:[N(ni,{outcome:o}),W("span",{className:"font-bold leading-none",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.05rem",color:si(o)},children:[or(e.s)," / ",or(e.m)]})]})}return r>0&&!a?W("span",{className:"text-xs font-semibold tabular-nums text-[#8d93a0]",children:[or(r)," ",t(r)]}):null}function ai(e){let r=0,t=0,n=!1,a=0,o=0;for(let s of e)r+=s.score??0,t+=s.maxScore??0,s.status==="awaiting_review"&&(n=!0),s.status==="correct"&&a++,(s.status==="correct"||s.status==="partial")&&o++;let i=e.length>0&&a===e.length?"full":o>0?"partial":"none";return{score:r,maxScore:t,awaiting:n,outcome:i}}function oi(e){let r=new Map;for(let t of e?.exerciseAnswers??[])for(let n of t.questionAnswers)r.set(n.questionId,n.answers);return r}function yd(e,r){return r.size===0?e:{exerciseAnswers:e.exerciseAnswers.map(t=>({...t,questionAnswers:t.questionAnswers.map(n=>n.answers.length===0&&r.has(n.questionId)?{...n,answers:r.get(n.questionId)}:n)}))}}function vd({timeLimitMinutes:e,startedAt:r,onExpire:t}){let n=e*6e4,a=new Date(r).getTime()+n,[o,i]=Be(()=>Math.max(a-Date.now(),0)),s=pr(t);s.current=t,Xt(()=>{if(o<=0){s.current();return}let b=setInterval(()=>{let w=Math.max(a-Date.now(),0);i(w),w<=0&&(clearInterval(b),s.current())},1e3);return()=>clearInterval(b)},[a]);let c=o/n,l=c<.1?"bg-[#fdeeec] text-[#a32b1e] border-[#f6cfc9] animate-pulse":c<.25?"bg-[#fbf1dc] text-[#8a5a08] border-[#f2e2bf]":"bg-[#f5f4f1] text-[#565b66] border-[#e7e5e0]",p=Math.ceil(o/1e3),u=Math.floor(p/3600),d=Math.floor(p%3600/60),h=p%60,m=u>0?`${u}:${String(d).padStart(2,"0")}:${String(h).padStart(2,"0")}`:`${d}:${String(h).padStart(2,"0")}`;return W("span",{className:ge("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-xs font-bold tabular-nums transition-colors",l),children:[N(Br,{size:12}),m]})}function Jt({assessment:e,meta:r,scoreHidden:t=!1,isForm:n=!1,requiredQuestionIds:a,locale:o="en",branding:i,timeLimitMinutes:s,startedAt:c,initialAnswers:l,onAnswersChange:p,saveState:u,resumed:d=!1,onSubmit:h,review:m,onViewReport:b,reportLabel:w,onBack:R,backLabel:v,allowReset:C,onReset:x,overlayConfig:S,contained:k=!1,layout:_,onClose:T,mediaHandler:F,onAddAnnex:g,fallbackLogoUrl:E}){let f=Te(()=>Yo(o),[o]),q=Ue($=>Go(o,$),[o]),A=ea(o)?"rtl":"ltr",L=pr(null),G=pr(null);Xt(()=>{let $=G.current,ne=L.current;if(!$||!ne||typeof ResizeObserver>"u")return;let ke=()=>ne.style.setProperty("--edp-bar",`${$.offsetHeight}px`);ke();let sr=new ResizeObserver(ke);return sr.observe($),()=>sr.disconnect()},[]);let B=_?.maxWidth??Ko,V=i?.branding?.primaryColor,K=i?.branding?.accentColor,le=i?.branding?.fontFamily,xe=i?.branding?.fontUrl,P=i?.branding?.showPoweredBy!==!1;Xt(()=>{if(!xe||typeof document>"u"||document.querySelector(`link[href="${xe}"]`))return;let ne=document.createElement("link");ne.rel="stylesheet",ne.href=xe,document.head.appendChild(ne)},[xe]);let[y,O]=Be(()=>m?.answers??l??{exerciseAnswers:[]}),[j]=Be(()=>m?new Map:oi(l)),z=pr(p);z.current=p;let[oe]=Be(()=>(m?m.answers:l)?.mediaPlays),re=pr(oe),se=Ue($=>re.current&&Object.keys(re.current).length>0?{...$,mediaPlays:re.current}:$,[]),de=pr(y);de.current=y;let U=pr(!1),Y=Ue($=>{let ne=se(yd($,j));O(ne),z.current?.(ne)},[j,se]),me=Ue($=>{if(re.current=$,m||U.current)return;let ne=se(de.current);O(ne),z.current?.(ne)},[m,se]),[ee,te]=Be(null);Xt(()=>{te(Date.now())},[]);let[ce,ze]=Be(d&&!m),Ee=Te(()=>{if(ee===null||!s||s<=0||!c)return null;let $=new Date(c).getTime()+s*6e4-ee;return $>0?Math.max(1,Math.floor($/6e4)):null},[ee,s,c]),[D,J]=Be(!1),[Z,pe]=Be(!1),[H,st]=Be(m?.result??null);U.current=H!==null;let qr=Te(()=>oi(m?.answers),[m]),[Wr,ur]=Be(null),[_r,ct]=Be(!1),ir=pr(!1),Nr=Te(()=>bd(e),[e]),Ur=Te(()=>Z?Jn(e,y):[],[Z,e,y]),Hr=Ur.length,en=Ue($=>{pe(!1);let ne=L.current?.querySelectorAll(`[data-question-id="${CSS.escape($)}"]`),ke=Array.from(ne??[]).find(sr=>sr.getClientRects().length>0);ke&&requestAnimationFrame(()=>ke.scrollIntoView({block:"start",behavior:"smooth"}))},[]),rn=(a??[]).join(" "),mr=Te(()=>new Set(rn?rn.split(" "):[]),[rn]),[la,gi]=Be(!1),tn=Te(()=>la?Zn(e,y,mr).map($=>$.questionId).join(" "):"",[la,e,y,mr]),da=Te(()=>new Set(tn?tn.split(" "):[]),[tn]),bi=Ue(()=>{let $=Zn(e,y,mr);if($.length===0){pe(!0);return}gi(!0),en($[0].questionId)},[e,y,mr,en]),nn=Te(()=>e.exercises.reduce(($,ne)=>$+ri(ne),0),[e]),an=Te(()=>H?Kt(H.exerciseFeedback):void 0,[H]),pa=Te(()=>{let $=new Map;for(let ne of H?.exerciseFeedback??[])for(let ke of ne.questions)ke.explanation&&$.set(ke.questionId,ke);return $},[H]),lt=t||H?.scoreHidden===!0,ua=Te(()=>{if(!H)return{};let $={};for(let ne of H.exerciseFeedback)$[ne.exerciseId]=ai(ne.questions.flatMap(ke=>ke.nodeResults));return $},[H]),ma=Te(()=>{if(!H)return{};let $={};for(let ne of H.exerciseFeedback)for(let ke of ne.questions)ke.nodeResults.length>0&&($[ke.questionId]=ai(ke.nodeResults));return $},[H]),xi=Ue(async()=>{J(!0),ur(null);try{let $=await h(y);st($),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch($){ur($ instanceof Error?$.message==="required_unanswered"?f("requiredBlocked"):$.message:f("confirmCancel"))}finally{J(!1),pe(!1)}},[y,h,f]),dt=Ue(()=>{!H||!b||b(H)},[H,b]),yi=Ue(()=>{ir.current||D||H||(ir.current=!0,ct(!0),pe(!1),typeof document<"u"&&document.activeElement?.blur(),setTimeout(()=>{J(!0),ur(null),h(y).then($=>{st($),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}).catch($=>{ur($ instanceof Error?$.message:"submit_error")}).finally(()=>{J(!1),ct(!1)})},800))},[y,D,h,H]),on=Ue(($,ne,ke)=>{let sr=ri($),He=ua[$.id],fa=$.questions.length>1,wi=Jo(ne)?Xo(ne,{renderQuestion:(mt,ln,ki)=>{let Ve=mt.id,ha=j.get(Ve),ga={...F?{mediaHandler:F}:{},...m?{initialAnswers:qr.get(Ve)??[],readOnly:!0}:ha?{initialAnswers:ha}:{},...H!==null?{readOnly:!0}:{}},ba=Object.keys(ga).length>0&&Jo(ln)?Xo(ln,ga):ln,Ri=mr.has(Ve),xa=da.has(Ve)?W("p",{role:"alert",className:"mt-2 flex items-center gap-1.5 text-sm font-medium text-[#a32b1e]",children:[N(md,{size:14,className:"flex-shrink-0"}),f("requiredMissing")]}):null,dn=pa.get(Ve),ya=dn?.explanation?N(Vo,{content:dn.explanation,nodeResults:dn.nodeResults,label:f("explanation")}):null;if(!fa)return W("div",{"data-question-id":Ve,children:[ba,xa,ya]},Ve);let Vr=ma[Ve],Si=ii(mt);return W("div",{"data-question-id":Ve,children:[W("div",{className:"flex items-center gap-2.5 mb-3",children:[W("span",{className:"inline-flex items-center rounded-lg border border-[#e7e5e0] bg-[#f1efe9] px-3 py-1 text-xs font-bold tracking-tight text-[#1d2025]",children:[f("question",{index:ki+1}),Ri&&N(ti,{label:f("required")})]}),N(xd,{hidden:lt,score:Vr?{s:Vr.score,m:Vr.maxScore,awaiting:Vr.awaiting,outcome:Vr.outcome}:null,weight:Si,unit:q,t:f})]}),ba,xa,ya]},Ve)},renderSeparator:mt=>N("div",{className:"border-t border-[#e7e5e0] my-1"},`qsep-${mt}`)}):ne;return W("div",{"data-exercise-id":$.id,className:"bg-white rounded-[14px] border border-[#e7e5e0] shadow-sm overflow-hidden",children:[W("div",{className:"flex items-center justify-between px-4 py-2.5 bg-[#f1efe9] border-b border-[#e7e5e0]",style:K?{backgroundColor:K}:void 0,children:[W("span",{dir:"auto",className:"min-w-0 text-sm font-bold text-[#1d2025] [overflow-wrap:anywhere]",children:[Sr(f,$.title,ke),!fa&&$.questions[0]&&mr.has($.questions[0].id)&&N(ti,{label:f("required")})]}),lt?null:He?.awaiting?W("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-[#8a5a08] bg-[#fbf1dc] border border-[#f2e2bf] rounded-full px-2 py-0.5",children:[N(Br,{size:11}),f("pendingReview")]}):He?W("span",{className:"font-bold leading-none tabular-nums",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',fontSize:"1.15rem",color:He.maxScore>0&&He.score>=He.maxScore?"#1f8a4c":He.maxScore>0&&He.score>0?"#c8810e":He.maxScore>0?"#d23b2b":"#8d93a0"},children:[or(He.score)," / ",or(He.maxScore)]}):sr>0?W("span",{className:"text-xs font-semibold text-[#8d93a0] tabular-nums",children:["/ ",or(sr)," ",q(sr)]}):null]}),N("div",{className:"p-4",children:wi})]},$.id)},[f,q,ua,ma,K,F,m,qr,j,pa,lt,mr,da,H]),vi=Te(()=>Yn(e).length>0,[e]),sn=Ue($=>W("div",{className:"flex items-center gap-3 py-2",children:[N("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"}),N("span",{className:"text-[10px] font-bold text-[#8d93a0] uppercase tracking-widest",children:Sr(f,e.exercises[$+1]?.title,$+1)}),N("div",{className:"flex-1 border-t border-dashed border-[#e7e5e0]"})]},`sep-${$}`),[f,e]),cn=P?N("p",{className:"pt-2 pb-1 text-center text-xs text-[#8d93a0] select-none",children:f("poweredBy")}):null,qe=H!==null,fr=n||H?.isForm===!0,pt=H?.showVerdict!==!1,ut=pt?H?.passed?"#1f8a4c":"#d23b2b":"#1d2025";return N(xt,{initial:oe,onChange:me,children:N("div",{className:"edpire-scope",style:{display:"contents"},children:W("div",{ref:L,dir:A,className:ge("flex flex-col [--edp-bar:0px] [&_[data-exercise-id]]:scroll-mt-[calc(var(--edp-bar)+0.75rem)] [&_[data-question-id]]:scroll-mt-[calc(var(--edp-bar)+0.75rem)]",k?"h-full":"min-h-dvh"),style:le?{fontFamily:le}:void 0,children:[N(Do,{visible:D&&!_r&&!fr,hasAiNodes:Nr,text:f("evaluating"),aiText:f("aiEvaluating"),contained:k,...S}),_r&&W("div",{className:ge("fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-red-950/80 backdrop-blur-sm",k&&"absolute"),children:[N(Br,{size:40,className:"text-red-300"}),N("p",{className:"text-xl font-black text-white tracking-tight",children:f("timeUp.title")}),N("p",{className:"text-sm text-red-200",children:f("timeUp.submitting")})]}),W("div",{ref:G,className:"sticky top-0 z-10 flex-shrink-0 flex items-center justify-between gap-2 px-4 py-2.5 border-b border-[#e7e5e0] bg-[#fbfaf7]",style:K?{backgroundColor:K}:void 0,children:[W("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[N("img",{src:i?.logoUrl??E??gd,alt:i?.name??"Edpire",width:24,height:24,loading:"lazy",className:"flex-none rounded object-contain"}),W("div",{className:"min-w-0",children:[N("h1",{dir:"auto",title:r.title,className:"line-clamp-2 text-sm font-bold leading-snug text-[#1d2025] [overflow-wrap:anywhere]",children:r.title}),N("p",{className:"text-[11px] text-[#8d93a0]",children:nn>0&&!lt&&W("span",{className:"ms-2 font-semibold text-[#565b66]",children:["/ ",or(nn)," ",q(nn)]})})]}),!qe&&ee!==null&&s&&s>0&&c&&N(vd,{timeLimitMinutes:s,startedAt:c,onExpire:yi}),!qe&&(u==="saving"||u==="saved")&&W("span",{role:"status",className:"hidden sm:inline-flex items-center gap-1 text-[11px] font-medium text-[#8d93a0]",children:[u==="saved"?N(fd,{size:12}):N(ra,{size:12,className:"animate-spin"}),f(u==="saved"?"answersSaved":"answersSaving")]})]}),W("div",{className:"flex flex-none items-center gap-2",children:[C&&W("button",{onClick:x,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium text-[#565b66] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:[N(pd,{size:13}),f("reset")]}),(!qe||m)&&R&&W("button",{onClick:R,className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium text-[#565b66] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:[N(na,{size:13}),v??f("back")]}),T&&N("button",{onClick:T,className:"p-1.5 text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#f1efe9] rounded-lg transition-colors",children:N(na,{size:15})}),!qe&&N("button",{onClick:bi,disabled:D,style:V?{backgroundColor:V}:void 0,className:"flex flex-shrink-0 items-center gap-2 px-3.5 sm:px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors disabled:opacity-50",children:D?W(oa,{children:[N(ra,{size:14,className:"animate-spin"}),f(fr?"formSending":"submitting")]}):W(oa,{children:[N(Zo,{size:14}),N("span",{className:"sm:hidden",children:f(fr?"formSubmit":"confirmSubmit")}),N("span",{className:"hidden sm:inline",children:f(fr?"formSubmit":"submit")})]})})]})]}),Wr&&N("div",{className:"flex-shrink-0 bg-[#fdeeec] border-b border-[#f6cfc9] px-4 py-2 text-sm text-[#a32b1e]",children:Wr}),!qe&&u==="failed"&&W("div",{role:"alert",className:"flex-shrink-0 flex items-center gap-2 bg-[#fbf1dc] border-b border-[#f2e2bf] px-4 py-2 text-sm font-semibold text-[#8a5a08]",children:[N(hd,{size:15,className:"flex-shrink-0"}),f("answersNotSaved")]}),!qe&&ce&&(j.size>0||Ee!==null)&&W("div",{role:"status",className:"flex-shrink-0 flex items-center gap-2 bg-[#f5f4f1] border-b border-[#e7e5e0] px-4 py-2 text-sm text-[#1d2025]",children:[Ee!==null&&N(Br,{size:15,className:"flex-shrink-0 text-[#565b66]"}),W("span",{className:"flex-1 min-w-0",children:[j.size>0?f("resumeRestored"):f("resumeFresh"),Ee!==null&&W(oa,{children:[" ",f("resumeTimeLeft",{minutes:Ee})]})]}),N("button",{type:"button",onClick:()=>ze(!1),"aria-label":f("close"),className:"flex-shrink-0 p-1 rounded-md text-[#8d93a0] hover:text-[#1d2025] hover:bg-[#e7e5e0] transition-colors",children:N(na,{size:14})})]}),qe&&H?.isForm?N(Qo,{t:f,rtl:ea(o),showClose:!k,onContinue:b&&H.returnUrl?dt:void 0,continueLabel:w,primaryColor:V}):qe&&H&&(H.awaitingManualGrading?N("div",{className:"flex-shrink-0 border-b bg-[#fbf1dc] border-[#f2e2bf]",children:N("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:B},children:W("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 sm:gap-4",children:[W("div",{className:"flex items-center gap-2",children:[N(Br,{size:20,className:"text-[#c8810e] flex-shrink-0"}),N("span",{className:"text-sm font-semibold text-[#8a5a08]",children:H.aiPending?f("beingMarked"):f("awaitingReview")})]}),N("div",{className:"hidden sm:block w-px h-8 bg-[#f2e2bf]"}),N("p",{className:"text-sm text-[#8a5a08] flex-1 min-w-0",children:H.aiPending?f("beingMarkedDesc"):f("awaitingReviewDesc")}),b&&W("button",{onClick:dt,style:V?{backgroundColor:V}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[N(ta,{size:14}),w??f("viewFullReport")]})]})})}):H.scoreHidden?N("div",{className:"flex-shrink-0 border-b bg-[#f5f4f1] border-[#e7e5e0]",children:N("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:B},children:W("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 sm:gap-4",children:[W("div",{className:"flex items-center gap-2",children:[N(ei,{size:20,className:"text-[#1d2025] flex-shrink-0"}),N("span",{className:"text-sm font-semibold text-[#1d2025]",children:f("submittedNoScore")})]}),N("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),N("p",{className:"text-sm text-[#565b66] flex-1 min-w-0",children:f("submittedNoScoreDesc")}),b&&W("button",{onClick:dt,style:V?{backgroundColor:V}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[N(ta,{size:14}),w??f("viewFullReport")]})]})})}):N("div",{className:ge("flex-shrink-0 border-b",pt?H.passed?"bg-[#ecf8f0] border-[#c5e8d1]":"bg-[#fdeeec] border-[#f6cfc9]":"bg-[#f5f4f1] border-[#e7e5e0]"),children:N("div",{className:"mx-auto px-4 py-3 sm:px-6 sm:py-4",style:{maxWidth:B},children:W("div",{className:"flex flex-wrap sm:flex-nowrap items-center gap-x-4 gap-y-2",children:[W("div",{className:"flex items-center gap-2",children:[pt?H.passed?N(ei,{size:20,className:"text-[#1f8a4c] flex-shrink-0"}):N(dd,{size:20,className:"text-[#d23b2b] flex-shrink-0"}):null,N("span",{className:"text-sm font-semibold",style:{color:ut},children:pt?H.passed?f("assessmentPassed"):f("assessmentNotPassed"):f("yourScore")})]}),N("div",{className:"hidden sm:block w-px h-8 bg-[#e7e5e0]"}),W("div",{className:"flex items-baseline gap-1.5",children:[W("span",{className:"leading-none tabular-nums text-[1.6rem] sm:text-[2rem]",style:{fontFamily:'var(--font-hand, "Caveat", cursive)',color:ut},children:[or(H.totalScore)," / ",or(H.maxScore)]}),N("span",{className:"text-sm text-[#8d93a0] font-medium",children:q(H.maxScore)})]}),W("div",{className:"flex-1 flex items-center gap-3 min-w-[140px]",children:[N("div",{className:"flex-1 h-2 bg-[#e7e5e0] rounded-full overflow-hidden min-w-[80px]",children:N("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${H.percentage}%`,backgroundColor:ut}})}),W("span",{className:"text-sm font-bold tabular-nums flex-shrink-0",style:{color:ut},children:[H.percentage,"%"]})]}),b&&W("button",{onClick:dt,style:V?{backgroundColor:V}:void 0,className:"flex-shrink-0 flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors",children:[N(ta,{size:14}),w??f("viewFullReport")]})]})})})),N("div",{className:ge("flex-1 flex flex-col",k&&"overflow-hidden",_r&&"pointer-events-none opacity-60",H?.isForm&&"hidden"),children:e.annex||vi?N(qo,{assessment:e,isSubmitted:qe,setAnswers:Y,validationFeedback:an,renderExercise:on,renderSeparator:sn,primaryColor:V,contained:k,locale:o,contentMaxWidth:B,t:f,footer:cn}):g?N(Uo,{assessment:e,isSubmitted:qe,setAnswers:Y,validationFeedback:an,renderExercise:on,renderSeparator:sn,primaryColor:V,contained:k,locale:o,contentMaxWidth:B,t:f,onAddAnnex:g,footer:cn}):N("div",{className:ge("flex-1",k&&"overflow-y-auto"),children:W("div",{className:"mx-auto p-6 flex flex-col gap-4",style:{maxWidth:B},children:[N(dr,{assessment:e,onAnswersChange:qe?void 0:Y,validationFeedback:an,renderExercise:on,renderSeparator:sn,locale:o}),cn]})})}),Z&&N("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:W("div",{role:"dialog","aria-modal":"true","aria-labelledby":"edpire-submit-confirm-title",className:"bg-white rounded-[14px] shadow-xl p-6 max-w-sm mx-4",children:[N("h3",{id:"edpire-submit-confirm-title",className:"text-base font-bold text-[#1d2025] mb-2",children:f(fr?"formConfirmTitle":"confirmTitle")}),Hr>0&&W("div",{className:"text-sm text-[#8a5a08] bg-[#fbf1dc] border border-[#f2e2bf] rounded-lg px-3 py-2 mb-3",children:[W("p",{className:"flex items-start gap-2 font-semibold",children:[N(ud,{size:15,className:"flex-shrink-0 mt-px"}),N("span",{children:Hr===1?f("unansweredOne"):f("unansweredMany",{count:Hr})})]}),W("ul",{className:"mt-1 ps-[23px] flex flex-col gap-0.5",children:[Ur.slice(0,aa).map($=>N("li",{children:N("button",{type:"button",onClick:()=>en($.questionId),className:"text-start underline underline-offset-2 hover:text-[#1d2025] cursor-pointer",children:$.only?Sr(f,$.exerciseTitle,$.exerciseIndex):`${Sr(f,$.exerciseTitle,$.exerciseIndex)} \xB7 ${f("question",{index:$.questionIndex+1})}`})},$.questionId)),Hr>aa&&N("li",{children:f("unansweredMore",{count:Hr-aa})})]})]}),N("p",{className:"text-sm text-[#565b66] mb-5",children:f(fr?"formConfirmDescription":"confirmDescription")}),W("div",{className:"flex gap-3 justify-end",children:[N("button",{onClick:()=>pe(!1),className:"px-4 py-2 text-sm font-medium text-[#565b66] hover:bg-[#f1efe9] rounded-lg transition-colors",children:f("confirmCancel")}),W("button",{onClick:xi,disabled:D,style:V?{backgroundColor:V}:void 0,className:"flex items-center gap-2 px-4 py-2 bg-[#1d2025] text-white text-sm font-semibold rounded-lg hover:bg-[#31353c] transition-colors disabled:opacity-50",children:[D?N(ra,{size:14,className:"animate-spin"}):N(Zo,{size:14}),f(fr?"formSubmit":"confirmSubmit")]})]})]})})]})})})}function Zt(e){return(e??[]).map(r=>({exerciseId:r.exercise_id,questions:r.questions.map(t=>({questionId:t.question_id,...t.explanation?{explanation:t.explanation}:{},nodeResults:t.node_results.map(n=>({nodeId:n.node_id,status:n.status,...n.score!==void 0?{score:n.score}:{},...n.max_score!==void 0?{maxScore:n.max_score}:{},...n.feedback!==void 0?{feedback:n.feedback}:{},...n.display_answer!==void 0?{displayAnswer:n.display_answer}:{},...n.detail!==void 0?{detail:n.detail}:{},...n.teacher_feedback!==void 0?{teacherFeedback:n.teacher_feedback}:{}}))}))}))}import{jsx as Rd}from"react/jsx-runtime";function ia(e,r){let t=Zt(e.exercise_feedback);return{submissionId:e.submission_id,totalScore:e.score??0,maxScore:e.max_score??0,percentage:e.percentage??0,passed:e.passed??!1,...e.score_hidden?{scoreHidden:!0}:{},returnUrl:r??null,exerciseFeedback:t,awaitingManualGrading:e.awaiting_manual_grading??!1,aiPending:e.ai_pending??!1}}function sa(e){return{annex:e.annex??void 0,exercises:e.exercises.map(r=>({id:r.id,...r.title?{title:r.title}:{},sharedContext:r.sharedContext,questions:r.questions.map(t=>({id:t.id,version:"1.0",content:t.content,answerKeys:[]}))}))}}function li({token:e,data:r,baseUrl:t,options:n}){let{locale:a,branding:o,returnUrl:i,reportLabel:s,backLabel:c,onBack:l,overlayConfig:p,layout:u,mediaHandler:d,onComplete:h,onError:m}=n,b=o??r.branding??void 0,w=a??r.meta.language??"en",R=wd(()=>sa(r.assessment),[r]),[v]=kd(()=>new Date().toISOString()),C=ci(async S=>{let k=await fetch(`${t}/api/v1/embed/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,answers:S})});if(!k.ok){let T=await k.json().catch(()=>({}));if(k.status===422&&T.code==="required_unanswered")throw new Error("required_unanswered");let F=typeof T.error=="string"?T.error:"Submission failed",g=k.status===401?"TOKEN_INVALID":k.status===409?"TOKEN_USED":k.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";throw m?.({code:g,message:F}),new Error(F)}let _=await k.json();return h?.(_),ia(_,i)},[t,e,h,m,i]),x=ci(S=>{if(i)try{let k=new URL(i);k.searchParams.set("submission_id",S.submissionId),!S.awaitingManualGrading&&!S.scoreHidden&&(k.searchParams.set("score",String(S.totalScore)),k.searchParams.set("max_score",String(S.maxScore))),window.location.href=k.toString()}catch{window.location.href=i}},[i]);return Rd(Jt,{assessment:R,meta:{title:r.meta.title,category:r.meta.category??null},locale:w,branding:b,scoreHidden:r.meta.score_hidden===!0,requiredQuestionIds:r.meta.required_question_ids,timeLimitMinutes:r.meta.settings.time_limit_minutes,startedAt:v,onSubmit:C,onViewReport:i?x:void 0,reportLabel:s,onBack:l,backLabel:c,overlayConfig:p,layout:u,mediaHandler:d})}import{useMemo as di}from"react";import{jsx as Cd}from"react/jsx-runtime";function Sd(){return Promise.reject(new Error("A review cannot be submitted"))}function pi({review:e,locale:r,branding:t,layout:n,onBack:a,backLabel:o}){let i=di(()=>sa(e.assessment),[e]),s=di(()=>({answers:e.answers,result:ia({submission_id:e.submission.id,score:e.submission.score,max_score:e.submission.max_score,percentage:e.submission.percentage,passed:e.submission.passed,awaiting_manual_grading:e.submission.awaiting_manual_grading,ai_pending:e.submission.ai_pending,score_hidden:e.submission.score_hidden,exercise_feedback:e.exercise_feedback})}),[e]),c=r??e.meta.language??"en";return Cd(Jt,{assessment:i,meta:{title:e.meta.title,category:e.meta.category??null},locale:c,branding:t??e.branding??void 0,review:s,scoreHidden:e.submission.score_hidden===!0,onSubmit:Sd,onBack:a,backLabel:o,layout:n})}import Ad from"react";import{createRoot as Pd}from"react-dom/client";import _d,{useMemo as Nd}from"react";import"katex/dist/katex.min.css";import{jsx as ca}from"react/jsx-runtime";var ui=_d.memo(function({content:r,onAnswersChange:t,feedback:n,initialAnswers:a,readOnly:o,className:i,dir:s}){let c=Nd(()=>{if(n)return new Map(Object.entries(n))},[n]),l=ca(Dr,{content:r,onAnswersChange:t,initialAnswers:a,validationFeedback:c,readOnly:o,className:i});return ca("div",{className:"edpire-scope",style:{display:"contents"},children:s?ca("div",{dir:s,children:l}):l})});function Td(e){let{container:r,content:t,onAnswersChange:n,feedback:a,initialAnswers:o,readOnly:i,dir:s}=e,c=typeof r=="string"?document.querySelector(r):r;if(!c)throw new Error(`EdpireSDK.renderQuestion: container not found: ${String(r)}`);let l={content:t,onAnswersChange:n,feedback:a,initialAnswers:o,readOnly:i,dir:s},p=Pd(c);function u(){p.render(Ad.createElement(ui,l))}return u(),{setContent(d){l={...l,content:d,feedback:null},u()},setFeedback(d){l={...l,feedback:d},u()},setInitialAnswers(d){l={...l,initialAnswers:d},u()},unmount(){p.unmount()}}}function Ed(e){let r=[],t=0;for(let n of e.exercises)for(let a of n.questions)r.push({exerciseId:n.id,questionId:a.id,content:a.content_ast,points:a.points,sequenceNumber:a.sequence_number,index:t++});return r}function Md(e){let r=Kt(Zt(e.exercise_feedback)),t=new Map;for(let o of e.answers.exerciseAnswers)for(let i of o.questionAnswers)t.set(i.questionId,i.answers);let n=[],a=0;for(let o of e.assessment.exercises){let i=r.get(o.id);for(let s of o.questions){let c=i?.get(s.id),l=e.exercise_feedback.find(m=>m.exercise_id===o.id)?.questions.find(m=>m.question_id===s.id),p=l?.node_results??[],u=0,d=0,h=!1;for(let m of p)u+=m.score??0,d+=m.max_score??0,m.status==="awaiting_review"&&(h=!0);n.push({exerciseId:o.id,questionId:s.id,content:s.content,sharedContext:o.sharedContext??null,explanation:l?.explanation??null,answers:t.get(s.id)??[],feedback:c?Object.fromEntries(c):{},score:u,maxScore:d,status:h?"awaiting_review":d===0?"unscored":u>=d?"correct":u>0?"partial":"incorrect",index:a++})}}return n}function Ld(e){let r=new Map;for(let t of e)r.has(t.exerciseId)||r.set(t.exerciseId,[]),r.get(t.exerciseId).push({questionId:t.questionId,answers:t.answers});return{exerciseAnswers:Array.from(r.entries()).map(([t,n])=>({exerciseId:t,questionAnswers:n}))}}var Id="https://edpire.com";function hi(e,r,t){e.textContent="";let n=document.createElement("div");n.style.cssText="padding:32px;text-align:center;color:#dc2626;font-family:sans-serif";let a=document.createElement("div");if(a.textContent=r,n.appendChild(a),t){let o=document.createElement("div");o.style.cssText="margin-top:8px;font-size:13px;color:#6b7280",o.textContent=t,n.appendChild(o)}e.appendChild(n)}var Vb={mount(e){let{token:r,container:t,baseUrl:n=Id,onError:a}=e,o=typeof t=="string"?document.querySelector(t):t;if(!o){let l={code:"UNKNOWN",message:`Container not found: ${t}`};return a?.(l),{unmount:()=>{}}}let i=null,s=!1;function c(){if(s)return;s=!0;let l=i;i=null,setTimeout(()=>{l?.unmount()},0)}return(async()=>{o.innerHTML='<div style="padding:32px;text-align:center;color:#6b7280;font-family:sans-serif">Loading assessment\u2026</div>';let l;try{let p=await fetch(`${n}/api/v1/embed/assessments?token=${encodeURIComponent(r)}`,{method:"GET"});if(!p.ok){let u=await p.json().catch(()=>({})),d=typeof u.error=="string"?u.error:"Failed to load assessment",h=p.status===401?"TOKEN_INVALID":p.status===403?"ORIGIN_NOT_ALLOWED":p.status===404?"ASSESSMENT_NOT_FOUND":"UNKNOWN";a?.({code:h,message:d});let m=h==="ORIGIN_NOT_ALLOWED"?`Add ${typeof location<"u"?location.origin:"this origin"} to Allowed Embed Origins in Edpire, under Integrations then Origins.`:"";hi(o,d,m);return}l=await p.json()}catch{a?.({code:"NETWORK_ERROR",message:"Failed to connect to Edpire"}),hi(o,"Failed to connect to Edpire. Please try again.","");return}s||(o.innerHTML="",i=fi(o),i.render(mi.createElement(li,{token:r,data:l,baseUrl:n,options:e})))})(),{unmount:c}},review(e){let{container:r,...t}=e,n=typeof r=="string"?document.querySelector(r):r;if(!n)return{unmount:()=>{}};n.textContent="";let a=fi(n);return a.render(mi.createElement(pi,t)),{unmount(){let o=a;a=null,setTimeout(()=>o?.unmount(),0)}}}};export{Vb as EdpireAssessment,Ld as buildSubmitPayload,Ed as flattenAssessment,Md as flattenReview,Td as renderQuestion};