@mavea/mavea 2.2.0 → 2.2.1

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 (105) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/.vite/manifest.json +354 -354
  3. package/dist/assets/{AnnotationLayer-HanjTRYY.js → AnnotationLayer-CzXCVZCu.js} +1 -1
  4. package/dist/assets/{AppCommandPalette-DBiuHUNL.js → AppCommandPalette-D6904cc9.js} +1 -1
  5. package/dist/assets/{CheckLogRail-CfoGgTqv.js → CheckLogRail-CeRhbIwa.js} +1 -1
  6. package/dist/assets/{ConversationVideoStudio-CEi_cgBR.js → ConversationVideoStudio-Cyu-M9Us.js} +1 -1
  7. package/dist/assets/{CourseLessonReader-CaLT_Y6N.js → CourseLessonReader-BvTabDPT.js} +2 -2
  8. package/dist/assets/{CoursesApp-IfWCeml5.js → CoursesApp-B8kZ6pFr.js} +2 -2
  9. package/dist/assets/{DashPresent-T7I-lAng.js → DashPresent-Dr0LLNnz.js} +1 -1
  10. package/dist/assets/{DashboardDetail-BhRSDenD.js → DashboardDetail-B5JZ6fRz.js} +2 -2
  11. package/dist/assets/{DashboardLoopGate-DBVAR7IS.js → DashboardLoopGate-UHcbTCXN.js} +2 -2
  12. package/dist/assets/DashboardLoopRuntime-BZutKupS.js +1 -0
  13. package/dist/assets/{DashboardsApp-C_awJ3hM.js → DashboardsApp-DzVa4Nqd.js} +2 -2
  14. package/dist/assets/{DeepZoomApp-C-66OasV.js → DeepZoomApp-CN8ZKeS4.js} +1 -1
  15. package/dist/assets/{DelegatePanel-DaJTDkYu.js → DelegatePanel-DO7J_rk_.js} +1 -1
  16. package/dist/assets/{DemoGallery-B9F7SUzp.js → DemoGallery-DMQP4JAa.js} +1 -1
  17. package/dist/assets/{DropSelect-IBjV5Ol1.js → DropSelect-BVDNR47E.js} +1 -1
  18. package/dist/assets/{ExportModal-gckBiikq.js → ExportModal-BVsirsNU.js} +1 -1
  19. package/dist/assets/{ExtractionPreview-DDOkCH9u.js → ExtractionPreview-872OE2ZI.js} +1 -1
  20. package/dist/assets/{FeatureUseNotice-BfnZH8Vt.js → FeatureUseNotice-BNDajs0p.js} +1 -1
  21. package/dist/assets/{FlagshipCommandPalette-CYQdl3Zu.js → FlagshipCommandPalette-mKkMVsza.js} +1 -1
  22. package/dist/assets/{FlagshipShowcase-CFMmbeff.js → FlagshipShowcase-CL_KWgKn.js} +1 -1
  23. package/dist/assets/{FlashcardsApp-KJ1bmlbp.js → FlashcardsApp-COYviD1h.js} +1 -1
  24. package/dist/assets/GalleryApp-B5z9rsrO.css +1 -0
  25. package/dist/assets/{GalleryApp-Dh8Nc_So.js → GalleryApp-D96R7Hdy.js} +2 -2
  26. package/dist/assets/{HonestByDesign-C3LTj4Bx.js → HonestByDesign-DOg91fEf.js} +1 -1
  27. package/dist/assets/{HowItWorks-C5Dqqvl-.js → HowItWorks-D4lHSwEb.js} +1 -1
  28. package/dist/assets/{LegalApp-DYVJIUyF.js → LegalApp-BSPhYvKz.js} +1 -1
  29. package/dist/assets/{LegalMarkdownDocument-CbuQ-pLN.js → LegalMarkdownDocument-DDUOgn72.js} +1 -1
  30. package/dist/assets/{LegalPageShell-CoEyiZGz.js → LegalPageShell-DSbe8dTr.js} +1 -1
  31. package/dist/assets/{LibraryOverlay-TQnxY9R8.js → LibraryOverlay-CEhVoSyv.js} +1 -1
  32. package/dist/assets/{LiveApp-DRnphsFA.js → LiveApp-DtpM4tO0.js} +4 -4
  33. package/dist/assets/{LiveSettings-Cz3XSqv8.js → LiveSettings-C7luyoWU.js} +1 -1
  34. package/dist/assets/{MindMapViewerDrawer-AUJlLC2R.js → MindMapViewerDrawer-DxcjLJzB.js} +1 -1
  35. package/dist/assets/{MindShape-BbuVOTaR.js → MindShape-DhEmAQeq.js} +1 -1
  36. package/dist/assets/{PinToDashboard-BdXI7oo9.js → PinToDashboard-CQHDENt1.js} +1 -1
  37. package/dist/assets/{PlanReview-CGRvSRAt.js → PlanReview-f7EY7XTc.js} +1 -1
  38. package/dist/assets/{PresentationDeck-CoPmOr2f.js → PresentationDeck-Bo1BVx73.js} +1 -1
  39. package/dist/assets/{PrismApp-DPECS285.js → PrismApp-CBr8XpUt.js} +2 -2
  40. package/dist/assets/{PrismBriefingPlayer-BvpG7oZs.js → PrismBriefingPlayer-qNjVbmUq.js} +2 -2
  41. package/dist/assets/{PrismOverlay-c8rcvt4V.js → PrismOverlay-L_lLIH_1.js} +3 -3
  42. package/dist/assets/{PrismWorkbench-BEaD7Arj.js → PrismWorkbench-DK-1IY4A.js} +1 -1
  43. package/dist/assets/{PrivacyApp-_O_MR088.js → PrivacyApp-DT8wZumn.js} +1 -1
  44. package/dist/assets/{ReplayCard-IN-ilb2E.js → ReplayCard-BQr6DWYi.js} +2 -2
  45. package/dist/assets/{ReplayOverlay-ZRjFP-zf.js → ReplayOverlay-CRVixwg2.js} +1 -1
  46. package/dist/assets/{RippleApp-D_Gd8Lw8.js → RippleApp-CMY2OCRm.js} +2 -2
  47. package/dist/assets/{RippleOverlay-vP2KxTiI.js → RippleOverlay-Dwi8Ir43.js} +2 -2
  48. package/dist/assets/{SeeDontRead-BmUyUai5.js → SeeDontRead-BkeAv1Jd.js} +1 -1
  49. package/dist/assets/{ShareModal-_KYCohqO.js → ShareModal-DVwc57KT.js} +2 -2
  50. package/dist/assets/{ShipCourse--ajDej06.js → ShipCourse-BNEPgsV5.js} +1 -1
  51. package/dist/assets/{SignatureLoop-DDw2gtQ_.js → SignatureLoop-C9GvENvP.js} +1 -1
  52. package/dist/assets/{SynthesisApp-CilzogOF.js → SynthesisApp-BPAT6v7a.js} +2 -2
  53. package/dist/assets/{SynthesisOverlay-CAK5h0hB.js → SynthesisOverlay-u_W105hD.js} +1 -1
  54. package/dist/assets/{TemplatePicker-3w18ViSc.js → TemplatePicker-CAC4ggbJ.js} +1 -1
  55. package/dist/assets/{TermsApp-BfTGOTq6.js → TermsApp-BlyUsTrJ.js} +1 -1
  56. package/dist/assets/{TopicCanvas-DSCNWNjv.js → TopicCanvas-CyBGLgb0.js} +2 -2
  57. package/dist/assets/{TourPrism-Y47m-KGq.js → TourPrism-Cn2YHIwh.js} +1 -1
  58. package/dist/assets/{TrackerTile-LXFQXcvH.js → TrackerTile-Ds3ks6Bh.js} +2 -2
  59. package/dist/assets/{TwoSurfaces-CSpKrgfJ.js → TwoSurfaces-cdP8bAG9.js} +1 -1
  60. package/dist/assets/{WorldOverlay-D5FWgYe3.js → WorldOverlay-DPkQobVE.js} +1 -1
  61. package/dist/assets/{WowFeatures-e6mkftpD.js → WowFeatures-BBtcWAOz.js} +1 -1
  62. package/dist/assets/{ZoomDeck-CC9zXPxF.js → ZoomDeck-Cdvkvo2H.js} +1 -1
  63. package/dist/assets/{audioTrack-w1tZwSoU.js → audioTrack-W_18XwGZ.js} +1 -1
  64. package/dist/assets/canvas-BX595EVB.js +1 -0
  65. package/dist/assets/{capture-Bomj_Egy.js → capture-Dyff_zSz.js} +1 -1
  66. package/dist/assets/{confirmAdd-CUFiPNWz.js → confirmAdd-D_hDIeaD.js} +1 -1
  67. package/dist/assets/{dashboardEvents-PktCbV72.js → dashboardEvents-BV0Ly6No.js} +1 -1
  68. package/dist/assets/{deepen-Dz4yTyJs.js → deepen-D8kPrlU5.js} +1 -1
  69. package/dist/assets/docs-6X4Ki_cV.js +1 -0
  70. package/dist/assets/{effort-BKGxLYoq.js → effort-QeWrMtZt.js} +1 -1
  71. package/dist/assets/{generateBeats-BjWC2fwl.js → generateBeats-Da9RmZke.js} +1 -1
  72. package/dist/assets/{generateLive-BLajGcNK.js → generateLive-CDIkclO4.js} +1 -1
  73. package/dist/assets/{index-CKRjGbeR.js → index-BMeoXWPR.js} +3 -3
  74. package/dist/assets/{kokoro-B-rc224u.js → kokoro-DcP-u0Tl.js} +1 -1
  75. package/dist/assets/{loader-BiYFMeRS.js → loader-BRfSnl9t.js} +2 -2
  76. package/dist/assets/{notes-nfocTnUv.js → notes-BDCTTA87.js} +1 -1
  77. package/dist/assets/{perfProbe-BqMK4N56.js → perfProbe-ssw0AtWX.js} +1 -1
  78. package/dist/assets/{pin-IyE46GaQ.js → pin-Bic4-gim.js} +1 -1
  79. package/dist/assets/{portal-C2b5NoMN.js → portal-Dpb34d3-.js} +1 -1
  80. package/dist/assets/{prewarm-Pvdu5Jt0.js → prewarm-xdXDmF8B.js} +1 -1
  81. package/dist/assets/{quietHours-lWcjQ2Iu.js → quietHours-uFS7n8N6.js} +1 -1
  82. package/dist/assets/{registry-BD1Zyd46.js → registry-BV02ROnH.js} +1 -1
  83. package/dist/assets/{registry-OUL5YJry.js → registry-BWx2f_wi.js} +1 -1
  84. package/dist/assets/{registry-BJFqryP_.js → registry-Bs5HUWIJ.js} +1 -1
  85. package/dist/assets/registry-CdPShFc3.js +1 -0
  86. package/dist/assets/{registry-BiT0eNZb.js → registry-DNIasVGX.js} +1 -1
  87. package/dist/assets/{registry-BTUHr4mQ.js → registry-DueizAoA.js} +1 -1
  88. package/dist/assets/{registry-CnmuVlAA.js → registry-PAcazQzL.js} +1 -1
  89. package/dist/assets/{relate-ZHm-ZvaR.js → relate-BHJl3RaA.js} +1 -1
  90. package/dist/assets/{replay-DBeCo_vn.js → replay-DoRQJHjZ.js} +1 -1
  91. package/dist/assets/{select-CejTsgpx.js → select-StjZ4ZRN.js} +1 -1
  92. package/dist/assets/shard010-Bal9PeRL.js +1 -0
  93. package/dist/assets/shard049-C4_IyApZ.js +1 -0
  94. package/dist/assets/{useDashboardLoop-SPlr1Mrm.js → useDashboardLoop-DEE_sLT0.js} +1 -1
  95. package/dist/assets/{walkSync-BtO3jsqQ.js → walkSync-CRhkAQFu.js} +1 -1
  96. package/dist/demo-assets/CREDITS.md +36 -0
  97. package/dist/index.html +1 -1
  98. package/package.json +1 -1
  99. package/dist/assets/DashboardLoopRuntime-B55z8L4b.js +0 -1
  100. package/dist/assets/GalleryApp-B4KBdNyu.css +0 -1
  101. package/dist/assets/canvas-BRGFkCD-.js +0 -1
  102. package/dist/assets/docs-B2aDtm5K.js +0 -1
  103. package/dist/assets/registry-BmjYillB.js +0 -1
  104. package/dist/assets/shard010-CQfR6lnk.js +0 -1
  105. package/dist/assets/shard049-hPaNN2sL.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-kNHRtoqd.js","assets/rolldown-runtime-DkW27tQK.js","assets/preload-helper-CiWYd9n-.js","assets/generateLive-BLajGcNK.js","assets/blockLabel-FogyzEQY.js","assets/deepenStore-BWLLzLCY.js","assets/catalog-BHjl-1uH.js","assets/http-Bqk6nJiH.js","assets/history-D2EH2X6D.js","assets/number-zqlPMliA.js","assets/catalog-vLsIS_Na.js","assets/facts-CNQz8OQz.js","assets/blockTypes-DUDdP3pB.js","assets/streamParse-BX0bAppQ.js","assets/liveSchema-eKgFc5D0.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/safeImageUrl-BINWXOTz.js","assets/empty-D51uhW0E.js","assets/sourceHost-BV3t2XDb.js","assets/spokenText-Dy-GZvZV.js","assets/annotations-CftUUB13.js","assets/contentVault-XKWjF2FB.js","assets/keyVault-Aw5Y2PjT.js","assets/screen-DFWKge3-.js","assets/attachments-BW-vki-E.js","assets/providers-CPhoN8j0.js","assets/info-CiqHR5cs.js","assets/route-CMdTFx0P.js","assets/effort-BKGxLYoq.js","assets/index-CKRjGbeR.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/speed-BOytg6bC.js","assets/cache-7UEbF3S6.js","assets/validate-MQG0EcTD.js","assets/types-C42I77wh.js","assets/json-J4Y32_i9.js","assets/verbatim-DBTj9sPD.js","assets/citation-BsSvaaer.js","assets/receipts-D7zveV-I.js","assets/officeDoc-GU6Cssjf.js","assets/csv-DAqzYXUs.js","assets/search-ZN7v_P5B.js","assets/store-DqOaVRLn.js","assets/ready-_sg3IJkE.js","assets/shapes-BwXCYTlu.js","assets/ledger-BssK9Pv2.js","assets/now-C9-UAzTC.js","assets/select-CejTsgpx.js","assets/offers-eBNj_lSP.js","assets/scale-Bcgfo6Hp.js","assets/spreadLabels-CQ8hufvK.js","assets/TopicCanvas-DSCNWNjv.js","assets/loader-BiYFMeRS.js","assets/FallbackCard-CUe6i-zT.js","assets/FallbackCard-D_6ps1xA.css","assets/useFocusTrap-CJmpNZv2.js","assets/motion-BY_Egaxm.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/CanvasSkeleton-BmGjJHUQ.js","assets/CanvasSkeleton-DYASkTjW.css","assets/richText-BkxJhl9N.js","assets/toast-BBNs2h3L.js","assets/format-q0LwBjID.js","assets/useValidatedImage-BQi2c66o.js","assets/lib-Dkb5WBRc.js","assets/BlockEmpty-B-giiUPy.js","assets/motion-DxHSlPN6.js","assets/lib-DP9Kuxqk.css","assets/TopicCanvas-sGuo7pnQ.css","assets/HowItWorks-C5Dqqvl-.js","assets/generateBeats-BjWC2fwl.js","assets/walkSync-BtO3jsqQ.js","assets/kokoro-B-rc224u.js","assets/nextFrame-12y0UrAd.js","assets/canvas-BRGFkCD-.js","assets/CommandPalette-Cz8h94Jd.js","assets/registry-BodYWiga.js","assets/CommandPalette-Bb-eErih.css","assets/Library-CDgWdTiF.js","assets/sentenceCase-CLDiNB0f.js","assets/store-C9s8Bfz0.js","assets/localBudget-CxLP6bjE.js","assets/neighborhoods-B56WegJs.js","assets/chapters-DcdG3Lu8.js","assets/threads-DNfxMTwx.js","assets/time-BHTmJR1s.js","assets/Library-DmrtHjUf.css","assets/LiveSettings-Cz3XSqv8.js","assets/FeatureUseNotice-BfnZH8Vt.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/useLiveConfig-CvOQTr0s.js","assets/quietHours-lWcjQ2Iu.js","assets/DropSelect-IBjV5Ol1.js","assets/DropSelect-B4lqCEjw.css","assets/TemplatePicker-3w18ViSc.js","assets/store-D2IJF4SA.js","assets/useStudy-70Iz4ZVn.js","assets/queue-Adae4IzW.js","assets/LiveSettings-Dho0OxlM.css","assets/DashboardDetail-BhRSDenD.js","assets/store-D16dGt7I.js","assets/route-D4kd-D3B.js","assets/useDashboards-B-EjE8FH.js","assets/format-BkvssSOr.js","assets/ledger-DHS2di3l.js","assets/dataPending-DGdCvY5Y.js","assets/AreaChart-DZGCSEwt.js","assets/tiles-D-s6v-mA.js","assets/tiles-CBiVVjtT.css","assets/useDashboardLoop-SPlr1Mrm.js","assets/predictions-CkVKHq-5.js","assets/notify-Bz4wuE4T.js","assets/dashboardEvents-PktCbV72.js","assets/confirmAdd-CUFiPNWz.js","assets/planTracker-BA-x4jbw.js","assets/pin-IyE46GaQ.js","assets/pin-BXyyKnci.css","assets/CadenceCard-j1V7XOxX.js","assets/CheckLogRail-CfoGgTqv.js","assets/useLedger-D4cXEwI0.js","assets/checkLogModel-BMtruriG.js","assets/CheckLogRail-BOaXnqWK.css","assets/DashboardDetail-8J8TsdQg.css","assets/dashboards-Cvs28p3Z.css","assets/DashboardSettings-5tn-dw6G.js","assets/UnderstoodPanel-DmJph4el.js","assets/UnderstoodPanel-Q6GX1TFq.css","assets/ZoomDeck-CC9zXPxF.js","assets/portal-C2b5NoMN.js","assets/useZoomGesture-CN0p0lHL.js","assets/ZoomDeck-DdLNsrHV.css","assets/AtlasView-CYZ9sfXb.js","assets/store-CgA7mKy1.js","assets/AtlasView-B7yObdf8.css","assets/RippleOverlay-vP2KxTiI.js","assets/buildShip-BgFg98tH.js","assets/parseDiff-D8uBQ9mQ.js","assets/incident-D3bmMmES.js","assets/githubToken-Bwa7V9YT.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/RippleOverlay-B3hg2KMN.css","assets/CardEditor-D4slxmIM.js","assets/CardEditor-CiAfT78z.css","assets/CourseRail-DD8gtAn4.js","assets/store-B2Rpbqgg.js","assets/generateCourse-DPL0bO3L.js","assets/useSrsCards-C27o39fF.js","assets/deckLine-NBd3MyGT.js","assets/CourseRail-BDQIWara.css","assets/MindMapViewerDrawer-AUJlLC2R.js","assets/MindShape-BbuVOTaR.js","assets/Presence-UqXfH4Y-.js","assets/geometry-DXAbnb0J.js","assets/MindShape-CozR9W8M.css","assets/Recap-BOl3SUh0.js","assets/Recap-D3NlzM1p.css","assets/LibraryOverlay-TQnxY9R8.js","assets/LibraryOverlay-BkPYm0Bs.css","assets/ReplayOverlay-ZRjFP-zf.js","assets/replay-DBeCo_vn.js","assets/AnnotationLayer-HanjTRYY.js","assets/gesture-BBS5nQEi.js","assets/emphasize-BqCIst-B.js","assets/AnnotationLayer-BRYhJ1LB.css","assets/ReplayOverlay-DzkcTnCA.css","assets/ShareModal-_KYCohqO.js","assets/capture-Bomj_Egy.js","assets/share--tpc1nLE.js","assets/registry-Cz5cZREW.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/ReelJelly-D5e-jt-8.js","assets/ShareModal-I_sxHKLv.css","assets/ExportModal-gckBiikq.js","assets/notes-nfocTnUv.js","assets/registry-CvtHBjkb.js","assets/registry-types-D3q_LrlV.js","assets/fitText-DHbmSS-q.js","assets/registry-CNgybLQv.css","assets/registry-BD1Zyd46.js","assets/openWorld-B4VY6xO7.js","assets/display-CAb_PiGv.js","assets/registry-DhWVSz_J.css","assets/registry-uiAoJKXu.js","assets/registry-2GJZ46M8.css","assets/registry-DOctfuxc.js","assets/registry-brX673Dg.css","assets/registry-BQuygaKz.js","assets/axis-DHAV38YM.js","assets/registry-B1KQ1VPZ.css","assets/registry-GxnzELw0.js","assets/registry-CuVk7MAI.css","assets/registry-C3bIc5Kp.js","assets/CodeOutput-DF892aIR.js","assets/useTimeout-Cm4yzted.js","assets/registry-BzNLfje1.css","assets/registry-CbKXa68-.js","assets/registry-B3HqLZyO.css","assets/registry-JRteQJcE.js","assets/registry-UFIuwh3i.css","assets/registry-nCDSZOmZ.js","assets/registry-CGB0jkFI.css","assets/registry-BmjYillB.js","assets/registry-CRisz4Ca.css","assets/registry-BiT0eNZb.js","assets/useInterval-DDgFrel2.js","assets/registry-CmWPyj7Q.css","assets/registry-C4RNoF_2.js","assets/useSpotlightWalk-DxlxBezO.js","assets/registry-BZsqAOnQ.css","assets/registry-OUL5YJry.js","assets/registry-T3i2Q9SI.css","assets/registry-BoLdoGPW.js","assets/registry-DjvftnY2.css","assets/registry-BJFqryP_.js","assets/quizResult-DB8yeqDr.js","assets/stepDriver-DwjFet6U.js","assets/registry-D5O0Ptw_.css","assets/registry-Cdk7NOiD.js","assets/safeCssColor-di93BXgG.js","assets/registry-CnNL4jmR.css","assets/registry-DO4hGO5e.js","assets/registry-CRM7y8QT.css","assets/registry-CnmuVlAA.js","assets/registry-g2sBcIrf.css","assets/registry-CLHP_r7X.js","assets/registry-CyPRooIp.css","assets/registry-BTUHr4mQ.js","assets/registry-yzYj0SNk.css","assets/registry-Diyud3DF.js","assets/registry-DpMI23iE.css","assets/registry-CT85vG1M.js","assets/registry-sT9NoG1k.css","assets/registry-MwJlqlFZ.js","assets/registry-BgWzEkxc.css","assets/registry-DLyrLfe-.js","assets/notes-A9t4jdfx.css","assets/ready-Ba6nk9O1.js","assets/ExportModal-sX8MPVPW.css","assets/ExtractionPreview-DDOkCH9u.js","assets/store-gfPI5TVE.js","assets/relate-ZHm-ZvaR.js","assets/PinToDashboard-BdXI7oo9.js","assets/PrismOverlay-c8rcvt4V.js","assets/penStrokes-CTC3AYiz.js","assets/types-CaO6xOn5.js","assets/pen-UKrUHlDA.js","assets/PrismOverlay-5ZVXu4WL.css","assets/WorldOverlay-D5FWgYe3.js","assets/value-Dx7DZob4.js","assets/types-DuEbJpIA.js","assets/engine-BiM6INsW.js","assets/engine-CTvOaA86.css","assets/WorldOverlay-CLWtwuSl.css","assets/SynthesisOverlay-CAK5h0hB.js","assets/PresentationDeck-CoPmOr2f.js","assets/DelegatePanel-DaJTDkYu.js","assets/DelegatePanel-D17XvWYd.css","assets/SrsReview-Gr6Y0QTQ.js","assets/SrsReview-DmBcJCMa.css","assets/TourPrism-Y47m-KGq.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{t as r}from"./jsx-runtime-DeHZSEgm.js";import{n as i,t as a}from"./preload-helper-CiWYd9n-.js";import{r as o,t as s}from"./preloadableLazy-MIX1ApBW.js";import{$ as c,A as l,B as u,D as d,E as f,G as p,H as m,J as h,K as g,L as _,M as v,O as y,Q as b,R as x,S,U as C,V as w,W as T,X as E,Y as D,Z as O,a as k,at as A,et as j,j as M,k as N,lt as P,q as F,r as I,rt as L,t as R,z}from"./index-CKRjGbeR.js";import{n as B}from"./icons-gLFQTv74.js";import{a as ee,i as te,n as ne}from"./loader-BiYFMeRS.js";import{n as re,r as ie}from"./blockLabel-FogyzEQY.js";import{t as ae}from"./useFocusTrap-CJmpNZv2.js";import{t as oe}from"./motion-BY_Egaxm.js";import{r as se,s as ce,t as V}from"./CanvasSkeleton-BmGjJHUQ.js";import{a as le,i as ue}from"./empty-D51uhW0E.js";import{t as de}from"./Presence-UqXfH4Y-.js";import{t as fe}from"./MindShape-BbuVOTaR.js";import{r as pe}from"./openWorld-B4VY6xO7.js";import{i as me,r as he,t as ge}from"./display-CAb_PiGv.js";import{t as _e}from"./sentenceCase-CLDiNB0f.js";import{r as H,t as ve}from"./sourceHost-BV3t2XDb.js";import{t as ye}from"./stepDriver-DwjFet6U.js";import{n as be,t as xe}from"./spokenText-Dy-GZvZV.js";import{A as Se,C as Ce,D as we,E as Te,O as Ee,T as De,_ as Oe,b as ke,c as Ae,d as je,h as Me,j as Ne,l as Pe,o as Fe,r as Ie,u as Le,v as Re,w as ze,y as Be}from"./kokoro-B-rc224u.js";import{t as Ve}from"./portal-C2b5NoMN.js";import{a as U,i as He,o as Ue,r as We,s as Ge}from"./threads-DNfxMTwx.js";import{t as Ke}from"./FeatureUseNotice-BfnZH8Vt.js";import{n as qe,r as Je}from"./history-D2EH2X6D.js";import{n as Ye}from"./nextFrame-12y0UrAd.js";import{a as Xe,c as Ze,d as Qe,f as $e,i as et,n as tt,o as nt,r as rt,s as it,t as at,u as ot}from"./walkSync-BtO3jsqQ.js";import{n as st,t as ct}from"./generateBeats-BjWC2fwl.js";import{n as lt,r as ut,t as dt}from"./AnnotationLayer-HanjTRYY.js";import{n as ft,t as pt}from"./number-zqlPMliA.js";import{n as mt}from"./emphasize-BqCIst-B.js";import{n as ht,o as gt}from"./streamParse-BX0bAppQ.js";import{n as _t,t as vt}from"./registry-DLyrLfe-.js";import{t as yt}from"./ready-Ba6nk9O1.js";import{t as bt}from"./registry-BodYWiga.js";import{i as xt,r as St}from"./info-CiqHR5cs.js";import{r as Ct}from"./contentVault-XKWjF2FB.js";import{a as wt,c as Tt,i as Et,n as Dt,r as Ot,s as kt}from"./store-gfPI5TVE.js";import{a as At,o as jt,r as Mt}from"./store-C9s8Bfz0.js";import{n as Nt,r as Pt}from"./chapters-DcdG3Lu8.js";/* empty css */import{g as Ft,h as It,l as Lt,m as Rt,p as zt,s as Bt,t as Vt,v as Ht}from"./attachments-BW-vki-E.js";import{t as Ut}from"./types-CaO6xOn5.js";import{J as Wt,Z as Gt,a as Kt,c as qt,m as Jt,q as Yt,u as Xt}from"./store-D16dGt7I.js";import{t as Zt}from"./providers-CPhoN8j0.js";import{a as Qt,c as $t,d as en,l as tn,n as nn,o as rn,r as an,s as on,u as sn}from"./useLiveConfig-CvOQTr0s.js";import{prewarmLive as cn}from"./prewarm-Pvdu5Jt0.js";import{c as ln,f as un,g as dn,m as fn,p as pn,r as mn,s as hn,u as gn}from"./effort-BKGxLYoq.js";import{t as _n}from"./TopbarMenu-DQXxqSWY.js";import{a as vn,c as yn,d as bn,f as xn,i as Sn,l as Cn,m as wn,o as Tn,p as En,s as Dn,t as On}from"./quietHours-lWcjQ2Iu.js";import{a as kn,c as An,d as jn,i as Mn,n as Nn,t as Pn,u as Fn}from"./store-DqOaVRLn.js";import{r as In}from"./speed-BOytg6bC.js";import{i as Ln,n as Rn,r as zn,t as Bn}from"./cache-7UEbF3S6.js";import{r as Vn}from"./verbatim-DBTj9sPD.js";import{n as Hn}from"./citation-BsSvaaer.js";import{n as Un,o as Wn,t as Gn}from"./validate-MQG0EcTD.js";import{n as Kn}from"./TemplatePicker-3w18ViSc.js";import{t as qn}from"./ready-_sg3IJkE.js";import{t as Jn}from"./DropSelect-IBjV5Ol1.js";import{t as Yn}from"./route-D4kd-D3B.js";import{t as Xn}from"./useDashboards-B-EjE8FH.js";import{n as Zn,r as Qn}from"./value-Dx7DZob4.js";import{i as $n,n as er}from"./shapes-BwXCYTlu.js";import{a as tr,d as nr,g as rr,l as ir,n as ar,p as or,r as sr}from"./store-D2IJF4SA.js";import{a as cr,i as lr,r as ur}from"./useStudy-70Iz4ZVn.js";import{t as dr}from"./useZoomGesture-CN0p0lHL.js";import{a as fr,o as pr,t as mr}from"./store-CgA7mKy1.js";import{SEED_SHIP as hr}from"./seed-b1xc0dj2.js";import{t as gr}from"./buildShip-BgFg98tH.js";import{n as _r}from"./parseDiff-D8uBQ9mQ.js";import{enrichShipModel as vr}from"./generate-BZobrQPX.js";import{a as yr,c as br,g as xr,h as Sr,l as Cr,o as wr,p as Tr,r as Er,t as Dr}from"./store-B2Rpbqgg.js";import{r as Or}from"./courseSeed-CZdNBTTs.js";import{i as kr,n as Ar,r as jr,t as Mr}from"./mastery-DB5qpRAy.js";var W=t(),Nr=P(),Pr=/\?\s*$|^\s*(what|why|how|when|where|who|which|can|could|should|would|is|are|do|does|tell me|show me|explain)\b/i;function Fr(e){return Pr.test(e.trim())}function Ir(e,t){let n=e.key,r=t.trim();if(!r)return null;switch(e.kind){case`number`:{let t=r.replace(/,/g,``).match(/-?\d+(\.\d+)?/);if(!t)return null;let i=Number(t[0]);return Number.isFinite(i)?{kind:`number`,key:n,value:i,...e.unit?{unit:e.unit}:{}}:null}case`choice`:{let t=e.options?.find(e=>r.toLowerCase().includes(e.toLowerCase()));return t?{kind:`choice`,key:n,value:t}:null}case`card`:return null;case`date`:return{kind:`date`,key:n,value:r};default:return{kind:`text`,key:n,value:r}}}function Lr(e,t){if(e.phase!==`awaiting_input`||!e.activeKey)return!1;let n=e.blanks.find(t=>t.key===e.activeKey);if(!n)return!1;let r=Ir(n,t),i=Fr(t);return r&&!i?(e.fill(r),!0):!r&&!i}function Rr(e){return e.alwaysOn&&e.sttOk&&!e.composerHasText}function zr(e,t){let n=(0,W.useRef)({...e,...t});n.current={...e,...t};let r=e.listening||Rr(e);(0,W.useEffect)(()=>{if(!r)return;let e=()=>{document.hidden?n.current.listening&&n.current.stop():Rr(n.current)&&!n.current.listening&&n.current.start()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[r])}var G=r(),Br=200;function Vr(e){let t=e.trim().split(/\s+/).filter(Boolean).length;return Math.min(8e3,700+t*360)}function Hr(e,t){let n=(0,W.useRef)(e);n.current=e;let[r,i]=(0,W.useState)(null),a=(0,W.useRef)(null),o=(0,W.useCallback)(e=>{a.current=e,i(e)},[]),s=(0,W.useRef)(void 0),c=(0,W.useRef)(void 0),l=(0,W.useCallback)(()=>{s.current!==void 0&&clearTimeout(s.current),c.current!==void 0&&clearTimeout(c.current),s.current=void 0,c.current=void 0},[]),u=(0,W.useCallback)(e=>{let t=n.current,r=e.id??null;if(t.takeWheel(),t.moveSpot(e),r&&r===a.current){t.hush(),l(),o(null);return}t.hush(),l();let i=r?t.lineFor(e):null;if(!i||!t.canSpeak()){o(null);return}o(r),s.current=setTimeout(()=>{s.current=void 0,n.current.speakLine(i),c.current=setTimeout(()=>{c.current=void 0,a.current===r&&o(null)},Vr(i))},Br)},[l,o]);return(0,W.useEffect)(()=>()=>{l(),o(null)},[t,l,o]),{narrate:u,narratingId:r}}var Ur=`mavea-view-mode`,Wr=Ur,Gr=`everything`,Kr=new Set([`canvas`,`world`]);function qr(e){return e===`focus`||e===`everything`||e===`canvas`||e===`world`}var Jr=null;function Yr(){try{if(typeof localStorage>`u`)return Gr;let e=localStorage.getItem(Ur);return qr(e)&&!Kr.has(e)?e:Gr}catch{return Gr}}function Xr(){return Yr()}function Zr(){return Jr||(Jr=Yr(),Jr)}function Qr(e){if(qr(e)){Jr=e;try{typeof localStorage<`u`&&!Kr.has(e)&&localStorage.setItem(Ur,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(Wr))}catch{}}}function $r(){let[e,t]=(0,W.useState)(()=>Zr());return(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(Zr());return window.addEventListener(Wr,e),()=>window.removeEventListener(Wr,e)},[]),[e,(0,W.useCallback)(Qr,[])]}function ei({value:e,onChange:t,onSend:n,listening:r,onMic:i,micMode:a=`tap`,micArmed:o=!1,micPaused:s=!1,micProcessing:c=!1,micDisabled:l=!1,placeholder:u,disabled:d,heard:f,focusSignal:p,onFiles:m,attachTitle:h,attachPulse:g,onMicDown:_,onForceStop:v,onMicCancel:y,tools:b,micExtra:x}){let S=(0,W.useRef)(null),C=(0,W.useRef)(null),[w,T]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!g)return;T(!0);let e=setTimeout(()=>T(!1),1100);return()=>clearTimeout(e)},[g]);let E=(0,W.useRef)(!1),D=(0,W.useRef)(null),O=(0,W.useRef)(!1),k=(0,W.useRef)(y);k.current=y,(0,W.useEffect)(()=>()=>{E.current&&k.current?.()},[]),(0,W.useEffect)(()=>{a!==`hold`&&(O.current=!1,E.current&&(E.current=!1,D.current=null,k.current?.()))},[a]),(0,W.useEffect)(()=>{!r&&S.current&&S.current.focus()},[r]),(0,W.useEffect)(()=>{p&&S.current&&S.current.focus()},[p]);let A=(0,W.useCallback)(e=>{a!==`hold`||l||c||r||E.current||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),E.current=!0,D.current=e.pointerId,O.current=!0,_?.())},[l,c,r,a,_]),j=(0,W.useCallback)(()=>{E.current&&(E.current=!1,D.current=null,v?.())},[v]),M=(0,W.useCallback)(e=>{D.current===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),j())},[j]),N=(0,W.useCallback)(e=>{E.current&&(e&&D.current===e.pointerId&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),E.current=!1,D.current=null,y?.())},[y]),P=(0,W.useCallback)(e=>{a!==`hold`||l||c||r||E.current||e.repeat||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),E.current=!0,O.current=!0,_?.())},[r,l,a,c,_]),F=(0,W.useCallback)(e=>{a!==`hold`||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),j())},[j,a]),I=(0,W.useCallback)(()=>{if(a===`hold`||O.current){O.current=!1;return}l||c&&a!==`always`||i()},[i,l,a,c]),L=l?`Microphone off`:c&&a!==`always`?`Finishing voice input`:r?`Finish and send`:s?`Resume always-on`:o?`Pause always-on`:a===`hold`?`Hold to talk`:`Talk to Mavéa`,R=(0,G.jsx)(`button`,{className:`mic-btn`+(r?` listening`:``)+(o?` armed`:``)+(s?` paused`:``)+(c?` processing`:``)+(l?` mic-off`:``),onClick:I,onPointerDown:A,onPointerUp:M,onPointerCancel:N,onKeyDown:P,onKeyUp:F,title:L,"aria-label":L,"aria-busy":c,children:l?(0,G.jsx)(B.micOff,{}):(0,G.jsx)(B.mic,{})});return(0,G.jsxs)(`div`,{className:`composer`,children:[x?(0,G.jsxs)(`div`,{className:`mic-btn-wrap`,children:[R,x]}):R,f&&!e?(0,G.jsx)(`div`,{className:`live-listen heard`,children:(0,G.jsxs)(`span`,{style:{color:`var(--text-primary)`},children:[`"`,f,`"`]})}):r&&!e?(0,G.jsxs)(`div`,{className:`live-listen`,children:[(0,G.jsx)(`span`,{className:`wave`,children:[14,18,10,20,8,16,12].map((e,t)=>(0,G.jsx)(`i`,{style:{height:e}},t))}),`Listening…`]}):(0,G.jsx)(`input`,{ref:S,className:`composer-input`,name:`mavea-ask`,"aria-label":u||`Ask Mavéa anything`,autoComplete:`off`,value:e,disabled:d,placeholder:u||`Ask Mavéa anything — or just talk`,onChange:e=>t(e.target.value),onKeyDown:t=>{t.nativeEvent.isComposing||t.key===`Enter`&&e.trim()&&n(e)}}),m&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`input`,{ref:C,type:`file`,name:`mavea-attach`,accept:Vt,multiple:!0,disabled:d,hidden:!0,"aria-hidden":`true`,onChange:e=>{let t=Array.from(e.target.files??[]);t.length&&m(t),e.target.value=``}}),(0,G.jsx)(`button`,{type:`button`,className:`composer-tool`+(w?` is-pulsing`:``),title:h||`Attach a file`,"aria-label":h||`Attach a file`,disabled:d,onClick:()=>C.current?.click(),children:(0,G.jsx)(B.paperclip,{})})]}),b,(0,G.jsx)(`button`,{className:`send-btn`,disabled:d||!e.trim(),onClick:()=>n(e),title:`Send`,"aria-label":`Send`,children:(0,G.jsx)(B.send,{})})]})}i();var ti=null;async function K(){return ti||(ti=(await a(()=>import(`./corpus.generated-oX9uU93S.js`),[])).default,ti)}function ni(e){return ti?.conversations.find(t=>t.id===e)}function ri(e){return e.replace(/\b([\p{L}]+)-ish\b/gu,`roughly $1`).replace(/\s*[—–]\s*/g,`, `).replace(/(\p{L})-(?=\p{L})/gu,`$1 `).replace(/\s+-\s+/g,`, `).replace(/,\s*,+/g,`, `).replace(/\s{2,}/g,` `).trim()}function q(e){return{...e,question:ri(e.question),narration:ri(e.narration),spoken:e.spoken?ri(e.spoken):e.spoken,tour:e.tour.map(e=>({...e,say:e.say?ri(e.say):e.say,saySpoken:e.saySpoken?ri(e.saySpoken):e.saySpoken}))}}var ii=[{id:`talk`,title:`Speak naturally`,mode:`voice`,coach:`Start by speaking naturally or typing. I will understand either and respond out loud.`,spotlight:`.mic-btn`,action:{kind:`mic`},durationMs:6e3},{id:`connect`,title:`Bring your own model`,mode:`explain`,coach:`Choose Gemini, Claude, GPT, Grok, or OpenRouter, then paste your own API key. Start with a fast, lower cost model and move up only when a task needs it. The key stays in memory unless you choose Remember. Requests pass through this deployment, and your provider's usage charges, privacy, and retention terms apply.`,spotlight:`.settings-model-connect`,action:{kind:`connect`},durationMs:12e3},{id:`draws`,title:`See the answer`,mode:`explain`,coach:`Ask anything. I build a visual answer while I explain the important parts. Use the voice toggle labeled Mavéa's voice to turn speech off and reveal everything immediately. Your microphone stays unchanged.`,spotlight:`.voice-switch`,action:{kind:`answer`,convoId:`money`,ask:`How does $10,000 grow at 7% over 30 years?`},durationMs:9e3},{id:`mark`,title:`Follow the explanation`,mode:`explain`,coach:`Watch the Pen circle the result, then underline why it matters. Its marks stay with the answer.`,spotlight:`.pen-toggle-pill`,action:{kind:`penDemo`},durationMs:1e4,needsCanvas:!0},{id:`ask`,title:`Ask across the answer`,mode:`explain`,coach:`Choose Ask on two cards, then type a question. I will use both pieces of context together.`,spotlight:`.topic-wrap .block-ask, .ask-hint`,action:{kind:`askMulti`},durationMs:12e3,needsCanvas:!0},{id:`canvas`,title:`Explore the canvas`,mode:`explain`,coach:`Switch to Canvas when you want to explore the whole answer spatially.`,action:{kind:`canvas`,convoId:`travel`},durationMs:15e3},{id:`living-answer`,title:`Walk the why`,mode:`explain`,coach:`A living answer lays out the causes behind an answer. Watch as I walk it cause by cause and say what each one did.`,action:{kind:`showcase`,featureId:`living-answer`},durationMs:26e3},{id:`prism`,title:`Check the evidence`,mode:`explain`,coach:`Prism checks a document claim by claim and ties every finding to its source.`,action:{kind:`prism`},durationMs:32e3},{id:`share`,title:`Present or publish`,mode:`explain`,coach:`Turn a useful answer into a polished presentation or document.`,action:{kind:`export`},durationMs:16e3,needsCanvas:!0},{id:`yours`,title:`Try it yourself`,mode:`voice`,coach:`That is the tour. Now ask your first question.`,spotlight:`.mic-btn`,action:{kind:`mic`},durationMs:6e3}],ai=[{id:`bend`,title:`Make it yours`,mode:`explain`,coach:`These are starting assumptions. Drag the rent and watch the comparison update.`,spotlight:`.bend-strip`,action:{kind:`bend`,convoId:`mortgage`},durationMs:8e3,needsCanvas:!0,glyph:`🎚️`,hook:`Drag a number, watch it recompute`},{id:`chips`,title:`Go deeper`,mode:`explain`,coach:`When an answer offers ways to go deeper, tap one and I'll take it further.`,spotlight:`.footer-keepgoing`,action:{kind:`chip`,convoId:`monthly`,label:`What if I added $500 monthly?`},durationMs:9e3,needsCanvas:!0,glyph:`💬`,hook:`Tap a suggestion, go deeper`},{id:`rail`,title:`Session history`,mode:`explain`,coach:`Settled turns stay on the left for this session. Jump back anytime.`,spotlight:`.rail-chat`,action:{kind:`rail`},durationMs:8e3,needsCanvas:!0,glyph:`📜`,hook:`Settled turns, replayable on the left`},{id:`highlight`,title:`Highlight to ask`,mode:`explain`,coach:`Choose Highlight, draw around any part of an answer, then ask about exactly what you marked.`,spotlight:`.mark-toggle`,action:{kind:`mark`},durationMs:8e3,needsCanvas:!0,glyph:`✎`,hook:`Draw around the exact part you mean`},{id:`range`,title:`A fitting picture`,mode:`explain`,coach:`Answers can choose from diagrams, flows, charts, and interactive maps.`,action:{kind:`montage`,convoIds:[`space`,`krebs`,`travel`]},durationMs:9e3,glyph:`🎨`,hook:`See the visual range`},{id:`focus`,title:`One card at a time`,mode:`explain`,coach:`Feeling overwhelmed? Focus puts one card center stage, one at a time.`,spotlight:`.focus-toggle`,action:{kind:`focusWalk`,convoId:`money`},durationMs:11e3,glyph:`🎯`,hook:`One card at a time, center stage`},{id:`think`,title:`Think out loud`,mode:`explain`,coach:`Not sure what to ask yet? Think out loud, and I will map your thoughts live.`,action:{kind:`listen`},durationMs:16e3,glyph:`🧠`,hook:`Think out loud, I map it live`},{id:`atlas`,title:`Memory and Atlas`,mode:`explain`,coach:`When Memory is enabled, saved facts and kept topics can shape Atlas.`,action:{kind:`atlas`},durationMs:9e3,glyph:`🗺️`,hook:`Kept topics become a place`},{id:`export`,title:`Export the answer`,mode:`explain`,coach:`Need to share it? Export the current answer as a styled slide deck or document.`,action:{kind:`export`},durationMs:12e3,needsCanvas:!0,glyph:`📄`,hook:`Any answer becomes a deck or document`},{id:`flashcards`,title:`Make it stick`,mode:`explain`,coach:`Learning something? Any card becomes a flashcard, kept right here on your device.`,action:{kind:`flashcards`},durationMs:8e3,needsCanvas:!0,glyph:`🎴`,hook:`Turn any card into a flashcard`},{id:`course`,title:`Master a subject`,mode:`explain`,coach:`Want to truly master something? I'll build you a course and teach it, one lesson at a time.`,spotlight:`.course-rail`,action:{kind:`course`},durationMs:12e3,glyph:`🎓`,hook:`A full course, a lesson at a time`},{id:`present`,title:`Fill the room`,mode:`explain`,coach:`Present fills the room with the answer while the microphone stays live.`,action:{kind:`present`},durationMs:9e3,needsCanvas:!0,glyph:`🖥️`,hook:`Fill the room, chrome falls away`},{id:`palette`,title:`Feature index, one key away`,mode:`explain`,coach:`Browse the feature index with one keystroke. Just press Command K.`,spotlight:`.cmdk-panel`,action:{kind:`palette`},durationMs:9e3,glyph:`⌘`,hook:`Feature index, one keystroke away`},{id:`ripple`,title:`See a change ripple`,mode:`explain`,coach:`Here is a real code change. See what it touches, what could break, and the safest order to ship it.`,action:{kind:`showcase`,featureId:`ripple`},durationMs:12e3,glyph:`🌊`,hook:`A code change's whole blast radius`},{id:`deepzoom`,title:`Telescope any topic`,mode:`explain`,coach:`Telescope a topic from the big picture all the way down to the finest detail.`,action:{kind:`showcase`,featureId:`deepzoom`},durationMs:1e4,glyph:`🔭`,hook:`From big picture to finest detail`},{id:`synthesis`,title:`Fuse many documents`,mode:`explain`,coach:`Drop in several documents and I combine them into one map of agreements, contradictions, and gaps.`,action:{kind:`showcase`,featureId:`synthesis`},durationMs:1e4,glyph:`🧬`,hook:`Many documents into one map`},{id:`memory`,title:`What I remember`,mode:`explain`,coach:`Everything I remember about you lives here. Review it, edit it, or forget it. It stays on your device.`,action:{kind:`showcase`,featureId:`memory`},durationMs:9e3,glyph:`🔖`,hook:`See, edit, or forget what I know`},{id:`library`,title:`Past conversations`,mode:`explain`,coach:`Every canvas you build is kept. Reopen any past conversation where you left it.`,action:{kind:`showcase`,featureId:`library`},durationMs:9e3,glyph:`📚`,hook:`Reopen a canvas you built before`},{id:`review`,title:`Study your cards`,mode:`explain`,coach:`Open Study to go through your flashcards. Keep it a plain pile, or let Mavéa space them out so the ones you find hard come back sooner.`,action:{kind:`showcase`,featureId:`review`},durationMs:9e3,glyph:`🧠`,hook:`Go through your flashcards`},{id:`manage-flashcards`,title:`Manage your deck`,mode:`explain`,coach:`Open your flashcard library to organize decks, edit cards, and choose what to study.`,action:{kind:`showcase`,featureId:`flashcards`},durationMs:9e3,glyph:`🗂️`,hook:`Organize and edit every study card`},{id:`track`,title:`Build a living dashboard`,mode:`explain`,coach:`Choose the parts you want to keep live, set a refresh schedule, and create a dashboard from this answer.`,action:{kind:`showcase`,featureId:`track`},durationMs:12e3,needsCanvas:!0,glyph:`📈`,hook:`Choose what stays live and how often`},{id:`delegate`,title:`Rehearse it first`,mode:`explain`,coach:`Prepare a hard conversation before you have it. Take the seat and practice your own lines, or send me to argue your side and read the debrief.`,action:{kind:`showcase`,featureId:`delegate`},durationMs:9e3,glyph:`🤝`,hook:`Practice it, or send me to scout it`},{id:`just-listen`,title:`Just listen`,mode:`explain`,coach:`Think out loud and I save what you say without answering, so you can sort it later.`,action:{kind:`showcase`,featureId:`just-listen`},durationMs:9e3,glyph:`👂`,hook:`Bank everything you say, sort it later`},{id:`recap`,title:`Recap the session`,mode:`explain`,coach:`Lost the thread? I'll recap everything we've covered this session at a glance.`,action:{kind:`showcase`,featureId:`recap`},durationMs:9e3,glyph:`📋`,hook:`Everything we've covered, at a glance`},{id:`ghost`,title:`Ghost answers`,mode:`explain`,coach:`While you listen, I quietly draft a response, so it is ready when you want it.`,action:{kind:`showcase`,featureId:`ghost`},durationMs:9e3,glyph:`👻`,hook:`I draft what I would say, quietly`},{id:`whisper`,title:`Whisper mode`,mode:`explain`,coach:`Need to stay quiet? Whisper mode lowers my voice to a soft murmur.`,action:{kind:`showcase`,featureId:`whisper`},durationMs:9e3,glyph:`🤫`,hook:`A quiet voice when you need it`},{id:`morning-brief`,title:`Morning brief`,mode:`explain`,coach:`Start the day with a brief of what changed across the things you track. It stays off until you turn it on.`,action:{kind:`showcase`,featureId:`morning-brief`},durationMs:9e3,glyph:`☀️`,hook:`Open the day with what's changed`},{id:`settings`,title:`Bring your own model`,mode:`explain`,coach:`Bring your own model, connect a provider, and tune how I answer. You control the key and the terms.`,action:{kind:`showcase`,featureId:`settings`},durationMs:9e3,glyph:`⚙️`,hook:`Connect a provider, tune the answers`},{id:`zoom-deck`,title:`Chapter view`,mode:`explain`,coach:`Pull back from the cards to the whole session, with every topic shown as a chapter.`,action:{kind:`showcase`,featureId:`zoom-deck`},durationMs:1e4,glyph:`📖`,hook:`Pull back to the whole session`},{id:`blanks`,title:`Fill in your own`,mode:`explain`,coach:`Some numbers are only yours to give. I leave glowing spaces and finish the answer around what you add.`,spotlight:`.blank-slot`,action:{kind:`blanksDemo`},durationMs:1e4,glyph:`◌`,hook:`Holes for the numbers only you know`}],oi=[...ii,...ai];function si(e){return oi.find(t=>t.id===e)}var ci={money:`How does $10,000 grow at 7% over 30 years?`,monthly:`What if I added $500 monthly?`,mortgage:`Should I buy or rent a $500,000 home?`,space:`How does a black hole bend light?`,travel:`Plan me 5 days in Japan.`,budget:`Where does the US federal budget actually go?`,krebs:`Explain the Krebs cycle.`,url:`What actually happens when I open a website?`,neural:`How does a neural network learn?`,fitness:`Design me a 3-day strength routine.`};function li(e,t){let n=ni(e),r=n?.frames[0];if(!n||!r)return null;let i=ri(t??ci[e]??n.question);return{frame:q({...r,question:i}),question:i}}var ui=[{key:`savings`,label:`Your savings`,prompt:`How much have you set aside for the break?`,kind:`number`,unit:`$`,placeholder:`e.g. 18,000`},{key:`spend`,label:`Monthly spend`,prompt:`Roughly what will you spend a month while travelling?`,kind:`number`,unit:`$/mo`,placeholder:`e.g. 2,400`}],di=[{type:`insight`,id:`blanks-lede`,col:12,props:{title:`The money side of a 6-month break`,summary:`I've mapped the typical costs and what to sort out before you leave. Two numbers, though, are yours to give — so I've left them as holes rather than guess.`}},{type:`blanks`,id:`blanks-holes`,col:12,props:{title:`The parts only you can answer`,icon:`spark`,iconColor:`var(--presence)`,intro:`I've weighed everything I can. Fill these in and I'll finish the runway math around them.`,slots:ui}}],fi=[{type:`insight`,id:`blanks-verdict`,col:12,props:{title:`You can afford it — with a cushion`,summary:`$18,000 saved against $2,400 a month is about 7.5 months of runway — enough for a 6-month break with room to spare.`,stat:`7.5 months`,delta:`+1.5 vs. the plan`,deltaDir:`up`}},{type:`breakdown`,id:`blanks-runway`,col:12,props:{title:`Your runway`,rows:[{name:`Saved`,val:`$18,000`,pct:100},{name:`Spend / month`,val:`$2,400`,pct:32},{name:`6-month cost`,val:`$14,400`,pct:80},{name:`Left over`,val:`$3,600`,pct:20,tag:`cushion`,tagColor:`var(--presence)`}]}}];function pi(e,t){return{question:`Can I afford a 6-month career break?`,narration:t,mode:`replace`,tour:[],spec:e,at:0}}function mi(e){let t={...e,title:`Can I afford a 6-month career break?`,sub:`The money side`,bend:void 0,sources:void 0,track:void 0},n={...t,blocks:di,blanks:ui,awaiting:!0},r={...t,blocks:fi,blanks:void 0,awaiting:!1};return{holes:pi(n,``),filled:pi(r,`With eighteen thousand saved and twenty-four hundred a month, that’s about seven and a half months of runway — enough for six, with a cushion.`)}}function hi(){let e=!1,t=[];return{after(n,r){t.push(setTimeout(()=>!e&&r(),n))},cancel(){e=!0,t.forEach(clearTimeout)}}}function gi(e,t){if(_()){t();return}let n=Date.now(),r=()=>{if(_()||Date.now()-n>=8e3){t();return}e(200,r)};e(200,r)}function _i(e,t,n,r=0){for(let i=1;i<=n.length;i++)e(r+i*22,()=>t(n.slice(0,i)));return r+n.length*22}function vi(e){let t=Date.now(),n=e.maxExtraMs??2e4,r=0,i=window.setInterval(()=>{let a=Date.now()-t;a<e.minHoldMs||(r=e.isQuiet()?r+1:0,(r>=7||a>=e.minHoldMs+n)&&(window.clearInterval(i),e.advance()))},250);return()=>window.clearInterval(i)}var yi=450,bi=1600;function xi(e,t){if(e<=0)return[];let n=Math.max(bi,Math.floor((t-yi-400)/e));return Array.from({length:e},(e,t)=>yi+t*n)}var Si=1500,Ci=900;function wi(e,t){let n=1850;if(e<=0)return{focusAt:Si,spotlightAt:[]};let r=Math.max(Ci,Math.floor((t-n)/e));return{focusAt:Si,spotlightAt:Array.from({length:e},(e,t)=>n+t*r)}}var Ti=[`I keep thinking about moving to Austin.`,`My sister already lives there.`,`But I'm worried about starting over.`,`And my lease runs until March.`,`Is it even the right time?`];function Ei(e){return!!e&&ai.some(t=>t.id===e)}function Di(e){return!!e&&ii.some(t=>t.id===e)}function Oi(e){let{active:t}=e,[n,r]=(0,W.useState)(()=>{let t=e.startChapter;return Ei(t)||Di(t)&&e.solo?t??null:null}),[i,a]=(0,W.useState)(()=>{let t=e.startChapter;if(Ei(t)||Di(t)&&e.solo)return 0;let n=t?ii.findIndex(e=>e.id===t):-1;return n>=0?n:0}),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(!1),[u,d]=(0,W.useState)(!1),f=(0,W.useRef)(u);f.current=u;let p=(0,W.useRef)(c);p.current=c;let[m,h]=(0,W.useState)(!1),[g,v]=(0,W.useState)(0),y=(0,W.useRef)(e.ops);y.current=e.ops;let b=n?si(n):void 0,x=b?[b]:ii,S=(0,W.useRef)(x);S.current=x;let C=x.length,w=t?x[i]??null:null,[T,E]=(0,W.useState)(!1),[D,O]=(0,W.useState)(!1),[k,j]=(0,W.useState)(0);(0,W.useEffect)(()=>{if(!t)return;let e=!0;return(async()=>{for(let t=0;e&&t<2;t++)try{await K(),e&&E(!0);return}catch{}e&&O(!0)})(),()=>{e=!1}},[t,k]);let M=(0,W.useCallback)(()=>{O(!1),j(e=>e+1)},[]),N=(0,W.useCallback)(()=>{let e=y.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,W.useEffect)(()=>{if(!t||!o||m||!T)return;let e=S.current[i];if(!e)return;A(e.id,!!n);let r=y.current,a=hi(),s=a.after,c=e=>gi(s,e),l=e=>c(()=>r.speak(e)),u=e=>r.showFrame(e.frame,e.question,{silent:!0});if(N(),e.needsCanvas&&!r.hasCanvas()){let e=li(`money`);e&&u(e)}r.setMuted(f.current||e.mode===`silent`);let d=e.action;if(d.kind===`answer`){let e=li(d.convoId,d.ask);if(e){let t=e.question,n={...e.frame,narration:``,spoken:``,tour:e.frame.tour.slice(0,4).map(e=>({...e,say:``,saySpoken:``}))};s(_i(s,r.typeInto,t)+360,()=>c(()=>r.showFrame(n,e.question)))}}else if(d.kind===`chip`){let e=li(`money`);e&&u(e),s(1400,()=>r.pressKeepGoing(d.label)),s(2e3,()=>{let e=li(d.convoId,d.label);e&&r.showFrame(e.frame,e.question)})}else if(d.kind===`montage`){let t=d.convoIds.map(e=>li(e)).filter(Boolean),n=xi(t.length,e.durationMs);t.forEach((e,t)=>s(n[t],()=>u(e)))}else if(d.kind===`ask`)s(1300,()=>r.pinFirstBlock()),_i(s,r.typeInto,`Why does it grow faster after year 20?`,1700);else if(d.kind===`askMulti`){let e=li(`money`);e&&u(e),s(1300,()=>r.pinFirstBlocks(2)),_i(s,r.typeInto,`How do these two parts explain the final total?`,2600)}else if(d.kind===`bend`){if(d.convoId){let e=li(d.convoId);e&&u(e)}s(1400,()=>r.bendIt())}else if(d.kind===`rail`)s(1300,()=>r.toggleRail()),s(2600,()=>r.toggleRail());else if(d.kind===`export`)s(500,()=>r.openExport());else if(d.kind===`mark`)s(400,()=>r.setInkArmed(!0)),s(900,()=>r.scriptedMark());else if(d.kind===`penDemo`){let e=li(`money`);e&&u(e),s(1200,()=>r.drawPenTourStep(`result`)),s(3900,()=>r.drawPenTourStep(`reason`)),s(7200,()=>r.setSpot(null))}else if(d.kind===`focus`)s(500,()=>r.setViewMode(`focus`));else if(d.kind===`canvas`){let e=li(d.convoId);e&&u(e),s(1500,()=>r.setViewMode(`canvas`));let t=(e?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,3);t.forEach((e,t)=>s(2700+t*1900,()=>r.setSpot(e))),s(2700+t.length*1900,()=>r.setSpot(null))}else if(d.kind===`focusWalk`){let t=li(d.convoId);t&&u(t);let n=(t?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e),{focusAt:i,spotlightAt:a}=wi(n.length,e.durationMs);s(i,()=>r.setViewMode(`focus`)),n.forEach((e,t)=>s(a[t],()=>r.setSpot(e)))}else if(d.kind===`listen`){s(400,()=>r.startWatchThinking());let e=800;for(let t of Ti)e=_i(s,r.typeInto,t,e)+300,s(e,()=>{r.typeInto(``),r.bankThought(t)}),e+=800}else if(d.kind===`flashcards`)s(700,()=>r.openFlashcards());else if(d.kind===`course`)s(500,()=>r.openTourCourse());else if(d.kind===`connect`)s(400,()=>r.openModelSettings());else if(d.kind===`present`)s(500,()=>r.setPresenting(!0));else if(d.kind===`share`)s(500,()=>r.setShareOpen(!0)),s(3100,()=>r.shareRemix()),s(4900,()=>r.sharePalette(`Ember`));else if(d.kind===`palette`)s(500,()=>r.setPaletteOpen(!0));else if(d.kind===`atlas`)s(500,()=>r.openAtlas());else if(d.kind===`prism`)s(400,()=>r.openPrism(0));else if(d.kind===`memory`)s(700,()=>r.fireMemoryGlow());else if(d.kind===`showcase`)d.featureId===`recap`||d.featureId===`zoom-deck`?([`money`,`space`,`travel`].forEach((e,t)=>{let n=li(e);n&&s(t*200,()=>u(n))}),s(1400,()=>r.showcaseFeature(d.featureId))):s(500,()=>r.showcaseFeature(d.featureId));else if(d.kind===`blanksDemo`){let e=li(`money`)?.frame.spec;if(e){let{holes:t,filled:n}=mi(e);u({frame:t,question:t.question}),s(5200,()=>r.showFrame(n,n.question))}}return e.mode!==`silent`&&!f.current&&s(160,()=>l(ri(e.coach))),a.cancel},[i,g,t,o,m,T,n,N]),(0,W.useEffect)(()=>{if(!t||!o||m||!c||!T)return;let e=S.current[i];if(!e)return;let n=y.current;return vi({minHoldMs:e.durationMs,isQuiet:()=>!n.isSpeaking()&&!n.isBusy(),advance:()=>{i+1>=C?(N(),h(!0)):a(i+1)}})},[i,g,t,o,m,c,T,C,n,N]),(0,W.useEffect)(()=>()=>N(),[N]);let P=(0,W.useCallback)(()=>{_(),s(!0),l(!0),h(!1)},[]),F=(0,W.useCallback)((e,t)=>{_(),h(!1),t?.keepPlaying||l(!1),a(Math.max(0,Math.min(S.current.length-1,e))),v(e=>e+1)},[]),I=(0,W.useCallback)(()=>{i+1>=C?(N(),h(!0)):F(i+1,{keepPlaying:!0})},[i,C,F,N]),L=(0,W.useCallback)(()=>F(i-1),[i,F]),R=(0,W.useCallback)(e=>F(e),[F]),z=(0,W.useCallback)(()=>{N(),r(null),s(!0),F(0),l(!0)},[F,N]),B=(0,W.useCallback)(e=>{Ei(e)&&(_(),r(e),s(!0),h(!1),l(!0),a(0),v(e=>e+1))},[]),ee=(0,W.useCallback)(()=>{if(_(),!o){P();return}if(m){z();return}p.current&&y.current.cancelSpeech(),l(e=>!e)},[m,z,P,o]),te=(0,W.useCallback)(()=>{_();let e=!f.current;f.current=e,d(e);let t=S.current[i],n=t?.mode===`silent`,r=y.current;r.setMuted(e||n),e?r.cancelSpeech():o&&!m&&t&&!n&&r.speak(ri(t.coach))},[m,i,o]),ne=(0,W.useCallback)(()=>{N(),h(!0)},[N]);return{active:t,started:o,index:i,total:C,chapter:w,coach:ri(w?.coach??``),spotlight:w?.spotlight,playing:c,muted:u,done:m,corpusError:D,retryCorpus:M,solo:!!n,start:P,next:I,prev:L,jumpTo:R,toggle:ee,toggleMute:te,replay:z,skip:ne,playExtra:B}}var J=n();function ki(e){let t=window.innerWidth,n=window.innerHeight,r=Math.min(e.right,t)-Math.max(e.left,0),i=Math.min(e.bottom,n)-Math.max(e.top,0);return r>e.width*.5&&i>e.height*.5}var Ai=/^(hidden|auto|scroll|clip)$/;function ji(e,t){let n=e.top,r=e.left,i=e.right,a=e.bottom;for(let e=t.parentElement;e;e=e.parentElement){let t=getComputedStyle(e),o=Ai.test(t.overflowY),s=Ai.test(t.overflowX);if(!o&&!s)continue;let c=e.getBoundingClientRect();o&&(n=Math.max(n,c.top),a=Math.min(a,c.bottom)),s&&(r=Math.max(r,c.left),i=Math.min(i,c.right))}return new DOMRect(r,n,Math.max(0,i-r),Math.max(0,a-n))}function Mi(e,t){let n=(0,J.c)(4),[r,i]=(0,W.useState)(null),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(null);return}let n=!0,r=0,a=null,o=e=>{e===a||e!==null&&a!==null&&Math.abs(e.top-a.top)<.5&&Math.abs(e.left-a.left)<.5&&Math.abs(e.width-a.width)<.5&&Math.abs(e.height-a.height)<.5||(a=e,i(e))},s=e.split(`,`).map(Li).filter(Boolean),c=()=>{if(!n)return;let e=null,t=null;for(let n of s){let r=Array.from(document.querySelectorAll(n)).filter(Ii).map(Fi).filter(Pi),i=r.find(Ni)??r[0];if(i){e=i.hit,t=i.rect;break}}if(!e||!t){o(null);return}let i=t;if(!ki(i)){let t=Date.now();t-r>1200&&(r=t,e.scrollIntoView({block:`center`,behavior:`smooth`})),o(null);return}o(i)};c();let l=0,u=()=>{l||=requestAnimationFrame(()=>{l=0,c()})},d=window.setInterval(c,750);return window.addEventListener(`resize`,u),window.addEventListener(`scroll`,u,{passive:!0,capture:!0}),()=>{n=!1,window.clearInterval(d),cancelAnimationFrame(l),window.removeEventListener(`resize`,u),window.removeEventListener(`scroll`,u,!0)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,W.useEffect)(a,o),r}function Ni(e){let{rect:t}=e;return ki(t)}function Pi(e){let{raw:t}=e;return t.width>0&&t.height>0}function Fi(e){let t=e.getBoundingClientRect();return{hit:e,raw:t,rect:ji(t,e)}}function Ii(e){return!e.checkVisibility||e.checkVisibility({checkOpacity:!0})}function Li(e){return e.trim()}function Ri(e){let t=(0,J.c)(83),{driver:n}=e,r=(0,W.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=e=>{let t=r.current,n=t&&t.isConnected?t:r.current=document.querySelector(`.canvas-scroll`);if(!n)return;let i=e.deltaMode===1?e.deltaY*16:e.deltaMode===2?e.deltaY*n.clientHeight:e.deltaY;n.scrollTop+=i},t[0]=i):i=t[0];let a=i,o=Mi(n.spotlight,n.active&&n.started&&!n.done),s=(0,W.useRef)(null),c=n.active&&!n.done&&!n.started&&!n.corpusError,l;t[1]===c?l=t[2]:(l={active:c},t[1]=c,t[2]=l),ae(s,l);let u=n.active&&n.started&&!n.done?n.chapter?.id:void 0,d,f;if(t[3]===u?(d=t[4],f=t[5]):(d=()=>{if(u)return document.body.dataset.tourChapter=u,Bi},f=[u],t[3]=u,t[4]=d,t[5]=f),(0,W.useEffect)(d,f),!n.active||n.done)return null;if(n.corpusError){let e,r,i;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,G.jsx)(`h2`,{children:`This walkthrough couldn’t load`}),i=(0,G.jsx)(`p`,{children:`The recorded scenes did not come through. Check your connection and try again.`}),t[6]=e,t[7]=r,t[8]=i):(e=t[6],r=t[7],i=t[8]);let a;t[9]===n.retryCorpus?a=t[10]:(a=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.retryCorpus,children:`Retry`}),t[9]=n.retryCorpus,t[10]=a);let o;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:zi,children:`Back to home`}),t[11]=o):o=t[11];let s;return t[12]===a?s=t[13]:(s=(0,G.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`tourx-welcome`,role:`alert`,children:[e,r,i,(0,G.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[a,o]})]})}),t[12]=a,t[13]=s),s}if(!n.started){let e,r;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,G.jsx)(`h2`,{id:`tourx-welcome-title`,children:`See Mavéa in action`}),t[14]=e,t[15]=r):(e=t[14],r=t[15]);let i=n.total===1?`scene plays`:`scenes play`,a;t[16]!==n.total||t[17]!==i?(a=(0,G.jsxs)(`p`,{children:[n.total,` short `,i,` automatically. Pause, skip, or move at your own pace.`]}),t[16]=n.total,t[17]=i,t[18]=a):a=t[18];let o;t[19]===n.start?o=t[20]:(o=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.start,children:`Start the tour`}),t[19]=n.start,t[20]=o);let c;t[21]===n.skip?c=t[22]:(c=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:n.skip,children:`Skip tour`}),t[21]=n.skip,t[22]=c);let l;t[23]!==o||t[24]!==c?(l=(0,G.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[o,c]}),t[23]=o,t[24]=c,t[25]=l):l=t[25];let u;return t[26]!==l||t[27]!==a?(u=(0,G.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{ref:s,className:`tourx-welcome`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tourx-welcome-title`,children:[e,r,a,l]})}),t[26]=l,t[27]=a,t[28]=u):u=t[28],u}let p=u===`ask`||!!o&&o.top+o.height/2>window.innerHeight*.58,m;t[29]===o?m=t[30]:(m=o&&(0,G.jsx)(`div`,{className:`tourx-ring`,style:{top:o.top-8,left:o.left-8,width:o.width+16,height:o.height+16}}),t[29]=o,t[30]=m);let h=`tourx-panel`+(n.solo?` is-solo`:``)+(p?` is-top`:``),g=n.solo?`Mini-demo controls`:`Walkthrough controls`,_=`head-`+n.index,v=n.solo?`Mini demo`:`${n.index+1} / ${n.total}`,y;t[31]===v?y=t[32]:(y=(0,G.jsx)(`span`,{className:`tourx-count`,children:v}),t[31]=v,t[32]=y);let b=n.chapter?.title,x;t[33]===b?x=t[34]:(x=(0,G.jsx)(`span`,{className:`tourx-title`,children:b}),t[33]=b,t[34]=x);let S;t[35]!==y||t[36]!==x||t[37]!==_?(S=(0,G.jsxs)(`div`,{className:`tourx-head`,children:[y,x]},_),t[35]=y,t[36]=x,t[37]=_,t[38]=S):S=t[38];let C=`coach-`+n.index,w;t[39]!==n.coach||t[40]!==C?(w=(0,G.jsx)(`p`,{className:`tourx-coach`,children:n.coach},C),t[39]=n.coach,t[40]=C,t[41]=w):w=t[41];let T;t[42]!==n.index||t[43]!==n.prev||t[44]!==n.solo?(T=!n.solo&&(0,G.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.prev,disabled:n.index===0,"aria-label":`Previous chapter`,children:(0,G.jsx)(B.chevL,{className:`tourx-ic`})}),t[42]=n.index,t[43]=n.prev,t[44]=n.solo,t[45]=T):T=t[45];let E=n.playing?`Pause autoplay`:`Turn on autoplay`,D;t[46]===n.playing?D=t[47]:(D=n.playing?(0,G.jsx)(B.pause,{className:`tourx-ic`}):(0,G.jsx)(B.play,{className:`tourx-ic`}),t[46]=n.playing,t[47]=D);let O=n.playing?`Pause`:`Autoplay`,k;t[48]===O?k=t[49]:(k=(0,G.jsx)(`span`,{children:O}),t[48]=O,t[49]=k);let A;t[50]!==n.toggle||t[51]!==E||t[52]!==D||t[53]!==k?(A=(0,G.jsxs)(`button`,{type:`button`,className:`tourx-btn tourx-play tourx-auto`,onClick:n.toggle,"aria-label":E,children:[D,k]}),t[50]=n.toggle,t[51]=E,t[52]=D,t[53]=k,t[54]=A):A=t[54];let j=n.muted?`Turn narration on`:`Mute narration`,M=n.muted?`Turn narration on`:`Mute narration`,N;t[55]===n.muted?N=t[56]:(N=n.muted?(0,G.jsx)(B.speakerOff,{className:`tourx-ic`}):(0,G.jsx)(B.speaker,{className:`tourx-ic`}),t[55]=n.muted,t[56]=N);let P;t[57]!==n.muted||t[58]!==n.toggleMute||t[59]!==j||t[60]!==M||t[61]!==N?(P=(0,G.jsx)(`button`,{type:`button`,className:`tourx-btn tourx-mute`,onClick:n.toggleMute,"aria-label":j,"aria-pressed":n.muted,title:M,children:N}),t[57]=n.muted,t[58]=n.toggleMute,t[59]=j,t[60]=M,t[61]=N,t[62]=P):P=t[62];let F;t[63]===n?F=t[64]:(F=!n.solo&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.next,"aria-label":`Next chapter`,children:(0,G.jsx)(B.chevR,{className:`tourx-ic`})}),(0,G.jsx)(`div`,{className:`tourx-dots`,role:`tablist`,"aria-label":`Chapters`,children:Array.from({length:n.total},(e,t)=>(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===n.index,"aria-label":`Chapter ${t+1}`,className:`tourx-dot`+(t===n.index?` is-active`:``),onClick:()=>n.jumpTo(t)},t))})]}),t[63]=n,t[64]=F);let I=n.solo?`Back to demos`:`Skip`,L;t[65]!==n.skip||t[66]!==I?(L=(0,G.jsx)(`button`,{type:`button`,className:`tourx-skip`,onClick:n.skip,children:I}),t[65]=n.skip,t[66]=I,t[67]=L):L=t[67];let R;t[68]!==T||t[69]!==A||t[70]!==P||t[71]!==F||t[72]!==L?(R=(0,G.jsxs)(`div`,{className:`tourx-controls`,children:[T,A,P,F,L]}),t[68]=T,t[69]=A,t[70]=P,t[71]=F,t[72]=L,t[73]=R):R=t[73];let z;t[74]!==S||t[75]!==w||t[76]!==R||t[77]!==h||t[78]!==g?(z=(0,G.jsxs)(`div`,{className:h,role:`group`,"aria-label":g,onWheel:a,children:[S,w,R]}),t[74]=S,t[75]=w,t[76]=R,t[77]=h,t[78]=g,t[79]=z):z=t[79];let ee;return t[80]!==z||t[81]!==m?(ee=(0,G.jsxs)(`div`,{className:`tourx`,"aria-live":`polite`,children:[m,z]}),t[80]=z,t[81]=m,t[82]=ee):ee=t[82],ee}function zi(){window.location.hash=`#/`}function Bi(){delete document.body.dataset.tourChapter}function Vi({onStart:e,onReplay:t,onPlayExtra:n,hasStoredSession:r=!1}){let i=(0,W.useRef)(null);ae(i);let a=x();return(0,G.jsx)(`div`,{ref:i,className:`tour-end`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-end-title`,children:(0,G.jsxs)(`section`,{className:`tour-end-card`,children:[(0,G.jsxs)(`header`,{className:`tour-end-intro`,children:[(0,G.jsx)(`div`,{className:`tour-end-mascot`,"aria-hidden":`true`,ref:a,children:(0,G.jsx)(de,{state:`idle`,emotion:`neutral`,gaze:`center`})}),(0,G.jsx)(`h2`,{id:`tour-end-title`,className:`tour-end-title tour-end-line`,children:`That's Mavéa.`}),(0,G.jsx)(`p`,{className:`tour-end-tagline tour-end-line`,children:`Talk to AI. See what it means.`}),(0,G.jsx)(`p`,{className:`tour-end-copy tour-end-line`,children:`Try it now, or open any scripted mini-demo below to see that feature operate on the real interface.`}),(0,G.jsxs)(`div`,{className:`tour-end-actions tour-end-line`,children:[(0,G.jsx)(`button`,{type:`button`,className:`tour-end-start`,onClick:e,children:r?`Back to your session`:`Start Mavéa`}),(0,G.jsx)(`button`,{type:`button`,className:`tour-end-replay`,onClick:t,children:`Replay the tour`})]})]}),(0,G.jsxs)(`div`,{className:`tour-end-extras`,children:[(0,G.jsx)(`h3`,{children:`More to explore`}),(0,G.jsx)(`div`,{className:`tour-end-grid`,children:ai.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`tour-end-extra`,onClick:()=>n(e.id),"aria-label":`Play scripted mini-demo: ${e.title}`,children:[(0,G.jsx)(`span`,{className:`tour-end-glyph`,"aria-hidden":`true`,children:e.glyph}),(0,G.jsxs)(`span`,{className:`tour-end-extra-copy`,children:[(0,G.jsx)(`strong`,{children:e.title}),(0,G.jsx)(`small`,{children:e.hook})]})]},e.id))})]})]})})}var Hi=new Map([{persona:`cfo`,steps:[{ask:`Run my quarterly review: ARR grew from $12.4M to $15.1M, churn ticked up from 2.1% to 2.8%, and regions came in at NA $8.2M, EMEA $4.6M, APAC $2.3M.`,bakeAsk:`Run my quarterly review: ARR grew from $12.4M to $15.1M, churn ticked up from 2.1% to 2.8%, and regions came in at NA $8.2M, EMEA $4.6M, APAC $2.3M. Build the full picture, including growth, the churn drift, and how the regions stack up.`,expect:{minBlocks:4,suggests:!0}},{ask:`Walk me through the bridge: new business added $1.9M, expansion $1.3M, and churn gave back $0.5M.`,beats:[{kind:`pin`,atMs:900}],note:`Renata pins the bridge. The next question uses that context.`,expect:{minBlocks:2,suggests:!0}},{ask:`Forecast for next quarter`,bakeAsk:`Forecast for next quarter: if churn keeps drifting at this pace, where does ARR land? Model it from the numbers we established.`,viaChip:!0,expect:{minBlocks:2}},{beats:[{kind:`export`,atMs:500,format:`presentation`}],note:`One tap: the whole review becomes a board deck.`,holdMs:6500},{beats:[{kind:`dashboard`,atMs:500,settings:!0}],note:`A living dashboard keeps a board like this up to date.`,holdMs:6500},{beats:[{kind:`present`,atMs:500}],note:`…or presents itself, full screen.`,holdMs:6e3}]},{persona:`student`,steps:[{ask:`What does saving $200 a month at 5% become after 10 years?`,bakeAsk:`What does saving $200 a month at 5% interest become after 10 years? Chart it year by year, split what I put in from what the interest earned, and make the monthly amount adjustable.`,beats:[{kind:`bend`,atMs:1100}],note:`Grab the dial. The whole answer updates live.`,expect:{minBlocks:3,bend:!0,suggests:!0}},{ask:`Why does compound interest beat simple interest? It's on my econ exam.`,beats:[{kind:`pen`,atMs:1400}],note:`Mavéa’s Pen marks the exact part Maya is studying.`,expect:{minBlocks:2}},{beats:[{kind:`flashcards`,atMs:600}],note:`Any card can become a flashcard and join her study deck.`,holdMs:6e3}]},{persona:`dev`,steps:[{ask:`Explain how OAuth login works, step by step. I'm adding it to our app.`,beats:[{kind:`focus`,atMs:1200,walk:!0}],note:`Focus mode: one card at a time, everything else dims.`,expect:{minBlocks:3,suggests:!0}},{ask:`Compare session cookies and JWTs for keeping users signed in. Focus on tradeoffs, not dogma.`,bakeAsk:`Compare session cookies and JWTs for keeping users signed in. Show the real tradeoffs side by side, including revocation, statelessness, size, XSS and CSRF exposure, and when each wins.`,beats:[{kind:`pin`,atMs:1e3}],expect:{minBlocks:2}},{beats:[{kind:`palette`,atMs:600}],note:`Press Command K. Every feature is a keystroke away.`,holdMs:5e3},{beats:[{kind:`export`,atMs:500,format:`presentation`}],note:`The whole session becomes a polished presentation.`,holdMs:7500}]},{persona:`traveler`,steps:[{ask:`Plan a long weekend in Lisbon. Three days, first visit, and we love food and views.`,expect:{minBlocks:4,suggests:!0}},{ask:`How do we plan a great day trip to Sintra on Saturday?`,beats:[{kind:`canvas`,atMs:1e3}],note:`The spatial canvas: the whole trip on one board.`,expect:{minBlocks:2}},{beats:[{kind:`export`,atMs:500,format:`document`}],note:`The plan is ready to print for the plane.`,holdMs:7500}]}].map(e=>[e.persona,e]));function Ui(e){return Hi.get(e)}function Wi(e){return e.steps.filter(e=>!!e.ask)}var Gi=1300,Ki=900;function qi(e,t){return(e?.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,t)}function Ji(e,t,n,r){switch(e.kind){case`pin`:r(e.atMs,()=>t.pinFirstBlock());break;case`bend`:n?.spec.bend&&r(e.atMs,()=>t.bendIt());break;case`mark`:r(e.atMs,()=>t.setInkArmed(!0)),r(e.atMs+500,()=>t.scriptedMark());break;case`pen`:r(e.atMs,()=>t.drawPenOnFirstBlock());break;case`focus`:r(e.atMs,()=>t.setViewMode(`focus`)),e.walk&&qi(n,4).forEach((n,i)=>r(e.atMs+Ki+i*Gi,()=>t.setSpot(n)));break;case`canvas`:{r(e.atMs,()=>t.setViewMode(`canvas`));let i=qi(n,3);i.forEach((n,i)=>r(e.atMs+Ki+i*Gi,()=>t.setSpot(n))),r(e.atMs+Ki+i.length*Gi,()=>t.setSpot(null));break}case`export`:r(e.atMs,()=>t.openExport()),e.format===`document`&&r(e.atMs+1800,()=>t.exportSetFormat(`document`)),r(e.atMs+3e3,()=>t.exportPickTemplate(1));break;case`dashboard`:r(e.atMs,()=>t.openDashboards()),e.settings&&r(e.atMs+2600,()=>t.dashboardShowSettings());break;case`flashcards`:r(e.atMs,()=>t.openFlashcards());break;case`present`:r(e.atMs,()=>t.setPresenting(!0));break;case`share`:r(e.atMs,()=>t.setShareOpen(!0));break;case`palette`:r(e.atMs,()=>t.setPaletteOpen(!0))}}function Yi(e){switch(e.kind){case`canvas`:return 6400;case`focus`:return e.walk?7300:1600;case`export`:return e.format===`document`?4800:3800;case`dashboard`:return e.settings?4400:2600;case`mark`:return 2400;case`pen`:return 3200;default:return 1600}}function Xi(e){return e?.length?Math.max(...e.map(e=>e.atMs+Yi(e))):0}i();var Zi=Object.assign({"./cfo.generated.json":()=>a(()=>import(`./cfo.generated-j5CXp1Zz.js`),[]),"./dev.generated.json":()=>a(()=>import(`./dev.generated-DYgVxL_4.js`),[]),"./student.generated.json":()=>a(()=>import(`./student.generated-DS_acPaJ.js`),[]),"./traveler.generated.json":()=>a(()=>import(`./traveler.generated-Beun9X7y.js`),[])});function Qi(e){let t=!1,n=e.frames.map(e=>{let n=e.spec.blocks,r=n.map(e=>ue(e.type,e.props)&&le(e.type,e.props));if(r.every(Boolean))return e;t=!0;let i=new Map,a=0;r.forEach((e,t)=>{e&&i.set(t,a++)});let o=e.tour?.filter(e=>i.has(e.index)).map(e=>({...e,index:i.get(e.index)}));return{...e,spec:{...e.spec,blocks:n.filter((e,t)=>r[t])},...o?{tour:o}:{}}});return t?{...e,frames:n}:e}async function $i(e){let t=Zi[`./${e}.generated.json`];if(!t)return null;try{let e=(await t()).default??null;return e?Qi(e):null}catch{return null}}var ea=4500,ta=1e3,Y=6e4;function na(e,t,n){if(!e[t]?.ask)return null;let r=e.slice(0,t+1).filter(e=>!!e.ask).length-1;return n.frames[r]??null}function ra(e,t,n){let r=e.slice(0,t+1).filter(e=>!!e.ask).length;return n.frames[Math.max(0,r-1)]??null}function ia(e){let{active:t,personaId:n}=e,r=n?Ui(n):void 0,i=r?.steps??[],a=i.length,[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(`loading`),[u,d]=(0,W.useState)(()=>Math.max(0,Math.min(a-1,e.startStep??0))),[f,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[v,y]=(0,W.useState)(!1),b=(0,W.useRef)(v);b.current=v;let[x,S]=(0,W.useState)(!1),[C,w]=(0,W.useState)(0),[T,E]=(0,W.useState)(null),D=(0,W.useRef)(e.ops);D.current=e.ops;let O=(0,W.useRef)(null),k=(0,W.useRef)(0),A=(0,W.useCallback)(()=>{if(!t||!n)return;l(`loading`);let e=++k.current;$i(n).then(t=>{if(e!==k.current)return;let n=r?Wi(r).length:0,i=!!t&&!!r&&t.frames.length===n;s(i?t:null),l(i?`ready`:`error`)})},[t,n,r]);(0,W.useEffect)(A,[A]);let j=(0,W.useCallback)(()=>{let e=D.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,W.useEffect)(()=>{if(!t||!f||x||c!==`ready`||!o||!r)return;let e=r.steps[u];if(!e)return;p(r.persona,u);let n=D.current,i=hi(),a=i.after;E(null),O.current=null,j(),n.setMuted(b.current);let s=na(r.steps,u,o),l=s??ra(r.steps,u,o),d=e.ask?ri(e.ask):null,m=s?q({...s,question:d??s.question}):null,h=l?q(l):null,g=()=>{let t=e.beats??[];for(let e of t)Ji(e,n,h,a);if(e.note){let n=t.length?Math.min(...t.map(e=>e.atMs)):0;a(n,()=>E(ri(e.note??``)))}O.current=Date.now()+Xi(t)+(e.holdMs??ea)},_=e=>{let t=Date.now(),r=0,i=()=>{if(Date.now()-t>=Y){g();return}if(r=n.isSpeaking()||n.isBusy()?0:r+1,r>=7){g();return}a(250,i)};a(e,i)};if(e.ask&&m){let t=r.steps.slice(0,u+1).filter(e=>!!e.ask).length-1,i=t>0?o.frames[t-1]??null:null,s=!!e.viaChip&&!!i?.spec.suggests?.some(t=>t.label===e.ask),c=d??e.ask,l;s?(a(700,()=>n.pressKeepGoing(e.ask??c)),l=1600):l=_i(a,n.typeInto,c,400)+360,a(l,()=>gi(a,()=>n.showFrame(m,c))),_(l+ta)}else!n.hasCanvas()&&h&&n.showFrame(h,h.question,{silent:!0}),a(300,g);return i.cancel},[u,C,t,f,x,c,o,r,j]),(0,W.useEffect)(()=>{if(!t||!f||x||!h||c!==`ready`)return;let e=D.current,n=window.setInterval(()=>{let t=O.current;!t||Date.now()<t||e.isSpeaking()||e.isBusy()||(window.clearInterval(n),u+1>=a?(j(),S(!0)):d(u+1))},250);return()=>window.clearInterval(n)},[u,C,t,f,x,h,a,c,j]),(0,W.useEffect)(()=>()=>j(),[j]);let M=(0,W.useCallback)(()=>{_(),m(!0),g(!0),S(!1)},[]),N=(0,W.useCallback)((e,t)=>{_(),S(!1),t?.keepPlaying||g(!1),d(Math.max(0,Math.min(a-1,e))),w(e=>e+1)},[a]),P=(0,W.useCallback)(()=>{u+1>=a?(j(),S(!0)):N(u+1,{keepPlaying:!0})},[u,a,N,j]),F=(0,W.useCallback)(()=>N(u-1),[u,N]),I=(0,W.useCallback)(e=>N(e),[N]),L=(0,W.useCallback)(()=>{j(),m(!0),N(0),g(!0)},[N,j]),R=(0,W.useCallback)(()=>{if(_(),!f){M();return}if(x){L();return}g(e=>!e)},[x,L,M,f]),z=(0,W.useCallback)(()=>{_();let e=!b.current;b.current=e,y(e),D.current.setMuted(e),e&&D.current.cancelSpeech()},[]),B=(0,W.useCallback)(()=>{j(),S(!0)},[j]);return{active:t,started:f,loadState:c,model:o?.model??null,reload:A,index:u,total:a,step:t?i[u]??null:null,note:T,playing:h,muted:v,done:x,start:M,next:P,prev:F,jumpTo:I,toggle:R,toggleMute:z,replay:L,skip:B}}function aa(e){return/\p{Extended_Pictographic}/u.test(e)}function oa(){window.location.hash=`#/`}function sa({driver:e,member:t,onExit:n}){let r=(0,W.useRef)(null),i=e.active&&e.loadState===`ready`&&(!e.started||e.done);if(ae(r,{active:i}),!e.active)return null;let a={"--accent":t.accent};if(e.loadState===`loading`)return(0,G.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`demox-load`,style:a,children:[(0,G.jsx)(B.spinner,{className:`demox-spinner`}),`Loading curated replay…`]})});if(e.loadState===`error`)return(0,G.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`demox-card`,style:a,role:`alert`,children:[(0,G.jsx)(`p`,{className:`demox-card-title`,children:`This demo couldn’t load`}),(0,G.jsx)(`p`,{className:`demox-card-body`,children:`The curated prerecorded example did not come through. Check your connection and try again.`}),(0,G.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.reload,children:`Retry`}),(0,G.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:oa,children:`Back to home`})]})]})});if(!e.started)return(0,G.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{ref:r,className:`demox-card demox-start`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-start-title`,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(aa(t.avatar)?` emoji`:``),children:t.avatar}),(0,G.jsx)(`span`,{className:`demox-card-kicker`,children:`Curated prerecorded example`}),(0,G.jsxs)(`p`,{id:`demox-start-title`,className:`demox-card-title`,children:[`Watch: `,t.useCase]}),(0,G.jsx)(`p`,{className:`demox-card-body`,children:`This fictional scenario replays prerecorded, model-generated answers with curated feature choreography. Pause or move between steps at any time.`}),(0,G.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.start,children:`Start demo`}),(0,G.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:oa,children:`Back to home`})]})]})});if(e.done){let i=R.filter(e=>e.id!==t.id);return(0,G.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{ref:r,className:`demox-card demox-end`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-end-title`,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(aa(t.avatar)?` emoji`:``),children:t.avatar}),(0,G.jsx)(`p`,{id:`demox-end-title`,className:`demox-card-title`,children:`End of curated replay`}),(0,G.jsx)(`p`,{className:`demox-card-body`,children:`These model-generated answers were prerecorded, then replayed with curated feature choreography. The scenario is illustrative, not a live result or customer testimonial. Try your own question with your selected provider.`}),(0,G.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:n,children:`Try it yourself`}),(0,G.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:e.replay,children:`Replay`})]}),(0,G.jsx)(`div`,{className:`demox-others`,role:`group`,"aria-label":`More curated replays`,children:i.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`demox-other`,style:{"--accent":e.accent},onClick:()=>m(e.id),title:`${e.name} · ${e.role}`,children:[(0,G.jsx)(`span`,{className:`demox-other-avatar`+(aa(e.avatar)?` emoji`:``),children:e.avatar}),e.useCase]},e.id))})]})})}return(0,G.jsxs)(`div`,{className:`demox`,"aria-live":`polite`,children:[(0,G.jsxs)(`div`,{className:`demox-banner`,style:a,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(aa(t.avatar)?` emoji`:``),children:t.avatar}),(0,G.jsxs)(`span`,{className:`demox-who`,children:[(0,G.jsx)(`span`,{className:`demox-name`,children:t.useCase}),(0,G.jsxs)(`span`,{className:`demox-role`,children:[t.name,` · `,t.role]})]}),(0,G.jsx)(`span`,{className:`demox-badge`,children:`Curated replay`})]}),e.note&&(0,G.jsx)(`div`,{className:`demox-note`,style:a,children:e.note},e.note),(0,G.jsxs)(`div`,{className:`demox-panel`,style:a,role:`group`,"aria-label":`Demo controls`,children:[(0,G.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.prev,disabled:e.index===0,"aria-label":`Previous step`,children:(0,G.jsx)(B.chevL,{className:`demox-ic`})}),(0,G.jsx)(`button`,{type:`button`,className:`demox-btn demox-play`,onClick:e.toggle,"aria-label":e.playing?`Pause autoplay`:`Turn on autoplay`,children:e.playing?(0,G.jsx)(B.pause,{className:`demox-ic`}):(0,G.jsx)(B.play,{className:`demox-ic`})}),(0,G.jsx)(`button`,{type:`button`,className:`demox-btn demox-mute`,onClick:e.toggleMute,"aria-label":e.muted?`Turn narration on`:`Mute narration`,"aria-pressed":e.muted,title:e.muted?`Turn narration on`:`Mute narration`,children:e.muted?(0,G.jsx)(B.speakerOff,{className:`demox-ic`}):(0,G.jsx)(B.speaker,{className:`demox-ic`})}),(0,G.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.next,"aria-label":`Next step`,children:(0,G.jsx)(B.chevR,{className:`demox-ic`})}),(0,G.jsx)(`div`,{className:`demox-dots`,role:`tablist`,"aria-label":`Steps`,children:Array.from({length:e.total},(t,n)=>(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":n===e.index,"aria-label":`Step ${n+1}`,className:`demox-dot`+(n===e.index?` is-active`:``),onClick:()=>e.jumpTo(n)},n))}),(0,G.jsxs)(`button`,{type:`button`,className:`demox-skip`,onClick:n,"aria-label":`Exit demo, try it yourself`,children:[(0,G.jsx)(`span`,{className:`demox-skip-full`,children:`Exit, try it yourself`}),(0,G.jsx)(`span`,{className:`demox-skip-short`,"aria-hidden":`true`,children:`Exit`})]})]})]})}i();var ca=[`nasa-cfd`,`fomc`,`weather`,`cars`,`react-readme`],la=null;async function ua(){return la||(la=[...(await a(()=>import(`./prism.generated-BQkO5r6r.js`),[])).default.docs].sort((e,t)=>{let n=ca.indexOf(e.id),r=ca.indexOf(t.id);return(n<0?99:n)-(r<0?99:r)}).map(e=>({id:e.id,type:e.type,name:e.name,doc:{name:e.name,mime:e.mime,data:e.data,size:e.size},spec:{...e.spec,claims:e.spec.claims.map(e=>({...e,kind:Ut(e.kind)}))},proposed:e.proposed})),la)}var da=`How does $10,000 grow at 7% over 30 years?`;function fa(){let e=ni(`money`)?.frames[0]?.spec.blocks??[],t=ni(`monthly`)?.frames[0]?.spec.blocks??[],n=[],r=(e,t,r=1)=>{for(let i of t)for(let t of e)t.type===i&&t.id&&!n.includes(t)&&r-->0&&n.push(t)};return r(e,[`chart`]),r(e,[`stacked`,`stack`]),r(t,[`chart`]),r(t,[`kpi`,`stack`,`stacked`]),r(e,[`breakdown`]),n}function pa(){let e=Jt().find(e=>e.question===da);if(e)return e.id;let t=fa();if(t.length===0)return null;let n=Xt({title:`Investment growth · $10k at 7%`,question:da,topic:`money`});return n.thesis={text:`Your initial $10,000 grows by more than 7.6× through the power of compounding interest.`,saidAt:n.createdAt},n.widgets=t.map(e=>qt(e,`tour`)),n.cadence={data:`hourly`,ai:`daily`},n.nextDataAt=Gt(n.createdAt,Wt[n.cadence.data]),n.nextAiAt=Gt(n.createdAt,Yt[n.cadence.ai]),Kt(n),n.id}var ma=44,ha=2,ga=24e3;function _a(e,t,n){let r=(t,n)=>{for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))};r(0,`RIFF`),e.setUint32(4,36+t*ha,!0),r(8,`WAVE`),r(12,`fmt `),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,1,!0),e.setUint32(24,n,!0),e.setUint32(28,n*ha,!0),e.setUint16(32,ha,!0),e.setUint16(34,16,!0),r(36,`data`),e.setUint32(40,t*ha,!0)}function va(e,t,n,r){let i=ma+n*ha;for(let a=n;a<r;a++){let n=Math.max(-1,Math.min(1,t[a]));e.setInt16(i,n<0?n*32768:n*32767,!0),i+=ha}}function ya(e,t){let n=new ArrayBuffer(ma+e*ha),r=new DataView(n);return _a(r,e,t),{buffer:n,view:r}}function ba(){let e=globalThis.scheduler;return typeof e?.yield==`function`?e.yield():typeof MessageChannel==`function`?new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),t.port2.close(),e()},t.port2.postMessage(null)}):new Promise(e=>setTimeout(e,0))}async function xa(e,t,n=ba){let{buffer:r,view:i}=ya(e.length,t);for(let t=0;t<e.length;t+=ga)t>0&&await n(),va(i,e,t,Math.min(t+ga,e.length));return r}i();var Sa=512,Ca=16e3,wa=Sa/Ca*1e3,Ta=12,Ea=Math.ceil(90*Ca/Sa),Da=3,Oa=2,ka=.5,Aa=.35,ja=Math.round(300/wa);function Ma(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Na(e){let t=e&&typeof e==`object`&&`name`in e?String(e.name):void 0;return t===`NotAllowedError`||t===`SecurityError`?`not-allowed`:`audio`}function Pa(e){return e?45e3:25e3}var Fa=class t{mode=`vad`;capabilities;vad=null;vadLoading=!1;vadFailed=!1;phase=`idle`;muted=!1;wantRunning=!1;continuous=!1;disposed=!1;sessionId=0;transcriptionAborts=new Set;transcriptionChain=Promise.resolve();queuedTranscriptions=0;activeTranscriptions=0;transcriptionSlotWaiters=[];preRollFrames=[];utteranceFrames=[];quietFrames=0;speechEnding=!1;captureCtx=null;maveaSpeaking=!1;echoTailUntil=0;onBargeIn;utteranceIsEcho=!1;bargeInTimer=null;static ECHO_TAIL_MS=600;static WHISPER_RETRY_MS=1e4;whisperOk=null;whisperRetryAt=0;resultSubs=new Set;stateSubs=new Set;constructor(){let e=typeof navigator<`u`&&typeof navigator.mediaDevices?.getUserMedia==`function`;this.capabilities={stt:e,tts:!1,canUseRealVoice:e}}start(e){if(!this.muted){if(e?.continuous!==void 0&&(this.continuous=e.continuous),this.wantRunning||(this.sessionId+=1),this.wantRunning=!0,this.vadFailed){this.emitState({phase:`idle`,error:`unsupported`});return}this.vad?this.startVad():this.loadVad()}}stop(){this.wantRunning=!1,this.continuous=!1,this.sessionId+=1,this.abortTranscriptions(),this.pauseVad(),this.clearBargeInTimer(),this.clearSpeechEnding(),this.preRollFrames=[],this.utteranceFrames=[],this.phase!==`idle`&&this.emitState({phase:`idle`})}forceStop(){if(this.phase===`transcribing`){this.continuous=!1,this.wantRunning=!1,this.pauseVad(),this.emitState({phase:`transcribing`});return}let e=this.continuous;this.wantRunning=e,this.pauseVad(),this.clearBargeInTimer(),this.clearSpeechEnding();let t=Ma([...this.utteranceFrames,...this.preRollFrames]);this.preRollFrames=[],this.utteranceFrames=[],this.utteranceIsEcho=!1,t.length>0?(this.emitState({phase:`transcribing`}),this.enqueueTranscription(t,this.sessionId,e)):(this.emitState({phase:`idle`}),e&&this.startVad())}speak(e){return Promise.resolve()}cancel(){this.stop()}setMuted(e){this.muted=e,e&&this.stop()}setMaveaSpeaking(e){this.maveaSpeaking&&!e&&(this.echoTailUntil=Date.now()+t.ECHO_TAIL_MS),this.maveaSpeaking=e}setSoundEnabled(e){}onResult(e){return this.resultSubs.add(e),()=>this.resultSubs.delete(e)}onStateChange(e){return this.stateSubs.add(e),()=>this.stateSubs.delete(e)}dispose(){this.disposed=!0,this.wantRunning=!1,this.sessionId+=1,this.abortTranscriptions(),this.releaseWaitingTranscriptions(),this.clearBargeInTimer();let e=this.takeCaptureContextCloser();this.vad?(this.vad.destroy().catch(()=>{}).then(e),this.vad=null):e(),this.resultSubs.clear(),this.stateSubs.clear()}async loadVad(){if(!this.vadLoading){this.vadLoading=!0;try{let{MicVAD:t}=await a(async()=>{let{MicVAD:t}=await import(`./dist-kNHRtoqd.js`).then(t=>e(t.default,1));return{MicVAD:t}},__vite__mapDeps([0,1,2])),n=this.ensureCaptureContext();if(this.vad=await t.new({model:`v5`,startOnLoad:!1,baseAssetPath:`/`,onnxWASMBasePath:`/`,...n?{audioContext:n}:{},positiveSpeechThreshold:ka,negativeSpeechThreshold:Aa,minSpeechMs:280,preSpeechPadMs:500,redemptionMs:1600,onFrameProcessed:(e,t)=>{this.captureFrame(t),this.trackSpeechTail(e.isSpeech)},onSpeechStart:()=>this.handleSpeechStart(),onSpeechRealStart:()=>this.handleSpeechRealStart(),onSpeechEnd:e=>void this.handleSpeechEnd(e),onVADMisfire:()=>this.handleMisfire()}),this.disposed){let e=this.takeCaptureContextCloser();this.vad.destroy().catch(()=>{}).then(e),this.vad=null;return}this.vadLoading=!1,this.wantRunning&&this.startVad()}catch(e){console.warn(`[VadVoice] Local Silero VAD failed to load`,e),this.vadLoading=!1,this.vadFailed=!0,this.wantRunning&&this.emitState({phase:`idle`,error:`unsupported`})}}}clearBargeInTimer(){this.bargeInTimer!==null&&(clearTimeout(this.bargeInTimer),this.bargeInTimer=null)}ensureCaptureContext(){if(this.captureCtx||this.disposed)return this.captureCtx;if(typeof AudioContext!=`function`)return null;try{this.captureCtx=new AudioContext}catch{this.captureCtx=null}return this.captureCtx}takeCaptureContextCloser(){let e=this.captureCtx;return this.captureCtx=null,()=>{e?.close().catch(()=>{})}}startVad(){this.vad&&(this.captureCtx?.state===`suspended`&&this.captureCtx.resume().catch(()=>{}),Promise.resolve(this.vad.start()).catch(e=>{!this.disposed&&this.wantRunning&&(this.wantRunning=!1,this.emitState({phase:`idle`,error:Na(e)}))}))}pauseVad(){this.vad&&Promise.resolve(this.vad.pause()).catch(()=>{}).then(()=>this.suspendCaptureContext())}suspendCaptureContext(){this.wantRunning||this.disposed||this.captureCtx?.state===`running`&&this.captureCtx.suspend().catch(()=>{})}captureFrame(e){if(this.phase===`listening`&&!this.utteranceIsEcho){this.utteranceFrames.length<Ea&&this.utteranceFrames.push(e);return}this.preRollFrames.push(e),this.preRollFrames.length>Ta&&this.preRollFrames.shift()}trackSpeechTail(e){if(!(this.phase!==`listening`||this.utteranceIsEcho)){if(e>=ka){this.quietFrames=0,this.speechEnding&&(this.speechEnding=!1,this.emitState({phase:`listening`,speechEnding:!1}));return}e>=Aa||this.speechEnding||(this.quietFrames+=1,!(this.quietFrames<ja)&&(this.speechEnding=!0,this.emitState({phase:`listening`,speechEnding:!0})))}}clearSpeechEnding(){this.quietFrames=0,this.speechEnding=!1}handleSpeechStart(){this.muted||(this.clearSpeechEnding(),this.utteranceIsEcho=Date.now()<this.echoTailUntil,this.utteranceFrames=this.preRollFrames,this.preRollFrames=[],!this.utteranceIsEcho&&this.emitState({phase:`listening`}))}handleSpeechRealStart(){this.muted||(this.utteranceIsEcho&&!this.maveaSpeaking&&(this.utteranceIsEcho=!1,this.utteranceFrames=[...this.utteranceFrames,...this.preRollFrames],this.preRollFrames=[],this.emitState({phase:`listening`})),!this.utteranceIsEcho&&this.maveaSpeaking&&this.onBargeIn?.())}handleMisfire(){this.clearBargeInTimer(),this.clearSpeechEnding(),this.utteranceIsEcho=!1,this.utteranceFrames=[],this.continuous||(this.wantRunning=!1,this.pauseVad()),this.phase!==`idle`&&this.emitState({phase:`idle`})}handleSpeechEnd(e){if(this.clearBargeInTimer(),this.clearSpeechEnding(),this.utteranceIsEcho){this.utteranceIsEcho=!1,this.utteranceFrames=[],this.emitState({phase:`idle`});return}this.utteranceFrames=[],this.continuous||(this.wantRunning=!1,this.pauseVad()),this.emitState({phase:`transcribing`}),this.enqueueTranscription(e,this.sessionId)}enqueueTranscription(e,t,n=!1){if(this.queuedTranscriptions>=Da){this.emitState({phase:`idle`,error:`audio`}),n&&this.wantRunning&&this.startVad();return}this.queuedTranscriptions+=1;let r=this.runTranscription(e,t);this.transcriptionChain=this.transcriptionChain.catch(()=>{}).then(async()=>{try{this.deliverTranscription(await r,t,n)}finally{--this.queuedTranscriptions}})}async runTranscription(e,t){await this.acquireTranscriptionSlot();let n=new AbortController;this.transcriptionAborts.add(n);try{if(this.disposed||t!==this.sessionId)return null;let r=await this.transcribeWhisper(e,n.signal);return this.disposed||n.signal.aborted||t!==this.sessionId?null:r}catch{return null}finally{this.transcriptionAborts.delete(n),this.releaseTranscriptionSlot()}}deliverTranscription(e,t,n){if(!e||this.disposed||t!==this.sessionId)return;let r=e.text.trim();if(!r){this.emitState({phase:`idle`,error:e.error??`no-speech`}),n&&this.wantRunning&&this.startVad();return}let i=e.confidence!==void 0&&e.confidence<.7||(e.noSpeechProbability??0)>=.6;this.emitState({phase:`heard`,transcript:r}),this.emitResult({transcript:r,confidence:e.confidence,noSpeechProbability:e.noSpeechProbability,lowConfidence:i}),this.emitState({phase:`idle`}),n&&this.wantRunning&&this.startVad()}acquireTranscriptionSlot(){return this.activeTranscriptions<Oa?(this.activeTranscriptions+=1,Promise.resolve()):new Promise(e=>this.transcriptionSlotWaiters.push(e))}releaseTranscriptionSlot(){let e=this.transcriptionSlotWaiters.shift();e?e():--this.activeTranscriptions}releaseWaitingTranscriptions(){let e=this.transcriptionSlotWaiters.splice(0);this.activeTranscriptions+=e.length,e.forEach(e=>e())}abortTranscriptions(){for(let e of this.transcriptionAborts)e.abort();this.transcriptionAborts.clear()}async transcribeWhisper(e,t){let n=await this.transcribeWhisperDetailed(e,t);return t?n:n.text}async transcribeWhisperDetailed(e,n){if(this.whisperOk===!1&&Date.now()<this.whisperRetryAt)return{text:``,error:`transcription`};try{let t=await xa(e,Ca),r=new FormData;r.append(`file`,new Blob([t],{type:`audio/wav`}),`speech.wav`),r.append(`language`,`en`),r.append(`response_format`,`verbose_json`);let i=Pa(this.whisperOk===!0),a=AbortSignal.timeout(i),o=n?AbortSignal.any([n,a]):a,s=await fetch(`/stt/inference`,{method:`POST`,body:r,signal:o});if(s.ok){let e=await s.json(),t=e.text?.trim()??``;if(this.whisperOk=!0,this.whisperRetryAt=0,t){let n=[...e.words??[],...(e.segments??[]).flatMap(e=>e.words??[])].map(e=>e.probability).filter(e=>Number.isFinite(e)),r=(e.segments??[]).map(e=>e.avg_logprob).filter(e=>Number.isFinite(e)),i=n.length>0?n.reduce((e,t)=>e+t,0)/n.length:r.length>0?Math.exp(r.reduce((e,t)=>e+t,0)/r.length):void 0,a=(e.segments??[]).map(e=>e.no_speech_prob).filter(e=>Number.isFinite(e));return{text:t,confidence:i,noSpeechProbability:a.length>0?Math.max(...a):void 0}}return{text:``,error:`no-speech`}}}catch(e){if(e instanceof DOMException&&(e.name===`TimeoutError`||e.name===`AbortError`))return{text:``,error:`transcription`}}return this.whisperOk!==!0&&(this.whisperOk=!1,this.whisperRetryAt=Date.now()+t.WHISPER_RETRY_MS),{text:``,error:`transcription`}}emitResult(e){this.resultSubs.forEach(t=>t(e))}emitState(e){this.phase=e.phase,this.stateSubs.forEach(t=>t(e))}};function Ia(){return new Fa}function La(e={}){let t=(0,W.useRef)(e.onResult),n=(0,W.useRef)(e.onStateChange),r=(0,W.useRef)(e.onBargeIn);t.current=e.onResult,n.current=e.onStateChange,r.current=e.onBargeIn;let i=(0,W.useMemo)(()=>Ia(),[]);return(0,W.useEffect)(()=>{let e=i.onResult(e=>t.current?.(e)),a=i.onStateChange(e=>n.current?.(e));return`onBargeIn`in i&&(i.onBargeIn=()=>r.current?.()),()=>{e(),a(),i.dispose()}},[i]),(0,W.useMemo)(()=>({mode:i.mode,capabilities:i.capabilities,start:e=>i.start(e),stop:()=>i.stop(),speak:e=>i.speak(e),cancel:()=>i.cancel(),setMuted:e=>i.setMuted(e),setSoundEnabled:e=>i.setSoundEnabled(e),setMaveaSpeaking:e=>i.setMaveaSpeaking?.(e),forceStop:()=>i.forceStop?.()}),[i])}var Ra=`mavea-always-on`;function za(e,t,n=!1,r=`neutral`,i=!1,a=!1){if(t)return{state:`listening`,emotion:`neutral`,gaze:`center`};if(n)return i?{state:`showing`,emotion:`surprised`,gaze:`center`}:{state:`speaking`,emotion:`surprised`,gaze:`center`};if(a)return{state:`loading`,emotion:`neutral`,gaze:`center`};switch(e){case`thinking`:return{state:`loading`,emotion:`neutral`,gaze:`center`};case`speaking`:return i?{state:`showing`,emotion:r,gaze:`center`}:{state:`speaking`,emotion:r,gaze:`center`};case`showing`:return{state:`showing`,emotion:r,gaze:`right`};default:return{state:`idle`,emotion:r,gaze:`center`}}}var Ba=new Set([`no`,`caution`,`avoid`,`risk`,`wait`]),Va=new Set([`yes`,`go`,`recommended`,`good`]);function Ha(e,t){let n=e.props[t];return typeof n==`string`?n.toLowerCase():void 0}function Ua(e){let t=e?.blocks;if(!t?.length)return`neutral`;let n=!1,r=e?.awaiting===!0;for(let e of t){let t=Ha(e,`tone`);(t===`warn`||t===`neg`)&&(n=!0),t===`pos`&&(r=!0);let i=Ha(e,`stance`);i&&Ba.has(i)&&(n=!0),i&&Va.has(i)&&(r=!0),e.type===`insight`&&e.props.conf===`unverified`&&(n=!0)}return n?`concerned`:r?`warm`:`neutral`}function Wa(e){switch(e){case`concerned`:return`concerned`;case`warm`:return`warm`;default:return`neutral`}}function Ga(e){return Wa(Ua(e))}function Ka(e){let t=e?.blocks;return!t?.length||Ua(e)!==`warm`?!1:t.some(e=>{let t=Ha(e,`stance`);return t!==void 0&&Va.has(t)})}var qa={clipShared:[`Nice — that one's worth sharing.`,`Off it goes.`,`Clipped and ready to share.`]};Object.keys(qa);function Ja(e,t,n){let r=qa[e];if(r.length===0)return``;let i=Math.abs(Math.trunc(t))%r.length;return r.length>1&&r[i]===n&&(i=(i+1)%r.length),r[i]}function Ya(){return{lastAt:0,lastTurn:-1/0}}function Xa(e,t){return!(e.lastAt!==0&&t.now-e.lastAt<9e4||t.turnCount-e.lastTurn<3)}function Za(e,t){return{lastAt:t.now,lastTurn:t.turnCount}}var Qa=1100,$a=6e3,eo=150,to=950,no=350,ro=8;function io(e){let{muted:t,turnCount:n,gates:r}=e,i=(0,W.useRef)(e.speak),a=(0,W.useRef)(e.cancelSpeak),o=(0,W.useRef)(e.isSpeaking);i.current=e.speak,a.current=e.cancelSpeak,o.current=e.isSpeaking;let[s,c]=(0,W.useState)([]),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(null),[p,m]=(0,W.useState)(0),h=(0,W.useRef)(Ya()),g=(0,W.useRef)(void 0),_=(0,W.useRef)(null),v=(0,W.useRef)(null),y=(0,W.useCallback)(()=>{_.current&&=(clearTimeout(_.current),null),v.current&&=(clearTimeout(v.current),null)},[]),b=(0,W.useCallback)(e=>{c(t=>t.length>=ro||t[t.length-1]===e?t:[...t,e])},[]),x=(0,W.useCallback)(()=>{y(),u(!1),v.current=setTimeout(()=>{v.current=null,f(null)},to)},[y]),S=(0,W.useCallback)(e=>{let t=()=>{let n=Date.now()-e;n>=Qa&&!o.current()||n>=$a?x():_.current=setTimeout(t,eo)};_.current=setTimeout(t,Qa)},[x]),C=r.atRest&&!r.busy&&!r.listening&&!r.introHold&&r.hasCanvas&&!r.modalOpen;(0,W.useEffect)(()=>{if(l||d!==null||!C||s.length===0)return;if(o.current()){let e=setTimeout(()=>m(e=>e+1),no);return()=>clearTimeout(e)}let e=s[0],r=Date.now();if(!Xa(h.current,{type:e,now:r,turnCount:n})){c(e=>e.slice(1));return}h.current=Za(h.current,{type:e,now:r,turnCount:n});let a=Ja(e,r,g.current);g.current=a,c(e=>e.slice(1)),f(a),u(!0),!t&&a&&i.current(a),S(r)},[l,d,C,s,n,t,S,p]),(0,W.useEffect)(()=>{if(!l)return;let e=r.busy||!r.atRest,t=r.listening||r.modalOpen;!e&&!t||(y(),u(!1),f(null),c([]),g.current=void 0,t&&!e&&a.current())},[l,r.busy,r.atRest,r.listening,r.modalOpen,y]);let w=(0,W.useCallback)(()=>{y(),c([]),u(!1),f(null),h.current=Ya(),g.current=void 0},[y]);return(0,W.useEffect)(()=>()=>y(),[y]),{interjecting:l,line:d,enqueue:b,reset:w}}function ao(e){let t=(0,J.c)(36),{chapters:n,currentIndex:r,onJump:i,onClose:a}=e,o=(0,W.useRef)(null),s;if(t[0]===a?s=t[1]:(s={onEscape:a},t[0]=a,t[1]=s),ae(o,s),n.length===0)return null;let c;t[2]===n?c=t[3]:(c=Nt(n),t[2]=n,t[3]=c);let l=c,u;t[4]!==n||t[5]!==r?(u=n.find(e=>e.moments.some(e=>e.frameIndex===r))?.color,t[4]=n,t[5]=r,t[6]=u):u=t[6];let d=u,f;t[7]===a?f=t[8]:(f=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=f);let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.jsx)(`h2`,{className:`ovw-title`,children:`Your conversation`}),t[9]=p):p=t[9];let m=n.length===1?`chapter`:`chapters`,h=l===1?`moment`:`moments`,g;t[10]!==n.length||t[11]!==m||t[12]!==h||t[13]!==l?(g=(0,G.jsxs)(`header`,{className:`ovw-head`,children:[p,(0,G.jsxs)(`p`,{className:`ovw-sub`,children:[n.length,` `,m,` · `,l,` `,h,` — tap anywhere to dive back in`]})]}),t[10]=n.length,t[11]=m,t[12]=h,t[13]=l,t[14]=g):g=t[14];let _;if(t[15]!==n||t[16]!==r||t[17]!==a||t[18]!==i){let e;t[20]!==r||t[21]!==a||t[22]!==i?(e=e=>(0,G.jsxs)(`section`,{className:`ovw-card`,style:{"--card-c":e.color},children:[(0,G.jsxs)(`div`,{className:`ovw-card-head`,children:[(0,G.jsx)(`span`,{className:`ovw-card-dot`}),(0,G.jsx)(`h3`,{className:`ovw-card-title`,children:e.title}),(0,G.jsx)(`span`,{className:`ovw-card-count`,children:e.moments.length})]}),(0,G.jsx)(`ul`,{className:`ovw-moments`,children:e.moments.map(e=>{let t=e.frameIndex===r,n=B[e.icon]||B.mic;return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,className:`ovw-moment`+(t?` is-current`:``),onClick:()=>{i(e.frameIndex),a()},"aria-current":t?`true`:void 0,children:[(0,G.jsx)(n,{}),(0,G.jsx)(`span`,{className:`ovw-moment-q`,children:e.question||`Moment`})]}),e.elements.length>0&&(0,G.jsx)(`ul`,{className:`ovw-els`,children:e.elements.map(t=>{let n=t.icon&&B[t.icon]||B.spark;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,className:`ovw-el`,onClick:()=>{i(e.frameIndex,t.id),a()},"aria-label":`Jump to "${t.label}" in "${e.question||`this moment`}"`,children:[(0,G.jsx)(n,{}),(0,G.jsx)(`span`,{className:`ovw-el-label`,children:t.label})]})},t.id)})})]},e.frameIndex)})})]},e.id),t[20]=r,t[21]=a,t[22]=i,t[23]=e):e=t[23],_=n.map(e),t[15]=n,t[16]=r,t[17]=a,t[18]=i,t[19]=_}else _=t[19];let v;t[24]===_?v=t[25]:(v=(0,G.jsx)(`div`,{className:`ovw-grid`,children:_}),t[24]=_,t[25]=v);let y;t[26]!==v||t[27]!==g?(y=(0,G.jsxs)(`div`,{className:`ovw-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":`Conversation overview`,ref:o,onClick:oo,children:[g,v]}),t[26]=v,t[27]=g,t[28]=y):y=t[28];let b;t[29]!==a||t[30]!==y||t[31]!==f?(b=(0,G.jsx)(`div`,{className:`ovw-scrim`,onClick:a,role:`button`,tabIndex:0,"aria-label":`Close conversation overview`,onKeyDown:f,children:y}),t[29]=a,t[30]=y,t[31]=f,t[32]=b):b=t[32];let x;return t[33]!==d||t[34]!==b?(x=(0,G.jsx)(Ve,{accent:d,children:b}),t[33]=d,t[34]=b,t[35]=x):x=t[35],x}function oo(e){return e.stopPropagation()}function so(e){let t=new Map;for(let n of e)for(let e of n.spec?.sources??[])e?.url&&!t.has(e.url)&&t.set(e.url,e);return[...t.values()]}function co(e,t={}){if(e.length<2)return null;let n=e[e.length-1]?.spec;if(!n)return null;let r=t.cap??1/0,i=e.reduce((e,t)=>U(e,t.spec?.blocks??[],`augment`).blocks,[]),a=i.length>r,o=a?i.slice(0,r):i,s=e.length,c=a?`${s} moments in this thread · showing the first ${r} cards`:`${s} moments in this thread`,l=so(e);return{...n,id:t.id??n.id,title:t.title??n.title,sub:c,blocks:o,sources:l.length?l:n.sources,tint:t.tint??n.tint,suggests:[],bend:void 0,awaiting:void 0,blanks:void 0}}var lo=240;function uo(e){let{stops:t,from:n=0,spokenWalk:r,withNotes:i,teach:a,marksById:o}=e,s=[],c=0;for(let e=n;e<t.length;e++){let n=t[e].spot;if(!n)continue;let l=t[e].line;if(r&&e>0&&i&&l){let e=ut(l);e&&s.push({spot:n,line:l,noteText:e})}let u=o.get(n);if(u?.length){let e=u.length>1;for(let t=0;t<u.length;t++){let r=t===u.length-1;s.push({spot:n,line:l,mark:u[t],generous:a,delayMs:c*lo,badgeMs:r?lt+(u.length-1)*lo:void 0,stepNumber:e?t+1:void 0}),c++}}else a&&(s.push({spot:n,line:l,generous:!0,delayMs:c*lo}),c++)}return s}var fo=1100,po=1700;function mo(e,t,n){let{controller:r,release:i}=e,a=!1,o=e=>{a||(a=!0,i(),n(e))},s=()=>t.isCancelled()?`cancelled`:t.isDismissed()?`dismissed`:null;(async()=>{for(let e=0;e<r.count;e++){let n=s();if(n){o(n);return}let i=r.spokenFor(e)??r.captionFor(e);if(i){let n=t.speakLine(i),a=await Qe(n),c=s();if(c){o(c);return}r.setIndex(e),a?await ot(n,po,fo):await it(po)}else r.setIndex(e),await it(po)}let e=s();o(e??`complete`)})()}function ho(e){let t=(0,J.c)(8),{items:n,onSeeHow:r}=e;if(n.length===0)return null;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`span`,{className:`card-eyebrow start-with-head`,children:`Or start a different way`}),t[0]=i):i=t[0];let a;if(t[1]!==n||t[2]!==r){let e;t[4]===r?e=t[5]:(e=e=>(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,className:`start-with-card`+(e.available?``:` is-unavailable`),onClick:e.run,onPointerEnter:e.preload,onFocus:e.preload,children:[(0,G.jsx)(`span`,{className:`start-with-label`,children:e.feature.label}),(0,G.jsx)(`span`,{className:`start-with-blurb`,children:e.available?e.blurb??e.feature.blurb:e.reason??e.blurb??e.feature.blurb})]}),r&&e.feature.tourChapter&&(0,G.jsxs)(`button`,{type:`button`,className:`start-with-see`,onClick:()=>r(e.feature),"aria-label":`See how ${e.feature.label} works`,children:[(0,G.jsx)(B.play,{}),` See how`]})]},e.feature.id),t[4]=r,t[5]=e),a=n.map(e),t[1]=n,t[2]=r,t[3]=a}else a=t[3];let o;return t[6]===a?o=t[7]:(o=(0,G.jsxs)(`section`,{className:`start-with`,"aria-label":`Ways to start`,children:[i,(0,G.jsx)(`ul`,{className:`start-with-grid`,children:a})]}),t[6]=a,t[7]=o),o}var go=[`pdf-world`,`just-listen`,`watch-me-think`,`deepzoom`,`delegate`,`courses`,`synthesis`,`ripple`];function _o(e){return e.length===0?{blurb:`Choose a PDF, Office doc, or data file to map its claims`,opensPicker:!0}:{blurb:e.length===1?`Open the map for ${e[0].name}`:`Open the map across ${e.length} documents`,opensPicker:!1}}var vo=new Set([`just-listen`,`watch-me-think`]);function yo(e,t,n){if(e.length===0)return e;let r=new Map;n.forEach((e,t)=>{let n=We(e),i=r.get(n);i?i.push(t):r.set(n,[t])});let i=new Map;n.forEach((e,t)=>{let n=We(e);i.has(n)||i.set(n,t)});let a=e=>{if(e.kind!==`connect`)return e;let n=t[e.onIndex??-1],r=n?i.get(We(n)):void 0;return r===void 0?void 0:{...e,onIndex:r}},o=e=>{let t=(e.marks??(e.mark?[e.mark]:[])).map(a).filter(e=>!!e);return t.length?{mark:t[0],...t.length>1?{marks:t}:{}}:{}},s=[],c=new Set;for(let n of e){let e=t[n.index];if(!e)continue;let i=r.get(We(e))?.shift();if(i===void 0||c.has(i))continue;c.add(i);let{mark:a,marks:l}=o(n),u={...n,index:i,mark:a,marks:l},d=i===n.index&&a===n.mark&&l===n.marks;s.push(d?n:u)}return s}function bo(e,t,n,r,i){let a={question:n,narration:r.narration,title:r.spec.title,blockTypes:r.spec.blocks.map(e=>e.type)},o=Ue(e,a,r.continuity,r.tier),s=!e||o===`replace`&&Ge(e,a)<.15,c=i?.forceReplace?`replace`:o,l=U(t,r.spec.blocks,c);c!==`replace`&&l.overflow&&(c=`replace`,l=U(t,r.spec.blocks,`replace`));let u={...r.spec,blocks:l.blocks};c!==`replace`&&delete u.bend;let d=c===`replace`?l.blocks.find(e=>e.id)?.id??null:l.firstNewId,f=yo(r.tour??[],r.spec.blocks,l.blocks),p=Date.now();return{frame:{id:qe(p),question:n,narration:r.narration,...r.spoken?{spoken:r.spoken}:{},mode:c,topicShift:s,tour:f,spec:u,at:p,...r.corrects?{corrects:r.corrects}:{}},mode:c,spot:d,snap:a}}var xo={like:`Likes`,love:`Loves`,prefer:`Prefers`,enjoy:`Enjoys`,hate:`Hates`,dislike:`Dislikes`,need:`Needs`,want:`Wants`,own:`Owns`,use:`Uses`,drive:`Drives`,play:`Plays`,speak:`Speaks`,work:`Works`,live:`Lives`,study:`Studies`,train:`Trains`,teach:`Teaches`,code:`Codes`,run:`Runs`,cook:`Cooks`,travel:`Travels`},So=3,Co=140;function wo(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function To(e){let t=e.trim().replace(/\s+/g,` `);if(!t||t.length>Co||t.includes(`?`))return``;let n=t.toLowerCase(),r;if(r=t.match(/^i(?:'m| am)\s+(an?\s+.+)/i))return Eo(`Is ${r[1]}`);if(r=t.match(/^i(?:'m| am)\s+(.+)/i))return Eo(r[1]);if(r=t.match(/^i(?:'ve| have)\s+(?:got\s+)?(.+)/i))return Eo(`Has ${r[1]}`);if(r=t.match(/^my\s+(.+?)\s+(is|are)\s+(.+)/i))return Eo(`${r[1]} ${r[2]} ${r[3]}`);if(r=n.match(/^i\s+(\w+)\s+(.+)/)){let e=xo[r[1]];if(e)return Eo(`${e} ${t.slice(t.toLowerCase().indexOf(r[2]))}`)}return``}function Eo(e){let t=wo(e.trim().replace(/\s+/g,` `));return t.length>=6&&t.length<=Co?t:``}function Do(e){if(!e)return[];let t=e.split(/[.!?\n]+|,?\s+\band\b\s+/i),n=[];for(let e of t){let t=To(e);if(t&&!n.includes(t)&&n.push(t),n.length>=So)break}return n}var Oo=.6,ko=.5;function Ao(e){return(e.match(/\d[\d,.]*\d|\d/g)??[]).map(e=>e.replace(/,/g,``).replace(/\.+$/,``))}function jo(e,t){let n=Ao(e);if(!n.length)return!1;let r=new Set(Ao(t));return n.some(e=>!r.has(e))}function Mo(e,t,n={}){if(!jo(e,t)){let n=jn(e),r=jn(t);if(n.size>0&&Fn(n,r)>=Oo)return`user-stated`}return n.webGrounded?`web-grounded`:`model-inferred`}function No(e,t){let n=Ao(e),r=new Set(Ao(t));if(n.length)return n.every(e=>r.has(e))?`user-stated`:`model-inferred`;let i=jn(e);return i.size>0&&Fn(i,jn(t))>=ko?`user-stated`:`model-inferred`}var Po=24;function Fo(e,t=`item`){let n=e.toLowerCase().match(/[a-z][a-z0-9]*/g);return(n&&n[0]?n[0]:t).slice(0,Po)}function Io(e,t={}){return{concept:`corrections.${Fo(e.what)}`,body:`On "${e.what}", an earlier answer said ${e.was}; the user corrected it to ${e.now}. Use the corrected value and double-check figures like this before stating them.`,kind:`procedural`,source:t.source??`user-stated`,verify:!0,outcome:`loss`,turnId:t.turnId,quote:e.now}}var Lo=4,Ro=1600,zo=24,Bo=`Break ONE cause into the parts it is MADE OF (components or segments) — never its causes or its effects, which are separate nodes. Return ONLY compact JSON, one line.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-kNHRtoqd.js","assets/rolldown-runtime-DkW27tQK.js","assets/preload-helper-CiWYd9n-.js","assets/generateLive-CDIkclO4.js","assets/blockLabel-FogyzEQY.js","assets/deepenStore-BWLLzLCY.js","assets/catalog-BHjl-1uH.js","assets/http-Bqk6nJiH.js","assets/history-D2EH2X6D.js","assets/number-zqlPMliA.js","assets/catalog-vLsIS_Na.js","assets/facts-CNQz8OQz.js","assets/blockTypes-DUDdP3pB.js","assets/streamParse-BX0bAppQ.js","assets/liveSchema-eKgFc5D0.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/safeImageUrl-BINWXOTz.js","assets/empty-D51uhW0E.js","assets/sourceHost-BV3t2XDb.js","assets/spokenText-Dy-GZvZV.js","assets/annotations-CftUUB13.js","assets/contentVault-XKWjF2FB.js","assets/keyVault-Aw5Y2PjT.js","assets/screen-DFWKge3-.js","assets/attachments-BW-vki-E.js","assets/providers-CPhoN8j0.js","assets/info-CiqHR5cs.js","assets/route-CMdTFx0P.js","assets/effort-QeWrMtZt.js","assets/index-BMeoXWPR.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/speed-BOytg6bC.js","assets/cache-7UEbF3S6.js","assets/validate-MQG0EcTD.js","assets/types-C42I77wh.js","assets/json-J4Y32_i9.js","assets/verbatim-DBTj9sPD.js","assets/citation-BsSvaaer.js","assets/receipts-D7zveV-I.js","assets/officeDoc-GU6Cssjf.js","assets/csv-DAqzYXUs.js","assets/search-ZN7v_P5B.js","assets/store-DqOaVRLn.js","assets/ready-_sg3IJkE.js","assets/shapes-BwXCYTlu.js","assets/ledger-BssK9Pv2.js","assets/now-C9-UAzTC.js","assets/select-StjZ4ZRN.js","assets/offers-eBNj_lSP.js","assets/scale-Bcgfo6Hp.js","assets/spreadLabels-CQ8hufvK.js","assets/TopicCanvas-CyBGLgb0.js","assets/loader-BRfSnl9t.js","assets/FallbackCard-CUe6i-zT.js","assets/FallbackCard-D_6ps1xA.css","assets/useFocusTrap-CJmpNZv2.js","assets/motion-BY_Egaxm.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/CanvasSkeleton-BmGjJHUQ.js","assets/CanvasSkeleton-DYASkTjW.css","assets/richText-BkxJhl9N.js","assets/toast-BBNs2h3L.js","assets/format-q0LwBjID.js","assets/useValidatedImage-BQi2c66o.js","assets/lib-Dkb5WBRc.js","assets/BlockEmpty-B-giiUPy.js","assets/motion-DxHSlPN6.js","assets/lib-DP9Kuxqk.css","assets/TopicCanvas-sGuo7pnQ.css","assets/HowItWorks-D4lHSwEb.js","assets/generateBeats-Da9RmZke.js","assets/walkSync-CRhkAQFu.js","assets/kokoro-DcP-u0Tl.js","assets/nextFrame-12y0UrAd.js","assets/canvas-BX595EVB.js","assets/CommandPalette-Cz8h94Jd.js","assets/registry-BodYWiga.js","assets/CommandPalette-Bb-eErih.css","assets/Library-CDgWdTiF.js","assets/sentenceCase-CLDiNB0f.js","assets/store-C9s8Bfz0.js","assets/localBudget-CxLP6bjE.js","assets/neighborhoods-B56WegJs.js","assets/chapters-DcdG3Lu8.js","assets/threads-DNfxMTwx.js","assets/time-BHTmJR1s.js","assets/Library-DmrtHjUf.css","assets/LiveSettings-C7luyoWU.js","assets/FeatureUseNotice-BNDajs0p.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/useLiveConfig-CvOQTr0s.js","assets/quietHours-uFS7n8N6.js","assets/DropSelect-BVDNR47E.js","assets/DropSelect-B4lqCEjw.css","assets/TemplatePicker-CAC4ggbJ.js","assets/store-D2IJF4SA.js","assets/useStudy-70Iz4ZVn.js","assets/queue-Adae4IzW.js","assets/LiveSettings-Dho0OxlM.css","assets/DashboardDetail-B5JZ6fRz.js","assets/store-D16dGt7I.js","assets/route-D4kd-D3B.js","assets/useDashboards-B-EjE8FH.js","assets/format-BkvssSOr.js","assets/ledger-DHS2di3l.js","assets/dataPending-DGdCvY5Y.js","assets/AreaChart-DZGCSEwt.js","assets/tiles-D-s6v-mA.js","assets/tiles-CBiVVjtT.css","assets/useDashboardLoop-DEE_sLT0.js","assets/predictions-CkVKHq-5.js","assets/notify-Bz4wuE4T.js","assets/dashboardEvents-BV0Ly6No.js","assets/confirmAdd-D_hDIeaD.js","assets/planTracker-BA-x4jbw.js","assets/pin-Bic4-gim.js","assets/pin-BXyyKnci.css","assets/CadenceCard-j1V7XOxX.js","assets/CheckLogRail-CeRhbIwa.js","assets/useLedger-D4cXEwI0.js","assets/checkLogModel-BMtruriG.js","assets/CheckLogRail-BOaXnqWK.css","assets/DashboardDetail-8J8TsdQg.css","assets/dashboards-Cvs28p3Z.css","assets/DashboardSettings-5tn-dw6G.js","assets/UnderstoodPanel-DmJph4el.js","assets/UnderstoodPanel-Q6GX1TFq.css","assets/ZoomDeck-Cdvkvo2H.js","assets/portal-Dpb34d3-.js","assets/useZoomGesture-CN0p0lHL.js","assets/ZoomDeck-DdLNsrHV.css","assets/AtlasView-CYZ9sfXb.js","assets/store-CgA7mKy1.js","assets/AtlasView-B7yObdf8.css","assets/RippleOverlay-Dwi8Ir43.js","assets/buildShip-BgFg98tH.js","assets/parseDiff-D8uBQ9mQ.js","assets/incident-D3bmMmES.js","assets/githubToken-Bwa7V9YT.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/RippleOverlay-B3hg2KMN.css","assets/CardEditor-D4slxmIM.js","assets/CardEditor-CiAfT78z.css","assets/CourseRail-DD8gtAn4.js","assets/store-B2Rpbqgg.js","assets/generateCourse-DPL0bO3L.js","assets/useSrsCards-C27o39fF.js","assets/deckLine-NBd3MyGT.js","assets/CourseRail-BDQIWara.css","assets/MindMapViewerDrawer-DxcjLJzB.js","assets/MindShape-DhEmAQeq.js","assets/Presence-UqXfH4Y-.js","assets/geometry-DXAbnb0J.js","assets/MindShape-CozR9W8M.css","assets/Recap-BOl3SUh0.js","assets/Recap-D3NlzM1p.css","assets/LibraryOverlay-CEhVoSyv.js","assets/LibraryOverlay-BkPYm0Bs.css","assets/ReplayOverlay-CRVixwg2.js","assets/replay-DoRQJHjZ.js","assets/AnnotationLayer-CzXCVZCu.js","assets/gesture-BBS5nQEi.js","assets/emphasize-BqCIst-B.js","assets/AnnotationLayer-BRYhJ1LB.css","assets/ReplayOverlay-DzkcTnCA.css","assets/ShareModal-DVwc57KT.js","assets/capture-Dyff_zSz.js","assets/share--tpc1nLE.js","assets/registry-Cz5cZREW.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/ReelJelly-D5e-jt-8.js","assets/ShareModal-I_sxHKLv.css","assets/ExportModal-BVsirsNU.js","assets/notes-BDCTTA87.js","assets/registry-CvtHBjkb.js","assets/registry-types-D3q_LrlV.js","assets/fitText-DHbmSS-q.js","assets/registry-CNgybLQv.css","assets/registry-BV02ROnH.js","assets/openWorld-B4VY6xO7.js","assets/display-CAb_PiGv.js","assets/registry-DhWVSz_J.css","assets/registry-uiAoJKXu.js","assets/registry-2GJZ46M8.css","assets/registry-DOctfuxc.js","assets/registry-brX673Dg.css","assets/registry-BQuygaKz.js","assets/axis-DHAV38YM.js","assets/registry-B1KQ1VPZ.css","assets/registry-GxnzELw0.js","assets/registry-CuVk7MAI.css","assets/registry-C3bIc5Kp.js","assets/CodeOutput-DF892aIR.js","assets/useTimeout-Cm4yzted.js","assets/registry-BzNLfje1.css","assets/registry-CbKXa68-.js","assets/registry-B3HqLZyO.css","assets/registry-JRteQJcE.js","assets/registry-UFIuwh3i.css","assets/registry-nCDSZOmZ.js","assets/registry-CGB0jkFI.css","assets/registry-CdPShFc3.js","assets/registry-CRisz4Ca.css","assets/registry-DNIasVGX.js","assets/useInterval-DDgFrel2.js","assets/registry-CmWPyj7Q.css","assets/registry-C4RNoF_2.js","assets/useSpotlightWalk-DxlxBezO.js","assets/registry-BZsqAOnQ.css","assets/registry-BWx2f_wi.js","assets/registry-T3i2Q9SI.css","assets/registry-BoLdoGPW.js","assets/registry-DjvftnY2.css","assets/registry-Bs5HUWIJ.js","assets/quizResult-DB8yeqDr.js","assets/stepDriver-DwjFet6U.js","assets/registry-D5O0Ptw_.css","assets/registry-Cdk7NOiD.js","assets/safeCssColor-di93BXgG.js","assets/registry-CnNL4jmR.css","assets/registry-DO4hGO5e.js","assets/registry-CRM7y8QT.css","assets/registry-PAcazQzL.js","assets/registry-g2sBcIrf.css","assets/registry-CLHP_r7X.js","assets/registry-CyPRooIp.css","assets/registry-DueizAoA.js","assets/registry-yzYj0SNk.css","assets/registry-Diyud3DF.js","assets/registry-DpMI23iE.css","assets/registry-CT85vG1M.js","assets/registry-sT9NoG1k.css","assets/registry-MwJlqlFZ.js","assets/registry-BgWzEkxc.css","assets/registry-DLyrLfe-.js","assets/notes-A9t4jdfx.css","assets/ready-Ba6nk9O1.js","assets/ExportModal-sX8MPVPW.css","assets/ExtractionPreview-872OE2ZI.js","assets/store-gfPI5TVE.js","assets/relate-BHJl3RaA.js","assets/PinToDashboard-CQHDENt1.js","assets/PrismOverlay-L_lLIH_1.js","assets/penStrokes-CTC3AYiz.js","assets/types-CaO6xOn5.js","assets/pen-UKrUHlDA.js","assets/PrismOverlay-5ZVXu4WL.css","assets/WorldOverlay-DPkQobVE.js","assets/value-Dx7DZob4.js","assets/types-DuEbJpIA.js","assets/engine-BiM6INsW.js","assets/engine-CTvOaA86.css","assets/WorldOverlay-CLWtwuSl.css","assets/SynthesisOverlay-u_W105hD.js","assets/PresentationDeck-Bo1BVx73.js","assets/DelegatePanel-DO7J_rk_.js","assets/DelegatePanel-D17XvWYd.css","assets/SrsReview-Gr6Y0QTQ.js","assets/SrsReview-DmBcJCMa.css","assets/TourPrism-Cn2YHIwh.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{t as r}from"./jsx-runtime-DeHZSEgm.js";import{n as i,t as a}from"./preload-helper-CiWYd9n-.js";import{r as o,t as s}from"./preloadableLazy-MIX1ApBW.js";import{$ as c,A as l,B as u,D as d,E as f,G as p,H as m,J as h,K as g,L as _,M as v,O as y,Q as b,R as x,S,U as C,V as w,W as T,X as E,Y as D,Z as O,a as k,at as A,et as j,j as M,k as N,lt as P,q as F,r as I,rt as L,t as R,z}from"./index-BMeoXWPR.js";import{n as B}from"./icons-gLFQTv74.js";import{a as ee,i as te,n as ne}from"./loader-BRfSnl9t.js";import{n as re,r as ie}from"./blockLabel-FogyzEQY.js";import{t as ae}from"./useFocusTrap-CJmpNZv2.js";import{t as oe}from"./motion-BY_Egaxm.js";import{r as se,s as ce,t as V}from"./CanvasSkeleton-BmGjJHUQ.js";import{a as le,i as ue}from"./empty-D51uhW0E.js";import{t as de}from"./Presence-UqXfH4Y-.js";import{t as fe}from"./MindShape-DhEmAQeq.js";import{r as pe}from"./openWorld-B4VY6xO7.js";import{i as me,r as he,t as ge}from"./display-CAb_PiGv.js";import{t as _e}from"./sentenceCase-CLDiNB0f.js";import{r as H,t as ve}from"./sourceHost-BV3t2XDb.js";import{t as ye}from"./stepDriver-DwjFet6U.js";import{n as be,t as xe}from"./spokenText-Dy-GZvZV.js";import{A as Se,C as Ce,D as we,E as Te,O as Ee,T as De,_ as Oe,b as ke,c as Ae,d as je,h as Me,j as Ne,l as Pe,o as Fe,r as Ie,u as Le,v as Re,w as ze,y as Be}from"./kokoro-DcP-u0Tl.js";import{t as Ve}from"./portal-Dpb34d3-.js";import{a as U,i as He,o as Ue,r as We,s as Ge}from"./threads-DNfxMTwx.js";import{t as Ke}from"./FeatureUseNotice-BNDajs0p.js";import{n as qe,r as Je}from"./history-D2EH2X6D.js";import{n as Ye}from"./nextFrame-12y0UrAd.js";import{a as Xe,c as Ze,d as Qe,f as $e,i as et,n as tt,o as nt,r as rt,s as it,t as at,u as ot}from"./walkSync-CRhkAQFu.js";import{n as st,t as ct}from"./generateBeats-Da9RmZke.js";import{n as lt,r as ut,t as dt}from"./AnnotationLayer-CzXCVZCu.js";import{n as ft,t as pt}from"./number-zqlPMliA.js";import{n as mt}from"./emphasize-BqCIst-B.js";import{n as ht,o as gt}from"./streamParse-BX0bAppQ.js";import{n as _t,t as vt}from"./registry-DLyrLfe-.js";import{t as yt}from"./ready-Ba6nk9O1.js";import{t as bt}from"./registry-BodYWiga.js";import{i as xt,r as St}from"./info-CiqHR5cs.js";import{r as Ct}from"./contentVault-XKWjF2FB.js";import{a as wt,c as Tt,i as Et,n as Dt,r as Ot,s as kt}from"./store-gfPI5TVE.js";import{a as At,o as jt,r as Mt}from"./store-C9s8Bfz0.js";import{n as Nt,r as Pt}from"./chapters-DcdG3Lu8.js";/* empty css */import{g as Ft,h as It,l as Lt,m as Rt,p as zt,s as Bt,t as Vt,v as Ht}from"./attachments-BW-vki-E.js";import{t as Ut}from"./types-CaO6xOn5.js";import{J as Wt,Z as Gt,a as Kt,c as qt,m as Jt,q as Yt,u as Xt}from"./store-D16dGt7I.js";import{t as Zt}from"./providers-CPhoN8j0.js";import{a as Qt,c as $t,d as en,l as tn,n as nn,o as rn,r as an,s as on,u as sn}from"./useLiveConfig-CvOQTr0s.js";import{prewarmLive as cn}from"./prewarm-xdXDmF8B.js";import{c as ln,f as un,g as dn,m as fn,p as pn,r as mn,s as hn,u as gn}from"./effort-QeWrMtZt.js";import{t as _n}from"./TopbarMenu-DQXxqSWY.js";import{a as vn,c as yn,d as bn,f as xn,i as Sn,l as Cn,m as wn,o as Tn,p as En,s as Dn,t as On}from"./quietHours-uFS7n8N6.js";import{a as kn,c as An,d as jn,i as Mn,n as Nn,t as Pn,u as Fn}from"./store-DqOaVRLn.js";import{r as In}from"./speed-BOytg6bC.js";import{i as Ln,n as Rn,r as zn,t as Bn}from"./cache-7UEbF3S6.js";import{r as Vn}from"./verbatim-DBTj9sPD.js";import{n as Hn}from"./citation-BsSvaaer.js";import{n as Un,o as Wn,t as Gn}from"./validate-MQG0EcTD.js";import{n as Kn}from"./TemplatePicker-CAC4ggbJ.js";import{t as qn}from"./ready-_sg3IJkE.js";import{t as Jn}from"./DropSelect-BVDNR47E.js";import{t as Yn}from"./route-D4kd-D3B.js";import{t as Xn}from"./useDashboards-B-EjE8FH.js";import{n as Zn,r as Qn}from"./value-Dx7DZob4.js";import{i as $n,n as er}from"./shapes-BwXCYTlu.js";import{a as tr,d as nr,g as rr,l as ir,n as ar,p as or,r as sr}from"./store-D2IJF4SA.js";import{a as cr,i as lr,r as ur}from"./useStudy-70Iz4ZVn.js";import{t as dr}from"./useZoomGesture-CN0p0lHL.js";import{a as fr,o as pr,t as mr}from"./store-CgA7mKy1.js";import{SEED_SHIP as hr}from"./seed-b1xc0dj2.js";import{t as gr}from"./buildShip-BgFg98tH.js";import{n as _r}from"./parseDiff-D8uBQ9mQ.js";import{enrichShipModel as vr}from"./generate-BZobrQPX.js";import{a as yr,c as br,g as xr,h as Sr,l as Cr,o as wr,p as Tr,r as Er,t as Dr}from"./store-B2Rpbqgg.js";import{r as Or}from"./courseSeed-CZdNBTTs.js";import{i as kr,n as Ar,r as jr,t as Mr}from"./mastery-DB5qpRAy.js";var W=t(),Nr=P(),Pr=/\?\s*$|^\s*(what|why|how|when|where|who|which|can|could|should|would|is|are|do|does|tell me|show me|explain)\b/i;function Fr(e){return Pr.test(e.trim())}function Ir(e,t){let n=e.key,r=t.trim();if(!r)return null;switch(e.kind){case`number`:{let t=r.replace(/,/g,``).match(/-?\d+(\.\d+)?/);if(!t)return null;let i=Number(t[0]);return Number.isFinite(i)?{kind:`number`,key:n,value:i,...e.unit?{unit:e.unit}:{}}:null}case`choice`:{let t=e.options?.find(e=>r.toLowerCase().includes(e.toLowerCase()));return t?{kind:`choice`,key:n,value:t}:null}case`card`:return null;case`date`:return{kind:`date`,key:n,value:r};default:return{kind:`text`,key:n,value:r}}}function Lr(e,t){if(e.phase!==`awaiting_input`||!e.activeKey)return!1;let n=e.blanks.find(t=>t.key===e.activeKey);if(!n)return!1;let r=Ir(n,t),i=Fr(t);return r&&!i?(e.fill(r),!0):!r&&!i}function Rr(e){return e.alwaysOn&&e.sttOk&&!e.composerHasText}function zr(e,t){let n=(0,W.useRef)({...e,...t});n.current={...e,...t};let r=e.listening||Rr(e);(0,W.useEffect)(()=>{if(!r)return;let e=()=>{document.hidden?n.current.listening&&n.current.stop():Rr(n.current)&&!n.current.listening&&n.current.start()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[r])}var G=r(),Br=200;function Vr(e){let t=e.trim().split(/\s+/).filter(Boolean).length;return Math.min(8e3,700+t*360)}function Hr(e,t){let n=(0,W.useRef)(e);n.current=e;let[r,i]=(0,W.useState)(null),a=(0,W.useRef)(null),o=(0,W.useCallback)(e=>{a.current=e,i(e)},[]),s=(0,W.useRef)(void 0),c=(0,W.useRef)(void 0),l=(0,W.useCallback)(()=>{s.current!==void 0&&clearTimeout(s.current),c.current!==void 0&&clearTimeout(c.current),s.current=void 0,c.current=void 0},[]),u=(0,W.useCallback)(e=>{let t=n.current,r=e.id??null;if(t.takeWheel(),t.moveSpot(e),r&&r===a.current){t.hush(),l(),o(null);return}t.hush(),l();let i=r?t.lineFor(e):null;if(!i||!t.canSpeak()){o(null);return}o(r),s.current=setTimeout(()=>{s.current=void 0,n.current.speakLine(i),c.current=setTimeout(()=>{c.current=void 0,a.current===r&&o(null)},Vr(i))},Br)},[l,o]);return(0,W.useEffect)(()=>()=>{l(),o(null)},[t,l,o]),{narrate:u,narratingId:r}}var Ur=`mavea-view-mode`,Wr=Ur,Gr=`everything`,Kr=new Set([`canvas`,`world`]);function qr(e){return e===`focus`||e===`everything`||e===`canvas`||e===`world`}var Jr=null;function Yr(){try{if(typeof localStorage>`u`)return Gr;let e=localStorage.getItem(Ur);return qr(e)&&!Kr.has(e)?e:Gr}catch{return Gr}}function Xr(){return Yr()}function Zr(){return Jr||(Jr=Yr(),Jr)}function Qr(e){if(qr(e)){Jr=e;try{typeof localStorage<`u`&&!Kr.has(e)&&localStorage.setItem(Ur,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(Wr))}catch{}}}function $r(){let[e,t]=(0,W.useState)(()=>Zr());return(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(Zr());return window.addEventListener(Wr,e),()=>window.removeEventListener(Wr,e)},[]),[e,(0,W.useCallback)(Qr,[])]}function ei({value:e,onChange:t,onSend:n,listening:r,onMic:i,micMode:a=`tap`,micArmed:o=!1,micPaused:s=!1,micProcessing:c=!1,micDisabled:l=!1,placeholder:u,disabled:d,heard:f,focusSignal:p,onFiles:m,attachTitle:h,attachPulse:g,onMicDown:_,onForceStop:v,onMicCancel:y,tools:b,micExtra:x}){let S=(0,W.useRef)(null),C=(0,W.useRef)(null),[w,T]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!g)return;T(!0);let e=setTimeout(()=>T(!1),1100);return()=>clearTimeout(e)},[g]);let E=(0,W.useRef)(!1),D=(0,W.useRef)(null),O=(0,W.useRef)(!1),k=(0,W.useRef)(y);k.current=y,(0,W.useEffect)(()=>()=>{E.current&&k.current?.()},[]),(0,W.useEffect)(()=>{a!==`hold`&&(O.current=!1,E.current&&(E.current=!1,D.current=null,k.current?.()))},[a]),(0,W.useEffect)(()=>{!r&&S.current&&S.current.focus()},[r]),(0,W.useEffect)(()=>{p&&S.current&&S.current.focus()},[p]);let A=(0,W.useCallback)(e=>{a!==`hold`||l||c||r||E.current||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),E.current=!0,D.current=e.pointerId,O.current=!0,_?.())},[l,c,r,a,_]),j=(0,W.useCallback)(()=>{E.current&&(E.current=!1,D.current=null,v?.())},[v]),M=(0,W.useCallback)(e=>{D.current===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),j())},[j]),N=(0,W.useCallback)(e=>{E.current&&(e&&D.current===e.pointerId&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),E.current=!1,D.current=null,y?.())},[y]),P=(0,W.useCallback)(e=>{a!==`hold`||l||c||r||E.current||e.repeat||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),E.current=!0,O.current=!0,_?.())},[r,l,a,c,_]),F=(0,W.useCallback)(e=>{a!==`hold`||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),j())},[j,a]),I=(0,W.useCallback)(()=>{if(a===`hold`||O.current){O.current=!1;return}l||c&&a!==`always`||i()},[i,l,a,c]),L=l?`Microphone off`:c&&a!==`always`?`Finishing voice input`:r?`Finish and send`:s?`Resume always-on`:o?`Pause always-on`:a===`hold`?`Hold to talk`:`Talk to Mavéa`,R=(0,G.jsx)(`button`,{className:`mic-btn`+(r?` listening`:``)+(o?` armed`:``)+(s?` paused`:``)+(c?` processing`:``)+(l?` mic-off`:``),onClick:I,onPointerDown:A,onPointerUp:M,onPointerCancel:N,onKeyDown:P,onKeyUp:F,title:L,"aria-label":L,"aria-busy":c,children:l?(0,G.jsx)(B.micOff,{}):(0,G.jsx)(B.mic,{})});return(0,G.jsxs)(`div`,{className:`composer`,children:[x?(0,G.jsxs)(`div`,{className:`mic-btn-wrap`,children:[R,x]}):R,f&&!e?(0,G.jsx)(`div`,{className:`live-listen heard`,children:(0,G.jsxs)(`span`,{style:{color:`var(--text-primary)`},children:[`"`,f,`"`]})}):r&&!e?(0,G.jsxs)(`div`,{className:`live-listen`,children:[(0,G.jsx)(`span`,{className:`wave`,children:[14,18,10,20,8,16,12].map((e,t)=>(0,G.jsx)(`i`,{style:{height:e}},t))}),`Listening…`]}):(0,G.jsx)(`input`,{ref:S,className:`composer-input`,name:`mavea-ask`,"aria-label":u||`Ask Mavéa anything`,autoComplete:`off`,value:e,disabled:d,placeholder:u||`Ask Mavéa anything — or just talk`,onChange:e=>t(e.target.value),onKeyDown:t=>{t.nativeEvent.isComposing||t.key===`Enter`&&e.trim()&&n(e)}}),m&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`input`,{ref:C,type:`file`,name:`mavea-attach`,accept:Vt,multiple:!0,disabled:d,hidden:!0,"aria-hidden":`true`,onChange:e=>{let t=Array.from(e.target.files??[]);t.length&&m(t),e.target.value=``}}),(0,G.jsx)(`button`,{type:`button`,className:`composer-tool`+(w?` is-pulsing`:``),title:h||`Attach a file`,"aria-label":h||`Attach a file`,disabled:d,onClick:()=>C.current?.click(),children:(0,G.jsx)(B.paperclip,{})})]}),b,(0,G.jsx)(`button`,{className:`send-btn`,disabled:d||!e.trim(),onClick:()=>n(e),title:`Send`,"aria-label":`Send`,children:(0,G.jsx)(B.send,{})})]})}i();var ti=null;async function K(){return ti||(ti=(await a(()=>import(`./corpus.generated-oX9uU93S.js`),[])).default,ti)}function ni(e){return ti?.conversations.find(t=>t.id===e)}function ri(e){return e.replace(/\b([\p{L}]+)-ish\b/gu,`roughly $1`).replace(/\s*[—–]\s*/g,`, `).replace(/(\p{L})-(?=\p{L})/gu,`$1 `).replace(/\s+-\s+/g,`, `).replace(/,\s*,+/g,`, `).replace(/\s{2,}/g,` `).trim()}function q(e){return{...e,question:ri(e.question),narration:ri(e.narration),spoken:e.spoken?ri(e.spoken):e.spoken,tour:e.tour.map(e=>({...e,say:e.say?ri(e.say):e.say,saySpoken:e.saySpoken?ri(e.saySpoken):e.saySpoken}))}}var ii=[{id:`talk`,title:`Speak naturally`,mode:`voice`,coach:`Start by speaking naturally or typing. I will understand either and respond out loud.`,spotlight:`.mic-btn`,action:{kind:`mic`},durationMs:6e3},{id:`connect`,title:`Bring your own model`,mode:`explain`,coach:`Choose Gemini, Claude, GPT, Grok, or OpenRouter, then paste your own API key. Start with a fast, lower cost model and move up only when a task needs it. The key stays in memory unless you choose Remember. Requests pass through this deployment, and your provider's usage charges, privacy, and retention terms apply.`,spotlight:`.settings-model-connect`,action:{kind:`connect`},durationMs:12e3},{id:`draws`,title:`See the answer`,mode:`explain`,coach:`Ask anything. I build a visual answer while I explain the important parts. Use the voice toggle labeled Mavéa's voice to turn speech off and reveal everything immediately. Your microphone stays unchanged.`,spotlight:`.voice-switch`,action:{kind:`answer`,convoId:`money`,ask:`How does $10,000 grow at 7% over 30 years?`},durationMs:9e3},{id:`mark`,title:`Follow the explanation`,mode:`explain`,coach:`Watch the Pen circle the result, then underline why it matters. Its marks stay with the answer.`,spotlight:`.pen-toggle-pill`,action:{kind:`penDemo`},durationMs:1e4,needsCanvas:!0},{id:`ask`,title:`Ask across the answer`,mode:`explain`,coach:`Choose Ask on two cards, then type a question. I will use both pieces of context together.`,spotlight:`.topic-wrap .block-ask, .ask-hint`,action:{kind:`askMulti`},durationMs:12e3,needsCanvas:!0},{id:`canvas`,title:`Explore the canvas`,mode:`explain`,coach:`Switch to Canvas when you want to explore the whole answer spatially.`,action:{kind:`canvas`,convoId:`travel`},durationMs:15e3},{id:`living-answer`,title:`Walk the why`,mode:`explain`,coach:`A living answer lays out the causes behind an answer. Watch as I walk it cause by cause and say what each one did.`,action:{kind:`showcase`,featureId:`living-answer`},durationMs:26e3},{id:`prism`,title:`Check the evidence`,mode:`explain`,coach:`Prism checks a document claim by claim and ties every finding to its source.`,action:{kind:`prism`},durationMs:32e3},{id:`share`,title:`Present or publish`,mode:`explain`,coach:`Turn a useful answer into a polished presentation or document.`,action:{kind:`export`},durationMs:16e3,needsCanvas:!0},{id:`yours`,title:`Try it yourself`,mode:`voice`,coach:`That is the tour. Now ask your first question.`,spotlight:`.mic-btn`,action:{kind:`mic`},durationMs:6e3}],ai=[{id:`bend`,title:`Make it yours`,mode:`explain`,coach:`These are starting assumptions. Drag the rent and watch the comparison update.`,spotlight:`.bend-strip`,action:{kind:`bend`,convoId:`mortgage`},durationMs:8e3,needsCanvas:!0,glyph:`🎚️`,hook:`Drag a number, watch it recompute`},{id:`chips`,title:`Go deeper`,mode:`explain`,coach:`When an answer offers ways to go deeper, tap one and I'll take it further.`,spotlight:`.footer-keepgoing`,action:{kind:`chip`,convoId:`monthly`,label:`What if I added $500 monthly?`},durationMs:9e3,needsCanvas:!0,glyph:`💬`,hook:`Tap a suggestion, go deeper`},{id:`rail`,title:`Session history`,mode:`explain`,coach:`Settled turns stay on the left for this session. Jump back anytime.`,spotlight:`.rail-chat`,action:{kind:`rail`},durationMs:8e3,needsCanvas:!0,glyph:`📜`,hook:`Settled turns, replayable on the left`},{id:`highlight`,title:`Highlight to ask`,mode:`explain`,coach:`Choose Highlight, draw around any part of an answer, then ask about exactly what you marked.`,spotlight:`.mark-toggle`,action:{kind:`mark`},durationMs:8e3,needsCanvas:!0,glyph:`✎`,hook:`Draw around the exact part you mean`},{id:`range`,title:`A fitting picture`,mode:`explain`,coach:`Answers can choose from diagrams, flows, charts, and interactive maps.`,action:{kind:`montage`,convoIds:[`space`,`krebs`,`travel`]},durationMs:9e3,glyph:`🎨`,hook:`See the visual range`},{id:`focus`,title:`One card at a time`,mode:`explain`,coach:`Feeling overwhelmed? Focus puts one card center stage, one at a time.`,spotlight:`.focus-toggle`,action:{kind:`focusWalk`,convoId:`money`},durationMs:11e3,glyph:`🎯`,hook:`One card at a time, center stage`},{id:`think`,title:`Think out loud`,mode:`explain`,coach:`Not sure what to ask yet? Think out loud, and I will map your thoughts live.`,action:{kind:`listen`},durationMs:16e3,glyph:`🧠`,hook:`Think out loud, I map it live`},{id:`atlas`,title:`Memory and Atlas`,mode:`explain`,coach:`When Memory is enabled, saved facts and kept topics can shape Atlas.`,action:{kind:`atlas`},durationMs:9e3,glyph:`🗺️`,hook:`Kept topics become a place`},{id:`export`,title:`Export the answer`,mode:`explain`,coach:`Need to share it? Export the current answer as a styled slide deck or document.`,action:{kind:`export`},durationMs:12e3,needsCanvas:!0,glyph:`📄`,hook:`Any answer becomes a deck or document`},{id:`flashcards`,title:`Make it stick`,mode:`explain`,coach:`Learning something? Any card becomes a flashcard, kept right here on your device.`,action:{kind:`flashcards`},durationMs:8e3,needsCanvas:!0,glyph:`🎴`,hook:`Turn any card into a flashcard`},{id:`course`,title:`Master a subject`,mode:`explain`,coach:`Want to truly master something? I'll build you a course and teach it, one lesson at a time.`,spotlight:`.course-rail`,action:{kind:`course`},durationMs:12e3,glyph:`🎓`,hook:`A full course, a lesson at a time`},{id:`present`,title:`Fill the room`,mode:`explain`,coach:`Present fills the room with the answer while the microphone stays live.`,action:{kind:`present`},durationMs:9e3,needsCanvas:!0,glyph:`🖥️`,hook:`Fill the room, chrome falls away`},{id:`palette`,title:`Feature index, one key away`,mode:`explain`,coach:`Browse the feature index with one keystroke. Just press Command K.`,spotlight:`.cmdk-panel`,action:{kind:`palette`},durationMs:9e3,glyph:`⌘`,hook:`Feature index, one keystroke away`},{id:`ripple`,title:`See a change ripple`,mode:`explain`,coach:`Here is a real code change. See what it touches, what could break, and the safest order to ship it.`,action:{kind:`showcase`,featureId:`ripple`},durationMs:12e3,glyph:`🌊`,hook:`A code change's whole blast radius`},{id:`deepzoom`,title:`Telescope any topic`,mode:`explain`,coach:`Telescope a topic from the big picture all the way down to the finest detail.`,action:{kind:`showcase`,featureId:`deepzoom`},durationMs:1e4,glyph:`🔭`,hook:`From big picture to finest detail`},{id:`synthesis`,title:`Fuse many documents`,mode:`explain`,coach:`Drop in several documents and I combine them into one map of agreements, contradictions, and gaps.`,action:{kind:`showcase`,featureId:`synthesis`},durationMs:1e4,glyph:`🧬`,hook:`Many documents into one map`},{id:`memory`,title:`What I remember`,mode:`explain`,coach:`Everything I remember about you lives here. Review it, edit it, or forget it. It stays on your device.`,action:{kind:`showcase`,featureId:`memory`},durationMs:9e3,glyph:`🔖`,hook:`See, edit, or forget what I know`},{id:`library`,title:`Past conversations`,mode:`explain`,coach:`Every canvas you build is kept. Reopen any past conversation where you left it.`,action:{kind:`showcase`,featureId:`library`},durationMs:9e3,glyph:`📚`,hook:`Reopen a canvas you built before`},{id:`review`,title:`Study your cards`,mode:`explain`,coach:`Open Study to go through your flashcards. Keep it a plain pile, or let Mavéa space them out so the ones you find hard come back sooner.`,action:{kind:`showcase`,featureId:`review`},durationMs:9e3,glyph:`🧠`,hook:`Go through your flashcards`},{id:`manage-flashcards`,title:`Manage your deck`,mode:`explain`,coach:`Open your flashcard library to organize decks, edit cards, and choose what to study.`,action:{kind:`showcase`,featureId:`flashcards`},durationMs:9e3,glyph:`🗂️`,hook:`Organize and edit every study card`},{id:`track`,title:`Build a living dashboard`,mode:`explain`,coach:`Choose the parts you want to keep live, set a refresh schedule, and create a dashboard from this answer.`,action:{kind:`showcase`,featureId:`track`},durationMs:12e3,needsCanvas:!0,glyph:`📈`,hook:`Choose what stays live and how often`},{id:`delegate`,title:`Rehearse it first`,mode:`explain`,coach:`Prepare a hard conversation before you have it. Take the seat and practice your own lines, or send me to argue your side and read the debrief.`,action:{kind:`showcase`,featureId:`delegate`},durationMs:9e3,glyph:`🤝`,hook:`Practice it, or send me to scout it`},{id:`just-listen`,title:`Just listen`,mode:`explain`,coach:`Think out loud and I save what you say without answering, so you can sort it later.`,action:{kind:`showcase`,featureId:`just-listen`},durationMs:9e3,glyph:`👂`,hook:`Bank everything you say, sort it later`},{id:`recap`,title:`Recap the session`,mode:`explain`,coach:`Lost the thread? I'll recap everything we've covered this session at a glance.`,action:{kind:`showcase`,featureId:`recap`},durationMs:9e3,glyph:`📋`,hook:`Everything we've covered, at a glance`},{id:`ghost`,title:`Ghost answers`,mode:`explain`,coach:`While you listen, I quietly draft a response, so it is ready when you want it.`,action:{kind:`showcase`,featureId:`ghost`},durationMs:9e3,glyph:`👻`,hook:`I draft what I would say, quietly`},{id:`whisper`,title:`Whisper mode`,mode:`explain`,coach:`Need to stay quiet? Whisper mode lowers my voice to a soft murmur.`,action:{kind:`showcase`,featureId:`whisper`},durationMs:9e3,glyph:`🤫`,hook:`A quiet voice when you need it`},{id:`morning-brief`,title:`Morning brief`,mode:`explain`,coach:`Start the day with a brief of what changed across the things you track. It stays off until you turn it on.`,action:{kind:`showcase`,featureId:`morning-brief`},durationMs:9e3,glyph:`☀️`,hook:`Open the day with what's changed`},{id:`settings`,title:`Bring your own model`,mode:`explain`,coach:`Bring your own model, connect a provider, and tune how I answer. You control the key and the terms.`,action:{kind:`showcase`,featureId:`settings`},durationMs:9e3,glyph:`⚙️`,hook:`Connect a provider, tune the answers`},{id:`zoom-deck`,title:`Chapter view`,mode:`explain`,coach:`Pull back from the cards to the whole session, with every topic shown as a chapter.`,action:{kind:`showcase`,featureId:`zoom-deck`},durationMs:1e4,glyph:`📖`,hook:`Pull back to the whole session`},{id:`blanks`,title:`Fill in your own`,mode:`explain`,coach:`Some numbers are only yours to give. I leave glowing spaces and finish the answer around what you add.`,spotlight:`.blank-slot`,action:{kind:`blanksDemo`},durationMs:1e4,glyph:`◌`,hook:`Holes for the numbers only you know`}],oi=[...ii,...ai];function si(e){return oi.find(t=>t.id===e)}var ci={money:`How does $10,000 grow at 7% over 30 years?`,monthly:`What if I added $500 monthly?`,mortgage:`Should I buy or rent a $500,000 home?`,space:`How does a black hole bend light?`,travel:`Plan me 5 days in Japan.`,budget:`Where does the US federal budget actually go?`,krebs:`Explain the Krebs cycle.`,url:`What actually happens when I open a website?`,neural:`How does a neural network learn?`,fitness:`Design me a 3-day strength routine.`};function li(e,t){let n=ni(e),r=n?.frames[0];if(!n||!r)return null;let i=ri(t??ci[e]??n.question);return{frame:q({...r,question:i}),question:i}}var ui=[{key:`savings`,label:`Your savings`,prompt:`How much have you set aside for the break?`,kind:`number`,unit:`$`,placeholder:`e.g. 18,000`},{key:`spend`,label:`Monthly spend`,prompt:`Roughly what will you spend a month while travelling?`,kind:`number`,unit:`$/mo`,placeholder:`e.g. 2,400`}],di=[{type:`insight`,id:`blanks-lede`,col:12,props:{title:`The money side of a 6-month break`,summary:`I've mapped the typical costs and what to sort out before you leave. Two numbers, though, are yours to give — so I've left them as holes rather than guess.`}},{type:`blanks`,id:`blanks-holes`,col:12,props:{title:`The parts only you can answer`,icon:`spark`,iconColor:`var(--presence)`,intro:`I've weighed everything I can. Fill these in and I'll finish the runway math around them.`,slots:ui}}],fi=[{type:`insight`,id:`blanks-verdict`,col:12,props:{title:`You can afford it — with a cushion`,summary:`$18,000 saved against $2,400 a month is about 7.5 months of runway — enough for a 6-month break with room to spare.`,stat:`7.5 months`,delta:`+1.5 vs. the plan`,deltaDir:`up`}},{type:`breakdown`,id:`blanks-runway`,col:12,props:{title:`Your runway`,rows:[{name:`Saved`,val:`$18,000`,pct:100},{name:`Spend / month`,val:`$2,400`,pct:32},{name:`6-month cost`,val:`$14,400`,pct:80},{name:`Left over`,val:`$3,600`,pct:20,tag:`cushion`,tagColor:`var(--presence)`}]}}];function pi(e,t){return{question:`Can I afford a 6-month career break?`,narration:t,mode:`replace`,tour:[],spec:e,at:0}}function mi(e){let t={...e,title:`Can I afford a 6-month career break?`,sub:`The money side`,bend:void 0,sources:void 0,track:void 0},n={...t,blocks:di,blanks:ui,awaiting:!0},r={...t,blocks:fi,blanks:void 0,awaiting:!1};return{holes:pi(n,``),filled:pi(r,`With eighteen thousand saved and twenty-four hundred a month, that’s about seven and a half months of runway — enough for six, with a cushion.`)}}function hi(){let e=!1,t=[];return{after(n,r){t.push(setTimeout(()=>!e&&r(),n))},cancel(){e=!0,t.forEach(clearTimeout)}}}function gi(e,t){if(_()){t();return}let n=Date.now(),r=()=>{if(_()||Date.now()-n>=8e3){t();return}e(200,r)};e(200,r)}function _i(e,t,n,r=0){for(let i=1;i<=n.length;i++)e(r+i*22,()=>t(n.slice(0,i)));return r+n.length*22}function vi(e){let t=Date.now(),n=e.maxExtraMs??2e4,r=0,i=window.setInterval(()=>{let a=Date.now()-t;a<e.minHoldMs||(r=e.isQuiet()?r+1:0,(r>=7||a>=e.minHoldMs+n)&&(window.clearInterval(i),e.advance()))},250);return()=>window.clearInterval(i)}var yi=450,bi=1600;function xi(e,t){if(e<=0)return[];let n=Math.max(bi,Math.floor((t-yi-400)/e));return Array.from({length:e},(e,t)=>yi+t*n)}var Si=1500,Ci=900;function wi(e,t){let n=1850;if(e<=0)return{focusAt:Si,spotlightAt:[]};let r=Math.max(Ci,Math.floor((t-n)/e));return{focusAt:Si,spotlightAt:Array.from({length:e},(e,t)=>n+t*r)}}var Ti=[`I keep thinking about moving to Austin.`,`My sister already lives there.`,`But I'm worried about starting over.`,`And my lease runs until March.`,`Is it even the right time?`];function Ei(e){return!!e&&ai.some(t=>t.id===e)}function Di(e){return!!e&&ii.some(t=>t.id===e)}function Oi(e){let{active:t}=e,[n,r]=(0,W.useState)(()=>{let t=e.startChapter;return Ei(t)||Di(t)&&e.solo?t??null:null}),[i,a]=(0,W.useState)(()=>{let t=e.startChapter;if(Ei(t)||Di(t)&&e.solo)return 0;let n=t?ii.findIndex(e=>e.id===t):-1;return n>=0?n:0}),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(!1),[u,d]=(0,W.useState)(!1),f=(0,W.useRef)(u);f.current=u;let p=(0,W.useRef)(c);p.current=c;let[m,h]=(0,W.useState)(!1),[g,v]=(0,W.useState)(0),y=(0,W.useRef)(e.ops);y.current=e.ops;let b=n?si(n):void 0,x=b?[b]:ii,S=(0,W.useRef)(x);S.current=x;let C=x.length,w=t?x[i]??null:null,[T,E]=(0,W.useState)(!1),[D,O]=(0,W.useState)(!1),[k,j]=(0,W.useState)(0);(0,W.useEffect)(()=>{if(!t)return;let e=!0;return(async()=>{for(let t=0;e&&t<2;t++)try{await K(),e&&E(!0);return}catch{}e&&O(!0)})(),()=>{e=!1}},[t,k]);let M=(0,W.useCallback)(()=>{O(!1),j(e=>e+1)},[]),N=(0,W.useCallback)(()=>{let e=y.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,W.useEffect)(()=>{if(!t||!o||m||!T)return;let e=S.current[i];if(!e)return;A(e.id,!!n);let r=y.current,a=hi(),s=a.after,c=e=>gi(s,e),l=e=>c(()=>r.speak(e)),u=e=>r.showFrame(e.frame,e.question,{silent:!0});if(N(),e.needsCanvas&&!r.hasCanvas()){let e=li(`money`);e&&u(e)}r.setMuted(f.current||e.mode===`silent`);let d=e.action;if(d.kind===`answer`){let e=li(d.convoId,d.ask);if(e){let t=e.question,n={...e.frame,narration:``,spoken:``,tour:e.frame.tour.slice(0,4).map(e=>({...e,say:``,saySpoken:``}))};s(_i(s,r.typeInto,t)+360,()=>c(()=>r.showFrame(n,e.question)))}}else if(d.kind===`chip`){let e=li(`money`);e&&u(e),s(1400,()=>r.pressKeepGoing(d.label)),s(2e3,()=>{let e=li(d.convoId,d.label);e&&r.showFrame(e.frame,e.question)})}else if(d.kind===`montage`){let t=d.convoIds.map(e=>li(e)).filter(Boolean),n=xi(t.length,e.durationMs);t.forEach((e,t)=>s(n[t],()=>u(e)))}else if(d.kind===`ask`)s(1300,()=>r.pinFirstBlock()),_i(s,r.typeInto,`Why does it grow faster after year 20?`,1700);else if(d.kind===`askMulti`){let e=li(`money`);e&&u(e),s(1300,()=>r.pinFirstBlocks(2)),_i(s,r.typeInto,`How do these two parts explain the final total?`,2600)}else if(d.kind===`bend`){if(d.convoId){let e=li(d.convoId);e&&u(e)}s(1400,()=>r.bendIt())}else if(d.kind===`rail`)s(1300,()=>r.toggleRail()),s(2600,()=>r.toggleRail());else if(d.kind===`export`)s(500,()=>r.openExport());else if(d.kind===`mark`)s(400,()=>r.setInkArmed(!0)),s(900,()=>r.scriptedMark());else if(d.kind===`penDemo`){let e=li(`money`);e&&u(e),s(1200,()=>r.drawPenTourStep(`result`)),s(3900,()=>r.drawPenTourStep(`reason`)),s(7200,()=>r.setSpot(null))}else if(d.kind===`focus`)s(500,()=>r.setViewMode(`focus`));else if(d.kind===`canvas`){let e=li(d.convoId);e&&u(e),s(1500,()=>r.setViewMode(`canvas`));let t=(e?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,3);t.forEach((e,t)=>s(2700+t*1900,()=>r.setSpot(e))),s(2700+t.length*1900,()=>r.setSpot(null))}else if(d.kind===`focusWalk`){let t=li(d.convoId);t&&u(t);let n=(t?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e),{focusAt:i,spotlightAt:a}=wi(n.length,e.durationMs);s(i,()=>r.setViewMode(`focus`)),n.forEach((e,t)=>s(a[t],()=>r.setSpot(e)))}else if(d.kind===`listen`){s(400,()=>r.startWatchThinking());let e=800;for(let t of Ti)e=_i(s,r.typeInto,t,e)+300,s(e,()=>{r.typeInto(``),r.bankThought(t)}),e+=800}else if(d.kind===`flashcards`)s(700,()=>r.openFlashcards());else if(d.kind===`course`)s(500,()=>r.openTourCourse());else if(d.kind===`connect`)s(400,()=>r.openModelSettings());else if(d.kind===`present`)s(500,()=>r.setPresenting(!0));else if(d.kind===`share`)s(500,()=>r.setShareOpen(!0)),s(3100,()=>r.shareRemix()),s(4900,()=>r.sharePalette(`Ember`));else if(d.kind===`palette`)s(500,()=>r.setPaletteOpen(!0));else if(d.kind===`atlas`)s(500,()=>r.openAtlas());else if(d.kind===`prism`)s(400,()=>r.openPrism(0));else if(d.kind===`memory`)s(700,()=>r.fireMemoryGlow());else if(d.kind===`showcase`)d.featureId===`recap`||d.featureId===`zoom-deck`?([`money`,`space`,`travel`].forEach((e,t)=>{let n=li(e);n&&s(t*200,()=>u(n))}),s(1400,()=>r.showcaseFeature(d.featureId))):s(500,()=>r.showcaseFeature(d.featureId));else if(d.kind===`blanksDemo`){let e=li(`money`)?.frame.spec;if(e){let{holes:t,filled:n}=mi(e);u({frame:t,question:t.question}),s(5200,()=>r.showFrame(n,n.question))}}return e.mode!==`silent`&&!f.current&&s(160,()=>l(ri(e.coach))),a.cancel},[i,g,t,o,m,T,n,N]),(0,W.useEffect)(()=>{if(!t||!o||m||!c||!T)return;let e=S.current[i];if(!e)return;let n=y.current;return vi({minHoldMs:e.durationMs,isQuiet:()=>!n.isSpeaking()&&!n.isBusy(),advance:()=>{i+1>=C?(N(),h(!0)):a(i+1)}})},[i,g,t,o,m,c,T,C,n,N]),(0,W.useEffect)(()=>()=>N(),[N]);let P=(0,W.useCallback)(()=>{_(),s(!0),l(!0),h(!1)},[]),F=(0,W.useCallback)((e,t)=>{_(),h(!1),t?.keepPlaying||l(!1),a(Math.max(0,Math.min(S.current.length-1,e))),v(e=>e+1)},[]),I=(0,W.useCallback)(()=>{i+1>=C?(N(),h(!0)):F(i+1,{keepPlaying:!0})},[i,C,F,N]),L=(0,W.useCallback)(()=>F(i-1),[i,F]),R=(0,W.useCallback)(e=>F(e),[F]),z=(0,W.useCallback)(()=>{N(),r(null),s(!0),F(0),l(!0)},[F,N]),B=(0,W.useCallback)(e=>{Ei(e)&&(_(),r(e),s(!0),h(!1),l(!0),a(0),v(e=>e+1))},[]),ee=(0,W.useCallback)(()=>{if(_(),!o){P();return}if(m){z();return}p.current&&y.current.cancelSpeech(),l(e=>!e)},[m,z,P,o]),te=(0,W.useCallback)(()=>{_();let e=!f.current;f.current=e,d(e);let t=S.current[i],n=t?.mode===`silent`,r=y.current;r.setMuted(e||n),e?r.cancelSpeech():o&&!m&&t&&!n&&r.speak(ri(t.coach))},[m,i,o]),ne=(0,W.useCallback)(()=>{N(),h(!0)},[N]);return{active:t,started:o,index:i,total:C,chapter:w,coach:ri(w?.coach??``),spotlight:w?.spotlight,playing:c,muted:u,done:m,corpusError:D,retryCorpus:M,solo:!!n,start:P,next:I,prev:L,jumpTo:R,toggle:ee,toggleMute:te,replay:z,skip:ne,playExtra:B}}var J=n();function ki(e){let t=window.innerWidth,n=window.innerHeight,r=Math.min(e.right,t)-Math.max(e.left,0),i=Math.min(e.bottom,n)-Math.max(e.top,0);return r>e.width*.5&&i>e.height*.5}var Ai=/^(hidden|auto|scroll|clip)$/;function ji(e,t){let n=e.top,r=e.left,i=e.right,a=e.bottom;for(let e=t.parentElement;e;e=e.parentElement){let t=getComputedStyle(e),o=Ai.test(t.overflowY),s=Ai.test(t.overflowX);if(!o&&!s)continue;let c=e.getBoundingClientRect();o&&(n=Math.max(n,c.top),a=Math.min(a,c.bottom)),s&&(r=Math.max(r,c.left),i=Math.min(i,c.right))}return new DOMRect(r,n,Math.max(0,i-r),Math.max(0,a-n))}function Mi(e,t){let n=(0,J.c)(4),[r,i]=(0,W.useState)(null),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(null);return}let n=!0,r=0,a=null,o=e=>{e===a||e!==null&&a!==null&&Math.abs(e.top-a.top)<.5&&Math.abs(e.left-a.left)<.5&&Math.abs(e.width-a.width)<.5&&Math.abs(e.height-a.height)<.5||(a=e,i(e))},s=e.split(`,`).map(Li).filter(Boolean),c=()=>{if(!n)return;let e=null,t=null;for(let n of s){let r=Array.from(document.querySelectorAll(n)).filter(Ii).map(Fi).filter(Pi),i=r.find(Ni)??r[0];if(i){e=i.hit,t=i.rect;break}}if(!e||!t){o(null);return}let i=t;if(!ki(i)){let t=Date.now();t-r>1200&&(r=t,e.scrollIntoView({block:`center`,behavior:`smooth`})),o(null);return}o(i)};c();let l=0,u=()=>{l||=requestAnimationFrame(()=>{l=0,c()})},d=window.setInterval(c,750);return window.addEventListener(`resize`,u),window.addEventListener(`scroll`,u,{passive:!0,capture:!0}),()=>{n=!1,window.clearInterval(d),cancelAnimationFrame(l),window.removeEventListener(`resize`,u),window.removeEventListener(`scroll`,u,!0)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,W.useEffect)(a,o),r}function Ni(e){let{rect:t}=e;return ki(t)}function Pi(e){let{raw:t}=e;return t.width>0&&t.height>0}function Fi(e){let t=e.getBoundingClientRect();return{hit:e,raw:t,rect:ji(t,e)}}function Ii(e){return!e.checkVisibility||e.checkVisibility({checkOpacity:!0})}function Li(e){return e.trim()}function Ri(e){let t=(0,J.c)(83),{driver:n}=e,r=(0,W.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=e=>{let t=r.current,n=t&&t.isConnected?t:r.current=document.querySelector(`.canvas-scroll`);if(!n)return;let i=e.deltaMode===1?e.deltaY*16:e.deltaMode===2?e.deltaY*n.clientHeight:e.deltaY;n.scrollTop+=i},t[0]=i):i=t[0];let a=i,o=Mi(n.spotlight,n.active&&n.started&&!n.done),s=(0,W.useRef)(null),c=n.active&&!n.done&&!n.started&&!n.corpusError,l;t[1]===c?l=t[2]:(l={active:c},t[1]=c,t[2]=l),ae(s,l);let u=n.active&&n.started&&!n.done?n.chapter?.id:void 0,d,f;if(t[3]===u?(d=t[4],f=t[5]):(d=()=>{if(u)return document.body.dataset.tourChapter=u,Bi},f=[u],t[3]=u,t[4]=d,t[5]=f),(0,W.useEffect)(d,f),!n.active||n.done)return null;if(n.corpusError){let e,r,i;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,G.jsx)(`h2`,{children:`This walkthrough couldn’t load`}),i=(0,G.jsx)(`p`,{children:`The recorded scenes did not come through. Check your connection and try again.`}),t[6]=e,t[7]=r,t[8]=i):(e=t[6],r=t[7],i=t[8]);let a;t[9]===n.retryCorpus?a=t[10]:(a=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.retryCorpus,children:`Retry`}),t[9]=n.retryCorpus,t[10]=a);let o;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:zi,children:`Back to home`}),t[11]=o):o=t[11];let s;return t[12]===a?s=t[13]:(s=(0,G.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`tourx-welcome`,role:`alert`,children:[e,r,i,(0,G.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[a,o]})]})}),t[12]=a,t[13]=s),s}if(!n.started){let e,r;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,G.jsx)(`h2`,{id:`tourx-welcome-title`,children:`See Mavéa in action`}),t[14]=e,t[15]=r):(e=t[14],r=t[15]);let i=n.total===1?`scene plays`:`scenes play`,a;t[16]!==n.total||t[17]!==i?(a=(0,G.jsxs)(`p`,{children:[n.total,` short `,i,` automatically. Pause, skip, or move at your own pace.`]}),t[16]=n.total,t[17]=i,t[18]=a):a=t[18];let o;t[19]===n.start?o=t[20]:(o=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.start,children:`Start the tour`}),t[19]=n.start,t[20]=o);let c;t[21]===n.skip?c=t[22]:(c=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:n.skip,children:`Skip tour`}),t[21]=n.skip,t[22]=c);let l;t[23]!==o||t[24]!==c?(l=(0,G.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[o,c]}),t[23]=o,t[24]=c,t[25]=l):l=t[25];let u;return t[26]!==l||t[27]!==a?(u=(0,G.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{ref:s,className:`tourx-welcome`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tourx-welcome-title`,children:[e,r,a,l]})}),t[26]=l,t[27]=a,t[28]=u):u=t[28],u}let p=u===`ask`||!!o&&o.top+o.height/2>window.innerHeight*.58,m;t[29]===o?m=t[30]:(m=o&&(0,G.jsx)(`div`,{className:`tourx-ring`,style:{top:o.top-8,left:o.left-8,width:o.width+16,height:o.height+16}}),t[29]=o,t[30]=m);let h=`tourx-panel`+(n.solo?` is-solo`:``)+(p?` is-top`:``),g=n.solo?`Mini-demo controls`:`Walkthrough controls`,_=`head-`+n.index,v=n.solo?`Mini demo`:`${n.index+1} / ${n.total}`,y;t[31]===v?y=t[32]:(y=(0,G.jsx)(`span`,{className:`tourx-count`,children:v}),t[31]=v,t[32]=y);let b=n.chapter?.title,x;t[33]===b?x=t[34]:(x=(0,G.jsx)(`span`,{className:`tourx-title`,children:b}),t[33]=b,t[34]=x);let S;t[35]!==y||t[36]!==x||t[37]!==_?(S=(0,G.jsxs)(`div`,{className:`tourx-head`,children:[y,x]},_),t[35]=y,t[36]=x,t[37]=_,t[38]=S):S=t[38];let C=`coach-`+n.index,w;t[39]!==n.coach||t[40]!==C?(w=(0,G.jsx)(`p`,{className:`tourx-coach`,children:n.coach},C),t[39]=n.coach,t[40]=C,t[41]=w):w=t[41];let T;t[42]!==n.index||t[43]!==n.prev||t[44]!==n.solo?(T=!n.solo&&(0,G.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.prev,disabled:n.index===0,"aria-label":`Previous chapter`,children:(0,G.jsx)(B.chevL,{className:`tourx-ic`})}),t[42]=n.index,t[43]=n.prev,t[44]=n.solo,t[45]=T):T=t[45];let E=n.playing?`Pause autoplay`:`Turn on autoplay`,D;t[46]===n.playing?D=t[47]:(D=n.playing?(0,G.jsx)(B.pause,{className:`tourx-ic`}):(0,G.jsx)(B.play,{className:`tourx-ic`}),t[46]=n.playing,t[47]=D);let O=n.playing?`Pause`:`Autoplay`,k;t[48]===O?k=t[49]:(k=(0,G.jsx)(`span`,{children:O}),t[48]=O,t[49]=k);let A;t[50]!==n.toggle||t[51]!==E||t[52]!==D||t[53]!==k?(A=(0,G.jsxs)(`button`,{type:`button`,className:`tourx-btn tourx-play tourx-auto`,onClick:n.toggle,"aria-label":E,children:[D,k]}),t[50]=n.toggle,t[51]=E,t[52]=D,t[53]=k,t[54]=A):A=t[54];let j=n.muted?`Turn narration on`:`Mute narration`,M=n.muted?`Turn narration on`:`Mute narration`,N;t[55]===n.muted?N=t[56]:(N=n.muted?(0,G.jsx)(B.speakerOff,{className:`tourx-ic`}):(0,G.jsx)(B.speaker,{className:`tourx-ic`}),t[55]=n.muted,t[56]=N);let P;t[57]!==n.muted||t[58]!==n.toggleMute||t[59]!==j||t[60]!==M||t[61]!==N?(P=(0,G.jsx)(`button`,{type:`button`,className:`tourx-btn tourx-mute`,onClick:n.toggleMute,"aria-label":j,"aria-pressed":n.muted,title:M,children:N}),t[57]=n.muted,t[58]=n.toggleMute,t[59]=j,t[60]=M,t[61]=N,t[62]=P):P=t[62];let F;t[63]===n?F=t[64]:(F=!n.solo&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.next,"aria-label":`Next chapter`,children:(0,G.jsx)(B.chevR,{className:`tourx-ic`})}),(0,G.jsx)(`div`,{className:`tourx-dots`,role:`tablist`,"aria-label":`Chapters`,children:Array.from({length:n.total},(e,t)=>(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===n.index,"aria-label":`Chapter ${t+1}`,className:`tourx-dot`+(t===n.index?` is-active`:``),onClick:()=>n.jumpTo(t)},t))})]}),t[63]=n,t[64]=F);let I=n.solo?`Back to demos`:`Skip`,L;t[65]!==n.skip||t[66]!==I?(L=(0,G.jsx)(`button`,{type:`button`,className:`tourx-skip`,onClick:n.skip,children:I}),t[65]=n.skip,t[66]=I,t[67]=L):L=t[67];let R;t[68]!==T||t[69]!==A||t[70]!==P||t[71]!==F||t[72]!==L?(R=(0,G.jsxs)(`div`,{className:`tourx-controls`,children:[T,A,P,F,L]}),t[68]=T,t[69]=A,t[70]=P,t[71]=F,t[72]=L,t[73]=R):R=t[73];let z;t[74]!==S||t[75]!==w||t[76]!==R||t[77]!==h||t[78]!==g?(z=(0,G.jsxs)(`div`,{className:h,role:`group`,"aria-label":g,onWheel:a,children:[S,w,R]}),t[74]=S,t[75]=w,t[76]=R,t[77]=h,t[78]=g,t[79]=z):z=t[79];let ee;return t[80]!==z||t[81]!==m?(ee=(0,G.jsxs)(`div`,{className:`tourx`,"aria-live":`polite`,children:[m,z]}),t[80]=z,t[81]=m,t[82]=ee):ee=t[82],ee}function zi(){window.location.hash=`#/`}function Bi(){delete document.body.dataset.tourChapter}function Vi({onStart:e,onReplay:t,onPlayExtra:n,hasStoredSession:r=!1}){let i=(0,W.useRef)(null);ae(i);let a=x();return(0,G.jsx)(`div`,{ref:i,className:`tour-end`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-end-title`,children:(0,G.jsxs)(`section`,{className:`tour-end-card`,children:[(0,G.jsxs)(`header`,{className:`tour-end-intro`,children:[(0,G.jsx)(`div`,{className:`tour-end-mascot`,"aria-hidden":`true`,ref:a,children:(0,G.jsx)(de,{state:`idle`,emotion:`neutral`,gaze:`center`})}),(0,G.jsx)(`h2`,{id:`tour-end-title`,className:`tour-end-title tour-end-line`,children:`That's Mavéa.`}),(0,G.jsx)(`p`,{className:`tour-end-tagline tour-end-line`,children:`Talk to AI. See what it means.`}),(0,G.jsx)(`p`,{className:`tour-end-copy tour-end-line`,children:`Try it now, or open any scripted mini-demo below to see that feature operate on the real interface.`}),(0,G.jsxs)(`div`,{className:`tour-end-actions tour-end-line`,children:[(0,G.jsx)(`button`,{type:`button`,className:`tour-end-start`,onClick:e,children:r?`Back to your session`:`Start Mavéa`}),(0,G.jsx)(`button`,{type:`button`,className:`tour-end-replay`,onClick:t,children:`Replay the tour`})]})]}),(0,G.jsxs)(`div`,{className:`tour-end-extras`,children:[(0,G.jsx)(`h3`,{children:`More to explore`}),(0,G.jsx)(`div`,{className:`tour-end-grid`,children:ai.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`tour-end-extra`,onClick:()=>n(e.id),"aria-label":`Play scripted mini-demo: ${e.title}`,children:[(0,G.jsx)(`span`,{className:`tour-end-glyph`,"aria-hidden":`true`,children:e.glyph}),(0,G.jsxs)(`span`,{className:`tour-end-extra-copy`,children:[(0,G.jsx)(`strong`,{children:e.title}),(0,G.jsx)(`small`,{children:e.hook})]})]},e.id))})]})]})})}var Hi=new Map([{persona:`cfo`,steps:[{ask:`Run my quarterly review: ARR grew from $12.4M to $15.1M, churn ticked up from 2.1% to 2.8%, and regions came in at NA $8.2M, EMEA $4.6M, APAC $2.3M.`,bakeAsk:`Run my quarterly review: ARR grew from $12.4M to $15.1M, churn ticked up from 2.1% to 2.8%, and regions came in at NA $8.2M, EMEA $4.6M, APAC $2.3M. Build the full picture, including growth, the churn drift, and how the regions stack up.`,expect:{minBlocks:4,suggests:!0}},{ask:`Walk me through the bridge: new business added $1.9M, expansion $1.3M, and churn gave back $0.5M.`,beats:[{kind:`pin`,atMs:900}],note:`Renata pins the bridge. The next question uses that context.`,expect:{minBlocks:2,suggests:!0}},{ask:`Forecast for next quarter`,bakeAsk:`Forecast for next quarter: if churn keeps drifting at this pace, where does ARR land? Model it from the numbers we established.`,viaChip:!0,expect:{minBlocks:2}},{beats:[{kind:`export`,atMs:500,format:`presentation`}],note:`One tap: the whole review becomes a board deck.`,holdMs:6500},{beats:[{kind:`dashboard`,atMs:500,settings:!0}],note:`A living dashboard keeps a board like this up to date.`,holdMs:6500},{beats:[{kind:`present`,atMs:500}],note:`…or presents itself, full screen.`,holdMs:6e3}]},{persona:`student`,steps:[{ask:`What does saving $200 a month at 5% become after 10 years?`,bakeAsk:`What does saving $200 a month at 5% interest become after 10 years? Chart it year by year, split what I put in from what the interest earned, and make the monthly amount adjustable.`,beats:[{kind:`bend`,atMs:1100}],note:`Grab the dial. The whole answer updates live.`,expect:{minBlocks:3,bend:!0,suggests:!0}},{ask:`Why does compound interest beat simple interest? It's on my econ exam.`,beats:[{kind:`pen`,atMs:1400}],note:`Mavéa’s Pen marks the exact part Maya is studying.`,expect:{minBlocks:2}},{beats:[{kind:`flashcards`,atMs:600}],note:`Any card can become a flashcard and join her study deck.`,holdMs:6e3}]},{persona:`dev`,steps:[{ask:`Explain how OAuth login works, step by step. I'm adding it to our app.`,beats:[{kind:`focus`,atMs:1200,walk:!0}],note:`Focus mode: one card at a time, everything else dims.`,expect:{minBlocks:3,suggests:!0}},{ask:`Compare session cookies and JWTs for keeping users signed in. Focus on tradeoffs, not dogma.`,bakeAsk:`Compare session cookies and JWTs for keeping users signed in. Show the real tradeoffs side by side, including revocation, statelessness, size, XSS and CSRF exposure, and when each wins.`,beats:[{kind:`pin`,atMs:1e3}],expect:{minBlocks:2}},{beats:[{kind:`palette`,atMs:600}],note:`Press Command K. Every feature is a keystroke away.`,holdMs:5e3},{beats:[{kind:`export`,atMs:500,format:`presentation`}],note:`The whole session becomes a polished presentation.`,holdMs:7500}]},{persona:`traveler`,steps:[{ask:`Plan a long weekend in Lisbon. Three days, first visit, and we love food and views.`,expect:{minBlocks:4,suggests:!0}},{ask:`How do we plan a great day trip to Sintra on Saturday?`,beats:[{kind:`canvas`,atMs:1e3}],note:`The spatial canvas: the whole trip on one board.`,expect:{minBlocks:2}},{beats:[{kind:`export`,atMs:500,format:`document`}],note:`The plan is ready to print for the plane.`,holdMs:7500}]}].map(e=>[e.persona,e]));function Ui(e){return Hi.get(e)}function Wi(e){return e.steps.filter(e=>!!e.ask)}var Gi=1300,Ki=900;function qi(e,t){return(e?.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,t)}function Ji(e,t,n,r){switch(e.kind){case`pin`:r(e.atMs,()=>t.pinFirstBlock());break;case`bend`:n?.spec.bend&&r(e.atMs,()=>t.bendIt());break;case`mark`:r(e.atMs,()=>t.setInkArmed(!0)),r(e.atMs+500,()=>t.scriptedMark());break;case`pen`:r(e.atMs,()=>t.drawPenOnFirstBlock());break;case`focus`:r(e.atMs,()=>t.setViewMode(`focus`)),e.walk&&qi(n,4).forEach((n,i)=>r(e.atMs+Ki+i*Gi,()=>t.setSpot(n)));break;case`canvas`:{r(e.atMs,()=>t.setViewMode(`canvas`));let i=qi(n,3);i.forEach((n,i)=>r(e.atMs+Ki+i*Gi,()=>t.setSpot(n))),r(e.atMs+Ki+i.length*Gi,()=>t.setSpot(null));break}case`export`:r(e.atMs,()=>t.openExport()),e.format===`document`&&r(e.atMs+1800,()=>t.exportSetFormat(`document`)),r(e.atMs+3e3,()=>t.exportPickTemplate(1));break;case`dashboard`:r(e.atMs,()=>t.openDashboards()),e.settings&&r(e.atMs+2600,()=>t.dashboardShowSettings());break;case`flashcards`:r(e.atMs,()=>t.openFlashcards());break;case`present`:r(e.atMs,()=>t.setPresenting(!0));break;case`share`:r(e.atMs,()=>t.setShareOpen(!0));break;case`palette`:r(e.atMs,()=>t.setPaletteOpen(!0))}}function Yi(e){switch(e.kind){case`canvas`:return 6400;case`focus`:return e.walk?7300:1600;case`export`:return e.format===`document`?4800:3800;case`dashboard`:return e.settings?4400:2600;case`mark`:return 2400;case`pen`:return 3200;default:return 1600}}function Xi(e){return e?.length?Math.max(...e.map(e=>e.atMs+Yi(e))):0}i();var Zi=Object.assign({"./cfo.generated.json":()=>a(()=>import(`./cfo.generated-j5CXp1Zz.js`),[]),"./dev.generated.json":()=>a(()=>import(`./dev.generated-DYgVxL_4.js`),[]),"./student.generated.json":()=>a(()=>import(`./student.generated-DS_acPaJ.js`),[]),"./traveler.generated.json":()=>a(()=>import(`./traveler.generated-Beun9X7y.js`),[])});function Qi(e){let t=!1,n=e.frames.map(e=>{let n=e.spec.blocks,r=n.map(e=>ue(e.type,e.props)&&le(e.type,e.props));if(r.every(Boolean))return e;t=!0;let i=new Map,a=0;r.forEach((e,t)=>{e&&i.set(t,a++)});let o=e.tour?.filter(e=>i.has(e.index)).map(e=>({...e,index:i.get(e.index)}));return{...e,spec:{...e.spec,blocks:n.filter((e,t)=>r[t])},...o?{tour:o}:{}}});return t?{...e,frames:n}:e}async function $i(e){let t=Zi[`./${e}.generated.json`];if(!t)return null;try{let e=(await t()).default??null;return e?Qi(e):null}catch{return null}}var ea=4500,ta=1e3,Y=6e4;function na(e,t,n){if(!e[t]?.ask)return null;let r=e.slice(0,t+1).filter(e=>!!e.ask).length-1;return n.frames[r]??null}function ra(e,t,n){let r=e.slice(0,t+1).filter(e=>!!e.ask).length;return n.frames[Math.max(0,r-1)]??null}function ia(e){let{active:t,personaId:n}=e,r=n?Ui(n):void 0,i=r?.steps??[],a=i.length,[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(`loading`),[u,d]=(0,W.useState)(()=>Math.max(0,Math.min(a-1,e.startStep??0))),[f,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[v,y]=(0,W.useState)(!1),b=(0,W.useRef)(v);b.current=v;let[x,S]=(0,W.useState)(!1),[C,w]=(0,W.useState)(0),[T,E]=(0,W.useState)(null),D=(0,W.useRef)(e.ops);D.current=e.ops;let O=(0,W.useRef)(null),k=(0,W.useRef)(0),A=(0,W.useCallback)(()=>{if(!t||!n)return;l(`loading`);let e=++k.current;$i(n).then(t=>{if(e!==k.current)return;let n=r?Wi(r).length:0,i=!!t&&!!r&&t.frames.length===n;s(i?t:null),l(i?`ready`:`error`)})},[t,n,r]);(0,W.useEffect)(A,[A]);let j=(0,W.useCallback)(()=>{let e=D.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,W.useEffect)(()=>{if(!t||!f||x||c!==`ready`||!o||!r)return;let e=r.steps[u];if(!e)return;p(r.persona,u);let n=D.current,i=hi(),a=i.after;E(null),O.current=null,j(),n.setMuted(b.current);let s=na(r.steps,u,o),l=s??ra(r.steps,u,o),d=e.ask?ri(e.ask):null,m=s?q({...s,question:d??s.question}):null,h=l?q(l):null,g=()=>{let t=e.beats??[];for(let e of t)Ji(e,n,h,a);if(e.note){let n=t.length?Math.min(...t.map(e=>e.atMs)):0;a(n,()=>E(ri(e.note??``)))}O.current=Date.now()+Xi(t)+(e.holdMs??ea)},_=e=>{let t=Date.now(),r=0,i=()=>{if(Date.now()-t>=Y){g();return}if(r=n.isSpeaking()||n.isBusy()?0:r+1,r>=7){g();return}a(250,i)};a(e,i)};if(e.ask&&m){let t=r.steps.slice(0,u+1).filter(e=>!!e.ask).length-1,i=t>0?o.frames[t-1]??null:null,s=!!e.viaChip&&!!i?.spec.suggests?.some(t=>t.label===e.ask),c=d??e.ask,l;s?(a(700,()=>n.pressKeepGoing(e.ask??c)),l=1600):l=_i(a,n.typeInto,c,400)+360,a(l,()=>gi(a,()=>n.showFrame(m,c))),_(l+ta)}else!n.hasCanvas()&&h&&n.showFrame(h,h.question,{silent:!0}),a(300,g);return i.cancel},[u,C,t,f,x,c,o,r,j]),(0,W.useEffect)(()=>{if(!t||!f||x||!h||c!==`ready`)return;let e=D.current,n=window.setInterval(()=>{let t=O.current;!t||Date.now()<t||e.isSpeaking()||e.isBusy()||(window.clearInterval(n),u+1>=a?(j(),S(!0)):d(u+1))},250);return()=>window.clearInterval(n)},[u,C,t,f,x,h,a,c,j]),(0,W.useEffect)(()=>()=>j(),[j]);let M=(0,W.useCallback)(()=>{_(),m(!0),g(!0),S(!1)},[]),N=(0,W.useCallback)((e,t)=>{_(),S(!1),t?.keepPlaying||g(!1),d(Math.max(0,Math.min(a-1,e))),w(e=>e+1)},[a]),P=(0,W.useCallback)(()=>{u+1>=a?(j(),S(!0)):N(u+1,{keepPlaying:!0})},[u,a,N,j]),F=(0,W.useCallback)(()=>N(u-1),[u,N]),I=(0,W.useCallback)(e=>N(e),[N]),L=(0,W.useCallback)(()=>{j(),m(!0),N(0),g(!0)},[N,j]),R=(0,W.useCallback)(()=>{if(_(),!f){M();return}if(x){L();return}g(e=>!e)},[x,L,M,f]),z=(0,W.useCallback)(()=>{_();let e=!b.current;b.current=e,y(e),D.current.setMuted(e),e&&D.current.cancelSpeech()},[]),B=(0,W.useCallback)(()=>{j(),S(!0)},[j]);return{active:t,started:f,loadState:c,model:o?.model??null,reload:A,index:u,total:a,step:t?i[u]??null:null,note:T,playing:h,muted:v,done:x,start:M,next:P,prev:F,jumpTo:I,toggle:R,toggleMute:z,replay:L,skip:B}}function aa(e){return/\p{Extended_Pictographic}/u.test(e)}function oa(){window.location.hash=`#/`}function sa({driver:e,member:t,onExit:n}){let r=(0,W.useRef)(null),i=e.active&&e.loadState===`ready`&&(!e.started||e.done);if(ae(r,{active:i}),!e.active)return null;let a={"--accent":t.accent};if(e.loadState===`loading`)return(0,G.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`demox-load`,style:a,children:[(0,G.jsx)(B.spinner,{className:`demox-spinner`}),`Loading curated replay…`]})});if(e.loadState===`error`)return(0,G.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`demox-card`,style:a,role:`alert`,children:[(0,G.jsx)(`p`,{className:`demox-card-title`,children:`This demo couldn’t load`}),(0,G.jsx)(`p`,{className:`demox-card-body`,children:`The curated prerecorded example did not come through. Check your connection and try again.`}),(0,G.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.reload,children:`Retry`}),(0,G.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:oa,children:`Back to home`})]})]})});if(!e.started)return(0,G.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{ref:r,className:`demox-card demox-start`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-start-title`,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(aa(t.avatar)?` emoji`:``),children:t.avatar}),(0,G.jsx)(`span`,{className:`demox-card-kicker`,children:`Curated prerecorded example`}),(0,G.jsxs)(`p`,{id:`demox-start-title`,className:`demox-card-title`,children:[`Watch: `,t.useCase]}),(0,G.jsx)(`p`,{className:`demox-card-body`,children:`This fictional scenario replays prerecorded, model-generated answers with curated feature choreography. Pause or move between steps at any time.`}),(0,G.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.start,children:`Start demo`}),(0,G.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:oa,children:`Back to home`})]})]})});if(e.done){let i=R.filter(e=>e.id!==t.id);return(0,G.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{ref:r,className:`demox-card demox-end`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-end-title`,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(aa(t.avatar)?` emoji`:``),children:t.avatar}),(0,G.jsx)(`p`,{id:`demox-end-title`,className:`demox-card-title`,children:`End of curated replay`}),(0,G.jsx)(`p`,{className:`demox-card-body`,children:`These model-generated answers were prerecorded, then replayed with curated feature choreography. The scenario is illustrative, not a live result or customer testimonial. Try your own question with your selected provider.`}),(0,G.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:n,children:`Try it yourself`}),(0,G.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:e.replay,children:`Replay`})]}),(0,G.jsx)(`div`,{className:`demox-others`,role:`group`,"aria-label":`More curated replays`,children:i.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`demox-other`,style:{"--accent":e.accent},onClick:()=>m(e.id),title:`${e.name} · ${e.role}`,children:[(0,G.jsx)(`span`,{className:`demox-other-avatar`+(aa(e.avatar)?` emoji`:``),children:e.avatar}),e.useCase]},e.id))})]})})}return(0,G.jsxs)(`div`,{className:`demox`,"aria-live":`polite`,children:[(0,G.jsxs)(`div`,{className:`demox-banner`,style:a,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(aa(t.avatar)?` emoji`:``),children:t.avatar}),(0,G.jsxs)(`span`,{className:`demox-who`,children:[(0,G.jsx)(`span`,{className:`demox-name`,children:t.useCase}),(0,G.jsxs)(`span`,{className:`demox-role`,children:[t.name,` · `,t.role]})]}),(0,G.jsx)(`span`,{className:`demox-badge`,children:`Curated replay`})]}),e.note&&(0,G.jsx)(`div`,{className:`demox-note`,style:a,children:e.note},e.note),(0,G.jsxs)(`div`,{className:`demox-panel`,style:a,role:`group`,"aria-label":`Demo controls`,children:[(0,G.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.prev,disabled:e.index===0,"aria-label":`Previous step`,children:(0,G.jsx)(B.chevL,{className:`demox-ic`})}),(0,G.jsx)(`button`,{type:`button`,className:`demox-btn demox-play`,onClick:e.toggle,"aria-label":e.playing?`Pause autoplay`:`Turn on autoplay`,children:e.playing?(0,G.jsx)(B.pause,{className:`demox-ic`}):(0,G.jsx)(B.play,{className:`demox-ic`})}),(0,G.jsx)(`button`,{type:`button`,className:`demox-btn demox-mute`,onClick:e.toggleMute,"aria-label":e.muted?`Turn narration on`:`Mute narration`,"aria-pressed":e.muted,title:e.muted?`Turn narration on`:`Mute narration`,children:e.muted?(0,G.jsx)(B.speakerOff,{className:`demox-ic`}):(0,G.jsx)(B.speaker,{className:`demox-ic`})}),(0,G.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.next,"aria-label":`Next step`,children:(0,G.jsx)(B.chevR,{className:`demox-ic`})}),(0,G.jsx)(`div`,{className:`demox-dots`,role:`tablist`,"aria-label":`Steps`,children:Array.from({length:e.total},(t,n)=>(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":n===e.index,"aria-label":`Step ${n+1}`,className:`demox-dot`+(n===e.index?` is-active`:``),onClick:()=>e.jumpTo(n)},n))}),(0,G.jsxs)(`button`,{type:`button`,className:`demox-skip`,onClick:n,"aria-label":`Exit demo, try it yourself`,children:[(0,G.jsx)(`span`,{className:`demox-skip-full`,children:`Exit, try it yourself`}),(0,G.jsx)(`span`,{className:`demox-skip-short`,"aria-hidden":`true`,children:`Exit`})]})]})]})}i();var ca=[`nasa-cfd`,`fomc`,`weather`,`cars`,`react-readme`],la=null;async function ua(){return la||(la=[...(await a(()=>import(`./prism.generated-BQkO5r6r.js`),[])).default.docs].sort((e,t)=>{let n=ca.indexOf(e.id),r=ca.indexOf(t.id);return(n<0?99:n)-(r<0?99:r)}).map(e=>({id:e.id,type:e.type,name:e.name,doc:{name:e.name,mime:e.mime,data:e.data,size:e.size},spec:{...e.spec,claims:e.spec.claims.map(e=>({...e,kind:Ut(e.kind)}))},proposed:e.proposed})),la)}var da=`How does $10,000 grow at 7% over 30 years?`;function fa(){let e=ni(`money`)?.frames[0]?.spec.blocks??[],t=ni(`monthly`)?.frames[0]?.spec.blocks??[],n=[],r=(e,t,r=1)=>{for(let i of t)for(let t of e)t.type===i&&t.id&&!n.includes(t)&&r-->0&&n.push(t)};return r(e,[`chart`]),r(e,[`stacked`,`stack`]),r(t,[`chart`]),r(t,[`kpi`,`stack`,`stacked`]),r(e,[`breakdown`]),n}function pa(){let e=Jt().find(e=>e.question===da);if(e)return e.id;let t=fa();if(t.length===0)return null;let n=Xt({title:`Investment growth · $10k at 7%`,question:da,topic:`money`});return n.thesis={text:`Your initial $10,000 grows by more than 7.6× through the power of compounding interest.`,saidAt:n.createdAt},n.widgets=t.map(e=>qt(e,`tour`)),n.cadence={data:`hourly`,ai:`daily`},n.nextDataAt=Gt(n.createdAt,Wt[n.cadence.data]),n.nextAiAt=Gt(n.createdAt,Yt[n.cadence.ai]),Kt(n),n.id}var ma=44,ha=2,ga=24e3;function _a(e,t,n){let r=(t,n)=>{for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))};r(0,`RIFF`),e.setUint32(4,36+t*ha,!0),r(8,`WAVE`),r(12,`fmt `),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,1,!0),e.setUint32(24,n,!0),e.setUint32(28,n*ha,!0),e.setUint16(32,ha,!0),e.setUint16(34,16,!0),r(36,`data`),e.setUint32(40,t*ha,!0)}function va(e,t,n,r){let i=ma+n*ha;for(let a=n;a<r;a++){let n=Math.max(-1,Math.min(1,t[a]));e.setInt16(i,n<0?n*32768:n*32767,!0),i+=ha}}function ya(e,t){let n=new ArrayBuffer(ma+e*ha),r=new DataView(n);return _a(r,e,t),{buffer:n,view:r}}function ba(){let e=globalThis.scheduler;return typeof e?.yield==`function`?e.yield():typeof MessageChannel==`function`?new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),t.port2.close(),e()},t.port2.postMessage(null)}):new Promise(e=>setTimeout(e,0))}async function xa(e,t,n=ba){let{buffer:r,view:i}=ya(e.length,t);for(let t=0;t<e.length;t+=ga)t>0&&await n(),va(i,e,t,Math.min(t+ga,e.length));return r}i();var Sa=512,Ca=16e3,wa=Sa/Ca*1e3,Ta=12,Ea=Math.ceil(90*Ca/Sa),Da=3,Oa=2,ka=.5,Aa=.35,ja=Math.round(300/wa);function Ma(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Na(e){let t=e&&typeof e==`object`&&`name`in e?String(e.name):void 0;return t===`NotAllowedError`||t===`SecurityError`?`not-allowed`:`audio`}function Pa(e){return e?45e3:25e3}var Fa=class t{mode=`vad`;capabilities;vad=null;vadLoading=!1;vadFailed=!1;phase=`idle`;muted=!1;wantRunning=!1;continuous=!1;disposed=!1;sessionId=0;transcriptionAborts=new Set;transcriptionChain=Promise.resolve();queuedTranscriptions=0;activeTranscriptions=0;transcriptionSlotWaiters=[];preRollFrames=[];utteranceFrames=[];quietFrames=0;speechEnding=!1;captureCtx=null;maveaSpeaking=!1;echoTailUntil=0;onBargeIn;utteranceIsEcho=!1;bargeInTimer=null;static ECHO_TAIL_MS=600;static WHISPER_RETRY_MS=1e4;whisperOk=null;whisperRetryAt=0;resultSubs=new Set;stateSubs=new Set;constructor(){let e=typeof navigator<`u`&&typeof navigator.mediaDevices?.getUserMedia==`function`;this.capabilities={stt:e,tts:!1,canUseRealVoice:e}}start(e){if(!this.muted){if(e?.continuous!==void 0&&(this.continuous=e.continuous),this.wantRunning||(this.sessionId+=1),this.wantRunning=!0,this.vadFailed){this.emitState({phase:`idle`,error:`unsupported`});return}this.vad?this.startVad():this.loadVad()}}stop(){this.wantRunning=!1,this.continuous=!1,this.sessionId+=1,this.abortTranscriptions(),this.pauseVad(),this.clearBargeInTimer(),this.clearSpeechEnding(),this.preRollFrames=[],this.utteranceFrames=[],this.phase!==`idle`&&this.emitState({phase:`idle`})}forceStop(){if(this.phase===`transcribing`){this.continuous=!1,this.wantRunning=!1,this.pauseVad(),this.emitState({phase:`transcribing`});return}let e=this.continuous;this.wantRunning=e,this.pauseVad(),this.clearBargeInTimer(),this.clearSpeechEnding();let t=Ma([...this.utteranceFrames,...this.preRollFrames]);this.preRollFrames=[],this.utteranceFrames=[],this.utteranceIsEcho=!1,t.length>0?(this.emitState({phase:`transcribing`}),this.enqueueTranscription(t,this.sessionId,e)):(this.emitState({phase:`idle`}),e&&this.startVad())}speak(e){return Promise.resolve()}cancel(){this.stop()}setMuted(e){this.muted=e,e&&this.stop()}setMaveaSpeaking(e){this.maveaSpeaking&&!e&&(this.echoTailUntil=Date.now()+t.ECHO_TAIL_MS),this.maveaSpeaking=e}setSoundEnabled(e){}onResult(e){return this.resultSubs.add(e),()=>this.resultSubs.delete(e)}onStateChange(e){return this.stateSubs.add(e),()=>this.stateSubs.delete(e)}dispose(){this.disposed=!0,this.wantRunning=!1,this.sessionId+=1,this.abortTranscriptions(),this.releaseWaitingTranscriptions(),this.clearBargeInTimer();let e=this.takeCaptureContextCloser();this.vad?(this.vad.destroy().catch(()=>{}).then(e),this.vad=null):e(),this.resultSubs.clear(),this.stateSubs.clear()}async loadVad(){if(!this.vadLoading){this.vadLoading=!0;try{let{MicVAD:t}=await a(async()=>{let{MicVAD:t}=await import(`./dist-kNHRtoqd.js`).then(t=>e(t.default,1));return{MicVAD:t}},__vite__mapDeps([0,1,2])),n=this.ensureCaptureContext();if(this.vad=await t.new({model:`v5`,startOnLoad:!1,baseAssetPath:`/`,onnxWASMBasePath:`/`,...n?{audioContext:n}:{},positiveSpeechThreshold:ka,negativeSpeechThreshold:Aa,minSpeechMs:280,preSpeechPadMs:500,redemptionMs:1600,onFrameProcessed:(e,t)=>{this.captureFrame(t),this.trackSpeechTail(e.isSpeech)},onSpeechStart:()=>this.handleSpeechStart(),onSpeechRealStart:()=>this.handleSpeechRealStart(),onSpeechEnd:e=>void this.handleSpeechEnd(e),onVADMisfire:()=>this.handleMisfire()}),this.disposed){let e=this.takeCaptureContextCloser();this.vad.destroy().catch(()=>{}).then(e),this.vad=null;return}this.vadLoading=!1,this.wantRunning&&this.startVad()}catch(e){console.warn(`[VadVoice] Local Silero VAD failed to load`,e),this.vadLoading=!1,this.vadFailed=!0,this.wantRunning&&this.emitState({phase:`idle`,error:`unsupported`})}}}clearBargeInTimer(){this.bargeInTimer!==null&&(clearTimeout(this.bargeInTimer),this.bargeInTimer=null)}ensureCaptureContext(){if(this.captureCtx||this.disposed)return this.captureCtx;if(typeof AudioContext!=`function`)return null;try{this.captureCtx=new AudioContext}catch{this.captureCtx=null}return this.captureCtx}takeCaptureContextCloser(){let e=this.captureCtx;return this.captureCtx=null,()=>{e?.close().catch(()=>{})}}startVad(){this.vad&&(this.captureCtx?.state===`suspended`&&this.captureCtx.resume().catch(()=>{}),Promise.resolve(this.vad.start()).catch(e=>{!this.disposed&&this.wantRunning&&(this.wantRunning=!1,this.emitState({phase:`idle`,error:Na(e)}))}))}pauseVad(){this.vad&&Promise.resolve(this.vad.pause()).catch(()=>{}).then(()=>this.suspendCaptureContext())}suspendCaptureContext(){this.wantRunning||this.disposed||this.captureCtx?.state===`running`&&this.captureCtx.suspend().catch(()=>{})}captureFrame(e){if(this.phase===`listening`&&!this.utteranceIsEcho){this.utteranceFrames.length<Ea&&this.utteranceFrames.push(e);return}this.preRollFrames.push(e),this.preRollFrames.length>Ta&&this.preRollFrames.shift()}trackSpeechTail(e){if(!(this.phase!==`listening`||this.utteranceIsEcho)){if(e>=ka){this.quietFrames=0,this.speechEnding&&(this.speechEnding=!1,this.emitState({phase:`listening`,speechEnding:!1}));return}e>=Aa||this.speechEnding||(this.quietFrames+=1,!(this.quietFrames<ja)&&(this.speechEnding=!0,this.emitState({phase:`listening`,speechEnding:!0})))}}clearSpeechEnding(){this.quietFrames=0,this.speechEnding=!1}handleSpeechStart(){this.muted||(this.clearSpeechEnding(),this.utteranceIsEcho=Date.now()<this.echoTailUntil,this.utteranceFrames=this.preRollFrames,this.preRollFrames=[],!this.utteranceIsEcho&&this.emitState({phase:`listening`}))}handleSpeechRealStart(){this.muted||(this.utteranceIsEcho&&!this.maveaSpeaking&&(this.utteranceIsEcho=!1,this.utteranceFrames=[...this.utteranceFrames,...this.preRollFrames],this.preRollFrames=[],this.emitState({phase:`listening`})),!this.utteranceIsEcho&&this.maveaSpeaking&&this.onBargeIn?.())}handleMisfire(){this.clearBargeInTimer(),this.clearSpeechEnding(),this.utteranceIsEcho=!1,this.utteranceFrames=[],this.continuous||(this.wantRunning=!1,this.pauseVad()),this.phase!==`idle`&&this.emitState({phase:`idle`})}handleSpeechEnd(e){if(this.clearBargeInTimer(),this.clearSpeechEnding(),this.utteranceIsEcho){this.utteranceIsEcho=!1,this.utteranceFrames=[],this.emitState({phase:`idle`});return}this.utteranceFrames=[],this.continuous||(this.wantRunning=!1,this.pauseVad()),this.emitState({phase:`transcribing`}),this.enqueueTranscription(e,this.sessionId)}enqueueTranscription(e,t,n=!1){if(this.queuedTranscriptions>=Da){this.emitState({phase:`idle`,error:`audio`}),n&&this.wantRunning&&this.startVad();return}this.queuedTranscriptions+=1;let r=this.runTranscription(e,t);this.transcriptionChain=this.transcriptionChain.catch(()=>{}).then(async()=>{try{this.deliverTranscription(await r,t,n)}finally{--this.queuedTranscriptions}})}async runTranscription(e,t){await this.acquireTranscriptionSlot();let n=new AbortController;this.transcriptionAborts.add(n);try{if(this.disposed||t!==this.sessionId)return null;let r=await this.transcribeWhisper(e,n.signal);return this.disposed||n.signal.aborted||t!==this.sessionId?null:r}catch{return null}finally{this.transcriptionAborts.delete(n),this.releaseTranscriptionSlot()}}deliverTranscription(e,t,n){if(!e||this.disposed||t!==this.sessionId)return;let r=e.text.trim();if(!r){this.emitState({phase:`idle`,error:e.error??`no-speech`}),n&&this.wantRunning&&this.startVad();return}let i=e.confidence!==void 0&&e.confidence<.7||(e.noSpeechProbability??0)>=.6;this.emitState({phase:`heard`,transcript:r}),this.emitResult({transcript:r,confidence:e.confidence,noSpeechProbability:e.noSpeechProbability,lowConfidence:i}),this.emitState({phase:`idle`}),n&&this.wantRunning&&this.startVad()}acquireTranscriptionSlot(){return this.activeTranscriptions<Oa?(this.activeTranscriptions+=1,Promise.resolve()):new Promise(e=>this.transcriptionSlotWaiters.push(e))}releaseTranscriptionSlot(){let e=this.transcriptionSlotWaiters.shift();e?e():--this.activeTranscriptions}releaseWaitingTranscriptions(){let e=this.transcriptionSlotWaiters.splice(0);this.activeTranscriptions+=e.length,e.forEach(e=>e())}abortTranscriptions(){for(let e of this.transcriptionAborts)e.abort();this.transcriptionAborts.clear()}async transcribeWhisper(e,t){let n=await this.transcribeWhisperDetailed(e,t);return t?n:n.text}async transcribeWhisperDetailed(e,n){if(this.whisperOk===!1&&Date.now()<this.whisperRetryAt)return{text:``,error:`transcription`};try{let t=await xa(e,Ca),r=new FormData;r.append(`file`,new Blob([t],{type:`audio/wav`}),`speech.wav`),r.append(`language`,`en`),r.append(`response_format`,`verbose_json`);let i=Pa(this.whisperOk===!0),a=AbortSignal.timeout(i),o=n?AbortSignal.any([n,a]):a,s=await fetch(`/stt/inference`,{method:`POST`,body:r,signal:o});if(s.ok){let e=await s.json(),t=e.text?.trim()??``;if(this.whisperOk=!0,this.whisperRetryAt=0,t){let n=[...e.words??[],...(e.segments??[]).flatMap(e=>e.words??[])].map(e=>e.probability).filter(e=>Number.isFinite(e)),r=(e.segments??[]).map(e=>e.avg_logprob).filter(e=>Number.isFinite(e)),i=n.length>0?n.reduce((e,t)=>e+t,0)/n.length:r.length>0?Math.exp(r.reduce((e,t)=>e+t,0)/r.length):void 0,a=(e.segments??[]).map(e=>e.no_speech_prob).filter(e=>Number.isFinite(e));return{text:t,confidence:i,noSpeechProbability:a.length>0?Math.max(...a):void 0}}return{text:``,error:`no-speech`}}}catch(e){if(e instanceof DOMException&&(e.name===`TimeoutError`||e.name===`AbortError`))return{text:``,error:`transcription`}}return this.whisperOk!==!0&&(this.whisperOk=!1,this.whisperRetryAt=Date.now()+t.WHISPER_RETRY_MS),{text:``,error:`transcription`}}emitResult(e){this.resultSubs.forEach(t=>t(e))}emitState(e){this.phase=e.phase,this.stateSubs.forEach(t=>t(e))}};function Ia(){return new Fa}function La(e={}){let t=(0,W.useRef)(e.onResult),n=(0,W.useRef)(e.onStateChange),r=(0,W.useRef)(e.onBargeIn);t.current=e.onResult,n.current=e.onStateChange,r.current=e.onBargeIn;let i=(0,W.useMemo)(()=>Ia(),[]);return(0,W.useEffect)(()=>{let e=i.onResult(e=>t.current?.(e)),a=i.onStateChange(e=>n.current?.(e));return`onBargeIn`in i&&(i.onBargeIn=()=>r.current?.()),()=>{e(),a(),i.dispose()}},[i]),(0,W.useMemo)(()=>({mode:i.mode,capabilities:i.capabilities,start:e=>i.start(e),stop:()=>i.stop(),speak:e=>i.speak(e),cancel:()=>i.cancel(),setMuted:e=>i.setMuted(e),setSoundEnabled:e=>i.setSoundEnabled(e),setMaveaSpeaking:e=>i.setMaveaSpeaking?.(e),forceStop:()=>i.forceStop?.()}),[i])}var Ra=`mavea-always-on`;function za(e,t,n=!1,r=`neutral`,i=!1,a=!1){if(t)return{state:`listening`,emotion:`neutral`,gaze:`center`};if(n)return i?{state:`showing`,emotion:`surprised`,gaze:`center`}:{state:`speaking`,emotion:`surprised`,gaze:`center`};if(a)return{state:`loading`,emotion:`neutral`,gaze:`center`};switch(e){case`thinking`:return{state:`loading`,emotion:`neutral`,gaze:`center`};case`speaking`:return i?{state:`showing`,emotion:r,gaze:`center`}:{state:`speaking`,emotion:r,gaze:`center`};case`showing`:return{state:`showing`,emotion:r,gaze:`right`};default:return{state:`idle`,emotion:r,gaze:`center`}}}var Ba=new Set([`no`,`caution`,`avoid`,`risk`,`wait`]),Va=new Set([`yes`,`go`,`recommended`,`good`]);function Ha(e,t){let n=e.props[t];return typeof n==`string`?n.toLowerCase():void 0}function Ua(e){let t=e?.blocks;if(!t?.length)return`neutral`;let n=!1,r=e?.awaiting===!0;for(let e of t){let t=Ha(e,`tone`);(t===`warn`||t===`neg`)&&(n=!0),t===`pos`&&(r=!0);let i=Ha(e,`stance`);i&&Ba.has(i)&&(n=!0),i&&Va.has(i)&&(r=!0),e.type===`insight`&&e.props.conf===`unverified`&&(n=!0)}return n?`concerned`:r?`warm`:`neutral`}function Wa(e){switch(e){case`concerned`:return`concerned`;case`warm`:return`warm`;default:return`neutral`}}function Ga(e){return Wa(Ua(e))}function Ka(e){let t=e?.blocks;return!t?.length||Ua(e)!==`warm`?!1:t.some(e=>{let t=Ha(e,`stance`);return t!==void 0&&Va.has(t)})}var qa={clipShared:[`Nice — that one's worth sharing.`,`Off it goes.`,`Clipped and ready to share.`]};Object.keys(qa);function Ja(e,t,n){let r=qa[e];if(r.length===0)return``;let i=Math.abs(Math.trunc(t))%r.length;return r.length>1&&r[i]===n&&(i=(i+1)%r.length),r[i]}function Ya(){return{lastAt:0,lastTurn:-1/0}}function Xa(e,t){return!(e.lastAt!==0&&t.now-e.lastAt<9e4||t.turnCount-e.lastTurn<3)}function Za(e,t){return{lastAt:t.now,lastTurn:t.turnCount}}var Qa=1100,$a=6e3,eo=150,to=950,no=350,ro=8;function io(e){let{muted:t,turnCount:n,gates:r}=e,i=(0,W.useRef)(e.speak),a=(0,W.useRef)(e.cancelSpeak),o=(0,W.useRef)(e.isSpeaking);i.current=e.speak,a.current=e.cancelSpeak,o.current=e.isSpeaking;let[s,c]=(0,W.useState)([]),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(null),[p,m]=(0,W.useState)(0),h=(0,W.useRef)(Ya()),g=(0,W.useRef)(void 0),_=(0,W.useRef)(null),v=(0,W.useRef)(null),y=(0,W.useCallback)(()=>{_.current&&=(clearTimeout(_.current),null),v.current&&=(clearTimeout(v.current),null)},[]),b=(0,W.useCallback)(e=>{c(t=>t.length>=ro||t[t.length-1]===e?t:[...t,e])},[]),x=(0,W.useCallback)(()=>{y(),u(!1),v.current=setTimeout(()=>{v.current=null,f(null)},to)},[y]),S=(0,W.useCallback)(e=>{let t=()=>{let n=Date.now()-e;n>=Qa&&!o.current()||n>=$a?x():_.current=setTimeout(t,eo)};_.current=setTimeout(t,Qa)},[x]),C=r.atRest&&!r.busy&&!r.listening&&!r.introHold&&r.hasCanvas&&!r.modalOpen;(0,W.useEffect)(()=>{if(l||d!==null||!C||s.length===0)return;if(o.current()){let e=setTimeout(()=>m(e=>e+1),no);return()=>clearTimeout(e)}let e=s[0],r=Date.now();if(!Xa(h.current,{type:e,now:r,turnCount:n})){c(e=>e.slice(1));return}h.current=Za(h.current,{type:e,now:r,turnCount:n});let a=Ja(e,r,g.current);g.current=a,c(e=>e.slice(1)),f(a),u(!0),!t&&a&&i.current(a),S(r)},[l,d,C,s,n,t,S,p]),(0,W.useEffect)(()=>{if(!l)return;let e=r.busy||!r.atRest,t=r.listening||r.modalOpen;!e&&!t||(y(),u(!1),f(null),c([]),g.current=void 0,t&&!e&&a.current())},[l,r.busy,r.atRest,r.listening,r.modalOpen,y]);let w=(0,W.useCallback)(()=>{y(),c([]),u(!1),f(null),h.current=Ya(),g.current=void 0},[y]);return(0,W.useEffect)(()=>()=>y(),[y]),{interjecting:l,line:d,enqueue:b,reset:w}}function ao(e){let t=(0,J.c)(36),{chapters:n,currentIndex:r,onJump:i,onClose:a}=e,o=(0,W.useRef)(null),s;if(t[0]===a?s=t[1]:(s={onEscape:a},t[0]=a,t[1]=s),ae(o,s),n.length===0)return null;let c;t[2]===n?c=t[3]:(c=Nt(n),t[2]=n,t[3]=c);let l=c,u;t[4]!==n||t[5]!==r?(u=n.find(e=>e.moments.some(e=>e.frameIndex===r))?.color,t[4]=n,t[5]=r,t[6]=u):u=t[6];let d=u,f;t[7]===a?f=t[8]:(f=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=f);let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.jsx)(`h2`,{className:`ovw-title`,children:`Your conversation`}),t[9]=p):p=t[9];let m=n.length===1?`chapter`:`chapters`,h=l===1?`moment`:`moments`,g;t[10]!==n.length||t[11]!==m||t[12]!==h||t[13]!==l?(g=(0,G.jsxs)(`header`,{className:`ovw-head`,children:[p,(0,G.jsxs)(`p`,{className:`ovw-sub`,children:[n.length,` `,m,` · `,l,` `,h,` — tap anywhere to dive back in`]})]}),t[10]=n.length,t[11]=m,t[12]=h,t[13]=l,t[14]=g):g=t[14];let _;if(t[15]!==n||t[16]!==r||t[17]!==a||t[18]!==i){let e;t[20]!==r||t[21]!==a||t[22]!==i?(e=e=>(0,G.jsxs)(`section`,{className:`ovw-card`,style:{"--card-c":e.color},children:[(0,G.jsxs)(`div`,{className:`ovw-card-head`,children:[(0,G.jsx)(`span`,{className:`ovw-card-dot`}),(0,G.jsx)(`h3`,{className:`ovw-card-title`,children:e.title}),(0,G.jsx)(`span`,{className:`ovw-card-count`,children:e.moments.length})]}),(0,G.jsx)(`ul`,{className:`ovw-moments`,children:e.moments.map(e=>{let t=e.frameIndex===r,n=B[e.icon]||B.mic;return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,className:`ovw-moment`+(t?` is-current`:``),onClick:()=>{i(e.frameIndex),a()},"aria-current":t?`true`:void 0,children:[(0,G.jsx)(n,{}),(0,G.jsx)(`span`,{className:`ovw-moment-q`,children:e.question||`Moment`})]}),e.elements.length>0&&(0,G.jsx)(`ul`,{className:`ovw-els`,children:e.elements.map(t=>{let n=t.icon&&B[t.icon]||B.spark;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,className:`ovw-el`,onClick:()=>{i(e.frameIndex,t.id),a()},"aria-label":`Jump to "${t.label}" in "${e.question||`this moment`}"`,children:[(0,G.jsx)(n,{}),(0,G.jsx)(`span`,{className:`ovw-el-label`,children:t.label})]})},t.id)})})]},e.frameIndex)})})]},e.id),t[20]=r,t[21]=a,t[22]=i,t[23]=e):e=t[23],_=n.map(e),t[15]=n,t[16]=r,t[17]=a,t[18]=i,t[19]=_}else _=t[19];let v;t[24]===_?v=t[25]:(v=(0,G.jsx)(`div`,{className:`ovw-grid`,children:_}),t[24]=_,t[25]=v);let y;t[26]!==v||t[27]!==g?(y=(0,G.jsxs)(`div`,{className:`ovw-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":`Conversation overview`,ref:o,onClick:oo,children:[g,v]}),t[26]=v,t[27]=g,t[28]=y):y=t[28];let b;t[29]!==a||t[30]!==y||t[31]!==f?(b=(0,G.jsx)(`div`,{className:`ovw-scrim`,onClick:a,role:`button`,tabIndex:0,"aria-label":`Close conversation overview`,onKeyDown:f,children:y}),t[29]=a,t[30]=y,t[31]=f,t[32]=b):b=t[32];let x;return t[33]!==d||t[34]!==b?(x=(0,G.jsx)(Ve,{accent:d,children:b}),t[33]=d,t[34]=b,t[35]=x):x=t[35],x}function oo(e){return e.stopPropagation()}function so(e){let t=new Map;for(let n of e)for(let e of n.spec?.sources??[])e?.url&&!t.has(e.url)&&t.set(e.url,e);return[...t.values()]}function co(e,t={}){if(e.length<2)return null;let n=e[e.length-1]?.spec;if(!n)return null;let r=t.cap??1/0,i=e.reduce((e,t)=>U(e,t.spec?.blocks??[],`augment`).blocks,[]),a=i.length>r,o=a?i.slice(0,r):i,s=e.length,c=a?`${s} moments in this thread · showing the first ${r} cards`:`${s} moments in this thread`,l=so(e);return{...n,id:t.id??n.id,title:t.title??n.title,sub:c,blocks:o,sources:l.length?l:n.sources,tint:t.tint??n.tint,suggests:[],bend:void 0,awaiting:void 0,blanks:void 0}}var lo=240;function uo(e){let{stops:t,from:n=0,spokenWalk:r,withNotes:i,teach:a,marksById:o}=e,s=[],c=0;for(let e=n;e<t.length;e++){let n=t[e].spot;if(!n)continue;let l=t[e].line;if(r&&e>0&&i&&l){let e=ut(l);e&&s.push({spot:n,line:l,noteText:e})}let u=o.get(n);if(u?.length){let e=u.length>1;for(let t=0;t<u.length;t++){let r=t===u.length-1;s.push({spot:n,line:l,mark:u[t],generous:a,delayMs:c*lo,badgeMs:r?lt+(u.length-1)*lo:void 0,stepNumber:e?t+1:void 0}),c++}}else a&&(s.push({spot:n,line:l,generous:!0,delayMs:c*lo}),c++)}return s}var fo=1100,po=1700;function mo(e,t,n){let{controller:r,release:i}=e,a=!1,o=e=>{a||(a=!0,i(),n(e))},s=()=>t.isCancelled()?`cancelled`:t.isDismissed()?`dismissed`:null;(async()=>{for(let e=0;e<r.count;e++){let n=s();if(n){o(n);return}let i=r.spokenFor(e)??r.captionFor(e);if(i){let n=t.speakLine(i),a=await Qe(n),c=s();if(c){o(c);return}r.setIndex(e),a?await ot(n,po,fo):await it(po)}else r.setIndex(e),await it(po)}let e=s();o(e??`complete`)})()}function ho(e){let t=(0,J.c)(8),{items:n,onSeeHow:r}=e;if(n.length===0)return null;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`span`,{className:`card-eyebrow start-with-head`,children:`Or start a different way`}),t[0]=i):i=t[0];let a;if(t[1]!==n||t[2]!==r){let e;t[4]===r?e=t[5]:(e=e=>(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,className:`start-with-card`+(e.available?``:` is-unavailable`),onClick:e.run,onPointerEnter:e.preload,onFocus:e.preload,children:[(0,G.jsx)(`span`,{className:`start-with-label`,children:e.feature.label}),(0,G.jsx)(`span`,{className:`start-with-blurb`,children:e.available?e.blurb??e.feature.blurb:e.reason??e.blurb??e.feature.blurb})]}),r&&e.feature.tourChapter&&(0,G.jsxs)(`button`,{type:`button`,className:`start-with-see`,onClick:()=>r(e.feature),"aria-label":`See how ${e.feature.label} works`,children:[(0,G.jsx)(B.play,{}),` See how`]})]},e.feature.id),t[4]=r,t[5]=e),a=n.map(e),t[1]=n,t[2]=r,t[3]=a}else a=t[3];let o;return t[6]===a?o=t[7]:(o=(0,G.jsxs)(`section`,{className:`start-with`,"aria-label":`Ways to start`,children:[i,(0,G.jsx)(`ul`,{className:`start-with-grid`,children:a})]}),t[6]=a,t[7]=o),o}var go=[`pdf-world`,`just-listen`,`watch-me-think`,`deepzoom`,`delegate`,`courses`,`synthesis`,`ripple`];function _o(e){return e.length===0?{blurb:`Choose a PDF, Office doc, or data file to map its claims`,opensPicker:!0}:{blurb:e.length===1?`Open the map for ${e[0].name}`:`Open the map across ${e.length} documents`,opensPicker:!1}}var vo=new Set([`just-listen`,`watch-me-think`]);function yo(e,t,n){if(e.length===0)return e;let r=new Map;n.forEach((e,t)=>{let n=We(e),i=r.get(n);i?i.push(t):r.set(n,[t])});let i=new Map;n.forEach((e,t)=>{let n=We(e);i.has(n)||i.set(n,t)});let a=e=>{if(e.kind!==`connect`)return e;let n=t[e.onIndex??-1],r=n?i.get(We(n)):void 0;return r===void 0?void 0:{...e,onIndex:r}},o=e=>{let t=(e.marks??(e.mark?[e.mark]:[])).map(a).filter(e=>!!e);return t.length?{mark:t[0],...t.length>1?{marks:t}:{}}:{}},s=[],c=new Set;for(let n of e){let e=t[n.index];if(!e)continue;let i=r.get(We(e))?.shift();if(i===void 0||c.has(i))continue;c.add(i);let{mark:a,marks:l}=o(n),u={...n,index:i,mark:a,marks:l},d=i===n.index&&a===n.mark&&l===n.marks;s.push(d?n:u)}return s}function bo(e,t,n,r,i){let a={question:n,narration:r.narration,title:r.spec.title,blockTypes:r.spec.blocks.map(e=>e.type)},o=Ue(e,a,r.continuity,r.tier),s=!e||o===`replace`&&Ge(e,a)<.15,c=i?.forceReplace?`replace`:o,l=U(t,r.spec.blocks,c);c!==`replace`&&l.overflow&&(c=`replace`,l=U(t,r.spec.blocks,`replace`));let u={...r.spec,blocks:l.blocks};c!==`replace`&&delete u.bend;let d=c===`replace`?l.blocks.find(e=>e.id)?.id??null:l.firstNewId,f=yo(r.tour??[],r.spec.blocks,l.blocks),p=Date.now();return{frame:{id:qe(p),question:n,narration:r.narration,...r.spoken?{spoken:r.spoken}:{},mode:c,topicShift:s,tour:f,spec:u,at:p,...r.corrects?{corrects:r.corrects}:{}},mode:c,spot:d,snap:a}}var xo={like:`Likes`,love:`Loves`,prefer:`Prefers`,enjoy:`Enjoys`,hate:`Hates`,dislike:`Dislikes`,need:`Needs`,want:`Wants`,own:`Owns`,use:`Uses`,drive:`Drives`,play:`Plays`,speak:`Speaks`,work:`Works`,live:`Lives`,study:`Studies`,train:`Trains`,teach:`Teaches`,code:`Codes`,run:`Runs`,cook:`Cooks`,travel:`Travels`},So=3,Co=140;function wo(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function To(e){let t=e.trim().replace(/\s+/g,` `);if(!t||t.length>Co||t.includes(`?`))return``;let n=t.toLowerCase(),r;if(r=t.match(/^i(?:'m| am)\s+(an?\s+.+)/i))return Eo(`Is ${r[1]}`);if(r=t.match(/^i(?:'m| am)\s+(.+)/i))return Eo(r[1]);if(r=t.match(/^i(?:'ve| have)\s+(?:got\s+)?(.+)/i))return Eo(`Has ${r[1]}`);if(r=t.match(/^my\s+(.+?)\s+(is|are)\s+(.+)/i))return Eo(`${r[1]} ${r[2]} ${r[3]}`);if(r=n.match(/^i\s+(\w+)\s+(.+)/)){let e=xo[r[1]];if(e)return Eo(`${e} ${t.slice(t.toLowerCase().indexOf(r[2]))}`)}return``}function Eo(e){let t=wo(e.trim().replace(/\s+/g,` `));return t.length>=6&&t.length<=Co?t:``}function Do(e){if(!e)return[];let t=e.split(/[.!?\n]+|,?\s+\band\b\s+/i),n=[];for(let e of t){let t=To(e);if(t&&!n.includes(t)&&n.push(t),n.length>=So)break}return n}var Oo=.6,ko=.5;function Ao(e){return(e.match(/\d[\d,.]*\d|\d/g)??[]).map(e=>e.replace(/,/g,``).replace(/\.+$/,``))}function jo(e,t){let n=Ao(e);if(!n.length)return!1;let r=new Set(Ao(t));return n.some(e=>!r.has(e))}function Mo(e,t,n={}){if(!jo(e,t)){let n=jn(e),r=jn(t);if(n.size>0&&Fn(n,r)>=Oo)return`user-stated`}return n.webGrounded?`web-grounded`:`model-inferred`}function No(e,t){let n=Ao(e),r=new Set(Ao(t));if(n.length)return n.every(e=>r.has(e))?`user-stated`:`model-inferred`;let i=jn(e);return i.size>0&&Fn(i,jn(t))>=ko?`user-stated`:`model-inferred`}var Po=24;function Fo(e,t=`item`){let n=e.toLowerCase().match(/[a-z][a-z0-9]*/g);return(n&&n[0]?n[0]:t).slice(0,Po)}function Io(e,t={}){return{concept:`corrections.${Fo(e.what)}`,body:`On "${e.what}", an earlier answer said ${e.was}; the user corrected it to ${e.now}. Use the corrected value and double-check figures like this before stating them.`,kind:`procedural`,source:t.source??`user-stated`,verify:!0,outcome:`loss`,turnId:t.turnId,quote:e.now}}var Lo=4,Ro=1600,zo=24,Bo=`Break ONE cause into the parts it is MADE OF (components or segments) — never its causes or its effects, which are separate nodes. Return ONLY compact JSON, one line.
3
3
 
4
4
  At most ${Lo} children; fewer beats padding. Nothing honest to split? {"children":[]}.
5
5
  "tier":"T2" with a VERBATIM "quote" from SOURCES is the only way to give a "value" — otherwise "tier":"T0" and no numbers, no quote. Never invent a figure or a citation. Empty SOURCES ⇒ every child T0.
@@ -15,7 +15,7 @@ ${r||`(nothing else)`}
15
15
  SOURCES:
16
16
  ${n.text.trim()?n.text.trim().slice(0,6e3):Ho}
17
17
 
18
- Give the parts "${t.label}" is made of (${Lo} max). Quote SOURCES verbatim for any number; otherwise T0 with no numbers. Reply as compact JSON on one line.`}var Wo=new Map;function Go(e,t,n,r){return Ln(`world-expand:${e.title}\0${t}\0${n.text}`,r.provider)}async function Ko(e,t,n,r,i,a){let o=await Bn(e);if(o)return o;if(a?.aborted)return null;let s;try{s=(await Zt(i.provider).generate({system:Bo,history:[],user:Uo(t,n,r),maxTokens:Ro,thinkingLevel:`minimal`,format:Vo,...a?{signal:a}:{}},i)).raw}catch{return null}if(a?.aborted)return null;let c=Un(s,n.id,r,!!t.provenance.illustrative);return c.length===0?null:(Rn(e,c),c)}function qo(e,t){for(let n of e){if(n.id===t)return n;let e=n.children===void 0?void 0:qo(n.children,t);if(e)return e}}function Jo(e,t,n,r,i){let a=qo(e.nodes,t);if(!a||(a.children?.length??0)>0)return Promise.resolve(null);let o=Go(e,t,n,r);return(Wo.get(o)??(()=>{let t=Ko(o,e,a,n,r,i);for(Wo.set(o,t);Wo.size>zo;){let e=Wo.keys().next().value;if(e===void 0||e===o)break;Wo.delete(e)}return t.then(e=>{e||Wo.delete(o)},()=>Wo.delete(o)),t})()).then(n=>n?Gn(e,t,n):null)}function Yo(e=160){let t=``,n=!0;return{push(r,i=!1){let a=r.trim();if(!a)return i?this.flush():``;if(n&&!t)return n=!1,a;if(t=t?`${t} ${a}`:a,!i&&t.length<e)return``;let o=t;return t=``,o},flush(){let e=t;return t=``,e}}}i();var Xo=()=>a(()=>import(`./generateLive-BLajGcNK.js`),__vite__mapDeps([3,4,5,6,7,8,9,10,2,1,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59])),Zo=50,Qo=18e5,$o=864e5,es=`live-answer:v1`,ts=2;function ns(e,t){let n=t?.searchMode??(t?.webSearch?`free`:`off`),r=t?.quality??``,i=t?.explainLevel??`standard`,a=+!!t?.generativeBlocks,o=+!!t?.memoryEnabled,s=+!!t?.worldEnabled;return`${e.provider}::${e.model}::${n}::${r}::${i}::${a}::${o}::${s}`}function rs(e,t,n){let r=e.slice(-40);if(r.length===0&&!t&&!n)return`cold`;let i=r.map(e=>`${e.role}:${e.content}`);return t&&i.push(`world:${t.title}`),n&&i.push(`lesson:${n.topic}\u0000${n.directive}`),zn(i.join(`\0`))}function is(e,t){let n=e.get(t);return!n||(e.delete(t),Date.now()-n.at>Qo)?null:(e.set(t,n),n.result)}function as(e,t,n){for(e.delete(t),e.set(t,{at:Date.now(),result:n});e.size>Zo;){let t=e.keys().next().value;if(t===void 0)break;e.delete(t)}}function os(e,t){return Ln(`${es}:${e}`,t.provider)}async function ss(e){let t=await Bn(e);return typeof t?.at!=`number`||!t.result?.spec?.blocks?.length||Date.now()-t.at>$o?null:t.result}function cs(e,t){return!e.spec.sources?.length&&!t?.memoryEnabled}function ls(e){let t=e?.blocks??[];for(let e=t.length-1;e>=0;--e){let n=t[e];if(n.type===`world`&&n.props.world)return n.props.world}}function us(e,t,n,r){let i=e.blocks.findIndex(e=>e.id===t&&e.type===`world`);if(i<0)return e;let a=e.blocks[i];if(a.type!==`world`||a.props.world||a.props.title!==n)return e;let o=[...e.blocks];return o[i]={...a,props:{...a.props,world:r}},{...e,blocks:o}}function ds(e,t){return!e||e.blocks.length>t.blocks.length?!1:e.blocks.every((e,n)=>{let r=t.blocks[n];return e.type===r.type&&JSON.stringify(e.props)===JSON.stringify(r.props)})}var fs={history:[],spec:null,status:`idle`,turn:0,narration:``,understood:[],busy:!1,activity:null,spot:null,mode:`replace`,replaceEpoch:0,prior:null,tour:[],past:[],frames:[],viewIndex:null,viewOverride:null,error:null,pendingShape:null,reasoning:!1,liveSources:[],restored:!1,phase:`normal`,filled:{},activeBlank:null};function ps(e,t){return e?.find(e=>!(e.key in t))?.key??null}function ms(e,t){switch(t.type){case`start`:return{...e,status:`thinking`,busy:!0,narration:``,understood:[],activity:null,spot:null,viewIndex:null,viewOverride:null,error:null,pendingShape:null,reasoning:!1,liveSources:[],restored:!1,...t.fresh?{spec:null,prior:null}:{},phase:`normal`,filled:{},activeBlank:null};case`speak`:return{...e,status:`speaking`,narration:t.narration};case`activity`:return{...e,activity:t.activity};case`stream`:return{...e,status:`showing`,spec:t.spec};case`show`:return{...e,status:`showing`,spec:t.spec,narration:t.narration||e.narration,understood:t.understood,history:t.history.slice(-40),turn:e.turn+1,busy:!1,mode:t.mode,prior:t.prior,tour:t.tour,past:t.freshTimeline?[]:t.mode===`replace`&&t.priorSpec?[...e.past,t.priorSpec].slice(-12):e.past,frames:t.freshTimeline?[t.frame]:[...e.frames,t.frame].slice(-40),activity:null,replaceEpoch:t.mode===`replace`&&!t.streamed?e.replaceEpoch+1:e.replaceEpoch,spot:t.spot,viewIndex:null,viewOverride:null,pendingShape:null,reasoning:!1,liveSources:[],phase:t.spec.awaiting&&t.spec.blanks?.length?`awaiting_input`:`normal`,filled:{},activeBlank:t.spec.awaiting&&t.spec.blanks?.length?ps(t.spec.blanks,{}):null};case`idle`:return{...e,status:`idle`,busy:!1,activity:null,reasoning:!1};case`error`:return{...e,status:`idle`,busy:!1,activity:null,error:t.error,pendingShape:null,reasoning:!1,liveSources:[]};case`spot`:return{...e,spot:t.spot};case`pending`:return{...e,pendingShape:t.pending};case`thinking`:return{...e,reasoning:t.on};case`sources`:return{...e,liveSources:t.sources};case`jump`:return e.frames[t.index]?{...e,viewIndex:t.index,viewOverride:null,spot:null}:e;case`preview`:return{...e,viewOverride:t.spec,viewIndex:null,spot:null};case`restore`:{let n=t.spec.blocks.find(e=>e.id)?.id??null,r={id:qe(t.at),question:t.question,narration:``,mode:`replace`,tour:[],spec:t.spec,at:t.at};return{...e,restored:!0,spec:t.spec,status:`showing`,turn:e.turn+1,narration:``,understood:[],busy:!1,activity:null,spot:n,viewIndex:null,viewOverride:null,mode:`replace`,replaceEpoch:e.replaceEpoch+1,tour:[],error:null,frames:[...e.frames,r].slice(-40),prior:{question:t.question,narration:``,title:t.spec.title,blockTypes:t.spec.blocks.map(e=>e.type)},history:[...e.history,{role:`user`,content:t.question},{role:`assistant`,content:t.spec.title}].slice(-40)}}case`world`:{let n=e.spec?us(e.spec,t.blockId,t.question,t.world):e.spec,r=e.frames.map(e=>{let n=us(e.spec,t.blockId,t.question,t.world);return n===e.spec?e:{...e,spec:n}});return n===e.spec&&r.every((t,n)=>t===e.frames[n])?e:{...e,spec:n,frames:r}}case`fill`:{let n={...e.filled,[t.value.key]:t.value};return{...e,filled:n,activeBlank:ps(e.spec?.blanks,n)}}case`unfill`:{let n={...e.filled};return delete n[t.key],{...e,filled:n,activeBlank:t.key}}case`setActiveBlank`:return{...e,activeBlank:t.key};case`reset`:return{...fs};default:return e}}function hs(e){let t=e.frames[e.frames.length-1];return{...fs,history:e.history,frames:e.frames,spec:t.spec,status:`idle`,mode:`replace`,restored:!0,prior:{question:t.question,narration:t.narration,title:t.spec.title,blockTypes:t.spec.blocks.map(e=>e.type)}}}var gs={blocked:`Mavéa needs the terms accepted before it can reach a model — open Settings to review.`,busy:`Still finishing the last answer — your question is still here, send it again in a moment.`,empty:`There’s nothing to send yet — type a question or attach a file.`};function _s(e){let{canRun:t,getConfig:n,configReady:r,canvasReady:i,getCaps:a,speak:o,cancelSpeak:s,getLibraryEnabled:c}=e,[l,u]=(0,W.useReducer)(ms,e.initial??fs),d=(0,W.useRef)(e);d.current=e;let f=(0,W.useRef)(!1);f.current=l.busy;let p=(0,W.useRef)(l.history);p.current=l.history;let m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)(l.spec);g.current=l.spec;let _=(0,W.useRef)(null),v=(0,W.useRef)([]);v.current=l.frames;let y=(0,W.useRef)(l.prior);y.current=l.prior;let b=(0,W.useRef)(l.filled);b.current=l.filled;let x=(0,W.useRef)(new Map),S=(0,W.useRef)(new Map),C=(0,W.useRef)([]),w=(0,W.useRef)(new Set),T=(0,W.useRef)(l.turn);T.current=l.turn;let E=(0,W.useCallback)(async(e,l,d,_,v,b,E,D)=>{if(t&&!t())return;let O=e.trim();if(!O&&!l?.length||f.current&&!D?.force)return;let k=O||`What can you tell me about the attached file?`,A=b?.trim()||k,j={question:A,retry:k,attachments:l,selectedBlocks:d,inkIntents:v};s?.();let M=D?.freshStart?null:g.current;m.current?.abort(),h.current?.(),h.current=null;let N=new AbortController;m.current=N,f.current=!0,u({type:`start`,fresh:D?.freshStart});let P=null,F=e=>{if(!i){o?.(e);return}P=(P??i()).then(()=>{N.signal.aborted||o?.(e)})},I=D?.freshStart?[]:p.current,L=D?.freshStart?null:y.current,R=ls(g.current),z=!!(l?.length||d?.length||_&&Object.keys(_).length||v?.length);if(await r?.(),N.signal.aborted)return;let B=n(),te=a?.(),ne=ns(B,te),ie=`${k}::${rs(I,R,D?.lesson)}::${ne}`,ae=os(ie,B),oe=z?null:S.current.get(ie)??null;for(let e of C.current)e.key===ie&&oe||(e.ctrl.abort(),S.current.delete(e.key));C.current=oe?C.current.filter(e=>e.key===ie):[];let se=z?null:is(x.current,ie),ce=!He(L,k),V,le=!1,ue=null,de=se;if(!de&&oe){let e=await oe.catch(()=>null);if(N.signal.aborted)return;e&&!e.error&&e.spec.blocks.length>0&&(de=e)}if(!de&&!z&&(de=await ss(ae),N.signal.aborted))return;if(de){let e=de;e.narration&&(u({type:`speak`,narration:e.narration}),F(e.spoken||e.narration)),V=e}else{let e=``,t=new ht(`narration`),n=0,r=!1,i=mn(hn(k)),a=0,o=Yo(),s;try{s=await Xo()}catch{if(N.signal.aborted)return;u({type:`error`,error:{kind:`network`,message:`Mavéa couldn't finish loading. Check your connection and try again.`,...j}});return}let{generateLive:c}=s,f=null,p=0,m=()=>{if(p=0,!f||N.signal.aborted)return;let e=f;f=null,le=!0,ue=e,u({type:`stream`,spec:e})};if(N.signal.addEventListener(`abort`,()=>{f=null,p&&cancelAnimationFrame(p)},{once:!0}),V=await c(k,I,B,s=>{if(N.signal.aborted)return;e+=s,t.scan(e);let c=t.progress();if(!c)return;let{chunk:l,consumed:d}=gt(c.text,n,c.done);if(!l){if(c.done){let e=o.flush();e&&F(e)}return}if(n=d,r=!0,u({type:`speak`,narration:xe(be(c.text.slice(0,d)))}),a>=i){let e=o.flush();e&&F(e);return}a+=l.length;let f=o.push(l,c.done);f&&F(f)},{caps:te,signal:N.signal,onActivity:e=>{N.signal.aborted||u({type:`activity`,activity:e})},recentTypes:[...w.current],rotation:T.current,attachments:l,selectedBlocks:d,filledBlanks:_,inkIntents:v,priorTopic:L?.title||void 0,priorWorld:R,lesson:D?.lesson,onPartial:ce?e=>{N.signal.aborted||(ee(e.spec.blocks),f=e.spec,le?p||=requestAnimationFrame(m):m())}:void 0,onSources:e=>{N.signal.aborted||u({type:`sources`,sources:e})},onPending:ce?e=>{N.signal.aborted||u({type:`pending`,pending:e})}:void 0,onThinking:e=>{N.signal.aborted||u({type:`thinking`,on:e})}}),p&&cancelAnimationFrame(p),m(),!N.signal.aborted){let e=o.flush();e&&F(e)}if(N.signal.aborted)return;!r&&V.narration&&(u({type:`speak`,narration:V.narration}),F(V.spoken||V.narration)),!z&&!V.error&&V.spec.blocks.length>0&&(as(x.current,ie,V),cs(V,te)&&Rn(ae,{at:Date.now(),result:V}))}if(V.error){u({type:`error`,error:{...V.error,...j}});return}let fe=d?.length?`${A} (about: ${d.map(re).join(`, `)})`:A,pe=[...I,{role:`user`,content:fe},{role:`assistant`,content:V.narration||V.spec.title}],me,he,ge;try{let e=bo(L,D?.freshStart?[]:g.current?.blocks??[],A,V,{forceReplace:ce});me=e.mode,he=e.frame.spec;let t=e.snap;ge=E?{...e.frame,mind:E}:e.frame,ee(he.blocks),u({type:`show`,spec:he,narration:V.narration,history:pe,mode:me,spot:e.spot,prior:t,tour:ge.tour,priorSpec:M,streamed:le&&ds(ue,he),frame:ge,understood:V.understood??[],freshTimeline:D?.freshStart});for(let e of t.blockTypes)w.current.add(e)}catch{u({type:`error`,error:{kind:`http`,message:`Something went wrong putting that answer together — let's try again.`,...j}});return}if(a?.().memoryEnabled&&pn(k))try{let e=String(ge.at),t=A.slice(0,200),n=(he.sources?.length??0)>0,r=V.memory??[];if(r.length)An(r.map(r=>({...r,source:Mo(r.body,A,{webGrounded:n}),turnId:e,quote:t})));else{let n=Do(A);n.length&&An([{concept:`profile`,body:n.join(`. `),source:`user-stated`,turnId:e,quote:t}])}if(V.corrects){let t=No(V.corrects.now,A);An([Io(V.corrects,{turnId:e,source:t})])}}catch{}me===`replace`&&c?.()&&jt(he,A);let _e=n(),H=a?.();if(H?.quality===`thorough`){let e=he.suggests??[],t=[...w.current],n=ns(_e,H),r=rs(pe,ls(he),void 0);e.slice(0,ts).forEach((e,i)=>{let a=`${e.label}::${r}::${n}`;if(is(x.current,a)||S.current.has(a))return;let o=new AbortController;C.current.push({key:a,ctrl:o});let s=Xo().then(({generateLive:n})=>n(e.label,pe,_e,void 0,{caps:H,signal:o.signal,repair:!1,recentTypes:t,rotation:T.current+1+i})).then(e=>(!o.signal.aborted&&!e.error&&e.spec.blocks.length>0&&as(x.current,a,e),e));S.current.set(a,s);let c=()=>{S.current.get(a)===s&&S.current.delete(a)};s.then(c,c)})}},[t,n,r,i,a,o,s,c]),D=(0,W.useCallback)((e,n)=>t&&!t()?`blocked`:!e.trim()&&!n?`empty`:f.current?`busy`:null,[t]),O=(0,W.useCallback)(()=>{m.current?.abort(),m.current=null,h.current?.(),h.current=null;for(let e of C.current)e.ctrl.abort();C.current=[],S.current.clear(),x.current.clear(),w.current.clear(),u({type:`reset`})},[]),k=(0,W.useCallback)(e=>u({type:`spot`,spot:e}),[]),A=(0,W.useCallback)(e=>u({type:`jump`,index:e}),[]),j=(0,W.useCallback)(e=>{e&&ee(e.blocks),u({type:`preview`,spec:e})},[]),M=(0,W.useCallback)(e=>{let t=_.current?.blocks.find(t=>t.id===e);if(t)return t;let n=g.current?.blocks.find(t=>t.id===e);if(n)return n;for(let t of v.current){let n=t.spec.blocks.find(t=>t.id===e);if(n)return n}},[]),N=(0,W.useCallback)(async e=>{let{canRun:t,getConfig:n}=d.current;if(t&&!t())return null;let r=M(e);if(r?.type!==`world`)return null;if(r.props.world)return r.props.world;let i=r.props.title;try{let t=await un(i,await gn(i),n());return t&&u({type:`world`,blockId:e,question:i,world:t}),t}catch{return null}},[M]),P=(0,W.useCallback)(async(e,t,n)=>{let{canRun:r,getConfig:i}=d.current;if(r&&!r())return null;let a=M(e);if(a?.type!==`world`)return null;let o=n??a.props.world;if(!o)return null;try{return await Jo(o,t,await gn(o.title),i())}catch{return null}},[M]),F=(0,W.useCallback)(e=>u({type:`fill`,value:e}),[]),I=(0,W.useCallback)(e=>u({type:`unfill`,key:e}),[]),L=(0,W.useCallback)(e=>u({type:`setActiveBlank`,key:e}),[]),R=(0,W.useCallback)(()=>{let e=g.current,t=b.current;return!e||!Object.keys(t).length||f.current?!1:(E(`Complete the answer you started above using the values I just filled into the blanks — keep everything you already showed and fill in only the parts that depended on those values. Do not start over.`,void 0,e.blocks,t),!0)},[E]),z=(0,W.useCallback)((e,t)=>{s?.(),ee(e.blocks),u({type:`restore`,spec:e,question:t,at:Date.now()})},[s]),B=(0,W.useCallback)((e,t,n)=>{let r=n?.silent===!0;ee(e.spec.blocks),n?.interrupt!==!1&&s?.();let i=De();u({type:`start`,fresh:!1}),r||u({type:`speak`,narration:e.narration});let a=r?void 0:o?.(e.spoken??e.narration),c=[...p.current,{role:`user`,content:t},{role:`assistant`,content:e.narration||e.spec.title}],l={question:t,narration:e.narration,title:e.spec.title,blockTypes:e.spec.blocks.map(e=>e.type)},d=g.current,f=e.spec.blocks.find(e=>e.id)?.id??null;h.current?.();let m=!1;h.current=()=>{m=!0};let _=()=>{m||(h.current=null,u({type:`show`,spec:e.spec,narration:e.narration,understood:[],history:c,mode:e.mode,prior:l,tour:r?[]:e.tour,spot:f,frame:e,priorSpec:d,streamed:!1,freshTimeline:!1}))};n?.revealNow||r?_():i?window.setTimeout(_,480):Ye(a?a.started:Promise.resolve(!1),et).then(_)},[s,o]),te=l.viewOverride?l.viewOverride:l.viewIndex==null?l.spec:l.frames[l.viewIndex]?.spec??l.spec;return _.current=te,(0,W.useEffect)(()=>()=>{m.current?.abort(),h.current?.();for(let e of C.current)e.ctrl.abort()},[]),{...l,run:E,refuseReason:D,reset:O,setSpot:k,restore:z,jumpTo:A,previewSpec:j,fill:F,unfill:I,generateWorld:N,expandWorld:P,setActiveBlank:L,complete:R,showFrame:B,viewSpec:te}}function vs(e){return e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`}function ys(e){return`${vs(e)}. What can I help you explore?`}var bs=`mavea-live-setup-v1`;function xs(){try{return localStorage.getItem(bs)===`1`}catch{return!1}}function Ss(){try{localStorage.setItem(bs,`1`)}catch{}}function Cs(){try{localStorage.removeItem(bs)}catch{}}var ws=[{id:`connect`,label:`Connect`,title:`Hi. Which mind should I think with?`,sub:`Your key, your model. Stored here only if you choose, then sent through this deployment.`},{id:`think`,label:`Think`,title:`How thorough should I be?`,sub:`All of this is optional, the defaults are good.`},{id:`remember`,label:`Remember`,title:`Should I remember you, and how should I sound?`,sub:`Memory lives on this device. You can hear me first.`},{id:`go`,label:`Go`,title:`What are we figuring out?`,sub:`Talk like you would to a friend, switch topics whenever you want.`}],Ts=`I’m awake.`,Es=`Set and ready, start talking, or try one of these.`,Ds=ws.map(e=>e.id);function Os(e){let t=Ds.indexOf(e);return t>=0&&t<Ds.length-1?Ds[t+1]:null}function ks(e){return ws.find(t=>t.id===e)??ws[0]}function As(e){let t=(0,J.c)(17),{current:n,done:r,onPick:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],t[0]=a):a=t[0];let o=(0,W.useRef)(a),s,c,l,u,d;if(t[1]!==n||t[2]!==r||t[3]!==i){let e=e=>t=>{if(t.key!==`ArrowRight`&&t.key!==`ArrowLeft`)return;t.preventDefault();let n=(e+(t.key===`ArrowRight`?1:-1)+ws.length)%ws.length;o.current[n]?.focus(),i(ws[n].id)};u=`constellation`,d=`Setup steps`,s=`const-track`,c=`tablist`,l=ws.map((t,a)=>{let s=t.id===n,c=r.has(t.id)&&!s;return(0,G.jsxs)(`li`,{className:`const-step `+(s?`is-current`:c?`is-done`:`is-future`),children:[(0,G.jsx)(`button`,{ref:e=>{o.current[a]=e},type:`button`,role:`tab`,"aria-selected":s,"aria-current":s?`step`:void 0,"aria-label":`${t.label}${c?`, done`:``}`,tabIndex:s?0:-1,className:`const-disc`,onClick:()=>i(t.id),onKeyDown:e(a),children:c?(0,G.jsx)(B.check,{}):s?null:(0,G.jsx)(`span`,{className:`const-num`,"aria-hidden":!0,children:a+1})}),(0,G.jsx)(`span`,{className:`const-label`,children:t.label})]},t.id)}),t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d}else s=t[4],c=t[5],l=t[6],u=t[7],d=t[8];let f;t[9]!==s||t[10]!==c||t[11]!==l?(f=(0,G.jsx)(`ol`,{className:s,role:c,children:l}),t[9]=s,t[10]=c,t[11]=l,t[12]=f):f=t[12];let p;return t[13]!==u||t[14]!==d||t[15]!==f?(p=(0,G.jsx)(`nav`,{className:u,"aria-label":d,children:f}),t[13]=u,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}function js(e){let t=(0,J.c)(16),{label:n,on:r,onToggle:i,note:a}=e,o;t[0]===n?o=t[1]:(o=(0,G.jsx)(`span`,{className:`toggle-label`,children:n}),t[0]=n,t[1]=o);let s;t[2]===a?s=t[3]:(s=(0,G.jsx)(`span`,{className:`toggle-note`,children:a}),t[2]=a,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,G.jsxs)(`div`,{className:`toggle-text`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l=`toggle-pill`+(r?` is-on`:``),u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(`span`,{className:`toggle-knob`}),t[7]=u):u=t[7];let d;t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==l?(d=(0,G.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":n,onClick:i,className:l,children:u}),t[8]=n,t[9]=r,t[10]=i,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==c||t[14]!==d?(f=(0,G.jsxs)(`div`,{className:`toggle-row`,children:[c,d]}),t[13]=c,t[14]=d,t[15]=f):f=t[15],f}function Ms(e){let t=(0,J.c)(10),{value:n,options:r,onPick:i,ariaLabel:a}=e,o;if(t[0]!==i||t[1]!==r||t[2]!==n){let e;t[4]!==i||t[5]!==n?(e=e=>{let t=e.value===n;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>i(e.value),className:`seg-opt`+(t?` is-active`:``),children:[(0,G.jsx)(`span`,{className:`seg-title`,children:e.label}),e.sub&&(0,G.jsx)(`span`,{className:`seg-sub`,children:e.sub})]},e.value)},t[4]=i,t[5]=n,t[6]=e):e=t[6],o=r.map(e),t[0]=i,t[1]=r,t[2]=n,t[3]=o}else o=t[3];let s;return t[7]!==a||t[8]!==o?(s=(0,G.jsx)(`div`,{className:`seg`,role:`radiogroup`,"aria-label":a,children:o}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ns(e){let t=(0,J.c)(20),{id:n,value:r,onChange:i,placeholder:a,ariaLabel:o}=e,[s,c]=(0,W.useState)(!1),l=(0,W.useId)(),u=n??l,d=s?`text`:`password`,f;t[0]===i?f=t[1]:(f=e=>i(e.target.value),t[0]=i,t[1]=f);let p;t[2]!==o||t[3]!==a||t[4]!==u||t[5]!==d||t[6]!==f||t[7]!==r?(p=(0,G.jsx)(`input`,{id:u,className:`setup-input`,type:d,value:r,onChange:f,placeholder:a,spellCheck:!1,autoComplete:`new-password`,"aria-label":o}),t[2]=o,t[3]=a,t[4]=u,t[5]=d,t[6]=f,t[7]=r,t[8]=p):p=t[8];let m;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>c(Ps),t[9]=m):m=t[9];let h=s?`Hide key`:`Show key`,g=s?`Hide key`:`Show key`,_;t[10]===s?_=t[11]:(_=s?(0,G.jsx)(B.eyeOff,{}):(0,G.jsx)(B.eye,{}),t[10]=s,t[11]=_);let v;t[12]!==s||t[13]!==h||t[14]!==g||t[15]!==_?(v=(0,G.jsx)(`button`,{type:`button`,className:`input-eye`,onClick:m,"aria-label":h,"aria-pressed":s,title:g,children:_}),t[12]=s,t[13]=h,t[14]=g,t[15]=_,t[16]=v):v=t[16];let y;return t[17]!==p||t[18]!==v?(y=(0,G.jsxs)(`div`,{className:`input-wrap`,children:[p,v]}),t[17]=p,t[18]=v,t[19]=y):y=t[19],y}function Ps(e){return!e}var Fs={gemini:{badge:`G`,name:`Gemini`,sub:`Google`},anthropic:{badge:`A`,name:`Claude`,sub:`Anthropic`},openai:{badge:`O`,name:`GPT`,sub:`OpenAI`},grok:{badge:`X`,name:`Grok`,sub:`xAI`},openrouter:{badge:`R`,name:`OpenRouter`,sub:`Many models`}},Is={native:`Real-time web search built in (grounds server-side when a question needs it).`,app:`Web grounding via Wikipedia, or your own Brave/Tavily search key.`,local:`Web grounding via Wikipedia when you ask for it.`},Ls={anthropic:`sk-ant-…`,openai:`sk-…`,gemini:`AIza…`,grok:`xai-…`,openrouter:`sk-or-…`};function Rs(e){return e.split(` · `)[1]??e}function zs(){let e=(0,J.c)(52),t=(0,W.useId)(),[n]=en(),r=xt(n.provider),i=n.models[n.provider]??``,a=i||r.defaultModel,o=n.keys[n.provider]??``,[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1),d=(0,W.useRef)(0),f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=async()=>{let e=d.current+=1;u(!0);let t=await qn(sn(nn()),{tts:!1});e===d.current&&(c({llm:t.llm,model:t.model,statusCode:t.statusCode}),u(!1))},e[0]=f):f=e[0];let p=f;(0,W.useEffect)(()=>{if(r.needsKey&&!o){c(null);return}let e=setTimeout(()=>void p(),400);return()=>clearTimeout(e)},[n.provider,a,o,p,r.needsKey]);let m=!!s?.llm&&!!s?.model&&!!a,h=l?`checking`:m?`ok`:`warn`,g=l?`Checking…`:r.needsKey&&!o?`Add your API key.`:a?m?`Looks good.`:s?.llm?`Reachable, but the model was not found.`:s?.statusCode===401?`Invalid API key.`:s?.statusCode===403?`Key lacks permission.`:s?.statusCode===404?`Model not found.`:s?.statusCode===void 0?`Not reachable.`:`Error ${s.statusCode}.`:`Choose a model.`,_=m?`Kept in memory unless you choose Remember; sent through this deployment to ${Rs(r.label)} when used.`:``,v;e[1]===n.provider?v=e[2]:(v=St.map(e=>{let t=Fs[e.id],r=e.id===n.provider;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,className:`provider-tile`+(r?` is-selected`:``),onClick:()=>on({provider:e.id}),children:[(0,G.jsx)(`span`,{className:`provider-badge`,children:t.badge}),(0,G.jsx)(`span`,{className:`provider-name`,children:t.name}),(0,G.jsx)(`span`,{className:`provider-sub`,children:t.sub})]},e.id)}),e[1]=n.provider,e[2]=v);let y;e[3]===v?y=e[4]:(y=(0,G.jsx)(`div`,{className:`provider-tiles`,role:`radiogroup`,"aria-label":`Provider`,children:v}),e[3]=v,e[4]=y);let b;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,G.jsx)(`p`,{className:`field-helper`,children:`When a default model is offered, start there for faster, lower-cost use and move up only when a task needs it. Requests pass through this deployment to the provider, whose usage charges, privacy, and retention terms apply.`}),e[5]=b):b=e[5];let x;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,G.jsx)(`span`,{className:`field-head`,children:(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Model`})}),e[6]=x):x=e[6];let S;e[7]===n.provider?S=e[8]:(S=e=>$t(n.provider,`model`,e),e[7]=n.provider,e[8]=S);let C;e[9]!==n.provider||e[10]!==i||e[11]!==S?(C=(0,G.jsx)(En,{provider:n.provider,value:i,onChange:S},n.provider),e[9]=n.provider,e[10]=i,e[11]=S,e[12]=C):C=e[12];let w;e[13]!==r.modelNotes||e[14]!==a?(w=r.modelNotes?.[a]&&(0,G.jsx)(`span`,{className:`field-helper`,children:r.modelNotes[a]}),e[13]=r.modelNotes,e[14]=a,e[15]=w):w=e[15];let T=Is[r.search],E;e[16]===T?E=e[17]:(E=(0,G.jsx)(`span`,{className:`field-helper`,children:T}),e[16]=T,e[17]=E);let D;e[18]!==C||e[19]!==w||e[20]!==E?(D=(0,G.jsxs)(`div`,{className:`field-col`,children:[x,C,w,E]}),e[18]=C,e[19]=w,e[20]=E,e[21]=D):D=e[21];let O;e[22]!==n.provider||e[23]!==r.keyUrl||e[24]!==r.needsKey||e[25]!==o||e[26]!==t?(O=r.needsKey&&(0,G.jsxs)(`label`,{className:`field-col`,htmlFor:t,children:[(0,G.jsx)(`span`,{className:`field-head`,children:(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`API key`})}),(0,G.jsx)(Ns,{id:t,value:o,onChange:e=>$t(n.provider,`key`,e),placeholder:Ls[n.provider]??`paste your key`,ariaLabel:`API key`}),r.keyUrl&&(0,G.jsx)(`a`,{className:`field-helper field-helper-link`,href:r.keyUrl,target:`_blank`,rel:`noreferrer noopener`,children:`Get a key↗`}),(0,G.jsx)(`span`,{className:`field-helper`,children:`Tip: use a restricted, spend-capped key — if it's ever exposed, the cost and access stay bounded.`})]}),e[22]=n.provider,e[23]=r.keyUrl,e[24]=r.needsKey,e[25]=o,e[26]=t,e[27]=O):O=e[27];let k;e[28]!==D||e[29]!==O?(k=(0,G.jsxs)(`div`,{className:`field-grid`,children:[D,O]}),e[28]=D,e[29]=O,e[30]=k):k=e[30];let A=`status-strip `+h,j;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,G.jsx)(`span`,{className:`status-strip-dot`,"aria-hidden":!0}),e[31]=j):j=e[31];let M;e[32]===g?M=e[33]:(M=(0,G.jsx)(`strong`,{children:g}),e[32]=g,e[33]=M);let N=_&&` `+_,P;e[34]!==M||e[35]!==N?(P=(0,G.jsxs)(`span`,{className:`status-strip-text`,children:[M,N]}),e[34]=M,e[35]=N,e[36]=P):P=e[36];let F;e[37]===p?F=e[38]:(F=(0,G.jsx)(`button`,{type:`button`,className:`status-strip-test`,onClick:()=>void p(),title:`Re-check the connection`,children:`Test`}),e[37]=p,e[38]=F);let I;e[39]!==A||e[40]!==P||e[41]!==F?(I=(0,G.jsxs)(`div`,{className:A,children:[j,P,F]}),e[39]=A,e[40]=P,e[41]=F,e[42]=I):I=e[42];let L;e[43]!==n.rememberKey||e[44]!==r.needsKey?(L=r.needsKey&&(0,G.jsx)(js,{label:`Remember this key on this device`,on:n.rememberKey,onToggle:()=>on({rememberKey:!n.rememberKey}),note:n.rememberKey?`Saved encrypted in this browser; use only on a trusted device.`:`Kept in memory only, cleared when you reload.`}),e[43]=n.rememberKey,e[44]=r.needsKey,e[45]=L):L=e[45];let R;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,G.jsx)(xn,{}),e[46]=R):R=e[46];let z;return e[47]!==k||e[48]!==I||e[49]!==y||e[50]!==L?(z=(0,G.jsxs)(`div`,{className:`step-body`,children:[y,b,k,I,L,R]}),e[47]=k,e[48]=I,e[49]=y,e[50]=L,e[51]=z):z=e[51],z}function Bs(){let e=(0,J.c)(19),[t]=en(),n=Zt(t.provider).capabilities,r=t.searchMode===`off`?`Answers from the model's own knowledge — no web calls.`:n.nativeWebSearch?`Grounds fresh asks in live web results with citations, only when a question needs it.`:`This model has no built-in search, so Real-time won't ground anything right now. Works only if your model supports it — pick one that does (Gemini or OpenRouter), or leave this off.`,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Web search`}),e[0]=i):i=e[0];let a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=[{value:`off`,label:`Off`,sub:`model knowledge`},{value:`realtime`,label:`Real-time`,sub:`live sources`}],e[1]=a):a=e[1];let o;e[2]===t.searchMode?o=e[3]:(o=(0,G.jsx)(Ms,{ariaLabel:`Web search`,value:t.searchMode,onPick:Z,options:a}),e[2]=t.searchMode,e[3]=o);let s;e[4]===r?s=e[5]:(s=(0,G.jsx)(`p`,{className:`field-helper`,children:r}),e[4]=r,e[5]=s);let c;e[6]!==o||e[7]!==s?(c=(0,G.jsxs)(`div`,{className:`field-block`,children:[i,o,s]}),e[6]=o,e[7]=s,e[8]=c):c=e[8];let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Answer quality`}),e[9]=l):l=e[9];let u;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=[{value:`fast`,label:`Fast`,sub:`quickest`},{value:`balanced`,label:`Balanced`,sub:`default`},{value:`thorough`,label:`Thorough`,sub:`thinks more`}],e[10]=u):u=e[10];let d;e[11]===t.quality?d=e[12]:(d=(0,G.jsx)(Ms,{ariaLabel:`Answer quality`,value:t.quality,onPick:X,options:u}),e[11]=t.quality,e[12]=d);let f;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsx)(`p`,{className:`field-helper`,children:`Fast keeps replies snappy; Thorough lets the model think more on hard questions.`}),e[13]=f):f=e[13];let p;e[14]===d?p=e[15]:(p=(0,G.jsxs)(`div`,{className:`field-block`,children:[l,d,f]}),e[14]=d,e[15]=p);let m;return e[16]!==c||e[17]!==p?(m=(0,G.jsxs)(`div`,{className:`step-body`,children:[c,p]}),e[16]=c,e[17]=p,e[18]=m):m=e[18],m}function X(e){return on({quality:e})}function Z(e){return on({searchMode:e})}function Vs(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Hs(e){let t=je(e);if(t){Fe(`mavea`,t.kokoro);try{localStorage.setItem(Pe,e)}catch{}}}function Us(e){let t=(0,J.c)(20),{label:n,value:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=e=>{i(e),Hs(e);let t=je(e);t&&Cn(t)},t[2]=i,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Le.map(Ws),t[4]=s):s=t[4];let c;t[5]!==n||t[6]!==o||t[7]!==r?(c=(0,G.jsx)(Jn,{ariaLabel:n,value:r,onChange:o,options:s}),t[5]=n,t[6]=o,t[7]=r,t[8]=c):c=t[8];let l;t[9]===r?l=t[10]:(l=()=>{let e=je(r);e&&Cn(e)},t[9]=r,t[10]=l);let u;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(B.play,{}),t[11]=u):u=t[11];let d;t[12]===l?d=t[13]:(d=(0,G.jsx)(`button`,{type:`button`,className:`voice-play`,onClick:l,"aria-label":`Preview Mavéa's voice`,title:`Preview voice`,children:u}),t[12]=l,t[13]=d);let f;t[14]!==c||t[15]!==d?(f=(0,G.jsxs)(`div`,{className:`voice-row`,children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16];let p;return t[17]!==a||t[18]!==f?(p=(0,G.jsxs)(`div`,{className:`voice-col`,children:[a,f]}),t[17]=a,t[18]=f,t[19]=p):p=t[19],p}function Ws(e){return{value:e.id,label:e.label,note:e.tone}}function Gs(){let e=(0,J.c)(16),[t]=en(),n=bn(),[r,i]=(0,W.useState)(Js),a;e[0]===t.memoryEnabled?a=e[1]:(a=()=>on({memoryEnabled:!t.memoryEnabled}),e[0]=t.memoryEnabled,e[1]=a);let o;e[2]!==t.memoryEnabled||e[3]!==a?(o=(0,G.jsx)(js,{label:`Remember me`,on:t.memoryEnabled,onToggle:a,note:`Durable facts about you, kept on this device only, to personalize future chats.`}),e[2]=t.memoryEnabled,e[3]=a,e[4]=o):o=e[4];let s;e[5]!==t.memoryEnabled||e[6]!==n?(s=t.memoryEnabled&&(0,G.jsxs)(`div`,{className:`memory-panel`,children:[(0,G.jsxs)(`div`,{className:`memory-head`,children:[(0,G.jsxs)(`span`,{className:`card-eyebrow`,children:[`What Mavéa remembers (`,n.length,` `,n.length===1?`concept`:`concepts`,`)`]}),n.length>0&&(0,G.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:qs,children:`Forget all`})]}),n.length===0?(0,G.jsx)(`p`,{className:`memory-empty`,children:`Nothing yet — Mavéa will note useful facts as you talk.`}):(0,G.jsx)(`ul`,{className:`memory-list`,children:n.map(Ks)})]}),e[5]=t.memoryEnabled,e[6]=n,e[7]=s):s=e[7];let c;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsx)(`hr`,{className:`setup-divider`}),e[8]=c):c=e[8];let l;e[9]===r?l=e[10]:(l=(0,G.jsx)(`div`,{className:`voice-grid`,children:(0,G.jsx)(Us,{label:`Mavéa speaks as`,value:r,onChange:i})}),e[9]=r,e[10]=l);let u;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(Dn,{}),e[11]=u):u=e[11];let d;return e[12]!==o||e[13]!==s||e[14]!==l?(d=(0,G.jsxs)(`div`,{className:`step-body`,children:[o,s,c,l,u]}),e[12]=o,e[13]=s,e[14]=l,e[15]=d):d=e[15],d}function Ks(e){return(0,G.jsxs)(`li`,{className:`memory-fact`,children:[(0,G.jsx)(`span`,{className:`memory-fact-concept`,children:e.concept}),(0,G.jsx)(`span`,{className:`memory-fact-text`,children:e.body}),(0,G.jsx)(`button`,{type:`button`,className:`memory-x`,onClick:()=>Nn(e.id),"aria-label":`Forget: ${e.concept}`,title:`Forget this`,children:(0,G.jsx)(B.x,{})})]},e.id)}function qs(){return Mn()}function Js(){return Vs(Pe,Ae)}var Ys=[{kicker:`Build`,accent:`var(--presence)`,prompt:`Build me a budget for a $5,000 month`},{kicker:`Decide`,accent:`var(--insight)`,prompt:`Should I take the train or fly to Boston?`},{kicker:`Understand`,accent:`var(--warning)`,prompt:`How does refinancing actually work?`},{kicker:`Plan`,accent:`var(--danger)`,prompt:`Three days in Tokyo, food first`}];function Xs({onStart:e}){return(0,G.jsx)(`div`,{className:`starter-grid`,role:`list`,children:Ys.map(t=>(0,G.jsxs)(`button`,{type:`button`,className:`starter-chip`,style:{"--starter-accent":t.accent},onClick:()=>e(t.prompt),children:[(0,G.jsxs)(`span`,{className:`starter-kicker`,children:[(0,G.jsx)(`span`,{"aria-hidden":!0,children:`✦`}),` `,t.kicker]}),(0,G.jsx)(`span`,{className:`starter-copy`,children:t.prompt})]},t.kicker))})}function Zs(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Qs(e,t){return je(Zs(e,t))?.label??`Voice`}var $s={fast:`Fast — snappy & cheap`,balanced:`Balanced — the default`,thorough:`Thorough — deeper thinking`};function ec(e){let t=(0,J.c)(55),{onJump:n,onStart:r,onStartTalking:i,onStartOver:a,onSeeHow:o,studySlot:s,librarySlot:c,launcherSlot:l}=e,[u]=en(),d=bn(),f=yn(),p,m;if(t[0]!==u.models||t[1]!==u.provider){let e=xt(u.provider);p=u.models[u.provider]||e.defaultModel,m=e.label.split(` · `)[1]??(e.needsKey?e.label:`Local`),t[0]=u.models,t[1]=u.provider,t[2]=p,t[3]=m}else p=t[2],m=t[3];let h=m,g;t[4]===u?g=t[5]:(g=an(u),t[4]=u,t[5]=g);let _=g,v=u.searchMode===`off`?`Off`:`Real-time`,y=u.memoryEnabled?`${d.length} ${d.length===1?`concept`:`concepts`} · this device only`:`Off`,b=`${p} · ${h}`,x;t[6]===b?x=t[7]:(x={key:`model`,label:`Model`,value:b,step:`connect`},t[6]=b,t[7]=x);let S;t[8]===v?S=t[9]:(S={key:`search`,label:`Web search`,value:v,step:`think`},t[8]=v,t[9]=S);let C=$s[u.quality]??u.quality,w;t[10]===C?w=t[11]:(w={key:`quality`,label:`Quality`,value:C,step:`think`},t[10]=C,t[11]=w);let T;t[12]===y?T=t[13]:(T={key:`memory`,label:`Memory`,value:y,step:`remember`},t[12]=y,t[13]=T);let E;t[14]===f?E=t[15]:(E=f===!1?`Off — captions only (voice needs the local TTS service)`:Qs(Pe,Ae),t[14]=f,t[15]=E);let D;t[16]===E?D=t[17]:(D={key:`voice`,label:`Voice`,value:E,step:`remember`},t[16]=E,t[17]=D);let O;t[18]!==D||t[19]!==x||t[20]!==S||t[21]!==w||t[22]!==T?(O=[x,S,w,T,D],t[18]=D,t[19]=x,t[20]=S,t[21]=w,t[22]=T,t[23]=O):O=t[23];let k=O,A;t[24]!==n||t[25]!==k?(A=(0,G.jsx)(`ul`,{className:`checklist`,children:k.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,className:`check-row`,onClick:()=>n(e.step),children:[(0,G.jsx)(`span`,{className:`check-mark`,"aria-hidden":!0,children:(0,G.jsx)(B.check,{})}),(0,G.jsx)(`span`,{className:`check-label`,children:e.label}),(0,G.jsx)(`span`,{className:`check-value`,children:e.value})]})},e.key))}),t[24]=n,t[25]=k,t[26]=A):A=t[26];let j;t[27]!==_||t[28]!==n||t[29]!==i?(j=_?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ke,{kind:`voice-data`,from:`live`,className:`go-voice-notice`}),(0,G.jsxs)(`button`,{type:`button`,className:`go-start`,onClick:i,children:[(0,G.jsx)(B.mic,{}),` Start talking`]})]}):(0,G.jsxs)(`button`,{type:`button`,className:`go-start go-start--gated`,onClick:()=>n(`connect`),title:`Add a model and a key on the Connect step first`,children:[(0,G.jsx)(B.mic,{}),` Connect a model to start`]}),t[27]=_,t[28]=n,t[29]=i,t[30]=j):j=t[30];let M;t[31]===a?M=t[32]:(M=(0,G.jsx)(`div`,{className:`go-ghosts`,children:(0,G.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:a,children:`Start over`})}),t[31]=a,t[32]=M);let N;t[33]!==A||t[34]!==j||t[35]!==M?(N=(0,G.jsxs)(`div`,{className:`go-left`,children:[A,j,M]}),t[33]=A,t[34]=j,t[35]=M,t[36]=N):N=t[36];let P;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Or start with one`}),t[37]=P):P=t[37];let F;t[38]===o?F=t[39]:(F=o&&(0,G.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:o,children:`See how it works`}),t[38]=o,t[39]=F);let I;t[40]===F?I=t[41]:(I=(0,G.jsxs)(`div`,{className:`try-head`,children:[P,F]}),t[40]=F,t[41]=I);let L;t[42]===r?L=t[43]:(L=(0,G.jsx)(Xs,{onStart:r}),t[42]=r,t[43]=L);let R;t[44]!==I||t[45]!==L?(R=(0,G.jsxs)(`div`,{className:`go-right`,children:[I,L]}),t[44]=I,t[45]=L,t[46]=R):R=t[46];let z;t[47]===c?z=t[48]:(z=c&&(0,G.jsx)(`div`,{className:`go-library`,children:c}),t[47]=c,t[48]=z);let ee;return t[49]!==l||t[50]!==s||t[51]!==N||t[52]!==R||t[53]!==z?(ee=(0,G.jsxs)(`div`,{className:`step-body go-grid`,children:[N,R,l,s,z]}),t[49]=l,t[50]=s,t[51]=N,t[52]=R,t[53]=z,t[54]=ee):ee=t[54],ee}function tc({speak:e,goDemo:t,onStart:n,onStartTalking:r,onSeeHow:i,studySlot:a,librarySlot:o,launcherSlot:s,paletteSlot:c,seed:l}){let u=(0,W.useRef)(!xs()),d=(0,W.useRef)(!1),[f,p]=(0,W.useState)(u.current?`connect`:`go`),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(``),v=(0,W.useRef)(l??``),[y,b]=(0,W.useState)(!u.current),x=!u.current||y;(0,W.useEffect)(()=>{if(f!==`go`)return;b(!0),u.current&&Ss();let t=v.current;if(t){v.current=``,n(t);return}d.current||(d.current=!0,e(u.current?`I’m awake.`:ys(new Date().getHours())))},[f,e,n]),(0,W.useEffect)(()=>{let e=document.documentElement;return e.dataset.wizardStep=f,()=>{delete e.dataset.wizardStep}},[f]);let S=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=S.current;if(!e)return;let t=document.documentElement,n=0,r=()=>{n=0,t.style.setProperty(`--wiz-scroll`,String(Math.min(1,e.scrollTop/130)))},i=()=>{n||=requestAnimationFrame(r)};return e.addEventListener(`scroll`,i,{passive:!0}),r(),()=>{e.removeEventListener(`scroll`,i),n&&cancelAnimationFrame(n),t.style.removeProperty(`--wiz-scroll`)}},[f]);let C=e=>{h(x&&e!==`go`),p(e),e!==`go`&&_(``)},w=()=>{C(m?`go`:Os(f)??`go`)},T=()=>{(typeof window>`u`||window.confirm(`Start over? This clears your saved setup and replays the intro.`))&&(Qt(),Cs(),Dt(),u.current=!0,d.current=!1,b(!1),h(!1),p(`connect`))},E=ws.findIndex(e=>e.id===f),D=new Set(ws.filter((e,t)=>x?e.id!==f:t<E).map(e=>e.id)),O=ks(f),k=f===`go`,A=k&&u.current?Ts:O.title,j=k&&u.current?Es:O.sub;return(0,G.jsxs)(`div`,{className:`setup stage`,"data-active":`1`,children:[(0,G.jsxs)(`header`,{className:`setup-nav`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`setup-back`,onClick:t,children:[(0,G.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to the demo`]}),(0,G.jsx)(As,{current:f,done:D,onPick:C}),(0,G.jsxs)(`div`,{className:`setup-nav-end`,children:[c,(0,G.jsx)(Kn,{triggerClassName:`setup-icon-btn`})]})]}),(0,G.jsxs)(`div`,{className:`setup-stage`,ref:S,children:[(0,G.jsxs)(`div`,{className:`setup-head`,children:[(0,G.jsx)(`h1`,{className:`setup-q`,children:A}),(0,G.jsx)(`p`,{className:`setup-sub`,children:j})]}),(0,G.jsxs)(`section`,{className:`card reveal setup-card`+(k?` setup-card--wide`:``),"aria-label":O.label,children:[f===`connect`&&(0,G.jsx)(zs,{}),f===`think`&&(0,G.jsx)(Bs,{}),f===`remember`&&(0,G.jsx)(Gs,{}),k&&(0,G.jsx)(ec,{onJump:C,onStart:n,onStartTalking:r,onStartOver:T,onSeeHow:i,studySlot:a,librarySlot:o,launcherSlot:s}),!k&&(0,G.jsxs)(`footer`,{className:`setup-foot`,children:[(0,G.jsx)(`span`,{className:`setup-foot-note`,children:`Changes save as you make them.`}),(0,G.jsxs)(`button`,{type:`button`,className:`setup-done`,onClick:w,children:[`Done `,(0,G.jsx)(B.check,{})]})]})]},f)]}),k&&(0,G.jsx)(`div`,{className:`go-composer`,children:(0,G.jsxs)(`div`,{className:`go-composer-inner`,children:[(0,G.jsx)(`input`,{className:`go-composer-input`,type:`text`,placeholder:`Say it or type it. Try ‘plan a trip’ or ‘compare two options’…`,value:g,autoComplete:`off`,spellCheck:!1,onChange:e=>_(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&g.trim()&&n(g.trim())}}),g.trim()?(0,G.jsx)(`button`,{type:`button`,className:`go-composer-send`,"aria-label":`Send`,onClick:()=>n(g.trim()),children:(0,G.jsx)(B.send,{})}):(0,G.jsx)(`button`,{type:`button`,className:`go-composer-mic`,"aria-label":`Use microphone`,onClick:r,children:(0,G.jsx)(B.mic,{})})]})})]})}function nc({mode:e,onChange:t,pttKey:n,pttSide:r}){let[i,a]=(0,W.useState)(!1),o=(0,W.useRef)(null),s=(0,W.useRef)(null),c=(0,W.useCallback)(()=>{a(!1),s.current?.focus()},[]);(0,W.useEffect)(()=>{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)},t=e=>{e.key===`Escape`&&c()};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[i,c]);let l=vn(n||`Alt`,r),u=e=>{t(e),c()},d=[{key:`tap`,title:`Tap`,blurb:`Tap once, then tap again to send`,checked:e===`tap`,onClick:()=>u(`tap`)},{key:`always`,title:`Always on`,blurb:`Hands-free — listens for any speech`,checked:e===`always`,onClick:()=>u(`always`)},{key:`hold`,title:`Hold ${l}`,blurb:`Hold the mic or ${l} to talk`,checked:e===`hold`,onClick:()=>u(`hold`)}];return(0,G.jsxs)(`div`,{className:`mic-mode-pop-root`,ref:o,children:[(0,G.jsx)(`button`,{type:`button`,className:`mic-mode-chevron`,ref:s,onClick:()=>a(e=>!e),"aria-expanded":i,"aria-haspopup":`menu`,"aria-label":`Mic mode`,title:`Mic mode`,children:(0,G.jsx)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M6 9l6 6 6-6`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),i&&(0,G.jsx)(`div`,{className:`mic-mode-pop`,role:`menu`,"aria-label":`Mic mode`,children:d.map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.checked,className:`more-menu-row mic-mode-row`,onClick:e.onClick,children:[(0,G.jsx)(`span`,{className:`more-menu-name`,children:e.title}),(0,G.jsx)(`span`,{className:`more-menu-blurb`,children:e.blurb}),e.checked&&(0,G.jsx)(B.check,{className:`mic-mode-row-check`,"aria-hidden":`true`})]},e.key))})]})}function rc(e,t){e.documentElement.dataset.presenceStyle=t}function ic(e){delete e.documentElement.dataset.presenceStyle}var ac=/(photo|image|carousel|mood|palette|video|map|diagram|story|slide|verse)/,oc=/(chart|table|matrix|grid|stat|kpi|code|pipeline|timeline|kanban|roadmap|process|flow|tree|schema|heatmap|scatter|bars|donut|gauge|checks|network|sankey)/;function sc(e,t){return!!(e?.blocks)?.some(e=>t.test(String(e.type).toLowerCase()))}function cc({status:e,interjecting:t=!1,spec:n}){if(e===`thinking`)return`bead`;if(t)return`pip`;let r=Ua(n);return r===`warm`?`pip`:r===`concerned`?`hybrid`:sc(n,ac)?`aura`:sc(n,oc)?`bead`:`hybrid`}var lc=6e3;function uc({dashboardId:e,dashboardTitle:t,onDismiss:n}){let r=(0,W.useRef)(n);return r.current=n,(0,W.useEffect)(()=>{let e=setTimeout(()=>r.current(),lc);return()=>clearTimeout(e)},[e]),(0,G.jsxs)(`div`,{className:`cards-pill dash-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(B.check,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text dash-pill-text`,children:[`Added to `,(0,G.jsx)(`strong`,{children:t})]}),(0,G.jsxs)(`a`,{className:`cards-pill-btn cards-pill-primary`,href:Yn.detail(e),onClick:n,children:[`Open `,(0,G.jsx)(B.chevR,{})]})]})}var dc={strong:`Strong evidence`,partial:`Partial evidence`,inferred:`Inferred`,unverified:`Unverified`},fc={strong:3,partial:2,inferred:1,unverified:1};function pc(e){let t=(0,J.c)(3),{count:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`i`,{className:`prov-dot`,"aria-hidden":`true`}),t[0]=r):r=t[0];let i=n==null?`Inferred`:`${n} ${n===1?`claim`:`claims`} inferred`,a;return t[1]===i?a=t[2]:(a=(0,G.jsxs)(`span`,{className:`prov-inferred`,children:[r,i]}),t[1]=i,t[2]=a),a}function mc(e){let t=(0,J.c)(8),{level:n,title:r}=e,i=fc[n],a=`prov-pill `+n,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[0,1,2],t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=(0,G.jsx)(`span`,{className:`prov-bars`,"aria-hidden":`true`,children:o.map(e=>(0,G.jsx)(`i`,{className:e<i?`on`:``},e))}),t[1]=i,t[2]=s);let c=dc[n],l;return t[3]!==a||t[4]!==s||t[5]!==c||t[6]!==r?(l=(0,G.jsxs)(`span`,{className:a,title:r,children:[s,c]}),t[3]=a,t[4]=s,t[5]=c,t[6]=r,t[7]=l):l=t[7],l}function hc({sources:e,hosts:t=!1,className:n}){return e.length?(0,G.jsxs)(`div`,{className:`grounded-in`+(n?` ${n}`:``),children:[(0,G.jsx)(`span`,{className:`grounded-in-label`,children:`Grounded in`}),(0,G.jsx)(`ul`,{children:e.map((e,n)=>{let r=H(e.url),i=t?ve(e.url):null;return(0,G.jsxs)(`li`,{children:[r?(0,G.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,children:e.title}):(0,G.jsx)(`span`,{className:`grounded-in-name`,children:e.title}),i&&(0,G.jsx)(`span`,{className:`grounded-in-host`,children:i})]},n)})})]}):null}var gc=(e,t,n)=>`block:${e}:${t}${n===void 0?``:`@${n}`}`,_c=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,40)||`value`;function vc(e){let t=[];switch(e.type){case`chart`:{let{labels:n,series:r,unit:i}=e.props;for(let e of r)e.data.forEach((r,a)=>{let o=n[a];o===void 0||!Number.isFinite(r)||t.push({key:`${_c(e.name)}-${_c(o)}`,label:`${e.name} · ${o}`,value:r,...i===void 0?{}:{unit:i},at:o})});return t}case`breakdown`:for(let n of e.props.rows)Number.isFinite(n.pct)&&t.push({key:_c(n.name),label:n.name,value:n.pct,unit:`%`});return t;case`kpi`:for(let n of e.props.kpis){let e=ft(n.val);e&&t.push({key:_c(n.label),label:n.label,value:e.value,...e.kind===`pct`?{unit:`%`}:{}})}return t;case`ring`:for(let n of e.props.rings){let e=ft(n.display);e&&t.push({key:_c(n.label),label:n.label,value:e.value,...n.unit===void 0?e.kind===`pct`?{unit:`%`}:{}:{unit:n.unit}})}return t;default:return t}}function yc(e,t){let n=e.props,r=n.title??n.eyebrow;return r===void 0?null:{id:`block:${t}`,label:r,role:`measure`}}function bc(e,t=``){let n=Vn(t),r=t.split(/(?<=[.!?])\s+|\n+/).map(e=>e.trim()).filter(Boolean),i=e.sources?.[0]?.url?Hn(e.sources[0].url):void 0,a=[],o=[],s=new Map,c=[];return e.blocks.forEach((e,t)=>{let l=vc(e);if(l.length===0)return;let u=yc(e,t);if(u){a.push(u);for(let e of l){let a=gc(t,e.key,e.at);if(s.has(a))continue;let l=r.find(t=>pt(e.value,t)&&n(t)),d=l===void 0?void 0:{quote:l,...i===void 0?{}:{host:i}},f=Zn(a,e.label,e.value,d?`T2`:`T3`,e.unit,d,d===void 0,e.at);f&&(s.set(a,f),c.push({valueId:a,surface:`block`,id:u.id,label:u.label}),o.push({valueId:a,entityId:u.id,...e.at===void 0?{}:{at:e.at}}))}}}),{title:e.title,entities:a,relations:[],facts:o,trust:Qn(s,c)}}function xc({open:e,onClose:t,claim:n,conf:r,sources:i,hadFiles:a=!1,blocks:o}){(0,W.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]);let s=(0,W.useMemo)(()=>{if(!o?.length)return[];let e=i.map(e=>e.snippet??``).filter(Boolean).join(`
18
+ Give the parts "${t.label}" is made of (${Lo} max). Quote SOURCES verbatim for any number; otherwise T0 with no numbers. Reply as compact JSON on one line.`}var Wo=new Map;function Go(e,t,n,r){return Ln(`world-expand:${e.title}\0${t}\0${n.text}`,r.provider)}async function Ko(e,t,n,r,i,a){let o=await Bn(e);if(o)return o;if(a?.aborted)return null;let s;try{s=(await Zt(i.provider).generate({system:Bo,history:[],user:Uo(t,n,r),maxTokens:Ro,thinkingLevel:`minimal`,format:Vo,...a?{signal:a}:{}},i)).raw}catch{return null}if(a?.aborted)return null;let c=Un(s,n.id,r,!!t.provenance.illustrative);return c.length===0?null:(Rn(e,c),c)}function qo(e,t){for(let n of e){if(n.id===t)return n;let e=n.children===void 0?void 0:qo(n.children,t);if(e)return e}}function Jo(e,t,n,r,i){let a=qo(e.nodes,t);if(!a||(a.children?.length??0)>0)return Promise.resolve(null);let o=Go(e,t,n,r);return(Wo.get(o)??(()=>{let t=Ko(o,e,a,n,r,i);for(Wo.set(o,t);Wo.size>zo;){let e=Wo.keys().next().value;if(e===void 0||e===o)break;Wo.delete(e)}return t.then(e=>{e||Wo.delete(o)},()=>Wo.delete(o)),t})()).then(n=>n?Gn(e,t,n):null)}function Yo(e=160){let t=``,n=!0;return{push(r,i=!1){let a=r.trim();if(!a)return i?this.flush():``;if(n&&!t)return n=!1,a;if(t=t?`${t} ${a}`:a,!i&&t.length<e)return``;let o=t;return t=``,o},flush(){let e=t;return t=``,e}}}i();var Xo=()=>a(()=>import(`./generateLive-CDIkclO4.js`),__vite__mapDeps([3,4,5,6,7,8,9,10,2,1,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59])),Zo=50,Qo=18e5,$o=864e5,es=`live-answer:v1`,ts=2;function ns(e,t){let n=t?.searchMode??(t?.webSearch?`free`:`off`),r=t?.quality??``,i=t?.explainLevel??`standard`,a=+!!t?.generativeBlocks,o=+!!t?.memoryEnabled,s=+!!t?.worldEnabled;return`${e.provider}::${e.model}::${n}::${r}::${i}::${a}::${o}::${s}`}function rs(e,t,n){let r=e.slice(-40);if(r.length===0&&!t&&!n)return`cold`;let i=r.map(e=>`${e.role}:${e.content}`);return t&&i.push(`world:${t.title}`),n&&i.push(`lesson:${n.topic}\u0000${n.directive}`),zn(i.join(`\0`))}function is(e,t){let n=e.get(t);return!n||(e.delete(t),Date.now()-n.at>Qo)?null:(e.set(t,n),n.result)}function as(e,t,n){for(e.delete(t),e.set(t,{at:Date.now(),result:n});e.size>Zo;){let t=e.keys().next().value;if(t===void 0)break;e.delete(t)}}function os(e,t){return Ln(`${es}:${e}`,t.provider)}async function ss(e){let t=await Bn(e);return typeof t?.at!=`number`||!t.result?.spec?.blocks?.length||Date.now()-t.at>$o?null:t.result}function cs(e,t){return!e.spec.sources?.length&&!t?.memoryEnabled}function ls(e){let t=e?.blocks??[];for(let e=t.length-1;e>=0;--e){let n=t[e];if(n.type===`world`&&n.props.world)return n.props.world}}function us(e,t,n,r){let i=e.blocks.findIndex(e=>e.id===t&&e.type===`world`);if(i<0)return e;let a=e.blocks[i];if(a.type!==`world`||a.props.world||a.props.title!==n)return e;let o=[...e.blocks];return o[i]={...a,props:{...a.props,world:r}},{...e,blocks:o}}function ds(e,t){return!e||e.blocks.length>t.blocks.length?!1:e.blocks.every((e,n)=>{let r=t.blocks[n];return e.type===r.type&&JSON.stringify(e.props)===JSON.stringify(r.props)})}var fs={history:[],spec:null,status:`idle`,turn:0,narration:``,understood:[],busy:!1,activity:null,spot:null,mode:`replace`,replaceEpoch:0,prior:null,tour:[],past:[],frames:[],viewIndex:null,viewOverride:null,error:null,pendingShape:null,reasoning:!1,liveSources:[],restored:!1,phase:`normal`,filled:{},activeBlank:null};function ps(e,t){return e?.find(e=>!(e.key in t))?.key??null}function ms(e,t){switch(t.type){case`start`:return{...e,status:`thinking`,busy:!0,narration:``,understood:[],activity:null,spot:null,viewIndex:null,viewOverride:null,error:null,pendingShape:null,reasoning:!1,liveSources:[],restored:!1,...t.fresh?{spec:null,prior:null}:{},phase:`normal`,filled:{},activeBlank:null};case`speak`:return{...e,status:`speaking`,narration:t.narration};case`activity`:return{...e,activity:t.activity};case`stream`:return{...e,status:`showing`,spec:t.spec};case`show`:return{...e,status:`showing`,spec:t.spec,narration:t.narration||e.narration,understood:t.understood,history:t.history.slice(-40),turn:e.turn+1,busy:!1,mode:t.mode,prior:t.prior,tour:t.tour,past:t.freshTimeline?[]:t.mode===`replace`&&t.priorSpec?[...e.past,t.priorSpec].slice(-12):e.past,frames:t.freshTimeline?[t.frame]:[...e.frames,t.frame].slice(-40),activity:null,replaceEpoch:t.mode===`replace`&&!t.streamed?e.replaceEpoch+1:e.replaceEpoch,spot:t.spot,viewIndex:null,viewOverride:null,pendingShape:null,reasoning:!1,liveSources:[],phase:t.spec.awaiting&&t.spec.blanks?.length?`awaiting_input`:`normal`,filled:{},activeBlank:t.spec.awaiting&&t.spec.blanks?.length?ps(t.spec.blanks,{}):null};case`idle`:return{...e,status:`idle`,busy:!1,activity:null,reasoning:!1};case`error`:return{...e,status:`idle`,busy:!1,activity:null,error:t.error,pendingShape:null,reasoning:!1,liveSources:[]};case`spot`:return{...e,spot:t.spot};case`pending`:return{...e,pendingShape:t.pending};case`thinking`:return{...e,reasoning:t.on};case`sources`:return{...e,liveSources:t.sources};case`jump`:return e.frames[t.index]?{...e,viewIndex:t.index,viewOverride:null,spot:null}:e;case`preview`:return{...e,viewOverride:t.spec,viewIndex:null,spot:null};case`restore`:{let n=t.spec.blocks.find(e=>e.id)?.id??null,r={id:qe(t.at),question:t.question,narration:``,mode:`replace`,tour:[],spec:t.spec,at:t.at};return{...e,restored:!0,spec:t.spec,status:`showing`,turn:e.turn+1,narration:``,understood:[],busy:!1,activity:null,spot:n,viewIndex:null,viewOverride:null,mode:`replace`,replaceEpoch:e.replaceEpoch+1,tour:[],error:null,frames:[...e.frames,r].slice(-40),prior:{question:t.question,narration:``,title:t.spec.title,blockTypes:t.spec.blocks.map(e=>e.type)},history:[...e.history,{role:`user`,content:t.question},{role:`assistant`,content:t.spec.title}].slice(-40)}}case`world`:{let n=e.spec?us(e.spec,t.blockId,t.question,t.world):e.spec,r=e.frames.map(e=>{let n=us(e.spec,t.blockId,t.question,t.world);return n===e.spec?e:{...e,spec:n}});return n===e.spec&&r.every((t,n)=>t===e.frames[n])?e:{...e,spec:n,frames:r}}case`fill`:{let n={...e.filled,[t.value.key]:t.value};return{...e,filled:n,activeBlank:ps(e.spec?.blanks,n)}}case`unfill`:{let n={...e.filled};return delete n[t.key],{...e,filled:n,activeBlank:t.key}}case`setActiveBlank`:return{...e,activeBlank:t.key};case`reset`:return{...fs};default:return e}}function hs(e){let t=e.frames[e.frames.length-1];return{...fs,history:e.history,frames:e.frames,spec:t.spec,status:`idle`,mode:`replace`,restored:!0,prior:{question:t.question,narration:t.narration,title:t.spec.title,blockTypes:t.spec.blocks.map(e=>e.type)}}}var gs={blocked:`Mavéa needs the terms accepted before it can reach a model — open Settings to review.`,busy:`Still finishing the last answer — your question is still here, send it again in a moment.`,empty:`There’s nothing to send yet — type a question or attach a file.`};function _s(e){let{canRun:t,getConfig:n,configReady:r,canvasReady:i,getCaps:a,speak:o,cancelSpeak:s,getLibraryEnabled:c}=e,[l,u]=(0,W.useReducer)(ms,e.initial??fs),d=(0,W.useRef)(e);d.current=e;let f=(0,W.useRef)(!1);f.current=l.busy;let p=(0,W.useRef)(l.history);p.current=l.history;let m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)(l.spec);g.current=l.spec;let _=(0,W.useRef)(null),v=(0,W.useRef)([]);v.current=l.frames;let y=(0,W.useRef)(l.prior);y.current=l.prior;let b=(0,W.useRef)(l.filled);b.current=l.filled;let x=(0,W.useRef)(new Map),S=(0,W.useRef)(new Map),C=(0,W.useRef)([]),w=(0,W.useRef)(new Set),T=(0,W.useRef)(l.turn);T.current=l.turn;let E=(0,W.useCallback)(async(e,l,d,_,v,b,E,D)=>{if(t&&!t())return;let O=e.trim();if(!O&&!l?.length||f.current&&!D?.force)return;let k=O||`What can you tell me about the attached file?`,A=b?.trim()||k,j={question:A,retry:k,attachments:l,selectedBlocks:d,inkIntents:v};s?.();let M=D?.freshStart?null:g.current;m.current?.abort(),h.current?.(),h.current=null;let N=new AbortController;m.current=N,f.current=!0,u({type:`start`,fresh:D?.freshStart});let P=null,F=e=>{if(!i){o?.(e);return}P=(P??i()).then(()=>{N.signal.aborted||o?.(e)})},I=D?.freshStart?[]:p.current,L=D?.freshStart?null:y.current,R=ls(g.current),z=!!(l?.length||d?.length||_&&Object.keys(_).length||v?.length);if(await r?.(),N.signal.aborted)return;let B=n(),te=a?.(),ne=ns(B,te),ie=`${k}::${rs(I,R,D?.lesson)}::${ne}`,ae=os(ie,B),oe=z?null:S.current.get(ie)??null;for(let e of C.current)e.key===ie&&oe||(e.ctrl.abort(),S.current.delete(e.key));C.current=oe?C.current.filter(e=>e.key===ie):[];let se=z?null:is(x.current,ie),ce=!He(L,k),V,le=!1,ue=null,de=se;if(!de&&oe){let e=await oe.catch(()=>null);if(N.signal.aborted)return;e&&!e.error&&e.spec.blocks.length>0&&(de=e)}if(!de&&!z&&(de=await ss(ae),N.signal.aborted))return;if(de){let e=de;e.narration&&(u({type:`speak`,narration:e.narration}),F(e.spoken||e.narration)),V=e}else{let e=``,t=new ht(`narration`),n=0,r=!1,i=mn(hn(k)),a=0,o=Yo(),s;try{s=await Xo()}catch{if(N.signal.aborted)return;u({type:`error`,error:{kind:`network`,message:`Mavéa couldn't finish loading. Check your connection and try again.`,...j}});return}let{generateLive:c}=s,f=null,p=0,m=()=>{if(p=0,!f||N.signal.aborted)return;let e=f;f=null,le=!0,ue=e,u({type:`stream`,spec:e})};if(N.signal.addEventListener(`abort`,()=>{f=null,p&&cancelAnimationFrame(p)},{once:!0}),V=await c(k,I,B,s=>{if(N.signal.aborted)return;e+=s,t.scan(e);let c=t.progress();if(!c)return;let{chunk:l,consumed:d}=gt(c.text,n,c.done);if(!l){if(c.done){let e=o.flush();e&&F(e)}return}if(n=d,r=!0,u({type:`speak`,narration:xe(be(c.text.slice(0,d)))}),a>=i){let e=o.flush();e&&F(e);return}a+=l.length;let f=o.push(l,c.done);f&&F(f)},{caps:te,signal:N.signal,onActivity:e=>{N.signal.aborted||u({type:`activity`,activity:e})},recentTypes:[...w.current],rotation:T.current,attachments:l,selectedBlocks:d,filledBlanks:_,inkIntents:v,priorTopic:L?.title||void 0,priorWorld:R,lesson:D?.lesson,onPartial:ce?e=>{N.signal.aborted||(ee(e.spec.blocks),f=e.spec,le?p||=requestAnimationFrame(m):m())}:void 0,onSources:e=>{N.signal.aborted||u({type:`sources`,sources:e})},onPending:ce?e=>{N.signal.aborted||u({type:`pending`,pending:e})}:void 0,onThinking:e=>{N.signal.aborted||u({type:`thinking`,on:e})}}),p&&cancelAnimationFrame(p),m(),!N.signal.aborted){let e=o.flush();e&&F(e)}if(N.signal.aborted)return;!r&&V.narration&&(u({type:`speak`,narration:V.narration}),F(V.spoken||V.narration)),!z&&!V.error&&V.spec.blocks.length>0&&(as(x.current,ie,V),cs(V,te)&&Rn(ae,{at:Date.now(),result:V}))}if(V.error){u({type:`error`,error:{...V.error,...j}});return}let fe=d?.length?`${A} (about: ${d.map(re).join(`, `)})`:A,pe=[...I,{role:`user`,content:fe},{role:`assistant`,content:V.narration||V.spec.title}],me,he,ge;try{let e=bo(L,D?.freshStart?[]:g.current?.blocks??[],A,V,{forceReplace:ce});me=e.mode,he=e.frame.spec;let t=e.snap;ge=E?{...e.frame,mind:E}:e.frame,ee(he.blocks),u({type:`show`,spec:he,narration:V.narration,history:pe,mode:me,spot:e.spot,prior:t,tour:ge.tour,priorSpec:M,streamed:le&&ds(ue,he),frame:ge,understood:V.understood??[],freshTimeline:D?.freshStart});for(let e of t.blockTypes)w.current.add(e)}catch{u({type:`error`,error:{kind:`http`,message:`Something went wrong putting that answer together — let's try again.`,...j}});return}if(a?.().memoryEnabled&&pn(k))try{let e=String(ge.at),t=A.slice(0,200),n=(he.sources?.length??0)>0,r=V.memory??[];if(r.length)An(r.map(r=>({...r,source:Mo(r.body,A,{webGrounded:n}),turnId:e,quote:t})));else{let n=Do(A);n.length&&An([{concept:`profile`,body:n.join(`. `),source:`user-stated`,turnId:e,quote:t}])}if(V.corrects){let t=No(V.corrects.now,A);An([Io(V.corrects,{turnId:e,source:t})])}}catch{}me===`replace`&&c?.()&&jt(he,A);let _e=n(),H=a?.();if(H?.quality===`thorough`){let e=he.suggests??[],t=[...w.current],n=ns(_e,H),r=rs(pe,ls(he),void 0);e.slice(0,ts).forEach((e,i)=>{let a=`${e.label}::${r}::${n}`;if(is(x.current,a)||S.current.has(a))return;let o=new AbortController;C.current.push({key:a,ctrl:o});let s=Xo().then(({generateLive:n})=>n(e.label,pe,_e,void 0,{caps:H,signal:o.signal,repair:!1,recentTypes:t,rotation:T.current+1+i})).then(e=>(!o.signal.aborted&&!e.error&&e.spec.blocks.length>0&&as(x.current,a,e),e));S.current.set(a,s);let c=()=>{S.current.get(a)===s&&S.current.delete(a)};s.then(c,c)})}},[t,n,r,i,a,o,s,c]),D=(0,W.useCallback)((e,n)=>t&&!t()?`blocked`:!e.trim()&&!n?`empty`:f.current?`busy`:null,[t]),O=(0,W.useCallback)(()=>{m.current?.abort(),m.current=null,h.current?.(),h.current=null;for(let e of C.current)e.ctrl.abort();C.current=[],S.current.clear(),x.current.clear(),w.current.clear(),u({type:`reset`})},[]),k=(0,W.useCallback)(e=>u({type:`spot`,spot:e}),[]),A=(0,W.useCallback)(e=>u({type:`jump`,index:e}),[]),j=(0,W.useCallback)(e=>{e&&ee(e.blocks),u({type:`preview`,spec:e})},[]),M=(0,W.useCallback)(e=>{let t=_.current?.blocks.find(t=>t.id===e);if(t)return t;let n=g.current?.blocks.find(t=>t.id===e);if(n)return n;for(let t of v.current){let n=t.spec.blocks.find(t=>t.id===e);if(n)return n}},[]),N=(0,W.useCallback)(async e=>{let{canRun:t,getConfig:n}=d.current;if(t&&!t())return null;let r=M(e);if(r?.type!==`world`)return null;if(r.props.world)return r.props.world;let i=r.props.title;try{let t=await un(i,await gn(i),n());return t&&u({type:`world`,blockId:e,question:i,world:t}),t}catch{return null}},[M]),P=(0,W.useCallback)(async(e,t,n)=>{let{canRun:r,getConfig:i}=d.current;if(r&&!r())return null;let a=M(e);if(a?.type!==`world`)return null;let o=n??a.props.world;if(!o)return null;try{return await Jo(o,t,await gn(o.title),i())}catch{return null}},[M]),F=(0,W.useCallback)(e=>u({type:`fill`,value:e}),[]),I=(0,W.useCallback)(e=>u({type:`unfill`,key:e}),[]),L=(0,W.useCallback)(e=>u({type:`setActiveBlank`,key:e}),[]),R=(0,W.useCallback)(()=>{let e=g.current,t=b.current;return!e||!Object.keys(t).length||f.current?!1:(E(`Complete the answer you started above using the values I just filled into the blanks — keep everything you already showed and fill in only the parts that depended on those values. Do not start over.`,void 0,e.blocks,t),!0)},[E]),z=(0,W.useCallback)((e,t)=>{s?.(),ee(e.blocks),u({type:`restore`,spec:e,question:t,at:Date.now()})},[s]),B=(0,W.useCallback)((e,t,n)=>{let r=n?.silent===!0;ee(e.spec.blocks),n?.interrupt!==!1&&s?.();let i=De();u({type:`start`,fresh:!1}),r||u({type:`speak`,narration:e.narration});let a=r?void 0:o?.(e.spoken??e.narration),c=[...p.current,{role:`user`,content:t},{role:`assistant`,content:e.narration||e.spec.title}],l={question:t,narration:e.narration,title:e.spec.title,blockTypes:e.spec.blocks.map(e=>e.type)},d=g.current,f=e.spec.blocks.find(e=>e.id)?.id??null;h.current?.();let m=!1;h.current=()=>{m=!0};let _=()=>{m||(h.current=null,u({type:`show`,spec:e.spec,narration:e.narration,understood:[],history:c,mode:e.mode,prior:l,tour:r?[]:e.tour,spot:f,frame:e,priorSpec:d,streamed:!1,freshTimeline:!1}))};n?.revealNow||r?_():i?window.setTimeout(_,480):Ye(a?a.started:Promise.resolve(!1),et).then(_)},[s,o]),te=l.viewOverride?l.viewOverride:l.viewIndex==null?l.spec:l.frames[l.viewIndex]?.spec??l.spec;return _.current=te,(0,W.useEffect)(()=>()=>{m.current?.abort(),h.current?.();for(let e of C.current)e.ctrl.abort()},[]),{...l,run:E,refuseReason:D,reset:O,setSpot:k,restore:z,jumpTo:A,previewSpec:j,fill:F,unfill:I,generateWorld:N,expandWorld:P,setActiveBlank:L,complete:R,showFrame:B,viewSpec:te}}function vs(e){return e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`}function ys(e){return`${vs(e)}. What can I help you explore?`}var bs=`mavea-live-setup-v1`;function xs(){try{return localStorage.getItem(bs)===`1`}catch{return!1}}function Ss(){try{localStorage.setItem(bs,`1`)}catch{}}function Cs(){try{localStorage.removeItem(bs)}catch{}}var ws=[{id:`connect`,label:`Connect`,title:`Hi. Which mind should I think with?`,sub:`Your key, your model. Stored here only if you choose, then sent through this deployment.`},{id:`think`,label:`Think`,title:`How thorough should I be?`,sub:`All of this is optional, the defaults are good.`},{id:`remember`,label:`Remember`,title:`Should I remember you, and how should I sound?`,sub:`Memory lives on this device. You can hear me first.`},{id:`go`,label:`Go`,title:`What are we figuring out?`,sub:`Talk like you would to a friend, switch topics whenever you want.`}],Ts=`I’m awake.`,Es=`Set and ready, start talking, or try one of these.`,Ds=ws.map(e=>e.id);function Os(e){let t=Ds.indexOf(e);return t>=0&&t<Ds.length-1?Ds[t+1]:null}function ks(e){return ws.find(t=>t.id===e)??ws[0]}function As(e){let t=(0,J.c)(17),{current:n,done:r,onPick:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],t[0]=a):a=t[0];let o=(0,W.useRef)(a),s,c,l,u,d;if(t[1]!==n||t[2]!==r||t[3]!==i){let e=e=>t=>{if(t.key!==`ArrowRight`&&t.key!==`ArrowLeft`)return;t.preventDefault();let n=(e+(t.key===`ArrowRight`?1:-1)+ws.length)%ws.length;o.current[n]?.focus(),i(ws[n].id)};u=`constellation`,d=`Setup steps`,s=`const-track`,c=`tablist`,l=ws.map((t,a)=>{let s=t.id===n,c=r.has(t.id)&&!s;return(0,G.jsxs)(`li`,{className:`const-step `+(s?`is-current`:c?`is-done`:`is-future`),children:[(0,G.jsx)(`button`,{ref:e=>{o.current[a]=e},type:`button`,role:`tab`,"aria-selected":s,"aria-current":s?`step`:void 0,"aria-label":`${t.label}${c?`, done`:``}`,tabIndex:s?0:-1,className:`const-disc`,onClick:()=>i(t.id),onKeyDown:e(a),children:c?(0,G.jsx)(B.check,{}):s?null:(0,G.jsx)(`span`,{className:`const-num`,"aria-hidden":!0,children:a+1})}),(0,G.jsx)(`span`,{className:`const-label`,children:t.label})]},t.id)}),t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d}else s=t[4],c=t[5],l=t[6],u=t[7],d=t[8];let f;t[9]!==s||t[10]!==c||t[11]!==l?(f=(0,G.jsx)(`ol`,{className:s,role:c,children:l}),t[9]=s,t[10]=c,t[11]=l,t[12]=f):f=t[12];let p;return t[13]!==u||t[14]!==d||t[15]!==f?(p=(0,G.jsx)(`nav`,{className:u,"aria-label":d,children:f}),t[13]=u,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}function js(e){let t=(0,J.c)(16),{label:n,on:r,onToggle:i,note:a}=e,o;t[0]===n?o=t[1]:(o=(0,G.jsx)(`span`,{className:`toggle-label`,children:n}),t[0]=n,t[1]=o);let s;t[2]===a?s=t[3]:(s=(0,G.jsx)(`span`,{className:`toggle-note`,children:a}),t[2]=a,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,G.jsxs)(`div`,{className:`toggle-text`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l=`toggle-pill`+(r?` is-on`:``),u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(`span`,{className:`toggle-knob`}),t[7]=u):u=t[7];let d;t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==l?(d=(0,G.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":n,onClick:i,className:l,children:u}),t[8]=n,t[9]=r,t[10]=i,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==c||t[14]!==d?(f=(0,G.jsxs)(`div`,{className:`toggle-row`,children:[c,d]}),t[13]=c,t[14]=d,t[15]=f):f=t[15],f}function Ms(e){let t=(0,J.c)(10),{value:n,options:r,onPick:i,ariaLabel:a}=e,o;if(t[0]!==i||t[1]!==r||t[2]!==n){let e;t[4]!==i||t[5]!==n?(e=e=>{let t=e.value===n;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>i(e.value),className:`seg-opt`+(t?` is-active`:``),children:[(0,G.jsx)(`span`,{className:`seg-title`,children:e.label}),e.sub&&(0,G.jsx)(`span`,{className:`seg-sub`,children:e.sub})]},e.value)},t[4]=i,t[5]=n,t[6]=e):e=t[6],o=r.map(e),t[0]=i,t[1]=r,t[2]=n,t[3]=o}else o=t[3];let s;return t[7]!==a||t[8]!==o?(s=(0,G.jsx)(`div`,{className:`seg`,role:`radiogroup`,"aria-label":a,children:o}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ns(e){let t=(0,J.c)(20),{id:n,value:r,onChange:i,placeholder:a,ariaLabel:o}=e,[s,c]=(0,W.useState)(!1),l=(0,W.useId)(),u=n??l,d=s?`text`:`password`,f;t[0]===i?f=t[1]:(f=e=>i(e.target.value),t[0]=i,t[1]=f);let p;t[2]!==o||t[3]!==a||t[4]!==u||t[5]!==d||t[6]!==f||t[7]!==r?(p=(0,G.jsx)(`input`,{id:u,className:`setup-input`,type:d,value:r,onChange:f,placeholder:a,spellCheck:!1,autoComplete:`new-password`,"aria-label":o}),t[2]=o,t[3]=a,t[4]=u,t[5]=d,t[6]=f,t[7]=r,t[8]=p):p=t[8];let m;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>c(Ps),t[9]=m):m=t[9];let h=s?`Hide key`:`Show key`,g=s?`Hide key`:`Show key`,_;t[10]===s?_=t[11]:(_=s?(0,G.jsx)(B.eyeOff,{}):(0,G.jsx)(B.eye,{}),t[10]=s,t[11]=_);let v;t[12]!==s||t[13]!==h||t[14]!==g||t[15]!==_?(v=(0,G.jsx)(`button`,{type:`button`,className:`input-eye`,onClick:m,"aria-label":h,"aria-pressed":s,title:g,children:_}),t[12]=s,t[13]=h,t[14]=g,t[15]=_,t[16]=v):v=t[16];let y;return t[17]!==p||t[18]!==v?(y=(0,G.jsxs)(`div`,{className:`input-wrap`,children:[p,v]}),t[17]=p,t[18]=v,t[19]=y):y=t[19],y}function Ps(e){return!e}var Fs={gemini:{badge:`G`,name:`Gemini`,sub:`Google`},anthropic:{badge:`A`,name:`Claude`,sub:`Anthropic`},openai:{badge:`O`,name:`GPT`,sub:`OpenAI`},grok:{badge:`X`,name:`Grok`,sub:`xAI`},openrouter:{badge:`R`,name:`OpenRouter`,sub:`Many models`}},Is={native:`Real-time web search built in (grounds server-side when a question needs it).`,app:`Web grounding via Wikipedia, or your own Brave/Tavily search key.`,local:`Web grounding via Wikipedia when you ask for it.`},Ls={anthropic:`sk-ant-…`,openai:`sk-…`,gemini:`AIza…`,grok:`xai-…`,openrouter:`sk-or-…`};function Rs(e){return e.split(` · `)[1]??e}function zs(){let e=(0,J.c)(52),t=(0,W.useId)(),[n]=en(),r=xt(n.provider),i=n.models[n.provider]??``,a=i||r.defaultModel,o=n.keys[n.provider]??``,[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1),d=(0,W.useRef)(0),f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=async()=>{let e=d.current+=1;u(!0);let t=await qn(sn(nn()),{tts:!1});e===d.current&&(c({llm:t.llm,model:t.model,statusCode:t.statusCode}),u(!1))},e[0]=f):f=e[0];let p=f;(0,W.useEffect)(()=>{if(r.needsKey&&!o){c(null);return}let e=setTimeout(()=>void p(),400);return()=>clearTimeout(e)},[n.provider,a,o,p,r.needsKey]);let m=!!s?.llm&&!!s?.model&&!!a,h=l?`checking`:m?`ok`:`warn`,g=l?`Checking…`:r.needsKey&&!o?`Add your API key.`:a?m?`Looks good.`:s?.llm?`Reachable, but the model was not found.`:s?.statusCode===401?`Invalid API key.`:s?.statusCode===403?`Key lacks permission.`:s?.statusCode===404?`Model not found.`:s?.statusCode===void 0?`Not reachable.`:`Error ${s.statusCode}.`:`Choose a model.`,_=m?`Kept in memory unless you choose Remember; sent through this deployment to ${Rs(r.label)} when used.`:``,v;e[1]===n.provider?v=e[2]:(v=St.map(e=>{let t=Fs[e.id],r=e.id===n.provider;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,className:`provider-tile`+(r?` is-selected`:``),onClick:()=>on({provider:e.id}),children:[(0,G.jsx)(`span`,{className:`provider-badge`,children:t.badge}),(0,G.jsx)(`span`,{className:`provider-name`,children:t.name}),(0,G.jsx)(`span`,{className:`provider-sub`,children:t.sub})]},e.id)}),e[1]=n.provider,e[2]=v);let y;e[3]===v?y=e[4]:(y=(0,G.jsx)(`div`,{className:`provider-tiles`,role:`radiogroup`,"aria-label":`Provider`,children:v}),e[3]=v,e[4]=y);let b;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,G.jsx)(`p`,{className:`field-helper`,children:`When a default model is offered, start there for faster, lower-cost use and move up only when a task needs it. Requests pass through this deployment to the provider, whose usage charges, privacy, and retention terms apply.`}),e[5]=b):b=e[5];let x;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,G.jsx)(`span`,{className:`field-head`,children:(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Model`})}),e[6]=x):x=e[6];let S;e[7]===n.provider?S=e[8]:(S=e=>$t(n.provider,`model`,e),e[7]=n.provider,e[8]=S);let C;e[9]!==n.provider||e[10]!==i||e[11]!==S?(C=(0,G.jsx)(En,{provider:n.provider,value:i,onChange:S},n.provider),e[9]=n.provider,e[10]=i,e[11]=S,e[12]=C):C=e[12];let w;e[13]!==r.modelNotes||e[14]!==a?(w=r.modelNotes?.[a]&&(0,G.jsx)(`span`,{className:`field-helper`,children:r.modelNotes[a]}),e[13]=r.modelNotes,e[14]=a,e[15]=w):w=e[15];let T=Is[r.search],E;e[16]===T?E=e[17]:(E=(0,G.jsx)(`span`,{className:`field-helper`,children:T}),e[16]=T,e[17]=E);let D;e[18]!==C||e[19]!==w||e[20]!==E?(D=(0,G.jsxs)(`div`,{className:`field-col`,children:[x,C,w,E]}),e[18]=C,e[19]=w,e[20]=E,e[21]=D):D=e[21];let O;e[22]!==n.provider||e[23]!==r.keyUrl||e[24]!==r.needsKey||e[25]!==o||e[26]!==t?(O=r.needsKey&&(0,G.jsxs)(`label`,{className:`field-col`,htmlFor:t,children:[(0,G.jsx)(`span`,{className:`field-head`,children:(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`API key`})}),(0,G.jsx)(Ns,{id:t,value:o,onChange:e=>$t(n.provider,`key`,e),placeholder:Ls[n.provider]??`paste your key`,ariaLabel:`API key`}),r.keyUrl&&(0,G.jsx)(`a`,{className:`field-helper field-helper-link`,href:r.keyUrl,target:`_blank`,rel:`noreferrer noopener`,children:`Get a key↗`}),(0,G.jsx)(`span`,{className:`field-helper`,children:`Tip: use a restricted, spend-capped key — if it's ever exposed, the cost and access stay bounded.`})]}),e[22]=n.provider,e[23]=r.keyUrl,e[24]=r.needsKey,e[25]=o,e[26]=t,e[27]=O):O=e[27];let k;e[28]!==D||e[29]!==O?(k=(0,G.jsxs)(`div`,{className:`field-grid`,children:[D,O]}),e[28]=D,e[29]=O,e[30]=k):k=e[30];let A=`status-strip `+h,j;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,G.jsx)(`span`,{className:`status-strip-dot`,"aria-hidden":!0}),e[31]=j):j=e[31];let M;e[32]===g?M=e[33]:(M=(0,G.jsx)(`strong`,{children:g}),e[32]=g,e[33]=M);let N=_&&` `+_,P;e[34]!==M||e[35]!==N?(P=(0,G.jsxs)(`span`,{className:`status-strip-text`,children:[M,N]}),e[34]=M,e[35]=N,e[36]=P):P=e[36];let F;e[37]===p?F=e[38]:(F=(0,G.jsx)(`button`,{type:`button`,className:`status-strip-test`,onClick:()=>void p(),title:`Re-check the connection`,children:`Test`}),e[37]=p,e[38]=F);let I;e[39]!==A||e[40]!==P||e[41]!==F?(I=(0,G.jsxs)(`div`,{className:A,children:[j,P,F]}),e[39]=A,e[40]=P,e[41]=F,e[42]=I):I=e[42];let L;e[43]!==n.rememberKey||e[44]!==r.needsKey?(L=r.needsKey&&(0,G.jsx)(js,{label:`Remember this key on this device`,on:n.rememberKey,onToggle:()=>on({rememberKey:!n.rememberKey}),note:n.rememberKey?`Saved encrypted in this browser; use only on a trusted device.`:`Kept in memory only, cleared when you reload.`}),e[43]=n.rememberKey,e[44]=r.needsKey,e[45]=L):L=e[45];let R;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,G.jsx)(xn,{}),e[46]=R):R=e[46];let z;return e[47]!==k||e[48]!==I||e[49]!==y||e[50]!==L?(z=(0,G.jsxs)(`div`,{className:`step-body`,children:[y,b,k,I,L,R]}),e[47]=k,e[48]=I,e[49]=y,e[50]=L,e[51]=z):z=e[51],z}function Bs(){let e=(0,J.c)(19),[t]=en(),n=Zt(t.provider).capabilities,r=t.searchMode===`off`?`Answers from the model's own knowledge — no web calls.`:n.nativeWebSearch?`Grounds fresh asks in live web results with citations, only when a question needs it.`:`This model has no built-in search, so Real-time won't ground anything right now. Works only if your model supports it — pick one that does (Gemini or OpenRouter), or leave this off.`,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Web search`}),e[0]=i):i=e[0];let a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=[{value:`off`,label:`Off`,sub:`model knowledge`},{value:`realtime`,label:`Real-time`,sub:`live sources`}],e[1]=a):a=e[1];let o;e[2]===t.searchMode?o=e[3]:(o=(0,G.jsx)(Ms,{ariaLabel:`Web search`,value:t.searchMode,onPick:Z,options:a}),e[2]=t.searchMode,e[3]=o);let s;e[4]===r?s=e[5]:(s=(0,G.jsx)(`p`,{className:`field-helper`,children:r}),e[4]=r,e[5]=s);let c;e[6]!==o||e[7]!==s?(c=(0,G.jsxs)(`div`,{className:`field-block`,children:[i,o,s]}),e[6]=o,e[7]=s,e[8]=c):c=e[8];let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Answer quality`}),e[9]=l):l=e[9];let u;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=[{value:`fast`,label:`Fast`,sub:`quickest`},{value:`balanced`,label:`Balanced`,sub:`default`},{value:`thorough`,label:`Thorough`,sub:`thinks more`}],e[10]=u):u=e[10];let d;e[11]===t.quality?d=e[12]:(d=(0,G.jsx)(Ms,{ariaLabel:`Answer quality`,value:t.quality,onPick:X,options:u}),e[11]=t.quality,e[12]=d);let f;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsx)(`p`,{className:`field-helper`,children:`Fast keeps replies snappy; Thorough lets the model think more on hard questions.`}),e[13]=f):f=e[13];let p;e[14]===d?p=e[15]:(p=(0,G.jsxs)(`div`,{className:`field-block`,children:[l,d,f]}),e[14]=d,e[15]=p);let m;return e[16]!==c||e[17]!==p?(m=(0,G.jsxs)(`div`,{className:`step-body`,children:[c,p]}),e[16]=c,e[17]=p,e[18]=m):m=e[18],m}function X(e){return on({quality:e})}function Z(e){return on({searchMode:e})}function Vs(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Hs(e){let t=je(e);if(t){Fe(`mavea`,t.kokoro);try{localStorage.setItem(Pe,e)}catch{}}}function Us(e){let t=(0,J.c)(20),{label:n,value:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=e=>{i(e),Hs(e);let t=je(e);t&&Cn(t)},t[2]=i,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Le.map(Ws),t[4]=s):s=t[4];let c;t[5]!==n||t[6]!==o||t[7]!==r?(c=(0,G.jsx)(Jn,{ariaLabel:n,value:r,onChange:o,options:s}),t[5]=n,t[6]=o,t[7]=r,t[8]=c):c=t[8];let l;t[9]===r?l=t[10]:(l=()=>{let e=je(r);e&&Cn(e)},t[9]=r,t[10]=l);let u;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(B.play,{}),t[11]=u):u=t[11];let d;t[12]===l?d=t[13]:(d=(0,G.jsx)(`button`,{type:`button`,className:`voice-play`,onClick:l,"aria-label":`Preview Mavéa's voice`,title:`Preview voice`,children:u}),t[12]=l,t[13]=d);let f;t[14]!==c||t[15]!==d?(f=(0,G.jsxs)(`div`,{className:`voice-row`,children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16];let p;return t[17]!==a||t[18]!==f?(p=(0,G.jsxs)(`div`,{className:`voice-col`,children:[a,f]}),t[17]=a,t[18]=f,t[19]=p):p=t[19],p}function Ws(e){return{value:e.id,label:e.label,note:e.tone}}function Gs(){let e=(0,J.c)(16),[t]=en(),n=bn(),[r,i]=(0,W.useState)(Js),a;e[0]===t.memoryEnabled?a=e[1]:(a=()=>on({memoryEnabled:!t.memoryEnabled}),e[0]=t.memoryEnabled,e[1]=a);let o;e[2]!==t.memoryEnabled||e[3]!==a?(o=(0,G.jsx)(js,{label:`Remember me`,on:t.memoryEnabled,onToggle:a,note:`Durable facts about you, kept on this device only, to personalize future chats.`}),e[2]=t.memoryEnabled,e[3]=a,e[4]=o):o=e[4];let s;e[5]!==t.memoryEnabled||e[6]!==n?(s=t.memoryEnabled&&(0,G.jsxs)(`div`,{className:`memory-panel`,children:[(0,G.jsxs)(`div`,{className:`memory-head`,children:[(0,G.jsxs)(`span`,{className:`card-eyebrow`,children:[`What Mavéa remembers (`,n.length,` `,n.length===1?`concept`:`concepts`,`)`]}),n.length>0&&(0,G.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:qs,children:`Forget all`})]}),n.length===0?(0,G.jsx)(`p`,{className:`memory-empty`,children:`Nothing yet — Mavéa will note useful facts as you talk.`}):(0,G.jsx)(`ul`,{className:`memory-list`,children:n.map(Ks)})]}),e[5]=t.memoryEnabled,e[6]=n,e[7]=s):s=e[7];let c;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsx)(`hr`,{className:`setup-divider`}),e[8]=c):c=e[8];let l;e[9]===r?l=e[10]:(l=(0,G.jsx)(`div`,{className:`voice-grid`,children:(0,G.jsx)(Us,{label:`Mavéa speaks as`,value:r,onChange:i})}),e[9]=r,e[10]=l);let u;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(Dn,{}),e[11]=u):u=e[11];let d;return e[12]!==o||e[13]!==s||e[14]!==l?(d=(0,G.jsxs)(`div`,{className:`step-body`,children:[o,s,c,l,u]}),e[12]=o,e[13]=s,e[14]=l,e[15]=d):d=e[15],d}function Ks(e){return(0,G.jsxs)(`li`,{className:`memory-fact`,children:[(0,G.jsx)(`span`,{className:`memory-fact-concept`,children:e.concept}),(0,G.jsx)(`span`,{className:`memory-fact-text`,children:e.body}),(0,G.jsx)(`button`,{type:`button`,className:`memory-x`,onClick:()=>Nn(e.id),"aria-label":`Forget: ${e.concept}`,title:`Forget this`,children:(0,G.jsx)(B.x,{})})]},e.id)}function qs(){return Mn()}function Js(){return Vs(Pe,Ae)}var Ys=[{kicker:`Build`,accent:`var(--presence)`,prompt:`Build me a budget for a $5,000 month`},{kicker:`Decide`,accent:`var(--insight)`,prompt:`Should I take the train or fly to Boston?`},{kicker:`Understand`,accent:`var(--warning)`,prompt:`How does refinancing actually work?`},{kicker:`Plan`,accent:`var(--danger)`,prompt:`Three days in Tokyo, food first`}];function Xs({onStart:e}){return(0,G.jsx)(`div`,{className:`starter-grid`,role:`list`,children:Ys.map(t=>(0,G.jsxs)(`button`,{type:`button`,className:`starter-chip`,style:{"--starter-accent":t.accent},onClick:()=>e(t.prompt),children:[(0,G.jsxs)(`span`,{className:`starter-kicker`,children:[(0,G.jsx)(`span`,{"aria-hidden":!0,children:`✦`}),` `,t.kicker]}),(0,G.jsx)(`span`,{className:`starter-copy`,children:t.prompt})]},t.kicker))})}function Zs(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Qs(e,t){return je(Zs(e,t))?.label??`Voice`}var $s={fast:`Fast — snappy & cheap`,balanced:`Balanced — the default`,thorough:`Thorough — deeper thinking`};function ec(e){let t=(0,J.c)(55),{onJump:n,onStart:r,onStartTalking:i,onStartOver:a,onSeeHow:o,studySlot:s,librarySlot:c,launcherSlot:l}=e,[u]=en(),d=bn(),f=yn(),p,m;if(t[0]!==u.models||t[1]!==u.provider){let e=xt(u.provider);p=u.models[u.provider]||e.defaultModel,m=e.label.split(` · `)[1]??(e.needsKey?e.label:`Local`),t[0]=u.models,t[1]=u.provider,t[2]=p,t[3]=m}else p=t[2],m=t[3];let h=m,g;t[4]===u?g=t[5]:(g=an(u),t[4]=u,t[5]=g);let _=g,v=u.searchMode===`off`?`Off`:`Real-time`,y=u.memoryEnabled?`${d.length} ${d.length===1?`concept`:`concepts`} · this device only`:`Off`,b=`${p} · ${h}`,x;t[6]===b?x=t[7]:(x={key:`model`,label:`Model`,value:b,step:`connect`},t[6]=b,t[7]=x);let S;t[8]===v?S=t[9]:(S={key:`search`,label:`Web search`,value:v,step:`think`},t[8]=v,t[9]=S);let C=$s[u.quality]??u.quality,w;t[10]===C?w=t[11]:(w={key:`quality`,label:`Quality`,value:C,step:`think`},t[10]=C,t[11]=w);let T;t[12]===y?T=t[13]:(T={key:`memory`,label:`Memory`,value:y,step:`remember`},t[12]=y,t[13]=T);let E;t[14]===f?E=t[15]:(E=f===!1?`Off — captions only (voice needs the local TTS service)`:Qs(Pe,Ae),t[14]=f,t[15]=E);let D;t[16]===E?D=t[17]:(D={key:`voice`,label:`Voice`,value:E,step:`remember`},t[16]=E,t[17]=D);let O;t[18]!==D||t[19]!==x||t[20]!==S||t[21]!==w||t[22]!==T?(O=[x,S,w,T,D],t[18]=D,t[19]=x,t[20]=S,t[21]=w,t[22]=T,t[23]=O):O=t[23];let k=O,A;t[24]!==n||t[25]!==k?(A=(0,G.jsx)(`ul`,{className:`checklist`,children:k.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,className:`check-row`,onClick:()=>n(e.step),children:[(0,G.jsx)(`span`,{className:`check-mark`,"aria-hidden":!0,children:(0,G.jsx)(B.check,{})}),(0,G.jsx)(`span`,{className:`check-label`,children:e.label}),(0,G.jsx)(`span`,{className:`check-value`,children:e.value})]})},e.key))}),t[24]=n,t[25]=k,t[26]=A):A=t[26];let j;t[27]!==_||t[28]!==n||t[29]!==i?(j=_?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ke,{kind:`voice-data`,from:`live`,className:`go-voice-notice`}),(0,G.jsxs)(`button`,{type:`button`,className:`go-start`,onClick:i,children:[(0,G.jsx)(B.mic,{}),` Start talking`]})]}):(0,G.jsxs)(`button`,{type:`button`,className:`go-start go-start--gated`,onClick:()=>n(`connect`),title:`Add a model and a key on the Connect step first`,children:[(0,G.jsx)(B.mic,{}),` Connect a model to start`]}),t[27]=_,t[28]=n,t[29]=i,t[30]=j):j=t[30];let M;t[31]===a?M=t[32]:(M=(0,G.jsx)(`div`,{className:`go-ghosts`,children:(0,G.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:a,children:`Start over`})}),t[31]=a,t[32]=M);let N;t[33]!==A||t[34]!==j||t[35]!==M?(N=(0,G.jsxs)(`div`,{className:`go-left`,children:[A,j,M]}),t[33]=A,t[34]=j,t[35]=M,t[36]=N):N=t[36];let P;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Or start with one`}),t[37]=P):P=t[37];let F;t[38]===o?F=t[39]:(F=o&&(0,G.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:o,children:`See how it works`}),t[38]=o,t[39]=F);let I;t[40]===F?I=t[41]:(I=(0,G.jsxs)(`div`,{className:`try-head`,children:[P,F]}),t[40]=F,t[41]=I);let L;t[42]===r?L=t[43]:(L=(0,G.jsx)(Xs,{onStart:r}),t[42]=r,t[43]=L);let R;t[44]!==I||t[45]!==L?(R=(0,G.jsxs)(`div`,{className:`go-right`,children:[I,L]}),t[44]=I,t[45]=L,t[46]=R):R=t[46];let z;t[47]===c?z=t[48]:(z=c&&(0,G.jsx)(`div`,{className:`go-library`,children:c}),t[47]=c,t[48]=z);let ee;return t[49]!==l||t[50]!==s||t[51]!==N||t[52]!==R||t[53]!==z?(ee=(0,G.jsxs)(`div`,{className:`step-body go-grid`,children:[N,R,l,s,z]}),t[49]=l,t[50]=s,t[51]=N,t[52]=R,t[53]=z,t[54]=ee):ee=t[54],ee}function tc({speak:e,goDemo:t,onStart:n,onStartTalking:r,onSeeHow:i,studySlot:a,librarySlot:o,launcherSlot:s,paletteSlot:c,seed:l}){let u=(0,W.useRef)(!xs()),d=(0,W.useRef)(!1),[f,p]=(0,W.useState)(u.current?`connect`:`go`),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(``),v=(0,W.useRef)(l??``),[y,b]=(0,W.useState)(!u.current),x=!u.current||y;(0,W.useEffect)(()=>{if(f!==`go`)return;b(!0),u.current&&Ss();let t=v.current;if(t){v.current=``,n(t);return}d.current||(d.current=!0,e(u.current?`I’m awake.`:ys(new Date().getHours())))},[f,e,n]),(0,W.useEffect)(()=>{let e=document.documentElement;return e.dataset.wizardStep=f,()=>{delete e.dataset.wizardStep}},[f]);let S=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=S.current;if(!e)return;let t=document.documentElement,n=0,r=()=>{n=0,t.style.setProperty(`--wiz-scroll`,String(Math.min(1,e.scrollTop/130)))},i=()=>{n||=requestAnimationFrame(r)};return e.addEventListener(`scroll`,i,{passive:!0}),r(),()=>{e.removeEventListener(`scroll`,i),n&&cancelAnimationFrame(n),t.style.removeProperty(`--wiz-scroll`)}},[f]);let C=e=>{h(x&&e!==`go`),p(e),e!==`go`&&_(``)},w=()=>{C(m?`go`:Os(f)??`go`)},T=()=>{(typeof window>`u`||window.confirm(`Start over? This clears your saved setup and replays the intro.`))&&(Qt(),Cs(),Dt(),u.current=!0,d.current=!1,b(!1),h(!1),p(`connect`))},E=ws.findIndex(e=>e.id===f),D=new Set(ws.filter((e,t)=>x?e.id!==f:t<E).map(e=>e.id)),O=ks(f),k=f===`go`,A=k&&u.current?Ts:O.title,j=k&&u.current?Es:O.sub;return(0,G.jsxs)(`div`,{className:`setup stage`,"data-active":`1`,children:[(0,G.jsxs)(`header`,{className:`setup-nav`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`setup-back`,onClick:t,children:[(0,G.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to the demo`]}),(0,G.jsx)(As,{current:f,done:D,onPick:C}),(0,G.jsxs)(`div`,{className:`setup-nav-end`,children:[c,(0,G.jsx)(Kn,{triggerClassName:`setup-icon-btn`})]})]}),(0,G.jsxs)(`div`,{className:`setup-stage`,ref:S,children:[(0,G.jsxs)(`div`,{className:`setup-head`,children:[(0,G.jsx)(`h1`,{className:`setup-q`,children:A}),(0,G.jsx)(`p`,{className:`setup-sub`,children:j})]}),(0,G.jsxs)(`section`,{className:`card reveal setup-card`+(k?` setup-card--wide`:``),"aria-label":O.label,children:[f===`connect`&&(0,G.jsx)(zs,{}),f===`think`&&(0,G.jsx)(Bs,{}),f===`remember`&&(0,G.jsx)(Gs,{}),k&&(0,G.jsx)(ec,{onJump:C,onStart:n,onStartTalking:r,onStartOver:T,onSeeHow:i,studySlot:a,librarySlot:o,launcherSlot:s}),!k&&(0,G.jsxs)(`footer`,{className:`setup-foot`,children:[(0,G.jsx)(`span`,{className:`setup-foot-note`,children:`Changes save as you make them.`}),(0,G.jsxs)(`button`,{type:`button`,className:`setup-done`,onClick:w,children:[`Done `,(0,G.jsx)(B.check,{})]})]})]},f)]}),k&&(0,G.jsx)(`div`,{className:`go-composer`,children:(0,G.jsxs)(`div`,{className:`go-composer-inner`,children:[(0,G.jsx)(`input`,{className:`go-composer-input`,type:`text`,placeholder:`Say it or type it. Try ‘plan a trip’ or ‘compare two options’…`,value:g,autoComplete:`off`,spellCheck:!1,onChange:e=>_(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&g.trim()&&n(g.trim())}}),g.trim()?(0,G.jsx)(`button`,{type:`button`,className:`go-composer-send`,"aria-label":`Send`,onClick:()=>n(g.trim()),children:(0,G.jsx)(B.send,{})}):(0,G.jsx)(`button`,{type:`button`,className:`go-composer-mic`,"aria-label":`Use microphone`,onClick:r,children:(0,G.jsx)(B.mic,{})})]})})]})}function nc({mode:e,onChange:t,pttKey:n,pttSide:r}){let[i,a]=(0,W.useState)(!1),o=(0,W.useRef)(null),s=(0,W.useRef)(null),c=(0,W.useCallback)(()=>{a(!1),s.current?.focus()},[]);(0,W.useEffect)(()=>{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)},t=e=>{e.key===`Escape`&&c()};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[i,c]);let l=vn(n||`Alt`,r),u=e=>{t(e),c()},d=[{key:`tap`,title:`Tap`,blurb:`Tap once, then tap again to send`,checked:e===`tap`,onClick:()=>u(`tap`)},{key:`always`,title:`Always on`,blurb:`Hands-free — listens for any speech`,checked:e===`always`,onClick:()=>u(`always`)},{key:`hold`,title:`Hold ${l}`,blurb:`Hold the mic or ${l} to talk`,checked:e===`hold`,onClick:()=>u(`hold`)}];return(0,G.jsxs)(`div`,{className:`mic-mode-pop-root`,ref:o,children:[(0,G.jsx)(`button`,{type:`button`,className:`mic-mode-chevron`,ref:s,onClick:()=>a(e=>!e),"aria-expanded":i,"aria-haspopup":`menu`,"aria-label":`Mic mode`,title:`Mic mode`,children:(0,G.jsx)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M6 9l6 6 6-6`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),i&&(0,G.jsx)(`div`,{className:`mic-mode-pop`,role:`menu`,"aria-label":`Mic mode`,children:d.map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.checked,className:`more-menu-row mic-mode-row`,onClick:e.onClick,children:[(0,G.jsx)(`span`,{className:`more-menu-name`,children:e.title}),(0,G.jsx)(`span`,{className:`more-menu-blurb`,children:e.blurb}),e.checked&&(0,G.jsx)(B.check,{className:`mic-mode-row-check`,"aria-hidden":`true`})]},e.key))})]})}function rc(e,t){e.documentElement.dataset.presenceStyle=t}function ic(e){delete e.documentElement.dataset.presenceStyle}var ac=/(photo|image|carousel|mood|palette|video|map|diagram|story|slide|verse)/,oc=/(chart|table|matrix|grid|stat|kpi|code|pipeline|timeline|kanban|roadmap|process|flow|tree|schema|heatmap|scatter|bars|donut|gauge|checks|network|sankey)/;function sc(e,t){return!!(e?.blocks)?.some(e=>t.test(String(e.type).toLowerCase()))}function cc({status:e,interjecting:t=!1,spec:n}){if(e===`thinking`)return`bead`;if(t)return`pip`;let r=Ua(n);return r===`warm`?`pip`:r===`concerned`?`hybrid`:sc(n,ac)?`aura`:sc(n,oc)?`bead`:`hybrid`}var lc=6e3;function uc({dashboardId:e,dashboardTitle:t,onDismiss:n}){let r=(0,W.useRef)(n);return r.current=n,(0,W.useEffect)(()=>{let e=setTimeout(()=>r.current(),lc);return()=>clearTimeout(e)},[e]),(0,G.jsxs)(`div`,{className:`cards-pill dash-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(B.check,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text dash-pill-text`,children:[`Added to `,(0,G.jsx)(`strong`,{children:t})]}),(0,G.jsxs)(`a`,{className:`cards-pill-btn cards-pill-primary`,href:Yn.detail(e),onClick:n,children:[`Open `,(0,G.jsx)(B.chevR,{})]})]})}var dc={strong:`Strong evidence`,partial:`Partial evidence`,inferred:`Inferred`,unverified:`Unverified`},fc={strong:3,partial:2,inferred:1,unverified:1};function pc(e){let t=(0,J.c)(3),{count:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`i`,{className:`prov-dot`,"aria-hidden":`true`}),t[0]=r):r=t[0];let i=n==null?`Inferred`:`${n} ${n===1?`claim`:`claims`} inferred`,a;return t[1]===i?a=t[2]:(a=(0,G.jsxs)(`span`,{className:`prov-inferred`,children:[r,i]}),t[1]=i,t[2]=a),a}function mc(e){let t=(0,J.c)(8),{level:n,title:r}=e,i=fc[n],a=`prov-pill `+n,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[0,1,2],t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=(0,G.jsx)(`span`,{className:`prov-bars`,"aria-hidden":`true`,children:o.map(e=>(0,G.jsx)(`i`,{className:e<i?`on`:``},e))}),t[1]=i,t[2]=s);let c=dc[n],l;return t[3]!==a||t[4]!==s||t[5]!==c||t[6]!==r?(l=(0,G.jsxs)(`span`,{className:a,title:r,children:[s,c]}),t[3]=a,t[4]=s,t[5]=c,t[6]=r,t[7]=l):l=t[7],l}function hc({sources:e,hosts:t=!1,className:n}){return e.length?(0,G.jsxs)(`div`,{className:`grounded-in`+(n?` ${n}`:``),children:[(0,G.jsx)(`span`,{className:`grounded-in-label`,children:`Grounded in`}),(0,G.jsx)(`ul`,{children:e.map((e,n)=>{let r=H(e.url),i=t?ve(e.url):null;return(0,G.jsxs)(`li`,{children:[r?(0,G.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,children:e.title}):(0,G.jsx)(`span`,{className:`grounded-in-name`,children:e.title}),i&&(0,G.jsx)(`span`,{className:`grounded-in-host`,children:i})]},n)})})]}):null}var gc=(e,t,n)=>`block:${e}:${t}${n===void 0?``:`@${n}`}`,_c=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,40)||`value`;function vc(e){let t=[];switch(e.type){case`chart`:{let{labels:n,series:r,unit:i}=e.props;for(let e of r)e.data.forEach((r,a)=>{let o=n[a];o===void 0||!Number.isFinite(r)||t.push({key:`${_c(e.name)}-${_c(o)}`,label:`${e.name} · ${o}`,value:r,...i===void 0?{}:{unit:i},at:o})});return t}case`breakdown`:for(let n of e.props.rows)Number.isFinite(n.pct)&&t.push({key:_c(n.name),label:n.name,value:n.pct,unit:`%`});return t;case`kpi`:for(let n of e.props.kpis){let e=ft(n.val);e&&t.push({key:_c(n.label),label:n.label,value:e.value,...e.kind===`pct`?{unit:`%`}:{}})}return t;case`ring`:for(let n of e.props.rings){let e=ft(n.display);e&&t.push({key:_c(n.label),label:n.label,value:e.value,...n.unit===void 0?e.kind===`pct`?{unit:`%`}:{}:{unit:n.unit}})}return t;default:return t}}function yc(e,t){let n=e.props,r=n.title??n.eyebrow;return r===void 0?null:{id:`block:${t}`,label:r,role:`measure`}}function bc(e,t=``){let n=Vn(t),r=t.split(/(?<=[.!?])\s+|\n+/).map(e=>e.trim()).filter(Boolean),i=e.sources?.[0]?.url?Hn(e.sources[0].url):void 0,a=[],o=[],s=new Map,c=[];return e.blocks.forEach((e,t)=>{let l=vc(e);if(l.length===0)return;let u=yc(e,t);if(u){a.push(u);for(let e of l){let a=gc(t,e.key,e.at);if(s.has(a))continue;let l=r.find(t=>pt(e.value,t)&&n(t)),d=l===void 0?void 0:{quote:l,...i===void 0?{}:{host:i}},f=Zn(a,e.label,e.value,d?`T2`:`T3`,e.unit,d,d===void 0,e.at);f&&(s.set(a,f),c.push({valueId:a,surface:`block`,id:u.id,label:u.label}),o.push({valueId:a,entityId:u.id,...e.at===void 0?{}:{at:e.at}}))}}}),{title:e.title,entities:a,relations:[],facts:o,trust:Qn(s,c)}}function xc({open:e,onClose:t,claim:n,conf:r,sources:i,hadFiles:a=!1,blocks:o}){(0,W.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]);let s=(0,W.useMemo)(()=>{if(!o?.length)return[];let e=i.map(e=>e.snippet??``).filter(Boolean).join(`
19
19
  `),t=bc({title:n,blocks:[...o],sources:i},e);return t.facts.flatMap(e=>{let n=t.trust.values.get(e.valueId);return n===void 0||he(n)===null?[]:[n]})},[o,n,i]),c=s.filter(e=>e.kind===`grounded`).length,l=i.length?`How sure Mavéa is, based on these sources`:a?`How sure Mavéa is, based on your files`:se;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`scrim`+(e?` show`:``),role:`presentation`,onClick:t,style:{pointerEvents:e?`auto`:`none`}}),(0,G.jsxs)(`aside`,{className:`drawer`+(e?` show`:``),"aria-hidden":!e,inert:!e,children:[(0,G.jsx)(`button`,{className:`drawer-x`,onClick:t,"aria-label":`Close evidence`,children:(0,G.jsx)(B.x,{})}),(0,G.jsxs)(`div`,{className:`drawer-head`,children:[(0,G.jsxs)(`div`,{className:`drawer-eyebrow`,children:[(0,G.jsx)(B.shield,{style:{width:14,height:14}}),` Where this came from`]}),(0,G.jsx)(`div`,{className:`drawer-claim`,children:n})]}),(0,G.jsxs)(`div`,{className:`drawer-body`,children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`var(--text-secondary)`},children:[(0,G.jsx)(mc,{level:r||`inferred`,title:l}),i.length>0?(0,G.jsxs)(`span`,{children:[`· grounded in `,i.length,` live source`,i.length===1?``:`s`]}):a?(0,G.jsx)(`span`,{children:`· based on your attached files`}):(0,G.jsx)(`span`,{children:`· from the model's own knowledge`})]}),i.length>0&&(0,G.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`grid`,gap:8},"aria-label":`Sources`,children:i.map((e,t)=>{let n=H(e.url);return n?(0,G.jsx)(`li`,{children:(0,G.jsxs)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`evidence-block evidence-src`,children:[(0,G.jsxs)(`div`,{className:`evidence-top`,children:[(0,G.jsxs)(`span`,{className:`evidence-file`,children:[(0,G.jsx)(B.globe,{style:{width:16,height:16}}),e.title]}),(0,G.jsx)(`span`,{className:`evidence-loc`,children:ve(e.url)??e.url}),(0,G.jsx)(B.external,{style:{width:14,height:14,flex:`0 0 auto`}})]}),e.snippet&&(0,G.jsx)(`div`,{className:`evidence-quote`,children:e.snippet})]})},t):null})}),s.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`drawer-eyebrow`,children:[(0,G.jsx)(B.chart,{style:{width:14,height:14}}),` The figures in this answer`]}),(0,G.jsx)(`p`,{className:`evidence-note`,children:c===0?`None of these is stated by a source — they are the model's own.`:`${c} of ${s.length} ${c===1?`is`:`are`} stated by a source you can read below.`}),(0,G.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`grid`,gap:8},"aria-label":`Figures in this answer`,children:s.map(e=>(0,G.jsxs)(`li`,{className:`evidence-block evidence-figure`,children:[(0,G.jsxs)(`div`,{className:`evidence-top`,children:[(0,G.jsx)(`span`,{className:`evidence-file`,children:e.label}),(0,G.jsx)(`span`,{className:`evidence-fig`,children:me(e)}),(0,G.jsx)(`span`,{className:`evidence-loc`,"data-status":e.kind,children:ge[e.kind]})]}),e.kind===`grounded`?(0,G.jsx)(`div`,{className:`evidence-quote`,children:e.resolution.receipt.quote}):e.kind===`illustrative`&&e.resolution.illustrative!==`Shows the shape, not your numbers.`?(0,G.jsx)(`div`,{className:`evidence-caveat`,children:e.resolution.illustrative}):null]},e.id))})]}),(0,G.jsxs)(`div`,{className:`assumption`,children:[(0,G.jsx)(B.alert,{}),i.length>0?(0,G.jsxs)(`div`,{children:[`Mavéa summarized these sources — open them to read the originals, and treat anything labeled `,(0,G.jsx)(`b`,{children:`inferred`}),` as a best estimate, not a verified fact.`]}):a?(0,G.jsxs)(`div`,{children:[`Mavéa answered from your attached files and its own knowledge — no live sources were checked. Treat anything labeled `,(0,G.jsx)(`b`,{children:`inferred`}),` as a best estimate, not a verified fact.`]}):(0,G.jsx)(`div`,{children:`This came from the model's own knowledge — nothing here was checked against live sources or your files. Treat it as a starting point, not verified fact.`})]})]})]})]})}var Sc=new Set([`inferred`,`unverified`]);function Cc(e){let{conf:t}=e.props;return t===`strong`||t===`partial`||t===`inferred`||t===`unverified`?t:void 0}function wc(e){if(!e)return 0;let t=0,n=e=>{for(let r of e){let e=Cc(r);e&&Sc.has(e)&&t++,r.type===`composite`&&n(r.props.regions.map(e=>e.block))}};return n(e.blocks),t}function Tc(e,t=3){if(!e?.length)return[];let n=new Set,r=[];for(let i of e){let e=ve(i.url)??i.title,a=e.toLowerCase();if(!(!e||n.has(a))&&(n.add(a),r.push(e),r.length>=t))break}return r}function Ec(e){let t=(0,J.c)(15),{question:n,narration:r,sources:i,inferred:a,tint:o}=e;if(!r)return null;let s;if(t[0]!==a||t[1]!==r||t[2]!==n||t[3]!==i||t[4]!==o){let e=Tc(i),c;t[6]===o?c=t[7]:(c=o?{"--thread-tint":o}:void 0,t[6]=o,t[7]=c);let l;t[8]!==n||t[9]!==o?(l=n&&(0,G.jsxs)(`p`,{className:`hero-ask`,children:[o&&(0,G.jsx)(`span`,{className:`hero-thread-dot`,"aria-hidden":`true`}),`You asked, “`,n,`”`]}),t[8]=n,t[9]=o,t[10]=l):l=t[10];let u;t[11]===r?u=t[12]:(u=mt(r),t[11]=r,t[12]=u);let d;t[13]===u?d=t[14]:(d=(0,G.jsx)(`p`,{className:`hero-line voice-text`,children:u}),t[13]=u,t[14]=d),s=(0,G.jsxs)(`section`,{className:`answer-hero`,"aria-label":`Mavéa's answer`,style:c,children:[l,d,(e.length>0||a>0)&&(0,G.jsxs)(`p`,{className:`hero-meta`,children:[e.length>0&&(0,G.jsxs)(`span`,{className:`hero-sources`,children:[`Sources: `,e.join(` · `)]}),a>0&&(0,G.jsx)(pc,{count:a})]})]}),t[0]=a,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s}else s=t[5];return s}var Dc=1300;function Oc(e){let t=(0,J.c)(9),{onDone:n,tint:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=()=>{let e=window.setTimeout(n,Dc);return()=>window.clearTimeout(e)},a=[n],t[0]=n,t[1]=i,t[2]=a),(0,W.useEffect)(i,a);let o;t[3]===r?o=t[4]:(o=r?{"--topic-sweep-ink":r}:void 0,t[3]=r,t[4]=o);let s,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(`span`,{className:`topic-sweep-line`}),c=(0,G.jsx)(`span`,{className:`topic-sweep-label`,children:`New topic`}),t[5]=s,t[6]=c):(s=t[5],c=t[6]);let l;return t[7]===o?l=t[8]:(l=(0,G.jsxs)(`aside`,{className:`topic-sweep`,"aria-hidden":`true`,style:o,children:[s,c]}),t[7]=o,t[8]=l),l}function kc(e){return e?.track!=null&&e.track.score>=95&&(e.sources?.length??0)>0}function Ac(e,t){return ln(e)&&t.blocks.length>=4}function jc(e,t){if(!ce(e))return!1;if(!t)return!0;let n=$n(t);return n.planning||n.comparison||n.whatIf||n.decision||n.troubleshoot}function Mc(e){let t=(0,J.c)(58),{spec:n,followups:r,question:i,onAsk:a,onTrack:o,onDeepZoom:s,onCanvas:c,onSeeAll:l,threadCount:u,busy:d}=e,f;t[0]===n.sources?f=t[1]:(f=n.sources??[],t[0]=n.sources,t[1]=f);let p=f,m,h,g,_,v,y,b,x,S;if(t[2]!==d||t[3]!==r||t[4]!==a||t[5]!==c||t[6]!==s||t[7]!==l||t[8]!==o||t[9]!==i||t[10]!==p||t[11]!==n||t[12]!==u){let e=r.slice(0,12),f;t[22]!==o||t[23]!==n?(f=!!o&&kc(n),t[22]=o,t[23]=n,t[24]=f):f=t[24],v=f;let C;t[25]!==d||t[26]!==s||t[27]!==i||t[28]!==n?(C=!d&&!!s&&!!i&&Ac(i,n),t[25]=d,t[26]=s,t[27]=i,t[28]=n,t[29]=C):C=t[29],g=C;let w;t[30]!==d||t[31]!==c||t[32]!==i||t[33]!==n?(w=!d&&!!c&&jc(n,i),t[30]=d,t[31]=c,t[32]=i,t[33]=n,t[34]=w):w=t[34],h=w,_=!!l&&(u??0)>=2,m=p.length>0||e.length>0||v||g||h||_,y=`answer-footer`+(p.length>0&&e.length>0?``:` single`),b=`Sources, follow-ups, and AI disclaimer`,t[35]===p?x=t[36]:(x=p.length>0&&(0,G.jsx)(hc,{sources:p,hosts:!0,className:`footer-grounded`}),t[35]=p,t[36]=x),S=e.length>0&&(0,G.jsxs)(`div`,{className:`footer-keepgoing`,children:[(0,G.jsx)(`span`,{className:`footer-label`,children:`Keep going`}),(0,G.jsx)(`ul`,{className:`footer-list`,children:e.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,className:`kg-row`,onClick:()=>a(e.route),disabled:d,children:[(0,G.jsx)(`span`,{className:`kg-q`,children:e.label}),(0,G.jsx)(`span`,{className:`kg-arrow`,"aria-hidden":`true`,children:`→`})]})},e.label))})]}),t[2]=d,t[3]=r,t[4]=a,t[5]=c,t[6]=s,t[7]=l,t[8]=o,t[9]=i,t[10]=p,t[11]=n,t[12]=u,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S}else m=t[13],h=t[14],g=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21];let C;t[37]!==d||t[38]!==h||t[39]!==g||t[40]!==_||t[41]!==v||t[42]!==c||t[43]!==s||t[44]!==l||t[45]!==o||t[46]!==n.track?.reason||t[47]!==u?(C=(v||g||h||_)&&(0,G.jsxs)(`div`,{className:`footer-chips`,children:[_&&(0,G.jsxs)(`button`,{type:`button`,className:`footer-feature-chip is-thread`,onClick:l,title:`Bring all ${u} moments of this topic thread together onto one canvas`,children:[`See all ${u} moments`,(0,G.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),h&&(0,G.jsxs)(`button`,{type:`button`,className:`footer-feature-chip`,onClick:c,title:`Spread this answer's cards on a board you can wander — the Mavéa threads them together`,children:[`See this answer as a canvas`,(0,G.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),g&&(0,G.jsxs)(`button`,{type:`button`,className:`footer-feature-chip`,onClick:s,title:`Explore this topic level by level — from the broad field down to the mechanism`,children:[`Explore this step by step`,(0,G.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),v&&(0,G.jsxs)(`button`,{type:`button`,className:`footer-track`,onClick:o,disabled:d,title:n.track?.reason,children:[`Track this live`,(0,G.jsx)(`span`,{className:`footer-track-arrow`,"aria-hidden":`true`,children:`→`})]})]}),t[37]=d,t[38]=h,t[39]=g,t[40]=_,t[41]=v,t[42]=c,t[43]=s,t[44]=l,t[45]=o,t[46]=n.track?.reason,t[47]=u,t[48]=C):C=t[48];let w=`footer-disclaimer`+(m?``:` only`),T;t[49]===w?T=t[50]:(T=(0,G.jsx)(`p`,{className:w,children:`AI-generated; may be inaccurate, incomplete, or outdated. Verify important information. Not medical, legal, financial, or other professional advice.`}),t[49]=w,t[50]=T);let E;return t[51]!==y||t[52]!==b||t[53]!==x||t[54]!==S||t[55]!==C||t[56]!==T?(E=(0,G.jsxs)(`section`,{className:y,"aria-label":b,children:[x,S,C,T]}),t[51]=y,t[52]=b,t[53]=x,t[54]=S,t[55]=C,t[56]=T,t[57]=E):E=t[57],E}var Nc=[`Alt`,`Control`,`Shift`],Pc=[{side:`any`,label:`Either`},{side:`left`,label:`Left`},{side:`right`,label:`Right`}],Fc=typeof navigator<`u`&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),Ic={Alt:Fc?`Option (⌥)`:`Alt`,Control:Fc?`Control (⌃)`:`Ctrl`,Shift:Fc?`Shift (⇧)`:`Shift`};function Lc({children:e,holdEnabled:t,showHint:n=!0,pttKey:r,pttSide:i=`any`,onHoldStart:a,onHoldEnd:o,onChangePttKey:s,onChangePttSide:c}){Tn({enabled:t,pttKey:r,pttSide:i,onStart:a,onStop:o});let l=(0,W.useRef)(null),u=(0,W.useRef)(null),[d,f]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{let e=l.current,t=e?.closest(`.mavea-app`);if(!e||!t)return;let n=()=>t.style.setProperty(`--dock-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--dock-h`)}},[]),(0,W.useEffect)(()=>{if(!d)return;let e=e=>{u.current&&!u.current.contains(e.target)&&f(!1)},t=e=>{e.key===`Escape`&&(f(!1),u.current?.querySelector(`.dock-hint-btn`)?.focus())};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[d]),(0,G.jsxs)(`div`,{className:`live-dock dock-bar`,ref:l,children:[(0,G.jsx)(`div`,{className:`dock-main`,children:e}),t&&n&&(0,G.jsxs)(`div`,{className:`dock-hint-wrap`,ref:u,children:[(0,G.jsxs)(`button`,{type:`button`,className:`dock-hint dock-hint-btn`,onClick:()=>f(e=>!e),title:`Click to change hold-to-talk key`,children:[`Hold `,vn(r||`Alt`,i),` to talk`]}),d&&(0,G.jsxs)(`div`,{className:`dock-hint-picker`,role:`menu`,"aria-label":`Choose hold-to-talk key`,children:[(0,G.jsx)(`div`,{className:`dock-hint-row`,children:Nc.map(e=>(0,G.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":(r||`Alt`)===e,className:`dock-hint-key${(r||`Alt`)===e?` active`:``}`,title:Ic[e],onClick:()=>s?.(e),children:vn(e)},e))}),(0,G.jsx)(`div`,{className:`dock-hint-row dock-hint-sides`,children:Pc.map(({side:e,label:t})=>(0,G.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":i===e,className:`dock-hint-key${i===e?` active`:``}`,title:e===`any`?`Either side of the key`:`Only the ${t.toLowerCase()} key`,onClick:()=>c?.(e),children:t},e))})]})]})]})}var Rc=e=>e.toLowerCase().replace(/\s+/g,` `).trim();function zc(e){return Rc(`${e.question} ${e.spec.title??``} ${e.narration}`)}function Bc(e){let t=new Map;return e.forEach((n,r)=>{let i=n.corrects;if(!i)return;let a=Rc(i.what);if(a){for(let n=r-1;n>=0;n--)if(zc(e[n]).includes(a)){t.set(n,{note:i,by:r});return}}}),t}function Vc(e){if(!e)return``;try{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).formatToParts(new Date(e)).filter(e=>e.type===`hour`||e.type===`minute`||e.type===`literal`).map(e=>e.value).join(``).trim()}catch{return``}}function Hc({chapters:e,frames:t,currentIndex:n,onJump:r,onReplay:i,onOverview:a,resumed:o,chatOpen:s,onToggleChat:c,collapsed:l,onToggleCollapse:u,onOpenPast:d,onStudy:f,roomIndices:p,bookmarks:m,onToggleBookmark:h,onViewMindMap:g,onSeeTogether:_}){let v=ur(),y=e.length===0,b=(0,W.useMemo)(()=>Bc(t),[t]);return(0,G.jsxs)(`aside`,{className:`side-rail`+(s?` chat-open`:``)+(l?` is-collapsed`:``),children:[(0,G.jsxs)(`button`,{type:`button`,className:`rail-mobile-toggle`,"aria-expanded":s,onClick:c,children:[(0,G.jsx)(B.chat,{}),s?`Hide session`:`This session`]}),(0,G.jsxs)(`div`,{className:`rail-head`,children:[u&&(0,G.jsx)(`button`,{type:`button`,className:`rail-collapse`,onClick:u,"aria-expanded":!l,"aria-label":l?`Expand the session panel`:`Collapse the session panel`,title:l?`Show this session`:`Hide this session`,children:(0,G.jsx)(B.panelLeft,{})}),(0,G.jsx)(`span`,{className:`rail-title sess-title`,children:`This session`}),(i||a)&&(0,G.jsxs)(`div`,{className:`rail-head-actions`,children:[i&&(0,G.jsx)(`button`,{type:`button`,className:`rail-history rail-icon`,onClick:i,title:`Replay earlier answers`,"aria-label":`Replay earlier answers`,children:(0,G.jsx)(B.play,{})}),a&&(0,G.jsx)(`button`,{type:`button`,className:`rail-history rail-icon`,onClick:a,title:`Zoom out to the whole conversation`,"aria-label":`Conversation overview`,children:(0,G.jsx)(B.layers,{})})]})]}),u&&(0,G.jsx)(`div`,{className:`rail-collapsed-label`,"aria-hidden":`true`,children:`This session`}),(0,G.jsxs)(`div`,{className:`rail-chat sess-list`,children:[o&&(0,G.jsx)(`div`,{className:`sess-note`,role:`note`,children:`Resumed — picking back up where you left off.`}),y?(0,G.jsx)(`div`,{className:`sess-note`,children:`Topics can wander — cooking, markets, your fantasy lineup. Mavéa keeps the thread.`}):e.map(e=>(0,G.jsxs)(`div`,{className:`sess-chapter`,style:{"--ch-c":e.color},children:[(0,G.jsxs)(`div`,{className:`sess-chapter-head`,children:[(0,G.jsx)(`div`,{className:`sess-chapter-label`,title:e.title,children:e.title}),_&&e.moments.length>=2&&(0,G.jsx)(`button`,{type:`button`,className:`sess-together`,onClick:()=>_(e),title:`See all ${e.moments.length} moments of this thread together on one canvas`,"aria-label":`See all ${e.moments.length} moments of this thread together`,children:(0,G.jsx)(B.table,{})})]}),e.moments.map(e=>{let i=b.get(e.frameIndex),a=t[e.frameIndex],o=a?String(a.at):null,s=o?m?.has(o)??!1:!1;return(0,G.jsxs)(`div`,{className:`sess-row-wrap`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`sess-row`+(e.frameIndex===n?` is-current`:``)+(i?` is-corrected`:``)+(s?` is-bookmarked`:``),onClick:()=>r(e.frameIndex),"aria-current":e.frameIndex===n?`true`:void 0,title:i?`${e.question} · Corrected later — ${i.note.what}: was ${i.note.was}, now ${i.note.now}`:e.question,children:[(0,G.jsx)(`span`,{className:`sess-time`,children:Vc(a?.at)}),(0,G.jsx)(`span`,{className:`sess-q`,children:e.question}),i&&(0,G.jsx)(`span`,{className:`sess-corrected`,children:`corrected`}),p?.has(e.frameIndex)&&(0,G.jsx)(`span`,{className:`sess-room`,children:`from the room`})]}),g&&a?.mind&&(0,G.jsx)(`button`,{type:`button`,className:`sess-mapview`,onClick:t=>{t.stopPropagation(),g(e.frameIndex)},title:`See the thinking map this answer grew from`,"aria-label":`View the thinking map`,children:(0,G.jsx)(B.sparkle,{})}),h&&o&&(0,G.jsx)(`button`,{type:`button`,className:`sess-bookmark${s?` on`:``}`,onClick:e=>{e.stopPropagation(),h(o)},title:s?`Remove bookmark`:`Bookmark this moment`,"aria-pressed":s,"aria-label":s?`Remove bookmark`:`Bookmark this moment`,children:s?`★`:`☆`})]},e.frameIndex)})]},e.id))]}),(d||f&&v)&&(0,G.jsxs)(`div`,{className:`rail-foot`,children:[d&&(0,G.jsxs)(`button`,{type:`button`,className:`rail-past`,onClick:d,children:[(0,G.jsx)(B.clock,{}),(0,G.jsx)(`span`,{children:`Past conversations`})]}),f&&v&&(0,G.jsxs)(`button`,{type:`button`,className:`rail-past`,onClick:f,children:[(0,G.jsx)(B.layers,{}),(0,G.jsxs)(`span`,{children:[v.count,` card`,v.count===1?``:`s`,` ready`]})]})]})]})}function Uc(e){let{spec:t,frames:n,viewIndex:r,narration:i,lastAsk:a}=e;if(!t)return null;let o=n.length-1;if(r!=null&&r!==o){let e=n[r];if(e)return{question:Ct(e.question)||null,narration:e.narration||e.spec.title}}let s=o>=0?n[o]:void 0,c=i||s?.narration||t.title;if(!c)return null;let l=i?a??s?.question:s?.question??a;return{question:Ct(l)||null,narration:c}}function Wc(e){let t=(0,J.c)(3),n=(0,W.useRef)(null),[r,i]=(0,W.useState)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`thinking`){n.current=performance.now();return}(e===`speaking`||e===`showing`)&&n.current!==null&&(i(Math.round(performance.now()-n.current)),n.current=null)},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,W.useEffect)(a,o),r}function Gc(e){return e===null||!Number.isFinite(e)||e<0?null:e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function Kc(e){return e===`circle`?`○`:e===`point`?`→`:e===`underline`?`—`:e===`highlight`?`▬`:e===`rising`?`↗`:e===`falling`?`↘`:e===`bracket`?`⊓`:e===`note`?`✎`:e===`connect`?`⤳`:e===`strike`?`✕`:e===`question`?`?`:e===`star`?`★`:e===`check`?`✓`:e===`frame`?`▢`:e===`brace`?`{`:`✦`}function qc(e){return e===`circle`?`circles`:e===`point`?`arrow:`:e===`underline`?`underlines`:e===`highlight`?`highlights`:e===`rising`?`trend up:`:e===`falling`?`trend down:`:e===`bracket`?`brackets`:e===`note`?`notes`:e===`connect`?`connects:`:e===`strike`?`strikes out`:e===`question`?`questions`:e===`star`?`stars`:e===`check`?`checks off`:e===`frame`?`frames`:e===`brace`?`groups`:`drew on`}function Jc(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function Yc(e){if(e.kind===`connect`&&e.at&&e.to)return`${e.at} → ${e.to}`;if(e.at)return e.at;if(e.line){let t=e.line.split(/\s+/).slice(0,4).join(` `);return t.length<e.line.length?`${t}…`:t}return e.spot}function Xc(e){let t=(0,J.c)(42),{entries:n,turnStartMs:r,annotationsEnabled:i,hiddenSpots:a,onToggle:o,onKeep:s,onClear:c,onClip:l,onJumpTo:u,onToggleSpot:d}=e,f;t[0]===o?f=t[1]:(f=e=>{e.stopPropagation(),o()},t[0]=o,t[1]=f);let p=f,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(`span`,{className:`gesture-track-eyebrow`,children:`Gesture track`}),t[2]=m):m=t[2];let h=`gesture-track-toggle ${i?`on`:`off`}`,g=i?`Turn off drawing`:`Turn on drawing`,_=i?`Drawing on — tap to turn off`:`Drawing off — tap to turn on`,v;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,G.jsx)(`span`,{className:`gesture-track-toggle-icon`,children:`✦`}),t[3]=v):v=t[3];let y=i?`Pen on`:`Pen off`,b;t[4]===y?b=t[5]:(b=(0,G.jsx)(`span`,{children:y}),t[4]=y,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,G.jsx)(`span`,{className:`gesture-track-toggle-switch`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{className:`gesture-track-toggle-knob`})}),t[6]=x):x=t[6];let S;t[7]!==i||t[8]!==p||t[9]!==h||t[10]!==g||t[11]!==_||t[12]!==b?(S=(0,G.jsxs)(`div`,{className:`gesture-track-header`,children:[m,(0,G.jsxs)(`button`,{type:`button`,className:h,onClick:p,title:g,"aria-label":_,"aria-pressed":i,children:[v,b,x]})]}),t[7]=i,t[8]=p,t[9]=h,t[10]=g,t[11]=_,t[12]=b,t[13]=S):S=t[13];let C;if(t[14]!==n||t[15]!==a||t[16]!==u||t[17]!==d||t[18]!==r){let e;t[20]!==a||t[21]!==u||t[22]!==d||t[23]!==r?(e=e=>{let t=a?.has(e.spot)??!1;return(0,G.jsxs)(`li`,{className:`gesture-track-entry${t?` is-hidden`:``}`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`gesture-track-entry-btn`,onClick:()=>u?.(e.spot,e.toSpot),title:`Jump to this annotation`,children:[(0,G.jsx)(`span`,{className:`gesture-track-time`,children:Jc(e.inkedAt-r)}),(0,G.jsx)(`span`,{className:`gesture-track-icon`,"aria-hidden":`true`,children:Kc(e.kind)}),(0,G.jsxs)(`span`,{className:`gesture-track-desc`,children:[e.stepNumber&&(0,G.jsxs)(`span`,{className:`gesture-track-step`,children:[`Step `,e.stepNumber]}),(0,G.jsx)(`span`,{className:`gesture-track-verb`,children:qc(e.kind)}),` `,(0,G.jsx)(`span`,{className:`gesture-track-target`,title:Yc(e),children:Yc(e)})]})]}),d&&(0,G.jsx)(`button`,{type:`button`,className:`gesture-track-eye`,onClick:t=>{t.stopPropagation(),d(e.spot)},title:t?`Show annotation`:`Hide annotation`,"aria-pressed":t,"aria-label":t?`Show annotation`:`Hide annotation`,children:t?(0,G.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M1.5 1.5L10.5 10.5M5 5.3C5 5.3 5.4 5 6 5c.9 0 1.5.7 1.5 1.5 0 .5-.2.9-.5 1.2`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`}),(0,G.jsx)(`path`,{d:`M2 3.5C1 4.4.5 5.2.5 6s1.5 3 5.5 3c.9 0 1.7-.1 2.4-.4M10 8.5c1-1 1.5-1.8 1.5-2.5s-1.5-3-5.5-3c-.5 0-1 0-1.4.1`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`})]}):(0,G.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:[(0,G.jsx)(`ellipse`,{cx:`6`,cy:`6`,rx:`5.5`,ry:`3`,stroke:`currentColor`,strokeWidth:`1.2`}),(0,G.jsx)(`circle`,{cx:`6`,cy:`6`,r:`1.5`,fill:`currentColor`})]})})]},`${e.spot}|${e.kind??``}|${e.at??``}`)},t[20]=a,t[21]=u,t[22]=d,t[23]=r,t[24]=e):e=t[24],C=n.map(e),t[14]=n,t[15]=a,t[16]=u,t[17]=d,t[18]=r,t[19]=C}else C=t[19];let w;t[25]===C?w=t[26]:(w=(0,G.jsx)(`ol`,{className:`gesture-track-list`,"aria-label":`Drawn gestures`,children:C}),t[25]=C,t[26]=w);let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,G.jsx)(`p`,{className:`gesture-track-hint`,children:`Your blue ink, Mavéa's orange. Tap an entry to jump to it.`}),t[27]=T):T=t[27];let E;t[28]===s?E=t[29]:(E=(0,G.jsx)(`button`,{type:`button`,className:`gesture-track-btn primary`,onClick:s,children:`Keep annotations`}),t[28]=s,t[29]=E);let D;t[30]===l?D=t[31]:(D=l&&(0,G.jsx)(`button`,{type:`button`,className:`gesture-track-btn`,onClick:l,children:`Clip this moment`}),t[30]=l,t[31]=D);let O;t[32]===c?O=t[33]:(O=(0,G.jsx)(`button`,{type:`button`,className:`gesture-track-btn ghost`,onClick:c,children:`Clear`}),t[32]=c,t[33]=O);let k;t[34]!==E||t[35]!==D||t[36]!==O?(k=(0,G.jsxs)(`div`,{className:`gesture-track-actions`,children:[E,D,O]}),t[34]=E,t[35]=D,t[36]=O,t[37]=k):k=t[37];let A;return t[38]!==S||t[39]!==w||t[40]!==k?(A=(0,G.jsxs)(`div`,{className:`gesture-track`,role:`complementary`,"aria-label":`Gesture track`,children:[S,w,T,k]}),t[38]=S,t[39]=w,t[40]=k,t[41]=A):A=t[41],A}function Zc(e){let t=(0,J.c)(13),{enabled:n,open:r,inkCount:i,onClick:a}=e,o=`pen-toggle-pill ${n?`on`:`off`}${r?` open`:``}`,s=r?`Close pen panel`:`Open pen panel`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✦`}),t[0]=c):c=t[0];let l=n?`Pen on`:`Pen off`,u;t[1]===l?u=t[2]:(u=(0,G.jsx)(`span`,{children:l}),t[1]=l,t[2]=u);let d;t[3]!==i||t[4]!==r?(d=!r&&i>0&&(0,G.jsx)(`span`,{className:`pen-ink-count`,"aria-label":`${i} marks drawn`,children:i}),t[3]=i,t[4]=r,t[5]=d):d=t[5];let f;return t[6]!==a||t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==u||t[11]!==d?(f=(0,G.jsxs)(`button`,{type:`button`,className:o,onClick:a,title:s,"aria-expanded":r,"aria-haspopup":`true`,children:[c,u,d]}),t[6]=a,t[7]=r,t[8]=o,t[9]=s,t[10]=u,t[11]=d,t[12]=f):f=t[12],f}var Qc=/\b(teach me|walk me through|tutor( me)?|step[- ]by[- ]step|like i'?m (five|5|a beginner|new))\b/i;function $c(e){return!!e&&Qc.test(e)}function el(e){if(e.length===0)return``;let t=`M ${e[0].x} ${e[0].y}`;for(let n=1;n<e.length;n++)t+=` L ${e[n].x} ${e[n].y}`;return t}var tl=4,nl=2e3;function rl(e,t=tl){if(e.length<=1)return e.slice();let n=0;for(let t=1;t<e.length;t++)n+=Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y);let r=Math.max(t,n/nl),i=[e[0]];for(let t=1;t<e.length;t++){let n=e[t-1],a=e[t],o=Math.hypot(a.x-n.x,a.y-n.y),s=Math.floor(o/r);for(let e=1;e<=s;e++){let t=e*r/o;i.push({x:n.x+(a.x-n.x)*t,y:n.y+(a.y-n.y)*t})}let c=i[i.length-1];(c.x!==a.x||c.y!==a.y)&&i.push(a)}return i}function il(e){let t=0;for(let n=1;n<e.length;n++)t+=Math.hypot(e[n].x-e[n-1].x,e[n].y-e[n-1].y);return t}function al(e){if(e.length<3)return 0;let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];t+=r.x*i.y-i.x*r.y}return Math.abs(t)/2}function ol(e){let t=e[0].x,n=e[0].x,r=e[0].y,i=e[0].y;for(let a of e)a.x<t&&(t=a.x),a.x>n&&(n=a.x),a.y<r&&(r=a.y),a.y>i&&(i=a.y);return{minX:t,minY:r,maxX:n,maxY:i}}function sl(e){if(e.length<4)return!1;let{minX:t,minY:n,maxX:r,maxY:i}=ol(e),a=Math.hypot(r-t,i-n),o=il(e);if(a<10||o<10)return!1;let s=e[0],c=e[e.length-1],l=Math.hypot(c.x-s.x,c.y-s.y)<=Math.max(16,a*.35),u=al(e)>o*o*.02;return l||u}function cl(e,t){let n=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let a=t[r].x,o=t[r].y,s=t[i].x,c=t[i].y;o>e.y!=c>e.y&&e.x<(s-a)*(e.y-o)/(c-o)+a&&(n=!n)}return n}var ll=3e3;function ul(e,t=tl,n=ll){let{minX:r,minY:i,maxX:a,maxY:o}=ol(e),s=a-r,c=o-i;if(s<=0||c<=0)return[];let l=Math.max(1,Math.round(s/t))*Math.max(1,Math.round(c/t))>n?Math.sqrt(s*c/n):t,u=[];for(let t=i+l/2;t<o;t+=l)for(let i=r+l/2;i<a;i+=l){let r={x:i,y:t};if(cl(r,e)&&(u.push(r),u.length>=n))return u}return u}var dl=4,fl=4e3,pl=`input, textarea, select, button, a, summary, [contenteditable], [role="slider"], [role="tab"], [role="switch"], [draggable="true"], .block-ask, .geo-map, [data-interactive]`;function ml({armed:e,rootRef:t,onStroke:n,onTap:r,strokes:i,highlights:a}){let o=(0,W.useRef)(null),s=(0,W.useRef)(null),c=(0,W.useRef)(null),l=(0,W.useRef)([]),u=(0,W.useRef)(null),d=(0,W.useRef)(!1),f=(0,W.useRef)(!1),p=(0,W.useRef)(null),m=(0,W.useRef)(0),h=(0,W.useRef)(e);h.current=e;let g=(0,W.useRef)(n);g.current=n;let _=(0,W.useRef)(r);return _.current=r,(0,W.useEffect)(()=>{let n=t.current;if(n)return n.classList.toggle(`ink-armed`,e),()=>n.classList.remove(`ink-armed`)},[e,t]),(0,W.useEffect)(()=>{let e=t.current,n=o.current;if(!e||!n)return;let r=e=>{let t=n.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},i=()=>({stage:e,svgRect:n.getBoundingClientRect()}),a=()=>{let e=el(l.current);s.current?.setAttribute(`d`,e),c.current?.setAttribute(`d`,e)},v=()=>{s.current?.setAttribute(`d`,``),c.current?.setAttribute(`d`,``)},y=()=>{l.current=[],u.current=null,d.current=!1,f.current=!1,p.current=null},b=t=>{try{e.setPointerCapture(t)}catch{}},x=t=>{try{e.hasPointerCapture?.(t)&&e.releasePointerCapture(t)}catch{}},S=()=>{p.current!=null&&x(p.current),e.classList.remove(`ink-capturing`),y(),v()},C=()=>{document.hidden&&S()},w=e=>{if(d.current||f.current){if(performance.now()-m.current>fl)S();else return}if(!(h.current||e.pointerType===`pen`)||e.target?.closest?.(pl))return;m.current=performance.now(),d.current=!0,p.current=e.pointerId;let t=r(e);u.current=t,l.current=[t]},T=t=>{if(p.current!==t.pointerId||!d.current&&!f.current)return;let n=r(t);if(!f.current){if(Math.hypot(n.x-(u.current?.x??n.x),n.y-(u.current?.y??n.y))<dl)return;f.current=!0,b(t.pointerId),e.classList.add(`ink-capturing`)}t.preventDefault(),l.current.push(n),a()},E=t=>{if(p.current!==t.pointerId)return;let n=f.current,r=d.current,a=l.current,o=u.current;x(t.pointerId),e.classList.remove(`ink-capturing`),y(),v(),n&&a.length>=2?g.current(a,i()):r&&!n&&o&&_.current?.(o,i())},D=e=>{p.current===e.pointerId&&S()};return e.addEventListener(`pointerdown`,w),window.addEventListener(`pointermove`,T),window.addEventListener(`pointerup`,E),window.addEventListener(`pointercancel`,D),window.addEventListener(`blur`,S),document.addEventListener(`visibilitychange`,C),()=>{e.removeEventListener(`pointerdown`,w),window.removeEventListener(`pointermove`,T),window.removeEventListener(`pointerup`,E),window.removeEventListener(`pointercancel`,D),window.removeEventListener(`blur`,S),document.removeEventListener(`visibilitychange`,C),p.current!=null&&x(p.current),e.classList.remove(`ink-capturing`,`ink-armed`)}},[t]),(0,G.jsxs)(`svg`,{ref:o,className:`ink-user-overlay`,"aria-hidden":`true`,children:[a?.map((e,t)=>e.w>0&&e.h>0?(0,G.jsx)(`rect`,{className:`ink-highlight`,x:e.x,y:e.y,width:e.w,height:e.h,rx:3,ry:3},`h`+t):null),i?.map((e,t)=>(0,G.jsx)(`path`,{className:`ink-user-stroke ink-user-settled`,d:e},t)),(0,G.jsx)(`path`,{ref:c,className:`ink-user-halo`,d:``}),(0,G.jsx)(`path`,{ref:s,className:`ink-user-stroke`,d:``})]})}var hl=80,gl=`.ink-user-overlay, .ink-layer, .block-ask, .card-eyebrow`,_l=e=>{let t=e.replace(/\s+/g,` `).trim();return t.length>hl?t.slice(0,79)+`…`:t};function vl(e){return!e.data||!e.data.trim()?!1:!e.parentElement?.closest(gl)}function yl(e){if(e.min!==e.max)return[e.min,e.max];let t=e.node.data,n=e.min,r=e.min;for(;n>0&&!/\s/.test(t[n-1]);)n--;for(;r<t.length&&!/\s/.test(t[r]);)r++;return n<r?[n,r]:[e.min,e.min+1]}function bl(e,t){if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}function xl(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;t;t=t.parentElement){let e=t.getAttribute?.(`data-spot-id`);if(e)return e}return``}function Sl(e,t,n){try{let r=document.createRange(),i=e.length;r.setStart(e,Math.max(0,Math.min(t,i))),r.setEnd(e,Math.max(0,Math.min(n,i)));let a=r.getClientRects(),o=[];for(let e=0;e<a.length;e++){let t=a[e];t&&t.width>0&&t.height>0&&o.push(t)}return o}catch{return[]}}function Cl(e){let t=[...e.values()],n=e=>{let[t,n]=yl(e);return e.node.data.slice(t,n)},r=t[0];for(let e of t)(e.samples>r.samples||e.samples===r.samples&&n(e).length>n(r).length)&&(r=e);let i=[...t].sort((e,t)=>bl(e.node,t.node)),a=_l(i.map(n).filter(e=>e.trim()).join(` `));if(!a)return null;let o=[];for(let e of i){let[t,n]=yl(e);o.push(...Sl(e.node,t,n))}return{text:a,blockId:xl(r.node),rects:o}}function wl(e){let t=e.matches?.(`text, tspan`)?e:e.closest?.(`text, tspan`),n=e.closest?.(`[aria-label]`),r=[t?.textContent,n?.getAttribute(`aria-label`),e.getAttribute?.(`alt`),e.getAttribute?.(`title`)];for(let e of r)if(e?.trim())return e;return``}function Tl(e,t){if(e.length===0)return null;let n=e[Math.floor(e.length/2)];for(let e of t.elementsAt(n.x,n.y)){if(e.closest?.(gl))continue;let t=wl(e);if(t)return{text:_l(t),blockId:xl(e),rects:[e.getBoundingClientRect()]}}return null}function El(e,t){let n=new Map,r=[];for(let i of e){let e=t.caretAt(i.x,i.y);if(e&&vl(e.node)){let t=n.get(e.node);t?(e.offset<t.min&&(t.min=e.offset),e.offset>t.max&&(t.max=e.offset),t.samples++):n.set(e.node,{node:e.node,min:e.offset,max:e.offset,samples:1})}else r.push(i)}return n.size>0?Cl(n):Tl(r,t)}function Dl(e,t,n){if(e.length===0)return null;let r=e=>({x:e.x+t.left,y:e.y+t.top});if(sl(e)){let t=ul(e.map(r)),i=t.length>0?El(t,n):null;if(i)return i}let i=rl(e).map(r);return i.length===0?null:El(i,n)}var Ol=6,Q=14;function kl(e,t,n,r){try{if(e.length===0)return!1;let i=Math.min(t,e.length-1),a=document.createRange();a.setStart(e,i),a.setEnd(e,i+1);let o=a.getClientRects();if(o.length===0)return!0;for(let e=0;e<o.length;e++){let t=o[e];if(n>=t.left-Ol&&n<=t.right+Ol&&r>=t.top-Q&&r<=t.bottom+Q)return!0}return!1}catch{return!0}}function Al(e,t){let n=document,r=null,i=0;if(typeof n.caretRangeFromPoint==`function`){let a=n.caretRangeFromPoint(e,t);a&&a.startContainer.nodeType===Node.TEXT_NODE&&(r=a.startContainer,i=a.startOffset)}else if(typeof document.caretPositionFromPoint==`function`){let n=document.caretPositionFromPoint(e,t);n&&n.offsetNode.nodeType===Node.TEXT_NODE&&(r=n.offsetNode,i=n.offset)}return!r||!kl(r,i,e,t)?null:{node:r,offset:i}}var jl={caretAt:Al,elementsAt:(e,t)=>document.elementsFromPoint(e,t)};function Ml(e,t,n=jl){let r=Dl(e,t.svgRect,n);return!r||!r.text?null:{intent:{kind:`highlight`,blockIds:r.blockId?[r.blockId]:[],textAt:r.text},rects:r.rects}}function Nl(e,t){return e.map(e=>({x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}))}function Pl(e){let{onCommit:t,resetKey:n,hitTester:r}=e,[i,a]=(0,W.useState)([]),[o,s]=(0,W.useState)(0),c=(0,W.useRef)(i);c.current=i;let l=(0,W.useRef)(t);l.current=t;let u=(0,W.useCallback)((e,t,n)=>{let i=Ml(e,n,r);if(!i)return s(e=>e+1),!1;let o={intent:i.intent,stroke:t,rects:Nl(i.rects,n.svgRect)};return a(e=>[...e,o]),!0},[r]),d=(0,W.useCallback)((e,t)=>{u(e,el(e),t)},[u]),f=(0,W.useCallback)((e,t)=>{u([e,{x:e.x+1,y:e.y+1}],``,t)},[u]),p=(0,W.useCallback)(e=>{a(t=>e==null?t.slice(0,-1):t.filter((t,n)=>n!==e))},[]),m=(0,W.useCallback)(()=>{let e=c.current;e.length&&l.current(e.map(e=>e.intent)),a([])},[]),h=(0,W.useCallback)(()=>a([]),[]);(0,W.useEffect)(()=>{a([])},[n]);let g=i.map(e=>e.intent),_=i.map(e=>e.stroke).filter(Boolean),v=i.flatMap(e=>e.rects);return{phase:i.length?`pinned`:`idle`,pins:i,intents:g,strokes:_,highlights:v,miss:o,onStroke:d,onTap:f,undo:p,send:m,clear:h}}var Fl=e=>e.length>22?e.slice(0,21)+`…`:e;function Il(e){return e.textAt?`Marked “${Fl(e.textAt)}”`:`Marked`}function Ll(e){if(e.length===0)return``;let t=e[0]?.textAt?.trim(),n=t?`Tell me about “${Fl(t)}”`:`Tell me about this`;return e.length===1?n:`${n} (and ${e.length-1} more)`}function Rl(e){let t=new Set,n=[];for(let r of e)!r.id||t.has(r.id)||(t.add(r.id),n.push(r));return n}function zl(e,t){let n=new Map;for(let e of t)e.id&&n.set(e.id,e);let r=[],i=[],a=new Set;for(let t of e){let e=t.blockIds;if(!(e.length>0&&!e.every(e=>n.has(e)))){r.push(t);for(let t of e){if(a.has(t))continue;a.add(t);let e=n.get(t);e&&i.push(e)}}}return{intents:r,blocks:i}}function Bl(e){let t=(0,J.c)(15),{pins:n,onUndo:r,onSend:i}=e;if(n.length===0)return null;let a=n.length,o=a>1?`s`:``,s;t[0]!==a||t[1]!==o?(s=(0,G.jsxs)(`span`,{className:`ink-sr`,role:`status`,children:[`Highlighted `,a,` part`,o]}),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c;if(t[3]!==r||t[4]!==n){let e;t[6]===r?e=t[7]:(e=(e,t)=>(0,G.jsxs)(`span`,{className:`ink-chip`,children:[(0,G.jsx)(`span`,{className:`ink-chip-text`,children:Il(e.intent)}),(0,G.jsx)(`button`,{type:`button`,className:`ink-chip-x`,"aria-label":`Remove ${e.intent.textAt||`mark`}`,onClick:()=>r(t),children:(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`11`,height:`11`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`})})})]},t),t[6]=r,t[7]=e),c=n.map(e),t[3]=r,t[4]=n,t[5]=c}else c=t[5];let l=`Ask about the ${a} highlighted part${a>1?`s`:``}`,u;t[8]!==i||t[9]!==l?(u=(0,G.jsx)(`button`,{type:`button`,className:`ink-chip-act primary`,onClick:i,title:l,children:`Ask`}),t[8]=i,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==s||t[12]!==c||t[13]!==u?(d=(0,G.jsxs)(`div`,{className:`ink-dock`,role:`group`,"aria-label":`Highlighted parts to ask about`,children:[s,c,u]}),t[11]=s,t[12]=c,t[13]=u,t[14]=d):d=t[14],d}var Vl=`mavea-ink-hint-seen`;function Hl(){try{return localStorage.getItem(Vl)===`1`}catch{return!0}}function Ul({armed:e,pins:t,miss:n=0,onUndo:r,onSend:i}){let[a,o]=(0,W.useState)(Hl),s=!a&&!e&&t.length===0,c=e&&t.length===0,[l,u]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!n)return;u(!0);let e=setTimeout(()=>u(!1),2600);return()=>clearTimeout(e)},[n]),(0,W.useEffect)(()=>{if(!(a||!e&&t.length===0)){o(!0);try{localStorage.setItem(Vl,`1`)}catch{}}},[e,t.length,a]);let d=()=>{o(!0);try{localStorage.setItem(Vl,`1`)}catch{}},f=t.length>0;return!s&&!c&&!l&&!f?null:(0,G.jsxs)(`div`,{className:`ink-bar`+(s?` coaching`:``),children:[s&&(0,G.jsxs)(`div`,{className:`ink-coach`,role:`note`,children:[(0,G.jsx)(`span`,{className:`ink-coach-spark`,"aria-hidden":`true`,children:`✍️`}),(0,G.jsxs)(`span`,{className:`ink-coach-text`,children:[(0,G.jsx)(`strong`,{children:`Highlight to ask.`}),` Turn on `,(0,G.jsx)(`strong`,{children:`Highlight`}),`, then drag across any value, label, or card to grab it. Ask in your own words, and a pen draws straight away.`]}),(0,G.jsx)(`button`,{type:`button`,className:`ink-coach-x`,title:`Dismiss`,"aria-label":`Got it`,onClick:d,children:(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})})]}),c&&!l&&(0,G.jsxs)(`span`,{className:`ink-howto`,role:`status`,children:[(0,G.jsx)(`span`,{className:`ink-howto-dot`,"aria-hidden":`true`}),`Drag across any value, label, or card on the answer to grab it. Then ask in your own words.`]}),l&&!s&&(0,G.jsx)(`span`,{className:`ink-miss`,role:`status`,children:`Nothing to grab there. Drag across a value, label, or card.`}),f&&(0,G.jsx)(Bl,{pins:t,onUndo:r,onSend:i})]})}function Wl(e){let t=(0,J.c)(10),{armed:n,onToggle:r}=e,i=`mark-toggle`+(n?` on`:``),a=n?`Highlighter on — drag across the answer to ask about it`:`Highlight the answer to ask about it`,o;t[0]!==n||t[1]!==r?(o=()=>r(!n),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M3 21l3.2-.9L18 8.3l-2.3-2.3L4 17.6 3 21z M14.7 7l2.3 2.3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinejoin:`round`,strokeLinecap:`round`})}),c=(0,G.jsx)(`span`,{className:`mark-toggle-label`,children:`Highlight`}),t[3]=s,t[4]=c):(s=t[3],c=t[4]);let l;return t[5]!==n||t[6]!==i||t[7]!==a||t[8]!==o?(l=(0,G.jsxs)(`button`,{type:`button`,className:i,"aria-pressed":n,"aria-label":a,title:`Highlight to ask`,onClick:o,children:[s,c]}),t[5]=n,t[6]=i,t[7]=a,t[8]=o,t[9]=l):l=t[9],l}var Gl=`mavea-brief-date`,Kl=Gl,ql=void 0;function Jl(){return new Date().toISOString().slice(0,10)}function Yl(){try{return typeof localStorage>`u`?null:localStorage.getItem(Gl)}catch{return null}}function Xl(){return ql===void 0&&(ql=Yl()),ql}function Zl(e){ql=e;try{typeof localStorage<`u`&&localStorage.setItem(Gl,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(Kl,{detail:e}))}catch{}}function Ql(e){return e?Xl()!==Jl():!1}function $l(){Zl(Jl())}function eu(e){let t=[];return t.push(`You are Mavéa, an AI presence. Generate a concise morning brief (max 3 items). Use real, grounded information only — no invented data, no placeholder numbers.`),e.length>0&&(t.push(``),t.push(`They recently discussed: ${e.join(`, `)}.`)),t.push(``),t.push(`Produce exactly 3 blocks in a warm, alive morning format using only insight, text, or list block types. Start your response with a single short narration sentence — natural and calm, like "Here's your morning." or "Good morning. Here's a brief look at your day." — then emit the blocks. Do not explain what you are doing; just deliver the brief.`),t.join(`
20
20
  `)}var tu=99;function nu(e){return e>tu?`${tu}+`:String(e)}function ru(){for(let e of br()){let t=Cr(e.id),n=e.lessons.length;if(!n)continue;let r=e.lessons.filter(e=>t.lessons[e.id]?.status===`done`).length;if(!(r>=n)&&(r!==0||t.current!==0))return{title:e.title,sub:`Lesson ${Math.min(t.current+1,n)} of ${n}`}}return null}function iu(e){let t=(0,J.c)(16),{onStudy:n}=e,r=ur(),i;if(t[0]!==r||t[1]!==n){if(i=[],r){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(B.layers,{}),t[3]=e):e=t[3];let a;t[4]===r.count?a=t[5]:(a=nu(r.count),t[4]=r.count,t[5]=a);let o=`${a} card${r.count===1?``:`s`}`,s;t[6]!==r.label||t[7]!==n||t[8]!==o?(s={key:`cards`,icon:e,title:o,sub:r.label,action:`Study`,onPick:n},t[6]=r.label,t[7]=n,t[8]=o,t[9]=s):s=t[9],i.push(s)}let e;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=ru(),t[10]=e):e=t[10];let a=e;if(a){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(B.play,{}),t[11]=e):e=t[11];let n;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(n={key:`course`,icon:e,title:a.title,sub:a.sub,action:`Continue`,onPick:ou},t[12]=n):n=t[12],i.push(n)}t[0]=r,t[1]=n,t[2]=i}else i=t[2];let a=i;if(!a.length)return null;let o;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Ready when you are`}),t[13]=o):o=t[13];let s;return t[14]===a?s=t[15]:(s=(0,G.jsxs)(`section`,{className:`ready-shelf go-study`,children:[o,(0,G.jsx)(`ul`,{className:`ready-list`,children:a.map(au)})]}),t[14]=a,t[15]=s),s}function au(e){return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,className:`ready-item`,onClick:e.onPick,children:[(0,G.jsx)(`span`,{className:`ready-icon`,"aria-hidden":!0,children:e.icon}),(0,G.jsxs)(`span`,{className:`ready-copy`,children:[(0,G.jsx)(`span`,{className:`ready-title`,children:e.title}),(0,G.jsx)(`span`,{className:`ready-sub`,children:e.sub})]}),(0,G.jsx)(`span`,{className:`ready-go`,children:e.action})]})},e.key)}function ou(){window.location.hash=`#/courses`}function su(e){return e.type===`flashcard`&&Array.isArray(e.props?.cards)}function cu(e){return e.replace(/<[^>]+>/g,``).trim()}function lu(e){let t=[];for(let n of e){if(!su(n))continue;let e=n;for(let n of e.props.cards){let e=cu(n.front??``),r=cu(n.back??``);!e||!r||t.push({front:e,back:r,tag:n.tag?cu(n.tag):void 0})}}return t}function uu(e){return cu(e??``).trim()}function du(e){let t=[],n=(e,n,r)=>{let i=uu(e),a=uu(n);i&&a&&t.push({front:i,back:a,tag:uu(r)||void 0})};switch(e.type){case`flashcard`:for(let t of e.props.cards??[])n(t.front,t.back,t.tag);break;case`faq`:for(let t of e.props.items??[])n(t.q,t.a,t.tag);break;case`deflist`:for(let t of e.props.items??[])n(t.term,t.def,t.tag);break;case`quiz`:{let t=(e.props.options??[]).filter(e=>e.correct).map(e=>uu(e.text)).filter(Boolean);if(t.length){let r=uu(e.props.explanation),i=r?`${t.join(`; `)} — ${r}`:t.join(`; `);n(e.props.question,i)}break}}return t}var fu=[`title`,`label`,`heading`,`name`,`question`,`caption`,`eyebrow`],pu=[`summary`,`narrative`,`detail`,`sub`,`body`,`text`,`prose`,`def`,`a`];function mu(e){return e.props??{}}function hu(e,t){for(let n of t){let t=e[n];if(typeof t==`string`){let e=uu(t);if(e)return e}}return``}function gu(e){return hu(mu(e),fu).slice(0,140)||re(e)}function _u(e){return hu(mu(e),pu).slice(0,400)}function vu(e){return{front:gu(e),back:_u(e)}}function yu(e){let t=[],n=gu(e);n&&t.push(n);for(let[,r]of Object.entries(mu(e)))if(typeof r==`string`){let e=uu(r);e&&e!==n&&t.push(e)}else if(Array.isArray(r)){for(let e of r.slice(0,12))if(typeof e==`string`){let n=uu(e);n&&t.push(n)}else if(e&&typeof e==`object`)for(let n of[`label`,`text`,`term`,`def`,`q`,`a`,`name`,`value`,`title`]){let r=e[n];if(typeof r==`string`){let e=uu(r);e&&t.push(e)}}}return[...new Set(t)].join(`
21
21
  `).slice(0,1400)}function bu(e){let t=du(e);return t.length?{cards:t,exact:!0}:{cards:[vu(e)],exact:!1}}var xu=`You write flashcards the way a strong student does: atomic (one idea per card), concise (no long prose), and focused on what is worth memorising — key facts, definitions and terms, formulas, cause→effect, and a single concrete example when it aids recall. The FRONT is a clear question or cue; the BACK is the shortest complete answer. Use ONLY information present in the source text — never add facts not stated there. Return 1–4 cards as JSON of the form {"cards":[{"front":"…","back":"…"}]}.`,Su={type:`object`,properties:{cards:{type:`array`,minItems:1,maxItems:4,items:{type:`object`,properties:{front:{type:`string`},back:{type:`string`}},required:[`front`,`back`]}}},required:[`cards`]};function Cu(e){let t=e;if(typeof e==`string`){let n=e.trim();try{t=JSON.parse(n)}catch{let e=n.match(/\{[\s\S]*\}/);if(!e)return[];try{t=JSON.parse(e[0])}catch{return[]}}}let n=t?.cards;if(!Array.isArray(n))return[];let r=[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=uu(String(e.front??``)).slice(0,300),n=uu(String(e.back??``)).slice(0,600);t&&n&&r.push({front:t,back:n})}return r.slice(0,4)}async function wu(e,t,n){let r=yu(e);if(!r)return[];let i=In(t.model)===`slow`?480:640;try{let e=await Zt(t.provider).generate({system:xu,systemBase:xu,history:[],user:`Source (from the answer the user is studying):\n"""\n${r}\n"""\n\nWrite the flashcards now.`,maxTokens:i,temperature:0,thinkingLevel:`minimal`,format:Su,...n?{signal:n}:{}},t);return n?.aborted?[]:Cu(e.raw)}catch{return[]}}var Tu=`tour-neural-networks`,Eu=`neural`,Du=[{id:`loop`,title:`The learning loop`,minutes:8,goal:`See the guess-measure-adjust cycle every network repeats to learn.`,objectives:[`Name the three steps a network learns by`,`Read what a training curve is telling you`,`Explain what a "weight" is in one sentence`],concepts:[`training loop`,`loss`,`weights`],checkpoint:[{question:`What are the three repeating steps a network learns by?`,answer:`Make a guess (forward pass), measure the error (loss), then nudge the weights to shrink it.`},{question:`When a training curve slopes downward, what is falling?`,answer:`The loss — the network is getting the answer wrong by less on each pass.`}]},{id:`neuron`,title:`Inside a single neuron`,minutes:7,goal:`Open up one neuron and watch it turn inputs into a decision.`,objectives:[`Compute a weighted sum of inputs plus a bias`,`Explain why an activation is needed at all`],concepts:[`weighted sum`,`activation function`,`bias`]},{id:`backprop`,title:`How it assigns blame`,minutes:10,goal:`Follow the error backward so the network knows which weights to change.`,objectives:[`State gradient descent in one line`,`Describe what backpropagation actually updates`],concepts:[`gradient descent`,`backpropagation`]},{id:`data`,title:`Why data and depth matter`,minutes:8,goal:`Understand what more layers and more examples buy you — and where they hurt.`,objectives:[`Relate depth to the abstractions a network can form`,`Explain overfitting in a single sentence`],concepts:[`depth`,`generalization`,`overfitting`]},{id:`tuning`,title:`Making it learn well`,minutes:9,goal:`Meet the handful of dials that decide whether training works at all.`,objectives:[`Explain what the learning rate controls`,`Say why training happens in batches`],concepts:[`learning rate`,`batch size`,`epochs`]}];function Ou(){let e=wr(Tu);if(e)return e;let t=ni(Eu)?.frames[0];if(!t)return null;let n={id:Tu,topic:`how neural networks learn`,title:`How neural networks learn`,subtitle:`From one neuron to a trained model, in five short sittings.`,level:`beginner`,lessons:Du,createdAt:Date.now(),model:`tour`};return Sr(n),Er(Tu,Du[0].id,t),n}var ku=24e3,Au=ku*180,ju=[],Mu=null,Nu=[],Pu=0,Fu=!1,Iu=!1,Lu=1,Ru=0,zu=new Set,Bu=null,Vu=null;function Hu(){Ru+=1,Vu=null;for(let e of zu)e()}function Uu(e){return zu.add(e),()=>zu.delete(e)}function Wu(){return Ru}function Gu(){return Pu/ku}function Ku(){ju=[],Mu=null,Nu=[],Pu=0,Lu=Me(),Fu=!0,Bu=null,Hu()}function qu(){Fu=!1,Mu=null,Hu()}function Ju(e){Iu=e}function Yu(e){if(!Fu||Iu)return;let t=Nu[Nu.length-1];t&&t.blocks===e||(Nu.push({t:Gu(),blocks:e}),Vu=null)}var Xu={begin(e){!Fu||Iu||(Mu={text:e,chunks:[],samples:0})},push(e){if(!Fu||Iu||!Mu||Pu+e.length>Au)return;let t=new Int16Array(e.length);for(let n=0;n<e.length;n++){let r=Math.round(e[n]*32768);t[n]=r>32767?32767:r<-32768?-32768:r}Mu.chunks.push(t),Mu.samples+=e.length,Pu+=e.length},end(e){if(!(!Fu||!Mu)){if(Iu){Pu-=Mu.samples,Mu=null;return}e&&Mu.samples>0?(ju.push(Mu),Bu=null):Pu-=Mu.samples,Mu=null,Hu()}}};function Zu(){if(Vu)return Vu;if(!Bu){let e=ju.reduce((e,t)=>e+t.samples,0);if(e===0)return null;let t=new Int16Array(e),n=[],r=0;for(let e of ju){let i=r/ku;for(let n of e.chunks)t.set(n,r),r+=n.length;n.push({text:e.text,t0:i,t1:r/ku})}Bu={pcm:t,spans:n}}let e=Bu.pcm.length/ku,t=Nu.map(t=>({t:Math.min(t.t,e),blocks:t.blocks}));return Vu={pcm:Bu.pcm,sampleRate:ku,duration:e,spans:Bu.spans,marks:t,speed:Lu},Vu}function Qu(e,t){let n=0;for(let r of e.marks){if(r.t>t)break;n=r.blocks}return n}var $u=e=>e.saySpoken??e.say??``;function ed(e){let t=new Map;for(let n of e){let e=Ce(Ee($u(n)));e&&!t.has(e)&&t.set(e,n.index)}return t}function td(e,t,n,r){if(t>=e.duration-.05)return r;let i=Qu(e,t),a=ed(n);for(let r of e.spans){if(r.t0>t)break;let e=a.get(r.text)??n.find(e=>e.say===r.text||e.saySpoken===r.text)?.index;e!==void 0&&(i=Math.max(i,e+1))}return Math.max(1,Math.min(i,r))}var nd=72e5,rd=class{budget;map=new Map;constructor(e=nd){this.budget=e}set(e,t){this.map.delete(e),this.map.set(e,t),this.evict(e)}get(e){return this.map.get(e)??null}get size(){return this.map.size}total(){let e=0;for(let t of this.map.values())e+=t.pcm.length;return e}evict(e){let t=[...this.map.keys()],n=0;for(;this.total()>this.budget&&this.map.size>1&&n<t.length;){let r=t[n++];r!==e&&this.map.delete(r)}}},id=[1,1.25,1.5,2,.75];function ad(e){return`${Number.isInteger(e)?e:e.toFixed(2).replace(/0+$/,``).replace(/\.$/,``)}×`}function od(e){return Math.min(2,Math.max(.75,e))}function sd(e){let t=id.indexOf(od(e));return id[(t<0?0:t+1)%id.length]}function cd(e,t){let n=e.length*2,r=new ArrayBuffer(44+n),i=new DataView(r),a=(e,t)=>{for(let n=0;n<t.length;n++)i.setUint8(e+n,t.charCodeAt(n))};a(0,`RIFF`),i.setUint32(4,36+n,!0),a(8,`WAVE`),a(12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),a(36,`data`),i.setUint32(40,n,!0);for(let t=0;t<e.length;t++)i.setInt16(44+t*2,e[t],!0);return r}function ld(e,t){let n=new Blob([cd(e,t)],{type:`audio/wav`});return URL.createObjectURL(n)}var ud=160;function dd(e){let t=Math.max(1,Math.floor(e.length/ud)),n=[];for(let r=0;r<ud;r++){let i=0,a=r*t,o=Math.min(e.length,a+t);for(let t=a;t<o;t++){let n=Math.abs(e[t]);n>i&&(i=n)}n.push(i/32768)}return n}var fd={recording:{title:`Preparing voice scrub`,hint:`It appears here as soon as Mavéa finishes speaking.`},muted:{title:`Voice was muted`,hint:`Unmute before the next answer to capture a scrub track.`},offline:{title:`Voice is off`,hint:`Start the local TTS service to hear and scrub future answers.`},past:{title:`Voice scrub lives on the latest answer`,hint:`Return to live to replay the current spoken track.`},missing:{title:`No voice track captured`,hint:`The answer is still here as captions, but there is no audio to scrub.`}};function pd(e){let t=(0,J.c)(8),{reason:n}=e,r=fd[n],i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`span`,{className:`voice-scrub-empty-dot`,"aria-hidden":`true`}),t[0]=i):i=t[0];let a;t[1]===r.title?a=t[2]:(a=(0,G.jsx)(`span`,{className:`voice-scrub-empty-title`,children:r.title}),t[1]=r.title,t[2]=a);let o;t[3]===r.hint?o=t[4]:(o=(0,G.jsx)(`span`,{className:`voice-scrub-empty-hint`,children:r.hint}),t[3]=r.hint,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,G.jsxs)(`div`,{className:`voice-scrub voice-scrub--empty`,role:`status`,"aria-label":`Voice scrub unavailable`,children:[i,(0,G.jsxs)(`span`,{className:`voice-scrub-empty-copy`,children:[a,o]})]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function md({audio:e,t,onSeek:n}){let r=(0,W.useRef)(null),i=(0,W.useRef)(null),a=(0,W.useMemo)(()=>dd(e.pcm),[e.pcm]),o=(0,W.useRef)(!1),s=(0,W.useRef)(null),c=(0,W.useRef)(null),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(null),p=d??t,m=(0,W.useRef)(p);m.current=p;let[h,g]=en(),_=od(h.voiceSpeed),y=_/(e.speed||1),b=(0,W.useRef)(y);b.current=y;let x=(0,W.useCallback)(()=>{c.current?.stop(),c.current=null,u(!1)},[]),S=(0,W.useRef)(null),C=(0,W.useCallback)(e=>{let t=window.devicePixelRatio||1,n=e.clientWidth,r=e.clientHeight;if(!n||!r)return null;e.width=n*t,e.height=r*t;let i=e.width,o=e.height,s=document.documentElement.dataset.theme??``,c=S.current;if(c&&c.peaks===a&&c.pw===i&&c.ph===o&&c.theme===s)return c;let l=getComputedStyle(e),u=l.getPropertyValue(`--scrub-played`).trim()||`#8a93f8`,d=l.getPropertyValue(`--scrub-rest`).trim()||`#5c647833`,f=n/ud,p=e=>{let n=document.createElement(`canvas`);n.width=i,n.height=o;let s=n.getContext(`2d`);if(s){s.scale(t,t),s.fillStyle=e;for(let e=0;e<ud;e++){let t=Math.max(.06,a[e])*(r-4);s.fillRect(e*f+f*.2,(r-t)/2,f*.6,t)}}return n},m={peaks:a,pw:i,ph:o,theme:s,played:p(u),rest:p(d)};return S.current=m,m},[a]),w=(0,W.useCallback)(t=>{let n=r.current;if(!n)return;let i=C(n);if(!i)return;let a=n.getContext(`2d`);if(!a)return;let{played:o,rest:s,pw:c,ph:l}=i;a.clearRect(0,0,c,l),a.drawImage(s,0,0);let u=t===null?1:Math.max(0,Math.min(1,t/e.duration)),d=Number.isFinite(u)?Math.min(ud,Math.max(0,Math.floor(u*ud)+1)):0;if(d>0){let e=Math.min(c,Math.round(d/ud*c));a.drawImage(o,0,0,e,l,0,0,e,l)}},[e.duration,C]);(0,W.useEffect)(()=>{c.current||w(p)},[p,w]);let T=(0,W.useCallback)(t=>{if(x(),!v())return;n(t),f(t),s.current||=ld(e.pcm,e.sampleRate);let r=new Audio(s.current);r.preservesPitch=!0,r.webkitPreservesPitch=!0,r.playbackRate=b.current,r.currentTime=t,t>0&&r.addEventListener(`loadedmetadata`,()=>{Math.abs(r.currentTime-t)>.05&&(r.currentTime=t)},{once:!0});let i=z(r);r.play().catch(()=>{});let a=0,o=Math.round(t),l=()=>{if(r.ended||r.currentTime>=e.duration){d(),c.current=null,u(!1),f(null),n(null);return}w(r.currentTime);let t=Math.round(r.currentTime);t!==o&&(o=t,f(r.currentTime)),a=requestAnimationFrame(l)},d=()=>{cancelAnimationFrame(a);try{r.pause(),r.removeAttribute(`src`)}catch{}i()};c.current={stop:d,el:r},u(!0),a=requestAnimationFrame(l)},[e,n,x,w]),E=(0,W.useCallback)(()=>{if(c.current){let e=c.current.el.currentTime;x(),f(null),n(e)}else T(p??0)},[p,T,x,n]),D=(0,W.useCallback)(()=>{g({voiceSpeed:sd(_)})},[g,_]);(0,W.useEffect)(()=>{c.current&&(c.current.el.playbackRate=y)},[y]),(0,W.useEffect)(()=>{let e=null;return typeof MutationObserver<`u`&&(e=new MutationObserver(()=>{c.current||w(m.current)}),e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})),()=>{e?.disconnect(),x(),s.current&&=(URL.revokeObjectURL(s.current),null),S.current=null}},[e,x,w]),(0,W.useEffect)(()=>{f(null)},[e]);let O=t=>{let n=i.current.getBoundingClientRect();return n.width?Math.max(0,Math.min(1,(t-n.left)/n.width))*e.duration:0};return(0,G.jsxs)(`div`,{className:`voice-scrub`,children:[(0,G.jsx)(`button`,{type:`button`,className:`voice-scrub-play`,onPointerDown:e=>e.stopPropagation(),onClick:E,"aria-label":l?`Pause`:`Play the spoken answer`,title:l?`Pause`:`Play from here`,children:l?(0,G.jsxs)(`svg`,{viewBox:`0 0 12 12`,width:`13`,height:`13`,"aria-hidden":`true`,children:[(0,G.jsx)(`rect`,{x:`2.5`,y:`2`,width:`2.4`,height:`8`,rx:`0.6`,fill:`currentColor`}),(0,G.jsx)(`rect`,{x:`7.1`,y:`2`,width:`2.4`,height:`8`,rx:`0.6`,fill:`currentColor`})]}):(0,G.jsx)(`svg`,{viewBox:`0 0 12 12`,width:`13`,height:`13`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M3.2 2.2 L10 6 L3.2 9.8 Z`,fill:`currentColor`})})}),(0,G.jsx)(`button`,{type:`button`,className:`voice-scrub-rate`,onPointerDown:e=>e.stopPropagation(),onClick:D,"aria-label":`Speed, currently ${ad(_)}. Tap to change.`,title:`Voice speed`,children:ad(_)}),(0,G.jsxs)(`div`,{ref:i,className:`voice-scrub-body`,role:`slider`,"aria-label":`Scrub the spoken answer`,"aria-valuemin":0,"aria-valuemax":Math.round(e.duration),"aria-valuenow":Math.round(p??e.duration),tabIndex:0,onPointerDown:e=>{o.current=!0,x(),f(null);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}n(O(e.clientX),!0)},onPointerMove:e=>{o.current&&n(O(e.clientX),!0)},onPointerUp:e=>{o.current&&(o.current=!1,T(O(e.clientX)))},onKeyDown:t=>{let r=p??e.duration;t.key===`ArrowLeft`&&(x(),f(null),n(Math.max(0,r-2),!0)),t.key===`ArrowRight`&&(x(),f(null),n(Math.min(e.duration,r+2),!0)),(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),E()),t.key===`Escape`&&(x(),f(null),n(null))},children:[(0,G.jsx)(`canvas`,{ref:r,className:`voice-scrub-wave`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`voice-scrub-hint`,children:l?`playing — tap pause or drag to scrub`:p===null?`play, or drag to rewind the voice`:`the canvas is rebuilt to this moment`})]})]})}function hd({audio:e,t,onSeek:n,unavailable:r=`missing`}){return e?(0,G.jsx)(md,{audio:e,t,onSeek:n}):(0,G.jsx)(pd,{reason:r})}function gd(){let e=(0,J.c)(16),[t,n]=en(),r;e[0]===t.voiceSpeed?r=e[1]:(r=od(t.voiceSpeed),e[0]=t.voiceSpeed,e[1]=r);let i=r,a,o;e[2]===i?(a=e[3],o=e[4]):(a=()=>{ke(i)},o=[i],e[2]=i,e[3]=a,e[4]=o),(0,W.useEffect)(a,o);let s;e[5]!==n||e[6]!==i?(s=()=>n({voiceSpeed:sd(i)}),e[5]=n,e[6]=i,e[7]=s):s=e[7];let c=s,l;e[8]===i?l=e[9]:(l=ad(i),e[8]=i,e[9]=l);let u=`Voice speed, currently ${l}. Tap to change.`,d;e[10]===i?d=e[11]:(d=ad(i),e[10]=i,e[11]=d);let f;return e[12]!==c||e[13]!==u||e[14]!==d?(f=(0,G.jsx)(`button`,{type:`button`,className:`voice-speed`,onClick:c,"aria-label":u,title:`How fast Mavéa speaks`,children:d}),e[12]=c,e[13]=u,e[14]=d,e[15]=f):f=e[15],f}var _d={standard:`deep`,deep:`simple`,simple:`standard`},vd={simple:`Simple`,standard:`Standard`,deep:`In-depth`};function yd(){let e=(0,J.c)(9),[t,n]=en(),r=t.explainLevel,i;e[0]!==r||e[1]!==n?(i=()=>n({explainLevel:_d[r]}),e[0]=r,e[1]=n,e[2]=i):i=e[2];let a=i,o=`explain-chip`+(r===`simple`?` is-simple`:r===`deep`?` is-deep`:``),s=`Explanation level: ${vd[r]}. Tap for ${vd[_d[r]]}.`,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsx)(`span`,{className:`explain-chip-tag`,children:`Explain`}),e[3]=c):c=e[3];let l=vd[r],u;return e[4]!==a||e[5]!==o||e[6]!==s||e[7]!==l?(u=(0,G.jsxs)(`button`,{type:`button`,className:o,onClick:a,"aria-label":s,title:`How plain or rigorous the words and visuals are — or just say 'explain it simpler' / 'go deeper'`,children:[c,l]}),e[4]=a,e[5]=o,e[6]=s,e[7]=l,e[8]=u):u=e[8],u}var bd=[`You catch a HALF-SPOKEN question, still being said. Reply ONLY with JSON:`,`{"ghosts":[{"kind":"forming"|"maybe","title":"..."}]}`,`2-3 entries: the visual cards you would build if the sentence ended right now.`,`"forming" = clearly needed for what was said so far; "maybe" = a plausible direction the sentence is heading.`,`Each title ≤ 6 words, concrete (e.g. "Bloom forecast", "Late-April flights"). No prose, no other keys.`].join(`
@@ -76,4 +76,4 @@ Only genuinely new atoms (each needs a verbatim quote from the NEW speech). Reus
76
76
  `).trim()}function kf(e,t){let n=e.center?.trim(),r=Of(e);return[n?`I've been thinking out loud and here's what it comes down to: ${n}`:`I've been thinking out loud. Here's the shape of it.`,``,r,``,t===`plan`?`Pull this together and give me a concrete plan — the clear next steps, in order, that move me forward given everything above.`:`Pull this together and help me with it — weigh what matters most, address the tensions head-on, and give me a clear, useful answer.`].filter(e=>e!==void 0).join(`
77
77
  `).trim()}function Af(e){return/^(ok(ay)?[,.\s]+)?(any |your |so[,.\s]+)?thoughts\s*[?.!]*$/i.test(e.trim())}function jf(e,t){return e?t>0?`Discard ${t} banked — or tap Thoughts? to sort them`:`Stop banking and go back to answering`:`Bank everything you say without answering — say "thoughts?" when you want the sort`}function Mf(e){let t=e.trim();return t.length>0&&!Af(t)}function Nf(e,t){let n=e.map((e,t)=>`(${t+1}) ${e.trim()}`).join(`
78
78
  `);return[`I just thought out loud for about ${Math.max(1,t)} minute${t>=2?`s`:``}. Sort what I actually said — do NOT add ideas of your own:`,`- the DECISIONS I made (even tentative ones),`,`- the TODOS I gave myself,`,`- any CONTRADICTIONS (quote both moments and ask me which one I mean).`,`My words, in order:`,n].join(`
79
- `)}var Pf=/https?:\/\/[^\s<>"')\]]+/i;function Ff(e){let t=e.match(Pf);return t?t[0].replace(/[.,;:!?]+$/,``):null}function If(e){let t=Ff(e);return t?e.replace(t,``).trim().split(/\s+/).filter(Boolean).length<=12:!1}function Lf(e){return`Check this for me: ${e} — what's actually true, what's shaky, and what's missing context? Ground every verdict in real sources.`}var Rf=`Check the claim in this screenshot — what's actually true, what's shaky, and what's missing context? Ground every verdict in real sources.`;function zf(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable:!1}var Bf=_t.map(e=>{let t=vt[e];return{id:e,label:t.label,description:`${t.archetype} — ${t.blurb}`,accent:t.tokens.accent}}),Vf=`mavea-preso-style`;function Hf(e){return Bf.some(t=>t.id===e)}function Uf(){try{let e=localStorage.getItem(Vf);return Hf(e)?e:`folio`}catch{return`folio`}}function Wf(e){try{localStorage.setItem(Vf,e)}catch{}}function Gf(e){return e<5?`Late night`:e<12?`This morning`:e<17?`This afternoon`:`Tonight`}function Kf(e){let t=Math.max(1,Math.round(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function qf(e,t){if(e.length===0||t.length===0)return null;let n=e[0],r=e[e.length-1],i=`${Gf(new Date(n.at).getHours())}, so far.`,a=[`${Vc(n.at)} – ${Vc(r.at)}`,Kf(r.at-n.at),`${t.length} ${t.length===1?`topic`:`topics`}`,`${e.length} ${e.length===1?`moment`:`moments`}`].join(` · `),o=Bc(e),s=[];for(let n of t){let t=n.moments[0],r=n.moments[n.moments.length-1],i=e[r.frameIndex],a=i?.narration||i?.question||``;if(!a)continue;let c=n.moments.map(e=>o.get(e.frameIndex)).find(Boolean);s.push({title:n.title,clock:Vc(e[t.frameIndex]?.at),line:a,frameIndex:r.frameIndex,...c?{corrected:`Corrected — ${c.note.what}: was ${c.note.was}, now ${c.note.now}`}:{}})}return s.length?{heading:i,meta:a,rows:s}:null}var Jf=300;function Yf({transcript:e,mode:t,note:n,transcribing:r=!1}){let[i,a]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!r){a(!1);return}let e=window.setTimeout(()=>a(!0),Jf);return()=>window.clearTimeout(e)},[r]);let o=r&&i;return(0,G.jsx)(`div`,{className:`listen-stage`,children:(0,G.jsxs)(`div`,{className:`listen-card`+(o?` is-transcribing`:``),children:[(0,G.jsxs)(`span`,{className:`listen-eq`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]}),(0,G.jsxs)(`div`,{className:`listen-body`,children:[(0,G.jsxs)(`div`,{className:`listen-line`,children:[e?`“${e}`:o?`Heard you`:`Listening`,(0,G.jsx)(`span`,{className:`listen-caret`,"aria-hidden":`true`}),e?`”`:``]}),(0,G.jsx)(`div`,{className:`listen-note`,role:`status`,"aria-live":`polite`,children:o?`Got that — one moment…`:n??(t===`always`?`Always on — Mavéa answers when you finish a thought.`:t===`hold`?`Release the mic or shortcut to send.`:`It sends when you pause — or tap the mic to send now.`)})]})]})})}var Xf=250;function Zf(e){let t=(0,J.c)(6),{cards:n}=e,[r,i]=(0,W.useState)(!1),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.setTimeout(()=>i(!0),Xf);return()=>window.clearTimeout(e)},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,W.useEffect)(a,o),!r||n.length===0)return null;let s;t[2]===n?s=t[3]:(s=n.map(Qf),t[2]=n,t[3]=s);let c;return t[4]===s?c=t[5]:(c=(0,G.jsx)(`div`,{className:`skel-grid`,role:`status`,"aria-label":`Building the answer`,children:s}),t[4]=s,t[5]=c),c}function Qf(e,t){return(0,G.jsxs)(`div`,{className:`skel-card`,children:[(0,G.jsxs)(`span`,{className:`skel-eyebrow`,children:[`✦ `,e.label,`…`]}),e.lines.map($f)]},t)}function $f(e,t){return(0,G.jsx)(`span`,{className:`skel-line`,style:{width:`${e}%`}},t)}function ep({thinking:e=!1}){return(0,G.jsxs)(`div`,{className:`composing-status`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(`span`,{className:`composing-orb`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:e?`Thinking it through`:`Composing your answer`}),(0,G.jsxs)(`span`,{className:`composing-dots`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]})]})}function tp(e){let t=(0,J.c)(14),{activity:n,sources:r}=e,i,a,o,s,c,l;if(t[0]!==n||t[1]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.slice(0,3),t=n===`searching`;if(!t&&e.length===0){l=null;break bb0}i=`turn-chips`,a=`status`,o=`polite`,s=t&&e.length===0&&(0,G.jsxs)(`span`,{className:`turn-chip`,children:[(0,G.jsx)(B.globe,{}),` Searching the web…`]}),c=e.map(np)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;return t[8]!==i||t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==c?(u=(0,G.jsxs)(`div`,{className:i,role:a,"aria-live":o,children:[s,c]}),t[8]=i,t[9]=a,t[10]=o,t[11]=s,t[12]=c,t[13]=u):u=t[13],u}function np(e,t){return(0,G.jsxs)(`span`,{className:`turn-chip src`,children:[(0,G.jsx)(`i`,{className:`turn-chip-dot`,"aria-hidden":`true`}),ve(e.url)??e.title]},t)}function rp(){return(0,W.useSyncExternalStore)(Ne,De,ip)}function ip(){return!1}var ap=600,op=!1,sp=null,cp=null,lp=new Set;function up(){if(Te()){sp===null&&!op&&(sp=window.setTimeout(()=>{sp=null,op=!0;for(let e of lp)e()},ap));return}if(sp!==null&&(window.clearTimeout(sp),sp=null),op){op=!1;for(let e of lp)e()}}function dp(e){return lp.add(e),cp??=Ne(up),()=>{lp.delete(e),lp.size===0&&(cp?.(),cp=null,sp!==null&&(window.clearTimeout(sp),sp=null),op=!1)}}function fp(){return(0,W.useSyncExternalStore)(dp,mp,pp)}function pp(){return!1}function mp(){return op}var hp=600,gp=!1,_p=null,vp=null,yp=new Set;function bp(){if(De()){if(_p!==null&&(window.clearTimeout(_p),_p=null),!gp){gp=!0;for(let e of yp)e()}return}_p!==null||!gp||(_p=window.setTimeout(()=>{_p=null,gp=!1;for(let e of yp)e()},hp))}function xp(e){return yp.add(e),vp??=Ne(bp),()=>{yp.delete(e),yp.size===0&&(vp?.(),vp=null,_p!==null&&(window.clearTimeout(_p),_p=null),gp=!1)}}function Sp(){return(0,W.useSyncExternalStore)(xp,wp,Cp)}function Cp(){return!1}function wp(){return gp}var Tp={scalar:`Key figure`,series:`Trend`,composition:`Breakdown`,comparison:`Comparison`,ranking:`Ranking`,distribution:`Distribution`,relationship:`Relationship`,hierarchy:`Structure`,flow:`Process`,sequence:`Timeline`,keyvalue:`Readouts`,list:`Checklist`,geo:`Map`,code:`Code`,tabular:`Table`,status:`Status`},Ep=/^(please|hey|ok(ay)?|so|now|can|could|would|will|you|how|what|why|when|where|which|who|should|is|are|do|does|did|tell|show|give|make|build|plan|help|i|me|us|my|about|the|a|an)\b[\s,'’]*/i;function Dp(e,t=4){let n=e.trim().replace(/\s+/g,` `);for(let e=0;e<8;e++){let e=n.replace(Ep,``);if(e===n)break;n=e}return n.replace(/[?!.]+$/,``).split(` `).slice(0,t).join(` `).trim()}var Op=[[78,52],[64,88],[82,40]];function kp(e,t){let n=Dp(e),r=er(e,t),i=Object.entries(r).filter(([e,t])=>t>0&&Tp[e]).sort((e,t)=>t[1]-e[1]).map(([e])=>Tp[e]),a=hn(e)===`rich`?3:2,o=[`Finding`];for(let e of i){if(o.length>=a)break;o.includes(e)||o.push(e)}for(;o.length<a;)o.push(o.length===1?`Readouts`:`Details`);return o.map((e,t)=>({label:n?`${e} — ${n}`:e,lines:Op[t%Op.length]}))}function Ap(e){let t=e&&Tp[e]||(e===`text`?`Finding`:null);return{label:t?`Building — ${t.toLowerCase()}`:`Building`,lines:Op[0]}}function jp(e){return e.paletteOpen||e.shareOpen||e.exportOpen||e.dashOpen||e.showSettings||e.proofOpen||e.showHow||e.replayAt!==null||e.recapOpen||e.atlasOpen||e.delegateOpen||e.srsOpen||e.zoomLevel!==null||e.mindViewOpen}function Mp(e,t){let n=e.left-t.left+e.width/2,r=e.top-t.top+e.height/2,i=Math.min(e.width/2+14,t.width*.45),a=e.height/2+10,o=Math.PI*2*1.12,s=[];for(let e=0;e<=32;e++){let t=-Math.PI/2+o*e/32;s.push({x:n+Math.cos(t)*i,y:r+Math.sin(t)*a})}return s}var Np=`Local voice input isn’t available here — check browser microphone support, or type instead.`,Pp=`Microphone access is blocked — allow mic access for this site to talk to Mavéa.`,Fp=`Couldn’t reach your microphone — check it’s connected and not in use by another app.`,Ip=`Local transcription is still starting or unavailable — try again in a moment, or type instead.`;function Lp(){let e=(0,J.c)(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,W.useState)(t),[i,a]=(0,W.useState)(null),[o,s]=(0,W.useState)(!1),c;e[1]===n.length?c=e[2]:(c=async e=>{a(null);let t=6-n.length;if(t<=0)return a(`You can attach up to 6 files.`),[];let i=[],o=null;for(let n of e.slice(0,t)){let e=await Lt(n);if(e.ok&&e.attachment)i.push(e.attachment);else if(!o){let t=/\.(pdf|docx|pptx|xlsx)$/i.test(n.name);o=e.error===`too-large`?`"${n.name}" is too large (max ${t?40:10} MB).`:`"${n.name}" isn't a supported type (images, PDF, Office docs, or text/data files like CSV, TXT, Markdown, JSON).`}}return e.length>t&&(o=`Only the first ${t} file(s) were added.`),i.length&&r(e=>[...e,...i]),o&&a(o),i},e[1]=n.length,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{r(t=>t.filter((t,n)=>n!==e))},e[3]=u):u=e[3];let d=u,f;return e[4]!==i||e[5]!==n||e[6]!==l||e[7]!==o?(f={attached:n,setAttached:r,attachError:i,setAttachError:a,turnHadFiles:o,setTurnHadFiles:s,onFiles:l,removeAttachment:d},e[4]=i,e[5]=n,e[6]=l,e[7]=o,e[8]=f):f=e[8],f}var Rp=`mavea-live-bookmarks`;function zp(){let[e,t]=(0,W.useState)(()=>{try{let e=localStorage.getItem(Rp);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}});return{bookmarks:e,toggleBookmark:(0,W.useCallback)(e=>{t(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(Rp,JSON.stringify([...n]))}catch{}return n})},[])}}var Bp=`mavea-live-ask-hint`;function Vp(){let e=(0,J.c)(3),[t,n]=(0,W.useState)(Hp),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(!0);try{localStorage.setItem(Bp,`1`)}catch{}},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a={askHintSeen:t,dismissAskHint:i},e[1]=t,e[2]=a),a}function Hp(){try{return localStorage.getItem(Bp)===`1`}catch{return!1}}i();var Up=(0,W.lazy)(()=>a(()=>import(`./TopicCanvas-DSCNWNjv.js`).then(e=>e.n).then(e=>({default:e.TopicCanvas})),__vite__mapDeps([60,1,31,32,16,2,30,33,34,35,36,37,38,39,15,61,62,4,63,64,65,66,67,68,69,70,71,17,72,18,5,6,7,73,74,75,76,77]))),Wp=[{col:6},{col:6},{col:12}],Gp=`mavea-live-rail-collapsed-v1`,Kp=`View as living answer`,qp=`Why this answer is true — the causal web behind it, and its receipts`,Jp=`mavea-mic-hold-preferred`,Yp=`I may have misheard that. Review the draft, then send it.`,Xp=6400,Zp=po+at;function Qp(e){return zf(e.target)?!0:(e.key===` `||e.key===`Spacebar`)&&e.target instanceof HTMLElement&&!!e.target.closest(`button`)}var $p=s(()=>a(()=>import(`./HowItWorks-C5Dqqvl-.js`).then(e=>({default:e.HowItWorks})),__vite__mapDeps([78,31,1,16,15,60,32,2,30,33,34,35,36,37,38,39,61,62,4,63,64,65,66,67,68,69,70,71,17,72,18,5,6,7,73,74,75,76,77,79,80,81,20,82,83,24]))),em=$p.Component,tm=s(()=>a(()=>import(`./CommandPalette-Cz8h94Jd.js`).then(e=>({default:e.CommandPalette})),__vite__mapDeps([84,31,1,16,35,36,37,15,85,86]))),nm=tm.Component,rm=s(()=>a(()=>import(`./Library-CDgWdTiF.js`).then(e=>({default:e.Library})),__vite__mapDeps([87,31,1,32,16,15,4,88,89,22,23,90,91,92,93,94,95]))).Component,im=s(()=>a(()=>import(`./LiveSettings-Cz3XSqv8.js`).then(e=>({default:e.LiveSettings})),__vite__mapDeps([96,31,1,32,16,2,30,33,34,35,36,37,38,39,15,64,81,20,97,98,27,89,22,23,90,94,26,7,12,25,28,99,100,51,101,102,103,104,105,106,54,107]))),am=im.Component,om=s(()=>a(()=>import(`./DashboardDetail-BhRSDenD.js`).then(e=>({default:e.DashboardDetail})),__vite__mapDeps([108,31,1,32,16,2,15,60,30,33,34,35,36,37,38,39,61,62,4,63,64,65,66,67,68,69,70,71,17,72,18,5,6,7,73,74,75,76,77,19,83,109,22,23,90,99,27,26,12,25,28,110,111,112,113,114,115,116,117,118,9,44,55,119,120,121,20,81,122,123,124,125,126,127,128,129,130,131,132]))).Component,sm=s(()=>a(()=>import(`./DashboardSettings-5tn-dw6G.js`).then(e=>({default:e.DashboardSettings})),__vite__mapDeps([133,31,1,32,16,109,22,23,90,110,111,112,113,120,126,116,117]))).Component,cm=s(()=>a(()=>import(`./UnderstoodPanel-DmJph4el.js`).then(e=>({default:e.UnderstoodPanel})),__vite__mapDeps([134,31,1,32,16,135]))).Component,lm=s(()=>a(()=>import(`./ZoomDeck-CC9zXPxF.js`).then(e=>({default:e.ZoomDeck})),__vite__mapDeps([136,31,1,32,16,15,64,137,30,33,34,2,35,36,37,38,39,138,139]))),um=lm.Component,dm=s(()=>a(()=>import(`./AtlasView-CYZ9sfXb.js`).then(e=>({default:e.AtlasView})),__vite__mapDeps([140,31,1,16,91,92,4,88,93,94,141,22,23,142]))),fm=dm.Component,pm=s(()=>a(()=>import(`./RippleOverlay-vP2KxTiI.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([143,31,1,32,16,2,36,35,37,30,33,34,38,39,64,66,97,98,28,41,144,145,146,147,23,148,149,150]))),mm=pm.Component,hm=s(()=>a(()=>import(`./CardEditor-D4slxmIM.js`).then(e=>({default:e.CardEditor})),__vite__mapDeps([151,31,1,16,64,104,152]))).Component,gm=s(()=>a(()=>import(`./CourseRail-DD8gtAn4.js`).then(e=>({default:e.CourseRail})),__vite__mapDeps([153,31,1,32,16,15,99,27,23,26,7,12,25,28,104,154,90,155,44,156,157,158]))).Component,_m=s(()=>a(()=>import(`./MindMapViewerDrawer-AUJlLC2R.js`).then(e=>({default:e.MindMapViewerDrawer})),__vite__mapDeps([159,32,1,31,16,15,160,30,33,34,2,35,36,37,38,39,66,161,162,163]))).Component,vm=s(()=>a(()=>import(`./Recap-BOl3SUh0.js`).then(e=>({default:e.Recap})),__vite__mapDeps([164,31,1,32,16,64,165]))),ym=vm.Component,bm=s(()=>a(()=>import(`./LibraryOverlay-TQnxY9R8.js`).then(e=>({default:e.LibraryOverlay})),__vite__mapDeps([166,31,1,32,16,15,64,137,30,33,34,2,35,36,37,38,39,87,4,88,89,22,23,90,91,92,93,94,95,167]))),xm=bm.Component,Sm=s(()=>a(()=>import(`./ReplayOverlay-ZRjFP-zf.js`).then(e=>({default:e.ReplayOverlay})),__vite__mapDeps([168,31,1,16,60,32,2,30,33,34,35,36,37,38,39,15,61,62,4,63,64,65,66,67,68,69,70,71,17,72,18,5,6,7,73,74,75,76,77,88,169,79,80,81,20,82,83,170,171,9,172,173,174]))).Component,Cm=s(()=>a(()=>import(`./ShareModal-_KYCohqO.js`).then(e=>({default:e.ShareModal})),__vite__mapDeps([175,31,1,32,16,2,35,36,37,15,64,70,20,176,30,33,34,38,39,177,178,179,180,181,162,93,97,98,182]))),wm=Cm.Component,Tm=s(()=>a(()=>import(`./ExportModal-gckBiikq.js`).then(e=>({default:e.ExportModal})),__vite__mapDeps([183,31,1,32,16,2,30,33,34,35,36,37,38,39,4,64,19,177,180,97,98,82,184,62,15,63,17,185,69,71,58,74,73,75,76,186,187,188,189,160,66,161,162,163,190,191,43,88,192,193,194,195,196,197,18,198,199,200,59,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,65,219,220,221,222,223,224,225,226,81,20,227,228,72,229,230,231,232,233,137,234,235,236,237,238,239,240,241,242,243,21,244,11,245,246,247,248]))),Em=Tm.Component,Dm=s(()=>a(()=>import(`./ExtractionPreview-DDOkCH9u.js`).then(e=>({default:e.ExtractionPreview})),__vite__mapDeps([249,31,1,32,16,64,250,8,22,23,90,89,109,26,7,12,27,25,28,99,44,110,118,2,9,113,112,114,55,119,120,121,20,81,30,33,34,35,36,37,38,39,122,251,132]))),Om=Dm.Component,km=s(()=>a(()=>import(`./PinToDashboard-BdXI7oo9.js`).then(e=>({default:e.PinToDashboard})),__vite__mapDeps([252,31,1,32,16,15,4,64,109,22,23,90,99,27,26,7,12,25,28,112,113,124,118,2,9,44,114,55,119,120,121,20,81,30,33,34,35,36,37,38,39,125]))).Component,Am=s(()=>a(()=>import(`./PrismOverlay-c8rcvt4V.js`).then(e=>e.n).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([253,1,31,32,16,2,36,35,37,30,33,34,38,39,64,70,19,254,171,25,255,26,7,12,27,28,41,45,48,49,256,13,46,50,257]))),jm=Am.Component,Mm=s(()=>a(()=>import(`./WorldOverlay-D5FWgYe3.js`).then(e=>({default:e.WorldOverlay})),__vite__mapDeps([258,31,1,32,16,2,61,37,64,66,71,190,191,88,19,226,20,80,81,30,33,34,35,36,38,39,82,172,42,43,9,44,45,46,47,259,260,57,58,59,261,262,263]))),Nm=Mm.Component,Pm=s(()=>a(()=>import(`./SynthesisOverlay-CAK5h0hB.js`).then(e=>({default:e.SynthesisOverlay})),__vite__mapDeps([264,31,1,16,25,26,7,12,27,28,45,253,32,2,36,35,37,30,33,34,38,39,64,70,19,254,171,255,41,48,49,256,13,46,50,257]))),Fm=Pm.Component,Im=s(()=>a(()=>import(`./PresentationDeck-CoPmOr2f.js`).then(e=>({default:e.PresentationDeck})),__vite__mapDeps([265,31,1,32,16,30,33,34,2,35,36,37,38,39,184,62,15,4,63,17,185,69,71,58,74,73,75,76,186,187,188,189,160,66,161,162,163,190,191,43,88,192,193,194,195,196,197,18,198,199,200,59,201,202,203,204,205,206,207,208,209,210,211,212,19,213,214,215,216,217,218,65,219,220,221,222,223,224,225,226,81,20,227,228,72,229,230,231,232,233,64,137,234,235,236,237,238,239,240,241,242,243,21,244,180,11,245,246]))),Lm=Im.Component,Rm=s(()=>a(()=>import(`./DelegatePanel-DaJTDkYu.js`).then(e=>({default:e.DelegatePanel})),__vite__mapDeps([266,31,1,32,16,30,33,34,2,35,36,37,38,39,64,161,162,20,81,97,98,26,7,12,27,25,28,267]))),zm=Rm.Component,Bm=s(()=>a(()=>import(`./SrsReview-Gr6Y0QTQ.js`).then(e=>({default:e.SrsReview})),__vite__mapDeps([268,31,1,16,64,104,106,269]))),Vm=Bm.Component,Hm=s(()=>a(()=>import(`./TourPrism-Y47m-KGq.js`).then(e=>({default:e.TourPrism})),__vite__mapDeps([270,31,1,32,16,253,2,36,35,37,30,33,34,38,39,64,70,19,254,171,25,255,26,7,12,27,28,41,45,48,49,256,13,46,50,257]))),Um=Hm.Component;function $({children:e,label:t=`Feature`}){return(0,G.jsx)(f,{label:t,overlay:!0,children:e})}function Wm(){try{window.location.hash=``}catch{}}function Gm(e){return y(e)??Promise.resolve()}function Km(e){let t=e.toLowerCase().trim().replace(/[.,!?]+$/,``);return t.split(/\s+/).filter(Boolean).length<=3&&/^(yeah|yep|yes|ok|okay|sure|right|uh huh|uh-huh|mhm|mm|hmm|hm|go on|go ahead|carry on|continue|keep going|please continue|please go on|go ahead|keep it up|got it|alright)$/.test(t)?!0:/\b(keep going|go on|continue|carry on|go ahead|please continue|please go on)\b/.test(t)}function qm(){let[e]=en(),t=xt(e.provider),n=e.models[e.provider]||t.defaultModel;(0,W.useLayoutEffect)(()=>S(document),[]),(0,W.useEffect)(()=>{let t=document.documentElement;return e.fontScale===`normal`?delete t.dataset.fontScale:t.dataset.fontScale=e.fontScale,()=>{delete t.dataset.fontScale}},[e.fontScale]);let r=(0,W.useRef)(u()),i=(0,W.useRef)(Or()),s=(0,W.useRef)(c()),f=(0,W.useRef)(s.current?b():null),p=(0,W.useRef)(s.current?j():!1),m=(0,W.useRef)((()=>{if(s.current)return null;let e=C();return e&&I(e)?e:null})()),_=(0,W.useRef)(m.current?T():null);(0,W.useEffect)(()=>{s.current&&h(),f.current&&F(),p.current&&D(),m.current&&w()},[]);let[v,y]=(0,W.useState)(``),{attached:A,setAttached:P,attachError:R,setAttachError:z,turnHadFiles:ee,setTurnHadFiles:ae,onFiles:se,removeAttachment:ce}=Lp(),[le,ue]=(0,W.useState)([]),[fe,me]=(0,W.useState)(!1),{askHintSeen:he,dismissAskHint:ge}=Vp(),[H,ve]=(0,W.useState)(!1),[be,xe]=(0,W.useState)(`idle`),[Ce,Te]=(0,W.useState)(!1),Ee=be===`transcribing`||Ce,[ke,Ae]=(0,W.useState)(null),[Me,Pe]=(0,W.useState)(null),[Le,Ve]=(0,W.useState)(null),[U,He]=(0,W.useState)(!1),[Ue,We]=(0,W.useState)(!1),[Ge,qe]=(0,W.useState)(!1),[Ye,et]=(0,W.useState)(!1),[ut,ft]=(0,W.useState)(null),[pt,mt]=(0,W.useState)(!1),[ht,gt]=(0,W.useState)(null),[_t,vt]=(0,W.useState)(null),[St,Ct]=(0,W.useState)(()=>new Set),[Tt,kt]=(0,W.useState)(null),[Nt,Lt]=(0,W.useState)(null),Ut=(0,W.useRef)(void 0),[Wt,Gt]=(0,W.useState)(null),Kt=(0,W.useRef)(void 0),[qt,Jt]=(0,W.useState)(!1),[Yt,Xt]=(0,W.useState)(!1),[Qt,$t]=(0,W.useState)(!1),[an,ln]=(0,W.useState)(!1),[un,pn]=(0,W.useState)(!1),[mn,hn]=(0,W.useState)(()=>mr().length),gn=Xn().length;(0,W.useEffect)(()=>{let e=()=>{window.removeEventListener(`focusin`,t),window.removeEventListener(`pointerdown`,t)};function t(t){(t.target instanceof Element?t.target:null)?.closest(`.composer, .mic-btn`)&&(e(),dn())}return window.addEventListener(`focusin`,t),window.addEventListener(`pointerdown`,t,{passive:!0}),e},[]),(0,W.useEffect)(()=>Ar(),[]);let[vn,yn]=(0,W.useState)(null),[bn,xn]=(0,W.useState)(null),[Cn,Tn]=(0,W.useState)(null),En=(0,W.useCallback)(e=>{e.length>=4?Tn(e):e.length>0&&yn(e)},[]),[Dn,An]=(0,W.useState)(null);(0,W.useEffect)(()=>{O()&&(g(),An(hr))},[]);let[jn,Mn]=(0,W.useState)({open:!1,spec:null}),[Nn,Fn]=(0,W.useState)(!1),In=(0,W.useRef)(!1);In.current=Nn;let[Ln,Rn]=(0,W.useState)(!1),zn=(0,W.useRef)(0),Bn=(0,W.useCallback)(()=>{let e=++zn.current;Rn(!0);let t=()=>{zn.current===e&&(Rn(!1),Fn(!0))};Im.preload().then(t,t)},[]);(0,W.useEffect)(()=>()=>{zn.current+=1},[]);let[Vn,Hn]=(0,W.useState)(()=>Uf()),[Un,Wn]=(0,W.useState)(!1),[Gn,qn]=(0,W.useState)(new Set),[Jn,Yn]=(0,W.useState)(null),[Zn,Qn]=(0,W.useState)(null),[$n,er]=(0,W.useState)(null),[ur,br]=(0,W.useState)(!1),Sr=(0,W.useCallback)((e,t=!1)=>{er(e),br(e!==null&&t)},[]),Pr=(0,W.useCallback)(()=>{er(null),br(!1)},[]),Fr=(0,W.useRef)(new rd).current,Ir=(0,W.useMemo)(()=>e.quality===`fast`?null:sn(e),[e]),[Br,Vr]=(0,W.useState)(!1),Ur=(0,W.useRef)(!1);Ur.current=Br;let Wr=(0,W.useRef)([]),[Gr,Kr]=(0,W.useState)(0),qr=(0,W.useRef)(0),Jr=jf(Br,Gr),[Yr,Zr]=(0,W.useState)(!1),Qr=(0,W.useRef)(!1);Qr.current=Yr;let ti=(0,W.useRef)([]),K=xf((0,W.useMemo)(()=>sn(e),[e])),ri=(0,W.useRef)(K);ri.current=K;let q=(0,W.useRef)(null),ii=(0,W.useRef)(!1),ai=(0,W.useRef)(`idle`),oi=(0,W.useCallback)(()=>{let e=ti.current.join(` `).trim();e&&ri.current.phase===`listening`&&ri.current.onSpeechEnd(e)},[]),si=Sn(),[ci,li]=(0,W.useState)(!1),[ui,di]=(0,W.useState)(()=>{try{return localStorage.getItem(Gp)===`true`}catch{return!1}});(0,W.useEffect)(()=>{try{localStorage.setItem(Gp,String(ui))}catch{}},[ui]);let[fi,pi]=(0,W.useState)(!1),[mi,hi]=(0,W.useState)(!1),[gi,_i]=(0,W.useState)(!1),[vi,yi]=(0,W.useState)(),[bi,xi]=(0,W.useState)(!1);(0,W.useEffect)(()=>{gi||xi(!1)},[gi]);let{open:Si,openPalette:Ci,closePalette:wi}=M(),[Ti,Ei]=(0,W.useState)(!1),[Di,J]=(0,W.useState)(0),[ki,Ai]=(0,W.useState)(0),[ji,Mi]=(0,W.useState)(!1),[Ni,Pi]=(0,W.useState)(()=>{try{return localStorage.getItem(Ra)===`true`}catch{return!1}}),[Fi,Ii]=(0,W.useState)(!1),Li=(0,W.useRef)(null),[zi,Bi]=(0,W.useState)(()=>{try{return localStorage.getItem(Jp)===`true`}catch{return!1}}),Hi=Ni?`always`:zi?`hold`:`tap`;(0,W.useEffect)(()=>{try{let e=je(localStorage.getItem(`mavea-voice-mavea`)||`heart`);e&&Fe(`mavea`,e.kokoro)}catch{}},[]),(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e,t=t=>{let n=t.detail?.changed;Array.isArray(n)&&n.length>0&&(hi(!0),e&&clearTimeout(e),e=setTimeout(()=>hi(!1),2600))};return window.addEventListener(Pn,t),()=>{window.removeEventListener(Pn,t),e&&clearTimeout(e)}},[]);let Ui=(0,W.useCallback)(e=>{try{localStorage.setItem(Ra,String(e))}catch{}},[]);(0,W.useEffect)(()=>{let e=Li.current;Ui(e?e.enabled:Ni)},[Ni,Ui]),(0,W.useEffect)(()=>{try{localStorage.setItem(Jp,String(zi))}catch{}},[zi]);let Wi=(0,W.useRef)(null),Gi=(0,W.useRef)(U);Gi.current=U;let Ki=(0,W.useRef)(null),[qi,Ji]=(0,W.useState)(null),[Yi,Xi]=(0,W.useState)(!1),Zi=(0,W.useRef)([]),Qi=(0,W.useRef)(()=>{}),$i=(0,W.useCallback)(e=>{Gi.current||Wi.current?.setMaveaSpeaking(!0);let t=!De(),n=Se(e,`mavea`);return t&&(Ki.current=n),n},[]);(0,W.useEffect)(()=>{Oe(U),U?Wi.current?.setMaveaSpeaking(!1):De()&&Wi.current?.setMaveaSpeaking(!0)},[U]);let[ea]=(0,W.useState)(()=>r.current||i.current?(Dt(),null):s.current||m.current?null:Et()),ta=(0,W.useRef)(Ot()).current,Y=_s({canRun:k,getConfig:()=>sn(nn()),configReady:rn,canvasReady:()=>Gi.current||Ie()===!1?Promise.resolve():Xe(()=>ga.current),getCaps:()=>tn(nn()),speak:$i,cancelSpeak:ze,getLibraryEnabled:()=>nn().libraryEnabled,initial:ea?hs(ea):void 0}),na=Gd(H,ke,Ir,Y.busy),ra=(0,W.useCallback)(()=>{window.location.hash=`#/live`,window.location.reload()},[]),aa=(0,W.useCallback)(()=>{L(),window.location.hash=`#/live`,window.location.reload()},[]),oa=(0,W.useRef)(`normal`);oa.current=Y.phase;let ca=(0,W.useRef)(null);ca.current=Y.activeBlank;let la=(0,W.useRef)([]);la.current=Y.spec?.blanks??[],(0,W.useEffect)(()=>{cn()},[]),(0,W.useEffect)(()=>{s.current||m.current||Y.frames.length>0&&wt(Y.history,Y.frames)},[Y.frames,Y.history]),(0,W.useEffect)(()=>{if(!(Y.frames.length===0||Y.busy))return o(Cm.preload)},[Y.frames.length,Y.busy]),(0,W.useEffect)(()=>{if(!s.current)return;let e=p.current&&f.current===`prism`;if(!(p.current&&!e))return o(()=>Promise.all([Hm.preload(),ua()]).then(()=>void 0),e?300:2500)},[]);let da=(0,W.useMemo)(()=>Y.frames.map((e,t)=>({index:t,label:e.question?_e(e.question):`Answer ${t+1}`,spec:e.spec})),[Y.frames]),fa=(0,W.useCallback)(e=>{if(e.length){if(!tr().styleAsked&&sr().length===e.length){Gt({count:e.length,deck:e[0].deck}),Kt.current&&clearTimeout(Kt.current),Kt.current=setTimeout(()=>{nr(),Gt(null)},12e3);return}Lt({count:e.length,ids:e.map(e=>e.id)}),Ut.current&&clearTimeout(Ut.current),Ut.current=setTimeout(()=>Lt(null),6e3)}},[]),ma=(0,W.useCallback)(e=>{Kt.current&&clearTimeout(Kt.current),e?rr(e):nr(),Gt(null)},[]);(0,W.useEffect)(()=>()=>{Ut.current&&clearTimeout(Ut.current),Kt.current&&clearTimeout(Kt.current)},[]),(0,W.useEffect)(()=>{if(!e.autoSaveFlashcards)return;let t=Y.frames[Y.frames.length-1];if(!t)return;let n=lu(t.spec.blocks);if(n.length>0){let e=ar(n,{deck:t.spec.topic||t.spec.title||`General`,origin:`auto`});fa(e)}},[Y.frames,e.autoSaveFlashcards,fa]);let ha=(0,W.useCallback)(t=>{let n=Y.viewSpec??Y.spec,r=n?.topic||n?.title||`General`,{cards:i,exact:a}=bu(t),o={ts:Date.now(),...t.id?{blockId:t.id}:{},...Me?{question:Me}:{},...n?.topic?{topic:n.topic}:{}},s=sn(e),c=!!s.apiKey;kt({block:t,initial:i,deck:r,source:o,enrich:!a&&c?()=>wu(t,s):void 0})},[Y.viewSpec,Y.spec,Me,e]),ga=(0,W.useRef)(null),_a=(0,W.useRef)(null),va=(0,W.useRef)(()=>{}),ya=(0,W.useRef)([]),ba=(0,W.useRef)(()=>{}),xa=(0,W.useRef)(()=>{});ba.current=()=>{let e=document.querySelector(`.bend-slider`);if(!e)return;e.scrollIntoView({block:`center`,behavior:`smooth`});let t=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set;if(!t)return;ya.current.forEach(e=>window.clearTimeout(e)),ya.current.length=0;let n=Number(e.min||0),r=Number(e.max||100),i=Number(e.step||1)||1,a=Number(e.value),o=Math.min(r,n+(r-n)*.78);for(let n=1;n<=26;n++)ya.current.push(window.setTimeout(()=>{let r=a+(o-a)*n/26,s=Math.round(r/i)*i;t.call(e,String(s)),e.dispatchEvent(new Event(`input`,{bubbles:!0}))},500+n*90))},(0,W.useEffect)(()=>{let e=ya.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]);let Sa=(0,W.useRef)(()=>{}),Ca=(0,W.useRef)(null),wa=(0,W.useRef)(null),Ta=(0,W.useRef)(null),Ea=x(),Da=(0,W.useRef)(!1),Oa=(0,W.useRef)(null),ka=(0,W.useRef)(!1),Aa=(0,W.useRef)(null),[ja,Ma]=(0,W.useState)(!1),[Na,Pa]=(0,W.useState)(!1),Fa=(0,W.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id,i=n.saySpoken??n.say;r&&i&&e.set(r,i)}return e},[Y.tour,Y.spec]),Ia=(0,W.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id;r&&n.mark&&e.set(r,n.mark)}return e},[Y.tour,Y.spec]),Ba=(0,W.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id,i=n.marks??(n.mark?[n.mark]:[]);r&&i.length&&e.set(r,i)}return e},[Y.tour,Y.spec]),[Va,Ha]=(0,W.useState)([]),[Ua,Wa]=(0,W.useState)(()=>new Set),qa=(0,W.useCallback)(e=>{Wa(t=>t.has(e)?t:new Set(t).add(e))},[]),Ja=(0,W.useMemo)(()=>Va.filter(e=>e.noteText!==void 0||Ua.has(e)),[Va,Ua]),Ya=(0,W.useRef)(Date.now());(0,W.useEffect)(()=>{Ha([]),Wa(new Set),Ya.current=Date.now()},[Y.turn]);let[Xa,Za]=(0,W.useState)(!1);(0,W.useEffect)(()=>Za(!1),[Y.turn]);let[Qa,$a]=(0,W.useState)(()=>new Set);(0,W.useEffect)(()=>$a(new Set),[Y.turn]);let eo=(0,W.useRef)(!1);(0,W.useEffect)(()=>{let e=!!Y.error;e&&!eo.current&&ga.current?.scrollTo({top:0,behavior:`smooth`}),eo.current=e},[Y.error]);let[to,no]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=ga.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>no(e.clientWidth>=1280),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[Y.turn]);let ro=(0,W.useMemo)(()=>Va.filter(e=>e.noteText&&!Qa.has(e.spot)).map(e=>({spot:e.spot,text:e.noteText})),[Va,Qa]),{bookmarks:oo,toggleBookmark:so}=zp(),lo=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(!Xa)return;function e(e){lo.current&&!lo.current.contains(e.target)&&Za(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[Xa]);let fo=(0,W.useRef)(Y.spec);fo.current=Y.spec;let po=(0,W.useCallback)((e,t,n,r,i,a,o,s)=>{e&&Ha(c=>{if(s?c.some(t=>t.spot===e&&t.noteText!==void 0):c.some(t=>t.spot===e&&t.kind===n?.kind&&t.at===n?.at&&t.noteText===void 0))return c;let l=!t&&!n?.at?fo.current?.blocks.find(t=>t.id===e)??null:null,u=n?.kind===`connect`&&typeof n.onIndex==`number`?fo.current?.blocks[n.onIndex]?.id:void 0,d={spot:e,line:t??(l?re(l):void 0),mark:n,generous:r,kind:n?.kind??(s?`note`:void 0),at:n?.at,...n?.kind===`connect`&&n.to?{to:n.to}:{},color:n?.color,inkedAt:Date.now(),...i?{delayMs:i}:{},...a?{badgeMs:a}:{},...o?{stepNumber:o}:{},...u?{toSpot:u}:{},...s?{noteText:s}:{}};return[...c,d]})},[]),yo=e.teachMode||$c(Me),bo=(0,W.useRef)(e.annotationsEnabled);bo.current=e.annotationsEnabled;let xo=(0,W.useRef)(Ni);xo.current=Ni;let So=(0,W.useRef)(null);So.current=Y.narration??null;let Co=(0,W.useRef)(!1),wo=(0,W.useRef)(!1);wo.current=Y.busy;let To=(0,W.useRef)(null),Eo=(0,W.useRef)(Y.frames);Eo.current=Y.frames;let Do=(0,W.useRef)([]),Oo=(0,W.useCallback)(()=>{let e=!bo.current;To.current=null,on({annotationsEnabled:e,teachMode:e}),e?(Ha(Do.current),Do.current=[]):Ha(e=>(Do.current=e,[]))},[]),ko=(0,W.useRef)(null),Ao=(0,W.useCallback)((e,t)=>{let n=_a.current,r=n?.querySelector(`[data-spot-id="${CSS.escape(e)}"]`);if(!r)return;let i=t?n?.querySelector(`[data-spot-id="${CSS.escape(t)}"]`):null,a=ga.current;if(i&&a){let e=a.getBoundingClientRect(),t=r.getBoundingClientRect(),n=i.getBoundingClientRect(),o=(Math.min(t.top,n.top)+Math.max(t.top+t.height,n.top+n.height))/2-e.top-a.clientHeight/2;a.scrollTo({top:Math.max(0,a.scrollTop+o),behavior:`smooth`})}else r.scrollIntoView({behavior:`smooth`,block:`center`});let o=[r,i].filter(e=>!!e);o.forEach(e=>e.classList.add(`ink-jump-glow`)),ko.current!=null&&window.clearTimeout(ko.current),ko.current=window.setTimeout(()=>{o.forEach(e=>e.classList.remove(`ink-jump-glow`)),ko.current=null},800)},[]);(0,W.useEffect)(()=>()=>{ko.current!=null&&window.clearTimeout(ko.current)},[]);let jo=(0,W.useRef)(null),Mo=(0,W.useCallback)((e,t)=>{Y.jumpTo(e),t&&(jo.current!=null&&cancelAnimationFrame(jo.current),jo.current=requestAnimationFrame(()=>{jo.current=null,Ao(t)}))},[Y,Ao]);(0,W.useEffect)(()=>()=>{jo.current!=null&&cancelAnimationFrame(jo.current)},[]);let No=(0,W.useCallback)(e=>{$a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[Po,Fo]=$r(),[Io,Lo]=(0,W.useState)(0),Ro=(0,W.useRef)(Po);Ro.current!==Po&&(Ro.current=Po,Lo(e=>e+1));let zo=(0,W.useCallback)(()=>{let e=To.current;e&&(To.current=null,bo.current=e.annotationsEnabled,on(e))},[]),Bo=(0,W.useCallback)(()=>{if(bo.current)return;let{annotationsEnabled:e,teachMode:t}=nn();To.current??={annotationsEnabled:e,teachMode:t},bo.current=!0,on({annotationsEnabled:!0,teachMode:!0})},[]),Vo={isBusy:()=>Y.busy||ka.current,isSpeaking:()=>De(),hasCanvas:()=>!!Y.spec,showFrame:(e,t,n)=>{Pe(t),y(``),Y.showFrame(e,t,{interrupt:!1,revealNow:Gi.current,silent:n?.silent})},typeInto:y,speak:e=>(nl(e),$i(e)),cancelSpeech:ze,setMuted:He,setViewMode:Fo,setInkArmed:me,setPresenting:Fn,setShareOpen:We,setPaletteOpen:e=>e?Ci():wi(),pressKeepGoing:e=>{let t=document.querySelectorAll(`.footer-keepgoing .kg-row`),n=Array.from(t).find(t=>t.textContent?.includes(e))??t[0];n&&(n.classList.add(`kg-tour-press`),window.setTimeout(()=>n.classList.remove(`kg-tour-press`),620))},pinFirstBlock:()=>{let e=fo.current?.blocks.find(e=>!!e.id);e&&Is(e)},pinFirstBlocks:e=>{let t=(fo.current?.blocks??[]).filter(e=>!!e.id).slice(0,e);ue(t)},startWatchThinking:()=>{Zr(!0),Qr.current=!0},bankThought:e=>{ti.current=[...ti.current,e],K.onTranscript(ti.current.join(` `))},openAtlas:()=>{if(mr().length<3){for(let e of[`money`,`space`,`travel`,`budget`]){let t=ni(e),n=t?.frames[0]?.spec;t&&n&&jt(n,t.question)}hn(pr(Mt()))}pn(!0)},openPrism:e=>{ua().then(t=>{Go.current.chapter?.action.kind===`prism`&&xn(t[e]??null)})},showcaseFeature:e=>{if(e===`library`&&Mt().length<3)for(let e of[`money`,`space`,`travel`]){let t=ni(e),n=t?.frames[0]?.spec;t&&n&&jt(n,t.question)}if(e===`deepzoom`){window.location.hash=`#/deepzoom?demo=1`;return}if(e===`synthesis`){window.location.hash=`#/synthesis?demo=1`;return}if(e===`living-answer`&&Zi.current.length===0){a(async()=>{let{WORLD_SEED:e}=await import(`./seed-D_P5jyog.js`);return{WORLD_SEED:e}},[]).then(({WORLD_SEED:e})=>{Ji({type:`world`,id:`tour-world`,col:12,props:{title:e.title,world:e}}),Xi(!0),Qi.current(`tour-world`)});return}Ho.current[e]?.run()},setSpot:e=>Y.setSpot(e),scriptedMark:()=>va.current(),drawPenTourStep:e=>{Bo(),e===`result`?(ga.current?.scrollTo({top:0,behavior:`smooth`}),po(`live-1`,`After thirty years, the investment reaches seventy-six thousand one hundred twenty-three dollars.`,{kind:`circle`,at:`$76,123`,color:`key`},!1,void 0,5600,1)):po(`live-1`,`Compounding grows the original investment by more than seven point six times.`,{kind:`underline`,at:`7.6x`,color:`warm`},!1,void 0,3e3,2)},drawPenOnFirstBlock:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e?.id&&(Bo(),ga.current?.scrollTo({top:0,behavior:`smooth`}),po(e.id,e.note,void 0,!0,void 0,3200))},openDashboards:()=>{let e=pa();e?ft(e):et(!0)},dashboardShowSettings:()=>mt(!0),openModelSettings:()=>{yi(`model`),_i(!0)},openExport:()=>qe(!0),shareRemix:()=>{document.querySelector(`.shm-remix`)?.click()},sharePalette:e=>{Array.from(document.querySelectorAll(`.shm-chip`)).find(t=>t.textContent?.trim().toLowerCase()===e.toLowerCase())?.click()},exportSetFormat:e=>{document.querySelector(`[data-export-format="${e}"]`)?.click()},exportPickTemplate:e=>{document.querySelectorAll(`[data-export-template]`)[e]?.click()},toggleRail:()=>di(e=>!e),bendIt:()=>ba.current(),openFlashcards:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e&&ha(e)},openTourCourse:()=>xa.current(),fireMemoryGlow:()=>{hi(!0),window.setTimeout(()=>hi(!1),2600)},stopRevealWalk:()=>{Da.current=!0},closeAllOverlays:()=>{Y.setSpot(null),ue([]),y(``),Fo(`everything`),me(!1),Sa.current(),Ha([]),Wa(new Set),$a(new Set),Za(!1),Fn(!1),We(!1),wi(),An(null),pn(!1),yn(null),xn(null),Tn(null),kt(null),ln(!1),qe(!1),et(!1),ft(null),mt(!1),di(!1),Xt(!1),$t(!1),_i(!1),Zr(!1),Vr(!1),Ss(null),ws(0),Es(null)}},Ho=(0,W.useRef)({}),Uo=Oi({active:s.current,startChapter:f.current,solo:p.current,ops:Vo}),Wo=ia({active:!!m.current,personaId:m.current,startStep:_.current,ops:Vo}),Go=(0,W.useRef)(Uo);Go.current=Uo,(0,W.useEffect)(()=>{if(!s.current)return;let e=e=>{let t=Go.current;if(e.key===`Escape`)t.skip();else if(Qp(e))return;else e.key===`ArrowRight`?(e.preventDefault(),t.next()):e.key===`ArrowLeft`?(e.preventDefault(),t.prev()):(e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),t.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Ko=(0,W.useRef)(Wo);Ko.current=Wo,(0,W.useEffect)(()=>{if(!m.current)return;let e=e=>{let t=Ko.current;if(e.key===`Escape`)t.skip();else if(Qp(e))return;else e.key===`ArrowRight`?(e.preventDefault(),t.next()):e.key===`ArrowLeft`?(e.preventDefault(),t.prev()):(e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),t.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{(Uo.done||Wo.done)&&zo()},[Uo.done,Wo.done,zo]),(0,W.useEffect)(()=>()=>zo(),[zo]);let{narrate:qo,narratingId:Jo}=Hr({takeWheel:()=>{Da.current=!0},hush:ze,moveSpot:e=>{Y.setSpot(e.id??null),bo.current&&po(e.id,e.note??(e.id?Fa.get(e.id):void 0)??void 0,e.id?Ia.get(e.id):void 0,!0)},canSpeak:()=>!Gi.current,lineFor:e=>e.noteSpoken??e.note??(e.id?Fa.get(e.id):void 0)??ie(e),speakLine:$i},Y.turn),[Yo,Xo]=(0,W.useState)(!1),[Zo,Qo]=(0,W.useState)(!!ea||!!r.current&&xs()||!!i.current&&xs()||s.current||!!m.current),$o=wn();(0,W.useEffect)(()=>{hn(pr($o))},[$o]),(0,W.useEffect)(()=>{let e=Y.spec;if(!e||Oa.current===Y.turn)return;if(Oa.current=Y.turn,ea&&Y.turn===0){Y.spot&&Y.setSpot(null);return}if(s.current&&!Y.narration&&Y.tour.length===0){Y.spot&&Y.setSpot(null);return}let t=[];for(let n of Y.tour){let r=e.blocks[n.index]?.id;r&&t.push(n.say?{spot:r,say:n.say}:{spot:r})}let n=[];if(t.length?n=ct(e.blocks,{opener:Y.narration,tour:t,maxStops:5}):st({blockCount:e.blocks.length,mode:Y.mode,hasModelTour:!1,teach:yo})&&(n=ct(e.blocks,{opener:Y.narration,maxStops:yo?e.blocks.length:3,startId:Y.spot??void 0})),!n.length){Y.spot&&Y.setSpot(null);return}let r=t.length>0,i=Gi.current&&r&&bo.current;Ma(i);let a=n.map(e=>({spot:e.set&&`spot`in e.set?e.set.spot??void 0:void 0,line:e.set&&`caption`in e.set?e.set.caption:void 0}));if(Gi.current){if(bo.current){let e=uo({stops:a,spokenWalk:r,withNotes:i,teach:yo,marksById:Ba});for(let t of e)po(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}Y.setSpot(null);return}Da.current=!1,ka.current=!0;let o=!1,c,l,u=0,d=null,f=()=>{d&&=(d(),null)},p=()=>{ka.current=!1,Aa.current=null,l&&clearTimeout(l),Pa(!1),nl(null)},m=()=>o?!0:Da.current?(p(),Y.setSpot(null),!0):!1,h=(e,t)=>{if(e!==void 0&&Y.setSpot(e??null),r&&t&&nl(t),e&&bo.current){let n=Ba.get(e);if(n?.length){let r=lt+(n.length-1)*900,i=n.length>1;for(let a=0;a<n.length;a++){let o=a*900,s=a===n.length-1?r:void 0;po(e,t,n[a],yo,o,s,i?a+1:void 0)}}else yo&&po(e,t,void 0,yo)}},g=e=>{let t=e&&!Gi.current&&!oe()?ye(e):null;if(!t){b();return}d=t.release,mo(t,{speakLine:$i,isCancelled:()=>o,isDismissed:()=>Da.current},e=>{if(d=null,e===`dismissed`){p(),Y.setSpot(null);return}e!==`cancelled`&&b()})},_=e=>{let t=e.set&&`spot`in e.set?e.set.spot:void 0,n=e.set&&`caption`in e.set?e.set.caption:void 0;return(t?Fa.get(t):void 0)??n},v=e=>{for(let t=e+1;t<n.length;t++){let e=_(n[t]);if(e){we(e,`mavea`);return}}},y=async(e,t,n,r,i)=>{let a=e.ms??1700;if(t===0||!i){if(h(n,r),v(t),await $e({floorMs:at,capMs:Ze(a)}),m())return;g(n);return}let o=$i(i),s=await Qe(o);m()||(h(n,r),v(t),s?await ot(o,a):await it(a),!m()&&g(n))},b=()=>{if(o||u>=n.length){p();return}if(Da.current){p(),Y.setSpot(null);return}let e=u,t=n[u++],i=t.set&&`caption`in t.set?t.set.caption:void 0,a=t.set&&`spot`in t.set?t.set.spot:void 0,s=_(t);r?y(t,e,a,i,s):(h(a,i),c=setTimeout(b,t.ms??0))};return Aa.current=()=>{if(o=!0,c&&clearTimeout(c),f(),ze(),bo.current){let e=uo({stops:a,from:u,spokenWalk:r,withNotes:!1,teach:yo,marksById:Ba});for(let t of e)po(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}p(),Y.setSpot(null)},(async()=>{l=setTimeout(()=>{o||Pa(!0)},600);let t=ga.current;await nt({loadFams:()=>te(ne(e.blocks)),settle:t?()=>yt(t,{timeoutMs:rt,perImageMs:tt}):void 0,firstLine:Ki.current,wantVoice:!Gi.current&&Ie()!==!1}),l&&clearTimeout(l),Pa(!1),!m()&&b()})(),()=>{o=!0,Aa.current=null,ka.current=!1,c&&clearTimeout(c),l&&clearTimeout(l),Pa(!1),f()}},[Y.turn]),(0,W.useEffect)(()=>{let e=Y.spot,t=Y.spec;if(!t||!e)return;let n=0,r=0,i=()=>{let a=ga.current;if(!a)return;let o=a.querySelector(`.spotlit`);if(!o){++n<12&&(r=window.setTimeout(i,90));return}let s=a.getBoundingClientRect(),c=o.getBoundingClientRect(),l=c.top-s.top-(a.clientHeight-c.height)/2,u=Ba.get(e)?.find(e=>e.kind===`connect`),d=u&&typeof u.onIndex==`number`?t.blocks[u.onIndex]?.id:void 0,f=d?a.querySelector(`[data-spot-id="${CSS.escape(d)}"]`):null;if(f){let e=f.getBoundingClientRect(),t=(Math.min(c.top,e.top)+Math.max(c.top+c.height,e.top+e.height))/2-s.top-a.clientHeight/2,n=a.clientHeight*.35;l=Math.max(l-n,Math.min(l+n,t))}a.scrollTo({top:Math.max(0,a.scrollTop+l),behavior:`smooth`})};return r=window.setTimeout(i,90),()=>window.clearTimeout(r)},[Y.spot,Y.spec,Ba]);let es=(0,W.useCallback)(()=>{Y.spot&&(Da.current=!0,Y.setSpot(null))},[Y]),ts=(0,W.useCallback)(()=>{let e=Aa.current;e?e():(ze(),es())},[es]),[ns,rs]=(0,W.useState)(!1),[is,as]=(0,W.useState)(!1),os=(0,W.useCallback)(async(...e)=>{(0,Nr.flushSync)(()=>rs(!0)),as(!0);try{await te(ne(e[0].blocks))}catch{}finally{as(!1)}Y.restore(...e)},[Y]);(0,W.useEffect)(()=>{Y.busy&&rs(!0)},[Y.busy]),(0,W.useEffect)(()=>{rs(!1)},[Y.turn]),(0,W.useEffect)(()=>{if(!Y.spot)return;let e=e=>{e.key===`Escape`&&ts()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Y.spot,ts]);let[ss,cs]=(0,W.useState)(null);(0,W.useEffect)(()=>cs(null),[Y.turn]),(0,W.useEffect)(()=>Ei(!1),[Y.turn]),(0,W.useEffect)(()=>ue([]),[Y.turn]),(0,W.useEffect)(()=>li(!1),[Y.turn]);let[ls,us]=(0,W.useState)(null),ds=(0,W.useRef)(!1),fs=(0,W.useCallback)(e=>{ds.current=!0,us(e)},[]);(0,W.useEffect)(()=>{if(ds.current){ds.current=!1;return}us(null)},[Y.turn]);let ps=(()=>{let e=Y.spec?.blocks.find(e=>e.type===`insight`);return e&&e.type===`insight`?e.props.conf:void 0})(),ms=Pl({resetKey:Y.turn,onCommit:e=>{let{intents:t,blocks:n}=zl(e,(Y.viewSpec??Y.spec)?.blocks??[]);if(!t.length)return;let r=Rl([...le,...n]);ue([]),Y.run(Ll(t),void 0,r.length?r:void 0,void 0,t)}});va.current=()=>{let e=_a.current,t=e?.querySelector(`[data-spot-id]`);!e||!t||(t.scrollIntoView({block:`center`,behavior:`smooth`}),window.setTimeout(()=>vs(e,t),560))};let vs=(e,t)=>{let n=e.querySelector(`.ink-user-overlay`);if(!n)return;let r=(Array.from(t.querySelectorAll(`*`)).filter(e=>e.children.length===0&&e.offsetHeight>0&&/\d/.test(e.textContent??``)).map(e=>({el:e,size:parseFloat(getComputedStyle(e).fontSize)})).sort((e,t)=>t.size-e.size)[0]?.el??t).getBoundingClientRect(),i=n.getBoundingClientRect(),a=Mp(r,i);ms.onStroke(a,{stage:e,svgRect:i});let o=t.getAttribute(`data-spot-id`);o&&Y.setSpot(o)};Sa.current=()=>ms.clear();let ys=(0,W.useCallback)((t,n=!1)=>{let r=t.trim();if(Qr.current&&r){y(``),q.current!==null&&(window.clearTimeout(q.current),q.current=null),ti.current=[...ti.current,r],K.onTranscript(ti.current.join(` `));return}if(r&&(/^diff --git /m.test(r)||/^@@ .* @@/m.test(r))){let t=gr(_r(r));if(t.changes.length>0){y(``),An(t);let n=sn(e);n&&vr(t,r,n).then(e=>An(t=>t&&e));return}}if(!r&&A.length===0&&ms.intents.length===0)return;let i=Y.refuseReason(r,A.length>0||ms.intents.length>0);if(i&&!(n&&i===`busy`)){Ve(gs[i]);return}Ae(null),Pe(r||null),y(``);let a=A;ae(a.length>0),P([]),z(null);let o=Y.viewSpec??Y.spec,{intents:s,blocks:c}=zl(ms.intents,o?.blocks??[]),l=Rl([...le,...c]);ue([]),ms.clear(),Y.run(r||Ll(s),a.length?a:void 0,l.length?l:void 0,void 0,s.length?s:void 0,void 0,void 0,n?{force:!0}:void 0)},[Y,A,le,ms,K,e,Ae,P,z,ae]);(0,W.useEffect)(()=>{if(r.current&&xs()){let e=r.current;r.current=``,ys(e)}},[]);let[bs,Ss]=(0,W.useState)(null),[Cs,ws]=(0,W.useState)(0),[Ts,Es]=(0,W.useState)(null),Ds=(0,W.useRef)(null),Os=(0,W.useCallback)((e,t)=>{let n=e.lessons[t];if(!n)return;let r=Cr(e.id);Ss(e),ws(t),Es(r),xr(e.id,t),Qo(!0);let i=`Lesson ${t+1}: ${n.title}`,a=yr(e.id,n.id);if(a){Pe(i),Y.showFrame(a,i);return}let o=kr(e,t,r,jr(e.topic));Ds.current={courseId:e.id,lessonId:n.id,framesBefore:Y.frames.length},Pe(i),Y.run(`Teach this lesson: "${n.title}" — ${n.goal}`,void 0,void 0,void 0,void 0,i,void 0,{lesson:o})},[Y]);xa.current=()=>{let e=Ou();if(!e)return;let t=e.lessons[0];Ss(e),ws(0),Es(Cr(e.id)),xr(e.id,0),Qo(!0);let n=yr(e.id,t.id);if(n){let e=`Lesson 1: ${t.title}`;Pe(e),Y.showFrame({...n,narration:``,tour:[]},e,{interrupt:!1})}},(0,W.useEffect)(()=>{let e=i.current;if(!e||(i.current=void 0,!xs()))return;let t=wr(e.courseId);if(!t)return;let n=Math.min(Math.max(e.lessonIdx,0),t.lessons.length-1);Os(t,n)},[]),(0,W.useEffect)(()=>{let e=Ds.current;!e||Y.busy||(Ds.current=null,!(Y.frames.length<=e.framesBefore)&&Er(e.courseId,e.lessonId,Y.frames[Y.frames.length-1]))},[Y.frames,Y.busy]);let ks=(0,W.useCallback)(e=>{if(!bs)return;let t=bs.lessons[Cs];t&&(Tr(bs.id,t.id,e),Es(Cr(bs.id)))},[bs,Cs]);(0,W.useEffect)(()=>{if(typeof window>`u`||!bs)return;let e=()=>Es(Cr(bs.id));return window.addEventListener(Dr,e),()=>window.removeEventListener(Dr,e)},[bs]);let[As,js]=(0,W.useState)(null);(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.missedCards.length&&js(t)};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[]);let Ms=(0,W.useCallback)(e=>{let t=e.missedCards.flatMap(t=>ar([t],{deck:e.courseTitle,tags:[e.lessonTitle,`checkpoint`],source:{question:t.front,topic:e.topic,ts:e.at},origin:`auto`}));js(null),fa(t)},[fa]),Ns=(0,W.useMemo)(()=>new Set(le.map(e=>e.id)),[le]),Ps=(0,W.useCallback)((e,t)=>{Pe(`Correction: ${t}`),Y.run(`Correction — you understood "${e}", but it's actually "${t}". Keep the rest of your understanding and update the answer wherever this changes it.`,void 0,void 0,void 0,void 0,`Correction: ${t}`)},[Y]),Fs=(0,W.useCallback)(e=>{let t=e.map(re),n=e.length===2?`Fuse these two: what is the real relationship between "${t[0]}" and "${t[1]}"? Lead with the single most useful connection, and be explicit about correlation versus cause.`:`Fuse these ${e.length}: what are the most important connections and patterns across ${t.map(e=>`"${e}"`).join(`, `)}? Lead with the strongest insight, then note any correlations, trade-offs, or cause-and-effect you can support from the data.`;Pe(`Fuse: ${t.join(` × `)}`),ue([]),Y.run(n,void 0,e,void 0,void 0,`Fuse: ${t.join(` × `)}`)},[Y]),Is=(0,W.useCallback)(e=>{e.id&&(ue(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e]),J(e=>e+1),ge())},[ge]),Ls=le.length>1?[`How do these relate?`,`Compare them`,`Summarize these`]:[`Explain this`,`Why it matters`,`Go deeper`],Rs=Zt(e.provider).capabilities.vision;(0,W.useEffect)(()=>{let e=e=>{if(zf(e.target))return;let t=e.clipboardData;if(!t)return;let n=[...t.files].filter(e=>e.type.startsWith(`image/`));if(n.length){e.preventDefault(),se(n),y(Rf),J(e=>e+1);return}let r=t.getData(`text/plain`);r&&If(r)&&(e.preventDefault(),y(Lf(Ff(r))),J(e=>e+1))},t=null,n=e=>{e.dataTransfer?.types.some(e=>e===`Files`||e===`text/uri-list`)&&(e.preventDefault(),Mi(!0),t&&clearTimeout(t),t=setTimeout(()=>Mi(!1),200))},r=e=>{Mi(!1);let t=e.dataTransfer;if(!t)return;if(zf(e.target)){t.files.length&&e.preventDefault();return}let n=[...t.files],r=n.filter(e=>e.type.startsWith(`image/`)),i=n.filter(e=>!e.type.startsWith(`image/`)),a=n.length?null:Ff(t.getData(`text/uri-list`)||t.getData(`text/plain`)||``);!n.length&&!a||(e.preventDefault(),r.length?(se(r),y(Rf)):i.length?se(i):a&&y(Lf(a)),J(e=>e+1))};return window.addEventListener(`paste`,e),window.addEventListener(`dragover`,n),window.addEventListener(`drop`,r),()=>{window.removeEventListener(`paste`,e),window.removeEventListener(`dragover`,n),window.removeEventListener(`drop`,r),t&&clearTimeout(t)}},[se]);let zs=(0,W.useRef)(Po);zs.current=Po,(0,W.useEffect)(()=>{if(!Nn)return;let e=zs.current;Fo(`focus`),document.documentElement.requestFullscreen?.().catch(()=>{});let t=e=>{e.key===`Escape`&&Fn(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t),Fo(e),document.fullscreenElement&&document.exitFullscreen().catch(()=>{})}},[Nn,Fo]);let Bs=(0,W.useRef)(0);(0,W.useEffect)(()=>{let e=Y.frames.length;if(e>Bs.current&&In.current){let t=e-1;qn(e=>new Set(e).add(t))}Bs.current=e},[Y.frames.length]);let X=La({mode:`vad`,onBargeIn:()=>{ts(),Co.current=!0},onResult:e=>{let t=e.transcript.trim(),n=Co.current;if(e.lowConfidence&&t){Co.current=!1,Ae(null),y(t),Ve(Yp),J(e=>e+1),ii.current&&Qr.current&&(ii.current=!1,Wi.current?.stop(),ti.current.length>0?oi():(Qr.current=!1,Zr(!1)));return}if(Co.current){Co.current=!1;let e=So.current;if(!t||Km(t)){e&&$i(e);return}}if(t){if(Ae(t),Qr.current){ti.current=[...ti.current,t],Ae(null);let e=ti.current.join(` `);K.onTranscript(e),ii.current&&(ii.current=!1,oi());return}if(Ur.current){if(Ae(null),Af(t)){Vr(!1);let e=Wr.current;if(Wr.current=[],Kr(0),e.length){let t=Math.round((Date.now()-qr.current)/6e4);Pe(`Your thinking, sorted`),Y.run(Nf(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}}else Mf(t)&&(Wr.current=[...Wr.current,t],Kr(e=>e+1));return}if(Lr({phase:oa.current,activeKey:ca.current,blanks:la.current,fill:Y.fill},t)){Ae(null);return}ys(t,n||wo.current)}},onStateChange:e=>{if(ai.current=e.phase,xe(e.phase),ve(e.phase===`listening`),e.phase===`listening`?e.speechEnding!==void 0&&Te(e.speechEnding):Te(!1),e.phase===`idle`&&(Co.current=!1),e.phase===`listening`)Ve(null),q.current!==null&&(window.clearTimeout(q.current),q.current=null);else if(e.phase===`idle`&&Qr.current&&ri.current.phase===`listening`){if(ii.current){ii.current=!1,oi();return}q.current!==null&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>{q.current=null,Wi.current?.stop(),oi()},Xp)}e.error===`not-allowed`?Ve(Pp):e.error===`unsupported`?Ve(Np):e.error===`audio`?Ve(Fp):e.error===`transcription`&&Ve(Ip)}}),Z=X.capabilities.stt;Wi.current=X;let Vs=(0,W.useCallback)(()=>{if(Qr.current){if(q.current!==null&&(window.clearTimeout(q.current),q.current=null),H||ai.current===`transcribing`){ii.current=!0,H&&X.start({inCanvas:!!Y.spec,continuous:!1}),X.forceStop();return}if(X.stop(),ti.current.length===0){Qr.current=!1,Zr(!1);return}oi()}},[H,oi,X,Y.spec]),Hs=(0,W.useCallback)(()=>{H&&X.stop(),q.current!==null&&(window.clearTimeout(q.current),q.current=null),Ae(null),ii.current=!1,Zr(!1)},[H,X]),Us=Nn||jp({paletteOpen:Si,shareOpen:Ue,exportOpen:Ge,dashOpen:Ye,showSettings:gi,proofOpen:Ti,showHow:Yo,replayAt:ss,recapOpen:Qt,atlasOpen:un,delegateOpen:an,srsOpen:Yt,zoomLevel:Jn,mindViewOpen:jn.open});(0,W.useEffect)(()=>{if(!Yr||K.phase===`idle`||Us)return;let e=e=>{e.key===`Escape`&&Hs()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Yr,K.phase,Us,Hs]),(0,W.useEffect)(()=>{let e=document.documentElement;return si?e.dataset.whisper=``:delete e.dataset.whisper,Be(si?On:1),()=>{delete e.dataset.whisper,Be(1)}},[si]),(0,W.useEffect)(()=>{Br?qr.current=Date.now():(Wr.current=[],Kr(0))},[Br]),(0,W.useEffect)(()=>{if(Yr&&H&&ke){let e=Dd(ke),t=ti.current.length>0?[...ti.current,e].join(` `).trim():e;t&&K.onTranscript(t)}},[ke,H,Yr]),(0,W.useEffect)(()=>{Yr||(ti.current=[],K.reset(),q.current!==null&&(window.clearTimeout(q.current),q.current=null))},[Yr]),(0,W.useEffect)(()=>()=>{q.current!==null&&window.clearTimeout(q.current)},[]),(0,W.useEffect)(()=>{let e=()=>X.setMaveaSpeaking(De()&&!Gi.current);return e(),Ne(e)},[X]);let Ws=v.trim().length>0;(0,W.useEffect)(()=>{if(!Rr({alwaysOn:Ni&&!Fi,sttOk:Z,composerHasText:Ws}))return;let e=!1,t=setTimeout(()=>{e||X.start({inCanvas:!!Y.spec,continuous:!0})},100);return()=>{e=!0,clearTimeout(t),X.stop()}},[Ni,Fi,Z,X,Ws]),zr({alwaysOn:Ni&&!Fi,sttOk:Z,composerHasText:Ws,listening:H},{start:()=>X.start({inCanvas:!!Y.spec,continuous:!0}),stop:X.stop});let Gs=(0,W.useCallback)(()=>{if(!Z){Ve(Np),J(e=>e+1);return}Ni?H?X.forceStop():Fi?(Ii(!1),ts(),X.start({inCanvas:!!Y.spec,continuous:!0})):ai.current===`transcribing`?(Ii(!0),X.forceStop()):(Ii(!0),X.stop()):H?X.forceStop():(ts(),X.start({inCanvas:!!Y.spec}))},[Z,Ni,Fi,H,X,Y.spec,ts]),[Ks,qs]=(0,W.useState)(!1),Js=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=()=>{Js.current!==null&&(window.clearTimeout(Js.current),Js.current=null)};if(Y.status===`thinking`){qs(!0),e();return}if(Y.status===`idle`){qs(!1),e();return}if(Ks&&Y.spec){qs(!1),e();return}Ks&&Js.current===null&&(Js.current=window.setTimeout(()=>{qs(!1),Js.current=null},1100))},[Y.status,Y.spec,Ks]),(0,W.useEffect)(()=>()=>{Js.current!==null&&window.clearTimeout(Js.current)},[]);let Ys=io({speak:$i,cancelSpeak:ze,isSpeaking:De,muted:U,turnCount:Y.frames.length,gates:{atRest:Y.status===`showing`||Y.status===`idle`,busy:Y.busy,listening:H,introHold:Ks,hasCanvas:!!Y.spec,modalOpen:Si||Ue||Ge||Ye||gi||Ti||Yo||ss!==null||Qt||an||Yt||un||vn!==null||Cn!==null||jn.open||Jn!==null}}),Xs=Ys.interjecting,Zs=(0,W.useRef)(null),Qs=(0,W.useMemo)(()=>{let e=Ga(Y.spec);return e===`warm`&&Ka(Y.spec)&&(Zs.current===null||Zs.current===Y.spec)&&(Zs.current=Y.spec,e=`celebrate`),za(Y.status,H,Xs,e,U,Ee)},[Y.status,H,Xs,Y.spec,U,Ee]),$s=(0,W.useMemo)(()=>cc({status:Y.status,listening:H,interjecting:Xs,spec:Y.viewSpec??Y.spec}),[Y.status,H,Xs,Y.viewSpec,Y.spec]);(0,W.useEffect)(()=>(rc(document,$s),()=>ic(document)),[$s]);let ec=(0,W.useCallback)(()=>{let e=Ca.current,t=wa.current,n=Ta.current;if(!e||!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();!r.width||!i.width||(e.style.setProperty(`--home-x`,`${Math.round(r.left+r.width/2-(i.left+i.width/2))}px`),e.style.setProperty(`--home-y`,`${Math.round(r.top+r.height/2-(i.top+i.height/2))}px`),e.style.setProperty(`--home-scale`,(Math.max(r.width,12)*1.3/150).toFixed(3)))},[]);(0,W.useLayoutEffect)(()=>(ec(),window.addEventListener(`resize`,ec),()=>window.removeEventListener(`resize`,ec)),[ec]),(0,W.useLayoutEffect)(()=>{ec()},[ui,ec]);let ac=!!Y.spec&&!(Ks||Xs),oc=Zo,sc=Zo&&(!Y.spec||Ks||Xs),lc=!Y.spec&&!Zo;(0,W.useEffect)(()=>{if(!e.morningBrief||qt||lc||Y.busy||Y.restored||!Ql(Ot()))return;$l(),Jt(!0);let t=Y.frames.slice(-3).map(e=>e.question).filter(Boolean);Y.run(eu(t),void 0,void 0,void 0,void 0,`Morning brief`)},[e.morningBrief,lc,qt,Y.busy,Y.restored]),(0,W.useEffect)(()=>{ac&&Ca.current&&(Ca.current.style.setProperty(`--scroll-dock`,`0`),ec())},[ac,ec]);let dc=Xs?Ys.line:Y.narration,fc=!ac&&!!dc&&(Xs||Y.status===`speaking`||Y.status===`showing`),pc=sc&&Y.status===`speaking`,mc=(0,W.useRef)(new Map),[hc,gc]=(0,W.useState)(0);(0,W.useEffect)(()=>{let e=mc.current,t=new Set(Y.frames.map(e=>e.at)),n=!1;for(let r of[...e.keys()])t.has(r)||(e.delete(r),n=!0);let r=Y.frames.filter(t=>!e.has(t.at)),i=!1;return(async()=>{for(let t of r){let r=await fn(`${t.question} ${t.narration} ${t.spec?.title??``}`.trim());if(i)return;r&&(e.set(t.at,r),n=!0)}n&&gc(e=>e+1)})(),()=>{i=!0}},[Y.frames]);let _c=(0,W.useMemo)(()=>Pt(Y.frames,Y.frames.map(e=>mc.current.get(e.at)??null)),[Y.frames,hc]),vc=Y.frames.length-1,yc=Y.viewIndex??vc,bc=Y.viewOverride!=null,Sc=!bc&&(Y.viewIndex==null||Y.viewIndex===vc),Cc=Y.viewOverride?_c.find(e=>Y.viewOverride?.id===`thread-`+e.id):void 0,Tc=_c.find(e=>e.moments.some(e=>e.frameIndex===yc)),Dc=_c.length>=2?Tc?.color:void 0,kc=Y.frames[vc],Ac=_c[_c.length-1],jc=_c.length>=2&&Ac?.moments.length===1&&Ac.moments[0].frameIndex===vc,Nc=Sc&&!Y.busy&&jc&&kc?.mode===`replace`&&!!kc&&mc.current.has(kc.at),[Pc,Fc]=(0,W.useState)(null),Ic=(0,W.useRef)(-1);(0,W.useEffect)(()=>{Nc&&Ic.current!==vc&&(Ic.current=vc,Fc(vc))},[Nc,vc]);let Rc=(0,W.useCallback)(e=>{let t=co(e.moments.map(e=>Y.frames[e.frameIndex]).filter(e=>!!e),{title:e.title,tint:e.color,id:`thread-`+e.id});t&&(Y.previewSpec(t),ga.current?.scrollTo({top:0}))},[Y]),zc=Sc&&le.length===0?(Y.viewSpec??Y.spec)?.suggests??[]:[],Bc=Y.viewSpec??Y.spec,Vc=bc?Bc?{question:null,narration:Bc.title||`This thread`}:null:Uc({spec:Bc,frames:Y.frames,viewIndex:Y.viewIndex,narration:Y.narration,lastAsk:Me}),Kc=(0,W.useMemo)(()=>wc(Bc),[Bc]),qc=Gc(Wc(Y.status)),Jc=(0,W.useMemo)(()=>Y.busy?Y.status===`showing`?[Ap(Y.pendingShape)]:kp(Me??``,Y.history):[],[Y.busy,Y.status,Y.pendingShape,Me,Y.history]),Yc=rp(),Qc=fp(),el=(0,W.useSyncExternalStore)(Uu,Wu,Wu),[tl,nl]=(0,W.useState)(null);(0,W.useEffect)(()=>nl(null),[Y.turn]),(0,W.useEffect)(()=>Ma(!1),[Y.turn]);let rl=Sp()&&!U;(0,W.useEffect)(()=>{U&&Aa.current?.()},[U]);let[il,al]=(0,W.useState)(!1);(0,W.useEffect)(()=>al(!1),[Y.turn]),(0,W.useEffect)(()=>$t(!1),[Y.turn]);let ol=(0,W.useMemo)(()=>qf(Y.frames,_c),[Y.frames,_c]),sl=cr(),cl=lr(),ll=(0,W.useCallback)(e=>{if(s.current){Go.current.playExtra(e);return}Y.busy||E(e)},[Y.busy]),ul=(0,W.useCallback)(e=>{if(!Z){Ve(Np);return}ts(),Li.current===null&&(Li.current={enabled:Ni,paused:Fi}),Ii(!1),Pi(!0),e===`think`?(Vr(!1),Ur.current=!1,Zr(!0),Qr.current=!0):(Zr(!1),Qr.current=!1,Vr(!0),Ur.current=!0)},[Z,Ni,Fi,ts]);(0,W.useEffect)(()=>{if(Yr||Br)return;let e=Li.current;e!==null&&(Li.current=null,!Y.spec&&!Y.busy&&Qo(!1),Ii(e.paused),Pi(e.enabled),e.enabled&&!e.paused&&Z&&!v.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):X.stop())},[Yr,Br,Z,v,X,Y.spec,Y.busy]);let[dl,fl]=(0,W.useState)(null),[pl,hl]=(0,W.useState)(!1),[gl,_l]=(0,W.useState)(0),vl=(0,W.useMemo)(()=>{let e=((Y.viewSpec??Y.spec)?.blocks??[]).filter(e=>e.type===`world`);return e.length>0?e:qi?[qi]:[]},[Y.viewSpec,Y.spec,qi]),yl=(0,W.useMemo)(()=>vl.find(e=>e.id===dl)??vl[0],[vl,dl]);Zi.current=vl;let bl=yl!==void 0,xl=Po===`world`&&bl,Sl=(0,W.useCallback)(e=>{e&&fl(e),hl(!1),Fo(`world`)},[Fo]);Qi.current=Sl;let Cl=(0,W.useCallback)(()=>Fo(Xr()),[Fo]);(0,W.useEffect)(()=>pe(Sl),[Sl]),(0,W.useEffect)(()=>{Po===`world`&&!bl&&Cl()},[Po,bl,Cl]);let wl=xl?yl.id??null:null,Tl=xl&&yl.props.world===void 0,{generateWorld:El}=Y;(0,W.useEffect)(()=>{if(!wl||!Tl)return;let e=!0;return hl(!1),El(wl).then(t=>{e&&!t&&hl(!0)}),()=>{e=!1}},[wl,Tl,gl,El]);let{expandWorld:Dl}=Y,Ol=(0,W.useCallback)((e,t)=>wl?Dl(wl,e,t):Promise.resolve(null),[wl,Dl]),Q={atlas:{available:mn>0,reason:`Fills in as you discuss things`,run:()=>pn(!0),preload:dm.preload},"pdf-world":{available:A.some(zt),reason:`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map`,run:()=>{let e=A.filter(zt);if(e.length>0){En(e);return}J(e=>e+1),Ai(e=>e+1),z(`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map of claims.`)},preload:Am.preload},synthesis:{available:!0,run:()=>{let e=A.filter(zt);e.length>=2?Tn(e):window.location.hash=`#/synthesis`},preload:()=>A.filter(zt).length>=2?Pm.preload():Gm(`#/synthesis`)},ripple:{available:!0,run:()=>An(hr),preload:pm.preload},review:{available:!0,run:()=>Xt(!0),preload:Bm.preload},flashcards:{available:!0,run:()=>{window.location.hash=`#/flashcards`},preload:()=>Gm(`#/flashcards`)},courses:{available:!0,run:()=>{window.location.hash=`#/courses`},preload:()=>Gm(`#/courses`)},dashboards:{available:!0,run:()=>{window.location.hash=`#/dashboards`},preload:()=>Gm(`#/dashboards`)},gallery:{available:!0,run:()=>{window.location.hash=`#/gallery`},preload:()=>Gm(`#/gallery`)},recap:{available:!!ol,reason:`Once we've covered something`,run:()=>$t(!0),preload:vm.preload},present:{available:!!Y.spec,reason:`Once there is an answer`,run:Bn,preload:Im.preload},track:{available:!!Y.spec,reason:`Once there is a conversation to track`,run:()=>et(!0),preload:Dm.preload},share:{available:Y.frames.length>0,reason:`Once there is something to share`,run:()=>We(!0),preload:Cm.preload},export:{available:Y.frames.length>0,reason:`Once there is an answer to export`,run:()=>qe(!0),preload:Tm.preload},focus:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Fo(`focus`)},board:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Fo(`canvas`)},"living-answer":{available:bl,reason:`Once an answer has causes to trace`,run:()=>Sl(),preload:Mm.preload},ink:{available:!!Y.spec,reason:`Once there is an answer to mark`,run:()=>me(!0)},blanks:{available:!0,run:()=>Ve(`When a number in an answer is truly yours to give, Mavéa leaves a glowing hole for it — type, say, or drop a card in, and it finishes the answer around your value.`)},"watch-me-think":{available:Z,reason:Z?void 0:Np,run:()=>ul(`think`)},"just-listen":{available:Z,reason:Z?void 0:Np,run:()=>ul(`listen`)},whisper:{available:!0,run:()=>{yi(`you`),xi(!0),_i(!0)},preload:im.preload},ghost:{available:Z&&e.quality!==`fast`,reason:Z?e.quality===`fast`?`Needs Balanced quality or higher — you're on Fast`:void 0:Np,run:()=>ul(`listen`)},delegate:{available:!0,run:()=>ln(!0),preload:Rm.preload},memory:{available:!0,run:()=>{yi(`you`),_i(!0)},preload:im.preload},library:{available:$o.length>0,reason:`Fills in as you save conversations`,run:()=>pi(!0),preload:bm.preload},deepzoom:{available:!0,run:()=>{let e=Me??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},preload:()=>Gm(`#/deepzoom`)},"zoom-deck":{available:!!ol,reason:`Opens once there are a few answers to pull back from`,run:()=>Yn(`chapters`),preload:lm.preload},"morning-brief":{available:!0,run:()=>{yi(`you`),xi(!0),_i(!0)},preload:im.preload},settings:{available:!0,run:()=>{yi(void 0),_i(!0)},preload:im.preload},how:{available:!0,run:()=>Xo(!0),preload:$p.preload}};Ho.current=Q;let kl=bt.filter(e=>e.surface!==`demo`).map(e=>{let t=Q[e.id]??{available:!0,run:()=>void 0},n=e.id===`how`?aa:e.tourChapter?()=>ll(e.tourChapter):void 0;return{feature:e,available:t.available,reason:t.reason,run:t.run,preload:t.preload,watch:n}}),Al=(0,W.useCallback)(()=>Qo(!0),[]),jl=(0,W.useRef)(null),Ml=go.map(e=>kl.find(t=>t.feature.id===e)).filter(e=>!!e).map(e=>{if(e.feature.id===`pdf-world`){let t=A.filter(zt),n=_o(t);return{feature:e.feature,available:!0,blurb:n.blurb,preload:e.preload,run:n.opensPicker?()=>jl.current?.click():()=>En(t)}}return{feature:e.feature,available:e.available,reason:e.reason,preload:e.preload,run:()=>{vo.has(e.feature.id)&&Al(),e.run()}}}),Nl=[{label:`New`,blurb:`Start a fresh session`,onClick:()=>{Y.reset(),Ys.reset(),Qo(!1),ae(!1),Dt()},show:!!Y.spec},{label:`Dashboard`,blurb:`Open your living dashboards`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!!Y.spec}],Fl=[{label:`Rehearse`,blurb:`Practice a hard conversation — take the seat, or send your Mavéa`,onClick:Q.delegate.run,preload:Q.delegate.preload,show:!0},{label:`Study`,blurb:sl>0?`${sl} card${sl===1?``:`s`} ready`:cl===`spaced`?`Go through what you have saved`:`Flip through your cards`,onClick:Q.review.run,preload:Q.review.preload,show:!0},{label:`Manage flashcards`,blurb:`See, organize, and edit your study deck`,onClick:Q.flashcards.run,preload:Q.flashcards.preload,show:!0},{label:`Courses`,blurb:`Turn a topic into a structured syllabus — a lesson at a time, at your pace`,onClick:Q.courses.run,preload:Q.courses.preload,show:!0},{label:`Recap`,blurb:`What we covered — the session so far`,onClick:Q.recap.run,preload:Q.recap.preload,show:!!ol}],Il=[{label:`Present`,blurb:`Fill the room — the chrome falls away, the mic stays live`,onClick:Q.present.run,preload:Q.present.preload,show:!!Y.spec},{label:`Export`,blurb:`Choose a template and export a polished PDF`,onClick:Q.export.run,preload:Q.export.preload,show:Y.frames.length>0},{label:`Video`,blurb:`Share a moment, a topic, or the whole conversation`,onClick:Q.share.run,preload:Q.share.preload,show:Y.frames.length>0}],Bl=[{label:`Search all features`,blurb:`Browse Mavéa’s feature index · ${l}`,onClick:Ci,preload:tm.preload,show:!0},{label:`Atlas`,blurb:`Kept conversations and topics, as a place`,onClick:Q.atlas.run,preload:Q.atlas.preload,show:mn>0},{label:`Watch me think`,blurb:`A live map of your thinking`,onClick:Q[`watch-me-think`].run,show:Q[`watch-me-think`].available},{label:`Prism`,blurb:Q[`pdf-world`].available?`Split your document into a map of its claims`:`Attach a PDF, Office doc, or data file — then split it into claims`,onClick:Q[`pdf-world`].run,preload:Q[`pdf-world`].preload,show:!0},{label:`Ripple`,blurb:`Model a code change’s impact, risks, and a proposed ship order`,onClick:Q.ripple.run,preload:Q.ripple.preload,show:!0},{label:`Dashboards`,blurb:gn>0?`${gn} dashboard${gn===1?``:`s`} set to refresh while Mavéa is open`:`Create a dashboard that refreshes on schedule while Mavéa is open`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!0},{label:`Deep Zoom`,blurb:Me?`Zoom from field to mechanism — "${Me.slice(0,50)}${Me.length>50?`…`:``}"`:`Telescope any topic from big picture to finest detail`,onClick:()=>{let e=Me??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},show:!0}],Vl=(0,W.useCallback)(e=>{e===`out`&&ol&&Yn(`chapters`)},[ol]);dr(ga,Vl),(0,W.useEffect)(()=>(Re(Xu),()=>Re(null)),[]);let Hl=(0,W.useRef)(!0);(0,W.useEffect)(()=>{Y.busy&&(Ku(),Hl.current=!1,Qn(null),Pr())},[Y.busy,Y.turn,Pr]),(0,W.useEffect)(()=>(Ju(ss!==null),()=>Ju(!1)),[ss]),(0,W.useEffect)(()=>Pr(),[Y.viewIndex,Pr]);let Gl=Y.spec?.blocks.length??0;(0,W.useEffect)(()=>{Gl>0&&Yu(Gl)},[Gl]),(0,W.useEffect)(()=>{if(Y.busy)return;if(Y.spec){let e=Zu();if(e){Qn(e);let t=Y.frames.length-1,n=Y.frames[t];n&&Fr.set(Je(n),e)}}if(Yc||Hl.current)return;let e=window.setTimeout(()=>{Hl.current=!0,qu()},Zp);return()=>window.clearTimeout(e)},[Yc,Y.busy,Y.spec,el,Y.frames,Fr]);let Kl=(0,W.useMemo)(()=>Sc?Zn:Y.viewIndex!=null&&Y.frames[Y.viewIndex]?Fr.get(Je(Y.frames[Y.viewIndex])):null,[Sc,Zn,Y.viewIndex,Y.frames,Fr]),ql=(0,W.useMemo)(()=>{if(!ur||$n===null||!Kl)return null;let e=Sc?Y.spec:Y.viewSpec;if(!e)return null;let t=Sc?Y.tour:Y.viewIndex==null?[]:Y.frames[Y.viewIndex]?.tour??[],n=td(Kl,$n,t,e.blocks.length);return{...e,blocks:e.blocks.slice(0,n)}},[ur,$n,Kl,Sc,Y.spec,Y.viewSpec,Y.tour,Y.viewIndex,Y.frames]),Jl=Y.error?(0,G.jsxs)(`div`,{className:`live-error`,role:`alert`,children:[(0,G.jsxs)(`div`,{className:`live-error-head`,children:[(0,G.jsx)(B.alert,{}),(0,G.jsx)(`span`,{children:`Couldn’t answer`})]}),(0,G.jsx)(`p`,{className:`live-error-msg`,children:Y.error.message}),(0,G.jsxs)(`div`,{className:`live-error-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`live-error-btn primary`,onClick:()=>{let e=Y.error;e&&Y.run(e.retry,e.attachments,e.selectedBlocks,void 0,e.inkIntents,e.question)},disabled:Y.busy,children:`Retry`}),(0,G.jsx)(`button`,{type:`button`,className:`live-error-btn`,onClick:()=>_i(!0),children:`Open settings`})]})]}):null,Yl=Yr,[Xl,Zl]=(0,W.useState)(160);(0,W.useEffect)(()=>{if(!Yl)return;let e=document.querySelector(`.live-dock`);if(!e)return;let t=()=>Zl(Math.round(e.getBoundingClientRect().height)+8);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Yl]);let tu=Yl?(0,G.jsxs)(`div`,{className:`ms-stage-fill`,"data-phase":K.phase,style:{"--ms-bottom-reserve":`${Xl}px`},children:[(0,G.jsxs)(`button`,{type:`button`,className:`ms-exit`,onClick:Hs,title:`Back to the conversation (Esc)`,children:[(0,G.jsx)(B.chevL,{}),`Back to conversation`]}),(0,G.jsx)(Tf,{mindShape:K,onSettled:()=>{$i(`I think this is the shape of it.`)},onConfirmUnsaid:()=>K.confirmUnsaid(),onDismissUnsaid:()=>K.dismissUnsaid(),onAction:(e,t)=>{if(e===`add-more`)Ae(null),K.resume(),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:Ni&&!Fi});else if(e===`not-quite`)ti.current=[],K.resume(!1),Ae(null),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:Ni&&!Fi});else if(e===`share`)We(!0);else if(e===`present`)Bn();else if(e===`answer`||e===`plan`||e===`commit-plan`||e===`tell-apart`){let n=K.spec,r=e===`commit-plan`||e===`plan`?`plan`:`answer`,i=n?kf(n,r):ke??``;e===`tell-apart`&&t?.tension&&(i=`I keep coming back to “${t.tension.a}” but I also said “${t.tension.b}.” Help me tell these two reasons apart — are they the same thing or not?\n\n`+i);let a=Y.restored;if(H&&!Ni&&X.stop(),Ae(null),K.reset(),Zr(!1),i){let t=e===`tell-apart`?`Telling them apart`:n?.center||(r===`plan`?`A plan`:`An answer`);Pe(t),Y.run(i,void 0,void 0,void 0,void 0,t,n??void 0,a?{freshStart:!0}:void 0)}}},liveTranscript:ke||void 0,thoughtCount:Vd([ti.current.join(` `),ke??``].join(` `))})]}):null,nu=Yr?K.phase===`settled`||K.phase===`pausing`?`Add thought`:`Done thinking`:`Watch me think`;return(0,G.jsxs)(`div`,{className:`mavea-app with-rail live-voice canvas-flat`+(ac?` face-homed`:``)+(lc?` in-wizard`:``)+(Nn?` presenting`:``)+(ui?` rail-collapsed`:``)+(Yl?` watch-thinking`:``),"data-title":Y.spec?.title??``,...Nn?{"data-preso":Vn}:{},ref:Ca,children:[s.current&&(0,G.jsx)(Ri,{driver:Uo}),s.current&&Uo.done&&(0,G.jsx)(Vi,{onStart:ra,onReplay:aa,onPlayExtra:Uo.playExtra,hasStoredSession:ta}),m.current&&(()=>{let e=I(m.current);return e?(0,G.jsx)(sa,{driver:Wo,member:e,onExit:ra}):null})(),Ln&&(0,G.jsxs)(`div`,{className:`preso-preparing`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,G.jsx)(`span`,{className:`async-pending-spinner`,"aria-hidden":`true`}),`Preparing presentation…`]}),Nn&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`preso-style-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||Wn(!1)},children:[(0,G.jsxs)(`button`,{type:`button`,className:`preso-style-btn`+(Un?` is-open`:``),onClick:()=>Wn(e=>!e),"aria-expanded":Un,"aria-haspopup":`listbox`,children:[(0,G.jsx)(`span`,{className:`preso-swatch-sm`,style:{background:Bf.find(e=>e.id===Vn)?.accent??`var(--presence)`}}),`Style`]}),Un&&(0,G.jsx)(`div`,{className:`preso-menu`,role:`listbox`,"aria-label":`Presentation style`,children:Bf.map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":Vn===e.id,className:`preso-row`+(Vn===e.id?` is-active`:``),onClick:()=>{Hn(e.id),Wf(e.id),Wn(!1)},children:[(0,G.jsx)(`span`,{className:`preso-swatch`,style:{background:e.accent}}),(0,G.jsx)(`span`,{className:`preso-name`,children:e.label}),(0,G.jsx)(`span`,{className:`preso-desc`,children:e.description})]},e.id))})]}),(0,G.jsx)(`button`,{type:`button`,className:`present-exit`,onClick:()=>Fn(!1),title:`End the presentation (Esc)`,children:`End show · Esc`}),(0,G.jsx)($,{children:(0,G.jsx)(Lm,{spec:Y.viewSpec??Y.spec,question:Vc?.question??null,narration:Vc?.narration??Y.narration,skinId:Vn,autoAdvanceMs:s.current||m.current?2600:void 0,onExit:()=>Fn(!1)})})]}),(0,G.jsx)(`div`,{className:`presence-layer`+(ac?` corner`:sc?``:` idlehome`)+(fc?` has-caption`:``)+(mi?` is-mem-save`:``),ref:Ta,children:(0,G.jsxs)(`div`,{className:`presence-positioner`,ref:Ea,children:[Zo&&(0,G.jsx)(`div`,{className:`presence-seed`,"aria-hidden":`true`},Y.turn),(0,G.jsx)(de,{state:Qs.state,emotion:Qs.emotion,gaze:Qs.gaze,muted:U})]})}),(0,G.jsx)(`div`,{className:`presence-scrim`+(pc?` show`:``)}),fc&&(0,G.jsx)(`div`,{className:`center-caption`,role:`status`,"aria-live":`polite`,children:dc}),(0,G.jsx)(tp,{activity:Y.activity,sources:Y.busy?Y.liveSources:[]}),(0,G.jsxs)(`div`,{className:`topbar`,children:[(0,G.jsxs)(`button`,{className:`brand brand-link`,type:`button`,onClick:Wm,title:`Back to the demo`,"aria-label":`Back to the demo`,children:[(0,G.jsx)(`span`,{className:`brand-dot jelly-mark`,ref:wa}),(0,G.jsx)(`span`,{className:`brand-name`,children:`Mavéa`}),Y.spec&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`brand-sep`}),(0,G.jsx)(`span`,{className:`workspace-name`,children:Y.error?`Couldn’t answer`:Y.spec.title})]})]}),(0,G.jsxs)(`span`,{className:`live-badge`,title:`Live · ${t.label}`,"aria-label":`Live mode`,children:[(0,G.jsx)(`span`,{className:`live-dot`}),`Live`]}),(0,G.jsx)(`div`,{className:`topbar-spacer`}),(0,G.jsx)(_n,{label:`Create`,items:Nl}),(0,G.jsx)(_n,{label:`Practice`,items:Fl,badge:sl}),(0,G.jsx)(_n,{label:`Share`,items:Il}),(0,G.jsx)(_n,{label:`Explore`,items:Bl}),(0,G.jsx)(N,{onOpen:Ci,preload:tm.preload}),(0,G.jsx)(`span`,{className:`topbar-divider`,"aria-hidden":`true`}),(0,G.jsx)(Kn,{})]}),(0,G.jsx)(Hc,{chapters:_c,frames:Y.frames,currentIndex:yc,onJump:Y.jumpTo,onReplay:Y.frames.length>0?()=>cs(Y.frames.length-1):void 0,onOverview:Y.frames.length>0?()=>al(!0):void 0,resumed:Y.restored,chatOpen:ci,onToggleChat:()=>li(e=>!e),collapsed:ui,onToggleCollapse:()=>di(e=>!e),onOpenPast:$o.length>0?()=>pi(!0):void 0,onStudy:()=>Xt(!0),roomIndices:Gn,bookmarks:oo,onToggleBookmark:so,onViewMindMap:e=>{let t=Y.frames[e];t?.mind&&Mn({open:!0,spec:t.mind})},onSeeTogether:Rc}),(0,G.jsxs)(Lc,{holdEnabled:Z&&Hi===`hold`,showHint:!1,pttKey:e.pttKey,pttSide:e.pttSide,onHoldStart:()=>{ts(),X.start({inCanvas:!!Y.spec})},onHoldEnd:()=>X.forceStop(),onChangePttKey:e=>on({pttKey:e}),onChangePttSide:e=>on({pttSide:e}),children:[(si||Ni&&Z)&&(0,G.jsxs)(`div`,{className:`dock-modes`,role:`group`,"aria-label":`Listening modes`,children:[si&&(0,G.jsx)(`span`,{className:`whisper-badge`,children:`won't wake anyone`}),Ni&&Z&&(0,G.jsx)(`button`,{type:`button`,className:`listen-mode-chip`+(Br?` on`:``),"aria-pressed":Br,onClick:()=>{Vr(e=>!e),Yr&&(Qr.current=!1,Zr(!1))},title:Jr,"aria-label":Jr,children:Br?`Just listening · ${Gr} banked`:`Just listen`}),Br&&Gr>0&&(0,G.jsx)(`button`,{type:`button`,className:`listen-mode-chip`,onClick:()=>{Vr(!1);let e=Wr.current;if(Wr.current=[],Kr(0),e.length){let t=Math.round((Date.now()-qr.current)/6e4);Pe(`Your thinking, sorted`),Y.run(Nf(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}},children:`Thoughts?`})]}),Z&&(0,G.jsx)(Ke,{kind:`voice-data`,from:`live`}),Le&&(0,G.jsxs)(`div`,{className:`voice-notice`,role:`status`,children:[Le===Yp?(0,G.jsx)(B.spark,{}):(0,G.jsx)(B.micOff,{}),(0,G.jsx)(`span`,{children:Le}),(0,G.jsx)(`button`,{type:`button`,className:`voice-notice-x`,"aria-label":`Dismiss voice notice`,onClick:()=>Ve(null),children:(0,G.jsx)(B.x,{})})]}),(A.length>0||R)&&(0,G.jsxs)(`div`,{className:`attach-strip`,role:`list`,"aria-label":`Attached files`,children:[A.map((e,t)=>(0,G.jsxs)(`span`,{className:`attach-chip`,role:`listitem`,children:[Rt(e)?(0,G.jsx)(`img`,{className:`attach-thumb`,src:`data:${e.mime};base64,${e.data}`,alt:``}):(0,G.jsx)(B.paperclip,{}),(0,G.jsx)(`span`,{className:`attach-name`,children:Bt(e)}),(Ft(e)&&Rs||It(e)||Ht(e))&&(0,G.jsx)(`button`,{type:`button`,className:`attach-explode`,"aria-label":`Explode ${e.name} into a map of its claims`,title:`Explode into a map of grounded claims`,onClick:()=>yn([e]),children:`⊹ Explode`}),(0,G.jsx)(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>ce(t),children:(0,G.jsx)(B.x,{})})]},t)),(()=>{let e=A.filter(e=>It(e)||Ht(e)||Ft(e)&&Rs);if(e.length<=1)return null;let t=(0,G.jsxs)(`button`,{type:`button`,className:`attach-explode attach-compare`,"aria-label":`Compare ${e.length} documents — map their claims and find where they agree and contradict`,title:`Explode all documents together and compare them`,onClick:()=>yn(e),children:[`⊹ Compare `,e.length,` documents`]},`compare`),n=(0,G.jsxs)(`button`,{type:`button`,className:`attach-explode attach-compare`,"aria-label":`Synthesize ${e.length} sources — fuse them into one map of themes, contradictions, and gaps`,title:`Fuse all sources into one navigable Synthesis World`,onClick:()=>Tn(e),children:[`⊹ Synthesize `,e.length,` sources`]},`synth`);return e.length>=4?n:e.length>=3?(0,G.jsxs)(G.Fragment,{children:[t,n]}):t})(),R&&(0,G.jsx)(`span`,{className:`attach-error`,role:`status`,children:R})]}),A.length>0&&(0,G.jsx)(Ke,{kind:`upload`,from:`live`}),Y.spec&&(0,G.jsx)(Ul,{armed:fe,pins:ms.pins,miss:ms.miss,onUndo:ms.undo,onSend:ms.send}),le.length>0&&(0,G.jsxs)(`div`,{className:`pin-dock`,children:[(0,G.jsx)(`div`,{className:`pin-strip`,role:`list`,"aria-label":`Elements you're asking about`,children:le.map(e=>(0,G.jsxs)(`span`,{className:`pin-chip`,role:`listitem`,children:[(0,G.jsx)(B.chat,{}),(0,G.jsx)(`span`,{className:`pin-name`,children:re(e)}),(0,G.jsx)(`button`,{type:`button`,className:`pin-remove`,"aria-label":`Unpin ${re(e)}`,onClick:()=>Is(e),children:(0,G.jsx)(B.x,{})})]},e.id))}),(0,G.jsxs)(`div`,{className:`pin-suggests`,role:`list`,"aria-label":`Quick follow-ups`,children:[le.length>=2&&(0,G.jsxs)(`button`,{type:`button`,className:`live-chip pin-fuse-chip`,disabled:Y.busy,title:`Combine these ${le.length} cards into a single new answer — useful when you want Mavéa to find the pattern, trade-off, or story that runs across all of them at once`,onClick:()=>Fs(le),children:[`Fuse `,le.length,` into one`]}),Ls.map(e=>(0,G.jsx)(`button`,{type:`button`,className:`live-chip`,onClick:()=>ys(e),disabled:Y.busy,children:e},e))]})]}),(0,G.jsxs)(`div`,{className:oc?`voice-capsule`:`composer-passthrough`,children:[oc&&(0,G.jsxs)(`div`,{className:`voice-strip`,children:[rl&&!Qc?(0,G.jsxs)(`button`,{type:`button`,className:`vc-status`,onClick:ts,title:`Tap to stop and show the whole answer at once`,"aria-label":`Stop speaking and show the whole answer`,children:[(0,G.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]}),(0,G.jsx)(`span`,{className:`vc-status-label`,children:`Speaking`})]}):Na&&!U?(0,G.jsxs)(`div`,{className:`vc-status vc-preparing`,role:`status`,"aria-busy":`true`,children:[(0,G.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]}),(0,G.jsx)(`span`,{className:`vc-status-label`,children:`Preparing voice…`})]}):Qc&&!U?(0,G.jsx)(`div`,{className:`vc-status vc-preparing vc-quiet`,role:`status`,"aria-busy":`true`,"aria-label":`Preparing voice`,children:(0,G.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]})}):null,(0,G.jsx)(`div`,{className:`vc-transcript`,"aria-hidden":`true`,children:tl??Y.narration??``}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>He(e=>!e),title:U?`Unmute Mavéa's voice — your microphone is unaffected`:`Mute Mavéa's voice — muted answers land written out at once, with notes and pen marks standing in for the walk. Your microphone is unaffected.`,"aria-pressed":!U,className:`voice-switch`+(U?` is-muted`:``),children:[U?(0,G.jsx)(B.speakerOff,{}):(0,G.jsx)(B.speaker,{}),(0,G.jsx)(`span`,{className:`voice-switch-label`,children:`Mavéa's voice`}),(0,G.jsx)(`span`,{className:`voice-switch-track`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{className:`voice-switch-thumb`})})]}),(0,G.jsx)(gd,{}),(0,G.jsx)(yd,{}),(0,G.jsxs)(`button`,{className:`live-model-chip`,onClick:()=>_i(e=>!e),title:m.current?`The model that generated this curated prerecorded example`:qc?`Model settings · last reply ${qc}`:`Model settings`,children:[(0,G.jsx)(`span`,{className:`chip-dot`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`chip-model`,children:m.current?Wo.model??`—`:n}),(0,G.jsx)(`span`,{className:`chip-caret`,"aria-hidden":`true`})]})]}),(0,G.jsx)(ei,{value:v,onChange:e=>{y(e)},onSend:ys,listening:H,heard:ke,onMic:Gs,micMode:Hi,micArmed:Ni&&!Fi,micPaused:Ni&&Fi,micProcessing:be===`transcribing`,placeholder:Yr?`Talk, or type a thought — it lands on the map…`:le.length?le.length>1?`Ask about the selected elements…`:`Ask about the selected element…`:`Talk, or type — anything.`,focusSignal:Di,disabled:Y.busy,onFiles:se,attachPulse:ki,attachTitle:Rs?`Attach an image or PDF`:`Attach a doc or data file to explode — ${n} can't read images/PDFs directly`,onMicDown:()=>{Z&&(ts(),X.start({inCanvas:!!Y.spec}))},onForceStop:()=>X.forceStop(),onMicCancel:()=>X.stop(),tools:(0,G.jsxs)(G.Fragment,{children:[Y.spec&&(0,G.jsx)(Wl,{armed:fe,onToggle:me}),(0,G.jsxs)(`button`,{type:`button`,className:`composer-watch`+(Yr?` on`:``),"aria-pressed":Yr,"aria-label":nu,onClick:()=>{Yr?K.phase===`settled`||K.phase===`pausing`?(Ae(null),K.resume(),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:!0})):Vs():ul(`think`)},title:Yr?K.phase===`settled`||K.phase===`pausing`?`Add another thought`:`Finish now without waiting for silence`:`Build a live map while you think aloud`,children:[(0,G.jsx)(B.spark,{}),(0,G.jsx)(`span`,{children:nu})]})]}),micExtra:Z?(0,G.jsx)(nc,{mode:Hi,pttKey:e.pttKey,pttSide:e.pttSide,onChange:e=>{Li.current=null,Ii(!1),Pi(e===`always`),Ui(e===`always`),Bi(e===`hold`),e===`always`&&Ni&&!H&&!v.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):e!==`always`&&H&&X.stop()}}):void 0})]})]}),(H||Ee)&&!Yr&&(0,G.jsx)(Yf,{transcript:ke,mode:Hi,transcribing:Ee,note:Br?`Just listening · ${Math.max(1,Math.round((Date.now()-qr.current)/6e4))}m — say "thoughts?" when you want me`:void 0}),H&&!Yr&&(0,G.jsx)(Kd,{ghosts:na}),Y.spec?(0,G.jsxs)(`div`,{className:`canvas-stage stage`,"data-active":`1`,ref:_a,children:[Pc!=null&&(0,G.jsx)(Oc,{tint:Ac?.color,onDone:()=>Fc(null)},Pc),(0,G.jsx)(`div`,{className:`canvas-scroll`,ref:ga,onClick:Y.spot?e=>{e.target.closest(`.spotlit`)||es()}:void 0,children:(0,G.jsxs)(`div`,{className:`topic-wrap`,children:[(0,G.jsx)(ml,{armed:fe,rootRef:_a,onStroke:ms.onStroke,onTap:ms.onTap,strokes:ms.strokes,highlights:ms.highlights}),Jl,!Sc&&(0,G.jsxs)(`div`,{className:`viewing-past`,role:`status`,children:[bc?(0,G.jsx)(B.table,{}):(0,G.jsx)(B.clock,{}),(0,G.jsx)(`span`,{children:bc?`Viewing this thread together`:`Viewing an earlier moment`}),(0,G.jsx)(`button`,{type:`button`,className:`viewing-past-back`,onClick:()=>bc?Y.previewSpec(null):Y.jumpTo(vc),children:`Return to live`})]}),!he&&le.length===0&&(0,G.jsxs)(`div`,{className:`ask-hint`,role:`note`,children:[(0,G.jsx)(B.chat,{}),(0,G.jsxs)(`span`,{children:[`Tap `,(0,G.jsx)(`strong`,{children:`Ask`}),` on any element to ask Mavéa about it.`]}),(0,G.jsx)(`button`,{type:`button`,className:`ask-hint-x`,"aria-label":`Dismiss tip`,onClick:ge,children:(0,G.jsx)(B.x,{})})]}),bs&&(0,G.jsx)($,{children:(0,G.jsx)(gm,{course:bs,lessonIdx:Cs,progress:Ts??Cr(bs.id),onPrev:()=>Os(bs,Cs-1),onNext:()=>Os(bs,Cs+1),onCheckpoint:ks,busy:Y.busy},`${bs.id}:${Cs}`)}),Vc&&!bs&&(0,G.jsx)(Ec,{question:Vc.question,narration:Vc.narration,sources:Bc?.sources,inferred:Kc,tint:Dc}),is&&(0,G.jsx)(d,{label:`Opening saved answer…`,overlay:!0}),(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(`div`,{className:`canvas-loading`,role:`status`,"aria-busy":`true`,"aria-label":`Loading canvas`,children:(0,G.jsx)(`div`,{className:`skel-grid`,children:(0,G.jsx)(V,{blocks:Wp})})}),children:(0,G.jsx)(Up,{data:ql??Y.viewSpec??Y.spec,spot:Sc?Y.spot:null,built:{},onProve:()=>Ei(!0),onAskBlock:Is,onAddToDashboard:e=>gt({block:e,question:Vc?.question??void 0}),selectedBlockIds:Ns,onNarrate:qo,narratingId:Jo,muted:U,viewMode:Po,onViewMode:Fo,presenting:Nn,noteGutter:Sc&&e.annotationsEnabled&&to&&ja,walkNotes:Sc?ro:void 0,blankFill:Sc?{values:Y.filled,activeKey:Y.activeBlank,fill:Y.fill,unfill:Y.unfill,activate:Y.setActiveBlank,complete:Y.complete,busy:Y.busy}:void 0,bend:Sc&&$n===null?Y.spec?.bend:void 0,onAddToFlashcard:ha,flashedIds:St,belowHeaderSlot:Vc&&Kl?(0,G.jsx)(hd,{audio:Kl,t:$n,onSeek:Sr}):void 0,viewSlot:bl?(0,G.jsxs)(`button`,{type:`button`,className:`canvas-open world-open`,title:qp,"aria-label":Kp,onClick:()=>Sl(),children:[(0,G.jsx)(B.globe,{className:`ic`,"aria-hidden":!0}),Kp]}):void 0,headerSlot:Sc?(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(`div`,{className:`pen-anchor`,ref:lo,children:[(0,G.jsx)(Zc,{enabled:e.annotationsEnabled,open:Xa,inkCount:Ja.length,onClick:()=>Za(e=>!e)}),Xa&&(0,G.jsx)(`div`,{className:`pen-popover`,children:(0,G.jsx)(Xc,{entries:Ja,turnStartMs:Ya.current,annotationsEnabled:e.annotationsEnabled,hiddenSpots:Qa,onToggle:Oo,onKeep:()=>Za(!1),onClear:()=>{Ha([]),Wa(new Set),$a(new Set),Za(!1)},onClip:()=>We(!0),onJumpTo:Ao,onToggleSpot:No})})]})}):void 0},bc?`thread-`+(Y.viewOverride?.id??``):Sc?`live-`+Y.replaceEpoch:`view-`+Y.viewIndex)}),Sc&&!Yl&&!ns&&(0,G.jsx)(dt,{spots:Qa.size>0?Va.filter(e=>!Qa.has(e.spot)):Va,revision:Io,onPlaced:qa}),Y.busy&&Sc&&(0,G.jsxs)(`div`,{className:`working-col`,children:[(0,G.jsx)(Zf,{cards:Jc}),(0,G.jsx)(ep,{thinking:Y.reasoning})]}),Sc&&!Y.busy&&(0,G.jsx)($,{children:(0,G.jsx)(cm,{chips:Y.understood,onFix:Ps})}),(0,G.jsx)(Mc,{spec:Y.viewSpec??Y.spec,followups:zc,question:Me??void 0,onAsk:ys,onTrack:()=>et(!0),onDeepZoom:Me?()=>{window.location.hash=`#/deepzoom?seed=${encodeURIComponent(Me)}`}:void 0,onCanvas:()=>Fo(`canvas`),onSeeAll:!bc&&Tc&&Tc.moments.length>=2?()=>Rc(Tc):void 0,threadCount:Tc?.moments.length,busy:Y.busy})]})})]}):lc?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(tc,{seed:r.current||void 0,speak:$i,goDemo:Wm,onStart:e=>{Qo(!0),ys(e)},onStartTalking:()=>{if(Qo(!0),!Z){Ve(Np),J(e=>e+1);return}X.start({inCanvas:!1})},onSeeHow:()=>Xo(!0),paletteSlot:(0,G.jsx)(N,{onOpen:Ci,preload:tm.preload}),launcherSlot:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ho,{items:Ml,onSeeHow:e=>e.tourChapter&&ll(e.tourChapter)}),(0,G.jsx)(`input`,{ref:jl,type:`file`,accept:Vt,multiple:!0,hidden:!0,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,t.length&&se(t).then(e=>{let t=e.filter(zt);t.length&&En(t)})}}),A.length>0&&(0,G.jsxs)(`div`,{className:`start-with-staged`,children:[(0,G.jsx)(`ul`,{className:`start-with-files`,children:A.map((e,t)=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{className:`start-with-file`,children:Bt(e)}),(0,G.jsx)(`button`,{type:`button`,className:`start-with-drop`,onClick:()=>ce(t),"aria-label":`Remove ${e.name}`,children:`✕`})]},`${e.name}-${t}`))}),(0,G.jsx)(`button`,{type:`button`,className:`start-with-another`,onClick:()=>jl.current?.click(),children:`Choose a different file`})]}),R&&(0,G.jsx)(`p`,{className:`start-with-error`,role:`alert`,children:R})]}),studySlot:(0,G.jsx)(iu,{onStudy:()=>Xt(!0)}),librarySlot:$o.length>0?(0,G.jsx)($,{children:(0,G.jsx)(rm,{entries:$o,onResume:e=>{Qo(!0),ae(!1),Pe(e.question??null),fs(e.id),os(e.spec,e.question)},onRemove:At,heading:`Pick up where you left off`,sub:`Your conversations stay on this device — tap one to step back in.`})}):void 0})}):(0,G.jsxs)(`div`,{className:`presence-stage stage`,"data-active":`1`,children:[Jl&&(0,G.jsx)(`div`,{className:`live-error-stage`,children:Jl}),Y.busy&&(0,G.jsx)(`div`,{className:`skel-stage`,children:(0,G.jsx)(Zf,{cards:Jc})})]}),tu,xl&&(0,G.jsx)($,{label:`Living answer`,children:(0,G.jsx)(Nm,{spec:yl.props.world??null,question:yl.props.title,failed:pl,onRetry:()=>_l(e=>e+1),onClose:Cl,view:yl.props.view,onExpandNode:Ol,autoWalk:Yi&&yl.id===`tour-world`,speakLine:$i})}),ji&&(0,G.jsxs)(`div`,{className:`drop-hint`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(B.paperclip,{}),(0,G.jsx)(`span`,{children:`Drop to attach — Mavéa reads PDFs, Office docs, and data files`})]}),Yo&&(0,G.jsx)($,{children:(0,G.jsx)(em,{onClose:()=>Xo(!1),speak:$i,onFullTour:aa})}),Si&&(0,G.jsx)($,{children:(0,G.jsx)(nm,{items:kl,surface:`live`,onClose:wi,pinned:s.current&&Uo.chapter?.id===`palette`})}),gi&&(0,G.jsx)(`div`,{role:`presentation`,onClick:e=>e.target===e.currentTarget&&_i(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`flex-start`,justifyContent:`center`,paddingTop:80,zIndex:50},children:(0,G.jsx)($,{children:(0,G.jsx)(am,{onClose:()=>_i(!1),initialTab:vi,initialAdvancedYouOpen:bi})})}),ss!==null&&(0,G.jsx)($,{children:(0,G.jsx)(Sm,{frames:Y.frames,initialIndex:ss,speak:$i,cancelSpeak:ze,onClose:()=>cs(null)})}),Ue&&(0,G.jsx)($,{children:(0,G.jsx)(wm,{frames:Y.frames,retainedAudio:e=>Fr.get(Je(e)),onClose:()=>We(!1),onShared:()=>Ys.enqueue(`clipShared`)})}),Ge&&da.length>0&&(0,G.jsx)($,{children:(0,G.jsx)(Em,{answers:da,defaultIndex:Cc?Cc.moments[Cc.moments.length-1].frameIndex:da.length-1,defaultIndices:Cc?.moments.map(e=>e.frameIndex),onClose:()=>qe(!1),guided:s.current&&Uo.chapter?.action.kind===`export`})}),Ye&&(0,G.jsx)($,{children:(0,G.jsx)(Om,{onClose:()=>et(!1),initialSourceId:ls?`lib-`+ls:void 0})}),ut&&(0,G.jsxs)(`div`,{className:`cv-takeover`,role:`dialog`,"aria-modal":`true`,"aria-label":`Living dashboard`,children:[(0,G.jsxs)(`header`,{className:`cv-takeover-head`,children:[(0,G.jsxs)(`div`,{className:`cv-takeover-id`,children:[(0,G.jsx)(`span`,{className:`cv-takeover-glyph`,"aria-hidden":`true`,children:`◎`}),(0,G.jsxs)(`div`,{className:`cv-takeover-titles`,children:[(0,G.jsx)(`span`,{className:`cv-takeover-eyebrow`,children:`Living dashboard`}),(0,G.jsx)(`span`,{className:`cv-takeover-title`,children:`Investment growth · $10k at 7%`})]})]}),(0,G.jsxs)(`button`,{type:`button`,className:`cv-takeover-close`,onClick:()=>ft(null),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` Back to answer`]})]}),(0,G.jsx)(`div`,{className:`tour-dash-body`,children:(0,G.jsx)($,{children:pt?(0,G.jsx)(sm,{id:ut}):(0,G.jsx)(om,{id:ut})})})]}),ht&&(0,G.jsx)($,{children:(0,G.jsx)(km,{block:ht.block,question:ht.question,conversationTitle:Y.spec?.title,onClose:()=>gt(null),onAdded:(e,t)=>vt({id:e,title:t})})}),_t&&(0,G.jsx)(uc,{dashboardId:_t.id,dashboardTitle:_t.title,onDismiss:()=>vt(null)}),Y.spec&&(0,G.jsx)(xc,{open:Ti,onClose:()=>Ei(!1),claim:Y.spec.title,conf:ps,sources:Y.spec.sources??[],hadFiles:ee,blocks:Y.spec.blocks}),jn.open&&(0,G.jsx)($,{children:(0,G.jsx)(_m,{open:!0,spec:jn.spec,onClose:()=>Mn(e=>({...e,open:!1}))})}),fi&&(0,G.jsx)($,{children:(0,G.jsx)(xm,{entries:$o,onResume:e=>{Qo(!0),ae(!1),Pe(e.question??null),fs(e.id),os(e.spec,e.question),pi(!1)},onRemove:At,onClose:()=>pi(!1)})}),il&&(0,G.jsx)(ao,{chapters:_c,currentIndex:yc,onJump:Mo,onClose:()=>al(!1)}),Jn&&ol&&(0,G.jsx)($,{children:(0,G.jsx)(um,{model:ol,level:Jn,onLevel:Yn,onJump:e=>{Y.jumpTo(e),Yn(null)},onClose:()=>Yn(null)})}),an&&(0,G.jsx)($,{children:(0,G.jsx)(zm,{cfg:sn(e),memoryNodes:kn(),speak:$i,onDebrief:e=>{ln(!1),y(e)},onClose:()=>ln(!1),onPrepTurn:(e,t)=>{ln(!1),Pe(t),Y.run(e,void 0,void 0,void 0,void 0,t)}})}),Qt&&ol&&(0,G.jsx)($,{children:(0,G.jsx)(ym,{model:ol,onJump:e=>{Y.jumpTo(e),$t(!1)},onShare:Y.frames.length>0?()=>{$t(!1),We(!0)}:void 0,onClose:()=>$t(!1)})}),un&&(0,G.jsx)($,{children:(0,G.jsx)(fm,{records:mr(),chapters:_c,onLand:e=>{pn(!1);let t=fr(e,$o);Qo(!0),ae(!1),t?(Pe(t.question??null),fs(t.id),os(t.spec,t.question)):(Pe(e.question),Y.run(e.question))},onGoDeeper:e=>{pn(!1),Qo(!0),ae(!1),Pe(e),Y.run(e)},autoTour:s.current,onClose:()=>pn(!1)})}),vn&&(0,G.jsx)($,{children:(0,G.jsx)(jm,{pdf:vn,cfg:sn(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>yn(null)})}),bn&&(0,G.jsx)($,{children:(0,G.jsx)(Um,{doc:bn,cfg:sn(e),onClose:()=>xn(null)},bn.id)}),Cn&&(0,G.jsx)($,{children:(0,G.jsx)(Fm,{sources:Cn,cfg:sn(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>Tn(null)})}),Dn&&(0,G.jsx)($,{children:(0,G.jsx)(mm,{model:Dn,cfg:sn(e),speak:$i,showcase:s.current,onClose:()=>An(null)})}),Yt&&(0,G.jsx)($,{children:(0,G.jsx)(Vm,{onClose:()=>Xt(!1)})}),Tt&&(0,G.jsx)($,{children:(0,G.jsx)(hm,{mode:`add`,initial:Tt.initial,deck:Tt.deck,origin:`block`,source:Tt.source,heading:`Flashcards from ${re(Tt.block)}`,enrich:Tt.enrich,decks:ir(),onSaved:e=>{if(e.length&&Tt.block.id){let e=Tt.block.id;Ct(t=>new Set(t).add(e))}fa(e)},onClose:()=>kt(null)})}),As&&(0,G.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(B.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[As.missedCards.length,` card`,As.missedCards.length===1?``:`s`,` from this checkpoint`]}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>js(null),children:`Dismiss`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>Ms(As),children:`Add`})]}),!As&&Wt&&(0,G.jsxs)(`div`,{className:`cards-pill is-ask`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`div`,{className:`cards-pill-head`,children:[(0,G.jsx)(B.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[Wt.count,` card`,Wt.count===1?``:`s`,` saved to “`,Wt.deck,`”`]})]}),(0,G.jsxs)(`div`,{className:`cards-pill-ask`,children:[(0,G.jsx)(`span`,{className:`cards-pill-q`,children:`Want Mavéa to help you remember these?`}),(0,G.jsx)(`span`,{className:`cards-pill-sub`,children:`They’ll come back for a quick practice every so often.`}),(0,G.jsxs)(`div`,{className:`cards-pill-choices`,children:[(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>ma(`collection`),children:`No thanks`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>ma(`spaced`),children:`Yes`})]})]})]}),!As&&!Wt&&Nt&&(0,G.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(B.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[Nt.count,` card`,Nt.count===1?``:`s`,` added`]}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>{or(Nt.ids),Lt(null)},children:`Undo`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>{window.location.hash=`#/flashcards`,Lt(null)},children:`View`})]})]})}export{qm as LiveApp};
79
+ `)}var Pf=/https?:\/\/[^\s<>"')\]]+/i;function Ff(e){let t=e.match(Pf);return t?t[0].replace(/[.,;:!?]+$/,``):null}function If(e){let t=Ff(e);return t?e.replace(t,``).trim().split(/\s+/).filter(Boolean).length<=12:!1}function Lf(e){return`Check this for me: ${e} — what's actually true, what's shaky, and what's missing context? Ground every verdict in real sources.`}var Rf=`Check the claim in this screenshot — what's actually true, what's shaky, and what's missing context? Ground every verdict in real sources.`;function zf(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable:!1}var Bf=_t.map(e=>{let t=vt[e];return{id:e,label:t.label,description:`${t.archetype} — ${t.blurb}`,accent:t.tokens.accent}}),Vf=`mavea-preso-style`;function Hf(e){return Bf.some(t=>t.id===e)}function Uf(){try{let e=localStorage.getItem(Vf);return Hf(e)?e:`folio`}catch{return`folio`}}function Wf(e){try{localStorage.setItem(Vf,e)}catch{}}function Gf(e){return e<5?`Late night`:e<12?`This morning`:e<17?`This afternoon`:`Tonight`}function Kf(e){let t=Math.max(1,Math.round(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function qf(e,t){if(e.length===0||t.length===0)return null;let n=e[0],r=e[e.length-1],i=`${Gf(new Date(n.at).getHours())}, so far.`,a=[`${Vc(n.at)} – ${Vc(r.at)}`,Kf(r.at-n.at),`${t.length} ${t.length===1?`topic`:`topics`}`,`${e.length} ${e.length===1?`moment`:`moments`}`].join(` · `),o=Bc(e),s=[];for(let n of t){let t=n.moments[0],r=n.moments[n.moments.length-1],i=e[r.frameIndex],a=i?.narration||i?.question||``;if(!a)continue;let c=n.moments.map(e=>o.get(e.frameIndex)).find(Boolean);s.push({title:n.title,clock:Vc(e[t.frameIndex]?.at),line:a,frameIndex:r.frameIndex,...c?{corrected:`Corrected — ${c.note.what}: was ${c.note.was}, now ${c.note.now}`}:{}})}return s.length?{heading:i,meta:a,rows:s}:null}var Jf=300;function Yf({transcript:e,mode:t,note:n,transcribing:r=!1}){let[i,a]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!r){a(!1);return}let e=window.setTimeout(()=>a(!0),Jf);return()=>window.clearTimeout(e)},[r]);let o=r&&i;return(0,G.jsx)(`div`,{className:`listen-stage`,children:(0,G.jsxs)(`div`,{className:`listen-card`+(o?` is-transcribing`:``),children:[(0,G.jsxs)(`span`,{className:`listen-eq`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]}),(0,G.jsxs)(`div`,{className:`listen-body`,children:[(0,G.jsxs)(`div`,{className:`listen-line`,children:[e?`“${e}`:o?`Heard you`:`Listening`,(0,G.jsx)(`span`,{className:`listen-caret`,"aria-hidden":`true`}),e?`”`:``]}),(0,G.jsx)(`div`,{className:`listen-note`,role:`status`,"aria-live":`polite`,children:o?`Got that — one moment…`:n??(t===`always`?`Always on — Mavéa answers when you finish a thought.`:t===`hold`?`Release the mic or shortcut to send.`:`It sends when you pause — or tap the mic to send now.`)})]})]})})}var Xf=250;function Zf(e){let t=(0,J.c)(6),{cards:n}=e,[r,i]=(0,W.useState)(!1),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.setTimeout(()=>i(!0),Xf);return()=>window.clearTimeout(e)},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,W.useEffect)(a,o),!r||n.length===0)return null;let s;t[2]===n?s=t[3]:(s=n.map(Qf),t[2]=n,t[3]=s);let c;return t[4]===s?c=t[5]:(c=(0,G.jsx)(`div`,{className:`skel-grid`,role:`status`,"aria-label":`Building the answer`,children:s}),t[4]=s,t[5]=c),c}function Qf(e,t){return(0,G.jsxs)(`div`,{className:`skel-card`,children:[(0,G.jsxs)(`span`,{className:`skel-eyebrow`,children:[`✦ `,e.label,`…`]}),e.lines.map($f)]},t)}function $f(e,t){return(0,G.jsx)(`span`,{className:`skel-line`,style:{width:`${e}%`}},t)}function ep({thinking:e=!1}){return(0,G.jsxs)(`div`,{className:`composing-status`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(`span`,{className:`composing-orb`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:e?`Thinking it through`:`Composing your answer`}),(0,G.jsxs)(`span`,{className:`composing-dots`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]})]})}function tp(e){let t=(0,J.c)(14),{activity:n,sources:r}=e,i,a,o,s,c,l;if(t[0]!==n||t[1]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.slice(0,3),t=n===`searching`;if(!t&&e.length===0){l=null;break bb0}i=`turn-chips`,a=`status`,o=`polite`,s=t&&e.length===0&&(0,G.jsxs)(`span`,{className:`turn-chip`,children:[(0,G.jsx)(B.globe,{}),` Searching the web…`]}),c=e.map(np)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;return t[8]!==i||t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==c?(u=(0,G.jsxs)(`div`,{className:i,role:a,"aria-live":o,children:[s,c]}),t[8]=i,t[9]=a,t[10]=o,t[11]=s,t[12]=c,t[13]=u):u=t[13],u}function np(e,t){return(0,G.jsxs)(`span`,{className:`turn-chip src`,children:[(0,G.jsx)(`i`,{className:`turn-chip-dot`,"aria-hidden":`true`}),ve(e.url)??e.title]},t)}function rp(){return(0,W.useSyncExternalStore)(Ne,De,ip)}function ip(){return!1}var ap=600,op=!1,sp=null,cp=null,lp=new Set;function up(){if(Te()){sp===null&&!op&&(sp=window.setTimeout(()=>{sp=null,op=!0;for(let e of lp)e()},ap));return}if(sp!==null&&(window.clearTimeout(sp),sp=null),op){op=!1;for(let e of lp)e()}}function dp(e){return lp.add(e),cp??=Ne(up),()=>{lp.delete(e),lp.size===0&&(cp?.(),cp=null,sp!==null&&(window.clearTimeout(sp),sp=null),op=!1)}}function fp(){return(0,W.useSyncExternalStore)(dp,mp,pp)}function pp(){return!1}function mp(){return op}var hp=600,gp=!1,_p=null,vp=null,yp=new Set;function bp(){if(De()){if(_p!==null&&(window.clearTimeout(_p),_p=null),!gp){gp=!0;for(let e of yp)e()}return}_p!==null||!gp||(_p=window.setTimeout(()=>{_p=null,gp=!1;for(let e of yp)e()},hp))}function xp(e){return yp.add(e),vp??=Ne(bp),()=>{yp.delete(e),yp.size===0&&(vp?.(),vp=null,_p!==null&&(window.clearTimeout(_p),_p=null),gp=!1)}}function Sp(){return(0,W.useSyncExternalStore)(xp,wp,Cp)}function Cp(){return!1}function wp(){return gp}var Tp={scalar:`Key figure`,series:`Trend`,composition:`Breakdown`,comparison:`Comparison`,ranking:`Ranking`,distribution:`Distribution`,relationship:`Relationship`,hierarchy:`Structure`,flow:`Process`,sequence:`Timeline`,keyvalue:`Readouts`,list:`Checklist`,geo:`Map`,code:`Code`,tabular:`Table`,status:`Status`},Ep=/^(please|hey|ok(ay)?|so|now|can|could|would|will|you|how|what|why|when|where|which|who|should|is|are|do|does|did|tell|show|give|make|build|plan|help|i|me|us|my|about|the|a|an)\b[\s,'’]*/i;function Dp(e,t=4){let n=e.trim().replace(/\s+/g,` `);for(let e=0;e<8;e++){let e=n.replace(Ep,``);if(e===n)break;n=e}return n.replace(/[?!.]+$/,``).split(` `).slice(0,t).join(` `).trim()}var Op=[[78,52],[64,88],[82,40]];function kp(e,t){let n=Dp(e),r=er(e,t),i=Object.entries(r).filter(([e,t])=>t>0&&Tp[e]).sort((e,t)=>t[1]-e[1]).map(([e])=>Tp[e]),a=hn(e)===`rich`?3:2,o=[`Finding`];for(let e of i){if(o.length>=a)break;o.includes(e)||o.push(e)}for(;o.length<a;)o.push(o.length===1?`Readouts`:`Details`);return o.map((e,t)=>({label:n?`${e} — ${n}`:e,lines:Op[t%Op.length]}))}function Ap(e){let t=e&&Tp[e]||(e===`text`?`Finding`:null);return{label:t?`Building — ${t.toLowerCase()}`:`Building`,lines:Op[0]}}function jp(e){return e.paletteOpen||e.shareOpen||e.exportOpen||e.dashOpen||e.showSettings||e.proofOpen||e.showHow||e.replayAt!==null||e.recapOpen||e.atlasOpen||e.delegateOpen||e.srsOpen||e.zoomLevel!==null||e.mindViewOpen}function Mp(e,t){let n=e.left-t.left+e.width/2,r=e.top-t.top+e.height/2,i=Math.min(e.width/2+14,t.width*.45),a=e.height/2+10,o=Math.PI*2*1.12,s=[];for(let e=0;e<=32;e++){let t=-Math.PI/2+o*e/32;s.push({x:n+Math.cos(t)*i,y:r+Math.sin(t)*a})}return s}var Np=`Local voice input isn’t available here — check browser microphone support, or type instead.`,Pp=`Microphone access is blocked — allow mic access for this site to talk to Mavéa.`,Fp=`Couldn’t reach your microphone — check it’s connected and not in use by another app.`,Ip=`Local transcription is still starting or unavailable — try again in a moment, or type instead.`;function Lp(){let e=(0,J.c)(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,W.useState)(t),[i,a]=(0,W.useState)(null),[o,s]=(0,W.useState)(!1),c;e[1]===n.length?c=e[2]:(c=async e=>{a(null);let t=6-n.length;if(t<=0)return a(`You can attach up to 6 files.`),[];let i=[],o=null;for(let n of e.slice(0,t)){let e=await Lt(n);if(e.ok&&e.attachment)i.push(e.attachment);else if(!o){let t=/\.(pdf|docx|pptx|xlsx)$/i.test(n.name);o=e.error===`too-large`?`"${n.name}" is too large (max ${t?40:10} MB).`:`"${n.name}" isn't a supported type (images, PDF, Office docs, or text/data files like CSV, TXT, Markdown, JSON).`}}return e.length>t&&(o=`Only the first ${t} file(s) were added.`),i.length&&r(e=>[...e,...i]),o&&a(o),i},e[1]=n.length,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{r(t=>t.filter((t,n)=>n!==e))},e[3]=u):u=e[3];let d=u,f;return e[4]!==i||e[5]!==n||e[6]!==l||e[7]!==o?(f={attached:n,setAttached:r,attachError:i,setAttachError:a,turnHadFiles:o,setTurnHadFiles:s,onFiles:l,removeAttachment:d},e[4]=i,e[5]=n,e[6]=l,e[7]=o,e[8]=f):f=e[8],f}var Rp=`mavea-live-bookmarks`;function zp(){let[e,t]=(0,W.useState)(()=>{try{let e=localStorage.getItem(Rp);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}});return{bookmarks:e,toggleBookmark:(0,W.useCallback)(e=>{t(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(Rp,JSON.stringify([...n]))}catch{}return n})},[])}}var Bp=`mavea-live-ask-hint`;function Vp(){let e=(0,J.c)(3),[t,n]=(0,W.useState)(Hp),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(!0);try{localStorage.setItem(Bp,`1`)}catch{}},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a={askHintSeen:t,dismissAskHint:i},e[1]=t,e[2]=a),a}function Hp(){try{return localStorage.getItem(Bp)===`1`}catch{return!1}}i();var Up=(0,W.lazy)(()=>a(()=>import(`./TopicCanvas-CyBGLgb0.js`).then(e=>e.n).then(e=>({default:e.TopicCanvas})),__vite__mapDeps([60,1,31,32,16,2,30,33,34,35,36,37,38,39,15,61,62,4,63,64,65,66,67,68,69,70,71,17,72,18,5,6,7,73,74,75,76,77]))),Wp=[{col:6},{col:6},{col:12}],Gp=`mavea-live-rail-collapsed-v1`,Kp=`View as living answer`,qp=`Why this answer is true — the causal web behind it, and its receipts`,Jp=`mavea-mic-hold-preferred`,Yp=`I may have misheard that. Review the draft, then send it.`,Xp=6400,Zp=po+at;function Qp(e){return zf(e.target)?!0:(e.key===` `||e.key===`Spacebar`)&&e.target instanceof HTMLElement&&!!e.target.closest(`button`)}var $p=s(()=>a(()=>import(`./HowItWorks-D4lHSwEb.js`).then(e=>({default:e.HowItWorks})),__vite__mapDeps([78,31,1,16,15,60,32,2,30,33,34,35,36,37,38,39,61,62,4,63,64,65,66,67,68,69,70,71,17,72,18,5,6,7,73,74,75,76,77,79,80,81,20,82,83,24]))),em=$p.Component,tm=s(()=>a(()=>import(`./CommandPalette-Cz8h94Jd.js`).then(e=>({default:e.CommandPalette})),__vite__mapDeps([84,31,1,16,35,36,37,15,85,86]))),nm=tm.Component,rm=s(()=>a(()=>import(`./Library-CDgWdTiF.js`).then(e=>({default:e.Library})),__vite__mapDeps([87,31,1,32,16,15,4,88,89,22,23,90,91,92,93,94,95]))).Component,im=s(()=>a(()=>import(`./LiveSettings-C7luyoWU.js`).then(e=>({default:e.LiveSettings})),__vite__mapDeps([96,31,1,32,16,2,30,33,34,35,36,37,38,39,15,64,81,20,97,98,27,89,22,23,90,94,26,7,12,25,28,99,100,51,101,102,103,104,105,106,54,107]))),am=im.Component,om=s(()=>a(()=>import(`./DashboardDetail-B5JZ6fRz.js`).then(e=>({default:e.DashboardDetail})),__vite__mapDeps([108,31,1,32,16,2,15,60,30,33,34,35,36,37,38,39,61,62,4,63,64,65,66,67,68,69,70,71,17,72,18,5,6,7,73,74,75,76,77,19,83,109,22,23,90,99,27,26,12,25,28,110,111,112,113,114,115,116,117,118,9,44,55,119,120,121,20,81,122,123,124,125,126,127,128,129,130,131,132]))).Component,sm=s(()=>a(()=>import(`./DashboardSettings-5tn-dw6G.js`).then(e=>({default:e.DashboardSettings})),__vite__mapDeps([133,31,1,32,16,109,22,23,90,110,111,112,113,120,126,116,117]))).Component,cm=s(()=>a(()=>import(`./UnderstoodPanel-DmJph4el.js`).then(e=>({default:e.UnderstoodPanel})),__vite__mapDeps([134,31,1,32,16,135]))).Component,lm=s(()=>a(()=>import(`./ZoomDeck-Cdvkvo2H.js`).then(e=>({default:e.ZoomDeck})),__vite__mapDeps([136,31,1,32,16,15,64,137,30,33,34,2,35,36,37,38,39,138,139]))),um=lm.Component,dm=s(()=>a(()=>import(`./AtlasView-CYZ9sfXb.js`).then(e=>({default:e.AtlasView})),__vite__mapDeps([140,31,1,16,91,92,4,88,93,94,141,22,23,142]))),fm=dm.Component,pm=s(()=>a(()=>import(`./RippleOverlay-Dwi8Ir43.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([143,31,1,32,16,2,36,35,37,30,33,34,38,39,64,66,97,98,28,41,144,145,146,147,23,148,149,150]))),mm=pm.Component,hm=s(()=>a(()=>import(`./CardEditor-D4slxmIM.js`).then(e=>({default:e.CardEditor})),__vite__mapDeps([151,31,1,16,64,104,152]))).Component,gm=s(()=>a(()=>import(`./CourseRail-DD8gtAn4.js`).then(e=>({default:e.CourseRail})),__vite__mapDeps([153,31,1,32,16,15,99,27,23,26,7,12,25,28,104,154,90,155,44,156,157,158]))).Component,_m=s(()=>a(()=>import(`./MindMapViewerDrawer-DxcjLJzB.js`).then(e=>({default:e.MindMapViewerDrawer})),__vite__mapDeps([159,32,1,31,16,15,160,30,33,34,2,35,36,37,38,39,66,161,162,163]))).Component,vm=s(()=>a(()=>import(`./Recap-BOl3SUh0.js`).then(e=>({default:e.Recap})),__vite__mapDeps([164,31,1,32,16,64,165]))),ym=vm.Component,bm=s(()=>a(()=>import(`./LibraryOverlay-CEhVoSyv.js`).then(e=>({default:e.LibraryOverlay})),__vite__mapDeps([166,31,1,32,16,15,64,137,30,33,34,2,35,36,37,38,39,87,4,88,89,22,23,90,91,92,93,94,95,167]))),xm=bm.Component,Sm=s(()=>a(()=>import(`./ReplayOverlay-CRVixwg2.js`).then(e=>({default:e.ReplayOverlay})),__vite__mapDeps([168,31,1,16,60,32,2,30,33,34,35,36,37,38,39,15,61,62,4,63,64,65,66,67,68,69,70,71,17,72,18,5,6,7,73,74,75,76,77,88,169,79,80,81,20,82,83,170,171,9,172,173,174]))).Component,Cm=s(()=>a(()=>import(`./ShareModal-DVwc57KT.js`).then(e=>({default:e.ShareModal})),__vite__mapDeps([175,31,1,32,16,2,35,36,37,15,64,70,20,176,30,33,34,38,39,177,178,179,180,181,162,93,97,98,182]))),wm=Cm.Component,Tm=s(()=>a(()=>import(`./ExportModal-BVsirsNU.js`).then(e=>({default:e.ExportModal})),__vite__mapDeps([183,31,1,32,16,2,30,33,34,35,36,37,38,39,4,64,19,177,180,97,98,82,184,62,15,63,17,185,69,71,58,74,73,75,76,186,187,188,189,160,66,161,162,163,190,191,43,88,192,193,194,195,196,197,18,198,199,200,59,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,65,219,220,221,222,223,224,225,226,81,20,227,228,72,229,230,231,232,233,137,234,235,236,237,238,239,240,241,242,243,21,244,11,245,246,247,248]))),Em=Tm.Component,Dm=s(()=>a(()=>import(`./ExtractionPreview-872OE2ZI.js`).then(e=>({default:e.ExtractionPreview})),__vite__mapDeps([249,31,1,32,16,64,250,8,22,23,90,89,109,26,7,12,27,25,28,99,44,110,118,2,9,113,112,114,55,119,120,121,20,81,30,33,34,35,36,37,38,39,122,251,132]))),Om=Dm.Component,km=s(()=>a(()=>import(`./PinToDashboard-CQHDENt1.js`).then(e=>({default:e.PinToDashboard})),__vite__mapDeps([252,31,1,32,16,15,4,64,109,22,23,90,99,27,26,7,12,25,28,112,113,124,118,2,9,44,114,55,119,120,121,20,81,30,33,34,35,36,37,38,39,125]))).Component,Am=s(()=>a(()=>import(`./PrismOverlay-L_lLIH_1.js`).then(e=>e.n).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([253,1,31,32,16,2,36,35,37,30,33,34,38,39,64,70,19,254,171,25,255,26,7,12,27,28,41,45,48,49,256,13,46,50,257]))),jm=Am.Component,Mm=s(()=>a(()=>import(`./WorldOverlay-DPkQobVE.js`).then(e=>({default:e.WorldOverlay})),__vite__mapDeps([258,31,1,32,16,2,61,37,64,66,71,190,191,88,19,226,20,80,81,30,33,34,35,36,38,39,82,172,42,43,9,44,45,46,47,259,260,57,58,59,261,262,263]))),Nm=Mm.Component,Pm=s(()=>a(()=>import(`./SynthesisOverlay-u_W105hD.js`).then(e=>({default:e.SynthesisOverlay})),__vite__mapDeps([264,31,1,16,25,26,7,12,27,28,45,253,32,2,36,35,37,30,33,34,38,39,64,70,19,254,171,255,41,48,49,256,13,46,50,257]))),Fm=Pm.Component,Im=s(()=>a(()=>import(`./PresentationDeck-Bo1BVx73.js`).then(e=>({default:e.PresentationDeck})),__vite__mapDeps([265,31,1,32,16,30,33,34,2,35,36,37,38,39,184,62,15,4,63,17,185,69,71,58,74,73,75,76,186,187,188,189,160,66,161,162,163,190,191,43,88,192,193,194,195,196,197,18,198,199,200,59,201,202,203,204,205,206,207,208,209,210,211,212,19,213,214,215,216,217,218,65,219,220,221,222,223,224,225,226,81,20,227,228,72,229,230,231,232,233,64,137,234,235,236,237,238,239,240,241,242,243,21,244,180,11,245,246]))),Lm=Im.Component,Rm=s(()=>a(()=>import(`./DelegatePanel-DO7J_rk_.js`).then(e=>({default:e.DelegatePanel})),__vite__mapDeps([266,31,1,32,16,30,33,34,2,35,36,37,38,39,64,161,162,20,81,97,98,26,7,12,27,25,28,267]))),zm=Rm.Component,Bm=s(()=>a(()=>import(`./SrsReview-Gr6Y0QTQ.js`).then(e=>({default:e.SrsReview})),__vite__mapDeps([268,31,1,16,64,104,106,269]))),Vm=Bm.Component,Hm=s(()=>a(()=>import(`./TourPrism-Cn2YHIwh.js`).then(e=>({default:e.TourPrism})),__vite__mapDeps([270,31,1,32,16,253,2,36,35,37,30,33,34,38,39,64,70,19,254,171,25,255,26,7,12,27,28,41,45,48,49,256,13,46,50,257]))),Um=Hm.Component;function $({children:e,label:t=`Feature`}){return(0,G.jsx)(f,{label:t,overlay:!0,children:e})}function Wm(){try{window.location.hash=``}catch{}}function Gm(e){return y(e)??Promise.resolve()}function Km(e){let t=e.toLowerCase().trim().replace(/[.,!?]+$/,``);return t.split(/\s+/).filter(Boolean).length<=3&&/^(yeah|yep|yes|ok|okay|sure|right|uh huh|uh-huh|mhm|mm|hmm|hm|go on|go ahead|carry on|continue|keep going|please continue|please go on|go ahead|keep it up|got it|alright)$/.test(t)?!0:/\b(keep going|go on|continue|carry on|go ahead|please continue|please go on)\b/.test(t)}function qm(){let[e]=en(),t=xt(e.provider),n=e.models[e.provider]||t.defaultModel;(0,W.useLayoutEffect)(()=>S(document),[]),(0,W.useEffect)(()=>{let t=document.documentElement;return e.fontScale===`normal`?delete t.dataset.fontScale:t.dataset.fontScale=e.fontScale,()=>{delete t.dataset.fontScale}},[e.fontScale]);let r=(0,W.useRef)(u()),i=(0,W.useRef)(Or()),s=(0,W.useRef)(c()),f=(0,W.useRef)(s.current?b():null),p=(0,W.useRef)(s.current?j():!1),m=(0,W.useRef)((()=>{if(s.current)return null;let e=C();return e&&I(e)?e:null})()),_=(0,W.useRef)(m.current?T():null);(0,W.useEffect)(()=>{s.current&&h(),f.current&&F(),p.current&&D(),m.current&&w()},[]);let[v,y]=(0,W.useState)(``),{attached:A,setAttached:P,attachError:R,setAttachError:z,turnHadFiles:ee,setTurnHadFiles:ae,onFiles:se,removeAttachment:ce}=Lp(),[le,ue]=(0,W.useState)([]),[fe,me]=(0,W.useState)(!1),{askHintSeen:he,dismissAskHint:ge}=Vp(),[H,ve]=(0,W.useState)(!1),[be,xe]=(0,W.useState)(`idle`),[Ce,Te]=(0,W.useState)(!1),Ee=be===`transcribing`||Ce,[ke,Ae]=(0,W.useState)(null),[Me,Pe]=(0,W.useState)(null),[Le,Ve]=(0,W.useState)(null),[U,He]=(0,W.useState)(!1),[Ue,We]=(0,W.useState)(!1),[Ge,qe]=(0,W.useState)(!1),[Ye,et]=(0,W.useState)(!1),[ut,ft]=(0,W.useState)(null),[pt,mt]=(0,W.useState)(!1),[ht,gt]=(0,W.useState)(null),[_t,vt]=(0,W.useState)(null),[St,Ct]=(0,W.useState)(()=>new Set),[Tt,kt]=(0,W.useState)(null),[Nt,Lt]=(0,W.useState)(null),Ut=(0,W.useRef)(void 0),[Wt,Gt]=(0,W.useState)(null),Kt=(0,W.useRef)(void 0),[qt,Jt]=(0,W.useState)(!1),[Yt,Xt]=(0,W.useState)(!1),[Qt,$t]=(0,W.useState)(!1),[an,ln]=(0,W.useState)(!1),[un,pn]=(0,W.useState)(!1),[mn,hn]=(0,W.useState)(()=>mr().length),gn=Xn().length;(0,W.useEffect)(()=>{let e=()=>{window.removeEventListener(`focusin`,t),window.removeEventListener(`pointerdown`,t)};function t(t){(t.target instanceof Element?t.target:null)?.closest(`.composer, .mic-btn`)&&(e(),dn())}return window.addEventListener(`focusin`,t),window.addEventListener(`pointerdown`,t,{passive:!0}),e},[]),(0,W.useEffect)(()=>Ar(),[]);let[vn,yn]=(0,W.useState)(null),[bn,xn]=(0,W.useState)(null),[Cn,Tn]=(0,W.useState)(null),En=(0,W.useCallback)(e=>{e.length>=4?Tn(e):e.length>0&&yn(e)},[]),[Dn,An]=(0,W.useState)(null);(0,W.useEffect)(()=>{O()&&(g(),An(hr))},[]);let[jn,Mn]=(0,W.useState)({open:!1,spec:null}),[Nn,Fn]=(0,W.useState)(!1),In=(0,W.useRef)(!1);In.current=Nn;let[Ln,Rn]=(0,W.useState)(!1),zn=(0,W.useRef)(0),Bn=(0,W.useCallback)(()=>{let e=++zn.current;Rn(!0);let t=()=>{zn.current===e&&(Rn(!1),Fn(!0))};Im.preload().then(t,t)},[]);(0,W.useEffect)(()=>()=>{zn.current+=1},[]);let[Vn,Hn]=(0,W.useState)(()=>Uf()),[Un,Wn]=(0,W.useState)(!1),[Gn,qn]=(0,W.useState)(new Set),[Jn,Yn]=(0,W.useState)(null),[Zn,Qn]=(0,W.useState)(null),[$n,er]=(0,W.useState)(null),[ur,br]=(0,W.useState)(!1),Sr=(0,W.useCallback)((e,t=!1)=>{er(e),br(e!==null&&t)},[]),Pr=(0,W.useCallback)(()=>{er(null),br(!1)},[]),Fr=(0,W.useRef)(new rd).current,Ir=(0,W.useMemo)(()=>e.quality===`fast`?null:sn(e),[e]),[Br,Vr]=(0,W.useState)(!1),Ur=(0,W.useRef)(!1);Ur.current=Br;let Wr=(0,W.useRef)([]),[Gr,Kr]=(0,W.useState)(0),qr=(0,W.useRef)(0),Jr=jf(Br,Gr),[Yr,Zr]=(0,W.useState)(!1),Qr=(0,W.useRef)(!1);Qr.current=Yr;let ti=(0,W.useRef)([]),K=xf((0,W.useMemo)(()=>sn(e),[e])),ri=(0,W.useRef)(K);ri.current=K;let q=(0,W.useRef)(null),ii=(0,W.useRef)(!1),ai=(0,W.useRef)(`idle`),oi=(0,W.useCallback)(()=>{let e=ti.current.join(` `).trim();e&&ri.current.phase===`listening`&&ri.current.onSpeechEnd(e)},[]),si=Sn(),[ci,li]=(0,W.useState)(!1),[ui,di]=(0,W.useState)(()=>{try{return localStorage.getItem(Gp)===`true`}catch{return!1}});(0,W.useEffect)(()=>{try{localStorage.setItem(Gp,String(ui))}catch{}},[ui]);let[fi,pi]=(0,W.useState)(!1),[mi,hi]=(0,W.useState)(!1),[gi,_i]=(0,W.useState)(!1),[vi,yi]=(0,W.useState)(),[bi,xi]=(0,W.useState)(!1);(0,W.useEffect)(()=>{gi||xi(!1)},[gi]);let{open:Si,openPalette:Ci,closePalette:wi}=M(),[Ti,Ei]=(0,W.useState)(!1),[Di,J]=(0,W.useState)(0),[ki,Ai]=(0,W.useState)(0),[ji,Mi]=(0,W.useState)(!1),[Ni,Pi]=(0,W.useState)(()=>{try{return localStorage.getItem(Ra)===`true`}catch{return!1}}),[Fi,Ii]=(0,W.useState)(!1),Li=(0,W.useRef)(null),[zi,Bi]=(0,W.useState)(()=>{try{return localStorage.getItem(Jp)===`true`}catch{return!1}}),Hi=Ni?`always`:zi?`hold`:`tap`;(0,W.useEffect)(()=>{try{let e=je(localStorage.getItem(`mavea-voice-mavea`)||`heart`);e&&Fe(`mavea`,e.kokoro)}catch{}},[]),(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e,t=t=>{let n=t.detail?.changed;Array.isArray(n)&&n.length>0&&(hi(!0),e&&clearTimeout(e),e=setTimeout(()=>hi(!1),2600))};return window.addEventListener(Pn,t),()=>{window.removeEventListener(Pn,t),e&&clearTimeout(e)}},[]);let Ui=(0,W.useCallback)(e=>{try{localStorage.setItem(Ra,String(e))}catch{}},[]);(0,W.useEffect)(()=>{let e=Li.current;Ui(e?e.enabled:Ni)},[Ni,Ui]),(0,W.useEffect)(()=>{try{localStorage.setItem(Jp,String(zi))}catch{}},[zi]);let Wi=(0,W.useRef)(null),Gi=(0,W.useRef)(U);Gi.current=U;let Ki=(0,W.useRef)(null),[qi,Ji]=(0,W.useState)(null),[Yi,Xi]=(0,W.useState)(!1),Zi=(0,W.useRef)([]),Qi=(0,W.useRef)(()=>{}),$i=(0,W.useCallback)(e=>{Gi.current||Wi.current?.setMaveaSpeaking(!0);let t=!De(),n=Se(e,`mavea`);return t&&(Ki.current=n),n},[]);(0,W.useEffect)(()=>{Oe(U),U?Wi.current?.setMaveaSpeaking(!1):De()&&Wi.current?.setMaveaSpeaking(!0)},[U]);let[ea]=(0,W.useState)(()=>r.current||i.current?(Dt(),null):s.current||m.current?null:Et()),ta=(0,W.useRef)(Ot()).current,Y=_s({canRun:k,getConfig:()=>sn(nn()),configReady:rn,canvasReady:()=>Gi.current||Ie()===!1?Promise.resolve():Xe(()=>ga.current),getCaps:()=>tn(nn()),speak:$i,cancelSpeak:ze,getLibraryEnabled:()=>nn().libraryEnabled,initial:ea?hs(ea):void 0}),na=Gd(H,ke,Ir,Y.busy),ra=(0,W.useCallback)(()=>{window.location.hash=`#/live`,window.location.reload()},[]),aa=(0,W.useCallback)(()=>{L(),window.location.hash=`#/live`,window.location.reload()},[]),oa=(0,W.useRef)(`normal`);oa.current=Y.phase;let ca=(0,W.useRef)(null);ca.current=Y.activeBlank;let la=(0,W.useRef)([]);la.current=Y.spec?.blanks??[],(0,W.useEffect)(()=>{cn()},[]),(0,W.useEffect)(()=>{s.current||m.current||Y.frames.length>0&&wt(Y.history,Y.frames)},[Y.frames,Y.history]),(0,W.useEffect)(()=>{if(!(Y.frames.length===0||Y.busy))return o(Cm.preload)},[Y.frames.length,Y.busy]),(0,W.useEffect)(()=>{if(!s.current)return;let e=p.current&&f.current===`prism`;if(!(p.current&&!e))return o(()=>Promise.all([Hm.preload(),ua()]).then(()=>void 0),e?300:2500)},[]);let da=(0,W.useMemo)(()=>Y.frames.map((e,t)=>({index:t,label:e.question?_e(e.question):`Answer ${t+1}`,spec:e.spec})),[Y.frames]),fa=(0,W.useCallback)(e=>{if(e.length){if(!tr().styleAsked&&sr().length===e.length){Gt({count:e.length,deck:e[0].deck}),Kt.current&&clearTimeout(Kt.current),Kt.current=setTimeout(()=>{nr(),Gt(null)},12e3);return}Lt({count:e.length,ids:e.map(e=>e.id)}),Ut.current&&clearTimeout(Ut.current),Ut.current=setTimeout(()=>Lt(null),6e3)}},[]),ma=(0,W.useCallback)(e=>{Kt.current&&clearTimeout(Kt.current),e?rr(e):nr(),Gt(null)},[]);(0,W.useEffect)(()=>()=>{Ut.current&&clearTimeout(Ut.current),Kt.current&&clearTimeout(Kt.current)},[]),(0,W.useEffect)(()=>{if(!e.autoSaveFlashcards)return;let t=Y.frames[Y.frames.length-1];if(!t)return;let n=lu(t.spec.blocks);if(n.length>0){let e=ar(n,{deck:t.spec.topic||t.spec.title||`General`,origin:`auto`});fa(e)}},[Y.frames,e.autoSaveFlashcards,fa]);let ha=(0,W.useCallback)(t=>{let n=Y.viewSpec??Y.spec,r=n?.topic||n?.title||`General`,{cards:i,exact:a}=bu(t),o={ts:Date.now(),...t.id?{blockId:t.id}:{},...Me?{question:Me}:{},...n?.topic?{topic:n.topic}:{}},s=sn(e),c=!!s.apiKey;kt({block:t,initial:i,deck:r,source:o,enrich:!a&&c?()=>wu(t,s):void 0})},[Y.viewSpec,Y.spec,Me,e]),ga=(0,W.useRef)(null),_a=(0,W.useRef)(null),va=(0,W.useRef)(()=>{}),ya=(0,W.useRef)([]),ba=(0,W.useRef)(()=>{}),xa=(0,W.useRef)(()=>{});ba.current=()=>{let e=document.querySelector(`.bend-slider`);if(!e)return;e.scrollIntoView({block:`center`,behavior:`smooth`});let t=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set;if(!t)return;ya.current.forEach(e=>window.clearTimeout(e)),ya.current.length=0;let n=Number(e.min||0),r=Number(e.max||100),i=Number(e.step||1)||1,a=Number(e.value),o=Math.min(r,n+(r-n)*.78);for(let n=1;n<=26;n++)ya.current.push(window.setTimeout(()=>{let r=a+(o-a)*n/26,s=Math.round(r/i)*i;t.call(e,String(s)),e.dispatchEvent(new Event(`input`,{bubbles:!0}))},500+n*90))},(0,W.useEffect)(()=>{let e=ya.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]);let Sa=(0,W.useRef)(()=>{}),Ca=(0,W.useRef)(null),wa=(0,W.useRef)(null),Ta=(0,W.useRef)(null),Ea=x(),Da=(0,W.useRef)(!1),Oa=(0,W.useRef)(null),ka=(0,W.useRef)(!1),Aa=(0,W.useRef)(null),[ja,Ma]=(0,W.useState)(!1),[Na,Pa]=(0,W.useState)(!1),Fa=(0,W.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id,i=n.saySpoken??n.say;r&&i&&e.set(r,i)}return e},[Y.tour,Y.spec]),Ia=(0,W.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id;r&&n.mark&&e.set(r,n.mark)}return e},[Y.tour,Y.spec]),Ba=(0,W.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id,i=n.marks??(n.mark?[n.mark]:[]);r&&i.length&&e.set(r,i)}return e},[Y.tour,Y.spec]),[Va,Ha]=(0,W.useState)([]),[Ua,Wa]=(0,W.useState)(()=>new Set),qa=(0,W.useCallback)(e=>{Wa(t=>t.has(e)?t:new Set(t).add(e))},[]),Ja=(0,W.useMemo)(()=>Va.filter(e=>e.noteText!==void 0||Ua.has(e)),[Va,Ua]),Ya=(0,W.useRef)(Date.now());(0,W.useEffect)(()=>{Ha([]),Wa(new Set),Ya.current=Date.now()},[Y.turn]);let[Xa,Za]=(0,W.useState)(!1);(0,W.useEffect)(()=>Za(!1),[Y.turn]);let[Qa,$a]=(0,W.useState)(()=>new Set);(0,W.useEffect)(()=>$a(new Set),[Y.turn]);let eo=(0,W.useRef)(!1);(0,W.useEffect)(()=>{let e=!!Y.error;e&&!eo.current&&ga.current?.scrollTo({top:0,behavior:`smooth`}),eo.current=e},[Y.error]);let[to,no]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=ga.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>no(e.clientWidth>=1280),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[Y.turn]);let ro=(0,W.useMemo)(()=>Va.filter(e=>e.noteText&&!Qa.has(e.spot)).map(e=>({spot:e.spot,text:e.noteText})),[Va,Qa]),{bookmarks:oo,toggleBookmark:so}=zp(),lo=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(!Xa)return;function e(e){lo.current&&!lo.current.contains(e.target)&&Za(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[Xa]);let fo=(0,W.useRef)(Y.spec);fo.current=Y.spec;let po=(0,W.useCallback)((e,t,n,r,i,a,o,s)=>{e&&Ha(c=>{if(s?c.some(t=>t.spot===e&&t.noteText!==void 0):c.some(t=>t.spot===e&&t.kind===n?.kind&&t.at===n?.at&&t.noteText===void 0))return c;let l=!t&&!n?.at?fo.current?.blocks.find(t=>t.id===e)??null:null,u=n?.kind===`connect`&&typeof n.onIndex==`number`?fo.current?.blocks[n.onIndex]?.id:void 0,d={spot:e,line:t??(l?re(l):void 0),mark:n,generous:r,kind:n?.kind??(s?`note`:void 0),at:n?.at,...n?.kind===`connect`&&n.to?{to:n.to}:{},color:n?.color,inkedAt:Date.now(),...i?{delayMs:i}:{},...a?{badgeMs:a}:{},...o?{stepNumber:o}:{},...u?{toSpot:u}:{},...s?{noteText:s}:{}};return[...c,d]})},[]),yo=e.teachMode||$c(Me),bo=(0,W.useRef)(e.annotationsEnabled);bo.current=e.annotationsEnabled;let xo=(0,W.useRef)(Ni);xo.current=Ni;let So=(0,W.useRef)(null);So.current=Y.narration??null;let Co=(0,W.useRef)(!1),wo=(0,W.useRef)(!1);wo.current=Y.busy;let To=(0,W.useRef)(null),Eo=(0,W.useRef)(Y.frames);Eo.current=Y.frames;let Do=(0,W.useRef)([]),Oo=(0,W.useCallback)(()=>{let e=!bo.current;To.current=null,on({annotationsEnabled:e,teachMode:e}),e?(Ha(Do.current),Do.current=[]):Ha(e=>(Do.current=e,[]))},[]),ko=(0,W.useRef)(null),Ao=(0,W.useCallback)((e,t)=>{let n=_a.current,r=n?.querySelector(`[data-spot-id="${CSS.escape(e)}"]`);if(!r)return;let i=t?n?.querySelector(`[data-spot-id="${CSS.escape(t)}"]`):null,a=ga.current;if(i&&a){let e=a.getBoundingClientRect(),t=r.getBoundingClientRect(),n=i.getBoundingClientRect(),o=(Math.min(t.top,n.top)+Math.max(t.top+t.height,n.top+n.height))/2-e.top-a.clientHeight/2;a.scrollTo({top:Math.max(0,a.scrollTop+o),behavior:`smooth`})}else r.scrollIntoView({behavior:`smooth`,block:`center`});let o=[r,i].filter(e=>!!e);o.forEach(e=>e.classList.add(`ink-jump-glow`)),ko.current!=null&&window.clearTimeout(ko.current),ko.current=window.setTimeout(()=>{o.forEach(e=>e.classList.remove(`ink-jump-glow`)),ko.current=null},800)},[]);(0,W.useEffect)(()=>()=>{ko.current!=null&&window.clearTimeout(ko.current)},[]);let jo=(0,W.useRef)(null),Mo=(0,W.useCallback)((e,t)=>{Y.jumpTo(e),t&&(jo.current!=null&&cancelAnimationFrame(jo.current),jo.current=requestAnimationFrame(()=>{jo.current=null,Ao(t)}))},[Y,Ao]);(0,W.useEffect)(()=>()=>{jo.current!=null&&cancelAnimationFrame(jo.current)},[]);let No=(0,W.useCallback)(e=>{$a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[Po,Fo]=$r(),[Io,Lo]=(0,W.useState)(0),Ro=(0,W.useRef)(Po);Ro.current!==Po&&(Ro.current=Po,Lo(e=>e+1));let zo=(0,W.useCallback)(()=>{let e=To.current;e&&(To.current=null,bo.current=e.annotationsEnabled,on(e))},[]),Bo=(0,W.useCallback)(()=>{if(bo.current)return;let{annotationsEnabled:e,teachMode:t}=nn();To.current??={annotationsEnabled:e,teachMode:t},bo.current=!0,on({annotationsEnabled:!0,teachMode:!0})},[]),Vo={isBusy:()=>Y.busy||ka.current,isSpeaking:()=>De(),hasCanvas:()=>!!Y.spec,showFrame:(e,t,n)=>{Pe(t),y(``),Y.showFrame(e,t,{interrupt:!1,revealNow:Gi.current,silent:n?.silent})},typeInto:y,speak:e=>(nl(e),$i(e)),cancelSpeech:ze,setMuted:He,setViewMode:Fo,setInkArmed:me,setPresenting:Fn,setShareOpen:We,setPaletteOpen:e=>e?Ci():wi(),pressKeepGoing:e=>{let t=document.querySelectorAll(`.footer-keepgoing .kg-row`),n=Array.from(t).find(t=>t.textContent?.includes(e))??t[0];n&&(n.classList.add(`kg-tour-press`),window.setTimeout(()=>n.classList.remove(`kg-tour-press`),620))},pinFirstBlock:()=>{let e=fo.current?.blocks.find(e=>!!e.id);e&&Is(e)},pinFirstBlocks:e=>{let t=(fo.current?.blocks??[]).filter(e=>!!e.id).slice(0,e);ue(t)},startWatchThinking:()=>{Zr(!0),Qr.current=!0},bankThought:e=>{ti.current=[...ti.current,e],K.onTranscript(ti.current.join(` `))},openAtlas:()=>{if(mr().length<3){for(let e of[`money`,`space`,`travel`,`budget`]){let t=ni(e),n=t?.frames[0]?.spec;t&&n&&jt(n,t.question)}hn(pr(Mt()))}pn(!0)},openPrism:e=>{ua().then(t=>{Go.current.chapter?.action.kind===`prism`&&xn(t[e]??null)})},showcaseFeature:e=>{if(e===`library`&&Mt().length<3)for(let e of[`money`,`space`,`travel`]){let t=ni(e),n=t?.frames[0]?.spec;t&&n&&jt(n,t.question)}if(e===`deepzoom`){window.location.hash=`#/deepzoom?demo=1`;return}if(e===`synthesis`){window.location.hash=`#/synthesis?demo=1`;return}if(e===`living-answer`&&Zi.current.length===0){a(async()=>{let{WORLD_SEED:e}=await import(`./seed-D_P5jyog.js`);return{WORLD_SEED:e}},[]).then(({WORLD_SEED:e})=>{Ji({type:`world`,id:`tour-world`,col:12,props:{title:e.title,world:e}}),Xi(!0),Qi.current(`tour-world`)});return}Ho.current[e]?.run()},setSpot:e=>Y.setSpot(e),scriptedMark:()=>va.current(),drawPenTourStep:e=>{Bo(),e===`result`?(ga.current?.scrollTo({top:0,behavior:`smooth`}),po(`live-1`,`After thirty years, the investment reaches seventy-six thousand one hundred twenty-three dollars.`,{kind:`circle`,at:`$76,123`,color:`key`},!1,void 0,5600,1)):po(`live-1`,`Compounding grows the original investment by more than seven point six times.`,{kind:`underline`,at:`7.6x`,color:`warm`},!1,void 0,3e3,2)},drawPenOnFirstBlock:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e?.id&&(Bo(),ga.current?.scrollTo({top:0,behavior:`smooth`}),po(e.id,e.note,void 0,!0,void 0,3200))},openDashboards:()=>{let e=pa();e?ft(e):et(!0)},dashboardShowSettings:()=>mt(!0),openModelSettings:()=>{yi(`model`),_i(!0)},openExport:()=>qe(!0),shareRemix:()=>{document.querySelector(`.shm-remix`)?.click()},sharePalette:e=>{Array.from(document.querySelectorAll(`.shm-chip`)).find(t=>t.textContent?.trim().toLowerCase()===e.toLowerCase())?.click()},exportSetFormat:e=>{document.querySelector(`[data-export-format="${e}"]`)?.click()},exportPickTemplate:e=>{document.querySelectorAll(`[data-export-template]`)[e]?.click()},toggleRail:()=>di(e=>!e),bendIt:()=>ba.current(),openFlashcards:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e&&ha(e)},openTourCourse:()=>xa.current(),fireMemoryGlow:()=>{hi(!0),window.setTimeout(()=>hi(!1),2600)},stopRevealWalk:()=>{Da.current=!0},closeAllOverlays:()=>{Y.setSpot(null),ue([]),y(``),Fo(`everything`),me(!1),Sa.current(),Ha([]),Wa(new Set),$a(new Set),Za(!1),Fn(!1),We(!1),wi(),An(null),pn(!1),yn(null),xn(null),Tn(null),kt(null),ln(!1),qe(!1),et(!1),ft(null),mt(!1),di(!1),Xt(!1),$t(!1),_i(!1),Zr(!1),Vr(!1),Ss(null),ws(0),Es(null)}},Ho=(0,W.useRef)({}),Uo=Oi({active:s.current,startChapter:f.current,solo:p.current,ops:Vo}),Wo=ia({active:!!m.current,personaId:m.current,startStep:_.current,ops:Vo}),Go=(0,W.useRef)(Uo);Go.current=Uo,(0,W.useEffect)(()=>{if(!s.current)return;let e=e=>{let t=Go.current;if(e.key===`Escape`)t.skip();else if(Qp(e))return;else e.key===`ArrowRight`?(e.preventDefault(),t.next()):e.key===`ArrowLeft`?(e.preventDefault(),t.prev()):(e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),t.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Ko=(0,W.useRef)(Wo);Ko.current=Wo,(0,W.useEffect)(()=>{if(!m.current)return;let e=e=>{let t=Ko.current;if(e.key===`Escape`)t.skip();else if(Qp(e))return;else e.key===`ArrowRight`?(e.preventDefault(),t.next()):e.key===`ArrowLeft`?(e.preventDefault(),t.prev()):(e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),t.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{(Uo.done||Wo.done)&&zo()},[Uo.done,Wo.done,zo]),(0,W.useEffect)(()=>()=>zo(),[zo]);let{narrate:qo,narratingId:Jo}=Hr({takeWheel:()=>{Da.current=!0},hush:ze,moveSpot:e=>{Y.setSpot(e.id??null),bo.current&&po(e.id,e.note??(e.id?Fa.get(e.id):void 0)??void 0,e.id?Ia.get(e.id):void 0,!0)},canSpeak:()=>!Gi.current,lineFor:e=>e.noteSpoken??e.note??(e.id?Fa.get(e.id):void 0)??ie(e),speakLine:$i},Y.turn),[Yo,Xo]=(0,W.useState)(!1),[Zo,Qo]=(0,W.useState)(!!ea||!!r.current&&xs()||!!i.current&&xs()||s.current||!!m.current),$o=wn();(0,W.useEffect)(()=>{hn(pr($o))},[$o]),(0,W.useEffect)(()=>{let e=Y.spec;if(!e||Oa.current===Y.turn)return;if(Oa.current=Y.turn,ea&&Y.turn===0){Y.spot&&Y.setSpot(null);return}if(s.current&&!Y.narration&&Y.tour.length===0){Y.spot&&Y.setSpot(null);return}let t=[];for(let n of Y.tour){let r=e.blocks[n.index]?.id;r&&t.push(n.say?{spot:r,say:n.say}:{spot:r})}let n=[];if(t.length?n=ct(e.blocks,{opener:Y.narration,tour:t,maxStops:5}):st({blockCount:e.blocks.length,mode:Y.mode,hasModelTour:!1,teach:yo})&&(n=ct(e.blocks,{opener:Y.narration,maxStops:yo?e.blocks.length:3,startId:Y.spot??void 0})),!n.length){Y.spot&&Y.setSpot(null);return}let r=t.length>0,i=Gi.current&&r&&bo.current;Ma(i);let a=n.map(e=>({spot:e.set&&`spot`in e.set?e.set.spot??void 0:void 0,line:e.set&&`caption`in e.set?e.set.caption:void 0}));if(Gi.current){if(bo.current){let e=uo({stops:a,spokenWalk:r,withNotes:i,teach:yo,marksById:Ba});for(let t of e)po(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}Y.setSpot(null);return}Da.current=!1,ka.current=!0;let o=!1,c,l,u=0,d=null,f=()=>{d&&=(d(),null)},p=()=>{ka.current=!1,Aa.current=null,l&&clearTimeout(l),Pa(!1),nl(null)},m=()=>o?!0:Da.current?(p(),Y.setSpot(null),!0):!1,h=(e,t)=>{if(e!==void 0&&Y.setSpot(e??null),r&&t&&nl(t),e&&bo.current){let n=Ba.get(e);if(n?.length){let r=lt+(n.length-1)*900,i=n.length>1;for(let a=0;a<n.length;a++){let o=a*900,s=a===n.length-1?r:void 0;po(e,t,n[a],yo,o,s,i?a+1:void 0)}}else yo&&po(e,t,void 0,yo)}},g=e=>{let t=e&&!Gi.current&&!oe()?ye(e):null;if(!t){b();return}d=t.release,mo(t,{speakLine:$i,isCancelled:()=>o,isDismissed:()=>Da.current},e=>{if(d=null,e===`dismissed`){p(),Y.setSpot(null);return}e!==`cancelled`&&b()})},_=e=>{let t=e.set&&`spot`in e.set?e.set.spot:void 0,n=e.set&&`caption`in e.set?e.set.caption:void 0;return(t?Fa.get(t):void 0)??n},v=e=>{for(let t=e+1;t<n.length;t++){let e=_(n[t]);if(e){we(e,`mavea`);return}}},y=async(e,t,n,r,i)=>{let a=e.ms??1700;if(t===0||!i){if(h(n,r),v(t),await $e({floorMs:at,capMs:Ze(a)}),m())return;g(n);return}let o=$i(i),s=await Qe(o);m()||(h(n,r),v(t),s?await ot(o,a):await it(a),!m()&&g(n))},b=()=>{if(o||u>=n.length){p();return}if(Da.current){p(),Y.setSpot(null);return}let e=u,t=n[u++],i=t.set&&`caption`in t.set?t.set.caption:void 0,a=t.set&&`spot`in t.set?t.set.spot:void 0,s=_(t);r?y(t,e,a,i,s):(h(a,i),c=setTimeout(b,t.ms??0))};return Aa.current=()=>{if(o=!0,c&&clearTimeout(c),f(),ze(),bo.current){let e=uo({stops:a,from:u,spokenWalk:r,withNotes:!1,teach:yo,marksById:Ba});for(let t of e)po(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}p(),Y.setSpot(null)},(async()=>{l=setTimeout(()=>{o||Pa(!0)},600);let t=ga.current;await nt({loadFams:()=>te(ne(e.blocks)),settle:t?()=>yt(t,{timeoutMs:rt,perImageMs:tt}):void 0,firstLine:Ki.current,wantVoice:!Gi.current&&Ie()!==!1}),l&&clearTimeout(l),Pa(!1),!m()&&b()})(),()=>{o=!0,Aa.current=null,ka.current=!1,c&&clearTimeout(c),l&&clearTimeout(l),Pa(!1),f()}},[Y.turn]),(0,W.useEffect)(()=>{let e=Y.spot,t=Y.spec;if(!t||!e)return;let n=0,r=0,i=()=>{let a=ga.current;if(!a)return;let o=a.querySelector(`.spotlit`);if(!o){++n<12&&(r=window.setTimeout(i,90));return}let s=a.getBoundingClientRect(),c=o.getBoundingClientRect(),l=c.top-s.top-(a.clientHeight-c.height)/2,u=Ba.get(e)?.find(e=>e.kind===`connect`),d=u&&typeof u.onIndex==`number`?t.blocks[u.onIndex]?.id:void 0,f=d?a.querySelector(`[data-spot-id="${CSS.escape(d)}"]`):null;if(f){let e=f.getBoundingClientRect(),t=(Math.min(c.top,e.top)+Math.max(c.top+c.height,e.top+e.height))/2-s.top-a.clientHeight/2,n=a.clientHeight*.35;l=Math.max(l-n,Math.min(l+n,t))}a.scrollTo({top:Math.max(0,a.scrollTop+l),behavior:`smooth`})};return r=window.setTimeout(i,90),()=>window.clearTimeout(r)},[Y.spot,Y.spec,Ba]);let es=(0,W.useCallback)(()=>{Y.spot&&(Da.current=!0,Y.setSpot(null))},[Y]),ts=(0,W.useCallback)(()=>{let e=Aa.current;e?e():(ze(),es())},[es]),[ns,rs]=(0,W.useState)(!1),[is,as]=(0,W.useState)(!1),os=(0,W.useCallback)(async(...e)=>{(0,Nr.flushSync)(()=>rs(!0)),as(!0);try{await te(ne(e[0].blocks))}catch{}finally{as(!1)}Y.restore(...e)},[Y]);(0,W.useEffect)(()=>{Y.busy&&rs(!0)},[Y.busy]),(0,W.useEffect)(()=>{rs(!1)},[Y.turn]),(0,W.useEffect)(()=>{if(!Y.spot)return;let e=e=>{e.key===`Escape`&&ts()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Y.spot,ts]);let[ss,cs]=(0,W.useState)(null);(0,W.useEffect)(()=>cs(null),[Y.turn]),(0,W.useEffect)(()=>Ei(!1),[Y.turn]),(0,W.useEffect)(()=>ue([]),[Y.turn]),(0,W.useEffect)(()=>li(!1),[Y.turn]);let[ls,us]=(0,W.useState)(null),ds=(0,W.useRef)(!1),fs=(0,W.useCallback)(e=>{ds.current=!0,us(e)},[]);(0,W.useEffect)(()=>{if(ds.current){ds.current=!1;return}us(null)},[Y.turn]);let ps=(()=>{let e=Y.spec?.blocks.find(e=>e.type===`insight`);return e&&e.type===`insight`?e.props.conf:void 0})(),ms=Pl({resetKey:Y.turn,onCommit:e=>{let{intents:t,blocks:n}=zl(e,(Y.viewSpec??Y.spec)?.blocks??[]);if(!t.length)return;let r=Rl([...le,...n]);ue([]),Y.run(Ll(t),void 0,r.length?r:void 0,void 0,t)}});va.current=()=>{let e=_a.current,t=e?.querySelector(`[data-spot-id]`);!e||!t||(t.scrollIntoView({block:`center`,behavior:`smooth`}),window.setTimeout(()=>vs(e,t),560))};let vs=(e,t)=>{let n=e.querySelector(`.ink-user-overlay`);if(!n)return;let r=(Array.from(t.querySelectorAll(`*`)).filter(e=>e.children.length===0&&e.offsetHeight>0&&/\d/.test(e.textContent??``)).map(e=>({el:e,size:parseFloat(getComputedStyle(e).fontSize)})).sort((e,t)=>t.size-e.size)[0]?.el??t).getBoundingClientRect(),i=n.getBoundingClientRect(),a=Mp(r,i);ms.onStroke(a,{stage:e,svgRect:i});let o=t.getAttribute(`data-spot-id`);o&&Y.setSpot(o)};Sa.current=()=>ms.clear();let ys=(0,W.useCallback)((t,n=!1)=>{let r=t.trim();if(Qr.current&&r){y(``),q.current!==null&&(window.clearTimeout(q.current),q.current=null),ti.current=[...ti.current,r],K.onTranscript(ti.current.join(` `));return}if(r&&(/^diff --git /m.test(r)||/^@@ .* @@/m.test(r))){let t=gr(_r(r));if(t.changes.length>0){y(``),An(t);let n=sn(e);n&&vr(t,r,n).then(e=>An(t=>t&&e));return}}if(!r&&A.length===0&&ms.intents.length===0)return;let i=Y.refuseReason(r,A.length>0||ms.intents.length>0);if(i&&!(n&&i===`busy`)){Ve(gs[i]);return}Ae(null),Pe(r||null),y(``);let a=A;ae(a.length>0),P([]),z(null);let o=Y.viewSpec??Y.spec,{intents:s,blocks:c}=zl(ms.intents,o?.blocks??[]),l=Rl([...le,...c]);ue([]),ms.clear(),Y.run(r||Ll(s),a.length?a:void 0,l.length?l:void 0,void 0,s.length?s:void 0,void 0,void 0,n?{force:!0}:void 0)},[Y,A,le,ms,K,e,Ae,P,z,ae]);(0,W.useEffect)(()=>{if(r.current&&xs()){let e=r.current;r.current=``,ys(e)}},[]);let[bs,Ss]=(0,W.useState)(null),[Cs,ws]=(0,W.useState)(0),[Ts,Es]=(0,W.useState)(null),Ds=(0,W.useRef)(null),Os=(0,W.useCallback)((e,t)=>{let n=e.lessons[t];if(!n)return;let r=Cr(e.id);Ss(e),ws(t),Es(r),xr(e.id,t),Qo(!0);let i=`Lesson ${t+1}: ${n.title}`,a=yr(e.id,n.id);if(a){Pe(i),Y.showFrame(a,i);return}let o=kr(e,t,r,jr(e.topic));Ds.current={courseId:e.id,lessonId:n.id,framesBefore:Y.frames.length},Pe(i),Y.run(`Teach this lesson: "${n.title}" — ${n.goal}`,void 0,void 0,void 0,void 0,i,void 0,{lesson:o})},[Y]);xa.current=()=>{let e=Ou();if(!e)return;let t=e.lessons[0];Ss(e),ws(0),Es(Cr(e.id)),xr(e.id,0),Qo(!0);let n=yr(e.id,t.id);if(n){let e=`Lesson 1: ${t.title}`;Pe(e),Y.showFrame({...n,narration:``,tour:[]},e,{interrupt:!1})}},(0,W.useEffect)(()=>{let e=i.current;if(!e||(i.current=void 0,!xs()))return;let t=wr(e.courseId);if(!t)return;let n=Math.min(Math.max(e.lessonIdx,0),t.lessons.length-1);Os(t,n)},[]),(0,W.useEffect)(()=>{let e=Ds.current;!e||Y.busy||(Ds.current=null,!(Y.frames.length<=e.framesBefore)&&Er(e.courseId,e.lessonId,Y.frames[Y.frames.length-1]))},[Y.frames,Y.busy]);let ks=(0,W.useCallback)(e=>{if(!bs)return;let t=bs.lessons[Cs];t&&(Tr(bs.id,t.id,e),Es(Cr(bs.id)))},[bs,Cs]);(0,W.useEffect)(()=>{if(typeof window>`u`||!bs)return;let e=()=>Es(Cr(bs.id));return window.addEventListener(Dr,e),()=>window.removeEventListener(Dr,e)},[bs]);let[As,js]=(0,W.useState)(null);(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.missedCards.length&&js(t)};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[]);let Ms=(0,W.useCallback)(e=>{let t=e.missedCards.flatMap(t=>ar([t],{deck:e.courseTitle,tags:[e.lessonTitle,`checkpoint`],source:{question:t.front,topic:e.topic,ts:e.at},origin:`auto`}));js(null),fa(t)},[fa]),Ns=(0,W.useMemo)(()=>new Set(le.map(e=>e.id)),[le]),Ps=(0,W.useCallback)((e,t)=>{Pe(`Correction: ${t}`),Y.run(`Correction — you understood "${e}", but it's actually "${t}". Keep the rest of your understanding and update the answer wherever this changes it.`,void 0,void 0,void 0,void 0,`Correction: ${t}`)},[Y]),Fs=(0,W.useCallback)(e=>{let t=e.map(re),n=e.length===2?`Fuse these two: what is the real relationship between "${t[0]}" and "${t[1]}"? Lead with the single most useful connection, and be explicit about correlation versus cause.`:`Fuse these ${e.length}: what are the most important connections and patterns across ${t.map(e=>`"${e}"`).join(`, `)}? Lead with the strongest insight, then note any correlations, trade-offs, or cause-and-effect you can support from the data.`;Pe(`Fuse: ${t.join(` × `)}`),ue([]),Y.run(n,void 0,e,void 0,void 0,`Fuse: ${t.join(` × `)}`)},[Y]),Is=(0,W.useCallback)(e=>{e.id&&(ue(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e]),J(e=>e+1),ge())},[ge]),Ls=le.length>1?[`How do these relate?`,`Compare them`,`Summarize these`]:[`Explain this`,`Why it matters`,`Go deeper`],Rs=Zt(e.provider).capabilities.vision;(0,W.useEffect)(()=>{let e=e=>{if(zf(e.target))return;let t=e.clipboardData;if(!t)return;let n=[...t.files].filter(e=>e.type.startsWith(`image/`));if(n.length){e.preventDefault(),se(n),y(Rf),J(e=>e+1);return}let r=t.getData(`text/plain`);r&&If(r)&&(e.preventDefault(),y(Lf(Ff(r))),J(e=>e+1))},t=null,n=e=>{e.dataTransfer?.types.some(e=>e===`Files`||e===`text/uri-list`)&&(e.preventDefault(),Mi(!0),t&&clearTimeout(t),t=setTimeout(()=>Mi(!1),200))},r=e=>{Mi(!1);let t=e.dataTransfer;if(!t)return;if(zf(e.target)){t.files.length&&e.preventDefault();return}let n=[...t.files],r=n.filter(e=>e.type.startsWith(`image/`)),i=n.filter(e=>!e.type.startsWith(`image/`)),a=n.length?null:Ff(t.getData(`text/uri-list`)||t.getData(`text/plain`)||``);!n.length&&!a||(e.preventDefault(),r.length?(se(r),y(Rf)):i.length?se(i):a&&y(Lf(a)),J(e=>e+1))};return window.addEventListener(`paste`,e),window.addEventListener(`dragover`,n),window.addEventListener(`drop`,r),()=>{window.removeEventListener(`paste`,e),window.removeEventListener(`dragover`,n),window.removeEventListener(`drop`,r),t&&clearTimeout(t)}},[se]);let zs=(0,W.useRef)(Po);zs.current=Po,(0,W.useEffect)(()=>{if(!Nn)return;let e=zs.current;Fo(`focus`),document.documentElement.requestFullscreen?.().catch(()=>{});let t=e=>{e.key===`Escape`&&Fn(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t),Fo(e),document.fullscreenElement&&document.exitFullscreen().catch(()=>{})}},[Nn,Fo]);let Bs=(0,W.useRef)(0);(0,W.useEffect)(()=>{let e=Y.frames.length;if(e>Bs.current&&In.current){let t=e-1;qn(e=>new Set(e).add(t))}Bs.current=e},[Y.frames.length]);let X=La({mode:`vad`,onBargeIn:()=>{ts(),Co.current=!0},onResult:e=>{let t=e.transcript.trim(),n=Co.current;if(e.lowConfidence&&t){Co.current=!1,Ae(null),y(t),Ve(Yp),J(e=>e+1),ii.current&&Qr.current&&(ii.current=!1,Wi.current?.stop(),ti.current.length>0?oi():(Qr.current=!1,Zr(!1)));return}if(Co.current){Co.current=!1;let e=So.current;if(!t||Km(t)){e&&$i(e);return}}if(t){if(Ae(t),Qr.current){ti.current=[...ti.current,t],Ae(null);let e=ti.current.join(` `);K.onTranscript(e),ii.current&&(ii.current=!1,oi());return}if(Ur.current){if(Ae(null),Af(t)){Vr(!1);let e=Wr.current;if(Wr.current=[],Kr(0),e.length){let t=Math.round((Date.now()-qr.current)/6e4);Pe(`Your thinking, sorted`),Y.run(Nf(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}}else Mf(t)&&(Wr.current=[...Wr.current,t],Kr(e=>e+1));return}if(Lr({phase:oa.current,activeKey:ca.current,blanks:la.current,fill:Y.fill},t)){Ae(null);return}ys(t,n||wo.current)}},onStateChange:e=>{if(ai.current=e.phase,xe(e.phase),ve(e.phase===`listening`),e.phase===`listening`?e.speechEnding!==void 0&&Te(e.speechEnding):Te(!1),e.phase===`idle`&&(Co.current=!1),e.phase===`listening`)Ve(null),q.current!==null&&(window.clearTimeout(q.current),q.current=null);else if(e.phase===`idle`&&Qr.current&&ri.current.phase===`listening`){if(ii.current){ii.current=!1,oi();return}q.current!==null&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>{q.current=null,Wi.current?.stop(),oi()},Xp)}e.error===`not-allowed`?Ve(Pp):e.error===`unsupported`?Ve(Np):e.error===`audio`?Ve(Fp):e.error===`transcription`&&Ve(Ip)}}),Z=X.capabilities.stt;Wi.current=X;let Vs=(0,W.useCallback)(()=>{if(Qr.current){if(q.current!==null&&(window.clearTimeout(q.current),q.current=null),H||ai.current===`transcribing`){ii.current=!0,H&&X.start({inCanvas:!!Y.spec,continuous:!1}),X.forceStop();return}if(X.stop(),ti.current.length===0){Qr.current=!1,Zr(!1);return}oi()}},[H,oi,X,Y.spec]),Hs=(0,W.useCallback)(()=>{H&&X.stop(),q.current!==null&&(window.clearTimeout(q.current),q.current=null),Ae(null),ii.current=!1,Zr(!1)},[H,X]),Us=Nn||jp({paletteOpen:Si,shareOpen:Ue,exportOpen:Ge,dashOpen:Ye,showSettings:gi,proofOpen:Ti,showHow:Yo,replayAt:ss,recapOpen:Qt,atlasOpen:un,delegateOpen:an,srsOpen:Yt,zoomLevel:Jn,mindViewOpen:jn.open});(0,W.useEffect)(()=>{if(!Yr||K.phase===`idle`||Us)return;let e=e=>{e.key===`Escape`&&Hs()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Yr,K.phase,Us,Hs]),(0,W.useEffect)(()=>{let e=document.documentElement;return si?e.dataset.whisper=``:delete e.dataset.whisper,Be(si?On:1),()=>{delete e.dataset.whisper,Be(1)}},[si]),(0,W.useEffect)(()=>{Br?qr.current=Date.now():(Wr.current=[],Kr(0))},[Br]),(0,W.useEffect)(()=>{if(Yr&&H&&ke){let e=Dd(ke),t=ti.current.length>0?[...ti.current,e].join(` `).trim():e;t&&K.onTranscript(t)}},[ke,H,Yr]),(0,W.useEffect)(()=>{Yr||(ti.current=[],K.reset(),q.current!==null&&(window.clearTimeout(q.current),q.current=null))},[Yr]),(0,W.useEffect)(()=>()=>{q.current!==null&&window.clearTimeout(q.current)},[]),(0,W.useEffect)(()=>{let e=()=>X.setMaveaSpeaking(De()&&!Gi.current);return e(),Ne(e)},[X]);let Ws=v.trim().length>0;(0,W.useEffect)(()=>{if(!Rr({alwaysOn:Ni&&!Fi,sttOk:Z,composerHasText:Ws}))return;let e=!1,t=setTimeout(()=>{e||X.start({inCanvas:!!Y.spec,continuous:!0})},100);return()=>{e=!0,clearTimeout(t),X.stop()}},[Ni,Fi,Z,X,Ws]),zr({alwaysOn:Ni&&!Fi,sttOk:Z,composerHasText:Ws,listening:H},{start:()=>X.start({inCanvas:!!Y.spec,continuous:!0}),stop:X.stop});let Gs=(0,W.useCallback)(()=>{if(!Z){Ve(Np),J(e=>e+1);return}Ni?H?X.forceStop():Fi?(Ii(!1),ts(),X.start({inCanvas:!!Y.spec,continuous:!0})):ai.current===`transcribing`?(Ii(!0),X.forceStop()):(Ii(!0),X.stop()):H?X.forceStop():(ts(),X.start({inCanvas:!!Y.spec}))},[Z,Ni,Fi,H,X,Y.spec,ts]),[Ks,qs]=(0,W.useState)(!1),Js=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=()=>{Js.current!==null&&(window.clearTimeout(Js.current),Js.current=null)};if(Y.status===`thinking`){qs(!0),e();return}if(Y.status===`idle`){qs(!1),e();return}if(Ks&&Y.spec){qs(!1),e();return}Ks&&Js.current===null&&(Js.current=window.setTimeout(()=>{qs(!1),Js.current=null},1100))},[Y.status,Y.spec,Ks]),(0,W.useEffect)(()=>()=>{Js.current!==null&&window.clearTimeout(Js.current)},[]);let Ys=io({speak:$i,cancelSpeak:ze,isSpeaking:De,muted:U,turnCount:Y.frames.length,gates:{atRest:Y.status===`showing`||Y.status===`idle`,busy:Y.busy,listening:H,introHold:Ks,hasCanvas:!!Y.spec,modalOpen:Si||Ue||Ge||Ye||gi||Ti||Yo||ss!==null||Qt||an||Yt||un||vn!==null||Cn!==null||jn.open||Jn!==null}}),Xs=Ys.interjecting,Zs=(0,W.useRef)(null),Qs=(0,W.useMemo)(()=>{let e=Ga(Y.spec);return e===`warm`&&Ka(Y.spec)&&(Zs.current===null||Zs.current===Y.spec)&&(Zs.current=Y.spec,e=`celebrate`),za(Y.status,H,Xs,e,U,Ee)},[Y.status,H,Xs,Y.spec,U,Ee]),$s=(0,W.useMemo)(()=>cc({status:Y.status,listening:H,interjecting:Xs,spec:Y.viewSpec??Y.spec}),[Y.status,H,Xs,Y.viewSpec,Y.spec]);(0,W.useEffect)(()=>(rc(document,$s),()=>ic(document)),[$s]);let ec=(0,W.useCallback)(()=>{let e=Ca.current,t=wa.current,n=Ta.current;if(!e||!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();!r.width||!i.width||(e.style.setProperty(`--home-x`,`${Math.round(r.left+r.width/2-(i.left+i.width/2))}px`),e.style.setProperty(`--home-y`,`${Math.round(r.top+r.height/2-(i.top+i.height/2))}px`),e.style.setProperty(`--home-scale`,(Math.max(r.width,12)*1.3/150).toFixed(3)))},[]);(0,W.useLayoutEffect)(()=>(ec(),window.addEventListener(`resize`,ec),()=>window.removeEventListener(`resize`,ec)),[ec]),(0,W.useLayoutEffect)(()=>{ec()},[ui,ec]);let ac=!!Y.spec&&!(Ks||Xs),oc=Zo,sc=Zo&&(!Y.spec||Ks||Xs),lc=!Y.spec&&!Zo;(0,W.useEffect)(()=>{if(!e.morningBrief||qt||lc||Y.busy||Y.restored||!Ql(Ot()))return;$l(),Jt(!0);let t=Y.frames.slice(-3).map(e=>e.question).filter(Boolean);Y.run(eu(t),void 0,void 0,void 0,void 0,`Morning brief`)},[e.morningBrief,lc,qt,Y.busy,Y.restored]),(0,W.useEffect)(()=>{ac&&Ca.current&&(Ca.current.style.setProperty(`--scroll-dock`,`0`),ec())},[ac,ec]);let dc=Xs?Ys.line:Y.narration,fc=!ac&&!!dc&&(Xs||Y.status===`speaking`||Y.status===`showing`),pc=sc&&Y.status===`speaking`,mc=(0,W.useRef)(new Map),[hc,gc]=(0,W.useState)(0);(0,W.useEffect)(()=>{let e=mc.current,t=new Set(Y.frames.map(e=>e.at)),n=!1;for(let r of[...e.keys()])t.has(r)||(e.delete(r),n=!0);let r=Y.frames.filter(t=>!e.has(t.at)),i=!1;return(async()=>{for(let t of r){let r=await fn(`${t.question} ${t.narration} ${t.spec?.title??``}`.trim());if(i)return;r&&(e.set(t.at,r),n=!0)}n&&gc(e=>e+1)})(),()=>{i=!0}},[Y.frames]);let _c=(0,W.useMemo)(()=>Pt(Y.frames,Y.frames.map(e=>mc.current.get(e.at)??null)),[Y.frames,hc]),vc=Y.frames.length-1,yc=Y.viewIndex??vc,bc=Y.viewOverride!=null,Sc=!bc&&(Y.viewIndex==null||Y.viewIndex===vc),Cc=Y.viewOverride?_c.find(e=>Y.viewOverride?.id===`thread-`+e.id):void 0,Tc=_c.find(e=>e.moments.some(e=>e.frameIndex===yc)),Dc=_c.length>=2?Tc?.color:void 0,kc=Y.frames[vc],Ac=_c[_c.length-1],jc=_c.length>=2&&Ac?.moments.length===1&&Ac.moments[0].frameIndex===vc,Nc=Sc&&!Y.busy&&jc&&kc?.mode===`replace`&&!!kc&&mc.current.has(kc.at),[Pc,Fc]=(0,W.useState)(null),Ic=(0,W.useRef)(-1);(0,W.useEffect)(()=>{Nc&&Ic.current!==vc&&(Ic.current=vc,Fc(vc))},[Nc,vc]);let Rc=(0,W.useCallback)(e=>{let t=co(e.moments.map(e=>Y.frames[e.frameIndex]).filter(e=>!!e),{title:e.title,tint:e.color,id:`thread-`+e.id});t&&(Y.previewSpec(t),ga.current?.scrollTo({top:0}))},[Y]),zc=Sc&&le.length===0?(Y.viewSpec??Y.spec)?.suggests??[]:[],Bc=Y.viewSpec??Y.spec,Vc=bc?Bc?{question:null,narration:Bc.title||`This thread`}:null:Uc({spec:Bc,frames:Y.frames,viewIndex:Y.viewIndex,narration:Y.narration,lastAsk:Me}),Kc=(0,W.useMemo)(()=>wc(Bc),[Bc]),qc=Gc(Wc(Y.status)),Jc=(0,W.useMemo)(()=>Y.busy?Y.status===`showing`?[Ap(Y.pendingShape)]:kp(Me??``,Y.history):[],[Y.busy,Y.status,Y.pendingShape,Me,Y.history]),Yc=rp(),Qc=fp(),el=(0,W.useSyncExternalStore)(Uu,Wu,Wu),[tl,nl]=(0,W.useState)(null);(0,W.useEffect)(()=>nl(null),[Y.turn]),(0,W.useEffect)(()=>Ma(!1),[Y.turn]);let rl=Sp()&&!U;(0,W.useEffect)(()=>{U&&Aa.current?.()},[U]);let[il,al]=(0,W.useState)(!1);(0,W.useEffect)(()=>al(!1),[Y.turn]),(0,W.useEffect)(()=>$t(!1),[Y.turn]);let ol=(0,W.useMemo)(()=>qf(Y.frames,_c),[Y.frames,_c]),sl=cr(),cl=lr(),ll=(0,W.useCallback)(e=>{if(s.current){Go.current.playExtra(e);return}Y.busy||E(e)},[Y.busy]),ul=(0,W.useCallback)(e=>{if(!Z){Ve(Np);return}ts(),Li.current===null&&(Li.current={enabled:Ni,paused:Fi}),Ii(!1),Pi(!0),e===`think`?(Vr(!1),Ur.current=!1,Zr(!0),Qr.current=!0):(Zr(!1),Qr.current=!1,Vr(!0),Ur.current=!0)},[Z,Ni,Fi,ts]);(0,W.useEffect)(()=>{if(Yr||Br)return;let e=Li.current;e!==null&&(Li.current=null,!Y.spec&&!Y.busy&&Qo(!1),Ii(e.paused),Pi(e.enabled),e.enabled&&!e.paused&&Z&&!v.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):X.stop())},[Yr,Br,Z,v,X,Y.spec,Y.busy]);let[dl,fl]=(0,W.useState)(null),[pl,hl]=(0,W.useState)(!1),[gl,_l]=(0,W.useState)(0),vl=(0,W.useMemo)(()=>{let e=((Y.viewSpec??Y.spec)?.blocks??[]).filter(e=>e.type===`world`);return e.length>0?e:qi?[qi]:[]},[Y.viewSpec,Y.spec,qi]),yl=(0,W.useMemo)(()=>vl.find(e=>e.id===dl)??vl[0],[vl,dl]);Zi.current=vl;let bl=yl!==void 0,xl=Po===`world`&&bl,Sl=(0,W.useCallback)(e=>{e&&fl(e),hl(!1),Fo(`world`)},[Fo]);Qi.current=Sl;let Cl=(0,W.useCallback)(()=>Fo(Xr()),[Fo]);(0,W.useEffect)(()=>pe(Sl),[Sl]),(0,W.useEffect)(()=>{Po===`world`&&!bl&&Cl()},[Po,bl,Cl]);let wl=xl?yl.id??null:null,Tl=xl&&yl.props.world===void 0,{generateWorld:El}=Y;(0,W.useEffect)(()=>{if(!wl||!Tl)return;let e=!0;return hl(!1),El(wl).then(t=>{e&&!t&&hl(!0)}),()=>{e=!1}},[wl,Tl,gl,El]);let{expandWorld:Dl}=Y,Ol=(0,W.useCallback)((e,t)=>wl?Dl(wl,e,t):Promise.resolve(null),[wl,Dl]),Q={atlas:{available:mn>0,reason:`Fills in as you discuss things`,run:()=>pn(!0),preload:dm.preload},"pdf-world":{available:A.some(zt),reason:`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map`,run:()=>{let e=A.filter(zt);if(e.length>0){En(e);return}J(e=>e+1),Ai(e=>e+1),z(`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map of claims.`)},preload:Am.preload},synthesis:{available:!0,run:()=>{let e=A.filter(zt);e.length>=2?Tn(e):window.location.hash=`#/synthesis`},preload:()=>A.filter(zt).length>=2?Pm.preload():Gm(`#/synthesis`)},ripple:{available:!0,run:()=>An(hr),preload:pm.preload},review:{available:!0,run:()=>Xt(!0),preload:Bm.preload},flashcards:{available:!0,run:()=>{window.location.hash=`#/flashcards`},preload:()=>Gm(`#/flashcards`)},courses:{available:!0,run:()=>{window.location.hash=`#/courses`},preload:()=>Gm(`#/courses`)},dashboards:{available:!0,run:()=>{window.location.hash=`#/dashboards`},preload:()=>Gm(`#/dashboards`)},gallery:{available:!0,run:()=>{window.location.hash=`#/gallery`},preload:()=>Gm(`#/gallery`)},recap:{available:!!ol,reason:`Once we've covered something`,run:()=>$t(!0),preload:vm.preload},present:{available:!!Y.spec,reason:`Once there is an answer`,run:Bn,preload:Im.preload},track:{available:!!Y.spec,reason:`Once there is a conversation to track`,run:()=>et(!0),preload:Dm.preload},share:{available:Y.frames.length>0,reason:`Once there is something to share`,run:()=>We(!0),preload:Cm.preload},export:{available:Y.frames.length>0,reason:`Once there is an answer to export`,run:()=>qe(!0),preload:Tm.preload},focus:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Fo(`focus`)},board:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Fo(`canvas`)},"living-answer":{available:bl,reason:`Once an answer has causes to trace`,run:()=>Sl(),preload:Mm.preload},ink:{available:!!Y.spec,reason:`Once there is an answer to mark`,run:()=>me(!0)},blanks:{available:!0,run:()=>Ve(`When a number in an answer is truly yours to give, Mavéa leaves a glowing hole for it — type, say, or drop a card in, and it finishes the answer around your value.`)},"watch-me-think":{available:Z,reason:Z?void 0:Np,run:()=>ul(`think`)},"just-listen":{available:Z,reason:Z?void 0:Np,run:()=>ul(`listen`)},whisper:{available:!0,run:()=>{yi(`you`),xi(!0),_i(!0)},preload:im.preload},ghost:{available:Z&&e.quality!==`fast`,reason:Z?e.quality===`fast`?`Needs Balanced quality or higher — you're on Fast`:void 0:Np,run:()=>ul(`listen`)},delegate:{available:!0,run:()=>ln(!0),preload:Rm.preload},memory:{available:!0,run:()=>{yi(`you`),_i(!0)},preload:im.preload},library:{available:$o.length>0,reason:`Fills in as you save conversations`,run:()=>pi(!0),preload:bm.preload},deepzoom:{available:!0,run:()=>{let e=Me??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},preload:()=>Gm(`#/deepzoom`)},"zoom-deck":{available:!!ol,reason:`Opens once there are a few answers to pull back from`,run:()=>Yn(`chapters`),preload:lm.preload},"morning-brief":{available:!0,run:()=>{yi(`you`),xi(!0),_i(!0)},preload:im.preload},settings:{available:!0,run:()=>{yi(void 0),_i(!0)},preload:im.preload},how:{available:!0,run:()=>Xo(!0),preload:$p.preload}};Ho.current=Q;let kl=bt.filter(e=>e.surface!==`demo`).map(e=>{let t=Q[e.id]??{available:!0,run:()=>void 0},n=e.id===`how`?aa:e.tourChapter?()=>ll(e.tourChapter):void 0;return{feature:e,available:t.available,reason:t.reason,run:t.run,preload:t.preload,watch:n}}),Al=(0,W.useCallback)(()=>Qo(!0),[]),jl=(0,W.useRef)(null),Ml=go.map(e=>kl.find(t=>t.feature.id===e)).filter(e=>!!e).map(e=>{if(e.feature.id===`pdf-world`){let t=A.filter(zt),n=_o(t);return{feature:e.feature,available:!0,blurb:n.blurb,preload:e.preload,run:n.opensPicker?()=>jl.current?.click():()=>En(t)}}return{feature:e.feature,available:e.available,reason:e.reason,preload:e.preload,run:()=>{vo.has(e.feature.id)&&Al(),e.run()}}}),Nl=[{label:`New`,blurb:`Start a fresh session`,onClick:()=>{Y.reset(),Ys.reset(),Qo(!1),ae(!1),Dt()},show:!!Y.spec},{label:`Dashboard`,blurb:`Open your living dashboards`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!!Y.spec}],Fl=[{label:`Rehearse`,blurb:`Practice a hard conversation — take the seat, or send your Mavéa`,onClick:Q.delegate.run,preload:Q.delegate.preload,show:!0},{label:`Study`,blurb:sl>0?`${sl} card${sl===1?``:`s`} ready`:cl===`spaced`?`Go through what you have saved`:`Flip through your cards`,onClick:Q.review.run,preload:Q.review.preload,show:!0},{label:`Manage flashcards`,blurb:`See, organize, and edit your study deck`,onClick:Q.flashcards.run,preload:Q.flashcards.preload,show:!0},{label:`Courses`,blurb:`Turn a topic into a structured syllabus — a lesson at a time, at your pace`,onClick:Q.courses.run,preload:Q.courses.preload,show:!0},{label:`Recap`,blurb:`What we covered — the session so far`,onClick:Q.recap.run,preload:Q.recap.preload,show:!!ol}],Il=[{label:`Present`,blurb:`Fill the room — the chrome falls away, the mic stays live`,onClick:Q.present.run,preload:Q.present.preload,show:!!Y.spec},{label:`Export`,blurb:`Choose a template and export a polished PDF`,onClick:Q.export.run,preload:Q.export.preload,show:Y.frames.length>0},{label:`Video`,blurb:`Share a moment, a topic, or the whole conversation`,onClick:Q.share.run,preload:Q.share.preload,show:Y.frames.length>0}],Bl=[{label:`Search all features`,blurb:`Browse Mavéa’s feature index · ${l}`,onClick:Ci,preload:tm.preload,show:!0},{label:`Atlas`,blurb:`Kept conversations and topics, as a place`,onClick:Q.atlas.run,preload:Q.atlas.preload,show:mn>0},{label:`Watch me think`,blurb:`A live map of your thinking`,onClick:Q[`watch-me-think`].run,show:Q[`watch-me-think`].available},{label:`Prism`,blurb:Q[`pdf-world`].available?`Split your document into a map of its claims`:`Attach a PDF, Office doc, or data file — then split it into claims`,onClick:Q[`pdf-world`].run,preload:Q[`pdf-world`].preload,show:!0},{label:`Ripple`,blurb:`Model a code change’s impact, risks, and a proposed ship order`,onClick:Q.ripple.run,preload:Q.ripple.preload,show:!0},{label:`Dashboards`,blurb:gn>0?`${gn} dashboard${gn===1?``:`s`} set to refresh while Mavéa is open`:`Create a dashboard that refreshes on schedule while Mavéa is open`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!0},{label:`Deep Zoom`,blurb:Me?`Zoom from field to mechanism — "${Me.slice(0,50)}${Me.length>50?`…`:``}"`:`Telescope any topic from big picture to finest detail`,onClick:()=>{let e=Me??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},show:!0}],Vl=(0,W.useCallback)(e=>{e===`out`&&ol&&Yn(`chapters`)},[ol]);dr(ga,Vl),(0,W.useEffect)(()=>(Re(Xu),()=>Re(null)),[]);let Hl=(0,W.useRef)(!0);(0,W.useEffect)(()=>{Y.busy&&(Ku(),Hl.current=!1,Qn(null),Pr())},[Y.busy,Y.turn,Pr]),(0,W.useEffect)(()=>(Ju(ss!==null),()=>Ju(!1)),[ss]),(0,W.useEffect)(()=>Pr(),[Y.viewIndex,Pr]);let Gl=Y.spec?.blocks.length??0;(0,W.useEffect)(()=>{Gl>0&&Yu(Gl)},[Gl]),(0,W.useEffect)(()=>{if(Y.busy)return;if(Y.spec){let e=Zu();if(e){Qn(e);let t=Y.frames.length-1,n=Y.frames[t];n&&Fr.set(Je(n),e)}}if(Yc||Hl.current)return;let e=window.setTimeout(()=>{Hl.current=!0,qu()},Zp);return()=>window.clearTimeout(e)},[Yc,Y.busy,Y.spec,el,Y.frames,Fr]);let Kl=(0,W.useMemo)(()=>Sc?Zn:Y.viewIndex!=null&&Y.frames[Y.viewIndex]?Fr.get(Je(Y.frames[Y.viewIndex])):null,[Sc,Zn,Y.viewIndex,Y.frames,Fr]),ql=(0,W.useMemo)(()=>{if(!ur||$n===null||!Kl)return null;let e=Sc?Y.spec:Y.viewSpec;if(!e)return null;let t=Sc?Y.tour:Y.viewIndex==null?[]:Y.frames[Y.viewIndex]?.tour??[],n=td(Kl,$n,t,e.blocks.length);return{...e,blocks:e.blocks.slice(0,n)}},[ur,$n,Kl,Sc,Y.spec,Y.viewSpec,Y.tour,Y.viewIndex,Y.frames]),Jl=Y.error?(0,G.jsxs)(`div`,{className:`live-error`,role:`alert`,children:[(0,G.jsxs)(`div`,{className:`live-error-head`,children:[(0,G.jsx)(B.alert,{}),(0,G.jsx)(`span`,{children:`Couldn’t answer`})]}),(0,G.jsx)(`p`,{className:`live-error-msg`,children:Y.error.message}),(0,G.jsxs)(`div`,{className:`live-error-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`live-error-btn primary`,onClick:()=>{let e=Y.error;e&&Y.run(e.retry,e.attachments,e.selectedBlocks,void 0,e.inkIntents,e.question)},disabled:Y.busy,children:`Retry`}),(0,G.jsx)(`button`,{type:`button`,className:`live-error-btn`,onClick:()=>_i(!0),children:`Open settings`})]})]}):null,Yl=Yr,[Xl,Zl]=(0,W.useState)(160);(0,W.useEffect)(()=>{if(!Yl)return;let e=document.querySelector(`.live-dock`);if(!e)return;let t=()=>Zl(Math.round(e.getBoundingClientRect().height)+8);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Yl]);let tu=Yl?(0,G.jsxs)(`div`,{className:`ms-stage-fill`,"data-phase":K.phase,style:{"--ms-bottom-reserve":`${Xl}px`},children:[(0,G.jsxs)(`button`,{type:`button`,className:`ms-exit`,onClick:Hs,title:`Back to the conversation (Esc)`,children:[(0,G.jsx)(B.chevL,{}),`Back to conversation`]}),(0,G.jsx)(Tf,{mindShape:K,onSettled:()=>{$i(`I think this is the shape of it.`)},onConfirmUnsaid:()=>K.confirmUnsaid(),onDismissUnsaid:()=>K.dismissUnsaid(),onAction:(e,t)=>{if(e===`add-more`)Ae(null),K.resume(),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:Ni&&!Fi});else if(e===`not-quite`)ti.current=[],K.resume(!1),Ae(null),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:Ni&&!Fi});else if(e===`share`)We(!0);else if(e===`present`)Bn();else if(e===`answer`||e===`plan`||e===`commit-plan`||e===`tell-apart`){let n=K.spec,r=e===`commit-plan`||e===`plan`?`plan`:`answer`,i=n?kf(n,r):ke??``;e===`tell-apart`&&t?.tension&&(i=`I keep coming back to “${t.tension.a}” but I also said “${t.tension.b}.” Help me tell these two reasons apart — are they the same thing or not?\n\n`+i);let a=Y.restored;if(H&&!Ni&&X.stop(),Ae(null),K.reset(),Zr(!1),i){let t=e===`tell-apart`?`Telling them apart`:n?.center||(r===`plan`?`A plan`:`An answer`);Pe(t),Y.run(i,void 0,void 0,void 0,void 0,t,n??void 0,a?{freshStart:!0}:void 0)}}},liveTranscript:ke||void 0,thoughtCount:Vd([ti.current.join(` `),ke??``].join(` `))})]}):null,nu=Yr?K.phase===`settled`||K.phase===`pausing`?`Add thought`:`Done thinking`:`Watch me think`;return(0,G.jsxs)(`div`,{className:`mavea-app with-rail live-voice canvas-flat`+(ac?` face-homed`:``)+(lc?` in-wizard`:``)+(Nn?` presenting`:``)+(ui?` rail-collapsed`:``)+(Yl?` watch-thinking`:``),"data-title":Y.spec?.title??``,...Nn?{"data-preso":Vn}:{},ref:Ca,children:[s.current&&(0,G.jsx)(Ri,{driver:Uo}),s.current&&Uo.done&&(0,G.jsx)(Vi,{onStart:ra,onReplay:aa,onPlayExtra:Uo.playExtra,hasStoredSession:ta}),m.current&&(()=>{let e=I(m.current);return e?(0,G.jsx)(sa,{driver:Wo,member:e,onExit:ra}):null})(),Ln&&(0,G.jsxs)(`div`,{className:`preso-preparing`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,G.jsx)(`span`,{className:`async-pending-spinner`,"aria-hidden":`true`}),`Preparing presentation…`]}),Nn&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`preso-style-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||Wn(!1)},children:[(0,G.jsxs)(`button`,{type:`button`,className:`preso-style-btn`+(Un?` is-open`:``),onClick:()=>Wn(e=>!e),"aria-expanded":Un,"aria-haspopup":`listbox`,children:[(0,G.jsx)(`span`,{className:`preso-swatch-sm`,style:{background:Bf.find(e=>e.id===Vn)?.accent??`var(--presence)`}}),`Style`]}),Un&&(0,G.jsx)(`div`,{className:`preso-menu`,role:`listbox`,"aria-label":`Presentation style`,children:Bf.map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":Vn===e.id,className:`preso-row`+(Vn===e.id?` is-active`:``),onClick:()=>{Hn(e.id),Wf(e.id),Wn(!1)},children:[(0,G.jsx)(`span`,{className:`preso-swatch`,style:{background:e.accent}}),(0,G.jsx)(`span`,{className:`preso-name`,children:e.label}),(0,G.jsx)(`span`,{className:`preso-desc`,children:e.description})]},e.id))})]}),(0,G.jsx)(`button`,{type:`button`,className:`present-exit`,onClick:()=>Fn(!1),title:`End the presentation (Esc)`,children:`End show · Esc`}),(0,G.jsx)($,{children:(0,G.jsx)(Lm,{spec:Y.viewSpec??Y.spec,question:Vc?.question??null,narration:Vc?.narration??Y.narration,skinId:Vn,autoAdvanceMs:s.current||m.current?2600:void 0,onExit:()=>Fn(!1)})})]}),(0,G.jsx)(`div`,{className:`presence-layer`+(ac?` corner`:sc?``:` idlehome`)+(fc?` has-caption`:``)+(mi?` is-mem-save`:``),ref:Ta,children:(0,G.jsxs)(`div`,{className:`presence-positioner`,ref:Ea,children:[Zo&&(0,G.jsx)(`div`,{className:`presence-seed`,"aria-hidden":`true`},Y.turn),(0,G.jsx)(de,{state:Qs.state,emotion:Qs.emotion,gaze:Qs.gaze,muted:U})]})}),(0,G.jsx)(`div`,{className:`presence-scrim`+(pc?` show`:``)}),fc&&(0,G.jsx)(`div`,{className:`center-caption`,role:`status`,"aria-live":`polite`,children:dc}),(0,G.jsx)(tp,{activity:Y.activity,sources:Y.busy?Y.liveSources:[]}),(0,G.jsxs)(`div`,{className:`topbar`,children:[(0,G.jsxs)(`button`,{className:`brand brand-link`,type:`button`,onClick:Wm,title:`Back to the demo`,"aria-label":`Back to the demo`,children:[(0,G.jsx)(`span`,{className:`brand-dot jelly-mark`,ref:wa}),(0,G.jsx)(`span`,{className:`brand-name`,children:`Mavéa`}),Y.spec&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`brand-sep`}),(0,G.jsx)(`span`,{className:`workspace-name`,children:Y.error?`Couldn’t answer`:Y.spec.title})]})]}),(0,G.jsxs)(`span`,{className:`live-badge`,title:`Live · ${t.label}`,"aria-label":`Live mode`,children:[(0,G.jsx)(`span`,{className:`live-dot`}),`Live`]}),(0,G.jsx)(`div`,{className:`topbar-spacer`}),(0,G.jsx)(_n,{label:`Create`,items:Nl}),(0,G.jsx)(_n,{label:`Practice`,items:Fl,badge:sl}),(0,G.jsx)(_n,{label:`Share`,items:Il}),(0,G.jsx)(_n,{label:`Explore`,items:Bl}),(0,G.jsx)(N,{onOpen:Ci,preload:tm.preload}),(0,G.jsx)(`span`,{className:`topbar-divider`,"aria-hidden":`true`}),(0,G.jsx)(Kn,{})]}),(0,G.jsx)(Hc,{chapters:_c,frames:Y.frames,currentIndex:yc,onJump:Y.jumpTo,onReplay:Y.frames.length>0?()=>cs(Y.frames.length-1):void 0,onOverview:Y.frames.length>0?()=>al(!0):void 0,resumed:Y.restored,chatOpen:ci,onToggleChat:()=>li(e=>!e),collapsed:ui,onToggleCollapse:()=>di(e=>!e),onOpenPast:$o.length>0?()=>pi(!0):void 0,onStudy:()=>Xt(!0),roomIndices:Gn,bookmarks:oo,onToggleBookmark:so,onViewMindMap:e=>{let t=Y.frames[e];t?.mind&&Mn({open:!0,spec:t.mind})},onSeeTogether:Rc}),(0,G.jsxs)(Lc,{holdEnabled:Z&&Hi===`hold`,showHint:!1,pttKey:e.pttKey,pttSide:e.pttSide,onHoldStart:()=>{ts(),X.start({inCanvas:!!Y.spec})},onHoldEnd:()=>X.forceStop(),onChangePttKey:e=>on({pttKey:e}),onChangePttSide:e=>on({pttSide:e}),children:[(si||Ni&&Z)&&(0,G.jsxs)(`div`,{className:`dock-modes`,role:`group`,"aria-label":`Listening modes`,children:[si&&(0,G.jsx)(`span`,{className:`whisper-badge`,children:`won't wake anyone`}),Ni&&Z&&(0,G.jsx)(`button`,{type:`button`,className:`listen-mode-chip`+(Br?` on`:``),"aria-pressed":Br,onClick:()=>{Vr(e=>!e),Yr&&(Qr.current=!1,Zr(!1))},title:Jr,"aria-label":Jr,children:Br?`Just listening · ${Gr} banked`:`Just listen`}),Br&&Gr>0&&(0,G.jsx)(`button`,{type:`button`,className:`listen-mode-chip`,onClick:()=>{Vr(!1);let e=Wr.current;if(Wr.current=[],Kr(0),e.length){let t=Math.round((Date.now()-qr.current)/6e4);Pe(`Your thinking, sorted`),Y.run(Nf(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}},children:`Thoughts?`})]}),Z&&(0,G.jsx)(Ke,{kind:`voice-data`,from:`live`}),Le&&(0,G.jsxs)(`div`,{className:`voice-notice`,role:`status`,children:[Le===Yp?(0,G.jsx)(B.spark,{}):(0,G.jsx)(B.micOff,{}),(0,G.jsx)(`span`,{children:Le}),(0,G.jsx)(`button`,{type:`button`,className:`voice-notice-x`,"aria-label":`Dismiss voice notice`,onClick:()=>Ve(null),children:(0,G.jsx)(B.x,{})})]}),(A.length>0||R)&&(0,G.jsxs)(`div`,{className:`attach-strip`,role:`list`,"aria-label":`Attached files`,children:[A.map((e,t)=>(0,G.jsxs)(`span`,{className:`attach-chip`,role:`listitem`,children:[Rt(e)?(0,G.jsx)(`img`,{className:`attach-thumb`,src:`data:${e.mime};base64,${e.data}`,alt:``}):(0,G.jsx)(B.paperclip,{}),(0,G.jsx)(`span`,{className:`attach-name`,children:Bt(e)}),(Ft(e)&&Rs||It(e)||Ht(e))&&(0,G.jsx)(`button`,{type:`button`,className:`attach-explode`,"aria-label":`Explode ${e.name} into a map of its claims`,title:`Explode into a map of grounded claims`,onClick:()=>yn([e]),children:`⊹ Explode`}),(0,G.jsx)(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>ce(t),children:(0,G.jsx)(B.x,{})})]},t)),(()=>{let e=A.filter(e=>It(e)||Ht(e)||Ft(e)&&Rs);if(e.length<=1)return null;let t=(0,G.jsxs)(`button`,{type:`button`,className:`attach-explode attach-compare`,"aria-label":`Compare ${e.length} documents — map their claims and find where they agree and contradict`,title:`Explode all documents together and compare them`,onClick:()=>yn(e),children:[`⊹ Compare `,e.length,` documents`]},`compare`),n=(0,G.jsxs)(`button`,{type:`button`,className:`attach-explode attach-compare`,"aria-label":`Synthesize ${e.length} sources — fuse them into one map of themes, contradictions, and gaps`,title:`Fuse all sources into one navigable Synthesis World`,onClick:()=>Tn(e),children:[`⊹ Synthesize `,e.length,` sources`]},`synth`);return e.length>=4?n:e.length>=3?(0,G.jsxs)(G.Fragment,{children:[t,n]}):t})(),R&&(0,G.jsx)(`span`,{className:`attach-error`,role:`status`,children:R})]}),A.length>0&&(0,G.jsx)(Ke,{kind:`upload`,from:`live`}),Y.spec&&(0,G.jsx)(Ul,{armed:fe,pins:ms.pins,miss:ms.miss,onUndo:ms.undo,onSend:ms.send}),le.length>0&&(0,G.jsxs)(`div`,{className:`pin-dock`,children:[(0,G.jsx)(`div`,{className:`pin-strip`,role:`list`,"aria-label":`Elements you're asking about`,children:le.map(e=>(0,G.jsxs)(`span`,{className:`pin-chip`,role:`listitem`,children:[(0,G.jsx)(B.chat,{}),(0,G.jsx)(`span`,{className:`pin-name`,children:re(e)}),(0,G.jsx)(`button`,{type:`button`,className:`pin-remove`,"aria-label":`Unpin ${re(e)}`,onClick:()=>Is(e),children:(0,G.jsx)(B.x,{})})]},e.id))}),(0,G.jsxs)(`div`,{className:`pin-suggests`,role:`list`,"aria-label":`Quick follow-ups`,children:[le.length>=2&&(0,G.jsxs)(`button`,{type:`button`,className:`live-chip pin-fuse-chip`,disabled:Y.busy,title:`Combine these ${le.length} cards into a single new answer — useful when you want Mavéa to find the pattern, trade-off, or story that runs across all of them at once`,onClick:()=>Fs(le),children:[`Fuse `,le.length,` into one`]}),Ls.map(e=>(0,G.jsx)(`button`,{type:`button`,className:`live-chip`,onClick:()=>ys(e),disabled:Y.busy,children:e},e))]})]}),(0,G.jsxs)(`div`,{className:oc?`voice-capsule`:`composer-passthrough`,children:[oc&&(0,G.jsxs)(`div`,{className:`voice-strip`,children:[rl&&!Qc?(0,G.jsxs)(`button`,{type:`button`,className:`vc-status`,onClick:ts,title:`Tap to stop and show the whole answer at once`,"aria-label":`Stop speaking and show the whole answer`,children:[(0,G.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]}),(0,G.jsx)(`span`,{className:`vc-status-label`,children:`Speaking`})]}):Na&&!U?(0,G.jsxs)(`div`,{className:`vc-status vc-preparing`,role:`status`,"aria-busy":`true`,children:[(0,G.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]}),(0,G.jsx)(`span`,{className:`vc-status-label`,children:`Preparing voice…`})]}):Qc&&!U?(0,G.jsx)(`div`,{className:`vc-status vc-preparing vc-quiet`,role:`status`,"aria-busy":`true`,"aria-label":`Preparing voice`,children:(0,G.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]})}):null,(0,G.jsx)(`div`,{className:`vc-transcript`,"aria-hidden":`true`,children:tl??Y.narration??``}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>He(e=>!e),title:U?`Unmute Mavéa's voice — your microphone is unaffected`:`Mute Mavéa's voice — muted answers land written out at once, with notes and pen marks standing in for the walk. Your microphone is unaffected.`,"aria-pressed":!U,className:`voice-switch`+(U?` is-muted`:``),children:[U?(0,G.jsx)(B.speakerOff,{}):(0,G.jsx)(B.speaker,{}),(0,G.jsx)(`span`,{className:`voice-switch-label`,children:`Mavéa's voice`}),(0,G.jsx)(`span`,{className:`voice-switch-track`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{className:`voice-switch-thumb`})})]}),(0,G.jsx)(gd,{}),(0,G.jsx)(yd,{}),(0,G.jsxs)(`button`,{className:`live-model-chip`,onClick:()=>_i(e=>!e),title:m.current?`The model that generated this curated prerecorded example`:qc?`Model settings · last reply ${qc}`:`Model settings`,children:[(0,G.jsx)(`span`,{className:`chip-dot`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`chip-model`,children:m.current?Wo.model??`—`:n}),(0,G.jsx)(`span`,{className:`chip-caret`,"aria-hidden":`true`})]})]}),(0,G.jsx)(ei,{value:v,onChange:e=>{y(e)},onSend:ys,listening:H,heard:ke,onMic:Gs,micMode:Hi,micArmed:Ni&&!Fi,micPaused:Ni&&Fi,micProcessing:be===`transcribing`,placeholder:Yr?`Talk, or type a thought — it lands on the map…`:le.length?le.length>1?`Ask about the selected elements…`:`Ask about the selected element…`:`Talk, or type — anything.`,focusSignal:Di,disabled:Y.busy,onFiles:se,attachPulse:ki,attachTitle:Rs?`Attach an image or PDF`:`Attach a doc or data file to explode — ${n} can't read images/PDFs directly`,onMicDown:()=>{Z&&(ts(),X.start({inCanvas:!!Y.spec}))},onForceStop:()=>X.forceStop(),onMicCancel:()=>X.stop(),tools:(0,G.jsxs)(G.Fragment,{children:[Y.spec&&(0,G.jsx)(Wl,{armed:fe,onToggle:me}),(0,G.jsxs)(`button`,{type:`button`,className:`composer-watch`+(Yr?` on`:``),"aria-pressed":Yr,"aria-label":nu,onClick:()=>{Yr?K.phase===`settled`||K.phase===`pausing`?(Ae(null),K.resume(),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:!0})):Vs():ul(`think`)},title:Yr?K.phase===`settled`||K.phase===`pausing`?`Add another thought`:`Finish now without waiting for silence`:`Build a live map while you think aloud`,children:[(0,G.jsx)(B.spark,{}),(0,G.jsx)(`span`,{children:nu})]})]}),micExtra:Z?(0,G.jsx)(nc,{mode:Hi,pttKey:e.pttKey,pttSide:e.pttSide,onChange:e=>{Li.current=null,Ii(!1),Pi(e===`always`),Ui(e===`always`),Bi(e===`hold`),e===`always`&&Ni&&!H&&!v.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):e!==`always`&&H&&X.stop()}}):void 0})]})]}),(H||Ee)&&!Yr&&(0,G.jsx)(Yf,{transcript:ke,mode:Hi,transcribing:Ee,note:Br?`Just listening · ${Math.max(1,Math.round((Date.now()-qr.current)/6e4))}m — say "thoughts?" when you want me`:void 0}),H&&!Yr&&(0,G.jsx)(Kd,{ghosts:na}),Y.spec?(0,G.jsxs)(`div`,{className:`canvas-stage stage`,"data-active":`1`,ref:_a,children:[Pc!=null&&(0,G.jsx)(Oc,{tint:Ac?.color,onDone:()=>Fc(null)},Pc),(0,G.jsx)(`div`,{className:`canvas-scroll`,ref:ga,onClick:Y.spot?e=>{e.target.closest(`.spotlit`)||es()}:void 0,children:(0,G.jsxs)(`div`,{className:`topic-wrap`,children:[(0,G.jsx)(ml,{armed:fe,rootRef:_a,onStroke:ms.onStroke,onTap:ms.onTap,strokes:ms.strokes,highlights:ms.highlights}),Jl,!Sc&&(0,G.jsxs)(`div`,{className:`viewing-past`,role:`status`,children:[bc?(0,G.jsx)(B.table,{}):(0,G.jsx)(B.clock,{}),(0,G.jsx)(`span`,{children:bc?`Viewing this thread together`:`Viewing an earlier moment`}),(0,G.jsx)(`button`,{type:`button`,className:`viewing-past-back`,onClick:()=>bc?Y.previewSpec(null):Y.jumpTo(vc),children:`Return to live`})]}),!he&&le.length===0&&(0,G.jsxs)(`div`,{className:`ask-hint`,role:`note`,children:[(0,G.jsx)(B.chat,{}),(0,G.jsxs)(`span`,{children:[`Tap `,(0,G.jsx)(`strong`,{children:`Ask`}),` on any element to ask Mavéa about it.`]}),(0,G.jsx)(`button`,{type:`button`,className:`ask-hint-x`,"aria-label":`Dismiss tip`,onClick:ge,children:(0,G.jsx)(B.x,{})})]}),bs&&(0,G.jsx)($,{children:(0,G.jsx)(gm,{course:bs,lessonIdx:Cs,progress:Ts??Cr(bs.id),onPrev:()=>Os(bs,Cs-1),onNext:()=>Os(bs,Cs+1),onCheckpoint:ks,busy:Y.busy},`${bs.id}:${Cs}`)}),Vc&&!bs&&(0,G.jsx)(Ec,{question:Vc.question,narration:Vc.narration,sources:Bc?.sources,inferred:Kc,tint:Dc}),is&&(0,G.jsx)(d,{label:`Opening saved answer…`,overlay:!0}),(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(`div`,{className:`canvas-loading`,role:`status`,"aria-busy":`true`,"aria-label":`Loading canvas`,children:(0,G.jsx)(`div`,{className:`skel-grid`,children:(0,G.jsx)(V,{blocks:Wp})})}),children:(0,G.jsx)(Up,{data:ql??Y.viewSpec??Y.spec,spot:Sc?Y.spot:null,built:{},onProve:()=>Ei(!0),onAskBlock:Is,onAddToDashboard:e=>gt({block:e,question:Vc?.question??void 0}),selectedBlockIds:Ns,onNarrate:qo,narratingId:Jo,muted:U,viewMode:Po,onViewMode:Fo,presenting:Nn,noteGutter:Sc&&e.annotationsEnabled&&to&&ja,walkNotes:Sc?ro:void 0,blankFill:Sc?{values:Y.filled,activeKey:Y.activeBlank,fill:Y.fill,unfill:Y.unfill,activate:Y.setActiveBlank,complete:Y.complete,busy:Y.busy}:void 0,bend:Sc&&$n===null?Y.spec?.bend:void 0,onAddToFlashcard:ha,flashedIds:St,belowHeaderSlot:Vc&&Kl?(0,G.jsx)(hd,{audio:Kl,t:$n,onSeek:Sr}):void 0,viewSlot:bl?(0,G.jsxs)(`button`,{type:`button`,className:`canvas-open world-open`,title:qp,"aria-label":Kp,onClick:()=>Sl(),children:[(0,G.jsx)(B.globe,{className:`ic`,"aria-hidden":!0}),Kp]}):void 0,headerSlot:Sc?(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(`div`,{className:`pen-anchor`,ref:lo,children:[(0,G.jsx)(Zc,{enabled:e.annotationsEnabled,open:Xa,inkCount:Ja.length,onClick:()=>Za(e=>!e)}),Xa&&(0,G.jsx)(`div`,{className:`pen-popover`,children:(0,G.jsx)(Xc,{entries:Ja,turnStartMs:Ya.current,annotationsEnabled:e.annotationsEnabled,hiddenSpots:Qa,onToggle:Oo,onKeep:()=>Za(!1),onClear:()=>{Ha([]),Wa(new Set),$a(new Set),Za(!1)},onClip:()=>We(!0),onJumpTo:Ao,onToggleSpot:No})})]})}):void 0},bc?`thread-`+(Y.viewOverride?.id??``):Sc?`live-`+Y.replaceEpoch:`view-`+Y.viewIndex)}),Sc&&!Yl&&!ns&&(0,G.jsx)(dt,{spots:Qa.size>0?Va.filter(e=>!Qa.has(e.spot)):Va,revision:Io,onPlaced:qa}),Y.busy&&Sc&&(0,G.jsxs)(`div`,{className:`working-col`,children:[(0,G.jsx)(Zf,{cards:Jc}),(0,G.jsx)(ep,{thinking:Y.reasoning})]}),Sc&&!Y.busy&&(0,G.jsx)($,{children:(0,G.jsx)(cm,{chips:Y.understood,onFix:Ps})}),(0,G.jsx)(Mc,{spec:Y.viewSpec??Y.spec,followups:zc,question:Me??void 0,onAsk:ys,onTrack:()=>et(!0),onDeepZoom:Me?()=>{window.location.hash=`#/deepzoom?seed=${encodeURIComponent(Me)}`}:void 0,onCanvas:()=>Fo(`canvas`),onSeeAll:!bc&&Tc&&Tc.moments.length>=2?()=>Rc(Tc):void 0,threadCount:Tc?.moments.length,busy:Y.busy})]})})]}):lc?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(tc,{seed:r.current||void 0,speak:$i,goDemo:Wm,onStart:e=>{Qo(!0),ys(e)},onStartTalking:()=>{if(Qo(!0),!Z){Ve(Np),J(e=>e+1);return}X.start({inCanvas:!1})},onSeeHow:()=>Xo(!0),paletteSlot:(0,G.jsx)(N,{onOpen:Ci,preload:tm.preload}),launcherSlot:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ho,{items:Ml,onSeeHow:e=>e.tourChapter&&ll(e.tourChapter)}),(0,G.jsx)(`input`,{ref:jl,type:`file`,accept:Vt,multiple:!0,hidden:!0,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,t.length&&se(t).then(e=>{let t=e.filter(zt);t.length&&En(t)})}}),A.length>0&&(0,G.jsxs)(`div`,{className:`start-with-staged`,children:[(0,G.jsx)(`ul`,{className:`start-with-files`,children:A.map((e,t)=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{className:`start-with-file`,children:Bt(e)}),(0,G.jsx)(`button`,{type:`button`,className:`start-with-drop`,onClick:()=>ce(t),"aria-label":`Remove ${e.name}`,children:`✕`})]},`${e.name}-${t}`))}),(0,G.jsx)(`button`,{type:`button`,className:`start-with-another`,onClick:()=>jl.current?.click(),children:`Choose a different file`})]}),R&&(0,G.jsx)(`p`,{className:`start-with-error`,role:`alert`,children:R})]}),studySlot:(0,G.jsx)(iu,{onStudy:()=>Xt(!0)}),librarySlot:$o.length>0?(0,G.jsx)($,{children:(0,G.jsx)(rm,{entries:$o,onResume:e=>{Qo(!0),ae(!1),Pe(e.question??null),fs(e.id),os(e.spec,e.question)},onRemove:At,heading:`Pick up where you left off`,sub:`Your conversations stay on this device — tap one to step back in.`})}):void 0})}):(0,G.jsxs)(`div`,{className:`presence-stage stage`,"data-active":`1`,children:[Jl&&(0,G.jsx)(`div`,{className:`live-error-stage`,children:Jl}),Y.busy&&(0,G.jsx)(`div`,{className:`skel-stage`,children:(0,G.jsx)(Zf,{cards:Jc})})]}),tu,xl&&(0,G.jsx)($,{label:`Living answer`,children:(0,G.jsx)(Nm,{spec:yl.props.world??null,question:yl.props.title,failed:pl,onRetry:()=>_l(e=>e+1),onClose:Cl,view:yl.props.view,onExpandNode:Ol,autoWalk:Yi&&yl.id===`tour-world`,speakLine:$i})}),ji&&(0,G.jsxs)(`div`,{className:`drop-hint`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(B.paperclip,{}),(0,G.jsx)(`span`,{children:`Drop to attach — Mavéa reads PDFs, Office docs, and data files`})]}),Yo&&(0,G.jsx)($,{children:(0,G.jsx)(em,{onClose:()=>Xo(!1),speak:$i,onFullTour:aa})}),Si&&(0,G.jsx)($,{children:(0,G.jsx)(nm,{items:kl,surface:`live`,onClose:wi,pinned:s.current&&Uo.chapter?.id===`palette`})}),gi&&(0,G.jsx)(`div`,{role:`presentation`,onClick:e=>e.target===e.currentTarget&&_i(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`flex-start`,justifyContent:`center`,paddingTop:80,zIndex:50},children:(0,G.jsx)($,{children:(0,G.jsx)(am,{onClose:()=>_i(!1),initialTab:vi,initialAdvancedYouOpen:bi})})}),ss!==null&&(0,G.jsx)($,{children:(0,G.jsx)(Sm,{frames:Y.frames,initialIndex:ss,speak:$i,cancelSpeak:ze,onClose:()=>cs(null)})}),Ue&&(0,G.jsx)($,{children:(0,G.jsx)(wm,{frames:Y.frames,retainedAudio:e=>Fr.get(Je(e)),onClose:()=>We(!1),onShared:()=>Ys.enqueue(`clipShared`)})}),Ge&&da.length>0&&(0,G.jsx)($,{children:(0,G.jsx)(Em,{answers:da,defaultIndex:Cc?Cc.moments[Cc.moments.length-1].frameIndex:da.length-1,defaultIndices:Cc?.moments.map(e=>e.frameIndex),onClose:()=>qe(!1),guided:s.current&&Uo.chapter?.action.kind===`export`})}),Ye&&(0,G.jsx)($,{children:(0,G.jsx)(Om,{onClose:()=>et(!1),initialSourceId:ls?`lib-`+ls:void 0})}),ut&&(0,G.jsxs)(`div`,{className:`cv-takeover`,role:`dialog`,"aria-modal":`true`,"aria-label":`Living dashboard`,children:[(0,G.jsxs)(`header`,{className:`cv-takeover-head`,children:[(0,G.jsxs)(`div`,{className:`cv-takeover-id`,children:[(0,G.jsx)(`span`,{className:`cv-takeover-glyph`,"aria-hidden":`true`,children:`◎`}),(0,G.jsxs)(`div`,{className:`cv-takeover-titles`,children:[(0,G.jsx)(`span`,{className:`cv-takeover-eyebrow`,children:`Living dashboard`}),(0,G.jsx)(`span`,{className:`cv-takeover-title`,children:`Investment growth · $10k at 7%`})]})]}),(0,G.jsxs)(`button`,{type:`button`,className:`cv-takeover-close`,onClick:()=>ft(null),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` Back to answer`]})]}),(0,G.jsx)(`div`,{className:`tour-dash-body`,children:(0,G.jsx)($,{children:pt?(0,G.jsx)(sm,{id:ut}):(0,G.jsx)(om,{id:ut})})})]}),ht&&(0,G.jsx)($,{children:(0,G.jsx)(km,{block:ht.block,question:ht.question,conversationTitle:Y.spec?.title,onClose:()=>gt(null),onAdded:(e,t)=>vt({id:e,title:t})})}),_t&&(0,G.jsx)(uc,{dashboardId:_t.id,dashboardTitle:_t.title,onDismiss:()=>vt(null)}),Y.spec&&(0,G.jsx)(xc,{open:Ti,onClose:()=>Ei(!1),claim:Y.spec.title,conf:ps,sources:Y.spec.sources??[],hadFiles:ee,blocks:Y.spec.blocks}),jn.open&&(0,G.jsx)($,{children:(0,G.jsx)(_m,{open:!0,spec:jn.spec,onClose:()=>Mn(e=>({...e,open:!1}))})}),fi&&(0,G.jsx)($,{children:(0,G.jsx)(xm,{entries:$o,onResume:e=>{Qo(!0),ae(!1),Pe(e.question??null),fs(e.id),os(e.spec,e.question),pi(!1)},onRemove:At,onClose:()=>pi(!1)})}),il&&(0,G.jsx)(ao,{chapters:_c,currentIndex:yc,onJump:Mo,onClose:()=>al(!1)}),Jn&&ol&&(0,G.jsx)($,{children:(0,G.jsx)(um,{model:ol,level:Jn,onLevel:Yn,onJump:e=>{Y.jumpTo(e),Yn(null)},onClose:()=>Yn(null)})}),an&&(0,G.jsx)($,{children:(0,G.jsx)(zm,{cfg:sn(e),memoryNodes:kn(),speak:$i,onDebrief:e=>{ln(!1),y(e)},onClose:()=>ln(!1),onPrepTurn:(e,t)=>{ln(!1),Pe(t),Y.run(e,void 0,void 0,void 0,void 0,t)}})}),Qt&&ol&&(0,G.jsx)($,{children:(0,G.jsx)(ym,{model:ol,onJump:e=>{Y.jumpTo(e),$t(!1)},onShare:Y.frames.length>0?()=>{$t(!1),We(!0)}:void 0,onClose:()=>$t(!1)})}),un&&(0,G.jsx)($,{children:(0,G.jsx)(fm,{records:mr(),chapters:_c,onLand:e=>{pn(!1);let t=fr(e,$o);Qo(!0),ae(!1),t?(Pe(t.question??null),fs(t.id),os(t.spec,t.question)):(Pe(e.question),Y.run(e.question))},onGoDeeper:e=>{pn(!1),Qo(!0),ae(!1),Pe(e),Y.run(e)},autoTour:s.current,onClose:()=>pn(!1)})}),vn&&(0,G.jsx)($,{children:(0,G.jsx)(jm,{pdf:vn,cfg:sn(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>yn(null)})}),bn&&(0,G.jsx)($,{children:(0,G.jsx)(Um,{doc:bn,cfg:sn(e),onClose:()=>xn(null)},bn.id)}),Cn&&(0,G.jsx)($,{children:(0,G.jsx)(Fm,{sources:Cn,cfg:sn(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>Tn(null)})}),Dn&&(0,G.jsx)($,{children:(0,G.jsx)(mm,{model:Dn,cfg:sn(e),speak:$i,showcase:s.current,onClose:()=>An(null)})}),Yt&&(0,G.jsx)($,{children:(0,G.jsx)(Vm,{onClose:()=>Xt(!1)})}),Tt&&(0,G.jsx)($,{children:(0,G.jsx)(hm,{mode:`add`,initial:Tt.initial,deck:Tt.deck,origin:`block`,source:Tt.source,heading:`Flashcards from ${re(Tt.block)}`,enrich:Tt.enrich,decks:ir(),onSaved:e=>{if(e.length&&Tt.block.id){let e=Tt.block.id;Ct(t=>new Set(t).add(e))}fa(e)},onClose:()=>kt(null)})}),As&&(0,G.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(B.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[As.missedCards.length,` card`,As.missedCards.length===1?``:`s`,` from this checkpoint`]}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>js(null),children:`Dismiss`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>Ms(As),children:`Add`})]}),!As&&Wt&&(0,G.jsxs)(`div`,{className:`cards-pill is-ask`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`div`,{className:`cards-pill-head`,children:[(0,G.jsx)(B.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[Wt.count,` card`,Wt.count===1?``:`s`,` saved to “`,Wt.deck,`”`]})]}),(0,G.jsxs)(`div`,{className:`cards-pill-ask`,children:[(0,G.jsx)(`span`,{className:`cards-pill-q`,children:`Want Mavéa to help you remember these?`}),(0,G.jsx)(`span`,{className:`cards-pill-sub`,children:`They’ll come back for a quick practice every so often.`}),(0,G.jsxs)(`div`,{className:`cards-pill-choices`,children:[(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>ma(`collection`),children:`No thanks`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>ma(`spaced`),children:`Yes`})]})]})]}),!As&&!Wt&&Nt&&(0,G.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(B.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[Nt.count,` card`,Nt.count===1?``:`s`,` added`]}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>{or(Nt.ids),Lt(null)},children:`Undo`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>{window.location.hash=`#/flashcards`,Lt(null)},children:`View`})]})]})}export{qm as LiveApp};