@mavea/mavea 1.0.11 → 1.0.13
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 +18 -1
- package/README.md +33 -164
- package/dist/.vite/manifest.json +606 -606
- package/dist/assets/{AppCommandPalette-DzUPm-Qa.js → AppCommandPalette-D_g8-7C0.js} +1 -1
- package/dist/assets/{BlockEmpty-Dp9IPo4S.js → BlockEmpty-Ddhgr5pu.js} +1 -1
- package/dist/assets/{BriefingPlayer-CTab7H0c.js → BriefingPlayer-D-QhLgXI.js} +1 -1
- package/dist/assets/{CanvasSkeleton-BCq4yAAN.js → CanvasSkeleton-BIiOmCMG.js} +2 -2
- package/dist/assets/{CheckLogRail-DbGJtneK.js → CheckLogRail-ZrDqyjQ7.js} +1 -1
- package/dist/assets/{CodeOutput-DjsCJAel.js → CodeOutput-D7sVg1Nr.js} +1 -1
- package/dist/assets/{CommandPalette-Cq9mDWiI.js → CommandPalette-DNa2q8E_.js} +1 -1
- package/dist/assets/{CourseLessonReader-Dz8IhHEw.js → CourseLessonReader-BIpGjcJk.js} +2 -2
- package/dist/assets/{CourseRail-DjK_L3eD.js → CourseRail-CQaotzN0.js} +1 -1
- package/dist/assets/{CoursesApp-Dv4yt63y.js → CoursesApp-q3kZJmu1.js} +2 -2
- package/dist/assets/{CrossExamPanel-DJCn13Aa.js → CrossExamPanel-BIJslibV.js} +1 -1
- package/dist/assets/{DashPresent-pfOEJGzV.js → DashPresent-DGSE0vYM.js} +1 -1
- package/dist/assets/{DashboardDetail-BSZ3CgcK.js → DashboardDetail-BpaLNg8R.js} +2 -2
- package/dist/assets/DashboardLoopRuntime-14yzj-xx.js +1 -0
- package/dist/assets/{DashboardOverview-DpJ2BDNu.js → DashboardOverview-8x3OxX2i.js} +1 -1
- package/dist/assets/{DashboardSettings-C1rC3iTs.js → DashboardSettings-f_zxcs5j.js} +1 -1
- package/dist/assets/{DashboardsApp-DeBWrYDk.js → DashboardsApp-mvMbGmp0.js} +2 -2
- package/dist/assets/{DeepZoomApp-B91oHx2Y.js → DeepZoomApp-E7bDmzuL.js} +1 -1
- package/dist/assets/{DelegatePanel-bFmfn9-D.js → DelegatePanel-pwRk9pFf.js} +1 -1
- package/dist/assets/{DemoGallery-fYIVdHQV.js → DemoGallery-DDzX8Z7I.js} +1 -1
- package/dist/assets/{DropSelect-DbxAWKQn.js → DropSelect-BMZYAX6q.js} +1 -1
- package/dist/assets/{ExportModal-HczU1Zg1.js → ExportModal-CTMJaU1l.js} +2 -2
- package/dist/assets/{ExtractionPreview-BfjJci-N.js → ExtractionPreview-C9wq7CrK.js} +1 -1
- package/dist/assets/{FlagshipCTA-CTb5P2Ix.js → FlagshipCTA-DPNSflKv.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-DLkDmsF-.js → FlagshipCommandPalette-55zqyPFm.js} +1 -1
- package/dist/assets/{FlagshipShowcase-CrFSCHHX.js → FlagshipShowcase-BWpoPWOn.js} +1 -1
- package/dist/assets/{FlashcardsApp-CV777TGC.js → FlashcardsApp-apCj3I17.js} +1 -1
- package/dist/assets/{ForecastPanel-BfAngk8l.js → ForecastPanel-CMRD-UKn.js} +1 -1
- package/dist/assets/{GalleryApp-DLssAAhN.js → GalleryApp-CcsbirLT.js} +1 -1
- package/dist/assets/{HonestByDesign-B0o03QVw.js → HonestByDesign-DU4qmc61.js} +1 -1
- package/dist/assets/{HowItWorks-DfUsQ2xD.js → HowItWorks-CkZXftN-.js} +1 -1
- package/dist/assets/{LegalApp-CnFE80Ja.js → LegalApp-BmZpqH-6.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-BidNcrNj.js → LegalMarkdownDocument-CcbAfubz.js} +1 -1
- package/dist/assets/{LegalPageShell-CFktFKTK.js → LegalPageShell-raMATqhx.js} +1 -1
- package/dist/assets/{LeverPanel-DgfX7mTL.js → LeverPanel-DVUgGcYW.js} +1 -1
- package/dist/assets/{Library-CAnmN5YL.js → Library-D725dNcx.js} +1 -1
- package/dist/assets/{LibraryOverlay-D7Gg_GIv.js → LibraryOverlay-D7PzQIpH.js} +1 -1
- package/dist/assets/LiveApp-B8Jw1Q0h.js +61 -0
- package/dist/assets/{LiveApp-COz1ZZp9.css → LiveApp-DQhDk2ma.css} +1 -1
- package/dist/assets/{LiveSettings-5UCN5UWM.js → LiveSettings-BQ06gZB7.js} +3 -3
- package/dist/assets/{MindMapViewerDrawer-DoXy6hCD.js → MindMapViewerDrawer-CIMuABKE.js} +1 -1
- package/dist/assets/{MindShape-BJCnqyTi.js → MindShape-0KPrv0CF.js} +1 -1
- package/dist/assets/MindShape-Bel2yDqO.css +1 -0
- package/dist/assets/{PinToDashboard-Dq77a2iP.js → PinToDashboard-ML4NFCAU.js} +1 -1
- package/dist/assets/{PlanReview-DvxM1675.js → PlanReview-CbJ_7Ld1.js} +1 -1
- package/dist/assets/{Presence-LNSqCz8N.js → Presence-B_zDfiE7.js} +1 -1
- package/dist/assets/{PresentationDeck-8kT0cMtk.js → PresentationDeck-Tm3PUdh5.js} +1 -1
- package/dist/assets/{PrismApp-Jf4pIAkh.js → PrismApp-Bc-6PO_P.js} +2 -2
- package/dist/assets/{PrismAskController-QXSoZBNb.js → PrismAskController-OwqFx5Pk.js} +1 -1
- package/dist/assets/{PrismBriefingPlayer-edFfwMNP.js → PrismBriefingPlayer-Bu_ZxYdh.js} +2 -2
- package/dist/assets/{PrismOverlay-CYItOpax.js → PrismOverlay-UTsJ8R5d.js} +4 -4
- package/dist/assets/{PrivacyApp-Dqz_BgOS.js → PrivacyApp-BLXan6dm.js} +1 -1
- package/dist/assets/{Recap-Ba2qZ2lX.js → Recap-5rYrcMCC.js} +1 -1
- package/dist/assets/{ReelJelly-9SCjNeHq.js → ReelJelly-Dg3XGB0c.js} +1 -1
- package/dist/assets/{RehearsalPanel-CtYKPl6O.js → RehearsalPanel-CM4466Os.js} +3 -3
- package/dist/assets/{ReplayCard-MSWq-Mxr.js → ReplayCard-wMIMlorH.js} +2 -2
- package/dist/assets/{ReplayOverlay-ChDrwMLh.js → ReplayOverlay-BomkTonB.js} +1 -1
- package/dist/assets/{RewindOverlay-CM9d5xhh.js → RewindOverlay-Izf89nG9.js} +1 -1
- package/dist/assets/{RippleApp-B7G_jg05.js → RippleApp-8QSIEjTX.js} +2 -2
- package/dist/assets/{RippleAskController-CJjt7VG8.js → RippleAskController-Cd86GrKs.js} +1 -1
- package/dist/assets/{RippleOverlay-Cfu3ZVL1.js → RippleOverlay-SCrXZTqz.js} +2 -2
- package/dist/assets/{SeeDontRead-DHhwv6RU.js → SeeDontRead-Bp8qsF20.js} +1 -1
- package/dist/assets/ShareModal-C-sD-aia.js +32 -0
- package/dist/assets/{ShareModal-C8S7ySls.css → ShareModal-PobtP7AJ.css} +1 -1
- package/dist/assets/{ShipCascade-B6kVuilv.js → ShipCascade-Cq_I4c_v.js} +1 -1
- package/dist/assets/{ShipCourse-CerQYrsy.js → ShipCourse-CzsJyMnT.js} +1 -1
- package/dist/assets/{ShipHotspots-DOmWYgHH.js → ShipHotspots-OMjPhQWP.js} +1 -1
- package/dist/assets/{ShipIncident-D0lvmytD.js → ShipIncident-Cqn6ZmKz.js} +1 -1
- package/dist/assets/{ShipMigration-D70LbiJk.js → ShipMigration-5_ZWn7K9.js} +1 -1
- package/dist/assets/{ShipOnboarding-B_0dp9a-.js → ShipOnboarding-Yr8oKgmQ.js} +1 -1
- package/dist/assets/{ShipRead-Cp2s7bSL.js → ShipRead-Bnw7mnv3.js} +1 -1
- package/dist/assets/{ShipRollout-Bw9pvbSM.js → ShipRollout-ECsDrqAd.js} +1 -1
- package/dist/assets/{ShipSuggestions-eHLjOJL5.js → ShipSuggestions-C6oDw2F8.js} +1 -1
- package/dist/assets/{ShipWorkspace-DwdoBSix.js → ShipWorkspace-BT6gZrqd.js} +1 -1
- package/dist/assets/{SignatureLoop-Bl43npTM.js → SignatureLoop-D7sibSnc.js} +1 -1
- package/dist/assets/{SynthesisApp-BkOWv_pc.js → SynthesisApp-B768x2r_.js} +2 -2
- package/dist/assets/{SynthesisOverlay-CHlVL7sT.js → SynthesisOverlay-Ds0MhZLQ.js} +1 -1
- package/dist/assets/{TermsApp-PakIMrh0.js → TermsApp-Da8FeMj3.js} +1 -1
- package/dist/assets/{TopicCanvas-wmAsICUd.js → TopicCanvas-D64O3lvD.js} +2 -2
- package/dist/assets/{TourPrism-VQqowXpY.js → TourPrism-CTf1G-Vv.js} +1 -1
- package/dist/assets/{TrackerTile-C1mU8Zxj.js → TrackerTile-DeujTCk-.js} +2 -2
- package/dist/assets/{TwoSurfaces-SNT4AVzV.js → TwoSurfaces-kyK2yqm0.js} +1 -1
- package/dist/assets/{UnderstoodPanel-BkwhDLhW.js → UnderstoodPanel-Dgwk_Cuj.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-DgYhqU53.js → WhyMachineOverlay-C4eQC0lg.js} +1 -1
- package/dist/assets/{WowFeatures-Cky9THxT.js → WowFeatures-CaBZ5WPM.js} +1 -1
- package/dist/assets/{ZoomDeck-BXwcRCO_.js → ZoomDeck-DnCtbhx1.js} +1 -1
- package/dist/assets/{alternateFinishes-Cn5LyQ0-.js → alternateFinishes-FSV_gA1A.js} +1 -1
- package/dist/assets/{annotationAuto-L2AxlJ2F.js → annotationAuto-x_dV8z65.js} +1 -1
- package/dist/assets/annotationReel-SeXzv0P-.js +1 -0
- package/dist/assets/{backup-Cw4GBHBV.js → backup-0zODkqi-.js} +1 -1
- package/dist/assets/canvas-uhcwigAL.js +1 -0
- package/dist/assets/{catalog-2srqP2Jf.js → catalog-Car_1ocN.js} +1 -1
- package/dist/assets/{dashboardEvents-S4Y2aOP_.js → dashboardEvents-BqcPN-K8.js} +2 -2
- package/dist/assets/{dist-BJbBdhc0.js → dist-BTg4yEWr.js} +1 -1
- package/dist/assets/{fit-C3MkNFdn.js → fit-I3tuibfX.js} +1 -1
- package/dist/assets/{generateLive-Ci8kqPD9.js → generateLive-Dk24OxVt.js} +1 -1
- package/dist/assets/{index-DWHIOldG.js → index-CWqRe4-B.js} +3 -3
- package/dist/assets/{jspdf.es.min-CfZM9xhl.js → jspdf.es.min-wkD3BzGZ.js} +1 -1
- package/dist/assets/kokoro-B-3GqktX.js +1 -0
- package/dist/assets/{lib-C9jT-CD8.js → lib-CwruVYU_.js} +1 -1
- package/dist/assets/{liveSchema-Dw4t_k7M.js → liveSchema-CCpVMy0H.js} +1 -1
- package/dist/assets/{motion-QSGW_vc_.js → motion-CURfDtdH.js} +1 -1
- package/dist/assets/{notes-D21K92Wx.js → notes-BG5QP-Dj.js} +1 -1
- package/dist/assets/{pdf-BP_vXBKO.js → pdf-x4qTBJIZ.js} +1 -1
- package/dist/assets/{perfProbe-DFw7brPU.js → perfProbe-BFwfpxJt.js} +1 -1
- package/dist/assets/{pin-BzDcIYD4.js → pin-DRN5H7py.js} +1 -1
- package/dist/assets/{portal-n6TW0FuE.js → portal-BYHo9LOD.js} +1 -1
- package/dist/assets/{pptxgen.es-GleD8us4.js → pptxgen.es-DGywGiaX.js} +1 -1
- package/dist/assets/{prewarm-CehIIttc.js → prewarm-CQNCE4Uq.js} +1 -1
- package/dist/assets/{quietHours-Brg4oaDf.js → quietHours-CKjQ2pGY.js} +1 -1
- package/dist/assets/{registry-CoCl26Tl.js → registry-1BWL6SXY.js} +1 -1
- package/dist/assets/registry-5a-E7vEN.css +1 -0
- package/dist/assets/{registry-mmGDT0wn.js → registry-9S6KiKjR.js} +1 -1
- package/dist/assets/{registry-BE1QBNKm.js → registry-BZQeYzgv.js} +1 -1
- package/dist/assets/{registry-CG5W7Xs6.js → registry-Bc6_RQ8l.js} +1 -1
- package/dist/assets/{registry-_mqmf4_W.js → registry-BklPTZre.js} +1 -1
- package/dist/assets/{registry-ia68k5sK.js → registry-Bl3NkU-0.js} +1 -1
- package/dist/assets/{registry-NNLA0NQi.js → registry-BpBiRe-o.js} +1 -1
- package/dist/assets/{registry-h3m1zDGt.js → registry-Bpx4VBWb.js} +1 -1
- package/dist/assets/{registry-BvEfWbB0.js → registry-BueBIP-N.js} +1 -1
- package/dist/assets/{registry-eQ4cE0zj.js → registry-CNr6L-3z.js} +1 -1
- package/dist/assets/{registry-CrpEXqNF.js → registry-CfTTYQrE.js} +1 -1
- package/dist/assets/{registry-CePhqBU6.js → registry-CqfjqOX5.js} +2 -2
- package/dist/assets/{registry-D86iln18.js → registry-D84Bs-bD.js} +1 -1
- package/dist/assets/{registry-DgIia4dY.js → registry-DBsjgIxw.js} +1 -1
- package/dist/assets/{registry-vPwth4BB.js → registry-DEgW3zel.js} +1 -1
- package/dist/assets/{registry-BPpjU0S5.js → registry-DFmFBfRz.js} +1 -1
- package/dist/assets/{registry-Cpr0zSyk.js → registry-DrqQbf_n.js} +1 -1
- package/dist/assets/{registry-VKh9QiDf.js → registry-Dw42uggW.js} +1 -1
- package/dist/assets/{registry-HB-VAc6H.js → registry-GLjcQX0n.js} +1 -1
- package/dist/assets/{registry-BYn3Bcie.js → registry-Z3TIPbYJ.js} +1 -1
- package/dist/assets/{registry-ChG5tFfx.js → registry-_T6pLDPG.js} +2 -2
- package/dist/assets/{registry-VS55xdsN.js → registry-aUZZeh27.js} +1 -1
- package/dist/assets/{registry-CFU0k7VB.js → registry-cPmSqaRu.js} +1 -1
- package/dist/assets/{relate-DDWak0Tv.js → relate-yq30L3hZ.js} +1 -1
- package/dist/assets/{shikiHighlight-SWupBCFg.js → shikiHighlight-BgZoQAHs.js} +1 -1
- package/dist/assets/src-B-t8Mww-.js +2 -0
- package/dist/assets/{useDashboardLoop-BSBGTrE2.js → useDashboardLoop-mGmJwv27.js} +3 -3
- package/dist/assets/{useLiveConfig-Cc4IKgOd.js → useLiveConfig-vMyjo2gV.js} +1 -1
- package/dist/assets/{useSpatialCanvas-D3nfHkST.js → useSpatialCanvas-CEXy6ZC2.js} +1 -1
- package/dist/assets/{useSpotlightWalk-gVilFhpa.js → useSpotlightWalk-B9XJ6OLK.js} +1 -1
- package/dist/assets/{useSrsCards-BhFfq4vc.js → useSrsCards-Vc6B2_he.js} +1 -1
- package/dist/assets/{useStudy-DRNarubG.js → useStudy-6QnY-Fw_.js} +1 -1
- package/dist/assets/{useZoomGesture-BdeFOm7j.js → useZoomGesture-BONUz5cE.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/DashboardLoopRuntime-DfnDIGFz.js +0 -1
- package/dist/assets/LiveApp-DmU3RMfZ.js +0 -61
- package/dist/assets/MindShape-Ca3MXEgK.css +0 -1
- package/dist/assets/ShareModal-d_o2hebL.js +0 -32
- package/dist/assets/annotationReel-DdHNp2IH.js +0 -1
- package/dist/assets/canvas-BwR8ltlj.js +0 -1
- package/dist/assets/kokoro-Da60jB7C.js +0 -1
- package/dist/assets/registry-CtbuZWYz.css +0 -1
- package/dist/assets/src-DbgF7cRH.js +0 -2
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-BJbBdhc0.js","assets/chunk-BVpWp9h4.js","assets/index-DWHIOldG.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/generateLive-Ci8kqPD9.js","assets/blockLabel-DAqaHKy3.js","assets/liveSchema-Dw4t_k7M.js","assets/catalog-2srqP2Jf.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-Cw7tCHIp.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-Be63DJkp.js","assets/speed-DwPw9KSv.js","assets/TopicCanvas-wmAsICUd.js","assets/FallbackCard-B489rTd9.js","assets/FallbackCard-D_6ps1xA.css","assets/CanvasSkeleton-BCq4yAAN.js","assets/CanvasSkeleton-iy6DBvde.css","assets/lib-C9jT-CD8.js","assets/BlockEmpty-Dp9IPo4S.js","assets/motion-QSGW_vc_.js","assets/lib-DMAxsZKm.css","assets/format-DlZTyeMy.js","assets/useSpatialCanvas-D3nfHkST.js","assets/useValidatedImage-D2fhA198.js","assets/richText-BkxJhl9N.js","assets/toast-BBNs2h3L.js","assets/TopicCanvas-D2Nax9II.css","assets/HowItWorks-DfUsQ2xD.js","assets/canvas-BwR8ltlj.js","assets/ReplayCard-MSWq-Mxr.js","assets/ShareModal-d_o2hebL.js","assets/ReelJelly-9SCjNeHq.js","assets/geometry-DXAbnb0J.js","assets/registry-ChG5tFfx.js","assets/fit-C3MkNFdn.js","assets/share-QHGHNDhQ.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-Da60jB7C.js","assets/ShareModal-C8S7ySls.css","assets/annotationReel-DdHNp2IH.js","assets/generateBeats-b64CL54v.js","assets/CommandPalette-Cq9mDWiI.js","assets/registry-BffpZK5w.js","assets/CommandPalette-Bb-eErih.css","assets/Library-CAnmN5YL.js","assets/neighborhoods-DFqKm9Xi.js","assets/chapters-Cbe53c3W.js","assets/time-BHTmJR1s.js","assets/Library-DmrtHjUf.css","assets/LiveSettings-5UCN5UWM.js","assets/useStudy-DRNarubG.js","assets/store-DrBDvqXF.js","assets/queue-J4h7E3uc.js","assets/store-DXmC_fP2.js","assets/queue-DHeyJ32F.css","assets/useLiveConfig-Cc4IKgOd.js","assets/quietHours-Brg4oaDf.js","assets/store-DoJn3lBF.js","assets/DropSelect-DbxAWKQn.js","assets/LiveSettings-CmgrMqvK.css","assets/DashboardDetail-BSZ3CgcK.js","assets/CheckLogRail-DbGJtneK.js","assets/dashboardEvents-S4Y2aOP_.js","assets/format-hc2QOoIu.js","assets/CheckLogRail-F4AlgAcc.css","assets/useDashboardLoop-BSBGTrE2.js","assets/notify-Bz4wuE4T.js","assets/predictions-CYS7Vo39.js","assets/json-B0N3XRZU.js","assets/pin-BzDcIYD4.js","assets/pin-Bya3BL_a.css","assets/planTracker-7AMCQPNx.js","assets/dashboards-rcWxdoXI.css","assets/DashboardSettings-C1rC3iTs.js","assets/UnderstoodPanel-BkwhDLhW.js","assets/UnderstoodPanel-Q6GX1TFq.css","assets/ZoomDeck-BXwcRCO_.js","assets/portal-n6TW0FuE.js","assets/useZoomGesture-BdeFOm7j.js","assets/ZoomDeck-B2SjNwY7.css","assets/AtlasView-B8b67dk0.js","assets/store-Dn23_Ymr.js","assets/AtlasView-B5fkQhO6.css","assets/RippleOverlay-Cfu3ZVL1.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-DjK_L3eD.js","assets/generateCourse-Cj_-vDWu.js","assets/store-BMRQiV1z.js","assets/deckLine-NBd3MyGT.js","assets/useSrsCards-BhFfq4vc.js","assets/CourseRail-CUa7uIGG.css","assets/MindMapViewerDrawer-DoXy6hCD.js","assets/MindShape-BJCnqyTi.js","assets/Presence-LNSqCz8N.js","assets/MindShape-Ca3MXEgK.css","assets/Recap-Ba2qZ2lX.js","assets/Recap-DCiiWNiV.css","assets/LibraryOverlay-D7Gg_GIv.js","assets/LibraryOverlay-CnKWDMG_.css","assets/ReplayOverlay-ChDrwMLh.js","assets/ExportModal-HczU1Zg1.js","assets/notes-D21K92Wx.js","assets/registry-CrpEXqNF.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-BE1QBNKm.js","assets/registry-2GJZ46M8.css","assets/registry-D86iln18.js","assets/registry-DpaaVbmL.css","assets/registry-mmGDT0wn.js","assets/registry-upbw6pyj.css","assets/registry-VS55xdsN.js","assets/CodeOutput-DjsCJAel.js","assets/registry-BzNLfje1.css","assets/registry-VKh9QiDf.js","assets/registry-ei6fIgBT.css","assets/registry-_mqmf4_W.js","assets/registry-UFIuwh3i.css","assets/registry-h3m1zDGt.js","assets/registry-CtbuZWYz.css","assets/registry-CePhqBU6.js","assets/registry-ZOWzhOHk.css","assets/registry-ia68k5sK.js","assets/registry-CRisz4Ca.css","assets/registry-NNLA0NQi.js","assets/registry-BcZXBr3y.css","assets/registry-CG5W7Xs6.js","assets/registry-CNgybLQv.css","assets/registry-DgIia4dY.js","assets/useSpotlightWalk-gVilFhpa.js","assets/registry-BAoRB8rd.css","assets/registry-vPwth4BB.js","assets/registry-T3i2Q9SI.css","assets/registry-BYn3Bcie.js","assets/registry-Xzq_Rpmm.css","assets/registry-BvEfWbB0.js","assets/Quiz-CUwtekfu.js","assets/stepDriver-DwjFet6U.js","assets/registry-DVzLacl_.css","assets/registry-DmQlNN3y.js","assets/registry-CRM7y8QT.css","assets/registry-CFU0k7VB.js","assets/registry-Dye5m3qt.css","assets/registry-Dkc7hN5T.js","assets/registry-C3ezxLR3.css","assets/registry-Cpr0zSyk.js","assets/registry-BVHiKEwE.css","assets/registry-HB-VAc6H.js","assets/registry-DWcNVyI2.css","assets/registry-BPpjU0S5.js","assets/registry-GeSy4i7R.css","assets/registry-CoCl26Tl.js","assets/registry-Dru0JcTa.css","assets/registry-eQ4cE0zj.js","assets/notes-A9t4jdfx.css","assets/ExportModal-D4WpAg2c.css","assets/ExtractionPreview-BfjJci-N.js","assets/relate-DDWak0Tv.js","assets/PinToDashboard-Dq77a2iP.js","assets/PrismOverlay-CYItOpax.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-CHlVL7sT.js","assets/RehearsalPanel-CtYKPl6O.js","assets/RehearsalPanel-BCU615wg.css","assets/PresentationDeck-8kT0cMtk.js","assets/pageVisibility-BxUVsw7Z.js","assets/DelegatePanel-bFmfn9-D.js","assets/DelegatePanel-_9RZiLHM.css","assets/SrsReview-BoaYb6XN.js","assets/SrsReview-DmGdGxT0.css","assets/TourPrism-VQqowXpY.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 ee,u as I,w as te,z as L}from"./index-DWHIOldG.js";import{n as R}from"./icons-CHVz6kv_.js";import{n as ne,t as re}from"./spokenText-D4zPX9JY.js";import{a as ie,i as ae,o as oe,r as se,s as ce}from"./threads-CkMgrSDP.js";import{D as le,E as ue,O as de,T as fe,_ as pe,a as me,c as he,d as ge,f as z,l as _e,n as ve,o as ye,p as be,s as xe,u as Se,v as Ce,w as we}from"./kokoro-Da60jB7C.js";import{t as Te}from"./FeatureUseNotice-CoK5HkbR.js";import{d as Ee,f as B,l as De,n as Oe,o as ke,s as Ae,t as je}from"./CanvasSkeleton-BCq4yAAN.js";import{n as Me,r as Ne}from"./blockLabel-DAqaHKy3.js";import{t as Pe}from"./Presence-LNSqCz8N.js";import{t as V}from"./MindShape-BJCnqyTi.js";import{r as Fe,t as Ie}from"./sourceHost-BV3t2XDb.js";import{t as Le}from"./stepDriver-DwjFet6U.js";import{t as Re}from"./portal-n6TW0FuE.js";import{i as ze,n as Be,r as Ve,t as He}from"./gesture-DabMpPcq.js";import{_ as Ue,f as We,g as Ge,i as Ke,t as qe,u as Je,v as Ye,x as Xe,y as Ze}from"./providers-wzm7E8Pa.js";import{a as Qe,s as $e}from"./streamParse-DRgMHWye.js";import{a as et,i as tt,n as nt,o as rt,t as it}from"./registry-eQ4cE0zj.js";import{t as at}from"./registry-BffpZK5w.js";import{i as ot,r as st}from"./info-CiqHR5cs.js";import{a as ct,c as lt,i as ut,l as dt,n as ft,r as pt,s as mt}from"./store-DrBDvqXF.js";import{n as ht,t as gt}from"./generateBeats-b64CL54v.js";import{n as _t,r as vt}from"./chapters-Cbe53c3W.js";import"./queue-J4h7E3uc.js";import{B as yt,S as bt,U as xt,a as St,d as Ct,f as wt,g as Tt,i as Et,o as Dt,p as Ot,r as kt,s as At,v as jt,z as Mt}from"./useStudy-DRNarubG.js";import{a as Nt,c as Pt,l as Ft,n as It,o as Lt,r as Rt,s as zt,u as Bt}from"./useLiveConfig-Cc4IKgOd.js";import{prewarmLive as Vt}from"./prewarm-CehIIttc.js";import{D as Ht,E as Ut,T as Wt,_ as Gt,b as Kt,g as qt,h as Jt,i as Yt,k as Xt,m as Zt,n as Qt,o as $t,u as en,v as tn,w as nn,x as rn}from"./shapes-Cw7tCHIp.js";import{a as an,o as on,r as sn}from"./store-DoJn3lBF.js";import{a as cn,c as ln,d as un,f as dn,i as fn,l as pn,o as mn,p as hn,s as gn,t as _n,u as vn}from"./quietHours-Brg4oaDf.js";import{t as yn}from"./DropSelect-DbxAWKQn.js";import{a as bn,d as xn,g as Sn,l as Cn,n as wn,p as Tn,r as En}from"./store-DXmC_fP2.js";import{t as Dn}from"./useZoomGesture-BdeFOm7j.js";import{a as On,o as kn,t as An}from"./store-Dn23_Ymr.js";import{SEED_SHIP as jn}from"./seed-b1xc0dj2.js";import{v as Mn,y as Nn}from"./githubToken-DtcLYqwm.js";import{enrichShipModel as Pn}from"./generate-8odaTyr4.js";import{a as Fn,c as In,f as Ln,h as Rn,l as zn,m as Bn,o as Vn,r as Hn,t as Un}from"./store-BMRQiV1z.js";import{n as Wn}from"./speed-DwPw9KSv.js";import{r as Gn}from"./courseSeed-CZdNBTTs.js";import{i as Kn,n as qn,r as Jn,t as Yn}from"./mastery-D7xYf5D7.js";var H=t(),Xn=k(),Zn=/\?\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 Qn(e){return Zn.test(e.trim())}function $n(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 er(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=$n(n,t),i=Qn(t);return r&&!i?(e.fill(r),!0):!r&&!i}function tr(e){return e.alwaysOn&&e.sttOk&&!e.composerHasText}function nr(e,t){let n=(0,H.useRef)({...e,...t});n.current={...e,...t};let r=tr(e);(0,H.useEffect)(()=>{if(!r)return;let e=()=>{document.hidden?n.current.stop():tr(n.current)&&!n.current.listening&&n.current.start()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[r])}var U=n(),rr=200;function ir(e){let t=e.trim().split(/\s+/).filter(Boolean).length;return Math.min(8e3,700+t*360)}function ar(e,t){let n=(0,H.useRef)(e);n.current=e;let[r,i]=(0,H.useState)(null),a=(0,H.useRef)(null),o=(0,H.useCallback)(e=>{a.current=e,i(e)},[]),s=(0,H.useRef)(void 0),c=(0,H.useRef)(void 0),l=(0,H.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,H.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)},ir(i))},rr)},[l,o]);return(0,H.useEffect)(()=>()=>{l(),o(null)},[t,l,o]),{narrate:u,narratingId:r}}var or=`mavea-view-mode`,sr=or,cr=`everything`;function lr(e){return e===`focus`||e===`everything`||e===`canvas`}var ur=null;function dr(){try{if(typeof localStorage>`u`)return cr;let e=localStorage.getItem(or);return lr(e)?e:cr}catch{return cr}}function fr(){return ur||(ur=dr(),ur)}function pr(e){if(lr(e)){ur=e;try{typeof localStorage<`u`&&e!==`canvas`&&localStorage.setItem(or,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(sr))}catch{}}}function mr(){let[e,t]=(0,H.useState)(()=>fr());return(0,H.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(fr());return window.addEventListener(sr,e),()=>window.removeEventListener(sr,e)},[]),[e,(0,H.useCallback)(pr,[])]}var hr=350;function gr({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,H.useRef)(null),v=(0,H.useRef)(null),[y,b]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(!f)return;b(!0);let e=setTimeout(()=>b(!1),1100);return()=>clearTimeout(e)},[f]);let x=(0,H.useRef)(null),S=(0,H.useRef)(!1),C=(0,H.useRef)(!1);(0,H.useEffect)(()=>{!r&&_.current&&_.current.focus()},[r]),(0,H.useEffect)(()=>{l&&_.current&&_.current.focus()},[l]);let w=(0,H.useCallback)(e=>{a||r||(e.currentTarget.setPointerCapture(e.pointerId),S.current=!1,x.current=setTimeout(()=>{S.current=!0,p?.()},hr))},[a,r,p]),T=(0,H.useCallback)(()=>{x.current!==null&&(clearTimeout(x.current),x.current=null),S.current&&(S.current=!1,C.current=!0,m?.())},[m]),E=(0,H.useCallback)(()=>{if(C.current){C.current=!1;return}a||i()},[i,a]),D=(0,U.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,U.jsx)(R.micOff,{}):(0,U.jsx)(R.mic,{})});return(0,U.jsxs)(`div`,{className:`composer`,children:[g?(0,U.jsxs)(`div`,{className:`mic-btn-wrap`,children:[D,g]}):D,c&&!e?(0,U.jsx)(`div`,{className:`live-listen heard`,children:(0,U.jsxs)(`span`,{style:{color:`var(--text-primary)`},children:[`"`,c,`"`]})}):r&&!e?(0,U.jsxs)(`div`,{className:`live-listen`,children:[(0,U.jsx)(`span`,{className:`wave`,children:[14,18,10,20,8,16,12].map((e,t)=>(0,U.jsx)(`i`,{style:{height:e}},t))}),`Listening…`]}):(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{ref:v,type:`file`,name:`mavea-attach`,accept:Ke,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,U.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,U.jsx)(R.paperclip,{})})]}),h,(0,U.jsx)(`button`,{className:`send-btn`,disabled:s||!e.trim(),onClick:()=>n(e),title:`Send`,"aria-label":`Send`,children:(0,U.jsx)(R.send,{})})]})}u();var _r=null;async function vr(){return _r||(_r=(await M(()=>import(`./corpus.generated-oX9uU93S.js`),[])).default,_r)}function yr(e){return _r?.conversations.find(t=>t.id===e)}function W(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 br(e){return{...e,question:W(e.question),narration:W(e.narration),spoken:e.spoken?W(e.spoken):e.spoken,tour:e.tour.map(e=>({...e,say:e.say?W(e.say):e.say,saySpoken:e.saySpoken?W(e.saySpoken):e.saySpoken}))}}var xr=[{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}],Sr=[{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`}],Cr=[...xr,...Sr];function wr(e){return Cr.find(t=>t.id===e)}var Tr={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 G(e,t){let n=yr(e),r=n?.frames[0];if(!n||!r)return null;let i=W(t??Tr[e]??n.question);return{frame:br({...r,question:i}),question:i}}var Er=[{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`}],Dr=[{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:Er}}],Or=[{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 kr(e,t){return{question:`Can I afford a 6-month career break?`,narration:t,mode:`replace`,tour:[],spec:e,at:0}}function K(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:Dr,blanks:Er,awaiting:!0},r={...t,blocks:Or,blanks:void 0,awaiting:!1};return{holes:kr(n,``),filled:kr(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 Ar(){let e=!1,t=[];return{after(n,r){t.push(setTimeout(()=>!e&&r(),n))},cancel(){e=!0,t.forEach(clearTimeout)}}}function jr(e,t){if(I()){t();return}let n=Date.now(),r=()=>{if(I()||Date.now()-n>=8e3){t();return}e(200,r)};e(200,r)}function Mr(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 Nr(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 Pr=450,Fr=1600;function Ir(e,t){if(e<=0)return[];let n=Math.max(Fr,Math.floor((t-Pr-400)/e));return Array.from({length:e},(e,t)=>Pr+t*n)}var Lr=1500,Rr=900;function zr(e,t){let n=1850;if(e<=0)return{focusAt:Lr,spotlightAt:[]};let r=Math.max(Rr,Math.floor((t-n)/e));return{focusAt:Lr,spotlightAt:Array.from({length:e},(e,t)=>n+t*r)}}var Br=[`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 Vr(e){return!!e&&Sr.some(t=>t.id===e)}function Hr(e){return!!e&&xr.some(t=>t.id===e)}function Ur(e){let{active:t}=e,[n,r]=(0,H.useState)(()=>{let t=e.startChapter;return Vr(t)||Hr(t)&&e.solo?t??null:null}),[i,a]=(0,H.useState)(()=>{let t=e.startChapter;if(Vr(t)||Hr(t)&&e.solo)return 0;let n=t?xr.findIndex(e=>e.id===t):-1;return n>=0?n:0}),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),f=(0,H.useRef)(u);f.current=u;let[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(0),_=(0,H.useRef)(e.ops);_.current=e.ops;let v=n?wr(n):void 0,y=v?[v]:xr,b=(0,H.useRef)(y);b.current=y;let x=y.length,C=t?y[i]??null:null,[w,T]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(!t)return;let e=!0;return vr().then(()=>{e&&T(!0)}),()=>{e=!1}},[t]);let E=(0,H.useCallback)(()=>{let e=_.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,H.useEffect)(()=>{if(!t||!o||p||!w)return;let e=b.current[i];if(!e)return;S(e.id,!!n);let r=_.current,a=Ar(),s=a.after,c=e=>jr(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=G(`money`);e&&u(e)}r.setMuted(f.current||e.mode===`silent`);let d=e.action;if(d.kind===`answer`){let e=G(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(Mr(s,r.typeInto,t)+360,()=>c(()=>r.showFrame(n,e.question)))}}else if(d.kind===`chip`){let e=G(`money`);e&&u(e),s(1400,()=>r.pressKeepGoing(d.label)),s(2e3,()=>{let e=G(d.convoId,d.label);e&&r.showFrame(e.frame,e.question)})}else if(d.kind===`montage`){let t=d.convoIds.map(e=>G(e)).filter(Boolean),n=Ir(t.length,e.durationMs);t.forEach((e,t)=>s(n[t],()=>u(e)))}else if(d.kind===`ask`)s(1300,()=>r.pinFirstBlock()),Mr(s,r.typeInto,`Why does it grow faster after year 20?`,1700);else if(d.kind===`askMulti`){let e=G(`money`);e&&u(e),s(1300,()=>r.pinFirstBlocks(2)),Mr(s,r.typeInto,`How do these two parts explain the final total?`,2600)}else if(d.kind===`bend`){if(d.convoId){let e=G(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=G(`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=G(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=G(d.convoId);t&&u(t);let n=(t?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e),{focusAt:i,spotlightAt:a}=zr(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 Br)e=Mr(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=G(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=G(`money`)?.frame.spec;if(e){let{holes:t,filled:n}=K(e);u({frame:t,question:t.question}),s(5200,()=>r.showFrame(n,n.question))}}return e.mode!==`silent`&&!f.current&&s(160,()=>l(W(e.coach))),a.cancel},[i,h,t,o,p,w,n,E]),(0,H.useEffect)(()=>{if(!t||!o||p||!c||!w)return;let e=b.current[i];if(!e)return;let n=_.current;return Nr({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,H.useEffect)(()=>()=>E(),[E]);let D=(0,H.useCallback)(()=>{I(),s(!0),l(!0),m(!1)},[]),O=(0,H.useCallback)((e,t)=>{I(),m(!1),t?.keepPlaying||l(!1),a(Math.max(0,Math.min(b.current.length-1,e))),g(e=>e+1)},[]),k=(0,H.useCallback)(()=>{i+1>=x?(E(),m(!0)):O(i+1,{keepPlaying:!0})},[i,x,O,E]),A=(0,H.useCallback)(()=>O(i-1),[i,O]),j=(0,H.useCallback)(e=>O(e),[O]),M=(0,H.useCallback)(()=>{E(),r(null),s(!0),O(0),l(!0)},[O,E]),N=(0,H.useCallback)(e=>{Vr(e)&&(I(),r(e),s(!0),m(!1),l(!0),a(0),g(e=>e+1))},[]),P=(0,H.useCallback)(()=>{if(I(),!o){D();return}if(p){M();return}l(e=>!e)},[p,M,D,o]),F=(0,H.useCallback)(()=>{I();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(W(t.coach))},[p,i,o]),ee=(0,H.useCallback)(()=>{E(),m(!0)},[E]);return{active:t,started:o,index:i,total:x,chapter:C,coach:W(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:ee,playExtra:N}}var q=T();function Wr(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 Gr(e,t){let n=(0,q.c)(4),[r,i]=(0,H.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(Xr).filter(Boolean),c=()=>{if(!n)return;let e=null,t=null;for(let n of s){let r=Array.from(document.querySelectorAll(n)).filter(Yr).map(Jr).filter(qr),i=r.find(Kr)??r[0];if(i){e=i.hit,t=i.rect;break}}if(!e||!t){o(null);return}let i=t;if(!Wr(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,H.useEffect)(a,o),r}function Kr(e){let{rect:t}=e;return Wr(t)}function qr(e){let{rect:t}=e;return t.width>0&&t.height>0}function Jr(e){return{hit:e,rect:e.getBoundingClientRect()}}function Yr(e){return!e.checkVisibility||e.checkVisibility({checkOpacity:!0})}function Xr(e){return e.trim()}function Zr(e){let t=(0,q.c)(72),{driver:n}=e,r=Gr(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,Qr},o=[i],t[0]=i,t[1]=a,t[2]=o),(0,H.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,U.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,U.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,U.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,U.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,U.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,U.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,U.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,U.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,U.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,U.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,U.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,U.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,U.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,U.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.prev,disabled:n.index===0,"aria-label":`Previous chapter`,children:(0,U.jsx)(R.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,U.jsx)(R.pause,{className:`tourx-ic`}):(0,U.jsx)(R.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,U.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,U.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,U.jsx)(R.speakerOff,{className:`tourx-ic`}):(0,U.jsx)(R.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,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.next,"aria-label":`Next chapter`,children:(0,U.jsx)(R.chevR,{className:`tourx-ic`})}),(0,U.jsx)(`div`,{className:`tourx-dots`,role:`tablist`,"aria-label":`Chapters`,children:Array.from({length:n.total},(e,t)=>(0,U.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,U.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,U.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,U.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,U.jsxs)(`div`,{className:`tourx`,"aria-live":`polite`,children:[c,N]}),t[69]=N,t[70]=c,t[71]=P):P=t[71],P}function Qr(){delete document.body.dataset.tourChapter}function $r({onStart:e,onReplay:t,onPlayExtra:n,hasStoredSession:r=!1}){return(0,U.jsx)(`div`,{className:`tour-end`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-end-title`,children:(0,U.jsxs)(`section`,{className:`tour-end-card`,children:[(0,U.jsxs)(`header`,{className:`tour-end-intro`,children:[(0,U.jsx)(`div`,{className:`tour-end-mascot`,"aria-hidden":`true`,children:(0,U.jsx)(Pe,{state:`idle`,emotion:`neutral`,gaze:`center`})}),(0,U.jsx)(`h2`,{id:`tour-end-title`,className:`tour-end-title tour-end-line`,children:`That's Mavéa.`}),(0,U.jsx)(`p`,{className:`tour-end-tagline tour-end-line`,children:`Talk to AI. See what it means.`}),(0,U.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,U.jsxs)(`div`,{className:`tour-end-actions tour-end-line`,children:[(0,U.jsx)(`button`,{type:`button`,className:`tour-end-start`,onClick:e,children:r?`Back to your session`:`Start Mavéa`}),(0,U.jsx)(`button`,{type:`button`,className:`tour-end-replay`,onClick:t,children:`Replay the tour`})]})]}),(0,U.jsxs)(`div`,{className:`tour-end-extras`,children:[(0,U.jsx)(`h3`,{children:`More to explore`}),(0,U.jsx)(`div`,{className:`tour-end-grid`,children:Sr.map(e=>(0,U.jsxs)(`button`,{type:`button`,className:`tour-end-extra`,onClick:()=>n(e.id),"aria-label":`Play scripted mini-demo: ${e.title}`,children:[(0,U.jsx)(`span`,{className:`tour-end-glyph`,"aria-hidden":`true`,children:e.glyph}),(0,U.jsxs)(`span`,{className:`tour-end-extra-copy`,children:[(0,U.jsx)(`strong`,{children:e.title}),(0,U.jsx)(`small`,{children:e.hook})]})]},e.id))})]})]})})}var ei=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 ti(e){return ei.get(e)}function ni(e){return e.steps.filter(e=>!!e.ask)}var ri=1300,ii=900;function ai(e,t){return(e?.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,t)}function J(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&&ai(n,4).forEach((n,i)=>r(e.atMs+ii+i*ri,()=>t.setSpot(n)));break;case`canvas`:{r(e.atMs,()=>t.setViewMode(`canvas`));let i=ai(n,3);i.forEach((n,i)=>r(e.atMs+ii+i*ri,()=>t.setSpot(n))),r(e.atMs+ii+i.length*ri,()=>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 oi(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 si(e){return e?.length?Math.max(...e.map(e=>e.atMs+oi(e))):0}u();var ci=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 li(e){let t=ci[`./${e}.generated.json`];if(!t)return null;try{return(await t()).default??null}catch{return null}}var ui=4500,di=1e3,fi=6e4;function pi(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 mi(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 hi(e){let{active:t,personaId:n}=e,r=n?ti(n):void 0,i=r?.steps??[],a=i.length,[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(`loading`),[u,f]=(0,H.useState)(()=>Math.max(0,Math.min(a-1,e.startStep??0))),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(!1),y=(0,H.useRef)(_);y.current=_;let[b,x]=(0,H.useState)(!1),[S,C]=(0,H.useState)(0),[w,T]=(0,H.useState)(null),E=(0,H.useRef)(e.ops);E.current=e.ops;let D=(0,H.useRef)(null),O=(0,H.useRef)(0),k=(0,H.useCallback)(()=>{if(!t||!n)return;l(`loading`);let e=++O.current;li(n).then(t=>{if(e!==O.current)return;let n=r?ni(r).length:0,i=!!t&&!!r&&t.frames.length===n;s(i?t:null),l(i?`ready`:`error`)})},[t,n,r]);(0,H.useEffect)(k,[k]);let A=(0,H.useCallback)(()=>{let e=E.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,H.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=Ar(),a=i.after;T(null),D.current=null,A(),n.setMuted(y.current);let s=pi(r.steps,u,o),l=s??mi(r.steps,u,o),f=e.ask?W(e.ask):null,m=s?br({...s,question:f??s.question}):null,h=l?br(l):null,g=()=>{let t=e.beats??[];for(let e of t)J(e,n,h,a);e.note&&a(t.length?Math.min(...t.map(e=>e.atMs)):0,()=>T(W(e.note??``))),D.current=Date.now()+si(t)+(e.holdMs??ui)},_=e=>{let t=Date.now(),r=0,i=()=>{if(Date.now()-t>=fi){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=Mr(a,n.typeInto,c,400)+360,a(l,()=>jr(a,()=>n.showFrame(m,c))),_(l+di)}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,H.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,H.useEffect)(()=>()=>A(),[A]);let j=(0,H.useCallback)(()=>{I(),m(!0),g(!0),x(!1)},[]),M=(0,H.useCallback)((e,t)=>{I(),x(!1),t?.keepPlaying||g(!1),f(Math.max(0,Math.min(a-1,e))),C(e=>e+1)},[a]),N=(0,H.useCallback)(()=>{u+1>=a?(A(),x(!0)):M(u+1,{keepPlaying:!0})},[u,a,M,A]),P=(0,H.useCallback)(()=>M(u-1),[u,M]),F=(0,H.useCallback)(e=>M(e),[M]),ee=(0,H.useCallback)(()=>{A(),m(!0),M(0),g(!0)},[M,A]),te=(0,H.useCallback)(()=>{if(I(),!p){j();return}if(b){ee();return}g(e=>!e)},[b,ee,j,p]),L=(0,H.useCallback)(()=>{I();let e=!y.current;y.current=e,v(e),E.current.setMuted(e),e&&E.current.cancelSpeech()},[]),R=(0,H.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:te,toggleMute:L,replay:ee,skip:R}}function gi(e){return/\p{Extended_Pictographic}/u.test(e)}function _i({driver:e,member:t,onExit:n}){if(!e.active)return null;let r={"--accent":t.accent};if(e.loadState===`loading`)return(0,U.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{className:`demox-load`,style:r,children:[(0,U.jsx)(R.spinner,{className:`demox-spinner`}),`Loading `,t.name,`’s session…`]})});if(e.loadState===`error`)return(0,U.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{className:`demox-card`,style:r,role:`alert`,children:[(0,U.jsx)(`p`,{className:`demox-card-title`,children:`This demo couldn’t load`}),(0,U.jsx)(`p`,{className:`demox-card-body`,children:`The recorded session did not come through. Check your connection and try again.`}),(0,U.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.reload,children:`Retry`}),(0,U.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:()=>{window.location.hash=`#/`},children:`Back to home`})]})]})});if(!e.started)return(0,U.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{className:`demox-card demox-start`,style:r,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-start-title`,children:[(0,U.jsx)(`span`,{className:`demox-avatar`+(gi(t.avatar)?` emoji`:``),children:t.avatar}),(0,U.jsx)(`span`,{className:`demox-card-kicker`,children:`Recorded session`}),(0,U.jsxs)(`p`,{id:`demox-start-title`,className:`demox-card-title`,children:[`Watch `,t.name,` use Mavéa`]}),(0,U.jsx)(`p`,{className:`demox-card-body`,children:`The session plays automatically. Pause or move between steps at any time.`}),(0,U.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.start,children:`Start demo`}),(0,U.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,U.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{className:`demox-card demox-end`,style:r,children:[(0,U.jsx)(`span`,{className:`demox-avatar`+(gi(t.avatar)?` emoji`:``),children:t.avatar}),(0,U.jsxs)(`p`,{className:`demox-card-title`,children:[`That was `,t.name,`’s session`]}),(0,U.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,U.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:n,children:`Try it yourself`}),(0,U.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:e.replay,children:`Replay`})]}),(0,U.jsx)(`div`,{className:`demox-others`,role:`group`,"aria-label":`More sessions`,children:i.map(e=>(0,U.jsxs)(`button`,{type:`button`,className:`demox-other`,style:{"--accent":e.accent},onClick:()=>h(e.id),title:`${e.name} · ${e.role}`,children:[(0,U.jsx)(`span`,{className:`demox-other-avatar`+(gi(e.avatar)?` emoji`:``),children:e.avatar}),e.useCase]},e.id))})]})})}return(0,U.jsxs)(`div`,{className:`demox`,"aria-live":`polite`,children:[(0,U.jsxs)(`div`,{className:`demox-banner`,style:r,children:[(0,U.jsx)(`span`,{className:`demox-avatar`+(gi(t.avatar)?` emoji`:``),children:t.avatar}),(0,U.jsxs)(`span`,{className:`demox-who`,children:[(0,U.jsx)(`span`,{className:`demox-name`,children:t.useCase}),(0,U.jsxs)(`span`,{className:`demox-role`,children:[t.name,` · `,t.role]})]}),(0,U.jsx)(`span`,{className:`demox-badge`,children:`Demo`})]}),e.note&&(0,U.jsx)(`div`,{className:`demox-note`,style:r,children:e.note},e.note),(0,U.jsxs)(`div`,{className:`demox-panel`,style:r,role:`group`,"aria-label":`Demo controls`,children:[(0,U.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.prev,disabled:e.index===0,"aria-label":`Previous step`,children:(0,U.jsx)(R.chevL,{className:`demox-ic`})}),(0,U.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,U.jsx)(R.pause,{className:`demox-ic`}):(0,U.jsx)(R.play,{className:`demox-ic`})}),(0,U.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,U.jsx)(R.speakerOff,{className:`demox-ic`}):(0,U.jsx)(R.speaker,{className:`demox-ic`})}),(0,U.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.next,"aria-label":`Next step`,children:(0,U.jsx)(R.chevR,{className:`demox-ic`})}),(0,U.jsx)(`div`,{className:`demox-dots`,role:`tablist`,"aria-label":`Steps`,children:Array.from({length:e.total},(t,n)=>(0,U.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,U.jsxs)(`button`,{type:`button`,className:`demox-skip`,onClick:n,"aria-label":`Exit demo, try it yourself`,children:[(0,U.jsx)(`span`,{className:`demox-skip-full`,children:`Exit, try it yourself`}),(0,U.jsx)(`span`,{className:`demox-skip-short`,"aria-hidden":`true`,children:`Exit`})]})]})]})}u();var Y=[`bitcoin`,`fomc`,`weather`,`cars`,`react-readme`],vi=null;async function yi(){return vi||(vi=[...(await M(()=>import(`./prism.generated-BhbHDHR6.js`),[])).default.docs].sort((e,t)=>{let n=Y.indexOf(e.id),r=Y.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})),vi)}var bi=`How does $10,000 grow at 7% over 30 years?`;function xi(){let e=yr(`money`)?.frames[0]?.spec.blocks??[],t=yr(`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 Si(){let e=bt().find(e=>e.question===bi);if(e)return e.id;let t=xi();if(t.length===0)return null;let n=jt({title:`Investment growth · $10k at 7%`,question:bi,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=>Tt(e,`tour`)),n.cadence={data:`hourly`,ai:`daily`},n.nextDataAt=xt(n.createdAt,yt[n.cadence.data]),n.nextAiAt=xt(n.createdAt,Mt[n.cadence.ai]),Ot(n),n.id}function Ci(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 wi(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 Ti=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=wi(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-BJbBdhc0.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=Ci(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))}},Ei=2200,Di=2e4,Oi=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=wi(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()+Di;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(),Ei)}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 ki(e){return e===`vad`?new Ti:new Oi}function Ai(e={}){let t=e.mode??`webspeech`,n=(0,H.useRef)(e.onResult),r=(0,H.useRef)(e.onStateChange),i=(0,H.useRef)(e.onBargeIn);n.current=e.onResult,r.current=e.onStateChange,i.current=e.onBargeIn;let a=(0,H.useMemo)(()=>ki(t),[t]);return(0,H.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,H.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 ji=1100,Mi=15e3,Ni=1e4,Pi=12e3,Fi=8e3,Ii=3500,Li=2500,Ri=3e3;function zi(e){return e*2+12e3}function Bi(e){return new Promise(t=>setTimeout(t,e))}async function Vi(e,t=Mi){return await et(e.started,t)??!1}async function Hi(e,t,n=ji){await Promise.all([et(e.finished,zi(t)),Bi(n)])}function Ui(e){let t=e.speaking??ge,n=e.subscribe??Ce;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 Wi(e){try{await et((async()=>{await rt(),await rt(),await et(e.loadFams(),Fi),e.settle&&await e.settle(),e.wantVoice&&e.firstLine&&await et(e.firstLine.started,Ni)})(),Pi)}catch{}}var Gi=`mavea-always-on`;function Ki(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 qi=new Set([`no`,`caution`,`avoid`,`risk`,`wait`]),Ji=new Set([`yes`,`go`,`recommended`,`good`]);function Yi(e,t){let n=e.props[t];return typeof n==`string`?n.toLowerCase():void 0}function Xi(e){let t=e?.blocks;if(!t?.length)return`neutral`;let n=!1,r=e?.awaiting===!0;for(let e of t){let t=Yi(e,`tone`);(t===`warn`||t===`neg`)&&(n=!0),t===`pos`&&(r=!0);let i=Yi(e,`stance`);i&&qi.has(i)&&(n=!0),i&&Ji.has(i)&&(r=!0),e.type===`insight`&&e.props.conf===`unverified`&&(n=!0)}return n?`concerned`:r?`warm`:`neutral`}function Zi(e){switch(e){case`concerned`:return`concerned`;case`warm`:return`warm`;default:return`neutral`}}function Qi(e){return Zi(Xi(e))}function $i(e){let t=e?.blocks;return!t?.length||Xi(e)!==`warm`?!1:t.some(e=>{let t=Yi(e,`stance`);return t!==void 0&&Ji.has(t)})}var ea={clipShared:[`Nice — that one's worth sharing.`,`Off it goes.`,`Clipped and ready to share.`]};function ta(e,t,n){let r=ea[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 na(){return{lastAt:0,lastTurn:-1/0}}function ra(e,t){return!(e.lastAt!==0&&t.now-e.lastAt<9e4||t.turnCount-e.lastTurn<3)}function ia(e,t){return{lastAt:t.now,lastTurn:t.turnCount}}var aa=1100,oa=6e3,sa=150,ca=950,la=350,ua=8;function da(e){let{muted:t,turnCount:n,gates:r}=e,i=(0,H.useRef)(e.speak),a=(0,H.useRef)(e.cancelSpeak),o=(0,H.useRef)(e.isSpeaking);i.current=e.speak,a.current=e.cancelSpeak,o.current=e.isSpeaking;let[s,c]=(0,H.useState)([]),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(null),[p,m]=(0,H.useState)(0),h=(0,H.useRef)(na()),g=(0,H.useRef)(void 0),_=(0,H.useRef)(null),v=(0,H.useRef)(null),y=(0,H.useCallback)(()=>{_.current&&=(clearTimeout(_.current),null),v.current&&=(clearTimeout(v.current),null)},[]),b=(0,H.useCallback)(e=>{c(t=>t.length>=ua||t[t.length-1]===e?t:[...t,e])},[]),x=(0,H.useCallback)(()=>{y(),u(!1),v.current=setTimeout(()=>{v.current=null,f(null)},ca)},[y]),S=(0,H.useCallback)(e=>{let t=()=>{let n=Date.now()-e;n>=aa&&!o.current()||n>=oa?x():_.current=setTimeout(t,sa)};_.current=setTimeout(t,aa)},[x]),C=r.atRest&&!r.busy&&!r.listening&&!r.introHold&&r.hasCanvas&&!r.modalOpen;(0,H.useEffect)(()=>{if(l||d!==null||!C||s.length===0)return;if(o.current()){let e=setTimeout(()=>m(e=>e+1),la);return()=>clearTimeout(e)}let e=s[0],r=Date.now();if(!ra(h.current,{type:e,now:r,turnCount:n})){c(e=>e.slice(1));return}h.current=ia(h.current,{type:e,now:r,turnCount:n});let a=ta(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,H.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,H.useCallback)(()=>{y(),c([]),u(!1),f(null),h.current=na(),g.current=void 0},[y]);return(0,H.useEffect)(()=>()=>y(),[y]),{interjecting:l,line:d,enqueue:b,reset:w}}function fa(e){let t=(0,q.c)(37),{chapters:n,currentIndex:r,onJump:i,onClose:a}=e,o=(0,H.useRef)(null),s=(0,H.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,H.useEffect)(c,l),n.length===0)return null;let u;t[3]===n?u=t[4]:(u=_t(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,U.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,U.jsxs)(`header`,{className:`ovw-head`,children:[h,(0,U.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,U.jsxs)(`section`,{className:`ovw-card`,style:{"--card-c":e.color},children:[(0,U.jsxs)(`div`,{className:`ovw-card-head`,children:[(0,U.jsx)(`span`,{className:`ovw-card-dot`}),(0,U.jsx)(`h3`,{className:`ovw-card-title`,children:e.title}),(0,U.jsx)(`span`,{className:`ovw-card-count`,children:e.moments.length})]}),(0,U.jsx)(`ul`,{className:`ovw-moments`,children:e.moments.map(e=>{let t=e.frameIndex===r,n=R[e.icon]||R.mic;return(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`button`,{type:`button`,className:`ovw-moment`+(t?` is-current`:``),onClick:()=>{i(e.frameIndex),a()},"aria-current":t?`true`:void 0,children:[(0,U.jsx)(n,{}),(0,U.jsx)(`span`,{className:`ovw-moment-q`,children:e.question||`Moment`})]}),e.elements.length>0&&(0,U.jsx)(`ul`,{className:`ovw-els`,children:e.elements.map(t=>{let n=t.icon&&R[t.icon]||R.spark;return(0,U.jsx)(`li`,{children:(0,U.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,U.jsx)(n,{}),(0,U.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,U.jsx)(`div`,{className:`ovw-grid`,children:y}),t[25]=y,t[26]=b);let x;t[27]!==b||t[28]!==v?(x=(0,U.jsxs)(`div`,{className:`ovw-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":`Conversation overview`,ref:o,onClick:pa,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,U.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,U.jsx)(Re,{accent:p,children:S}),t[34]=p,t[35]=S,t[36]=C):C=t[36],C}function pa(e){return e.stopPropagation()}function ma(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 ha(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)=>ie(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=ma(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 ga=140;function _a(e,t=ga){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 va(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 ya=`svg text, img, canvas, video, button, input, select, textarea, a`,ba=`.ink-layer, .ink-connect-layer, .note-rail`,xa=600,Sa={left:-1e9,top:-1e9,width:2e9,height:2e9};function Ca(e){let t=[],n=e=>{e.width>0&&e.height>0&&t.length<xa&&t.push(e)},r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),i;for(;i=r.nextNode();){if(t.length>=xa)return[Sa];let e=i;if(!e.textContent?.trim()||e.parentElement?.closest(ba))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(ya))){if(t.length>=xa)return[Sa];r.closest(ba)||n(r.getBoundingClientRect())}return t}function wa(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 Ta(e,t,n=3){for(let r of e)if(!t.some(e=>wa(r.box,e,n)))return r.place;return null}var Ea=`percent|points?|seconds?|minutes?|min|hours?|hrs?|days?|weeks?|months?|mo|years?|yrs?|miles?|km|kg|lbs?|watts?`,Da=`(?:[kKMGT]?(?:W|Wh|B|bps|Hz|V|A)|ms|km|mi|kg|lb|oz|ft|°[CF]?)`,Oa=String.raw`\d(?:[\d,]*\d)?(?:\.\d+)?`,ka=new RegExp(String.raw`(?<![\w.])(?:`+String.raw`[+\-−]?[$€£]\s?${Oa}(?:\s?[–—-]\s?${Oa})?(?:\s?(?:k|K|m|M|bn|B|T|million|billion|trillion)(?![A-Za-z]))?(?:\s?\/\s?[a-z]{1,5})?`+String.raw`|`+String.raw`${Oa}\s?[–—-]\s?${Oa}\s?(?:${Da}|%)?`+String.raw`|`+String.raw`[+\-−]?${Oa}\s?(?:%|×|x(?![A-Za-z0-9]))`+String.raw`|`+String.raw`${Oa}${Da}(?![A-Za-z0-9])`+String.raw`|`+String.raw`${Oa}\s(?:${Ea})\b`+String.raw`)`,`g`);function Aa(e){let t=[],n=0;ka.lastIndex=0;for(let r=ka.exec(e);r;r=ka.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 ja(e){return Aa(e).map((e,t)=>e.accent?(0,U.jsx)(`em`,{className:`hero-accent`,children:e.text},t):(0,U.jsx)(H.Fragment,{children:e.text},t))}function Ma(e){let t=Aa(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 Na(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 Pa=/[0-9.]/;function Fa(e){return e.length>0&&[...e].every(e=>Pa.test(e))}function Ia(e,t,n){let r=t>0?e[t-1]:``,i=t+n<e.length?e[t+n]:``;return Pa.test(r)||Pa.test(i)}function La(e,t){for(let n of t){let t=Na(n).norm;if(t.length<2)continue;let r=Fa(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}=Na(n),s=i.indexOf(t);for(;s>=0;){if(!r||!Ia(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 Ra(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 za(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 Ba(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 Va=100,Ha=18,Ua=2;function Wa(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>=Ua)return}o>=Ha||(a=window.setTimeout(f,Va))},p=()=>{i||(o=0,s=null,c=0,window.clearTimeout(a),a=window.setTimeout(f,Va))};return a=window.setTimeout(f,Va),window.addEventListener(`resize`,p),()=>{i=!0,window.clearTimeout(a),window.removeEventListener(`resize`,p),l?.disconnect(),u?.removeEventListener(`transitionend`,p)}}function Ga(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 Ka=12,qa=e=>Math.ceil(Math.max(1,e.length)/26)*18+18,Ja=218,Ya=18;function Xa(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 Za(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)||Ja,a=i-Ya;if(a<=0)return null;let o=i-Ya,s=r.width-i+Ya,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=Ga(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=!Xa(c,i,o,i.left,a),f=!Xa(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=va(t.map(e=>({top:e.box.top+4,height:qa(e.note.text)})),Ka,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`?ze({x:s-6,y:n[r]+16},{x:t.box.right+3,y:i},t.note.spot):ze({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 Qa({notes:e,within:t,revision:n}){let[r,i]=(0,H.useState)(null),a=(0,H.useRef)(e);return a.current=e,(0,H.useEffect)(()=>Wa(()=>Za(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,Xn.createPortal)((0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`svg`,{className:`note-rail-arrows`,"aria-hidden":`true`,children:r.notes.map((e,t)=>e.tether&&(0,U.jsxs)(`g`,{style:{"--note-delay":`${t*120}ms`},children:[(0,U.jsx)(`path`,{className:`note-tether`,d:e.tether.d,pathLength:1,fill:`none`}),(0,U.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,U.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,U.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 $a=9;function eo(e){return e===`rising`||e===`falling`||e===`bracket`||e===`brace`}function to(e,t,n){let r={rect:e,kind:t.kind};if(eo(t.kind)&&t.to){let e=La(n,[t.to]),i=e&&za(e);i&&(r.toRect=i)}return(t.kind===`note`||t.kind===`bracket`||t.kind===`brace`)&&t.label&&(r.label=t.label),r}function no(e,t,n,r=!1){if(n){let t=La(e,[n.at]);if(t){if(n.kind===`circle`){let n=Ra(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=za(t);if(r){let i=to(r,n,e);if(i.el=t.node.parentElement??void 0,n.kind===`highlight`){let e=Ba(t);e.length>1&&(i.rects=e)}return i}}return null}if(!r)return null;let i=t?Ma(t):null;if(i?.figures.length){let t=La(e,i.figures),n=t&&za(t);if(n)return{rect:n,kind:`underline`,el:t?.node.parentElement??void 0}}let a=e.querySelector(`[data-mark]`),o=He(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=La(e,i.labels),n=t&&za(t);if(n)return{rect:n,kind:`underline`,el:t?.node.parentElement??void 0}}return null}function ro(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 io(e,t,n,r,i,a){let o=Ga((i??document).querySelectorAll(`[data-spot-id="${CSS.escape(e)}"]`));if(!o)return null;let s=no(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?ro(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=()=>_??=Ca(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=Ta(Be(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=>wa(e,t,0))&&(g.tight=!0)}let y=Ve(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-$a-2,y:m.top-$a-2},{x:m.left-$a-4,y:m.top+m.height/2},{x:m.left+m.width+$a+3,y:m.top-$a-2},{x:m.left-$a-2,y:m.top+m.height+$a+3}].map(t=>({x:e(t.x,10,h.width-$a-1),y:e(t.y,10,h.height-$a-1)})).find(e=>!v().some(t=>wa({left:e.x-$a,top:e.y-$a,width:$a*2,height:$a*2},t,2)))}return{host:o,container:u,stroke:y,anchor:m,view:{w:f.w,h:f.h},...b?{chip:b}:{}}}var ao=2400;function oo({spot:e,line:t,mark:n,generous:r,within:i,delayMs:a,badgeMs:o,revision:s,stepNumber:c}){let[l,u]=(0,H.useState)(null);if((0,H.useEffect)(()=>Wa(()=>io(e,t,n,r,i,typeof c==`number`),e=>e.stroke.d,e=>e.host,u),[e,t,n,r,i,s,c]),(0,H.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,Xn.createPortal)((0,U.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,U.jsx)(`path`,{className:`ink-fill`,d:p.d,...g?{"data-color":g}:{}}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`path`,{className:`ink-halo`,d:p.d,pathLength:1,...g?{"data-color":g}:{}}),(0,U.jsx)(`path`,{className:`ink-stroke`,d:p.d,pathLength:1,...g?{"data-color":g}:{}}),p.head&&(0,U.jsx)(`path`,{className:`ink-stroke ink-head`,d:p.head,pathLength:1,...g?{"data-color":g}:{}})]}),p.label&&(0,U.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,U.jsx)(`tspan`,{x:p.label.x,dy:t===0?0:`1.25em`,children:e},t))}),typeof c==`number`&&h&&(0,U.jsxs)(`g`,{"aria-hidden":`true`,children:[(0,U.jsx)(`circle`,{className:`ink-step-dot`,cx:h.x,cy:h.y,r:8,...g?{"data-color":g}:{}}),(0,U.jsx)(`text`,{className:`ink-step-num`,x:h.x,y:h.y,textAnchor:`middle`,dominantBaseline:`middle`,children:c})]})]}),f)}function so(e,t,n,r){let i=r??document,a=i.querySelector(`.card-grid`);if(!a)return null;let o=Ga(i.querySelectorAll(`[data-spot-id="${CSS.escape(e)}"]`)),s=Ga(i.querySelectorAll(`[data-spot-id="${CSS.escape(t)}"]`));if(!o||!s||o===s)return null;let c=La(o,[n.at]),l=c&&za(c),u=n.to?La(s,[n.to]):null,d=u&&za(u);if(!l||!d)return null;let f=Ve(`connect`,l,a.getBoundingClientRect(),`${e}>${t}`,{to:d});return f?{grid:a,stroke:f}:null}function co(e){let t=(0,q.c)(34),{spot:n,toSpot:r,mark:i,within:a,delayMs:o,revision:s}=e,[c,l]=(0,H.useState)(null),u;t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==a?(u=()=>Wa(()=>so(n,r,i,a),uo,lo,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,H.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,U.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,U.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,U.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,U.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,Xn.createPortal)(S,f),t[31]=f,t[32]=S,t[33]=C):C=t[33],C}function lo(e){return e.grid}function uo(e){return e.stroke.d}function fo(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(ho),s=n.filter(mo);a=e.length>0&&(0,U.jsx)(Qa,{notes:e.map(po),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,U.jsx)(co,{spot:e.spot,toSpot:e.toSpot,mark:e.mark,within:r,delayMs:e.delayMs,revision:i},n):(0,U.jsx)(oo,{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,U.jsxs)(U.Fragment,{children:[a,o]}),t[8]=a,t[9]=o,t[10]=s):s=t[10],s}function po(e){return{spot:e.spot,text:e.noteText}}function mo(e){return!e.noteText}function ho(e){return e.noteText}var go=240;function _o(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=_a(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*go,badgeMs:r?ao+(u.length-1)*go:void 0,stepNumber:e?t+1:void 0}),c++}}else a&&(s.push({spot:n,line:l,generous:!0,delayMs:c*go}),c++)}return s}var vo=1100,yo=1700;function bo(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 Vi(n),c=s();if(c){o(c);return}r.setIndex(e),a?await Hi(n,yo,vo):await Bi(yo)}else r.setIndex(e),await Bi(yo)}o(s()??`complete`)})()}function xo(e,t,n){if(e.length===0)return e;let r=new Map;n.forEach((e,t)=>{let n=se(e),i=r.get(n);i?i.push(t):r.set(n,[t])});let i=new Map;n.forEach((e,t)=>{let n=se(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(se(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(se(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 So(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=oe(e,a,r.continuity,r.tier),s=!e||o===`replace`&&ce(e,a)<.15,c=i?.forceReplace?`replace`:o,l=ie(t,r.spec.blocks,c);c!==`replace`&&l.overflow&&(c=`replace`,l=ie(t,r.spec.blocks,`replace`));let u={...r.spec,blocks:l.blocks};c!==`replace`&&delete u.bend;let d=c===`replace`?l.blocks.find(e=>e.id)?.id??null:l.firstNewId,f=xo(r.tour??[],r.spec.blocks,l.blocks);return{frame:{question:n,narration:r.narration,...r.spoken?{spoken:r.spoken}:{},mode:c,topicShift:s,tour:f,spec:u,at:Date.now(),...r.corrects?{corrects:r.corrects}:{}},mode:c,spot:d,snap:a}}var Co={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`},wo=3,To=140;function Eo(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Do(e){let t=e.trim().replace(/\s+/g,` `);if(!t||t.length>To||t.includes(`?`))return``;let n=t.toLowerCase(),r;if(r=t.match(/^i(?:'m| am)\s+(an?\s+.+)/i))return Oo(`Is ${r[1]}`);if(r=t.match(/^i(?:'m| am)\s+(.+)/i))return Oo(r[1]);if(r=t.match(/^i(?:'ve| have)\s+(?:got\s+)?(.+)/i))return Oo(`Has ${r[1]}`);if(r=t.match(/^my\s+(.+?)\s+(is|are)\s+(.+)/i))return Oo(`${r[1]} ${r[2]} ${r[3]}`);if(r=n.match(/^i\s+(\w+)\s+(.+)/)){let e=Co[r[1]];if(e)return Oo(`${e} ${t.slice(t.toLowerCase().indexOf(r[2]))}`)}return``}function Oo(e){let t=Eo(e.trim().replace(/\s+/g,` `));return t.length>=6&&t.length<=To?t:``}function ko(e){if(!e)return[];let t=e.split(/[.!?\n]+|,?\s+\band\b\s+/i),n=[];for(let e of t){let t=Do(e);if(t&&!n.includes(t)&&n.push(t),n.length>=wo)break}return n}var Ao=.6,jo=.5;function Mo(e){return(e.match(/\d[\d,.]*\d|\d/g)??[]).map(e=>e.replace(/,/g,``).replace(/\.+$/,``))}function No(e,t){let n=Mo(e);if(!n.length)return!1;let r=new Set(Mo(t));return n.some(e=>!r.has(e))}function Po(e,t,n={}){if(!No(e,t)){let n=Ut(e),r=Ut(t);if(n.size>0&&Wt(n,r)>=Ao)return`user-stated`}return n.webGrounded?`web-grounded`:`model-inferred`}function Fo(e,t){let n=Mo(e),r=new Set(Mo(t));if(n.length)return n.every(e=>r.has(e))?`user-stated`:`model-inferred`;let i=Ut(e);return i.size>0&&Wt(i,Ut(t))>=jo?`user-stated`:`model-inferred`}var Io=24;function Lo(e,t=`item`){let n=e.toLowerCase().match(/[a-z][a-z0-9]*/g);return(n&&n[0]?n[0]:t).slice(0,Io)}function Ro(e,t={}){return{concept:`corrections.${Lo(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 zo=()=>M(()=>import(`./generateLive-Ci8kqPD9.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])),Bo=50,Vo=2;function Ho(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 Uo={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 Wo(e,t){return e?.find(e=>!(e.key in t))?.key??null}function Go(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?Wo(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:Wo(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{...Uo};default:return e}}function Ko(e){let t=e.frames[e.frames.length-1];return{...Uo,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 qo(e){let{canRun:t,getConfig:n,getCaps:r,speak:i,cancelSpeak:a,getLibraryEnabled:o}=e,[s,c]=(0,H.useReducer)(Go,e.initial??Uo),l=(0,H.useRef)(!1);l.current=s.busy;let u=(0,H.useRef)(s.history);u.current=s.history;let d=(0,H.useRef)(null),f=(0,H.useRef)(null),p=(0,H.useRef)(s.spec);p.current=s.spec;let m=(0,H.useRef)(s.prior);m.current=s.prior;let h=(0,H.useRef)(s.filled);h.current=s.filled;let g=(0,H.useRef)(new Map),_=(0,H.useRef)(new Map),v=(0,H.useRef)([]),y=(0,H.useRef)(new Set),b=(0,H.useRef)(s.turn);b.current=s.turn;let x=(0,H.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=Ho(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,ee=!ae(F,D),I=`${D}::${P.length}::${M}`,te=j?null:_.current.get(I)??null,L,R=!1;if(N??te){let e=N??te;e.narration&&(c({type:`speak`,narration:e.narration}),i?.(e.spoken||e.narration)),L=e}else{let e=``,t=0,a=!1,o=en(Zt(D)),l=0,u;try{u=await zo()}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(L=await d(D,P,n(),n=>{if(A.signal.aborted)return;e+=n;let r=Qe(e);if(!r)return;let{chunk:s,consumed:u}=$e(r.text,t,r.done);s&&(t=u,a=!0,c({type:`speak`,narration:re(ne(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:ee?e=>{A.signal.aborted||(R=!0,B(e.spec.blocks),c({type:`stream`,spec:e.spec}))}:void 0,onSources:e=>{A.signal.aborted||c({type:`sources`,sources:e})},onPending:ee?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&&L.narration&&(c({type:`speak`,narration:L.narration}),i?.(L.spoken||L.narration)),!L.error&&L.spec.blocks.length>0&&(_.current.set(I,L),_.current.size>Bo)){let e=_.current.keys().next().value;e!==void 0&&_.current.delete(e)}}if(L.error){c({type:`error`,error:{...L.error,question:O,retry:D}});return}let ie=h?.length?`${O} (about: ${h.map(Me).join(`, `)})`:O,oe=[...P,{role:`user`,content:ie},{role:`assistant`,content:L.narration||L.spec.title}],se,ce,le;try{let e=So(F,T?.freshStart?[]:p.current?.blocks??[],O,L,{forceReplace:ee});se=e.mode,ce=e.frame.spec;let t=e.snap;le=w?{...e.frame,mind:w}:e.frame,B(ce.blocks),c({type:`show`,spec:ce,narration:L.narration,history:oe,mode:se,spot:e.spot,prior:t,tour:le.tour,priorSpec:k,streamed:R,frame:le,understood:L.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&&qt(D))try{let e=String(le.at),t=O.slice(0,200),n=(ce.sources?.length??0)>0,r=L.memory??[];if(r.length)nn(r.map(r=>({...r,source:Po(r.body,O,{webGrounded:n}),turnId:e,quote:t})));else{let n=ko(O);n.length&&nn([{concept:`profile`,body:n.join(`. `),source:`user-stated`,turnId:e,quote:t}])}if(L.corrects){let t=Fo(L.corrects.now,O);nn([Ro(L.corrects,{turnId:e,source:t})])}}catch{}se===`replace`&&o?.()&&on(ce,O);let ue=n(),de=r?.();if(de?.quality===`thorough`){let e=ce.suggests??[],t=[...y.current],n=Ho(ue,de);e.slice(0,Vo).forEach((e,r)=>{let i=new AbortController;v.current.push(i),zo().then(({generateLive:n})=>n(e.label,oe,ue,void 0,{caps:de,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,H.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,H.useCallback)(e=>c({type:`spot`,spot:e}),[]),w=(0,H.useCallback)(e=>c({type:`jump`,index:e}),[]),T=(0,H.useCallback)(e=>{e&&B(e.blocks),c({type:`preview`,spec:e})},[]),E=(0,H.useCallback)(e=>c({type:`fill`,value:e}),[]),D=(0,H.useCallback)(e=>c({type:`unfill`,key:e}),[]),O=(0,H.useCallback)(e=>c({type:`setActiveBlank`,key:e}),[]),k=(0,H.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,H.useCallback)((e,t)=>{a?.(),B(e.blocks),c({type:`restore`,spec:e,question:t,at:Date.now()})},[a]),j=(0,H.useCallback)((e,t,n)=>{B(e.spec.blocks),n?.interrupt!==!1&&a?.();let r=ge();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):et(o?o.started:Promise.resolve(!1),Ri).then(g)},[a,i]),M=s.viewOverride?s.viewOverride:s.viewIndex==null?s.spec:s.frames[s.viewIndex]?.spec??s.spec;return(0,H.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 Jo(e){return e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`}function Yo(e){return`${Jo(e)}. What can I help you explore?`}var Xo=`mavea-live-setup-v1`;function Zo(){try{return localStorage.getItem(Xo)===`1`}catch{return!1}}function Qo(){try{localStorage.setItem(Xo,`1`)}catch{}}function $o(){try{localStorage.removeItem(Xo)}catch{}}var X=[{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.`}],Z=`I’m awake.`,es=`Set and ready, start talking, or try one of these.`,ts=X.map(e=>e.id);function ns(e){let t=ts.indexOf(e);return t>=0&&t<ts.length-1?ts[t+1]:null}function rs(e){return X.find(t=>t.id===e)??X[0]}function is(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,H.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)+X.length)%X.length;o.current[n]?.focus(),i(X[n].id)};u=`constellation`,d=`Setup steps`,s=`const-track`,c=`tablist`,l=X.map((t,a)=>{let s=t.id===n,c=r.has(t.id)&&!s;return(0,U.jsxs)(`li`,{className:`const-step `+(s?`is-current`:c?`is-done`:`is-future`),children:[(0,U.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,U.jsx)(R.check,{}):s?null:(0,U.jsx)(`span`,{className:`const-num`,"aria-hidden":!0,children:a+1})}),(0,U.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,U.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,U.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 as(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,U.jsx)(`span`,{className:`toggle-label`,children:n}),t[0]=n,t[1]=o);let s;t[2]===a?s=t[3]:(s=(0,U.jsx)(`span`,{className:`toggle-note`,children:a}),t[2]=a,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,U.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,U.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,U.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,U.jsxs)(`div`,{className:`toggle-row`,children:[c,d]}),t[13]=c,t[14]=d,t[15]=f):f=t[15],f}function os(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,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>i(e.value),className:`seg-opt`+(t?` is-active`:``),children:[(0,U.jsx)(`span`,{className:`seg-title`,children:e.label}),e.sub&&(0,U.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,U.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 ss(e){let t=(0,q.c)(20),{id:n,value:r,onChange:i,placeholder:a,ariaLabel:o}=e,[s,c]=(0,H.useState)(!1),l=(0,H.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,U.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(cs),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,U.jsx)(R.eyeOff,{}):(0,U.jsx)(R.eye,{}),t[10]=s,t[11]=_);let v;t[12]!==s||t[13]!==h||t[14]!==g||t[15]!==_?(v=(0,U.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,U.jsxs)(`div`,{className:`input-wrap`,children:[p,v]}),t[17]=p,t[18]=v,t[19]=y):y=t[19],y}function cs(e){return!e}var ls={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`}},us={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.`},ds={anthropic:`sk-ant-…`,openai:`sk-…`,gemini:`AIza…`,grok:`xai-…`,openrouter:`sk-or-…`};function fs(e){return e.split(` · `)[1]??e}function ps(){let e=(0,q.c)(51),t=(0,H.useId)(),[n]=Bt(),r=ot(n.provider),i=n.models[n.provider]??``,a=i||r.defaultModel,o=n.keys[n.provider]??``,[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(!1),d=(0,H.useRef)(0),f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=async()=>{let e=d.current+=1;u(!0);let t=await $t(Ft(It()),{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,H.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 ${fs(r.label)} when used.`:``,v;e[1]===n.provider?v=e[2]:(v=st.map(e=>{let t=ls[e.id],r=e.id===n.provider;return(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,className:`provider-tile`+(r?` is-selected`:``),onClick:()=>Lt({provider:e.id}),children:[(0,U.jsx)(`span`,{className:`provider-badge`,children:t.badge}),(0,U.jsx)(`span`,{className:`provider-name`,children:t.name}),(0,U.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,U.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,U.jsx)(`span`,{className:`field-head`,children:(0,U.jsx)(`span`,{className:`card-eyebrow`,children:`Model`})}),e[5]=b):b=e[5];let x;e[6]===n.provider?x=e[7]:(x=e=>zt(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,U.jsx)(dn,{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,U.jsx)(`span`,{className:`field-helper`,children:r.modelNotes[a]}),e[12]=r.modelNotes,e[13]=a,e[14]=C):C=e[14];let w=us[r.search],T;e[15]===w?T=e[16]:(T=(0,U.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,U.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,U.jsxs)(`label`,{className:`field-col`,htmlFor:t,children:[(0,U.jsx)(`span`,{className:`field-head`,children:(0,U.jsx)(`span`,{className:`card-eyebrow`,children:`API key`})}),(0,U.jsx)(ss,{id:t,value:o,onChange:e=>zt(n.provider,`key`,e),placeholder:ds[n.provider]??`paste your key`,ariaLabel:`API key`}),r.keyUrl&&(0,U.jsx)(`a`,{className:`field-helper field-helper-link`,href:r.keyUrl,target:`_blank`,rel:`noreferrer noopener`,children:`Get a key↗`}),(0,U.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,U.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,U.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,U.jsx)(`strong`,{children:g}),e[31]=g,e[32]=j);let M=_&&` `+_,N;e[33]!==j||e[34]!==M?(N=(0,U.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,U.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,U.jsxs)(`div`,{className:k,children:[A,N,P]}),e[38]=k,e[39]=N,e[40]=P,e[41]=F):F=e[41];let ee;e[42]!==n.rememberKey||e[43]!==r.needsKey?(ee=r.needsKey&&(0,U.jsx)(as,{label:`Remember this key on this device`,on:n.rememberKey,onToggle:()=>Lt({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]=ee):ee=e[44];let I;e[45]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,U.jsx)(un,{}),e[45]=I):I=e[45];let te;return e[46]!==O||e[47]!==F||e[48]!==ee||e[49]!==y?(te=(0,U.jsxs)(`div`,{className:`step-body`,children:[y,O,F,ee,I]}),e[46]=O,e[47]=F,e[48]=ee,e[49]=y,e[50]=te):te=e[50],te}function ms(){let e=(0,q.c)(19),[t]=Bt(),n=qe(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,U.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,U.jsx)(os,{ariaLabel:`Web search`,value:t.searchMode,onPick:gs,options:a}),e[2]=t.searchMode,e[3]=o);let s;e[4]===r?s=e[5]:(s=(0,U.jsx)(`p`,{className:`field-helper`,children:r}),e[4]=r,e[5]=s);let c;e[6]!==o||e[7]!==s?(c=(0,U.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,U.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,U.jsx)(os,{ariaLabel:`Answer quality`,value:t.quality,onPick:hs,options:u}),e[11]=t.quality,e[12]=d);let f;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,U.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,U.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,U.jsxs)(`div`,{className:`step-body`,children:[c,p]}),e[16]=c,e[17]=p,e[18]=m):m=e[18],m}function hs(e){return Lt({quality:e})}function gs(e){return Lt({searchMode:e})}function _s(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function vs(e){let t=_e(e);if(t){me(`mavea`,t.kokoro);try{localStorage.setItem(xe,e)}catch{}}}function ys(e){let t=(0,q.c)(20),{label:n,value:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=(0,U.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),vs(e);let t=_e(e);t&&pn(t)},t[2]=i,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=he.map(bs),t[4]=s):s=t[4];let c;t[5]!==n||t[6]!==o||t[7]!==r?(c=(0,U.jsx)(yn,{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=_e(r);e&&pn(e)},t[9]=r,t[10]=l);let u;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,U.jsx)(R.play,{}),t[11]=u):u=t[11];let d;t[12]===l?d=t[13]:(d=(0,U.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,U.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,U.jsxs)(`div`,{className:`voice-col`,children:[a,f]}),t[17]=a,t[18]=f,t[19]=p):p=t[19],p}function bs(e){return{value:e.id,label:e.label,note:e.tone}}function xs(){let e=(0,q.c)(16),[t]=Bt(),n=vn(),[r,i]=(0,H.useState)(ws),a;e[0]===t.memoryEnabled?a=e[1]:(a=()=>Lt({memoryEnabled:!t.memoryEnabled}),e[0]=t.memoryEnabled,e[1]=a);let o;e[2]!==t.memoryEnabled||e[3]!==a?(o=(0,U.jsx)(as,{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,U.jsxs)(`div`,{className:`memory-panel`,children:[(0,U.jsxs)(`div`,{className:`memory-head`,children:[(0,U.jsxs)(`span`,{className:`card-eyebrow`,children:[`What Mavéa remembers (`,n.length,` `,n.length===1?`concept`:`concepts`,`)`]}),n.length>0&&(0,U.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:Cs,children:`Forget all`})]}),n.length===0?(0,U.jsx)(`p`,{className:`memory-empty`,children:`Nothing yet — Mavéa will note useful facts as you talk.`}):(0,U.jsx)(`ul`,{className:`memory-list`,children:n.map(Ss)})]}),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,U.jsx)(`hr`,{className:`setup-divider`}),e[8]=c):c=e[8];let l;e[9]===r?l=e[10]:(l=(0,U.jsx)(`div`,{className:`voice-grid`,children:(0,U.jsx)(ys,{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,U.jsx)(gn,{}),e[11]=u):u=e[11];let d;return e[12]!==o||e[13]!==s||e[14]!==l?(d=(0,U.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 Ss(e){return(0,U.jsxs)(`li`,{className:`memory-fact`,children:[(0,U.jsx)(`span`,{className:`memory-fact-concept`,children:e.concept}),(0,U.jsx)(`span`,{className:`memory-fact-text`,children:e.body}),(0,U.jsx)(`button`,{type:`button`,className:`memory-x`,onClick:()=>tn(e.id),"aria-label":`Forget: ${e.concept}`,title:`Forget this`,children:(0,U.jsx)(R.x,{})})]},e.id)}function Cs(){return Kt()}function ws(){return _s(xe,ye)}var Ts=[{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 Es({onStart:e}){return(0,U.jsx)(`div`,{className:`starter-grid`,role:`list`,children:Ts.map(t=>(0,U.jsxs)(`button`,{type:`button`,className:`starter-chip`,style:{"--starter-accent":t.accent},onClick:()=>e(t.prompt),children:[(0,U.jsxs)(`span`,{className:`starter-kicker`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,children:`✦`}),` `,t.kicker]}),(0,U.jsx)(`span`,{className:`starter-copy`,children:t.prompt})]},t.kicker))})}function Ds(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Os(e,t){return _e(Ds(e,t))?.label??`Voice`}var ks={fast:`Fast — snappy & cheap`,balanced:`Balanced — the default`,thorough:`Thorough — deeper thinking`};function As(e){let t=(0,q.c)(54),{onJump:n,onStart:r,onStartTalking:i,onStartOver:a,onSeeHow:o,studySlot:s,librarySlot:c}=e,[l]=Bt(),u=vn(),d=ln(),f,p;if(t[0]!==l.models||t[1]!==l.provider){let e=ot(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=Rt(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=ks[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)`:Os(xe,ye),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,U.jsx)(`ul`,{className:`checklist`,children:O.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`check-row`,onClick:()=>n(e.step),children:[(0,U.jsx)(`span`,{className:`check-mark`,"aria-hidden":!0,children:(0,U.jsx)(R.check,{})}),(0,U.jsx)(`span`,{className:`check-label`,children:e.label}),(0,U.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,U.jsxs)(`button`,{type:`button`,className:`go-start`,onClick:i,children:[(0,U.jsx)(R.mic,{}),` Start talking`]}):(0,U.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,U.jsx)(R.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,U.jsx)(`div`,{className:`go-ghosts`,children:(0,U.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,U.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,U.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,U.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,U.jsxs)(`div`,{className:`try-head`,children:[N,P]}),t[40]=P,t[41]=F);let ee;t[42]===r?ee=t[43]:(ee=(0,U.jsx)(Es,{onStart:r}),t[42]=r,t[43]=ee);let I;t[44]!==F||t[45]!==ee?(I=(0,U.jsxs)(`div`,{className:`go-right`,children:[F,ee]}),t[44]=F,t[45]=ee,t[46]=I):I=t[46];let te;t[47]===c?te=t[48]:(te=c&&(0,U.jsx)(`div`,{className:`go-library`,children:c}),t[47]=c,t[48]=te);let L;return t[49]!==s||t[50]!==M||t[51]!==I||t[52]!==te?(L=(0,U.jsxs)(`div`,{className:`step-body go-grid`,children:[M,I,s,te]}),t[49]=s,t[50]=M,t[51]=I,t[52]=te,t[53]=L):L=t[53],L}function js({speak:e,goDemo:t,onStart:n,onStartTalking:r,onSeeHow:i,studySlot:a,librarySlot:o,seed:s}){let c=(0,H.useRef)(!Zo()),l=(0,H.useRef)(!1),[u,d]=(0,H.useState)(c.current?`connect`:`go`),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(``),g=(0,H.useRef)(s??``),[_,v]=(0,H.useState)(!c.current),y=!c.current||_;(0,H.useEffect)(()=>{if(u!==`go`)return;v(!0),c.current&&Qo();let t=g.current;if(t){g.current=``,n(t);return}l.current||(l.current=!0,e(c.current?`I’m awake.`:Yo(new Date().getHours())))},[u,e,n]),(0,H.useEffect)(()=>{let e=document.documentElement;return e.dataset.wizardStep=u,()=>{delete e.dataset.wizardStep}},[u]);let b=(0,H.useRef)(null);(0,H.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`:ns(u)??`go`)},C=()=>{(typeof window>`u`||window.confirm(`Start over? This clears your saved setup and replays the intro.`))&&(Nt(),$o(),ft(),c.current=!0,l.current=!1,v(!1),p(!1),d(`connect`))},w=X.findIndex(e=>e.id===u),T=new Set(X.filter((e,t)=>y?e.id!==u:t<w).map(e=>e.id)),E=rs(u),D=u===`go`,O=D&&c.current?Z:E.title,k=D&&c.current?es:E.sub;return(0,U.jsxs)(`div`,{className:`setup stage`,"data-active":`1`,children:[(0,U.jsxs)(`header`,{className:`setup-nav`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`setup-back`,onClick:t,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to the demo`]}),(0,U.jsx)(is,{current:u,done:T,onPick:x}),(0,U.jsx)(Ct,{triggerClassName:`setup-icon-btn`})]}),(0,U.jsxs)(`div`,{className:`setup-stage`,ref:b,children:[(0,U.jsxs)(`div`,{className:`setup-head`,children:[(0,U.jsx)(`h1`,{className:`setup-q`,children:O}),(0,U.jsx)(`p`,{className:`setup-sub`,children:k})]}),(0,U.jsxs)(`section`,{className:`card reveal setup-card`+(D?` setup-card--wide`:``),"aria-label":E.label,children:[u===`connect`&&(0,U.jsx)(ps,{}),u===`think`&&(0,U.jsx)(ms,{}),u===`remember`&&(0,U.jsx)(xs,{}),D&&(0,U.jsx)(As,{onJump:x,onStart:n,onStartTalking:r,onStartOver:C,onSeeHow:i,studySlot:a,librarySlot:o}),!D&&(0,U.jsxs)(`footer`,{className:`setup-foot`,children:[(0,U.jsx)(`span`,{className:`setup-foot-note`,children:`Changes save as you make them.`}),(0,U.jsxs)(`button`,{type:`button`,className:`setup-done`,onClick:S,children:[`Done `,(0,U.jsx)(R.check,{})]})]})]},u)]}),D&&(0,U.jsx)(`div`,{className:`go-composer`,children:(0,U.jsxs)(`div`,{className:`go-composer-inner`,children:[(0,U.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,U.jsx)(`button`,{type:`button`,className:`go-composer-send`,"aria-label":`Send`,onClick:()=>n(m.trim()),children:(0,U.jsx)(R.send,{})}):(0,U.jsx)(`button`,{type:`button`,className:`go-composer-mic`,"aria-label":`Use microphone`,onClick:r,children:(0,U.jsx)(R.mic,{})})]})})]})}function Ms(e){let t=(0,q.c)(39),{mode:n,onChange:r,pttKey:i,pttSide:a}=e,[o,s]=(0,H.useState)(!1),c=(0,H.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,H.useEffect)(l,u);let d=i||`Alt`,f;t[3]!==a||t[4]!==d?(f=cn(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(Ps),t[29]=k):k=t[29];let A;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,U.jsx)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,U.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,U.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,U.jsx)(`div`,{className:`mic-mode-pop`,role:`menu`,"aria-label":`Mic mode`,children:O.map(Ns)}),t[33]=o,t[34]=O,t[35]=M):M=t[35];let N;return t[36]!==j||t[37]!==M?(N=(0,U.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 Ns(e){return(0,U.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.checked,className:`more-menu-row mic-mode-row`,onClick:e.onClick,children:[(0,U.jsx)(`span`,{className:`more-menu-name`,children:e.title}),(0,U.jsx)(`span`,{className:`more-menu-blurb`,children:e.blurb}),e.checked&&(0,U.jsx)(R.check,{className:`mic-mode-row-check`,"aria-hidden":`true`})]},e.key)}function Ps(e){return!e}function Fs(e,t){e.documentElement.dataset.presenceStyle=t}function Is(e){delete e.documentElement.dataset.presenceStyle}var Ls=/(photo|image|carousel|mood|palette|video|map|diagram|story|slide|verse)/,Rs=/(chart|table|matrix|grid|stat|kpi|code|pipeline|timeline|kanban|roadmap|process|flow|tree|schema|heatmap|scatter|bars|donut|gauge|checks|network|sankey)/;function zs(e,t){return!!(e?.blocks)?.some(e=>t.test(String(e.type).toLowerCase()))}function Bs({status:e,interjecting:t=!1,spec:n}){if(e===`thinking`)return`bead`;if(t)return`pip`;let r=Xi(n);return r===`warm`?`pip`:r===`concerned`?`hybrid`:zs(n,Ls)?`aura`:zs(n,Rs)?`bead`:`hybrid`}var Vs=6e3;function Hs({dashboardId:e,dashboardTitle:t,onDismiss:n}){let r=(0,H.useRef)(n);return r.current=n,(0,H.useEffect)(()=>{let e=setTimeout(()=>r.current(),Vs);return()=>clearTimeout(e)},[e]),(0,U.jsxs)(`div`,{className:`cards-pill dash-pill`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(R.check,{}),(0,U.jsxs)(`span`,{className:`cards-pill-text dash-pill-text`,children:[`Added to `,(0,U.jsx)(`strong`,{children:t})]}),(0,U.jsxs)(`a`,{className:`cards-pill-btn cards-pill-primary`,href:At.detail(e),onClick:n,children:[`Open `,(0,U.jsx)(R.chevR,{})]})]})}var Us={strong:`Strong evidence`,partial:`Partial evidence`,inferred:`Inferred`,unverified:`Unverified`},Ws={strong:3,partial:2,inferred:1,unverified:1};function Gs(e){let t=(0,q.c)(3),{count:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,U.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,U.jsxs)(`span`,{className:`prov-inferred`,children:[r,i]}),t[1]=i,t[2]=a),a}function Ks(e){let t=(0,q.c)(8),{level:n,title:r}=e,i=Ws[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,U.jsx)(`span`,{className:`prov-bars`,"aria-hidden":`true`,children:o.map(e=>(0,U.jsx)(`i`,{className:e<i?`on`:``},e))}),t[1]=i,t[2]=s);let c=Us[n],l;return t[3]!==a||t[4]!==s||t[5]!==c||t[6]!==r?(l=(0,U.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 qs({sources:e,hosts:t=!1,className:n}){return e.length?(0,U.jsxs)(`div`,{className:`grounded-in`+(n?` ${n}`:``),children:[(0,U.jsx)(`span`,{className:`grounded-in-label`,children:`Grounded in`}),(0,U.jsx)(`ul`,{children:e.map((e,n)=>{let r=Fe(e.url),i=t?Ie(e.url):null;return(0,U.jsxs)(`li`,{children:[r?(0,U.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,children:e.title}):(0,U.jsx)(`span`,{className:`grounded-in-name`,children:e.title}),i&&(0,U.jsx)(`span`,{className:`grounded-in-host`,children:i})]},n)})})]}):null}function Js({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`:Oe;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`scrim`+(e?` show`:``),role:`presentation`,onClick:t,style:{pointerEvents:e?`auto`:`none`}}),(0,U.jsxs)(`aside`,{className:`drawer`+(e?` show`:``),"aria-hidden":!e,inert:!e,children:[(0,U.jsx)(`button`,{className:`drawer-x`,onClick:t,"aria-label":`Close evidence`,children:(0,U.jsx)(R.x,{})}),(0,U.jsxs)(`div`,{className:`drawer-head`,children:[(0,U.jsxs)(`div`,{className:`drawer-eyebrow`,children:[(0,U.jsx)(R.shield,{style:{width:14,height:14}}),` Where this came from`]}),(0,U.jsx)(`div`,{className:`drawer-claim`,children:n})]}),(0,U.jsxs)(`div`,{className:`drawer-body`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`var(--text-secondary)`},children:[(0,U.jsx)(Ks,{level:r||`inferred`,title:o}),i.length>0?(0,U.jsxs)(`span`,{children:[`· grounded in `,i.length,` live source`,i.length===1?``:`s`]}):a?(0,U.jsx)(`span`,{children:`· based on your attached files`}):(0,U.jsx)(`span`,{children:`· from the model's own knowledge`})]}),i.length>0&&(0,U.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`grid`,gap:8},"aria-label":`Sources`,children:i.map((e,t)=>{let n=Fe(e.url);return n?(0,U.jsx)(`li`,{children:(0,U.jsxs)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`evidence-block evidence-src`,children:[(0,U.jsxs)(`div`,{className:`evidence-top`,children:[(0,U.jsxs)(`span`,{className:`evidence-file`,children:[(0,U.jsx)(R.globe,{style:{width:16,height:16}}),e.title]}),(0,U.jsx)(`span`,{className:`evidence-loc`,children:Ie(e.url)??e.url}),(0,U.jsx)(R.external,{style:{width:14,height:14,flex:`0 0 auto`}})]}),e.snippet&&(0,U.jsx)(`div`,{className:`evidence-quote`,children:e.snippet})]})},t):null})}),(0,U.jsxs)(`div`,{className:`assumption`,children:[(0,U.jsx)(R.alert,{}),i.length>0?(0,U.jsxs)(`div`,{children:[`Mavéa summarized these sources — open them to read the originals, and treat anything labeled `,(0,U.jsx)(`b`,{children:`inferred`}),` as a best estimate, not a verified fact.`]}):a?(0,U.jsxs)(`div`,{children:[`Mavéa answered from your attached files and its own knowledge — no live sources were checked. Treat anything labeled `,(0,U.jsx)(`b`,{children:`inferred`}),` as a best estimate, not a verified fact.`]}):(0,U.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 Ys=new Set([`inferred`,`unverified`]);function Xs(e){let{conf:t}=e.props;return t===`strong`||t===`partial`||t===`inferred`||t===`unverified`?t:void 0}function Zs(e){if(!e)return 0;let t=0,n=e=>{for(let r of e){let e=Xs(r);e&&Ys.has(e)&&t++,r.type===`composite`&&n(r.props.regions.map(e=>e.block))}};return n(e.blocks),t}function Qs(e,t=3){if(!e?.length)return[];let n=new Set,r=[];for(let i of e){let e=Ie(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 $s(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=Qs(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,U.jsxs)(`p`,{className:`hero-ask`,children:[o&&(0,U.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=ja(r),t[11]=r,t[12]=u);let d;t[13]===u?d=t[14]:(d=(0,U.jsx)(`p`,{className:`hero-line voice-text`,children:u}),t[13]=u,t[14]=d),s=(0,U.jsxs)(`section`,{className:`answer-hero`,"aria-label":`Mavéa's answer`,style:c,children:[l,d,(e.length>0||a>0)&&(0,U.jsxs)(`p`,{className:`hero-meta`,children:[e.length>0&&(0,U.jsxs)(`span`,{className:`hero-sources`,children:[`Sources: `,e.join(` · `)]}),a>0&&(0,U.jsx)(Gs,{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 ec=1300;function tc(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,ec);return()=>window.clearTimeout(e)},a=[n],t[0]=n,t[1]=i,t[2]=a),(0,H.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,U.jsx)(`span`,{className:`topic-sweep-line`}),c=(0,U.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,U.jsxs)(`aside`,{className:`topic-sweep`,"aria-hidden":`true`,style:o,children:[s,c]}),t[7]=o,t[8]=l),l}function nc(e){return e?.track!=null&&e.track.score>=95}function rc(e,t){return Jt(e)&&t.blocks.length>=4}function ic(e,t){if(!ke(e))return!1;if(!t)return!0;let n=Yt(t);return n.planning||n.comparison||n.whatIf||n.decision||n.troubleshoot}function ac(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&&nc(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&&rc(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&&ic(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,U.jsx)(qs,{sources:p,hosts:!0,className:`footer-grounded`}),t[35]=p,t[36]=x),S=e.length>0&&(0,U.jsxs)(`div`,{className:`footer-keepgoing`,children:[(0,U.jsx)(`span`,{className:`footer-label`,children:`Keep going`}),(0,U.jsx)(`ul`,{className:`footer-list`,children:e.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`kg-row`,onClick:()=>a(e.route),disabled:d,children:[(0,U.jsx)(`span`,{className:`kg-q`,children:e.label}),(0,U.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,U.jsxs)(`div`,{className:`footer-chips`,children:[_&&(0,U.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,U.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),h&&(0,U.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,U.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),g&&(0,U.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,U.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),v&&(0,U.jsxs)(`button`,{type:`button`,className:`footer-track`,onClick:o,disabled:d,title:n.track?.reason,children:[`Track this live`,(0,U.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,U.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,U.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 oc=[`Alt`,`Control`,`Shift`],sc=[{side:`any`,label:`Either`},{side:`left`,label:`Left`},{side:`right`,label:`Right`}],cc=typeof navigator<`u`&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),lc={Alt:cc?`Option (⌥)`:`Alt`,Control:cc?`Control (⌃)`:`Ctrl`,Shift:cc?`Shift (⇧)`:`Shift`};function uc({children:e,holdEnabled:t,showHint:n=!0,pttKey:r,pttSide:i=`any`,onHoldStart:a,onHoldEnd:o,onChangePttKey:s,onChangePttSide:c}){mn({enabled:t,pttKey:r,pttSide:i,onStart:a,onStop:o});let l=(0,H.useRef)(null),u=(0,H.useRef)(null),[d,f]=(0,H.useState)(!1);return(0,H.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,H.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,U.jsxs)(`div`,{className:`live-dock dock-bar`,ref:l,children:[(0,U.jsx)(`div`,{className:`dock-main`,children:e}),t&&n&&(0,U.jsxs)(`div`,{className:`dock-hint-wrap`,ref:u,children:[(0,U.jsxs)(`button`,{type:`button`,className:`dock-hint dock-hint-btn`,onClick:()=>f(e=>!e),title:`Click to change hold-to-talk key`,children:[`Hold `,cn(r||`Alt`,i),` to talk`]}),d&&(0,U.jsxs)(`div`,{className:`dock-hint-picker`,role:`menu`,"aria-label":`Choose hold-to-talk key`,children:[(0,U.jsx)(`div`,{className:`dock-hint-row`,children:oc.map(e=>(0,U.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":(r||`Alt`)===e,className:`dock-hint-key${(r||`Alt`)===e?` active`:``}`,title:lc[e],onClick:()=>s?.(e),children:cn(e)},e))}),(0,U.jsx)(`div`,{className:`dock-hint-row dock-hint-sides`,children:sc.map(({side:e,label:t})=>(0,U.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 dc=e=>e.toLowerCase().replace(/\s+/g,` `).trim();function fc(e){return dc(`${e.question} ${e.spec.title??``} ${e.narration}`)}function pc(e){let t=new Map;return e.forEach((n,r)=>{let i=n.corrects;if(!i)return;let a=dc(i.what);if(a){for(let n=r-1;n>=0;n--)if(fc(e[n]).includes(a)){t.set(n,{note:i,by:r});return}}}),t}function mc(e){if(!e)return``;try{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).formatToParts(new Date(e)).filter(e=>e.type===`hour`||e.type===`minute`||e.type===`literal`).map(e=>e.value).join(``).trim()}catch{return``}}function hc({chapters:e,frames:t,currentIndex:n,onJump:r,onReplay:i,onOverview:a,resumed:o,chatOpen:s,onToggleChat:c,collapsed:l,onToggleCollapse:u,onOpenPast:d,onStudy:f,roomIndices:p,bookmarks:m,onToggleBookmark:h,onViewMindMap:g,onSeeTogether:_}){let v=kt(),y=e.length===0,b=(0,H.useMemo)(()=>pc(t),[t]);return(0,U.jsxs)(`aside`,{className:`side-rail`+(s?` chat-open`:``)+(l?` is-collapsed`:``),children:[(0,U.jsxs)(`button`,{type:`button`,className:`rail-mobile-toggle`,"aria-expanded":s,onClick:c,children:[(0,U.jsx)(R.chat,{}),s?`Hide session`:`This session`]}),(0,U.jsxs)(`div`,{className:`rail-head`,children:[u&&(0,U.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,U.jsx)(R.panelLeft,{})}),(0,U.jsx)(`span`,{className:`rail-title sess-title`,children:`This session`}),(i||a)&&(0,U.jsxs)(`div`,{className:`rail-head-actions`,children:[i&&(0,U.jsx)(`button`,{type:`button`,className:`rail-history rail-icon`,onClick:i,title:`Replay earlier answers`,"aria-label":`Replay earlier answers`,children:(0,U.jsx)(R.play,{})}),a&&(0,U.jsx)(`button`,{type:`button`,className:`rail-history rail-icon`,onClick:a,title:`Zoom out to the whole conversation`,"aria-label":`Conversation overview`,children:(0,U.jsx)(R.layers,{})})]})]}),u&&(0,U.jsx)(`div`,{className:`rail-collapsed-label`,"aria-hidden":`true`,children:`This session`}),(0,U.jsxs)(`div`,{className:`rail-chat sess-list`,children:[o&&(0,U.jsx)(`div`,{className:`sess-note`,role:`note`,children:`Resumed — picking back up where you left off.`}),y?(0,U.jsx)(`div`,{className:`sess-note`,children:`Topics can wander — cooking, markets, your fantasy lineup. Mavéa keeps the thread.`}):e.map(e=>(0,U.jsxs)(`div`,{className:`sess-chapter`,style:{"--ch-c":e.color},children:[(0,U.jsxs)(`div`,{className:`sess-chapter-head`,children:[(0,U.jsx)(`div`,{className:`sess-chapter-label`,title:e.title,children:e.title}),_&&e.moments.length>=2&&(0,U.jsx)(`button`,{type:`button`,className:`sess-together`,onClick:()=>_(e),title:`See all ${e.moments.length} moments of this thread together on one canvas`,"aria-label":`See all ${e.moments.length} moments of this thread together`,children:(0,U.jsx)(R.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,U.jsxs)(`div`,{className:`sess-row-wrap`,children:[(0,U.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,U.jsx)(`span`,{className:`sess-time`,children:mc(a?.at)}),(0,U.jsx)(`span`,{className:`sess-q`,children:e.question}),i&&(0,U.jsx)(`span`,{className:`sess-corrected`,children:`corrected`}),p?.has(e.frameIndex)&&(0,U.jsx)(`span`,{className:`sess-room`,children:`from the room`})]}),g&&a?.mind&&(0,U.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,U.jsx)(R.sparkle,{})}),h&&o&&(0,U.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,U.jsxs)(`div`,{className:`rail-foot`,children:[d&&(0,U.jsxs)(`button`,{type:`button`,className:`rail-past`,onClick:d,children:[(0,U.jsx)(R.clock,{}),(0,U.jsx)(`span`,{children:`Past conversations`})]}),f&&v&&(0,U.jsxs)(`button`,{type:`button`,className:`rail-past`,onClick:f,children:[(0,U.jsx)(R.layers,{}),(0,U.jsxs)(`span`,{children:[v.count,` card`,v.count===1?``:`s`,` ready`]})]})]})]})}function gc(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:dt(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:dt(i?a??s?.question:s?.question??a)||null,narration:c}:null}function _c(e){let t=(0,q.c)(3),n=(0,H.useRef)(null),[r,i]=(0,H.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,H.useEffect)(a,o),r}function vc(e){return e===null||!Number.isFinite(e)||e<0?null:e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function yc(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 bc(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 xc(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function Q(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 Sc(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,U.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,U.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,U.jsx)(`span`,{children:y}),t[4]=y,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,U.jsx)(`span`,{className:`gesture-track-toggle-switch`,"aria-hidden":`true`,children:(0,U.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,U.jsxs)(`div`,{className:`gesture-track-header`,children:[m,(0,U.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,U.jsxs)(`li`,{className:`gesture-track-entry${t?` is-hidden`:``}`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`gesture-track-entry-btn`,onClick:()=>u?.(e.spot,e.toSpot),title:`Jump to this annotation`,children:[(0,U.jsx)(`span`,{className:`gesture-track-time`,children:xc(e.inkedAt-r)}),(0,U.jsx)(`span`,{className:`gesture-track-icon`,"aria-hidden":`true`,children:yc(e.kind)}),(0,U.jsxs)(`span`,{className:`gesture-track-desc`,children:[e.stepNumber&&(0,U.jsxs)(`span`,{className:`gesture-track-step`,children:[`Step `,e.stepNumber]}),(0,U.jsx)(`span`,{className:`gesture-track-verb`,children:bc(e.kind)}),` `,(0,U.jsx)(`span`,{className:`gesture-track-target`,title:Q(e),children:Q(e)})]})]}),d&&(0,U.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,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:[(0,U.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,U.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,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:[(0,U.jsx)(`ellipse`,{cx:`6`,cy:`6`,rx:`5.5`,ry:`3`,stroke:`currentColor`,strokeWidth:`1.2`}),(0,U.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,U.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,U.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,U.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,U.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,U.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,U.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,U.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 Cc(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,U.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,U.jsx)(`span`,{children:l}),t[1]=l,t[2]=u);let d;t[3]!==i||t[4]!==r?(d=!r&&i>0&&(0,U.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,U.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 wc=/\b(teach me|walk me through|tutor( me)?|step[- ]by[- ]step|like i'?m (five|5|a beginner|new))\b/i;function Tc(e){return!!e&&wc.test(e)}function Ec(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 Dc=4,Oc=2e3;function kc(e,t=Dc){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/Oc),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 Ac(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 jc(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 Mc(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 Nc(e){if(e.length<4)return!1;let{minX:t,minY:n,maxX:r,maxY:i}=Mc(e),a=Math.hypot(r-t,i-n),o=Ac(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=jc(e)>o*o*.02;return l||u}function Pc(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 Fc=3e3;function Ic(e,t=Dc,n=Fc){let{minX:r,minY:i,maxX:a,maxY:o}=Mc(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(Pc(r,e)&&(u.push(r),u.length>=n))return u}return u}var Lc=4,Rc=4e3,zc=`input, textarea, select, button, a, summary, [contenteditable], [role="slider"], [role="tab"], [role="switch"], [draggable="true"], .block-ask, .leaflet-container, .geo-map, [data-interactive]`;function Bc({armed:e,rootRef:t,onStroke:n,onTap:r,strokes:i,highlights:a}){let o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=(0,H.useRef)([]),u=(0,H.useRef)(null),d=(0,H.useRef)(!1),f=(0,H.useRef)(!1),p=(0,H.useRef)(null),m=(0,H.useRef)(0),h=(0,H.useRef)(e);h.current=e;let g=(0,H.useRef)(n);g.current=n;let _=(0,H.useRef)(r);return _.current=r,(0,H.useEffect)(()=>{let n=t.current;if(n)return n.classList.toggle(`ink-armed`,e),()=>n.classList.remove(`ink-armed`)},[e,t]),(0,H.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=Ec(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>Rc)S();else return;if(!(h.current||e.pointerType===`pen`)||e.target?.closest?.(zc))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))<Lc)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,U.jsxs)(`svg`,{ref:o,className:`ink-user-overlay`,"aria-hidden":`true`,children:[a?.map((e,t)=>e.w>0&&e.h>0?(0,U.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,U.jsx)(`path`,{className:`ink-user-stroke ink-user-settled`,d:e},t)),(0,U.jsx)(`path`,{ref:c,className:`ink-user-halo`,d:``}),(0,U.jsx)(`path`,{ref:s,className:`ink-user-stroke`,d:``})]})}var Vc=80,Hc=`.ink-user-overlay, .ink-layer, .block-ask, .card-eyebrow`,Uc=e=>{let t=e.replace(/\s+/g,` `).trim();return t.length>Vc?t.slice(0,Vc-1)+`…`:t};function Wc(e){return!e.data||!e.data.trim()?!1:!e.parentElement?.closest(Hc)}function Gc(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 Kc(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 qc(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 Jc(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 Yc(e){let t=[...e.values()],n=e=>{let[t,n]=Gc(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)=>Kc(e.node,t.node)),a=Uc(i.map(n).filter(e=>e.trim()).join(` `));if(!a)return null;let o=[];for(let e of i){let[t,n]=Gc(e);o.push(...Jc(e.node,t,n))}return{text:a,blockId:qc(r.node),rects:o}}function Xc(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 Zc(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?.(Hc))continue;let t=Xc(e);if(t)return{text:Uc(t),blockId:qc(e),rects:[e.getBoundingClientRect()]}}return null}function Qc(e,t){let n=new Map,r=[];for(let i of e){let e=t.caretAt(i.x,i.y);if(e&&Wc(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?Yc(n):Zc(r,t)}function $c(e,t,n){if(e.length===0)return null;let r=e=>({x:e.x+t.left,y:e.y+t.top});if(Nc(e)){let t=Ic(e.map(r)),i=t.length>0?Qc(t,n):null;if(i)return i}let i=kc(e).map(r);return i.length===0?null:Qc(i,n)}var el=6,tl=14;function nl(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-el&&n<=t.right+el&&r>=t.top-tl&&r<=t.bottom+tl)return!0}return!1}catch{return!0}}function rl(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||!nl(r,i,e,t)?null:{node:r,offset:i}}var il={caretAt:rl,elementsAt:(e,t)=>document.elementsFromPoint(e,t)};function al(e,t,n=il){let r=$c(e,t.svgRect,n);return!r||!r.text?null:{intent:{kind:`highlight`,blockIds:r.blockId?[r.blockId]:[],textAt:r.text},rects:r.rects}}function ol(e,t){return e.map(e=>({x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}))}function sl(e){let{onCommit:t,resetKey:n,hitTester:r}=e,[i,a]=(0,H.useState)([]),[o,s]=(0,H.useState)(0),c=(0,H.useRef)(i);c.current=i;let l=(0,H.useRef)(t);l.current=t;let u=(0,H.useCallback)((e,t,n)=>{let i=al(e,n,r);if(!i)return s(e=>e+1),!1;let o={intent:i.intent,stroke:t,rects:ol(i.rects,n.svgRect)};return a(e=>[...e,o]),!0},[r]),d=(0,H.useCallback)((e,t)=>{u(e,Ec(e),t)},[u]),f=(0,H.useCallback)((e,t)=>{u([e,{x:e.x+1,y:e.y+1}],``,t)},[u]),p=(0,H.useCallback)(e=>{a(t=>e==null?t.slice(0,-1):t.filter((t,n)=>n!==e))},[]),m=(0,H.useCallback)(()=>{let e=c.current;e.length&&l.current(e.map(e=>e.intent)),a([])},[]),h=(0,H.useCallback)(()=>a([]),[]);(0,H.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 cl=e=>e.length>22?e.slice(0,21)+`…`:e;function ll(e){return e.textAt?`Marked “${cl(e.textAt)}”`:`Marked`}function ul(e){if(e.length===0)return``;let t=e[0]?.textAt?.trim(),n=t?`Tell me about “${cl(t)}”`:`Tell me about this`;return e.length===1?n:`${n} (and ${e.length-1} more)`}function dl(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 fl(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 pl(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,U.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,U.jsxs)(`span`,{className:`ink-chip`,children:[(0,U.jsx)(`span`,{className:`ink-chip-text`,children:ll(e.intent)}),(0,U.jsx)(`button`,{type:`button`,className:`ink-chip-x`,"aria-label":`Remove ${e.intent.textAt||`mark`}`,onClick:()=>r(t),children:(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`11`,height:`11`,"aria-hidden":`true`,children:(0,U.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,U.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,U.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 ml=`mavea-ink-hint-seen`;function hl(){try{return localStorage.getItem(ml)===`1`}catch{return!0}}function gl({armed:e,pins:t,miss:n=0,onUndo:r,onSend:i}){let[a,o]=(0,H.useState)(hl),s=!a&&!e&&t.length===0,c=e&&t.length===0,[l,u]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(!n)return;u(!0);let e=setTimeout(()=>u(!1),2600);return()=>clearTimeout(e)},[n]),(0,H.useEffect)(()=>{if(!(a||!e&&t.length===0)){o(!0);try{localStorage.setItem(ml,`1`)}catch{}}},[e,t.length,a]);let d=()=>{o(!0);try{localStorage.setItem(ml,`1`)}catch{}},f=t.length>0;return!s&&!c&&!l&&!f?null:(0,U.jsxs)(`div`,{className:`ink-bar`+(s?` coaching`:``),children:[s&&(0,U.jsxs)(`div`,{className:`ink-coach`,role:`note`,children:[(0,U.jsx)(`span`,{className:`ink-coach-spark`,"aria-hidden":`true`,children:`✍️`}),(0,U.jsxs)(`span`,{className:`ink-coach-text`,children:[(0,U.jsx)(`strong`,{children:`Highlight to ask.`}),` Turn on `,(0,U.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,U.jsx)(`button`,{type:`button`,className:`ink-coach-x`,title:`Dismiss`,"aria-label":`Got it`,onClick:d,children:(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})})]}),c&&!l&&(0,U.jsxs)(`span`,{className:`ink-howto`,role:`status`,children:[(0,U.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,U.jsx)(`span`,{className:`ink-miss`,role:`status`,children:`Nothing to grab there. Drag across a value, label, or card.`}),f&&(0,U.jsx)(pl,{pins:t,onUndo:r,onSend:i})]})}function _l(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,U.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,children:(0,U.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,U.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,U.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 vl=`mavea-brief-date`,yl=vl,bl=void 0;function xl(){return new Date().toISOString().slice(0,10)}function Sl(){try{return typeof localStorage>`u`?null:localStorage.getItem(vl)}catch{return null}}function Cl(){return bl===void 0&&(bl=Sl()),bl}function wl(e){bl=e;try{typeof localStorage<`u`&&localStorage.setItem(vl,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(yl,{detail:e}))}catch{}}function Tl(e){return e?Cl()!==xl():!1}function El(){wl(xl())}function Dl(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 Ol=99;function kl(e){return e>Ol?`${Ol}+`:String(e)}function Al(){for(let e of In()){let t=zn(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 jl(e){let t=(0,q.c)(16),{onStudy:n}=e,r=kt(),i;if(t[0]!==r||t[1]!==n){if(i=[],r){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(R.layers,{}),t[3]=e):e=t[3];let a;t[4]===r.count?a=t[5]:(a=kl(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=Al(),t[10]=e):e=t[10];let a=e;if(a){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(R.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:Nl},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,U.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,U.jsxs)(`section`,{className:`ready-shelf go-study`,children:[o,(0,U.jsx)(`ul`,{className:`ready-list`,children:a.map(Ml)})]}),t[14]=a,t[15]=s),s}function Ml(e){return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`ready-item`,onClick:e.onPick,children:[(0,U.jsx)(`span`,{className:`ready-icon`,"aria-hidden":!0,children:e.icon}),(0,U.jsxs)(`span`,{className:`ready-copy`,children:[(0,U.jsx)(`span`,{className:`ready-title`,children:e.title}),(0,U.jsx)(`span`,{className:`ready-sub`,children:e.sub})]}),(0,U.jsx)(`span`,{className:`ready-go`,children:e.action})]})},e.key)}function Nl(){window.location.hash=`#/courses`}function Pl(e){return e.type===`flashcard`&&Array.isArray(e.props?.cards)}function Fl(e){return e.replace(/<[^>]+>/g,``).trim()}function Il(e){let t=[];for(let n of e){if(!Pl(n))continue;let e=n;for(let n of e.props.cards){let e=Fl(n.front??``),r=Fl(n.back??``);!e||!r||t.push({front:e,back:r,tag:n.tag?Fl(n.tag):void 0})}}return t}function Ll(e){return Fl(e??``).trim()}function Rl(e){let t=[],n=(e,n,r)=>{let i=Ll(e),a=Ll(n);i&&a&&t.push({front:i,back:a,tag:Ll(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=>Ll(e.text)).filter(Boolean);if(t.length){let r=Ll(e.props.explanation),i=r?`${t.join(`; `)} — ${r}`:t.join(`; `);n(e.props.question,i)}break}default:break}return t}var zl=[`title`,`label`,`heading`,`name`,`question`,`caption`,`eyebrow`],Bl=[`summary`,`narrative`,`detail`,`sub`,`body`,`text`,`prose`,`def`,`a`];function Vl(e){return e.props??{}}function Hl(e,t){for(let n of t){let t=e[n];if(typeof t==`string`){let e=Ll(t);if(e)return e}}return``}function Ul(e){return Hl(Vl(e),zl).slice(0,140)||Me(e)}function Wl(e){return Hl(Vl(e),Bl).slice(0,400)}function Gl(e){return{front:Ul(e),back:Wl(e)}}function Kl(e){let t=[],n=Ul(e);n&&t.push(n);for(let[,r]of Object.entries(Vl(e)))if(typeof r==`string`){let e=Ll(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=Ll(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=Ll(r);e&&t.push(e)}}}return[...new Set(t)].join(`
|
|
5
|
-
`).slice(0,1400)}function ql(e){let t=Rl(e);return t.length?{cards:t,exact:!0}:{cards:[Gl(e)],exact:!1}}var Jl=`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":"…"}]}.`,Yl={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 Xl(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=Ll(String(e.front??``)).slice(0,300),n=Ll(String(e.back??``)).slice(0,600);t&&n&&r.push({front:t,back:n})}return r.slice(0,4)}async function Zl(e,t,n){let r=Kl(e);if(!r)return[];let i=Wn(t.model)===`slow`?480:640;try{let e=await qe(t.provider).generate({system:Jl,systemBase:Jl,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:Yl,...n?{signal:n}:{}},t);return n?.aborted?[]:Xl(e.raw)}catch{return[]}}var Ql=`tour-neural-networks`,$l=`neural`,eu=[{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 tu(){let e=Vn(Ql);if(e)return e;let t=yr($l)?.frames[0];if(!t)return null;let n={id:Ql,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:eu,createdAt:Date.now(),model:`tour`};return Bn(n),Hn(Ql,eu[0].id,t),n}var nu=24e3,ru=nu*180,iu=[],au=null,ou=[],su=0,cu=!1,lu=1,uu=0,du=new Set;function fu(){uu+=1;for(let e of du)e()}function pu(e){return du.add(e),()=>du.delete(e)}function mu(){return uu}function hu(){return su/nu}function gu(){iu=[],au=null,ou=[],su=0,lu=we(),cu=!0,fu()}function _u(e){if(!cu)return;let t=ou[ou.length-1];t&&t.blocks===e||ou.push({t:hu(),blocks:e})}var vu={begin(e){cu&&(au={text:e,chunks:[],samples:0})},push(e){!cu||!au||su+e.length>ru||(au.chunks.push(e),au.samples+=e.length,su+=e.length)},end(e){!cu||!au||(e&&au.samples>0?iu.push(au):su-=au.samples,au=null,fu())}};function yu(){let e=iu.reduce((e,t)=>e+t.samples,0);if(e===0)return null;let t=new Float32Array(e),n=[],r=0;for(let e of iu){let i=r/nu;for(let n of e.chunks)t.set(n,r),r+=n.length;n.push({text:e.text,t0:i,t1:r/nu})}let i=e/nu;return{pcm:t,sampleRate:nu,duration:i,spans:n,marks:ou.map(e=>({t:Math.min(e.t,i),blocks:e.blocks})),speed:lu}}function bu(e,t){let n=0;for(let r of e.marks){if(r.t>t)break;n=r.blocks}return n}function xu(e,t,n,r){if(t>=e.duration-.05)return r;let i=bu(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 Su=24e3*300,Cu=class{budget;map=new Map;constructor(e=Su){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)}}},wu=[1,1.25,1.5,2,.75];function Tu(e){return`${Number.isInteger(e)?e:e.toFixed(2).replace(/0+$/,``).replace(/\.$/,``)}×`}function Eu(e){return Math.min(2,Math.max(.75,e))}function Du(e){let t=wu.indexOf(Eu(e));return wu[(t<0?0:t+1)%wu.length]}function Ou(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 ku(e,t){let n=new Blob([Ou(e,t)],{type:`audio/wav`});return URL.createObjectURL(n)}var Au=160;function ju(e){let t=Math.max(1,Math.floor(e.pcm.length/Au)),n=[];for(let r=0;r<Au;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 Mu={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 Nu(e){let t=(0,q.c)(8),{reason:n}=e,r=Mu[n],i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.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,U.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,U.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,U.jsxs)(`div`,{className:`voice-scrub voice-scrub--empty`,role:`status`,"aria-label":`Voice scrub unavailable`,children:[i,(0,U.jsxs)(`span`,{className:`voice-scrub-empty-copy`,children:[a,o]})]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Pu({audio:e,t,onSeek:n}){let r=(0,H.useRef)(null),i=(0,H.useRef)(null),a=(0,H.useRef)(null),o=(0,H.useRef)(!1),s=(0,H.useRef)(null),c=(0,H.useRef)(null),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(null),p=d??t,[m,h]=Bt(),g=Eu(m.voiceSpeed),_=g/(e.speed||1),v=(0,H.useRef)(_);v.current=_;let y=(0,H.useCallback)(()=>{c.current?.stop(),c.current=null,u(!1)},[]),b=(0,H.useCallback)(t=>{if(y(),!x())return;n(t),f(t),s.current||=ku(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,H.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,H.useCallback)(()=>{h({voiceSpeed:Du(g)})},[h,g]);(0,H.useEffect)(()=>{c.current&&(c.current.el.playbackRate=_)},[_]),(0,H.useEffect)(()=>()=>{y(),s.current&&=(URL.revokeObjectURL(s.current),null)},[e,y]),(0,H.useEffect)(()=>{let t=r.current;if(!t)return;a.current||=ju(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/Au;for(let e=0;e<Au;e++){let t=Math.max(.06,a.current[e])*(o-4);s.fillStyle=e/Au<=d?l:u,s.fillRect(e*f+f*.2,(o-t)/2,f*.6,t)}},[e,p]),(0,H.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,U.jsxs)(`div`,{className:`voice-scrub`,children:[(0,U.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,U.jsxs)(`svg`,{viewBox:`0 0 12 12`,width:`13`,height:`13`,"aria-hidden":`true`,children:[(0,U.jsx)(`rect`,{x:`2.5`,y:`2`,width:`2.4`,height:`8`,rx:`0.6`,fill:`currentColor`}),(0,U.jsx)(`rect`,{x:`7.1`,y:`2`,width:`2.4`,height:`8`,rx:`0.6`,fill:`currentColor`})]}):(0,U.jsx)(`svg`,{viewBox:`0 0 12 12`,width:`13`,height:`13`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M3.2 2.2 L10 6 L3.2 9.8 Z`,fill:`currentColor`})})}),(0,U.jsx)(`button`,{type:`button`,className:`voice-scrub-rate`,onPointerDown:e=>e.stopPropagation(),onClick:C,"aria-label":`Speed, currently ${Tu(g)}. Tap to change.`,title:`Voice speed`,children:Tu(g)}),(0,U.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,U.jsx)(`canvas`,{ref:r,className:`voice-scrub-wave`,"aria-hidden":`true`}),(0,U.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 Fu({audio:e,t,onSeek:n,unavailable:r=`missing`}){return e?(0,U.jsx)(Pu,{audio:e,t,onSeek:n}):(0,U.jsx)(Nu,{reason:r})}function Iu(){let e=(0,q.c)(16),[t,n]=Bt(),r;e[0]===t.voiceSpeed?r=e[1]:(r=Eu(t.voiceSpeed),e[0]=t.voiceSpeed,e[1]=r);let i=r,a,o;e[2]===i?(a=e[3],o=e[4]):(a=()=>{de(i)},o=[i],e[2]=i,e[3]=a,e[4]=o),(0,H.useEffect)(a,o);let s;e[5]!==n||e[6]!==i?(s=()=>n({voiceSpeed:Du(i)}),e[5]=n,e[6]=i,e[7]=s):s=e[7];let c=s,l;e[8]===i?l=e[9]:(l=Tu(i),e[8]=i,e[9]=l);let u=`Voice speed, currently ${l}. Tap to change.`,d;e[10]===i?d=e[11]:(d=Tu(i),e[10]=i,e[11]=d);let f;return e[12]!==c||e[13]!==u||e[14]!==d?(f=(0,U.jsx)(`button`,{type:`button`,className:`voice-speed`,onClick:c,"aria-label":u,title:`How fast Mavéa speaks`,children:d}),e[12]=c,e[13]=u,e[14]=d,e[15]=f):f=e[15],f}var Lu={standard:`deep`,deep:`simple`,simple:`standard`},Ru={simple:`Simple`,standard:`Standard`,deep:`In-depth`};function zu(){let e=(0,q.c)(8),[t,n]=Bt(),r=t.explainLevel,i;e[0]!==r||e[1]!==n?(i=()=>n({explainLevel:Lu[r]}),e[0]=r,e[1]=n,e[2]=i):i=e[2];let a=i,o=`explain-chip`+(r===`simple`?` is-simple`:r===`deep`?` is-deep`:``),s=`Explanation level: ${Ru[r]}. Tap for ${Ru[Lu[r]]}.`,c=Ru[r],l;return e[3]!==a||e[4]!==o||e[5]!==s||e[6]!==c?(l=(0,U.jsx)(`button`,{type:`button`,className:o,onClick:a,"aria-label":s,title:`How plain or rigorous the words and visuals are — or just say 'explain it simpler' / 'go deeper'`,children:c}),e[3]=a,e[4]=o,e[5]=s,e[6]=c,e[7]=l):l=e[7],l}var Bu=[`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
|
-
`),Vu=150;function Hu(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 Uu(e,t,n){try{let r=await qe(t.provider).generate({system:Bu,history:[],user:e,maxTokens:Vu},t);return n.aborted?[]:Hu(r.raw)}catch{return[]}}var Wu=80,Gu=120;function Ku(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function qu(e){if(!e)return``;if(/[\s.!?,;:]$/.test(e))return e.trim();let t=e.trimEnd();return/\s/.test(t)?t.replace(/\S+$/,``).trim():``}function Ju(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 Yu(e){return Ku(e.trim(),Gu)}function Xu(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 Ku(t.charAt(0).toUpperCase()+t.slice(1),Wu)}var Zu=/\b(Dad|Mom|Mum|Papa|Mama|Grandpa|Grandma|Grandad|Nan|Nana|Uncle|Auntie)\b(?:'s)?/,Qu=/\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,$u=/\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/,ed=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(`.`)),td=/\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,nd=/\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,rd=/\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,id=/(?:\?)|(?:\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,ad=/\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 od(e){let t=Ju(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`?Ku(i,Wu):Xu(a),s=`${t}:${o.toLowerCase().slice(0,20)}`;if(r.has(s))return;r.add(s);let c=Yu(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(Qu);if(t){let n=t[1],r=n.charAt(0).toUpperCase()+n.slice(1);u(`per_${i++}`,`person`,r,e)}let n=e.match(Zu);n&&!t&&u(`per_${i++}`,`person`,n[1],e);let r=e.match($u);if(r){let t=r[1];ed.has(t)||u(`per_${i++}`,`person`,t,e)}td.test(e)&&u(`opt_${a++}`,`option`,Xu(e),e),nd.test(e)&&u(`fea_${o++}`,`fear`,Xu(e),e),rd.test(e)&&u(`con_${s++}`,`constraint`,Xu(e),e),id.test(e)&&u(`loo_${c++}`,`open_loop`,Xu(e),e),ad.test(e)&&u(`wan_${l++}`,`want`,Xu(e),e)}return n}function sd(e){let t=Ju(e);return t.length>0?t.length:+!!e.trim()}var cd=/^(?: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,ld=14;function ud(e){let t=e.trim();return t?sd(t)>=2?!0:cd.test(t)||t.endsWith(`?`)?!1:t.split(/\s+/).length>=ld:!1}var dd=700,fd=4,pd=3;function md(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,H.useState)(o),l=(0,H.useRef)(0),u=(0,H.useRef)(``),d=(0,H.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,H.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,H.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=qu((t??``).trim());if(r.split(/\s+/).filter(Boolean).length<fd||r===u.current||l.current>=pd)return;let i=window.setTimeout(()=>{u.current=r,l.current+=1,d.current?.abort();let e=new AbortController;d.current=e,Uu(r,n,e.signal).then(t=>{!e.signal.aborted&&t.length&&c(t)})},dd);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,H.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,H.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 hd({ghosts:e}){return e.length===0?null:(0,U.jsx)(`div`,{className:`ghost-row`,"aria-hidden":`true`,children:e.map((e,t)=>(0,U.jsxs)(`div`,{className:`ghost-card is-`+e.kind,style:{"--gi":t},children:[(0,U.jsxs)(`span`,{className:`ghost-kind`,children:[`◌ `,e.kind===`forming`?`Forming`:`Maybe`]}),(0,U.jsx)(`span`,{className:`ghost-title`,children:e.title}),(0,U.jsxs)(`span`,{className:`ghost-bones`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]})]},e.title))})}var gd=2e3,_d=350,vd={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`]},yd={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`]},bd={type:`object`,properties:{center:{type:`string`},title:{type:`string`},atoms:{type:`array`,minItems:1,items:vd},links:{type:`array`,items:yd},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`]},xd={type:`object`,properties:{add:{type:`array`,items:vd},addLinks:{type:`array`,items:yd}}},Sd=`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 Cd(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 wd(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 Td(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
|
-
${wd(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 Ed(e,t,n,r,i){try{let a=await qe(r.provider).generate({system:Sd,history:[],user:e,maxTokens:t,thinkingLevel:`minimal`,format:n,signal:i},r);return i?.aborted?null:a.raw}catch{return null}}async function Dd(e,t,n){let r=await Ed(Cd(e),gd,bd,t,n);return r===null?null:mt(r,e)}async function Od(e,t,n,r,i){let a=await Ed(Td(e,t),_d,xd,r,i);return a===null?null:lt(a,n)}function kd(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 Ad=6e3,jd=8,Md=1,Nd=8,Pd=4;function Fd(e){return e.trim()?e.trim().split(/\s+/).length:0}var Id=24;function Ld(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 Rd(e){return e.toLowerCase().replace(/['’]/g,``).replace(/[^a-z0-9]+/g,` `).trim()}function zd(e){return e.status===`stable`?2:+(e.status===`forming`)}function Bd(e,t){let n=new Map(e.atoms.map(e=>[e.id,e])),r=new Map(e.atoms.map(e=>[Rd(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(Rd(e.quote));if(i&&n.has(i)){n.set(i,{...n.get(i),...e,id:i});continue}n.set(e.id,e),r.set(Rd(e.quote),e.id)}let i=Array.from(n.values());i.length>Id&&(i=[...i].sort((e,t)=>(t.weight??1)-(e.weight??1)||zd(t)-zd(e)).slice(0,Id));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 Vd={center:``,atoms:[],links:[]};function Hd(e){let[t,n]=(0,H.useState)(`idle`),[r,i]=(0,H.useState)(null),a=(0,H.useRef)(`idle`),o=(0,H.useRef)(null),s=(0,H.useRef)(``),c=(0,H.useRef)(0),l=(0,H.useRef)(0),u=(0,H.useRef)(null),d=(0,H.useRef)(!1),f=(0,H.useRef)(new Set),p=(0,H.useRef)(e);(0,H.useEffect)(()=>{p.current=e},[e]);let m=e=>[`id:${e.id}`,`q:${Rd(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,H.useCallback)(e=>{let t=e.filter(e=>!h(e));if(t.length===0)return;let n=o.current??Vd,r=Ld(n.atoms,t);v({...n,atoms:r})},[]),b=(0,H.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 Od(i,n,e,t,r.signal);if(r.signal.aborted||!a)return;v(g(Bd(o.current??n,a)))}finally{r.signal.aborted||(d.current=!1)}},[]),x=(0,H.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 Dd(e,t,n.signal);if(n.signal.aborted||!r)return;let i=Bd(o.current??Vd,{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,H.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 Dd(e,t,n.signal);if(n.signal.aborted||!r)return;v(r)}finally{n.signal.aborted||(d.current=!1)}},[]),C=(0,H.useCallback)(e=>{a.current===`idle`&&_(`listening`);let t=od(e);y(t);let n=Fd(e),r=l.current>=Nd,i=Date.now()-c.current<Ad,u=!r&&!i&&!d.current;if((o.current?.atoms.length??0)===0){u&&n>=Pd&&x(e);return}let f=n-Fd(s.current),p=t.filter(e=>!o.current?.atoms.some(t=>t.id===e.id)).length;u&&!(n<Pd||f<jd&&p<Md)&&b(e)},[y,x,b]),w=(0,H.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,H.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,H.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,H.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=Ld(e.atoms,[n]);v({...e,atoms:r,unsaid:void 0})},[]),O=(0,H.useCallback)(()=>{let e=o.current;if(!e?.unsaid)return;let{unsaid:t}=e;f.current.add(`q:${Rd(t.label)}`),v({...e,unsaid:void 0})},[]),k=(0,H.useCallback)(e=>{if(!e.trim()){w();return}_(`pausing`),S(e).then(()=>{a.current===`pausing`&&_(`settled`)})},[S,w]);return(0,H.useEffect)(()=>()=>{u.current?.abort()},[]),{phase:t,spec:r,intent:(0,H.useMemo)(()=>r?kd(r):`general`,[r]),onTranscript:C,onSpeechEnd:k,removeAtom:E,confirmUnsaid:D,dismissUnsaid:O,reset:w,resume:T}}var Ud=5e3,Wd=0;function Gd(e,t){let[n,r]=(0,H.useState)([]),i=(0,H.useRef)(new Set),a=(0,H.useCallback)((e,t)=>{r([{id:`sig-${++Wd}`,content:t,kind:e,expiresAt:Date.now()+Ud}])},[]);return(0,H.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,H.useEffect)(()=>{t===`idle`&&(i.current.clear(),r([]))},[t]),(0,H.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 Kd(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,H.useRef)(!1),[p,m]=(0,H.useState)(!1),h=(0,H.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,H.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,H.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,H.useEffect)(b,x);let{currentSignal:S}=Gd(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,U.jsx)(V,{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 qd=[{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 Jd(e){let t=e.quote&&e.quote.trim()&&e.quote.trim()!==e.label?` ("${e.quote.trim()}")`:``;return`- ${e.label}${t}`}function Yd(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(Jd(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(Jd(e));t.push(``)}}else for(let n of qd){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(Jd(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 Xd(e,t){let n=e.center?.trim(),r=Yd(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 Zd(e){return/^(ok(ay)?[,.\s]+)?(any |your |so[,.\s]+)?thoughts\s*[?.!]*$/i.test(e.trim())}function Qd(e){let t=e.trim();return t.length>0&&!Zd(t)}function $d(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 ef=/https?:\/\/[^\s<>"')\]]+/i;function tf(e){let t=e.match(ef);return t?t[0].replace(/[.,;:!?]+$/,``):null}function nf(e){let t=tf(e);return t?e.replace(t,``).trim().split(/\s+/).filter(Boolean).length<=12:!1}function rf(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 af=`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 of(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?!0:e.isContentEditable:!1}var sf=nt.map(e=>{let t=it[e];return{id:e,label:t.label,description:`${t.archetype} — ${t.blurb}`,accent:t.tokens.accent}}),cf=`mavea-preso-style`;function lf(e){return sf.some(t=>t.id===e)}function uf(){try{let e=localStorage.getItem(cf);return lf(e)?e:`folio`}catch{return`folio`}}function df(e){try{localStorage.setItem(cf,e)}catch{}}function ff(e){return e<5?`Late night`:e<12?`This morning`:e<17?`This afternoon`:`Tonight`}function pf(e){let t=Math.max(1,Math.round(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function mf(e,t){if(e.length===0||t.length===0)return null;let n=e[0],r=e[e.length-1],i=`${ff(new Date(n.at).getHours())}, so far.`,a=[`${mc(n.at)} – ${mc(r.at)}`,pf(r.at-n.at),`${t.length} ${t.length===1?`topic`:`topics`}`,`${e.length} ${e.length===1?`moment`:`moments`}`].join(` · `),o=pc(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:mc(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 hf(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,U.jsxs)(`span`,{className:`listen-eq`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]}),t[0]=a):a=t[0];let o=n?`“${n}`:`Listening`,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.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,U.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,U.jsx)(`div`,{className:`listen-note`,children:u}),t[5]=u,t[6]=d);let f;return t[7]!==l||t[8]!==d?(f=(0,U.jsx)(`div`,{className:`listen-stage`,children:(0,U.jsxs)(`div`,{className:`listen-card`,role:`status`,"aria-live":`polite`,children:[a,(0,U.jsxs)(`div`,{className:`listen-body`,children:[l,d]})]})}),t[7]=l,t[8]=d,t[9]=f):f=t[9],f}var gf=250;function _f(e){let t=(0,q.c)(6),{cards:n}=e,[r,i]=(0,H.useState)(!1),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.setTimeout(()=>i(!0),gf);return()=>window.clearTimeout(e)},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,H.useEffect)(a,o),!r||n.length===0)return null;let s;t[2]===n?s=t[3]:(s=n.map(vf),t[2]=n,t[3]=s);let c;return t[4]===s?c=t[5]:(c=(0,U.jsx)(`div`,{className:`skel-grid`,role:`status`,"aria-label":`Building the answer`,children:s}),t[4]=s,t[5]=c),c}function vf(e,t){return(0,U.jsxs)(`div`,{className:`skel-card`,children:[(0,U.jsxs)(`span`,{className:`skel-eyebrow`,children:[`✦ `,e.label,`…`]}),e.lines.map(yf)]},t)}function yf(e,t){return(0,U.jsx)(`span`,{className:`skel-line`,style:{width:`${e}%`}},t)}function bf({thinking:e=!1}){return(0,U.jsxs)(`div`,{className:`composing-status`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(`span`,{className:`composing-orb`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:e?`Thinking it through`:`Composing your answer`}),(0,U.jsxs)(`span`,{className:`composing-dots`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]})]})}function xf(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,U.jsxs)(`span`,{className:`turn-chip`,children:[(0,U.jsx)(R.globe,{}),` Searching the web…`]}),c=e.map(Sf)}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,U.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 Sf(e,t){return(0,U.jsxs)(`span`,{className:`turn-chip src`,children:[(0,U.jsx)(`i`,{className:`turn-chip-dot`,"aria-hidden":`true`}),Ie(e.url)??e.title]},t)}function Cf(){return(0,H.useSyncExternalStore)(Ce,ge,wf)}function wf(){return!1}var Tf=600,Ef=!1,Df=null,Of=null,kf=new Set;function Af(){if(z()){Df===null&&!Ef&&(Df=window.setTimeout(()=>{Df=null,Ef=!0;for(let e of kf)e()},Tf));return}if(Df!==null&&(window.clearTimeout(Df),Df=null),Ef){Ef=!1;for(let e of kf)e()}}function jf(e){return kf.add(e),Of??=Ce(Af),()=>{kf.delete(e),kf.size===0&&(Of?.(),Of=null,Df!==null&&(window.clearTimeout(Df),Df=null),Ef=!1)}}function Mf(){return(0,H.useSyncExternalStore)(jf,Pf,Nf)}function Nf(){return!1}function Pf(){return Ef}var Ff={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`},If=/^(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 Lf(e,t=4){let n=e.trim().replace(/\s+/g,` `);for(let e=0;e<8;e++){let e=n.replace(If,``);if(e===n)break;n=e}return n.replace(/[?!.]+$/,``).split(` `).slice(0,t).join(` `).trim()}var Rf=[[78,52],[64,88],[82,40]];function zf(e,t){let n=Lf(e),r=Qt(e,t),i=Object.entries(r).filter(([e,t])=>t>0&&Ff[e]).sort((e,t)=>t[1]-e[1]).map(([e])=>Ff[e]),a=Zt(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:Rf[t%Rf.length]}))}function Bf(e){let t=e&&Ff[e]||(e===`text`?`Finding`:null);return{label:t?`Building — ${t.toLowerCase()}`:`Building`,lines:Rf[0]}}function Vf(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 Hf(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 Uf=`Voice input needs Chrome or Edge — type instead.`,Wf=`Microphone access is blocked — allow mic access for this site to talk to Mavéa.`,Gf=`Couldn't reach your microphone — check it's connected and not in use by another app.`;function Kf(){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,H.useState)(t),[i,a]=(0,H.useState)(null),[o,s]=(0,H.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 We(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 qf=`mavea-live-bookmarks`;function Jf(){let[e,t]=(0,H.useState)(()=>{try{let e=localStorage.getItem(qf);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}});return{bookmarks:e,toggleBookmark:(0,H.useCallback)(e=>{t(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(qf,JSON.stringify([...n]))}catch{}return n})},[])}}var Yf=`mavea-live-ask-hint`;function Xf(){let e=(0,q.c)(3),[t,n]=(0,H.useState)(Zf),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(!0);try{localStorage.setItem(Yf,`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 Zf(){try{return localStorage.getItem(Yf)===`1`}catch{return!1}}u();var Qf=(0,H.lazy)(()=>M(()=>import(`./TopicCanvas-wmAsICUd.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]))),$f=[{col:6},{col:6},{col:12}],ep=`mavea-live-rail-collapsed-v1`,tp=`mavea-mic-hold-preferred`,np=3e3,rp=l(()=>M(()=>import(`./HowItWorks-DfUsQ2xD.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,62,28]))),ip=rp.Component,ap=l(()=>M(()=>import(`./CommandPalette-Cq9mDWiI.js`).then(e=>({default:e.CommandPalette})),__vite__mapDeps([63,2,1,3,4,5,6,16,64,65]))),op=ap.Component,sp=l(()=>M(()=>import(`./Library-CAnmN5YL.js`).then(e=>({default:e.Library})),__vite__mapDeps([66,2,1,3,4,5,6,8,16,67,68,57,69,70]))).Component,cp=l(()=>M(()=>import(`./LiveSettings-5UCN5UWM.js`).then(e=>({default:e.LiveSettings})),__vite__mapDeps([71,2,1,3,4,5,6,13,14,15,16,55,56,72,23,24,73,74,75,76,77,78,22,79,80,59,20,69,58,81]))),lp=cp.Component,up=l(()=>M(()=>import(`./DashboardDetail-BSZ3CgcK.js`).then(e=>({default:e.DashboardDetail})),__vite__mapDeps([82,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,61,19,72,23,24,73,74,75,76,77,13,15,83,84,85,86,87,88,89,90,25,26,91,92,93,94]))).Component,dp=l(()=>M(()=>import(`./DashboardSettings-C1rC3iTs.js`).then(e=>({default:e.DashboardSettings})),__vite__mapDeps([95,2,1,3,4,5,6,72,23,24,73,74,75,76,77,13,14,15,85,88]))).Component,fp=l(()=>M(()=>import(`./UnderstoodPanel-BkwhDLhW.js`).then(e=>({default:e.UnderstoodPanel})),__vite__mapDeps([96,2,1,3,4,5,6,97]))).Component,pp=l(()=>M(()=>import(`./ZoomDeck-BXwcRCO_.js`).then(e=>({default:e.ZoomDeck})),__vite__mapDeps([98,2,1,3,4,5,6,99,16,58,100,101]))),mp=pp.Component,hp=l(()=>M(()=>import(`./AtlasView-B8b67dk0.js`).then(e=>({default:e.AtlasView})),__vite__mapDeps([102,3,1,4,67,68,8,57,103,23,24,73,69,104]))),gp=hp.Component,_p=l(()=>M(()=>import(`./RippleOverlay-Cfu3ZVL1.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([105,2,1,3,4,5,6,41,55,56,106,107,108,109,24,58,110]))),vp=_p.Component,yp=l(()=>M(()=>import(`./CardEditor-DzJXb0G7.js`).then(e=>({default:e.CardEditor})),__vite__mapDeps([111,3,1,4,75,58,112]))).Component,bp=l(()=>M(()=>import(`./CourseRail-DjK_L3eD.js`).then(e=>({default:e.CourseRail})),__vite__mapDeps([113,2,1,3,4,5,6,16,114,13,14,15,115,116,117,75,77,24,118]))).Component,xp=l(()=>M(()=>import(`./MindMapViewerDrawer-DoXy6hCD.js`).then(e=>({default:e.MindMapViewerDrawer})),__vite__mapDeps([119,2,1,3,4,5,6,120,41,121,51,122,16]))).Component,Sp=l(()=>M(()=>import(`./Recap-Ba2qZ2lX.js`).then(e=>({default:e.Recap})),__vite__mapDeps([123,2,1,3,4,5,6,58,124]))),Cp=Sp.Component,wp=l(()=>M(()=>import(`./LibraryOverlay-D7Gg_GIv.js`).then(e=>({default:e.LibraryOverlay})),__vite__mapDeps([125,2,1,3,4,5,6,99,16,66,8,67,68,57,69,70,126]))),Tp=wp.Component,Ep=l(()=>M(()=>import(`./ReplayOverlay-ChDrwMLh.js`).then(e=>({default:e.ReplayOverlay})),__vite__mapDeps([127,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,62]))).Component,Dp=l(()=>M(()=>import(`./ShareModal-d_o2hebL.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,60]))),Op=Dp.Component,kp=l(()=>M(()=>import(`./ExportModal-HczU1Zg1.js`).then(e=>({default:e.ExportModal})),__vite__mapDeps([128,2,1,3,4,5,6,8,129,130,131,36,37,38,16,39,132,40,133,134,42,43,135,18,136,32,33,137,138,11,139,140,141,142,143,144,145,146,147,148,149,150,120,41,121,51,122,151,152,153,154,19,155,156,157,158,159,160,161,34,35,162,163,164,165,166,167,168,169,170,171,172,173,99,58,174,175,176,177,178,179,180,181,182,183,12,184,185,53,186,54,55,56,187]))),Ap=kp.Component,jp=l(()=>M(()=>import(`./ExtractionPreview-BfjJci-N.js`).then(e=>({default:e.ExtractionPreview})),__vite__mapDeps([188,2,1,3,4,5,6,13,14,15,72,23,24,73,74,75,76,77,87,84,20,85,59,88,89,90,25,26,189,79,58,94]))),Mp=jp.Component,Np=l(()=>M(()=>import(`./PinToDashboard-Dq77a2iP.js`).then(e=>({default:e.PinToDashboard})),__vite__mapDeps([190,2,1,3,4,5,6,8,16,72,23,24,73,74,75,76,77,13,14,15,91,87,84,20,85,59,88,89,90,25,26,92,58]))).Component,Pp=l(()=>M(()=>import(`./PrismOverlay-CYItOpax.js`).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([191,2,1,3,4,5,6,13,14,15,19,44,192,193,194,195,196,29,21,58,197]))),Fp=Pp.Component,Ip=l(()=>M(()=>import(`./SynthesisOverlay-CHlVL7sT.js`).then(e=>({default:e.SynthesisOverlay})),__vite__mapDeps([198,2,1,3,4,5,6,13,14,15,191,19,44,192,193,194,195,196,29,21,58,197]))),Lp=Ip.Component,Rp=l(()=>M(()=>import(`./RehearsalPanel-CtYKPl6O.js`).then(e=>({default:e.RehearsalPanel})),__vite__mapDeps([199,2,1,3,4,5,6,13,14,15,55,56,20,58,59,200]))),zp=Rp.Component,Bp=l(()=>M(()=>import(`./PresentationDeck-8kT0cMtk.js`).then(e=>({default:e.PresentationDeck})),__vite__mapDeps([201,2,1,3,4,5,6,129,130,131,36,37,38,16,39,132,40,133,134,42,43,135,18,136,32,8,33,137,138,11,139,140,141,142,143,144,145,146,147,148,149,150,120,41,121,51,122,151,152,153,154,19,155,156,157,158,159,160,161,34,35,162,163,164,165,166,167,168,169,170,171,172,173,99,58,174,175,176,177,178,179,180,181,182,183,12,184,185,53,186,202]))),Vp=Bp.Component,Hp=l(()=>M(()=>import(`./DelegatePanel-bFmfn9-D.js`).then(e=>({default:e.DelegatePanel})),__vite__mapDeps([203,2,1,3,4,5,6,13,14,15,55,56,202,58,121,51,204]))),Up=Hp.Component,Wp=l(()=>M(()=>import(`./SrsReview-BoaYb6XN.js`).then(e=>({default:e.SrsReview})),__vite__mapDeps([205,3,1,4,74,75,76,58,206]))),Gp=Wp.Component,Kp=l(()=>M(()=>import(`./TourPrism-VQqowXpY.js`).then(e=>({default:e.TourPrism})),__vite__mapDeps([207,2,1,3,4,5,6,191,13,14,15,19,44,192,193,194,195,196,29,21,58,197]))),qp=Kp.Component;function $({children:e,label:t=`Feature`}){return(0,U.jsx)(O,{label:t,overlay:!0,children:e})}function Jp(){try{window.location.hash=``}catch{}}function Yp(e){return D(e)??Promise.resolve()}function Xp(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 Zp(){let[e]=Bt(),t=ot(e.provider),n=e.models[e.provider]||t.defaultModel;(0,H.useLayoutEffect)(()=>(m(document,`#/live`),()=>te(document)),[]),(0,H.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,H.useRef)(g()),u=(0,H.useRef)(Gn()),d=(0,H.useRef)(A()),h=(0,H.useRef)(d.current?ee():null),x=(0,H.useRef)(d.current?P():!1),S=(0,H.useRef)((()=>{if(d.current)return null;let e=_();return e&&N(e)?e:null})()),w=(0,H.useRef)(S.current?s():null);(0,H.useEffect)(()=>{d.current&&b(),h.current&&v(),x.current&&f(),S.current&&c()},[]);let[T,D]=(0,H.useState)(``),{attached:O,setAttached:k,attachError:M,setAttachError:F,turnHadFiles:I,setTurnHadFiles:ne,onFiles:re,removeAttachment:ie}=Kf(),[ae,oe]=(0,H.useState)([]),[se,ce]=(0,H.useState)(!1),{askHintSeen:de,dismissAskHint:he}=Xf(),[z,ye]=(0,H.useState)(!1),[xe,Ce]=(0,H.useState)(null),[we,B]=(0,H.useState)(null),[Oe,ke]=(0,H.useState)(null),[V,Fe]=(0,H.useState)(!1),[Ie,Re]=(0,H.useState)(!1),[ze,Be]=(0,H.useState)(!1),[Ve,He]=(0,H.useState)(!1),[We,Ke]=(0,H.useState)(null),[Qe,$e]=(0,H.useState)(!1),[et,nt]=(0,H.useState)(null),[rt,it]=(0,H.useState)(null),[st,lt]=(0,H.useState)(()=>new Set),[dt,mt]=(0,H.useState)(null),[_t,yt]=(0,H.useState)(null),bt=(0,H.useRef)(void 0),[xt,Tt]=(0,H.useState)(null),Ot=(0,H.useRef)(void 0),[kt,At]=(0,H.useState)(!1),[jt,Mt]=(0,H.useState)(!1),[Nt,Rt]=(0,H.useState)(!1),[zt,Ut]=(0,H.useState)(!1),[Wt,Kt]=(0,H.useState)(!1),[qt,Jt]=(0,H.useState)(()=>An().length),Yt=Dt().length;(0,H.useEffect)(()=>{let e=()=>void Xt(),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,H.useEffect)(()=>qn(),[]);let[Zt,Qt]=(0,H.useState)(null),[$t,en]=(0,H.useState)(null),[tn,nn]=(0,H.useState)(null),cn=(0,H.useCallback)(e=>{e.length>=4?nn(e):e.length>0&&Qt(e)},[]),[ln,un]=(0,H.useState)(null);(0,H.useEffect)(()=>{C()&&(y(),un(jn))},[]);let[dn,pn]=(0,H.useState)({open:!1,spec:null}),[mn,gn]=(0,H.useState)(!1),[vn,yn]=(0,H.useState)(!1),In=(0,H.useRef)(!1);In.current=vn;let[Bn,Wn]=(0,H.useState)(()=>uf()),[Zn,Qn]=(0,H.useState)(!1),[$n,rr]=(0,H.useState)(new Set),[ir,or]=(0,H.useState)(null),[sr,cr]=(0,H.useState)(null),[lr,ur]=(0,H.useState)(null),[dr,fr]=(0,H.useState)(!1),pr=(0,H.useCallback)((e,t=!1)=>{ur(e),fr(e!==null&&t)},[]),hr=(0,H.useCallback)(()=>{ur(null),fr(!1)},[]),_r=(0,H.useRef)(new Cu).current,vr=(0,H.useMemo)(()=>e.quality===`fast`?null:Ft(e),[e]),[W,br]=(0,H.useState)(!1),xr=(0,H.useRef)(!1);xr.current=W;let Sr=(0,H.useRef)([]),[Cr,wr]=(0,H.useState)(0),Tr=(0,H.useRef)(0),[G,Er]=(0,H.useState)(!1),Dr=(0,H.useRef)(!1);Dr.current=G;let Or=(0,H.useRef)([]),kr=(0,H.useMemo)(()=>Ft(e),[e]),K=Hd(kr),Ar=(0,H.useRef)(K);Ar.current=K;let jr=(0,H.useRef)(null),Mr=fn(),[Nr,Pr]=(0,H.useState)(!1),[Fr,Ir]=(0,H.useState)(()=>{try{return localStorage.getItem(ep)===`true`}catch{return!1}});(0,H.useEffect)(()=>{try{localStorage.setItem(ep,String(Fr))}catch{}},[Fr]);let[Lr,Rr]=(0,H.useState)(!1),[zr,Br]=(0,H.useState)(!1),[Vr,Hr]=(0,H.useState)(!1),[q,Wr]=(0,H.useState)(),[Gr,Kr]=(0,H.useState)(!1);(0,H.useEffect)(()=>{Vr||Kr(!1)},[Vr]);let{open:qr,openPalette:Jr,closePalette:Yr}=a(),[Xr,Qr]=(0,H.useState)(!1),[ei,ti]=(0,H.useState)(0),[ni,ri]=(0,H.useState)(0),[ii,ai]=(0,H.useState)(!1),[J,oi]=(0,H.useState)(()=>{try{return localStorage.getItem(Gi)===`true`}catch{return!1}}),si=(0,H.useRef)(null),[ci,li]=(0,H.useState)(()=>{try{return localStorage.getItem(tp)===`true`}catch{return!1}});(0,H.useEffect)(()=>{try{let e=_e(localStorage.getItem(`mavea-voice-mavea`)||`heart`);e&&me(`mavea`,e.kokoro)}catch{}},[]),(0,H.useEffect)(()=>{if(typeof window>`u`)return;let e,t=t=>{let n=t.detail?.changed;Array.isArray(n)&&n.length>0&&(Br(!0),e&&clearTimeout(e),e=setTimeout(()=>Br(!1),2600))};return window.addEventListener(Gt,t),()=>{window.removeEventListener(Gt,t),e&&clearTimeout(e)}},[]),(0,H.useEffect)(()=>{try{localStorage.setItem(Gi,String(J))}catch{}},[J]),(0,H.useEffect)(()=>{try{localStorage.setItem(tp,String(ci))}catch{}},[ci]);let ui=(0,H.useRef)(null),di=(0,H.useRef)(V);di.current=V;let fi=(0,H.useRef)(null),pi=(0,H.useCallback)(e=>{di.current||ui.current?.setMaveaSpeaking(!0);let t=!ge(),n=pe(e,`mavea`);return t&&(fi.current=n),n},[]);(0,H.useEffect)(()=>{fe(V),V?ui.current?.setMaveaSpeaking(!1):ge()&&ui.current?.setMaveaSpeaking(!0)},[V]);let[mi]=(0,H.useState)(()=>l.current||u.current?(ft(),null):d.current||S.current?null:ut()),gi=(0,H.useRef)(pt()).current,Y=qo({canRun:E,getConfig:()=>Ft(It()),getCaps:()=>Pt(It()),speak:pi,cancelSpeak:Se,getLibraryEnabled:()=>It().libraryEnabled,initial:mi?Ko(mi):void 0}),vi=md(z,xe,vr,Y.busy),bi=(0,H.useCallback)(()=>{window.location.hash=`#/live`,window.location.reload()},[]),xi=(0,H.useCallback)(()=>{j(),window.location.hash=`#/live`,window.location.reload()},[]),Ci=(0,H.useRef)(`normal`);Ci.current=Y.phase;let wi=(0,H.useRef)(null);wi.current=Y.activeBlank;let Ti=(0,H.useRef)([]);Ti.current=Y.spec?.blanks??[],(0,H.useEffect)(()=>{Vt()},[]),(0,H.useEffect)(()=>{d.current||S.current||Y.frames.length>0&&ct(Y.history,Y.frames)},[Y.frames,Y.history]),(0,H.useEffect)(()=>{if(!(Y.frames.length===0||Y.busy))return p(Dp.preload)},[Y.frames.length,Y.busy]),(0,H.useEffect)(()=>{if(!d.current)return;let e=x.current&&h.current===`prism`;if(!(x.current&&!e))return p(()=>Promise.all([Kp.preload(),yi()]).then(()=>void 0),e?300:2500)},[]);let Ei=(0,H.useMemo)(()=>Y.frames.map((e,t)=>({index:t,label:e.question||`Answer ${t+1}`,spec:e.spec})),[Y.frames]),Di=(0,H.useCallback)(e=>{if(e.length){if(!bn().styleAsked&&En().length===e.length){Tt({count:e.length,deck:e[0].deck}),Ot.current&&clearTimeout(Ot.current),Ot.current=setTimeout(()=>{xn(),Tt(null)},12e3);return}yt({count:e.length,ids:e.map(e=>e.id)}),bt.current&&clearTimeout(bt.current),bt.current=setTimeout(()=>yt(null),6e3)}},[]),Oi=(0,H.useCallback)(e=>{Ot.current&&clearTimeout(Ot.current),e?Sn(e):xn(),Tt(null)},[]);(0,H.useEffect)(()=>()=>{bt.current&&clearTimeout(bt.current),Ot.current&&clearTimeout(Ot.current)},[]),(0,H.useEffect)(()=>{if(!e.autoSaveFlashcards)return;let t=Y.frames[Y.frames.length-1];if(!t)return;let n=Il(t.spec.blocks);n.length>0&&Di(wn(n,{deck:t.spec.topic||t.spec.title||`General`,origin:`auto`}))},[Y.frames,e.autoSaveFlashcards,Di]);let ki=(0,H.useCallback)(t=>{let n=Y.viewSpec??Y.spec,r=n?.topic||n?.title||`General`,{cards:i,exact:a}=ql(t),o={ts:Date.now(),...t.id?{blockId:t.id}:{},...we?{question:we}:{},...n?.topic?{topic:n.topic}:{}},s=Ft(e),c=!!s.apiKey;mt({block:t,initial:i,deck:r,source:o,enrich:!a&&c?()=>Zl(t,s):void 0})},[Y.viewSpec,Y.spec,we,e]),Mi=(0,H.useRef)(null),Ni=(0,H.useRef)(null),Pi=(0,H.useRef)(()=>{}),Fi=(0,H.useRef)([]),Ri=(0,H.useRef)(()=>{}),qi=(0,H.useRef)(()=>{});Ri.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;Fi.current.forEach(e=>window.clearTimeout(e)),Fi.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++)Fi.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,H.useEffect)(()=>{let e=Fi.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]);let Ji=(0,H.useRef)(()=>{}),Yi=(0,H.useRef)(null),Xi=(0,H.useRef)(null),Zi=(0,H.useRef)(null),ea=(0,H.useRef)(!1),ta=(0,H.useRef)(null),na=(0,H.useRef)(!1),ra=(0,H.useRef)(null),[ia,aa]=(0,H.useState)(!1),[oa,sa]=(0,H.useState)(!1),ca=(0,H.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]),la=(0,H.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]),ua=(0,H.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]),[pa,ma]=(0,H.useState)([]),ga=(0,H.useRef)(Date.now()),_a=(0,H.useRef)(null),va=(0,H.useRef)(null),ya=(0,H.useCallback)(e=>{va.current=e,_a.current??=requestAnimationFrame(()=>{_a.current=null,va.current!=null&&Ce(va.current)})},[]);(0,H.useEffect)(()=>()=>{_a.current!=null&&cancelAnimationFrame(_a.current)},[]),(0,H.useEffect)(()=>{ma([]),ga.current=Date.now()},[Y.turn]);let[ba,xa]=(0,H.useState)(!1);(0,H.useEffect)(()=>xa(!1),[Y.turn]);let[Sa,Ca]=(0,H.useState)(()=>new Set);(0,H.useEffect)(()=>Ca(new Set),[Y.turn]);let[wa,Ta]=(0,H.useState)(!1);(0,H.useEffect)(()=>{let e=Mi.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>Ta(e.clientWidth>=1280),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[Y.turn]);let Ea=(0,H.useMemo)(()=>pa.filter(e=>e.noteText&&!Sa.has(e.spot)).map(e=>({spot:e.spot,text:e.noteText})),[pa,Sa]),{bookmarks:Da,toggleBookmark:Oa}=Jf(),ka=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!ba)return;function e(e){ka.current&&!ka.current.contains(e.target)&&xa(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[ba]);let Aa=(0,H.useRef)(Y.spec);Aa.current=Y.spec;let ja=(0,H.useCallback)((e,t,n,r,i,a,o,s)=>{e&&ma(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?Aa.current?.blocks.find(t=>t.id===e)??null:null,u=n?.kind===`connect`&&typeof n.onIndex==`number`?Aa.current?.blocks[n.onIndex]?.id:void 0,d={spot:e,line:t??(l?Me(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]})},[]),Ma=e.teachMode||Tc(we),Na=(0,H.useRef)(e.annotationsEnabled);Na.current=e.annotationsEnabled;let Pa=(0,H.useRef)(J);Pa.current=J;let Fa=(0,H.useRef)(null);Fa.current=Y.narration??null;let Ia=(0,H.useRef)(!1),La=(0,H.useRef)(Y.frames);La.current=Y.frames;let Ra=(0,H.useRef)([]),za=(0,H.useCallback)(()=>{let e=!Na.current;Lt({annotationsEnabled:e,teachMode:e}),e?(ma(Ra.current),Ra.current=[]):ma(e=>(Ra.current=e,[]))},[]),Ba=(0,H.useRef)(null),Va=(0,H.useCallback)((e,t)=>{let n=Ni.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=Mi.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`)),Ba.current!=null&&window.clearTimeout(Ba.current),Ba.current=window.setTimeout(()=>{o.forEach(e=>e.classList.remove(`ink-jump-glow`)),Ba.current=null},800)},[]);(0,H.useEffect)(()=>()=>{Ba.current!=null&&window.clearTimeout(Ba.current)},[]);let Ha=(0,H.useRef)(null),Ua=(0,H.useCallback)((e,t)=>{Y.jumpTo(e),t&&(Ha.current!=null&&cancelAnimationFrame(Ha.current),Ha.current=requestAnimationFrame(()=>{Ha.current=null,Va(t)}))},[Y,Va]);(0,H.useEffect)(()=>()=>{Ha.current!=null&&cancelAnimationFrame(Ha.current)},[]);let Wa=(0,H.useCallback)(e=>{Ca(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[Ga,Ka]=mr(),[qa,Ja]=(0,H.useState)(0),Ya=(0,H.useRef)(Ga);Ya.current!==Ga&&(Ya.current=Ga,Ja(e=>e+1));let Xa={isBusy:()=>Y.busy||na.current,isSpeaking:()=>ge(),hasCanvas:()=>!!Y.spec,showFrame:(e,t)=>{B(t),D(``),Y.showFrame(e,t,{interrupt:!1,revealNow:di.current})},typeInto:D,speak:e=>(oc(e),pi(e)),cancelSpeech:Se,setMuted:Fe,setViewMode:Ka,setInkArmed:ce,setPresenting:yn,setShareOpen:Re,setPaletteOpen:e=>e?Jr():Yr(),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=Aa.current?.blocks.find(e=>!!e.id);e&&Jo(e)},pinFirstBlocks:e=>{oe((Aa.current?.blocks??[]).filter(e=>!!e.id).slice(0,e))},startWatchThinking:()=>{Er(!0),Dr.current=!0},bankThought:e=>{Or.current=[...Or.current,e],K.onTranscript(Or.current.join(` `))},openAtlas:()=>{if(An().length<3){for(let e of[`money`,`space`,`travel`,`budget`]){let t=yr(e),n=t?.frames[0]?.spec;t&&n&&on(n,t.question)}Jt(kn(sn()))}Kt(!0)},openPrism:e=>{yi().then(t=>{eo.current.chapter?.action.kind===`prism`&&en(t[e]??null)})},showcaseFeature:e=>{if(e===`library`&&sn().length<3)for(let e of[`money`,`space`,`travel`]){let t=yr(e),n=t?.frames[0]?.spec;t&&n&&on(n,t.question)}if(e===`deepzoom`){window.location.hash=`#/deepzoom?demo=1`;return}if(e===`synthesis`){window.location.hash=`#/synthesis?demo=1`;return}Za.current[e]?.run()},setSpot:e=>Y.setSpot(e),scriptedMark:()=>Pi.current(),drawPenTourStep:e=>{Na.current||(Na.current=!0,Lt({annotationsEnabled:!0,teachMode:!0})),e===`result`?(Mi.current?.scrollTo({top:0,behavior:`smooth`}),ja(`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)):ja(`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&&(Na.current||(Na.current=!0,Lt({annotationsEnabled:!0,teachMode:!0})),Mi.current?.scrollTo({top:0,behavior:`smooth`}),ja(e.id,e.note,void 0,!0,void 0,3200))},openDashboards:()=>{let e=Si();e?Ke(e):He(!0)},dashboardShowSettings:()=>$e(!0),openModelSettings:()=>{Wr(`model`),Hr(!0)},openExport:()=>Be(!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:()=>Ir(e=>!e),bendIt:()=>Ri.current(),openFlashcards:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e&&ki(e)},openTourCourse:()=>qi.current(),fireMemoryGlow:()=>{Br(!0),window.setTimeout(()=>Br(!1),2600)},stopRevealWalk:()=>{ea.current=!0},closeAllOverlays:()=>{Y.setSpot(null),oe([]),D(``),Ka(`everything`),ce(!1),Ji.current(),ma([]),Ca(new Set),xa(!1),yn(!1),Re(!1),Yr(),un(null),Kt(!1),Qt(null),en(null),nn(null),mt(null),gn(!1),Ut(!1),Be(!1),He(!1),Ke(null),$e(!1),Ir(!1),Mt(!1),Rt(!1),Hr(!1),Er(!1),br(!1),Mo(null),Po(0),Io(null)}},Za=(0,H.useRef)({}),Qa=Ur({active:d.current,startChapter:h.current,solo:x.current,ops:Xa}),$a=hi({active:!!S.current,personaId:S.current,startStep:w.current,ops:Xa}),eo=(0,H.useRef)(Qa);eo.current=Qa,(0,H.useEffect)(()=>{if(!d.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 to=(0,H.useRef)($a);to.current=$a,(0,H.useEffect)(()=>{if(!S.current)return;let e=e=>{let t=to.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:no,narratingId:ro}=ar({takeWheel:()=>{ea.current=!0},hush:Se,moveSpot:e=>{Y.setSpot(e.id??null),Na.current&&ja(e.id,e.note??(e.id?ca.get(e.id):void 0)??void 0,e.id?la.get(e.id):void 0,!0)},canSpeak:()=>!di.current,lineFor:e=>e.noteSpoken??e.note??(e.id?ca.get(e.id):void 0)??Ne(e),speakLine:pi},Y.turn),[io,oo]=(0,H.useState)(!1),[so,co]=(0,H.useState)(!!mi||!!l.current&&Zo()||!!u.current&&Zo()||d.current||!!S.current),lo=hn();(0,H.useEffect)(()=>{Jt(kn(lo))},[lo]),(0,H.useEffect)(()=>{let e=Y.spec;if(!e||ta.current===Y.turn)return;if(ta.current=Y.turn,mi&&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=gt(e.blocks,{opener:Y.narration,tour:t,maxStops:5}):ht({blockCount:e.blocks.length,mode:Y.mode,hasModelTour:!1,teach:Ma})&&(n=gt(e.blocks,{opener:Y.narration,maxStops:Ma?e.blocks.length:3,startId:Y.spot??void 0})),!n.length){Y.spot&&Y.setSpot(null);return}let r=t.length>0,i=di.current&&r&&Na.current;aa(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(di.current){if(Na.current){let e=_o({stops:a,spokenWalk:r,withNotes:i,teach:Ma,marksById:ua});for(let t of e)ja(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}Y.setSpot(null);return}ea.current=!1,na.current=!0;let o=!1,s,c,l=0,u=null,f=()=>{u&&=(u(),null)},p=()=>{na.current=!1,ra.current=null,c&&clearTimeout(c),sa(!1),oc(null)},m=()=>o?!0:ea.current?(p(),Y.setSpot(null),!0):!1,h=(e,t)=>{if(e!==void 0&&Y.setSpot(e??null),r&&t&&oc(t),e&&Na.current){let n=ua.get(e);if(n?.length){let r=ao+(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;ja(e,t,n[a],Ma,o,s,i?a+1:void 0)}}else Ma&&ja(e,t,void 0,Ma)}},g=e=>{let t=e&&!di.current&&!Ae()?Le(e):null;if(!t){b();return}u=t.release,bo(t,{speakLine:pi,isCancelled:()=>o,isDismissed:()=>ea.current},e=>{if(u=null,e===`dismissed`){p(),Y.setSpot(null);return}e!==`cancelled`&&b()})},_=e=>{let t=e.set&&`spot`in e.set?e.set.spot:void 0,n=e.set&&`caption`in e.set?e.set.caption:void 0;return(t?ca.get(t):void 0)??n},v=e=>{for(let t=e+1;t<n.length;t++){let e=_(n[t]);if(e){be(e,`mavea`);return}}},y=async(e,t,n,r,i)=>{let a=e.ms??1700;if(t===0||!i){if(h(n,r),v(t),await Ui({floorMs:ji,capMs:zi(a)}),m())return;g(n);return}let o=pi(i),s=await Vi(o);m()||(h(n,r),v(t),s?await Hi(o,a):await Bi(a),!m()&&g(n))},b=()=>{if(o||l>=n.length){p();return}if(ea.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=_(t);r?y(t,e,a,i,c):(h(a,i),s=setTimeout(b,t.ms??0))};return ra.current=()=>{if(o=!0,s&&clearTimeout(s),f(),Se(),Na.current){let e=_o({stops:a,from:l,spokenWalk:r,withNotes:!1,teach:Ma,marksById:ua});for(let t of e)ja(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}p(),Y.setSpot(null)},(async()=>{c=setTimeout(()=>{o||sa(!0)},600);let t=Mi.current;await Wi({loadFams:()=>Ee(De(e.blocks)),settle:t?()=>tt(t,{timeoutMs:Ii,perImageMs:Li}):void 0,firstLine:fi.current,wantVoice:!di.current&&ve()!==!1}),c&&clearTimeout(c),sa(!1),!m()&&b()})(),()=>{o=!0,ra.current=null,na.current=!1,s&&clearTimeout(s),c&&clearTimeout(c),sa(!1),f()}},[Y.turn]),(0,H.useEffect)(()=>{let e=Y.spot,t=Y.spec;if(!t||!e)return;let n=0,r=0,i=()=>{let a=Mi.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=ua.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,ua]);let uo=(0,H.useCallback)(()=>{Y.spot&&(ea.current=!0,Y.setSpot(null))},[Y]),po=(0,H.useCallback)(()=>{let e=ra.current;e?e():(Se(),uo())},[uo]),[mo,ho]=(0,H.useState)(!1),[go,vo]=(0,H.useState)(!1),yo=(0,H.useCallback)(async(...e)=>{(0,Xn.flushSync)(()=>ho(!0)),vo(!0);try{await Ee(De(e[0].blocks))}catch{}finally{vo(!1)}Y.restore(...e)},[Y]);(0,H.useEffect)(()=>{ho(!1)},[Y.turn]),(0,H.useEffect)(()=>{if(!Y.spot)return;let e=e=>{e.key===`Escape`&&po()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Y.spot,po]);let[xo,So]=(0,H.useState)(null);(0,H.useEffect)(()=>So(null),[Y.turn]),(0,H.useEffect)(()=>Qr(!1),[Y.turn]),(0,H.useEffect)(()=>oe([]),[Y.turn]),(0,H.useEffect)(()=>Pr(!1),[Y.turn]);let[Co,wo]=(0,H.useState)(null),To=(0,H.useRef)(!1),Eo=(0,H.useCallback)(e=>{To.current=!0,wo(e)},[]);(0,H.useEffect)(()=>{if(To.current){To.current=!1;return}wo(null)},[Y.turn]);let Do=(()=>{let e=Y.spec?.blocks.find(e=>e.type===`insight`);return e&&e.type===`insight`?e.props.conf:void 0})(),Oo=sl({resetKey:Y.turn,onCommit:e=>{let{intents:t,blocks:n}=fl(e,(Y.viewSpec??Y.spec)?.blocks??[]);if(!t.length)return;let r=dl([...ae,...n]);oe([]),Y.run(ul(t),void 0,r.length?r:void 0,void 0,t)}});Pi.current=()=>{let e=Ni.current,t=e?.querySelector(`[data-spot-id]`);!e||!t||(t.scrollIntoView({block:`center`,behavior:`smooth`}),window.setTimeout(()=>ko(e,t),560))};let ko=(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=Hf(r,i);Oo.onStroke(a,{stage:e,svgRect:i});let o=t.getAttribute(`data-spot-id`);o&&Y.setSpot(o)};Ji.current=()=>Oo.clear();let Ao=(0,H.useCallback)((t,n=!1)=>{let r=t.trim();if(Dr.current&&r){D(``),Or.current=[...Or.current,r],K.onTranscript(Or.current.join(` `));return}if(r&&(/^diff --git /m.test(r)||/^@@ .* @@/m.test(r))){let t=Nn(Mn(r));if(t.changes.length>0){D(``),un(t);let n=Ft(e);n&&Pn(t,r,n).then(e=>un(t=>t&&e));return}}if(!r&&O.length===0&&Oo.intents.length===0)return;Ce(null),B(r||null),D(``);let i=O;ne(i.length>0),k([]),F(null);let a=Y.viewSpec??Y.spec,{intents:o,blocks:s}=fl(Oo.intents,a?.blocks??[]),c=dl([...ae,...s]);oe([]),Oo.clear(),Y.run(r||ul(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,ae,Oo,K,e,Ce,k,F,ne]);(0,H.useEffect)(()=>{if(l.current&&Zo()){let e=l.current;l.current=``,Ao(e)}},[]);let[jo,Mo]=(0,H.useState)(null),[No,Po]=(0,H.useState)(0),[Fo,Io]=(0,H.useState)(null),Lo=(0,H.useRef)(null),Ro=(0,H.useCallback)((e,t)=>{let n=e.lessons[t];if(!n)return;let r=zn(e.id);Mo(e),Po(t),Io(r),Rn(e.id,t),co(!0);let i=`Lesson ${t+1}: ${n.title}`,a=Fn(e.id,n.id);if(a){B(i),Y.showFrame(a,i);return}let o=Kn(e,t,r,Jn(e.topic));Lo.current={courseId:e.id,lessonId:n.id,framesBefore:Y.frames.length},B(i),Y.run(`Teach this lesson: "${n.title}" — ${n.goal}`,void 0,void 0,void 0,void 0,i,void 0,{lesson:o})},[Y]);qi.current=()=>{let e=tu();if(!e)return;let t=e.lessons[0];Mo(e),Po(0),Io(zn(e.id)),Rn(e.id,0),co(!0);let n=Fn(e.id,t.id);if(n){let e=`Lesson 1: ${t.title}`;B(e),Y.showFrame({...n,narration:``,tour:[]},e,{interrupt:!1})}},(0,H.useEffect)(()=>{let e=u.current;if(!e||(u.current=void 0,!Zo()))return;let t=Vn(e.courseId);t&&Ro(t,Math.min(Math.max(e.lessonIdx,0),t.lessons.length-1))},[]),(0,H.useEffect)(()=>{let e=Lo.current;!e||Y.busy||(Lo.current=null,!(Y.frames.length<=e.framesBefore)&&Hn(e.courseId,e.lessonId,Y.frames[Y.frames.length-1]))},[Y.frames,Y.busy]);let zo=(0,H.useCallback)(e=>{if(!jo)return;let t=jo.lessons[No];t&&(Ln(jo.id,t.id,e),Io(zn(jo.id)))},[jo,No]);(0,H.useEffect)(()=>{if(typeof window>`u`||!jo)return;let e=()=>Io(zn(jo.id));return window.addEventListener(Un,e),()=>window.removeEventListener(Un,e)},[jo]);let[Bo,Vo]=(0,H.useState)(null);(0,H.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.missedCards.length&&Vo(t)};return window.addEventListener(Yn,e),()=>window.removeEventListener(Yn,e)},[]);let Ho=(0,H.useCallback)(e=>{let t=e.missedCards.flatMap(t=>wn([t],{deck:e.courseTitle,tags:[e.lessonTitle,`checkpoint`],source:{question:t.front,topic:e.topic,ts:e.at},origin:`auto`}));Vo(null),Di(t)},[Di]),Uo=(0,H.useMemo)(()=>new Set(ae.map(e=>e.id)),[ae]),Wo=(0,H.useCallback)((e,t)=>{B(`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]),Go=(0,H.useCallback)(e=>{let t=e.map(Me),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.`;B(`Fuse: ${t.join(` × `)}`),oe([]),Y.run(n,void 0,e,void 0,void 0,`Fuse: ${t.join(` × `)}`)},[Y]),Jo=(0,H.useCallback)(e=>{e.id&&(oe(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e]),ti(e=>e+1),he())},[he]),Yo=ae.length>1?[`How do these relate?`,`Compare them`,`Summarize these`]:[`Explain this`,`Why it matters`,`Go deeper`],Xo=qe(e.provider).capabilities.vision;(0,H.useEffect)(()=>{let e=e=>{if(of(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(),re(n),D(af),ti(e=>e+1);return}let r=t.getData(`text/plain`);r&&nf(r)&&(e.preventDefault(),D(rf(tf(r))),ti(e=>e+1))},t=null,n=e=>{e.dataTransfer?.types.some(e=>e===`Files`||e===`text/uri-list`)&&(e.preventDefault(),ai(!0),t&&clearTimeout(t),t=setTimeout(()=>ai(!1),200))},r=e=>{ai(!1);let t=e.dataTransfer;if(!t)return;if(of(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:tf(t.getData(`text/uri-list`)||t.getData(`text/plain`)||``);!n.length&&!a||(e.preventDefault(),r.length?(re(r),D(af)):i.length?re(i):a&&D(rf(a)),ti(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)}},[re]);let Qo=(0,H.useRef)(Ga);Qo.current=Ga,(0,H.useEffect)(()=>{if(!vn)return;let e=Qo.current;Ka(`focus`),document.documentElement.requestFullscreen?.().catch(()=>{});let t=e=>{e.key===`Escape`&&yn(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t),Ka(e),document.fullscreenElement&&document.exitFullscreen().catch(()=>{})}},[vn,Ka]);let $o=(0,H.useRef)(0);(0,H.useEffect)(()=>{let e=Y.frames.length;if(e>$o.current&&In.current){let t=e-1;rr(e=>new Set(e).add(t))}$o.current=e},[Y.frames.length]);let X=Ai({mode:J?`vad`:`webspeech`,onBargeIn:()=>{po(),Ia.current=!0},onResult:e=>{let t=e.transcript.trim(),n=Ia.current;if(Ia.current){Ia.current=!1;let e=Fa.current;if(!t||Xp(t)){e&&pi(e);return}}if(t){if(Ce(t),Dr.current){Or.current=[...Or.current,t],Ce(null),K.onTranscript(Or.current.join(` `));return}if(xr.current){if(Zd(t)){br(!1);let e=Sr.current;if(Sr.current=[],wr(0),e.length){let t=Math.round((Date.now()-Tr.current)/6e4);B(`Your thinking, sorted`),Y.run($d(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}}else Qd(t)&&(Sr.current=[...Sr.current,t],wr(e=>e+1));return}if(!er({phase:Ci.current,activeKey:wi.current,blanks:Ti.current,fill:Y.fill},t)){if(kr&&ud(t)){Er(!0),Dr.current=!0,Or.current=[...Or.current,t],Ce(null),K.onTranscript(Or.current.join(` `));return}Ao(t,n)}}},onStateChange:e=>{ye(e.phase===`listening`),e.phase===`idle`&&(Ia.current=!1),e.phase===`listening`?(ke(null),e.transcript&&ya(e.transcript),jr.current!==null&&(window.clearTimeout(jr.current),jr.current=null)):e.phase===`idle`&&Dr.current&&(jr.current!==null&&window.clearTimeout(jr.current),jr.current=window.setTimeout(()=>{jr.current=null;let e=Or.current.join(` `).trim();e&&Ar.current.phase===`listening`&&Ar.current.onSpeechEnd(e)},np)),e.error===`not-allowed`?ke(Wf):e.error===`unsupported`?ke(Uf):e.error===`audio`&&ke(Gf)}}),Z=X.capabilities.stt;ui.current=X;let es=(0,H.useCallback)(()=>{z&&!J&&X.stop(),jr.current!==null&&(window.clearTimeout(jr.current),jr.current=null),Ce(null),Er(!1)},[z,J,X]),ts=vn||Vf({paletteOpen:qr,shareOpen:Ie,exportOpen:ze,dashOpen:Ve,showSettings:Vr,proofOpen:Xr,showHow:io,replayAt:xo,recapOpen:Nt,atlasOpen:Wt,rehearsalOpen:mn,delegateOpen:zt,srsOpen:jt,zoomLevel:ir,mindViewOpen:dn.open});(0,H.useEffect)(()=>{if(!G||K.phase===`idle`||ts)return;let e=e=>{e.key===`Escape`&&es()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[G,K.phase,ts,es]),(0,H.useEffect)(()=>{let e=document.documentElement;return Mr?e.dataset.whisper=``:delete e.dataset.whisper,le(Mr?_n:1),()=>{delete e.dataset.whisper,le(1)}},[Mr]),(0,H.useEffect)(()=>{W?Tr.current=Date.now():(Sr.current=[],wr(0))},[W]),(0,H.useEffect)(()=>{if(G&&z&&xe){let e=qu(xe),t=Or.current.length>0?[...Or.current,e].join(` `).trim():e;t&&K.onTranscript(t)}},[xe,z,G]),(0,H.useEffect)(()=>{G||(Or.current=[],K.reset(),jr.current!==null&&(window.clearTimeout(jr.current),jr.current=null))},[G]),(0,H.useEffect)(()=>()=>{jr.current!==null&&window.clearTimeout(jr.current)},[]),(0,H.useEffect)(()=>{if(!J)return;let e=0,t=()=>{ge()||X.setMaveaSpeaking(!1),e=window.setTimeout(t,200)};return t(),()=>window.clearTimeout(e)},[J,X]);let ns=T.trim().length>0;(0,H.useEffect)(()=>{if(!tr({alwaysOn:J,sttOk:Z,composerHasText:ns}))return;let e=!1,t=setTimeout(()=>{e||X.start({inCanvas:!!Y.spec})},100);return()=>{e=!0,clearTimeout(t),X.stop()}},[J,Z,X,ns]),nr({alwaysOn:J,sttOk:Z,composerHasText:ns,listening:z},{start:()=>X.start({inCanvas:!!Y.spec}),stop:X.stop});let rs=(0,H.useCallback)(()=>{if(!Z){ke(Uf),ti(e=>e+1);return}z?X.stop():(Se(),X.start({inCanvas:!!Y.spec}))},[Z,z,X,Y.spec]),[is,as]=(0,H.useState)(!1),os=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=()=>{os.current!==null&&(window.clearTimeout(os.current),os.current=null)};if(Y.status===`thinking`){as(!0),e();return}if(Y.status===`idle`){as(!1),e();return}if(is&&Y.spec){as(!1),e();return}is&&os.current===null&&(os.current=window.setTimeout(()=>{as(!1),os.current=null},1100))},[Y.status,Y.spec,is]),(0,H.useEffect)(()=>()=>{os.current!==null&&window.clearTimeout(os.current)},[]);let ss=da({speak:pi,cancelSpeak:Se,isSpeaking:ge,muted:V,turnCount:Y.frames.length,gates:{atRest:Y.status===`showing`||Y.status===`idle`,busy:Y.busy,listening:z,introHold:is,hasCanvas:!!Y.spec,modalOpen:qr||Ie||ze||Ve||Vr||Xr||io||xo!==null||Nt||zt||jt||Wt||Zt!==null||tn!==null||mn||dn.open||ir!==null}}),cs=ss.interjecting,ls=(0,H.useRef)(null),us=(0,H.useMemo)(()=>{let e=Qi(Y.spec);return e===`warm`&&$i(Y.spec)&&(ls.current===null||ls.current===Y.spec)&&(ls.current=Y.spec,e=`celebrate`),Ki(Y.status,z,cs,e,V)},[Y.status,z,cs,Y.spec,V]),ds=(0,H.useMemo)(()=>Bs({status:Y.status,listening:z,interjecting:cs,spec:Y.viewSpec??Y.spec}),[Y.status,z,cs,Y.viewSpec,Y.spec]);(0,H.useEffect)(()=>(Fs(document,ds),()=>Is(document)),[ds]);let fs=(0,H.useCallback)(()=>{let e=Yi.current,t=Xi.current,n=Zi.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,H.useLayoutEffect)(()=>(fs(),window.addEventListener(`resize`,fs),()=>window.removeEventListener(`resize`,fs)),[fs]),(0,H.useLayoutEffect)(()=>{fs()},[Fr,fs]);let ps=!!Y.spec&&!(is||cs),ms=so,hs=so&&(!Y.spec||is||cs),gs=!Y.spec&&!so;(0,H.useEffect)(()=>{if(!e.morningBrief||kt||gs||Y.busy||Y.restored||!Tl(pt()))return;El(),At(!0);let t=Y.frames.slice(-3).map(e=>e.question).filter(Boolean);Y.run(Dl(t),void 0,void 0,void 0,void 0,`Morning brief`)},[e.morningBrief,gs,kt,Y.busy,Y.restored]),(0,H.useEffect)(()=>{ps&&Yi.current&&(Yi.current.style.setProperty(`--scroll-dock`,`0`),fs())},[ps,fs]);let _s=cs?ss.line:Y.narration,vs=!ps&&!!_s&&(cs||Y.status===`speaking`||Y.status===`showing`),ys=hs&&Y.status===`speaking`,bs=(0,H.useRef)(new Map),[xs,Ss]=(0,H.useState)(0);(0,H.useEffect)(()=>{let e=bs.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 Ht(`${t.question} ${t.narration} ${t.spec?.title??``}`.trim());if(i)return;r&&(e.set(t.at,r),n=!0)}n&&Ss(e=>e+1)})(),()=>{i=!0}},[Y.frames]);let Cs=(0,H.useMemo)(()=>vt(Y.frames,Y.frames.map(e=>bs.current.get(e.at)??null)),[Y.frames,xs]),ws=Y.frames.length-1,Ts=Y.viewIndex??ws,Es=Y.viewOverride!=null,Ds=!Es&&(Y.viewIndex==null||Y.viewIndex===ws),Os=Y.viewOverride?Cs.find(e=>Y.viewOverride?.id===`thread-`+e.id):void 0,ks=Cs.find(e=>e.moments.some(e=>e.frameIndex===Ts)),As=Cs.length>=2?ks?.color:void 0,Ns=Y.frames[ws],Ps=Cs[Cs.length-1],Ls=Cs.length>=2&&Ps?.moments.length===1&&Ps.moments[0].frameIndex===ws,Rs=Ds&&!Y.busy&&Ls&&Ns?.mode===`replace`&&!!Ns&&bs.current.has(Ns.at),[zs,Vs]=(0,H.useState)(null),Us=(0,H.useRef)(-1);(0,H.useEffect)(()=>{Rs&&Us.current!==ws&&(Us.current=ws,Vs(ws))},[Rs,ws]);let Ws=(0,H.useCallback)(e=>{let t=ha(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),Mi.current?.scrollTo({top:0}))},[Y]),Gs=Ds&&ae.length===0?(Y.viewSpec??Y.spec)?.suggests??[]:[],Ks=Y.viewSpec??Y.spec,qs=Es?Ks?{question:null,narration:Ks.title||`This thread`}:null:gc({spec:Ks,frames:Y.frames,viewIndex:Y.viewIndex,narration:Y.narration,lastAsk:we}),Ys=(0,H.useMemo)(()=>Zs(Ks),[Ks]),Xs=vc(_c(Y.status)),Qs=(0,H.useMemo)(()=>Y.busy?Y.status===`showing`?[Bf(Y.pendingShape)]:zf(we??``,Y.history):[],[Y.busy,Y.status,Y.pendingShape,we,Y.history]),ec=Cf(),nc=Mf(),rc=(0,H.useSyncExternalStore)(pu,mu,mu),[ic,oc]=(0,H.useState)(null);(0,H.useEffect)(()=>oc(null),[Y.turn]),(0,H.useEffect)(()=>aa(!1),[Y.turn]);let sc=ec&&!V,[cc,lc]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(sc){lc(!0);return}let e=window.setTimeout(()=>lc(!1),600);return()=>window.clearTimeout(e)},[sc]),(0,H.useEffect)(()=>{V&&ra.current?.()},[V]);let[dc,fc]=(0,H.useState)(!1);(0,H.useEffect)(()=>fc(!1),[Y.turn]),(0,H.useEffect)(()=>Rt(!1),[Y.turn]);let pc=(0,H.useMemo)(()=>mf(Y.frames,Cs),[Y.frames,Cs]),mc=St(),yc=Et(),bc=(0,H.useCallback)(e=>{if(d.current){eo.current.playExtra(e);return}Y.busy||r(e)},[Y.busy]),xc=(0,H.useCallback)(e=>{if(!Z){ke(Uf);return}si.current===null&&(si.current=J),oi(!0),e===`think`?Er(!0):br(!0)},[Z,J]);(0,H.useEffect)(()=>{if(G||W)return;let e=si.current;e!==null&&(si.current=null,oi(e))},[G,W]);let Q={atlas:{available:qt>0,reason:`Fills in as you discuss things`,run:()=>Kt(!0),preload:hp.preload},"pdf-world":{available:O.some(Ge),reason:`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map`,run:()=>{let e=O.filter(Ge);if(e.length>0){cn(e);return}ti(e=>e+1),ri(e=>e+1),F(`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map of claims.`)},preload:Pp.preload},synthesis:{available:!0,run:()=>{let e=O.filter(Ge);e.length>=2?nn(e):window.location.hash=`#/synthesis`},preload:()=>O.filter(Ge).length>=2?Ip.preload():Yp(`#/synthesis`)},ripple:{available:!0,run:()=>un(jn),preload:_p.preload},rehearse:{available:!0,run:()=>gn(!0),preload:Rp.preload},review:{available:!0,run:()=>Mt(!0),preload:Wp.preload},flashcards:{available:!0,run:()=>{window.location.hash=`#/flashcards`},preload:()=>Yp(`#/flashcards`)},courses:{available:!0,run:()=>{window.location.hash=`#/courses`},preload:()=>Yp(`#/courses`)},dashboards:{available:!0,run:()=>{window.location.hash=`#/dashboards`},preload:()=>Yp(`#/dashboards`)},gallery:{available:!0,run:()=>{window.location.hash=`#/gallery`},preload:()=>Yp(`#/gallery`)},recap:{available:!!pc,reason:`Once we've covered something`,run:()=>Rt(!0),preload:Sp.preload},present:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>yn(!0),preload:Bp.preload},track:{available:!!Y.spec,reason:`Once there is a conversation to track`,run:()=>He(!0),preload:jp.preload},share:{available:Y.frames.length>0,reason:`Once there is something to share`,run:()=>Re(!0),preload:Dp.preload},export:{available:Y.frames.length>0,reason:`Once there is an answer to export`,run:()=>Be(!0),preload:kp.preload},focus:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Ka(`focus`)},board:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Ka(`canvas`)},ink:{available:!!Y.spec,reason:`Once there is an answer to mark`,run:()=>ce(!0)},blanks:{available:!0,run:()=>ke(`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:Uf,run:()=>xc(`think`)},"just-listen":{available:Z,reason:Z?void 0:Uf,run:()=>xc(`listen`)},whisper:{available:!0,run:()=>{Wr(`you`),Kr(!0),Hr(!0)},preload:cp.preload},ghost:{available:Z&&e.quality!==`fast`,reason:Z?e.quality===`fast`?`Needs Balanced quality or higher — you're on Fast`:void 0:Uf,run:()=>xc(`listen`)},delegate:{available:!0,run:()=>Ut(!0),preload:Hp.preload},memory:{available:!0,run:()=>{Wr(`you`),Hr(!0)},preload:cp.preload},library:{available:lo.length>0,reason:`Fills in as you save conversations`,run:()=>Rr(!0),preload:wp.preload},deepzoom:{available:!0,run:()=>{let e=we??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},preload:()=>Yp(`#/deepzoom`)},"zoom-deck":{available:!!pc,reason:`Opens once there are a few answers to pull back from`,run:()=>or(`chapters`),preload:pp.preload},"morning-brief":{available:!0,run:()=>{Wr(`you`),Kr(!0),Hr(!0)},preload:cp.preload},settings:{available:!0,run:()=>{Wr(void 0),Hr(!0)},preload:cp.preload},how:{available:!0,run:()=>oo(!0),preload:rp.preload}};Za.current=Q;let wc=at.filter(e=>e.surface!==`demo`).map(e=>{let t=Q[e.id]??{available:!0,run:()=>void 0},n=e.id===`how`?xi:e.tourChapter?()=>bc(e.tourChapter):void 0;return{feature:e,available:t.available,reason:t.reason,run:t.run,preload:t.preload,watch:n}}),Ec=[{label:`New`,blurb:`Start a fresh session`,onClick:()=>{Y.reset(),ss.reset(),co(!1),ne(!1),ft()},show:!!Y.spec},{label:`Dashboard`,blurb:`Open your living dashboards`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!!Y.spec}],Dc=[{label:`Rehearse`,blurb:`Practice a conversation before it happens`,onClick:Q.rehearse.run,preload:Q.rehearse.preload,show:!0},{label:`Study`,blurb:mc>0?`${mc} card${mc===1?``:`s`} ready`:yc===`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:!!pc}],Oc=[{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}],kc=[{label:`Search all features`,blurb:`Browse Mavéa’s feature index · ${L}`,onClick:Jr,preload:ap.preload,show:!0},{label:`Atlas`,blurb:`Kept conversations and topics, as a place`,onClick:Q.atlas.run,preload:Q.atlas.preload,show:qt>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:Yt>0?`${Yt} dashboard${Yt===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:we?`Zoom from field to mechanism — "${we.slice(0,50)}${we.length>50?`…`:``}"`:`Telescope any topic from big picture to finest detail`,onClick:()=>{let e=we??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},show:!0}];Dn(Mi,(0,H.useCallback)(e=>{e===`out`&&pc&&or(`chapters`)},[pc])),(0,H.useEffect)(()=>(ue(vu),()=>ue(null)),[]),(0,H.useEffect)(()=>{Y.busy&&(gu(),cr(null),hr())},[Y.busy,Y.turn,hr]),(0,H.useEffect)(()=>hr(),[Y.viewIndex,hr]);let Ac=Y.spec?.blocks.length??0;(0,H.useEffect)(()=>{Ac>0&&_u(Ac)},[Ac]),(0,H.useEffect)(()=>{if(!Y.busy&&Y.spec){let e=yu();if(e){cr(e);let t=Y.frames.length-1;t>=0&&_r.set(t,e)}}},[ec,Y.busy,Y.spec,rc,Y.frames,_r]);let jc=(0,H.useMemo)(()=>Ds?sr:Y.viewIndex==null?null:_r.get(Y.viewIndex),[Ds,sr,Y.viewIndex,_r]),Mc=(0,H.useMemo)(()=>{if(!dr||lr===null||!jc)return null;let e=Ds?Y.spec:Y.viewSpec;if(!e)return null;let t=xu(jc,lr,Ds?Y.tour:Y.viewIndex==null?[]:Y.frames[Y.viewIndex]?.tour??[],e.blocks.length);return{...e,blocks:e.blocks.slice(0,t)}},[dr,lr,jc,Ds,Y.spec,Y.viewSpec,Y.tour,Y.viewIndex,Y.frames]),Nc=Y.error?(0,U.jsxs)(`div`,{className:`live-error`,role:`alert`,children:[(0,U.jsxs)(`div`,{className:`live-error-head`,children:[(0,U.jsx)(R.alert,{}),(0,U.jsx)(`span`,{children:`Couldn’t answer`})]}),(0,U.jsx)(`p`,{className:`live-error-msg`,children:Y.error.message}),(0,U.jsxs)(`div`,{className:`live-error-actions`,children:[(0,U.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,U.jsx)(`button`,{type:`button`,className:`live-error-btn`,onClick:()=>Hr(!0),children:`Open settings`})]})]}):null,Pc=G&&K.phase!==`idle`,Fc=Pc?(0,U.jsxs)(`div`,{className:`ms-stage-fill`,"data-phase":K.phase,children:[(0,U.jsxs)(`button`,{type:`button`,className:`ms-exit`,onClick:es,title:`Back to the conversation (Esc)`,children:[(0,U.jsx)(R.chevL,{}),`Back to conversation`]}),(0,U.jsx)(Kd,{mindShape:K,onSettled:()=>{pi(`I think this is the shape of it.`)},onConfirmUnsaid:()=>K.confirmUnsaid(),onDismissUnsaid:()=>K.dismissUnsaid(),onAction:(e,t)=>{if(e===`add-more`)Ce(null),K.resume(),!z&&Z&&X.start({inCanvas:!!Y.spec});else if(e===`not-quite`)Or.current=[],K.resume(!1),Ce(null),!z&&Z&&X.start({inCanvas:!!Y.spec});else if(e===`share`)Re(!0);else if(e===`present`)yn(!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?Xd(n,r):xe??``;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(z&&!J&&X.stop(),Ce(null),K.reset(),Er(!1),i){let t=e===`tell-apart`?`Telling them apart`:n?.center||(r===`plan`?`A plan`:`An answer`);B(t),Y.run(i,void 0,void 0,void 0,void 0,t,n??void 0,a?{freshStart:!0}:void 0)}}},liveTranscript:xe||void 0,thoughtCount:sd([Or.current.join(` `),xe??``].join(` `))})]}):null;return(0,U.jsxs)(`div`,{className:`mavea-app with-rail live-voice canvas-flat`+(ps?` face-homed`:``)+(gs?` in-wizard`:``)+(vn?` presenting`:``)+(Fr?` rail-collapsed`:``)+(Pc?` watch-thinking`:``),"data-title":Y.spec?.title??``,...vn?{"data-preso":Bn}:{},ref:Yi,children:[d.current&&(0,U.jsx)(Zr,{driver:Qa}),d.current&&Qa.done&&(0,U.jsx)($r,{onStart:bi,onReplay:xi,onPlayExtra:Qa.playExtra,hasStoredSession:gi}),S.current&&(()=>{let e=N(S.current);return e?(0,U.jsx)(_i,{driver:$a,member:e,onExit:bi}):null})(),vn&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`preso-style-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||Qn(!1)},children:[(0,U.jsxs)(`button`,{type:`button`,className:`preso-style-btn`+(Zn?` is-open`:``),onClick:()=>Qn(e=>!e),"aria-expanded":Zn,"aria-haspopup":`listbox`,children:[(0,U.jsx)(`span`,{className:`preso-swatch-sm`,style:{background:sf.find(e=>e.id===Bn)?.accent??`var(--presence)`}}),`Style`]}),Zn&&(0,U.jsx)(`div`,{className:`preso-menu`,role:`listbox`,"aria-label":`Presentation style`,children:sf.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":Bn===e.id,className:`preso-row`+(Bn===e.id?` is-active`:``),onClick:()=>{Wn(e.id),df(e.id),Qn(!1)},children:[(0,U.jsx)(`span`,{className:`preso-swatch`,style:{background:e.accent}}),(0,U.jsx)(`span`,{className:`preso-name`,children:e.label}),(0,U.jsx)(`span`,{className:`preso-desc`,children:e.description})]},e.id))})]}),(0,U.jsx)(`button`,{type:`button`,className:`present-exit`,onClick:()=>yn(!1),title:`End the presentation (Esc)`,children:`End show · Esc`}),(0,U.jsx)($,{children:(0,U.jsx)(Vp,{spec:Y.viewSpec??Y.spec,question:qs?.question??null,narration:qs?.narration??Y.narration,skinId:Bn,autoAdvanceMs:d.current?2600:void 0,onExit:()=>yn(!1)})})]}),(0,U.jsx)(`div`,{className:`presence-layer`+(ps?` corner`:hs?``:` idlehome`)+(vs?` has-caption`:``)+(zr?` is-mem-save`:``),ref:Zi,children:(0,U.jsxs)(`div`,{className:`presence-positioner`,children:[so&&(0,U.jsx)(`div`,{className:`presence-seed`,"aria-hidden":`true`},Y.turn),(0,U.jsx)(Pe,{state:us.state,emotion:us.emotion,gaze:us.gaze,muted:V})]})}),(0,U.jsx)(`div`,{className:`presence-scrim`+(ys?` show`:``)}),vs&&(0,U.jsx)(`div`,{className:`center-caption`,role:`status`,"aria-live":`polite`,children:_s}),(0,U.jsx)(xf,{activity:Y.activity,sources:Y.busy?Y.liveSources:[]}),(0,U.jsxs)(`div`,{className:`topbar`,children:[(0,U.jsxs)(`button`,{className:`brand brand-link`,type:`button`,onClick:Jp,title:`Back to the demo`,"aria-label":`Back to the demo`,children:[(0,U.jsx)(`span`,{className:`brand-dot jelly-mark`,ref:Xi}),(0,U.jsx)(`span`,{className:`brand-name`,children:`Mavéa`}),Y.spec&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`brand-sep`}),(0,U.jsx)(`span`,{className:`workspace-name`,children:Y.error?`Couldn’t answer`:Y.spec.title})]})]}),(0,U.jsxs)(`span`,{className:`live-badge`,title:`Live · ${t.label}`,"aria-label":`Live mode`,children:[(0,U.jsx)(`span`,{className:`live-dot`}),`Live`]}),(0,U.jsx)(`div`,{className:`topbar-spacer`}),(0,U.jsx)(wt,{label:`Create`,items:Ec}),(0,U.jsx)(wt,{label:`Practice`,items:Dc,badge:mc}),(0,U.jsx)(wt,{label:`Share`,items:Oc}),(0,U.jsx)(wt,{label:`Explore`,items:kc}),(0,U.jsx)(o,{onOpen:Jr,preload:ap.preload}),(0,U.jsx)(`span`,{className:`topbar-divider`,"aria-hidden":`true`}),(0,U.jsx)(Ct,{})]}),(0,U.jsx)(hc,{chapters:Cs,frames:Y.frames,currentIndex:Ts,onJump:Y.jumpTo,onReplay:Y.frames.length>0?()=>So(Y.frames.length-1):void 0,onOverview:Y.frames.length>0?()=>fc(!0):void 0,resumed:Y.restored,chatOpen:Nr,onToggleChat:()=>Pr(e=>!e),collapsed:Fr,onToggleCollapse:()=>Ir(e=>!e),onOpenPast:lo.length>0?()=>Rr(!0):void 0,onStudy:()=>Mt(!0),roomIndices:$n,bookmarks:Da,onToggleBookmark:Oa,onViewMindMap:e=>{let t=Y.frames[e];t?.mind&&pn({open:!0,spec:t.mind})},onSeeTogether:Ws}),(0,U.jsxs)(uc,{holdEnabled:Z&&!J,showHint:!1,pttKey:e.pttKey,pttSide:e.pttSide,onHoldStart:()=>X.start({inCanvas:!!Y.spec}),onHoldEnd:()=>X.forceStop?.(),onChangePttKey:e=>Lt({pttKey:e}),onChangePttSide:e=>Lt({pttSide:e}),children:[(Mr||J&&Z)&&(0,U.jsxs)(`div`,{className:`dock-modes`,role:`group`,"aria-label":`Listening modes`,children:[Mr&&(0,U.jsx)(`span`,{className:`whisper-badge`,children:`won't wake anyone`}),J&&Z&&(0,U.jsx)(`button`,{type:`button`,className:`listen-mode-chip`+(W?` on`:``),"aria-pressed":W,onClick:()=>{br(e=>!e),G&&Er(!1)},title:W?`Stop banking and go back to answering`:`Bank everything you say without answering — say "thoughts?" when you want the sort`,children:W?`Just listening · ${Cr} banked`:`Just listen`}),W&&Cr>0&&(0,U.jsx)(`button`,{type:`button`,className:`listen-mode-chip`,onClick:()=>{br(!1);let e=Sr.current;if(Sr.current=[],wr(0),e.length){let t=Math.round((Date.now()-Tr.current)/6e4);B(`Your thinking, sorted`),Y.run($d(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}},children:`Thoughts?`})]}),(W||G)&&(0,U.jsx)(Te,{kind:`voice-data`,from:`live`}),Oe&&(0,U.jsxs)(`div`,{className:`voice-notice`,role:`status`,children:[(0,U.jsx)(R.micOff,{}),(0,U.jsx)(`span`,{children:Oe}),(0,U.jsx)(`button`,{type:`button`,className:`voice-notice-x`,"aria-label":`Dismiss voice notice`,onClick:()=>ke(null),children:(0,U.jsx)(R.x,{})})]}),(O.length>0||M)&&(0,U.jsxs)(`div`,{className:`attach-strip`,role:`list`,"aria-label":`Attached files`,children:[O.map((e,t)=>(0,U.jsxs)(`span`,{className:`attach-chip`,role:`listitem`,children:[Ue(e)?(0,U.jsx)(`img`,{className:`attach-thumb`,src:`data:${e.mime};base64,${e.data}`,alt:``}):(0,U.jsx)(R.paperclip,{}),(0,U.jsx)(`span`,{className:`attach-name`,children:Je(e)}),(Ze(e)&&Xo||Ye(e)||Xe(e))&&(0,U.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:()=>Qt([e]),children:`⊹ Explode`}),(0,U.jsx)(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>ie(t),children:(0,U.jsx)(R.x,{})})]},t)),(()=>{let e=O.filter(e=>Ye(e)||Xe(e)||Ze(e)&&Xo);if(e.length<=1)return null;let t=(0,U.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:()=>Qt(e),children:[`⊹ Compare `,e.length,` documents`]},`compare`),n=(0,U.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:()=>nn(e),children:[`⊹ Synthesize `,e.length,` sources`]},`synth`);return e.length>=4?n:e.length>=3?(0,U.jsxs)(U.Fragment,{children:[t,n]}):t})(),M&&(0,U.jsx)(`span`,{className:`attach-error`,role:`status`,children:M})]}),O.length>0&&(0,U.jsx)(Te,{kind:`upload`,from:`live`}),Y.spec&&(0,U.jsx)(gl,{armed:se,pins:Oo.pins,miss:Oo.miss,onUndo:Oo.undo,onSend:Oo.send}),ae.length>0&&(0,U.jsxs)(`div`,{className:`pin-dock`,children:[(0,U.jsx)(`div`,{className:`pin-strip`,role:`list`,"aria-label":`Elements you're asking about`,children:ae.map(e=>(0,U.jsxs)(`span`,{className:`pin-chip`,role:`listitem`,children:[(0,U.jsx)(R.chat,{}),(0,U.jsx)(`span`,{className:`pin-name`,children:Me(e)}),(0,U.jsx)(`button`,{type:`button`,className:`pin-remove`,"aria-label":`Unpin ${Me(e)}`,onClick:()=>Jo(e),children:(0,U.jsx)(R.x,{})})]},e.id))}),(0,U.jsxs)(`div`,{className:`pin-suggests`,role:`list`,"aria-label":`Quick follow-ups`,children:[ae.length>=2&&(0,U.jsxs)(`button`,{type:`button`,className:`live-chip pin-fuse-chip`,disabled:Y.busy,title:`Combine these ${ae.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:()=>Go(ae),children:[`Fuse `,ae.length,` into one`]}),Yo.map(e=>(0,U.jsx)(`button`,{type:`button`,className:`live-chip`,onClick:()=>Ao(e),disabled:Y.busy,children:e},e))]})]}),(0,U.jsxs)(`div`,{className:ms?`voice-capsule`:`composer-passthrough`,children:[ms&&(0,U.jsxs)(`div`,{className:`voice-strip`,children:[cc&&!nc?(0,U.jsxs)(`button`,{type:`button`,className:`vc-status`,onClick:po,title:`Tap to stop and show the whole answer at once`,"aria-label":`Stop speaking and show the whole answer`,children:[(0,U.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]}),(0,U.jsx)(`span`,{className:`vc-status-label`,children:`Speaking`})]}):oa&&!V?(0,U.jsxs)(`div`,{className:`vc-status vc-preparing`,role:`status`,"aria-busy":`true`,children:[(0,U.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]}),(0,U.jsx)(`span`,{className:`vc-status-label`,children:`Preparing voice…`})]}):nc&&!V?(0,U.jsx)(`div`,{className:`vc-status vc-preparing vc-quiet`,role:`status`,"aria-busy":`true`,"aria-label":`Preparing voice`,children:(0,U.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]})}):null,(0,U.jsx)(`div`,{className:`vc-transcript`,"aria-hidden":`true`,children:ic??Y.narration??``}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>Fe(e=>!e),title:V?`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":!V,className:`voice-switch`+(V?` is-muted`:``),children:[V?(0,U.jsx)(R.speakerOff,{}):(0,U.jsx)(R.speaker,{}),(0,U.jsx)(`span`,{className:`voice-switch-label`,children:`Mavéa's voice`}),(0,U.jsx)(`span`,{className:`voice-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{className:`voice-switch-thumb`})})]}),(0,U.jsx)(Iu,{}),(0,U.jsx)(zu,{}),(0,U.jsxs)(`button`,{className:`live-model-chip`,onClick:()=>Hr(e=>!e),title:S.current?`The model that generated this recorded session`:Xs?`Model settings · last reply ${Xs}`:`Model settings`,children:[(0,U.jsx)(`span`,{className:`chip-dot`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`chip-model`,children:S.current?$a.model??`—`:n}),(0,U.jsx)(`span`,{className:`chip-caret`,"aria-hidden":`true`})]})]}),(0,U.jsx)(gr,{value:T,onChange:e=>{D(e)},onSend:Ao,listening:z,heard:xe,onMic:rs,placeholder:G?`Talk, or type a thought — it lands on the map…`:ae.length?ae.length>1?`Ask about the selected elements…`:`Ask about the selected element…`:`Talk, or type — anything.`,focusSignal:ei,disabled:Y.busy,onFiles:re,attachPulse:ni,attachTitle:Xo?`Attach an image or PDF`:`Attach a doc or data file to explode — ${n} can't read images/PDFs directly`,onMicDown:()=>{Z&&(Se(),X.start({inCanvas:!!Y.spec}))},onForceStop:()=>X.forceStop?.(),tools:Y.spec?(0,U.jsx)(_l,{armed:se,onToggle:ce}):void 0,micExtra:Z?(0,U.jsx)(Ms,{mode:J?`always`:ci?`hold`:`tap`,pttKey:e.pttKey,pttSide:e.pttSide,onChange:e=>{si.current=null,oi(e===`always`),li(e===`hold`),e!==`always`&&z&&X.stop()}}):void 0})]})]}),z&&!G&&(0,U.jsx)(hf,{transcript:xe,mode:J?`always`:`tap`,note:W?`Just listening · ${Math.max(1,Math.round((Date.now()-Tr.current)/6e4))}m — say "thoughts?" when you want me`:void 0}),z&&!G&&(0,U.jsx)(hd,{ghosts:vi}),Y.spec?(0,U.jsxs)(`div`,{className:`canvas-stage stage`,"data-active":`1`,ref:Ni,children:[Fc,zs!=null&&(0,U.jsx)(tc,{tint:Ps?.color,onDone:()=>Vs(null)},zs),(0,U.jsx)(`div`,{className:`canvas-scroll`,ref:Mi,onClick:Y.spot?e=>{e.target.closest(`.spotlit`)||uo()}:void 0,children:(0,U.jsxs)(`div`,{className:`topic-wrap`,children:[(0,U.jsx)(Bc,{armed:se,rootRef:Ni,onStroke:Oo.onStroke,onTap:Oo.onTap,strokes:Oo.strokes,highlights:Oo.highlights}),Nc,!Ds&&(0,U.jsxs)(`div`,{className:`viewing-past`,role:`status`,children:[Es?(0,U.jsx)(R.table,{}):(0,U.jsx)(R.clock,{}),(0,U.jsx)(`span`,{children:Es?`Viewing this thread together`:`Viewing an earlier moment`}),(0,U.jsx)(`button`,{type:`button`,className:`viewing-past-back`,onClick:()=>Es?Y.previewSpec(null):Y.jumpTo(ws),children:`Return to live`})]}),!de&&ae.length===0&&(0,U.jsxs)(`div`,{className:`ask-hint`,role:`note`,children:[(0,U.jsx)(R.chat,{}),(0,U.jsxs)(`span`,{children:[`Tap `,(0,U.jsx)(`strong`,{children:`Ask`}),` on any element to ask Mavéa about it.`]}),(0,U.jsx)(`button`,{type:`button`,className:`ask-hint-x`,"aria-label":`Dismiss tip`,onClick:he,children:(0,U.jsx)(R.x,{})})]}),jo&&(0,U.jsx)($,{children:(0,U.jsx)(bp,{course:jo,lessonIdx:No,progress:Fo??zn(jo.id),onPrev:()=>Ro(jo,No-1),onNext:()=>Ro(jo,No+1),onCheckpoint:zo,busy:Y.busy},`${jo.id}:${No}`)}),qs&&!jo&&(0,U.jsx)($s,{question:qs.question,narration:qs.narration,sources:Ks?.sources,inferred:Ys,tint:As}),go&&(0,U.jsx)(i,{label:`Opening saved answer…`,overlay:!0}),(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(`div`,{className:`canvas-loading`,role:`status`,"aria-busy":`true`,"aria-label":`Loading canvas`,children:(0,U.jsx)(`div`,{className:`skel-grid`,children:(0,U.jsx)(je,{blocks:$f})})}),children:(0,U.jsx)(Qf,{data:Mc??Y.viewSpec??Y.spec,spot:Ds?Y.spot:null,built:{},onProve:()=>Qr(!0),onAskBlock:Jo,onAddToDashboard:e=>nt({block:e,question:qs?.question??void 0}),selectedBlockIds:Uo,onNarrate:no,narratingId:ro,muted:V,viewMode:Ga,onViewMode:Ka,presenting:vn,noteGutter:Ds&&e.annotationsEnabled&&wa&&ia,walkNotes:Ds?Ea:void 0,blankFill:Ds?{values:Y.filled,activeKey:Y.activeBlank,fill:Y.fill,unfill:Y.unfill,activate:Y.setActiveBlank,complete:Y.complete,busy:Y.busy}:void 0,bend:Ds&&lr===null?Y.spec?.bend:void 0,onAddToFlashcard:ki,flashedIds:st,belowHeaderSlot:qs&&jc?(0,U.jsx)(Fu,{audio:jc,t:lr,onSeek:pr}):void 0,headerSlot:Ds?(0,U.jsxs)(`div`,{className:`pen-anchor`,ref:ka,children:[(0,U.jsx)(Cc,{enabled:e.annotationsEnabled,open:ba,inkCount:pa.length,onClick:()=>xa(e=>!e)}),ba&&(0,U.jsx)(`div`,{className:`pen-popover`,children:(0,U.jsx)(Sc,{entries:pa,turnStartMs:ga.current,annotationsEnabled:e.annotationsEnabled,hiddenSpots:Sa,onToggle:za,onKeep:()=>xa(!1),onClear:()=>{ma([]),Ca(new Set),xa(!1)},onClip:()=>Re(!0),onJumpTo:Va,onToggleSpot:Wa})})]}):void 0},Es?`thread-`+(Y.viewOverride?.id??``):Ds?`live-`+Y.replaceEpoch:`view-`+Y.viewIndex)}),Ds&&!Pc&&!mo&&(0,U.jsx)(fo,{spots:Sa.size>0?pa.filter(e=>!Sa.has(e.spot)):pa,revision:qa}),Y.busy&&Ds&&(0,U.jsxs)(`div`,{className:`working-col`,children:[(0,U.jsx)(_f,{cards:Qs}),(0,U.jsx)(bf,{thinking:Y.reasoning})]}),Ds&&!Y.busy&&(0,U.jsx)($,{children:(0,U.jsx)(fp,{chips:Y.understood,onFix:Wo})}),(0,U.jsx)(ac,{spec:Y.viewSpec??Y.spec,followups:Gs,question:we??void 0,onAsk:Ao,onTrack:()=>He(!0),onDeepZoom:we?()=>{window.location.hash=`#/deepzoom?seed=${encodeURIComponent(we)}`}:void 0,onCanvas:()=>Ka(`canvas`),onSeeAll:!Es&&ks&&ks.moments.length>=2?()=>Ws(ks):void 0,threadCount:ks?.moments.length,busy:Y.busy})]})})]}):gs?(0,U.jsxs)(U.Fragment,{children:[Fc,(0,U.jsx)(js,{seed:l.current||void 0,speak:pi,goDemo:Jp,onStart:e=>{co(!0),Ao(e)},onStartTalking:()=>{if(co(!0),!Z){ke(Uf),ti(e=>e+1);return}X.start({inCanvas:!1})},onSeeHow:()=>oo(!0),studySlot:(0,U.jsx)(jl,{onStudy:()=>Mt(!0)}),librarySlot:lo.length>0?(0,U.jsx)($,{children:(0,U.jsx)(sp,{entries:lo,onResume:e=>{co(!0),ne(!1),B(e.question??null),Eo(e.id),yo(e.spec,e.question)},onRemove:an,heading:`Pick up where you left off`,sub:`Your conversations stay on this device — tap one to step back in.`})}):void 0})]}):(0,U.jsxs)(`div`,{className:`presence-stage stage`,"data-active":`1`,children:[Fc,Nc&&(0,U.jsx)(`div`,{className:`live-error-stage`,children:Nc}),Y.busy&&(0,U.jsx)(`div`,{className:`skel-stage`,children:(0,U.jsx)(_f,{cards:Qs})})]}),ii&&(0,U.jsxs)(`div`,{className:`drop-hint`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(R.paperclip,{}),(0,U.jsx)(`span`,{children:`Drop to attach — Mavéa reads PDFs, Office docs, and data files`})]}),io&&(0,U.jsx)($,{children:(0,U.jsx)(ip,{onClose:()=>oo(!1),speak:pi,onFullTour:xi})}),qr&&(0,U.jsx)($,{children:(0,U.jsx)(op,{items:wc,surface:`live`,onClose:Yr,pinned:d.current&&Qa.chapter?.id===`palette`})}),Vr&&(0,U.jsx)(`div`,{role:`presentation`,onClick:e=>e.target===e.currentTarget&&Hr(!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,U.jsx)($,{children:(0,U.jsx)(lp,{onClose:()=>Hr(!1),initialTab:q,initialAdvancedYouOpen:Gr})})}),xo!==null&&(0,U.jsx)($,{children:(0,U.jsx)(Ep,{frames:Y.frames,initialIndex:xo,speak:pi,cancelSpeak:Se,onClose:()=>So(null)})}),Ie&&(0,U.jsx)($,{children:(0,U.jsx)(Op,{frames:Y.frames,cfg:d.current||S.current?void 0:Ft(e),onClose:()=>Re(!1),onShared:()=>ss.enqueue(`clipShared`)})}),ze&&Ei.length>0&&(0,U.jsx)($,{children:(0,U.jsx)(Ap,{answers:Ei,defaultIndex:Os?Os.moments[Os.moments.length-1].frameIndex:Ei.length-1,defaultIndices:Os?.moments.map(e=>e.frameIndex),onClose:()=>Be(!1),guided:d.current&&Qa.chapter?.action.kind===`export`})}),Ve&&(0,U.jsx)($,{children:(0,U.jsx)(Mp,{onClose:()=>He(!1),initialSourceId:Co?`lib-`+Co:void 0})}),We&&(0,U.jsxs)(`div`,{className:`cv-takeover`,role:`dialog`,"aria-modal":`true`,"aria-label":`Living dashboard`,children:[(0,U.jsxs)(`header`,{className:`cv-takeover-head`,children:[(0,U.jsxs)(`div`,{className:`cv-takeover-id`,children:[(0,U.jsx)(`span`,{className:`cv-takeover-glyph`,"aria-hidden":`true`,children:`◎`}),(0,U.jsxs)(`div`,{className:`cv-takeover-titles`,children:[(0,U.jsx)(`span`,{className:`cv-takeover-eyebrow`,children:`Living dashboard`}),(0,U.jsx)(`span`,{className:`cv-takeover-title`,children:`Investment growth · $10k at 7%`})]})]}),(0,U.jsxs)(`button`,{type:`button`,className:`cv-takeover-close`,onClick:()=>Ke(null),children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` Back to answer`]})]}),(0,U.jsx)(`div`,{className:`tour-dash-body`,children:(0,U.jsx)($,{children:Qe?(0,U.jsx)(dp,{id:We}):(0,U.jsx)(up,{id:We})})})]}),et&&(0,U.jsx)($,{children:(0,U.jsx)(Np,{block:et.block,question:et.question,conversationTitle:Y.spec?.title,onClose:()=>nt(null),onAdded:(e,t)=>it({id:e,title:t})})}),rt&&(0,U.jsx)(Hs,{dashboardId:rt.id,dashboardTitle:rt.title,onDismiss:()=>it(null)}),Y.spec&&(0,U.jsx)(Js,{open:Xr,onClose:()=>Qr(!1),claim:Y.spec.title,conf:Do,sources:Y.spec.sources??[],hadFiles:I}),dn.open&&(0,U.jsx)($,{children:(0,U.jsx)(xp,{open:!0,spec:dn.spec,onClose:()=>pn(e=>({...e,open:!1}))})}),Lr&&(0,U.jsx)($,{children:(0,U.jsx)(Tp,{entries:lo,onResume:e=>{co(!0),ne(!1),B(e.question??null),Eo(e.id),yo(e.spec,e.question),Rr(!1)},onRemove:an,onClose:()=>Rr(!1)})}),dc&&(0,U.jsx)(fa,{chapters:Cs,currentIndex:Ts,onJump:Ua,onClose:()=>fc(!1)}),ir&&pc&&(0,U.jsx)($,{children:(0,U.jsx)(mp,{model:pc,level:ir,onLevel:or,onJump:e=>{Y.jumpTo(e),or(null)},onClose:()=>or(null)})}),zt&&(0,U.jsx)($,{children:(0,U.jsx)(Up,{cfg:Ft(e),onClose:()=>Ut(!1),onPrepTurn:(e,t)=>{Ut(!1),B(t),Y.run(e,void 0,void 0,void 0,void 0,t)}})}),Nt&&pc&&(0,U.jsx)($,{children:(0,U.jsx)(Cp,{model:pc,onJump:e=>{Y.jumpTo(e),Rt(!1)},onShare:Y.frames.length>0?()=>{Rt(!1),Re(!0)}:void 0,onClose:()=>Rt(!1)})}),Wt&&(0,U.jsx)($,{children:(0,U.jsx)(gp,{records:An(),chapters:Cs,onLand:e=>{Kt(!1);let t=On(e,lo);co(!0),ne(!1),t?(B(t.question??null),Eo(t.id),yo(t.spec,t.question)):(B(e.question),Y.run(e.question))},onGoDeeper:e=>{Kt(!1),co(!0),ne(!1),B(e),Y.run(e)},autoTour:d.current,onClose:()=>Kt(!1)})}),Zt&&(0,U.jsx)($,{children:(0,U.jsx)(Fp,{pdf:Zt,cfg:Ft(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>Qt(null)})}),$t&&(0,U.jsx)($,{children:(0,U.jsx)(qp,{doc:$t,cfg:Ft(e),onClose:()=>en(null)},$t.id)}),tn&&(0,U.jsx)($,{children:(0,U.jsx)(Lp,{sources:tn,cfg:Ft(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>nn(null)})}),ln&&(0,U.jsx)($,{children:(0,U.jsx)(vp,{model:ln,cfg:Ft(e),speak:pi,showcase:d.current,onClose:()=>un(null)})}),mn&&(0,U.jsx)($,{children:(0,U.jsx)(zp,{cfg:Ft(e),memoryNodes:rn(),speak:pi,onDebrief:e=>{gn(!1),D(e)},onClose:()=>gn(!1)})}),jt&&(0,U.jsx)($,{children:(0,U.jsx)(Gp,{onClose:()=>Mt(!1)})}),dt&&(0,U.jsx)($,{children:(0,U.jsx)(yp,{mode:`add`,initial:dt.initial,deck:dt.deck,origin:`block`,source:dt.source,heading:`Flashcards from ${Me(dt.block)}`,enrich:dt.enrich,decks:Cn(),onSaved:e=>{if(e.length&&dt.block.id){let e=dt.block.id;lt(t=>new Set(t).add(e))}Di(e)},onClose:()=>mt(null)})}),Bo&&(0,U.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(R.layers,{}),(0,U.jsxs)(`span`,{className:`cards-pill-text`,children:[Bo.missedCards.length,` card`,Bo.missedCards.length===1?``:`s`,` from this checkpoint`]}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>Vo(null),children:`Dismiss`}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>Ho(Bo),children:`Add`})]}),!Bo&&xt&&(0,U.jsxs)(`div`,{className:`cards-pill is-ask`,role:`status`,"aria-live":`polite`,children:[(0,U.jsxs)(`div`,{className:`cards-pill-head`,children:[(0,U.jsx)(R.layers,{}),(0,U.jsxs)(`span`,{className:`cards-pill-text`,children:[xt.count,` card`,xt.count===1?``:`s`,` saved to “`,xt.deck,`”`]})]}),(0,U.jsxs)(`div`,{className:`cards-pill-ask`,children:[(0,U.jsx)(`span`,{className:`cards-pill-q`,children:`Want Mavéa to help you remember these?`}),(0,U.jsx)(`span`,{className:`cards-pill-sub`,children:`They’ll come back for a quick practice every so often.`}),(0,U.jsxs)(`div`,{className:`cards-pill-choices`,children:[(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>Oi(`collection`),children:`No thanks`}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>Oi(`spaced`),children:`Yes`})]})]})]}),!Bo&&!xt&&_t&&(0,U.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(R.layers,{}),(0,U.jsxs)(`span`,{className:`cards-pill-text`,children:[_t.count,` card`,_t.count===1?``:`s`,` added`]}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>{Tn(_t.ids),yt(null)},children:`Undo`}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>{window.location.hash=`#/flashcards`,yt(null)},children:`View`})]})]})}export{Zp as LiveApp};
|