@mavea/mavea 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +159 -0
- package/DISCLAIMER.md +16 -0
- package/LICENSE +75 -0
- package/PRIVACY.md +127 -0
- package/README.md +248 -0
- package/SECURITY.md +72 -0
- package/SUPPORT.md +13 -0
- package/TERMS.md +122 -0
- package/THIRD-PARTY.txt +639 -0
- package/TRADEMARKS.md +15 -0
- package/bin/mavea.mjs +1079 -0
- package/dist/.vite/manifest.json +4261 -0
- package/dist/_headers +52 -0
- package/dist/assets/AppCommandPalette-DUMSp3rd.js +1 -0
- package/dist/assets/AtlasView-B5fkQhO6.css +1 -0
- package/dist/assets/AtlasView-Dl2fssaG.js +1 -0
- package/dist/assets/BlockEmpty-CLtVQf6c.js +1 -0
- package/dist/assets/BriefingPlayer-DO205Qkh.js +1 -0
- package/dist/assets/BriefingPlayer-TpFZB77N.css +1 -0
- package/dist/assets/CanvasSkeleton-BZZPCuRZ.js +2 -0
- package/dist/assets/CanvasSkeleton-iy6DBvde.css +1 -0
- package/dist/assets/CardEditor-BY1bZiV6.css +1 -0
- package/dist/assets/CardEditor-DzJXb0G7.js +1 -0
- package/dist/assets/CheckLogRail-F4AlgAcc.css +1 -0
- package/dist/assets/CheckLogRail-wUfby67Z.js +1 -0
- package/dist/assets/CodeOutput-Kh6ldxQz.js +97 -0
- package/dist/assets/CommandPalette-Bb-eErih.css +1 -0
- package/dist/assets/CommandPalette-Kl00mMZm.js +1 -0
- package/dist/assets/CourseLessonReader-COmTQdSK.css +1 -0
- package/dist/assets/CourseLessonReader-MBHoknUz.js +2 -0
- package/dist/assets/CourseRail-CUa7uIGG.css +1 -0
- package/dist/assets/CourseRail-q6x5cCpW.js +1 -0
- package/dist/assets/CoursesApp-v89OVJvg.js +2 -0
- package/dist/assets/CrossExamPanel-CZ0ShGma.css +1 -0
- package/dist/assets/CrossExamPanel-DH04p6VS.js +1 -0
- package/dist/assets/DashPresent-BYXbPuGj.js +1 -0
- package/dist/assets/DashPresent-DQYcgp-W.css +1 -0
- package/dist/assets/DashboardDetail-B50ZkeVK.js +2 -0
- package/dist/assets/DashboardLoopRuntime-CFXPx3v_.js +1 -0
- package/dist/assets/DashboardOverview-C-FdGWM5.js +1 -0
- package/dist/assets/DashboardSettings-Dmw6JTbI.js +1 -0
- package/dist/assets/DashboardsApp-Dx-EsaPW.css +1 -0
- package/dist/assets/DashboardsApp-JSY_bVfi.js +2 -0
- package/dist/assets/DeepZoomApp-BFNwli7l.js +37 -0
- package/dist/assets/DeepZoomApp-fRXCJHHZ.css +1 -0
- package/dist/assets/DelegatePanel-BK7rEhIc.js +26 -0
- package/dist/assets/DelegatePanel-_9RZiLHM.css +1 -0
- package/dist/assets/DemoGallery-BPtVG7_y.js +1 -0
- package/dist/assets/DropSelect-DUhdQSta.js +1 -0
- package/dist/assets/ExportModal-D4WpAg2c.css +1 -0
- package/dist/assets/ExportModal-D65cGyj_.js +2 -0
- package/dist/assets/ExtractionPreview-Iwfg2Ogl.js +18 -0
- package/dist/assets/FallbackCard-B489rTd9.js +1 -0
- package/dist/assets/FallbackCard-D_6ps1xA.css +1 -0
- package/dist/assets/FeatureUseNotice-CWt7gOwS.css +1 -0
- package/dist/assets/FeatureUseNotice-DPtQ0OGb.js +1 -0
- package/dist/assets/FlagshipCTA-BXntKhxb.js +1 -0
- package/dist/assets/FlagshipCommandPalette-BDJfasI-.js +1 -0
- package/dist/assets/FlagshipShowcase-DJ8Gxk_G.js +1 -0
- package/dist/assets/FlashcardsApp-CLNo4WX7.js +1 -0
- package/dist/assets/ForecastPanel-Da2ZBUrE.css +1 -0
- package/dist/assets/ForecastPanel-PBO2-dgS.js +1 -0
- package/dist/assets/GalleryApp-B1CB3_81.css +1 -0
- package/dist/assets/GalleryApp-DM03CMRy.js +1 -0
- package/dist/assets/HonestByDesign-Dqyth6nW.js +1 -0
- package/dist/assets/HowItWorks-C0zosIvq.js +1 -0
- package/dist/assets/LegalApp-DZBdExTy.js +1 -0
- package/dist/assets/LegalMarkdownDocument-CSZhRG5r.js +3 -0
- package/dist/assets/LegalPageShell-C_HottbD.css +1 -0
- package/dist/assets/LegalPageShell-DTeXqWyc.js +1 -0
- package/dist/assets/LeverPanel-DhpJY76O.css +1 -0
- package/dist/assets/LeverPanel-aZfhtVJX.js +1 -0
- package/dist/assets/Library-D2XGNXz7.js +1 -0
- package/dist/assets/Library-DmrtHjUf.css +1 -0
- package/dist/assets/LibraryOverlay-B2WQSgwr.js +1 -0
- package/dist/assets/LibraryOverlay-CnKWDMG_.css +1 -0
- package/dist/assets/LiveApp-B9zwXlGC.js +61 -0
- package/dist/assets/LiveApp-BVZGpJ1S.css +1 -0
- package/dist/assets/LiveSettings-CmgrMqvK.css +1 -0
- package/dist/assets/LiveSettings-D9OcWlm6.js +6 -0
- package/dist/assets/MindMapViewerDrawer-YYyZqmAd.js +1 -0
- package/dist/assets/MindShape-Ca3MXEgK.css +1 -0
- package/dist/assets/MindShape-mTlN5mPZ.js +1 -0
- package/dist/assets/Orb-B0NEVfqL.js +1 -0
- package/dist/assets/PinToDashboard-_kIOHs0k.js +1 -0
- package/dist/assets/PlanReview-33V8GTNB.js +1 -0
- package/dist/assets/Presence-CzLJIeSD.js +1 -0
- package/dist/assets/PresentationDeck-BDoGecxr.js +1 -0
- package/dist/assets/PrismApp-PfBTFhMF.js +2 -0
- package/dist/assets/PrismAskController-DBoxQSJR.css +1 -0
- package/dist/assets/PrismAskController-DbQDrlU9.js +37 -0
- package/dist/assets/PrismBriefingPlayer-1fvlfLR8.js +2 -0
- package/dist/assets/PrismOverlay-B7lEspdu.js +131 -0
- package/dist/assets/PrismOverlay-BTfAicBt.css +1 -0
- package/dist/assets/PrivacyApp-CR4lRs0L.js +128 -0
- package/dist/assets/Quiz-CUwtekfu.js +1 -0
- package/dist/assets/Recap-DCiiWNiV.css +1 -0
- package/dist/assets/Recap-H5fhj5Tc.js +1 -0
- package/dist/assets/ReelJelly-3jSVsJsy.js +1 -0
- package/dist/assets/RehearsalPanel-BCU615wg.css +1 -0
- package/dist/assets/RehearsalPanel-BVgjrOPg.js +6 -0
- package/dist/assets/ReplayCard-BpYO5vX-.js +2 -0
- package/dist/assets/ReplayOverlay-DXmVdeIr.js +1 -0
- package/dist/assets/RewindOverlay-BusfWeFq.js +1 -0
- package/dist/assets/RewindOverlay-C92qgvmi.css +1 -0
- package/dist/assets/RippleApp-9KrJPYgN.js +2 -0
- package/dist/assets/RippleAskController-BNAUoIW0.css +1 -0
- package/dist/assets/RippleAskController-CO9wE7hU.js +34 -0
- package/dist/assets/RippleOverlay-DMHLbfh8.js +6 -0
- package/dist/assets/RippleOverlay-_iiZsQVZ.css +1 -0
- package/dist/assets/SeeDontRead-C389viue.js +1 -0
- package/dist/assets/ShareModal-C8S7ySls.css +1 -0
- package/dist/assets/ShareModal-ClnEkudw.js +32 -0
- package/dist/assets/ShipCascade-BUtwvQoW.js +1 -0
- package/dist/assets/ShipCascade-CyFnrlET.css +1 -0
- package/dist/assets/ShipCourse-B7lG6DYW.js +1 -0
- package/dist/assets/ShipCourse-DcT7PUSm.css +1 -0
- package/dist/assets/ShipGate-BVZfCllb.css +1 -0
- package/dist/assets/ShipGate-BYYu9WVq.js +2 -0
- package/dist/assets/ShipHotspots-Bj2CovtT.js +1 -0
- package/dist/assets/ShipHotspots-CLOMutPv.css +1 -0
- package/dist/assets/ShipIncident-BUHvFFiC.css +1 -0
- package/dist/assets/ShipIncident-DcmindmE.js +2 -0
- package/dist/assets/ShipMigration-BznCskNg.css +1 -0
- package/dist/assets/ShipMigration-s0hVjDQl.js +1 -0
- package/dist/assets/ShipOnboarding-BC9Vxkpa.css +1 -0
- package/dist/assets/ShipOnboarding-ekbHL7OH.js +1 -0
- package/dist/assets/ShipRead-BVNgQT6L.js +1 -0
- package/dist/assets/ShipRollout-BdUQzMyP.js +1 -0
- package/dist/assets/ShipRollout-CqeObx5b.css +1 -0
- package/dist/assets/ShipSuggestions-B6fKYh8L.js +1 -0
- package/dist/assets/ShipSuggestions-BKRvk5Mj.css +1 -0
- package/dist/assets/ShipWorkspace-3D3Rrs1p.js +2 -0
- package/dist/assets/ShipWorkspace-D6XQpGEN.css +1 -0
- package/dist/assets/SignatureLoop-C60r8Wm5.js +1 -0
- package/dist/assets/SrsReview-BoaYb6XN.js +1 -0
- package/dist/assets/SrsReview-DmGdGxT0.css +1 -0
- package/dist/assets/SynthesisApp-vJ2Jq0Qe.js +2 -0
- package/dist/assets/SynthesisOverlay-CkERphvG.js +66 -0
- package/dist/assets/TermsApp-C70tW6m6.js +123 -0
- package/dist/assets/TopicCanvas-CT0eSj2M.js +2 -0
- package/dist/assets/TopicCanvas-D2Nax9II.css +1 -0
- package/dist/assets/TourPrism-BvucSkcs.js +1 -0
- package/dist/assets/TrackerTile-CasZNmt4.js +2 -0
- package/dist/assets/TwoSurfaces-C90X7Aj5.js +1 -0
- package/dist/assets/UnderstoodPanel-CHPD2Ttj.js +1 -0
- package/dist/assets/UnderstoodPanel-Q6GX1TFq.css +1 -0
- package/dist/assets/WhyMachineOverlay-BZk3PVTl.css +1 -0
- package/dist/assets/WhyMachineOverlay-CB0_n6Sy.js +1 -0
- package/dist/assets/WowFeatures-Ci_H5QYX.js +1 -0
- package/dist/assets/ZoomDeck-B2SjNwY7.css +1 -0
- package/dist/assets/ZoomDeck-BQHO79ZU.js +1 -0
- package/dist/assets/__vite-browser-external-BufR4LQa.js +1 -0
- package/dist/assets/ai-Ba4lZJ9Y.js +12 -0
- package/dist/assets/alternateFinishes-DZ-rkpkX.js +494 -0
- package/dist/assets/annotationAuto-B0nihA4F.js +1 -0
- package/dist/assets/annotationReel-BcU9Q0Sw.js +1 -0
- package/dist/assets/annotations-D2K9A5GB.js +1 -0
- package/dist/assets/backup-c-Btapzp.js +1 -0
- package/dist/assets/blockLabel-DAqaHKy3.js +1 -0
- package/dist/assets/c-DWGmR78Y.js +1 -0
- package/dist/assets/c-SSSlmE39.js +1 -0
- package/dist/assets/cache-BumECILO.js +1 -0
- package/dist/assets/canvas-QTEIiK23.js +1 -0
- package/dist/assets/catalog-BHjl-1uH.js +2 -0
- package/dist/assets/catalog-Dqaq2YFd.js +1 -0
- package/dist/assets/cfo.generated-Bjl5OGay.js +1 -0
- package/dist/assets/chapters-BiUsDClQ.js +1 -0
- package/dist/assets/charts1-EOoxU_K3.js +1 -0
- package/dist/assets/charts2-tyUiQPff.js +1 -0
- package/dist/assets/chunk-BVpWp9h4.js +1 -0
- package/dist/assets/citation-BcvmjKS8.js +1 -0
- package/dist/assets/code-CpjYCNS8.js +8 -0
- package/dist/assets/codeContext-0UMRSGRr.js +5 -0
- package/dist/assets/colors-D49Req-e.js +1 -0
- package/dist/assets/compose-BJ9EfcQS.js +3 -0
- package/dist/assets/contentVault-DzTYWcbD.js +1 -0
- package/dist/assets/core-DEFyprhs.js +1 -0
- package/dist/assets/corpus.generated-oX9uU93S.js +11 -0
- package/dist/assets/courseSeed-CZdNBTTs.js +1 -0
- package/dist/assets/courseStore-DfafnL-9.js +1 -0
- package/dist/assets/courses-BkH1ntDL.css +1 -0
- package/dist/assets/cpp-BGdv8dzs.js +1 -0
- package/dist/assets/cpp-CNAAXZl-.js +1 -0
- package/dist/assets/csharp-oqKa8noW.js +1 -0
- package/dist/assets/css-CdtkT07m.js +1 -0
- package/dist/assets/css-LbU1hoFO.js +1 -0
- package/dist/assets/dag-C3Xx8pOD.js +2 -0
- package/dist/assets/dashboardEvents-DR9d_c74.js +2 -0
- package/dist/assets/dashboards-rcWxdoXI.css +1 -0
- package/dist/assets/deckLine-NBd3MyGT.js +1 -0
- package/dist/assets/demoPaletteItems-NPCSaSU6.js +1 -0
- package/dist/assets/dev.generated-DYgVxL_4.js +73 -0
- package/dist/assets/diagrams-CaSfjT4I.js +1 -0
- package/dist/assets/diff-woXpYk--.js +1 -0
- package/dist/assets/display-OvC57CMc.js +9 -0
- package/dist/assets/dist-BFx3nZg4.js +2785 -0
- package/dist/assets/dist-xRGLOZwv.js +14 -0
- package/dist/assets/docs-B2aDtm5K.js +1 -0
- package/dist/assets/everyday-CoZa4kDZ.js +1 -0
- package/dist/assets/explode-WBykfhqW.js +13 -0
- package/dist/assets/extractNumbers-CuhagRkd.js +1 -0
- package/dist/assets/facts-BBTt3ImG.js +1 -0
- package/dist/assets/finance-Bxn_Q1p0.js +1 -0
- package/dist/assets/fit-0HxU-rtB.js +1 -0
- package/dist/assets/fitText-CDFmCQzl.js +1 -0
- package/dist/assets/flows-BL81J7yN.js +1 -0
- package/dist/assets/format-DlZTyeMy.js +1 -0
- package/dist/assets/format-hc2QOoIu.js +1 -0
- package/dist/assets/forms-DeoXOxdD.js +1 -0
- package/dist/assets/generate-8odaTyr4.js +17 -0
- package/dist/assets/generateBeats-b64CL54v.js +1 -0
- package/dist/assets/generateCourse-Cj_-vDWu.js +28 -0
- package/dist/assets/generateLive-D4B30fnF.js +52 -0
- package/dist/assets/geometry-DXAbnb0J.js +1 -0
- package/dist/assets/gesture-DabMpPcq.js +2 -0
- package/dist/assets/github-dark-C-LZuMrd.js +1 -0
- package/dist/assets/github-light-EUqPIrTm.js +1 -0
- package/dist/assets/githubBrowser-DywfDeYx.js +1 -0
- package/dist/assets/githubToken-DtcLYqwm.js +11 -0
- package/dist/assets/go-rLFTqkRN.js +1 -0
- package/dist/assets/homeTarget-BgWKI_E1.js +1 -0
- package/dist/assets/html-BcACZWSP.js +1 -0
- package/dist/assets/html-DDNsd9lV.js +1 -0
- package/dist/assets/http-CJCtjYpA.js +2 -0
- package/dist/assets/icons-CHVz6kv_.js +1 -0
- package/dist/assets/index-CepQEz75.css +1 -0
- package/dist/assets/index-y8GL67bB.js +22 -0
- package/dist/assets/index.es-CRLiWwiA.js +5 -0
- package/dist/assets/info-CiqHR5cs.js +1 -0
- package/dist/assets/java-BtIQNnN0.js +1 -0
- package/dist/assets/java-DxlWrXwe.js +1 -0
- package/dist/assets/javascript-BzbQS41l.js +1 -0
- package/dist/assets/javascript-Yelw-5ZN.js +1 -0
- package/dist/assets/json-B0N3XRZU.js +1 -0
- package/dist/assets/json-B88Oqtu5.js +1 -0
- package/dist/assets/json-CaljABEy.js +1 -0
- package/dist/assets/jspdf.es.min-C-Pf79px.js +79 -0
- package/dist/assets/jsx-D3KKoC5L.js +1 -0
- package/dist/assets/jsx-hEbJ82HF.js +1 -0
- package/dist/assets/jsx-runtime-DaSxXjOY.js +1 -0
- package/dist/assets/katex-BMCG0xok.js +257 -0
- package/dist/assets/keyVault-DEsNh9FR.js +1 -0
- package/dist/assets/kokoro-D4GKpSL0.js +1 -0
- package/dist/assets/kotlin-DhhofPvG.js +1 -0
- package/dist/assets/layout-BFQOzXtG.js +1 -0
- package/dist/assets/layout-CkO0Psde.js +1 -0
- package/dist/assets/lazyRetry-D50B1UMY.js +1 -0
- package/dist/assets/leaflet-src-C_xhOQY7.js +1 -0
- package/dist/assets/learn-DVfqN-nf.js +1 -0
- package/dist/assets/lib-DMAxsZKm.css +1 -0
- package/dist/assets/lib-VFqp6Y3w.js +1 -0
- package/dist/assets/links--u_phi0x.js +1 -0
- package/dist/assets/liveSchema-CJ49PX5R.js +98 -0
- package/dist/assets/markdown-BYOwaDjH.js +1 -0
- package/dist/assets/mastery-BPjxP0fN.js +4 -0
- package/dist/assets/media-CsrUl279.js +43 -0
- package/dist/assets/model-BE0UHu1w.js +27 -0
- package/dist/assets/motion-S0NRruNj.js +1 -0
- package/dist/assets/nav-Czm-NzPV.js +1 -0
- package/dist/assets/neighborhoods-C-1Tjr1r.js +1 -0
- package/dist/assets/notes-A9t4jdfx.css +1 -0
- package/dist/assets/notes-lROPCorS.js +1 -0
- package/dist/assets/notify-Bz4wuE4T.js +1 -0
- package/dist/assets/now-C9-UAzTC.js +1 -0
- package/dist/assets/number-DXgzss0v.js +1 -0
- package/dist/assets/officeDoc-B6nEhNp4.js +3 -0
- package/dist/assets/openchemlib-nMLMmg26.js +23 -0
- package/dist/assets/overlays-JxbHtA2o.js +1 -0
- package/dist/assets/owners-FXDGInVq.js +2 -0
- package/dist/assets/pageVisibility-BxUVsw7Z.js +1 -0
- package/dist/assets/pdf-Df7PCH7q.js +11 -0
- package/dist/assets/pdf.worker.min-yatZIOMy.mjs +21 -0
- package/dist/assets/penStrokes-9Q_l7NTt.js +1 -0
- package/dist/assets/perfProbe-COAp9PAa.js +1 -0
- package/dist/assets/php-CYrBA5iX.js +1 -0
- package/dist/assets/pickers-B4-3HOR8.js +1 -0
- package/dist/assets/pin-Bya3BL_a.css +1 -0
- package/dist/assets/pin-CXSuPJYL.js +1 -0
- package/dist/assets/planTracker-7AMCQPNx.js +1 -0
- package/dist/assets/portal-DMw7C32j.js +1 -0
- package/dist/assets/pptxgen.es-CvTILmV9.js +115 -0
- package/dist/assets/predictions-CYS7Vo39.js +1 -0
- package/dist/assets/prewarm--whjQhWJ.js +1 -0
- package/dist/assets/prism-app-CXYElq8-.css +1 -0
- package/dist/assets/prism.generated-BhbHDHR6.js +41 -0
- package/dist/assets/prismExtract.worker-Cws9K1NG.js +13 -0
- package/dist/assets/prismGround.worker-CIvKqxm2.js +1 -0
- package/dist/assets/prismLayout.worker-CZO2CY7B.js +1 -0
- package/dist/assets/providers-wzm7E8Pa.js +1 -0
- package/dist/assets/purify.es-adlwq8Pz.js +3 -0
- package/dist/assets/python-gzcpVVnB.js +1 -0
- package/dist/assets/queue-DHeyJ32F.css +1 -0
- package/dist/assets/queue-J4h7E3uc.js +1 -0
- package/dist/assets/quietHours-BvcsBKKK.js +1 -0
- package/dist/assets/react-BQSORdFI.js +1 -0
- package/dist/assets/reference-sJzyMiL4.js +1 -0
- package/dist/assets/registry-1GuPBfQK.js +1 -0
- package/dist/assets/registry-2GJZ46M8.css +1 -0
- package/dist/assets/registry-2v0jlh5Q.js +2 -0
- package/dist/assets/registry-B8DStMJk.js +1 -0
- package/dist/assets/registry-B940W2j5.js +1 -0
- package/dist/assets/registry-BAoRB8rd.css +1 -0
- package/dist/assets/registry-BPvIPLke.js +1 -0
- package/dist/assets/registry-BVHiKEwE.css +1 -0
- package/dist/assets/registry-BcZXBr3y.css +1 -0
- package/dist/assets/registry-BffpZK5w.js +1 -0
- package/dist/assets/registry-BgGeRiDA.js +2 -0
- package/dist/assets/registry-Buq5uuCv.js +1 -0
- package/dist/assets/registry-BzNLfje1.css +1 -0
- package/dist/assets/registry-C3ezxLR3.css +1 -0
- package/dist/assets/registry-CAusoyBh.js +1 -0
- package/dist/assets/registry-CEVrY72Z.js +1 -0
- package/dist/assets/registry-CKjKq6ct.js +1 -0
- package/dist/assets/registry-CNgybLQv.css +1 -0
- package/dist/assets/registry-CRM7y8QT.css +1 -0
- package/dist/assets/registry-CRisz4Ca.css +1 -0
- package/dist/assets/registry-Cg7qUZPS.js +1 -0
- package/dist/assets/registry-Cix-yqch.js +1 -0
- package/dist/assets/registry-CtbuZWYz.css +1 -0
- package/dist/assets/registry-DCI_BeFJ.js +5 -0
- package/dist/assets/registry-DDLSYDVA.js +1 -0
- package/dist/assets/registry-DI1wSG1Y.js +1 -0
- package/dist/assets/registry-DJinB5ye.js +2 -0
- package/dist/assets/registry-DUvXX_d0.js +1 -0
- package/dist/assets/registry-DVzLacl_.css +1 -0
- package/dist/assets/registry-DWcNVyI2.css +1 -0
- package/dist/assets/registry-D_URPoL4.js +1 -0
- package/dist/assets/registry-Dkc7hN5T.js +1 -0
- package/dist/assets/registry-DmQlNN3y.js +1 -0
- package/dist/assets/registry-DpaaVbmL.css +1 -0
- package/dist/assets/registry-Dpb8EXHn.js +49 -0
- package/dist/assets/registry-Dru0JcTa.css +1 -0
- package/dist/assets/registry-DujBAgn_.js +1 -0
- package/dist/assets/registry-Dye5m3qt.css +1 -0
- package/dist/assets/registry-GeSy4i7R.css +1 -0
- package/dist/assets/registry-QcULZpdE.js +4 -0
- package/dist/assets/registry-T3i2Q9SI.css +1 -0
- package/dist/assets/registry-UFIuwh3i.css +1 -0
- package/dist/assets/registry-Xzq_Rpmm.css +1 -0
- package/dist/assets/registry-ZOWzhOHk.css +1 -0
- package/dist/assets/registry-aIH-Im5Y.css +1 -0
- package/dist/assets/registry-aazwkBJp.js +1 -0
- package/dist/assets/registry-ei6fIgBT.css +1 -0
- package/dist/assets/registry-types-DMuK0vJ6.js +1 -0
- package/dist/assets/registry-upbw6pyj.css +1 -0
- package/dist/assets/registry-zRPjWNl5.js +1 -0
- package/dist/assets/relate-A9ZeaaAI.js +1 -0
- package/dist/assets/richText-BkxJhl9N.js +1 -0
- package/dist/assets/ruby-BhrksQMt.js +1 -0
- package/dist/assets/run-BYP2YlZT.js +23 -0
- package/dist/assets/run-C_0B_41W.js +21 -0
- package/dist/assets/run-DSVvshaB.js +21 -0
- package/dist/assets/rust-Cfkwpbl8.js +1 -0
- package/dist/assets/safeCssColor-di93BXgG.js +1 -0
- package/dist/assets/safeImageUrl-CUkucDUu.js +1 -0
- package/dist/assets/scale-Bcgfo6Hp.js +1 -0
- package/dist/assets/screen-DLR7p_yP.js +1 -0
- package/dist/assets/search-DnjHupRf.js +1 -0
- package/dist/assets/seed-b1xc0dj2.js +1 -0
- package/dist/assets/shapes-RqjqC0ay.js +1 -0
- package/dist/assets/shard000-DM_rqD7W.js +1 -0
- package/dist/assets/shard001-gQEQs7_F.js +1 -0
- package/dist/assets/shard002-DbDas-W-.js +1 -0
- package/dist/assets/shard003-DxMszG4_.js +1 -0
- package/dist/assets/shard004-DZMpLBw1.js +1 -0
- package/dist/assets/shard005-DLVkh9IH.js +1 -0
- package/dist/assets/shard006-B6efKHov.js +1 -0
- package/dist/assets/shard007-AFdZLe38.js +1 -0
- package/dist/assets/shard008-LbSBzwRx.js +1 -0
- package/dist/assets/shard009-D_6-SUDb.js +1 -0
- package/dist/assets/shard010-DbOj-uZW.js +1 -0
- package/dist/assets/shard011-BYSz7EEW.js +1 -0
- package/dist/assets/shard012-B5Ypj7OV.js +1 -0
- package/dist/assets/shard013-BtsliNIe.js +1 -0
- package/dist/assets/shard014-15sjmk68.js +1 -0
- package/dist/assets/shard015-nnXrqru_.js +1 -0
- package/dist/assets/shard016-BayXFE13.js +1 -0
- package/dist/assets/shard017-Cy4cGexs.js +1 -0
- package/dist/assets/shard018-aO-BYJ8H.js +1 -0
- package/dist/assets/shard019-gxaTeA3I.js +1 -0
- package/dist/assets/shard020-BibJdMI0.js +1 -0
- package/dist/assets/shard021-2FE-tze4.js +1 -0
- package/dist/assets/shard022-IXiyG-JK.js +1 -0
- package/dist/assets/shard023-314F6NJS.js +1 -0
- package/dist/assets/shard024-cN5rpQ_X.js +1 -0
- package/dist/assets/shard025-KKTaXOGE.js +1 -0
- package/dist/assets/shard026-C2Dkd1t6.js +1 -0
- package/dist/assets/shard027-Xy-8x9As.js +1 -0
- package/dist/assets/shard028-Bul-klUj.js +1 -0
- package/dist/assets/shard029-BbRSUcUZ.js +1 -0
- package/dist/assets/shard030-GYllsFVC.js +1 -0
- package/dist/assets/shard031-DMigeiyn.js +1 -0
- package/dist/assets/shard032-CcvmzK0l.js +1 -0
- package/dist/assets/shard033-11AU702M.js +1 -0
- package/dist/assets/shard034-Bx3urxjM.js +1 -0
- package/dist/assets/shard035-DBdEeyCt.js +1 -0
- package/dist/assets/shard036-vYgoRBqS.js +1 -0
- package/dist/assets/shard037-DP4MMw91.js +1 -0
- package/dist/assets/shard038-ffxsv7d6.js +1 -0
- package/dist/assets/shard039-C1JHHNp9.js +1 -0
- package/dist/assets/shard040-JbVvCSO_.js +1 -0
- package/dist/assets/shard041-5L_eFwGx.js +1 -0
- package/dist/assets/shard042-C9nsGL79.js +1 -0
- package/dist/assets/shard043-Dx_9HSKI.js +1 -0
- package/dist/assets/shard044-B3QQNC4A.js +1 -0
- package/dist/assets/shard045-B7z0WHO6.js +1 -0
- package/dist/assets/shard046-D1yDablJ.js +1 -0
- package/dist/assets/shard047-DJi3AgeT.js +1 -0
- package/dist/assets/shard048-D_2ipfUr.js +1 -0
- package/dist/assets/shard049-1aGgWZdd.js +1 -0
- package/dist/assets/shard050-Bjwa0Og4.js +1 -0
- package/dist/assets/shard051-Cx_GAk3v.js +1 -0
- package/dist/assets/shard052-LaeOD3V5.js +1 -0
- package/dist/assets/shard053-D-da7Foj.js +1 -0
- package/dist/assets/shard054-CM8eSRQk.js +1 -0
- package/dist/assets/shard055-QRpDl4Vs.js +1 -0
- package/dist/assets/shard056-DkY7CQm3.js +1 -0
- package/dist/assets/shard057-BVCgf7o0.js +1 -0
- package/dist/assets/shard058-93aGtdrX.js +1 -0
- package/dist/assets/shard059-rJE9X1_I.js +1 -0
- package/dist/assets/shard060-Lu_hfl1r.js +1 -0
- package/dist/assets/shard061-C9A8iNiq.js +1 -0
- package/dist/assets/shard062-BBIpEYZO.js +1 -0
- package/dist/assets/shard063-C_uen3Ub.js +1 -0
- package/dist/assets/shard064-DAHUsHST.js +1 -0
- package/dist/assets/shard065-C2edvdvh.js +1 -0
- package/dist/assets/shard066-DFcuVhZm.js +1 -0
- package/dist/assets/shard067-BN8DM8JZ.js +1 -0
- package/dist/assets/shard068-i464K77p.js +1 -0
- package/dist/assets/shard069-Dm9m2a5U.js +1 -0
- package/dist/assets/shard070-BPVvR8GH.js +1 -0
- package/dist/assets/shard071-Bal_0d9L.js +1 -0
- package/dist/assets/shard072-CBQu62kt.js +1 -0
- package/dist/assets/shard073-D5BRae0w.js +1 -0
- package/dist/assets/shard074-DtFvcBnZ.js +1 -0
- package/dist/assets/share-QHGHNDhQ.js +1 -0
- package/dist/assets/shellscript-BiGZg9Om.js +1 -0
- package/dist/assets/shellscript-CqHdAlCp.js +1 -0
- package/dist/assets/shikiHighlight-DUCYbsJ2.js +153 -0
- package/dist/assets/sourceHost-BV3t2XDb.js +1 -0
- package/dist/assets/speed-DwPw9KSv.js +1 -0
- package/dist/assets/spokenText-D4zPX9JY.js +1 -0
- package/dist/assets/sql-0Qcw9ht3.js +1 -0
- package/dist/assets/sql-CP0rg-5b.js +1 -0
- package/dist/assets/src-DbgF7cRH.js +2 -0
- package/dist/assets/stats-BeP5Bws0.js +1 -0
- package/dist/assets/status-BY02LIJt.js +1 -0
- package/dist/assets/stepDriver-DwjFet6U.js +1 -0
- package/dist/assets/store-4JNNn732.js +1 -0
- package/dist/assets/store-BFC7DZcg.js +1 -0
- package/dist/assets/store-BFrJaSxJ.js +1 -0
- package/dist/assets/store-DXmC_fP2.js +0 -0
- package/dist/assets/store-DgG0C1Qx.js +1 -0
- package/dist/assets/streamParse-DRgMHWye.js +2 -0
- package/dist/assets/student.generated-DS_acPaJ.js +1 -0
- package/dist/assets/swift-DonLKvLd.js +1 -0
- package/dist/assets/tables-Dzd3rTqG.js +1 -0
- package/dist/assets/time-BHTmJR1s.js +1 -0
- package/dist/assets/toast-BBNs2h3L.js +1 -0
- package/dist/assets/toml-CcmNWLt0.js +1 -0
- package/dist/assets/traveler.generated-Beun9X7y.js +1 -0
- package/dist/assets/tsx-5f3ulCja.js +1 -0
- package/dist/assets/tsx-BOvsFOI6.js +1 -0
- package/dist/assets/typeof-B5XbjTb1.js +1 -0
- package/dist/assets/typescript-Utq2Cl8c.js +1 -0
- package/dist/assets/typescript-j_1H8WHN.js +1 -0
- package/dist/assets/useDashboardLoop-B6ByHWoE.js +5 -0
- package/dist/assets/useFocusTrap-DbfG6zbM.js +1 -0
- package/dist/assets/useLiveConfig-X9Wxh90k.js +1 -0
- package/dist/assets/useSpatialCanvas-DogK9457.js +1 -0
- package/dist/assets/useSpotlightWalk-rMbmNBKK.js +1 -0
- package/dist/assets/useSrsCards-CagZefwX.js +1 -0
- package/dist/assets/useStudy-Bflreq2a.js +1 -0
- package/dist/assets/useTimeout-BRYvu2jQ.js +1 -0
- package/dist/assets/useValidatedImage-D2fhA198.js +1 -0
- package/dist/assets/useZoomGesture-CYc3tf2z.js +1 -0
- package/dist/assets/verbatim-CBMzUDlf.js +1 -0
- package/dist/assets/worker-BbLKfGzm.js +2 -0
- package/dist/assets/xml-WY0zc4PG.js +1 -0
- package/dist/assets/yaml-CxbubiML.js +1 -0
- package/dist/assets/yaml-DijMHRDA.js +1 -0
- package/dist/demo-assets/CREDITS.md +40 -0
- package/dist/demo-assets/images/basalt-cliffs.jpg +0 -0
- package/dist/demo-assets/images/capelinhos.jpg +0 -0
- package/dist/demo-assets/images/cliff-fields.jpg +0 -0
- package/dist/demo-assets/images/crater-panorama.jpg +0 -0
- package/dist/demo-assets/images/furnas-lake.jpg +0 -0
- package/dist/demo-assets/images/green-coast.jpg +0 -0
- package/dist/demo-assets/images/overcast-coast.jpg +0 -0
- package/dist/demo-assets/images/patchwork-fields.jpg +0 -0
- package/dist/demo-assets/images/ponta-delgada.jpg +0 -0
- package/dist/demo-assets/images/sete-cidades.jpg +0 -0
- package/dist/demo-assets/images/slide-placeholder-light.svg +9 -0
- package/dist/demo-assets/images/slide-placeholder.svg +9 -0
- package/dist/demo-assets/images/village-street.jpg +0 -0
- package/dist/demo-assets/pdf/cfd-primer.pdf +0 -0
- package/dist/demo-assets/video/azores-film.mp4 +0 -0
- package/dist/favicon.svg +19 -0
- package/dist/fonts/LICENSE.txt +34 -0
- package/dist/fonts/archivo-var-latin.woff2 +0 -0
- package/dist/fonts/bodoni-moda-400-italic-latin.woff2 +0 -0
- package/dist/fonts/bodoni-moda-var-latin.woff2 +0 -0
- package/dist/fonts/eb-garamond-var-italic-latin.woff2 +0 -0
- package/dist/fonts/eb-garamond-var-latin.woff2 +0 -0
- package/dist/fonts/export/families/archivo.css +12 -0
- package/dist/fonts/export/families/bodoni-moda.css +23 -0
- package/dist/fonts/export/families/eb-garamond.css +22 -0
- package/dist/fonts/export/families/ibm-plex-sans.css +12 -0
- package/dist/fonts/export/families/instrument-serif.css +22 -0
- package/dist/fonts/export/families/jetbrains-mono.css +12 -0
- package/dist/fonts/export/families/libre-franklin.css +12 -0
- package/dist/fonts/export/families/lora.css +22 -0
- package/dist/fonts/export/families/source-serif-4.css +12 -0
- package/dist/fonts/export/families/space-grotesk.css +12 -0
- package/dist/fonts/export/families/spectral.css +52 -0
- package/dist/fonts/fonts.css +141 -0
- package/dist/fonts/hanken-grotesk-var-latin.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-var-latin.woff2 +0 -0
- package/dist/fonts/instrument-serif-400-italic-latin.woff2 +0 -0
- package/dist/fonts/instrument-serif-400-latin.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-var-latin.woff2 +0 -0
- package/dist/fonts/libre-franklin-var-latin.woff2 +0 -0
- package/dist/fonts/lora-var-italic-latin.woff2 +0 -0
- package/dist/fonts/lora-var-latin.woff2 +0 -0
- package/dist/fonts/newsreader-var-italic-latin.woff2 +0 -0
- package/dist/fonts/newsreader-var-latin.woff2 +0 -0
- package/dist/fonts/plex-mono-400-latin.woff2 +0 -0
- package/dist/fonts/plex-mono-500-latin.woff2 +0 -0
- package/dist/fonts/plex-mono-600-latin.woff2 +0 -0
- package/dist/fonts/source-serif-4-var-latin.woff2 +0 -0
- package/dist/fonts/space-grotesk-var-latin.woff2 +0 -0
- package/dist/fonts/spectral-400-italic-latin.woff2 +0 -0
- package/dist/fonts/spectral-400-latin.woff2 +0 -0
- package/dist/fonts/spectral-500-italic-latin.woff2 +0 -0
- package/dist/fonts/spectral-500-latin.woff2 +0 -0
- package/dist/fonts/spectral-600-latin.woff2 +0 -0
- package/dist/index.html +117 -0
- package/dist/legal/DISCLAIMER.md +16 -0
- package/dist/legal/LICENSE.txt +75 -0
- package/dist/legal/PRIVACY.md +127 -0
- package/dist/legal/SECURITY.md +72 -0
- package/dist/legal/SUPPORT.md +13 -0
- package/dist/legal/TERMS.md +122 -0
- package/dist/legal/THIRD-PARTY.txt +639 -0
- package/dist/legal/TRADEMARKS.md +15 -0
- package/dist/ort-wasm-simd-threaded.mjs +59 -0
- package/dist/sw.js +30 -0
- package/dist/vad.worklet.bundle.min.js +1 -0
- package/docker-compose.yml +33 -0
- package/gateway/README.md +99 -0
- package/gateway/actions-gateway.mjs +537 -0
- package/gateway/connectors.d.mts +27 -0
- package/gateway/connectors.mjs +463 -0
- package/gateway/guard.mjs +110 -0
- package/gateway/tokenStore.mjs +134 -0
- package/package.json +143 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-BFx3nZg4.js","assets/chunk-BVpWp9h4.js","assets/index-y8GL67bB.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/generateLive-D4B30fnF.js","assets/blockLabel-DAqaHKy3.js","assets/liveSchema-CJ49PX5R.js","assets/catalog-Dqaq2YFd.js","assets/facts-BBTt3ImG.js","assets/annotations-D2K9A5GB.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/icons-CHVz6kv_.js","assets/catalog-BHjl-1uH.js","assets/safeImageUrl-CUkucDUu.js","assets/sourceHost-BV3t2XDb.js","assets/spokenText-D4zPX9JY.js","assets/streamParse-DRgMHWye.js","assets/shapes-RqjqC0ay.js","assets/contentVault-DzTYWcbD.js","assets/keyVault-DEsNh9FR.js","assets/now-C9-UAzTC.js","assets/number-DXgzss0v.js","assets/layout-BFQOzXtG.js","assets/screen-DLR7p_yP.js","assets/search-DnjHupRf.js","assets/speed-DwPw9KSv.js","assets/TopicCanvas-CT0eSj2M.js","assets/FallbackCard-B489rTd9.js","assets/FallbackCard-D_6ps1xA.css","assets/CanvasSkeleton-BZZPCuRZ.js","assets/CanvasSkeleton-iy6DBvde.css","assets/lib-VFqp6Y3w.js","assets/BlockEmpty-CLtVQf6c.js","assets/motion-S0NRruNj.js","assets/lib-DMAxsZKm.css","assets/format-DlZTyeMy.js","assets/useSpatialCanvas-DogK9457.js","assets/useValidatedImage-D2fhA198.js","assets/richText-BkxJhl9N.js","assets/toast-BBNs2h3L.js","assets/TopicCanvas-D2Nax9II.css","assets/HowItWorks-C0zosIvq.js","assets/canvas-QTEIiK23.js","assets/ReplayCard-BpYO5vX-.js","assets/ShareModal-ClnEkudw.js","assets/ReelJelly-3jSVsJsy.js","assets/geometry-DXAbnb0J.js","assets/registry-2v0jlh5Q.js","assets/fit-0HxU-rtB.js","assets/share-QHGHNDhQ.js","assets/FeatureUseNotice-DPtQ0OGb.js","assets/FeatureUseNotice-CWt7gOwS.css","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-D4GKpSL0.js","assets/ShareModal-C8S7ySls.css","assets/annotationReel-BcU9Q0Sw.js","assets/generateBeats-b64CL54v.js","assets/CommandPalette-Kl00mMZm.js","assets/registry-BffpZK5w.js","assets/CommandPalette-Bb-eErih.css","assets/Library-D2XGNXz7.js","assets/neighborhoods-C-1Tjr1r.js","assets/chapters-BiUsDClQ.js","assets/time-BHTmJR1s.js","assets/Library-DmrtHjUf.css","assets/LiveSettings-D9OcWlm6.js","assets/useStudy-Bflreq2a.js","assets/store-4JNNn732.js","assets/queue-J4h7E3uc.js","assets/store-DXmC_fP2.js","assets/queue-DHeyJ32F.css","assets/useLiveConfig-X9Wxh90k.js","assets/quietHours-BvcsBKKK.js","assets/store-BFrJaSxJ.js","assets/DropSelect-DUhdQSta.js","assets/LiveSettings-CmgrMqvK.css","assets/DashboardDetail-B50ZkeVK.js","assets/CheckLogRail-wUfby67Z.js","assets/dashboardEvents-DR9d_c74.js","assets/format-hc2QOoIu.js","assets/CheckLogRail-F4AlgAcc.css","assets/useDashboardLoop-B6ByHWoE.js","assets/notify-Bz4wuE4T.js","assets/predictions-CYS7Vo39.js","assets/json-B0N3XRZU.js","assets/pin-CXSuPJYL.js","assets/pin-Bya3BL_a.css","assets/planTracker-7AMCQPNx.js","assets/dashboards-rcWxdoXI.css","assets/DashboardSettings-Dmw6JTbI.js","assets/UnderstoodPanel-CHPD2Ttj.js","assets/UnderstoodPanel-Q6GX1TFq.css","assets/ZoomDeck-BQHO79ZU.js","assets/portal-DMw7C32j.js","assets/useZoomGesture-CYc3tf2z.js","assets/ZoomDeck-B2SjNwY7.css","assets/AtlasView-Dl2fssaG.js","assets/store-BFC7DZcg.js","assets/AtlasView-B5fkQhO6.css","assets/RippleOverlay-DMHLbfh8.js","assets/cache-BumECILO.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/githubToken-DtcLYqwm.js","assets/RippleOverlay-_iiZsQVZ.css","assets/CardEditor-DzJXb0G7.js","assets/CardEditor-BY1bZiV6.css","assets/CourseRail-q6x5cCpW.js","assets/generateCourse-Cj_-vDWu.js","assets/store-DgG0C1Qx.js","assets/deckLine-NBd3MyGT.js","assets/useSrsCards-CagZefwX.js","assets/CourseRail-CUa7uIGG.css","assets/MindMapViewerDrawer-YYyZqmAd.js","assets/MindShape-mTlN5mPZ.js","assets/Presence-CzLJIeSD.js","assets/MindShape-Ca3MXEgK.css","assets/Recap-H5fhj5Tc.js","assets/Recap-DCiiWNiV.css","assets/LibraryOverlay-B2WQSgwr.js","assets/LibraryOverlay-CnKWDMG_.css","assets/ReplayOverlay-DXmVdeIr.js","assets/ExportModal-D65cGyj_.js","assets/notes-lROPCorS.js","assets/registry-Dpb8EXHn.js","assets/registry-types-DMuK0vJ6.js","assets/fitText-CDFmCQzl.js","assets/scale-Bcgfo6Hp.js","assets/useTimeout-BRYvu2jQ.js","assets/safeCssColor-di93BXgG.js","assets/registry-aIH-Im5Y.css","assets/registry-DDLSYDVA.js","assets/registry-2GJZ46M8.css","assets/registry-BPvIPLke.js","assets/registry-DpaaVbmL.css","assets/registry-D_URPoL4.js","assets/registry-upbw6pyj.css","assets/registry-BgGeRiDA.js","assets/CodeOutput-Kh6ldxQz.js","assets/registry-BzNLfje1.css","assets/registry-DCI_BeFJ.js","assets/registry-ei6fIgBT.css","assets/registry-1GuPBfQK.js","assets/registry-UFIuwh3i.css","assets/registry-Cg7qUZPS.js","assets/registry-CtbuZWYz.css","assets/registry-QcULZpdE.js","assets/registry-ZOWzhOHk.css","assets/registry-Cix-yqch.js","assets/registry-CRisz4Ca.css","assets/registry-DJinB5ye.js","assets/registry-BcZXBr3y.css","assets/registry-DUvXX_d0.js","assets/registry-CNgybLQv.css","assets/registry-CKjKq6ct.js","assets/useSpotlightWalk-rMbmNBKK.js","assets/registry-BAoRB8rd.css","assets/registry-Buq5uuCv.js","assets/registry-T3i2Q9SI.css","assets/registry-CAusoyBh.js","assets/registry-Xzq_Rpmm.css","assets/registry-zRPjWNl5.js","assets/Quiz-CUwtekfu.js","assets/stepDriver-DwjFet6U.js","assets/registry-DVzLacl_.css","assets/registry-DmQlNN3y.js","assets/registry-CRM7y8QT.css","assets/registry-aazwkBJp.js","assets/registry-Dye5m3qt.css","assets/registry-Dkc7hN5T.js","assets/registry-C3ezxLR3.css","assets/registry-CEVrY72Z.js","assets/registry-BVHiKEwE.css","assets/registry-B940W2j5.js","assets/registry-DWcNVyI2.css","assets/registry-B8DStMJk.js","assets/registry-GeSy4i7R.css","assets/registry-DI1wSG1Y.js","assets/registry-Dru0JcTa.css","assets/registry-DujBAgn_.js","assets/notes-A9t4jdfx.css","assets/ExportModal-D4WpAg2c.css","assets/ExtractionPreview-Iwfg2Ogl.js","assets/relate-A9ZeaaAI.js","assets/PinToDashboard-_kIOHs0k.js","assets/PrismOverlay-B7lEspdu.js","assets/penStrokes-9Q_l7NTt.js","assets/gesture-DabMpPcq.js","assets/citation-BcvmjKS8.js","assets/verbatim-CBMzUDlf.js","assets/officeDoc-B6nEhNp4.js","assets/PrismOverlay-BTfAicBt.css","assets/SynthesisOverlay-CkERphvG.js","assets/RehearsalPanel-BVgjrOPg.js","assets/RehearsalPanel-BCU615wg.css","assets/PresentationDeck-BDoGecxr.js","assets/pageVisibility-BxUVsw7Z.js","assets/DelegatePanel-BK7rEhIc.js","assets/DelegatePanel-_9RZiLHM.css","assets/SrsReview-BoaYb6XN.js","assets/SrsReview-DmGdGxT0.css","assets/TourPrism-BvucSkcs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{$ as r,A as i,B as a,F as o,G as s,H as c,I as l,J as u,K as d,Q as f,R as p,S as m,U as h,V as g,W as _,X as v,Y as y,Z as b,c as x,ct as S,et as C,f as w,ht as T,i as E,j as D,k as O,mt as k,nt as A,ot as j,q as M,r as N,rt as P,t as F,tt as I,u as L,w as ee,z as R}from"./index-y8GL67bB.js";import{n as z}from"./icons-CHVz6kv_.js";import{n as te,t as ne}from"./spokenText-D4zPX9JY.js";import{C as re,E as ie,S as B,T as ae,a as oe,c as se,d as ce,g as le,h as ue,l as de,n as fe,o as pe,s as me,u as he,w as ge}from"./kokoro-D4GKpSL0.js";import{t as _e}from"./FeatureUseNotice-DPtQ0OGb.js";import{d as ve,f as ye,l as be,n as V,o as xe,s as Se,t as Ce}from"./CanvasSkeleton-BZZPCuRZ.js";import{n as we,r as Te}from"./blockLabel-DAqaHKy3.js";import{t as Ee}from"./Presence-CzLJIeSD.js";import{t as De}from"./MindShape-mTlN5mPZ.js";import{r as Oe,t as H}from"./sourceHost-BV3t2XDb.js";import{t as ke}from"./stepDriver-DwjFet6U.js";import{t as Ae}from"./portal-DMw7C32j.js";import{i as je,n as Me,r as U,t as Ne}from"./gesture-DabMpPcq.js";import{_ as Pe,f as Fe,g as Ie,i as Le,t as Re,u as ze,v as Be,x as Ve,y as He}from"./providers-wzm7E8Pa.js";import{a as Ue,s as We}from"./streamParse-DRgMHWye.js";import{a as Ge,i as Ke,n as qe,o as Je,t as Ye}from"./registry-DujBAgn_.js";import{t as Xe}from"./registry-BffpZK5w.js";import{i as Ze,r as Qe}from"./info-CiqHR5cs.js";import{a as $e,c as et,i as tt,l as nt,n as rt,r as it,s as at}from"./store-4JNNn732.js";import{n as ot,t as st}from"./generateBeats-b64CL54v.js";import{D as ct,E as lt,T as ut,_ as dt,b as ft,g as pt,h as mt,i as ht,k as gt,m as _t,n as vt,o as yt,u as bt,v as xt,w as St,x as Ct}from"./shapes-RqjqC0ay.js";import{n as wt,r as Tt}from"./chapters-BiUsDClQ.js";import"./queue-J4h7E3uc.js";import{B as Et,S as Dt,U as Ot,a as kt,d as At,f as jt,g as Mt,i as Nt,o as Pt,p as Ft,r as It,s as Lt,v as Rt,z as zt}from"./useStudy-Bflreq2a.js";import{a as Bt,c as Vt,l as Ht,n as Ut,o as Wt,r as Gt,s as Kt,u as qt}from"./useLiveConfig-X9Wxh90k.js";import{prewarmLive as Jt}from"./prewarm--whjQhWJ.js";import{a as Yt,o as Xt,r as Zt}from"./store-BFrJaSxJ.js";import{a as Qt,c as $t,d as en,f as tn,i as nn,l as rn,o as an,p as on,s as sn,t as cn,u as ln}from"./quietHours-BvcsBKKK.js";import{t as un}from"./DropSelect-DUhdQSta.js";import{a as dn,d as fn,g as pn,l as mn,n as hn,p as gn,r as _n}from"./store-DXmC_fP2.js";import{t as vn}from"./useZoomGesture-CYc3tf2z.js";import{a as yn,o as bn,t as xn}from"./store-BFC7DZcg.js";import{SEED_SHIP as Sn}from"./seed-b1xc0dj2.js";import{v as Cn,y as wn}from"./githubToken-DtcLYqwm.js";import{enrichShipModel as Tn}from"./generate-8odaTyr4.js";import{a as En,c as Dn,f as On,h as kn,l as An,m as jn,o as Mn,r as Nn,t as Pn}from"./store-DgG0C1Qx.js";import{n as Fn}from"./speed-DwPw9KSv.js";import{r as In}from"./courseSeed-CZdNBTTs.js";import{i as Ln,n as Rn,r as zn,t as Bn}from"./mastery-BPjxP0fN.js";var W=t(),Vn=k(),Hn=/\?\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 Un(e){return Hn.test(e.trim())}function Wn(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 Gn(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=Wn(n,t),i=Un(t);return r&&!i?(e.fill(r),!0):!r&&!i}function Kn(e){return e.alwaysOn&&e.sttOk&&!e.composerHasText}function qn(e,t){let n=(0,W.useRef)({...e,...t});n.current={...e,...t};let r=Kn(e);(0,W.useEffect)(()=>{if(!r)return;let e=()=>{document.hidden?n.current.stop():Kn(n.current)&&!n.current.listening&&n.current.start()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[r])}var G=n(),Jn=200;function Yn(e){let t=e.trim().split(/\s+/).filter(Boolean).length;return Math.min(8e3,700+t*360)}function Xn(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)},Yn(i))},Jn)},[l,o]);return(0,W.useEffect)(()=>()=>{l(),o(null)},[t,l,o]),{narrate:u,narratingId:r}}var Zn=`mavea-view-mode`,Qn=Zn,$n=`everything`;function er(e){return e===`focus`||e===`everything`||e===`canvas`}var tr=null;function nr(){try{if(typeof localStorage>`u`)return $n;let e=localStorage.getItem(Zn);return er(e)?e:$n}catch{return $n}}function rr(){return tr||(tr=nr(),tr)}function ir(e){if(er(e)){tr=e;try{typeof localStorage<`u`&&e!==`canvas`&&localStorage.setItem(Zn,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(Qn))}catch{}}}function ar(){let[e,t]=(0,W.useState)(()=>rr());return(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(rr());return window.addEventListener(Qn,e),()=>window.removeEventListener(Qn,e)},[]),[e,(0,W.useCallback)(ir,[])]}var or=350;function sr({value:e,onChange:t,onSend:n,listening:r,onMic:i,micDisabled:a=!1,placeholder:o,disabled:s,heard:c,focusSignal:l,onFiles:u,attachTitle:d,attachPulse:f,onMicDown:p,onForceStop:m,tools:h,micExtra:g}){let _=(0,W.useRef)(null),v=(0,W.useRef)(null),[y,b]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!f)return;b(!0);let e=setTimeout(()=>b(!1),1100);return()=>clearTimeout(e)},[f]);let x=(0,W.useRef)(null),S=(0,W.useRef)(!1),C=(0,W.useRef)(!1);(0,W.useEffect)(()=>{!r&&_.current&&_.current.focus()},[r]),(0,W.useEffect)(()=>{l&&_.current&&_.current.focus()},[l]);let w=(0,W.useCallback)(e=>{a||r||(e.currentTarget.setPointerCapture(e.pointerId),S.current=!1,x.current=setTimeout(()=>{S.current=!0,p?.()},or))},[a,r,p]),T=(0,W.useCallback)(()=>{x.current!==null&&(clearTimeout(x.current),x.current=null),S.current&&(S.current=!1,C.current=!0,m?.())},[m]),E=(0,W.useCallback)(()=>{if(C.current){C.current=!1;return}a||i()},[i,a]),D=(0,G.jsx)(`button`,{className:`mic-btn`+(r?` listening`:``)+(a?` mic-off`:``),onClick:E,onPointerDown:w,onPointerUp:T,onPointerCancel:T,title:a?`Microphone off`:r?`Stop listening`:`Talk to Mavéa`,"aria-label":a?`Microphone off`:r?`Stop listening`:`Talk to Mavéa`,children:a?(0,G.jsx)(z.micOff,{}):(0,G.jsx)(z.mic,{})});return(0,G.jsxs)(`div`,{className:`composer`,children:[g?(0,G.jsxs)(`div`,{className:`mic-btn-wrap`,children:[D,g]}):D,c&&!e?(0,G.jsx)(`div`,{className:`live-listen heard`,children:(0,G.jsxs)(`span`,{style:{color:`var(--text-primary)`},children:[`"`,c,`"`]})}):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:_,className:`composer-input`,name:`mavea-ask`,"aria-label":o||`Ask Mavéa anything`,autoComplete:`off`,value:e,disabled:s,placeholder:o||`Ask Mavéa anything — or just talk`,onChange:e=>t(e.target.value),onKeyDown:t=>{t.key===`Enter`&&e.trim()&&n(e)}}),u&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`input`,{ref:v,type:`file`,name:`mavea-attach`,accept:Le,multiple:!0,disabled:s,hidden:!0,"aria-hidden":`true`,onChange:e=>{let t=Array.from(e.target.files??[]);t.length&&u(t),e.target.value=``}}),(0,G.jsx)(`button`,{type:`button`,className:`composer-tool`+(y?` is-pulsing`:``),title:d||`Attach a file`,"aria-label":d||`Attach a file`,disabled:s,onClick:()=>v.current?.click(),children:(0,G.jsx)(z.paperclip,{})})]}),h,(0,G.jsx)(`button`,{className:`send-btn`,disabled:s||!e.trim(),onClick:()=>n(e),title:`Send`,"aria-label":`Send`,children:(0,G.jsx)(z.send,{})})]})}u();var cr=null;async function lr(){return cr||(cr=(await M(()=>import(`./corpus.generated-oX9uU93S.js`),[])).default,cr)}function ur(e){return cr?.conversations.find(t=>t.id===e)}function dr(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 fr(e){return{...e,question:dr(e.question),narration:dr(e.narration),spoken:e.spoken?dr(e.spoken):e.spoken,tour:e.tour.map(e=>({...e,say:e.say?dr(e.say):e.say,saySpoken:e.saySpoken?dr(e.saySpoken):e.saySpoken}))}}var pr=[{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. It stays in memory unless you choose Remember, and passes through this deployment to your provider when used.`,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.`,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:`dashboards`,title:`Keep it current`,mode:`explain`,coach:`A living dashboard keeps an answer current. Choose when it refreshes, or refresh it whenever you want.`,action:{kind:`dashboard`},durationMs:12e3,needsCanvas:!0},{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}],mr=[{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:`rehearse`,title:`Rehearse it first`,mode:`explain`,coach:`Practice a hard conversation before it happens. I play the other side while you find your words.`,action:{kind:`showcase`,featureId:`rehearse`},durationMs:9e3,glyph:`🎭`,hook:`Practice a hard conversation first`},{id:`delegate`,title:`Scout a negotiation`,mode:`explain`,coach:`Scout a negotiation before you have it. I play the practice partner, then debrief what I found.`,action:{kind:`showcase`,featureId:`delegate`},durationMs:9e3,glyph:`🤝`,hook:`Scout a negotiation, then a debrief`},{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`}],hr=[...pr,...mr];function gr(e){return hr.find(t=>t.id===e)}var _r={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 vr(e,t){let n=ur(e),r=n?.frames[0];if(!n||!r)return null;let i=dr(t??_r[e]??n.question);return{frame:fr({...r,question:i}),question:i}}var yr=[{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`}],br=[{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:yr}}],xr=[{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 Sr(e,t){return{question:`Can I afford a 6-month career break?`,narration:t,mode:`replace`,tour:[],spec:e,at:0}}function Cr(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:br,blanks:yr,awaiting:!0},r={...t,blocks:xr,blanks:void 0,awaiting:!1};return{holes:Sr(n,``),filled:Sr(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 wr(){let e=!1,t=[];return{after(n,r){t.push(setTimeout(()=>!e&&r(),n))},cancel(){e=!0,t.forEach(clearTimeout)}}}function Tr(e,t){if(L()){t();return}let n=Date.now(),r=()=>{if(L()||Date.now()-n>=8e3){t();return}e(200,r)};e(200,r)}function Er(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 Dr(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 Or=450,K=1600;function kr(e,t){if(e<=0)return[];let n=Math.max(K,Math.floor((t-Or-400)/e));return Array.from({length:e},(e,t)=>Or+t*n)}var Ar=1500,jr=900;function Mr(e,t){let n=1850;if(e<=0)return{focusAt:Ar,spotlightAt:[]};let r=Math.max(jr,Math.floor((t-n)/e));return{focusAt:Ar,spotlightAt:Array.from({length:e},(e,t)=>n+t*r)}}var Nr=[`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 Pr(e){return!!e&&mr.some(t=>t.id===e)}function Fr(e){return!!e&&pr.some(t=>t.id===e)}function Ir(e){let{active:t}=e,[n,r]=(0,W.useState)(()=>{let t=e.startChapter;return Pr(t)||Fr(t)&&e.solo?t??null:null}),[i,a]=(0,W.useState)(()=>{let t=e.startChapter;if(Pr(t)||Fr(t)&&e.solo)return 0;let n=t?pr.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,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(0),_=(0,W.useRef)(e.ops);_.current=e.ops;let v=n?gr(n):void 0,y=v?[v]:pr,b=(0,W.useRef)(y);b.current=y;let x=y.length,C=t?y[i]??null:null,[w,T]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!t)return;let e=!0;return lr().then(()=>{e&&T(!0)}),()=>{e=!1}},[t]);let E=(0,W.useCallback)(()=>{let e=_.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,W.useEffect)(()=>{if(!t||!o||p||!w)return;let e=b.current[i];if(!e)return;S(e.id,!!n);let r=_.current,a=wr(),s=a.after,c=e=>Tr(s,e),l=e=>c(()=>r.speak(e)),u=e=>r.showFrame({...e.frame,narration:``,tour:[]},e.question);if(E(),e.needsCanvas&&!r.hasCanvas()){let e=vr(`money`);e&&u(e)}r.setMuted(f.current||e.mode===`silent`);let d=e.action;if(d.kind===`answer`){let e=vr(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(Er(s,r.typeInto,t)+360,()=>c(()=>r.showFrame(n,e.question)))}}else if(d.kind===`chip`){let e=vr(`money`);e&&u(e),s(1400,()=>r.pressKeepGoing(d.label)),s(2e3,()=>{let e=vr(d.convoId,d.label);e&&r.showFrame(e.frame,e.question)})}else if(d.kind===`montage`){let t=d.convoIds.map(e=>vr(e)).filter(Boolean),n=kr(t.length,e.durationMs);t.forEach((e,t)=>s(n[t],()=>u(e)))}else if(d.kind===`ask`)s(1300,()=>r.pinFirstBlock()),Er(s,r.typeInto,`Why does it grow faster after year 20?`,1700);else if(d.kind===`askMulti`){let e=vr(`money`);e&&u(e),s(1300,()=>r.pinFirstBlocks(2)),Er(s,r.typeInto,`How do these two parts explain the final total?`,2600)}else if(d.kind===`bend`){if(d.convoId){let e=vr(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=vr(`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=vr(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=vr(d.convoId);t&&u(t);let n=(t?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e),{focusAt:i,spotlightAt:a}=Mr(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 Nr)e=Er(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===`dashboard`)s(500,()=>r.openDashboards()),s(2600,()=>r.dashboardShowSettings());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=vr(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=vr(`money`)?.frame.spec;if(e){let{holes:t,filled:n}=Cr(e);u({frame:t,question:t.question}),s(5200,()=>r.showFrame(n,n.question))}}return e.mode!==`silent`&&!f.current&&s(160,()=>l(dr(e.coach))),a.cancel},[i,h,t,o,p,w,n,E]),(0,W.useEffect)(()=>{if(!t||!o||p||!c||!w)return;let e=b.current[i];if(!e)return;let n=_.current;return Dr({minHoldMs:e.durationMs,isQuiet:()=>!n.isSpeaking()&&!n.isBusy(),advance:()=>{i+1>=x?(E(),m(!0)):a(i+1)}})},[i,h,t,o,p,c,w,x,n,E]),(0,W.useEffect)(()=>()=>E(),[E]);let D=(0,W.useCallback)(()=>{L(),s(!0),l(!0),m(!1)},[]),O=(0,W.useCallback)((e,t)=>{L(),m(!1),t?.keepPlaying||l(!1),a(Math.max(0,Math.min(b.current.length-1,e))),g(e=>e+1)},[]),k=(0,W.useCallback)(()=>{i+1>=x?(E(),m(!0)):O(i+1,{keepPlaying:!0})},[i,x,O,E]),A=(0,W.useCallback)(()=>O(i-1),[i,O]),j=(0,W.useCallback)(e=>O(e),[O]),M=(0,W.useCallback)(()=>{E(),r(null),s(!0),O(0),l(!0)},[O,E]),N=(0,W.useCallback)(e=>{Pr(e)&&(L(),r(e),s(!0),m(!1),l(!0),a(0),g(e=>e+1))},[]),P=(0,W.useCallback)(()=>{if(L(),!o){D();return}if(p){M();return}l(e=>!e)},[p,M,D,o]),F=(0,W.useCallback)(()=>{L();let e=!f.current;f.current=e,d(e);let t=b.current[i],n=t?.mode===`silent`,r=_.current;r.setMuted(e||n),e?r.cancelSpeech():o&&!p&&t&&!n&&r.speak(dr(t.coach))},[p,i,o]),I=(0,W.useCallback)(()=>{E(),m(!0)},[E]);return{active:t,started:o,index:i,total:x,chapter:C,coach:dr(C?.coach??``),spotlight:C?.spotlight,playing:c,muted:u,done:p,solo:!!n,start:D,next:k,prev:A,jumpTo:j,toggle:P,toggleMute:F,replay:M,skip:I,playExtra:N}}var q=T();function Lr(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}function Rr(e,t){let n=(0,q.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(Ur).filter(Boolean),c=()=>{if(!n)return;let e=null,t=null;for(let n of s){let r=Array.from(document.querySelectorAll(n)).filter(Hr).map(Vr).filter(Br),i=r.find(zr)??r[0];if(i){e=i.hit,t=i.rect;break}}if(!e||!t){o(null);return}let i=t;if(!Lr(i)){let t=Date.now();t-r>1200&&(r=t,e.scrollIntoView({block:`center`,behavior:`smooth`})),o(null);return}o(i)};c();let l=window.setInterval(c,250);return window.addEventListener(`resize`,c),window.addEventListener(`scroll`,c,!0),()=>{n=!1,window.clearInterval(l),window.removeEventListener(`resize`,c),window.removeEventListener(`scroll`,c,!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 zr(e){let{rect:t}=e;return Lr(t)}function Br(e){let{rect:t}=e;return t.width>0&&t.height>0}function Vr(e){return{hit:e,rect:e.getBoundingClientRect()}}function Hr(e){return!e.checkVisibility||e.checkVisibility({checkOpacity:!0})}function Ur(e){return e.trim()}function Wr(e){let t=(0,q.c)(72),{driver:n}=e,r=Rr(n.spotlight,n.active&&n.started&&!n.done),i=n.active&&n.started&&!n.done?n.chapter?.id:void 0,a,o;if(t[0]===i?(a=t[1],o=t[2]):(a=()=>{if(i)return document.body.dataset.tourChapter=i,Gr},o=[i],t[0]=i,t[1]=a,t[2]=o),(0,W.useEffect)(a,o),!n.active||n.done)return null;if(!n.started){let e,r;t[3]===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[3]=e,t[4]=r):(e=t[3],r=t[4]);let i=n.total===1?`scene plays`:`scenes play`,a;t[5]!==n.total||t[6]!==i?(a=(0,G.jsxs)(`p`,{children:[n.total,` short `,i,` automatically. Pause, skip, or move at your own pace.`]}),t[5]=n.total,t[6]=i,t[7]=a):a=t[7];let o;t[8]===n.start?o=t[9]:(o=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.start,children:`Start the tour`}),t[8]=n.start,t[9]=o);let s;t[10]===n.skip?s=t[11]:(s=(0,G.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:n.skip,children:`Skip tour`}),t[10]=n.skip,t[11]=s);let c;t[12]!==o||t[13]!==s?(c=(0,G.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14];let l;return t[15]!==a||t[16]!==c?(l=(0,G.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`tourx-welcome`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tourx-welcome-title`,children:[e,r,a,c]})}),t[15]=a,t[16]=c,t[17]=l):l=t[17],l}let s=i===`ask`||!!r&&r.top+r.height/2>window.innerHeight*.58,c;t[18]===r?c=t[19]:(c=r&&(0,G.jsx)(`div`,{className:`tourx-ring`,style:{top:r.top-8,left:r.left-8,width:r.width+16,height:r.height+16}}),t[18]=r,t[19]=c);let l=`tourx-panel`+(n.solo?` is-solo`:``)+(s?` is-top`:``),u=n.solo?`Mini-demo controls`:`Walkthrough controls`,d=`head-`+n.index,f=n.solo?`Mini demo`:`${n.index+1} / ${n.total}`,p;t[20]===f?p=t[21]:(p=(0,G.jsx)(`span`,{className:`tourx-count`,children:f}),t[20]=f,t[21]=p);let m=n.chapter?.title,h;t[22]===m?h=t[23]:(h=(0,G.jsx)(`span`,{className:`tourx-title`,children:m}),t[22]=m,t[23]=h);let g;t[24]!==h||t[25]!==d||t[26]!==p?(g=(0,G.jsxs)(`div`,{className:`tourx-head`,children:[p,h]},d),t[24]=h,t[25]=d,t[26]=p,t[27]=g):g=t[27];let _=`coach-`+n.index,v;t[28]!==n.coach||t[29]!==_?(v=(0,G.jsx)(`p`,{className:`tourx-coach`,children:n.coach},_),t[28]=n.coach,t[29]=_,t[30]=v):v=t[30];let y;t[31]!==n.index||t[32]!==n.prev||t[33]!==n.solo?(y=!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)(z.chevL,{className:`tourx-ic`})}),t[31]=n.index,t[32]=n.prev,t[33]=n.solo,t[34]=y):y=t[34];let b=n.playing?`Pause autoplay`:`Turn on autoplay`,x;t[35]===n.playing?x=t[36]:(x=n.playing?(0,G.jsx)(z.pause,{className:`tourx-ic`}):(0,G.jsx)(z.play,{className:`tourx-ic`}),t[35]=n.playing,t[36]=x);let S=n.playing?`Pause`:`Autoplay`,C;t[37]===S?C=t[38]:(C=(0,G.jsx)(`span`,{children:S}),t[37]=S,t[38]=C);let w;t[39]!==n.toggle||t[40]!==b||t[41]!==x||t[42]!==C?(w=(0,G.jsxs)(`button`,{type:`button`,className:`tourx-btn tourx-play tourx-auto`,onClick:n.toggle,"aria-label":b,children:[x,C]}),t[39]=n.toggle,t[40]=b,t[41]=x,t[42]=C,t[43]=w):w=t[43];let T=n.muted?`Turn narration on`:`Mute narration`,E=n.muted?`Turn narration on`:`Mute narration`,D;t[44]===n.muted?D=t[45]:(D=n.muted?(0,G.jsx)(z.speakerOff,{className:`tourx-ic`}):(0,G.jsx)(z.speaker,{className:`tourx-ic`}),t[44]=n.muted,t[45]=D);let O;t[46]!==n.muted||t[47]!==n.toggleMute||t[48]!==T||t[49]!==E||t[50]!==D?(O=(0,G.jsx)(`button`,{type:`button`,className:`tourx-btn tourx-mute`,onClick:n.toggleMute,"aria-label":T,"aria-pressed":n.muted,title:E,children:D}),t[46]=n.muted,t[47]=n.toggleMute,t[48]=T,t[49]=E,t[50]=D,t[51]=O):O=t[51];let k;t[52]===n?k=t[53]:(k=!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)(z.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[52]=n,t[53]=k);let A=n.solo?`Back to demos`:`Skip`,j;t[54]!==n.skip||t[55]!==A?(j=(0,G.jsx)(`button`,{type:`button`,className:`tourx-skip`,onClick:n.skip,children:A}),t[54]=n.skip,t[55]=A,t[56]=j):j=t[56];let M;t[57]!==y||t[58]!==w||t[59]!==O||t[60]!==k||t[61]!==j?(M=(0,G.jsxs)(`div`,{className:`tourx-controls`,children:[y,w,O,k,j]}),t[57]=y,t[58]=w,t[59]=O,t[60]=k,t[61]=j,t[62]=M):M=t[62];let N;t[63]!==g||t[64]!==v||t[65]!==M||t[66]!==l||t[67]!==u?(N=(0,G.jsxs)(`div`,{className:l,role:`group`,"aria-label":u,children:[g,v,M]}),t[63]=g,t[64]=v,t[65]=M,t[66]=l,t[67]=u,t[68]=N):N=t[68];let P;return t[69]!==N||t[70]!==c?(P=(0,G.jsxs)(`div`,{className:`tourx`,"aria-live":`polite`,children:[c,N]}),t[69]=N,t[70]=c,t[71]=P):P=t[71],P}function Gr(){delete document.body.dataset.tourChapter}function Kr({onStart:e,onReplay:t,onPlayExtra:n,hasStoredSession:r=!1}){return(0,G.jsx)(`div`,{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`,children:(0,G.jsx)(Ee,{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:mr.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 qr=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 Jr(e){return qr.get(e)}function Yr(e){return e.steps.filter(e=>!!e.ask)}var Xr=1300,Zr=900;function Qr(e,t){return(e?.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,t)}function $r(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&&Qr(n,4).forEach((n,i)=>r(e.atMs+Zr+i*Xr,()=>t.setSpot(n)));break;case`canvas`:{r(e.atMs,()=>t.setViewMode(`canvas`));let i=Qr(n,3);i.forEach((n,i)=>r(e.atMs+Zr+i*Xr,()=>t.setSpot(n))),r(e.atMs+Zr+i.length*Xr,()=>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));break}}function ei(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 ti(e){return e?.length?Math.max(...e.map(e=>e.atMs+ei(e))):0}u();var ni=Object.assign({"./cfo.generated.json":()=>M(()=>import(`./cfo.generated-Bjl5OGay.js`),[]),"./dev.generated.json":()=>M(()=>import(`./dev.generated-DYgVxL_4.js`),[]),"./student.generated.json":()=>M(()=>import(`./student.generated-DS_acPaJ.js`),[]),"./traveler.generated.json":()=>M(()=>import(`./traveler.generated-Beun9X7y.js`),[])});async function ri(e){let t=ni[`./${e}.generated.json`];if(!t)return null;try{return(await t()).default??null}catch{return null}}var ii=4500,J=1e3,ai=6e4;function oi(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 si(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 ci(e){let{active:t,personaId:n}=e,r=n?Jr(n):void 0,i=r?.steps??[],a=i.length,[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(`loading`),[u,f]=(0,W.useState)(()=>Math.max(0,Math.min(a-1,e.startStep??0))),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),y=(0,W.useRef)(_);y.current=_;let[b,x]=(0,W.useState)(!1),[S,C]=(0,W.useState)(0),[w,T]=(0,W.useState)(null),E=(0,W.useRef)(e.ops);E.current=e.ops;let D=(0,W.useRef)(null),O=(0,W.useRef)(0),k=(0,W.useCallback)(()=>{if(!t||!n)return;l(`loading`);let e=++O.current;ri(n).then(t=>{if(e!==O.current)return;let n=r?Yr(r).length:0,i=!!t&&!!r&&t.frames.length===n;s(i?t:null),l(i?`ready`:`error`)})},[t,n,r]);(0,W.useEffect)(k,[k]);let A=(0,W.useCallback)(()=>{let e=E.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,W.useEffect)(()=>{if(!t||!p||b||c!==`ready`||!o||!r)return;let e=r.steps[u];if(!e)return;d(r.persona,u);let n=E.current,i=wr(),a=i.after;T(null),D.current=null,A(),n.setMuted(y.current);let s=oi(r.steps,u,o),l=s??si(r.steps,u,o),f=e.ask?dr(e.ask):null,m=s?fr({...s,question:f??s.question}):null,h=l?fr(l):null,g=()=>{let t=e.beats??[];for(let e of t)$r(e,n,h,a);e.note&&a(t.length?Math.min(...t.map(e=>e.atMs)):0,()=>T(dr(e.note??``))),D.current=Date.now()+ti(t)+(e.holdMs??ii)},_=e=>{let t=Date.now(),r=0,i=()=>{if(Date.now()-t>=ai){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=f??e.ask,l;s?(a(700,()=>n.pressKeepGoing(e.ask??c)),l=1600):l=Er(a,n.typeInto,c,400)+360,a(l,()=>Tr(a,()=>n.showFrame(m,c))),_(l+J)}else !n.hasCanvas()&&h&&n.showFrame({...h,narration:``,tour:[]},h.question),a(300,g);return i.cancel},[u,S,t,p,b,c,o,r,A]),(0,W.useEffect)(()=>{if(!t||!p||b||!h||c!==`ready`)return;let e=E.current,n=window.setInterval(()=>{let t=D.current;!t||Date.now()<t||e.isSpeaking()||e.isBusy()||(window.clearInterval(n),u+1>=a?(A(),x(!0)):f(u+1))},250);return()=>window.clearInterval(n)},[u,S,t,p,b,h,a,c,A]),(0,W.useEffect)(()=>()=>A(),[A]);let j=(0,W.useCallback)(()=>{L(),m(!0),g(!0),x(!1)},[]),M=(0,W.useCallback)((e,t)=>{L(),x(!1),t?.keepPlaying||g(!1),f(Math.max(0,Math.min(a-1,e))),C(e=>e+1)},[a]),N=(0,W.useCallback)(()=>{u+1>=a?(A(),x(!0)):M(u+1,{keepPlaying:!0})},[u,a,M,A]),P=(0,W.useCallback)(()=>M(u-1),[u,M]),F=(0,W.useCallback)(e=>M(e),[M]),I=(0,W.useCallback)(()=>{A(),m(!0),M(0),g(!0)},[M,A]),ee=(0,W.useCallback)(()=>{if(L(),!p){j();return}if(b){I();return}g(e=>!e)},[b,I,j,p]),R=(0,W.useCallback)(()=>{L();let e=!y.current;y.current=e,v(e),E.current.setMuted(e),e&&E.current.cancelSpeech()},[]),z=(0,W.useCallback)(()=>{A(),x(!0)},[A]);return{active:t,started:p,loadState:c,model:o?.model??null,reload:k,index:u,total:a,step:t?i[u]??null:null,note:w,playing:h,muted:_,done:b,start:j,next:N,prev:P,jumpTo:F,toggle:ee,toggleMute:R,replay:I,skip:z}}function li(e){return/\p{Extended_Pictographic}/u.test(e)}function ui({driver:e,member:t,onExit:n}){if(!e.active)return null;let r={"--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:r,children:[(0,G.jsx)(z.spinner,{className:`demox-spinner`}),`Loading `,t.name,`’s session…`]})});if(e.loadState===`error`)return(0,G.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`demox-card`,style:r,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 recorded session 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:()=>{window.location.hash=`#/`},children:`Back to home`})]})]})});if(!e.started)return(0,G.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`demox-card demox-start`,style:r,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-start-title`,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(li(t.avatar)?` emoji`:``),children:t.avatar}),(0,G.jsx)(`span`,{className:`demox-card-kicker`,children:`Recorded session`}),(0,G.jsxs)(`p`,{id:`demox-start-title`,className:`demox-card-title`,children:[`Watch `,t.name,` use Mavéa`]}),(0,G.jsx)(`p`,{className:`demox-card-body`,children:`The session plays automatically. 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:n,children:`Back to home`})]})]})});if(e.done){let i=F.filter(e=>e.id!==t.id);return(0,G.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,G.jsxs)(`div`,{className:`demox-card demox-end`,style:r,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(li(t.avatar)?` emoji`:``),children:t.avatar}),(0,G.jsxs)(`p`,{className:`demox-card-title`,children:[`That was `,t.name,`’s session`]}),(0,G.jsx)(`p`,{className:`demox-card-body`,children:`Every answer you watched was generated by a real model and replayed exactly. Nothing was staged. Your turn.`}),(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 sessions`,children:i.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`demox-other`,style:{"--accent":e.accent},onClick:()=>h(e.id),title:`${e.name} · ${e.role}`,children:[(0,G.jsx)(`span`,{className:`demox-other-avatar`+(li(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:r,children:[(0,G.jsx)(`span`,{className:`demox-avatar`+(li(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:`Demo`})]}),e.note&&(0,G.jsx)(`div`,{className:`demox-note`,style:r,children:e.note},e.note),(0,G.jsxs)(`div`,{className:`demox-panel`,style:r,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)(z.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)(z.pause,{className:`demox-ic`}):(0,G.jsx)(z.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)(z.speakerOff,{className:`demox-ic`}):(0,G.jsx)(z.speaker,{className:`demox-ic`})}),(0,G.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.next,"aria-label":`Next step`,children:(0,G.jsx)(z.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`})]})]})]})}u();var di=[`bitcoin`,`fomc`,`weather`,`cars`,`react-readme`],fi=null;async function pi(){return fi||(fi=[...(await M(()=>import(`./prism.generated-BhbHDHR6.js`),[])).default.docs].sort((e,t)=>{let n=di.indexOf(e.id),r=di.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,proposed:e.proposed})),fi)}var mi=`How does $10,000 grow at 7% over 30 years?`;function hi(){let e=ur(`money`)?.frames[0]?.spec.blocks??[],t=ur(`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 gi(){let e=Dt().find(e=>e.question===mi);if(e)return e.id;let t=hi();if(t.length===0)return null;let n=Rt({title:`Investment growth · $10k at 7%`,question:mi,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=>Mt(e,`tour`)),n.cadence={data:`hourly`,ai:`daily`},n.nextDataAt=Ot(n.createdAt,Et[n.cadence.data]),n.nextAiAt=Ot(n.createdAt,zt[n.cadence.ai]),Ft(n),n.id}function _i(e,t){let n=e.length,r=new ArrayBuffer(44+n*2),i=new DataView(r);function 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*2,!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*2,!0);let o=44;for(let t=0;t<n;t++){let n=Math.max(-1,Math.min(1,e[t]));i.setInt16(o,n<0?n*32768:n*32767,!0),o+=2}return r}function vi(e){switch(e){case`no-speech`:return`no-speech`;case`not-allowed`:case`service-not-allowed`:return`not-allowed`;case`aborted`:return`aborted`;case`audio-capture`:return`audio`;default:return`unsupported`}}u();var Y=class t{mode=`vad`;capabilities;vad=null;vadLoading=!1;vadFailed=!1;rec=null;liveTranscript=``;phase=`idle`;muted=!1;wantRunning=!1;disposed=!1;maveaSpeaking=!1;echoTailUntil=0;onBargeIn;utteranceIsEcho=!1;bargeInTimer=null;static ECHO_TAIL_MS=600;whisperOk=null;resultSubs=new Set;stateSubs=new Set;constructor(){let e=window.SpeechRecognition||window.webkitSpeechRecognition,t=!!e,n=typeof window<`u`&&`speechSynthesis`in window;if(this.capabilities={stt:t,tts:n,canUseRealVoice:t},e){let t=new e;t.lang=`en-US`,t.interimResults=!0,t.continuous=!0,t.maxAlternatives=1,t.onresult=e=>{let t=``;for(let n=0;n<e.results.length;n++)t+=e.results[n][0].transcript;this.liveTranscript=t.trim(),this.phase===`listening`&&this.emitState({phase:`listening`,transcript:this.liveTranscript})},t.onerror=e=>{let t=vi(e.error);t===`aborted`||t===`no-speech`||this.emitState({phase:`idle`,error:t})},t.onend=()=>{},this.rec=t}}start(e){if(!this.muted){if(this.wantRunning=!0,this.vadFailed){if(this.rec&&this.phase===`idle`)try{this.rec.start(),this.emitState({phase:`listening`})}catch{}return}this.vad?this.vad.start():this.loadVad()}}stop(){this.wantRunning=!1,this.vad&&this.vad.pause();try{this.rec?.stop()}catch{}this.clearBargeInTimer(),this.liveTranscript=``,this.phase!==`idle`&&this.emitState({phase:`idle`})}forceStop(){this.wantRunning=!1,this.vad&&this.vad.pause();try{this.rec?.stop()}catch{}this.clearBargeInTimer();let e=this.liveTranscript.trim();this.liveTranscript=``,this.utteranceIsEcho=!1,e&&(this.emitState({phase:`heard`,transcript:e}),this.emitResult({transcript:e})),this.emitState({phase:`idle`})}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(){if(this.disposed=!0,this.wantRunning=!1,this.clearBargeInTimer(),this.vad&&=(this.vad.destroy().catch(()=>{}),null),this.rec){this.rec.onresult=null,this.rec.onerror=null,this.rec.onend=null;try{this.rec.abort()}catch{}}this.resultSubs.clear(),this.stateSubs.clear()}async loadVad(){if(!this.vadLoading){this.vadLoading=!0;try{let{MicVAD:t}=await M(async()=>{let{MicVAD:t}=await import(`./dist-BFx3nZg4.js`).then(t=>e(t.default,1));return{MicVAD:t}},__vite__mapDeps([0,1,2,3,4,5,6]));if(this.vad=await t.new({model:`v5`,startOnLoad:!1,baseAssetPath:`/`,onnxWASMBasePath:`/`,redemptionMs:2200,onSpeechStart:()=>this.handleSpeechStart(),onSpeechRealStart:()=>this.handleSpeechRealStart(),onSpeechEnd:e=>void this.handleSpeechEnd(e),onVADMisfire:()=>this.handleMisfire()}),this.disposed){this.vad.destroy().catch(()=>{}),this.vad=null;return}this.vadLoading=!1,this.wantRunning&&this.vad.start()}catch(e){console.warn(`[VadVoice] Silero VAD failed to load — falling back to WebSpeech`,e),this.vadLoading=!1,this.vadFailed=!0,this.rec?(this.rec.onresult=e=>{let t=e.results[e.results.length-1];if(!t)return;let n=t[0].transcript.trim();t.isFinal&&(this.maveaSpeaking||Date.now()<this.echoTailUntil)||(t.isFinal&&n?(this.emitState({phase:`heard`,transcript:n}),this.emitResult({transcript:n}),this.emitState({phase:`idle`})):t.isFinal||(this.liveTranscript=n,this.emitState({phase:`listening`,transcript:n})))},this.wantRunning&&this.start()):this.wantRunning&&this.emitState({phase:`idle`,error:`unsupported`})}}}clearBargeInTimer(){this.bargeInTimer!==null&&(clearTimeout(this.bargeInTimer),this.bargeInTimer=null)}handleSpeechStart(){if(!this.muted&&(this.utteranceIsEcho=Date.now()<this.echoTailUntil,this.liveTranscript=``,!this.utteranceIsEcho)){try{this.rec?.start()}catch{}this.emitState({phase:`listening`})}}handleSpeechRealStart(){this.muted||this.utteranceIsEcho||this.maveaSpeaking&&this.onBargeIn?.()}handleMisfire(){this.clearBargeInTimer();try{this.rec?.stop()}catch{}this.utteranceIsEcho=!1,this.liveTranscript=``,this.phase!==`idle`&&this.emitState({phase:`idle`})}async handleSpeechEnd(e){this.clearBargeInTimer();try{this.rec?.stop()}catch{}if(this.utteranceIsEcho){this.utteranceIsEcho=!1,this.liveTranscript=``,this.emitState({phase:`idle`});return}let t=(await this.transcribeWhisper(e)||this.liveTranscript).trim();t&&(this.emitState({phase:`heard`,transcript:t}),this.emitResult({transcript:t})),this.liveTranscript=``,this.emitState({phase:`idle`})}async transcribeWhisper(e){if(this.whisperOk===!1)return``;try{let t=_i(e,16e3),n=new FormData;n.append(`file`,new Blob([t],{type:`audio/wav`}),`speech.wav`),n.append(`model`,`whisper-1`),n.append(`language`,`en`);let r=this.whisperOk===!0?12e3:3500,i=await fetch(`/stt/v1/audio/transcriptions`,{method:`POST`,body:n,signal:AbortSignal.timeout(r)});if(i.ok){let e=(await i.json()).text?.trim()??``;if(e)return this.whisperOk===null&&(this.whisperOk=!0),e}}catch(e){if(e instanceof DOMException&&(e.name===`TimeoutError`||e.name===`AbortError`))return``}return this.whisperOk===null&&(this.whisperOk=!1),``}emitResult(e){this.resultSubs.forEach(t=>t(e))}emitState(e){this.phase=e.phase,this.stateSubs.forEach(t=>t(e))}},yi=2200,bi=2e4,xi=class{mode=`webspeech`;capabilities;rec;muted=!1;wantListening=!1;phase=`idle`;finalBuf=``;endTimer=null;silenceDeadline=0;resultSubs=new Set;stateSubs=new Set;constructor(){let e=window.SpeechRecognition||window.webkitSpeechRecognition,t=!!e,n=typeof window<`u`&&`speechSynthesis`in window;if(this.capabilities={stt:t,tts:n,canUseRealVoice:t&&n},e){let t=new e;t.lang=`en-US`,t.interimResults=!0,t.continuous=!0,t.maxAlternatives=1,t.onstart=()=>{this.finalBuf=``,this.emitState({phase:`listening`})},t.onresult=e=>{let t=``,n=``;for(let r=0;r<e.results.length;r++){let i=e.results[r];i.isFinal?t+=i[0].transcript:n+=i[0].transcript}this.finalBuf=t.trim();let r=`${this.finalBuf} ${n}`.trim();this.emitState({phase:`listening`,transcript:r}),this.armEndTimer()},t.onerror=e=>{this.clearEndTimer();let t=vi(e.error);if(t===`no-speech`){if(this.finalBuf)this.finalizeUtterance();else if(this.wantListening&&Date.now()<this.silenceDeadline)try{this.rec?.start()}catch{}else this.wantListening=!1,this.emitState({phase:`idle`});return}if(this.finalBuf=``,t===`aborted`){this.emitState({phase:`idle`});return}this.emitState({phase:`idle`,error:t})},t.onend=()=>{this.clearEndTimer(),this.phase===`listening`&&(this.finalBuf?this.finalizeUtterance():this.emitState({phase:`idle`}))},this.rec=t}}start(e){if(!(this.muted||!this.rec)){this.wantListening=!0,this.silenceDeadline=Date.now()+bi;try{this.rec.start()}catch{}}}stop(){this.wantListening=!1;try{this.rec?.stop()}catch{}}forceStop(){this.wantListening=!1,this.finalizeUtterance()}speak(e){return Promise.resolve()}cancel(){this.clearEndTimer(),this.finalBuf=``,this.stop()}setMuted(e){this.muted=e,e&&this.stop()}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.cancel(),this.rec&&(this.rec.onstart=null,this.rec.onresult=null,this.rec.onerror=null,this.rec.onend=null),this.resultSubs.clear(),this.stateSubs.clear()}armEndTimer(){this.clearEndTimer(),this.endTimer=setTimeout(()=>this.finalizeUtterance(),yi)}clearEndTimer(){this.endTimer!==null&&(clearTimeout(this.endTimer),this.endTimer=null)}finalizeUtterance(){this.clearEndTimer();let e=this.finalBuf.trim();this.finalBuf=``,e&&(this.emitState({phase:`heard`,transcript:e}),this.emitResult({transcript:e})),this.emitState({phase:`idle`});try{this.rec?.stop()}catch{}}emitResult(e){this.resultSubs.forEach(t=>t(e))}emitState(e){this.phase=e.phase,this.stateSubs.forEach(t=>t(e))}};function Si(e){return e===`vad`?new Y:new xi}function Ci(e={}){let t=e.mode??`webspeech`,n=(0,W.useRef)(e.onResult),r=(0,W.useRef)(e.onStateChange),i=(0,W.useRef)(e.onBargeIn);n.current=e.onResult,r.current=e.onStateChange,i.current=e.onBargeIn;let a=(0,W.useMemo)(()=>Si(t),[t]);return(0,W.useEffect)(()=>{let e=a.onResult(e=>n.current?.(e)),t=a.onStateChange(e=>r.current?.(e));return`onBargeIn`in a&&(a.onBargeIn=()=>i.current?.()),()=>{e(),t(),a.dispose()}},[a]),(0,W.useMemo)(()=>({mode:a.mode,capabilities:a.capabilities,start:e=>a.start(e),stop:()=>a.stop(),speak:e=>a.speak(e),cancel:()=>a.cancel(),setMuted:e=>a.setMuted(e),setSoundEnabled:e=>a.setSoundEnabled(e),setMaveaSpeaking:e=>a.setMaveaSpeaking?.(e),forceStop:()=>a.forceStop?.()}),[a])}var wi=1100,Ti=15e3,Ei=1e4,Di=12e3,Oi=8e3,ki=3500,Ai=2500,ji=3e3;function Mi(e){return e*2+12e3}function Ni(e){return new Promise(t=>setTimeout(t,e))}async function Pi(e,t=Ti){return await Ge(e.started,t)??!1}async function Fi(e,t,n=wi){await Promise.all([Ge(e.finished,Mi(t)),Ni(n)])}function Ii(e){let t=e.speaking??ce,n=e.subscribe??le;return new Promise(r=>{let i=!1,a=!1,o=()=>{a||(a=!0,c(),clearTimeout(l),r())},s=()=>{i&&!t()&&o()},c=n(s);setTimeout(()=>{i=!0,s()},e.floorMs);let l=setTimeout(o,e.capMs)})}async function Li(e){try{await Ge((async()=>{await Je(),await Je(),await Ge(e.loadFams(),Oi),e.settle&&await e.settle(),e.wantVoice&&e.firstLine&&await Ge(e.firstLine.started,Ei)})(),Di)}catch{}}var Ri=`mavea-always-on`;function zi(e,t,n=!1,r=`neutral`,i=!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`};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 Bi=new Set([`no`,`caution`,`avoid`,`risk`,`wait`]),Vi=new Set([`yes`,`go`,`recommended`,`good`]);function Hi(e,t){let n=e.props[t];return typeof n==`string`?n.toLowerCase():void 0}function Ui(e){let t=e?.blocks;if(!t?.length)return`neutral`;let n=!1,r=e?.awaiting===!0;for(let e of t){let t=Hi(e,`tone`);(t===`warn`||t===`neg`)&&(n=!0),t===`pos`&&(r=!0);let i=Hi(e,`stance`);i&&Bi.has(i)&&(n=!0),i&&Vi.has(i)&&(r=!0),e.type===`insight`&&e.props.conf===`unverified`&&(n=!0)}return n?`concerned`:r?`warm`:`neutral`}function Wi(e){switch(e){case`concerned`:return`concerned`;case`warm`:return`warm`;default:return`neutral`}}function Gi(e){return Wi(Ui(e))}function Ki(e){let t=e?.blocks;return!t?.length||Ui(e)!==`warm`?!1:t.some(e=>{let t=Hi(e,`stance`);return t!==void 0&&Vi.has(t)})}var qi={clipShared:[`Nice — that one's worth sharing.`,`Off it goes.`,`Clipped and ready to share.`]};function Ji(e,t,n){let r=qi[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 Yi(){return{lastAt:0,lastTurn:-1/0}}function Xi(e,t){return!(e.lastAt!==0&&t.now-e.lastAt<9e4||t.turnCount-e.lastTurn<3)}function Zi(e,t){return{lastAt:t.now,lastTurn:t.turnCount}}var Qi=1100,$i=6e3,ea=150,ta=950,na=350,ra=8;function ia(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)(Yi()),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>=ra||t[t.length-1]===e?t:[...t,e])},[]),x=(0,W.useCallback)(()=>{y(),u(!1),v.current=setTimeout(()=>{v.current=null,f(null)},ta)},[y]),S=(0,W.useCallback)(e=>{let t=()=>{let n=Date.now()-e;n>=Qi&&!o.current()||n>=$i?x():_.current=setTimeout(t,ea)};_.current=setTimeout(t,Qi)},[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),na);return()=>clearTimeout(e)}let e=s[0],r=Date.now();if(!Xi(h.current,{type:e,now:r,turnCount:n})){c(e=>e.slice(1));return}h.current=Zi(h.current,{type:e,now:r,turnCount:n});let a=Ji(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=Yi(),g.current=void 0},[y]);return(0,W.useEffect)(()=>()=>y(),[y]),{interjecting:l,line:d,enqueue:b,reset:w}}function aa(e){let t=(0,q.c)(37),{chapters:n,currentIndex:r,onJump:i,onClose:a}=e,o=(0,W.useRef)(null),s=(0,W.useRef)(null),c,l;if(t[0]===a?(c=t[1],l=t[2]):(c=()=>{s.current=document.activeElement??null;let e=e=>{e.key===`Escape`&&(e.preventDefault(),a())};return window.addEventListener(`keydown`,e),(o.current?.querySelector(`.ovw-moment, [tabindex], button`))?.focus(),()=>{window.removeEventListener(`keydown`,e),s.current?.focus?.()}},l=[a],t[0]=a,t[1]=c,t[2]=l),(0,W.useEffect)(c,l),n.length===0)return null;let u;t[3]===n?u=t[4]:(u=wt(n),t[3]=n,t[4]=u);let d=u,f;t[5]!==n||t[6]!==r?(f=n.find(e=>e.moments.some(e=>e.frameIndex===r))?.color,t[5]=n,t[6]=r,t[7]=f):f=t[7];let p=f,m;t[8]===a?m=t[9]:(m=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),a())},t[8]=a,t[9]=m);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,G.jsx)(`h2`,{className:`ovw-title`,children:`Your conversation`}),t[10]=h):h=t[10];let g=n.length===1?`chapter`:`chapters`,_=d===1?`moment`:`moments`,v;t[11]!==n.length||t[12]!==g||t[13]!==_||t[14]!==d?(v=(0,G.jsxs)(`header`,{className:`ovw-head`,children:[h,(0,G.jsxs)(`p`,{className:`ovw-sub`,children:[n.length,` `,g,` · `,d,` `,_,` — tap anywhere to dive back in`]})]}),t[11]=n.length,t[12]=g,t[13]=_,t[14]=d,t[15]=v):v=t[15];let y;if(t[16]!==n||t[17]!==r||t[18]!==a||t[19]!==i){let e;t[21]!==r||t[22]!==a||t[23]!==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=z[e.icon]||z.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&&z[t.icon]||z.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[21]=r,t[22]=a,t[23]=i,t[24]=e):e=t[24],y=n.map(e),t[16]=n,t[17]=r,t[18]=a,t[19]=i,t[20]=y}else y=t[20];let b;t[25]===y?b=t[26]:(b=(0,G.jsx)(`div`,{className:`ovw-grid`,children:y}),t[25]=y,t[26]=b);let x;t[27]!==b||t[28]!==v?(x=(0,G.jsxs)(`div`,{className:`ovw-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":`Conversation overview`,ref:o,onClick:oa,children:[v,b]}),t[27]=b,t[28]=v,t[29]=x):x=t[29];let S;t[30]!==a||t[31]!==x||t[32]!==m?(S=(0,G.jsx)(`div`,{className:`ovw-scrim`,onClick:a,role:`button`,tabIndex:0,"aria-label":`Close conversation overview`,onKeyDown:m,children:x}),t[30]=a,t[31]=x,t[32]=m,t[33]=S):S=t[33];let C;return t[34]!==p||t[35]!==S?(C=(0,G.jsx)(Ae,{accent:p,children:S}),t[34]=p,t[35]=S,t[36]=C):C=t[36],C}function oa(e){return e.stopPropagation()}var sa=.1,ca=.04,la=new Set(`the.a.an.of.to.and.or.is.are.was.were.be.in.on.at.for.my.me.i.you.it.this.that.these.those.how.what.why.when.where.which.who.should.do.does.did.can.could.would.will.with.about.please.show.tell.give.make.get.see.want.need.from.by.as.so.if.then.your.our.their.his.her.its`.split(`.`));function ua(e){let t=new Set;for(let n of e.toLowerCase().split(/[^a-z0-9]+/))n.length>=2&&!la.has(n)&&t.add(n);return t}function da(e,t){if(e.size===0&&t.size===0)return 1;if(e.size===0||t.size===0)return 0;let n=0;for(let r of e)t.has(r)&&n++;return n/(e.size+t.size-n)}function fa(e,t){let n=e=>`${e.question} ${e.narration} ${e.title}`;return da(ua(n(e)),ua(n(t)))}function pa(e,t,n,r){if(!e)return`replace`;let i=fa(e,t);return r!==`small`&&(n===`augment`||n===`refine`)?i<ca?`replace`:n:r!==`small`&&n===`replace`||i<sa?`replace`:`augment`}function ma(e){let t=e.type??``,n=e.props,r=``;if(n&&typeof n==`object`){let e=n;for(let t of[`title`,`eyebrow`,`headline`,`head`,`label`,`name`]){let n=e[t];if(typeof n==`string`&&n.trim()){r=n.trim().toLowerCase();break}}}return`${t}:${r}`}function ha(e){return e.map((e,t)=>({...e,id:`live-${t+1}`}))}function ga(e,t,n){if(n===`replace`||e.length===0){let e=ha(t);return{blocks:e,firstNewId:e[0]?.id??null,overflow:!1}}if(n===`refine`){let n=new Map;e.forEach((e,t)=>n.set(ma(e),t));let r=[...e],i=[];for(let e of t){let t=n.get(ma(e));t===void 0?i.push(e):r[t]=e}let a=ha([...r,...i]);return{blocks:a,firstNewId:i.length?a[r.length]?.id??null:null,overflow:a.length>16}}let r=new Set(e.map(ma)),i=t.filter(e=>!r.has(ma(e))),a=ha([...e,...i]);return{blocks:a,firstNewId:i.length?a[e.length]?.id??null:null,overflow:a.length>16}}function _a(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 va(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)=>ga(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=_a(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 ya=140;function ba(e,t=ya){let n=e.trim().replace(/\s+/g,` `);if(!n)return``;let r=/^(.*?[.!?])(?:\s|$)/.exec(n)?.[1]??n;if(r.length<=t)return r;let i=r.slice(0,t+1),a=i.lastIndexOf(` `);return(a>0?i.slice(0,a):i.slice(0,t)).replace(/[,;:\s]+$/,``)+`…`}function xa(e,t=12,n){if(e.length===0)return[];let r=e.map((e,t)=>({top:e.top,h:e.height??84,i:t})).sort((e,t)=>e.top-t.top||e.i-t.i),i=Array(e.length).fill(0),a=-1/0,o=-1/0;for(let{top:e,h:n,i:s}of r){let r=Math.max(e,a);i[s]=r,a=r+n+t,o=r+n}if(n!==void 0&&o>n){let e=Math.min(o-n,Math.max(0,Math.min(...i)));if(e>0)for(let t=0;t<i.length;t++)i[t]-=e}return i}var Sa=`svg text, img, canvas, video, button, input, select, textarea, a`,Ca=`.ink-layer, .ink-connect-layer, .note-rail`,wa=600,Ta={left:-1e9,top:-1e9,width:2e9,height:2e9};function Ea(e){let t=[],n=e=>{e.width>0&&e.height>0&&t.length<wa&&t.push(e)},r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),i;for(;i=r.nextNode();){if(t.length>=wa)return[Ta];let e=i;if(!e.textContent?.trim()||e.parentElement?.closest(Ca))continue;let r=document.createRange();if(r.selectNodeContents(e),typeof r.getClientRects==`function`)for(let e of Array.from(r.getClientRects()))n(e)}for(let r of Array.from(e.querySelectorAll(Sa))){if(t.length>=wa)return[Ta];r.closest(Ca)||n(r.getBoundingClientRect())}return t}function Da(e,t,n=3){return e.left-n<t.left+t.width&&e.left+e.width+n>t.left&&e.top-n<t.top+t.height&&e.top+e.height+n>t.top}function Oa(e,t,n=3){for(let r of e)if(!t.some(e=>Da(r.box,e,n)))return r.place;return null}var ka=`percent|points?|seconds?|minutes?|min|hours?|hrs?|days?|weeks?|months?|mo|years?|yrs?|miles?|km|kg|lbs?|watts?`,Aa=`(?:[kKMGT]?(?:W|Wh|B|bps|Hz|V|A)|ms|km|mi|kg|lb|oz|ft|°[CF]?)`,ja=String.raw`\d(?:[\d,]*\d)?(?:\.\d+)?`,Ma=new RegExp(String.raw`(?<![\w.])(?:`+String.raw`[+\-−]?[$€£]\s?${ja}(?:\s?[–—-]\s?${ja})?(?:\s?(?:k|K|m|M|bn|B|T|million|billion|trillion)(?![A-Za-z]))?(?:\s?\/\s?[a-z]{1,5})?`+String.raw`|`+String.raw`${ja}\s?[–—-]\s?${ja}\s?(?:${Aa}|%)?`+String.raw`|`+String.raw`[+\-−]?${ja}\s?(?:%|×|x(?![A-Za-z0-9]))`+String.raw`|`+String.raw`${ja}${Aa}(?![A-Za-z0-9])`+String.raw`|`+String.raw`${ja}\s(?:${ka})\b`+String.raw`)`,`g`);function Na(e){let t=[],n=0;Ma.lastIndex=0;for(let r=Ma.exec(e);r;r=Ma.exec(e))r.index>n&&t.push({text:e.slice(n,r.index),accent:!1}),t.push({text:r[0],accent:!0}),n=r.index+r[0].length;return n<e.length&&t.push({text:e.slice(n),accent:!1}),t}function Pa(e){return Na(e).map((e,t)=>e.accent?(0,G.jsx)(`em`,{className:`hero-accent`,children:e.text},t):(0,G.jsx)(W.Fragment,{children:e.text},t))}function Fa(e){let t=Na(e).filter(e=>e.accent).map(e=>e.text.trim()),n=[],r=/\b[A-Z][\w+#.&-]*(?:\s+[A-Z][\w+#.&-]*)*/g;for(let t=r.exec(e);t;t=r.exec(e)){let r=e.slice(0,t.index).trimEnd();if((r===``||/[.!?…:—]$/.test(r)||/["“]$/.test(r))&&!t[0].includes(` `))continue;let i=t[0].replace(/[.,;:!?]+$/,``);i.length<3||n.push(i)}return{figures:t,labels:n}}function Ia(e){let t=``,n=[];for(let r=0;r<e.length;r++){let i=e[r];/[\s,\u00a0$€£¥₹₩₽+%°]/.test(i)||(t+=i.toLowerCase(),n.push(r))}return{norm:t,map:n}}var La=/[0-9.]/;function Ra(e){return e.length>0&&[...e].every(e=>La.test(e))}function za(e,t,n){let r=t>0?e[t-1]:``,i=t+n<e.length?e[t+n]:``;return La.test(r)||La.test(i)}function Ba(e,t){for(let n of t){let t=Ia(n).norm;if(t.length<2)continue;let r=Ra(t),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a;for(;a=i.nextNode();){let e=a,n=e.textContent??``;if(!n.trim()||e.parentElement?.closest(`.ink-layer, .block-ask, .card-eyebrow`))continue;let{norm:i,map:o}=Ia(n),s=i.indexOf(t);for(;s>=0;){if(!r||!za(i,s,t.length))return{node:e,start:o[s],end:o[s+t.length-1]+1};s=i.indexOf(t,s+1)}}}return null}function Va(e,t){let n=e.node.parentElement;for(let e=0;n&&n!==t&&e<4;e++,n=n.parentElement)if(n.matches(`li, tr, .bar-col, .cat-row, .kpi, [class*="-row"], [class*="-item"], [class*="-col"]`))return n;return null}function Ha(e){let t=document.createRange();if(t.setStart(e.node,e.start),t.setEnd(e.node,e.end),typeof t.getClientRects!=`function`)return null;let n=t.getClientRects(),r=n.length>0?n[0]:t.getBoundingClientRect();return r&&r.width>0&&r.height>0?r:null}function Ua(e){let t=document.createRange();return t.setStart(e.node,e.start),t.setEnd(e.node,e.end),typeof t.getClientRects==`function`?Array.from(t.getClientRects()).filter(e=>e.width>0&&e.height>0):[]}var Wa=100,Ga=18,Ka=2;function qa(e,t,n,r){let i=!1,a,o=0,s=null,c=0,l,u,d=e=>{!l&&typeof ResizeObserver<`u`&&(l=new ResizeObserver(()=>p()),l.observe(e)),u||(u=e,e.addEventListener(`transitionend`,p))},f=()=>{if(i)return;o++;let l=e();if(l){d(n(l));let e=t(l);if(c=e===s?c+1:1,s=e,r(l),c>=Ka)return}o>=Ga||(a=window.setTimeout(f,Wa))},p=()=>{i||(o=0,s=null,c=0,window.clearTimeout(a),a=window.setTimeout(f,Wa))};return a=window.setTimeout(f,Wa),window.addEventListener(`resize`,p),()=>{i=!0,window.clearTimeout(a),window.removeEventListener(`resize`,p),l?.disconnect(),u?.removeEventListener(`transitionend`,p)}}function Ja(e){for(let t=e.length-1;t>=0;t--){let n=e[t].getBoundingClientRect();if(n.width>0&&n.height>0)return e[t]}return e[e.length-1]??null}var Ya=12,Xa=e=>Math.ceil(Math.max(1,e.length)/26)*18+18,Za=218,Qa=18;function $a(e,t,n,r,i){let a=Math.min(n,r),o=Math.max(n,r);return e.some(e=>e!==t&&e.right>a&&e.left<o&&e.bottom>i-10&&e.top<i+10)}function eo(e,t){let n=(t??document).querySelector(`.card-grid.note-gutter`);if(!n)return null;let r=n.getBoundingClientRect();if(r.width<=0)return null;let i=parseFloat(getComputedStyle(n).paddingRight)||Za,a=i-Qa;if(a<=0)return null;let o=i-Qa,s=r.width-i+Qa,c=[],l=new Map;for(let e of Array.from(n.querySelectorAll(`[data-spot-id]`))){let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0)continue;let n={left:t.left-r.left,top:t.top-r.top,right:t.left-r.left+t.width,bottom:t.top-r.top+t.height};c.push(n),l.set(e,n)}let u=[];for(let t of e){let e=Ja(n.querySelectorAll(`[data-spot-id="${CSS.escape(t.spot)}"]`)),i=e?l.get(e):void 0;if(!i)continue;let a=i.top+Math.min(36,(i.bottom-i.top)/2),d=!$a(c,i,o,i.left,a),f=!$a(c,i,i.right,s,a),p=(i.left+i.right)/2<=r.width/2?`left`:`right`,m=d&&f?p:d?`left`:f?`right`:p,h=m===`left`?d:f;u.push({note:t,box:i,side:m,tethered:h})}if(!u.length)return null;let d=[];for(let e of[`left`,`right`]){let t=u.filter(t=>t.side===e);if(!t.length)continue;let n=xa(t.map(e=>({top:e.box.top+4,height:Xa(e.note.text)})),Ya,r.height-8);t.forEach((t,r)=>{let i=t.box.top+Math.min(36,(t.box.bottom-t.box.top)/2);d.push({...t.note,top:n[r],side:e,...t.tethered?{tether:e===`right`?je({x:s-6,y:n[r]+16},{x:t.box.right+3,y:i},t.note.spot):je({x:o+6,y:n[r]+16},{x:t.box.left-3,y:i},t.note.spot)}:{}})})}return{grid:n,railWidth:a,notes:d}}function to({notes:e,within:t,revision:n}){let[r,i]=(0,W.useState)(null),a=(0,W.useRef)(e);return a.current=e,(0,W.useEffect)(()=>qa(()=>eo(a.current,t),e=>e.notes.map(e=>`${e.spot}@${Math.round(e.top)}`).join(`|`)+`|${e.railWidth}`,e=>e.grid,i),[e.map(e=>`${e.spot}${e.text}`).join(``),t,n]),!r||r.notes.length===0?null:(0,Vn.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`svg`,{className:`note-rail-arrows`,"aria-hidden":`true`,children:r.notes.map((e,t)=>e.tether&&(0,G.jsxs)(`g`,{style:{"--note-delay":`${t*120}ms`},children:[(0,G.jsx)(`path`,{className:`note-tether`,d:e.tether.d,pathLength:1,fill:`none`}),(0,G.jsx)(`path`,{className:`note-tether note-tether-head`,d:e.tether.head,pathLength:1,fill:`none`})]},e.spot))}),[`left`,`right`].map(e=>{let t=r.notes.filter(t=>t.side===e);return t.length?(0,G.jsx)(`aside`,{className:`note-rail`+(e===`left`?` left`:``),role:`list`,"aria-label":`Mavéa's notes`,style:{width:r.railWidth},children:t.map((e,t)=>(0,G.jsx)(`div`,{role:`listitem`,className:`margin-note`,style:{top:e.top,"--note-delay":`${t*120}ms`},children:e.text},e.spot))},e):null})]}),r.grid)}var no=9;function ro(e){return e===`rising`||e===`falling`||e===`bracket`||e===`brace`}function io(e,t,n){let r={rect:e,kind:t.kind};if(ro(t.kind)&&t.to){let e=Ba(n,[t.to]),i=e&&Ha(e);i&&(r.toRect=i)}return(t.kind===`note`||t.kind===`bracket`||t.kind===`brace`)&&t.label&&(r.label=t.label),r}function ao(e,t,n,r=!1){if(n){let t=Ba(e,[n.at]);if(t){if(n.kind===`circle`){let n=Va(t,e)?.getBoundingClientRect(),r=e.getBoundingClientRect();if(n&&n.width>0&&n.width<=r.width*.6&&n.height<=r.height*.6&&n.width/Math.max(n.height,1)<=5)return{rect:n,kind:`circle`,el:t.node.parentElement??void 0}}let r=Ha(t);if(r){let i=io(r,n,e);if(i.el=t.node.parentElement??void 0,n.kind===`highlight`){let e=Ua(t);e.length>1&&(i.rects=e)}return i}}return null}if(!r)return null;let i=t?Fa(t):null;if(i?.figures.length){let t=Ba(e,i.figures),n=t&&Ha(t);if(n)return{rect:n,kind:`underline`,el:t?.node.parentElement??void 0}}let a=e.querySelector(`[data-mark]`),o=Ne(a?.getAttribute(`data-mark`));if(a&&o){let e=a.getBoundingClientRect();if(e.width>0)return{rect:e,kind:o,el:a}}if(i?.labels.length){let t=Ba(e,i.labels),n=t&&Ha(t);if(n)return{rect:n,kind:`underline`,el:t?.node.parentElement??void 0}}return null}function oo(e,t){let n=e;for(;n&&n!==t;){let e=getComputedStyle(n),t=n.scrollHeight>n.clientHeight+1&&/(auto|scroll|overlay)/.test(e.overflowY),r=n.scrollWidth>n.clientWidth+1&&/(auto|scroll|overlay)/.test(e.overflowX);if(t||r)return n;n=n.parentElement}return null}function so(e,t,n,r,i,a){let o=Ja((i??document).querySelectorAll(`[data-spot-id="${CSS.escape(e)}"]`));if(!o)return null;let s=ao(o,t,n,r);if(!s)return null;let c=o.getBoundingClientRect();if(c.width<=0||c.height<=0)return null;let l=s.el?oo(s.el,o):null,u=l??o;l&&getComputedStyle(l).position===`static`&&(l.style.position=`relative`);let d=l?(()=>{let e=l.getBoundingClientRect();return{left:e.left-l.scrollLeft,top:e.top-l.scrollTop}})():{left:c.left,top:c.top},f=l?{w:l.scrollWidth,h:l.scrollHeight}:{w:c.width,h:c.height},p=e=>({left:e.left-d.left,top:e.top-d.top,width:e.width,height:e.height}),m=p(s.rect),h={left:0,top:0,width:f.w,height:f.h},g={...s.toRect?{to:p(s.toRect)}:{},...s.label?{label:s.label}:{},...s.rects?.length?{rects:s.rects.map(p)}:{}},_=null,v=()=>_??=Ea(u).map(p);if(s.kind===`note`||s.kind===`question`||(s.kind===`bracket`||s.kind===`brace`)&&g.label){let e=s.kind===`question`?`?`:g.label??``,t=Oa(Me(s.kind,m,h,e,g.to),v());if(t)g.place=t;else if(s.kind===`note`||s.kind===`question`)return null;else delete g.label}if(s.kind===`underline`||s.kind===`circle`){let e={left:m.left,top:m.top+m.height+2,width:m.width,height:9};v().some(t=>Da(e,t,0))&&(g.tight=!0)}let y=U(s.kind,m,h,e,g);if(!y)return null;let b;if(a){let e=(e,t,n)=>Math.min(Math.max(e,t),n);b=[{x:m.left-no-2,y:m.top-no-2},{x:m.left-no-4,y:m.top+m.height/2},{x:m.left+m.width+no+3,y:m.top-no-2},{x:m.left-no-2,y:m.top+m.height+no+3}].map(t=>({x:e(t.x,10,h.width-no-1),y:e(t.y,10,h.height-no-1)})).find(e=>!v().some(t=>Da({left:e.x-no,top:e.y-no,width:no*2,height:no*2},t,2)))}return{host:o,container:u,stroke:y,anchor:m,view:{w:f.w,h:f.h},...b?{chip:b}:{}}}var co=2400;function lo({spot:e,line:t,mark:n,generous:r,within:i,delayMs:a,badgeMs:o,revision:s,stepNumber:c}){let[l,u]=(0,W.useState)(null);if((0,W.useEffect)(()=>qa(()=>so(e,t,n,r,i,typeof c==`number`),e=>e.stroke.d,e=>e.host,u),[e,t,n,r,i,s,c]),(0,W.useEffect)(()=>{if(!l)return;let{host:e}=l,t=o??2400;e.style.setProperty(`--ink-badge-dur`,`${t/1e3}s`),e.dataset.inking=n?.color===`key`?`key`:n?.color===`cool`?`cool`:``;let r=window.setTimeout(()=>{delete e.dataset.inking,e.style.removeProperty(`--ink-badge-dur`)},t);return()=>{window.clearTimeout(r),delete e.dataset.inking,e.style.removeProperty(`--ink-badge-dur`)}},[l,n?.color,o]),!l||!l.container.isConnected)return null;let{host:d,container:f,stroke:p,view:m,chip:h}=l,g=n?.color&&n.color!==`warm`?n.color:void 0,_=f!==d;return(0,Vn.createPortal)((0,G.jsxs)(`svg`,{className:`ink-layer`,"aria-hidden":`true`,style:{...a?{"--ink-delay":`${a}ms`}:{},..._?{inset:`auto`,top:0,left:0,width:`${Math.max(1,Math.round(m.w))}px`,height:`${Math.max(1,Math.round(m.h))}px`}:{}},viewBox:`0 0 ${Math.max(1,Math.round(m.w))} ${Math.max(1,Math.round(m.h))}`,preserveAspectRatio:`none`,children:[p.fill?(0,G.jsx)(`path`,{className:`ink-fill`,d:p.d,...g?{"data-color":g}:{}}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`path`,{className:`ink-halo`,d:p.d,pathLength:1,...g?{"data-color":g}:{}}),(0,G.jsx)(`path`,{className:`ink-stroke`,d:p.d,pathLength:1,...g?{"data-color":g}:{}}),p.head&&(0,G.jsx)(`path`,{className:`ink-stroke ink-head`,d:p.head,pathLength:1,...g?{"data-color":g}:{}})]}),p.label&&(0,G.jsx)(`text`,{className:`ink-note`+(p.kind===`question`?` ink-glyph`:``),x:p.label.x,y:p.label.y,textAnchor:p.label.anchor,...p.label.size?{fontSize:p.label.size}:{},...g?{"data-color":g}:{},children:p.label.text.split(`
|
|
3
|
+
`).map((e,t)=>(0,G.jsx)(`tspan`,{x:p.label.x,dy:t===0?0:`1.25em`,children:e},t))}),typeof c==`number`&&h&&(0,G.jsxs)(`g`,{"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{className:`ink-step-dot`,cx:h.x,cy:h.y,r:8,...g?{"data-color":g}:{}}),(0,G.jsx)(`text`,{className:`ink-step-num`,x:h.x,y:h.y,textAnchor:`middle`,dominantBaseline:`middle`,children:c})]})]}),f)}function uo(e,t,n,r){let i=r??document,a=i.querySelector(`.card-grid`);if(!a)return null;let o=Ja(i.querySelectorAll(`[data-spot-id="${CSS.escape(e)}"]`)),s=Ja(i.querySelectorAll(`[data-spot-id="${CSS.escape(t)}"]`));if(!o||!s||o===s)return null;let c=Ba(o,[n.at]),l=c&&Ha(c),u=n.to?Ba(s,[n.to]):null,d=u&&Ha(u);if(!l||!d)return null;let f=U(`connect`,l,a.getBoundingClientRect(),`${e}>${t}`,{to:d});return f?{grid:a,stroke:f}:null}function fo(e){let t=(0,q.c)(34),{spot:n,toSpot:r,mark:i,within:a,delayMs:o,revision:s}=e,[c,l]=(0,W.useState)(null),u;t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==a?(u=()=>qa(()=>uo(n,r,i,a),mo,po,l),t[0]=i,t[1]=n,t[2]=r,t[3]=a,t[4]=u):u=t[4];let d;if(t[5]!==i||t[6]!==s||t[7]!==n||t[8]!==r||t[9]!==a?(d=[n,r,i,a,s],t[5]=i,t[6]=s,t[7]=n,t[8]=r,t[9]=a,t[10]=d):d=t[10],(0,W.useEffect)(u,d),!c||!c.grid.isConnected)return null;let{grid:f,stroke:p}=c,m=i.color&&i.color!==`warm`?i.color:void 0,h;t[11]===o?h=t[12]:(h=o?{"--ink-delay":`${o}ms`}:void 0,t[11]=o,t[12]=h);let g=h,_;t[13]===m?_=t[14]:(_=m?{"data-color":m}:{},t[13]=m,t[14]=_);let v;t[15]!==p.d||t[16]!==_?(v=(0,G.jsx)(`path`,{className:`ink-halo`,d:p.d,pathLength:1,..._}),t[15]=p.d,t[16]=_,t[17]=v):v=t[17];let y;t[18]===m?y=t[19]:(y=m?{"data-color":m}:{},t[18]=m,t[19]=y);let b;t[20]!==p.d||t[21]!==y?(b=(0,G.jsx)(`path`,{className:`ink-stroke`,d:p.d,pathLength:1,...y}),t[20]=p.d,t[21]=y,t[22]=b):b=t[22];let x;t[23]!==m||t[24]!==p.head?(x=p.head&&(0,G.jsx)(`path`,{className:`ink-stroke ink-head`,d:p.head,pathLength:1,...m?{"data-color":m}:{}}),t[23]=m,t[24]=p.head,t[25]=x):x=t[25];let S;t[26]!==g||t[27]!==v||t[28]!==b||t[29]!==x?(S=(0,G.jsxs)(`svg`,{className:`ink-connect-layer`,"aria-hidden":`true`,style:g,children:[v,b,x]}),t[26]=g,t[27]=v,t[28]=b,t[29]=x,t[30]=S):S=t[30];let C;return t[31]!==f||t[32]!==S?(C=(0,Vn.createPortal)(S,f),t[31]=f,t[32]=S,t[33]=C):C=t[33],C}function po(e){return e.grid}function mo(e){return e.stroke.d}function ho(e){let t=(0,q.c)(11),{spots:n,within:r,revision:i}=e;if(n.length===0)return null;let a,o;if(t[0]!==i||t[1]!==n||t[2]!==r){let e=n.filter(vo),s=n.filter(_o);a=e.length>0&&(0,G.jsx)(to,{notes:e.map(go),within:r,revision:i});let c;t[5]!==i||t[6]!==r?(c=(e,t)=>{let n=`${e.spot}|${e.mark?.kind??``}|${e.mark?.at??t}`;return e.mark?.kind===`connect`&&e.toSpot?(0,G.jsx)(fo,{spot:e.spot,toSpot:e.toSpot,mark:e.mark,within:r,delayMs:e.delayMs,revision:i},n):(0,G.jsx)(lo,{spot:e.spot,line:e.line,mark:e.mark,generous:e.generous,within:r,delayMs:e.delayMs,badgeMs:e.badgeMs,revision:i,stepNumber:e.stepNumber},n)},t[5]=i,t[6]=r,t[7]=c):c=t[7],o=s.map(c),t[0]=i,t[1]=n,t[2]=r,t[3]=a,t[4]=o}else a=t[3],o=t[4];let s;return t[8]!==a||t[9]!==o?(s=(0,G.jsxs)(G.Fragment,{children:[a,o]}),t[8]=a,t[9]=o,t[10]=s):s=t[10],s}function go(e){return{spot:e.spot,text:e.noteText}}function _o(e){return!e.noteText}function vo(e){return e.noteText}var yo=240;function bo(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=ba(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*yo,badgeMs:r?co+(u.length-1)*yo:void 0,stepNumber:e?t+1:void 0}),c++}}else a&&(s.push({spot:n,line:l,generous:!0,delayMs:c*yo}),c++)}return s}var xo=1100,So=1700;function Co(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 Pi(n),c=s();if(c){o(c);return}r.setIndex(e),a?await Fi(n,So,xo):await Ni(So)}else r.setIndex(e),await Ni(So)}o(s()??`complete`)})()}function wo(e,t,n){if(e.length===0)return e;let r=new Map;n.forEach((e,t)=>{let n=ma(e),i=r.get(n);i?i.push(t):r.set(n,[t])});let i=new Map;n.forEach((e,t)=>{let n=ma(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(ma(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(ma(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 To(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=i?.forceReplace?`replace`:pa(e,a,r.continuity,r.tier),s=ga(t,r.spec.blocks,o);o!==`replace`&&s.overflow&&(o=`replace`,s=ga(t,r.spec.blocks,`replace`));let c={...r.spec,blocks:s.blocks};o!==`replace`&&delete c.bend;let l=o===`replace`?s.blocks.find(e=>e.id)?.id??null:s.firstNewId,u=wo(r.tour??[],r.spec.blocks,s.blocks);return{frame:{question:n,narration:r.narration,...r.spoken?{spoken:r.spoken}:{},mode:o,tour:u,spec:c,at:Date.now(),...r.corrects?{corrects:r.corrects}:{}},mode:o,spot:l,snap:a}}var Eo={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`},Do=3,Oo=140;function ko(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Ao(e){let t=e.trim().replace(/\s+/g,` `);if(!t||t.length>Oo||t.includes(`?`))return``;let n=t.toLowerCase(),r;if(r=t.match(/^i(?:'m| am)\s+(an?\s+.+)/i))return jo(`Is ${r[1]}`);if(r=t.match(/^i(?:'m| am)\s+(.+)/i))return jo(r[1]);if(r=t.match(/^i(?:'ve| have)\s+(?:got\s+)?(.+)/i))return jo(`Has ${r[1]}`);if(r=t.match(/^my\s+(.+?)\s+(is|are)\s+(.+)/i))return jo(`${r[1]} ${r[2]} ${r[3]}`);if(r=n.match(/^i\s+(\w+)\s+(.+)/)){let e=Eo[r[1]];if(e)return jo(`${e} ${t.slice(t.toLowerCase().indexOf(r[2]))}`)}return``}function jo(e){let t=ko(e.trim().replace(/\s+/g,` `));return t.length>=6&&t.length<=Oo?t:``}function Mo(e){if(!e)return[];let t=e.split(/[.!?\n]+|,?\s+\band\b\s+/i),n=[];for(let e of t){let t=Ao(e);if(t&&!n.includes(t)&&n.push(t),n.length>=Do)break}return n}var No=.6,Po=.5;function Fo(e){return(e.match(/\d[\d,.]*\d|\d/g)??[]).map(e=>e.replace(/,/g,``).replace(/\.+$/,``))}function Io(e,t){let n=Fo(e);if(!n.length)return!1;let r=new Set(Fo(t));return n.some(e=>!r.has(e))}function Lo(e,t,n={}){if(!Io(e,t)){let n=lt(e),r=lt(t);if(n.size>0&&ut(n,r)>=No)return`user-stated`}return n.webGrounded?`web-grounded`:`model-inferred`}function Ro(e,t){let n=Fo(e),r=new Set(Fo(t));if(n.length)return n.every(e=>r.has(e))?`user-stated`:`model-inferred`;let i=lt(e);return i.size>0&&ut(i,lt(t))>=Po?`user-stated`:`model-inferred`}var zo=24;function Bo(e,t=`item`){let n=e.toLowerCase().match(/[a-z][a-z0-9]*/g);return(n&&n[0]?n[0]:t).slice(0,zo)}function Vo(e,t={}){return{concept:`corrections.${Bo(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}}u();var Ho=()=>M(()=>import(`./generateLive-D4B30fnF.js`),__vite__mapDeps([7,8,9,10,2,1,3,4,5,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])),Uo=50,Wo=2;function Go(e,t){let n=t?.searchMode??(t?.webSearch?`free`:`off`),r=t?.quality??``,i=t?.explainLevel??`standard`,a=+!!t?.generativeBlocks,o=+!!t?.memoryEnabled;return`${e.provider}::${e.model}::${n}::${r}::${i}::${a}::${o}`}var Ko={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 qo(e,t){return e?.find(e=>!(e.key in t))?.key??null}function Jo(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?qo(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={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`fill`:{let n={...e.filled,[t.value.key]:t.value};return{...e,filled:n,activeBlank:qo(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{...Ko};default:return e}}function Yo(e){let t=e.frames[e.frames.length-1];return{...Ko,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)}}}function Xo(e){let{canRun:t,getConfig:n,getCaps:r,speak:i,cancelSpeak:a,getLibraryEnabled:o}=e,[s,c]=(0,W.useReducer)(Jo,e.initial??Ko),l=(0,W.useRef)(!1);l.current=s.busy;let u=(0,W.useRef)(s.history);u.current=s.history;let d=(0,W.useRef)(null),f=(0,W.useRef)(null),p=(0,W.useRef)(s.spec);p.current=s.spec;let m=(0,W.useRef)(s.prior);m.current=s.prior;let h=(0,W.useRef)(s.filled);h.current=s.filled;let g=(0,W.useRef)(new Map),_=(0,W.useRef)(new Map),v=(0,W.useRef)([]),y=(0,W.useRef)(new Set),b=(0,W.useRef)(s.turn);b.current=s.turn;let x=(0,W.useCallback)(async(e,s,h,x,S,C,w,T)=>{if(t&&!t())return;let E=e.trim();if(!E&&!s?.length||l.current&&!T?.force)return;let D=E||`What can you tell me about the attached file?`,O=C?.trim()||D;a?.();let k=T?.freshStart?null:p.current;d.current?.abort(),f.current?.(),f.current=null;let A=new AbortController;d.current=A;for(let e of v.current)e.abort();v.current=[];let j=!!(s?.length||h?.length||x&&Object.keys(x).length||S?.length),M=Go(n(),r?.()),N=j?null:g.current.get(`${D}::${M}`)??null;g.current.clear(),c({type:`start`,fresh:T?.freshStart});let P=T?.freshStart?[]:u.current,F=T?.freshStart?null:m.current,I=pa(F,{question:D,narration:``,title:``,blockTypes:[]},void 0,`mid`)===`replace`,L=`${D}::${P.length}::${M}`,ee=j?null:_.current.get(L)??null,R,z=!1;if(N??ee){let e=N??ee;e.narration&&(c({type:`speak`,narration:e.narration}),i?.(e.spoken||e.narration)),R=e}else{let e=``,t=0,a=!1,o=bt(_t(D)),l=0,u;try{u=await Ho()}catch{if(A.signal.aborted)return;c({type:`error`,error:{kind:`network`,message:`Mavéa couldn't finish loading. Check your connection and try again.`,question:O,retry:D}});return}let{generateLive:d}=u;if(R=await d(D,P,n(),n=>{if(A.signal.aborted)return;e+=n;let r=Ue(e);if(!r)return;let{chunk:s,consumed:u}=We(r.text,t,r.done);s&&(t=u,a=!0,c({type:`speak`,narration:ne(te(r.text.slice(0,u)))}),!(l>=o)&&(l+=s.length,i?.(s)))},{caps:r?.(),signal:A.signal,onActivity:e=>{A.signal.aborted||c({type:`activity`,activity:e})},recentTypes:[...y.current],rotation:b.current,attachments:s,selectedBlocks:h,filledBlanks:x,inkIntents:S,priorTopic:F?.title||void 0,lesson:T?.lesson,onPartial:I?e=>{A.signal.aborted||(z=!0,ye(e.spec.blocks),c({type:`stream`,spec:e.spec}))}:void 0,onSources:e=>{A.signal.aborted||c({type:`sources`,sources:e})},onPending:I?e=>{A.signal.aborted||c({type:`pending`,pending:e})}:void 0,onThinking:e=>{A.signal.aborted||c({type:`thinking`,on:e})}}),A.signal.aborted)return;if(!a&&R.narration&&(c({type:`speak`,narration:R.narration}),i?.(R.spoken||R.narration)),!R.error&&R.spec.blocks.length>0&&(_.current.set(L,R),_.current.size>Uo)){let e=_.current.keys().next().value;e!==void 0&&_.current.delete(e)}}if(R.error){c({type:`error`,error:{...R.error,question:O,retry:D}});return}let re=h?.length?`${O} (about: ${h.map(we).join(`, `)})`:O,ie=[...P,{role:`user`,content:re},{role:`assistant`,content:R.narration||R.spec.title}],B,ae,oe;try{let e=To(F,T?.freshStart?[]:p.current?.blocks??[],O,R,{forceReplace:I});B=e.mode,ae=e.frame.spec;let t=e.snap;oe=w?{...e.frame,mind:w}:e.frame,ye(ae.blocks),c({type:`show`,spec:ae,narration:R.narration,history:ie,mode:B,spot:e.spot,prior:t,tour:oe.tour,priorSpec:k,streamed:z,frame:oe,understood:R.understood??[],freshTimeline:T?.freshStart});for(let e of t.blockTypes)y.current.add(e)}catch{c({type:`error`,error:{kind:`http`,message:`Something went wrong putting that answer together — let's try again.`,question:O,retry:D}});return}if(r?.().memoryEnabled&&pt(D))try{let e=String(oe.at),t=O.slice(0,200),n=(ae.sources?.length??0)>0,r=R.memory??[];if(r.length)St(r.map(r=>({...r,source:Lo(r.body,O,{webGrounded:n}),turnId:e,quote:t})));else{let n=Mo(O);n.length&&St([{concept:`profile`,body:n.join(`. `),source:`user-stated`,turnId:e,quote:t}])}if(R.corrects){let t=Ro(R.corrects.now,O);St([Vo(R.corrects,{turnId:e,source:t})])}}catch{}B===`replace`&&o?.()&&Xt(ae,O);let se=n(),ce=r?.();if(ce?.quality===`thorough`){let e=ae.suggests??[],t=[...y.current],n=Go(se,ce);e.slice(0,Wo).forEach((e,r)=>{let i=new AbortController;v.current.push(i),Ho().then(({generateLive:n})=>n(e.label,ie,se,void 0,{caps:ce,signal:i.signal,repair:!1,recentTypes:t,rotation:b.current+1+r})).then(t=>{!i.signal.aborted&&!t.error&&g.current.set(`${e.label}::${n}`,t)}).catch(()=>{})})}},[t,n,r,i,a,o]),S=(0,W.useCallback)(()=>{d.current?.abort(),d.current=null,f.current?.(),f.current=null;for(let e of v.current)e.abort();v.current=[],g.current.clear(),_.current.clear(),y.current.clear(),c({type:`reset`})},[]),C=(0,W.useCallback)(e=>c({type:`spot`,spot:e}),[]),w=(0,W.useCallback)(e=>c({type:`jump`,index:e}),[]),T=(0,W.useCallback)(e=>{e&&ye(e.blocks),c({type:`preview`,spec:e})},[]),E=(0,W.useCallback)(e=>c({type:`fill`,value:e}),[]),D=(0,W.useCallback)(e=>c({type:`unfill`,key:e}),[]),O=(0,W.useCallback)(e=>c({type:`setActiveBlank`,key:e}),[]),k=(0,W.useCallback)(()=>{let e=p.current,t=h.current;return!e||!Object.keys(t).length||l.current?!1:(x(`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)},[x]),A=(0,W.useCallback)((e,t)=>{a?.(),ye(e.blocks),c({type:`restore`,spec:e,question:t,at:Date.now()})},[a]),j=(0,W.useCallback)((e,t,n)=>{ye(e.spec.blocks),n?.interrupt!==!1&&a?.();let r=ce();c({type:`start`,fresh:!1}),c({type:`speak`,narration:e.narration});let o=i?.(e.spoken??e.narration),s=[...u.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=p.current,m=e.spec.blocks.find(e=>e.id)?.id??null;f.current?.();let h=!1;f.current=()=>{h=!0};let g=()=>{h||(f.current=null,c({type:`show`,spec:e.spec,narration:e.narration,understood:[],history:s,mode:e.mode,prior:l,tour:e.tour,spot:m,frame:e,priorSpec:d,streamed:!1,freshTimeline:!1}))};n?.revealNow?g():r?window.setTimeout(g,480):Ge(o?o.started:Promise.resolve(!1),ji).then(g)},[a,i]),M=s.viewOverride?s.viewOverride:s.viewIndex==null?s.spec:s.frames[s.viewIndex]?.spec??s.spec;return(0,W.useEffect)(()=>()=>{d.current?.abort(),f.current?.();for(let e of v.current)e.abort()},[]),{...s,run:x,reset:S,setSpot:C,restore:A,jumpTo:w,previewSpec:T,fill:E,unfill:D,setActiveBlank:O,complete:k,showFrame:j,viewSpec:M}}function Zo(e){return e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`}function X(e){return`${Zo(e)}. What can I help you explore?`}var Z=`mavea-live-setup-v1`;function Qo(){try{return localStorage.getItem(Z)===`1`}catch{return!1}}function $o(){try{localStorage.setItem(Z,`1`)}catch{}}function es(){try{localStorage.removeItem(Z)}catch{}}var ts=[{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.`}],ns=`I’m awake.`,rs=`Set and ready, start talking, or try one of these.`,is=ts.map(e=>e.id);function as(e){let t=is.indexOf(e);return t>=0&&t<is.length-1?is[t+1]:null}function os(e){return ts.find(t=>t.id===e)??ts[0]}function ss(e){let t=(0,q.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)+ts.length)%ts.length;o.current[n]?.focus(),i(ts[n].id)};u=`constellation`,d=`Setup steps`,s=`const-track`,c=`tablist`,l=ts.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)(z.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 cs(e){let t=(0,q.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 ls(e){let t=(0,q.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 us(e){let t=(0,q.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(ds),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)(z.eyeOff,{}):(0,G.jsx)(z.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 ds(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`}},ps={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.`},ms={anthropic:`sk-ant-…`,openai:`sk-…`,gemini:`AIza…`,grok:`xai-…`,openrouter:`sk-or-…`};function hs(e){return e.split(` · `)[1]??e}function gs(){let e=(0,q.c)(51),t=(0,W.useId)(),[n]=qt(),r=Ze(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 yt(Ht(Ut()),{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 ${hs(r.label)} when used.`:``,v;e[1]===n.provider?v=e[2]:(v=Qe.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:()=>Wt({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)(`span`,{className:`field-head`,children:(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Model`})}),e[5]=b):b=e[5];let x;e[6]===n.provider?x=e[7]:(x=e=>Kt(n.provider,`model`,e),e[6]=n.provider,e[7]=x);let S;e[8]!==n.provider||e[9]!==i||e[10]!==x?(S=(0,G.jsx)(tn,{provider:n.provider,value:i,onChange:x},n.provider),e[8]=n.provider,e[9]=i,e[10]=x,e[11]=S):S=e[11];let C;e[12]!==r.modelNotes||e[13]!==a?(C=r.modelNotes?.[a]&&(0,G.jsx)(`span`,{className:`field-helper`,children:r.modelNotes[a]}),e[12]=r.modelNotes,e[13]=a,e[14]=C):C=e[14];let w=ps[r.search],T;e[15]===w?T=e[16]:(T=(0,G.jsx)(`span`,{className:`field-helper`,children:w}),e[15]=w,e[16]=T);let E;e[17]!==S||e[18]!==C||e[19]!==T?(E=(0,G.jsxs)(`div`,{className:`field-col`,children:[b,S,C,T]}),e[17]=S,e[18]=C,e[19]=T,e[20]=E):E=e[20];let D;e[21]!==n.provider||e[22]!==r.keyUrl||e[23]!==r.needsKey||e[24]!==o||e[25]!==t?(D=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)(us,{id:t,value:o,onChange:e=>Kt(n.provider,`key`,e),placeholder:ms[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[21]=n.provider,e[22]=r.keyUrl,e[23]=r.needsKey,e[24]=o,e[25]=t,e[26]=D):D=e[26];let O;e[27]!==D||e[28]!==E?(O=(0,G.jsxs)(`div`,{className:`field-grid`,children:[E,D]}),e[27]=D,e[28]=E,e[29]=O):O=e[29];let k=`status-strip `+h,A;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,G.jsx)(`span`,{className:`status-strip-dot`,"aria-hidden":!0}),e[30]=A):A=e[30];let j;e[31]===g?j=e[32]:(j=(0,G.jsx)(`strong`,{children:g}),e[31]=g,e[32]=j);let M=_&&` `+_,N;e[33]!==j||e[34]!==M?(N=(0,G.jsxs)(`span`,{className:`status-strip-text`,children:[j,M]}),e[33]=j,e[34]=M,e[35]=N):N=e[35];let P;e[36]===p?P=e[37]:(P=(0,G.jsx)(`button`,{type:`button`,className:`status-strip-test`,onClick:()=>void p(),title:`Re-check the connection`,children:`Test`}),e[36]=p,e[37]=P);let F;e[38]!==k||e[39]!==N||e[40]!==P?(F=(0,G.jsxs)(`div`,{className:k,children:[A,N,P]}),e[38]=k,e[39]=N,e[40]=P,e[41]=F):F=e[41];let I;e[42]!==n.rememberKey||e[43]!==r.needsKey?(I=r.needsKey&&(0,G.jsx)(cs,{label:`Remember this key on this device`,on:n.rememberKey,onToggle:()=>Wt({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[42]=n.rememberKey,e[43]=r.needsKey,e[44]=I):I=e[44];let L;e[45]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,G.jsx)(en,{}),e[45]=L):L=e[45];let ee;return e[46]!==O||e[47]!==F||e[48]!==I||e[49]!==y?(ee=(0,G.jsxs)(`div`,{className:`step-body`,children:[y,O,F,I,L]}),e[46]=O,e[47]=F,e[48]=I,e[49]=y,e[50]=ee):ee=e[50],ee}function _s(){let e=(0,q.c)(19),[t]=qt(),n=Re(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)(ls,{ariaLabel:`Web search`,value:t.searchMode,onPick:ys,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)(ls,{ariaLabel:`Answer quality`,value:t.quality,onPick:vs,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 vs(e){return Wt({quality:e})}function ys(e){return Wt({searchMode:e})}function bs(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function xs(e){let t=de(e);if(t){oe(`mavea`,t.kokoro);try{localStorage.setItem(me,e)}catch{}}}function Ss(e){let t=(0,q.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),xs(e);let t=de(e);t&&rn(t)},t[2]=i,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=se.map(Cs),t[4]=s):s=t[4];let c;t[5]!==n||t[6]!==o||t[7]!==r?(c=(0,G.jsx)(un,{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=de(r);e&&rn(e)},t[9]=r,t[10]=l);let u;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(z.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 Cs(e){return{value:e.id,label:e.label,note:e.tone}}function ws(){let e=(0,q.c)(16),[t]=qt(),n=ln(),[r,i]=(0,W.useState)(Ds),a;e[0]===t.memoryEnabled?a=e[1]:(a=()=>Wt({memoryEnabled:!t.memoryEnabled}),e[0]=t.memoryEnabled,e[1]=a);let o;e[2]!==t.memoryEnabled||e[3]!==a?(o=(0,G.jsx)(cs,{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:Es,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(Ts)})]}),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)(Ss,{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)(sn,{}),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 Ts(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:()=>xt(e.id),"aria-label":`Forget: ${e.concept}`,title:`Forget this`,children:(0,G.jsx)(z.x,{})})]},e.id)}function Es(){return ft()}function Ds(){return bs(me,pe)}var Os=[{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 ks({onStart:e}){return(0,G.jsx)(`div`,{className:`starter-grid`,role:`list`,children:Os.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 As(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function js(e,t){return de(As(e,t))?.label??`Voice`}var Ms={fast:`Fast — snappy & cheap`,balanced:`Balanced — the default`,thorough:`Thorough — deeper thinking`};function Ns(e){let t=(0,q.c)(54),{onJump:n,onStart:r,onStartTalking:i,onStartOver:a,onSeeHow:o,studySlot:s,librarySlot:c}=e,[l]=qt(),u=ln(),d=$t(),f,p;if(t[0]!==l.models||t[1]!==l.provider){let e=Ze(l.provider);f=l.models[l.provider]||e.defaultModel,p=e.label.split(` · `)[1]??(e.needsKey?e.label:`Local`),t[0]=l.models,t[1]=l.provider,t[2]=f,t[3]=p}else f=t[2],p=t[3];let m=p,h;t[4]===l?h=t[5]:(h=Gt(l),t[4]=l,t[5]=h);let g=h,_=l.searchMode===`off`?`Off`:`Real-time`,v=l.memoryEnabled?`${u.length} ${u.length===1?`concept`:`concepts`} · this device only`:`Off`,y=`${f} · ${m}`,b;t[6]===y?b=t[7]:(b={key:`model`,label:`Model`,value:y,step:`connect`},t[6]=y,t[7]=b);let x;t[8]===_?x=t[9]:(x={key:`search`,label:`Web search`,value:_,step:`think`},t[8]=_,t[9]=x);let S=Ms[l.quality]??l.quality,C;t[10]===S?C=t[11]:(C={key:`quality`,label:`Quality`,value:S,step:`think`},t[10]=S,t[11]=C);let w;t[12]===v?w=t[13]:(w={key:`memory`,label:`Memory`,value:v,step:`remember`},t[12]=v,t[13]=w);let T;t[14]===d?T=t[15]:(T=d===!1?`Off — captions only (voice needs the local TTS service)`:js(me,pe),t[14]=d,t[15]=T);let E;t[16]===T?E=t[17]:(E={key:`voice`,label:`Voice`,value:T,step:`remember`},t[16]=T,t[17]=E);let D;t[18]!==E||t[19]!==b||t[20]!==x||t[21]!==C||t[22]!==w?(D=[b,x,C,w,E],t[18]=E,t[19]=b,t[20]=x,t[21]=C,t[22]=w,t[23]=D):D=t[23];let O=D,k;t[24]!==n||t[25]!==O?(k=(0,G.jsx)(`ul`,{className:`checklist`,children:O.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)(z.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]=O,t[26]=k):k=t[26];let A;t[27]!==g||t[28]!==n||t[29]!==i?(A=g?(0,G.jsxs)(`button`,{type:`button`,className:`go-start`,onClick:i,children:[(0,G.jsx)(z.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)(z.mic,{}),` Connect a model to start`]}),t[27]=g,t[28]=n,t[29]=i,t[30]=A):A=t[30];let j;t[31]===a?j=t[32]:(j=(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]=j);let M;t[33]!==k||t[34]!==A||t[35]!==j?(M=(0,G.jsxs)(`div`,{className:`go-left`,children:[k,A,j]}),t[33]=k,t[34]=A,t[35]=j,t[36]=M):M=t[36];let N;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,G.jsx)(`span`,{className:`card-eyebrow`,children:`Or start with one`}),t[37]=N):N=t[37];let P;t[38]===o?P=t[39]:(P=o&&(0,G.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:o,children:`See how it works`}),t[38]=o,t[39]=P);let F;t[40]===P?F=t[41]:(F=(0,G.jsxs)(`div`,{className:`try-head`,children:[N,P]}),t[40]=P,t[41]=F);let I;t[42]===r?I=t[43]:(I=(0,G.jsx)(ks,{onStart:r}),t[42]=r,t[43]=I);let L;t[44]!==F||t[45]!==I?(L=(0,G.jsxs)(`div`,{className:`go-right`,children:[F,I]}),t[44]=F,t[45]=I,t[46]=L):L=t[46];let ee;t[47]===c?ee=t[48]:(ee=c&&(0,G.jsx)(`div`,{className:`go-library`,children:c}),t[47]=c,t[48]=ee);let R;return t[49]!==s||t[50]!==M||t[51]!==L||t[52]!==ee?(R=(0,G.jsxs)(`div`,{className:`step-body go-grid`,children:[M,L,s,ee]}),t[49]=s,t[50]=M,t[51]=L,t[52]=ee,t[53]=R):R=t[53],R}function Ps({speak:e,goDemo:t,onStart:n,onStartTalking:r,onSeeHow:i,studySlot:a,librarySlot:o,seed:s}){let c=(0,W.useRef)(!Qo()),l=(0,W.useRef)(!1),[u,d]=(0,W.useState)(c.current?`connect`:`go`),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(``),g=(0,W.useRef)(s??``),[_,v]=(0,W.useState)(!c.current),y=!c.current||_;(0,W.useEffect)(()=>{if(u!==`go`)return;v(!0),c.current&&$o();let t=g.current;if(t){g.current=``,n(t);return}l.current||(l.current=!0,e(c.current?`I’m awake.`:X(new Date().getHours())))},[u,e,n]),(0,W.useEffect)(()=>{let e=document.documentElement;return e.dataset.wizardStep=u,()=>{delete e.dataset.wizardStep}},[u]);let b=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=b.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`)}},[u]);let x=e=>{p(y&&e!==`go`),d(e),e!==`go`&&h(``)},S=()=>{x(f?`go`:as(u)??`go`)},C=()=>{(typeof window>`u`||window.confirm(`Start over? This clears your saved setup and replays the intro.`))&&(Bt(),es(),rt(),c.current=!0,l.current=!1,v(!1),p(!1),d(`connect`))},w=ts.findIndex(e=>e.id===u),T=new Set(ts.filter((e,t)=>y?e.id!==u:t<w).map(e=>e.id)),E=os(u),D=u===`go`,O=D&&c.current?ns:E.title,k=D&&c.current?rs:E.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)(ss,{current:u,done:T,onPick:x}),(0,G.jsx)(At,{triggerClassName:`setup-icon-btn`})]}),(0,G.jsxs)(`div`,{className:`setup-stage`,ref:b,children:[(0,G.jsxs)(`div`,{className:`setup-head`,children:[(0,G.jsx)(`h1`,{className:`setup-q`,children:O}),(0,G.jsx)(`p`,{className:`setup-sub`,children:k})]}),(0,G.jsxs)(`section`,{className:`card reveal setup-card`+(D?` setup-card--wide`:``),"aria-label":E.label,children:[u===`connect`&&(0,G.jsx)(gs,{}),u===`think`&&(0,G.jsx)(_s,{}),u===`remember`&&(0,G.jsx)(ws,{}),D&&(0,G.jsx)(Ns,{onJump:x,onStart:n,onStartTalking:r,onStartOver:C,onSeeHow:i,studySlot:a,librarySlot:o}),!D&&(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:S,children:[`Done `,(0,G.jsx)(z.check,{})]})]})]},u)]}),D&&(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:m,autoComplete:`off`,spellCheck:!1,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m.trim()&&n(m.trim())}}),m.trim()?(0,G.jsx)(`button`,{type:`button`,className:`go-composer-send`,"aria-label":`Send`,onClick:()=>n(m.trim()),children:(0,G.jsx)(z.send,{})}):(0,G.jsx)(`button`,{type:`button`,className:`go-composer-mic`,"aria-label":`Use microphone`,onClick:r,children:(0,G.jsx)(z.mic,{})})]})})]})}function Fs(e){let t=(0,q.c)(39),{mode:n,onChange:r,pttKey:i,pttSide:a}=e,[o,s]=(0,W.useState)(!1),c=(0,W.useRef)(null),l,u;t[0]===o?(l=t[1],u=t[2]):(l=()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)},t=e=>{e.key===`Escape`&&s(!1)};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,W.useEffect)(l,u);let d=i||`Alt`,f;t[3]!==a||t[4]!==d?(f=Qt(d,a),t[3]=a,t[4]=d,t[5]=f):f=t[5];let p=f,m;t[6]===r?m=t[7]:(m=e=>{r(e),s(!1)},t[6]=r,t[7]=m);let h=m,g=n===`tap`,_;t[8]===h?_=t[9]:(_=()=>h(`tap`),t[8]=h,t[9]=_);let v;t[10]!==g||t[11]!==_?(v={key:`tap`,title:`Tap`,blurb:`Tap once, speak, tap to stop`,checked:g,onClick:_},t[10]=g,t[11]=_,t[12]=v):v=t[12];let y=n===`always`,b;t[13]===h?b=t[14]:(b=()=>h(`always`),t[13]=h,t[14]=b);let x;t[15]!==b||t[16]!==y?(x={key:`always`,title:`Always on`,blurb:`Hands-free — responds to "Mavéa"`,checked:y,onClick:b},t[15]=b,t[16]=y,t[17]=x):x=t[17];let S=`Hold ${p}`,C=`Push-to-talk with the ${p} key`,w=n===`hold`,T;t[18]===h?T=t[19]:(T=()=>h(`hold`),t[18]=h,t[19]=T);let E;t[20]!==S||t[21]!==C||t[22]!==w||t[23]!==T?(E={key:`hold`,title:S,blurb:C,checked:w,onClick:T},t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E):E=t[24];let D;t[25]!==x||t[26]!==E||t[27]!==v?(D=[v,x,E],t[25]=x,t[26]=E,t[27]=v,t[28]=D):D=t[28];let O=D,k;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>s(Ls),t[29]=k):k=t[29];let A;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(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`})}),t[30]=A):A=t[30];let j;t[31]===o?j=t[32]:(j=(0,G.jsx)(`button`,{type:`button`,className:`mic-mode-chevron`,onClick:k,"aria-expanded":o,"aria-haspopup":`menu`,"aria-label":`Mic mode`,title:`Mic mode`,children:A}),t[31]=o,t[32]=j);let M;t[33]!==o||t[34]!==O?(M=o&&(0,G.jsx)(`div`,{className:`mic-mode-pop`,role:`menu`,"aria-label":`Mic mode`,children:O.map(Is)}),t[33]=o,t[34]=O,t[35]=M):M=t[35];let N;return t[36]!==j||t[37]!==M?(N=(0,G.jsxs)(`div`,{className:`mic-mode-pop-root`,ref:c,children:[j,M]}),t[36]=j,t[37]=M,t[38]=N):N=t[38],N}function Is(e){return(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)(z.check,{className:`mic-mode-row-check`,"aria-hidden":`true`})]},e.key)}function Ls(e){return!e}function Rs(e,t){e.documentElement.dataset.presenceStyle=t}function zs(e){delete e.documentElement.dataset.presenceStyle}var Bs=/(photo|image|carousel|mood|palette|video|map|diagram|story|slide|verse)/,Vs=/(chart|table|matrix|grid|stat|kpi|code|pipeline|timeline|kanban|roadmap|process|flow|tree|schema|heatmap|scatter|bars|donut|gauge|checks|network|sankey)/;function Hs(e,t){return!!(e?.blocks)?.some(e=>t.test(String(e.type).toLowerCase()))}function Us({status:e,interjecting:t=!1,spec:n}){if(e===`thinking`)return`bead`;if(t)return`pip`;let r=Ui(n);return r===`warm`?`pip`:r===`concerned`?`hybrid`:Hs(n,Bs)?`aura`:Hs(n,Vs)?`bead`:`hybrid`}var Ws=6e3;function Gs({dashboardId:e,dashboardTitle:t,onDismiss:n}){let r=(0,W.useRef)(n);return r.current=n,(0,W.useEffect)(()=>{let e=setTimeout(()=>r.current(),Ws);return()=>clearTimeout(e)},[e]),(0,G.jsxs)(`div`,{className:`cards-pill dash-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(z.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:Lt.detail(e),onClick:n,children:[`Open `,(0,G.jsx)(z.chevR,{})]})]})}var Ks={strong:`Strong evidence`,partial:`Partial evidence`,inferred:`Inferred`,unverified:`Unverified`},qs={strong:3,partial:2,inferred:1,unverified:1};function Js(e){let t=(0,q.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 Ys(e){let t=(0,q.c)(8),{level:n,title:r}=e,i=qs[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=Ks[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 Xs({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=Oe(e.url),i=t?H(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}function Zs({open:e,onClose:t,claim:n,conf:r,sources:i,hadFiles:a=!1}){let o=i.length?`How sure Mavéa is, based on these sources`:a?`How sure Mavéa is, based on your files`:V;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)(z.x,{})}),(0,G.jsxs)(`div`,{className:`drawer-head`,children:[(0,G.jsxs)(`div`,{className:`drawer-eyebrow`,children:[(0,G.jsx)(z.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)(Ys,{level:r||`inferred`,title:o}),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=Oe(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)(z.globe,{style:{width:16,height:16}}),e.title]}),(0,G.jsx)(`span`,{className:`evidence-loc`,children:H(e.url)??e.url}),(0,G.jsx)(z.external,{style:{width:14,height:14,flex:`0 0 auto`}})]}),e.snippet&&(0,G.jsx)(`div`,{className:`evidence-quote`,children:e.snippet})]})},t):null})}),(0,G.jsxs)(`div`,{className:`assumption`,children:[(0,G.jsx)(z.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 Qs=new Set([`inferred`,`unverified`]);function $s(e){let{conf:t}=e.props;return t===`strong`||t===`partial`||t===`inferred`||t===`unverified`?t:void 0}function ec(e){if(!e)return 0;let t=0,n=e=>{for(let r of e){let e=$s(r);e&&Qs.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=H(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 nc(e){let t=(0,q.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=Pa(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)(Js,{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 rc=1300;function ic(e){let t=(0,q.c)(9),{onDone:n,tint:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=()=>{let e=window.setTimeout(n,rc);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 ac(e){return e?.track!=null&&e.track.score>=95}function oc(e,t){return mt(e)&&t.blocks.length>=4}function sc(e,t){if(!xe(e))return!1;if(!t)return!0;let n=ht(t);return n.planning||n.comparison||n.whatIf||n.decision||n.troubleshoot}function cc(e){let t=(0,q.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&&ac(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&&oc(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&&sc(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)(Xs,{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 lc=[`Alt`,`Control`,`Shift`],uc=[{side:`any`,label:`Either`},{side:`left`,label:`Left`},{side:`right`,label:`Right`}],dc=typeof navigator<`u`&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),fc={Alt:dc?`Option (⌥)`:`Alt`,Control:dc?`Control (⌃)`:`Ctrl`,Shift:dc?`Shift (⇧)`:`Shift`};function pc({children:e,holdEnabled:t,showHint:n=!0,pttKey:r,pttSide:i=`any`,onHoldStart:a,onHoldEnd:o,onChangePttKey:s,onChangePttSide:c}){an({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 `,Qt(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:lc.map(e=>(0,G.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":(r||`Alt`)===e,className:`dock-hint-key${(r||`Alt`)===e?` active`:``}`,title:fc[e],onClick:()=>s?.(e),children:Qt(e)},e))}),(0,G.jsx)(`div`,{className:`dock-hint-row dock-hint-sides`,children:uc.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 mc=e=>e.toLowerCase().replace(/\s+/g,` `).trim();function hc(e){return mc(`${e.question} ${e.spec.title??``} ${e.narration}`)}function Q(e){let t=new Map;return e.forEach((n,r)=>{let i=n.corrects;if(!i)return;let a=mc(i.what);if(a){for(let n=r-1;n>=0;n--)if(hc(e[n]).includes(a)){t.set(n,{note:i,by:r});return}}}),t}function gc(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 _c({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=It(),y=e.length===0,b=(0,W.useMemo)(()=>Q(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)(z.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)(z.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)(z.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)(z.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}),_&&(0,G.jsx)(`button`,{type:`button`,className:`sess-together`,onClick:()=>_(e),disabled:e.moments.length<2,title:e.moments.length>=2?`See all ${e.moments.length} moments of this thread together on one canvas`:`This thread is one moment — already fully on screen`,"aria-label":e.moments.length>=2?`See all ${e.moments.length} moments of this thread together`:`This thread is one moment — already fully on screen`,children:(0,G.jsx)(z.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:gc(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)(z.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)(z.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)(z.layers,{}),(0,G.jsxs)(`span`,{children:[v.count,` card`,v.count===1?``:`s`,` ready`]})]})]})]})}function vc(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:nt(e.question)||null,narration:e.narration||e.spec.title}}let s=o>=0?n[o]:void 0,c=i||s?.narration||t.title;return c?{question:nt(i?a??s?.question:s?.question??a)||null,narration:c}:null}function yc(e){let t=(0,q.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 bc(e){return e===null||!Number.isFinite(e)||e<0?null:e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function xc(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 Sc(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 Cc(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function wc(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 Tc(e){let t=(0,q.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:Cc(e.inkedAt-r)}),(0,G.jsx)(`span`,{className:`gesture-track-icon`,"aria-hidden":`true`,children:xc(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:Sc(e.kind)}),` `,(0,G.jsx)(`span`,{className:`gesture-track-target`,title:wc(e),children:wc(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 Ec(e){let t=(0,q.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 Dc=/\b(teach me|walk me through|tutor( me)?|step[- ]by[- ]step|like i'?m (five|5|a beginner|new))\b/i;function Oc(e){return!!e&&Dc.test(e)}function kc(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 Ac=4,jc=2e3;function Mc(e,t=Ac){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/jc),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 Nc(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 Pc(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 Fc(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 Ic(e){if(e.length<4)return!1;let{minX:t,minY:n,maxX:r,maxY:i}=Fc(e),a=Math.hypot(r-t,i-n),o=Nc(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=Pc(e)>o*o*.02;return l||u}function Lc(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 Rc=3e3;function zc(e,t=Ac,n=Rc){let{minX:r,minY:i,maxX:a,maxY:o}=Fc(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(Lc(r,e)&&(u.push(r),u.length>=n))return u}return u}var Bc=4,Vc=4e3,Hc=`input, textarea, select, button, a, summary, [contenteditable], [role="slider"], [role="tab"], [role="switch"], [draggable="true"], .block-ask, .leaflet-container, .geo-map, [data-interactive]`;function Uc({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=kc(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>Vc)S();else return;if(!(h.current||e.pointerType===`pen`)||e.target?.closest?.(Hc))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))<Bc)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 Wc=80,Gc=`.ink-user-overlay, .ink-layer, .block-ask, .card-eyebrow`,Kc=e=>{let t=e.replace(/\s+/g,` `).trim();return t.length>Wc?t.slice(0,Wc-1)+`…`:t};function qc(e){return!e.data||!e.data.trim()?!1:!e.parentElement?.closest(Gc)}function Jc(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 Yc(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 Xc(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 Zc(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 Qc(e){let t=[...e.values()],n=e=>{let[t,n]=Jc(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)=>Yc(e.node,t.node)),a=Kc(i.map(n).filter(e=>e.trim()).join(` `));if(!a)return null;let o=[];for(let e of i){let[t,n]=Jc(e);o.push(...Zc(e.node,t,n))}return{text:a,blockId:Xc(r.node),rects:o}}function $c(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 el(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?.(Gc))continue;let t=$c(e);if(t)return{text:Kc(t),blockId:Xc(e),rects:[e.getBoundingClientRect()]}}return null}function tl(e,t){let n=new Map,r=[];for(let i of e){let e=t.caretAt(i.x,i.y);if(e&&qc(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?Qc(n):el(r,t)}function nl(e,t,n){if(e.length===0)return null;let r=e=>({x:e.x+t.left,y:e.y+t.top});if(Ic(e)){let t=zc(e.map(r)),i=t.length>0?tl(t,n):null;if(i)return i}let i=Mc(e).map(r);return i.length===0?null:tl(i,n)}var rl=6,il=14;function al(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-rl&&n<=t.right+rl&&r>=t.top-il&&r<=t.bottom+il)return!0}return!1}catch{return!0}}function ol(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||!al(r,i,e,t)?null:{node:r,offset:i}}var sl={caretAt:ol,elementsAt:(e,t)=>document.elementsFromPoint(e,t)};function cl(e,t,n=sl){let r=nl(e,t.svgRect,n);return!r||!r.text?null:{intent:{kind:`highlight`,blockIds:r.blockId?[r.blockId]:[],textAt:r.text},rects:r.rects}}function ll(e,t){return e.map(e=>({x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}))}function ul(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=cl(e,n,r);if(!i)return s(e=>e+1),!1;let o={intent:i.intent,stroke:t,rects:ll(i.rects,n.svgRect)};return a(e=>[...e,o]),!0},[r]),d=(0,W.useCallback)((e,t)=>{u(e,kc(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 dl=e=>e.length>22?e.slice(0,21)+`…`:e;function fl(e){return e.textAt?`Marked “${dl(e.textAt)}”`:`Marked`}function pl(e){if(e.length===0)return``;let t=e[0]?.textAt?.trim(),n=t?`Tell me about “${dl(t)}”`:`Tell me about this`;return e.length===1?n:`${n} (and ${e.length-1} more)`}function ml(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 hl(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 gl(e){let t=(0,q.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:fl(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 _l=`mavea-ink-hint-seen`;function vl(){try{return localStorage.getItem(_l)===`1`}catch{return!0}}function yl({armed:e,pins:t,miss:n=0,onUndo:r,onSend:i}){let[a,o]=(0,W.useState)(vl),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(_l,`1`)}catch{}}},[e,t.length,a]);let d=()=>{o(!0);try{localStorage.setItem(_l,`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)(gl,{pins:t,onUndo:r,onSend:i})]})}function bl(e){let t=(0,q.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 xl=`mavea-brief-date`,Sl=xl,Cl=void 0;function wl(){return new Date().toISOString().slice(0,10)}function Tl(){try{return typeof localStorage>`u`?null:localStorage.getItem(xl)}catch{return null}}function El(){return Cl===void 0&&(Cl=Tl()),Cl}function Dl(e){Cl=e;try{typeof localStorage<`u`&&localStorage.setItem(xl,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(Sl,{detail:e}))}catch{}}function Ol(e){return e?El()!==wl():!1}function kl(){Dl(wl())}function Al(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(`
|
|
4
|
+
`)}var jl=99;function Ml(e){return e>jl?`${jl}+`:String(e)}function Nl(){for(let e of Dn()){let t=An(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 Pl(e){let t=(0,q.c)(16),{onStudy:n}=e,r=It(),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)(z.layers,{}),t[3]=e):e=t[3];let a;t[4]===r.count?a=t[5]:(a=Ml(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=Nl(),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)(z.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:Il},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(Fl)})]}),t[14]=a,t[15]=s),s}function Fl(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 Il(){window.location.hash=`#/courses`}function Ll(e){return e.type===`flashcard`&&Array.isArray(e.props?.cards)}function Rl(e){return e.replace(/<[^>]+>/g,``).trim()}function zl(e){let t=[];for(let n of e){if(!Ll(n))continue;let e=n;for(let n of e.props.cards){let e=Rl(n.front??``),r=Rl(n.back??``);!e||!r||t.push({front:e,back:r,tag:n.tag?Rl(n.tag):void 0})}}return t}function Bl(e){return Rl(e??``).trim()}function Vl(e){let t=[],n=(e,n,r)=>{let i=Bl(e),a=Bl(n);i&&a&&t.push({front:i,back:a,tag:Bl(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=>Bl(e.text)).filter(Boolean);if(t.length){let r=Bl(e.props.explanation),i=r?`${t.join(`; `)} — ${r}`:t.join(`; `);n(e.props.question,i)}break}default:break}return t}var Hl=[`title`,`label`,`heading`,`name`,`question`,`caption`,`eyebrow`],Ul=[`summary`,`narrative`,`detail`,`sub`,`body`,`text`,`prose`,`def`,`a`];function Wl(e){return e.props??{}}function Gl(e,t){for(let n of t){let t=e[n];if(typeof t==`string`){let e=Bl(t);if(e)return e}}return``}function Kl(e){return Gl(Wl(e),Hl).slice(0,140)||we(e)}function ql(e){return Gl(Wl(e),Ul).slice(0,400)}function Jl(e){return{front:Kl(e),back:ql(e)}}function Yl(e){let t=[],n=Kl(e);n&&t.push(n);for(let[,r]of Object.entries(Wl(e)))if(typeof r==`string`){let e=Bl(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=Bl(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=Bl(r);e&&t.push(e)}}}return[...new Set(t)].join(`
|
|
5
|
+
`).slice(0,1400)}function Xl(e){let t=Vl(e);return t.length?{cards:t,exact:!0}:{cards:[Jl(e)],exact:!1}}var Zl=`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":"…"}]}.`,Ql={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 $l(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=Bl(String(e.front??``)).slice(0,300),n=Bl(String(e.back??``)).slice(0,600);t&&n&&r.push({front:t,back:n})}return r.slice(0,4)}async function eu(e,t,n){let r=Yl(e);if(!r)return[];let i=Fn(t.model)===`slow`?480:640;try{let e=await Re(t.provider).generate({system:Zl,systemBase:Zl,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:Ql,...n?{signal:n}:{}},t);return n?.aborted?[]:$l(e.raw)}catch{return[]}}var tu=`tour-neural-networks`,nu=`neural`,ru=[{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 iu(){let e=Mn(tu);if(e)return e;let t=ur(nu)?.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:ru,createdAt:Date.now(),model:`tour`};return jn(n),Nn(tu,ru[0].id,t),n}var au=24e3,ou=au*180,su=[],cu=null,lu=[],uu=0,du=!1,fu=1,pu=0,mu=new Set;function hu(){pu+=1;for(let e of mu)e()}function gu(e){return mu.add(e),()=>mu.delete(e)}function _u(){return pu}function vu(){return uu/au}function yu(){su=[],cu=null,lu=[],uu=0,fu=B(),du=!0,hu()}function bu(e){if(!du)return;let t=lu[lu.length-1];t&&t.blocks===e||lu.push({t:vu(),blocks:e})}var xu={begin(e){du&&(cu={text:e,chunks:[],samples:0})},push(e){!du||!cu||uu+e.length>ou||(cu.chunks.push(e),cu.samples+=e.length,uu+=e.length)},end(e){!du||!cu||(e&&cu.samples>0?su.push(cu):uu-=cu.samples,cu=null,hu())}};function Su(){let e=su.reduce((e,t)=>e+t.samples,0);if(e===0)return null;let t=new Float32Array(e),n=[],r=0;for(let e of su){let i=r/au;for(let n of e.chunks)t.set(n,r),r+=n.length;n.push({text:e.text,t0:i,t1:r/au})}let i=e/au;return{pcm:t,sampleRate:au,duration:i,spans:n,marks:lu.map(e=>({t:Math.min(e.t,i),blocks:e.blocks})),speed:fu}}function Cu(e,t){let n=0;for(let r of e.marks){if(r.t>t)break;n=r.blocks}return n}function wu(e,t,n,r){if(t>=e.duration-.05)return r;let i=Cu(e,t);for(let r of e.spans){if(r.t0>t)break;let e=n.find(e=>e.say===r.text||e.saySpoken===r.text);e&&(i=Math.max(i,e.index+1))}return Math.max(1,Math.min(i,r))}var Tu=24e3*300,Eu=class{budget;map=new Map;constructor(e=Tu){this.budget=e}set(e,t){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()].sort((e,t)=>e-t),n=0;for(;this.total()>this.budget&&this.map.size>1&&n<t.length;){let r=t[n++];r!==e&&this.map.delete(r)}}},Du=[1,1.25,1.5,2,.75];function Ou(e){return`${Number.isInteger(e)?e:e.toFixed(2).replace(/0+$/,``).replace(/\.$/,``)}×`}function ku(e){return Math.min(2,Math.max(.75,e))}function Au(e){let t=Du.indexOf(ku(e));return Du[(t<0?0:t+1)%Du.length]}function ju(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++){let n=Math.max(-1,Math.min(1,e[t]));i.setInt16(44+t*2,Math.round(n*(n<0?32768:32767)),!0)}return r}function Mu(e,t){let n=new Blob([ju(e,t)],{type:`audio/wav`});return URL.createObjectURL(n)}var Nu=160;function Pu(e){let t=Math.max(1,Math.floor(e.pcm.length/Nu)),n=[];for(let r=0;r<Nu;r++){let i=0,a=r*t,o=Math.min(e.pcm.length,a+t);for(let t=a;t<o;t++){let n=Math.abs(e.pcm[t]);n>i&&(i=n)}n.push(i)}return n}var Fu={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 Iu(e){let t=(0,q.c)(8),{reason:n}=e,r=Fu[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 Lu({audio:e,t,onSeek:n}){let r=(0,W.useRef)(null),i=(0,W.useRef)(null),a=(0,W.useRef)(null),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,h]=qt(),g=ku(m.voiceSpeed),_=g/(e.speed||1),v=(0,W.useRef)(_);v.current=_;let y=(0,W.useCallback)(()=>{c.current?.stop(),c.current=null,u(!1)},[]),b=(0,W.useCallback)(t=>{if(y(),!x())return;n(t),f(t),s.current||=Mu(e.pcm,e.sampleRate);let r=new Audio(s.current);r.preservesPitch=!0,r.webkitPreservesPitch=!0,r.playbackRate=v.current,r.currentTime=t,t>0&&r.addEventListener(`loadedmetadata`,()=>{Math.abs(r.currentTime-t)>.05&&(r.currentTime=t)},{once:!0});let i=w(r);r.play().catch(()=>{});let a=0,o=()=>{if(r.ended||r.currentTime>=e.duration){l(),c.current=null,u(!1),f(null),n(null);return}f(r.currentTime),a=requestAnimationFrame(o)},l=()=>{cancelAnimationFrame(a);try{r.pause(),r.removeAttribute(`src`)}catch{}i()};c.current={stop:l,el:r},u(!0),a=requestAnimationFrame(o)},[e,n,y]),S=(0,W.useCallback)(()=>{if(c.current){let e=c.current.el.currentTime;y(),f(null),n(e)}else b(p??0)},[p,b,y,n]),C=(0,W.useCallback)(()=>{h({voiceSpeed:Au(g)})},[h,g]);(0,W.useEffect)(()=>{c.current&&(c.current.el.playbackRate=_)},[_]),(0,W.useEffect)(()=>()=>{y(),s.current&&=(URL.revokeObjectURL(s.current),null)},[e,y]),(0,W.useEffect)(()=>{let t=r.current;if(!t)return;a.current||=Pu(e);let n=window.devicePixelRatio||1,i=t.clientWidth,o=t.clientHeight;if(!i||!o)return;t.width=i*n,t.height=o*n;let s=t.getContext(`2d`);if(!s)return;s.scale(n,n),s.clearRect(0,0,i,o);let c=getComputedStyle(t),l=c.getPropertyValue(`--scrub-played`).trim()||`#8a93f8`,u=c.getPropertyValue(`--scrub-rest`).trim()||`#5c647833`,d=p===null?1:Math.max(0,Math.min(1,p/e.duration)),f=i/Nu;for(let e=0;e<Nu;e++){let t=Math.max(.06,a.current[e])*(o-4);s.fillStyle=e/Nu<=d?l:u,s.fillRect(e*f+f*.2,(o-t)/2,f*.6,t)}},[e,p]),(0,W.useEffect)(()=>{a.current=null,f(null)},[e]);let T=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:S,"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:C,"aria-label":`Speed, currently ${Ou(g)}. Tap to change.`,title:`Voice speed`,children:Ou(g)}),(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,y(),f(null);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}n(T(e.clientX),!0)},onPointerMove:e=>{o.current&&n(T(e.clientX),!0)},onPointerUp:e=>{o.current&&(o.current=!1,b(T(e.clientX)))},onKeyDown:t=>{let r=p??e.duration;t.key===`ArrowLeft`&&(y(),f(null),n(Math.max(0,r-2),!0)),t.key===`ArrowRight`&&(y(),f(null),n(Math.min(e.duration,r+2),!0)),(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),S()),t.key===`Escape`&&(y(),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 Ru({audio:e,t,onSeek:n,unavailable:r=`missing`}){return e?(0,G.jsx)(Lu,{audio:e,t,onSeek:n}):(0,G.jsx)(Iu,{reason:r})}function zu(){let e=(0,q.c)(16),[t,n]=qt(),r;e[0]===t.voiceSpeed?r=e[1]:(r=ku(t.voiceSpeed),e[0]=t.voiceSpeed,e[1]=r);let i=r,a,o;e[2]===i?(a=e[3],o=e[4]):(a=()=>{ie(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:Au(i)}),e[5]=n,e[6]=i,e[7]=s):s=e[7];let c=s,l;e[8]===i?l=e[9]:(l=Ou(i),e[8]=i,e[9]=l);let u=`Voice speed, currently ${l}. Tap to change.`,d;e[10]===i?d=e[11]:(d=Ou(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}function Bu(){let e=(0,q.c)(9),[t,n]=qt(),r=t.explainLevel===`simple`,i;e[0]!==n||e[1]!==r?(i=()=>n({explainLevel:r?`standard`:`simple`}),e[0]=n,e[1]=r,e[2]=i):i=e[2];let a=i,o=`explain-chip`+(r?` is-simple`:``),s=`Explanation level: ${r?`Simple`:`Standard`}. Tap to switch.`,c=r?`Simple`:`Standard`,l;return e[3]!==r||e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a?(l=(0,G.jsx)(`button`,{type:`button`,className:o,onClick:a,"aria-pressed":r,"aria-label":s,title:`How plain the words and visuals are — or just say 'explain it simpler' / 'go deeper'`,children:c}),e[3]=r,e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=l):l=e[8],l}var Vu=[`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(`
|
|
6
|
+
`),Hu=150;function Uu(e){try{let t=(typeof e==`string`?JSON.parse(e.match(/\{[\s\S]*\}/)?.[0]??`{}`):e).ghosts;return Array.isArray(t)?t.map(e=>{let t=e,n=typeof t.title==`string`?t.title.trim().slice(0,48):``;return n?{kind:t.kind===`maybe`?`maybe`:`forming`,title:n}:null}).filter(e=>e!==null).slice(0,3):[]}catch{return[]}}async function Wu(e,t,n){try{let r=await Re(t.provider).generate({system:Vu,history:[],user:e,maxTokens:Hu},t);return n.aborted?[]:Uu(r.raw)}catch{return[]}}var Gu=80,Ku=120;function qu(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function Ju(e){if(!e)return``;if(/[\s.!?,;:]$/.test(e))return e.trim();let t=e.trimEnd();return/\s/.test(t)?t.replace(/\S+$/,``).trim():``}function Yu(e){return e.replace(/([.!?])\s+/g,`$1\0`).replace(/\s+(?=\b(?:but |and i |and she |and he |and they |and dad|and mom|and my |so i |so she |so he |honestly |actually |i keep |i also |i've |i just |the thing is |i mean |i don't know)\b)/gi,`\0`).split(`\0`).map(e=>e.trim()).filter(e=>e.length>=8)}function Xu(e){return qu(e.trim(),Ku)}function Zu(e){let t=e.replace(/^(?:okay|so|like|i mean|well|um|uh|you know|honestly|actually|look|i just|and|but|i think|i guess|i suppose|you see)\s+/gi,``);return qu(t.charAt(0).toUpperCase()+t.slice(1),Gu)}var Qu=/\b(Dad|Mom|Mum|Papa|Mama|Grandpa|Grandma|Grandad|Nan|Nana|Uncle|Auntie)\b(?:'s)?/,$u=/\b(?:my|his|her|their|our)\s+(dad|father|mom|mother|sister|brother|son|daughter|wife|husband|partner|friend|boss|manager|co-?founder|colleague|mentor|coach|therapist|doctor|lawyer|ex)\b/i,ed=/\b([A-Z][a-z]{2,12})(?:'s)?\s+(?:just|started|always|keeps?|is|was|has|have|said|told|wants?|needs?|feels?|thinks?|loves?|hates?|came|went|left|got|has|moved|called|texted)\b/,td=new Set(`March.January.February.April.June.July.August.September.October.November.December.Monday.Tuesday.Wednesday.Thursday.Friday.Saturday.Sunday.Seattle.Austin.Portland.Chicago.Boston.Denver.Atlanta.New.York.Los.San.Las`.split(`.`)),nd=/\b(?:should i|whether to|thinking about|considering|one option|maybe i should|alternatively|or i could|or i might|could (?:also )?(?:go|stay|take|move|leave|try|do|join|accept|turn)|(?:an?|this|that|the)\s+offer|an? (?:opportunity|position|role|deal)|option (?:is|would be))\b/i,rd=/\b(?:scared|afraid|fear|worried about|anxious|terrified|dreading|dread|what if|might fail|not (?:going to )?work|won'?t work|going wrong|could go wrong|nervous|i'?m (?:just |really )?scared|i'?m worried)\b/i,id=/\b(?:can'?t|cannot|have to|has to|must|deadline|budget|mortgage|my lease|loan|runway|no choice|tied (?:to|down)|stuck|limited|only (?:have|got) (?:\w+ )?\d|only \d+ months?|no time|no money|not (?:enough|possible)|running out)\b/i,ad=/(?:\?)|(?:\b(?:i don'?t know|not sure|can'?t decide|i keep going back and forth|i keep (?:asking|wondering|second.?guessing)|haven'?t decided|still figuring|up in the air|i wonder|no idea|is it even|is it the right|is this (?:the right|a|even)|what (?:do|should) i)\b)/i,od=/\b(?:i (?:really )?want|i wish|i hope|would (?:really )?love|i'?ve always wanted|would like|i dream|my goal|i aspire|i'?m looking for|i need (?:to )?(?:feel|be|have|find|do)|i want to (?:feel|be|have|find|do))\b/i;function sd(e){let t=Yu(e),n=[],r=new Set,i=0,a=0,o=0,s=0,c=0,l=0;function u(e,t,i,a){let o=typeof i==`string`?qu(i,Gu):Zu(a),s=`${t}:${o.toLowerCase().slice(0,20)}`;if(r.has(s))return;r.add(s);let c=Xu(a);c&&n.push({id:e,kind:t,label:o,quote:c,status:`forming`,confidence:`said`,weight:1})}for(let e of t){let t=e.match($u);if(t){let n=t[1],r=n.charAt(0).toUpperCase()+n.slice(1);u(`per_${i++}`,`person`,r,e)}let n=e.match(Qu);n&&!t&&u(`per_${i++}`,`person`,n[1],e);let r=e.match(ed);if(r){let t=r[1];td.has(t)||u(`per_${i++}`,`person`,t,e)}nd.test(e)&&u(`opt_${a++}`,`option`,Zu(e),e),rd.test(e)&&u(`fea_${o++}`,`fear`,Zu(e),e),id.test(e)&&u(`con_${s++}`,`constraint`,Zu(e),e),ad.test(e)&&u(`loo_${c++}`,`open_loop`,Zu(e),e),od.test(e)&&u(`wan_${l++}`,`want`,Zu(e),e)}return n}function cd(e){let t=Yu(e);return t.length>0?t.length:+!!e.trim()}var ld=/^(?:what(?:'s|s)?|how|why|who|when|where|which|whose|is|are|am|can|could|do|does|did|should|would|will|may|might)\b/i,ud=14;function dd(e){let t=e.trim();return t?cd(t)>=2?!0:ld.test(t)||t.endsWith(`?`)?!1:t.split(/\s+/).length>=ud:!1}var fd=700,pd=4,md=3;function hd(e,t,n,r){let i=(0,q.c)(19),a=r===void 0?!1:r,o;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],i[0]=o):o=i[0];let[s,c]=(0,W.useState)(o),l=(0,W.useRef)(0),u=(0,W.useRef)(``),d=(0,W.useRef)(null),f,p;i[1]===e?(f=i[2],p=i[3]):(f=()=>{l.current=0,u.current=``,e||(d.current?.abort(),c([]))},p=[e],i[1]=e,i[2]=f,i[3]=p),(0,W.useEffect)(f,p);let m,h;i[4]===a?(m=i[5],h=i[6]):(m=()=>{a&&(d.current?.abort(),c([]))},h=[a],i[4]=a,i[5]=m,i[6]=h),(0,W.useEffect)(m,h);let g,_;i[7]!==n||i[8]!==e||i[9]!==t||i[10]!==a?(g=()=>{if(!e||!n||a)return;let r=Ju((t??``).trim());if(r.split(/\s+/).filter(Boolean).length<pd||r===u.current||l.current>=md)return;let i=window.setTimeout(()=>{u.current=r,l.current+=1,d.current?.abort();let e=new AbortController;d.current=e,Wu(r,n,e.signal).then(t=>{!e.signal.aborted&&t.length&&c(t)})},fd);return()=>window.clearTimeout(i)},_=[e,t,n,a],i[7]=n,i[8]=e,i[9]=t,i[10]=a,i[11]=g,i[12]=_):(g=i[11],_=i[12]),(0,W.useEffect)(g,_);let v,y;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>()=>d.current?.abort(),y=[],i[13]=v,i[14]=y):(v=i[13],y=i[14]),(0,W.useEffect)(v,y);let b;return i[15]!==s||i[16]!==e||i[17]!==a?(b=e&&!a?s:[],i[15]=s,i[16]=e,i[17]=a,i[18]=b):b=i[18],b}function gd({ghosts:e}){return e.length===0?null:(0,G.jsx)(`div`,{className:`ghost-row`,"aria-hidden":`true`,children:e.map((e,t)=>(0,G.jsxs)(`div`,{className:`ghost-card is-`+e.kind,style:{"--gi":t},children:[(0,G.jsxs)(`span`,{className:`ghost-kind`,children:[`◌ `,e.kind===`forming`?`Forming`:`Maybe`]}),(0,G.jsx)(`span`,{className:`ghost-title`,children:e.title}),(0,G.jsxs)(`span`,{className:`ghost-bones`,children:[(0,G.jsx)(`i`,{}),(0,G.jsx)(`i`,{})]})]},e.title))})}var _d=2e3,vd=350,yd={type:`object`,properties:{id:{type:`string`},kind:{type:`string`,enum:[`person`,`option`,`want`,`fear`,`constraint`,`tradeoff`,`contradiction`,`open_loop`,`action`,`value`,`question`]},label:{type:`string`},quote:{type:`string`},status:{type:`string`},confidence:{type:`string`},weight:{type:`number`}},required:[`id`,`kind`,`label`,`quote`]},bd={type:`object`,properties:{from:{type:`string`},to:{type:`string`},kind:{type:`string`,enum:[`supports`,`tensions`,`depends_on`,`same_thread`,`blocks`]},label:{type:`string`}},required:[`from`,`to`,`kind`]},xd={type:`object`,properties:{center:{type:`string`},title:{type:`string`},atoms:{type:`array`,minItems:1,items:yd},links:{type:`array`,items:bd},clusters:{type:`array`,items:{type:`object`,properties:{id:{type:`string`},label:{type:`string`},atomIds:{type:`array`,items:{type:`string`}},weight:{type:`number`}},required:[`id`,`label`,`atomIds`]}},unsaid:{type:`object`,properties:{label:{type:`string`},why:{type:`string`},confidence:{type:`string`}}}},required:[`center`,`atoms`]},Sd={type:`object`,properties:{add:{type:`array`,items:yd},addLinks:{type:`array`,items:bd}}},Cd=`You are Mavéa, a listening companion that mirrors the shape of thought. A person has been thinking aloud — sometimes weighing a personal decision (wants, fears, options), sometimes exploring a subject they're curious about (questions, threads, sub-topics). Extract the structure of their thinking into a "mindshape" — NOT to give advice, judge, or add ideas not present in their words.
|
|
7
|
+
|
|
8
|
+
Find WHAT IS ACTUALLY THERE and WHAT CONNECTS OR PULLS AGAINST WHAT. Choose the kind that genuinely fits each atom — never default everything to one kind.
|
|
9
|
+
|
|
10
|
+
ATOM KINDS:
|
|
11
|
+
- question: a subject, topic, or thing they are curious about or want to understand — the DEFAULT for exploratory/learning thinking ("how cars reshaped cities", "what came before the wheel")
|
|
12
|
+
- option: a concrete path, sub-area, or choice they are considering
|
|
13
|
+
- action: a concrete step they could take or are taking
|
|
14
|
+
- want: a genuine desire or goal, stated as wanting something — NOT a topic they are merely exploring
|
|
15
|
+
- fear: what worries or scares them
|
|
16
|
+
- constraint: a real limitation (time, money, geography, commitment, obligation)
|
|
17
|
+
- tradeoff: a genuine cost-benefit tension in a single choice
|
|
18
|
+
- open_loop: an unresolved question or loose thread they keep circling but haven't answered
|
|
19
|
+
- value: a principle that matters to them (only when explicitly stated)
|
|
20
|
+
- person: a real person mentioned by name or relationship
|
|
21
|
+
|
|
22
|
+
Pick deliberately: a subject of curiosity is a question, a sub-area or path is an option, an unknown they circle is an open_loop; reserve want for an actual stated desire. A map where every atom is the same kind is wrong — make the kinds reflect the real variety in what they said.
|
|
23
|
+
|
|
24
|
+
LINK KINDS:
|
|
25
|
+
- tensions: what genuinely conflicts or pulls against what — THE HERO LINK
|
|
26
|
+
- supports: one thing enables or justifies another
|
|
27
|
+
- depends_on: one thing requires another
|
|
28
|
+
- same_thread: two atoms about the same underlying issue
|
|
29
|
+
|
|
30
|
+
LABELS:
|
|
31
|
+
Each atom's label is a short, plain-language sentence that sums up the idea in the person's own framing — a reader skimming only the labels should grasp the whole shape of the thinking. Write "Cars gave us freedom but reshaped cities around them", NOT a bare noun ("cars") or a filler prefix ("information on cars") or a category. ≤80 chars.
|
|
32
|
+
|
|
33
|
+
CLUSTERS:
|
|
34
|
+
Group the atoms into 2–5 themes that EMERGED from what they actually said. Name each theme in THEIR words and specifics — "the move to Seattle", "Maya and her school", "Dad getting older", "is it the right time" — NEVER an abstract category like "People", "Options", "Worries", "Constraints", or "Trade-offs". A theme must contain at least one atom (list its atom ids). Do not invent a theme to fill a slot — only name what is genuinely there. The themes are how the map is organized, so they must read as this person's own thoughts, not a generic form.
|
|
35
|
+
|
|
36
|
+
HARD RULES:
|
|
37
|
+
1. Every atom MUST have a real quote — verbatim words from the transcript. No quote → no atom.
|
|
38
|
+
2. center = the inferred hidden question driving everything. Be SPECIFIC, not generic. ≤90 chars.
|
|
39
|
+
3. unsaid = ONE thing they kept circling but never said directly. Write its label as one complete plain-language sentence; confidence MUST be "maybe". label ≤120 chars, why ≤120 chars.
|
|
40
|
+
4. Find at least one tensions link if there is genuine conflict in the words.
|
|
41
|
+
5. NEVER use clinical/diagnostic language: trauma, PTSD, depression, anxiety disorder, attachment style, narcissism, codependency, dissociation, hypervigilance, personality disorder.
|
|
42
|
+
6. NEVER invent motives or interpretations beyond what the words contain.
|
|
43
|
+
7. label ≤80 chars (a short summarizing sentence, per LABELS above), quote ≤120 chars (verbatim from the transcript). cluster label ≤32 chars, content-specific.
|
|
44
|
+
|
|
45
|
+
Reply with ONLY compact JSON — no prose, no markdown fences. The exact fields are given with each request.`;function wd(e){return`TRANSCRIPT:
|
|
46
|
+
${e.trim()}
|
|
47
|
+
|
|
48
|
+
Extract the full mindshape. Reply as compact JSON on ONE line (no whitespace, no markdown):
|
|
49
|
+
{"center":"...","title":"...","atoms":[{"id":"...","kind":"...","label":"...","quote":"...","status":"stable","confidence":"said","weight":1}],"links":[{"from":"...","to":"...","kind":"tensions","label":"..."}],"clusters":[{"id":"...","label":"...","atomIds":["..."],"weight":1}],"unsaid":{"label":"...","why":"...","confidence":"maybe"}}`}function Td(e){return JSON.stringify({atoms:e.atoms.map(e=>({id:e.id,k:e.kind,l:e.label})),links:e.links.map(e=>[e.from,e.to,e.kind])})}function Ed(e,t){return`NEW SPEECH (since last update):
|
|
50
|
+
${e.trim()}
|
|
51
|
+
|
|
52
|
+
ALREADY ON THE MAP — reuse these ids, do NOT renumber or restate them:
|
|
53
|
+
${Td(t)}
|
|
54
|
+
|
|
55
|
+
Return ONLY what the NEW speech ADDS, as compact JSON on ONE line (no whitespace, no markdown):
|
|
56
|
+
{"add":[{"id":"...","kind":"...","label":"...","quote":"...","status":"stable","confidence":"said","weight":1}],"addLinks":[{"from":"...","to":"...","kind":"tensions","label":"..."}]}
|
|
57
|
+
Only genuinely new atoms (each needs a verbatim quote from the NEW speech). Reuse an existing id only to update that exact atom. Omit "add" or "addLinks" when empty. Do NOT restate unchanged atoms, and do NOT include center, unsaid, clusters, or title — those come at settle.`}async function Dd(e,t,n,r,i){try{let a=await Re(r.provider).generate({system:Cd,history:[],user:e,maxTokens:t,thinkingLevel:`minimal`,format:n,signal:i},r);return i?.aborted?null:a.raw}catch{return null}}async function Od(e,t,n){let r=await Dd(wd(e),_d,xd,t,n);return r===null?null:at(r,e)}async function kd(e,t,n,r,i){let a=await Dd(Ed(e,t),vd,Sd,r,i);return a===null?null:et(a,n)}function Ad(e){if(e.atoms.length===0)return`general`;let t=0,n=0,r=0,i=0,a=0,o=0,s=0;for(let c of e.atoms)c.kind===`option`?t++:c.kind===`open_loop`?n++:c.kind===`action`?r++:c.kind===`question`?i++:c.kind===`fear`?a++:c.kind===`want`?o++:c.kind===`person`&&s++;let c=e.atoms.length,l=e.links.some(e=>e.kind===`tensions`&&!e.provisional);return t>=2&&l?`decision`:n+r>=3?`planning`:i/c>=.4?`exploration`:(a+o+s)/c>=.5?`processing`:`general`}var jd=6e3,Md=8,Nd=1,Pd=8,Fd=4;function Id(e){return e.trim()?e.trim().split(/\s+/).length:0}var Ld=24;function Rd(e,t){let n=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);t?(e.status===`stable`||t.status===`forming`)&&n.set(e.id,{...t,...e}):n.set(e.id,e)}return Array.from(n.values())}function zd(e){return e.toLowerCase().replace(/['’]/g,``).replace(/[^a-z0-9]+/g,` `).trim()}function Bd(e){return e.status===`stable`?2:+(e.status===`forming`)}function Vd(e,t){let n=new Map(e.atoms.map(e=>[e.id,e])),r=new Map(e.atoms.map(e=>[zd(e.quote),e.id]));for(let e of t.add){let t=n.get(e.id);if(t){n.set(e.id,{...t,...e});continue}let i=r.get(zd(e.quote));if(i&&n.has(i)){n.set(i,{...n.get(i),...e,id:i});continue}n.set(e.id,e),r.set(zd(e.quote),e.id)}let i=Array.from(n.values());i.length>Ld&&(i=[...i].sort((e,t)=>(t.weight??1)-(e.weight??1)||Bd(t)-Bd(e)).slice(0,Ld));let a=new Set(i.map(e=>e.id)),o=e=>`${e.from}|${e.to}|${e.kind}`,s=new Map(e.links.map(e=>[o(e),e]));for(let e of t.addLinks)s.set(o(e),e);let c=Array.from(s.values()).filter(e=>a.has(e.from)&&a.has(e.to));return{...e,atoms:i,links:c}}var Hd={center:``,atoms:[],links:[]};function Ud(e){let[t,n]=(0,W.useState)(`idle`),[r,i]=(0,W.useState)(null),a=(0,W.useRef)(`idle`),o=(0,W.useRef)(null),s=(0,W.useRef)(``),c=(0,W.useRef)(0),l=(0,W.useRef)(0),u=(0,W.useRef)(null),d=(0,W.useRef)(!1),f=(0,W.useRef)(new Set),p=(0,W.useRef)(e);(0,W.useEffect)(()=>{p.current=e},[e]);let m=e=>[`id:${e.id}`,`q:${zd(e.quote)}`];function h(e){return m(e).some(e=>f.current.has(e))}function g(e){if(f.current.size===0)return e;let t=e.atoms.filter(e=>!h(e));if(t.length===e.atoms.length)return e;let n=new Set(t.map(e=>e.id));return{...e,atoms:t,links:e.links.filter(e=>n.has(e.from)&&n.has(e.to)),clusters:e.clusters?.map(e=>({...e,atomIds:e.atomIds.filter(e=>n.has(e))})).filter(e=>e.atomIds.length>0)}}function _(e){a.current=e,n(e)}function v(e){o.current=e,i(e)}let y=(0,W.useCallback)(e=>{let t=e.filter(e=>!h(e));if(t.length===0)return;let n=o.current??Hd,r=Rd(n.atoms,t);v({...n,atoms:r})},[]),b=(0,W.useCallback)(async e=>{let t=p.current;if(!t)return;let n=o.current;if(!n||n.atoms.length===0)return;u.current?.abort();let r=new AbortController;u.current=r;let i=e.slice(s.current.length).trim();s.current=e,c.current=Date.now(),l.current+=1,d.current=!0;try{let a=await kd(i,n,e,t,r.signal);if(r.signal.aborted||!a)return;v(g(Vd(o.current??n,a)))}finally{r.signal.aborted||(d.current=!1)}},[]),x=(0,W.useCallback)(async e=>{let t=p.current;if(!t)return;u.current?.abort();let n=new AbortController;u.current=n,s.current=e,c.current=Date.now(),l.current+=1,d.current=!0;try{let r=await Od(e,t,n.signal);if(n.signal.aborted||!r)return;let i=Vd(o.current??Hd,{add:r.atoms,addLinks:r.links});v(g({...i,center:r.center||i.center,clusters:r.clusters,unsaid:r.unsaid,title:r.title??i.title}))}finally{n.signal.aborted||(d.current=!1)}},[]),S=(0,W.useCallback)(async e=>{let t=p.current;if(!t)return;u.current?.abort();let n=new AbortController;u.current=n,s.current=e,c.current=Date.now(),l.current+=1,d.current=!0;try{let r=await Od(e,t,n.signal);if(n.signal.aborted||!r)return;v(r)}finally{n.signal.aborted||(d.current=!1)}},[]),C=(0,W.useCallback)(e=>{a.current===`idle`&&_(`listening`);let t=sd(e);y(t);let n=Id(e),r=l.current>=Pd,i=Date.now()-c.current<jd,u=!r&&!i&&!d.current;if((o.current?.atoms.length??0)===0){u&&n>=Fd&&x(e);return}let f=n-Id(s.current),p=t.filter(e=>!o.current?.atoms.some(t=>t.id===e.id)).length;u&&!(n<Fd||f<Md&&p<Nd)&&b(e)},[y,x,b]),w=(0,W.useCallback)(()=>{u.current?.abort(),u.current=null,d.current=!1,f.current.clear(),s.current=``,c.current=0,l.current=0,_(`idle`),v(null)},[]),T=(0,W.useCallback)((e=!0)=>{u.current?.abort(),u.current=null,d.current=!1,s.current=``,c.current=0,l.current=0,e||(f.current.clear(),v(null)),_(`listening`)},[]),E=(0,W.useCallback)(e=>{let t=o.current;if(!t)return;let n=t.atoms.find(t=>t.id===e);if(!n)return;m(n).forEach(e=>f.current.add(e));let r=t.atoms.filter(t=>t.id!==e),i=t.links.filter(t=>t.from!==e&&t.to!==e),a=t.clusters?.map(t=>({...t,atomIds:t.atomIds.filter(t=>t!==e)})).filter(e=>e.atomIds.length>0);v({...t,atoms:r,links:i,clusters:a})},[]),D=(0,W.useCallback)(()=>{let e=o.current;if(!e?.unsaid)return;let{unsaid:t}=e,n={id:`unsaid-confirmed`,kind:`open_loop`,status:`stable`,confidence:`inferred`,label:t.label,quote:t.why,weight:2},r=Rd(e.atoms,[n]);v({...e,atoms:r,unsaid:void 0})},[]),O=(0,W.useCallback)(()=>{let e=o.current;if(!e?.unsaid)return;let{unsaid:t}=e;f.current.add(`q:${zd(t.label)}`),v({...e,unsaid:void 0})},[]),k=(0,W.useCallback)(e=>{if(!e.trim()){w();return}_(`pausing`),S(e).then(()=>{a.current===`pausing`&&_(`settled`)})},[S,w]);return(0,W.useEffect)(()=>()=>{u.current?.abort()},[]),{phase:t,spec:r,intent:(0,W.useMemo)(()=>r?Ad(r):`general`,[r]),onTranscript:C,onSpeechEnd:k,removeAtom:E,confirmUnsaid:D,dismissUnsaid:O,reset:w,resume:T}}var Wd=5e3,Gd=0;function Kd(e,t){let[n,r]=(0,W.useState)([]),i=(0,W.useRef)(new Set),a=(0,W.useCallback)((e,t)=>{r([{id:`sig-${++Gd}`,content:t,kind:e,expiresAt:Date.now()+Wd}])},[]);return(0,W.useEffect)(()=>{let e=n[0];if(!e)return;let t=Math.max(0,e.expiresAt-Date.now()),i=window.setTimeout(()=>{r(e=>e.filter(e=>e.expiresAt>Date.now()))},t);return()=>window.clearTimeout(i)},[n]),(0,W.useEffect)(()=>{t===`idle`&&(i.current.clear(),r([]))},[t]),(0,W.useEffect)(()=>{if(!e||t===`settled`||t===`idle`)return;let n=e.atoms.length,r=i.current;n>=4&&!r.has(`pattern`)&&(r.add(`pattern`),a(`pattern`,`A shape is forming…`)),e.links.some(e=>e.kind===`tensions`&&!e.provisional)&&!r.has(`tension`)&&(r.add(`tension`),a(`tension`,`I see a pull here…`)),e.unsaid&&!r.has(`unsaid`)&&(r.add(`unsaid`),a(`unsaid`,`There's something unsaid circling…`)),n>=8&&!r.has(`depth`)&&(r.add(`depth`),a(`depth`,`This runs deeper than one answer…`))},[e,t,a]),{currentSignal:n[0]??null}}function qd(e){let t=(0,q.c)(29),{mindShape:n,onSettled:r,onAction:i,liveTranscript:a,thoughtCount:o,onConfirmUnsaid:s,onDismissUnsaid:c}=e,{phase:l,spec:u,intent:d}=n,f=(0,W.useRef)(!1),[p,m]=(0,W.useState)(!1),h=(0,W.useRef)(null),g,_;t[0]!==r||t[1]!==l?(g=()=>{l===`settled`&&!f.current&&(f.current=!0,r?.(),m(!0),h.current=setTimeout(()=>m(!1),1800))},_=[l,r],t[0]=r,t[1]=l,t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,W.useEffect)(g,_);let v,y;t[4]===l?(v=t[5],y=t[6]):(v=()=>{l===`idle`&&(f.current=!1,m(!1),h.current&&=(clearTimeout(h.current),null))},y=[l],t[4]=l,t[5]=v,t[6]=y),(0,W.useEffect)(v,y);let b,x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>()=>{h.current&&clearTimeout(h.current)},x=[],t[7]=b,t[8]=x):(b=t[7],x=t[8]),(0,W.useEffect)(b,x);let{currentSignal:S}=Kd(u,l),C=u?.center??``,w;t[9]===u?.atoms?w=t[10]:(w=u?.atoms??[],t[9]=u?.atoms,t[10]=w);let T;t[11]===u?.links?T=t[12]:(T=u?.links??[],t[11]=u?.links,t[12]=T);let E=u?.clusters,D=u?.unsaid,O=l===`settled`?void 0:a,k=l===`settled`?void 0:o,A;return t[13]!==S||t[14]!==d||t[15]!==p||t[16]!==n.removeAtom||t[17]!==i||t[18]!==s||t[19]!==c||t[20]!==l||t[21]!==E||t[22]!==D||t[23]!==O||t[24]!==k||t[25]!==C||t[26]!==w||t[27]!==T?(A=(0,G.jsx)(De,{asBlock:!1,phase:l,center:C,atoms:w,links:T,clusters:E,unsaid:D,intent:d,isRevealing:p,currentSignal:S,onAction:i,onRemoveAtom:n.removeAtom,onConfirmUnsaid:s,onDismissUnsaid:c,liveTranscript:O,thoughtCount:k}),t[13]=S,t[14]=d,t[15]=p,t[16]=n.removeAtom,t[17]=i,t[18]=s,t[19]=c,t[20]=l,t[21]=E,t[22]=D,t[23]=O,t[24]=k,t[25]=C,t[26]=w,t[27]=T,t[28]=A):A=t[28],A}var Jd=[{heading:`Options on the table`,kinds:[`option`]},{heading:`What I want`,kinds:[`want`,`value`]},{heading:`What worries me`,kinds:[`fear`,`contradiction`]},{heading:`Trade-offs`,kinds:[`tradeoff`]},{heading:`Constraints`,kinds:[`constraint`]},{heading:`People involved`,kinds:[`person`]},{heading:`Still open`,kinds:[`open_loop`,`question`]},{heading:`Things I could do`,kinds:[`action`]}];function Yd(e){let t=e.quote&&e.quote.trim()&&e.quote.trim()!==e.label?` ("${e.quote.trim()}")`:``;return`- ${e.label}${t}`}function Xd(e){let t=[];if(e.clusters&&e.clusters.length){let n=new Map(e.atoms.map(e=>[e.id,e])),r=new Set;for(let i of e.clusters){let e=i.atomIds.map(e=>n.get(e)).filter(e=>!!e);if(e.length){t.push(`${i.label}:`);for(let n of e)t.push(Yd(n)),r.add(n.id);t.push(``)}}let i=e.atoms.filter(e=>!r.has(e.id));if(i.length){t.push(`Also on my mind:`);for(let e of i)t.push(Yd(e));t.push(``)}}else for(let n of Jd){let r=e.atoms.filter(e=>n.kinds.includes(e.kind));if(r.length){t.push(`${n.heading}:`);for(let e of r)t.push(Yd(e));t.push(``)}}let n=e.links.filter(e=>e.kind===`tensions`);if(n.length){t.push(`Tensions I feel:`);for(let r of n){let n=e.atoms.find(e=>e.id===r.from)?.label??``,i=e.atoms.find(e=>e.id===r.to)?.label??``;n&&i&&t.push(`- "${n}" ${r.label||`pulls against`} "${i}"`)}t.push(``)}return t.join(`
|
|
58
|
+
`).trim()}function Zd(e,t){let n=e.center?.trim(),r=Xd(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(`
|
|
59
|
+
`).trim()}function Qd(e){return/^(ok(ay)?[,.\s]+)?(any |your |so[,.\s]+)?thoughts\s*[?.!]*$/i.test(e.trim())}function $d(e){let t=e.trim();return t.length>0&&!Qd(t)}function ef(e,t){let n=e.map((e,t)=>`(${t+1}) ${e.trim()}`).join(`
|
|
60
|
+
`);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(`
|
|
61
|
+
`)}var tf=/https?:\/\/[^\s<>"')\]]+/i;function nf(e){let t=e.match(tf);return t?t[0].replace(/[.,;:!?]+$/,``):null}function rf(e){let t=nf(e);return t?e.replace(t,``).trim().split(/\s+/).filter(Boolean).length<=12:!1}function af(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 of=`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 sf(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?!0:e.isContentEditable:!1}var cf=qe.map(e=>{let t=Ye[e];return{id:e,label:t.label,description:`${t.archetype} — ${t.blurb}`,accent:t.tokens.accent}}),lf=`mavea-preso-style`;function uf(e){return cf.some(t=>t.id===e)}function df(){try{let e=localStorage.getItem(lf);return uf(e)?e:`folio`}catch{return`folio`}}function ff(e){try{localStorage.setItem(lf,e)}catch{}}function pf(e){return e<5?`Late night`:e<12?`This morning`:e<17?`This afternoon`:`Tonight`}function mf(e){let t=Math.max(1,Math.round(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function hf(e,t){if(e.length===0||t.length===0)return null;let n=e[0],r=e[e.length-1],i=`${pf(new Date(n.at).getHours())}, so far.`,a=[`${gc(n.at)} – ${gc(r.at)}`,mf(r.at-n.at),`${t.length} ${t.length===1?`topic`:`topics`}`,`${e.length} ${e.length===1?`moment`:`moments`}`].join(` · `),o=Q(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:gc(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}function gf(e){let t=(0,q.c)(10),{transcript:n,mode:r,note:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(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`,{})]}),t[0]=a):a=t[0];let o=n?`“${n}`:`Listening`,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(`span`,{className:`listen-caret`,"aria-hidden":`true`}),t[1]=s):s=t[1];let c=n?`”`:``,l;t[2]!==o||t[3]!==c?(l=(0,G.jsxs)(`div`,{className:`listen-line`,children:[o,s,c]}),t[2]=o,t[3]=c,t[4]=l):l=t[4];let u=i??(r===`always`?`Always on — Mavéa answers when you finish a thought.`:`It sends when you pause — or tap the mic to stop.`),d;t[5]===u?d=t[6]:(d=(0,G.jsx)(`div`,{className:`listen-note`,children:u}),t[5]=u,t[6]=d);let f;return t[7]!==l||t[8]!==d?(f=(0,G.jsx)(`div`,{className:`listen-stage`,children:(0,G.jsxs)(`div`,{className:`listen-card`,role:`status`,"aria-live":`polite`,children:[a,(0,G.jsxs)(`div`,{className:`listen-body`,children:[l,d]})]})}),t[7]=l,t[8]=d,t[9]=f):f=t[9],f}var _f=250;function vf(e){let t=(0,q.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),_f);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(yf),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 yf(e,t){return(0,G.jsxs)(`div`,{className:`skel-card`,children:[(0,G.jsxs)(`span`,{className:`skel-eyebrow`,children:[`✦ `,e.label,`…`]}),e.lines.map(bf)]},t)}function bf(e,t){return(0,G.jsx)(`span`,{className:`skel-line`,style:{width:`${e}%`}},t)}function xf({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 Sf(e){let t=(0,q.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)(z.globe,{}),` Searching the web…`]}),c=e.map(Cf)}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 Cf(e,t){return(0,G.jsxs)(`span`,{className:`turn-chip src`,children:[(0,G.jsx)(`i`,{className:`turn-chip-dot`,"aria-hidden":`true`}),H(e.url)??e.title]},t)}function wf(){return(0,W.useSyncExternalStore)(le,ce,Tf)}function Tf(){return!1}var Ef={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`},Df=/^(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 Of(e,t=4){let n=e.trim().replace(/\s+/g,` `);for(let e=0;e<8;e++){let e=n.replace(Df,``);if(e===n)break;n=e}return n.replace(/[?!.]+$/,``).split(` `).slice(0,t).join(` `).trim()}var kf=[[78,52],[64,88],[82,40]];function Af(e,t){let n=Of(e),r=vt(e,t),i=Object.entries(r).filter(([e,t])=>t>0&&Ef[e]).sort((e,t)=>t[1]-e[1]).map(([e])=>Ef[e]),a=_t(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:kf[t%kf.length]}))}function jf(e){let t=e&&Ef[e]||(e===`text`?`Finding`:null);return{label:t?`Building — ${t.toLowerCase()}`:`Building`,lines:kf[0]}}function Mf(e){return e.paletteOpen||e.shareOpen||e.exportOpen||e.dashOpen||e.showSettings||e.proofOpen||e.showHow||e.replayAt!==null||e.recapOpen||e.atlasOpen||e.rehearsalOpen||e.delegateOpen||e.srsOpen||e.zoomLevel!==null||e.mindViewOpen}function Nf(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 Pf=`Voice input needs Chrome or Edge — type instead.`,Ff=`Microphone access is blocked — allow mic access for this site to talk to Mavéa.`,If=`Couldn't reach your microphone — check it's connected and not in use by another app.`;function Lf(){let e=(0,q.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){a(`You can attach up to 6 files.`);return}let i=[],o=null;for(let n of e.slice(0,t)){let e=await Fe(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).`}}e.length>t&&(o=`Only the first ${t} file(s) were added.`),i.length&&r(e=>[...e,...i]),o&&a(o)},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 Rf=`mavea-live-bookmarks`;function zf(){let[e,t]=(0,W.useState)(()=>{try{let e=localStorage.getItem(Rf);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(Rf,JSON.stringify([...n]))}catch{}return n})},[])}}var Bf=`mavea-live-ask-hint`;function Vf(){let e=(0,q.c)(3),[t,n]=(0,W.useState)(Hf),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(!0);try{localStorage.setItem(Bf,`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 Hf(){try{return localStorage.getItem(Bf)===`1`}catch{return!1}}u();var Uf=(0,W.lazy)(()=>M(()=>import(`./TopicCanvas-CT0eSj2M.js`).then(e=>e.n).then(e=>({default:e.TopicCanvas})),__vite__mapDeps([31,1,2,3,4,5,6,32,8,16,33,34,35,36,37,38,39,40,41,42,17,43,18,44,27,14,45]))),Wf=[{col:6},{col:6},{col:12}],Gf=`mavea-live-rail-collapsed-v1`,Kf=`mavea-mic-hold-preferred`,qf=3e3,Jf=l(()=>M(()=>import(`./HowItWorks-C0zosIvq.js`).then(e=>({default:e.HowItWorks})),__vite__mapDeps([46,3,1,4,31,2,5,6,32,8,16,33,34,35,36,37,38,39,40,41,42,17,43,18,44,27,14,45,47,48,49,50,51,52,53,54,55,56,20,57,58,59,60,61,28]))),Yf=Jf.Component,Xf=l(()=>M(()=>import(`./CommandPalette-Kl00mMZm.js`).then(e=>({default:e.CommandPalette})),__vite__mapDeps([62,2,1,3,4,5,6,16,63,64]))),Zf=Xf.Component,Qf=l(()=>M(()=>import(`./Library-D2XGNXz7.js`).then(e=>({default:e.Library})),__vite__mapDeps([65,2,1,3,4,5,6,8,16,66,67,22,13,14,15,23,24,68,69]))).Component,$f=l(()=>M(()=>import(`./LiveSettings-D9OcWlm6.js`).then(e=>({default:e.LiveSettings})),__vite__mapDeps([70,2,1,3,4,5,6,13,14,15,16,55,56,71,23,24,72,73,74,75,76,77,22,78,79,58,20,68,57,80]))),ep=$f.Component,tp=l(()=>M(()=>import(`./DashboardDetail-B50ZkeVK.js`).then(e=>({default:e.DashboardDetail})),__vite__mapDeps([81,2,1,3,4,5,6,31,32,8,16,33,34,35,36,37,38,39,40,41,42,17,43,18,44,27,14,45,47,48,49,50,51,52,53,54,55,56,20,57,58,59,60,19,71,23,24,72,73,74,75,76,13,15,82,83,84,85,86,87,88,89,25,26,90,91,92,93]))).Component,np=l(()=>M(()=>import(`./DashboardSettings-Dmw6JTbI.js`).then(e=>({default:e.DashboardSettings})),__vite__mapDeps([94,2,1,3,4,5,6,71,23,24,72,73,74,75,76,13,14,15,84,87]))).Component,rp=l(()=>M(()=>import(`./UnderstoodPanel-CHPD2Ttj.js`).then(e=>({default:e.UnderstoodPanel})),__vite__mapDeps([95,2,1,3,4,5,6,96]))).Component,ip=l(()=>M(()=>import(`./ZoomDeck-BQHO79ZU.js`).then(e=>({default:e.ZoomDeck})),__vite__mapDeps([97,2,1,3,4,5,6,98,16,57,99,100]))),ap=ip.Component,op=l(()=>M(()=>import(`./AtlasView-Dl2fssaG.js`).then(e=>({default:e.AtlasView})),__vite__mapDeps([101,3,1,4,66,67,8,22,13,14,15,23,24,102,72,68,103]))),sp=op.Component,cp=l(()=>M(()=>import(`./RippleOverlay-DMHLbfh8.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([104,2,1,3,4,5,6,41,55,56,105,106,107,108,24,57,109]))),lp=cp.Component,up=l(()=>M(()=>import(`./CardEditor-DzJXb0G7.js`).then(e=>({default:e.CardEditor})),__vite__mapDeps([110,3,1,4,74,57,111]))).Component,dp=l(()=>M(()=>import(`./CourseRail-q6x5cCpW.js`).then(e=>({default:e.CourseRail})),__vite__mapDeps([112,2,1,3,4,5,6,16,113,13,14,15,114,115,116,74,76,24,117]))).Component,fp=l(()=>M(()=>import(`./MindMapViewerDrawer-YYyZqmAd.js`).then(e=>({default:e.MindMapViewerDrawer})),__vite__mapDeps([118,2,1,3,4,5,6,119,41,120,51,121,16]))).Component,pp=l(()=>M(()=>import(`./Recap-H5fhj5Tc.js`).then(e=>({default:e.Recap})),__vite__mapDeps([122,2,1,3,4,5,6,57,123]))),mp=pp.Component,hp=l(()=>M(()=>import(`./LibraryOverlay-B2WQSgwr.js`).then(e=>({default:e.LibraryOverlay})),__vite__mapDeps([124,2,1,3,4,5,6,98,16,65,8,66,67,22,13,14,15,23,24,68,69,125]))),gp=hp.Component,_p=l(()=>M(()=>import(`./ReplayOverlay-DXmVdeIr.js`).then(e=>({default:e.ReplayOverlay})),__vite__mapDeps([126,3,1,4,31,2,5,6,32,8,16,33,34,35,36,37,38,39,40,41,42,17,43,18,44,27,14,45,47,48,49,50,51,52,53,54,55,56,20,57,58,59,60,61]))).Component,vp=l(()=>M(()=>import(`./ShareModal-ClnEkudw.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([49,1,2,3,4,5,6,50,51,52,53,54,16,55,56,20,44,57,58,59]))),yp=vp.Component,bp=l(()=>M(()=>import(`./ExportModal-D65cGyj_.js`).then(e=>({default:e.ExportModal})),__vite__mapDeps([127,2,1,3,4,5,6,8,128,129,130,36,37,38,16,39,131,40,132,133,42,43,134,18,135,32,33,136,137,11,138,139,140,141,142,143,144,145,146,147,148,149,119,41,120,51,121,150,151,152,153,19,154,155,156,157,158,159,160,34,35,161,162,163,164,165,166,167,168,169,170,171,172,98,57,173,174,175,176,177,178,179,180,181,182,12,183,184,53,185,54,55,56,186]))),xp=bp.Component,Sp=l(()=>M(()=>import(`./ExtractionPreview-Iwfg2Ogl.js`).then(e=>({default:e.ExtractionPreview})),__vite__mapDeps([187,2,1,3,4,5,6,13,14,15,71,23,24,72,73,74,75,76,86,83,20,84,58,87,88,89,25,26,188,78,57,93]))),Cp=Sp.Component,wp=l(()=>M(()=>import(`./PinToDashboard-_kIOHs0k.js`).then(e=>({default:e.PinToDashboard})),__vite__mapDeps([189,2,1,3,4,5,6,8,16,71,23,24,72,73,74,75,76,13,14,15,90,86,83,20,84,58,87,88,89,25,26,91,57]))).Component,Tp=l(()=>M(()=>import(`./PrismOverlay-B7lEspdu.js`).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([190,2,1,3,4,5,6,13,14,15,19,44,191,192,193,194,195,29,21,57,196]))),Ep=Tp.Component,Dp=l(()=>M(()=>import(`./SynthesisOverlay-CkERphvG.js`).then(e=>({default:e.SynthesisOverlay})),__vite__mapDeps([197,2,1,3,4,5,6,13,14,15,190,19,44,191,192,193,194,195,29,21,57,196]))),Op=Dp.Component,kp=l(()=>M(()=>import(`./RehearsalPanel-BVgjrOPg.js`).then(e=>({default:e.RehearsalPanel})),__vite__mapDeps([198,2,1,3,4,5,6,13,14,15,55,56,20,57,58,199]))),Ap=kp.Component,jp=l(()=>M(()=>import(`./PresentationDeck-BDoGecxr.js`).then(e=>({default:e.PresentationDeck})),__vite__mapDeps([200,2,1,3,4,5,6,128,129,130,36,37,38,16,39,131,40,132,133,42,43,134,18,135,32,8,33,136,137,11,138,139,140,141,142,143,144,145,146,147,148,149,119,41,120,51,121,150,151,152,153,19,154,155,156,157,158,159,160,34,35,161,162,163,164,165,166,167,168,169,170,171,172,98,57,173,174,175,176,177,178,179,180,181,182,12,183,184,53,185,201]))),Mp=jp.Component,Np=l(()=>M(()=>import(`./DelegatePanel-BK7rEhIc.js`).then(e=>({default:e.DelegatePanel})),__vite__mapDeps([202,2,1,3,4,5,6,13,14,15,55,56,201,57,120,51,203]))),Pp=Np.Component,Fp=l(()=>M(()=>import(`./SrsReview-BoaYb6XN.js`).then(e=>({default:e.SrsReview})),__vite__mapDeps([204,3,1,4,73,74,75,57,205]))),Ip=Fp.Component,Lp=l(()=>M(()=>import(`./TourPrism-BvucSkcs.js`).then(e=>({default:e.TourPrism})),__vite__mapDeps([206,2,1,3,4,5,6,190,13,14,15,19,44,191,192,193,194,195,29,21,57,196]))),Rp=Lp.Component;function $({children:e,label:t=`Feature`}){return(0,G.jsx)(O,{label:t,overlay:!0,children:e})}function zp(){try{window.location.hash=``}catch{}}function Bp(e){return D(e)??Promise.resolve()}function Vp(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 Hp(){let[e]=qt(),t=Ze(e.provider),n=e.models[e.provider]||t.defaultModel;(0,W.useLayoutEffect)(()=>(m(document,`#/live`),()=>ee(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 l=(0,W.useRef)(g()),u=(0,W.useRef)(In()),d=(0,W.useRef)(A()),h=(0,W.useRef)(d.current?I():null),x=(0,W.useRef)(d.current?P():!1),S=(0,W.useRef)((()=>{if(d.current)return null;let e=_();return e&&N(e)?e:null})()),w=(0,W.useRef)(S.current?s():null);(0,W.useEffect)(()=>{d.current&&b(),h.current&&v(),x.current&&f(),S.current&&c()},[]);let[T,D]=(0,W.useState)(``),{attached:O,setAttached:k,attachError:M,setAttachError:F,turnHadFiles:L,setTurnHadFiles:te,onFiles:ne,removeAttachment:ie}=Lf(),[B,se]=(0,W.useState)([]),[le,pe]=(0,W.useState)(!1),{askHintSeen:me,dismissAskHint:ye}=Vf(),[V,xe]=(0,W.useState)(!1),[De,Oe]=(0,W.useState)(null),[H,Ae]=(0,W.useState)(null),[je,Me]=(0,W.useState)(null),[U,Ne]=(0,W.useState)(!1),[Fe,Le]=(0,W.useState)(!1),[Ue,We]=(0,W.useState)(!1),[Ge,qe]=(0,W.useState)(!1),[Je,Ye]=(0,W.useState)(null),[Qe,et]=(0,W.useState)(!1),[nt,at]=(0,W.useState)(null),[lt,ut]=(0,W.useState)(null),[ft,pt]=(0,W.useState)(()=>new Set),[mt,ht]=(0,W.useState)(null),[_t,vt]=(0,W.useState)(null),yt=(0,W.useRef)(void 0),[bt,xt]=(0,W.useState)(null),St=(0,W.useRef)(void 0),[wt,Et]=(0,W.useState)(!1),[Dt,Ot]=(0,W.useState)(!1),[Mt,Ft]=(0,W.useState)(!1),[It,Lt]=(0,W.useState)(!1),[Rt,zt]=(0,W.useState)(!1),[Bt,Gt]=(0,W.useState)(()=>xn().length),Kt=Pt().length;(0,W.useEffect)(()=>{let e=()=>void gt(),t={once:!0,passive:!0};return window.addEventListener(`keydown`,e,t),window.addEventListener(`pointerdown`,e,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`pointerdown`,e)}},[]),(0,W.useEffect)(()=>Rn(),[]);let[Qt,$t]=(0,W.useState)(null),[en,tn]=(0,W.useState)(null),[rn,an]=(0,W.useState)(null),sn=(0,W.useCallback)(e=>{e.length>=4?an(e):e.length>0&&$t(e)},[]),[ln,un]=(0,W.useState)(null);(0,W.useEffect)(()=>{C()&&(y(),un(Sn))},[]);let[Dn,jn]=(0,W.useState)({open:!1,spec:null}),[Fn,Hn]=(0,W.useState)(!1),[Un,Wn]=(0,W.useState)(!1),Jn=(0,W.useRef)(!1);Jn.current=Un;let[Yn,Zn]=(0,W.useState)(()=>df()),[Qn,$n]=(0,W.useState)(!1),[er,tr]=(0,W.useState)(new Set),[nr,rr]=(0,W.useState)(null),[ir,or]=(0,W.useState)(null),[cr,lr]=(0,W.useState)(null),[dr,fr]=(0,W.useState)(!1),pr=(0,W.useCallback)((e,t=!1)=>{lr(e),fr(e!==null&&t)},[]),mr=(0,W.useCallback)(()=>{lr(null),fr(!1)},[]),hr=(0,W.useRef)(new Eu).current,gr=(0,W.useMemo)(()=>e.quality===`fast`?null:Ht(e),[e]),[_r,vr]=(0,W.useState)(!1),yr=(0,W.useRef)(!1);yr.current=_r;let br=(0,W.useRef)([]),[xr,Sr]=(0,W.useState)(0),Cr=(0,W.useRef)(0),[wr,Tr]=(0,W.useState)(!1),Er=(0,W.useRef)(!1);Er.current=wr;let Dr=(0,W.useRef)([]),Or=(0,W.useMemo)(()=>Ht(e),[e]),K=Ud(Or),kr=(0,W.useRef)(K);kr.current=K;let Ar=(0,W.useRef)(null),jr=nn(),[Mr,Nr]=(0,W.useState)(!1),[Pr,Fr]=(0,W.useState)(()=>{try{return localStorage.getItem(Gf)===`true`}catch{return!1}});(0,W.useEffect)(()=>{try{localStorage.setItem(Gf,String(Pr))}catch{}},[Pr]);let[q,Lr]=(0,W.useState)(!1),[Rr,zr]=(0,W.useState)(!1),[Br,Vr]=(0,W.useState)(!1),[Hr,Ur]=(0,W.useState)(),[Gr,qr]=(0,W.useState)(!1);(0,W.useEffect)(()=>{Br||qr(!1)},[Br]);let{open:Jr,openPalette:Yr,closePalette:Xr}=a(),[Zr,Qr]=(0,W.useState)(!1),[$r,ei]=(0,W.useState)(0),[ti,ni]=(0,W.useState)(0),[ri,ii]=(0,W.useState)(!1),[J,ai]=(0,W.useState)(()=>{try{return localStorage.getItem(Ri)===`true`}catch{return!1}}),oi=(0,W.useRef)(null),[si,li]=(0,W.useState)(()=>{try{return localStorage.getItem(Kf)===`true`}catch{return!1}});(0,W.useEffect)(()=>{try{let e=de(localStorage.getItem(`mavea-voice-mavea`)||`heart`);e&&oe(`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&&(zr(!0),e&&clearTimeout(e),e=setTimeout(()=>zr(!1),2600))};return window.addEventListener(dt,t),()=>{window.removeEventListener(dt,t),e&&clearTimeout(e)}},[]),(0,W.useEffect)(()=>{try{localStorage.setItem(Ri,String(J))}catch{}},[J]),(0,W.useEffect)(()=>{try{localStorage.setItem(Kf,String(si))}catch{}},[si]);let di=(0,W.useRef)(null),fi=(0,W.useRef)(U);fi.current=U;let mi=(0,W.useRef)(null),hi=(0,W.useCallback)(e=>{fi.current||di.current?.setMaveaSpeaking(!0);let t=!ce(),n=ue(e,`mavea`);return t&&(mi.current=n),n},[]);(0,W.useEffect)(()=>{re(U),U?di.current?.setMaveaSpeaking(!1):ce()&&di.current?.setMaveaSpeaking(!0)},[U]);let[_i]=(0,W.useState)(()=>l.current||u.current?(rt(),null):d.current||S.current?null:tt()),vi=(0,W.useRef)(it()).current,Y=Xo({canRun:E,getConfig:()=>Ht(Ut()),getCaps:()=>Vt(Ut()),speak:hi,cancelSpeak:he,getLibraryEnabled:()=>Ut().libraryEnabled,initial:_i?Yo(_i):void 0}),yi=hd(V,De,gr,Y.busy),bi=(0,W.useCallback)(()=>{window.location.hash=`#/live`,window.location.reload()},[]),xi=(0,W.useCallback)(()=>{j(),window.location.hash=`#/live`,window.location.reload()},[]),Si=(0,W.useRef)(`normal`);Si.current=Y.phase;let Ti=(0,W.useRef)(null);Ti.current=Y.activeBlank;let Ei=(0,W.useRef)([]);Ei.current=Y.spec?.blanks??[],(0,W.useEffect)(()=>{Jt()},[]),(0,W.useEffect)(()=>{d.current||S.current||Y.frames.length>0&&$e(Y.history,Y.frames)},[Y.frames,Y.history]),(0,W.useEffect)(()=>{if(!(Y.frames.length===0||Y.busy))return p(vp.preload)},[Y.frames.length,Y.busy]),(0,W.useEffect)(()=>{if(!d.current)return;let e=x.current&&h.current===`prism`;if(!(x.current&&!e))return p(()=>Promise.all([Lp.preload(),pi()]).then(()=>void 0),e?300:2500)},[]);let Di=(0,W.useMemo)(()=>Y.frames.map((e,t)=>({index:t,label:e.question||`Answer ${t+1}`,spec:e.spec})),[Y.frames]),Oi=(0,W.useCallback)(e=>{if(e.length){if(!dn().styleAsked&&_n().length===e.length){xt({count:e.length,deck:e[0].deck}),St.current&&clearTimeout(St.current),St.current=setTimeout(()=>{fn(),xt(null)},12e3);return}vt({count:e.length,ids:e.map(e=>e.id)}),yt.current&&clearTimeout(yt.current),yt.current=setTimeout(()=>vt(null),6e3)}},[]),ji=(0,W.useCallback)(e=>{St.current&&clearTimeout(St.current),e?pn(e):fn(),xt(null)},[]);(0,W.useEffect)(()=>()=>{yt.current&&clearTimeout(yt.current),St.current&&clearTimeout(St.current)},[]),(0,W.useEffect)(()=>{if(!e.autoSaveFlashcards)return;let t=Y.frames[Y.frames.length-1];if(!t)return;let n=zl(t.spec.blocks);n.length>0&&Oi(hn(n,{deck:t.spec.topic||t.spec.title||`General`,origin:`auto`}))},[Y.frames,e.autoSaveFlashcards,Oi]);let Bi=(0,W.useCallback)(t=>{let n=Y.viewSpec??Y.spec,r=n?.topic||n?.title||`General`,{cards:i,exact:a}=Xl(t),o={ts:Date.now(),...t.id?{blockId:t.id}:{},...H?{question:H}:{},...n?.topic?{topic:n.topic}:{}},s=Ht(e),c=!!s.apiKey;ht({block:t,initial:i,deck:r,source:o,enrich:!a&&c?()=>eu(t,s):void 0})},[Y.viewSpec,Y.spec,H,e]),Vi=(0,W.useRef)(null),Hi=(0,W.useRef)(null),Ui=(0,W.useRef)(()=>{}),Wi=(0,W.useRef)([]),qi=(0,W.useRef)(()=>{}),Ji=(0,W.useRef)(()=>{});qi.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;Wi.current.forEach(e=>window.clearTimeout(e)),Wi.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++)Wi.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=Wi.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]);let Yi=(0,W.useRef)(()=>{}),Xi=(0,W.useRef)(null),Zi=(0,W.useRef)(null),Qi=(0,W.useRef)(null),$i=(0,W.useRef)(!1),ea=(0,W.useRef)(null),ta=(0,W.useRef)(!1),na=(0,W.useRef)(null),[ra,oa]=(0,W.useState)(!1),[sa,ca]=(0,W.useState)(!1),la=(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]),ua=(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]),da=(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]),[fa,pa]=(0,W.useState)([]),ma=(0,W.useRef)(Date.now()),ha=(0,W.useRef)(null),ga=(0,W.useRef)(null),_a=(0,W.useCallback)(e=>{ga.current=e,ha.current??=requestAnimationFrame(()=>{ha.current=null,ga.current!=null&&Oe(ga.current)})},[]);(0,W.useEffect)(()=>()=>{ha.current!=null&&cancelAnimationFrame(ha.current)},[]),(0,W.useEffect)(()=>{pa([]),ma.current=Date.now()},[Y.turn]);let[ya,ba]=(0,W.useState)(!1);(0,W.useEffect)(()=>ba(!1),[Y.turn]);let[xa,Sa]=(0,W.useState)(()=>new Set);(0,W.useEffect)(()=>Sa(new Set),[Y.turn]);let[Ca,wa]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=Vi.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>wa(e.clientWidth>=1280),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[Y.turn]);let Ta=(0,W.useMemo)(()=>fa.filter(e=>e.noteText&&!xa.has(e.spot)).map(e=>({spot:e.spot,text:e.noteText})),[fa,xa]),{bookmarks:Ea,toggleBookmark:Da}=zf(),Oa=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(!ya)return;function e(e){Oa.current&&!Oa.current.contains(e.target)&&ba(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[ya]);let ka=(0,W.useRef)(Y.spec);ka.current=Y.spec;let Aa=(0,W.useCallback)((e,t,n,r,i,a,o,s)=>{e&&pa(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?ka.current?.blocks.find(t=>t.id===e)??null:null,u=n?.kind===`connect`&&typeof n.onIndex==`number`?ka.current?.blocks[n.onIndex]?.id:void 0,d={spot:e,line:t??(l?we(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]})},[]),ja=e.teachMode||Oc(H),Ma=(0,W.useRef)(e.annotationsEnabled);Ma.current=e.annotationsEnabled;let Na=(0,W.useRef)(J);Na.current=J;let Pa=(0,W.useRef)(null);Pa.current=Y.narration??null;let Fa=(0,W.useRef)(!1),Ia=(0,W.useRef)(Y.frames);Ia.current=Y.frames;let La=(0,W.useRef)([]),Ra=(0,W.useCallback)(()=>{let e=!Ma.current;Wt({annotationsEnabled:e,teachMode:e}),e?(pa(La.current),La.current=[]):pa(e=>(La.current=e,[]))},[]),za=(0,W.useRef)(null),Ba=(0,W.useCallback)((e,t)=>{let n=Hi.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=Vi.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`)),za.current!=null&&window.clearTimeout(za.current),za.current=window.setTimeout(()=>{o.forEach(e=>e.classList.remove(`ink-jump-glow`)),za.current=null},800)},[]);(0,W.useEffect)(()=>()=>{za.current!=null&&window.clearTimeout(za.current)},[]);let Va=(0,W.useRef)(null),Ha=(0,W.useCallback)((e,t)=>{Y.jumpTo(e),t&&(Va.current!=null&&cancelAnimationFrame(Va.current),Va.current=requestAnimationFrame(()=>{Va.current=null,Ba(t)}))},[Y,Ba]);(0,W.useEffect)(()=>()=>{Va.current!=null&&cancelAnimationFrame(Va.current)},[]);let Ua=(0,W.useCallback)(e=>{Sa(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[Wa,Ga]=ar(),[Ka,qa]=(0,W.useState)(0),Ja=(0,W.useRef)(Wa);Ja.current!==Wa&&(Ja.current=Wa,qa(e=>e+1));let Ya={isBusy:()=>Y.busy||ta.current,isSpeaking:()=>ce(),hasCanvas:()=>!!Y.spec,showFrame:(e,t)=>{Ae(t),D(``),Y.showFrame(e,t,{interrupt:!1,revealNow:fi.current})},typeInto:D,speak:e=>(tc(e),hi(e)),cancelSpeech:he,setMuted:Ne,setViewMode:Ga,setInkArmed:pe,setPresenting:Wn,setShareOpen:Le,setPaletteOpen:e=>e?Yr():Xr(),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=ka.current?.blocks.find(e=>!!e.id);e&&Go(e)},pinFirstBlocks:e=>{se((ka.current?.blocks??[]).filter(e=>!!e.id).slice(0,e))},startWatchThinking:()=>{Tr(!0),Er.current=!0},bankThought:e=>{Dr.current=[...Dr.current,e],K.onTranscript(Dr.current.join(` `))},openAtlas:()=>{if(xn().length<3){for(let e of[`money`,`space`,`travel`,`budget`]){let t=ur(e),n=t?.frames[0]?.spec;t&&n&&Xt(n,t.question)}Gt(bn(Zt()))}zt(!0)},openPrism:e=>{pi().then(t=>{$a.current.chapter?.action.kind===`prism`&&tn(t[e]??null)})},showcaseFeature:e=>{if(e===`library`&&Zt().length<3)for(let e of[`money`,`space`,`travel`]){let t=ur(e),n=t?.frames[0]?.spec;t&&n&&Xt(n,t.question)}if(e===`deepzoom`){window.location.hash=`#/deepzoom?demo=1`;return}if(e===`synthesis`){window.location.hash=`#/synthesis?demo=1`;return}Xa.current[e]?.run()},setSpot:e=>Y.setSpot(e),scriptedMark:()=>Ui.current(),drawPenTourStep:e=>{Ma.current||(Ma.current=!0,Wt({annotationsEnabled:!0,teachMode:!0})),e===`result`?(Vi.current?.scrollTo({top:0,behavior:`smooth`}),Aa(`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)):Aa(`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&&(Ma.current||(Ma.current=!0,Wt({annotationsEnabled:!0,teachMode:!0})),Vi.current?.scrollTo({top:0,behavior:`smooth`}),Aa(e.id,e.note,void 0,!0,void 0,3200))},openDashboards:()=>{let e=gi();e?Ye(e):qe(!0)},dashboardShowSettings:()=>et(!0),openModelSettings:()=>{Ur(`model`),Vr(!0)},openExport:()=>We(!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:()=>Fr(e=>!e),bendIt:()=>qi.current(),openFlashcards:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e&&Bi(e)},openTourCourse:()=>Ji.current(),fireMemoryGlow:()=>{zr(!0),window.setTimeout(()=>zr(!1),2600)},stopRevealWalk:()=>{$i.current=!0},closeAllOverlays:()=>{Y.setSpot(null),se([]),D(``),Ga(`everything`),pe(!1),Yi.current(),pa([]),Sa(new Set),ba(!1),Wn(!1),Le(!1),Xr(),un(null),zt(!1),$t(null),tn(null),an(null),ht(null),Hn(!1),Lt(!1),We(!1),qe(!1),Ye(null),et(!1),Fr(!1),Ot(!1),Ft(!1),Vr(!1),Tr(!1),vr(!1),jo(null),No(0),Fo(null)}},Xa=(0,W.useRef)({}),Za=Ir({active:d.current,startChapter:h.current,solo:x.current,ops:Ya}),Qa=ci({active:!!S.current,personaId:S.current,startStep:w.current,ops:Ya}),$a=(0,W.useRef)(Za);$a.current=Za,(0,W.useEffect)(()=>{if(!d.current)return;let e=e=>{let t=$a.current;e.key===`Escape`?t.skip():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 eo=(0,W.useRef)(Qa);eo.current=Qa,(0,W.useEffect)(()=>{if(!S.current)return;let e=e=>{let t=eo.current;e.key===`Escape`?t.skip():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{narrate:to,narratingId:no}=Xn({takeWheel:()=>{$i.current=!0},hush:he,moveSpot:e=>{Y.setSpot(e.id??null),Ma.current&&Aa(e.id,e.note??(e.id?la.get(e.id):void 0)??void 0,e.id?ua.get(e.id):void 0,!0)},canSpeak:()=>!fi.current,lineFor:e=>e.noteSpoken??e.note??(e.id?la.get(e.id):void 0)??Te(e),speakLine:hi},Y.turn),[ro,io]=(0,W.useState)(!1),[ao,oo]=(0,W.useState)(!!_i||!!l.current&&Qo()||!!u.current&&Qo()||d.current||!!S.current),so=on();(0,W.useEffect)(()=>{Gt(bn(so))},[so]),(0,W.useEffect)(()=>{let e=Y.spec;if(!e||ea.current===Y.turn)return;if(ea.current=Y.turn,_i&&Y.turn===0){Y.spot&&Y.setSpot(null);return}if(d.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=st(e.blocks,{opener:Y.narration,tour:t,maxStops:5}):ot({blockCount:e.blocks.length,mode:Y.mode,hasModelTour:!1,teach:ja})&&(n=st(e.blocks,{opener:Y.narration,maxStops:ja?e.blocks.length:3,startId:Y.spot??void 0})),!n.length){Y.spot&&Y.setSpot(null);return}let r=t.length>0,i=fi.current&&r&&Ma.current;oa(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(fi.current){if(Ma.current){let e=bo({stops:a,spokenWalk:r,withNotes:i,teach:ja,marksById:da});for(let t of e)Aa(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}Y.setSpot(null);return}$i.current=!1,ta.current=!0;let o=!1,s,c,l=0,u=null,f=()=>{u&&=(u(),null)},p=()=>{ta.current=!1,na.current=null,c&&clearTimeout(c),ca(!1),tc(null)},m=()=>o?!0:$i.current?(p(),Y.setSpot(null),!0):!1,h=(e,t)=>{if(e!==void 0&&Y.setSpot(e??null),r&&t&&tc(t),e&&Ma.current){let n=da.get(e);if(n?.length){let r=co+(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;Aa(e,t,n[a],ja,o,s,i?a+1:void 0)}}else ja&&Aa(e,t,void 0,ja)}},g=e=>{let t=e&&!fi.current&&!Se()?ke(e):null;if(!t){v();return}u=t.release,Co(t,{speakLine:hi,isCancelled:()=>o,isDismissed:()=>$i.current},e=>{if(u=null,e===`dismissed`){p(),Y.setSpot(null);return}e!==`cancelled`&&v()})},_=async(e,t,n,r,i)=>{let a=e.ms??1700;if(t===0||!i){if(h(n,r),await Ii({floorMs:wi,capMs:Mi(a)}),m())return;g(n);return}let o=hi(i),s=await Pi(o);m()||(h(n,r),s?await Fi(o,a):await Ni(a),!m()&&g(n))},v=()=>{if(o||l>=n.length){p();return}if($i.current){p(),Y.setSpot(null);return}let e=l,t=n[l++],i=t.set&&`caption`in t.set?t.set.caption:void 0,a=t.set&&`spot`in t.set?t.set.spot:void 0,c=(a?la.get(a):void 0)??i;r?_(t,e,a,i,c):(h(a,i),s=setTimeout(v,t.ms??0))};return na.current=()=>{if(o=!0,s&&clearTimeout(s),f(),he(),Ma.current){let e=bo({stops:a,from:l,spokenWalk:r,withNotes:!1,teach:ja,marksById:da});for(let t of e)Aa(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}p(),Y.setSpot(null)},(async()=>{c=setTimeout(()=>{o||ca(!0)},600);let t=Vi.current;await Li({loadFams:()=>ve(be(e.blocks)),settle:t?()=>Ke(t,{timeoutMs:ki,perImageMs:Ai}):void 0,firstLine:mi.current,wantVoice:!fi.current&&fe()!==!1}),c&&clearTimeout(c),ca(!1),!m()&&v()})(),()=>{o=!0,na.current=null,ta.current=!1,s&&clearTimeout(s),c&&clearTimeout(c),ca(!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=Vi.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=da.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,da]);let lo=(0,W.useCallback)(()=>{Y.spot&&($i.current=!0,Y.setSpot(null))},[Y]),uo=(0,W.useCallback)(()=>{let e=na.current;e?e():(he(),lo())},[lo]),[fo,po]=(0,W.useState)(!1),[mo,go]=(0,W.useState)(!1),_o=(0,W.useCallback)(async(...e)=>{(0,Vn.flushSync)(()=>po(!0)),go(!0);try{await ve(be(e[0].blocks))}catch{}finally{go(!1)}Y.restore(...e)},[Y]);(0,W.useEffect)(()=>{po(!1)},[Y.turn]),(0,W.useEffect)(()=>{if(!Y.spot)return;let e=e=>{e.key===`Escape`&&uo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Y.spot,uo]);let[vo,yo]=(0,W.useState)(null);(0,W.useEffect)(()=>yo(null),[Y.turn]),(0,W.useEffect)(()=>Qr(!1),[Y.turn]),(0,W.useEffect)(()=>se([]),[Y.turn]),(0,W.useEffect)(()=>Nr(!1),[Y.turn]);let[xo,So]=(0,W.useState)(null),wo=(0,W.useRef)(!1),To=(0,W.useCallback)(e=>{wo.current=!0,So(e)},[]);(0,W.useEffect)(()=>{if(wo.current){wo.current=!1;return}So(null)},[Y.turn]);let Eo=(()=>{let e=Y.spec?.blocks.find(e=>e.type===`insight`);return e&&e.type===`insight`?e.props.conf:void 0})(),Do=ul({resetKey:Y.turn,onCommit:e=>{let{intents:t,blocks:n}=hl(e,(Y.viewSpec??Y.spec)?.blocks??[]);if(!t.length)return;let r=ml([...B,...n]);se([]),Y.run(pl(t),void 0,r.length?r:void 0,void 0,t)}});Ui.current=()=>{let e=Hi.current,t=e?.querySelector(`[data-spot-id]`);!e||!t||(t.scrollIntoView({block:`center`,behavior:`smooth`}),window.setTimeout(()=>Oo(e,t),560))};let Oo=(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??``)).sort((e,t)=>parseFloat(getComputedStyle(t).fontSize)-parseFloat(getComputedStyle(e).fontSize))[0]??t).getBoundingClientRect(),i=n.getBoundingClientRect(),a=Nf(r,i);Do.onStroke(a,{stage:e,svgRect:i});let o=t.getAttribute(`data-spot-id`);o&&Y.setSpot(o)};Yi.current=()=>Do.clear();let ko=(0,W.useCallback)((t,n=!1)=>{let r=t.trim();if(Er.current&&r){D(``),Dr.current=[...Dr.current,r],K.onTranscript(Dr.current.join(` `));return}if(r&&(/^diff --git /m.test(r)||/^@@ .* @@/m.test(r))){let t=wn(Cn(r));if(t.changes.length>0){D(``),un(t);let n=Ht(e);n&&Tn(t,r,n).then(e=>un(t=>t&&e));return}}if(!r&&O.length===0&&Do.intents.length===0)return;Oe(null),Ae(r||null),D(``);let i=O;te(i.length>0),k([]),F(null);let a=Y.viewSpec??Y.spec,{intents:o,blocks:s}=hl(Do.intents,a?.blocks??[]),c=ml([...B,...s]);se([]),Do.clear(),Y.run(r||pl(o),i.length?i:void 0,c.length?c:void 0,void 0,o.length?o:void 0,void 0,void 0,n?{force:!0}:void 0)},[Y,O,B,Do,K,e,Oe,k,F,te]);(0,W.useEffect)(()=>{if(l.current&&Qo()){let e=l.current;l.current=``,ko(e)}},[]);let[Ao,jo]=(0,W.useState)(null),[Mo,No]=(0,W.useState)(0),[Po,Fo]=(0,W.useState)(null),Io=(0,W.useRef)(null),Lo=(0,W.useCallback)((e,t)=>{let n=e.lessons[t];if(!n)return;let r=An(e.id);jo(e),No(t),Fo(r),kn(e.id,t),oo(!0);let i=`Lesson ${t+1}: ${n.title}`,a=En(e.id,n.id);if(a){Ae(i),Y.showFrame(a,i);return}let o=Ln(e,t,r,zn(e.topic));Io.current={courseId:e.id,lessonId:n.id,framesBefore:Y.frames.length},Ae(i),Y.run(`Teach this lesson: "${n.title}" — ${n.goal}`,void 0,void 0,void 0,void 0,i,void 0,{lesson:o})},[Y]);Ji.current=()=>{let e=iu();if(!e)return;let t=e.lessons[0];jo(e),No(0),Fo(An(e.id)),kn(e.id,0),oo(!0);let n=En(e.id,t.id);if(n){let e=`Lesson 1: ${t.title}`;Ae(e),Y.showFrame({...n,narration:``,tour:[]},e,{interrupt:!1})}},(0,W.useEffect)(()=>{let e=u.current;if(!e||(u.current=void 0,!Qo()))return;let t=Mn(e.courseId);t&&Lo(t,Math.min(Math.max(e.lessonIdx,0),t.lessons.length-1))},[]),(0,W.useEffect)(()=>{let e=Io.current;!e||Y.busy||(Io.current=null,!(Y.frames.length<=e.framesBefore)&&Nn(e.courseId,e.lessonId,Y.frames[Y.frames.length-1]))},[Y.frames,Y.busy]);let Ro=(0,W.useCallback)(e=>{if(!Ao)return;let t=Ao.lessons[Mo];t&&(On(Ao.id,t.id,e),Fo(An(Ao.id)))},[Ao,Mo]);(0,W.useEffect)(()=>{if(typeof window>`u`||!Ao)return;let e=()=>Fo(An(Ao.id));return window.addEventListener(Pn,e),()=>window.removeEventListener(Pn,e)},[Ao]);let[zo,Bo]=(0,W.useState)(null);(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.missedCards.length&&Bo(t)};return window.addEventListener(Bn,e),()=>window.removeEventListener(Bn,e)},[]);let Vo=(0,W.useCallback)(e=>{let t=e.missedCards.flatMap(t=>hn([t],{deck:e.courseTitle,tags:[e.lessonTitle,`checkpoint`],source:{question:t.front,topic:e.topic,ts:e.at},origin:`auto`}));Bo(null),Oi(t)},[Oi]),Ho=(0,W.useMemo)(()=>new Set(B.map(e=>e.id)),[B]),Uo=(0,W.useCallback)((e,t)=>{Ae(`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]),Wo=(0,W.useCallback)(e=>{let t=e.map(we),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.`;Ae(`Fuse: ${t.join(` × `)}`),se([]),Y.run(n,void 0,e,void 0,void 0,`Fuse: ${t.join(` × `)}`)},[Y]),Go=(0,W.useCallback)(e=>{e.id&&(se(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e]),ei(e=>e+1),ye())},[ye]),Ko=B.length>1?[`How do these relate?`,`Compare them`,`Summarize these`]:[`Explain this`,`Why it matters`,`Go deeper`],qo=Re(e.provider).capabilities.vision;(0,W.useEffect)(()=>{let e=e=>{if(sf(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(),ne(n),D(of),ei(e=>e+1);return}let r=t.getData(`text/plain`);r&&rf(r)&&(e.preventDefault(),D(af(nf(r))),ei(e=>e+1))},t=null,n=e=>{e.dataTransfer?.types.some(e=>e===`Files`||e===`text/uri-list`)&&(e.preventDefault(),ii(!0),t&&clearTimeout(t),t=setTimeout(()=>ii(!1),200))},r=e=>{ii(!1);let t=e.dataTransfer;if(!t)return;if(sf(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:nf(t.getData(`text/uri-list`)||t.getData(`text/plain`)||``);!n.length&&!a||(e.preventDefault(),r.length?(ne(r),D(of)):i.length?ne(i):a&&D(af(a)),ei(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)}},[ne]);let Jo=(0,W.useRef)(Wa);Jo.current=Wa,(0,W.useEffect)(()=>{if(!Un)return;let e=Jo.current;Ga(`focus`),document.documentElement.requestFullscreen?.().catch(()=>{});let t=e=>{e.key===`Escape`&&Wn(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t),Ga(e),document.fullscreenElement&&document.exitFullscreen().catch(()=>{})}},[Un,Ga]);let Zo=(0,W.useRef)(0);(0,W.useEffect)(()=>{let e=Y.frames.length;if(e>Zo.current&&Jn.current){let t=e-1;tr(e=>new Set(e).add(t))}Zo.current=e},[Y.frames.length]);let X=Ci({mode:J?`vad`:`webspeech`,onBargeIn:()=>{uo(),Fa.current=!0},onResult:e=>{let t=e.transcript.trim(),n=Fa.current;if(Fa.current){Fa.current=!1;let e=Pa.current;if(!t||Vp(t)){e&&hi(e);return}}if(t){if(Oe(t),Er.current){Dr.current=[...Dr.current,t],Oe(null),K.onTranscript(Dr.current.join(` `));return}if(yr.current){if(Qd(t)){vr(!1);let e=br.current;if(br.current=[],Sr(0),e.length){let t=Math.round((Date.now()-Cr.current)/6e4);Ae(`Your thinking, sorted`),Y.run(ef(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}}else $d(t)&&(br.current=[...br.current,t],Sr(e=>e+1));return}if(!Gn({phase:Si.current,activeKey:Ti.current,blanks:Ei.current,fill:Y.fill},t)){if(Or&&dd(t)){Tr(!0),Er.current=!0,Dr.current=[...Dr.current,t],Oe(null),K.onTranscript(Dr.current.join(` `));return}ko(t,n)}}},onStateChange:e=>{xe(e.phase===`listening`),e.phase===`idle`&&(Fa.current=!1),e.phase===`listening`?(Me(null),e.transcript&&_a(e.transcript),Ar.current!==null&&(window.clearTimeout(Ar.current),Ar.current=null)):e.phase===`idle`&&Er.current&&(Ar.current!==null&&window.clearTimeout(Ar.current),Ar.current=window.setTimeout(()=>{Ar.current=null;let e=Dr.current.join(` `).trim();e&&kr.current.phase===`listening`&&kr.current.onSpeechEnd(e)},qf)),e.error===`not-allowed`?Me(Ff):e.error===`unsupported`?Me(Pf):e.error===`audio`&&Me(If)}}),Z=X.capabilities.stt;di.current=X;let $o=(0,W.useCallback)(()=>{V&&!J&&X.stop(),Ar.current!==null&&(window.clearTimeout(Ar.current),Ar.current=null),Oe(null),Tr(!1)},[V,J,X]),es=Un||Mf({paletteOpen:Jr,shareOpen:Fe,exportOpen:Ue,dashOpen:Ge,showSettings:Br,proofOpen:Zr,showHow:ro,replayAt:vo,recapOpen:Mt,atlasOpen:Rt,rehearsalOpen:Fn,delegateOpen:It,srsOpen:Dt,zoomLevel:nr,mindViewOpen:Dn.open});(0,W.useEffect)(()=>{if(!wr||K.phase===`idle`||es)return;let e=e=>{e.key===`Escape`&&$o()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[wr,K.phase,es,$o]),(0,W.useEffect)(()=>{let e=document.documentElement;return jr?e.dataset.whisper=``:delete e.dataset.whisper,ae(jr?cn:1),()=>{delete e.dataset.whisper,ae(1)}},[jr]),(0,W.useEffect)(()=>{_r?Cr.current=Date.now():(br.current=[],Sr(0))},[_r]),(0,W.useEffect)(()=>{if(wr&&V&&De){let e=Ju(De),t=Dr.current.length>0?[...Dr.current,e].join(` `).trim():e;t&&K.onTranscript(t)}},[De,V,wr]),(0,W.useEffect)(()=>{wr||(Dr.current=[],K.reset(),Ar.current!==null&&(window.clearTimeout(Ar.current),Ar.current=null))},[wr]),(0,W.useEffect)(()=>()=>{Ar.current!==null&&window.clearTimeout(Ar.current)},[]),(0,W.useEffect)(()=>{if(!J)return;let e=0,t=()=>{ce()||X.setMaveaSpeaking(!1),e=window.setTimeout(t,200)};return t(),()=>window.clearTimeout(e)},[J,X]);let ts=T.trim().length>0;(0,W.useEffect)(()=>{if(!Kn({alwaysOn:J,sttOk:Z,composerHasText:ts}))return;let e=!1,t=setTimeout(()=>{e||X.start({inCanvas:!!Y.spec})},100);return()=>{e=!0,clearTimeout(t),X.stop()}},[J,Z,X,ts]),qn({alwaysOn:J,sttOk:Z,composerHasText:ts,listening:V},{start:()=>X.start({inCanvas:!!Y.spec}),stop:X.stop});let ns=(0,W.useCallback)(()=>{if(!Z){Me(Pf),ei(e=>e+1);return}V?X.stop():(he(),X.start({inCanvas:!!Y.spec}))},[Z,V,X,Y.spec]),[rs,is]=(0,W.useState)(!1),as=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=()=>{as.current!==null&&(window.clearTimeout(as.current),as.current=null)};if(Y.status===`thinking`){is(!0),e();return}if(Y.status===`idle`){is(!1),e();return}if(rs&&Y.spec){is(!1),e();return}rs&&as.current===null&&(as.current=window.setTimeout(()=>{is(!1),as.current=null},1100))},[Y.status,Y.spec,rs]),(0,W.useEffect)(()=>()=>{as.current!==null&&window.clearTimeout(as.current)},[]);let os=ia({speak:hi,cancelSpeak:he,isSpeaking:ce,muted:U,turnCount:Y.frames.length,gates:{atRest:Y.status===`showing`||Y.status===`idle`,busy:Y.busy,listening:V,introHold:rs,hasCanvas:!!Y.spec,modalOpen:Jr||Fe||Ue||Ge||Br||Zr||ro||vo!==null||Mt||It||Dt||Rt||Qt!==null||rn!==null||Fn||Dn.open||nr!==null}}),ss=os.interjecting,cs=(0,W.useRef)(null),ls=(0,W.useMemo)(()=>{let e=Gi(Y.spec);return e===`warm`&&Ki(Y.spec)&&(cs.current===null||cs.current===Y.spec)&&(cs.current=Y.spec,e=`celebrate`),zi(Y.status,V,ss,e,U)},[Y.status,V,ss,Y.spec,U]),us=(0,W.useMemo)(()=>Us({status:Y.status,listening:V,interjecting:ss,spec:Y.viewSpec??Y.spec}),[Y.status,V,ss,Y.viewSpec,Y.spec]);(0,W.useEffect)(()=>(Rs(document,us),()=>zs(document)),[us]);let ds=(0,W.useCallback)(()=>{let e=Xi.current,t=Zi.current,n=Qi.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)(()=>(ds(),window.addEventListener(`resize`,ds),()=>window.removeEventListener(`resize`,ds)),[ds]),(0,W.useLayoutEffect)(()=>{ds()},[Pr,ds]);let fs=!!Y.spec&&!(rs||ss),ps=ao,ms=ao&&(!Y.spec||rs||ss),hs=!Y.spec&&!ao;(0,W.useEffect)(()=>{if(!e.morningBrief||wt||hs||Y.busy||Y.restored||!Ol(it()))return;kl(),Et(!0);let t=Y.frames.slice(-3).map(e=>e.question).filter(Boolean);Y.run(Al(t),void 0,void 0,void 0,void 0,`Morning brief`)},[e.morningBrief,hs,wt,Y.busy,Y.restored]),(0,W.useEffect)(()=>{fs&&Xi.current&&(Xi.current.style.setProperty(`--scroll-dock`,`0`),ds())},[fs,ds]);let gs=ss?os.line:Y.narration,_s=!fs&&!!gs&&(ss||Y.status===`speaking`||Y.status===`showing`),vs=ms&&Y.status===`speaking`,ys=(0,W.useRef)(new Map),[bs,xs]=(0,W.useState)(0);(0,W.useEffect)(()=>{let e=ys.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 ct(`${t.question} ${t.narration} ${t.spec?.title??``}`.trim());if(i)return;r&&(e.set(t.at,r),n=!0)}n&&xs(e=>e+1)})(),()=>{i=!0}},[Y.frames]);let Ss=(0,W.useMemo)(()=>Tt(Y.frames,Y.frames.map(e=>ys.current.get(e.at)??null)),[Y.frames,bs]),Cs=Y.frames.length-1,ws=Y.viewIndex??Cs,Ts=Y.viewOverride!=null,Es=!Ts&&(Y.viewIndex==null||Y.viewIndex===Cs),Ds=Y.viewOverride?Ss.find(e=>Y.viewOverride?.id===`thread-`+e.id):void 0,Os=Ss.find(e=>e.moments.some(e=>e.frameIndex===ws)),ks=Ss.length>=2?Os?.color:void 0,As=Y.frames[Cs],js=Ss[Ss.length-1],Ms=Ss.length>=2&&js?.moments.length===1&&js.moments[0].frameIndex===Cs,Ns=Es&&!Y.busy&&Ms&&As?.mode===`replace`&&!!As&&ys.current.has(As.at),[Is,Ls]=(0,W.useState)(null),Bs=(0,W.useRef)(-1);(0,W.useEffect)(()=>{Ns&&Bs.current!==Cs&&(Bs.current=Cs,Ls(Cs))},[Ns,Cs]);let Vs=(0,W.useCallback)(e=>{let t=va(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),Vi.current?.scrollTo({top:0}))},[Y]),Hs=Es&&B.length===0?(Y.viewSpec??Y.spec)?.suggests??[]:[],Ws=Y.viewSpec??Y.spec,Ks=Ts?Ws?{question:null,narration:Ws.title||`This thread`}:null:vc({spec:Ws,frames:Y.frames,viewIndex:Y.viewIndex,narration:Y.narration,lastAsk:H}),qs=(0,W.useMemo)(()=>ec(Ws),[Ws]),Js=bc(yc(Y.status)),Ys=(0,W.useMemo)(()=>Y.busy?Y.status===`showing`?[jf(Y.pendingShape)]:Af(H??``,Y.history):[],[Y.busy,Y.status,Y.pendingShape,H,Y.history]),Xs=wf(),Qs=(0,W.useSyncExternalStore)(gu,_u,_u),[$s,tc]=(0,W.useState)(null);(0,W.useEffect)(()=>tc(null),[Y.turn]),(0,W.useEffect)(()=>oa(!1),[Y.turn]);let rc=Xs&&!U,[ac,oc]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(rc){oc(!0);return}let e=window.setTimeout(()=>oc(!1),600);return()=>window.clearTimeout(e)},[rc]),(0,W.useEffect)(()=>{U&&na.current?.()},[U]);let[sc,lc]=(0,W.useState)(!1);(0,W.useEffect)(()=>lc(!1),[Y.turn]),(0,W.useEffect)(()=>Ft(!1),[Y.turn]);let uc=(0,W.useMemo)(()=>hf(Y.frames,Ss),[Y.frames,Ss]),dc=kt(),fc=Nt(),mc=(0,W.useCallback)(e=>{if(d.current){$a.current.playExtra(e);return}Y.busy||r(e)},[Y.busy]),hc=(0,W.useCallback)(e=>{if(!Z){Me(Pf);return}oi.current===null&&(oi.current=J),ai(!0),e===`think`?Tr(!0):vr(!0)},[Z,J]);(0,W.useEffect)(()=>{if(wr||_r)return;let e=oi.current;e!==null&&(oi.current=null,ai(e))},[wr,_r]);let Q={atlas:{available:Bt>0,reason:`Fills in as you discuss things`,run:()=>zt(!0),preload:op.preload},"pdf-world":{available:O.some(Ie),reason:`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map`,run:()=>{let e=O.filter(Ie);if(e.length>0){sn(e);return}ei(e=>e+1),ni(e=>e+1),F(`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map of claims.`)},preload:Tp.preload},synthesis:{available:!0,run:()=>{let e=O.filter(Ie);e.length>=2?an(e):window.location.hash=`#/synthesis`},preload:()=>O.filter(Ie).length>=2?Dp.preload():Bp(`#/synthesis`)},ripple:{available:!0,run:()=>un(Sn),preload:cp.preload},rehearse:{available:!0,run:()=>Hn(!0),preload:kp.preload},review:{available:!0,run:()=>Ot(!0),preload:Fp.preload},flashcards:{available:!0,run:()=>{window.location.hash=`#/flashcards`},preload:()=>Bp(`#/flashcards`)},courses:{available:!0,run:()=>{window.location.hash=`#/courses`},preload:()=>Bp(`#/courses`)},dashboards:{available:!0,run:()=>{window.location.hash=`#/dashboards`},preload:()=>Bp(`#/dashboards`)},gallery:{available:!0,run:()=>{window.location.hash=`#/gallery`},preload:()=>Bp(`#/gallery`)},recap:{available:!!uc,reason:`Once we've covered something`,run:()=>Ft(!0),preload:pp.preload},present:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Wn(!0),preload:jp.preload},track:{available:!!Y.spec,reason:`Once there is a conversation to track`,run:()=>qe(!0),preload:Sp.preload},share:{available:Y.frames.length>0,reason:`Once there is something to share`,run:()=>Le(!0),preload:vp.preload},export:{available:Y.frames.length>0,reason:`Once there is an answer to export`,run:()=>We(!0),preload:bp.preload},focus:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Ga(`focus`)},board:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Ga(`canvas`)},ink:{available:!!Y.spec,reason:`Once there is an answer to mark`,run:()=>pe(!0)},blanks:{available:!0,run:()=>Me(`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:Pf,run:()=>hc(`think`)},"just-listen":{available:Z,reason:Z?void 0:Pf,run:()=>hc(`listen`)},whisper:{available:!0,run:()=>{Ur(`you`),qr(!0),Vr(!0)},preload:$f.preload},ghost:{available:Z&&e.quality!==`fast`,reason:Z?e.quality===`fast`?`Needs Balanced quality or higher — you're on Fast`:void 0:Pf,run:()=>hc(`listen`)},delegate:{available:!0,run:()=>Lt(!0),preload:Np.preload},memory:{available:!0,run:()=>{Ur(`you`),Vr(!0)},preload:$f.preload},library:{available:so.length>0,reason:`Fills in as you save conversations`,run:()=>Lr(!0),preload:hp.preload},deepzoom:{available:!0,run:()=>{let e=H??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},preload:()=>Bp(`#/deepzoom`)},"zoom-deck":{available:!!uc,reason:`Opens once there are a few answers to pull back from`,run:()=>rr(`chapters`),preload:ip.preload},"morning-brief":{available:!0,run:()=>{Ur(`you`),qr(!0),Vr(!0)},preload:$f.preload},settings:{available:!0,run:()=>{Ur(void 0),Vr(!0)},preload:$f.preload},how:{available:!0,run:()=>io(!0),preload:Jf.preload}};Xa.current=Q;let gc=Xe.filter(e=>e.surface!==`demo`).map(e=>{let t=Q[e.id]??{available:!0,run:()=>void 0},n=e.id===`how`?xi:e.tourChapter?()=>mc(e.tourChapter):void 0;return{feature:e,available:t.available,reason:t.reason,run:t.run,preload:t.preload,watch:n}}),xc=[{label:`New`,blurb:`Start a fresh session`,onClick:()=>{Y.reset(),os.reset(),oo(!1),te(!1),rt()},show:!!Y.spec},{label:`Dashboard`,blurb:`Open your living dashboards`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!!Y.spec}],Sc=[{label:`Rehearse`,blurb:`Practice a conversation before it happens`,onClick:Q.rehearse.run,preload:Q.rehearse.preload,show:!0},{label:`Study`,blurb:dc>0?`${dc} card${dc===1?``:`s`} ready`:fc===`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:!!uc}],Cc=[{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:`Share`,blurb:`Share this conversation as a story`,onClick:Q.share.run,preload:Q.share.preload,show:Y.frames.length>0}],wc=[{label:`Search all features`,blurb:`Browse Mavéa’s feature index · ${R}`,onClick:Yr,preload:Xf.preload,show:!0},{label:`Atlas`,blurb:`Kept conversations and topics, as a place`,onClick:Q.atlas.run,preload:Q.atlas.preload,show:Bt>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:Kt>0?`${Kt} dashboard${Kt===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:`The Table`,blurb:`Scout a negotiation — two Mavéas talk it out, you get the debrief`,onClick:Q.delegate.run,preload:Q.delegate.preload,show:!0},{label:`Deep Zoom`,blurb:H?`Zoom from field to mechanism — "${H.slice(0,50)}${H.length>50?`…`:``}"`:`Telescope any topic from big picture to finest detail`,onClick:()=>{let e=H??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},show:!0}];vn(Vi,(0,W.useCallback)(e=>{e===`out`&&uc&&rr(`chapters`)},[uc])),(0,W.useEffect)(()=>(ge(xu),()=>ge(null)),[]),(0,W.useEffect)(()=>{Y.busy&&(yu(),or(null),mr())},[Y.busy,Y.turn,mr]),(0,W.useEffect)(()=>mr(),[Y.viewIndex,mr]);let Dc=Y.spec?.blocks.length??0;(0,W.useEffect)(()=>{Dc>0&&bu(Dc)},[Dc]),(0,W.useEffect)(()=>{if(!Y.busy&&Y.spec){let e=Su();if(e){or(e);let t=Y.frames.length-1;t>=0&&hr.set(t,e)}}},[Xs,Y.busy,Y.spec,Qs,Y.frames,hr]);let kc=(0,W.useMemo)(()=>Es?ir:Y.viewIndex==null?null:hr.get(Y.viewIndex),[Es,ir,Y.viewIndex,hr]),Ac=(0,W.useMemo)(()=>{if(!dr||cr===null||!kc)return null;let e=Es?Y.spec:Y.viewSpec;if(!e)return null;let t=wu(kc,cr,Es?Y.tour:Y.viewIndex==null?[]:Y.frames[Y.viewIndex]?.tour??[],e.blocks.length);return{...e,blocks:e.blocks.slice(0,t)}},[dr,cr,kc,Es,Y.spec,Y.viewSpec,Y.tour,Y.viewIndex,Y.frames]),jc=Y.error?(0,G.jsxs)(`div`,{className:`live-error`,role:`alert`,children:[(0,G.jsxs)(`div`,{className:`live-error-head`,children:[(0,G.jsx)(z.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,void 0,void 0,void 0,void 0,e.question)},disabled:Y.busy,children:`Retry`}),(0,G.jsx)(`button`,{type:`button`,className:`live-error-btn`,onClick:()=>Vr(!0),children:`Open settings`})]})]}):null,Mc=wr&&K.phase!==`idle`,Nc=Mc?(0,G.jsxs)(`div`,{className:`ms-stage-fill`,"data-phase":K.phase,children:[(0,G.jsxs)(`button`,{type:`button`,className:`ms-exit`,onClick:$o,title:`Back to the conversation (Esc)`,children:[(0,G.jsx)(z.chevL,{}),`Back to conversation`]}),(0,G.jsx)(qd,{mindShape:K,onSettled:()=>{hi(`I think this is the shape of it.`)},onConfirmUnsaid:()=>K.confirmUnsaid(),onDismissUnsaid:()=>K.dismissUnsaid(),onAction:(e,t)=>{if(e===`add-more`)Oe(null),K.resume(),!V&&Z&&X.start({inCanvas:!!Y.spec});else if(e===`not-quite`)Dr.current=[],K.resume(!1),Oe(null),!V&&Z&&X.start({inCanvas:!!Y.spec});else if(e===`share`)Le(!0);else if(e===`present`)Wn(!0);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?Zd(n,r):De??``;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(V&&!J&&X.stop(),Oe(null),K.reset(),Tr(!1),i){let t=e===`tell-apart`?`Telling them apart`:n?.center||(r===`plan`?`A plan`:`An answer`);Ae(t),Y.run(i,void 0,void 0,void 0,void 0,t,n??void 0,a?{freshStart:!0}:void 0)}}},liveTranscript:De||void 0,thoughtCount:cd([Dr.current.join(` `),De??``].join(` `))})]}):null;return(0,G.jsxs)(`div`,{className:`mavea-app with-rail live-voice canvas-flat`+(fs?` face-homed`:``)+(hs?` in-wizard`:``)+(Un?` presenting`:``)+(Pr?` rail-collapsed`:``)+(Mc?` watch-thinking`:``),"data-title":Y.spec?.title??``,...Un?{"data-preso":Yn}:{},ref:Xi,children:[d.current&&(0,G.jsx)(Wr,{driver:Za}),d.current&&Za.done&&(0,G.jsx)(Kr,{onStart:bi,onReplay:xi,onPlayExtra:Za.playExtra,hasStoredSession:vi}),S.current&&(()=>{let e=N(S.current);return e?(0,G.jsx)(ui,{driver:Qa,member:e,onExit:bi}):null})(),Un&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`preso-style-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||$n(!1)},children:[(0,G.jsxs)(`button`,{type:`button`,className:`preso-style-btn`+(Qn?` is-open`:``),onClick:()=>$n(e=>!e),"aria-expanded":Qn,"aria-haspopup":`listbox`,children:[(0,G.jsx)(`span`,{className:`preso-swatch-sm`,style:{background:cf.find(e=>e.id===Yn)?.accent??`var(--presence)`}}),`Style`]}),Qn&&(0,G.jsx)(`div`,{className:`preso-menu`,role:`listbox`,"aria-label":`Presentation style`,children:cf.map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":Yn===e.id,className:`preso-row`+(Yn===e.id?` is-active`:``),onClick:()=>{Zn(e.id),ff(e.id),$n(!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:()=>Wn(!1),title:`End the presentation (Esc)`,children:`End show · Esc`}),(0,G.jsx)($,{children:(0,G.jsx)(Mp,{spec:Y.viewSpec??Y.spec,question:Ks?.question??null,narration:Ks?.narration??Y.narration,skinId:Yn,autoAdvanceMs:d.current?2600:void 0,onExit:()=>Wn(!1)})})]}),(0,G.jsx)(`div`,{className:`presence-layer`+(fs?` corner`:ms?``:` idlehome`)+(_s?` has-caption`:``)+(Rr?` is-mem-save`:``),ref:Qi,children:(0,G.jsxs)(`div`,{className:`presence-positioner`,children:[ao&&(0,G.jsx)(`div`,{className:`presence-seed`,"aria-hidden":`true`},Y.turn),(0,G.jsx)(Ee,{state:ls.state,emotion:ls.emotion,gaze:ls.gaze,muted:U})]})}),(0,G.jsx)(`div`,{className:`presence-scrim`+(vs?` show`:``)}),_s&&(0,G.jsx)(`div`,{className:`center-caption`,role:`status`,"aria-live":`polite`,children:gs}),(0,G.jsx)(Sf,{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:zp,title:`Back to the demo`,"aria-label":`Back to the demo`,children:[(0,G.jsx)(`span`,{className:`brand-dot jelly-mark`,ref:Zi}),(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)(jt,{label:`Create`,items:xc}),(0,G.jsx)(jt,{label:`Practice`,items:Sc,badge:dc}),(0,G.jsx)(jt,{label:`Share`,items:Cc}),(0,G.jsx)(jt,{label:`Explore`,items:wc}),(0,G.jsx)(o,{onOpen:Yr,preload:Xf.preload}),(0,G.jsx)(`span`,{className:`topbar-divider`,"aria-hidden":`true`}),(0,G.jsx)(At,{})]}),(0,G.jsx)(_c,{chapters:Ss,frames:Y.frames,currentIndex:ws,onJump:Y.jumpTo,onReplay:Y.frames.length>0?()=>yo(Y.frames.length-1):void 0,onOverview:Y.frames.length>0?()=>lc(!0):void 0,resumed:Y.restored,chatOpen:Mr,onToggleChat:()=>Nr(e=>!e),collapsed:Pr,onToggleCollapse:()=>Fr(e=>!e),onOpenPast:so.length>0?()=>Lr(!0):void 0,onStudy:()=>Ot(!0),roomIndices:er,bookmarks:Ea,onToggleBookmark:Da,onViewMindMap:e=>{let t=Y.frames[e];t?.mind&&jn({open:!0,spec:t.mind})},onSeeTogether:Vs}),(0,G.jsxs)(pc,{holdEnabled:Z&&!J,showHint:!1,pttKey:e.pttKey,pttSide:e.pttSide,onHoldStart:()=>X.start({inCanvas:!!Y.spec}),onHoldEnd:()=>X.forceStop?.(),onChangePttKey:e=>Wt({pttKey:e}),onChangePttSide:e=>Wt({pttSide:e}),children:[(jr||J&&Z)&&(0,G.jsxs)(`div`,{className:`dock-modes`,role:`group`,"aria-label":`Listening modes`,children:[jr&&(0,G.jsx)(`span`,{className:`whisper-badge`,children:`won't wake anyone`}),J&&Z&&(0,G.jsx)(`button`,{type:`button`,className:`listen-mode-chip`+(_r?` on`:``),"aria-pressed":_r,onClick:()=>{vr(e=>!e),wr&&Tr(!1)},title:_r?`Stop banking and go back to answering`:`Bank everything you say without answering — say "thoughts?" when you want the sort`,children:_r?`Just listening · ${xr} banked`:`Just listen`}),_r&&xr>0&&(0,G.jsx)(`button`,{type:`button`,className:`listen-mode-chip`,onClick:()=>{vr(!1);let e=br.current;if(br.current=[],Sr(0),e.length){let t=Math.round((Date.now()-Cr.current)/6e4);Ae(`Your thinking, sorted`),Y.run(ef(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}},children:`Thoughts?`})]}),(_r||wr)&&(0,G.jsx)(_e,{kind:`voice-data`,from:`live`}),je&&(0,G.jsxs)(`div`,{className:`voice-notice`,role:`status`,children:[(0,G.jsx)(z.micOff,{}),(0,G.jsx)(`span`,{children:je}),(0,G.jsx)(`button`,{type:`button`,className:`voice-notice-x`,"aria-label":`Dismiss voice notice`,onClick:()=>Me(null),children:(0,G.jsx)(z.x,{})})]}),(O.length>0||M)&&(0,G.jsxs)(`div`,{className:`attach-strip`,role:`list`,"aria-label":`Attached files`,children:[O.map((e,t)=>(0,G.jsxs)(`span`,{className:`attach-chip`,role:`listitem`,children:[Pe(e)?(0,G.jsx)(`img`,{className:`attach-thumb`,src:`data:${e.mime};base64,${e.data}`,alt:``}):(0,G.jsx)(z.paperclip,{}),(0,G.jsx)(`span`,{className:`attach-name`,children:ze(e)}),(He(e)&&qo||Be(e)||Ve(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:()=>$t([e]),children:`⊹ Explode`}),(0,G.jsx)(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>ie(t),children:(0,G.jsx)(z.x,{})})]},t)),(()=>{let e=O.filter(e=>Be(e)||Ve(e)||He(e)&&qo);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:()=>$t(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:()=>an(e),children:[`⊹ Synthesize `,e.length,` sources`]},`synth`);return e.length>=4?n:e.length>=3?(0,G.jsxs)(G.Fragment,{children:[t,n]}):t})(),M&&(0,G.jsx)(`span`,{className:`attach-error`,role:`status`,children:M})]}),O.length>0&&(0,G.jsx)(_e,{kind:`upload`,from:`live`}),Y.spec&&(0,G.jsx)(yl,{armed:le,pins:Do.pins,miss:Do.miss,onUndo:Do.undo,onSend:Do.send}),B.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:B.map(e=>(0,G.jsxs)(`span`,{className:`pin-chip`,role:`listitem`,children:[(0,G.jsx)(z.chat,{}),(0,G.jsx)(`span`,{className:`pin-name`,children:we(e)}),(0,G.jsx)(`button`,{type:`button`,className:`pin-remove`,"aria-label":`Unpin ${we(e)}`,onClick:()=>Go(e),children:(0,G.jsx)(z.x,{})})]},e.id))}),(0,G.jsxs)(`div`,{className:`pin-suggests`,role:`list`,"aria-label":`Quick follow-ups`,children:[B.length>=2&&(0,G.jsxs)(`button`,{type:`button`,className:`live-chip pin-fuse-chip`,disabled:Y.busy,title:`Combine these ${B.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:()=>Wo(B),children:[`Fuse `,B.length,` into one`]}),Ko.map(e=>(0,G.jsx)(`button`,{type:`button`,className:`live-chip`,onClick:()=>ko(e),disabled:Y.busy,children:e},e))]})]}),(0,G.jsxs)(`div`,{className:ps?`voice-capsule`:`composer-passthrough`,children:[ps&&(0,G.jsxs)(`div`,{className:`voice-strip`,children:[ac?(0,G.jsxs)(`button`,{type:`button`,className:`vc-status`,onClick:uo,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`})]}):sa&&!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…`})]}):null,(0,G.jsx)(`div`,{className:`vc-transcript`,"aria-hidden":`true`,children:$s??Y.narration??``}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>Ne(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)(z.speakerOff,{}):(0,G.jsx)(z.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)(zu,{}),(0,G.jsx)(Bu,{}),(0,G.jsxs)(`button`,{className:`live-model-chip`,onClick:()=>Vr(e=>!e),title:S.current?`The model that generated this recorded session`:Js?`Model settings · last reply ${Js}`:`Model settings`,children:[(0,G.jsx)(`span`,{className:`chip-dot`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`chip-model`,children:S.current?Qa.model??`—`:n}),(0,G.jsx)(`span`,{className:`chip-caret`,"aria-hidden":`true`})]})]}),(0,G.jsx)(sr,{value:T,onChange:e=>{D(e)},onSend:ko,listening:V,heard:De,onMic:ns,placeholder:wr?`Talk, or type a thought — it lands on the map…`:B.length?B.length>1?`Ask about the selected elements…`:`Ask about the selected element…`:`Talk, or type — anything.`,focusSignal:$r,disabled:Y.busy,onFiles:ne,attachPulse:ti,attachTitle:qo?`Attach an image or PDF`:`Attach a doc or data file to explode — ${n} can't read images/PDFs directly`,onMicDown:()=>{Z&&(he(),X.start({inCanvas:!!Y.spec}))},onForceStop:()=>X.forceStop?.(),tools:Y.spec?(0,G.jsx)(bl,{armed:le,onToggle:pe}):void 0,micExtra:Z?(0,G.jsx)(Fs,{mode:J?`always`:si?`hold`:`tap`,pttKey:e.pttKey,pttSide:e.pttSide,onChange:e=>{oi.current=null,ai(e===`always`),li(e===`hold`),e!==`always`&&V&&X.stop()}}):void 0})]})]}),V&&!wr&&(0,G.jsx)(gf,{transcript:De,mode:J?`always`:`tap`,note:_r?`Just listening · ${Math.max(1,Math.round((Date.now()-Cr.current)/6e4))}m — say "thoughts?" when you want me`:void 0}),V&&!wr&&(0,G.jsx)(gd,{ghosts:yi}),Y.spec?(0,G.jsxs)(`div`,{className:`canvas-stage stage`,"data-active":`1`,ref:Hi,children:[Nc,Is!=null&&(0,G.jsx)(ic,{tint:js?.color,onDone:()=>Ls(null)},Is),(0,G.jsx)(`div`,{className:`canvas-scroll`,ref:Vi,onClick:Y.spot?e=>{e.target.closest(`.spotlit`)||lo()}:void 0,children:(0,G.jsxs)(`div`,{className:`topic-wrap`,children:[(0,G.jsx)(Uc,{armed:le,rootRef:Hi,onStroke:Do.onStroke,onTap:Do.onTap,strokes:Do.strokes,highlights:Do.highlights}),jc,!Es&&(0,G.jsxs)(`div`,{className:`viewing-past`,role:`status`,children:[Ts?(0,G.jsx)(z.table,{}):(0,G.jsx)(z.clock,{}),(0,G.jsx)(`span`,{children:Ts?`Viewing this thread together`:`Viewing an earlier moment`}),(0,G.jsx)(`button`,{type:`button`,className:`viewing-past-back`,onClick:()=>Ts?Y.previewSpec(null):Y.jumpTo(Cs),children:`Return to live`})]}),!me&&B.length===0&&(0,G.jsxs)(`div`,{className:`ask-hint`,role:`note`,children:[(0,G.jsx)(z.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:ye,children:(0,G.jsx)(z.x,{})})]}),Ao&&(0,G.jsx)($,{children:(0,G.jsx)(dp,{course:Ao,lessonIdx:Mo,progress:Po??An(Ao.id),onPrev:()=>Lo(Ao,Mo-1),onNext:()=>Lo(Ao,Mo+1),onCheckpoint:Ro,busy:Y.busy},`${Ao.id}:${Mo}`)}),Ks&&!Ao&&(0,G.jsx)(nc,{question:Ks.question,narration:Ks.narration,sources:Ws?.sources,inferred:qs,tint:ks}),mo&&(0,G.jsx)(i,{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)(Ce,{blocks:Wf})})}),children:(0,G.jsx)(Uf,{data:Ac??Y.viewSpec??Y.spec,spot:Es?Y.spot:null,built:{},onProve:()=>Qr(!0),onAskBlock:Go,onAddToDashboard:e=>at({block:e,question:Ks?.question??void 0}),selectedBlockIds:Ho,onNarrate:to,narratingId:no,muted:U,viewMode:Wa,onViewMode:Ga,presenting:Un,noteGutter:Es&&e.annotationsEnabled&&Ca&&ra,walkNotes:Es?Ta:void 0,blankFill:Es?{values:Y.filled,activeKey:Y.activeBlank,fill:Y.fill,unfill:Y.unfill,activate:Y.setActiveBlank,complete:Y.complete,busy:Y.busy}:void 0,bend:Es&&cr===null?Y.spec?.bend:void 0,onAddToFlashcard:Bi,flashedIds:ft,belowHeaderSlot:Ks&&kc?(0,G.jsx)(Ru,{audio:kc,t:cr,onSeek:pr}):void 0,headerSlot:Es?(0,G.jsxs)(`div`,{className:`pen-anchor`,ref:Oa,children:[(0,G.jsx)(Ec,{enabled:e.annotationsEnabled,open:ya,inkCount:fa.length,onClick:()=>ba(e=>!e)}),ya&&(0,G.jsx)(`div`,{className:`pen-popover`,children:(0,G.jsx)(Tc,{entries:fa,turnStartMs:ma.current,annotationsEnabled:e.annotationsEnabled,hiddenSpots:xa,onToggle:Ra,onKeep:()=>ba(!1),onClear:()=>{pa([]),Sa(new Set),ba(!1)},onClip:()=>Le(!0),onJumpTo:Ba,onToggleSpot:Ua})})]}):void 0},Ts?`thread-`+(Y.viewOverride?.id??``):Es?`live-`+Y.replaceEpoch:`view-`+Y.viewIndex)}),Es&&!Mc&&!fo&&(0,G.jsx)(ho,{spots:xa.size>0?fa.filter(e=>!xa.has(e.spot)):fa,revision:Ka}),Y.busy&&Es&&(0,G.jsxs)(`div`,{className:`working-col`,children:[(0,G.jsx)(vf,{cards:Ys}),(0,G.jsx)(xf,{thinking:Y.reasoning})]}),Es&&!Y.busy&&(0,G.jsx)($,{children:(0,G.jsx)(rp,{chips:Y.understood,onFix:Uo})}),(0,G.jsx)(cc,{spec:Y.viewSpec??Y.spec,followups:Hs,question:H??void 0,onAsk:ko,onTrack:()=>qe(!0),onDeepZoom:H?()=>{window.location.hash=`#/deepzoom?seed=${encodeURIComponent(H)}`}:void 0,onCanvas:()=>Ga(`canvas`),onSeeAll:!Ts&&Os&&Os.moments.length>=2?()=>Vs(Os):void 0,threadCount:Os?.moments.length,busy:Y.busy})]})})]}):hs?(0,G.jsxs)(G.Fragment,{children:[Nc,(0,G.jsx)(Ps,{seed:l.current||void 0,speak:hi,goDemo:zp,onStart:e=>{oo(!0),ko(e)},onStartTalking:()=>{if(oo(!0),!Z){Me(Pf),ei(e=>e+1);return}X.start({inCanvas:!1})},onSeeHow:()=>io(!0),studySlot:(0,G.jsx)(Pl,{onStudy:()=>Ot(!0)}),librarySlot:so.length>0?(0,G.jsx)($,{children:(0,G.jsx)(Qf,{entries:so,onResume:e=>{oo(!0),te(!1),Ae(e.question??null),To(e.id),_o(e.spec,e.question)},onRemove:Yt,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:[Nc,jc&&(0,G.jsx)(`div`,{className:`live-error-stage`,children:jc}),Y.busy&&(0,G.jsx)(`div`,{className:`skel-stage`,children:(0,G.jsx)(vf,{cards:Ys})})]}),ri&&(0,G.jsxs)(`div`,{className:`drop-hint`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(z.paperclip,{}),(0,G.jsx)(`span`,{children:`Drop to attach — Mavéa reads PDFs, Office docs, and data files`})]}),ro&&(0,G.jsx)($,{children:(0,G.jsx)(Yf,{onClose:()=>io(!1),speak:hi,onFullTour:xi})}),Jr&&(0,G.jsx)($,{children:(0,G.jsx)(Zf,{items:gc,surface:`live`,onClose:Xr,pinned:d.current&&Za.chapter?.id===`palette`})}),Br&&(0,G.jsx)(`div`,{role:`presentation`,onClick:e=>e.target===e.currentTarget&&Vr(!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)(ep,{onClose:()=>Vr(!1),initialTab:Hr,initialAdvancedYouOpen:Gr})})}),vo!==null&&(0,G.jsx)($,{children:(0,G.jsx)(_p,{frames:Y.frames,initialIndex:vo,speak:hi,cancelSpeak:he,onClose:()=>yo(null)})}),Fe&&(0,G.jsx)($,{children:(0,G.jsx)(yp,{frames:Y.frames,cfg:d.current||S.current?void 0:Ht(e),onClose:()=>Le(!1),onShared:()=>os.enqueue(`clipShared`)})}),Ue&&Di.length>0&&(0,G.jsx)($,{children:(0,G.jsx)(xp,{answers:Di,defaultIndex:Ds?Ds.moments[Ds.moments.length-1].frameIndex:Di.length-1,defaultIndices:Ds?.moments.map(e=>e.frameIndex),onClose:()=>We(!1),guided:d.current&&Za.chapter?.action.kind===`export`})}),Ge&&(0,G.jsx)($,{children:(0,G.jsx)(Cp,{onClose:()=>qe(!1),initialSourceId:xo?`lib-`+xo:void 0})}),Je&&(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:()=>Ye(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:Qe?(0,G.jsx)(np,{id:Je}):(0,G.jsx)(tp,{id:Je})})})]}),nt&&(0,G.jsx)($,{children:(0,G.jsx)(wp,{block:nt.block,question:nt.question,conversationTitle:Y.spec?.title,onClose:()=>at(null),onAdded:(e,t)=>ut({id:e,title:t})})}),lt&&(0,G.jsx)(Gs,{dashboardId:lt.id,dashboardTitle:lt.title,onDismiss:()=>ut(null)}),Y.spec&&(0,G.jsx)(Zs,{open:Zr,onClose:()=>Qr(!1),claim:Y.spec.title,conf:Eo,sources:Y.spec.sources??[],hadFiles:L}),Dn.open&&(0,G.jsx)($,{children:(0,G.jsx)(fp,{open:!0,spec:Dn.spec,onClose:()=>jn(e=>({...e,open:!1}))})}),q&&(0,G.jsx)($,{children:(0,G.jsx)(gp,{entries:so,onResume:e=>{oo(!0),te(!1),Ae(e.question??null),To(e.id),_o(e.spec,e.question),Lr(!1)},onRemove:Yt,onClose:()=>Lr(!1)})}),sc&&(0,G.jsx)(aa,{chapters:Ss,currentIndex:ws,onJump:Ha,onClose:()=>lc(!1)}),nr&&uc&&(0,G.jsx)($,{children:(0,G.jsx)(ap,{model:uc,level:nr,onLevel:rr,onJump:e=>{Y.jumpTo(e),rr(null)},onClose:()=>rr(null)})}),It&&(0,G.jsx)($,{children:(0,G.jsx)(Pp,{cfg:Ht(e),onClose:()=>Lt(!1),onPrepTurn:(e,t)=>{Lt(!1),Ae(t),Y.run(e,void 0,void 0,void 0,void 0,t)}})}),Mt&&uc&&(0,G.jsx)($,{children:(0,G.jsx)(mp,{model:uc,onJump:e=>{Y.jumpTo(e),Ft(!1)},onShare:Y.frames.length>0?()=>{Ft(!1),Le(!0)}:void 0,onClose:()=>Ft(!1)})}),Rt&&(0,G.jsx)($,{children:(0,G.jsx)(sp,{records:xn(),chapters:Ss,onLand:e=>{zt(!1);let t=yn(e,so);oo(!0),te(!1),t?(Ae(t.question??null),To(t.id),_o(t.spec,t.question)):(Ae(e.question),Y.run(e.question))},onGoDeeper:e=>{zt(!1),oo(!0),te(!1),Ae(e),Y.run(e)},autoTour:d.current,onClose:()=>zt(!1)})}),Qt&&(0,G.jsx)($,{children:(0,G.jsx)(Ep,{pdf:Qt,cfg:Ht(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>$t(null)})}),en&&(0,G.jsx)($,{children:(0,G.jsx)(Rp,{doc:en,cfg:Ht(e),onClose:()=>tn(null)},en.id)}),rn&&(0,G.jsx)($,{children:(0,G.jsx)(Op,{sources:rn,cfg:Ht(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>an(null)})}),ln&&(0,G.jsx)($,{children:(0,G.jsx)(lp,{model:ln,cfg:Ht(e),speak:hi,showcase:d.current,onClose:()=>un(null)})}),Fn&&(0,G.jsx)($,{children:(0,G.jsx)(Ap,{cfg:Ht(e),memoryNodes:Ct(),speak:hi,onDebrief:e=>{Hn(!1),D(e)},onClose:()=>Hn(!1)})}),Dt&&(0,G.jsx)($,{children:(0,G.jsx)(Ip,{onClose:()=>Ot(!1)})}),mt&&(0,G.jsx)($,{children:(0,G.jsx)(up,{mode:`add`,initial:mt.initial,deck:mt.deck,origin:`block`,source:mt.source,heading:`Flashcards from ${we(mt.block)}`,enrich:mt.enrich,decks:mn(),onSaved:e=>{if(e.length&&mt.block.id){let e=mt.block.id;pt(t=>new Set(t).add(e))}Oi(e)},onClose:()=>ht(null)})}),zo&&(0,G.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(z.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[zo.missedCards.length,` card`,zo.missedCards.length===1?``:`s`,` from this checkpoint`]}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>Bo(null),children:`Dismiss`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>Vo(zo),children:`Add`})]}),!zo&&bt&&(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)(z.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[bt.count,` card`,bt.count===1?``:`s`,` saved to “`,bt.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:()=>ji(`collection`),children:`No thanks`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>ji(`spaced`),children:`Yes`})]})]})]}),!zo&&!bt&&_t&&(0,G.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,G.jsx)(z.layers,{}),(0,G.jsxs)(`span`,{className:`cards-pill-text`,children:[_t.count,` card`,_t.count===1?``:`s`,` added`]}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>{gn(_t.ids),vt(null)},children:`Undo`}),(0,G.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>{window.location.hash=`#/flashcards`,vt(null)},children:`View`})]})]})}export{Hp as LiveApp};
|