@nexlylab/widget 1.33.0 → 1.34.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.
Files changed (66) hide show
  1. package/dist/INSTALL.txt +1 -1
  2. package/dist/runtime/{1.33.0/chunks/ClickToLoadEmbed-DdH19Upf-CnpjmfE1.js → 1.34.0/chunks/ClickToLoadEmbed-BNWVfZ1y-DuTZcv6f.js} +2 -2
  3. package/dist/runtime/{1.33.0/chunks/PanelInfoVideo-XFcVoL2c-qpxDXdLm.js → 1.34.0/chunks/PanelInfoVideo-Di7qwhV_-qpxDXdLm.js} +1 -1
  4. package/dist/runtime/{1.33.0/chunks/assistant-link-components-gMuMhmaU-rHpeX4O6.js → 1.34.0/chunks/assistant-link-components-DtT0biCl-jR32KHTm.js} +2 -2
  5. package/dist/runtime/{1.33.0/chunks/assistant-link-policy-DlGAtyk7-By6jpR50.js → 1.34.0/chunks/assistant-link-policy-B77YPf4E-By6jpR50.js} +1 -1
  6. package/dist/runtime/{1.33.0/chunks/block-rating-CAVRRYuG-CQMNokIy.js → 1.34.0/chunks/block-rating-uD_0LK-1-CQMNokIy.js} +1 -1
  7. package/dist/runtime/{1.33.0/chunks/external-url-JbUnX7Da-rLiy7c9v.js → 1.34.0/chunks/external-url-Bx_GTDOx-rLiy7c9v.js} +1 -1
  8. package/dist/runtime/{1.33.0/chunks/index-CPGSyaZ4-BoVmvEOm.js → 1.34.0/chunks/index--7VB9nyF-BoVmvEOm.js} +1 -1
  9. package/dist/runtime/{1.33.0/chunks/index-Cfy6Ocqe-CzwqZYRk.js → 1.34.0/chunks/index-66kR66X--CzwqZYRk.js} +1 -1
  10. package/dist/runtime/{1.33.0/chunks/index-BzVJMW3i-Bhh8_8Oh.js → 1.34.0/chunks/index-67cmm3Si-Bhh8_8Oh.js} +1 -1
  11. package/dist/runtime/{1.33.0/chunks/index-DTa1aDGz-Deg8QEW2.js → 1.34.0/chunks/index-7wlPUbYV-Deg8QEW2.js} +1 -1
  12. package/dist/runtime/{1.33.0/chunks/index-CDlumsdH-BgpZz7kC.js → 1.34.0/chunks/index-B80p2HRD-BHvEiO2X.js} +2 -2
  13. package/dist/runtime/{1.33.0/chunks/index-HIu_g6Cr-CEIHlemy.js → 1.34.0/chunks/index-BHphkqVW-CEIHlemy.js} +1 -1
  14. package/dist/runtime/{1.33.0/chunks/index-7yhyghzH-BlFXtfQb.js → 1.34.0/chunks/index-BIeasoH0-BlFXtfQb.js} +1 -1
  15. package/dist/runtime/{1.33.0/chunks/index-BP1Q45X4-f3F4IxQ5.js → 1.34.0/chunks/index-BPwttNii-f3F4IxQ5.js} +1 -1
  16. package/dist/runtime/{1.33.0/chunks/index-CmM1q2bg-D6H0juMn.js → 1.34.0/chunks/index-BTgHOj2W-D6H0juMn.js} +1 -1
  17. package/dist/runtime/{1.33.0/chunks/index-DOJHU9qy-Bil-vDLm.js → 1.34.0/chunks/index-BfGmnBJ0-BOltxOU-.js} +2 -2
  18. package/dist/runtime/{1.33.0/chunks/index-CH-C6uk_-B-pT4hKt.js → 1.34.0/chunks/index-BjNWgAJk-B-pT4hKt.js} +1 -1
  19. package/dist/runtime/{1.33.0/chunks/index-xQDKGkvA-pCzSL4DD.js → 1.34.0/chunks/index-BlY9hgA--pCzSL4DD.js} +1 -1
  20. package/dist/runtime/{1.33.0/chunks/index-uYSCRIpT-qsVnaLmo.js → 1.34.0/chunks/index-BmajLlTC-qsVnaLmo.js} +1 -1
  21. package/dist/runtime/{1.33.0/chunks/index-s0zHGN1t-DWm0RYZF.js → 1.34.0/chunks/index-BtBJMXR--DWm0RYZF.js} +1 -1
  22. package/dist/runtime/{1.33.0/chunks/index-BCxeWwto-B9PuY2Gx.js → 1.34.0/chunks/index-Bz-3E3Sa-B9PuY2Gx.js} +1 -1
  23. package/dist/runtime/{1.33.0/chunks/index-D9fi5TQ9-k8zxZkfU.js → 1.34.0/chunks/index-CM2ok1Hp-k8zxZkfU.js} +1 -1
  24. package/dist/runtime/{1.33.0/chunks/index-BblCrrAW-bh6F7tw3.js → 1.34.0/chunks/index-CMdx7oFx-bh6F7tw3.js} +1 -1
  25. package/dist/runtime/{1.33.0/chunks/index-SV2KdT0_-BZw4n83V.js → 1.34.0/chunks/index-COobDdoM-BZw4n83V.js} +1 -1
  26. package/dist/runtime/{1.33.0/chunks/index-BPfUysTZ-CV5ZiVsD.js → 1.34.0/chunks/index-CQCPJl3S-CV5ZiVsD.js} +1 -1
  27. package/dist/runtime/{1.33.0/chunks/index-BO0vI80C-qK4w7DnX.js → 1.34.0/chunks/index-CSsAPgvv-qK4w7DnX.js} +1 -1
  28. package/dist/runtime/{1.33.0/chunks/index-DZNxd978-BmIQ-NmU.js → 1.34.0/chunks/index-CXm6d9l1-BmIQ-NmU.js} +1 -1
  29. package/dist/runtime/{1.33.0/chunks/index-BjHXOMPQ-Bt7j8evJ.js → 1.34.0/chunks/index-CZcU6ylZ-Bt7j8evJ.js} +1 -1
  30. package/dist/runtime/{1.33.0/chunks/index-BwnCq3yC-LScXPMbE.js → 1.34.0/chunks/index-Ce73FsEJ-Ce0fEutJ.js} +2 -2
  31. package/dist/runtime/{1.33.0/chunks/index-S2W2KqpV-PMvqlUvO.js → 1.34.0/chunks/index-Cf3qMIwZ-PMvqlUvO.js} +1 -1
  32. package/dist/runtime/{1.33.0/chunks/index-CnknkPUN-Yl3jEGAx.js → 1.34.0/chunks/index-CqSCG8MM-Yl3jEGAx.js} +1 -1
  33. package/dist/runtime/{1.33.0/chunks/index-CZCcZigQ-qH_mrcVT.js → 1.34.0/chunks/index-CzfX3ctc-qH_mrcVT.js} +1 -1
  34. package/dist/runtime/{1.33.0/chunks/index-DsyaMk1k-DpMzyqHN.js → 1.34.0/chunks/index-DBhWCUM5-DpMzyqHN.js} +1 -1
  35. package/dist/runtime/{1.33.0/chunks/index-CYP-tLa5-DLVDVk-F.js → 1.34.0/chunks/index-DT9H1y9L-DladDuuj.js} +2 -2
  36. package/dist/runtime/{1.33.0/chunks/index-CNbQ508J-BPOHZMXu.js → 1.34.0/chunks/index-DbY1AG4s-C-OyGFef.js} +2 -2
  37. package/dist/runtime/{1.33.0/chunks/index-qzvjftnO-CDVtcfdt.js → 1.34.0/chunks/index-Ddxqdy4M-CDVtcfdt.js} +1 -1
  38. package/dist/runtime/{1.33.0/chunks/index-CVtuVQCx-Dtq7n928.js → 1.34.0/chunks/index-DmV2pHdJ-Dtq7n928.js} +1 -1
  39. package/dist/runtime/{1.33.0/chunks/index-CZSW9eXg-BwcGrX1b.js → 1.34.0/chunks/index-DnWzIgAa-DlTfKZaL.js} +2 -2
  40. package/dist/runtime/{1.33.0/chunks/index-Bd_8PmPr-CgO1smBF.js → 1.34.0/chunks/index-Dnqtxtmw-CgO1smBF.js} +1 -1
  41. package/dist/runtime/{1.33.0/chunks/index-BWY1nqf0-DX50C5MZ.js → 1.34.0/chunks/index-Dw35VwDs-DX50C5MZ.js} +1 -1
  42. package/dist/runtime/{1.33.0/chunks/index--H6hRpBJ-F9_TzvkO.js → 1.34.0/chunks/index-Dydy8_XR-F9_TzvkO.js} +1 -1
  43. package/dist/runtime/{1.33.0/chunks/index-NPLN6oCC-VW9D8cgC.js → 1.34.0/chunks/index-FHHrEvNZ-VW9D8cgC.js} +1 -1
  44. package/dist/runtime/{1.33.0/chunks/index-v9CNsbwM-CavFmRiD.js → 1.34.0/chunks/index-RyI_7m1j-CavFmRiD.js} +1 -1
  45. package/dist/runtime/{1.33.0/chunks/index-DG6McKPZ-CqZ9_vG_.js → 1.34.0/chunks/index-TJEJpVI7-CqZ9_vG_.js} +1 -1
  46. package/dist/runtime/{1.33.0/chunks/index-Ci7P37Ya-W5nof5Mx.js → 1.34.0/chunks/index-Va_2P_Gg-Kzu4aFqn.js} +2 -2
  47. package/dist/runtime/{1.33.0/chunks/index--pcCOJWb-BzpgdoE8.js → 1.34.0/chunks/index-_wovirve-BzpgdoE8.js} +1 -1
  48. package/dist/runtime/{1.33.0/chunks/index-CNP-4dFm-BlRhWcs1.js → 1.34.0/chunks/index-kmVVSAKR-BlRhWcs1.js} +1 -1
  49. package/dist/runtime/{1.33.0/chunks/index-DUV1wU5j-ErDxRmJu.js → 1.34.0/chunks/index-xV27oZEe-ErDxRmJu.js} +1 -1
  50. package/dist/runtime/1.34.0/nexly.js +61 -0
  51. package/dist/v1.js +4 -4
  52. package/package.json +1 -1
  53. package/dist/runtime/1.33.0/nexly.js +0 -61
  54. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/PanelVideoOverlay-BY__oBYV-B8OPC1xh.js +0 -0
  55. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/_commonjsHelpers-C6fGbg64-BC8KDfbh.js +0 -0
  56. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/accent-legibility-BJF2VO5n-CDPQ7suO.js +0 -0
  57. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/allowed-elements-C0OfX2zF-DIBV8lKu.js +0 -0
  58. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/block-helpers-Cg_zAqG6-DnN2COvk.js +0 -0
  59. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/index-BPDIV1BN-DINkyYvc.js +0 -0
  60. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/index-BcsmWDTX-Dw9WA5Ac.js +0 -0
  61. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/index-C262wwK4-DpyhuXqd.js +0 -0
  62. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/index-DMQkz1bV-BuMYksln.js +0 -0
  63. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/index-DZADUAKv-DPfvWVuj.js +0 -0
  64. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/index.modern-CioVZ357-nfRNslCS.js +0 -0
  65. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/inert-assistant-components-B6Cx9pG5-DWb6n3Yq.js +0 -0
  66. /package/dist/runtime/{1.33.0 → 1.34.0}/chunks/use-deferred-rating-XlgCUwcY-DDVOwURi.js +0 -0
@@ -1,2 +1,2 @@
1
- import{j as e,r as g,L as As,e as Ts,o as He,Z as In,K as Ls,k as Ms}from"../nexly.js";import{C as $s}from"./block-rating-CAVRRYuG-CQMNokIy.js";import{x as Rs,c as Us,s as Hn,a as Os}from"./allowed-elements-C0OfX2zF-DIBV8lKu.js";import{r as Bs}from"./inert-assistant-components-B6Cx9pG5-DWb6n3Yq.js";import{X as Ds,F as Es}from"./ClickToLoadEmbed-DdH19Upf-CnpjmfE1.js";import{p as Ps}from"./external-url-JbUnX7Da-rLiy7c9v.js";import"./_commonjsHelpers-C6fGbg64-BC8KDfbh.js";import"./assistant-link-policy-DlGAtyk7-By6jpR50.js";const Fs=/^[a-z0-9][a-z0-9-]*$/,Qs=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Le(n){if(!n)return null;const s=n.trim();if(!s)return null;if(s.startsWith("media:")){const l=s.slice(6);return Qs.test(l)?{kind:"media",mediaId:l}:null}const a=s.startsWith("icon:")?s.slice(5):s;return Fs.test(a)?{kind:"icon",slug:a}:null}const fn="media:",bn="youtube:",Ws=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Yn(n){if(!n)return null;const s=n.trim();if(s.startsWith(fn)){const a=s.slice(fn.length);return Ws.test(a)?{kind:"image",ref:`${fn}${a}`,mediaId:a}:null}if(s.startsWith(bn)){const a=s.slice(bn.length);return Es(a)?{kind:"youtube",ref:`${bn}${a}`,id:a}:null}return null}const xl={slug:"learning",name:"Learning",version:"1.0.0",category:"interactive",requiredService:"learning",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},title:{type:"string",default:""},showExplanations:{type:"boolean",default:!0},showBrowse:{type:"boolean",default:!0},showDashboard:{type:"boolean",default:!0},showProgress:{type:"boolean",default:!1},showNews:{type:"boolean",default:!0}}},defaultConfig:{readAloudEnabled:!1,title:"",showExplanations:!0,showBrowse:!0,showDashboard:!0,showProgress:!1,showNews:!0},dataContract:{serviceSlug:"learning",inputSchema:{type:"object",properties:{mode:{type:"string",description:"placement_quiz | section_quiz | checking_question | new_information | nothing"},quizId:{type:"string",description:"Set for placement_quiz / section_quiz"},questionId:{type:"string",description:"Set for checking_question"},lessonId:{type:"string",description:"Set for new_information / checking_question"},topicId:{type:"string",description:"Set for new_information / section_quiz"},reason:{type:"string",description:"Set for mode=nothing: no_curriculum | all_mastered | all_in_cooldown"}},required:["mode"]},previewDataOverride:{mode:"nothing",reason:"all_in_cooldown"}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"title",type:"localized-text",label:"Heading",default:"",placeholder:'Leave empty to use the translated default ("Learning")',group:"Content"},{id:"showExplanations",type:"toggle",label:"Show explanations after answering",default:!0,group:"Behavior"},{id:"showBrowse",type:"toggle",label:"Offer the browsing sections (Topics, Dashboard, Progress)",default:!0,group:"Sections"},{id:"showDashboard",type:"toggle",label:"Show the Dashboard section (streak, progress, what to pick up)",default:!0,group:"Sections"},{id:"showProgress",type:"toggle",label:"Show the Progress section (mastery by topic, quiz history)",default:!1,group:"Sections"},{id:"showNews",type:"toggle",label:"Show the News section (published feed items, with an unread badge)",default:!0,group:"Sections"}],events:{emits:[{name:"learning:answerSubmitted",description:"Learner answered a question"},{name:"learning:quizCompleted",description:"Learner finished a quiz attempt"},{name:"learning:lessonSkipped",description:"Learner declared a lesson already known"}],listens:[{name:"learning:reload",description:"Re-fetch the current assignment"}]},sizing:{minWidth:260,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main"]},Xn=g.createContext(null),Gs=({children:n})=>e.jsx("span",{className:"es-learning__md-link",children:n}),Js=({node:n,...s})=>e.jsx("div",{className:"es-learning__md-tablewrap",children:e.jsx("table",{...s})}),Ks=({node:n,type:s,checked:a,...l})=>s==="checkbox"?e.jsx("input",{...l,type:"checkbox",checked:!!a,disabled:!0,readOnly:!0}):null,Vs=()=>null,Zs=({src:n,alt:s})=>{const a=g.useContext(Xn);if(!a)return null;const{media:l,t:r}=a,t=Yn(typeof n=="string"?n:void 0),_=t?l[t.ref]:void 0,j=(s??"").trim();return _?_.kind==="image"?e.jsx("img",{className:"es-learning__media-img",src:_.url,alt:j||r("learning.media_image_alt"),loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"}):e.jsx(Ds,{embed:{provider:_.provider,id:_.id},t:r,classPrefix:"es-learning",posterUrl:_.posterUrl},`${_.provider}:${_.id}`):e.jsx("span",{className:"es-learning__media-missing",children:j||r("learning.media_unavailable")})},Hs=({node:n,children:s,...a})=>{const l=n?.children;return l!==void 0&&l.length>0&&l.every(r=>r.type==="element"&&r.tagName==="img"||r.type==="text"&&!(r.value??"").trim())&&l.some(r=>r.type==="element")?e.jsx(e.Fragment,{children:s}):e.jsx("p",{...a,children:s})},es={...Bs,a:Gs,table:Js,input:Ks},Ys={...es,img:Vs},Xs={...es,img:Zs,p:Hs},ea=[...Hn],na=[...Hn,"img"],sa=n=>Os(n)??"",aa=()=>"",la=n=>Yn(n)?n:"";function ns(n,s,a,l){return e.jsx("div",{className:"es-learning__md",children:e.jsx(Rs,{remarkPlugins:[...Us],allowedElements:s,transformLinkUri:sa,transformImageUri:a,components:l,children:n})})}function zn({children:n}){return n?.trim()?ns(n,ea,aa,Ys):null}function ss({children:n,media:s,t:a}){const l=g.useMemo(()=>({media:s??{},t:a}),[s,a]);return n?.trim()?e.jsx(Xn.Provider,{value:l,children:ns(n,na,la,Xs)}):null}function se({graphicRef:n,graphicAlt:s,graphicUrl:a,variant:l,done:r}){const t=Le(n);if(!t)return null;const _=["es-learning__graphic",l?`es-learning__graphic--${l}`:"",r?"es-learning__graphic--done":""].filter(Boolean).join(" ");if(t.kind==="media")return a?e.jsx("div",{className:`${_} es-learning__graphic--image`,children:e.jsx("img",{src:a,alt:s??"",className:"es-learning__graphic-img",loading:"lazy","data-testid":"learning-graphic-image"})}):null;const j=He(t.slug);return j?e.jsx("div",{className:_,role:s?"img":"presentation","aria-label":s??void 0,"data-testid":"learning-graphic-icon",children:e.jsx(j,{size:40})}):null}function as(n,s){const a=Le(n);return a?a.kind==="media"?!!s:!!He(a.slug):!1}function ls(n,s){return Le(n)?.kind==="media"&&!!s}function is({topicTitle:n,onBackToTopic:s,t:a}){return s?e.jsxs("button",{type:"button",className:"es-learning__eyebrow es-learning__eyebrow--back",onClick:s,"aria-label":a("learning.back_to_topic",{topic:n}),children:[e.jsx("span",{"aria-hidden":"true",children:"← "}),n]}):e.jsx("p",{className:"es-learning__eyebrow",children:n})}const Q=n=>({width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0});function ia({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"m15.5 8.5-2 5.5-5.5 2 2-5.5z"})]})}function Qn({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M12 7.5V12l3 2"})]})}function ta({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("path",{d:"M8 4h8v4a4 4 0 0 1-8 0z"}),e.jsx("path",{d:"M8 5H5.5a2.5 2.5 0 0 0 2.5 4M16 5h2.5a2.5 2.5 0 0 1-2.5 4"}),e.jsx("path",{d:"M12 12v4M9 20h6M10 20a2 2 0 0 1 4 0"})]})}function ra({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("path",{d:"M4 5h16M4 12h16M4 19h16"}),e.jsx("path",{d:"M7 5v7M12 12v7",opacity:"0.45"})]})}function oa({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),e.jsx("path",{d:"M14 3v5h5"}),e.jsx("path",{d:"m9.5 12.5 5 5m0-5-5 5"})]})}function Ve({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"M19 12H5m0 0 6-6m-6 6 6 6"})})}function fe({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"M5 12h14m0 0-6-6m6 6-6 6"})})}function oe({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"m5 13 4 4L19 7"})})}function Te({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function qn({size:n=16}){return e.jsxs("svg",{...Q(n),children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6v.3"}),e.jsx("path",{d:"M12 17h.01"})]})}function Wn({size:n=14}){return e.jsxs("svg",{...Q(n),children:[e.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),e.jsx("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]})}function Cn({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"m9 6 6 6-6 6"})})}function ca({size:n=18}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M12 6.5C10.5 5 8.5 4.5 4 4.5v13c4.5 0 6.5.5 8 2 1.5-1.5 3.5-2 8-2v-13c-4.5 0-6.5.5-8 2Z"}),e.jsx("path",{d:"M12 6.5v13"})]})}function da({size:n=18}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M4 6h16M4 12h16M4 18h10"})})}function ua({size:n=18}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"m4 11 8-6 8 6"}),e.jsx("path",{d:"M6 10v9h12v-9"})]})}function ga({size:n=18}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M5 19V10M12 19V5M19 19v-6"})})}function _a({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"M12 3c1 3-2 4-2 7a3 3 0 0 0 6 0c0-1.5-1-2-1-3.5 1.5 1 2.5 3 2.5 5A5.5 5.5 0 0 1 12 21a5.5 5.5 0 0 1-5-7.5C7.5 10 9 7 12 3Z"})})}function pa({size:n=18}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M4 5h13v14H6a2 2 0 0 1-2-2Z"}),e.jsx("path",{d:"M17 8h3v9a2 2 0 0 1-2 2h-1"}),e.jsx("path",{d:"M7 9h7"}),e.jsx("path",{d:"M7 12.5h7"}),e.jsx("path",{d:"M7 16h4"})]})}function ts({size:n=14}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M10 14 21 3"}),e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function rs({lesson:n,busy:s,onDone:a,doneLabel:l,doneGoesBack:r=!1,onBackToTopic:t,rating:_,readAloud:j,readAloudRef:o,t:x}){return e.jsxs("section",{className:"es-learning__lesson","aria-label":x("learning.lesson_aria"),children:[e.jsxs("div",{className:"es-learning__lesson-readable",ref:o,children:[e.jsx(is,{topicTitle:n.topicTitle,onBackToTopic:t,t:x}),e.jsx("h4",{className:"es-learning__lesson-title",children:n.title}),e.jsx(se,{graphicRef:n.graphicRef,graphicAlt:n.graphicAlt,graphicUrl:n.graphicUrl}),e.jsx(ss,{media:n.media,t:x,children:n.body})]}),j&&e.jsx("div",{className:"es-learning__lesson-readaloud",children:j}),_,e.jsx("button",{type:"button",className:"es-learning__btn es-learning__btn--block",onClick:a,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__spinner","aria-hidden":"true"}),x("learning.loading")]}):e.jsxs(e.Fragment,{children:[r&&e.jsx(Ve,{}),l??x("learning.lesson_done"),!r&&e.jsx(fe,{})]})})]})}const os={owl:({size:n})=>e.jsx(Ms,{size:n})};function ha(n){return typeof n=="string"&&n in os?n:"none"}function Ne({name:n,size:s=56,className:a}){const l=n==="none"?void 0:os[n];return l?e.jsx("span",{className:["es-learning__mascot",a].filter(Boolean).join(" "),"aria-hidden":"true",children:e.jsx(l,{size:s})}):null}function Gn({lessonTitle:n,topicTitle:s,newTopic:a=!1,graphicRef:l,graphicAlt:r,graphicUrl:t,slideCount:_,mascot:j,busy:o,onStart:x,onBackToTopic:b,t:p}){const f=!!l,m=p(a?"learning.new_topic_title":"learning.new_lesson_title");return e.jsxs("section",{className:`es-learning__intro${f?" es-learning__intro--illustrated":""}${a?" es-learning__intro--topic":""}`,"aria-label":m,children:[f?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"es-learning__intro-say",children:[e.jsx(Ne,{name:j,size:30}),e.jsx("h4",{className:"es-learning__intro-title",children:m})]}),e.jsx(se,{graphicRef:l,graphicAlt:r,graphicUrl:t})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{name:j,size:64}),e.jsx("h4",{className:"es-learning__intro-title",children:m})]}),e.jsx("p",{className:"es-learning__intro-lesson",children:a?s:n}),b&&!a?e.jsxs("button",{type:"button",className:"es-learning__intro-note es-learning__intro-note--back",onClick:b,"aria-label":p("learning.back_to_topic",{topic:s}),children:[e.jsx("span",{"aria-hidden":"true",children:"← "}),s]}):e.jsx("p",{className:"es-learning__intro-note",children:a?n:s}),typeof _=="number"&&_>0&&e.jsx("p",{className:"es-learning__intro-meta",children:p("learning.slide_count",{total:_})}),e.jsx("div",{className:"es-learning__intro-foot",children:e.jsxs("button",{type:"button",className:"es-learning__btn es-learning__btn--block",onClick:x,disabled:o,children:[p(a?"learning.start_new_topic":"learning.start_lesson"),e.jsx(fe,{})]})})]})}function ma({topicTitle:n,topicComplete:s,mascot:a,busy:l,onStart:r,onSkip:t,t:_}){const j=g.useRef(null);g.useEffect(()=>{j.current?.focus({preventScroll:!0})},[]);const o=_(s?"learning.section_quiz_title_complete":"learning.section_quiz_title");return e.jsxs("section",{className:"es-learning__intro","aria-label":o,children:[e.jsx(Ne,{name:a,size:64}),e.jsx("h4",{className:"es-learning__intro-title",children:o}),e.jsx("p",{className:"es-learning__intro-lesson",children:n}),e.jsx("p",{className:"es-learning__intro-note",children:_("learning.section_quiz_note")}),e.jsxs("div",{className:"es-learning__intro-foot",children:[e.jsxs("button",{ref:j,type:"button",className:"es-learning__btn es-learning__btn--block",onClick:r,disabled:l,children:[_("learning.section_quiz_start"),e.jsx(fe,{})]}),e.jsx("button",{type:"button",className:"es-learning__btn es-learning__btn--block es-learning__btn--ghost",onClick:t,disabled:l,children:_("learning.section_quiz_skip")})]})]})}function wn({quiz:n,isPlacement:s,eyebrow:a,topics:l,results:r,busy:t,mascot:_,onAnswer:j,onAnswerOpen:o,onFinish:x,onBackToLesson:b,onChooseTopic:p,onContinue:f,continueLabel:m,t:w}){const q=g.useMemo(()=>n.questions??(n.question?[n.question]:[]),[n.questions,n.question]),v=!!n.questions,[I,P]=g.useState(!s||n.answered>0),[T,Z]=g.useState(n.answers??{}),[u,E]=g.useState(()=>new Set(n.answeredIds??[])),[G,H]=g.useState({}),[be,F]=g.useState({}),[L,B]=g.useState(()=>{if(!n.questions)return 0;const k=new Set(n.answeredIds??Object.keys(n.answers??{})),A=n.questions.findIndex(he=>!k.has(he.questionId));return A===-1?Math.max(0,n.questions.length-1):A});if(r)return e.jsx(ja,{results:r,questions:q,mascot:_,onContinue:f,continueLabel:m,t:w});if(!I)return e.jsxs("section",{className:"es-learning__intro","aria-label":w("learning.placement_intro_title"),children:[_!=="none"?e.jsx(Ne,{name:_,size:64}):e.jsx("span",{className:"es-learning__state-icon","aria-hidden":"true",children:e.jsx(ia,{size:32})}),e.jsx("h4",{className:"es-learning__intro-title",children:w("learning.placement_intro_title")}),e.jsx("p",{className:"es-learning__intro-body",children:w("learning.placement_intro_body",{total:n.total})}),e.jsx("p",{className:"es-learning__intro-note",children:w("learning.placement_intro_note")}),l.length>0&&p&&e.jsxs("div",{className:"es-learning__topics",children:[e.jsx("p",{className:"es-learning__hint",children:w("learning.choose_topic")}),e.jsx("div",{className:"es-learning__topic-list",children:l.map(k=>e.jsx("button",{type:"button",className:"es-learning__topic",onClick:()=>p(k.topicId),disabled:t,children:k.title},k.topicId))})]}),e.jsx("button",{type:"button",className:"es-learning__btn es-learning__btn--block",onClick:()=>P(!0),disabled:t,children:w("learning.placement_start")})]});const J=q[L];if(!J)return e.jsx("p",{className:"es-learning__hint",children:w("learning.quiz_finished")});const _e=k=>T[k]!==void 0||u.has(k)||(G[k]??"").trim().length>0,Xe=q.filter(k=>_e(k.questionId)).length,ve=T[J.questionId],Y=J.options===null,K=L===q.length-1,ae=q.every(k=>_e(k.questionId)),we=Object.fromEntries(q.filter(k=>_e(k.questionId)).map(k=>[k.questionId,0])),U=J.questionId;function X(k){Z(A=>({...A,[U]:k})),j(U,k)}async function pe(){const k=(G[U]??"").trim();return!Y||!k||!o||u.has(U)&&be[U]===k?!0:await o(U,k)?(E(A=>new Set(A).add(U)),F(A=>({...A,[U]:k})),!0):!1}async function V(){await pe()&&B(k=>Math.min(q.length-1,k+1))}async function ke(){await pe()&&x()}return e.jsxs("section",{className:"es-learning__quiz","aria-label":w("learning.quiz_aria"),children:[b&&e.jsxs("button",{type:"button",className:"es-learning__backlink",onClick:b,children:["← ",w("learning.back_to_lesson")]}),s&&e.jsx("p",{className:"es-learning__eyebrow",children:w("learning.placement_intro")}),e.jsx("h4",{className:"es-learning__lesson-title",children:a??n.title}),e.jsx(xa,{total:q.length,currentIndex:L,answeredIds:we,questions:q,answeredCount:Xe,onJump:v?B:void 0,t:w}),e.jsx("p",{className:"es-learning__prompt",children:J.prompt}),Y?e.jsxs("div",{className:"es-learning__open",children:[e.jsx("textarea",{className:"es-learning__textarea",value:G[U]??"",onChange:k=>H(A=>({...A,[U]:k.target.value})),placeholder:w("learning.open_answer_placeholder"),"aria-label":w("learning.open_answer_aria"),rows:5,disabled:t}),e.jsx("p",{className:"es-learning__hint",children:w("learning.open_answer_hint")})]}):null,!Y&&e.jsx("div",{className:"es-learning__options",role:"radiogroup","aria-label":w("learning.options_aria"),children:(J.options??[]).map((k,A)=>e.jsxs("label",{className:`es-learning__option${ve===A?" es-learning__option--selected":""}`,children:[e.jsx("input",{type:"radio",name:`learning-option-${J.questionId}`,checked:ve===A,onChange:()=>X(A),disabled:t}),e.jsx("span",{className:"es-learning__option-letter",children:String.fromCharCode(65+A)}),e.jsx("span",{className:"es-learning__option-text",children:k})]},A))}),e.jsxs("footer",{className:"es-learning__actions",children:[v?e.jsxs("button",{type:"button",className:"es-learning__btn es-learning__btn--ghost",onClick:()=>B(k=>Math.max(0,k-1)),disabled:t||L===0,children:[e.jsx(Ve,{}),w("learning.previous_question")]}):e.jsx("span",{}),K?e.jsx("button",{type:"button",className:"es-learning__btn",onClick:()=>{ke()},disabled:t||!ae,children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__spinner","aria-hidden":"true"}),w("learning.checking")]}):w("learning.finish_quiz")}):e.jsx("button",{type:"button",className:"es-learning__btn",onClick:()=>{V()},disabled:t||!_e(U),children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__spinner","aria-hidden":"true"}),w("learning.checking")]}):e.jsxs(e.Fragment,{children:[w("learning.next_question"),e.jsx(fe,{})]})})]})]})}function xa({total:n,currentIndex:s,answeredIds:a,questions:l,answeredCount:r,onJump:t,t:_}){return e.jsxs("div",{className:"es-learning__progress",children:[e.jsx("div",{className:"es-learning__track",children:l.map((j,o)=>{const x=["es-learning__seg",a[j.questionId]!==void 0?"es-learning__seg--done":"",o===s?"es-learning__seg--current":""].filter(Boolean).join(" ");return t?e.jsx("button",{type:"button",className:x,onClick:()=>t(o),"aria-label":_("learning.go_to_question",{n:o+1}),"aria-current":o===s?"step":void 0},j.questionId):e.jsx("span",{className:x},j.questionId)})}),e.jsxs("span",{className:"es-learning__progress-count",children:[r,"/",n]})]})}function ja({results:n,questions:s,mascot:a,onContinue:l,continueLabel:r,t}){const _=n.total>0?Math.round(n.correct/n.total*100):0,j=(o,x)=>s.find(b=>b.questionId===o)?.prompt??x;return e.jsxs("section",{className:"es-learning__results","aria-label":t("learning.results_aria"),children:[e.jsxs("div",{className:"es-learning__score",children:[e.jsx(Ne,{name:a,size:28,className:"es-learning__mascot--score"}),e.jsxs("span",{className:"es-learning__score-value",children:[n.correct,"/",n.total]}),e.jsx("div",{className:"es-learning__score-bar",style:{"--es-learning-score":`${_}`},role:"img","aria-label":t("learning.quiz_result",{correct:n.correct,total:n.total})})]}),typeof n.passed=="boolean"&&typeof n.passPercent=="number"&&e.jsx("p",{className:`es-learning__pass es-learning__pass--${n.passed?"yes":"no"}`,children:t(n.passed?"learning.section_quiz_passed":"learning.section_quiz_failed",{percent:n.passPercent})}),n.rows&&n.rows.length>0&&e.jsx("ol",{className:"es-learning__review",children:n.rows.map(o=>e.jsxs("li",{className:`es-learning__review-row es-learning__review-row--${o.verdict}`,children:[e.jsx("span",{className:"es-learning__review-mark","aria-hidden":"true",children:o.verdict==="correct"?e.jsx(oe,{}):o.verdict==="wrong"?e.jsx(Te,{}):e.jsx(qn,{})}),e.jsxs("div",{className:"es-learning__review-body",children:[e.jsx("p",{className:"es-learning__review-prompt",children:j(o.questionId,o.prompt)}),(()=>{const x=o.answerText??(o.selectedOptionIndex!==null?o.options?.[o.selectedOptionIndex]??null:null);return x?e.jsx("p",{className:"es-learning__review-answer",children:t("learning.your_answer",{answer:x})}):null})(),o.feedback&&e.jsx("p",{className:"es-learning__review-feedback",children:o.feedback}),o.verdict!=="correct"&&o.correctAnswer&&e.jsx("p",{className:"es-learning__review-correct",children:t("learning.correct_answer",{answer:o.correctAnswer})}),o.explanation&&e.jsx(zn,{children:o.explanation})]})]},o.questionId))}),l&&e.jsxs("button",{type:"button",className:"es-learning__btn es-learning__btn--block",onClick:l,children:[r??t("learning.continue"),e.jsx(fe,{})]})]})}function fa({prompt:n,lessonTitle:s,answer:a,feedback:l,busy:r,showExplanations:t,onChange:_,onSubmit:j,t:o}){return e.jsxs("section",{className:"es-learning__question","aria-label":o("learning.question_aria"),children:[e.jsx("p",{className:"es-learning__eyebrow",children:s}),e.jsx("p",{className:"es-learning__prompt",children:n}),l?e.jsx(ba,{feedback:l,showExplanations:t,t:o}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{className:"es-learning__textarea",rows:5,value:a,onChange:x=>_(x.target.value),placeholder:o("learning.open_answer_placeholder"),"aria-label":o("learning.open_answer_aria"),disabled:r}),e.jsx("footer",{className:"es-learning__actions es-learning__actions--end",children:e.jsx("button",{type:"button",className:"es-learning__btn",onClick:j,disabled:r||!a.trim(),children:o(r?"learning.checking":"learning.submit_answer")})})]})]})}function ba({feedback:n,showExplanations:s,t:a}){const l=n.verdict==="correct"?e.jsx(oe,{size:18}):n.verdict==="wrong"?e.jsx(Te,{size:18}):e.jsx(qn,{size:18}),r=n.verdict==="correct"?a("learning.verdict_correct"):n.verdict==="wrong"?a("learning.verdict_wrong"):a("learning.verdict_ungradeable");return e.jsxs("div",{className:`es-learning__feedback es-learning__feedback--${n.verdict}`,role:"status",children:[e.jsxs("p",{className:"es-learning__verdict",children:[e.jsx("span",{className:"es-learning__verdict-icon","aria-hidden":"true",children:l}),r]}),n.feedback&&e.jsx("p",{className:"es-learning__feedback-text",children:n.feedback}),s&&n.explanation&&e.jsx(zn,{children:n.explanation})]})}const wa={all_in_cooldown:e.jsx(Qn,{}),not_due_yet:e.jsx(Qn,{}),all_mastered:e.jsx(ta,{}),no_curriculum:e.jsx(ra,{}),unavailable:e.jsx(oa,{})},Na={all_in_cooldown:{title:"learning.empty_cooldown_title",body:"learning.empty_cooldown"},not_due_yet:{title:"learning.next_lesson_title",body:"learning.next_lesson_body"},all_mastered:{title:"learning.empty_all_mastered_title",body:"learning.empty_all_mastered"},no_curriculum:{title:"learning.empty_no_curriculum_title",body:"learning.empty_no_curriculum"},unavailable:{title:"learning.unavailable_title",body:"learning.unavailable"}},va=new Set(["all_in_cooldown","all_mastered","not_due_yet"]);function ka(n){const[s,a]=g.useState(()=>Date.now());if(g.useEffect(()=>{if(!n)return;const t=setInterval(()=>a(Date.now()),6e4);return()=>clearInterval(t)},[n]),!n)return null;const l=new Date(n).getTime();if(!Number.isFinite(l))return null;const r=Math.max(0,Math.ceil((l-s)/6e4));return{hours:Math.floor(r/60),minutes:r%60}}function kn({kind:n,mascot:s,nextDueAt:a,t:l}){const{title:r,body:t}=Na[n],_=s!=="none"&&va.has(n),j=ka(n==="not_due_yet"?a:void 0);return e.jsxs("div",{className:`es-learning__state es-learning__state--${n}`,role:"status",children:[_?e.jsx(Ne,{name:s}):e.jsx("span",{className:"es-learning__state-icon","aria-hidden":"true",children:wa[n]}),e.jsx("p",{className:"es-learning__state-title",children:l(r)}),e.jsx("p",{className:"es-learning__state-body",children:l(t)}),j&&e.jsx("p",{className:"es-learning__countdown",children:j.hours>0?l("learning.next_lesson_in_hm",{hours:j.hours,minutes:j.minutes}):l("learning.next_lesson_in_m",{minutes:j.minutes})})]})}function cs({lesson:n,index:s,onIndexChange:a,answers:l,onAnswer:r,busy:t,onDone:_,doneLabel:j,doneGoesBack:o=!1,onBackToTopic:x,rating:b,readAloud:p,readAloudRef:f,t:m}){const w=n.slides??[],q=w.length,v=w[s];if(!v)return null;const I=v.check??null,P=l[v.id],T=!I||P!==void 0,Z=s===q-1;return e.jsxs("section",{className:"es-learning__lesson","aria-label":m("learning.lesson_aria"),children:[e.jsx(is,{topicTitle:n.topicTitle,onBackToTopic:x,t:m}),e.jsx("div",{className:"es-learning__slide-dots","aria-hidden":"true",children:w.map((u,E)=>e.jsx("span",{className:`es-learning__slide-dot${E<=s?" es-learning__slide-dot--on":""}`},u.id))}),e.jsx(se,{graphicRef:v.graphicRef??n.graphicRef,graphicAlt:v.graphicAlt??n.graphicAlt,graphicUrl:v.graphicUrl??n.graphicUrl}),e.jsxs("div",{className:"es-learning__lesson-readable",ref:f,children:[e.jsx("h4",{className:"es-learning__lesson-title",style:{fontSize:16},children:v.title}),e.jsx(ss,{media:n.media,t:m,children:v.body})]}),p&&e.jsx("div",{className:"es-learning__lesson-readaloud",children:p}),I&&e.jsxs("div",{className:`es-learning__slide-check${T?P===I.correctIndex?" es-learning__slide-check--good":" es-learning__slide-check--bad":""}`,children:[e.jsx("p",{className:"es-learning__slide-check-prompt",children:I.prompt}),e.jsx("div",{className:"es-learning__slide-check-options",children:I.options.map((u,E)=>{const G=P===E,H=E===I.correctIndex,be=["es-learning__slide-choice",T&&G&&H?"es-learning__slide-choice--good":"",T&&G&&!H?"es-learning__slide-choice--bad":"",T&&H&&!G?"es-learning__slide-choice--reveal":""].filter(Boolean).join(" ");return e.jsxs("button",{type:"button",className:be,disabled:T||t,onClick:()=>r(v.id,E),children:[T&&G&&e.jsx("span",{className:"es-learning__slide-choice-icon","aria-hidden":"true",children:H?e.jsx(oe,{size:14}):e.jsx(Te,{size:14})}),e.jsx("span",{children:u})]},E)})}),T&&e.jsx("p",{className:`es-learning__slide-check-fb${P===I.correctIndex?" es-learning__slide-check-fb--good":" es-learning__slide-check-fb--bad"}`,children:P===I.correctIndex?I.feedbackCorrect:I.feedbackIncorrect})]}),e.jsxs("div",{className:"es-learning__deck-foot",children:[Z&&T&&b,!T&&e.jsx("p",{className:"es-learning__hint",children:m("learning.slide_check_required")}),e.jsxs("footer",{className:"es-learning__actions es-learning__actions--captioned",children:[e.jsxs("button",{type:"button",className:"es-learning__btn es-learning__btn--ghost",onClick:()=>a(s-1),disabled:t||s===0,children:[e.jsx(Ve,{}),m("learning.previous_question")]}),e.jsx("p",{className:"es-learning__slide-caption",children:m("learning.slide_caption",{n:s+1,total:q})}),Z?e.jsx("button",{type:"button",className:"es-learning__btn",onClick:_,disabled:t||!T,children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__spinner","aria-hidden":"true"}),m("learning.loading")]}):e.jsxs(e.Fragment,{children:[o&&e.jsx(Ve,{}),j??m("learning.lesson_done"),!o&&e.jsx(fe,{})]})}):e.jsxs("button",{type:"button",className:"es-learning__btn",onClick:()=>a(s+1),disabled:t||!T,children:[m("learning.next_question"),e.jsx(fe,{})]})]})]})]})}function ya({rows:n,t:s}){const[a,l]=g.useState(!1);if(n.length===0)return e.jsx("p",{className:"es-learning__hint",children:s("learning.review_unavailable")});const r=n.filter(t=>t.verdict==="correct").length;return e.jsxs("div",{className:"es-learning__review-block",children:[e.jsxs("button",{type:"button",className:`es-learning__review-toggle${a?" es-learning__review-toggle--open":""}`,"aria-expanded":a,onClick:()=>l(t=>!t),children:[e.jsx("span",{className:"es-learning__review-heading",children:s("learning.your_answers")}),e.jsx("span",{className:"es-learning__review-score",children:s("learning.review_score",{correct:r,total:n.length})}),e.jsx("span",{className:"es-learning__review-chevron","aria-hidden":"true",children:e.jsx(Cn,{size:14})})]}),a?e.jsx("ol",{className:"es-learning__review",children:n.map(t=>{const _=t.answerText??(t.selectedOptionIndex!==null?t.options?.[t.selectedOptionIndex]??null:null);return e.jsxs("li",{className:`es-learning__review-row es-learning__review-row--${t.verdict}`,children:[e.jsx("span",{className:"es-learning__review-mark","aria-hidden":"true",children:t.verdict==="correct"?e.jsx(oe,{}):t.verdict==="wrong"?e.jsx(Te,{}):e.jsx(qn,{})}),e.jsxs("div",{className:"es-learning__review-body",children:[e.jsx("p",{className:"es-learning__review-prompt",children:t.prompt}),t.options&&t.options.length>0?e.jsx("ul",{className:"es-learning__review-options",children:t.options.map((j,o)=>{const x=o===t.selectedOptionIndex,b=t.correctAnswer!==null&&j===t.correctAnswer;return e.jsxs("li",{className:`es-learning__review-option es-learning__review-option--${b?"correct":x?"picked":"plain"}`,children:[e.jsx("span",{className:"es-learning__review-option-mark","aria-hidden":"true",children:b?e.jsx(oe,{size:12}):x?e.jsx(Te,{size:12}):null}),e.jsx("span",{className:"es-learning__review-option-text",children:j}),(x||b)&&e.jsx("span",{className:"es-learning__review-option-tag",children:s(x?"learning.answer_tag_yours":"learning.answer_tag_correct")})]},o)})}):e.jsxs("div",{className:"es-learning__review-pair",children:[_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__review-pair-label",children:s("learning.answer_tag_yours")}),e.jsx("span",{className:"es-learning__review-pair-value es-learning__review-pair-value--yours",children:_})]}),t.verdict!=="correct"&&t.correctAnswer&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__review-pair-label",children:s("learning.answer_tag_correct")}),e.jsx("span",{className:"es-learning__review-pair-value es-learning__review-pair-value--correct",children:t.correctAnswer})]})]}),t.feedback&&e.jsx("p",{className:"es-learning__review-feedback",children:t.feedback}),t.explanation&&e.jsx(zn,{children:t.explanation})]})]},t.questionId)})}):null]})}function Jn({lesson:n,slideIndex:s,onSlideIndexChange:a,slideAnswers:l,onSlideAnswer:r,onBack:t,backLabel:_,showBackLink:j=!0,onBackToTopic:o,rating:x,readAloud:b,readAloudRef:p,onFinish:f,finishLabel:m,review:w,t:q}){const v=(n.slides?.length??0)>0,I=f??t,P=f?m??_:_,T=!!o&&!f;return e.jsxs("div",{className:`es-learning__reader${w?" es-learning__reader--reviewed":""}`,children:[j&&e.jsxs("button",{type:"button",className:"es-learning__backlink",onClick:t,children:["← ",_]}),v?e.jsx(cs,{lesson:n,index:s,onIndexChange:a,answers:l,onAnswer:r,busy:!1,onDone:I,doneLabel:P,doneGoesBack:T,onBackToTopic:o,rating:x,readAloud:b,readAloudRef:p,t:q}):e.jsx(rs,{lesson:n,busy:!1,onDone:I,doneLabel:P,doneGoesBack:T,onBackToTopic:o,rating:x,readAloud:b,readAloudRef:p,t:q}),w&&e.jsx(ya,{rows:w,t:q})]})}function Ia({graphicRef:n,graphicUrl:s,graphicAlt:a,done:l}){const r=Le(n);if(!r)return null;const t=l?" es-learning__lesson-thumb--done":"";if(r.kind==="media")return s?e.jsx("img",{src:s,alt:a??"",loading:"lazy",className:`es-learning__lesson-thumb es-learning__lesson-thumb--image${t}`,"data-testid":"lesson-thumb-image"}):null;const _=He(r.slug);return _?e.jsx("span",{className:`es-learning__lesson-thumb${t}`,"aria-hidden":"true","data-testid":"lesson-thumb-icon",children:e.jsx(_,{size:20})}):null}function Sn({iconRef:n,iconUrl:s}){const a=Le(n);if(!a)return null;if(a.kind==="media")return s?e.jsx("img",{src:s,alt:"","aria-hidden":"true",loading:"lazy",className:"es-learning__topic-icon es-learning__topic-icon--image","data-testid":"topic-icon-image"}):null;const l=He(a.slug);return l?e.jsx("span",{className:"es-learning__topic-icon","aria-hidden":"true","data-testid":"topic-icon",children:e.jsx(l,{size:16})}):null}function ds({topics:n,onOpen:s,t:a}){return n.length===0?e.jsx("p",{className:"es-learning__hint",children:a("learning.empty_no_curriculum")}):e.jsx("section",{className:"es-learning__topics-view","aria-label":a("learning.nav_topics"),children:e.jsx("ul",{className:"es-learning__topic-cards",children:n.map(l=>{const r=l.lessonCount>0?Math.round(l.doneCount/l.lessonCount*100):0,t=l.doneCount===l.lessonCount&&l.lessonCount>0,_=as(l.heroRef,l.heroUrl);return e.jsx("li",{children:e.jsxs("button",{type:"button",className:"es-learning__topic-card",onClick:()=>s(l.topicId),children:[e.jsx(se,{graphicRef:l.heroRef,graphicAlt:l.heroAlt,graphicUrl:l.heroUrl,done:t}),e.jsxs("span",{className:"es-learning__topic-card-head",children:[!_&&e.jsx(Sn,{iconRef:l.iconRef,iconUrl:l.iconUrl}),e.jsx("span",{className:"es-learning__topic-card-title",children:l.title}),t&&e.jsx("span",{className:"es-learning__topic-card-done","aria-hidden":"true",children:e.jsx(oe,{size:14})})]}),e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${r}%`}})}),e.jsx("span",{className:"es-learning__topic-card-meta",children:a("learning.topic_progress",{mastered:l.doneCount,total:l.lessonCount})})]})},l.topicId)})})})}const Ke=["basics","intermediate","advanced","expert"],za={basics:"learning.level_basics",intermediate:"learning.level_intermediate",advanced:"learning.level_advanced",expert:"learning.level_expert"};function qa({level:n,t:s}){const a=Ke.indexOf(n)+1,l=Ke.length;return e.jsx("span",{className:"es-learning__level-stars",role:"img","aria-label":s("learning.level_difficulty",{n:a,total:l}),"data-testid":"learning-level-stars",children:Ke.map((r,t)=>e.jsx("span",{"aria-hidden":"true",className:`es-learning__level-star${t<a?" es-learning__level-star--on":""}`,children:"★"},t))})}const Ze=n=>n.lessonCount>0&&n.doneCount===n.lessonCount;function Ca({tracks:n,untracked:s=[],currentTrackId:a,onOpenTrack:l,onOpenUntracked:r,t}){const _=n.filter(o=>o.topicCount>0);if(_.length===0&&s.length===0)return e.jsx("p",{className:"es-learning__hint",children:t("learning.empty_no_curriculum")});const j=s.filter(Ze).length;return e.jsxs("section",{className:"es-learning__tracks-view","aria-label":t("learning.tracks_heading"),children:[e.jsx("div",{className:"es-learning__infobar es-learning__infobar--intro",children:e.jsxs("p",{className:"es-learning__infobar-text",children:[t("learning.tracks_intro"),_.length>1&&e.jsxs(e.Fragment,{children:[" ",e.jsx("strong",{children:t("learning.track_independent_hint")})]})]})}),e.jsxs("ul",{className:"es-learning__tracks",children:[_.map(o=>{const x=o.topicCount>0?Math.round(o.doneTopicCount/o.topicCount*100):0,b=as(o.heroRef,o.heroUrl),p=o.topicCount>0&&o.doneTopicCount===o.topicCount;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:`es-learning__track-card${o.trackId===a?" es-learning__track-card--current":""}`,onClick:()=>l(o.trackId),children:[e.jsx(se,{graphicRef:o.heroRef,graphicAlt:o.heroAlt,graphicUrl:o.heroUrl,done:p}),e.jsxs("span",{className:"es-learning__track-card-head",children:[!b&&e.jsx("span",{className:"es-learning__track-icon",children:e.jsx(Sn,{iconRef:o.iconRef,iconUrl:o.iconUrl})}),e.jsx("span",{className:"es-learning__track-card-title",children:o.title}),p&&e.jsx("span",{className:"es-learning__topic-card-done","aria-hidden":"true",children:e.jsx(oe,{size:14})})]}),o.description&&e.jsx("span",{className:"es-learning__track-card-desc",children:o.description}),e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${x}%`}})}),e.jsx("span",{className:"es-learning__track-card-meta",children:t("learning.track_progress",{done:o.doneTopicCount,total:o.topicCount})})]})},o.trackId)}),s.length>0&&e.jsx("li",{children:e.jsxs("button",{type:"button",className:"es-learning__track-card",onClick:()=>r?.(),children:[e.jsx("span",{className:"es-learning__track-card-head",children:e.jsx("span",{className:"es-learning__track-card-title",children:t("learning.track_unassigned")})}),e.jsx("span",{className:"es-learning__track-card-meta",children:t("learning.track_progress",{done:j,total:s.length})})]})})]})]})}function Sa({track:n,currentTopicId:s,onOpenTopic:a,onBack:l,t:r}){const t=new Set(n.topics.filter(Ze).map(b=>b.topicId)),_=n.topics.find(b=>b.topicId===s),j=_?.unlocks??[],o=Ke.map(b=>({level:b,topics:n.topics.filter(p=>(p.level??"basics")===b)})).filter(b=>b.topics.length>0),x=n.topicCount>0?Math.round(n.doneTopicCount/n.topicCount*100):0;return e.jsxs("section",{className:"es-learning__roadmap-view","aria-label":n.title,children:[e.jsxs("button",{type:"button",className:"es-learning__backlink",onClick:l,children:["← ",r("learning.tracks_heading")]}),e.jsxs("div",{className:"es-learning__detail-head",children:[e.jsx("h4",{className:"es-learning__detail-title",children:n.title}),e.jsxs("div",{className:"es-learning__progress-line",children:[e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${x}%`}})}),e.jsx("span",{className:"es-learning__progress-count",children:r("learning.track_progress",{done:n.doneTopicCount,total:n.topicCount})})]})]}),_&&j.length>0&&e.jsxs("div",{className:"es-learning__unlocks",children:[e.jsx("span",{className:"es-learning__unlocks-lead",children:r("learning.unlocks_lead",{topic:_.title})}),e.jsx("ul",{className:"es-learning__unlocks-list",children:j.map(b=>e.jsx("li",{children:b.title},b.topicId))})]}),e.jsx("div",{className:"es-learning__infobar es-learning__infobar--order",children:e.jsxs("p",{className:"es-learning__infobar-text",children:[e.jsx("strong",{children:r("learning.roadmap_heading")})," — ",r("learning.roadmap_why")]})}),e.jsx("ul",{className:"es-learning__levels",children:o.map(b=>e.jsxs("li",{children:[e.jsxs("span",{className:"es-learning__level-head",children:[e.jsx("span",{className:"es-learning__level-name",children:r(za[b.level])}),e.jsx("span",{className:"es-learning__level-rule","aria-hidden":"true"}),e.jsx(qa,{level:b.level,t:r})]}),e.jsx("ul",{className:"es-learning__level-topics",children:b.topics.map(p=>{const f=p.prerequisites??[],m=f.some(I=>!t.has(I.topicId)),w=ls(p.heroRef,p.heroUrl),q=Ze(p),v=["es-learning__road-row",w?"es-learning__road-row--card":"",m?"es-learning__road-row--ahead":"",p.topicId===s?"es-learning__road-row--current":""].filter(Boolean).join(" ");return e.jsx("li",{children:e.jsxs("button",{type:"button",className:v,onClick:()=>a(p.topicId),children:[w?e.jsx(se,{graphicRef:p.heroRef,graphicAlt:p.heroAlt,graphicUrl:p.heroUrl,variant:"card",done:q}):e.jsx(Sn,{iconRef:p.iconRef,iconUrl:p.iconUrl}),e.jsxs("span",{className:"es-learning__road-body",children:[e.jsx("span",{className:"es-learning__road-title",children:p.title}),f.length>0&&e.jsx("span",{className:"es-learning__road-needs",children:r("learning.topic_after",{names:f.map(I=>I.title).join(", ")})}),e.jsx("span",{className:"es-learning__track-card-meta",children:r("learning.topic_progress",{mastered:p.doneCount,total:p.lessonCount})})]}),q?e.jsx("span",{className:"es-learning__topic-card-done","aria-hidden":"true",children:e.jsx(oe,{size:14})}):e.jsx("span",{className:"es-learning__lesson-open","aria-hidden":"true",children:e.jsx(Cn,{size:14})})]})},p.topicId)})})]},b.level))})]})}const Aa={mastered:"learning.state_mastered",done:"learning.state_done",gap:"learning.state_in_progress",current:"learning.state_current",unseen:"learning.state_locked"},Ta=n=>n==="mastered"||n==="done",La="learning.state_available";function Ma({topic:n,onOpenLesson:s,onStartSectionQuiz:a,canPickAnyLesson:l=!1,backLabel:r,onBack:t,t:_}){const j=n.lessonCount>0?Math.round(n.doneCount/n.lessonCount*100):0;return e.jsxs("section",{className:"es-learning__topic-detail","aria-label":n.title,children:[r&&t&&e.jsxs("button",{type:"button",className:"es-learning__backlink",onClick:t,"aria-label":_("learning.back_to_track",{track:r}),children:["← ",r]}),e.jsxs("div",{className:"es-learning__detail-head",children:[!(r&&t)&&e.jsx("p",{className:"es-learning__eyebrow",children:_("learning.nav_topics")}),e.jsx("h4",{className:"es-learning__detail-title",children:n.title}),e.jsx(se,{graphicRef:n.heroRef,graphicAlt:n.heroAlt,graphicUrl:n.heroUrl,variant:"hero",done:Ze(n)}),e.jsxs("div",{className:"es-learning__progress-block",children:[e.jsx("span",{className:"es-learning__sec-label",children:_("learning.topic_lessons_done")}),e.jsxs("div",{className:"es-learning__progress-line",children:[e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${j}%`}})}),e.jsx("span",{className:"es-learning__progress-count",children:_("learning.progress_count",{done:n.doneCount,total:n.lessonCount})})]})]})]}),n.hasSectionQuiz===!0&&a&&e.jsx("button",{type:"button",className:"es-learning__btn es-learning__btn--block es-learning__btn--ghost es-learning__section-cta",onClick:a,children:_("learning.section_quiz_cta")}),e.jsxs("div",{className:"es-learning__list-block",children:[e.jsx("p",{className:"es-learning__list-divider",children:e.jsx("span",{className:"es-learning__sec-label",children:_("learning.topic_lesson_list")})}),e.jsx("ol",{className:"es-learning__lesson-list",children:n.lessons.map(o=>{const x=l||o.servedAt!==null||o.state==="mastered"||o.state==="done"||o.state==="current",b=x?"button":"div",p=ls(o.graphicRef,o.graphicUrl),f=x&&o.state==="unseen"?"available":o.state,m=_(x&&o.state==="unseen"?La:Aa[o.state]),w=o.servedAt===null&&o.state==="mastered",q=Ta(o.state);return p?e.jsx("li",{children:e.jsxs(b,{...x?{type:"button",onClick:()=>s(o)}:{},className:`es-learning__lesson-card es-learning__lesson-card--${o.state}${x?"":" es-learning__lesson-card--locked"}`,"aria-disabled":x?void 0:!0,children:[e.jsx(se,{graphicRef:o.graphicRef,graphicUrl:o.graphicUrl,graphicAlt:o.graphicAlt,variant:"card",done:q}),e.jsx("span",{className:"es-learning__lesson-card-title",children:o.title}),(o.isMilestone||w)&&e.jsxs("span",{className:"es-learning__lesson-row-meta",children:[o.isMilestone&&_("learning.milestone"),w&&`${o.isMilestone?" · ":""}${_("learning.not_delivered")}`]}),e.jsxs("span",{className:"es-learning__lesson-card-foot",children:[e.jsx("span",{className:`es-learning__lesson-chip es-learning__lesson-chip--${f}`,children:m}),!x&&e.jsx("span",{className:"es-learning__lesson-lock","aria-hidden":"true",children:e.jsx(Wn,{})})]})]})},o.lessonId):e.jsx("li",{children:e.jsxs(b,{...x?{type:"button",onClick:()=>s(o)}:{},className:`es-learning__lesson-row es-learning__lesson-row--${o.state}${x?"":" es-learning__lesson-row--locked"}`,"aria-disabled":x?void 0:!0,children:[e.jsx(Ia,{graphicRef:o.graphicRef,graphicUrl:o.graphicUrl,graphicAlt:o.graphicAlt,done:q}),e.jsxs("span",{className:"es-learning__lesson-row-body",children:[e.jsx("span",{className:"es-learning__lesson-row-title",children:o.title}),e.jsxs("span",{className:"es-learning__lesson-row-meta",children:[o.isMilestone?_("learning.milestone"):n.title,w&&` · ${_("learning.not_delivered")}`]}),e.jsx("span",{className:`es-learning__lesson-chip es-learning__lesson-chip--${f}`,children:m})]}),x?e.jsx("span",{className:"es-learning__lesson-open","aria-hidden":"true",children:e.jsx(Cn,{size:14})}):e.jsx("span",{className:"es-learning__lesson-lock","aria-hidden":"true",children:e.jsx(Wn,{})})]})},o.lessonId)})})]})]})}function $a({view:n,browse:s,mascot:a,slidePositions:l,newsTile:r,onGoToday:t,onOpenLesson:_,onOpenTopic:j,t:o}){const x=s?.summary?.doneLessons??0,b=s?.summary?.totalLessons??0,p=b>0?Math.round(x/b*100):0,f=s?.streak??{currentStreak:0,longestStreak:0},m=(s?.topics??[]).flatMap(v=>(v.lessons??[]).map(I=>({topic:v,lesson:I}))).filter(({lesson:v})=>v.servedAt!==null&&!v.done).sort((v,I)=>(I.lesson.servedAt??"").localeCompare(v.lesson.servedAt??"")).slice(0,3),w=s?.summary?.attempts?.[0]??null,q=s?.topics??[];return e.jsxs("section",{className:"es-learning__dashboard","aria-label":o("learning.nav_dashboard"),children:[e.jsx(Oa,{view:n,mascot:a,onGoToday:t,t:o}),s&&e.jsxs("div",{className:"es-learning__stats-deck",children:[e.jsxs("div",{className:"es-learning__stats-cell es-learning__stats-cell--ring",children:[e.jsxs("div",{className:"es-learning__ring",role:"img","aria-label":o("learning.dashboard_mastered_label",{pct:p}),style:{"--es-learning-ring":`${p}`},children:[e.jsx("span",{className:"es-learning__ring-value",children:p}),e.jsx("span",{className:"es-learning__ring-unit",children:"%"})]}),e.jsx("span",{className:"es-learning__stats-l",children:o("learning.dashboard_mastered")})]}),e.jsx("span",{className:"es-learning__stats-divider","aria-hidden":"true"}),e.jsxs("div",{className:"es-learning__stats-cell",children:[e.jsxs("span",{className:"es-learning__stats-n",children:[x,"/",b]}),e.jsx("span",{className:"es-learning__stats-l",children:o("learning.dashboard_lessons_done")})]}),e.jsx("span",{className:"es-learning__stats-divider","aria-hidden":"true"}),e.jsxs("div",{className:"es-learning__stats-cell es-learning__stats-cell--streak",children:[e.jsxs("span",{className:"es-learning__stats-n",children:[e.jsx(_a,{size:15}),f.currentStreak]}),e.jsx("span",{className:"es-learning__stats-l",children:o("learning.dashboard_streak")}),f.longestStreak>f.currentStreak&&e.jsx("span",{className:"es-learning__stats-sub",children:o("learning.dashboard_best_streak",{n:f.longestStreak})})]})]}),m.length>0&&_&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:o("learning.dashboard_inprogress_title")}),m.map(({topic:v,lesson:I})=>e.jsx(Ua,{topicTitle:v.title,lesson:I,position:l?.[I.lessonId],onOpen:()=>_(v.topicId,I),t:o},I.lessonId))]}),r,w&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:o("learning.dashboard_last_quiz")}),e.jsx("ul",{className:"es-learning__attempt-list",children:e.jsxs("li",{className:"es-learning__attempt",children:[e.jsx("span",{className:"es-learning__attempt-title",children:w.title}),e.jsx(Ra,{correct:w.correct,total:w.total,t:o})]})})]}),j&&q.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:o("learning.nav_topics")}),e.jsx(ds,{topics:q,onOpen:j,t:o})]})]})}function Ra({correct:n,total:s,t:a}){return s<=0?e.jsx("span",{className:"es-learning__attempt-score",children:a("learning.review_score",{correct:n,total:s})}):e.jsx("span",{className:"es-learning__attempt-segs",role:"img","aria-label":a("learning.attempt_score_a11y",{correct:n,total:s}),"data-testid":"learning-attempt-segments",children:Array.from({length:s},(l,r)=>e.jsx("span",{"aria-hidden":"true",className:`es-learning__attempt-seg es-learning__attempt-seg--${r<n?"good":"bad"}`},r))})}function Ua({topicTitle:n,lesson:s,position:a,onOpen:l,t:r}){const t=!!a&&a.total>0,_=a&&t?Math.round((a.index+1)/a.total*100):0;return e.jsxs("button",{type:"button",className:"es-learning__continue",onClick:l,children:[e.jsxs("span",{className:"es-learning__continue-row",children:[e.jsx(se,{graphicRef:s.graphicRef,graphicUrl:s.graphicUrl,graphicAlt:s.graphicAlt,variant:"continue"}),e.jsxs("span",{className:"es-learning__continue-body",children:[e.jsx("span",{className:"es-learning__continue-title",children:s.title}),e.jsx("span",{className:"es-learning__lesson-row-meta",children:n})]})]}),a&&t&&e.jsxs("span",{className:"es-learning__continue-bar",children:[e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${_}%`}})}),e.jsx("span",{className:"es-learning__progress-count",children:r("learning.slide_caption",{n:a.index+1,total:a.total})})]})]})}function Oa({view:n,mascot:s,onGoToday:a,t:l}){if(!n)return null;if(n.mode==="new_information"){const r=n.lesson.slides?.length??0;return e.jsxs("button",{type:"button",className:"es-learning__today-card es-learning__today-card--hero",onClick:a,children:[e.jsx(se,{graphicRef:n.lesson.graphicRef,graphicUrl:n.lesson.graphicUrl,graphicAlt:n.lesson.graphicAlt,variant:"today"}),e.jsxs("span",{className:"es-learning__today-inner",children:[e.jsx("span",{className:"es-learning__eyebrow",children:l("learning.dashboard_today_eyebrow")}),e.jsx("strong",{className:"es-learning__today-card-title",children:n.lesson.title}),e.jsxs("span",{className:"es-learning__lesson-row-meta",children:[n.lesson.topicTitle,r>0&&` · ${l("learning.slide_count",{total:r})}`]})]})]})}if(n.mode==="checking_question"||n.mode==="lesson_quiz"||n.mode==="section_quiz"||n.mode==="placement_quiz"){const r=n.mode==="checking_question"?null:n.quiz;return e.jsxs("button",{type:"button",className:"es-learning__today-card es-learning__today-card--gold",onClick:a,children:[e.jsx("span",{className:"es-learning__eyebrow",children:l("learning.dashboard_today_eyebrow")}),e.jsx("strong",{className:"es-learning__today-card-title",children:l("learning.dashboard_continue")}),r&&e.jsx("span",{className:"es-learning__lesson-row-meta",children:l("learning.quiz_progress",{answered:r.answered,total:r.total})})]})}return n.mode==="nothing"?e.jsx("div",{className:"es-learning__today-card",children:e.jsx(kn,{kind:n.reason,mascot:s,nextDueAt:n.nextDueAt,t:l})}):null}function Ba({browse:n,t:s}){const{topics:a,summary:l}=n;return e.jsxs("section",{className:"es-learning__progress-view","aria-label":s("learning.nav_progress"),children:[e.jsxs("div",{children:[e.jsx("p",{className:"es-learning__sec-label",children:s("learning.progress_topics_title")}),e.jsx("p",{className:"es-learning__hint",children:s("learning.progress_overall",{mastered:l.doneLessons,total:l.totalLessons})})]}),e.jsx("ul",{className:"es-learning__by-topic",children:a.map(r=>{const t=r.lessonCount>0?Math.round(r.doneCount/r.lessonCount*100):0;return e.jsxs("li",{className:"es-learning__by-topic-row",children:[e.jsx("span",{className:"es-learning__by-topic-title",children:r.title}),e.jsxs("span",{className:"es-learning__by-topic-count",children:[r.doneCount,"/",r.lessonCount]}),e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${t}%`}})})]},r.topicId)})}),l.attempts.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"es-learning__sec-label",children:s("learning.quiz_history")}),e.jsx("ul",{className:"es-learning__attempt-list",children:l.attempts.map(r=>e.jsxs("li",{className:"es-learning__attempt",children:[e.jsx("span",{className:"es-learning__attempt-title",children:r.title}),e.jsxs("span",{className:"es-learning__attempt-score",children:[r.correct,"/",r.total]})]},r.attemptId??r.quizId))})]})]})}const Da="es-learning-place",Ea=10080*60*1e3;function us(n){return`${Da}:${n}`}function Kn(n,s){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(a=>typeof a[1]=="number"&&Number.isFinite(a[1])&&a[1]>=s))}const Pa=n=>n==="dashboard"||n==="today"||n==="topics"||n==="news"||n==="progress";function Fa(n,s){try{const a=localStorage.getItem(us(n));if(!a)return null;const l=JSON.parse(a);return!Pa(l.tab)||(l.ownerId??null)!==s||typeof l.savedAt!="number"||Date.now()-l.savedAt>Ea?null:{tab:l.tab,openTopicId:typeof l.openTopicId=="string"?l.openTopicId:null,readingLessonId:typeof l.readingLessonId=="string"?l.readingLessonId:null,slideIndex:Kn(l.slideIndex,0),slideTotals:Kn(l.slideTotals,1)}}catch{return null}}function Qa(n,s,a){try{const l={...a,ownerId:s,savedAt:Date.now()};localStorage.setItem(us(n),JSON.stringify(l))}catch{}}const Wa=".es-widget__content, .gaio-theme__content";function Ga(n){const s=n?.ownerDocument;if(!n||!s)return;let a=n;for(;a&&a!==s.body&&a!==s.documentElement;){if(a.scrollTop!==0&&(a.scrollTop=0),a.matches(Wa))return;a=a.parentElement}}const Ja="es-learning-rated";function gs(n){return`${Ja}:${n}`}function _s(n,s){const[a]=In(()=>{const l=localStorage.getItem(gs(n));if(!l)return null;const r=JSON.parse(l);return(r.ownerId??null)!==s||!Array.isArray(r.lessonIds)?null:new Set(r.lessonIds.filter(t=>typeof t=="string"))});return a??new Set}function Ka(n,s,a){const l=_s(n,s);l.add(a);const r=[...l].slice(-500),t={ownerId:s,lessonIds:r};return In(()=>localStorage.setItem(gs(n),JSON.stringify(t))),new Set(r)}const Va=["learning-load","learning-browse","learning-read-lesson","learning-lesson-review","learning-lesson-quiz","learning-news-load"],Za=["learning-answer-quiz","learning-answer-quiz-open","learning-answer-open","learning-quiz-finish","learning-start-lesson","learning-complete-lesson"],Ha=300*1e3,ps=new Set(Va),Ye=new Map;let Ae;function hs(n){n!==Ae&&(Ye.clear(),Ae=n)}function Ya(n){return n?JSON.stringify(Object.keys(n).sort().map(s=>[s,String(n[s])])):""}function ms(n,s,a,l){return`${n}\0${s}\0${a}\0${Ya(l)}`}function re(n,s,a,l,r=Date.now()){if(hs(s),s===null||!ps.has(a))return null;const t=Ye.get(ms(n,s,a,l));return t?{data:t.data,stale:r-t.storedAt>=Ha}:null}function ge(n,s,a,l,r,t=Date.now()){if(Ae===void 0)Ae=s;else if(s!==Ae)return;s===null||!ps.has(a)||Ye.set(ms(n,s,a,l),{data:r,storedAt:t})}function Vn(){Ye.clear()}function Xa(n){hs(n)}function el(n){return Ps(n)}function nl(n,s){if(!n)return null;const[a]=In(()=>{const l=new Date(n);return Number.isNaN(l.getTime())?null:new Intl.DateTimeFormat(s,{day:"numeric",month:"short"}).format(l)});return a??null}function sl(n,s){if(!n)return null;const a=n.split("-")[0]?.toLowerCase();return!a||a===s.split("-")[0]?.toLowerCase()?null:a.toUpperCase()}function yn({item:n,currentLanguage:s,onPick:a,t:l}){const r=nl(n.publishedAt,s),t=sl(n.language,s),_=n.sourceName??n.host;return e.jsx("button",{type:"button",className:`es-learning__news${n.read?" es-learning__news--read":""}`,onClick:()=>a(n),"data-testid":"learning-news-card",children:e.jsxs("span",{className:"es-learning__news-row",children:[e.jsx("span",{className:"es-learning__news-thumb",children:n.thumbnailUrl&&e.jsx("img",{src:n.thumbnailUrl,alt:"",loading:"lazy"})}),e.jsxs("span",{className:"es-learning__news-body",children:[e.jsx("span",{className:"es-learning__news-title",children:n.title}),e.jsxs("span",{className:"es-learning__news-meta",children:[_&&e.jsx("span",{children:_}),_&&r&&e.jsx("span",{"aria-hidden":"true",children:"·"}),r&&e.jsx("span",{children:r}),t&&e.jsx("span",{className:"es-learning__news-lang",children:t})]})]}),n.read?e.jsx("span",{className:"es-learning__news-done",role:"img","aria-label":l("learning.news_read"),children:e.jsx(oe,{size:13})}):e.jsx("span",{className:"es-learning__news-ext","aria-hidden":"true",children:e.jsx(ts,{size:14})})]})})}function al({item:n,currentLanguage:s,onPick:a,t:l}){return e.jsxs("div",{className:"es-learning__news-tile","data-testid":"learning-news-tile",children:[e.jsx("p",{className:"es-learning__sec-label",children:l("learning.news_suggested_title")}),e.jsx(yn,{item:n,currentLanguage:s,onPick:a,t:l})]})}function ll({news:n,currentLanguage:s,onPick:a,t:l}){const r=n?.unread??[],t=n?.read??[];return r.length===0&&t.length===0?e.jsx("section",{className:"es-learning__dashboard","aria-label":l("learning.nav_news"),children:e.jsx("p",{className:"es-learning__news-empty",children:l("learning.news_empty")})}):e.jsxs("section",{className:"es-learning__dashboard","aria-label":l("learning.nav_news"),children:[r.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:l("learning.news_new_title")}),e.jsx("div",{className:"es-learning__news-list",children:r.map(_=>e.jsx(yn,{item:_,currentLanguage:s,onPick:a,t:l},_.id))})]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:l("learning.news_read_title")}),e.jsx("div",{className:"es-learning__news-list",children:t.map(_=>e.jsx(yn,{item:_,currentLanguage:s,onPick:a,t:l},_.id))})]})]})}function il({item:n,onCancel:s,onConfirm:a,t:l}){const r=g.useRef(null);return g.useEffect(()=>{r.current?.focus()},[]),g.useEffect(()=>{const t=_=>{_.key==="Escape"&&s()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[s]),e.jsxs("div",{className:"es-learning__leave",role:"dialog","aria-modal":"true","aria-labelledby":"es-learning-leave-title","data-testid":"learning-news-leave",children:[e.jsx("div",{className:"es-learning__leave-scrim","aria-hidden":"true",onClick:s}),e.jsxs("div",{className:"es-learning__leave-card",children:[e.jsx("span",{className:"es-learning__leave-icon","aria-hidden":"true",children:e.jsx(ts,{size:22})}),e.jsx("p",{className:"es-learning__leave-title",id:"es-learning-leave-title",children:l("learning.news_leave_title")}),e.jsx("p",{className:"es-learning__leave-body",children:l("learning.news_leave_body")}),e.jsx("span",{className:"es-learning__leave-host",children:n.host}),e.jsxs("div",{className:"es-learning__leave-actions",children:[e.jsx("button",{type:"button",className:"es-learning__leave-btn es-learning__leave-btn--cancel",onClick:s,children:l("learning.news_leave_cancel")}),e.jsx("button",{ref:r,type:"button",className:"es-learning__leave-btn es-learning__leave-btn--go",onClick:a,children:l("learning.news_leave_confirm")})]})]})]})}function Zn(){const n=new Date,s=n.getFullYear(),a=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return`${s}-${a}-${l}`}function tl(n){return!!n&&typeof n=="object"&&typeof n.error=="string"}async function R(n,s,a){const[l]=await Ls(n.call(s,a));return!l||tl(l)?null:l}const Nn="__untracked__";function vn(n){return!!n&&Array.isArray(n.unread)&&Array.isArray(n.read)}function rl(n,s,a){const l=n.unread.find(r=>r.id===s);return{suggested:n.suggested?.id===s?n.suggested.pinned?{...n.suggested,read:!0}:null:n.suggested,unread:n.unread.filter(r=>r.id!==s),read:l?[{...l,read:!0},...n.read]:n.read,unreadCount:a}}function jl(n){const s=n.auth?.user?.id??null;return e.jsx(ol,{...n},`${n.productId}\0${s??"signed-out"}`)}function ol({config:n,data:s,actions:a,i18n:l,builderMode:r,productId:t,auth:_,baseUrl:j,externalContext:o,previewMode:x,readOnly:b}){const p=l?.t??(i=>i),f=l?.currentLanguage??"en",m=_?.user?.id??null,w=As(n.title,f,{t:p,fallbackKey:"learning.title",enDefault:"Learning"}),q=n.showExplanations!==!1,v=ha(n.mascot),I=n.showBrowse!==!1,P=I&&n.showDashboard!==!1,T=I&&n.showProgress===!0,Z=I&&n.showNews!==!1,[u,E]=g.useState(()=>r?null:re(t,m,"learning-load",{language:f})?.data??null),[G,H]=g.useState(()=>!r&&re(t,m,"learning-load",{language:f})===null),[be,F]=g.useState(null),[L,B]=g.useState(!1),[J,_e]=g.useState(""),[Xe,ve]=g.useState(null),[Y,K]=g.useState(null),[ae,we]=g.useState(null),U=g.useRef(r?null:Fa(t,m)).current,[X,pe]=g.useState(U?.tab??"dashboard"),[V,ke]=g.useState(()=>{if(r||!Z)return null;const i=re(t,m,"learning-news-load")?.data;return vn(i)?i:null}),k=g.useRef(null);k.current=V;const[A,he]=g.useState(null),[ce,Me]=g.useState(()=>U?.slideIndex??{}),[en,$e]=g.useState({}),[ye,xs]=g.useState(()=>U?.slideTotals??{}),[js]=g.useState(()=>r?new Set:_s(t,m)),[fs,bs]=g.useState(()=>new Set),Ie=g.useRef(null),Re=i=>{if(n?.readAloudEnabled!==!0)return null;const c=o?.renderReadAloud;return typeof c!="function"?null:c(`learning-lesson-${i}`,Ie)},nn=i=>r||js.has(i)||fs.has(i)?null:e.jsx($s,{compact:!0,blockSlug:"learning",subjectType:"learning_lesson",subjectId:i,promptKey:"block_rating.prompt_lesson",ariaKey:"block_rating.rate_lesson_aria",baseUrl:j,apiKey:o?.apiKey,jwt:_?.jwt,previewMode:x||b,settleInPlace:!0,onRated:()=>Ka(t,m,i),onFeedbackCycleDone:()=>bs(c=>new Set(c).add(i)),t:p}),[sn,an]=g.useState(!1),[ws,Ns]=g.useState(!1),[Ue,ln]=g.useState(!1),[An,Tn]=g.useState(null),[vs,tn]=g.useState(!1),Ln=g.useRef(null),[le,me]=g.useState(U?.openTopicId??null),[xe,Oe]=g.useState(null),[W,de]=g.useState(null),[N,ze]=g.useState(()=>r?null:re(t,m,"learning-browse",{language:f})?.data??null),[rn,on]=g.useState(!1),[S,ee]=g.useState(null),[ks,Be]=g.useState(null),[M,De]=g.useState(null),[O,Ee]=g.useState(null),[ue,Mn]=g.useState(null),[cn,dn]=g.useState(!1),[$,un]=g.useState(null),ie=g.useRef(p);ie.current=p;const $n=g.useCallback((i,c)=>(Za.includes(i)&&(Vn(),on(!0)),a.call(i,c)),[a]),C=g.useMemo(()=>({...a,call:$n}),[a,$n]),je=g.useCallback(async i=>{F(null),ve(null),K(null),we(null),_e("");const c={...i?{preferredTopicId:i}:{},language:f},d=re(t,m,"learning-load",c);if(d){if(E(d.data),H(!1),!d.stale)return d.data;const y=await R(C,"learning-load",c);return y&&(ge(t,m,"learning-load",c,y),E(y)),y??d.data}H(!0);const h=await R(C,"learning-load",c);return h?(ge(t,m,"learning-load",c,h),E(h)):F(ie.current("learning.error_load")),H(!1),h},[C,f,m,t]);g.useEffect(()=>{if(r){const i=s?.mode??"nothing";E(i==="nothing"?{mode:"nothing",reason:s?.reason??"all_in_cooldown"}:{mode:"unavailable"});return}je()},[r,je,s?.mode,s?.reason]),g.useEffect(()=>{const i=a.on?.("learning:reload",()=>{Vn(),je()});return()=>i?.()},[a,je]),g.useEffect(()=>{if(r||!Z)return;let i=!1;return(async()=>{const c=re(t,m,"learning-news-load");if(c&&(vn(c.data)&&ke(c.data),!c.stale))return;const d=await R(a,"learning-news-load");i||!d||(ge(t,m,"learning-news-load",void 0,d),vn(d)&&ke(d))})(),()=>{i=!0}},[a,r,m,t,Z]);const ys=g.useCallback(()=>{const i=A;if(!i)return;he(null);const c=el(i.url);if(!c){F(ie.current("learning.news_error_open"));return}const d=window.open(c,"_blank","noopener,noreferrer");d&&(d.opener=null),(async()=>{const h=await R(a,"learning-news-open",{newsItemId:i.id});if(!h||typeof h.unreadCount!="number")return;const y=k.current;if(!y)return;const D=rl(y,i.id,h.unreadCount);ke(D),ge(t,m,"learning-news-load",void 0,D)})()},[a,A,m,t]);g.useEffect(()=>{Xa(m)},[m]),g.useEffect(()=>{if(X==="today"||r||N&&(M||W||$))return;const i={language:f},c=rn?null:re(t,m,"learning-browse",i);if(N&&!rn&&!(c&&c.stale)||(c&&ze(c.data),c&&!c.stale))return;let d=!1;return(async()=>{const h=await R(C,"learning-browse",i);d||!h||!Array.isArray(h.topics)||!h.summary||(ge(t,m,"learning-browse",i,h),ze(h),on(!1))})(),()=>{d=!0}},[X,N,rn,M,W,$,r,C,f,m,t]);const gn=g.useCallback(async(i,c,d)=>{const h=await R(C,"learning-answer-quiz",{quizId:i,questionId:c,selectedOptionIndex:d,language:f});if(!h){F(ie.current("learning.error_answer"));return}a.emit("learning:answerSubmitted",{questionId:c}),h.completed&&K(h.completed)},[a,C,f]),_n=g.useCallback(async(i,c,d)=>{B(!0);const h=await R(C,"learning-answer-quiz-open",{quizId:i,questionId:c,answer:d,language:f});return h?a.emit("learning:answerSubmitted",{questionId:c}):F(ie.current("learning.error_answer")),B(!1),!!h},[a,C,f]),pn=g.useCallback(async(i,c)=>{if(L)return;B(!0);const d=await R(C,"learning-quiz-finish",{quizId:i,language:f,activeDate:Zn()});if(d){if(K(d),a.emit("learning:quizCompleted",d),Mn(d.sectionQuiz??null),d.streak&&ze(h=>h&&{...h,streak:d.streak}),!c?.isSectionQuiz){const h=await R(C,"learning-load",{language:f});h?.mode&&we(h)}}else Y||F(ie.current("learning.error_answer"));B(!1)},[a,C,L,f,Y]),Rn=g.useCallback(async(i,c,d)=>{if(L)return!1;B(!0);const h=await R(C,"learning-section-quiz",{topicId:i,language:f});B(!1);const y=h?.quiz??null;return y?(K(null),dn(!1),un({quiz:y,topicTitle:h?.topicTitle||c,origin:d}),!0):!1},[L,C,f]),Is=g.useCallback(async i=>{const c=J.trim();if(!c||L)return;B(!0);const d=await R(C,"learning-answer-open",{questionId:i,answer:c,language:f});d?(a.emit("learning:answerSubmitted",{questionId:i,verdict:d.verdict}),ve(d)):F(ie.current("learning.error_answer")),B(!1)},[a,C,L,f,J]),Pe=g.useCallback(async i=>{B(!0);const c=await R(C,"learning-start-lesson",{lessonId:i});return B(!1),c?!0:(F(ie.current("learning.error_load")),!1)},[C]),hn=g.useCallback(async i=>{await Pe(i)&&ln(!0)},[Pe]),Fe=g.useCallback(async(i,c)=>{i?.mode==="new_information"&&i.isNew&&(c!==null&&i.lesson.topicId!==c?Tn(i.lesson.lessonId):await hn(i.lesson.lessonId)),tn(!1)},[hn]),Qe=g.useCallback(()=>{dn(!1),Mn(null),un(null),K(null),ln(!1),ae&&(E(ae),we(null),tn(!0),Fe(ae,Ln.current))},[Fe,ae]),We=g.useCallback(async i=>{const c=await R(C,"learning-complete-lesson",{lessonId:i,activeDate:Zn()});return c?.streak&&ze(d=>d&&{...d,streak:c.streak}),c},[C]),Un=g.useCallback(async(i,c)=>{ln(!1),tn(!0),Ln.current=c??null,i&&(await We(i),Me(d=>{if(!(i in d))return d;const h={...d};return delete h[i],h}),$e(d=>{if(!(i in d))return d;const h={...d};return delete h[i],h})),await Fe(await je(),c??null)},[Fe,je,We]),te=g.useCallback(async(i,c)=>{F(null),Ns(c?.fromQuiz===!0),de({...i}),Be(null);const d={lessonId:i.lessonId,language:f},h=re(t,m,"learning-read-lesson",d);if(h)ee(h.data),h.stale&&(async()=>{const y=await R(C,"learning-read-lesson",d);y&&(y.body||y.slides?.length)&&(ge(t,m,"learning-read-lesson",d,y),ee(y))})();else{ee(null);const y=await R(C,"learning-read-lesson",d);if(!y||!y.body&&!y.slides?.length){de(null),F(ie.current("learning.error_load"));return}ge(t,m,"learning-read-lesson",d,y),ee(y)}if(i.done){const y={lessonId:i.lessonId,language:f},D=re(t,m,"learning-lesson-review",y);if(D&&!D.stale)Be(D.data.rows??null);else{const Se=await R(C,"learning-lesson-review",y);Se?(ge(t,m,"learning-lesson-review",y,Se),Be(Se.rows??null)):Be(D?D.data.rows??null:null)}}},[C,f,m,t]),Ge=g.useCallback(async i=>{if(N?.canPickAnyLesson===!0&&i.servedAt===null&&!i.done){F(null),de(null),ee(null),Ee(i);return}await te(i)},[N?.canPickAnyLesson,te]),mn=g.useCallback(async i=>{await Pe(i.lessonId)&&(Ee(null),await te({...i,servedAt:new Date().toISOString()}))},[te,Pe]),zs=g.useCallback(async i=>{B(!0),await R(C,"learning-start-lesson",{lessonId:i}),await We(i);const c=await R(C,"learning-lesson-quiz",{lessonId:i,language:f});if(B(!1),c?.quiz){De({quiz:c.quiz,lessonId:c.lessonId??i,lessonTitle:c.lessonTitle??""}),de(null),ee(null);return}const d=N?.topics.flatMap(D=>(D.lessons??[]).map(Se=>({topicId:D.topicId,lesson:Se})))??[],h=d.findIndex(D=>D.lesson.lessonId===i),y=N?.canPickAnyLesson===!0&&h!==-1?d.slice(h+1).find(D=>!D.lesson.done)??null:null;if(de(null),ee(null),ze(null),!!y){if(y.topicId===d[h].topicId){await mn(y.lesson);return}Tn(y.lesson.lessonId),Ge(y.lesson)}},[C,f,N,Ge,We,mn]),On=g.useRef(U?.readingLessonId??null);g.useEffect(()=>{const i=On.current;if(!i||!N||r)return;On.current=null;const c=N.topics.flatMap(d=>d.lessons??[]).find(d=>d.lessonId===i);c&&te(c)},[N,r,te]),g.useEffect(()=>{r||Qa(t,m,{tab:X,openTopicId:le,readingLessonId:W?.lessonId??null,slideIndex:ce,slideTotals:ye})},[r,t,m,X,le,W,ce,ye]);const Bn=u?.mode==="new_information"?u.lesson:null;g.useEffect(()=>{const i=[];for(const c of[Bn,S]){const d=c?.slides?.length??0;c&&d>0&&i.push([c.lessonId,d])}i.length!==0&&xs(c=>{const d=i.filter(([h,y])=>c[h]!==y);return d.length>0?{...c,...Object.fromEntries(d)}:c})},[Bn,S]);const qs=g.useMemo(()=>{const i={};for(const[c,d]of Object.entries(ye))d<=0||(i[c]={index:Math.min(ce[c]??0,d-1),total:d});return i},[ye,ce]),qe=(N?.tracks?.length??0)>0,xn=g.useMemo(()=>O?N?.topics.find(i=>(i.lessons??[]).some(c=>c.lessonId===O.lessonId))??null:null,[N,O]),Ce=g.useMemo(()=>{if(!N||!qe)return[];const i=new Set(N.tracks.flatMap(c=>c.topics.map(d=>d.topicId)));return N.topics.filter(c=>!i.has(c.topicId))},[N,qe]),Je=g.useMemo(()=>!N||!xe?null:xe===Nn?{trackId:Nn,title:p("learning.track_unassigned"),topicCount:Ce.length,doneTopicCount:Ce.filter(i=>i.lessonCount>0&&i.doneCount===i.lessonCount).length,topics:Ce}:N.tracks?.find(i=>i.trackId===xe)??null,[N,xe,Ce,p]),Dn=i=>{if(N?.canPickAnyLesson!==!0)return null;const c=N.topics.flatMap(h=>h.lessons??[]),d=c.findIndex(h=>h.lessonId===i);return d===-1?null:c.slice(d+1).find(h=>!h.done)??null},Cs=i=>{if(!N)return!0;const c=N.topics.flatMap(h=>h.lessons??[]),d=c.findIndex(h=>h.lessonId===i);return d===-1?!0:c.slice(d+1).some(h=>!h.done)},jn=i=>Cs(i)?p("learning.finish_next_lesson"):p("learning.finish_lesson"),En=Z&&V!==null&&(V.unread.length>0||V.read.length>0||V.suggested!==null),ne=G||vs,z=X==="dashboard"&&!P||X==="progress"&&!T||X==="news"&&!En?"today":X,Pn=g.useRef(null),Fn=S?.lessonId??(u?.mode==="new_information"?u.lesson.lessonId:null),Ss=[z,xe??"",le??"",O?.lessonId??"",W?.lessonId??"",sn?"quiz-lesson":"",M?.quiz.attemptId??M?.quiz.quizId??"",$?.quiz.attemptId??$?.quiz.quizId??"",cn?"section-intro":"",u?.mode??"",u?.mode==="new_information"?u.lesson.lessonId:"",u?.mode==="new_information"&&u.isNew&&!Ue?"arrival":"",u?.mode==="checking_question"?u.question.questionId:"",u?.mode==="placement_quiz"||u?.mode==="section_quiz"||u?.mode==="lesson_quiz"?u.quiz.attemptId??u.quiz.quizId:"",Y?"results":"",Fn?String(ce[Fn]??0):""].join("|");return g.useLayoutEffect(()=>{Ga(Pn.current)},[Ss]),e.jsxs(Ts,{blockType:"learning",children:[e.jsxs("header",{className:"es-learning__header",children:[e.jsx("span",{className:"es-learning__header-title",children:w}),I&&e.jsx("nav",{className:"es-learning__header-actions","aria-label":w,children:[...P?[["dashboard",ua]]:[],["today",ca],["topics",da],...En?[["news",pa]]:[],...T?[["progress",ga]]:[]].map(([i,c])=>{const d=i==="news"&&z!=="news"?V?.unreadCount??0:0,h=p(`learning.nav_${i}`);return e.jsxs("button",{type:"button",className:`es-learning__navbtn es-learning__navbtn--icon${i==="news"?" es-learning__navbtn--news":""}${z===i?" es-learning__navbtn--active":""}`,"aria-current":z===i?"page":void 0,"aria-label":d>0?p("learning.nav_news_unread",{n:d}):h,title:h,onClick:()=>{pe(i),me(null),Oe(null),de(null),ee(null),Ee(null),an(!1),De(null),K(null),we(null),he(null)},children:[e.jsx(c,{}),d>0&&e.jsx("span",{className:"es-learning__navbadge","aria-hidden":"true",children:d>99?"99+":d})]},i)})})]}),e.jsxs("div",{className:"es-block__body es-learning",ref:Pn,children:[be&&e.jsx("div",{className:"es-learning__error",role:"alert",children:be}),ne&&(z==="today"||z==="dashboard")&&e.jsx("div",{className:"es-learning__loading",children:p("learning.loading")}),z==="dashboard"&&!G&&e.jsx($a,{view:u,browse:N,mascot:v,slidePositions:qs,newsTile:Z&&V?.suggested?e.jsx(al,{item:V.suggested,currentLanguage:f,onPick:he,t:p}):void 0,onGoToday:()=>pe("today"),onOpenLesson:(i,c)=>{pe("topics"),me(i),te(c)},onOpenTopic:i=>{pe("topics"),me(i)},t:p}),z==="news"&&e.jsx(ll,{news:V,currentLanguage:f,onPick:he,t:p}),z==="progress"&&N&&e.jsx(Ba,{browse:N,t:p}),(z==="topics"||z==="progress")&&!N&&!O&&e.jsx("div",{className:"es-learning__loading",children:p("learning.loading")}),z==="topics"&&O&&e.jsx(Gn,{lessonTitle:O.title,topicTitle:xn?.title??"",newTopic:An===O.lessonId,graphicRef:O.graphicRef,graphicAlt:O.graphicAlt,graphicUrl:O.graphicUrl,slideCount:ye[O.lessonId]??0,mascot:v,busy:L,onStart:()=>{mn(O)},onBackToTopic:xn?()=>{Ee(null),me(xn.topicId)}:void 0,t:p}),z==="topics"&&N&&W&&!S&&e.jsx("div",{className:"es-learning__loading",children:p("learning.loading")}),z==="topics"&&N&&W&&S&&e.jsx(Jn,{lesson:S,readAloud:Re(S.lessonId),readAloudRef:Ie,slideIndex:ce[S.lessonId]??0,onSlideIndexChange:i=>Me(c=>({...c,[S.lessonId]:i})),slideAnswers:en[S.lessonId]??{},onSlideAnswer:(i,c)=>$e(d=>({...d,[S.lessonId]:{...d[S.lessonId]??{},[i]:c}})),review:ks,backLabel:p("learning.back_to_topic",{topic:S.topicTitle}),showBackLink:!1,onBack:()=>{de(null),ee(null)},onBackToTopic:()=>{de(null),ee(null)},onFinish:N.canPickAnyLesson===!0&&!W.done?()=>{zs(S.lessonId)}:void 0,finishLabel:S.hasQuiz===!1?jn(S.lessonId):p("learning.finish_to_quiz"),rating:ws?null:nn(S.lessonId),t:p}),z==="topics"&&M&&e.jsx(wn,{quiz:M.quiz,isPlacement:!1,eyebrow:M.lessonTitle,topics:[],results:Y,busy:L,mascot:v,onAnswer:(i,c)=>{gn(M.quiz.quizId,i,c)},onAnswerOpen:(i,c)=>_n(M.quiz.quizId,i,c),onFinish:()=>{pn(M.quiz.quizId)},onBackToLesson:()=>{De(null),te({lessonId:M.lessonId,title:M.lessonTitle,isMilestone:!1,state:"gap",done:!1,servedAt:new Date().toISOString()},{fromQuiz:!0})},onContinue:()=>{const i=Dn(M.lessonId);K(null),De(null),i&&Ge(i)},continueLabel:Dn(M.lessonId)?p("learning.go_to_next_lesson"):p("learning.nav_topics"),t:p},M.quiz.attemptId??M.quiz.quizId),z==="topics"&&N&&!W&&!M&&!$&&!O&&le&&e.jsx(Ma,{topic:N.topics.find(i=>i.topicId===le)??N.topics[0],onOpenLesson:i=>{Ge(i)},onStartSectionQuiz:()=>{const i=N.topics.find(c=>c.topicId===le)??N.topics[0];(async()=>await Rn(i.topicId,i.title,"topics")||on(!0))()},canPickAnyLesson:N.canPickAnyLesson===!0,backLabel:Je?.title,onBack:Je?()=>me(null):void 0,t:p}),z==="topics"&&N&&!W&&!M&&!$&&!O&&!le&&qe&&!xe&&e.jsx(Ca,{tracks:N.tracks,untracked:Ce,onOpenTrack:Oe,onOpenUntracked:()=>Oe(Nn),t:p}),z==="topics"&&N&&!W&&!M&&!$&&!O&&!le&&qe&&xe&&Je&&e.jsx(Sa,{track:Je,onOpenTopic:me,onBack:()=>Oe(null),t:p}),z==="topics"&&N&&!W&&!M&&!$&&!O&&!le&&!qe&&e.jsx(ds,{topics:N.topics,onOpen:me,t:p}),z==="today"&&!ne&&u?.mode==="nothing"&&e.jsx(kn,{kind:u.reason,mascot:v,nextDueAt:u.nextDueAt,t:p}),z==="today"&&!ne&&u?.mode==="unavailable"&&e.jsx(kn,{kind:"unavailable",mascot:v,t:p}),z==="today"&&!ne&&u?.mode==="new_information"&&u.isNew&&!Ue&&e.jsx(Gn,{lessonTitle:u.lesson.title,topicTitle:u.lesson.topicTitle,newTopic:An===u.lesson.lessonId,graphicRef:u.lesson.graphicRef,graphicAlt:u.lesson.graphicAlt,graphicUrl:u.lesson.graphicUrl,slideCount:u.lesson.slides?.length??0,mascot:v,busy:L,onStart:()=>{hn(u.lesson.lessonId)},t:p}),z==="today"&&!ne&&u?.mode==="new_information"&&(!u.isNew||Ue)&&(!u.lesson.kind||u.lesson.kind==="info"||!u.lesson.slides?.length)&&e.jsx(rs,{lesson:u.lesson,busy:L,onDone:()=>{Un(u.lesson.lessonId,u.lesson.topicId)},doneLabel:u.lesson.hasQuiz===!1?jn(u.lesson.lessonId):void 0,rating:nn(u.lesson.lessonId),readAloud:Re(u.lesson.lessonId),readAloudRef:Ie,t:p}),z==="today"&&!ne&&u?.mode==="new_information"&&(!u.isNew||Ue)&&u.lesson.kind&&u.lesson.kind!=="info"&&!!u.lesson.slides?.length&&e.jsx(cs,{lesson:u.lesson,index:ce[u.lesson.lessonId]??0,onIndexChange:i=>Me(c=>({...c,[u.lesson.lessonId]:i})),answers:en[u.lesson.lessonId]??{},onAnswer:(i,c)=>$e(d=>({...d,[u.lesson.lessonId]:{...d[u.lesson.lessonId]??{},[i]:c}})),busy:L,onDone:()=>{Un(u.lesson.lessonId,u.lesson.topicId)},doneLabel:u.lesson.hasQuiz===!1?jn(u.lesson.lessonId):void 0,rating:nn(u.lesson.lessonId),readAloud:Re(u.lesson.lessonId),readAloudRef:Ie,t:p}),z==="today"&&!ne&&u?.mode==="checking_question"&&e.jsx(fa,{prompt:u.question.prompt,lessonTitle:u.lessonTitle,answer:J,feedback:Xe,busy:L,showExplanations:q,onChange:_e,onSubmit:()=>{Is(u.question.questionId)},t:p}),z==="today"&&!ne&&u?.mode==="lesson_quiz"&&sn&&(S?e.jsx(Jn,{lesson:S,readAloud:Re(S.lessonId),readAloudRef:Ie,slideIndex:ce[S.lessonId]??0,onSlideIndexChange:i=>Me(c=>({...c,[S.lessonId]:i})),slideAnswers:en[S.lessonId]??{},onSlideAnswer:(i,c)=>$e(d=>({...d,[S.lessonId]:{...d[S.lessonId]??{},[i]:c}})),backLabel:p("learning.back_to_quiz"),onBack:()=>an(!1),t:p}):e.jsx("div",{className:"es-learning__loading",children:p("learning.loading")})),z==="today"&&!ne&&cn&&ue&&e.jsx(ma,{topicTitle:ue.topicTitle,topicComplete:ue.topicComplete,mascot:v,busy:L,onStart:()=>{(async()=>await Rn(ue.topicId,ue.topicTitle,"today")||Qe())()},onSkip:Qe,t:p}),$&&z===$.origin&&e.jsx(wn,{quiz:$.quiz,isPlacement:!1,eyebrow:$.topicTitle,topics:[],results:Y,busy:L,mascot:v,onAnswer:(i,c)=>{gn($.quiz.quizId,i,c)},onAnswerOpen:(i,c)=>_n($.quiz.quizId,i,c),onFinish:()=>{pn($.quiz.quizId,{isSectionQuiz:!0})},onBackToLesson:void 0,onContinue:$.origin==="today"?Qe:()=>{un(null),K(null)},continueLabel:$.origin==="topics"?p("learning.nav_topics"):ae?.mode==="new_information"?p("learning.go_to_next_lesson"):p("learning.continue"),t:p},$.quiz.attemptId??$.quiz.quizId),z==="today"&&!ne&&!sn&&!cn&&$?.origin!=="today"&&(u?.mode==="placement_quiz"||u?.mode==="section_quiz"||u?.mode==="lesson_quiz")&&e.jsx(wn,{quiz:u.quiz,isPlacement:u.mode==="placement_quiz",eyebrow:u.mode==="lesson_quiz"?u.lessonTitle:void 0,topics:u.mode==="placement_quiz"?u.topics:[],results:Y,busy:L,mascot:v,onAnswer:(i,c)=>{gn(u.quiz.quizId,i,c)},onAnswerOpen:(i,c)=>_n(u.quiz.quizId,i,c),onFinish:()=>{pn(u.quiz.quizId)},onBackToLesson:u.mode==="lesson_quiz"?()=>{an(!0),te({lessonId:u.lessonId,title:u.lessonTitle,isMilestone:!1,state:"current",done:!1,servedAt:null},{fromQuiz:!0})}:void 0,onChooseTopic:u.mode==="placement_quiz"?i=>{je(i)}:void 0,onContinue:ue||ae?()=>{if(ue){K(null),dn(!0);return}Qe()}:void 0,continueLabel:!ue&&ae?.mode==="new_information"?p("learning.go_to_next_lesson"):p("learning.continue"),t:p},u.quiz.attemptId??u.quiz.quizId)]}),A&&e.jsx(il,{item:A,onCancel:()=>he(null),onConfirm:ys,t:p})]})}export{jl as Component,Gn as NewLessonIntro,ya as QuizReview,ma as SectionQuizIntro,xl as manifest};
2
- //# sourceMappingURL=index-CZSW9eXg-BwcGrX1b.js.map
1
+ import{j as e,r as g,L as As,e as Ts,o as He,Z as In,K as Ls,k as Ms}from"../nexly.js";import{C as $s}from"./block-rating-uD_0LK-1-CQMNokIy.js";import{x as Rs,c as Us,s as Hn,a as Os}from"./allowed-elements-C0OfX2zF-DIBV8lKu.js";import{r as Bs}from"./inert-assistant-components-B6Cx9pG5-DWb6n3Yq.js";import{X as Ds,F as Es}from"./ClickToLoadEmbed-BNWVfZ1y-DuTZcv6f.js";import{p as Ps}from"./external-url-Bx_GTDOx-rLiy7c9v.js";import"./_commonjsHelpers-C6fGbg64-BC8KDfbh.js";import"./assistant-link-policy-B77YPf4E-By6jpR50.js";const Fs=/^[a-z0-9][a-z0-9-]*$/,Qs=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Le(n){if(!n)return null;const s=n.trim();if(!s)return null;if(s.startsWith("media:")){const l=s.slice(6);return Qs.test(l)?{kind:"media",mediaId:l}:null}const a=s.startsWith("icon:")?s.slice(5):s;return Fs.test(a)?{kind:"icon",slug:a}:null}const fn="media:",bn="youtube:",Ws=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Yn(n){if(!n)return null;const s=n.trim();if(s.startsWith(fn)){const a=s.slice(fn.length);return Ws.test(a)?{kind:"image",ref:`${fn}${a}`,mediaId:a}:null}if(s.startsWith(bn)){const a=s.slice(bn.length);return Es(a)?{kind:"youtube",ref:`${bn}${a}`,id:a}:null}return null}const xl={slug:"learning",name:"Learning",version:"1.0.0",category:"interactive",requiredService:"learning",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},title:{type:"string",default:""},showExplanations:{type:"boolean",default:!0},showBrowse:{type:"boolean",default:!0},showDashboard:{type:"boolean",default:!0},showProgress:{type:"boolean",default:!1},showNews:{type:"boolean",default:!0}}},defaultConfig:{readAloudEnabled:!1,title:"",showExplanations:!0,showBrowse:!0,showDashboard:!0,showProgress:!1,showNews:!0},dataContract:{serviceSlug:"learning",inputSchema:{type:"object",properties:{mode:{type:"string",description:"placement_quiz | section_quiz | checking_question | new_information | nothing"},quizId:{type:"string",description:"Set for placement_quiz / section_quiz"},questionId:{type:"string",description:"Set for checking_question"},lessonId:{type:"string",description:"Set for new_information / checking_question"},topicId:{type:"string",description:"Set for new_information / section_quiz"},reason:{type:"string",description:"Set for mode=nothing: no_curriculum | all_mastered | all_in_cooldown"}},required:["mode"]},previewDataOverride:{mode:"nothing",reason:"all_in_cooldown"}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"title",type:"localized-text",label:"Heading",default:"",placeholder:'Leave empty to use the translated default ("Learning")',group:"Content"},{id:"showExplanations",type:"toggle",label:"Show explanations after answering",default:!0,group:"Behavior"},{id:"showBrowse",type:"toggle",label:"Offer the browsing sections (Topics, Dashboard, Progress)",default:!0,group:"Sections"},{id:"showDashboard",type:"toggle",label:"Show the Dashboard section (streak, progress, what to pick up)",default:!0,group:"Sections"},{id:"showProgress",type:"toggle",label:"Show the Progress section (mastery by topic, quiz history)",default:!1,group:"Sections"},{id:"showNews",type:"toggle",label:"Show the News section (published feed items, with an unread badge)",default:!0,group:"Sections"}],events:{emits:[{name:"learning:answerSubmitted",description:"Learner answered a question"},{name:"learning:quizCompleted",description:"Learner finished a quiz attempt"},{name:"learning:lessonSkipped",description:"Learner declared a lesson already known"}],listens:[{name:"learning:reload",description:"Re-fetch the current assignment"}]},sizing:{minWidth:260,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main"]},Xn=g.createContext(null),Gs=({children:n})=>e.jsx("span",{className:"es-learning__md-link",children:n}),Js=({node:n,...s})=>e.jsx("div",{className:"es-learning__md-tablewrap",children:e.jsx("table",{...s})}),Ks=({node:n,type:s,checked:a,...l})=>s==="checkbox"?e.jsx("input",{...l,type:"checkbox",checked:!!a,disabled:!0,readOnly:!0}):null,Vs=()=>null,Zs=({src:n,alt:s})=>{const a=g.useContext(Xn);if(!a)return null;const{media:l,t:r}=a,t=Yn(typeof n=="string"?n:void 0),_=t?l[t.ref]:void 0,j=(s??"").trim();return _?_.kind==="image"?e.jsx("img",{className:"es-learning__media-img",src:_.url,alt:j||r("learning.media_image_alt"),loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"}):e.jsx(Ds,{embed:{provider:_.provider,id:_.id},t:r,classPrefix:"es-learning",posterUrl:_.posterUrl},`${_.provider}:${_.id}`):e.jsx("span",{className:"es-learning__media-missing",children:j||r("learning.media_unavailable")})},Hs=({node:n,children:s,...a})=>{const l=n?.children;return l!==void 0&&l.length>0&&l.every(r=>r.type==="element"&&r.tagName==="img"||r.type==="text"&&!(r.value??"").trim())&&l.some(r=>r.type==="element")?e.jsx(e.Fragment,{children:s}):e.jsx("p",{...a,children:s})},es={...Bs,a:Gs,table:Js,input:Ks},Ys={...es,img:Vs},Xs={...es,img:Zs,p:Hs},ea=[...Hn],na=[...Hn,"img"],sa=n=>Os(n)??"",aa=()=>"",la=n=>Yn(n)?n:"";function ns(n,s,a,l){return e.jsx("div",{className:"es-learning__md",children:e.jsx(Rs,{remarkPlugins:[...Us],allowedElements:s,transformLinkUri:sa,transformImageUri:a,components:l,children:n})})}function zn({children:n}){return n?.trim()?ns(n,ea,aa,Ys):null}function ss({children:n,media:s,t:a}){const l=g.useMemo(()=>({media:s??{},t:a}),[s,a]);return n?.trim()?e.jsx(Xn.Provider,{value:l,children:ns(n,na,la,Xs)}):null}function se({graphicRef:n,graphicAlt:s,graphicUrl:a,variant:l,done:r}){const t=Le(n);if(!t)return null;const _=["es-learning__graphic",l?`es-learning__graphic--${l}`:"",r?"es-learning__graphic--done":""].filter(Boolean).join(" ");if(t.kind==="media")return a?e.jsx("div",{className:`${_} es-learning__graphic--image`,children:e.jsx("img",{src:a,alt:s??"",className:"es-learning__graphic-img",loading:"lazy","data-testid":"learning-graphic-image"})}):null;const j=He(t.slug);return j?e.jsx("div",{className:_,role:s?"img":"presentation","aria-label":s??void 0,"data-testid":"learning-graphic-icon",children:e.jsx(j,{size:40})}):null}function as(n,s){const a=Le(n);return a?a.kind==="media"?!!s:!!He(a.slug):!1}function ls(n,s){return Le(n)?.kind==="media"&&!!s}function is({topicTitle:n,onBackToTopic:s,t:a}){return s?e.jsxs("button",{type:"button",className:"es-learning__eyebrow es-learning__eyebrow--back",onClick:s,"aria-label":a("learning.back_to_topic",{topic:n}),children:[e.jsx("span",{"aria-hidden":"true",children:"← "}),n]}):e.jsx("p",{className:"es-learning__eyebrow",children:n})}const Q=n=>({width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0});function ia({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"m15.5 8.5-2 5.5-5.5 2 2-5.5z"})]})}function Qn({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M12 7.5V12l3 2"})]})}function ta({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("path",{d:"M8 4h8v4a4 4 0 0 1-8 0z"}),e.jsx("path",{d:"M8 5H5.5a2.5 2.5 0 0 0 2.5 4M16 5h2.5a2.5 2.5 0 0 1-2.5 4"}),e.jsx("path",{d:"M12 12v4M9 20h6M10 20a2 2 0 0 1 4 0"})]})}function ra({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("path",{d:"M4 5h16M4 12h16M4 19h16"}),e.jsx("path",{d:"M7 5v7M12 12v7",opacity:"0.45"})]})}function oa({size:n=28}){return e.jsxs("svg",{...Q(n),children:[e.jsx("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),e.jsx("path",{d:"M14 3v5h5"}),e.jsx("path",{d:"m9.5 12.5 5 5m0-5-5 5"})]})}function Ve({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"M19 12H5m0 0 6-6m-6 6 6 6"})})}function fe({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"M5 12h14m0 0-6-6m6 6-6 6"})})}function oe({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"m5 13 4 4L19 7"})})}function Te({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function qn({size:n=16}){return e.jsxs("svg",{...Q(n),children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6v.3"}),e.jsx("path",{d:"M12 17h.01"})]})}function Wn({size:n=14}){return e.jsxs("svg",{...Q(n),children:[e.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),e.jsx("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]})}function Cn({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"m9 6 6 6-6 6"})})}function ca({size:n=18}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M12 6.5C10.5 5 8.5 4.5 4 4.5v13c4.5 0 6.5.5 8 2 1.5-1.5 3.5-2 8-2v-13c-4.5 0-6.5.5-8 2Z"}),e.jsx("path",{d:"M12 6.5v13"})]})}function da({size:n=18}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M4 6h16M4 12h16M4 18h10"})})}function ua({size:n=18}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"m4 11 8-6 8 6"}),e.jsx("path",{d:"M6 10v9h12v-9"})]})}function ga({size:n=18}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M5 19V10M12 19V5M19 19v-6"})})}function _a({size:n=16}){return e.jsx("svg",{...Q(n),children:e.jsx("path",{d:"M12 3c1 3-2 4-2 7a3 3 0 0 0 6 0c0-1.5-1-2-1-3.5 1.5 1 2.5 3 2.5 5A5.5 5.5 0 0 1 12 21a5.5 5.5 0 0 1-5-7.5C7.5 10 9 7 12 3Z"})})}function pa({size:n=18}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M4 5h13v14H6a2 2 0 0 1-2-2Z"}),e.jsx("path",{d:"M17 8h3v9a2 2 0 0 1-2 2h-1"}),e.jsx("path",{d:"M7 9h7"}),e.jsx("path",{d:"M7 12.5h7"}),e.jsx("path",{d:"M7 16h4"})]})}function ts({size:n=14}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M10 14 21 3"}),e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function rs({lesson:n,busy:s,onDone:a,doneLabel:l,doneGoesBack:r=!1,onBackToTopic:t,rating:_,readAloud:j,readAloudRef:o,t:x}){return e.jsxs("section",{className:"es-learning__lesson","aria-label":x("learning.lesson_aria"),children:[e.jsxs("div",{className:"es-learning__lesson-readable",ref:o,children:[e.jsx(is,{topicTitle:n.topicTitle,onBackToTopic:t,t:x}),e.jsx("h4",{className:"es-learning__lesson-title",children:n.title}),e.jsx(se,{graphicRef:n.graphicRef,graphicAlt:n.graphicAlt,graphicUrl:n.graphicUrl}),e.jsx(ss,{media:n.media,t:x,children:n.body})]}),j&&e.jsx("div",{className:"es-learning__lesson-readaloud",children:j}),_,e.jsx("button",{type:"button",className:"es-learning__btn es-learning__btn--block",onClick:a,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__spinner","aria-hidden":"true"}),x("learning.loading")]}):e.jsxs(e.Fragment,{children:[r&&e.jsx(Ve,{}),l??x("learning.lesson_done"),!r&&e.jsx(fe,{})]})})]})}const os={owl:({size:n})=>e.jsx(Ms,{size:n})};function ha(n){return typeof n=="string"&&n in os?n:"none"}function Ne({name:n,size:s=56,className:a}){const l=n==="none"?void 0:os[n];return l?e.jsx("span",{className:["es-learning__mascot",a].filter(Boolean).join(" "),"aria-hidden":"true",children:e.jsx(l,{size:s})}):null}function Gn({lessonTitle:n,topicTitle:s,newTopic:a=!1,graphicRef:l,graphicAlt:r,graphicUrl:t,slideCount:_,mascot:j,busy:o,onStart:x,onBackToTopic:b,t:p}){const f=!!l,m=p(a?"learning.new_topic_title":"learning.new_lesson_title");return e.jsxs("section",{className:`es-learning__intro${f?" es-learning__intro--illustrated":""}${a?" es-learning__intro--topic":""}`,"aria-label":m,children:[f?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"es-learning__intro-say",children:[e.jsx(Ne,{name:j,size:30}),e.jsx("h4",{className:"es-learning__intro-title",children:m})]}),e.jsx(se,{graphicRef:l,graphicAlt:r,graphicUrl:t})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{name:j,size:64}),e.jsx("h4",{className:"es-learning__intro-title",children:m})]}),e.jsx("p",{className:"es-learning__intro-lesson",children:a?s:n}),b&&!a?e.jsxs("button",{type:"button",className:"es-learning__intro-note es-learning__intro-note--back",onClick:b,"aria-label":p("learning.back_to_topic",{topic:s}),children:[e.jsx("span",{"aria-hidden":"true",children:"← "}),s]}):e.jsx("p",{className:"es-learning__intro-note",children:a?n:s}),typeof _=="number"&&_>0&&e.jsx("p",{className:"es-learning__intro-meta",children:p("learning.slide_count",{total:_})}),e.jsx("div",{className:"es-learning__intro-foot",children:e.jsxs("button",{type:"button",className:"es-learning__btn es-learning__btn--block",onClick:x,disabled:o,children:[p(a?"learning.start_new_topic":"learning.start_lesson"),e.jsx(fe,{})]})})]})}function ma({topicTitle:n,topicComplete:s,mascot:a,busy:l,onStart:r,onSkip:t,t:_}){const j=g.useRef(null);g.useEffect(()=>{j.current?.focus({preventScroll:!0})},[]);const o=_(s?"learning.section_quiz_title_complete":"learning.section_quiz_title");return e.jsxs("section",{className:"es-learning__intro","aria-label":o,children:[e.jsx(Ne,{name:a,size:64}),e.jsx("h4",{className:"es-learning__intro-title",children:o}),e.jsx("p",{className:"es-learning__intro-lesson",children:n}),e.jsx("p",{className:"es-learning__intro-note",children:_("learning.section_quiz_note")}),e.jsxs("div",{className:"es-learning__intro-foot",children:[e.jsxs("button",{ref:j,type:"button",className:"es-learning__btn es-learning__btn--block",onClick:r,disabled:l,children:[_("learning.section_quiz_start"),e.jsx(fe,{})]}),e.jsx("button",{type:"button",className:"es-learning__btn es-learning__btn--block es-learning__btn--ghost",onClick:t,disabled:l,children:_("learning.section_quiz_skip")})]})]})}function wn({quiz:n,isPlacement:s,eyebrow:a,topics:l,results:r,busy:t,mascot:_,onAnswer:j,onAnswerOpen:o,onFinish:x,onBackToLesson:b,onChooseTopic:p,onContinue:f,continueLabel:m,t:w}){const q=g.useMemo(()=>n.questions??(n.question?[n.question]:[]),[n.questions,n.question]),v=!!n.questions,[I,P]=g.useState(!s||n.answered>0),[T,Z]=g.useState(n.answers??{}),[u,E]=g.useState(()=>new Set(n.answeredIds??[])),[G,H]=g.useState({}),[be,F]=g.useState({}),[L,B]=g.useState(()=>{if(!n.questions)return 0;const k=new Set(n.answeredIds??Object.keys(n.answers??{})),A=n.questions.findIndex(he=>!k.has(he.questionId));return A===-1?Math.max(0,n.questions.length-1):A});if(r)return e.jsx(ja,{results:r,questions:q,mascot:_,onContinue:f,continueLabel:m,t:w});if(!I)return e.jsxs("section",{className:"es-learning__intro","aria-label":w("learning.placement_intro_title"),children:[_!=="none"?e.jsx(Ne,{name:_,size:64}):e.jsx("span",{className:"es-learning__state-icon","aria-hidden":"true",children:e.jsx(ia,{size:32})}),e.jsx("h4",{className:"es-learning__intro-title",children:w("learning.placement_intro_title")}),e.jsx("p",{className:"es-learning__intro-body",children:w("learning.placement_intro_body",{total:n.total})}),e.jsx("p",{className:"es-learning__intro-note",children:w("learning.placement_intro_note")}),l.length>0&&p&&e.jsxs("div",{className:"es-learning__topics",children:[e.jsx("p",{className:"es-learning__hint",children:w("learning.choose_topic")}),e.jsx("div",{className:"es-learning__topic-list",children:l.map(k=>e.jsx("button",{type:"button",className:"es-learning__topic",onClick:()=>p(k.topicId),disabled:t,children:k.title},k.topicId))})]}),e.jsx("button",{type:"button",className:"es-learning__btn es-learning__btn--block",onClick:()=>P(!0),disabled:t,children:w("learning.placement_start")})]});const J=q[L];if(!J)return e.jsx("p",{className:"es-learning__hint",children:w("learning.quiz_finished")});const _e=k=>T[k]!==void 0||u.has(k)||(G[k]??"").trim().length>0,Xe=q.filter(k=>_e(k.questionId)).length,ve=T[J.questionId],Y=J.options===null,K=L===q.length-1,ae=q.every(k=>_e(k.questionId)),we=Object.fromEntries(q.filter(k=>_e(k.questionId)).map(k=>[k.questionId,0])),U=J.questionId;function X(k){Z(A=>({...A,[U]:k})),j(U,k)}async function pe(){const k=(G[U]??"").trim();return!Y||!k||!o||u.has(U)&&be[U]===k?!0:await o(U,k)?(E(A=>new Set(A).add(U)),F(A=>({...A,[U]:k})),!0):!1}async function V(){await pe()&&B(k=>Math.min(q.length-1,k+1))}async function ke(){await pe()&&x()}return e.jsxs("section",{className:"es-learning__quiz","aria-label":w("learning.quiz_aria"),children:[b&&e.jsxs("button",{type:"button",className:"es-learning__backlink",onClick:b,children:["← ",w("learning.back_to_lesson")]}),s&&e.jsx("p",{className:"es-learning__eyebrow",children:w("learning.placement_intro")}),e.jsx("h4",{className:"es-learning__lesson-title",children:a??n.title}),e.jsx(xa,{total:q.length,currentIndex:L,answeredIds:we,questions:q,answeredCount:Xe,onJump:v?B:void 0,t:w}),e.jsx("p",{className:"es-learning__prompt",children:J.prompt}),Y?e.jsxs("div",{className:"es-learning__open",children:[e.jsx("textarea",{className:"es-learning__textarea",value:G[U]??"",onChange:k=>H(A=>({...A,[U]:k.target.value})),placeholder:w("learning.open_answer_placeholder"),"aria-label":w("learning.open_answer_aria"),rows:5,disabled:t}),e.jsx("p",{className:"es-learning__hint",children:w("learning.open_answer_hint")})]}):null,!Y&&e.jsx("div",{className:"es-learning__options",role:"radiogroup","aria-label":w("learning.options_aria"),children:(J.options??[]).map((k,A)=>e.jsxs("label",{className:`es-learning__option${ve===A?" es-learning__option--selected":""}`,children:[e.jsx("input",{type:"radio",name:`learning-option-${J.questionId}`,checked:ve===A,onChange:()=>X(A),disabled:t}),e.jsx("span",{className:"es-learning__option-letter",children:String.fromCharCode(65+A)}),e.jsx("span",{className:"es-learning__option-text",children:k})]},A))}),e.jsxs("footer",{className:"es-learning__actions",children:[v?e.jsxs("button",{type:"button",className:"es-learning__btn es-learning__btn--ghost",onClick:()=>B(k=>Math.max(0,k-1)),disabled:t||L===0,children:[e.jsx(Ve,{}),w("learning.previous_question")]}):e.jsx("span",{}),K?e.jsx("button",{type:"button",className:"es-learning__btn",onClick:()=>{ke()},disabled:t||!ae,children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__spinner","aria-hidden":"true"}),w("learning.checking")]}):w("learning.finish_quiz")}):e.jsx("button",{type:"button",className:"es-learning__btn",onClick:()=>{V()},disabled:t||!_e(U),children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__spinner","aria-hidden":"true"}),w("learning.checking")]}):e.jsxs(e.Fragment,{children:[w("learning.next_question"),e.jsx(fe,{})]})})]})]})}function xa({total:n,currentIndex:s,answeredIds:a,questions:l,answeredCount:r,onJump:t,t:_}){return e.jsxs("div",{className:"es-learning__progress",children:[e.jsx("div",{className:"es-learning__track",children:l.map((j,o)=>{const x=["es-learning__seg",a[j.questionId]!==void 0?"es-learning__seg--done":"",o===s?"es-learning__seg--current":""].filter(Boolean).join(" ");return t?e.jsx("button",{type:"button",className:x,onClick:()=>t(o),"aria-label":_("learning.go_to_question",{n:o+1}),"aria-current":o===s?"step":void 0},j.questionId):e.jsx("span",{className:x},j.questionId)})}),e.jsxs("span",{className:"es-learning__progress-count",children:[r,"/",n]})]})}function ja({results:n,questions:s,mascot:a,onContinue:l,continueLabel:r,t}){const _=n.total>0?Math.round(n.correct/n.total*100):0,j=(o,x)=>s.find(b=>b.questionId===o)?.prompt??x;return e.jsxs("section",{className:"es-learning__results","aria-label":t("learning.results_aria"),children:[e.jsxs("div",{className:"es-learning__score",children:[e.jsx(Ne,{name:a,size:28,className:"es-learning__mascot--score"}),e.jsxs("span",{className:"es-learning__score-value",children:[n.correct,"/",n.total]}),e.jsx("div",{className:"es-learning__score-bar",style:{"--es-learning-score":`${_}`},role:"img","aria-label":t("learning.quiz_result",{correct:n.correct,total:n.total})})]}),typeof n.passed=="boolean"&&typeof n.passPercent=="number"&&e.jsx("p",{className:`es-learning__pass es-learning__pass--${n.passed?"yes":"no"}`,children:t(n.passed?"learning.section_quiz_passed":"learning.section_quiz_failed",{percent:n.passPercent})}),n.rows&&n.rows.length>0&&e.jsx("ol",{className:"es-learning__review",children:n.rows.map(o=>e.jsxs("li",{className:`es-learning__review-row es-learning__review-row--${o.verdict}`,children:[e.jsx("span",{className:"es-learning__review-mark","aria-hidden":"true",children:o.verdict==="correct"?e.jsx(oe,{}):o.verdict==="wrong"?e.jsx(Te,{}):e.jsx(qn,{})}),e.jsxs("div",{className:"es-learning__review-body",children:[e.jsx("p",{className:"es-learning__review-prompt",children:j(o.questionId,o.prompt)}),(()=>{const x=o.answerText??(o.selectedOptionIndex!==null?o.options?.[o.selectedOptionIndex]??null:null);return x?e.jsx("p",{className:"es-learning__review-answer",children:t("learning.your_answer",{answer:x})}):null})(),o.feedback&&e.jsx("p",{className:"es-learning__review-feedback",children:o.feedback}),o.verdict!=="correct"&&o.correctAnswer&&e.jsx("p",{className:"es-learning__review-correct",children:t("learning.correct_answer",{answer:o.correctAnswer})}),o.explanation&&e.jsx(zn,{children:o.explanation})]})]},o.questionId))}),l&&e.jsxs("button",{type:"button",className:"es-learning__btn es-learning__btn--block",onClick:l,children:[r??t("learning.continue"),e.jsx(fe,{})]})]})}function fa({prompt:n,lessonTitle:s,answer:a,feedback:l,busy:r,showExplanations:t,onChange:_,onSubmit:j,t:o}){return e.jsxs("section",{className:"es-learning__question","aria-label":o("learning.question_aria"),children:[e.jsx("p",{className:"es-learning__eyebrow",children:s}),e.jsx("p",{className:"es-learning__prompt",children:n}),l?e.jsx(ba,{feedback:l,showExplanations:t,t:o}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{className:"es-learning__textarea",rows:5,value:a,onChange:x=>_(x.target.value),placeholder:o("learning.open_answer_placeholder"),"aria-label":o("learning.open_answer_aria"),disabled:r}),e.jsx("footer",{className:"es-learning__actions es-learning__actions--end",children:e.jsx("button",{type:"button",className:"es-learning__btn",onClick:j,disabled:r||!a.trim(),children:o(r?"learning.checking":"learning.submit_answer")})})]})]})}function ba({feedback:n,showExplanations:s,t:a}){const l=n.verdict==="correct"?e.jsx(oe,{size:18}):n.verdict==="wrong"?e.jsx(Te,{size:18}):e.jsx(qn,{size:18}),r=n.verdict==="correct"?a("learning.verdict_correct"):n.verdict==="wrong"?a("learning.verdict_wrong"):a("learning.verdict_ungradeable");return e.jsxs("div",{className:`es-learning__feedback es-learning__feedback--${n.verdict}`,role:"status",children:[e.jsxs("p",{className:"es-learning__verdict",children:[e.jsx("span",{className:"es-learning__verdict-icon","aria-hidden":"true",children:l}),r]}),n.feedback&&e.jsx("p",{className:"es-learning__feedback-text",children:n.feedback}),s&&n.explanation&&e.jsx(zn,{children:n.explanation})]})}const wa={all_in_cooldown:e.jsx(Qn,{}),not_due_yet:e.jsx(Qn,{}),all_mastered:e.jsx(ta,{}),no_curriculum:e.jsx(ra,{}),unavailable:e.jsx(oa,{})},Na={all_in_cooldown:{title:"learning.empty_cooldown_title",body:"learning.empty_cooldown"},not_due_yet:{title:"learning.next_lesson_title",body:"learning.next_lesson_body"},all_mastered:{title:"learning.empty_all_mastered_title",body:"learning.empty_all_mastered"},no_curriculum:{title:"learning.empty_no_curriculum_title",body:"learning.empty_no_curriculum"},unavailable:{title:"learning.unavailable_title",body:"learning.unavailable"}},va=new Set(["all_in_cooldown","all_mastered","not_due_yet"]);function ka(n){const[s,a]=g.useState(()=>Date.now());if(g.useEffect(()=>{if(!n)return;const t=setInterval(()=>a(Date.now()),6e4);return()=>clearInterval(t)},[n]),!n)return null;const l=new Date(n).getTime();if(!Number.isFinite(l))return null;const r=Math.max(0,Math.ceil((l-s)/6e4));return{hours:Math.floor(r/60),minutes:r%60}}function kn({kind:n,mascot:s,nextDueAt:a,t:l}){const{title:r,body:t}=Na[n],_=s!=="none"&&va.has(n),j=ka(n==="not_due_yet"?a:void 0);return e.jsxs("div",{className:`es-learning__state es-learning__state--${n}`,role:"status",children:[_?e.jsx(Ne,{name:s}):e.jsx("span",{className:"es-learning__state-icon","aria-hidden":"true",children:wa[n]}),e.jsx("p",{className:"es-learning__state-title",children:l(r)}),e.jsx("p",{className:"es-learning__state-body",children:l(t)}),j&&e.jsx("p",{className:"es-learning__countdown",children:j.hours>0?l("learning.next_lesson_in_hm",{hours:j.hours,minutes:j.minutes}):l("learning.next_lesson_in_m",{minutes:j.minutes})})]})}function cs({lesson:n,index:s,onIndexChange:a,answers:l,onAnswer:r,busy:t,onDone:_,doneLabel:j,doneGoesBack:o=!1,onBackToTopic:x,rating:b,readAloud:p,readAloudRef:f,t:m}){const w=n.slides??[],q=w.length,v=w[s];if(!v)return null;const I=v.check??null,P=l[v.id],T=!I||P!==void 0,Z=s===q-1;return e.jsxs("section",{className:"es-learning__lesson","aria-label":m("learning.lesson_aria"),children:[e.jsx(is,{topicTitle:n.topicTitle,onBackToTopic:x,t:m}),e.jsx("div",{className:"es-learning__slide-dots","aria-hidden":"true",children:w.map((u,E)=>e.jsx("span",{className:`es-learning__slide-dot${E<=s?" es-learning__slide-dot--on":""}`},u.id))}),e.jsx(se,{graphicRef:v.graphicRef??n.graphicRef,graphicAlt:v.graphicAlt??n.graphicAlt,graphicUrl:v.graphicUrl??n.graphicUrl}),e.jsxs("div",{className:"es-learning__lesson-readable",ref:f,children:[e.jsx("h4",{className:"es-learning__lesson-title",style:{fontSize:16},children:v.title}),e.jsx(ss,{media:n.media,t:m,children:v.body})]}),p&&e.jsx("div",{className:"es-learning__lesson-readaloud",children:p}),I&&e.jsxs("div",{className:`es-learning__slide-check${T?P===I.correctIndex?" es-learning__slide-check--good":" es-learning__slide-check--bad":""}`,children:[e.jsx("p",{className:"es-learning__slide-check-prompt",children:I.prompt}),e.jsx("div",{className:"es-learning__slide-check-options",children:I.options.map((u,E)=>{const G=P===E,H=E===I.correctIndex,be=["es-learning__slide-choice",T&&G&&H?"es-learning__slide-choice--good":"",T&&G&&!H?"es-learning__slide-choice--bad":"",T&&H&&!G?"es-learning__slide-choice--reveal":""].filter(Boolean).join(" ");return e.jsxs("button",{type:"button",className:be,disabled:T||t,onClick:()=>r(v.id,E),children:[T&&G&&e.jsx("span",{className:"es-learning__slide-choice-icon","aria-hidden":"true",children:H?e.jsx(oe,{size:14}):e.jsx(Te,{size:14})}),e.jsx("span",{children:u})]},E)})}),T&&e.jsx("p",{className:`es-learning__slide-check-fb${P===I.correctIndex?" es-learning__slide-check-fb--good":" es-learning__slide-check-fb--bad"}`,children:P===I.correctIndex?I.feedbackCorrect:I.feedbackIncorrect})]}),e.jsxs("div",{className:"es-learning__deck-foot",children:[Z&&T&&b,!T&&e.jsx("p",{className:"es-learning__hint",children:m("learning.slide_check_required")}),e.jsxs("footer",{className:"es-learning__actions es-learning__actions--captioned",children:[e.jsxs("button",{type:"button",className:"es-learning__btn es-learning__btn--ghost",onClick:()=>a(s-1),disabled:t||s===0,children:[e.jsx(Ve,{}),m("learning.previous_question")]}),e.jsx("p",{className:"es-learning__slide-caption",children:m("learning.slide_caption",{n:s+1,total:q})}),Z?e.jsx("button",{type:"button",className:"es-learning__btn",onClick:_,disabled:t||!T,children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__spinner","aria-hidden":"true"}),m("learning.loading")]}):e.jsxs(e.Fragment,{children:[o&&e.jsx(Ve,{}),j??m("learning.lesson_done"),!o&&e.jsx(fe,{})]})}):e.jsxs("button",{type:"button",className:"es-learning__btn",onClick:()=>a(s+1),disabled:t||!T,children:[m("learning.next_question"),e.jsx(fe,{})]})]})]})]})}function ya({rows:n,t:s}){const[a,l]=g.useState(!1);if(n.length===0)return e.jsx("p",{className:"es-learning__hint",children:s("learning.review_unavailable")});const r=n.filter(t=>t.verdict==="correct").length;return e.jsxs("div",{className:"es-learning__review-block",children:[e.jsxs("button",{type:"button",className:`es-learning__review-toggle${a?" es-learning__review-toggle--open":""}`,"aria-expanded":a,onClick:()=>l(t=>!t),children:[e.jsx("span",{className:"es-learning__review-heading",children:s("learning.your_answers")}),e.jsx("span",{className:"es-learning__review-score",children:s("learning.review_score",{correct:r,total:n.length})}),e.jsx("span",{className:"es-learning__review-chevron","aria-hidden":"true",children:e.jsx(Cn,{size:14})})]}),a?e.jsx("ol",{className:"es-learning__review",children:n.map(t=>{const _=t.answerText??(t.selectedOptionIndex!==null?t.options?.[t.selectedOptionIndex]??null:null);return e.jsxs("li",{className:`es-learning__review-row es-learning__review-row--${t.verdict}`,children:[e.jsx("span",{className:"es-learning__review-mark","aria-hidden":"true",children:t.verdict==="correct"?e.jsx(oe,{}):t.verdict==="wrong"?e.jsx(Te,{}):e.jsx(qn,{})}),e.jsxs("div",{className:"es-learning__review-body",children:[e.jsx("p",{className:"es-learning__review-prompt",children:t.prompt}),t.options&&t.options.length>0?e.jsx("ul",{className:"es-learning__review-options",children:t.options.map((j,o)=>{const x=o===t.selectedOptionIndex,b=t.correctAnswer!==null&&j===t.correctAnswer;return e.jsxs("li",{className:`es-learning__review-option es-learning__review-option--${b?"correct":x?"picked":"plain"}`,children:[e.jsx("span",{className:"es-learning__review-option-mark","aria-hidden":"true",children:b?e.jsx(oe,{size:12}):x?e.jsx(Te,{size:12}):null}),e.jsx("span",{className:"es-learning__review-option-text",children:j}),(x||b)&&e.jsx("span",{className:"es-learning__review-option-tag",children:s(x?"learning.answer_tag_yours":"learning.answer_tag_correct")})]},o)})}):e.jsxs("div",{className:"es-learning__review-pair",children:[_&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__review-pair-label",children:s("learning.answer_tag_yours")}),e.jsx("span",{className:"es-learning__review-pair-value es-learning__review-pair-value--yours",children:_})]}),t.verdict!=="correct"&&t.correctAnswer&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"es-learning__review-pair-label",children:s("learning.answer_tag_correct")}),e.jsx("span",{className:"es-learning__review-pair-value es-learning__review-pair-value--correct",children:t.correctAnswer})]})]}),t.feedback&&e.jsx("p",{className:"es-learning__review-feedback",children:t.feedback}),t.explanation&&e.jsx(zn,{children:t.explanation})]})]},t.questionId)})}):null]})}function Jn({lesson:n,slideIndex:s,onSlideIndexChange:a,slideAnswers:l,onSlideAnswer:r,onBack:t,backLabel:_,showBackLink:j=!0,onBackToTopic:o,rating:x,readAloud:b,readAloudRef:p,onFinish:f,finishLabel:m,review:w,t:q}){const v=(n.slides?.length??0)>0,I=f??t,P=f?m??_:_,T=!!o&&!f;return e.jsxs("div",{className:`es-learning__reader${w?" es-learning__reader--reviewed":""}`,children:[j&&e.jsxs("button",{type:"button",className:"es-learning__backlink",onClick:t,children:["← ",_]}),v?e.jsx(cs,{lesson:n,index:s,onIndexChange:a,answers:l,onAnswer:r,busy:!1,onDone:I,doneLabel:P,doneGoesBack:T,onBackToTopic:o,rating:x,readAloud:b,readAloudRef:p,t:q}):e.jsx(rs,{lesson:n,busy:!1,onDone:I,doneLabel:P,doneGoesBack:T,onBackToTopic:o,rating:x,readAloud:b,readAloudRef:p,t:q}),w&&e.jsx(ya,{rows:w,t:q})]})}function Ia({graphicRef:n,graphicUrl:s,graphicAlt:a,done:l}){const r=Le(n);if(!r)return null;const t=l?" es-learning__lesson-thumb--done":"";if(r.kind==="media")return s?e.jsx("img",{src:s,alt:a??"",loading:"lazy",className:`es-learning__lesson-thumb es-learning__lesson-thumb--image${t}`,"data-testid":"lesson-thumb-image"}):null;const _=He(r.slug);return _?e.jsx("span",{className:`es-learning__lesson-thumb${t}`,"aria-hidden":"true","data-testid":"lesson-thumb-icon",children:e.jsx(_,{size:20})}):null}function Sn({iconRef:n,iconUrl:s}){const a=Le(n);if(!a)return null;if(a.kind==="media")return s?e.jsx("img",{src:s,alt:"","aria-hidden":"true",loading:"lazy",className:"es-learning__topic-icon es-learning__topic-icon--image","data-testid":"topic-icon-image"}):null;const l=He(a.slug);return l?e.jsx("span",{className:"es-learning__topic-icon","aria-hidden":"true","data-testid":"topic-icon",children:e.jsx(l,{size:16})}):null}function ds({topics:n,onOpen:s,t:a}){return n.length===0?e.jsx("p",{className:"es-learning__hint",children:a("learning.empty_no_curriculum")}):e.jsx("section",{className:"es-learning__topics-view","aria-label":a("learning.nav_topics"),children:e.jsx("ul",{className:"es-learning__topic-cards",children:n.map(l=>{const r=l.lessonCount>0?Math.round(l.doneCount/l.lessonCount*100):0,t=l.doneCount===l.lessonCount&&l.lessonCount>0,_=as(l.heroRef,l.heroUrl);return e.jsx("li",{children:e.jsxs("button",{type:"button",className:"es-learning__topic-card",onClick:()=>s(l.topicId),children:[e.jsx(se,{graphicRef:l.heroRef,graphicAlt:l.heroAlt,graphicUrl:l.heroUrl,done:t}),e.jsxs("span",{className:"es-learning__topic-card-head",children:[!_&&e.jsx(Sn,{iconRef:l.iconRef,iconUrl:l.iconUrl}),e.jsx("span",{className:"es-learning__topic-card-title",children:l.title}),t&&e.jsx("span",{className:"es-learning__topic-card-done","aria-hidden":"true",children:e.jsx(oe,{size:14})})]}),e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${r}%`}})}),e.jsx("span",{className:"es-learning__topic-card-meta",children:a("learning.topic_progress",{mastered:l.doneCount,total:l.lessonCount})})]})},l.topicId)})})})}const Ke=["basics","intermediate","advanced","expert"],za={basics:"learning.level_basics",intermediate:"learning.level_intermediate",advanced:"learning.level_advanced",expert:"learning.level_expert"};function qa({level:n,t:s}){const a=Ke.indexOf(n)+1,l=Ke.length;return e.jsx("span",{className:"es-learning__level-stars",role:"img","aria-label":s("learning.level_difficulty",{n:a,total:l}),"data-testid":"learning-level-stars",children:Ke.map((r,t)=>e.jsx("span",{"aria-hidden":"true",className:`es-learning__level-star${t<a?" es-learning__level-star--on":""}`,children:"★"},t))})}const Ze=n=>n.lessonCount>0&&n.doneCount===n.lessonCount;function Ca({tracks:n,untracked:s=[],currentTrackId:a,onOpenTrack:l,onOpenUntracked:r,t}){const _=n.filter(o=>o.topicCount>0);if(_.length===0&&s.length===0)return e.jsx("p",{className:"es-learning__hint",children:t("learning.empty_no_curriculum")});const j=s.filter(Ze).length;return e.jsxs("section",{className:"es-learning__tracks-view","aria-label":t("learning.tracks_heading"),children:[e.jsx("div",{className:"es-learning__infobar es-learning__infobar--intro",children:e.jsxs("p",{className:"es-learning__infobar-text",children:[t("learning.tracks_intro"),_.length>1&&e.jsxs(e.Fragment,{children:[" ",e.jsx("strong",{children:t("learning.track_independent_hint")})]})]})}),e.jsxs("ul",{className:"es-learning__tracks",children:[_.map(o=>{const x=o.topicCount>0?Math.round(o.doneTopicCount/o.topicCount*100):0,b=as(o.heroRef,o.heroUrl),p=o.topicCount>0&&o.doneTopicCount===o.topicCount;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:`es-learning__track-card${o.trackId===a?" es-learning__track-card--current":""}`,onClick:()=>l(o.trackId),children:[e.jsx(se,{graphicRef:o.heroRef,graphicAlt:o.heroAlt,graphicUrl:o.heroUrl,done:p}),e.jsxs("span",{className:"es-learning__track-card-head",children:[!b&&e.jsx("span",{className:"es-learning__track-icon",children:e.jsx(Sn,{iconRef:o.iconRef,iconUrl:o.iconUrl})}),e.jsx("span",{className:"es-learning__track-card-title",children:o.title}),p&&e.jsx("span",{className:"es-learning__topic-card-done","aria-hidden":"true",children:e.jsx(oe,{size:14})})]}),o.description&&e.jsx("span",{className:"es-learning__track-card-desc",children:o.description}),e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${x}%`}})}),e.jsx("span",{className:"es-learning__track-card-meta",children:t("learning.track_progress",{done:o.doneTopicCount,total:o.topicCount})})]})},o.trackId)}),s.length>0&&e.jsx("li",{children:e.jsxs("button",{type:"button",className:"es-learning__track-card",onClick:()=>r?.(),children:[e.jsx("span",{className:"es-learning__track-card-head",children:e.jsx("span",{className:"es-learning__track-card-title",children:t("learning.track_unassigned")})}),e.jsx("span",{className:"es-learning__track-card-meta",children:t("learning.track_progress",{done:j,total:s.length})})]})})]})]})}function Sa({track:n,currentTopicId:s,onOpenTopic:a,onBack:l,t:r}){const t=new Set(n.topics.filter(Ze).map(b=>b.topicId)),_=n.topics.find(b=>b.topicId===s),j=_?.unlocks??[],o=Ke.map(b=>({level:b,topics:n.topics.filter(p=>(p.level??"basics")===b)})).filter(b=>b.topics.length>0),x=n.topicCount>0?Math.round(n.doneTopicCount/n.topicCount*100):0;return e.jsxs("section",{className:"es-learning__roadmap-view","aria-label":n.title,children:[e.jsxs("button",{type:"button",className:"es-learning__backlink",onClick:l,children:["← ",r("learning.tracks_heading")]}),e.jsxs("div",{className:"es-learning__detail-head",children:[e.jsx("h4",{className:"es-learning__detail-title",children:n.title}),e.jsxs("div",{className:"es-learning__progress-line",children:[e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${x}%`}})}),e.jsx("span",{className:"es-learning__progress-count",children:r("learning.track_progress",{done:n.doneTopicCount,total:n.topicCount})})]})]}),_&&j.length>0&&e.jsxs("div",{className:"es-learning__unlocks",children:[e.jsx("span",{className:"es-learning__unlocks-lead",children:r("learning.unlocks_lead",{topic:_.title})}),e.jsx("ul",{className:"es-learning__unlocks-list",children:j.map(b=>e.jsx("li",{children:b.title},b.topicId))})]}),e.jsx("div",{className:"es-learning__infobar es-learning__infobar--order",children:e.jsxs("p",{className:"es-learning__infobar-text",children:[e.jsx("strong",{children:r("learning.roadmap_heading")})," — ",r("learning.roadmap_why")]})}),e.jsx("ul",{className:"es-learning__levels",children:o.map(b=>e.jsxs("li",{children:[e.jsxs("span",{className:"es-learning__level-head",children:[e.jsx("span",{className:"es-learning__level-name",children:r(za[b.level])}),e.jsx("span",{className:"es-learning__level-rule","aria-hidden":"true"}),e.jsx(qa,{level:b.level,t:r})]}),e.jsx("ul",{className:"es-learning__level-topics",children:b.topics.map(p=>{const f=p.prerequisites??[],m=f.some(I=>!t.has(I.topicId)),w=ls(p.heroRef,p.heroUrl),q=Ze(p),v=["es-learning__road-row",w?"es-learning__road-row--card":"",m?"es-learning__road-row--ahead":"",p.topicId===s?"es-learning__road-row--current":""].filter(Boolean).join(" ");return e.jsx("li",{children:e.jsxs("button",{type:"button",className:v,onClick:()=>a(p.topicId),children:[w?e.jsx(se,{graphicRef:p.heroRef,graphicAlt:p.heroAlt,graphicUrl:p.heroUrl,variant:"card",done:q}):e.jsx(Sn,{iconRef:p.iconRef,iconUrl:p.iconUrl}),e.jsxs("span",{className:"es-learning__road-body",children:[e.jsx("span",{className:"es-learning__road-title",children:p.title}),f.length>0&&e.jsx("span",{className:"es-learning__road-needs",children:r("learning.topic_after",{names:f.map(I=>I.title).join(", ")})}),e.jsx("span",{className:"es-learning__track-card-meta",children:r("learning.topic_progress",{mastered:p.doneCount,total:p.lessonCount})})]}),q?e.jsx("span",{className:"es-learning__topic-card-done","aria-hidden":"true",children:e.jsx(oe,{size:14})}):e.jsx("span",{className:"es-learning__lesson-open","aria-hidden":"true",children:e.jsx(Cn,{size:14})})]})},p.topicId)})})]},b.level))})]})}const Aa={mastered:"learning.state_mastered",done:"learning.state_done",gap:"learning.state_in_progress",current:"learning.state_current",unseen:"learning.state_locked"},Ta=n=>n==="mastered"||n==="done",La="learning.state_available";function Ma({topic:n,onOpenLesson:s,onStartSectionQuiz:a,canPickAnyLesson:l=!1,backLabel:r,onBack:t,t:_}){const j=n.lessonCount>0?Math.round(n.doneCount/n.lessonCount*100):0;return e.jsxs("section",{className:"es-learning__topic-detail","aria-label":n.title,children:[r&&t&&e.jsxs("button",{type:"button",className:"es-learning__backlink",onClick:t,"aria-label":_("learning.back_to_track",{track:r}),children:["← ",r]}),e.jsxs("div",{className:"es-learning__detail-head",children:[!(r&&t)&&e.jsx("p",{className:"es-learning__eyebrow",children:_("learning.nav_topics")}),e.jsx("h4",{className:"es-learning__detail-title",children:n.title}),e.jsx(se,{graphicRef:n.heroRef,graphicAlt:n.heroAlt,graphicUrl:n.heroUrl,variant:"hero",done:Ze(n)}),e.jsxs("div",{className:"es-learning__progress-block",children:[e.jsx("span",{className:"es-learning__sec-label",children:_("learning.topic_lessons_done")}),e.jsxs("div",{className:"es-learning__progress-line",children:[e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${j}%`}})}),e.jsx("span",{className:"es-learning__progress-count",children:_("learning.progress_count",{done:n.doneCount,total:n.lessonCount})})]})]})]}),n.hasSectionQuiz===!0&&a&&e.jsx("button",{type:"button",className:"es-learning__btn es-learning__btn--block es-learning__btn--ghost es-learning__section-cta",onClick:a,children:_("learning.section_quiz_cta")}),e.jsxs("div",{className:"es-learning__list-block",children:[e.jsx("p",{className:"es-learning__list-divider",children:e.jsx("span",{className:"es-learning__sec-label",children:_("learning.topic_lesson_list")})}),e.jsx("ol",{className:"es-learning__lesson-list",children:n.lessons.map(o=>{const x=l||o.servedAt!==null||o.state==="mastered"||o.state==="done"||o.state==="current",b=x?"button":"div",p=ls(o.graphicRef,o.graphicUrl),f=x&&o.state==="unseen"?"available":o.state,m=_(x&&o.state==="unseen"?La:Aa[o.state]),w=o.servedAt===null&&o.state==="mastered",q=Ta(o.state);return p?e.jsx("li",{children:e.jsxs(b,{...x?{type:"button",onClick:()=>s(o)}:{},className:`es-learning__lesson-card es-learning__lesson-card--${o.state}${x?"":" es-learning__lesson-card--locked"}`,"aria-disabled":x?void 0:!0,children:[e.jsx(se,{graphicRef:o.graphicRef,graphicUrl:o.graphicUrl,graphicAlt:o.graphicAlt,variant:"card",done:q}),e.jsx("span",{className:"es-learning__lesson-card-title",children:o.title}),(o.isMilestone||w)&&e.jsxs("span",{className:"es-learning__lesson-row-meta",children:[o.isMilestone&&_("learning.milestone"),w&&`${o.isMilestone?" · ":""}${_("learning.not_delivered")}`]}),e.jsxs("span",{className:"es-learning__lesson-card-foot",children:[e.jsx("span",{className:`es-learning__lesson-chip es-learning__lesson-chip--${f}`,children:m}),!x&&e.jsx("span",{className:"es-learning__lesson-lock","aria-hidden":"true",children:e.jsx(Wn,{})})]})]})},o.lessonId):e.jsx("li",{children:e.jsxs(b,{...x?{type:"button",onClick:()=>s(o)}:{},className:`es-learning__lesson-row es-learning__lesson-row--${o.state}${x?"":" es-learning__lesson-row--locked"}`,"aria-disabled":x?void 0:!0,children:[e.jsx(Ia,{graphicRef:o.graphicRef,graphicUrl:o.graphicUrl,graphicAlt:o.graphicAlt,done:q}),e.jsxs("span",{className:"es-learning__lesson-row-body",children:[e.jsx("span",{className:"es-learning__lesson-row-title",children:o.title}),e.jsxs("span",{className:"es-learning__lesson-row-meta",children:[o.isMilestone?_("learning.milestone"):n.title,w&&` · ${_("learning.not_delivered")}`]}),e.jsx("span",{className:`es-learning__lesson-chip es-learning__lesson-chip--${f}`,children:m})]}),x?e.jsx("span",{className:"es-learning__lesson-open","aria-hidden":"true",children:e.jsx(Cn,{size:14})}):e.jsx("span",{className:"es-learning__lesson-lock","aria-hidden":"true",children:e.jsx(Wn,{})})]})},o.lessonId)})})]})]})}function $a({view:n,browse:s,mascot:a,slidePositions:l,newsTile:r,onGoToday:t,onOpenLesson:_,onOpenTopic:j,t:o}){const x=s?.summary?.doneLessons??0,b=s?.summary?.totalLessons??0,p=b>0?Math.round(x/b*100):0,f=s?.streak??{currentStreak:0,longestStreak:0},m=(s?.topics??[]).flatMap(v=>(v.lessons??[]).map(I=>({topic:v,lesson:I}))).filter(({lesson:v})=>v.servedAt!==null&&!v.done).sort((v,I)=>(I.lesson.servedAt??"").localeCompare(v.lesson.servedAt??"")).slice(0,3),w=s?.summary?.attempts?.[0]??null,q=s?.topics??[];return e.jsxs("section",{className:"es-learning__dashboard","aria-label":o("learning.nav_dashboard"),children:[e.jsx(Oa,{view:n,mascot:a,onGoToday:t,t:o}),s&&e.jsxs("div",{className:"es-learning__stats-deck",children:[e.jsxs("div",{className:"es-learning__stats-cell es-learning__stats-cell--ring",children:[e.jsxs("div",{className:"es-learning__ring",role:"img","aria-label":o("learning.dashboard_mastered_label",{pct:p}),style:{"--es-learning-ring":`${p}`},children:[e.jsx("span",{className:"es-learning__ring-value",children:p}),e.jsx("span",{className:"es-learning__ring-unit",children:"%"})]}),e.jsx("span",{className:"es-learning__stats-l",children:o("learning.dashboard_mastered")})]}),e.jsx("span",{className:"es-learning__stats-divider","aria-hidden":"true"}),e.jsxs("div",{className:"es-learning__stats-cell",children:[e.jsxs("span",{className:"es-learning__stats-n",children:[x,"/",b]}),e.jsx("span",{className:"es-learning__stats-l",children:o("learning.dashboard_lessons_done")})]}),e.jsx("span",{className:"es-learning__stats-divider","aria-hidden":"true"}),e.jsxs("div",{className:"es-learning__stats-cell es-learning__stats-cell--streak",children:[e.jsxs("span",{className:"es-learning__stats-n",children:[e.jsx(_a,{size:15}),f.currentStreak]}),e.jsx("span",{className:"es-learning__stats-l",children:o("learning.dashboard_streak")}),f.longestStreak>f.currentStreak&&e.jsx("span",{className:"es-learning__stats-sub",children:o("learning.dashboard_best_streak",{n:f.longestStreak})})]})]}),m.length>0&&_&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:o("learning.dashboard_inprogress_title")}),m.map(({topic:v,lesson:I})=>e.jsx(Ua,{topicTitle:v.title,lesson:I,position:l?.[I.lessonId],onOpen:()=>_(v.topicId,I),t:o},I.lessonId))]}),r,w&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:o("learning.dashboard_last_quiz")}),e.jsx("ul",{className:"es-learning__attempt-list",children:e.jsxs("li",{className:"es-learning__attempt",children:[e.jsx("span",{className:"es-learning__attempt-title",children:w.title}),e.jsx(Ra,{correct:w.correct,total:w.total,t:o})]})})]}),j&&q.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:o("learning.nav_topics")}),e.jsx(ds,{topics:q,onOpen:j,t:o})]})]})}function Ra({correct:n,total:s,t:a}){return s<=0?e.jsx("span",{className:"es-learning__attempt-score",children:a("learning.review_score",{correct:n,total:s})}):e.jsx("span",{className:"es-learning__attempt-segs",role:"img","aria-label":a("learning.attempt_score_a11y",{correct:n,total:s}),"data-testid":"learning-attempt-segments",children:Array.from({length:s},(l,r)=>e.jsx("span",{"aria-hidden":"true",className:`es-learning__attempt-seg es-learning__attempt-seg--${r<n?"good":"bad"}`},r))})}function Ua({topicTitle:n,lesson:s,position:a,onOpen:l,t:r}){const t=!!a&&a.total>0,_=a&&t?Math.round((a.index+1)/a.total*100):0;return e.jsxs("button",{type:"button",className:"es-learning__continue",onClick:l,children:[e.jsxs("span",{className:"es-learning__continue-row",children:[e.jsx(se,{graphicRef:s.graphicRef,graphicUrl:s.graphicUrl,graphicAlt:s.graphicAlt,variant:"continue"}),e.jsxs("span",{className:"es-learning__continue-body",children:[e.jsx("span",{className:"es-learning__continue-title",children:s.title}),e.jsx("span",{className:"es-learning__lesson-row-meta",children:n})]})]}),a&&t&&e.jsxs("span",{className:"es-learning__continue-bar",children:[e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${_}%`}})}),e.jsx("span",{className:"es-learning__progress-count",children:r("learning.slide_caption",{n:a.index+1,total:a.total})})]})]})}function Oa({view:n,mascot:s,onGoToday:a,t:l}){if(!n)return null;if(n.mode==="new_information"){const r=n.lesson.slides?.length??0;return e.jsxs("button",{type:"button",className:"es-learning__today-card es-learning__today-card--hero",onClick:a,children:[e.jsx(se,{graphicRef:n.lesson.graphicRef,graphicUrl:n.lesson.graphicUrl,graphicAlt:n.lesson.graphicAlt,variant:"today"}),e.jsxs("span",{className:"es-learning__today-inner",children:[e.jsx("span",{className:"es-learning__eyebrow",children:l("learning.dashboard_today_eyebrow")}),e.jsx("strong",{className:"es-learning__today-card-title",children:n.lesson.title}),e.jsxs("span",{className:"es-learning__lesson-row-meta",children:[n.lesson.topicTitle,r>0&&` · ${l("learning.slide_count",{total:r})}`]})]})]})}if(n.mode==="checking_question"||n.mode==="lesson_quiz"||n.mode==="section_quiz"||n.mode==="placement_quiz"){const r=n.mode==="checking_question"?null:n.quiz;return e.jsxs("button",{type:"button",className:"es-learning__today-card es-learning__today-card--gold",onClick:a,children:[e.jsx("span",{className:"es-learning__eyebrow",children:l("learning.dashboard_today_eyebrow")}),e.jsx("strong",{className:"es-learning__today-card-title",children:l("learning.dashboard_continue")}),r&&e.jsx("span",{className:"es-learning__lesson-row-meta",children:l("learning.quiz_progress",{answered:r.answered,total:r.total})})]})}return n.mode==="nothing"?e.jsx("div",{className:"es-learning__today-card",children:e.jsx(kn,{kind:n.reason,mascot:s,nextDueAt:n.nextDueAt,t:l})}):null}function Ba({browse:n,t:s}){const{topics:a,summary:l}=n;return e.jsxs("section",{className:"es-learning__progress-view","aria-label":s("learning.nav_progress"),children:[e.jsxs("div",{children:[e.jsx("p",{className:"es-learning__sec-label",children:s("learning.progress_topics_title")}),e.jsx("p",{className:"es-learning__hint",children:s("learning.progress_overall",{mastered:l.doneLessons,total:l.totalLessons})})]}),e.jsx("ul",{className:"es-learning__by-topic",children:a.map(r=>{const t=r.lessonCount>0?Math.round(r.doneCount/r.lessonCount*100):0;return e.jsxs("li",{className:"es-learning__by-topic-row",children:[e.jsx("span",{className:"es-learning__by-topic-title",children:r.title}),e.jsxs("span",{className:"es-learning__by-topic-count",children:[r.doneCount,"/",r.lessonCount]}),e.jsx("span",{className:"es-learning__meter","aria-hidden":"true",children:e.jsx("span",{className:"es-learning__meter-fill",style:{width:`${t}%`}})})]},r.topicId)})}),l.attempts.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"es-learning__sec-label",children:s("learning.quiz_history")}),e.jsx("ul",{className:"es-learning__attempt-list",children:l.attempts.map(r=>e.jsxs("li",{className:"es-learning__attempt",children:[e.jsx("span",{className:"es-learning__attempt-title",children:r.title}),e.jsxs("span",{className:"es-learning__attempt-score",children:[r.correct,"/",r.total]})]},r.attemptId??r.quizId))})]})]})}const Da="es-learning-place",Ea=10080*60*1e3;function us(n){return`${Da}:${n}`}function Kn(n,s){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(a=>typeof a[1]=="number"&&Number.isFinite(a[1])&&a[1]>=s))}const Pa=n=>n==="dashboard"||n==="today"||n==="topics"||n==="news"||n==="progress";function Fa(n,s){try{const a=localStorage.getItem(us(n));if(!a)return null;const l=JSON.parse(a);return!Pa(l.tab)||(l.ownerId??null)!==s||typeof l.savedAt!="number"||Date.now()-l.savedAt>Ea?null:{tab:l.tab,openTopicId:typeof l.openTopicId=="string"?l.openTopicId:null,readingLessonId:typeof l.readingLessonId=="string"?l.readingLessonId:null,slideIndex:Kn(l.slideIndex,0),slideTotals:Kn(l.slideTotals,1)}}catch{return null}}function Qa(n,s,a){try{const l={...a,ownerId:s,savedAt:Date.now()};localStorage.setItem(us(n),JSON.stringify(l))}catch{}}const Wa=".es-widget__content, .gaio-theme__content";function Ga(n){const s=n?.ownerDocument;if(!n||!s)return;let a=n;for(;a&&a!==s.body&&a!==s.documentElement;){if(a.scrollTop!==0&&(a.scrollTop=0),a.matches(Wa))return;a=a.parentElement}}const Ja="es-learning-rated";function gs(n){return`${Ja}:${n}`}function _s(n,s){const[a]=In(()=>{const l=localStorage.getItem(gs(n));if(!l)return null;const r=JSON.parse(l);return(r.ownerId??null)!==s||!Array.isArray(r.lessonIds)?null:new Set(r.lessonIds.filter(t=>typeof t=="string"))});return a??new Set}function Ka(n,s,a){const l=_s(n,s);l.add(a);const r=[...l].slice(-500),t={ownerId:s,lessonIds:r};return In(()=>localStorage.setItem(gs(n),JSON.stringify(t))),new Set(r)}const Va=["learning-load","learning-browse","learning-read-lesson","learning-lesson-review","learning-lesson-quiz","learning-news-load"],Za=["learning-answer-quiz","learning-answer-quiz-open","learning-answer-open","learning-quiz-finish","learning-start-lesson","learning-complete-lesson"],Ha=300*1e3,ps=new Set(Va),Ye=new Map;let Ae;function hs(n){n!==Ae&&(Ye.clear(),Ae=n)}function Ya(n){return n?JSON.stringify(Object.keys(n).sort().map(s=>[s,String(n[s])])):""}function ms(n,s,a,l){return`${n}\0${s}\0${a}\0${Ya(l)}`}function re(n,s,a,l,r=Date.now()){if(hs(s),s===null||!ps.has(a))return null;const t=Ye.get(ms(n,s,a,l));return t?{data:t.data,stale:r-t.storedAt>=Ha}:null}function ge(n,s,a,l,r,t=Date.now()){if(Ae===void 0)Ae=s;else if(s!==Ae)return;s===null||!ps.has(a)||Ye.set(ms(n,s,a,l),{data:r,storedAt:t})}function Vn(){Ye.clear()}function Xa(n){hs(n)}function el(n){return Ps(n)}function nl(n,s){if(!n)return null;const[a]=In(()=>{const l=new Date(n);return Number.isNaN(l.getTime())?null:new Intl.DateTimeFormat(s,{day:"numeric",month:"short"}).format(l)});return a??null}function sl(n,s){if(!n)return null;const a=n.split("-")[0]?.toLowerCase();return!a||a===s.split("-")[0]?.toLowerCase()?null:a.toUpperCase()}function yn({item:n,currentLanguage:s,onPick:a,t:l}){const r=nl(n.publishedAt,s),t=sl(n.language,s),_=n.sourceName??n.host;return e.jsx("button",{type:"button",className:`es-learning__news${n.read?" es-learning__news--read":""}`,onClick:()=>a(n),"data-testid":"learning-news-card",children:e.jsxs("span",{className:"es-learning__news-row",children:[e.jsx("span",{className:"es-learning__news-thumb",children:n.thumbnailUrl&&e.jsx("img",{src:n.thumbnailUrl,alt:"",loading:"lazy"})}),e.jsxs("span",{className:"es-learning__news-body",children:[e.jsx("span",{className:"es-learning__news-title",children:n.title}),e.jsxs("span",{className:"es-learning__news-meta",children:[_&&e.jsx("span",{children:_}),_&&r&&e.jsx("span",{"aria-hidden":"true",children:"·"}),r&&e.jsx("span",{children:r}),t&&e.jsx("span",{className:"es-learning__news-lang",children:t})]})]}),n.read?e.jsx("span",{className:"es-learning__news-done",role:"img","aria-label":l("learning.news_read"),children:e.jsx(oe,{size:13})}):e.jsx("span",{className:"es-learning__news-ext","aria-hidden":"true",children:e.jsx(ts,{size:14})})]})})}function al({item:n,currentLanguage:s,onPick:a,t:l}){return e.jsxs("div",{className:"es-learning__news-tile","data-testid":"learning-news-tile",children:[e.jsx("p",{className:"es-learning__sec-label",children:l("learning.news_suggested_title")}),e.jsx(yn,{item:n,currentLanguage:s,onPick:a,t:l})]})}function ll({news:n,currentLanguage:s,onPick:a,t:l}){const r=n?.unread??[],t=n?.read??[];return r.length===0&&t.length===0?e.jsx("section",{className:"es-learning__dashboard","aria-label":l("learning.nav_news"),children:e.jsx("p",{className:"es-learning__news-empty",children:l("learning.news_empty")})}):e.jsxs("section",{className:"es-learning__dashboard","aria-label":l("learning.nav_news"),children:[r.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:l("learning.news_new_title")}),e.jsx("div",{className:"es-learning__news-list",children:r.map(_=>e.jsx(yn,{item:_,currentLanguage:s,onPick:a,t:l},_.id))})]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"es-learning__sec-label",children:l("learning.news_read_title")}),e.jsx("div",{className:"es-learning__news-list",children:t.map(_=>e.jsx(yn,{item:_,currentLanguage:s,onPick:a,t:l},_.id))})]})]})}function il({item:n,onCancel:s,onConfirm:a,t:l}){const r=g.useRef(null);return g.useEffect(()=>{r.current?.focus()},[]),g.useEffect(()=>{const t=_=>{_.key==="Escape"&&s()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[s]),e.jsxs("div",{className:"es-learning__leave",role:"dialog","aria-modal":"true","aria-labelledby":"es-learning-leave-title","data-testid":"learning-news-leave",children:[e.jsx("div",{className:"es-learning__leave-scrim","aria-hidden":"true",onClick:s}),e.jsxs("div",{className:"es-learning__leave-card",children:[e.jsx("span",{className:"es-learning__leave-icon","aria-hidden":"true",children:e.jsx(ts,{size:22})}),e.jsx("p",{className:"es-learning__leave-title",id:"es-learning-leave-title",children:l("learning.news_leave_title")}),e.jsx("p",{className:"es-learning__leave-body",children:l("learning.news_leave_body")}),e.jsx("span",{className:"es-learning__leave-host",children:n.host}),e.jsxs("div",{className:"es-learning__leave-actions",children:[e.jsx("button",{type:"button",className:"es-learning__leave-btn es-learning__leave-btn--cancel",onClick:s,children:l("learning.news_leave_cancel")}),e.jsx("button",{ref:r,type:"button",className:"es-learning__leave-btn es-learning__leave-btn--go",onClick:a,children:l("learning.news_leave_confirm")})]})]})]})}function Zn(){const n=new Date,s=n.getFullYear(),a=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return`${s}-${a}-${l}`}function tl(n){return!!n&&typeof n=="object"&&typeof n.error=="string"}async function R(n,s,a){const[l]=await Ls(n.call(s,a));return!l||tl(l)?null:l}const Nn="__untracked__";function vn(n){return!!n&&Array.isArray(n.unread)&&Array.isArray(n.read)}function rl(n,s,a){const l=n.unread.find(r=>r.id===s);return{suggested:n.suggested?.id===s?n.suggested.pinned?{...n.suggested,read:!0}:null:n.suggested,unread:n.unread.filter(r=>r.id!==s),read:l?[{...l,read:!0},...n.read]:n.read,unreadCount:a}}function jl(n){const s=n.auth?.user?.id??null;return e.jsx(ol,{...n},`${n.productId}\0${s??"signed-out"}`)}function ol({config:n,data:s,actions:a,i18n:l,builderMode:r,productId:t,auth:_,baseUrl:j,externalContext:o,previewMode:x,readOnly:b}){const p=l?.t??(i=>i),f=l?.currentLanguage??"en",m=_?.user?.id??null,w=As(n.title,f,{t:p,fallbackKey:"learning.title",enDefault:"Learning"}),q=n.showExplanations!==!1,v=ha(n.mascot),I=n.showBrowse!==!1,P=I&&n.showDashboard!==!1,T=I&&n.showProgress===!0,Z=I&&n.showNews!==!1,[u,E]=g.useState(()=>r?null:re(t,m,"learning-load",{language:f})?.data??null),[G,H]=g.useState(()=>!r&&re(t,m,"learning-load",{language:f})===null),[be,F]=g.useState(null),[L,B]=g.useState(!1),[J,_e]=g.useState(""),[Xe,ve]=g.useState(null),[Y,K]=g.useState(null),[ae,we]=g.useState(null),U=g.useRef(r?null:Fa(t,m)).current,[X,pe]=g.useState(U?.tab??"dashboard"),[V,ke]=g.useState(()=>{if(r||!Z)return null;const i=re(t,m,"learning-news-load")?.data;return vn(i)?i:null}),k=g.useRef(null);k.current=V;const[A,he]=g.useState(null),[ce,Me]=g.useState(()=>U?.slideIndex??{}),[en,$e]=g.useState({}),[ye,xs]=g.useState(()=>U?.slideTotals??{}),[js]=g.useState(()=>r?new Set:_s(t,m)),[fs,bs]=g.useState(()=>new Set),Ie=g.useRef(null),Re=i=>{if(n?.readAloudEnabled!==!0)return null;const c=o?.renderReadAloud;return typeof c!="function"?null:c(`learning-lesson-${i}`,Ie)},nn=i=>r||js.has(i)||fs.has(i)?null:e.jsx($s,{compact:!0,blockSlug:"learning",subjectType:"learning_lesson",subjectId:i,promptKey:"block_rating.prompt_lesson",ariaKey:"block_rating.rate_lesson_aria",baseUrl:j,apiKey:o?.apiKey,jwt:_?.jwt,previewMode:x||b,settleInPlace:!0,onRated:()=>Ka(t,m,i),onFeedbackCycleDone:()=>bs(c=>new Set(c).add(i)),t:p}),[sn,an]=g.useState(!1),[ws,Ns]=g.useState(!1),[Ue,ln]=g.useState(!1),[An,Tn]=g.useState(null),[vs,tn]=g.useState(!1),Ln=g.useRef(null),[le,me]=g.useState(U?.openTopicId??null),[xe,Oe]=g.useState(null),[W,de]=g.useState(null),[N,ze]=g.useState(()=>r?null:re(t,m,"learning-browse",{language:f})?.data??null),[rn,on]=g.useState(!1),[S,ee]=g.useState(null),[ks,Be]=g.useState(null),[M,De]=g.useState(null),[O,Ee]=g.useState(null),[ue,Mn]=g.useState(null),[cn,dn]=g.useState(!1),[$,un]=g.useState(null),ie=g.useRef(p);ie.current=p;const $n=g.useCallback((i,c)=>(Za.includes(i)&&(Vn(),on(!0)),a.call(i,c)),[a]),C=g.useMemo(()=>({...a,call:$n}),[a,$n]),je=g.useCallback(async i=>{F(null),ve(null),K(null),we(null),_e("");const c={...i?{preferredTopicId:i}:{},language:f},d=re(t,m,"learning-load",c);if(d){if(E(d.data),H(!1),!d.stale)return d.data;const y=await R(C,"learning-load",c);return y&&(ge(t,m,"learning-load",c,y),E(y)),y??d.data}H(!0);const h=await R(C,"learning-load",c);return h?(ge(t,m,"learning-load",c,h),E(h)):F(ie.current("learning.error_load")),H(!1),h},[C,f,m,t]);g.useEffect(()=>{if(r){const i=s?.mode??"nothing";E(i==="nothing"?{mode:"nothing",reason:s?.reason??"all_in_cooldown"}:{mode:"unavailable"});return}je()},[r,je,s?.mode,s?.reason]),g.useEffect(()=>{const i=a.on?.("learning:reload",()=>{Vn(),je()});return()=>i?.()},[a,je]),g.useEffect(()=>{if(r||!Z)return;let i=!1;return(async()=>{const c=re(t,m,"learning-news-load");if(c&&(vn(c.data)&&ke(c.data),!c.stale))return;const d=await R(a,"learning-news-load");i||!d||(ge(t,m,"learning-news-load",void 0,d),vn(d)&&ke(d))})(),()=>{i=!0}},[a,r,m,t,Z]);const ys=g.useCallback(()=>{const i=A;if(!i)return;he(null);const c=el(i.url);if(!c){F(ie.current("learning.news_error_open"));return}const d=window.open(c,"_blank","noopener,noreferrer");d&&(d.opener=null),(async()=>{const h=await R(a,"learning-news-open",{newsItemId:i.id});if(!h||typeof h.unreadCount!="number")return;const y=k.current;if(!y)return;const D=rl(y,i.id,h.unreadCount);ke(D),ge(t,m,"learning-news-load",void 0,D)})()},[a,A,m,t]);g.useEffect(()=>{Xa(m)},[m]),g.useEffect(()=>{if(X==="today"||r||N&&(M||W||$))return;const i={language:f},c=rn?null:re(t,m,"learning-browse",i);if(N&&!rn&&!(c&&c.stale)||(c&&ze(c.data),c&&!c.stale))return;let d=!1;return(async()=>{const h=await R(C,"learning-browse",i);d||!h||!Array.isArray(h.topics)||!h.summary||(ge(t,m,"learning-browse",i,h),ze(h),on(!1))})(),()=>{d=!0}},[X,N,rn,M,W,$,r,C,f,m,t]);const gn=g.useCallback(async(i,c,d)=>{const h=await R(C,"learning-answer-quiz",{quizId:i,questionId:c,selectedOptionIndex:d,language:f});if(!h){F(ie.current("learning.error_answer"));return}a.emit("learning:answerSubmitted",{questionId:c}),h.completed&&K(h.completed)},[a,C,f]),_n=g.useCallback(async(i,c,d)=>{B(!0);const h=await R(C,"learning-answer-quiz-open",{quizId:i,questionId:c,answer:d,language:f});return h?a.emit("learning:answerSubmitted",{questionId:c}):F(ie.current("learning.error_answer")),B(!1),!!h},[a,C,f]),pn=g.useCallback(async(i,c)=>{if(L)return;B(!0);const d=await R(C,"learning-quiz-finish",{quizId:i,language:f,activeDate:Zn()});if(d){if(K(d),a.emit("learning:quizCompleted",d),Mn(d.sectionQuiz??null),d.streak&&ze(h=>h&&{...h,streak:d.streak}),!c?.isSectionQuiz){const h=await R(C,"learning-load",{language:f});h?.mode&&we(h)}}else Y||F(ie.current("learning.error_answer"));B(!1)},[a,C,L,f,Y]),Rn=g.useCallback(async(i,c,d)=>{if(L)return!1;B(!0);const h=await R(C,"learning-section-quiz",{topicId:i,language:f});B(!1);const y=h?.quiz??null;return y?(K(null),dn(!1),un({quiz:y,topicTitle:h?.topicTitle||c,origin:d}),!0):!1},[L,C,f]),Is=g.useCallback(async i=>{const c=J.trim();if(!c||L)return;B(!0);const d=await R(C,"learning-answer-open",{questionId:i,answer:c,language:f});d?(a.emit("learning:answerSubmitted",{questionId:i,verdict:d.verdict}),ve(d)):F(ie.current("learning.error_answer")),B(!1)},[a,C,L,f,J]),Pe=g.useCallback(async i=>{B(!0);const c=await R(C,"learning-start-lesson",{lessonId:i});return B(!1),c?!0:(F(ie.current("learning.error_load")),!1)},[C]),hn=g.useCallback(async i=>{await Pe(i)&&ln(!0)},[Pe]),Fe=g.useCallback(async(i,c)=>{i?.mode==="new_information"&&i.isNew&&(c!==null&&i.lesson.topicId!==c?Tn(i.lesson.lessonId):await hn(i.lesson.lessonId)),tn(!1)},[hn]),Qe=g.useCallback(()=>{dn(!1),Mn(null),un(null),K(null),ln(!1),ae&&(E(ae),we(null),tn(!0),Fe(ae,Ln.current))},[Fe,ae]),We=g.useCallback(async i=>{const c=await R(C,"learning-complete-lesson",{lessonId:i,activeDate:Zn()});return c?.streak&&ze(d=>d&&{...d,streak:c.streak}),c},[C]),Un=g.useCallback(async(i,c)=>{ln(!1),tn(!0),Ln.current=c??null,i&&(await We(i),Me(d=>{if(!(i in d))return d;const h={...d};return delete h[i],h}),$e(d=>{if(!(i in d))return d;const h={...d};return delete h[i],h})),await Fe(await je(),c??null)},[Fe,je,We]),te=g.useCallback(async(i,c)=>{F(null),Ns(c?.fromQuiz===!0),de({...i}),Be(null);const d={lessonId:i.lessonId,language:f},h=re(t,m,"learning-read-lesson",d);if(h)ee(h.data),h.stale&&(async()=>{const y=await R(C,"learning-read-lesson",d);y&&(y.body||y.slides?.length)&&(ge(t,m,"learning-read-lesson",d,y),ee(y))})();else{ee(null);const y=await R(C,"learning-read-lesson",d);if(!y||!y.body&&!y.slides?.length){de(null),F(ie.current("learning.error_load"));return}ge(t,m,"learning-read-lesson",d,y),ee(y)}if(i.done){const y={lessonId:i.lessonId,language:f},D=re(t,m,"learning-lesson-review",y);if(D&&!D.stale)Be(D.data.rows??null);else{const Se=await R(C,"learning-lesson-review",y);Se?(ge(t,m,"learning-lesson-review",y,Se),Be(Se.rows??null)):Be(D?D.data.rows??null:null)}}},[C,f,m,t]),Ge=g.useCallback(async i=>{if(N?.canPickAnyLesson===!0&&i.servedAt===null&&!i.done){F(null),de(null),ee(null),Ee(i);return}await te(i)},[N?.canPickAnyLesson,te]),mn=g.useCallback(async i=>{await Pe(i.lessonId)&&(Ee(null),await te({...i,servedAt:new Date().toISOString()}))},[te,Pe]),zs=g.useCallback(async i=>{B(!0),await R(C,"learning-start-lesson",{lessonId:i}),await We(i);const c=await R(C,"learning-lesson-quiz",{lessonId:i,language:f});if(B(!1),c?.quiz){De({quiz:c.quiz,lessonId:c.lessonId??i,lessonTitle:c.lessonTitle??""}),de(null),ee(null);return}const d=N?.topics.flatMap(D=>(D.lessons??[]).map(Se=>({topicId:D.topicId,lesson:Se})))??[],h=d.findIndex(D=>D.lesson.lessonId===i),y=N?.canPickAnyLesson===!0&&h!==-1?d.slice(h+1).find(D=>!D.lesson.done)??null:null;if(de(null),ee(null),ze(null),!!y){if(y.topicId===d[h].topicId){await mn(y.lesson);return}Tn(y.lesson.lessonId),Ge(y.lesson)}},[C,f,N,Ge,We,mn]),On=g.useRef(U?.readingLessonId??null);g.useEffect(()=>{const i=On.current;if(!i||!N||r)return;On.current=null;const c=N.topics.flatMap(d=>d.lessons??[]).find(d=>d.lessonId===i);c&&te(c)},[N,r,te]),g.useEffect(()=>{r||Qa(t,m,{tab:X,openTopicId:le,readingLessonId:W?.lessonId??null,slideIndex:ce,slideTotals:ye})},[r,t,m,X,le,W,ce,ye]);const Bn=u?.mode==="new_information"?u.lesson:null;g.useEffect(()=>{const i=[];for(const c of[Bn,S]){const d=c?.slides?.length??0;c&&d>0&&i.push([c.lessonId,d])}i.length!==0&&xs(c=>{const d=i.filter(([h,y])=>c[h]!==y);return d.length>0?{...c,...Object.fromEntries(d)}:c})},[Bn,S]);const qs=g.useMemo(()=>{const i={};for(const[c,d]of Object.entries(ye))d<=0||(i[c]={index:Math.min(ce[c]??0,d-1),total:d});return i},[ye,ce]),qe=(N?.tracks?.length??0)>0,xn=g.useMemo(()=>O?N?.topics.find(i=>(i.lessons??[]).some(c=>c.lessonId===O.lessonId))??null:null,[N,O]),Ce=g.useMemo(()=>{if(!N||!qe)return[];const i=new Set(N.tracks.flatMap(c=>c.topics.map(d=>d.topicId)));return N.topics.filter(c=>!i.has(c.topicId))},[N,qe]),Je=g.useMemo(()=>!N||!xe?null:xe===Nn?{trackId:Nn,title:p("learning.track_unassigned"),topicCount:Ce.length,doneTopicCount:Ce.filter(i=>i.lessonCount>0&&i.doneCount===i.lessonCount).length,topics:Ce}:N.tracks?.find(i=>i.trackId===xe)??null,[N,xe,Ce,p]),Dn=i=>{if(N?.canPickAnyLesson!==!0)return null;const c=N.topics.flatMap(h=>h.lessons??[]),d=c.findIndex(h=>h.lessonId===i);return d===-1?null:c.slice(d+1).find(h=>!h.done)??null},Cs=i=>{if(!N)return!0;const c=N.topics.flatMap(h=>h.lessons??[]),d=c.findIndex(h=>h.lessonId===i);return d===-1?!0:c.slice(d+1).some(h=>!h.done)},jn=i=>Cs(i)?p("learning.finish_next_lesson"):p("learning.finish_lesson"),En=Z&&V!==null&&(V.unread.length>0||V.read.length>0||V.suggested!==null),ne=G||vs,z=X==="dashboard"&&!P||X==="progress"&&!T||X==="news"&&!En?"today":X,Pn=g.useRef(null),Fn=S?.lessonId??(u?.mode==="new_information"?u.lesson.lessonId:null),Ss=[z,xe??"",le??"",O?.lessonId??"",W?.lessonId??"",sn?"quiz-lesson":"",M?.quiz.attemptId??M?.quiz.quizId??"",$?.quiz.attemptId??$?.quiz.quizId??"",cn?"section-intro":"",u?.mode??"",u?.mode==="new_information"?u.lesson.lessonId:"",u?.mode==="new_information"&&u.isNew&&!Ue?"arrival":"",u?.mode==="checking_question"?u.question.questionId:"",u?.mode==="placement_quiz"||u?.mode==="section_quiz"||u?.mode==="lesson_quiz"?u.quiz.attemptId??u.quiz.quizId:"",Y?"results":"",Fn?String(ce[Fn]??0):""].join("|");return g.useLayoutEffect(()=>{Ga(Pn.current)},[Ss]),e.jsxs(Ts,{blockType:"learning",children:[e.jsxs("header",{className:"es-learning__header",children:[e.jsx("span",{className:"es-learning__header-title",children:w}),I&&e.jsx("nav",{className:"es-learning__header-actions","aria-label":w,children:[...P?[["dashboard",ua]]:[],["today",ca],["topics",da],...En?[["news",pa]]:[],...T?[["progress",ga]]:[]].map(([i,c])=>{const d=i==="news"&&z!=="news"?V?.unreadCount??0:0,h=p(`learning.nav_${i}`);return e.jsxs("button",{type:"button",className:`es-learning__navbtn es-learning__navbtn--icon${i==="news"?" es-learning__navbtn--news":""}${z===i?" es-learning__navbtn--active":""}`,"aria-current":z===i?"page":void 0,"aria-label":d>0?p("learning.nav_news_unread",{n:d}):h,title:h,onClick:()=>{pe(i),me(null),Oe(null),de(null),ee(null),Ee(null),an(!1),De(null),K(null),we(null),he(null)},children:[e.jsx(c,{}),d>0&&e.jsx("span",{className:"es-learning__navbadge","aria-hidden":"true",children:d>99?"99+":d})]},i)})})]}),e.jsxs("div",{className:"es-block__body es-learning",ref:Pn,children:[be&&e.jsx("div",{className:"es-learning__error",role:"alert",children:be}),ne&&(z==="today"||z==="dashboard")&&e.jsx("div",{className:"es-learning__loading",children:p("learning.loading")}),z==="dashboard"&&!G&&e.jsx($a,{view:u,browse:N,mascot:v,slidePositions:qs,newsTile:Z&&V?.suggested?e.jsx(al,{item:V.suggested,currentLanguage:f,onPick:he,t:p}):void 0,onGoToday:()=>pe("today"),onOpenLesson:(i,c)=>{pe("topics"),me(i),te(c)},onOpenTopic:i=>{pe("topics"),me(i)},t:p}),z==="news"&&e.jsx(ll,{news:V,currentLanguage:f,onPick:he,t:p}),z==="progress"&&N&&e.jsx(Ba,{browse:N,t:p}),(z==="topics"||z==="progress")&&!N&&!O&&e.jsx("div",{className:"es-learning__loading",children:p("learning.loading")}),z==="topics"&&O&&e.jsx(Gn,{lessonTitle:O.title,topicTitle:xn?.title??"",newTopic:An===O.lessonId,graphicRef:O.graphicRef,graphicAlt:O.graphicAlt,graphicUrl:O.graphicUrl,slideCount:ye[O.lessonId]??0,mascot:v,busy:L,onStart:()=>{mn(O)},onBackToTopic:xn?()=>{Ee(null),me(xn.topicId)}:void 0,t:p}),z==="topics"&&N&&W&&!S&&e.jsx("div",{className:"es-learning__loading",children:p("learning.loading")}),z==="topics"&&N&&W&&S&&e.jsx(Jn,{lesson:S,readAloud:Re(S.lessonId),readAloudRef:Ie,slideIndex:ce[S.lessonId]??0,onSlideIndexChange:i=>Me(c=>({...c,[S.lessonId]:i})),slideAnswers:en[S.lessonId]??{},onSlideAnswer:(i,c)=>$e(d=>({...d,[S.lessonId]:{...d[S.lessonId]??{},[i]:c}})),review:ks,backLabel:p("learning.back_to_topic",{topic:S.topicTitle}),showBackLink:!1,onBack:()=>{de(null),ee(null)},onBackToTopic:()=>{de(null),ee(null)},onFinish:N.canPickAnyLesson===!0&&!W.done?()=>{zs(S.lessonId)}:void 0,finishLabel:S.hasQuiz===!1?jn(S.lessonId):p("learning.finish_to_quiz"),rating:ws?null:nn(S.lessonId),t:p}),z==="topics"&&M&&e.jsx(wn,{quiz:M.quiz,isPlacement:!1,eyebrow:M.lessonTitle,topics:[],results:Y,busy:L,mascot:v,onAnswer:(i,c)=>{gn(M.quiz.quizId,i,c)},onAnswerOpen:(i,c)=>_n(M.quiz.quizId,i,c),onFinish:()=>{pn(M.quiz.quizId)},onBackToLesson:()=>{De(null),te({lessonId:M.lessonId,title:M.lessonTitle,isMilestone:!1,state:"gap",done:!1,servedAt:new Date().toISOString()},{fromQuiz:!0})},onContinue:()=>{const i=Dn(M.lessonId);K(null),De(null),i&&Ge(i)},continueLabel:Dn(M.lessonId)?p("learning.go_to_next_lesson"):p("learning.nav_topics"),t:p},M.quiz.attemptId??M.quiz.quizId),z==="topics"&&N&&!W&&!M&&!$&&!O&&le&&e.jsx(Ma,{topic:N.topics.find(i=>i.topicId===le)??N.topics[0],onOpenLesson:i=>{Ge(i)},onStartSectionQuiz:()=>{const i=N.topics.find(c=>c.topicId===le)??N.topics[0];(async()=>await Rn(i.topicId,i.title,"topics")||on(!0))()},canPickAnyLesson:N.canPickAnyLesson===!0,backLabel:Je?.title,onBack:Je?()=>me(null):void 0,t:p}),z==="topics"&&N&&!W&&!M&&!$&&!O&&!le&&qe&&!xe&&e.jsx(Ca,{tracks:N.tracks,untracked:Ce,onOpenTrack:Oe,onOpenUntracked:()=>Oe(Nn),t:p}),z==="topics"&&N&&!W&&!M&&!$&&!O&&!le&&qe&&xe&&Je&&e.jsx(Sa,{track:Je,onOpenTopic:me,onBack:()=>Oe(null),t:p}),z==="topics"&&N&&!W&&!M&&!$&&!O&&!le&&!qe&&e.jsx(ds,{topics:N.topics,onOpen:me,t:p}),z==="today"&&!ne&&u?.mode==="nothing"&&e.jsx(kn,{kind:u.reason,mascot:v,nextDueAt:u.nextDueAt,t:p}),z==="today"&&!ne&&u?.mode==="unavailable"&&e.jsx(kn,{kind:"unavailable",mascot:v,t:p}),z==="today"&&!ne&&u?.mode==="new_information"&&u.isNew&&!Ue&&e.jsx(Gn,{lessonTitle:u.lesson.title,topicTitle:u.lesson.topicTitle,newTopic:An===u.lesson.lessonId,graphicRef:u.lesson.graphicRef,graphicAlt:u.lesson.graphicAlt,graphicUrl:u.lesson.graphicUrl,slideCount:u.lesson.slides?.length??0,mascot:v,busy:L,onStart:()=>{hn(u.lesson.lessonId)},t:p}),z==="today"&&!ne&&u?.mode==="new_information"&&(!u.isNew||Ue)&&(!u.lesson.kind||u.lesson.kind==="info"||!u.lesson.slides?.length)&&e.jsx(rs,{lesson:u.lesson,busy:L,onDone:()=>{Un(u.lesson.lessonId,u.lesson.topicId)},doneLabel:u.lesson.hasQuiz===!1?jn(u.lesson.lessonId):void 0,rating:nn(u.lesson.lessonId),readAloud:Re(u.lesson.lessonId),readAloudRef:Ie,t:p}),z==="today"&&!ne&&u?.mode==="new_information"&&(!u.isNew||Ue)&&u.lesson.kind&&u.lesson.kind!=="info"&&!!u.lesson.slides?.length&&e.jsx(cs,{lesson:u.lesson,index:ce[u.lesson.lessonId]??0,onIndexChange:i=>Me(c=>({...c,[u.lesson.lessonId]:i})),answers:en[u.lesson.lessonId]??{},onAnswer:(i,c)=>$e(d=>({...d,[u.lesson.lessonId]:{...d[u.lesson.lessonId]??{},[i]:c}})),busy:L,onDone:()=>{Un(u.lesson.lessonId,u.lesson.topicId)},doneLabel:u.lesson.hasQuiz===!1?jn(u.lesson.lessonId):void 0,rating:nn(u.lesson.lessonId),readAloud:Re(u.lesson.lessonId),readAloudRef:Ie,t:p}),z==="today"&&!ne&&u?.mode==="checking_question"&&e.jsx(fa,{prompt:u.question.prompt,lessonTitle:u.lessonTitle,answer:J,feedback:Xe,busy:L,showExplanations:q,onChange:_e,onSubmit:()=>{Is(u.question.questionId)},t:p}),z==="today"&&!ne&&u?.mode==="lesson_quiz"&&sn&&(S?e.jsx(Jn,{lesson:S,readAloud:Re(S.lessonId),readAloudRef:Ie,slideIndex:ce[S.lessonId]??0,onSlideIndexChange:i=>Me(c=>({...c,[S.lessonId]:i})),slideAnswers:en[S.lessonId]??{},onSlideAnswer:(i,c)=>$e(d=>({...d,[S.lessonId]:{...d[S.lessonId]??{},[i]:c}})),backLabel:p("learning.back_to_quiz"),onBack:()=>an(!1),t:p}):e.jsx("div",{className:"es-learning__loading",children:p("learning.loading")})),z==="today"&&!ne&&cn&&ue&&e.jsx(ma,{topicTitle:ue.topicTitle,topicComplete:ue.topicComplete,mascot:v,busy:L,onStart:()=>{(async()=>await Rn(ue.topicId,ue.topicTitle,"today")||Qe())()},onSkip:Qe,t:p}),$&&z===$.origin&&e.jsx(wn,{quiz:$.quiz,isPlacement:!1,eyebrow:$.topicTitle,topics:[],results:Y,busy:L,mascot:v,onAnswer:(i,c)=>{gn($.quiz.quizId,i,c)},onAnswerOpen:(i,c)=>_n($.quiz.quizId,i,c),onFinish:()=>{pn($.quiz.quizId,{isSectionQuiz:!0})},onBackToLesson:void 0,onContinue:$.origin==="today"?Qe:()=>{un(null),K(null)},continueLabel:$.origin==="topics"?p("learning.nav_topics"):ae?.mode==="new_information"?p("learning.go_to_next_lesson"):p("learning.continue"),t:p},$.quiz.attemptId??$.quiz.quizId),z==="today"&&!ne&&!sn&&!cn&&$?.origin!=="today"&&(u?.mode==="placement_quiz"||u?.mode==="section_quiz"||u?.mode==="lesson_quiz")&&e.jsx(wn,{quiz:u.quiz,isPlacement:u.mode==="placement_quiz",eyebrow:u.mode==="lesson_quiz"?u.lessonTitle:void 0,topics:u.mode==="placement_quiz"?u.topics:[],results:Y,busy:L,mascot:v,onAnswer:(i,c)=>{gn(u.quiz.quizId,i,c)},onAnswerOpen:(i,c)=>_n(u.quiz.quizId,i,c),onFinish:()=>{pn(u.quiz.quizId)},onBackToLesson:u.mode==="lesson_quiz"?()=>{an(!0),te({lessonId:u.lessonId,title:u.lessonTitle,isMilestone:!1,state:"current",done:!1,servedAt:null},{fromQuiz:!0})}:void 0,onChooseTopic:u.mode==="placement_quiz"?i=>{je(i)}:void 0,onContinue:ue||ae?()=>{if(ue){K(null),dn(!0);return}Qe()}:void 0,continueLabel:!ue&&ae?.mode==="new_information"?p("learning.go_to_next_lesson"):p("learning.continue"),t:p},u.quiz.attemptId??u.quiz.quizId)]}),A&&e.jsx(il,{item:A,onCancel:()=>he(null),onConfirm:ys,t:p})]})}export{jl as Component,Gn as NewLessonIntro,ya as QuizReview,ma as SectionQuizIntro,xl as manifest};
2
+ //# sourceMappingURL=index-DnWzIgAa-DlTfKZaL.js.map
@@ -1,2 +1,2 @@
1
1
  import{j as e,T as N,r as d}from"../nexly.js";const f={"--ai-bg":"#141414","--ai-bg-elevated":"#1F1F1F","--ai-bg-card":"#1F1F1F","--ai-bg-input":"#141414","--ai-bg-footer":"#141414","--ai-fg":"#F5F5F5","--ai-fg-secondary":"#D1D5DB","--ai-muted":"#9CA3AF","--ai-muted-dim":"#6B7280","--ai-border":"#2a2a2a","--ai-border-subtle":"#1e1e1e","--ai-accent":"#FFCC00","--ai-accent-fg":"#1A1A1A","--ai-accent-hover":"#E6B800","--ai-accent-subtle":"rgba(255, 204, 0, 0.12)","--ai-accent-on-subtle":"#FFCC00","--ai-accent-on-subtle-strong":"#FFCC00","--ai-accent-border":"#75600C","--ai-user-bubble":"#FFCC00","--ai-user-bubble-fg":"#1A1A1A","--ai-assistant-bubble":"#1F1F1F","--ai-assistant-bubble-fg":"#F5F5F5","--ai-shadow":"0 20px 60px -15px rgba(0, 0, 0, 0.7)","--ai-scrollbar":"#FFCC00","--ai-success":"#22C55E","--ai-warning":"#EAB308","--ai-error":"#F87171","--ai-info":"#38BDF8","--es-color-surface":"#141414","--es-color-surface-elevated":"#1F1F1F","--es-color-surface-hover":"#2E2E2E","--es-color-on-surface":"#F5F5F5","--es-color-on-surface-muted":"#9CA3AF","--es-color-primary":"#FFCC00","--es-color-on-primary":"#1A1A1A","--es-color-primary-muted":"rgba(255, 204, 0, 0.12)","--es-color-primary-on-muted":"#FFCC00","--es-color-border":"#2a2a2a","--es-color-control-border":"#6B7280","--es-color-error":"#F87171","--es-color-success":"#22C55E","--es-color-on-success":"#1A1A1A","--es-color-warning":"#EAB308","--es-color-interactive":"#FFE066"},S={"--ai-bg":"#FFFFFF","--ai-bg-elevated":"#FAFAFA","--ai-bg-card":"#F2F2F2","--ai-bg-input":"#F2F2F2","--ai-bg-footer":"#FFFFFF","--ai-fg":"#1A1A1A","--ai-fg-secondary":"#4B4B4F","--ai-muted":"#67696E","--ai-muted-dim":"#9CA3AF","--ai-border":"#E5E5E5","--ai-border-subtle":"#EFEFEF","--ai-accent":"#856900","--ai-accent-fg":"#FFFFFF","--ai-accent-hover":"#6B5400","--ai-accent-subtle":"rgba(125, 98, 0, 0.10)","--ai-accent-on-subtle":"#7D6200","--ai-accent-on-subtle-strong":"#765D00","--ai-accent-border":"#A8944A","--ai-user-bubble":"#856900","--ai-user-bubble-fg":"#FFFFFF","--ai-assistant-bubble":"#F2F2F2","--ai-assistant-bubble-fg":"#1A1A1A","--ai-shadow":"0 20px 60px -15px rgba(0, 0, 0, 0.12)","--ai-scrollbar":"#D1D5DB","--ai-success":"#00672B","--ai-warning":"#9C5300","--ai-error":"#AD2C26","--ai-info":"#03669D","--es-color-surface":"#FFFFFF","--es-color-surface-elevated":"#F2F2F2","--es-color-surface-hover":"#EAEAEA","--es-color-on-surface":"#1A1A1A","--es-color-on-surface-muted":"#67696E","--es-color-primary":"#856900","--es-color-on-primary":"#FFFFFF","--es-color-primary-muted":"rgba(118, 93, 0, 0.10)","--es-color-primary-on-muted":"#765D00","--es-color-border":"#E5E5E5","--es-color-control-border":"#6B7280","--es-color-error":"#AD2C26","--es-color-success":"#00672B","--es-color-on-success":"#FFFFFF","--es-color-interactive":"#92400E"},L={slug:"ambient-signal-black",name:"Signal Black",version:"0.1.0",slots:["header","main","footer"],cssVariables:f,structure:{header:{id:"header",label:"Header",accepts:!0},main:{id:"main",label:"Main Content",accepts:!0},footer:{id:"footer",label:"Footer",accepts:!0}},defaultViews:[],requiredServices:["chat-bot"],description:"Bold monochrome theme with a #FFCC00 signal-gold accent, built for the AmbientSystem SupportChat widget.",author:"E-Commerce Studio",packageName:"@ecommerce-studio/theme-ambient-signal-black",options:[{id:"colorScheme",type:"select",label:"Appearance mode",default:"auto",group:"Appearance",options:[{label:"Auto (match visitor)",value:"auto"},{label:"Light",value:"light"},{label:"Dark",value:"dark"}]}],supports:{customCss:!1,customJs:!1,darkMode:!0,rtl:!1,views:!1}},D=105,j=82,x="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGkAAABSCAYAAABXP/pUAAACiklEQVR42u2c23GDQAxFtyc3oGrShupINWogPTn+sCcewmMxSKtdzp3RX2CcPVxJaIFSUEvJM+wZ90coy+KzyLoQsnLcC8o00AlQdGWBl8LeoK0di4sOwtkL5pNAieHgog+lQXBe6XDtAkEzskBAUxfNuRclAUTHlzDF0VAMBIiGIjkgXNSwDuEiXDSesgIy0Py1vXecRKo7EgKivA0DKa+DegSkjiBdvi5J+dtBtcSpD63AMyDRAQJp4ogtV1jZfnikBSwbEcqZtUUXZmeRsHQ0OJ5XszYCpcA5tmARoIDzoaskaPbXrYuyzNo0ABTuOXn4qVd3UeZJtTgNaw1APosp5YLbFNkBXd5N1gkgbzcByMlNw6c87RDQ1E1Dp7xeAV0GUs+ApvVDR4V0B1JuSAqkOkhfADptMV0g3R7xs7HRBaT6WZt5nPcd0vQPhFq0G5LLfdISJO+prA4EyX3i8FUB6e6QDkd0kTqddxekM4GN5qLiCP9jSEfS4SipTiJcdBaktSdrRoXkuTNbPCHVpkPpHJQ4Nguza/btBKm2ndeOgNnM/xHyAEoEpNr6lRmYzmQDi1qbaEi19SsLsDn3aPDF2wxSdmC2kKItGlB5AvpJllbWfrQ4QrMS/1ZF1e1LNkh7W/p3aLbz3C8osnH+5q+23J5teA+vJu6dcshM1B5nDRuo3Xq/UjNBtBNniVJiX8EMf4xYSp6XhK38/+TzNFr/TikJlQlitla+G/U+IrrU52dGBDXk9+qU1AYo4JwMSoEDrKgNTmA1AiMgaTNc3UplgEkyzjGgtJty1DiP+pJAQAISAhKQ6OJaNxBHtkas1H1VEh2Aw01t4ukEWxKd1x5AIYQQQgihhvoFxm18xEWNaMwAAAAASUVORK5CYII=",M=j/D,_=.62;function C({size:a=64,className:o,registerEl:s}){const c=a*_,n=c*M;return e.jsx("div",{className:o,"aria-hidden":"true","data-bird":"badge",style:{position:"relative",width:a,height:a,borderRadius:"9999px",background:"var(--ai-accent, #FFCC00)",color:"var(--ai-accent-fg, #1A1A1A)",display:"flex",alignItems:"center",justifyContent:"center",overflow:"visible"},children:e.jsxs("div",{ref:s,"data-bird":"root",style:{position:"relative",width:c,height:n,transformOrigin:"50% 50%"},children:[e.jsx("div",{"data-bird":"glow",style:{position:"absolute",inset:"-35%",borderRadius:"9999px",background:"radial-gradient(closest-side, currentColor, transparent 72%)",opacity:0,filter:"blur(6px)",pointerEvents:"none"}}),e.jsx("div",{"data-bird":"mark",style:{position:"relative",width:"100%",height:"100%",backgroundColor:"currentColor",WebkitMaskImage:`url("${x}")`,maskImage:`url("${x}")`,WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskSize:"contain",maskSize:"contain"}})]})})}const I=3200,R=2.5,z=4200,J=3,Q=Math.PI/3,P=5200,A=.12,V=.34;function p(a,o){const s=a.querySelector('[data-bird="glow"]');s&&(s.style.opacity=o.toFixed(3))}function X(a){const o=d.useRef(new Set),s=d.useRef(0),c=d.useCallback(n=>{const i=o.current;if(n)i.add(n);else for(const t of i)t.isConnected||i.delete(t)},[]);return d.useEffect(()=>{if(!a)return;if(typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){for(const t of o.current)t.style.transform="",p(t,A);return}const n=performance.now();function i(t){const r=t-n,h=Math.sin(r/I*Math.PI*2)*R,F=Math.sin(r/z*Math.PI*2+Q)*J,u=(Math.sin(r/P*Math.PI*2)+1)/2,l=A+(V-A)*u;for(const b of o.current)b.style.transform=`translateY(${h.toFixed(2)}px) rotate(${F.toFixed(2)}deg)`,p(b,l);s.current=requestAnimationFrame(i)}return s.current=requestAnimationFrame(i),()=>{cancelAnimationFrame(s.current);for(const t of o.current)t.style.transform="",p(t,0)}},[a]),{registerEl:c}}function O({brandName:a="AMBIENT",position:o="bottom-right",initialOpen:s=!1,children:c,cssVariables:n,t:i,colorScheme:t,builderMode:r=!1,owlIdleLife:h=!1,onOpenChange:F}){const u=N(t),[l,b]=d.useState(s||r),k=X(h),B=()=>b(g=>{const m=!g;return F?.(m),m}),w=()=>{b(!1),F?.(!1)},E=o==="bottom-left",v=d.useMemo(()=>{const g=Object.fromEntries(Object.entries(n??{}).filter(([m,y])=>f[m]!==y));return{...u==="light"?S:f,...g,...r?{width:"100%",height:"100%"}:{}}},[n,u,r]);return e.jsxs("div",{className:["ambient-shell",`ambient-shell--${u}`].join(" "),style:v,children:[!r&&e.jsx("button",{type:"button",className:["ambient-shell__button",E&&"ambient-shell__button--left",l&&"ambient-shell__button--hidden"].filter(Boolean).join(" "),onClick:B,"aria-label":i?.("floating.open_widget")??"Open chat widget",tabIndex:l?-1:0,"aria-hidden":l,children:e.jsx(C,{size:64,registerEl:k.registerEl})}),e.jsxs("div",{className:["ambient-shell__panel",E&&!r&&"ambient-shell__panel--left",(l||r)&&"ambient-shell__panel--open"].filter(Boolean).join(" "),role:"dialog","aria-label":i?.("chat.widget_aria")??"Chat widget","aria-hidden":r?!1:!l,children:[e.jsxs("header",{className:"ambient-shell__header",children:[e.jsxs("div",{className:"ambient-shell__header-brand",children:[e.jsx(C,{size:40,registerEl:k.registerEl}),e.jsxs("div",{className:"ambient-shell__header-info",children:[e.jsx("h1",{className:"ambient-shell__brand-name",children:a}),e.jsx("p",{className:"ambient-shell__brand-tagline",children:i?.("header.brand_tagline_support")??"Support"})]})]}),!r&&e.jsx("button",{type:"button",className:"ambient-shell__header-btn",onClick:w,"aria-label":i?.("header.close_widget")??"Close widget",children:e.jsx(T,{size:20})})]}),e.jsx("main",{className:"ambient-shell__content",style:{containerName:"es-slot",containerType:"inline-size"},children:c})]})]})}function T({size:a=20}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}export{C as BirdIcon,O as ThemeShell,f as darkVariables,S as lightVariables,L as manifest,X as useBirdAnimation};
2
- //# sourceMappingURL=index-Bd_8PmPr-CgO1smBF.js.map
2
+ //# sourceMappingURL=index-Dnqtxtmw-CgO1smBF.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as p,j as e,e as n}from"../nexly.js";const a=o=>`$${o.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})}`;function M({data:o,config:h,actions:l,metadata:x,i18n:j}){const s=j?.t??(i=>i),u=h.mode??o.mode??"basic",c=o.forecast,r=o.aiTip,[m,d]=p.useState("idle"),[N,b]=p.useState(!1);if(!c&&!o.error)return e.jsx(n,{blockType:"commission-forecast",children:e.jsx("div",{className:"cf-block",children:e.jsxs("div",{className:"cf-hero",children:[e.jsx("div",{className:"cf-hero-label",children:s("commission_forecast.estimated_commission")}),e.jsx("div",{className:"cf-hero-amount",style:{color:"var(--es-color-on-surface-muted, #4B5563)"},children:"—"}),e.jsx("div",{className:"cf-hero-sub",style:{color:"var(--es-color-on-surface-muted, #4B5563)"},children:x?.dataQuality==="none"?s("commission_forecast.signin_prompt"):s("commission_forecast.calculating")})]})})});if(o.error||!c)return e.jsx(n,{blockType:"commission-forecast",children:e.jsx("p",{style:{color:"var(--es-color-error, #AD2C26)",fontSize:13},children:s("commission_forecast.load_error")})});const t=c.deltaVsLastMonth,v=c.projectedMonthEnd>0?Math.min(100,Math.round(c.totalEstimated/c.projectedMonthEnd*100)):0,_=Math.round((c.scenarioOneMember-c.projectedMonthEnd)/Math.max(1,c.projectedMonthEnd)*100),g=()=>{r&&(navigator.clipboard.writeText(r).catch(()=>{}),d("copied"),l?.emit?.("cf:tipCopied",{tip:r}),setTimeout(()=>d("idle"),2e3))},f=()=>{b(!0),l?.emit?.("cf:scenarioViewed",{scenarioOneMember:c.scenarioOneMember})};return e.jsx(n,{blockType:"commission-forecast",children:e.jsxs("div",{className:"cf-block",children:[e.jsxs("div",{className:"cf-hero",children:[e.jsx("div",{className:"cf-hero-label",children:s("commission_forecast.estimated_commission")}),e.jsx("div",{className:"cf-hero-amount",children:a(c.totalEstimated)}),e.jsxs("div",{className:"cf-hero-sub",children:[e.jsxs("span",{children:[s("commission_forecast.projected_month_end_label")," ",e.jsx("strong",{children:a(c.projectedMonthEnd)})]}),t!==null&&e.jsxs("span",{className:`cf-delta-badge ${t>=0?"cf-delta--positive":"cf-delta--negative"}`,children:[t>=0?"↑":"↓"," ",a(Math.abs(t))," ",s("commission_forecast.vs_last_month")]})]})]}),e.jsxs("div",{className:"cf-forecast-row",children:[e.jsxs("div",{className:"cf-forecast-labels",children:[e.jsxs("span",{children:[s("commission_forecast.current_label")," ",a(c.totalEstimated)]}),e.jsxs("span",{children:[s("commission_forecast.target_label")," ",a(c.projectedMonthEnd)]})]}),e.jsx("div",{className:"cf-forecast-bar-track",children:e.jsx("div",{className:"cf-forecast-bar-fill",style:{width:`${v}%`}})}),e.jsx("div",{className:"cf-days-left",children:s("commission_forecast.days_left_run_rate",{days:c.daysLeft,rate:a(c.dailyRunRate)})})]}),e.jsxs("div",{className:"cf-scenario",onClick:f,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),f())},tabIndex:0,role:"button",children:[e.jsx("div",{className:"cf-scenario-label",children:s("commission_forecast.scenario_title")}),e.jsxs("div",{className:"cf-scenario-row",children:[e.jsx("span",{className:"cf-scenario-desc",children:s("commission_forecast.scenario_desc")}),e.jsx("span",{className:"cf-scenario-value",children:a(c.scenarioOneMember)})]}),e.jsx("div",{className:"cf-scenario-uplift",children:s("commission_forecast.uplift",{pct:_,amount:a(c.scenarioOneMember-c.projectedMonthEnd)})})]}),u==="pro"&&c.tiers.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cf-section-title",children:s("commission_forecast.by_tier",{count:c.tiers.length})}),e.jsx("div",{className:"cf-tier-list",children:c.tiers.map(i=>e.jsxs("div",{className:`cf-tier${i.status==="unreachable"?" cf-tier--unreachable":""}`,children:[e.jsxs("div",{className:"cf-tier-header",children:[e.jsx("span",{className:"cf-tier-engine",children:s("commission_forecast.engine_number",{id:i.engineId})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{className:`cf-tier-status cf-status--${i.status==="in progress"?"in-progress":"unreachable"}`,children:i.status==="in progress"?s("commission_forecast.status.in_progress"):s("commission_forecast.status.unreachable")}),e.jsx("span",{className:"cf-tier-amount",children:a(i.estimatedCommission)})]})]}),e.jsx("div",{className:"cf-tier-progress-track",children:e.jsx("div",{className:"cf-tier-progress-fill",style:{width:`${i.progressPct}%`}})}),e.jsxs("div",{className:"cf-tier-meta",children:[e.jsx("span",{children:s("commission_forecast.volume_label",{current:i.salesVolume.toLocaleString(),max:i.salesVolumeMax.toLocaleString()})}),e.jsx("span",{children:s("commission_forecast.points_label",{current:i.personalPoints,max:i.personalPointsMax})})]})]},i.engineId))})]}),r&&e.jsxs("div",{className:"cf-tip-box",children:[e.jsxs("div",{className:"cf-tip-header",children:[e.jsx("span",{className:"cf-tip-label",children:s("commission_forecast.ai_coach_label")}),e.jsx("button",{className:`cf-copy-btn${m==="copied"?" cf-copied":""}`,onClick:g,children:m==="copied"?`✓ ${s("common.copied")}`:s("common.copy")})]}),e.jsx("p",{className:"cf-tip-text",children:r})]})]})})}const k={slug:"commission-forecast",name:"Commission Forecast",version:"1.0.0",category:"data",requiredService:"commission-forecast",configSchema:{properties:{mode:{type:"string",default:"basic"}}},defaultConfig:{mode:"basic"},sizing:{minWidth:260,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],dataContract:{serviceSlug:"commission-forecast",inputSchema:{type:"object",properties:{forecast:{type:"object"},aiTip:{type:"string"},mode:{type:"string"}},required:["forecast","mode"]}},events:{emits:[{name:"cf:tipCopied",description:"User copied the AI commission tip"},{name:"cf:scenarioViewed",description:"User viewed the +1 member scenario projection"}]}};export{M as CommissionForecastBlock,M as Component,k as manifest};
2
- //# sourceMappingURL=index-BWY1nqf0-DX50C5MZ.js.map
2
+ //# sourceMappingURL=index-Dw35VwDs-DX50C5MZ.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as n,j as s,e as H}from"../nexly.js";const L={slug:"support-session-nav",name:"Support Session Navigator",version:"1.0.0",category:"interactive",configSchema:{},defaultConfig:{},sizing:{minWidth:200,preferredHeight:"fill",scrollable:!0},supportedPlacements:["sidebar","main"],events:{emits:[{name:"support-chat:select-session",description:"User selected a past support session"}]}};function M(a,o){const u=Date.now()-new Date(a).getTime(),r=Math.floor(u/6e4);if(r<1)return o("time.just_now");if(r<60)return o("time.minutes_ago",{count:r});const i=Math.floor(r/60);return i<24?o("time.hours_ago",{count:i}):o("time.days_ago",{count:Math.floor(i/24)})}function T({actions:a,baseUrl:o,productId:u,i18n:r,supportSessionId:i,auth:k,externalContext:g}){const t=r?.t??(e=>e),m=k?.jwt,w=g?.showTicketsTab??!1,[v,l]=n.useState(!1),[x,y]=n.useState([]),[p,b]=n.useState(!1),[f,j]=n.useState(null),[d,h]=n.useState(i??null);n.useEffect(()=>{h(i??null)},[i]);const _=n.useCallback(async()=>{b(!0),j(null);try{const e=await fetch(`${o}/api/support-chat/sessions?productId=${encodeURIComponent(u||"")}`,{headers:{...m?{Authorization:`Bearer ${m}`}:{}},credentials:"include"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const c=await e.json();if(!c.success||!c.data)throw new Error("Invalid response");y(c.data.sessions)}catch{j(t("support_session_nav.load_error"))}finally{b(!1)}},[o,m,u,t]);n.useEffect(()=>a.on("support-chat:session",e=>{const{sessionId:c}=e;c&&h(c),v&&_()}),[a,_,v]),n.useEffect(()=>a.on("support-chat:showHistory",()=>{l(!0),_()}),[a,_]),n.useEffect(()=>a.on("support-chat:clearHistory",()=>{l(!1)}),[a]);const C=n.useCallback(e=>{e!==d&&(h(e),a.emit("support-chat:select-session",{sessionId:e})),l(!1)},[a,d]),N=n.useCallback(()=>{a.emit("support-chat:clearHistory",void 0),h(null),l(!1)},[a]),S=n.useCallback(()=>{l(!1)},[]),E=n.useCallback(()=>{a.emit("support-chat:showTickets",void 0),l(!1)},[a]);return v?s.jsxs(H,{blockType:"support-session-nav",children:[s.jsxs("div",{className:"es-ssn__header",children:[s.jsx("span",{className:"es-ssn__header-title",children:t("support_session_nav.title")}),s.jsxs("div",{className:"es-ssn__header-actions",children:[s.jsx("button",{type:"button",className:"es-ssn__action-btn","aria-label":t("support_chat.new_conversation_button"),title:t("support_chat.new_conversation_button"),onClick:N,children:s.jsxs("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M12 5H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7"}),s.jsx("path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"})]})}),s.jsx("button",{type:"button",className:"es-ssn__action-btn es-ssn__action-btn--active","aria-label":t("support_chat.history_button"),title:t("support_chat.history_button"),"aria-pressed":"true",onClick:S,children:s.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]})}),w&&s.jsx("button",{type:"button",className:"es-ssn__action-btn","aria-label":t("support_chat.tickets_tab_button"),title:t("support_chat.tickets_tab_button"),onClick:E,children:s.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M2 9a3 3 0 1 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 1 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"}),s.jsx("path",{d:"m9 12 2 2 4-4"})]})})]})]}),s.jsx("div",{className:"es-block__body",children:s.jsxs("div",{className:"es-ssn__list",role:"list","aria-label":t("support_session_nav.list_aria"),children:[p&&s.jsx("div",{className:"es-ssn__loading",role:"status",children:t("support_session_nav.loading")}),f&&!p&&s.jsx("div",{className:"es-ssn__error",role:"alert",children:f}),!p&&!f&&x.length===0&&s.jsx("div",{className:"es-ssn__empty",children:t("support_session_nav.empty")}),!p&&x.map(e=>s.jsxs("button",{role:"listitem",type:"button",className:`es-ssn__item${e.id===d?" es-ssn__item--active":""}`,onClick:()=>C(e.id),"aria-current":e.id===d?"true":void 0,children:[s.jsx("div",{className:"es-ssn__item-preview",children:e.firstUserMessage??t("support_session_nav.no_preview")}),s.jsxs("div",{className:"es-ssn__item-meta",children:[s.jsx("span",{className:`es-ssn__item-status es-ssn__item-status--${e.status}`,"aria-label":e.status,children:e.status}),s.jsx("span",{children:M(e.updatedAt,t)}),e.messageCount>0&&s.jsx("span",{children:t("support_session_nav.message_count",{count:e.messageCount})})]})]},e.id))]})})]}):null}export{T as Component,L as manifest};
2
- //# sourceMappingURL=index--H6hRpBJ-F9_TzvkO.js.map
2
+ //# sourceMappingURL=index-Dydy8_XR-F9_TzvkO.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as q,j as e,e as m,l as w}from"../nexly.js";import{m as l}from"./block-helpers-Cg_zAqG6-DnN2COvk.js";const M={slug:"rank-advancement-roadmap",name:"Rank Advancement Roadmap",version:"1.0.0",category:"data",requiredService:"rank-advancement-roadmap",configSchema:{properties:{mode:{type:"string",default:"basic"},showAiTip:{type:"boolean",default:!0}}},defaultConfig:{mode:"basic",showAiTip:!0},sizing:{minWidth:280,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],dataContract:{serviceSlug:"rank-advancement-roadmap",inputSchema:{type:"object",properties:{currentRank:{type:"string"},nextRank:{type:"string"},progressPercent:{type:"number"},rankTree:{type:"array",items:{type:"object",properties:{rank:{type:"string"},requirements:{type:"array",items:{type:"string"}},achieved:{type:"boolean"}}}},aiTip:{type:"string"},mode:{type:"string",enum:["basic","pro"]}}},previewDataOverride:{currentRank:"Silver",nextRank:"Gold",progressPercent:62,mode:"pro",aiTip:"You're 38% away from Gold. Focus on recruiting 2 active distributors to your right leg — that's your fastest path to the next milestone.",rankTree:[{rank:"G-Miner",requirements:["Personal purchase: 50 pts"],achieved:!0},{rank:"Miner",requirements:["Personal purchase: 100 pts","Team volume: 500 pts"],achieved:!0},{rank:"Developer",requirements:["Personal purchase: 200 pts","Team volume: 1,500 pts"],achieved:!0},{rank:"Team Leader",requirements:["Personal purchase: 300 pts","Team volume: 5,000 pts","2 Developers in team"],achieved:!0},{rank:"Manager",requirements:["Personal purchase: 400 pts","Team volume: 15,000 pts","2 Team Leaders"],achieved:!1},{rank:"Senior Manager",requirements:["Personal purchase: 500 pts","Team volume: 40,000 pts","3 Managers"],achieved:!1},{rank:"Vice President",requirements:["Personal purchase: 600 pts","Team volume: 100,000 pts","4 Senior Managers"],achieved:!1},{rank:"President",requirements:["Personal purchase: 700 pts","Team volume: 250,000 pts","5 Vice Presidents"],achieved:!1}]}},fields:[{id:"mode",type:"select",label:"Display mode",default:"basic",options:[{label:"Basic — current rank + progress",value:"basic"},{label:"Pro — full rank tree",value:"pro"}],group:"Display"},{id:"showAiTip",type:"toggle",label:"Show AI coaching tip (pro mode)",default:!0,group:"Display"}],events:{emits:[{name:"rar:rankExpanded",description:"User expanded a rank in the accordion"}],listens:[{name:"rar:refresh",description:"Force refresh rank data"}]}};function k(s,o,d){return Math.min(Math.max(s,o),d)}function D({data:s,config:o,actions:d,metadata:v,i18n:x}){const r=x?.t??(a=>a),_=o.mode??s.mode??"basic",g=o.showAiTip??!0,p=s.currentRank,t=s.nextRank,b=k(s.progressPercent??0,0,100),u=s.rankTree??[],h=s.aiTip,[j,y]=q.useState(new Set);if(!p&&!s.error)return e.jsx(m,{blockType:"rank-advancement-roadmap",children:e.jsx("div",{className:"es-block__body es-rar__body",children:e.jsxs("div",{className:"es-rar__current-card",children:[e.jsx("div",{className:"es-rar__section-label",children:r("rank_roadmap.current_rank")}),e.jsx("div",{className:"es-rar__rank-row",children:e.jsx("span",{className:"es-rar__rank-name",style:{color:"var(--es-color-on-surface-muted, #4B5563)"},children:"—"})}),e.jsxs("div",{className:"es-rar__progress-label",children:[e.jsx("span",{children:v?.dataQuality==="none"?r("rank_roadmap.signin_prompt"):r("rank_roadmap.loading")}),e.jsx("span",{children:"0%"})]}),e.jsx("div",{className:"es-rar__progress-bar",children:e.jsx("div",{className:"es-rar__progress-fill",style:{width:"0%"}})})]})})});if(s.error)return e.jsx(m,{blockType:"rank-advancement-roadmap",error:w(s.error)});function f(a){y(c=>{const n=new Set(c);return n.has(a)?n.delete(a):(n.add(a),d.emit("rar:rankExpanded",{rank:a})),n})}const i=k(b,0,100);return e.jsx(m,{blockType:"rank-advancement-roadmap",children:e.jsxs("div",{className:"es-block__body es-rar__body",children:[e.jsxs("div",{className:"es-rar__current-card",children:[e.jsx("div",{className:"es-rar__section-label",children:r("rank_roadmap.current_rank")}),e.jsxs("div",{className:"es-rar__rank-row",children:[e.jsx("span",{className:"es-rar__rank-name",children:l(p??"",r)}),e.jsxs("span",{className:"es-rar__rank-badge",children:[i,"%"]})]}),e.jsxs("div",{className:"es-rar__progress-label",children:[e.jsx("span",{children:r("rank_roadmap.progress_to",{rank:t?l(t,r):r("rank_roadmap.next_rank_fallback")})}),e.jsxs("span",{children:[i,"%"]})]}),e.jsx("div",{className:"es-rar__progress-bar",children:e.jsx("div",{className:"es-rar__progress-fill",style:{width:`${i}%`},role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r("rank_roadmap.progress_aria",{percent:i,rank:t?l(t,r):r("rank_roadmap.next_rank_fallback")})})}),t&&e.jsx("div",{className:"es-rar__next-rank-hint",children:r("rank_roadmap.next_label",{rank:l(t,r)})})]}),g&&_==="pro"&&e.jsxs("div",{className:`es-rar__ai-tip${h?"":" es-rar__ai-tip--loading"}`,children:[e.jsx("div",{className:"es-rar__ai-tip-label",children:r("rank_roadmap.ai_tip_label")}),e.jsx("div",{className:"es-rar__ai-tip-text",children:h??r("rank_roadmap.analyzing")})]}),_==="pro"&&u.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"es-rar__tree-label",children:r("rank_roadmap.tree_label")}),e.jsx("ul",{className:"es-rar__tree",role:"list",children:u.map(a=>{const c=a.rank===p,n=j.has(a.rank),N=["es-rar__tree-item",a.achieved?"es-rar__tree-item--achieved":"",c?"es-rar__tree-item--current":""].filter(Boolean).join(" ");return e.jsxs("li",{className:N,children:[e.jsxs("button",{className:"es-rar__tree-header",onClick:()=>f(a.rank),"aria-expanded":n,"aria-controls":`rar-reqs-${a.rank}`,children:[e.jsx("span",{className:"es-rar__tree-status-icon","aria-hidden":"true",children:a.achieved?"✓":c?"▶":"○"}),e.jsx("span",{className:"es-rar__tree-rank-name",children:l(a.rank,r)}),e.jsx("span",{className:`es-rar__tree-chevron${n?" es-rar__tree-chevron--open":""}`,"aria-hidden":"true",children:"▾"})]}),n&&e.jsx("ul",{id:`rar-reqs-${a.rank}`,className:"es-rar__tree-requirements",role:"list",children:a.requirements.map((T,P)=>e.jsx("li",{className:"es-rar__tree-req",children:T},P))})]},a.rank)})})]})]})})}export{D as Component,M as manifest};
2
- //# sourceMappingURL=index-NPLN6oCC-VW9D8cgC.js.map
2
+ //# sourceMappingURL=index-FHHrEvNZ-VW9D8cgC.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as i,L as j,j as e,e as m}from"../nexly.js";const E={slug:"auth-register",name:"User Registration",version:"1.0.0",category:"interactive",requiredService:"",configSchema:{properties:{showName:{type:"boolean",default:!0},showEmail:{type:"boolean",default:!0},requireEmail:{type:"boolean",default:!1},showExternalId:{type:"boolean",default:!1},submitLabel:{type:"string",default:""}}},defaultConfig:{showName:!0,showEmail:!0,requireEmail:!1,showExternalId:!1,submitLabel:""},dataContract:{serviceSlug:"chat-bot",inputSchema:{type:"object",properties:{authenticated:{type:"boolean"}}},previewDataOverride:{authenticated:!1}},fields:[{id:"showName",type:"toggle",label:"Show name field",default:!0,group:"Form Fields"},{id:"showEmail",type:"toggle",label:"Show email field",default:!0,group:"Form Fields"},{id:"requireEmail",type:"toggle",label:"Require email",default:!1,group:"Form Fields"},{id:"showExternalId",type:"toggle",label:"Show external ID field",default:!1,group:"Form Fields"},{id:"submitLabel",type:"localized-text",label:"Submit button label",default:"",placeholder:'Leave empty to use translated default (e.g. "Register")',group:"Content"}],events:{emits:[{name:"auth:registered",description:"User successfully completed registration"},{name:"auth:registrationFailed",description:"Registration form submission failed"}],listens:[{name:"auth:reset",description:"Reset the registration form"}]},supportedPlacements:["main"],sizing:{minWidth:280,preferredHeight:"auto",scrollable:!1}};function k({config:o,actions:g,i18n:c}){const r=c?.t??(t=>t),b=c?.currentLanguage??"en",[f,h]=i.useState(""),[n,y]=i.useState(""),[s,p]=i.useState(!1),[a,l]=i.useState(null),v=o.showName??!0,x=o.showEmail??!0,d=o.requireEmail??!1,S=j(o.submitLabel,b,{t:r,fallbackKey:"auth.register.submit",enDefault:"Register"});async function w(t){t.preventDefault(),p(!0),l(null);try{const u=await g.call("register",{name:f||void 0,email:n||void 0});u?.error?l({success:!1,error:u.error}):l({success:!0,apiKey:u?.apiKey})}catch{l({success:!1,error:r("auth.register.error_failed")})}finally{p(!1)}}return a?.success?e.jsx(m,{blockType:"auth-register",children:e.jsxs("div",{className:"es-block__body",style:{padding:24,textAlign:"center"},children:[e.jsx("div",{style:{fontSize:14,color:"var(--es-color-success, #00672B)",marginBottom:8},children:r("auth.register.success")}),a.apiKey&&e.jsxs("div",{style:{fontSize:11,color:"var(--es-color-on-surface-muted, #4B5563)",background:"var(--es-color-surface-elevated, #f5f5f5)",padding:"8px 12px",borderRadius:6,fontFamily:"monospace",wordBreak:"break-all"},children:[r("auth.register.api_key_prompt"),e.jsx("br",{}),e.jsx("span",{style:{color:"var(--es-color-interactive, #2563EB)"},children:a.apiKey})]})]})}):e.jsx(m,{blockType:"auth-register",children:e.jsx("div",{className:"es-block__body",style:{padding:16},children:e.jsxs("form",{onSubmit:w,children:[v&&e.jsxs("div",{style:{marginBottom:12},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--es-color-on-surface-muted, #4B5563)",marginBottom:4},children:r("auth.register.name_label")}),e.jsx("input",{type:"text",value:f,onChange:t=>h(t.target.value),placeholder:r("auth.register.name_placeholder"),style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid var(--es-color-control-border, #6B7280)",background:"var(--es-color-surface-elevated, #f5f5f5)",color:"var(--es-color-on-surface, #1a1a1a)",fontSize:14,outline:"none",boxSizing:"border-box"}})]}),x&&e.jsxs("div",{style:{marginBottom:12},children:[e.jsxs("label",{style:{display:"block",fontSize:12,color:"var(--es-color-on-surface-muted, #4B5563)",marginBottom:4},children:[r("auth.email_label"),d&&" *"]}),e.jsx("input",{type:"email",value:n,onChange:t=>y(t.target.value),placeholder:r("auth.email_placeholder"),required:d,style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid var(--es-color-control-border, #6B7280)",background:"var(--es-color-surface-elevated, #f5f5f5)",color:"var(--es-color-on-surface, #1a1a1a)",fontSize:14,outline:"none",boxSizing:"border-box"}})]}),a?.error&&e.jsx("div",{style:{fontSize:12,color:"var(--es-color-error, #AD2C26)",marginBottom:8},children:a.error}),e.jsx("button",{type:"submit",disabled:s||d&&!n,style:{width:"100%",padding:"10px 16px",borderRadius:6,border:"none",background:s?"var(--es-color-on-surface-muted, #4B5563)":"var(--es-color-primary, #2563EB)",color:"var(--es-color-on-primary, #ffffff)",fontSize:14,fontWeight:600,cursor:s?"wait":"pointer"},children:s?r("auth.register.submitting"):S})]})})})}export{k as Component,E as manifest};
2
- //# sourceMappingURL=index-v9CNsbwM-CavFmRiD.js.map
2
+ //# sourceMappingURL=index-RyI_7m1j-CavFmRiD.js.map
@@ -1,2 +1,2 @@
1
1
  import{j as e,e as l}from"../nexly.js";const m={slug:"demo-services",name:"DEMO — Services",version:"0.1.0",category:"content",configSchema:{properties:{items:{type:"array",items:{type:"object",properties:{title:{type:"string"},description:{type:"string"}},required:["title"]},default:[]}}},defaultConfig:{items:[]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main","sidebar"]};function d(r){return Array.isArray(r)?r.flatMap(i=>{if(typeof i!="object"||i===null)return[];const s=i,c=typeof s.title=="string"?s.title.trim():"";if(!c)return[];const n=typeof s.description=="string"&&s.description.trim().length>0?s.description.trim():void 0;return[{title:c,description:n}]}):[]}function p({data:r,config:i,i18n:s}){const c=s?.t??(t=>t),n=d(r?.items??i?.items);return n.length===0?e.jsx(l,{blockType:"demo-services",children:e.jsx("div",{className:"es-block__body",children:e.jsx("div",{className:"es-block__empty",children:c("demoServices.empty")})})}):e.jsx(l,{blockType:"demo-services",children:e.jsx("div",{className:"es-block__body es-demosvc",children:e.jsx("ul",{className:"es-demosvc__list",children:n.map((t,o)=>e.jsxs("li",{className:"es-demosvc__item",children:[e.jsx("span",{className:"es-demosvc__ordinal","aria-hidden":"true",children:o+1}),e.jsxs("div",{className:"es-demosvc__text",children:[e.jsx("h3",{className:"es-demosvc__title",children:t.title}),t.description&&e.jsx("p",{className:"es-demosvc__desc",children:t.description})]})]},o))})})})}export{p as Component,m as manifest};
2
- //# sourceMappingURL=index-DG6McKPZ-CqZ9_vG_.js.map
2
+ //# sourceMappingURL=index-TJEJpVI7-CqZ9_vG_.js.map