@openscout/scout 0.2.86 → 0.2.90
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/README.md +10 -5
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +4 -4
- package/dist/client/assets/ActivityScreen-BUeb4ERK.js +1 -0
- package/dist/client/assets/{AddProjectForm-BNRpRPod.js → AddProjectForm-DtTfn4Zk.js} +1 -1
- package/dist/client/assets/AgentAvatar-CneOa70z.js +1 -0
- package/dist/client/assets/AgentConfigurationScreen-CkZ7EjZh.js +1 -0
- package/dist/client/assets/AgentDefinitionsWorkspace-0Y3kqMtv.js +1 -0
- package/dist/client/assets/{AgentDetailCard-FelCxQrT.js → AgentDetailCard-Dtc02KUO.js} +1 -1
- package/dist/client/assets/AgentFloorView-B5raPB_U.js +1 -0
- package/dist/client/assets/AgentInfoScreen-DFG4ElZD.js +1 -0
- package/dist/client/assets/{AgentLaneCard-CRDG74C1.js → AgentLaneCard-BRAkw8YJ.js} +1 -1
- package/dist/client/assets/{AgentLaneChrome-CWFqUdch.js → AgentLaneChrome-T8QE5742.js} +1 -1
- package/dist/client/assets/AgentLaneDetailSheet-C8RYotnv.js +4 -0
- package/dist/client/assets/{AgentLaneSummaryResize-yTM4GQAJ.js → AgentLaneSummaryResize-FyYweLo_.js} +1 -1
- package/dist/client/assets/AgentLanesEmbedScreen-Br7cmZVO.js +1 -0
- package/dist/client/assets/{AgentLanesPreflight-DJeDRTAN.js → AgentLanesPreflight-Cil3dNwu.js} +1 -1
- package/dist/client/assets/AgentLanesView-DPfO8MOo.js +2 -0
- package/dist/client/assets/{AgentLiveActions-Bn3zeZBN.js → AgentLiveActions-DwScaVRF.js} +1 -1
- package/dist/client/assets/AgentSessions-DKoWA0Lm.js +6 -0
- package/dist/client/assets/AgentsConsole-DoBIWGoq.js +1 -0
- package/dist/client/assets/AgentsScreen-JuUiSuwY.js +1 -0
- package/dist/client/assets/AgentsSubnav-BV0WAgzf.js +1 -0
- package/dist/client/assets/{AtopView-DymBCiXv.js → AtopView-ycxMrRwp.js} +1 -1
- package/dist/client/assets/BackToPicker-D6WgIDb-.js +1 -0
- package/dist/client/assets/BriefingDetailScreen-Zw-taW1s.js +6 -0
- package/dist/client/assets/{BriefingsScreen-CLvSOJjy.js → BriefingsScreen-BerYOoWS.js} +1 -1
- package/dist/client/assets/{BrokerMetadataPanel-DFAH-NO6.js → BrokerMetadataPanel-Cu93j-Ga.js} +1 -1
- package/dist/client/assets/BrokerScreen-CeN90URH.js +5 -0
- package/dist/client/assets/ChatCollapsedStrip-DdKyMSEM.js +1 -0
- package/dist/client/assets/{CodeDiffPane-C9HT1dCT.js → CodeDiffPane-BjCOBLze.js} +1 -1
- package/dist/client/assets/{CodeProjectPicker-5Y3GvXkM.js → CodeProjectPicker-NSGdCaK0.js} +1 -1
- package/dist/client/assets/{CodeScreen-DpN9kQvm.js → CodeScreen-CA9Sq6Dx.js} +1 -1
- package/dist/client/assets/ContextMenu-DnFcmfMR.js +1 -0
- package/dist/client/assets/ConversationComposer-CjRXFkvY.js +1 -0
- package/dist/client/assets/ConversationFeedRows-CgRTIpAv.js +1 -0
- package/dist/client/assets/ConversationHeader-CRmdtuL7.js +1 -0
- package/dist/client/assets/ConversationPanels-DCkcLIHk.js +2 -0
- package/dist/client/assets/ConversationScreen-Br0QQ3xo.js +1 -0
- package/dist/client/assets/ConversationScreen-yIKEsm-8.css +1 -0
- package/dist/client/assets/ConversationStatus-BJ1CMbAv.js +1 -0
- package/dist/client/assets/{DataTable-oJP339bX.js → DataTable-Dzqiaha4.js} +1 -1
- package/dist/client/assets/{DispatchAftermath-CH02HAVw.js → DispatchAftermath-B0WMg_z3.js} +1 -1
- package/dist/client/assets/DocumentFocusViewer-CZVVIAD5.js +1 -0
- package/dist/client/assets/{EmbeddableSurfacesLab-84b9I3fy.js → EmbeddableSurfacesLab-C3a7hJWO.js} +1 -1
- package/dist/client/assets/{EmptyState-BnDda92b.js → EmptyState-CYNJZMrZ.js} +1 -1
- package/dist/client/assets/{FileViewerPane-Dg7_88pv.js → FileViewerPane-Fwt8_KmD.js} +1 -1
- package/dist/client/assets/FleetSearch-Dsi_l2KW.js +1 -0
- package/dist/client/assets/FleetSearch-EXOe8ulE.css +1 -0
- package/dist/client/assets/FlightObserveScreen-g_tiGmvz.js +1 -0
- package/dist/client/assets/{FollowScreen-DcFBqr6l.js → FollowScreen-Bb_rcrzi.js} +1 -1
- package/dist/client/assets/{HarnessMark-DGZ6o6Ct.js → HarnessMark-DrE57dUq.js} +1 -1
- package/dist/client/assets/HarnessesScreen-CAsCJ_tG.js +1 -0
- package/dist/client/assets/{HerdrSession-DV2hD6Yh.js → HerdrSession-1eVu9Owj.js} +1 -1
- package/dist/client/assets/HomeHero-DEl-WBsT.css +1 -0
- package/dist/client/assets/HomeHero-W445QrG1.js +1 -0
- package/dist/client/assets/{KnowledgeSearchInspector-DNQjeWZO.js → KnowledgeSearchInspector-CbPVg3fr.js} +1 -1
- package/dist/client/assets/KnowledgeSearchScreen-C1lN1xJk.js +1 -0
- package/dist/client/assets/{LaneToolHoverCard-197xYmRp.js → LaneToolHoverCard-BkBcDYm-.js} +1 -1
- package/dist/client/assets/LaneTraceDetailSheet-CzTd44rf.js +1 -0
- package/dist/client/assets/{LaneTraceEventFocus-C9cmqxnK.js → LaneTraceEventFocus-BmMmPTyJ.js} +1 -1
- package/dist/client/assets/{MeshCanvas-C3_2p9B6.js → MeshCanvas-DwkjsiJ5.js} +2 -2
- package/dist/client/assets/{MeshCanvasMinimap-ZTjYWXTZ.js → MeshCanvasMinimap-vmCpU1sD.js} +1 -1
- package/dist/client/assets/MeshScreen-CkMepUpT.js +1 -0
- package/dist/client/assets/{MeshTopologyView-CBjHbAZw.js → MeshTopologyView-BD2xLE2C.js} +2 -2
- package/dist/client/assets/MessageComposerSuggestions-qbalTne_.js +1 -0
- package/dist/client/assets/MessagesScreen-C8UynyLC.js +1 -0
- package/dist/client/assets/{MissionContextRail-DXkrbcnZ.js → MissionContextRail-D5MEP2f4.js} +1 -1
- package/dist/client/assets/MissionControlView-K_I7eftL.js +1 -0
- package/dist/client/assets/MissionFocusOverlay-CWKLdUKG.js +1 -0
- package/dist/client/assets/MissionLeftAgentRow-ByGrNAcs.js +1 -0
- package/dist/client/assets/MissionLogPane-ZwHJ137T.js +1 -0
- package/dist/client/assets/{NewAgentModal-C18Ajovd.js → NewAgentModal-Do9aVvan.js} +1 -1
- package/dist/client/assets/NewChatComposer-DKlNX1UA.js +19 -0
- package/dist/client/assets/{NewChatOrigin-DpHS2Wmt.js → NewChatOrigin-DXPvX-hh.js} +1 -1
- package/dist/client/assets/ObserveEmbedScreen-Dghsq2on.js +2 -0
- package/dist/client/assets/ObserveTextFlow-DWNlmTVm.js +2 -0
- package/dist/client/assets/ObservedTopologyPanel-BlmGoxCE.js +2 -0
- package/dist/client/assets/OpenScoutAppShell-DDqQi-oe.js +87 -0
- package/dist/client/assets/OpsAgentsView-Bn_fGBdo.js +1 -0
- package/dist/client/assets/OpsScreen-DHnT-Q9R.js +1 -0
- package/dist/client/assets/OpsSubnav-CJRD7MjM.js +1 -0
- package/dist/client/assets/PlanView-B6gKo543.js +1 -0
- package/dist/client/assets/ProjectAgentProfile-Be1VOkI4.js +1 -0
- package/dist/client/assets/{ProjectAgentProfileBar-IDEpKZvI.js → ProjectAgentProfileBar-C5QWwZCn.js} +1 -1
- package/dist/client/assets/ProjectAgentProfileHero-DC7Dd8VL.js +1 -0
- package/dist/client/assets/ProjectsInbox-DCLrDmj1.js +2 -0
- package/dist/client/assets/ProjectsRail-C4hiXYSb.js +1 -0
- package/dist/client/assets/ProjectsScreen-jruZRjgD.js +1 -0
- package/dist/client/assets/ProjectsThreadAside-DYmL2dCY.js +1 -0
- package/dist/client/assets/Provider-p-xuaAoE.js +1 -0
- package/dist/client/assets/RailRow-Cf9LOiEj.css +1 -0
- package/dist/client/assets/RailRow-bRkkXIpR.js +1 -0
- package/dist/client/assets/RawSessionsTable-B7WKmXrk.js +1 -0
- package/dist/client/assets/RealtimeVoiceScreen-BzP3BQq9.js +1 -0
- package/dist/client/assets/{RepoDiffEmbedScreen-C97Euf4s.js → RepoDiffEmbedScreen-xjzjcJ_c.js} +1 -1
- package/dist/client/assets/{RepoDiffPageScreen-DUKLzkrW.js → RepoDiffPageScreen-DRzIY-dk.js} +1 -1
- package/dist/client/assets/RepoDiffViewer-CNDp01KM.js +7 -0
- package/dist/client/assets/RepoDiffViewerLazy-b6vjYxez.js +2 -0
- package/dist/client/assets/{ReposScreen-BR1LqTf1.js → ReposScreen-CpaLC_NU.js} +6 -6
- package/dist/client/assets/ScoutDeckSurface-DkpZ-0DH.js +1 -0
- package/dist/client/assets/{ScoutSurface-BMKW7hSu.js → ScoutSurface-BENBUt5-.js} +1 -1
- package/dist/client/assets/ScoutbotBroadcastChip-CGZyxS5H.js +2 -0
- package/dist/client/assets/{agent-autocomplete-C7xwIcwd.css → ScoutbotBroadcastChip-CxtYZWPZ.css} +1 -1
- package/dist/client/assets/{ScoutbotFxLab-0O2iDRrF.js → ScoutbotFxLab-Bk2ZsfPp.js} +1 -1
- package/dist/client/assets/ScoutbotRealtimeVoiceCall-n63LdBZs.js +1 -0
- package/dist/client/assets/{SecondaryNav-cYTw2p39.js → SecondaryNav-B4IsujYh.js} +1 -1
- package/dist/client/assets/{SessionEmbedScreen-mNjT0R6j.js → SessionEmbedScreen-CPfH-jqN.js} +1 -1
- package/dist/client/assets/{SessionObserve-zAlFbwFn.js → SessionObserve-B-SkP3tu.js} +1 -1
- package/dist/client/assets/{SessionObserveEvidence-BVawzqoE.js → SessionObserveEvidence-CF5jnH3-.js} +1 -1
- package/dist/client/assets/SessionRefScreen-C-4jjmVG.js +1 -0
- package/dist/client/assets/SessionsScreen-HAjFvmIq.js +1 -0
- package/dist/client/assets/SettingsDrawer-DATxwZrn.js +3 -0
- package/dist/client/assets/SettingsDrawer-UX7pFJU_.css +1 -0
- package/dist/client/assets/SettingsScreen-Bu53X7J_.js +1 -0
- package/dist/client/assets/{ShikiPane-DyEJdcvb.js → ShikiPane-DH8yYDks.js} +1 -1
- package/dist/client/assets/{SlidePanel-Dg8_styW.js → SlidePanel-RFXJpfUa.js} +1 -1
- package/dist/client/assets/{SpriteAvatar-DMrSssNZ.js → SpriteAvatar-CEYdCzem.js} +1 -1
- package/dist/client/assets/{StatusPill-NFFnphtx.js → StatusPill-9uy70ttd.js} +1 -1
- package/dist/client/assets/{TailView-BfObcZu3.js → TailView-6bIrgdxN.js} +2 -2
- package/dist/client/assets/Terminal-BI6km7H4.js +1 -0
- package/dist/client/assets/TerminalEmbedScreen-D4JOWwtm.js +1 -0
- package/dist/client/assets/{TextDocumentSurface-C7fGlzY8.js → TextDocumentSurface-BcP9vvji.js} +1 -1
- package/dist/client/assets/{TmuxPeek-BSeKIjnX.js → TmuxPeek-IaWqCgyJ.js} +1 -1
- package/dist/client/assets/{VoicePermissionsPanel-BkIGTzgw.js → VoicePermissionsPanel-C80iZxgy.js} +1 -1
- package/dist/client/assets/{WorkDetailScreen-Cwe-KWK4.js → WorkDetailScreen-CweZ6fEd.js} +3 -3
- package/dist/client/assets/WorkFilesViewer-Dy_-06iI.js +1 -0
- package/dist/client/assets/{activity-D4W2XZY2.js → activity-DS0u0Itf.js} +1 -1
- package/dist/client/assets/{addon-fit-Celjj2yn.js → addon-fit-CN888B3D.js} +1 -1
- package/dist/client/assets/{addon-webgl-Cu4tJ21-.js → addon-webgl-CoAnanQS.js} +1 -1
- package/dist/client/assets/{agent-essentials-CngjUhQj.js → agent-essentials-CuK4G_zS.js} +1 -1
- package/dist/client/assets/agent-identity-BxCsXnDp.js +1 -0
- package/dist/client/assets/{agent-lane-card-model-CSugZCdy.js → agent-lane-card-model-q4cwzLX4.js} +1 -1
- package/dist/client/assets/{agent-lane-detail-D5EIlX7_.js → agent-lane-detail-BNNm6FNu.js} +1 -1
- package/dist/client/assets/{agent-lane-preview-BhplDYGf.js → agent-lane-preview-C33Dwpn7.js} +1 -1
- package/dist/client/assets/{agent-lanes-DlqcEf0l.css → agent-lanes-BDNktFBZ.css} +1 -1
- package/dist/client/assets/{agent-lanes-model-BKOs_32K.js → agent-lanes-model-VYQ5a68i.js} +2 -2
- package/dist/client/assets/{api-BHHEUSS3.js → api-BkjHJfgJ.js} +1 -1
- package/dist/client/assets/api-h5zurxmi.js +1 -0
- package/dist/client/assets/{arc.es-DNT50Y-_.js → arc.es-BET9ev6q.js} +1 -1
- package/dist/client/assets/arrow-down-DxxPnPwh.js +1 -0
- package/dist/client/assets/{arrow-left-i-h6JAgs.js → arrow-left-CXDkJuCg.js} +1 -1
- package/dist/client/assets/{arrow-up-right-RBC6k8nn.js → arrow-up-right-Bj8RjSqW.js} +1 -1
- package/dist/client/assets/{bot-r2IuAuJd.js → bot-BSGSicKC.js} +1 -1
- package/dist/client/assets/broker-display-pp33bLsu.js +2 -0
- package/dist/client/assets/{cache-BO2Bd_LV.js → cache-Dr0why2k.js} +1 -1
- package/dist/client/assets/{check-Bfs7hMb1.js → check-BfA0T8UD.js} +1 -1
- package/dist/client/assets/{chevron-down-Da5tV19_.js → chevron-down-BVg09D6U.js} +1 -1
- package/dist/client/assets/{chevron-right-BMqtBds_.js → chevron-right-CaEwYkxE.js} +1 -1
- package/dist/client/assets/{chunk-HRAB3GC3-BUVYXXAp.js → chunk-HRAB3GC3-HhKwnZCi.js} +1 -1
- package/dist/client/assets/chunk-JTPDIGGW-DX2eTIQ_.js +46 -0
- package/dist/client/assets/chunk-T65CQEWV-D-bOfuCH.js +1 -0
- package/dist/client/assets/chunk-YOZR3KYS-oS9dlQCI.js +2 -0
- package/dist/client/assets/{clock-DaKLp6Xd.js → clock-C3TUL7D7.js} +1 -1
- package/dist/client/assets/{code-xml-ByQsfOI_.js → code-xml-Dbvjk9Kw.js} +1 -1
- package/dist/client/assets/collapsed-strip-Dz-of2SM.css +1 -0
- package/dist/client/assets/content-BQuEedeL.js +1 -0
- package/dist/client/assets/content-BUae-L_N.js +1 -0
- package/dist/client/assets/content-BfG98J1k.js +1 -0
- package/dist/client/assets/content-BkVTfkAC.js +1 -0
- package/dist/client/assets/content-BsNMos_d.js +1 -0
- package/dist/client/assets/content-C2TZOKSE.js +1 -0
- package/dist/client/assets/content-CCn98eSk.js +1 -0
- package/dist/client/assets/content-CJuH5cDP.js +1 -0
- package/dist/client/assets/content-CYnPp9yo.js +1 -0
- package/dist/client/assets/content-CcrUhm4P.js +1 -0
- package/dist/client/assets/content-CiOMtgQc.js +1 -0
- package/dist/client/assets/content-CxuVONeQ.js +1 -0
- package/dist/client/assets/content-Dmq9n1_L.js +1 -0
- package/dist/client/assets/content-DskHP2NI.js +1 -0
- package/dist/client/assets/content-DvvzL2HK.js +1 -0
- package/dist/client/assets/content-snCAUbwv.js +1 -0
- package/dist/client/assets/{conversation-icons-C4amK8Sa.js → conversation-icons-DmC_Ak3z.js} +1 -1
- package/dist/client/assets/conversation-model-CHwHZNw-.js +1 -0
- package/dist/client/assets/conversation-motion-features-DPiGTO21.js +1 -0
- package/dist/client/assets/{copy-De4s38o2.js → copy-C79v_7D-.js} +1 -1
- package/dist/client/assets/{createLucideIcon-DLlxGjKt.js → createLucideIcon-DCq_3fQn.js} +1 -1
- package/dist/client/assets/ctx-panel-B4s49N9e.css +1 -0
- package/dist/client/assets/discover-IEnbrH8_.js +2 -0
- package/dist/client/assets/embed-entry-XUPb-AzL.js +2 -0
- package/dist/client/assets/{external-link-BGHC_naA.js → external-link-Dd8xaveL.js} +1 -1
- package/dist/client/assets/{eye-BeCSqJn1.js → eye-DkU59kfl.js} +1 -1
- package/dist/client/assets/{file-text-BVhkMWyC.js → file-text-BITQqGtF.js} +1 -1
- package/dist/client/assets/gestures-B5rLNRpi.js +1 -0
- package/dist/client/assets/home-moving-signal-Bs635mVw.js +1 -0
- package/dist/client/assets/home-moving-signal-CAa0V91u.css +1 -0
- package/dist/client/assets/home-now-card-VxlLjg1A.js +1 -0
- package/dist/client/assets/{home-now-card-nano-Djhy6ax0.js → home-now-card-nano-C06GMiwD.js} +1 -1
- package/dist/client/assets/hooks-BWiLxTw1.js +2 -0
- package/dist/client/assets/index-9as_JTUs.css +1 -0
- package/dist/client/assets/index-BTj2MguM.js +1 -0
- package/dist/client/assets/index-BZovGpDk.js +10 -0
- package/dist/client/assets/index-CvF09yvf.css +1 -0
- package/dist/client/assets/index-DiiEQwdc.js +1 -0
- package/dist/client/assets/index-vbaJ8sin.js +1 -0
- package/dist/client/assets/inspector-panel-C96HcyK5.js +2 -0
- package/dist/client/assets/{keyboard-nav-7iEtvu9P.js → keyboard-nav-CHo_xmjw.js} +1 -1
- package/dist/client/assets/{lane-observe-vfyACHi0.js → lane-observe-BA3g9aVd.js} +1 -1
- package/dist/client/assets/{lane-roster-store-pHT3TAVs.js → lane-roster-store-B6ybJlHJ.js} +1 -1
- package/dist/client/assets/left-Bk3XnxPD.css +1 -0
- package/dist/client/assets/left-BuJ0wJW1.js +2 -0
- package/dist/client/assets/left-C6Zj3cR4.js +1 -0
- package/dist/client/assets/left-CCoobxPS.css +1 -0
- package/dist/client/assets/left-COMAiMfB.js +2 -0
- package/dist/client/assets/left-Ce4WKYPK.js +1 -0
- package/dist/client/assets/left-DMJkmJOF.js +1 -0
- package/dist/client/assets/left-DrCbY6ja.js +1 -0
- package/dist/client/assets/left-agents-BuSyVNGE.js +1 -0
- package/dist/client/assets/left-default-DRHywOKX.js +1 -0
- package/dist/client/assets/left-l92tw5Kc.js +1 -0
- package/dist/client/assets/left-lanes-4-aUyyrV.js +1 -0
- package/dist/client/assets/left-mission-e849d_Td.js +1 -0
- package/dist/client/assets/left-plan-MchYwAB_.js +2 -0
- package/dist/client/assets/library-DygjpA6u.js +1 -0
- package/dist/client/assets/{loader-circle-DoT8gpw6.js → loader-circle-B-l2Wj3-.js} +1 -1
- package/dist/client/assets/{local-agents-BMadXuP1.js → local-agents-Wof5knTJ.js} +1 -1
- package/dist/client/assets/{mentions-Cd6XticV.js → mentions-BjXfeF7t.js} +1 -1
- package/dist/client/assets/{mesh-ops-C0zCLTR8.js → mesh-ops-C1gq8zKf.js} +1 -1
- package/dist/client/assets/{mesh-view-store-Cpqil_2D.js → mesh-view-store-B56D3f77.js} +1 -1
- package/dist/client/assets/{message-circle-44KSmbvQ.js → message-circle-BwVx5X0q.js} +1 -1
- package/dist/client/assets/{message-markup-DAnnGpWr.js → message-markup-DlVX-iuc.js} +1 -1
- package/dist/client/assets/{message-square-DlY4EneU.js → message-square-BnkG6tae.js} +1 -1
- package/dist/client/assets/mission-control-m3BTDQ9l.css +1 -0
- package/dist/client/assets/{mission-control-store-DtjtRs9Z.js → mission-control-store-CMgIVjLJ.js} +1 -1
- package/dist/client/assets/model-Co0zkMIc.js +1 -0
- package/dist/client/assets/{observe-DL5_8-Zj.js → observe-DVHAcIrv.js} +1 -1
- package/dist/client/assets/{operator-attention-BqoWAlhp.js → operator-attention-BwSPeheT.js} +1 -1
- package/dist/client/assets/{page-status-CW8co39E.js → page-status-Bg2hd27j.js} +1 -1
- package/dist/client/assets/paperclip-DblaLD_N.js +1 -0
- package/dist/client/assets/plan-view-D56fneVF.css +1 -0
- package/dist/client/assets/{plus-64n9qucr.js → plus-BAI0t5g9.js} +1 -1
- package/dist/client/assets/profile-3Q4sUtvJ.js +1 -0
- package/dist/client/assets/projects-inbox-Da2hYEn6.js +1 -0
- package/dist/client/assets/{radio-BjpQTKT0.js → radio-BGtkyCG9.js} +1 -1
- package/dist/client/assets/{refresh-cw-IgN2fZLM.js → refresh-cw-DtF8xPqX.js} +1 -1
- package/dist/client/assets/resolve-panes-D4tlKNCT.js +1 -0
- package/dist/client/assets/resolve-sidebar-context-B27lj3Ci.js +1 -0
- package/dist/client/assets/right-B8qg3JdB.js +1 -0
- package/dist/client/assets/{right-B96CBzrV.js → right-BU_W1kSH.js} +1 -1
- package/dist/client/assets/right-BlR7h0US.js +1 -0
- package/dist/client/assets/right-BwgwTGGd.js +1 -0
- package/dist/client/assets/right-ByptvkVX.js +1 -0
- package/dist/client/assets/right-CUP-NIDG.js +1 -0
- package/dist/client/assets/right-Ch_jrNe2.js +1 -0
- package/dist/client/assets/right-Dd2DscRz.js +1 -0
- package/dist/client/assets/right-DmVHd8Xj.js +1 -0
- package/dist/client/assets/{right-DqiVyo8v.js → right-c4PAdFYZ.js} +1 -1
- package/dist/client/assets/{rocket-DnmN_YOD.js → rocket-BWh18pt_.js} +1 -1
- package/dist/client/assets/router-63XV_E7f.js +1 -0
- package/dist/client/assets/{text-BR9Bap0E.js → runtime-picker-BXKJbLot.js} +1 -1
- package/dist/client/assets/runtime-picker-vhm0gtLs.css +1 -0
- package/dist/client/assets/{scope-views-Z8aoAmtU.js → scope-views-Dm2_-NPi.js} +1 -1
- package/dist/client/assets/scout-voice-D8Q5sZOL.js +1 -0
- package/dist/client/assets/{scoutbot-D4vuKzOL.js → scoutbot-BTIErYHo.js} +2 -2
- package/dist/client/assets/{scroll-text-DRidbcse.js → scroll-text-DZb3mmYo.js} +1 -1
- package/dist/client/assets/{search-BbgsEMXa.js → search-1QMVOxF3.js} +1 -1
- package/dist/client/assets/secondaryNavConfig-c0cz3MkJ.js +1 -0
- package/dist/client/assets/{selection-bridge-CpzFGx3-.js → selection-bridge-O9C4kGfF.js} +1 -1
- package/dist/client/assets/{send-horizontal-BXo2uz3Z.js → send-horizontal-DbyEkGql.js} +1 -1
- package/dist/client/assets/{server-Dt3tpiBj.js → server-Bncn9S7r.js} +1 -1
- package/dist/client/assets/{session-catalog-CUQ8LUJY.js → session-catalog-DC6BlBBC.js} +1 -1
- package/dist/client/assets/{session-table-B4JOKevn.js → session-table-BUPq9Viy.js} +1 -1
- package/dist/client/assets/{sliders-horizontal-7V8B3xsf.js → sliders-horizontal-CMe8Bay1.js} +1 -1
- package/dist/client/assets/{sparkles-ytTwpCbZ.js → sparkles-_7cTZsIH.js} +1 -1
- package/dist/client/assets/{sse-CSozY6mp.js → sse-Bb0EOcU9.js} +1 -1
- package/dist/client/assets/system-surfaces-redesign-B7GQhfpw.css +1 -0
- package/dist/client/assets/{tail-display-DcliDVkW.js → tail-display-BRcJltQa.js} +1 -1
- package/dist/client/assets/{tail-events-CrN-Rmxj.js → tail-events-C12pfUax.js} +1 -1
- package/dist/client/assets/{terminal-relay-pSm7_An6.js → terminal-relay-BgfVJXIL.js} +1 -1
- package/dist/client/assets/{terminal-sessions-D4dHTRkt.js → terminal-sessions-AmSgHklm.js} +1 -1
- package/dist/client/assets/{terminal-takeover-CtA3wcXh.js → terminal-takeover--05EYhJm.js} +1 -1
- package/dist/client/assets/{terminal-BiNIXhna.js → terminal-xGf_F3y7.js} +1 -1
- package/dist/client/assets/text-DsBWV_4k.js +1 -0
- package/dist/client/assets/{use-conversation-list-C0bEXFeH.js → use-conversation-list-DWX02INv.js} +1 -1
- package/dist/client/assets/{use-fleet-active-asks-CK4aw-3G.js → use-fleet-active-asks-Cnwa4hTK.js} +1 -1
- package/dist/client/assets/{use-mesh-ops-items-QixBijmT.js → use-mesh-ops-items-BRFm37oY.js} +1 -1
- package/dist/client/assets/use-reduced-motion-C8cWvIZ3.js +1 -0
- package/dist/client/assets/use-scout-dev-flags-FkMreOOb.js +1 -0
- package/dist/client/assets/{useAgentHoverCard-6N8b7qsU.js → useAgentHoverCard-DvPZSJK3.js} +1 -1
- package/dist/client/assets/useContentSecondaryNav-CNlrhvvx.js +1 -0
- package/dist/client/assets/{usePierreRuntime-Bq6mXrgd.js → usePierreRuntime-C8WJ0X3F.js} +1 -1
- package/dist/client/assets/{wrench-CQvdf7KT.js → wrench-_tHBGTop.js} +1 -1
- package/dist/client/assets/{x-BJyPzFnn.js → x-CrGUKNRv.js} +1 -1
- package/dist/client/assets/{xterm-D6dE_wMr.js → xterm-Ks-VlLTq.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +38 -169
- package/dist/node/main.mjs +240 -272
- package/dist/pairing-runtime-controller.mjs +476 -394
- package/dist/runtime/base-daemon.mjs +121 -49
- package/dist/runtime/broker-daemon.mjs +60 -171
- package/dist/runtime/broker-process-manager.mjs +0 -6
- package/dist/runtime/mesh-discover.mjs +0 -6
- package/dist/scout-control-plane-web.mjs +477 -672
- package/dist/scout-web-server.mjs +477 -672
- package/package.json +7 -6
- package/dist/client/assets/ActivityScreen-C7AwUogt.js +0 -1
- package/dist/client/assets/AgentAvatar-B1xvQ7ej.js +0 -1
- package/dist/client/assets/AgentConfigurationScreen-BoBQpyz5.js +0 -1
- package/dist/client/assets/AgentDefinitionsWorkspace-rw3vh8Lm.js +0 -1
- package/dist/client/assets/AgentFloorView-Crdw8Uo5.js +0 -1
- package/dist/client/assets/AgentInfoScreen-Cge7HHbV.js +0 -1
- package/dist/client/assets/AgentLaneDetailSheet-DCIIg3Zp.js +0 -4
- package/dist/client/assets/AgentLanesEmbedScreen-BJLwXSNp.js +0 -1
- package/dist/client/assets/AgentLanesView-CbY9qD0z.js +0 -2
- package/dist/client/assets/AgentSessions-czl5zT7A.js +0 -6
- package/dist/client/assets/AgentsConsole-CoT2crwq.js +0 -1
- package/dist/client/assets/AgentsScreen-BcPM-z1T.js +0 -1
- package/dist/client/assets/AgentsSubnav-3_vpn2bT.js +0 -1
- package/dist/client/assets/AstronautSuit-BADl7m8x.js +0 -1
- package/dist/client/assets/BackToPicker-CqYhOaLB.js +0 -1
- package/dist/client/assets/BriefingDetailScreen-DDfZ8ci1.js +0 -1
- package/dist/client/assets/BrokerScreen-Bkvu92jk.js +0 -5
- package/dist/client/assets/Canvas-KyTsDJlB.js +0 -1
- package/dist/client/assets/ChatCollapsedStrip-Bjjqa30K.js +0 -1
- package/dist/client/assets/ConversationComposer-Ce7Byw48.js +0 -1
- package/dist/client/assets/ConversationFeedRows-DygDfQn_.js +0 -1
- package/dist/client/assets/ConversationHeader-C3sg0ULI.js +0 -1
- package/dist/client/assets/ConversationPanels-Dg4Y2GgX.js +0 -6
- package/dist/client/assets/ConversationScreen-BP5tdz2k.css +0 -1
- package/dist/client/assets/ConversationScreen-CjWWmuuh.js +0 -1
- package/dist/client/assets/ConversationStatus-BhVIYQza.js +0 -1
- package/dist/client/assets/CrewWorkspaces-B6YIyw1z.css +0 -1
- package/dist/client/assets/CrewWorkspaces-CDU-wy1Y.js +0 -1
- package/dist/client/assets/DocumentFocusViewer-DmtFisY9.js +0 -1
- package/dist/client/assets/FlightObserveScreen-DL3Xhl0h.js +0 -1
- package/dist/client/assets/HarnessesScreen-DTDL-XaA.js +0 -1
- package/dist/client/assets/HomeHero-7JwycwFY.css +0 -1
- package/dist/client/assets/HomeHero-CENwVZ45.js +0 -1
- package/dist/client/assets/HostAdvisorView-PgiZUkd_.js +0 -1
- package/dist/client/assets/KnowledgeSearchScreen-Bj80IgR0.js +0 -1
- package/dist/client/assets/LaneTraceDetailSheet-BztwvOv9.js +0 -1
- package/dist/client/assets/MeshScreen-lJKaOyGB.js +0 -1
- package/dist/client/assets/MessagesScreen-D6MVLvdg.js +0 -1
- package/dist/client/assets/MissionControlView-BCH-Zsp4.js +0 -1
- package/dist/client/assets/MissionFocusOverlay-DbAliOSF.js +0 -1
- package/dist/client/assets/MissionLeftAgentRow-Bx6Pg8_O.js +0 -1
- package/dist/client/assets/MissionLogPane-D06c29Y8.js +0 -1
- package/dist/client/assets/NewChatComposer-Bgqes0UQ.js +0 -19
- package/dist/client/assets/ObserveEmbedScreen-Cmhwai4X.js +0 -2
- package/dist/client/assets/ObserveTextFlow-C1f5oize.js +0 -2
- package/dist/client/assets/ObservedTopologyPanel-D85P6RAk.js +0 -2
- package/dist/client/assets/OpenScoutAppShell-IDI4fuUE.js +0 -88
- package/dist/client/assets/OpsAgentsView-yt0JavoB.js +0 -1
- package/dist/client/assets/OpsScreen-C3yNQqJE.js +0 -1
- package/dist/client/assets/OpsSubnav-BijKI3yG.js +0 -1
- package/dist/client/assets/ProjectAgentProfile-DnIeC16r.js +0 -1
- package/dist/client/assets/ProjectAgentProfileHero-Bh_aISs-.js +0 -1
- package/dist/client/assets/ProjectsInbox-B8Srlklk.js +0 -2
- package/dist/client/assets/ProjectsRail-DqAbdvCf.js +0 -1
- package/dist/client/assets/ProjectsScreen-DKHQ2iEv.js +0 -1
- package/dist/client/assets/ProjectsThreadAside-DpkjYLL2.js +0 -1
- package/dist/client/assets/Provider-Ve8yXaWR.js +0 -1
- package/dist/client/assets/RailRow-B0sRaJc6.css +0 -1
- package/dist/client/assets/RailRow-C4GNGR80.js +0 -1
- package/dist/client/assets/RawSessionsTable-Co3vzwsf.js +0 -1
- package/dist/client/assets/RealtimeVoiceScreen-DMd1CBAf.js +0 -9
- package/dist/client/assets/RepoDiffViewer-CovKjSgb.js +0 -7
- package/dist/client/assets/RepoDiffViewerLazy-zIiEmh-e.js +0 -2
- package/dist/client/assets/ScoutDeckSurface-BGsVicc2.js +0 -1
- package/dist/client/assets/SessionRefScreen-BmKhf29o.js +0 -1
- package/dist/client/assets/SessionsScreen-CsSqjIY2.js +0 -1
- package/dist/client/assets/SettingsDrawer-Dsj-On_x.css +0 -1
- package/dist/client/assets/SettingsDrawer-DwYQTGi8.js +0 -3
- package/dist/client/assets/SettingsScreen-Btaku7YM.js +0 -1
- package/dist/client/assets/Terminal-Dr-M9U4u.js +0 -1
- package/dist/client/assets/TerminalEmbedScreen-BmyZkonh.js +0 -1
- package/dist/client/assets/TerminalRelay-lJ2KdMCW.js +0 -46
- package/dist/client/assets/WorkFilesViewer-BBtKRBPv.js +0 -1
- package/dist/client/assets/agent-autocomplete-Dv-_9dAw.js +0 -2
- package/dist/client/assets/agent-identity-DzHGhLdJ.js +0 -1
- package/dist/client/assets/agent-specialization-CNrsRbKA.js +0 -1
- package/dist/client/assets/api-DEHEgJ9m.js +0 -1
- package/dist/client/assets/archive-DH49QqFG.js +0 -1
- package/dist/client/assets/arrow-right-B0Yi01Zr.js +0 -1
- package/dist/client/assets/broker-display-Q75fupqG.js +0 -2
- package/dist/client/assets/collapsed-strip-raJWthAH.css +0 -1
- package/dist/client/assets/compass-BepM5iWH.js +0 -1
- package/dist/client/assets/content-5hnDC9WE.js +0 -1
- package/dist/client/assets/content-BRFZ-a6m.js +0 -1
- package/dist/client/assets/content-BYykncDo.js +0 -1
- package/dist/client/assets/content-Be6yyWbJ.js +0 -1
- package/dist/client/assets/content-Bgl_X3ao.js +0 -1
- package/dist/client/assets/content-BopJW1Zx.js +0 -1
- package/dist/client/assets/content-Bv2sfg0w.js +0 -1
- package/dist/client/assets/content-CMBiIZTg.js +0 -1
- package/dist/client/assets/content-CPVqvf5o.js +0 -1
- package/dist/client/assets/content-CbwyFqdI.js +0 -1
- package/dist/client/assets/content-ClQjAWYi.js +0 -1
- package/dist/client/assets/content-Cv2tSAbv.js +0 -1
- package/dist/client/assets/content-DFFe3-Ot.js +0 -1
- package/dist/client/assets/content-DY5hwBmm.js +0 -1
- package/dist/client/assets/content-_IXoxGno.js +0 -1
- package/dist/client/assets/content-j_tewJdE.js +0 -1
- package/dist/client/assets/conversation-model-CigSPlKA.js +0 -1
- package/dist/client/assets/conversation-motion-features-_95aZx_1.js +0 -1
- package/dist/client/assets/cpu-Bc268H9Q.js +0 -1
- package/dist/client/assets/credentials-qwds23lv.js +0 -1
- package/dist/client/assets/ctx-panel-D_HJ3nhb.css +0 -1
- package/dist/client/assets/discover-DOlk1hG7.js +0 -2
- package/dist/client/assets/embed-entry-BqDJfa87.js +0 -2
- package/dist/client/assets/file-code-corner-CX53Cd9y.js +0 -1
- package/dist/client/assets/gauge-CPcEPmNt.js +0 -1
- package/dist/client/assets/gestures-BXIGYk_p.js +0 -1
- package/dist/client/assets/git-branch-q8Ayc8py.js +0 -1
- package/dist/client/assets/home-moving-signal-DMguaRWR.css +0 -1
- package/dist/client/assets/home-moving-signal-Dm2Z2x0p.js +0 -1
- package/dist/client/assets/home-now-card-xU5LGP7q.js +0 -1
- package/dist/client/assets/hooks-CdKx1CxP.js +0 -2
- package/dist/client/assets/host-advisor-B2Fqs5Dd.css +0 -1
- package/dist/client/assets/index-Bli6bTLU.js +0 -10
- package/dist/client/assets/index-D7UEHxaY.js +0 -1
- package/dist/client/assets/index-DFdlQs_c.js +0 -1
- package/dist/client/assets/index-DhfOMK0D.js +0 -1
- package/dist/client/assets/index-DzlEgstl.css +0 -1
- package/dist/client/assets/index-wLwc74Pu.css +0 -1
- package/dist/client/assets/inspector-panel-B8pigRsg.js +0 -2
- package/dist/client/assets/layers-BiZA-Clc.js +0 -1
- package/dist/client/assets/layout-grid-DMpv9CZM.js +0 -1
- package/dist/client/assets/left-BayK4ocL.js +0 -1
- package/dist/client/assets/left-BhZhSrS2.js +0 -1
- package/dist/client/assets/left-BhgU6NOA.js +0 -1
- package/dist/client/assets/left-CY_FGnN7.js +0 -1
- package/dist/client/assets/left-Cq8mjamr.js +0 -1
- package/dist/client/assets/left-DH44V4I_.css +0 -1
- package/dist/client/assets/left-Dnqla0b5.js +0 -2
- package/dist/client/assets/left-Dy403II2.js +0 -2
- package/dist/client/assets/left-R2OOE7VG.css +0 -1
- package/dist/client/assets/left-advisor-oOAtJ9YE.js +0 -1
- package/dist/client/assets/left-agents-TIKe8vW8.js +0 -1
- package/dist/client/assets/left-default-owH0Lwxo.js +0 -1
- package/dist/client/assets/left-lanes-BE_co2lP.js +0 -1
- package/dist/client/assets/left-mission-C_nWUtfA.js +0 -1
- package/dist/client/assets/library-BSVrjn_m.js +0 -1
- package/dist/client/assets/mission-control-CnU7dNt1.css +0 -1
- package/dist/client/assets/persistent-state-DYjP8lqN.js +0 -1
- package/dist/client/assets/profile-BkmuseW7.js +0 -1
- package/dist/client/assets/projects-inbox-C0umZMSY.js +0 -1
- package/dist/client/assets/provider-CX9EWecp.js +0 -1
- package/dist/client/assets/proxy-C35W-YHZ.js +0 -1
- package/dist/client/assets/resolve-panes-CCqRkQdM.js +0 -1
- package/dist/client/assets/resolve-sidebar-context-JkxY8qsV.js +0 -1
- package/dist/client/assets/right-B3PQUHd5.js +0 -1
- package/dist/client/assets/right-BPirlFC8.js +0 -1
- package/dist/client/assets/right-BUP2Ro_M.js +0 -1
- package/dist/client/assets/right-BVWYPIFX.js +0 -1
- package/dist/client/assets/right-BoAJxwA3.js +0 -1
- package/dist/client/assets/right-C2aOC2li.js +0 -1
- package/dist/client/assets/right-CtPJjgOV.js +0 -1
- package/dist/client/assets/right-SfSu0zHC.js +0 -1
- package/dist/client/assets/router-B0YclXYg.js +0 -1
- package/dist/client/assets/scout-voice-DvG_3stJ.js +0 -1
- package/dist/client/assets/scoutbot-markdown-BJJyaPu2.js +0 -6
- package/dist/client/assets/secondaryNavConfig-DyC_P9Wx.js +0 -1
- package/dist/client/assets/settings-BzWCF3NF.js +0 -1
- package/dist/client/assets/system-surfaces-redesign-QVXNeGYw.css +0 -1
- package/dist/client/assets/text-rLpBg4_z.css +0 -1
- package/dist/client/assets/use-reduced-motion-BLn59zLn.js +0 -1
- package/dist/client/assets/use-scout-dev-flags-JKb1EhFh.js +0 -1
- package/dist/client/assets/useContentSecondaryNav-D-hVKzM9.js +0 -1
- package/dist/client/assets/usePersistentState-DOEahRlt.js +0 -1
- package/dist/client/assets/zap-rw7uwZht.js +0 -1
- /package/dist/client/assets/{DocumentFocusViewer-BSC_JwVE.css → document-focus-viewer-BSC_JwVE.css} +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{r as d,j as o}from"./index-Bli6bTLU.js";import{a as Ht}from"./provider-CX9EWecp.js";import{k as vo,u as bs,o as yo,p as ht,l as Wt,a as bo,q as Re,r as Ss,s as So,t as ks}from"./Provider-Ve8yXaWR.js";import{H as ko,A as wo,S as jo,o as Co,a as Po,b as bi,c as Si}from"./agent-autocomplete-Dv-_9dAw.js";import{a as Z}from"./api-DEHEgJ9m.js";import{c as rt}from"./clipboard-e3fSpeo7.js";import{e as Eo}from"./credentials-qwds23lv.js";import{b as ws,u as To,a as De}from"./persistent-state-DYjP8lqN.js";import{s as Se,e as No,S as js}from"./scoutbot-D4vuKzOL.js";import{g as Ro,h as Do,j as Lo,i as Ao,e as Vo,s as Mo}from"./scout-voice-DvG_3stJ.js";import{d as Io,f as Cs,n as Ie}from"./time-Dhsh_2EG.js";import{S as Bo}from"./scoutbot-markdown-BJJyaPu2.js";import{L as re}from"./loader-circle-DoT8gpw6.js";import{P as ki}from"./plus-64n9qucr.js";import{C as Mt}from"./chevron-down-Da5tV19_.js";import{A as Oo}from"./archive-DH49QqFG.js";import{S as wi,a as ji}from"./text-BR9Bap0E.js";import{S as _o}from"./send-horizontal-BXo2uz3Z.js";import{c as Gt}from"./createLucideIcon-DLlxGjKt.js";import{C as Uo}from"./copy-De4s38o2.js";import{m as V,p as dt,a as zo,n as je,i as $o,b as Ci,d as Pi,r as It,t as Ei,f as z,e as Be,S as Fo,g as G,h as Ti,j as jt,k as Ni,o as M,q as ke,s as Ct,v as Ps,M as Ho,w as Ri,P as Di,x as Wo,y as Li,z as Es,A as Go,B as Le,C as Yo,c as qo,u as Ai}from"./use-reduced-motion-BLn59zLn.js";import{i as ne,b as Xo,r as Ko,s as Ts,p as Bt,d as Jo,e as Vi,f as Zo,h as ye,t as be,j as Pt,k as Ns,l as Qo,m as en,n as tn,o as sn,q as Yt,u as Et,v as on,w as nn,x as Mi,y as rn,z as an,A as cn,B as ln,C as Rs,D as un,F as Ii,g as hn,a as dn,c as mn}from"./gestures-BXIGYk_p.js";import{R as Ds}from"./rocket-DnmN_YOD.js";import{X as fn}from"./x-BJyPzFnn.js";import{R as pn}from"./refresh-cw-IgN2fZLM.js";import{S as xn}from"./settings-BzWCF3NF.js";import{V as Ls}from"./fx-z37u1o2z.js";import{B as gn}from"./bot-r2IuAuJd.js";import{d as vn}from"./types-B0PlfpKc.js";const yn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],bn=Gt("circle-check",yn);const Sn=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Bi=Gt("volume-2",Sn);const kn=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],Oi=Gt("volume-x",kn);function wn(e){return e==="x"||e==="y"?ne[e]?null:(ne[e]=!0,()=>{ne[e]=!1}):ne.x||ne.y?null:(ne.x=ne.y=!0,()=>{ne.x=ne.y=!1})}function qt(e){return Xo(e)&&"ownerSVGElement"in e}const at=new WeakMap;let ct;const _i=(e,t,s)=>(i,r)=>r&&r[0]?r[0][e+"Size"]:qt(i)&&"getBBox"in i?i.getBBox()[t]:i[s],jn=_i("inline","width","offsetWidth"),Cn=_i("block","height","offsetHeight");function Pn({target:e,borderBoxSize:t}){at.get(e)?.forEach(s=>{s(e,{get width(){return jn(e,t)},get height(){return Cn(e,t)}})})}function En(e){e.forEach(Pn)}function Tn(){typeof ResizeObserver>"u"||(ct=new ResizeObserver(En))}function Nn(e,t){ct||Tn();const s=Ko(e);return s.forEach(i=>{let r=at.get(i);r||(r=new Set,at.set(i,r)),r.add(t),ct?.observe(i)}),()=>{s.forEach(i=>{const r=at.get(i);r?.delete(t),r?.size||ct?.unobserve(i)})}}const lt=new Set;let we;function Rn(){we=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};lt.forEach(t=>t(e))},window.addEventListener("resize",we)}function Dn(e){return lt.add(e),we||Rn(),()=>{lt.delete(e),!lt.size&&typeof we=="function"&&(window.removeEventListener("resize",we),we=void 0)}}function As(e,t){return typeof e=="function"?Dn(e):Nn(e,t)}function Ln(e){return qt(e)&&e.tagName==="svg"}function Ot(e,t){e.min=t.min,e.max=t.max}function J(e,t){Ot(e.x,t.x),Ot(e.y,t.y)}function Vs(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Ui=1e-4,An=1-Ui,Vn=1+Ui,zi=.01,Mn=0-zi,In=0+zi;function $(e){return e.max-e.min}function Bn(e,t,s){return Math.abs(e-t)<=s}function Ms(e,t,s,i=.5){e.origin=i,e.originPoint=V(t.min,t.max,e.origin),e.scale=$(s)/$(t),e.translate=V(s.min,s.max,e.origin)-e.originPoint,(e.scale>=An&&e.scale<=Vn||isNaN(e.scale))&&(e.scale=1),(e.translate>=Mn&&e.translate<=In||isNaN(e.translate))&&(e.translate=0)}function Ve(e,t,s,i){Ms(e.x,t.x,s.x,i?i.originX:void 0),Ms(e.y,t.y,s.y,i?i.originY:void 0)}function Is(e,t,s,i=0){const r=i?V(s.min,s.max,i):s.min;e.min=r+t.min,e.max=e.min+$(t)}function On(e,t,s,i){Is(e.x,t.x,s.x,i?.x),Is(e.y,t.y,s.y,i?.y)}function Bs(e,t,s,i=0){const r=i?V(s.min,s.max,i):s.min;e.min=t.min-r,e.max=e.min+$(t)}function mt(e,t,s,i){Bs(e.x,t.x,s.x,i?.x),Bs(e.y,t.y,s.y,i?.y)}function Os(e,t,s,i,r){return e-=t,e=Ts(e,1/s,i),r!==void 0&&(e=Ts(e,1/r,i)),e}function _n(e,t=0,s=1,i=.5,r,c=e,n=e){if(dt.test(t)&&(t=parseFloat(t),t=V(n.min,n.max,t/100)-n.min),typeof t!="number")return;let a=V(c.min,c.max,i);e===c&&(a-=t),e.min=Os(e.min,t,s,a,r),e.max=Os(e.max,t,s,a,r)}function _s(e,t,[s,i,r],c,n){_n(e,t[s],t[i],t[r],t.scale,c,n)}const Un=["x","scaleX","originX"],zn=["y","scaleY","originY"];function Us(e,t,s,i){_s(e.x,t,Un,s?s.x:void 0,i?i.x:void 0),_s(e.y,t,zn,s?s.y:void 0,i?i.y:void 0)}function zs(e){return e.translate===0&&e.scale===1}function $i(e){return zs(e.x)&&zs(e.y)}function $s(e,t){return e.min===t.min&&e.max===t.max}function $n(e,t){return $s(e.x,t.x)&&$s(e.y,t.y)}function Fs(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Fi(e,t){return Fs(e.x,t.x)&&Fs(e.y,t.y)}function Hs(e){return $(e.x)/$(e.y)}function Ws(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Q(e){return[e("x"),e("y")]}function Fn(e,t,s){let i="";const r=e.x.translate/t.x,c=e.y.translate/t.y,n=s?.z||0;if((r||c||n)&&(i=`translate3d(${r}px, ${c}px, ${n}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:l,rotate:h,pathRotation:f,rotateX:m,rotateY:x,skewX:v,skewY:k}=s;l&&(i=`perspective(${l}px) ${i}`),h&&(i+=`rotate(${h}deg) `),f&&(i+=`rotate(${f}deg) `),m&&(i+=`rotateX(${m}deg) `),x&&(i+=`rotateY(${x}deg) `),v&&(i+=`skewX(${v}deg) `),k&&(i+=`skewY(${k}deg) `)}const a=e.x.scale*t.x,u=e.y.scale*t.y;return(a!==1||u!==1)&&(i+=`scale(${a}, ${u})`),i||"none"}const Hi=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Hn=Hi.length,Gs=e=>typeof e=="string"?parseFloat(e):e,Ys=e=>typeof e=="number"||zo.test(e);function Wn(e,t,s,i,r,c){r?(e.opacity=V(0,s.opacity??1,Gn(i)),e.opacityExit=V(t.opacity??1,0,Yn(i))):c&&(e.opacity=V(t.opacity??1,s.opacity??1,i));for(let n=0;n<Hn;n++){const a=Hi[n];let u=qs(t,a),l=qs(s,a);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||Ys(u)===Ys(l)?(e[a]=Math.max(V(Gs(u),Gs(l),i),0),(dt.test(l)||dt.test(u))&&(e[a]+="%")):e[a]=l}(t.rotate||s.rotate)&&(e.rotate=V(t.rotate||0,s.rotate||0,i))}function qs(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Gn=Wi(0,.5,Jo),Yn=Wi(.5,.95,je);function Wi(e,t,s){return i=>i<e?0:i>t?1:s(Bt(e,t,i))}function qn(e,t,s){const i=$o(e)?e:Ci(e);return i.start(Vi("",i,t,s)),i.animation}const Xn=(e,t)=>e.depth-t.depth;class Kn{constructor(){this.children=[],this.isDirty=!1}add(t){Pi(this.children,t),this.isDirty=!0}remove(t){It(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Xn),this.isDirty=!1,this.children.forEach(t)}}function Jn(e,t){const s=Ei.now(),i=({timestamp:r})=>{const c=r-s;c>=t&&(Be(i),e(c-t))};return z.setup(i,!0),()=>Be(i)}class Zn{constructor(){this.members=[]}add(t){Pi(this.members,t);for(let s=this.members.length-1;s>=0;s--){const i=this.members[s];if(i===t||i===this.lead||i===this.prevLead)continue;const r=i.instance;(!r||r.isConnected===!1)&&!i.snapshot&&(It(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(It(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(t,s){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:r}=i.options,{layoutDependency:c}=t.options;(r===void 0||r!==c)&&(t.resumeFrom=i,s&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const ut={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Tt=["","X","Y","Z"],Qn=1e3;let er=0;function Nt(e,t,s,i){const{latestValues:r}=t;r[e]&&(s[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function Gi(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=sn(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:r,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",z,!(r||c))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&Gi(i)}function Yi({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(n={},a=t?.()){this.id=er++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ir),this.nodes.forEach(lr),this.nodes.forEach(ur),this.nodes.forEach(or)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=n,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Kn)}addEventListener(n,a){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Fo),this.eventHandlers.get(n).add(a)}notifyListeners(n,...a){const u=this.eventHandlers.get(n);u&&u.notify(...a)}hasListeners(n){return this.eventHandlers.has(n)}mount(n){if(this.instance)return;this.isSVG=qt(n)&&!Ln(n),this.instance=n;const{layoutId:a,layout:u,visualElement:l}=this.options;if(l&&!l.current&&l.mount(n),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||a)&&(this.isLayoutDirty=!0),e){let h,f=0;const m=()=>this.root.updateBlockedByResize=!1;z.read(()=>{f=window.innerWidth}),e(n,()=>{const x=window.innerWidth;x!==f&&(f=x,this.root.updateBlockedByResize=!0,h&&h(),h=Jn(m,250),ut.hasAnimatedSinceResize&&(ut.hasAnimatedSinceResize=!1,this.nodes.forEach(Js)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||l.getDefaultTransition()||pr,{onLayoutAnimationStart:k,onLayoutAnimationComplete:y}=l.getProps(),b=!this.targetLayout||!Fi(this.targetLayout,x),C=!f&&m;if(this.options.layoutRoot||this.resumeFrom||C||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...Zo(v,"layout"),onPlay:k,onComplete:y};(l.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(h,C,P.path)}else f||Js(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const n=this.getStack();n&&n.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Be(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(hr),this.animationId++)}getTransformTemplate(){const{visualElement:n}=this.options;return n&&n.getProps().transformTemplate}willUpdate(n=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gi(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const f=this.path[h];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),n&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(rr),this.nodes.forEach(Xs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ks);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ar),this.nodes.forEach(cr),this.nodes.forEach(tr),this.nodes.forEach(sr)):this.nodes.forEach(Ks),this.clearAllSnapshots();const a=Ei.now();G.delta=Ti(0,1e3/60,a-G.timestamp),G.timestamp=a,G.isProcessing=!0,jt.update.process(G),jt.preRender.process(G),jt.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ni.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nr),this.sharedNodes.forEach(dr)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,z.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){z.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$(this.snapshot.measuredBox.x)&&!$(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const n=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=M()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,n?n.layoutBox:void 0)}updateScroll(n="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===n&&(a=!1),a&&this.instance){const u=i(this.instance);this.scroll={animationId:this.root.animationId,phase:n,isRoot:u,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!r)return;const n=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!$i(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,h=l!==this.prevTransformTemplateValue;n&&this.instance&&(a||ye(this.latestValues)||h)&&(r(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(n=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return n&&(u=this.removeTransform(u)),xr(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:n}=this.options;if(!n)return M();const a=n.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gr))){const{scroll:l}=this.root;l&&(be(a.x,l.offset.x),be(a.y,l.offset.y))}return a}removeElementScroll(n){const a=M();if(J(a,n),this.scroll?.wasRoot)return a;for(let u=0;u<this.path.length;u++){const l=this.path[u],{scroll:h,options:f}=l;l!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&J(a,n),be(a.x,h.offset.x),be(a.y,h.offset.y))}return a}applyTransform(n,a=!1,u){const l=u||M();J(l,n);for(let h=0;h<this.path.length;h++){const f=this.path[h];!a&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(be(l.x,-f.scroll.offset.x),be(l.y,-f.scroll.offset.y)),ye(f.latestValues)&&Pt(l,f.latestValues,f.layout?.layoutBox)}return ye(this.latestValues)&&Pt(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(n){const a=M();J(a,n);for(let u=0;u<this.path.length;u++){const l=this.path[u];if(!ye(l.latestValues))continue;let h;l.instance&&(Ns(l.latestValues)&&l.updateSnapshot(),h=M(),J(h,l.measurePageBox())),Us(a,l.latestValues,l.snapshot?.layoutBox,h)}return ye(this.latestValues)&&Us(a,this.latestValues),a}setTargetDelta(n){this.targetDelta=n,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(n){this.options={...this.options,...n,crossfade:n.crossfade!==void 0?n.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(n=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==a;if(!(n||u&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:f}=this.options;if(!this.layout||!(h||f))return;this.resolvedRelativeTargetAt=G.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=M(),this.targetWithTransforms=M()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),On(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):J(this.target,this.layout.layoutBox),Qo(this.target,this.targetDelta)):J(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ns(this.parent.latestValues)||en(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(n,a,u){this.relativeParent=n,this.linkedParentVersion=n.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=M(),this.relativeTargetOrigin=M(),mt(this.relativeTargetOrigin,a,u,this.options.layoutAnchor||void 0),J(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const n=this.getLead(),a=!!this.resumingFrom||this!==n;let u=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===G.timestamp&&(u=!1),u)return;const{layout:l,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||h))return;J(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;tn(this.layoutCorrected,this.treeScale,this.path,a),n.layout&&!n.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(n.target=n.layout.layoutBox,n.targetWithTransforms=M());const{target:x}=n;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Vs(this.prevProjectionDelta.x,this.projectionDelta.x),Vs(this.prevProjectionDelta.y,this.projectionDelta.y)),Ve(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ws(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ws(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(n=!0){if(this.options.visualElement?.scheduleRender(),n){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ke(),this.projectionDelta=ke(),this.projectionDeltaWithTransform=ke()}setAnimationOrigin(n,a=!1,u){const l=this.snapshot,h=l?l.latestValues:{},f={...this.latestValues},m=ke();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const x=M(),v=l?l.source:void 0,k=this.layout?this.layout.source:void 0,y=v!==k,b=this.getStack(),C=!b||b.members.length<=1,P=!!(y&&!C&&this.options.crossfade===!0&&!this.path.some(fr));this.animationProgress=0;let j;const D=u?.interpolateProjection(n);this.mixTargetDelta=T=>{const w=T/1e3,E=D?.(w);E?(m.x.translate=E.x,m.x.scale=V(n.x.scale,1,w),m.x.origin=n.x.origin,m.x.originPoint=n.x.originPoint,m.y.translate=E.y,m.y.scale=V(n.y.scale,1,w),m.y.origin=n.y.origin,m.y.originPoint=n.y.originPoint):(Zs(m.x,n.x,w),Zs(m.y,n.y,w)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mt(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),mr(this.relativeTarget,this.relativeTargetOrigin,x,w),j&&$n(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=M()),J(j,this.relativeTarget)),y&&(this.animationValues=f,Wn(f,h,this.latestValues,w,P,C)),E&&E.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=E.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(n){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Be(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=z.update(()=>{ut.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ci(0)),this.motionValue.jump(0,!1),this.currentAnimation=qn(this.motionValue,[0,1e3],{...n,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),n.onUpdate&&n.onUpdate(a)},onStop:()=>{},onComplete:()=>{n.onComplete&&n.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const n=this.getStack();n&&n.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Qn),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const n=this.getLead();let{targetWithTransforms:a,target:u,layout:l,latestValues:h}=n;if(!(!a||!u||!l)){if(this!==n&&this.layout&&l&&qi(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||M();const f=$(this.layout.layoutBox.x);u.x.min=n.target.x.min,u.x.max=u.x.min+f;const m=$(this.layout.layoutBox.y);u.y.min=n.target.y.min,u.y.max=u.y.min+m}J(a,u),Pt(a,h),Ve(this.projectionDeltaWithTransform,this.layoutCorrected,a,h)}}registerSharedNode(n,a){this.sharedNodes.has(n)||this.sharedNodes.set(n,new Zn),this.sharedNodes.get(n).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const n=this.getStack();return n?n.lead===this:!0}getLead(){const{layoutId:n}=this.options;return n?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:n}=this.options;return n?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:n}=this.options;if(n)return this.root.sharedNodes.get(n)}promote({needsReset:n,transition:a,preserveFollowOpacity:u}={}){const l=this.getStack();l&&l.promote(this,u),n&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const n=this.getStack();return n?n.relegate(this):!1}resetSkewAndRotation(){const{visualElement:n}=this.options;if(!n)return;let a=!1;const{latestValues:u}=n;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const l={};u.z&&Nt("z",n,l,this.animationValues);for(let h=0;h<Tt.length;h++)Nt(`rotate${Tt[h]}`,n,l,this.animationValues),Nt(`skew${Tt[h]}`,n,l,this.animationValues);n.render();for(const h in l)n.setStaticValue(h,l[h]),this.animationValues&&(this.animationValues[h]=l[h]);n.scheduleRender()}applyProjectionStyles(n,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){n.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,n.visibility="",n.opacity="",n.pointerEvents=Ct(a?.pointerEvents)||"",n.transform=u?u(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(n.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,n.pointerEvents=Ct(a?.pointerEvents)||""),this.hasProjected&&!ye(this.latestValues)&&(n.transform=u?u({},""):"none",this.hasProjected=!1);return}n.visibility="";const h=l.animationValues||l.latestValues;this.applyTransformsToTarget();let f=Fn(this.projectionDeltaWithTransform,this.treeScale,h);u&&(f=u(h,f)),n.transform=f;const{x:m,y:x}=this.projectionDelta;n.transformOrigin=`${m.origin*100}% ${x.origin*100}% 0`,l.animationValues?n.opacity=l===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:n.opacity=l===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const v in Ps){if(h[v]===void 0)continue;const{correct:k,applyTo:y,isCSSVariable:b}=Ps[v],C=f==="none"?h[v]:k(h[v],l);if(y){const P=y.length;for(let j=0;j<P;j++)n[y[j]]=C}else b?this.options.visualElement.renderState.vars[v]=C:n[v]=C}this.options.layoutId&&(n.pointerEvents=l===this?Ct(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(n=>n.currentAnimation?.stop()),this.root.nodes.forEach(Xs),this.root.sharedNodes.clear()}}}function tr(e){e.updateLayout()}function sr(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:r}=e.options,c=t.source!==e.layout.source;if(r==="size")Q(h=>{const f=c?t.measuredBox[h]:t.layoutBox[h],m=$(f);f.min=s[h].min,f.max=f.min+m});else if(r==="x"||r==="y"){const h=r==="x"?"y":"x";Ot(c?t.measuredBox[h]:t.layoutBox[h],s[h])}else qi(r,t.layoutBox,s)&&Q(h=>{const f=c?t.measuredBox[h]:t.layoutBox[h],m=$(s[h]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+m)});const n=ke();Ve(n,s,t.layoutBox);const a=ke();c?Ve(a,e.applyTransform(i,!0),t.measuredBox):Ve(a,s,t.layoutBox);const u=!$i(n);let l=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:m}=h;if(f&&m){const x=e.options.layoutAnchor||void 0,v=M();mt(v,t.layoutBox,f.layoutBox,x);const k=M();mt(k,s,m.layoutBox,x),Fi(v,k)||(l=!0),h.options.layoutRoot&&(e.relativeTarget=k,e.relativeTargetOrigin=v,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:a,layoutDelta:n,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function ir(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function or(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function nr(e){e.clearSnapshot()}function Xs(e){e.clearMeasurements()}function rr(e){e.isLayoutDirty=!0,e.updateLayout()}function Ks(e){e.isLayoutDirty=!1}function ar(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function cr(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Js(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function lr(e){e.resolveTargetDelta()}function ur(e){e.calcProjection()}function hr(e){e.resetSkewAndRotation()}function dr(e){e.removeLeadSnapshot()}function Zs(e,t,s){e.translate=V(t.translate,0,s),e.scale=V(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function Qs(e,t,s,i){e.min=V(t.min,s.min,i),e.max=V(t.max,s.max,i)}function mr(e,t,s,i){Qs(e.x,t.x,s.x,i),Qs(e.y,t.y,s.y,i)}function fr(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const pr={duration:.45,ease:[.4,0,.1,1]},ei=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ti=ei("applewebkit/")&&!ei("chrome/")?Math.round:je;function si(e){e.min=ti(e.min),e.max=ti(e.max)}function xr(e){si(e.x),si(e.y)}function qi(e,t,s){return e==="position"||e==="preserve-aspect"&&!Bn(Hs(t),Hs(s),.2)}function gr(e){return e!==e.root&&e.scroll?.wasRoot}const vr=Yi({attachResizeListener:(e,t)=>Yt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Rt={current:void 0},Xi=Yi({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rt.current){const e=new vr({});e.mount(window),e.setOptions({layoutScroll:!0}),Rt.current=e}return Rt.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});function ii(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yr(...e){return t=>{let s=!1;const i=e.map(r=>{const c=ii(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<i.length;r++){const c=i[r];typeof c=="function"?c():ii(e[r],null)}}}}function br(...e){return d.useCallback(yr(...e),e)}class Sr extends d.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(Et(s)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=s.offsetParent,r=Et(i)&&i.offsetWidth||0,c=Et(i)&&i.offsetHeight||0,n=getComputedStyle(s),a=this.props.sizeRef.current;a.height=parseFloat(n.height),a.width=parseFloat(n.width),a.top=s.offsetTop,a.left=s.offsetLeft,a.right=r-a.width-a.left,a.bottom=c-a.height-a.top,a.direction=n.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function kr({children:e,isPresent:t,anchorX:s,anchorY:i,root:r,pop:c}){const n=d.useId(),a=d.useRef(null),u=d.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=d.useContext(Ho),h=e.props?.ref??e?.ref,f=br(a,h);return d.useInsertionEffect(()=>{const{width:m,height:x,top:v,left:k,right:y,bottom:b,direction:C}=u.current;if(t||c===!1||!a.current||!m||!x)return;const P=C==="rtl",j=s==="left"?P?`right: ${y}`:`left: ${k}`:P?`left: ${k}`:`right: ${y}`,D=i==="bottom"?`bottom: ${b}`:`top: ${v}`;a.current.dataset.motionPopId=n;const T=document.createElement("style");l&&(T.nonce=l);const w=r??document.head;return w.appendChild(T),T.sheet&&T.sheet.insertRule(`
|
|
2
|
-
[data-motion-pop-id="${n}"] {
|
|
3
|
-
position: absolute !important;
|
|
4
|
-
width: ${m}px !important;
|
|
5
|
-
height: ${x}px !important;
|
|
6
|
-
${j}px !important;
|
|
7
|
-
${D}px !important;
|
|
8
|
-
}
|
|
9
|
-
`),()=>{a.current?.removeAttribute("data-motion-pop-id"),w.contains(T)&&w.removeChild(T)}},[t]),o.jsx(Sr,{isPresent:t,childRef:a,sizeRef:u,pop:c,children:c===!1?e:d.cloneElement(e,{ref:f})})}const wr=({children:e,initial:t,isPresent:s,onExitComplete:i,custom:r,presenceAffectsLayout:c,mode:n,anchorX:a,anchorY:u,root:l})=>{const h=Ri(jr),f=d.useId();let m=!0,x=d.useMemo(()=>(m=!1,{id:f,initial:t,isPresent:s,custom:r,onExitComplete:v=>{h.set(v,!0);for(const k of h.values())if(!k)return;i&&i()},register:v=>(h.set(v,!1),()=>h.delete(v))}),[s,h,i]);return c&&m&&(x={...x}),d.useMemo(()=>{h.forEach((v,k)=>h.set(k,!1))},[s]),d.useEffect(()=>{!s&&!h.size&&i&&i()},[s]),e=o.jsx(kr,{pop:n==="popLayout",isPresent:s,anchorX:a,anchorY:u,root:l,children:e}),o.jsx(Di.Provider,{value:x,children:e})};function jr(){return new Map}function Ki(e=!0){const t=d.useContext(Di);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:i,register:r}=t,c=d.useId();d.useEffect(()=>{if(e)return r(c)},[e]);const n=d.useCallback(()=>e&&i&&i(c),[c,i,e]);return!s&&i?[!1,n]:[!0]}const st=e=>e.key||"";function oi(e){const t=[];return d.Children.forEach(e,s=>{d.isValidElement(s)&&t.push(s)}),t}const Cr=({children:e,custom:t,initial:s=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:c="sync",propagate:n=!1,anchorX:a="left",anchorY:u="top",root:l})=>{const[h,f]=Ki(n),m=d.useMemo(()=>oi(e),[e]),x=n&&!h?[]:m.map(st),v=d.useRef(!0),k=d.useRef(m),y=Ri(()=>new Map),b=d.useRef(new Set),[C,P]=d.useState(m),[j,D]=d.useState(m);Wo(()=>{v.current=!1,k.current=m;for(let E=0;E<j.length;E++){const R=st(j[E]);x.includes(R)?(y.delete(R),b.current.delete(R)):y.get(R)!==!0&&y.set(R,!1)}},[j,x.length,x.join("-")]);const T=[];if(m!==C){let E=[...m];for(let R=0;R<j.length;R++){const I=j[R],A=st(I);x.includes(A)||(E.splice(R,0,I),T.push(I))}return c==="wait"&&T.length&&(E=T),D(oi(E)),P(m),null}const{forceRender:w}=d.useContext(Li);return o.jsx(o.Fragment,{children:j.map(E=>{const R=st(E),I=n&&!h?!1:m===j||x.includes(R),A=()=>{if(b.current.has(R))return;if(y.has(R))b.current.add(R),y.set(R,!0);else return;let B=!0;y.forEach(q=>{q||(B=!1)}),B&&(w?.(),D(k.current),n&&f?.(),i&&i())};return o.jsx(wr,{isPresent:I,initial:!v.current||s?void 0:!1,custom:t,presenceAffectsLayout:r,mode:c,root:l,onExitComplete:I?void 0:A,anchorX:a,anchorY:u,children:E},R)})})};function Me(e,t,s,i){return Yt(e,t,on(s),i)}const Ji=({current:e})=>e?e.ownerDocument.defaultView:null,ni=(e,t)=>Math.abs(e-t);function Pr(e,t){const s=ni(e.x,t.x),i=ni(e.y,t.y);return Math.sqrt(s**2+i**2)}const ri=new Set(["auto","scroll"]);class Zi{constructor(t,s,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:c=!1,distanceThreshold:n=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=it(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Dt(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,k=Pr(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!k)return;const{point:y}=x,{timestamp:b}=G;this.history.push({...y,timestamp:b});const{onStart:C,onMove:P}=this.handlers;v||(C&&C(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,v)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=v,this.lastMoveEventInfo=it(v,this.transformPagePoint),z.update(this.updatePoint,!0)},this.handlePointerUp=(x,v)=>{this.end();const{onEnd:k,onSessionEnd:y,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Dt(x.type==="pointercancel"?this.lastMoveEventInfo:it(v,this.transformPagePoint),this.history);this.startEvent&&k&&k(x,C),y&&y(x,C)},!nn(t))return;this.dragSnapToOrigin=c,this.handlers=s,this.transformPagePoint=i,this.distanceThreshold=n,this.contextWindow=r||window;const u=Mi(t),l=it(u,this.transformPagePoint),{point:h}=l,{timestamp:f}=G;this.history=[{...h,timestamp:f}];const{onSessionStart:m}=s;m&&m(t,Dt(l,this.history)),this.removeListeners=rn(Me(this.contextWindow,"pointermove",this.handlePointerMove),Me(this.contextWindow,"pointerup",this.handlePointerUp),Me(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let s=t.parentElement;for(;s;){const i=getComputedStyle(s);(ri.has(i.overflowX)||ri.has(i.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const i=t===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},c={x:r.x-s.x,y:r.y-s.y};c.x===0&&c.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(t,r),z.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Be(this.updatePoint)}}function it(e,t){return t?{point:t(e.point)}:e}function ai(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Dt({point:e},t){return{point:e,delta:ai(e,Qi(t)),offset:ai(e,Er(t)),velocity:Tr(t,.1)}}function Er(e){return e[0]}function Qi(e){return e[e.length-1]}function Tr(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,i=null;const r=Qi(e);for(;s>=0&&(i=e[s],!(r.timestamp-i.timestamp>Es(t)));)s--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&r.timestamp-i.timestamp>Es(t)*2&&(i=e[1]);const c=Go(r.timestamp-i.timestamp);if(c===0)return{x:0,y:0};const n={x:(r.x-i.x)/c,y:(r.y-i.y)/c};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}function Nr(e,{min:t,max:s},i){return t!==void 0&&e<t?e=i?V(t,e,i.min):Math.max(e,t):s!==void 0&&e>s&&(e=i?V(s,e,i.max):Math.min(e,s)),e}function ci(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function Rr(e,{top:t,left:s,bottom:i,right:r}){return{x:ci(e.x,s,r),y:ci(e.y,t,i)}}function li(e,t){let s=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,i]=[i,s]),{min:s,max:i}}function Dr(e,t){return{x:li(e.x,t.x),y:li(e.y,t.y)}}function Lr(e,t){let s=.5;const i=$(e),r=$(t);return r>i?s=Bt(t.min,t.max-i,e.min):i>r&&(s=Bt(e.min,e.max-r,t.min)),Ti(0,1,s)}function Ar(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const _t=.35;function Vr(e=_t){return e===!1?e=0:e===!0&&(e=_t),{x:ui(e,"left","right"),y:ui(e,"top","bottom")}}function ui(e,t,s){return{min:hi(e,t),max:hi(e,s)}}function hi(e,t){return typeof e=="number"?e:e[t]||0}const Mr=new WeakMap;class Ir{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=M(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const c=f=>{s&&this.snapToCursor(Mi(f).point),this.stopAnimation()},n=(f,m)=>{const{drag:x,dragPropagation:v,onDragStart:k}=this.getProps();if(x&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wn(x),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Q(b=>{let C=this.getAxisMotionValue(b).get()||0;if(dt.test(C)){const{projection:P}=this.visualElement;if(P&&P.layout){const j=P.layout.layoutBox[b];j&&(C=$(j)*(parseFloat(C)/100))}}this.originPoint[b]=C}),k&&z.update(()=>k(f,m),!1,!0),Rs(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;const{dragPropagation:x,dragDirectionLock:v,onDirectionLock:k,onDrag:y}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:b}=m;if(v&&this.currentDirection===null){this.currentDirection=Or(b),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),y&&z.update(()=>y(f,m),!1,!0)},u=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new Zi(t,{onSessionStart:c,onStart:n,onMove:a,onSessionEnd:u,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:Ji(this.visualElement),element:this.visualElement.current})}stop(t,s){const i=t||this.latestPointerEvent,r=s||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!r||!i)return;const{velocity:n}=r;this.startAnimation(n);const{onDragEnd:a}=this.getProps();a&&z.postRender(()=>a(i,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,i){const{drag:r}=this.getProps();if(!i||!ot(t,r,this.currentDirection))return;const c=this.getAxisMotionValue(t);let n=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(n=Nr(n,this.constraints[t],this.elastic[t])),c.set(n)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&&Le(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=Rr(i.layoutBox,t):this.constraints=!1,this.elastic=Vr(s),r!==this.constraints&&!Le(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Q(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=Ar(i.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Le(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const c=an(i,r.root,this.visualElement.getTransformPagePoint());let n=Dr(r.layout.layoutBox,c);if(s){const a=s(cn(n));this.hasMutatedConstraints=!!a,a&&(n=ln(a))}return n}startAnimation(t){const{drag:s,dragMomentum:i,dragElastic:r,dragTransition:c,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},l=Q(h=>{if(!ot(h,s,this.currentDirection))return;let f=u&&u[h]||{};(n===!0||n===h)&&(f={min:0,max:0});const m=r?200:1e6,x=r?40:1e7,v={type:"inertia",velocity:i?t[h]:0,bounceStiffness:m,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...c,...f};return this.startAxisValueAnimation(h,v)});return Promise.all(l).then(a)}startAxisValueAnimation(t,s){const i=this.getAxisMotionValue(t);return Rs(this.visualElement,t),i.start(Vi(t,i,0,s,this.visualElement,!1))}stopAnimation(){Q(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps()[s];return r||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Q(s=>{const{drag:i}=this.getProps();if(!ot(s,i,this.currentDirection))return;const{projection:r}=this.visualElement,c=this.getAxisMotionValue(s);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[s],u=c.get()||0;c.set(t[s]-V(n,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:i}=this.visualElement;if(!Le(s)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Q(n=>{const a=this.getAxisMotionValue(n);if(a&&this.constraints!==!1){const u=a.get();r[n]=Lr({min:u,max:u},this.constraints[n])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Q(n=>{if(!ot(n,t,null))return;const a=this.getAxisMotionValue(n),{min:u,max:l}=this.constraints[n];a.set(V(u,l,r[n]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Mr.set(this.visualElement,this);const t=this.visualElement.current,s=Me(t,"pointerdown",l=>{const{drag:h,dragListener:f=!0}=this.getProps(),m=l.target,x=m!==t&&un(m);h&&f&&!x&&this.start(l)});let i;const r=()=>{const{dragConstraints:l}=this.getProps();Le(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Br(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,n=c.addEventListener("measure",r);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),z.read(r);const a=Yt(window,"resize",()=>this.scalePositionWithinConstraints()),u=c.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(Q(f=>{const m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=l[f].translate,m.set(m.get()+l[f].translate))}),this.visualElement.render())}));return()=>{a(),s(),n(),u&&u(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:c=!1,dragElastic:n=_t,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:i,dragPropagation:r,dragConstraints:c,dragElastic:n,dragMomentum:a}}}function di(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Br(e,t,s){const i=As(e,di(s)),r=As(t,di(s));return()=>{i(),r()}}function ot(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function Or(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class _r extends Ii{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new Ir(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Lt=e=>(t,s)=>{e&&z.update(()=>e(t,s),!1,!0)};class Ur extends Ii{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new Zi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ji(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lt(t),onStart:Lt(s),onMove:Lt(i),onEnd:(c,n)=>{delete this.session,r&&z.postRender(()=>r(c,n))}}}mount(){this.removePointerDownListener=Me(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let At=!1;class zr extends d.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:i,layoutId:r}=this.props,{projection:c}=t;c&&(s.group&&s.group.add(c),i&&i.register&&r&&i.register(c),At&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ut.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:i,drag:r,isPresent:c}=this.props,{projection:n}=i;return n&&(n.isPresent=c,t.layoutDependency!==s&&n.setOptions({...n.options,layoutDependency:s}),At=!0,r||t.layoutDependency!==s||s===void 0||t.isPresent!==c?n.willUpdate():this.safeToRemove(),t.isPresent!==c&&(c?n.promote():n.relegate()||z.postRender(()=>{const a=n.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=s,i.root.didUpdate(),Ni.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:i}=this.props,{projection:r}=t;At=!0,r&&(r.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function eo(e){const[t,s]=Ki(),i=d.useContext(Li);return o.jsx(zr,{...e,layoutGroup:i,switchLayoutGroup:d.useContext(Yo),isPresent:t,safeToRemove:s})}const $r={pan:{Feature:Ur},drag:{Feature:_r,ProjectionNode:Xi,MeasureLayout:eo}},Fr={layout:{ProjectionNode:Xi,MeasureLayout:eo}},Hr={...dn,...hn,...$r,...Fr},to=qo(Hr,mn),Wr=new Set(["air-local","local","mini","node"]),Gr=new Set(["main","master","trunk"]);function Yr(e){return e.replace(/```[\s\S]*?```/g," code omitted ").replace(/\*\*([^*\n]+)\*\*/g,"$1").replace(/(^|[\s(])\*([^\s*][^*\n]*?[^\s*]|[^\s*])\*(?=[\s)\].,!?;:]|$)/g,"$1$2").replace(/(^|[\s(])_([^\s_][^_\n]*?[^\s_]|[^\s_])_(?=[\s)\].,!?;:]|$)/g,"$1$2").replace(/^\s*[-*]\s+/gm,"").replace(/\bhttps?:\/\/[^\s)]+/gi,t=>qr(t)).replace(/\b(session|conversation|message|flight|invocation|work)(?:\s+(?:id|ref))?\s*[:#]?\s+([a-z0-9][a-z0-9._:-]{9,})\b/gi,(t,s,i)=>`${s.toLowerCase()} ending in ${Ut(i)}`).replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,t=>`ID ending in ${Ut(t)}`).replace(/@?([a-z][a-z0-9-]*(?:\.[a-z0-9][a-z0-9-]*){2,})\b/gi,(t,s)=>Xr(t)?t:Kr(s)).replace(/`([^`]+)`/g,(t,s)=>Jr(s)).replace(/\s+/g," ").trim()}function qr(e){try{return new URL(e).hostname.replace(/^www\./,"").replace(/\./g," dot ")}catch{return"link"}}function Xr(e){const t=e.replace(/^@/,"").toLowerCase();return/\.(com|app|dev|org|net|io|local)(?:\b|\/)/.test(t)&&!t.endsWith(".air-local")}function Kr(e){const t=e.split(".").filter(Boolean);if(t.length<2)return e;const s=[...t];for(;s.length>1&&Wr.has(s.at(-1).toLowerCase());)s.pop();const[i,...r]=s,c=r.filter(n=>!Gr.has(n.toLowerCase())).map(zt).filter(Boolean);return[zt(i),...c].filter(Boolean).join(", ")}function Jr(e){return/^[a-z0-9][a-z0-9._:-]{12,}$/i.test(e)?`ID ending in ${Ut(e)}`:zt(e)}function Ut(e){return(e.replace(/[^a-z0-9]/gi,"").slice(-4)||e.slice(-4)).split("").join(" ")}function zt(e){return e.replace(/^@/,"").replace(/[_./:-]+/g," ").replace(/\s+/g," ").trim()}function Zr({state:e,chatExpanded:t,onToggleExpanded:s,sessionPickerOpen:i,onToggleSessionPicker:r,onStartNewChat:c,startingNewChat:n,onSwitchSession:a,switchingSessionId:u,sending:l,briefing:h,pendingAsk:f,onArchiveSession:m,archivingSessionId:x,onAssistantContextMenu:v,suggestedPrompts:k,onSelectPrompt:y}){const C=e.session.messages,P=t?C:C.slice(-4),j=t?0:Math.max(0,C.length-P.length),D=C.length,T=e.sessions.length,w=e.retention,E=C.length===0&&!f&&!l&&!h,R=n||l||h||!!u||!!x,I=e.session.createdAt?Io(e.session.createdAt):null,A=E?"Scout conversation":e.session.title&&e.session.title!=="New Scout Session"?e.session.title:`Session ${e.session.id.slice(0,8)}`,B=d.useRef(null),q=C[C.length-1]?.id??null,ee=C[C.length-1]?.body??"";return d.useEffect(()=>{const L=B.current;L&&(L.scrollTop=L.scrollHeight)},[q,ee,f,l,t,e.session.id]),o.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded border border-[var(--scout-chrome-border-soft)] bg-black/10 font-mono text-xs text-[var(--scout-chrome-ink-faint)]",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-[var(--scout-chrome-border-soft)] px-2.5 py-1.5",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[o.jsx("span",{className:"min-w-0 truncate text-[var(--scout-chrome-ink)]",title:e.session.id,children:A}),I&&!E&&o.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",I]}),!E&&o.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",D," msg",D===1?"":"s"]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[o.jsxs("button",{type:"button",title:"Start a new chat (keeps this chat in Chats)","aria-label":"Start new chat",onClick:c,disabled:R,className:"flex items-center gap-1 rounded border border-lime-300/30 bg-lime-300/[0.06] px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] text-lime-100 transition-colors hover:border-lime-300/50 hover:bg-lime-300/10 disabled:cursor-not-allowed disabled:opacity-40",children:[n?o.jsx(re,{size:10,className:"animate-spin"}):o.jsx(ki,{size:10}),o.jsx("span",{children:n?"Starting":"New chat"})]}),o.jsxs("button",{type:"button",title:`Switch chat (${T} total)`,"aria-label":"Switch chat",onClick:r,className:`flex items-center gap-1 rounded border px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] transition-colors ${i?"border-lime-300/40 bg-lime-300/10 text-lime-100":"border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[o.jsx(ko,{size:10}),o.jsx("span",{children:"Chats"}),o.jsx("span",{className:"text-[var(--scout-chrome-ink-ghost)]",children:T}),o.jsx(Mt,{size:9,className:i?"rotate-180 transition-transform":"transition-transform"})]}),D>4&&o.jsxs("button",{type:"button",title:t?"Collapse chat":"View full session","aria-label":t?"Collapse chat":"View full session",onClick:s,className:"flex items-center gap-1 rounded border border-[var(--scout-chrome-border-soft)] px-1.5 py-0.5 text-2xs uppercase tracking-[0.1em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]",children:[o.jsx("span",{children:t?"Collapse":"Full"}),t?o.jsx(vo,{size:9}):o.jsx(Mt,{size:9})]})]})]}),i&&o.jsxs("div",{className:"shrink-0 border-b border-[var(--scout-chrome-border-soft)] px-2 py-1.5",children:[o.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2 px-0.5 text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:[o.jsx("span",{children:"Recent chats"}),w&&w.archivedCount>0&&o.jsxs("span",{children:[w.archivedCount," archived"]})]}),o.jsx("div",{className:"flex max-h-40 flex-col gap-0.5 overflow-y-auto pr-0.5",children:e.sessions.map(L=>{const X=L.id===e.session.id,ae=u===L.id,K=x===L.id,_=Cs(L.updatedAt)||"unknown",F=L.title&&L.title!=="New Scout Session"?L.title:`Session ${L.id.slice(0,8)}`;return o.jsxs("div",{className:`flex items-center gap-2 rounded border px-2 py-1 text-left transition-colors ${X?"border-lime-300/40 bg-lime-300/[0.06] text-lime-100":"border-transparent text-[var(--scout-chrome-ink-faint)] hover:border-[var(--scout-chrome-border-soft)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[o.jsxs("button",{type:"button",onClick:()=>{X||a(L.id)},disabled:X||!!u||!!x,className:"flex min-w-0 flex-1 items-center gap-2 text-left disabled:cursor-not-allowed disabled:opacity-40",children:[o.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${X?"bg-lime-300":"bg-[var(--scout-chrome-ink-ghost)]"}`}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink)]",children:F}),o.jsxs("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:[L.messageCount," msg"]}),o.jsx("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:_}),ae&&o.jsx(re,{size:10,className:"shrink-0 animate-spin text-lime-200"})]}),o.jsx("button",{type:"button",title:"Archive chat","aria-label":`Archive chat ${F}`,onClick:()=>m(L.id),disabled:!!u||!!x,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded border border-transparent text-[var(--scout-chrome-ink-ghost)] transition-colors hover:border-[var(--scout-chrome-border-soft)] hover:bg-black/20 hover:text-[var(--scout-chrome-ink)] disabled:cursor-not-allowed disabled:opacity-30",children:K?o.jsx(re,{size:10,className:"animate-spin"}):o.jsx(Oo,{size:10})})]},L.id)})})]}),o.jsxs("div",{ref:B,className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-2.5 py-2",children:[j>0&&o.jsxs("button",{type:"button",onClick:s,className:"self-start text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)] hover:text-[var(--scout-chrome-ink)]",children:["↑ ",j," earlier message",j===1?"":"s"]}),E&&o.jsx(Qr,{suggestedPrompts:k,onSelectPrompt:y}),P.map((L,X)=>{const ae=sa(P[X-1],L),K=ia(L.createdAt);return o.jsxs("div",{className:"flex flex-col gap-1",children:[ae&&o.jsx("div",{className:"self-center rounded-full bg-white/[0.06] px-2.5 py-0.5 font-mono text-2xs font-medium text-[var(--scout-chrome-ink-ghost)]",title:Cs(L.createdAt),"aria-label":K,children:K}),o.jsx(mi,{role:L.role,body:L.body,onContextMenu:L.role==="assistant"&&v?_=>v(_,L.body):void 0})]},L.id)}),f&&o.jsx(mi,{role:"user",body:f,pending:!0}),l&&!f&&o.jsx("p",{className:"text-[var(--scout-chrome-ink-ghost)]",children:"Reading the control plane…"}),h&&o.jsxs("div",{className:"flex items-center gap-2 rounded border border-lime-300/30 bg-lime-300/[0.06] px-2.5 py-2 font-mono text-xs leading-relaxed text-lime-100",children:[o.jsx(re,{size:12,className:"shrink-0 animate-spin text-lime-300","aria-hidden":"true"}),o.jsxs("div",{className:"min-w-0 flex flex-col gap-0.5",children:[o.jsx("span",{className:"text-xs uppercase tracking-[0.14em] text-lime-300",children:"Briefing"}),o.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:"Codex is reviewing the control-plane snapshot. Voice will pick up when it lands."})]})]})]})]})}function Qr({suggestedPrompts:e=[],onSelectPrompt:t}){return o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col justify-start gap-2 px-1 py-2.5",children:[e.length>0?o.jsx("div",{className:"grid gap-1",children:e.slice(0,3).map(s=>o.jsx("button",{type:"button",onClick:()=>t?.(s),className:"min-h-7 truncate rounded border border-[var(--scout-chrome-border-soft)] bg-black/10 px-2.5 text-left font-mono text-xs leading-snug text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]",children:s},s))}):null,o.jsxs("div",{className:"max-w-[30rem]",children:[o.jsx("div",{className:"font-sans text-lg font-semibold leading-tight text-[var(--scout-chrome-ink)]",children:"Start with a question."}),o.jsx("p",{className:"mt-0.5 font-sans text-xs leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Paste a failed result or ask about what you are seeing. Scout replies when you ask."})]})]})}function ea({agents:e,draft:t,onDraftChange:s,onSubmit:i,sending:r,recording:c,voiceLabel:n,voiceBusy:a,voiceUnavailable:u,voiceHeld:l=!1,onMicClick:h,prominent:f=!1,autoFocus:m,focusSignal:x}){const v=d.useRef(null),k=d.useCallback(()=>{const P=v.current;P&&(P.textarea?P.textarea.focus({preventScroll:!0}):P.focus())},[]);d.useEffect(()=>{m&&k()},[m,k]),d.useEffect(()=>{x&&k()},[x,k]);let y="Start talking";u&&(y="Set up Scout voice"),c&&(y="Stop talking"),(a||l)&&(y=n);const b=a||c||l,C=["w-full resize-none rounded border font-mono text-sm leading-relaxed text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)]",f?"min-h-[88px] max-h-[170px] border-lime-300/30 bg-black/25 px-3 py-2 text-md":"min-h-[44px] max-h-[124px] border-[var(--scout-chrome-border-soft)] bg-black/20 px-2 py-1.5"].join(" ");return o.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:P=>{P.preventDefault(),i()},children:[o.jsx(wo,{ref:v,agents:e,value:t,onChange:s,onSubmit:()=>{t.trim()&&!r&&i()},placeholder:l?"Type while live voice is on…":f?"Ask Scout about what you are seeing…":"Ask Scout…",rows:f?4:2,disabled:r,submitOnEnter:!0,className:"min-w-0",textareaClassName:C}),o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("button",{type:"button",title:y,"aria-label":y,onClick:h,disabled:r||a||l,className:`flex h-8 items-center justify-center rounded border transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${c?"border-lime-300/50 bg-lime-300/10 text-lime-200":l?"border-lime-300/25 bg-lime-300/[0.05] text-lime-100/70":"border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"} ${b?"gap-1.5 px-3 font-mono text-xs uppercase tracking-[0.12em]":"w-9"}`,children:[a?o.jsx(re,{size:13,className:"animate-spin"}):c?o.jsx(wi,{size:12,className:"fill-current"}):o.jsx(ji,{size:13}),b&&o.jsx("span",{className:"truncate",children:n})]}),o.jsx("button",{type:"submit",title:"Send","aria-label":"Send",disabled:!t.trim()||r,className:"flex h-8 w-9 items-center justify-center rounded bg-lime-300/90 text-black transition-opacity disabled:cursor-not-allowed disabled:opacity-40",children:r?o.jsx(re,{size:13,className:"animate-spin"}):o.jsx(_o,{size:13})})]})]})}function mi({role:e,body:t,pending:s=!1,onContextMenu:i}){const r=e==="user",c=r?t:Se(t),[n,a]=d.useState(!1),u=d.useCallback(()=>{rt(c).then(()=>{a(!0),window.setTimeout(()=>a(!1),1200)}).catch(()=>{})},[c]);return o.jsxs("div",{className:"group flex flex-col gap-0.5",onContextMenu:i,children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("span",{className:`text-2xs uppercase tracking-[0.12em] ${r?"text-[var(--scout-chrome-ink-ghost)]":"text-lime-300"}`,children:[r?"You":"Reply",s&&" · sending"]}),o.jsx("button",{type:"button",title:n?"Copied":"Copy message","aria-label":n?"Copied message":"Copy message",disabled:s||!c.trim(),onClick:u,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded border border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-ghost)] opacity-70 transition hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)] disabled:cursor-not-allowed disabled:opacity-20 group-hover:opacity-100",children:n?o.jsx(bn,{size:11}):o.jsx(Uo,{size:11})})]}),r?o.jsx("p",{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-[var(--scout-chrome-ink)] ${s?"opacity-60":""}`,children:c}):o.jsx("div",{className:s?"opacity-60":"",children:o.jsx(Bo,{text:c})})]})}const ta=5*6e4;function sa(e,t){if(!e||!$t(e.createdAt,t.createdAt))return!0;const s=Ie(e.createdAt),i=Ie(t.createdAt);return s===null||i===null?!0:Math.abs(i-s)>=ta}function $t(e,t){const s=Ie(e),i=Ie(t);if(s===null||i===null)return!1;const r=new Date(s),c=new Date(i);return r.getFullYear()===c.getFullYear()&&r.getMonth()===c.getMonth()&&r.getDate()===c.getDate()}function ia(e){const t=Ie(e);if(t===null)return"";const s=new Date(t),i=new Date,r=new Date(i);r.setDate(i.getDate()-1);const c=s.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return $t(t,i.getTime())?`Today ${c}`:$t(t,r.getTime())?`Yesterday ${c}`:s.getFullYear()===i.getFullYear()?`${s.toLocaleDateString([],{month:"short",day:"numeric"})} ${c}`:`${s.toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})} ${c}`}const oa={"--scout-chrome-bg":"#f3f0e9","--scout-chrome-ink":"#2a2d2f","--scout-chrome-ink-strong":"#171a1c","--scout-chrome-ink-faint":"#6f716e","--scout-chrome-ink-ghost":"#9b9a94","--scout-chrome-border-soft":"#d9d4ca","--scout-chrome-hover":"#e9e5dc","--scout-chrome-active":"#ded8cc","--scout-accent":"#b58a3f"},fi=[2,4,7,5,3,6,9,5,3,4,8,6,3,5,9,6,3,5,7,4,2,4,6,3],na=fi.map((e,t)=>{const s=t/fi.length*Math.PI*2-Math.PI/2,i=24-e/2,r=24+e/2;return{x1:36+Math.cos(s)*i,y1:36+Math.sin(s)*i,x2:36+Math.cos(s)*r,y2:36+Math.sin(s)*r}});function ra({recording:e,sending:t,speaking:s,voiceAvailable:i,voiceProbeState:r,voiceState:c}){return s?"speaking":t?"thinking":e&&c==="processing"?"processing":e?"listening":r!=="idle"||c==="starting"||i===null?"checking":i===!1?"unavailable":"ready"}const aa={checking:{label:"Getting voice ready",helper:"Checking your microphone and speech services"},unavailable:{label:"Voice is offline",helper:"Tap to reconnect"},listening:{label:"Listening",helper:"Tap to finish your turn"},processing:{label:"Transcribing",helper:"Turning speech into text"},thinking:{label:"Scout is thinking",helper:"Your turn is in"},speaking:{label:"Scout is speaking",helper:"Tap to interrupt"},ready:{label:"Ready to listen",helper:"Tap to speak"}};function ca(e){switch(e){case"listening":return"Finish and send voice turn";case"speaking":return"Stop spoken reply";case"unavailable":return"Retry voice connection";case"checking":return"Checking voice";case"processing":return"Transcribing voice turn";case"thinking":return"Scout is thinking";case"ready":return"Start voice turn"}}function la(e){return e==="listening"||e==="processing"?"listen":e==="thinking"?"think":e==="speaking"?"speak":null}function ua({phase:e,disabled:t,onClick:s}){const i=Ai(),r=e==="listening"||e==="speaking",c=ca(e);return o.jsx(to.div,{animate:r&&!i?{scale:[1,1.025,1]}:{scale:1},transition:r&&!i?{duration:2.2,ease:"easeInOut",repeat:1/0}:{duration:.18},children:o.jsx("button",{type:"button",onClick:s,disabled:t,"aria-label":c,title:c,className:"group grid h-28 w-28 place-items-center rounded-full border border-[#d4cfc5] bg-white text-[#232729] shadow-[0_14px_34px_rgba(55,48,38,0.12)] outline-none transition-[border-color,box-shadow,transform] duration-200 hover:border-[#b9b2a6] hover:shadow-[0_17px_38px_rgba(55,48,38,0.16)] focus-visible:ring-2 focus-visible:ring-[#9c7736] focus-visible:ring-offset-4 focus-visible:ring-offset-[#f3f0e9] active:scale-[0.98] disabled:cursor-wait disabled:opacity-65",children:o.jsxs("svg",{viewBox:"0 0 72 72",className:"h-[72px] w-[72px]","aria-hidden":"true",children:[o.jsx("circle",{cx:"36",cy:"36",r:"24",fill:"none",stroke:"#d2cec6",strokeWidth:"0.8"}),na.map((n,a)=>o.jsx("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:r?"#817b71":"#a5a198",strokeWidth:"1.15",strokeLinecap:"round"},a)),o.jsx("circle",{cx:"36",cy:"36",r:"7.5",fill:r?"#b98a3b":"#d3b16d"})]})})})}const ha=[{id:"listen",label:"Listen"},{id:"think",label:"Think"},{id:"speak",label:"Speak"}];function da({messages:e,pendingAsk:t,partial:s,error:i,status:r,recording:c,sending:n,speaking:a,voiceAvailable:u,voiceInputSource:l,voiceProbeState:h,voiceState:f,voiceReplies:m,settingsOpen:x,setupPanel:v,settingsPanel:k,assistantModel:y,onPrimaryAction:b,onToggleVoiceReplies:C,onToggleSettings:P,onNewChat:j,onOpenLive:D}){const T=Ai(),w=d.useRef(null),E=ra({recording:c,sending:n,speaking:a,voiceAvailable:u,voiceProbeState:h,voiceState:f}),R=aa[E],I=E==="checking"||E==="processing"||E==="thinking",A=l??(u===!0?"Default input from Scout Menu":"Checking microphone…"),B=e.slice(-12),q=s||(n&&B.at(-1)?.body!==t?t:null),ee=B.length===0&&!q,L=la(E),X=y?.trim()||"Turn-based voice",ae=u===!1?"Mic offline":u===null?"Checking mic":"Mic active",K=E==="unavailable"?"bg-[#a25549]":E==="ready"||E==="checking"?"bg-[#a7a49d]":"bg-[#b58a3f]";return d.useEffect(()=>{w.current?.scrollIntoView({block:"nearest"})},[e.length,t]),o.jsxs("section",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden bg-[#f3f0e9] text-[#2a2d2f]",style:oa,"aria-label":"Direct voice conversation",children:[o.jsxs("header",{className:"flex min-h-14 shrink-0 items-center justify-between gap-2 border-b border-[#d9d4ca] px-3 py-2.5 sm:gap-4 sm:px-7",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[o.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-[15px] font-semibold tracking-[-0.018em] text-[#171a1c] sm:text-[17px]",children:"Direct Voice"}),o.jsx("span",{className:"hidden h-4 w-px bg-[#d6d1c7] sm:block","aria-hidden":"true"}),o.jsxs("div",{className:"hidden min-w-0 items-center gap-2 sm:flex","aria-live":"polite",children:[o.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${K}`,"aria-hidden":"true"}),o.jsx("span",{className:"truncate text-xs text-[#6f716e]",children:R.label})]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 sm:gap-2",children:[o.jsxs("div",{className:"flex rounded-md border border-[#cbc5ba] bg-[#e8e3da] p-0.5",role:"tablist","aria-label":"Voice mode",children:[o.jsx("button",{type:"button",role:"tab","aria-selected":"true",className:"rounded-[4px] bg-[#202426] px-2 py-1.5 text-[11px] font-medium text-white shadow-[0_1px_2px_rgba(0,0,0,0.14)] sm:px-3",children:"Direct"}),o.jsx("button",{type:"button",role:"tab","aria-selected":"false",onClick:D,disabled:!D,className:"rounded-[4px] px-2 py-1.5 text-[11px] font-medium text-[#6a6c69] transition-colors hover:bg-white/65 hover:text-[#232628] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] disabled:cursor-default disabled:opacity-45 sm:px-3",children:"Live"})]}),o.jsxs("button",{type:"button",onClick:j,className:"hidden h-8 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-[#4f5352] transition-colors hover:bg-[#e7e2d9] hover:text-[#191c1e] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] min-[430px]:flex sm:px-2.5","aria-label":"Start a new voice conversation",title:"New conversation",children:[o.jsx(ki,{size:14,"aria-hidden":"true"}),o.jsx("span",{className:"hidden md:inline",children:"New chat"})]}),o.jsx("button",{type:"button",onClick:C,className:`grid h-8 w-8 place-items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] ${m?"bg-[#e1d5bd] text-[#765923]":"text-[#6e706d] hover:bg-[#e7e2d9] hover:text-[#191c1e]"}`,"aria-pressed":m,"aria-label":m?"Mute spoken replies":"Enable spoken replies",title:m?"Spoken replies on":"Spoken replies off",children:m?o.jsx(Bi,{size:15}):o.jsx(Oi,{size:15})}),o.jsx("button",{type:"button",onClick:P,className:`grid h-8 w-8 place-items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9c7736] ${x?"bg-[#e1d5bd] text-[#765923]":"text-[#6e706d] hover:bg-[#e7e2d9] hover:text-[#191c1e]"}`,"aria-expanded":x,"aria-label":"Voice and Scoutbot settings",title:"Voice and Scoutbot settings",children:o.jsx(jo,{size:15})})]})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx("div",{className:"mx-auto flex min-h-full w-full max-w-[880px] flex-col px-6 py-8 sm:px-10 sm:py-10 lg:px-14",children:o.jsxs("div",{className:"w-full max-w-[720px]",children:[ee?o.jsxs("div",{className:"pt-1",children:[o.jsx("p",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#8b8983]",children:"Conversation"}),o.jsx("p",{className:"mt-2 max-w-[38ch] text-sm leading-6 text-[#737570]",children:"Your voice turns and Scout’s replies will appear here."})]}):o.jsxs("div",{className:"space-y-8 sm:space-y-9",children:[B.map(_=>{const F=_.role==="assistant";return o.jsxs("article",{className:"max-w-[68ch]",children:[o.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[o.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#575a59]",children:F?"Scout":"You"}),F&&o.jsx("span",{className:"text-[10px] text-[#8a8983]",children:X})]}),o.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[15px] leading-6 text-[#25292a] sm:text-base sm:leading-7",children:F?Se(_.body):_.body})]},_.id)}),q&&o.jsxs("article",{className:"max-w-[68ch]","aria-live":"polite",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#765923]",children:"You"}),o.jsx("span",{className:"text-[10px] text-[#9a7a40]",children:s?"Listening":"Sending"})]}),o.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[15px] leading-6 text-[#25292a] sm:text-base sm:leading-7",children:q})]})]}),o.jsx("div",{ref:w})]})})}),o.jsx(Cr,{initial:!1,children:(v||x||i)&&o.jsx(to.div,{initial:T?!1:{opacity:0,y:6},animate:{opacity:1,y:0},exit:T?void 0:{opacity:0,y:6},className:"max-h-[34vh] shrink-0 overflow-y-auto border-y border-[#d9d4ca] bg-[#eeeae2]",children:o.jsxs("div",{className:"mx-auto w-full max-w-[880px] px-6 py-4 sm:px-10 lg:px-14",children:[i&&o.jsx("p",{className:"mb-3 text-sm leading-6 text-[#93483f]",children:i}),v,x&&k]})})}),o.jsxs("div",{className:"shrink-0 px-5 pb-4 pt-3 sm:px-8 sm:pb-5",children:[o.jsxs("div",{className:"flex flex-col items-center text-center",children:[o.jsx(ua,{phase:E,disabled:I,onClick:b}),o.jsxs("div",{className:"mt-3","aria-live":"polite",children:[o.jsx("p",{className:"text-sm font-semibold text-[#24282a]",children:R.label}),o.jsx("p",{className:"mt-0.5 text-xs text-[#7a7b76]",children:R.helper})]}),o.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-[#7b6a49]",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#b58a3f]","aria-hidden":"true"}),o.jsx("span",{children:ae})]})]}),o.jsxs("footer",{className:"mx-auto mt-4 flex w-full max-w-[880px] flex-col items-stretch justify-between gap-2 border-t border-[#d9d4ca] pt-3 text-[11px] text-[#747570] sm:flex-row sm:items-center sm:gap-4",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(ji,{size:12,className:"shrink-0 text-[#8b7350]","aria-hidden":"true"}),o.jsxs("span",{className:"truncate",children:["Input: ",A]})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 sm:justify-start","aria-label":`Voice turn state: ${R.label}`,children:ha.map(_=>{const F=L===_.id;return o.jsx("span",{className:F?"font-medium text-[#5e4821]":"text-[#96948e]",children:_.label},_.id)})}),r&&!n&&E!=="listening"&&o.jsx("span",{className:"hidden max-w-48 truncate text-right text-[#96948e] lg:block",children:r})]})]})]})}function pi({icon:e,title:t,onClick:s,disabled:i,active:r,badge:c}){return o.jsxs("button",{type:"button",title:t,"aria-label":t,onClick:s,disabled:i,className:`flex shrink-0 items-center gap-1 rounded border p-1 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${r?"border-lime-300/50 bg-lime-300/10 text-lime-200":"border-[var(--scout-chrome-border-soft)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]"}`,children:[e,c&&o.jsx("span",{className:"font-mono text-3xs tracking-tight",children:c})]})}function xi({issue:e,probeState:t,onLaunch:s,onRetry:i,onSettings:r,onDismiss:c}){const n=t==="probing"||t==="launching";return o.jsxs("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-black/15 px-2.5 py-2 font-mono text-xs text-[var(--scout-chrome-ink)]",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(Ds,{size:13,className:"mt-0.5 shrink-0 text-[var(--scout-chrome-ink-faint)]"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:"Scout Voice"}),o.jsx("p",{className:"mt-1 leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Open Scout Menu to use speech."}),e&&o.jsx("p",{className:"mt-2 break-words leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:e})]}),c?o.jsx("button",{type:"button",title:"Hide voice setup","aria-label":"Hide voice setup",onClick:c,className:"shrink-0 rounded border border-transparent p-1 text-[var(--scout-chrome-ink-ghost)] transition-colors hover:border-[var(--scout-chrome-border-soft)] hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)]",children:o.jsx(fn,{size:11})}):null]}),o.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-1.5",children:[o.jsx(Vt,{icon:t==="launching"?o.jsx(re,{size:12,className:"animate-spin"}):o.jsx(Ds,{size:12}),label:t==="launching"?"Opening":"Open",onClick:s,disabled:t==="probing",title:"Open Scout services"}),o.jsx(Vt,{icon:t==="probing"?o.jsx(re,{size:12,className:"animate-spin"}):o.jsx(pn,{size:12}),label:"Retry",onClick:i,disabled:n,title:"Check Scout voice again"}),o.jsx(Vt,{icon:o.jsx(xn,{size:12}),label:"Voice",onClick:r,disabled:t==="probing",title:"Open Scoutbot voice settings"})]})]})}function Vt({icon:e,label:t,onClick:s,disabled:i,title:r}){return o.jsxs("button",{type:"button",title:r,onClick:s,disabled:i,className:"flex min-h-7 items-center justify-center gap-1.5 rounded border border-[var(--scout-chrome-border-soft)] px-2 text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)] transition-colors hover:bg-[var(--scout-chrome-hover)] hover:text-[var(--scout-chrome-ink)] disabled:cursor-not-allowed disabled:opacity-45",children:[e,t]})}const Ae="gpt-4o-mini-tts",Ft="us-woman",ft=[{id:"us-woman",label:"US Woman",locale:"US English",presentation:"Woman",voiceName:"Marin",description:"Warm, clear, and conversational.",speech:{modelId:Ae,voiceId:"marin",instructions:"Speak in clear, natural American English with a warm, grounded feminine presentation. Keep the delivery conversational and responsive."}},{id:"us-man",label:"US Man",locale:"US English",presentation:"Man",voiceName:"Cedar",description:"Grounded, calm, and direct.",speech:{modelId:Ae,voiceId:"cedar",instructions:"Speak in clear, natural American English with a warm, grounded masculine presentation. Keep the delivery conversational and responsive."}},{id:"british-woman",label:"British Woman",locale:"British English",presentation:"Woman",voiceName:"Marin",description:"Warm with a subtle British cadence.",speech:{modelId:Ae,voiceId:"marin",instructions:"Speak in natural British English with a subtle contemporary British accent and a warm, grounded feminine presentation. Avoid theatrical or exaggerated delivery."}},{id:"british-man",label:"British Man",locale:"British English",presentation:"Man",voiceName:"Cedar",description:"Calm with a subtle British cadence.",speech:{modelId:Ae,voiceId:"cedar",instructions:"Speak in natural British English with a subtle contemporary British accent and a calm, grounded masculine presentation. Avoid theatrical or exaggerated delivery."}}],Ce={modelId:Ae,voiceId:"marin",instructions:"Speak naturally, clearly, and conversationally."};function ma(e){return e==="custom"||ft.some(t=>t.id===e)}function fa(e,t={}){return e==="custom"?{modelId:t.modelId?.trim()||Ce.modelId,voiceId:t.voiceId?.trim()||Ce.voiceId,instructions:t.instructions?.trim()||Ce.instructions}:ft.find(s=>s.id===e)?.speech??ft.find(s=>s.id===Ft).speech}function gi({presentation:e,voicePresetId:t,onVoicePresetId:s,speechSelectionId:i,onSpeechSelectionId:r,customSpeechModelId:c,onCustomSpeechModelId:n,customSpeechVoiceId:a,onCustomSpeechVoiceId:u,customSpeechInstructions:l,onCustomSpeechInstructions:h,voiceDefaults:f,modelDraft:m,onModelDraft:x,promptDraft:v,onPromptDraft:k,configLoading:y,configSaving:b,configError:C,configStatus:P,onSave:j,onReload:D}){const T=e==="direct-voice";return o.jsx("div",{className:`rounded border border-[var(--scout-chrome-border-soft)] p-3 ${T?"bg-[#f8f5ef]":"bg-black/10"}`,children:o.jsxs("div",{className:"flex flex-col gap-3",children:[T?o.jsxs("fieldset",{className:"flex flex-col gap-2",children:[o.jsx("legend",{className:"mb-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Scout voice"}),o.jsx("div",{className:"grid grid-cols-2 gap-2",role:"radiogroup","aria-label":"Scout voice",children:ft.map(w=>{const E=i===w.id;return o.jsxs("button",{type:"button",role:"radio","aria-checked":E,onClick:()=>r(w.id),className:`min-h-20 rounded border p-2.5 text-left transition ${E?T?"border-[#b89a5f] bg-[#efe5d0] text-[var(--scout-chrome-ink)]":"border-lime-300/60 bg-lime-300/10 text-[var(--scout-chrome-ink)]":T?"border-[var(--scout-chrome-border-soft)] bg-white/55 text-[var(--scout-chrome-ink-faint)] hover:bg-white":"border-[var(--scout-chrome-border-soft)] bg-black/20 text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[o.jsx("span",{className:"block font-mono text-xs font-bold uppercase tracking-[0.1em]",children:w.label}),o.jsxs("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:[w.voiceName," · ",w.description]})]},w.id)})}),o.jsxs("button",{type:"button",role:"radio","aria-checked":i==="custom",onClick:()=>r("custom"),className:`rounded border px-2.5 py-2 text-left font-mono text-xs transition ${i==="custom"?T?"border-[#b89a5f] bg-[#efe5d0] text-[var(--scout-chrome-ink)]":"border-lime-300/60 bg-lime-300/10 text-[var(--scout-chrome-ink)]":T?"border-[var(--scout-chrome-border-soft)] bg-white/55 text-[var(--scout-chrome-ink-faint)] hover:bg-white":"border-[var(--scout-chrome-border-soft)] bg-black/20 text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[o.jsx("span",{className:"font-bold uppercase tracking-[0.1em]",children:"Custom voice"}),o.jsx("span",{className:"ml-2 text-[var(--scout-chrome-ink-ghost)]",children:"Use any supported model, voice, and style."})]}),i==="custom"&&o.jsxs("div",{className:`grid gap-2 rounded border border-[var(--scout-chrome-border-soft)] p-2.5 ${T?"bg-white/55":"bg-black/20"}`,children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Speech model",o.jsx("input",{value:c,onChange:w=>n(w.target.value),placeholder:"gpt-4o-mini-tts",className:`rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-xs normal-case tracking-normal text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)] ${T?"bg-white/75":"bg-black/25"}`})]}),o.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Voice ID",o.jsx("input",{value:a,onChange:w=>u(w.target.value),placeholder:"marin",className:`rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-xs normal-case tracking-normal text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)] ${T?"bg-white/75":"bg-black/25"}`})]})]}),o.jsxs("label",{className:"flex flex-col gap-1 font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Speaking style",o.jsx("textarea",{value:l,onChange:w=>h(w.target.value),rows:3,placeholder:"Speak naturally, clearly, and conversationally.",className:`w-full resize-y rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)] ${T?"bg-white/75":"bg-black/25"}`})]})]}),o.jsx("p",{className:"font-mono text-2xs normal-case leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Request-based TTS, separate from GPT Live. Replies are AI-generated speech."})]}):o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Voice FX",o.jsx("select",{value:t,onChange:w=>s(w.target.value),className:"rounded border border-[var(--scout-chrome-border-soft)] bg-black/20 px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)]",children:Ls.map(w=>o.jsxs("option",{value:w.id,children:[w.label," — ",w.family]},w.id))}),o.jsx("span",{className:"font-mono text-2xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink-ghost)]",children:Ls.find(w=>w.id===t)?.description??"Custom voice mood for spoken replies."})]}),o.jsxs("div",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Scout Voice",o.jsx("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-black/20 px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)]",children:f?`${f.modelId}${f.voiceId?` / ${f.voiceId}`:""}`:"Unavailable"})]})]}),o.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["Preferred model",o.jsx("input",{value:m,onChange:w=>x(w.target.value),placeholder:"gpt-4.1-mini",className:`rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)] placeholder:text-[var(--scout-chrome-ink-ghost)] ${T?"bg-white/75":"bg-black/20"}`,disabled:y||b})]}),o.jsxs("label",{className:"flex flex-col gap-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:["System Prompt",o.jsx("textarea",{value:v,onChange:w=>k(w.target.value),rows:6,className:`w-full resize-y rounded border border-[var(--scout-chrome-border-soft)] px-2 py-1.5 font-mono text-xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink)] ${T?"bg-white/75":"bg-black/20"}`,disabled:y||b})]}),C&&o.jsx("div",{className:`font-mono text-xs leading-relaxed ${T?"text-[#93483f]":"text-red-300"}`,children:C}),P&&o.jsx("div",{className:`font-mono text-xs leading-relaxed ${T?"text-[#765923]":"text-lime-200"}`,children:P}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{type:"button",onClick:j,disabled:y||b||!v.trim(),className:`flex items-center justify-center gap-2 rounded px-2.5 py-2 font-mono text-xs font-bold uppercase tracking-[0.12em] transition-opacity disabled:cursor-not-allowed disabled:opacity-40 ${T?"bg-[#282c2d] text-white hover:bg-[#151819]":"bg-lime-300/90 text-black"}`,children:[(y||b)&&o.jsx(re,{size:13,className:"animate-spin"}),b?"Saving":"Save"]}),o.jsx("button",{type:"button",onClick:D,disabled:y||b,className:"rounded border border-[var(--scout-chrome-border-soft)] px-2.5 py-2 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)] disabled:cursor-not-allowed disabled:opacity-40",children:"Reload"})]})]})})}const pa="chill-dispatcher",xa=6e4,ga=2500,va=1.2,ya={lowCutHz:160,highCutHz:5200,bandQ:.35,saturationAmount:.035,bitcrushAmount:0,hissGain:0,hissCutoffHz:1800,presencePeakDb:1.5,presenceCenterHz:1500,presenceQ:.65,compressorThresholdDb:-15,compressorRatio:2.2,clickEnabled:!0,clickGain:.24,clickDurationMs:45,squelchTailEnabled:!0,squelchTailGain:.018,squelchTailDurationMs:95,outputGain:1,wetMix:.38};function ba(e){const t=Math.min(1,e/8);return{saturationAmount:.035+t*.025,presencePeakDb:1.5+t*1.5}}function Sa(e,t){return{...e==="chill-dispatcher"?ya:{},...ba(t)}}function so(e,t,s){return new Promise((i,r)=>{const c=window.setTimeout(()=>r(new Error(s)),t);e.then(i,r).finally(()=>window.clearTimeout(c))})}async function nt(e,t={}){!e.sessionId&&!t.allowCurrentSession||await so(e.cancel(),ga,"Timed out releasing Scout voice session.").catch(()=>{})}function ka(e){const t=e instanceof Error?e.message:String(e);return/session_cancelled|was cancelled|cancelled/i.test(t)}const vi=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function wa(e){const t=[],s=new Set;vi.lastIndex=0;let i;for(;(i=vi.exec(e))!==null;)s.has(i[0])||(s.add(i[0]),t.push(i[0]));return t}function yi(e){const t=e.split("/").filter(Boolean);return t.length<=2?e:`…/${t.slice(-2).join("/")}`}function ja(){return{requesterName:"OpenScout",productName:"Scout Voice",headline:"Turn on local voice",body:"Scout voice handles local speech capture and spoken replies. Start Scout services, then return here to talk with your workspace.",actionLabel:"Return to OpenScout",logo:{url:new URL("/openscout-icon.png",window.location.href).toString(),symbolName:"sparkles"}}}const Ca=["Explain what went wrong here.","Help me rewrite this message.","What should I try next?"];function Pa({height:e,forceExpanded:t=!1,fill:s=!1,presentation:i="chat",onOpenLive:r}={}){const{applyScoutbotUiAction:c,agents:n,route:a,onlineCount:u}=bs(),l=yo(),h=Ht(ht,!1),f=Wt(),m=h&&(f.state==="connecting"||f.state==="live"),[x,v]=ws("openscout.scoutbot.collapsed",!0),[k,y]=d.useState(""),[b,C]=d.useState(!1),[P,j]=d.useState(null),[D,T]=d.useState(null),[w,E]=d.useState(null),[R,I]=d.useState("idle"),[A,B]=ws("openscout.scoutbot.voiceReplies",!1),[q]=To("openscout.scoutbot.voiceSpeed",va),[ee,L]=De("openscout.scoutbot.voicePresetId",pa),[X,ae]=De("openscout.scoutbot.speechProfileId",Ft),[K,_]=De("openscout.scoutbot.customSpeechModelId",Ce.modelId),[F,Xt]=De("openscout.scoutbot.customSpeechVoiceId",Ce.voiceId),[Oe,Kt]=De("openscout.scoutbot.customSpeechInstructions",Ce.instructions),[te,_e]=d.useState(!1),[pt,le]=d.useState(null),[xt,Pe]=d.useState(""),[se,gt]=d.useState(!1),[oo,Jt]=d.useState(null),[Zt,vt]=d.useState(null),[Na,Ue]=d.useState(null),[yt,H]=d.useState(null),[he,Ee]=d.useState(!1),[no,ze]=d.useState(!1),[Y,de]=d.useState(null),[me,Qt]=d.useState(!1),[bt,es]=d.useState(null),[ts,ss]=d.useState(!1),[is,os]=d.useState(!1),[ns,$e]=d.useState(null),[rs,St]=d.useState(null),[Fe,He]=d.useState(""),[We,Ge]=d.useState(""),[as,cs]=d.useState(null),[ro,fe]=d.useState(!1),[ao,pe]=d.useState(0),[co,Ye]=d.useState(!1),[kt,ls]=d.useState(null),qe=ma(X)?X:Ft,Xe=d.useMemo(()=>fa(qe,{modelId:K,voiceId:F,instructions:Oe}),[Oe,K,F,qe]),Ke=d.useRef(Ro()),xe=d.useRef(!1),ie=d.useRef(null),ge=d.useRef(null),ue=d.useRef(null),Je=d.useRef(A);Je.current=A,d.useEffect(()=>{i==="direct-voice"&&(Je.current=!0,B(!0))},[i,B]),d.useEffect(()=>(xe.current=!0,()=>{xe.current=!1,ge.current="discard";const p=ie.current;ie.current=null,p&&nt(p,{allowCurrentSession:!0}),ue.current?.stop(),ue.current=null}),[]);const O=d.useCallback(()=>{ue.current?.stop(),ue.current=null,gt(!1)},[]),Ze=d.useCallback(p=>{if(!p)return;O();const g=Yr(p),S=i==="direct-voice"?Do(g,{speed:q,modelId:Xe.modelId,voiceId:Xe.voiceId,instructions:Xe.instructions}):Lo(g,{speed:q,presetId:ee,params:Sa(ee,u)});ue.current=S,gt(!0),S.promise.catch(N=>{Ao(N)||j(N instanceof Error?N.message:"Scout voice speech failed.")}).finally(()=>{ue.current===S&&(ue.current=null,gt(!1))})},[O,q,Xe,u,i,ee]),us=d.useCallback(p=>{Je.current&&Ze(p)},[Ze]),hs=d.useCallback(p=>{Ze(Se(p))},[Ze]),{openFilePreview:ds}=bs(),ms=bo(),lo=d.useCallback((p,g)=>{const S=window.getSelection()?.toString().trim(),N=Se(g),U=wa(N),W=[];if(S&&(W.push({kind:"action",label:"Copy selection",shortcut:"⌘C",onSelect:()=>{rt(S)}}),W.push({kind:"separator"})),W.push({kind:"action",label:"Copy message",onSelect:()=>{rt(N)}}),U.length>0){W.push({kind:"separator"});for(const ce of U.slice(0,5)){const wt=yi(ce);W.push({kind:"action",label:`Preview ${wt}`,onSelect:()=>ds(ce)})}for(const ce of U.slice(0,5)){const wt=yi(ce);W.push({kind:"action",label:`Open ${wt} in OS`,onSelect:()=>{Z("/api/file/reveal",{method:"POST",body:JSON.stringify({path:ce})}).catch(()=>{})}})}W.push({kind:"action",label:U.length===1?"Copy path":"Copy first path",onSelect:()=>{rt(U[0])}})}W.push({kind:"separator"}),W.push({kind:"action",label:se?"Say again (stop current)":"Say",onSelect:()=>hs(g)}),ms(p,W)},[ds,hs,ms,se]);d.useEffect(()=>()=>{O()},[O]);const uo=Ca,ve=d.useCallback(p=>{const g=[...p.messages].reverse().find(N=>N.role==="user"),S=[...p.messages].reverse().find(N=>N.role==="assistant");vt(g?.body??null),Ue(S?Se(S.body):null)},[]),Te=d.useCallback(async()=>{try{const p=await Z("/api/scoutbot/session");de(p),ve(p.session)}catch{de(null)}},[ve]);d.useEffect(()=>{Te()},[Te]);const Qe=d.useCallback(async()=>{ss(!0),$e(null);try{const p=await Z("/api/scoutbot/config");He(p.model),Ge(p.systemPrompt),St(null)}catch(p){$e(p instanceof Error?p.message:"Could not load settings.")}finally{ss(!1)}},[]);d.useEffect(()=>{he&&Qe()},[Qe,he]),d.useEffect(()=>{if(!he)return;let p=!1;return Z("/api/voice/defaults").then(g=>{p||cs(g)}).catch(()=>{p||cs(null)}),()=>{p=!0}},[he]);const fs=d.useCallback(async()=>{os(!0),$e(null),St(null);try{const p=await Z("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:Fe,systemPrompt:We})});He(p.config.model),Ge(p.config.systemPrompt),St("Saved")}catch(p){$e(p instanceof Error?p.message:"Could not save settings.")}finally{os(!1)}},[Fe,We]),ho=d.useCallback(async p=>{if(!(!p||kt)){ls(p),j(null),O();try{const g=await Z("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:p})});de(g),ve(g.session),Ye(!1),fe(!1),window.dispatchEvent(new CustomEvent(Re,{detail:{id:g.session.id}}))}catch(g){j(g instanceof Error?g.message:"Could not switch session.")}finally{ls(null)}}},[O,kt,ve]),et=d.useCallback(async()=>{if(!(me||b)){if(Y?.session.messages.length===0){y(""),j(null),fe(!1),Ye(!1),H("New chat ready"),pe(p=>p+1);return}Qt(!0),j(null),H("Starting new chat"),O();try{const p=await Z("/api/scoutbot/session/reset",{method:"POST"});de(p),y(""),vt(null),Ue(null),fe(!1),Ye(!1),H("New chat ready"),pe(g=>g+1),window.dispatchEvent(new CustomEvent(Re,{detail:{id:p.session.id}}))}catch(p){H(null),j(p instanceof Error?p.message:"Could not start a new chat.")}finally{Qt(!1)}}},[me,b,Y,O]),mo=d.useCallback(async p=>{if(!(!p||bt)){es(p),j(null),O();try{const g=await Z("/api/scoutbot/session/archive",{method:"POST",body:JSON.stringify({id:p})});de(g),ve(g.session),fe(!1),H("session archived"),window.dispatchEvent(new CustomEvent(Re,{detail:{id:g.session.id}}))}catch(g){j(g instanceof Error?g.message:"Could not archive session.")}finally{es(null)}}},[bt,O,ve]),tt=d.useCallback((p,g)=>{T(g),Jt(p.activeInputDeviceName),E(g?null:p.lastUnavailableReason??"Scout voice service is not reachable."),I("idle")},[]),oe=d.useCallback(async(p=!1)=>{const g=Ke.current;I(N=>N==="launching"?N:"probing");const S=await g.probe(p?{force:!0}:void 0);return tt(g,S),S},[tt]);d.useEffect(()=>{Vo();const p=Ke.current,g=Mo(S=>{T(S.ok),Jt(S.inputDeviceName),E(S.ok?null:S.reason),I("idle")});return p.connectionState==="unknown"?oe():tt(p,p.connectionState==="connected"),g},[tt,oe]);const ps=d.useCallback(()=>{const p=Ke.current;j(null),I("launching"),p.launch({source:"openscout",context:ja()}),window.setTimeout(()=>{oe(!0)},2400)},[oe]),xs=d.useCallback(p=>{const g=Se(p);Ue(g);for(const S of No(p))S.type==="ask-agent"?(H(`Sending to ${S.targetLabel}`),Z("/api/scoutbot/actions/ask",{method:"POST",body:JSON.stringify({targetLabel:S.targetLabel,targetAgentId:S.targetAgentId,body:S.body,channel:S.channel})}).then(N=>{H(N.flightId?`Sent to ${N.targetAgentId??N.targetLabel} · run ${N.flightId}`:`Sent to ${N.targetAgentId??N.targetLabel}`)}).catch(N=>{H(null),j(N instanceof Error?N.message:"Could not send to agent.")})):S.type!=="reminder"&&c(S);us(g)},[c,us]);d.useEffect(()=>{const p=()=>{H("Scoutbot replied by voice"),Te()},g=()=>{H("Scoutbot chat changed"),Te()};return window.addEventListener(Ss,p),window.addEventListener(Re,g),()=>{window.removeEventListener(Ss,p),window.removeEventListener(Re,g)}},[Te]);const Ne=d.useCallback(async p=>{const g=p.trim();if(!(!g||b)){C(!0),j(null),vt(g),Ue(null),H("Sending"),y(S=>S.trim()===g?"":S);try{await Eo().catch(()=>null);const S=await Z("/api/scoutbot/chat",{method:"POST",body:JSON.stringify({body:g,route:a,uiContext:So("web")})});de({session:S.session,sessions:S.sessions,config:S.config}),H("Reply received"),xs(S.reply.body)}catch(S){H(null),j(S instanceof Error?S.message:"Could not send.")}finally{C(!1)}}},[xs,a,b]),gs=d.useCallback(async()=>{if(te)return;const p=Ke.current;if(ge.current=null,j(null),Pe(""),le("starting"),D!==!0&&!await oe(!0)){le(null);return}let g=null,S=!1;const N=async()=>{!g||S||(S=!0,await nt(g,{allowCurrentSession:ie.current===g}),ie.current===g&&(ie.current=null))};try{if(g=await p.startLive({onState:le,onPartial:Pe},{surface:i==="direct-voice"?"direct-voice":"chat-composer"}),!xe.current){await nt(g,{allowCurrentSession:!0});return}ie.current=g,_e(!0);const U=await g.result;if(await N(),!xe.current||(_e(!1),Pe(""),ge.current))return;le("done"),U.text&&await Ne(U.text)}catch(U){const W=ge.current;if(!xe.current)return;const ce=!!W||ka(U);if(await N(),_e(!1),Pe(""),W==="stop-failed")return;le(ce?null:"error"),ce||j(U instanceof Error?U.message:"Scout voice recording failed.")}finally{xe.current&&await N(),ge.current=null}},[Ne,i,oe,te,D]),vs=d.useCallback(async()=>{const p=ie.current;if(p){le("processing");try{await so(p.stop(),xa,"Scout voice did not finish processing the recording.")}catch(g){ge.current="stop-failed",await nt(p,{allowCurrentSession:!0}),ie.current===p&&(ie.current=null,_e(!1),Pe(""),le("error")),j(g instanceof Error?`Scout voice recording did not finish: ${g.message}`:"Scout voice recording did not finish.")}}},[]);d.useEffect(()=>{const p=()=>v(!1);return window.addEventListener("scout:scoutbot-panel-open",p),()=>window.removeEventListener("scout:scoutbot-panel-open",p)},[v]),d.useEffect(()=>Co(()=>v(!x)),[x,v]),d.useEffect(()=>{const p=g=>{const S=g.detail,N=S&&typeof S=="object"&&"body"in S?S.body:null;typeof N=="string"&&N.trim()&&(v(!1),Ne(N))};return window.addEventListener(js,p),()=>window.removeEventListener(js,p)},[Ne,v]),d.useEffect(()=>{const p=g=>{const S=g.detail,N=S&&typeof S=="object"&&"body"in S?S.body:null;typeof N=="string"&&N.trim()&&(v(!1),y(N),pe(U=>U+1))};return window.addEventListener("scout:scoutbot-compose",p),()=>window.removeEventListener("scout:scoutbot-compose",p)},[v]);const ys=d.useMemo(()=>{const p=se?"speaking":b?"thinking":te?"listening":"idle",g=Y?.session??null,S=g&&g.messages.length>0?g.messages[g.messages.length-1]:null;return{activity:p,brief:{lastDeliveredAt:null},reminders:{dueCount:0,upcomingCount:0,due:[],next:null},voice:{available:D,setupBlocked:D===!1,replies:A},error:P,session:{title:g?.title??null,lastActivityAt:S?.createdAt??g?.updatedAt??null},conversation:{messageCount:g?.messages.length??0,loading:Y===null}}},[se,b,te,D,A,P,Y]);d.useEffect(()=>{l?.publishState(ys)},[l,ys]),d.useEffect(()=>{if(!l)return;const p={focusScoutbot:()=>v(!1),triggerBrief:()=>{v(!1),pe(g=>g+1)},triggerAskState:()=>{v(!1),pe(g=>g+1)},toggleVoiceReplies:()=>{const g=!A;B(g),g||O()},openScoutbotSettings:()=>{v(!1),Ee(!0)},startNewChat:()=>{v(!1),me||et()},dismissReminder:()=>{},askReminderStatus:()=>{v(!1),pe(g=>g+1)}};l.registerActions(p)},[l,v,A,B,O,Ee,me,et]),d.useEffect(()=>{D===!0&&ze(!1)},[D]);const fo=m?"Live call":te?pt==="processing"?"Sending":"Stop":R==="probing"?"Checking Voice":R==="launching"?"Opening Scout":D===!1?"Open Scout":"Start Talking",po=Y!==null&&Y.session.messages.length===0&&!b;if(i==="direct-voice")return o.jsx(da,{messages:Y?.session.messages??[],pendingAsk:b?Zt:null,partial:xt,error:P,status:yt,recording:te,sending:b,speaking:se,voiceAvailable:D,voiceInputSource:oo,voiceProbeState:R,voiceState:pt,voiceReplies:A,settingsOpen:he,assistantModel:Y?.session.model??Y?.config.model??null,setupPanel:D===!1?o.jsx(xi,{issue:w,probeState:R,onLaunch:ps,onRetry:()=>{oe(!0)},onSettings:()=>Ee(!0),onDismiss:()=>ze(!1)}):null,settingsPanel:o.jsx(gi,{presentation:"direct-voice",voicePresetId:ee,onVoicePresetId:L,speechSelectionId:qe,onSpeechSelectionId:ae,customSpeechModelId:K,onCustomSpeechModelId:_,customSpeechVoiceId:F,onCustomSpeechVoiceId:Xt,customSpeechInstructions:Oe,onCustomSpeechInstructions:Kt,voiceDefaults:as,modelDraft:Fe,onModelDraft:He,promptDraft:We,onPromptDraft:Ge,configLoading:ts,configSaving:is,configError:ns,configStatus:rs,onSave:()=>{fs()},onReload:()=>{Qe()}}),onPrimaryAction:()=>{se?O():te?vs():D===!1?oe(!0):gs()},onToggleVoiceReplies:()=>{const p=!A;Je.current=p,B(p),p||O()},onToggleSettings:()=>Ee(p=>!p),onNewChat:()=>{me||et()},onOpenLive:r});if(x&&!t)return o.jsx("div",{className:"flex shrink-0 items-center border-t border-[var(--scout-chrome-border-soft)] px-3 py-1.5",children:o.jsx(Po,{})});const xo=s?"flex h-full min-h-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]":e===void 0?"flex max-h-[60vh] shrink-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]":"flex shrink-0 flex-col overflow-hidden border-t border-[var(--scout-chrome-border-soft)]",go=e===void 0||s?void 0:{height:`${e}px`};return o.jsxs("section",{className:xo,style:go,children:[o.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-3 pt-2.5 pb-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("div",{className:"flex min-w-0 items-center gap-2",children:o.jsx(gn,{size:20,className:"shrink-0 text-lime-300","aria-hidden":"true"})}),o.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[o.jsx(pi,{icon:A?o.jsx(Bi,{size:11}):o.jsx(Oi,{size:11}),title:m?A?"Voice replies on for typed chat (live call has its own audio)":"Voice replies off for typed chat (live call has its own audio)":A?"Voice replies on (click to mute)":"Voice replies off (click to enable)",onClick:()=>{const p=!A;B(p),p||O()},active:A}),!t&&o.jsx(pi,{icon:o.jsx(Mt,{size:11}),title:"Minimize",onClick:()=>v(!0)})]})]}),he&&o.jsx(gi,{presentation:"chat",voicePresetId:ee,onVoicePresetId:L,speechSelectionId:qe,onSpeechSelectionId:ae,customSpeechModelId:K,onCustomSpeechModelId:_,customSpeechVoiceId:F,onCustomSpeechVoiceId:Xt,customSpeechInstructions:Oe,onCustomSpeechInstructions:Kt,voiceDefaults:as,modelDraft:Fe,onModelDraft:He,promptDraft:We,onPromptDraft:Ge,configLoading:ts,configSaving:is,configError:ns,configStatus:rs,onSave:()=>{fs()},onReload:()=>{Qe()}})]}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col px-3 pb-1.5",children:Y&&o.jsx(Zr,{state:Y,chatExpanded:ro,onToggleExpanded:()=>fe(p=>!p),sessionPickerOpen:co,onToggleSessionPicker:()=>Ye(p=>!p),onStartNewChat:()=>{et()},startingNewChat:me,onSwitchSession:p=>{ho(p)},switchingSessionId:kt,sending:b,briefing:!1,pendingAsk:b?Zt:null,onArchiveSession:p=>{mo(p)},archivingSessionId:bt,onAssistantContextMenu:lo,suggestedPrompts:uo,onSelectPrompt:p=>{y(p),fe(!1)}})}),o.jsxs("div",{className:"flex shrink-0 flex-col gap-1.5 border-t border-[var(--scout-chrome-border-soft)] bg-black/10 px-3 pt-2 pb-2.5",children:[D===!1&&no&&!m&&o.jsx(xi,{issue:w,probeState:R,onLaunch:ps,onRetry:()=>{oe(!0)},onSettings:()=>Ee(!0),onDismiss:()=>ze(!1)}),(xt||se)&&!m&&o.jsxs("div",{className:"flex items-center justify-between gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-black/10 px-2.5 py-2 font-mono text-xs leading-relaxed text-[var(--scout-chrome-ink-faint)]",children:[o.jsx("span",{className:"min-w-0 truncate",children:se?"Speaking reply…":xt}),se&&o.jsx("button",{type:"button",title:"Stop spoken reply",onClick:O,className:"shrink-0 rounded border border-[var(--scout-chrome-border-soft)] p-1 text-[var(--scout-chrome-ink)] hover:bg-[var(--scout-chrome-hover)]",children:o.jsx(wi,{size:11,className:"fill-current"})})]}),yt&&!b&&o.jsx("div",{className:"font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:yt}),o.jsx(ea,{agents:n,draft:k,onDraftChange:y,onSubmit:()=>{Ne(k)},sending:b,recording:te,voiceLabel:fo,voiceBusy:pt==="processing"||R==="probing"||R==="launching",voiceUnavailable:D===!1,voiceHeld:m,onMicClick:()=>{if(!m){if(D===!1){ze(!0);return}te?vs():gs()}},prominent:po&&!m,autoFocus:t,focusSignal:ao}),P&&o.jsx("div",{className:"rounded border border-red-400/30 bg-red-400/10 px-2.5 py-2 font-mono text-xs leading-relaxed text-red-200",children:P})]})]})}function io({dictationActive:e=!1,autoStart:t=!1}){const s=Ht(ht,!1),{enabled:i,state:r,leaseId:c,startCall:n,endCall:a}=Wt(),u=d.useRef(!1),l=d.useRef(null),[h,f]=d.useState(()=>window.innerWidth>=720&&window.innerHeight>=520?"page":"compact"),m=window.webkit?.messageHandlers?.scoutRealtimeVoice;return d.useEffect(()=>{const x=()=>{f(window.innerWidth>=720&&window.innerHeight>=520?"page":"compact")};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),d.useEffect(()=>{m?.postMessage({kind:"session-state",state:r,leaseId:c})},[c,m,r]),d.useEffect(()=>{const x=()=>{if(l.current)return l.current;const k=a().finally(()=>{l.current===k&&(l.current=null)});return l.current=k,k},v=()=>{x()};return window.__scoutRealtimeVoiceStop=x,window.addEventListener(ks,v),window.__scoutRealtimeVoiceStopRequested&&x(),()=>{window.removeEventListener(ks,v),window.__scoutRealtimeVoiceStop===x&&delete window.__scoutRealtimeVoiceStop}},[a]),d.useEffect(()=>{!t||e||!s||!i||u.current||r!=="idle"&&r!=="ended"&&r!=="error"||(u.current=!0,n())},[t,e,s,i,n,r]),s?i?o.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[o.jsx(bi,{state:r,onMinimize:m?()=>m.postMessage("minimize"):void 0,onExpand:m?()=>m.postMessage(h==="page"?"restore":"expand"):void 0,layout:h}),o.jsx(Si,{dictationActive:e,layout:h})]}):o.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[o.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is disabled"}),o.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"Enable realtime voice in Settings → Voice. The footer Voice control starts and manages calls."})]}):o.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[o.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is off"}),o.jsxs("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:["Turn on the ",o.jsx("span",{className:"font-mono",children:ht})," flag to hold live conversations with Scoutbot. Calls use the configured OpenAI API account."]})]})}function Ea(){const e=Ht(ht,!1),{enabled:t,state:s}=Wt(),[i,r]=d.useState("direct"),c=e&&t;return i==="direct"?o.jsx("main",{className:"h-full min-h-0 overflow-hidden bg-[#f3f0e9]",children:o.jsx(Pa,{forceExpanded:!0,fill:!0,presentation:"direct-voice",onOpenLive:()=>r("realtime")})}):o.jsxs("main",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-[var(--scout-chrome-bg)]",children:[o.jsxs("header",{className:"flex min-h-14 shrink-0 items-center justify-between gap-4 border-b border-[var(--scout-chrome-border-soft)] px-4 py-2.5 sm:px-7",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[o.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-[17px] font-semibold tracking-[-0.018em] text-[var(--scout-chrome-ink-strong)]",children:"GPT Live"}),o.jsx("span",{className:"hidden h-4 w-px bg-[var(--scout-chrome-border-soft)] sm:block","aria-hidden":"true"}),o.jsxs("span",{className:"hidden items-center gap-2 text-xs text-[var(--scout-chrome-ink-faint)] sm:flex",children:[o.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${c?"bg-[var(--scout-accent)]":"bg-[var(--scout-chrome-ink-ghost)]"}`,"aria-hidden":"true"}),c?"Ready for a live call":"Live voice unavailable"]})]}),o.jsxs("div",{className:"flex rounded-md border border-[var(--scout-chrome-border-soft)] bg-[var(--scout-chrome-hover)] p-0.5",role:"tablist","aria-label":"Voice mode",children:[o.jsx("button",{type:"button",role:"tab","aria-selected":"false",onClick:()=>r("direct"),className:"rounded-[4px] px-3 py-1.5 text-[11px] font-medium text-[var(--scout-chrome-ink-faint)] transition-colors hover:text-[var(--scout-chrome-ink-strong)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--scout-accent)]",children:"Direct"}),o.jsx("button",{type:"button",role:"tab","aria-selected":"true",className:"rounded-[4px] bg-[var(--scout-chrome-ink-strong)] px-3 py-1.5 text-[11px] font-medium text-[var(--scout-chrome-bg)] shadow-[0_1px_2px_rgba(0,0,0,0.14)]",children:"Live"})]})]}),o.jsx("section",{className:"min-h-0 flex-1 overflow-hidden",children:c?o.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[o.jsx(bi,{state:s,layout:"page"}),o.jsx(Si,{dictationActive:!1,layout:"page"})]}):o.jsx(io,{})})]})}const Ta=vn({id:"voice",label:"Voice",route:{view:"voice"},webPath:"/voice",screen:"RealtimeVoiceScreen",embed:{path:"/embed/voice",profile:"macos.voice",rootClassName:"s-voice-embed",chrome:{showSecondaryNav:!1,showPageStatusBar:!1},hosts:{macos:!0},resolveEmbedProps:e=>({dictationActive:e.get("dictationActive")==="1",autoStart:e.get("autoStart")==="1"})}}),rc=Object.freeze(Object.defineProperty({__proto__:null,RealtimeVoicePage:Ea,RealtimeVoiceScreen:io,scoutSurface:Ta},Symbol.toStringTag,{value:"Module"}));export{Ea as R,Pa as S,rc as a};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{r as l,j as n}from"./index-Bli6bTLU.js";import{a as X,p as Z}from"./ui-LM8pS8qE.js";/* empty css */import{a as T,s as q,l as ee,L as te,f as K,S as ne,r as se,b as re,c as _,d as ie,u as ae,V as A,C as H,D as le,e as oe}from"./usePierreRuntime-Bq6mXrgd.js";import{C as ce}from"./chevron-down-Da5tV19_.js";import{C as de}from"./check-Bfs7hMb1.js";import{L as ue}from"./loader-circle-DoT8gpw6.js";import{S as fe}from"./send-horizontal-BXo2uz3Z.js";import{F as he}from"./file-code-corner-CX53Cd9y.js";import{C as me}from"./code-xml-ByQsfOI_.js";import{X as pe}from"./x-BJyPzFnn.js";import{r as O,a as Y,f as V}from"./cache-BO2Bd_LV.js";import{M as xe}from"./message-square-DlY4EneU.js";import{R as ge}from"./refresh-cw-IgN2fZLM.js";import{P as be}from"./plus-64n9qucr.js";import{a as B}from"./api-DEHEgJ9m.js";import"./chunk-HRAB3GC3-BUVYXXAp.js";import"./createLucideIcon-DLlxGjKt.js";function je({snapshot:e,selectedFile:t,targets:r,targetId:s,onTargetId:i,draft:c,onDraft:f,contextItems:o,onRemoveContextItem:p,pending:a,status:d,error:g,textareaRef:k,onSubmit:S}){const[u,y]=l.useState(!1),b=l.useRef(null),w=r.find(h=>h.id===s)??null,m=w?.label??"Scout",C=r[0]?.id??null,N=t?T(t):null,I=(c.trim().length>0||o.length>0)&&!a,R=l.useMemo(()=>[...r.map(h=>({id:h.id,label:h.label,suffix:h.id===C?"best context":null})),{id:"scout",label:"Scout",suffix:null}],[C,r]);return l.useEffect(()=>{if(!u)return;const h=$=>{const D=b.current;D&&$.target instanceof Node&&D.contains($.target)||y(!1)};return document.addEventListener("pointerdown",h),()=>document.removeEventListener("pointerdown",h)},[u]),n.jsxs("div",{className:"rd-comment",children:[o.length>0?n.jsx("div",{className:"rd-comment-context","aria-label":"Included diff context",children:o.map(h=>n.jsx(ye,{item:h,disabled:a,onRemove:p},h.id))}):null,n.jsxs("div",{className:"rd-comment-main",children:[n.jsxs("div",{className:"rd-target-picker",ref:b,children:[n.jsxs("button",{type:"button",className:"rd-target-button",onClick:()=>y(h=>!h),onKeyDown:h=>{h.stopPropagation(),h.key==="Escape"&&y(!1)},disabled:a,"aria-label":"Diff comment target","aria-haspopup":"listbox","aria-expanded":u,title:"Diff comment target",children:[n.jsx("span",{children:m}),n.jsx(ce,{size:13,strokeWidth:2,"aria-hidden":!0})]}),u?n.jsx("div",{className:"rd-target-menu",role:"listbox","aria-label":"Diff comment target",children:R.map(h=>{const $=h.id===(w?.id??"scout");return n.jsxs("button",{type:"button",className:"rd-target-option",role:"option","aria-selected":$,onClick:()=>{i(h.id),y(!1)},children:[n.jsx("span",{className:"rd-target-option-label",children:h.label}),h.suffix?n.jsx("span",{className:"rd-target-option-suffix",children:h.suffix}):null,n.jsx("span",{className:"rd-target-option-check","aria-hidden":!0,children:$?n.jsx(de,{size:12,strokeWidth:2.2}):null})]},h.id)})}):null]}),n.jsx("textarea",{ref:k,value:c,onChange:h=>f(h.currentTarget.value),onKeyDown:h=>{h.stopPropagation(),(h.metaKey||h.ctrlKey)&&h.key==="Enter"&&(h.preventDefault(),S())},rows:1,disabled:a,placeholder:o.length>0?`Send to ${m} with included context`:"Leave a note on this diff…","aria-label":"Diff comment"}),n.jsxs("button",{type:"button",className:"rd-comment-send",disabled:!I,onClick:S,title:"Send diff comment","aria-label":"Send diff comment",children:[a?n.jsx(ue,{size:13,className:"rd-comment-spin","aria-hidden":!0}):n.jsx(fe,{size:13,"aria-hidden":!0}),n.jsx("span",{children:a?"Sending":"Send"})]})]}),n.jsx("div",{className:"rd-comment-meta",children:g?n.jsx("span",{className:"err",children:g}):d?n.jsx("span",{className:"ok",children:d}):n.jsxs("span",{children:[e.scope?.kind==="session"?"Session diff":"Worktree diff",N?` · ${N}`:""]})})]})}function ye({item:e,disabled:t,onRemove:r}){const s=e.kind==="file"?he:me;return n.jsxs("div",{className:`rd-context-item ${e.kind}`,children:[n.jsxs("div",{className:"rd-context-head",children:[n.jsx("span",{className:"rd-context-icon","aria-hidden":!0,children:n.jsx(s,{size:12,strokeWidth:2})}),n.jsx("span",{className:"rd-context-label",title:e.label,children:e.label}),n.jsx("span",{className:"rd-context-detail",children:e.detail}),n.jsx("button",{type:"button",className:"rd-context-remove",onClick:()=>r(e.id),disabled:t,title:"Remove included context","aria-label":"Remove included context",children:n.jsx(pe,{size:11,strokeWidth:2.2,"aria-hidden":!0})})]}),e.preview?n.jsx("pre",{className:"rd-context-preview",children:e.preview}):null]})}function Ce({heading:e,worktreePath:t,snapshot:r,freshness:s,activeLayer:i,onLayer:c,layout:f,onLayout:o,refreshing:p,onRefresh:a,onFocusComment:d,onClose:g,onOpenAsPage:k}){const{dir:S}=q(t);return n.jsxs("div",{className:"rd-header",children:[n.jsxs("div",{className:"rd-header-id",children:[n.jsxs("div",{className:"rd-header-title",children:[n.jsx("span",{className:"rd-header-name",title:t,children:e}),r.scope?n.jsx(ke,{snapshot:r}):null,S?n.jsx("span",{className:"rd-header-dir",children:S}):null]}),n.jsx("div",{className:"rd-header-sub",children:n.jsx(Ne,{layers:r.layers,activeLayer:i,onLayer:c})}),n.jsx(Se,{freshness:s,generatedAt:r.generatedAt})]}),n.jsxs("div",{className:"rd-header-actions",children:[n.jsx("button",{type:"button",className:"rd-close","aria-label":"Comment on diff",title:"Comment on diff",onClick:d,children:n.jsx(xe,{size:14,strokeWidth:2,"aria-hidden":!0})}),n.jsxs("div",{className:"rd-segmented",role:"group","aria-label":"Diff layout",children:[n.jsx("button",{type:"button",className:f==="unified"?"on":"","aria-pressed":f==="unified",onClick:()=>o("unified"),children:"Unified"}),n.jsx("button",{type:"button",className:f==="split"?"on":"","aria-pressed":f==="split",onClick:()=>o("split"),children:"Split"})]}),n.jsx("button",{type:"button",className:`rd-close${p?" spinning":""}`,"aria-label":"Refresh diff",title:"Fetch fresh diff",onClick:a,disabled:p,children:n.jsx(ge,{size:14,strokeWidth:2,"aria-hidden":!0})}),k?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Open diff as page",title:"Open as full page",onClick:k,children:"↗"}):null,g?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Close",onClick:g,children:"✕"}):null]})]})}function $e({snapshot:e}){const t=[];e.coverage.truncatedLayers>0&&t.push({level:"warning",text:`${e.coverage.truncatedLayers} layer${e.coverage.truncatedLayers===1?"":"s"} truncated — the native diff hit a size budget; some files or hunks are omitted.`}),e.coverage.scanBudgetReached&&t.push({level:"warning",text:"Scan budget reached — this diff is partial."});for(const r of e.diagnostics)t.push({level:r.level,text:r.path?`${r.message} (${r.path})`:r.message});return t.length===0?null:n.jsx(n.Fragment,{children:t.map((r,s)=>n.jsxs("div",{className:`rd-banner ${r.level}`,children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:r.text})]},s))})}function ke({snapshot:e}){const t=e.scope;if(!t)return null;const r=t.kind==="session"?`Session · ${t.filteredPaths.length} files`:t.filteredPaths.length>0?`Filtered · ${t.filteredPaths.length} files`:"Worktree",s=t.kind==="session"?`${t.label}: path-filtered diff from ${t.changedFiles} changed / ${t.touchedFiles} touched session files`:t.label;return n.jsx("span",{className:`rd-scope-pill ${t.kind}`,title:s,children:r})}function Se({freshness:e,generatedAt:t}){const r=e?.fetchedAt??t,s=Math.max(0,Date.now()-r),i=e?.cacheHit?`Prefetched ${O(s)}`:`Updated ${O(s)}`;return n.jsxs("div",{className:"rd-freshness",title:new Date(r).toLocaleString(),children:[n.jsx("span",{children:i}),e?.refreshing?n.jsx("span",{children:"Refreshing…"}):null,e?.refreshError?n.jsx("span",{children:"Refresh failed"}):null]})}function Ne({layers:e,activeLayer:t,onLayer:r}){return n.jsx("div",{className:"rd-layers",role:"tablist","aria-label":"Diff layers",children:e.map(s=>{const i=ee(s);return n.jsxs("button",{type:"button",role:"tab","aria-selected":s.kind===t,className:"rd-layer-tab"+(s.kind===t?" on":""),onClick:()=>r(s.kind),title:s.shortstat??void 0,children:[n.jsx("span",{children:te[s.kind]??s.kind}),n.jsx("span",{className:"rd-layer-stat",children:s.files.length===0?"clean":n.jsxs(n.Fragment,{children:[s.files.length,"f"," ",n.jsxs("span",{style:{color:"var(--rd-add)"},children:["+",i.add]})," ",n.jsxs("span",{style:{color:"var(--rd-del)"},children:["−",i.del]}),s.truncated?" ⚠":""]})})]},s.kind)})})}const G="openscout.repo-diff.files-rail-width",U=268,we=196,ve=520;function Ie(e,t){if(e.length<=t)return e;const r=e.lastIndexOf(".");if(r<=0){const p=Math.max(1,Math.floor((t-1)/2)),a=t-p-1;return e.slice(0,p)+"…"+e.slice(-Math.max(1,a))}const s=e.slice(0,r),i=e.slice(r),c=t-i.length-1;if(c<2){const p=Math.max(1,t-i.length-1);return s.slice(0,p)+"…"+i}const f=Math.max(1,Math.floor(c/2)),o=Math.max(1,c-f);return s.slice(0,f)+"…"+s.slice(-o)+i}function De(e,t){return Math.max(8,Math.floor((e-178-t*14)/6.7))}function W(e){return Math.max(we,Math.min(ve,Math.round(e)))}function Re(){if(typeof window>"u")return U;const e=Number(window.localStorage.getItem(G));return Number.isFinite(e)?W(e):U}function Le(e){const t={name:"",path:"",firstIndex:Number.MAX_SAFE_INTEGER,children:new Map,files:[]};for(const r of e){t.firstIndex=Math.min(t.firstIndex,r.index);const s=r.dir?r.dir.split("/").filter(Boolean):[];let i=t;for(const c of s){const f=i.path?`${i.path}/${c}`:c;let o=i.children.get(c);o||(o={name:c,path:f,firstIndex:r.index,children:new Map,files:[]},i.children.set(c,o)),o.firstIndex=Math.min(o.firstIndex,r.index),i=o}i.files.push(r)}return t}function J(e){let t=e.files.length;for(const r of e.children.values())t+=J(r);return t}function Pe({layer:e,selectedFileKey:t,onSelect:r,onIncludeFile:s}){const[i,c]=l.useState(Re),[f,o]=l.useState(()=>new Set),p=l.useMemo(()=>(e?.files??[]).map((u,y)=>{const b=K(u,y),w=T(u),{name:m,dir:C}=q(w),N=(u.status==="renamed"||u.status==="copied")&&u.oldPath&&u.newPath&&u.oldPath!==u.newPath;return{file:u,index:y,key:b,display:w,name:m,dir:C,renamed:!!N}}),[e]),a=l.useMemo(()=>Le(p),[p]),d=l.useCallback(u=>{o(y=>{const b=new Set(y);return b.has(u)?b.delete(u):b.add(u),b})},[]),g=l.useCallback(u=>{u.preventDefault();const y=u.clientX,b=i,w=C=>{c(W(b+C.clientX-y))},m=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",m),c(C=>{const N=W(C);return window.localStorage.setItem(G,String(N)),N})};window.addEventListener("pointermove",w),window.addEventListener("pointerup",m,{once:!0})},[i]),k=(u,y)=>n.jsx(Fe,{entry:u,depth:y,railWidth:i,selected:u.key===t,onSelect:r,onIncludeFile:s},u.key),S=(u,y)=>{const b=[],w=[...u.children.values()].sort((m,C)=>m.firstIndex!==C.firstIndex?m.firstIndex-C.firstIndex:m.name.localeCompare(C.name));for(const m of w){const C=f.has(m.path);b.push(n.jsxs("button",{type:"button",className:"rd-dir-row",style:{paddingLeft:12+y*14},onClick:()=>d(m.path),title:m.path,children:[n.jsx("span",{className:"rd-dir-caret",children:C?"›":"⌄"}),n.jsx("span",{className:"rd-dir-name",children:m.name}),n.jsx("span",{className:"rd-dir-count",children:J(m)})]},`dir:${m.path}`)),C||b.push(...S(m,y+1))}for(const m of u.files)b.push(k(m,y));return b};return n.jsxs("div",{className:"rd-rail",style:{width:i},children:[n.jsx("div",{className:"rd-rail-head",children:e?`Changed files · ${e.files.length}`:"Changed files"}),n.jsx("div",{className:"rd-rail-list",children:S(a,0)}),n.jsx("div",{className:"rd-rail-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file navigation",onPointerDown:g})]})}function Fe({entry:e,depth:t,railWidth:r,selected:s,onSelect:i,onIncludeFile:c}){const{file:f,key:o,display:p,name:a,dir:d,renamed:g}=e,k=De(r,t),S=Ie(a,k);return n.jsxs("div",{className:"rd-file-row"+(s?" on":""),title:g?`${f.oldPath} → ${f.newPath}`:p,children:[n.jsxs("button",{type:"button",className:"rd-file-pick",style:{paddingLeft:18+t*14},onClick:()=>i(o),children:[n.jsx("span",{className:`rd-file-glyph ${f.status}`,children:ne[f.status]}),n.jsxs("span",{className:"rd-file-id",children:[n.jsx("span",{className:"rd-file-name",children:S}),n.jsx("span",{className:"rd-file-dir",children:g?`${f.oldPath} → ${d||a}`:d}),n.jsx(Ee,{file:f})]})]}),n.jsx("span",{className:"rd-file-churn",children:f.binary?n.jsx("span",{className:"add",style:{color:"var(--muted)"},children:"bin"}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"add",children:["+",f.additions??0]}),n.jsxs("span",{className:"del",children:["−",f.deletions??0]})]})}),n.jsx("button",{type:"button",className:"rd-file-include",onClick:u=>{u.stopPropagation(),c(f,o)},"aria-label":`Include ${p} in comment`,title:"Include in comment",children:n.jsx(be,{size:12,strokeWidth:2,"aria-hidden":!0})})]})}function Ee({file:e}){const t=[];return e.binary&&t.push("BINARY"),e.truncated&&t.push("TRUNCATED"),e.status==="conflict"&&t.push("CONFLICT"),t.length===0?null:n.jsx("span",{className:"rd-file-tags",children:t.map(r=>n.jsx("span",{className:"rd-file-tag",children:r},r))})}function Me(e){switch(e?.trim().toLowerCase()){case"active":case"working":case"running":case"in_turn":return 80;case"queued":case"waiting":case"waking":case"in_flight":return 50;case"idle":case"available":return 25;case"offline":case"retired":case"stale":return-40;default:return 0}}function Te(e){return e.newPath??e.oldPath??"(unknown)"}function Q(e){const t=e.scope?.kind==="session"?e.scope.agentId:null,r=new Map;for(const s of e.scout.hints)s.agentId&&r.set(s.agentId,(r.get(s.agentId)??0)+1);return e.scout.agents.map(s=>({id:s.id,label:X(s),score:Me(s.state)+(s.id===t?1e3:0)+(r.get(s.id)??0)*10})).sort((s,i)=>{const c=i.score-s.score;return c!==0?c:s.label.localeCompare(i.label)})}function Ae(e){return Q(e)[0]??null}function Ke(e){const t=e.files.reduce((r,s)=>({add:r.add+(s.additions??0),del:r.del+(s.deletions??0)}),{add:0,del:0});return`${e.kind}: ${e.files.length} file${e.files.length===1?"":"s"}, +${t.add} -${t.del}${e.truncated?", truncated":""}`}function z(e){const t=e.binary?"binary":`+${e.additions??0} -${e.deletions??0}`;return`${e.status}: ${Te(e)} (${t}${e.truncated?", truncated":""})`}function We(e){const t=e.scope;return t?t.kind==="session"?`session ${t.sessionId??t.refId??"(unknown)"} (${t.changedFiles} changed / ${t.touchedFiles} touched files, ${t.include})`:t.filteredPaths.length>0?`filtered worktree (${t.filteredPaths.length} paths)`:"worktree":"worktree"}function ze(e){const{comment:t,includedContext:r=[],snapshot:s,activeLayer:i,selectedFile:c}=e,o=((i?s.layers.find(d=>d.kind===i)??null:null)?.files??s.layers.flatMap(d=>d.files)).slice(0,12).map(z),p=s.scout.agents.map(d=>X(d)).slice(0,8),a=["Operator comment on repo diff:",t,"","Repo Diff context:",`- Worktree: ${s.worktreePath}`,`- Scope: ${We(s)}`,`- Active layer: ${i??"none"}`];return r.length>0&&a.splice(3,0,"Included diff context:",...r.map(d=>d.trim()).filter(Boolean),""),c&&a.push(`- Selected file: ${z(c)}`),a.push(`- Layers: ${s.layers.map(Ke).join("; ")}`),p.length>0&&a.push(`- Attached agents: ${p.join(", ")}`),s.scout.sessions.length>0&&a.push(`- Sessions: ${s.scout.sessions.map(d=>d.id).slice(0,8).join(", ")}`),o.length>0&&a.push(`- Changed files: ${o.join(", ")}`),s.diagnostics.length>0&&a.push(`- Diagnostics: ${s.diagnostics.map(d=>d.message).join("; ")}`),a.join(`
|
|
2
|
-
`)}function _e(e){const{snapshot:t,activeLayer:r,file:s}=e,i=[r??"diff",z(s)];return t.scope?.kind==="session"&&i.push(`session ${t.scope.sessionId??t.scope.refId??"scope"}`),`[Diff context: ${i.join(" · ")}]`}function He(e,t,r){return!e||!t?null:e.files.find((s,i)=>r(s,i)===t)??null}function Oe(e,t=120){const r=e.replace(/\s+/g," ").trim();return r.length>t?`${r.slice(0,t-3)}...`:r}function Be(e,t=7){const r=e.trimEnd().split(`
|
|
3
|
-
`),s=r.slice(0,t),i=r.length-s.length;return i>0?`${s.join(`
|
|
4
|
-
`)}
|
|
5
|
-
... ${i} more line${i===1?"":"s"}`:s.join(`
|
|
6
|
-
`)}function Ue(e){return e.newLine!=null?`L${e.newLine}`:e.oldLine!=null?`old L${e.oldLine}`:"line"}function Xe(e){return e.side==="add"?"+":e.side==="del"?"-":" "}function qe(e){const{snapshot:t,activeLayer:r,file:s}=e,i=T(s),c=s.binary?"binary":`+${s.additions??0} -${s.deletions??0}`;return{id:`file:${r??"diff"}:${i}`,kind:"file",label:i,detail:`${r??"diff"} · ${s.status} · ${c}`,preview:null,snippet:_e({snapshot:t,activeLayer:r,file:s})}}function Ye(e){const{line:t}=e,r=Xe(t);return{id:`line:${t.layer}:${t.filePath}:${t.side}:${t.oldLine??""}:${t.newLine??""}`,kind:"line",label:`${t.filePath}:${Ue(t)}`,detail:`${t.layer} · ${r}`,preview:`${r} ${Oe(t.text,180)}`,snippet:se({line:t})}}function Ve(e){const{selection:t}=e,r=t.filePath??"diff selection",s=t.text.trim().split(`
|
|
7
|
-
`).filter(Boolean).length;return{id:`selection:${t.layer??"diff"}:${r}:${t.text}`,kind:"selection",label:r,detail:`${t.layer??"diff"} · ${s} line${s===1?"":"s"}`,preview:Be(t.text),snippet:re({selection:t})}}function Ge({snapshot:e,activeLayer:t,selectedFile:r,setSelectedFileKey:s,resetKey:i}){const[c,f]=l.useState(""),[o,p]=l.useState([]),[a,d]=l.useState("scout"),[g,k]=l.useState(!1),[S,u]=l.useState(!1),[y,b]=l.useState(null),[w,m]=l.useState(null),C=l.useRef(null),N=l.useMemo(()=>e?Q(e):[],[e]),I=l.useMemo(()=>e?Ae(e):null,[e]);l.useEffect(()=>{f(""),p([]),k(!1),b(null),m(null)},[i]),l.useEffect(()=>{d(j=>g&&j==="scout"||N.some(x=>x.id===j)?j:I?.id??"scout")},[g,N,I?.id]);const R=l.useCallback(j=>{f(j),b(null),m(null)},[]),h=l.useCallback(j=>{k(!0),d(j)},[]),$=l.useCallback(j=>{p(x=>x.some(P=>P.id===j.id)?x:[...x,j]),b(null),m(null),queueMicrotask(()=>C.current?.focus())},[]),D=l.useCallback(j=>{p(x=>x.filter(P=>P.id!==j)),b(null),m(null)},[]),F=l.useCallback(async()=>{const j=c.trim();if(!j&&o.length===0||S||!e)return;const x=N.find(M=>M.id===a)??null,P=ze({comment:j||"Please review the included diff context.",includedContext:o.map(M=>M.snippet),snapshot:e,activeLayer:t,selectedFile:r});u(!0),b(null),m(null);try{x?(await B("/api/ask",{method:"POST",body:JSON.stringify({body:P,targetAgentId:x.id,targetLabel:x.label,metadata:{source:"repo-diff",originSurface:"repo-diff",handoffKind:"repo-diff-comment",targetAgentId:x.id,worktreePath:e.worktreePath,activeLayer:t,selectedFile:r?T(r):null,scopeKind:e.scope?.kind??"worktree"}})}),b(`Sent to ${x.label}`)):(await B("/api/send",{method:"POST",body:JSON.stringify({body:P})}),b("Sent to Scout")),f(""),p([])}catch(M){m(M instanceof Error?M.message:String(M))}finally{u(!1)}},[t,o,c,S,a,N,r,e]),v=l.useCallback((j,x)=>{e&&(s(x),$(qe({snapshot:e,activeLayer:t,file:j})))},[t,$,s,e]),L=l.useCallback(j=>{e&&$(Ye({line:j}))},[$,e]),E=l.useCallback(j=>{e&&$(Ve({selection:j}))},[$,e]);return{targets:N,targetId:a,setTargetId:h,draft:c,setDraft:R,contextItems:o,removeContextItem:D,pending:S,status:y,error:w,textareaRef:C,submit:F,includeFileInComment:v,includeLineInComment:L,includeSelectionInComment:E}}function Je({path:e,activeLayer:t,selectedFile:r,snapshotKey:s}){const i=r?T(r):null,c=`${e}\0${t??""}\0${i??""}\0${s}`,[f,o]=l.useState({layer:null,phase:"idle",error:null}),p=l.useRef(c),a=l.useMemo(()=>!t||!i?null:Y(e,[t],{files:[i],tier:"patch",cacheScope:s}),[t,i,e,s]);return l.useEffect(()=>{if(p.current=c,!t||!i){o({layer:null,phase:"idle",error:null});return}if(a?.fresh){o({layer:a.snapshot.layers[0]??null,phase:"ready",error:null});return}o({layer:null,phase:"loading",error:null}),V(e,[t],{files:[i],tier:"patch",cacheScope:s}).then(d=>{p.current===c&&o({layer:d.snapshot.layers[0]??null,phase:"ready",error:null})},d=>{p.current===c&&o(g=>({layer:g.layer,phase:"error",error:d instanceof Error?d.message:String(d)}))})},[t,a,i,e,c]),f}function Qe(e){const[t,r]=l.useState(null),[s,i]=l.useState(null),[c,f]=l.useState("split");l.useEffect(()=>{e&&f(e.render.preferredLayout==="stacked"?"unified":"split")},[e]),l.useEffect(()=>{if(!e)return;const d=e.layers.filter(g=>g.files.length>0)[0]??e.layers[0]??null;r(g=>g&&e.layers.some(k=>k.kind===g)?g:d?d.kind:null)},[e]);const o=l.useMemo(()=>!e||!t?null:e.layers.find(a=>a.kind===t)??null,[e,t]),p=l.useMemo(()=>He(o,s,K),[o,s]);return l.useEffect(()=>{if(!o){i(null);return}i(a=>{const d=o.files.map((g,k)=>K(g,k));return a&&d.includes(a)?a:d[0]??null})},[o]),{activeLayer:t,setActiveLayer:r,layer:o,selectedFileKey:s,setSelectedFileKey:i,selectedFile:p,layout:c,setLayout:f}}function Ze({path:e,layers:t,files:r,session:s,tier:i="summary",forceInitialLoad:c}){const f=t.join(","),o=l.useMemo(()=>f.split(","),[f]),p=(r??[]).join("\0"),a=s?`${s.sessionId??""}\0${s.agentId??""}\0${s.include??"changed"}`:"",d=l.useMemo(()=>({files:p?p.split("\0").filter(Boolean):void 0,tier:i,session:a?{sessionId:s?.sessionId??null,agentId:s?.agentId??null,include:s?.include??"changed"}:null}),[p,s?.agentId,s?.include,s?.sessionId,a,i]),[g,k]=l.useState(null),[S,u]=l.useState("loading"),[y,b]=l.useState(null),[w,m]=l.useState(null),C=l.useRef(null),N=l.useRef(!1);l.useEffect(()=>{C.current=g},[g]);const I=l.useCallback(async(h={})=>{const $=Y(e,o,d),D=h.force===!0||c&&!N.current,F=h.preserveCurrent===!0&&C.current!=null;b(null),$&&!D?(k($.snapshot),m(_($,!0)),u("ready")):F?(m(v=>({fetchedAt:v?.fetchedAt??Date.now(),cacheHit:v?.cacheHit??!1,refreshing:!0,refreshError:null})),u("ready")):(u("loading"),m(null));try{const v=await V(e,o,{force:D||$!=null,...d});D&&(N.current=!0),k(v.snapshot),m(ie(v,!1)),u("ready")}catch(v){const L=v instanceof Error?v.message:String(v);$?(m(_($,!1,L)),u("ready")):F?(m(E=>E&&{...E,refreshing:!1,refreshError:L}),u("ready")):(b(L),u("error"))}},[c,e,o,d]);l.useEffect(()=>{I()},[I]);const R=l.useCallback(()=>{I({force:!0,preserveCurrent:!0})},[I]);return{snapshot:g,fetchPhase:S,fetchError:y,freshness:w,filesKey:p,sessionKey:a,requestedLayers:o,loadSnapshot:I,refreshSnapshot:R}}function bt({path:e,layers:t=oe,files:r,session:s,forceInitialLoad:i=!1,onClose:c,onOpenAsPage:f,className:o,title:p}){const{snapshot:a,fetchPhase:d,fetchError:g,freshness:k,filesKey:S,sessionKey:u,loadSnapshot:y,refreshSnapshot:b}=Ze({path:e,layers:t,files:r,session:s,tier:"summary",forceInitialLoad:i}),{pierre:w,pierrePhase:m,pierreError:C,pierreTheme:N,retryPierre:I}=ae(a),{activeLayer:R,setActiveLayer:h,layer:$,selectedFileKey:D,setSelectedFileKey:F,selectedFile:v,layout:L,setLayout:E}=Qe(a),j=Je({path:e,activeLayer:R,selectedFile:v,snapshotKey:a?.render.renderKey??""}),x=Ge({snapshot:a,activeLayer:R,selectedFile:v,setSelectedFileKey:F,resetKey:`${e}\0${S}\0${u}`});if(d==="loading"&&!a)return n.jsx(A,{className:o,children:n.jsxs(H,{children:[n.jsx("div",{className:"rd-spinner","aria-hidden":!0}),n.jsxs("div",{className:"rd-center-title",children:["Reading ",s?"session":"worktree"," diff…"]}),n.jsx("div",{className:"rd-center-body",children:e})]})});if(d==="error"&&!a)return n.jsx(A,{className:o,children:n.jsxs(H,{children:[n.jsx("div",{className:"rd-center-title",children:"Couldn’t load the diff"}),n.jsx("div",{className:"rd-center-body",children:g??"The broker did not return a diff snapshot."}),n.jsx("div",{className:"rd-center-action",children:n.jsx("button",{type:"button",className:"rd-btn",onClick:()=>{y()},children:"Retry"})})]})});if(!a)return n.jsx(A,{className:o});const P=p??Z(a.worktreePath);return n.jsxs(A,{className:o,children:[n.jsx(Ce,{heading:P,worktreePath:a.worktreePath,snapshot:a,freshness:k,activeLayer:R,onLayer:h,layout:L,onLayout:E,refreshing:k?.refreshing===!0,onRefresh:b,onFocusComment:()=>{x.textareaRef.current?.scrollIntoView({block:"nearest"}),x.textareaRef.current?.focus()},onClose:c,onOpenAsPage:f}),n.jsx($e,{snapshot:a}),n.jsxs("div",{className:"rd-body",children:[n.jsx(Pe,{layer:$,selectedFileKey:D,onSelect:F,onIncludeFile:x.includeFileInComment}),n.jsx(je,{snapshot:a,selectedFile:v,targets:x.targets,targetId:x.targetId,onTargetId:x.setTargetId,draft:x.draft,onDraft:x.setDraft,contextItems:x.contextItems,onRemoveContextItem:x.removeContextItem,pending:x.pending,status:x.status,error:x.error,textareaRef:x.textareaRef,onSubmit:x.submit}),n.jsx(le,{layer:$,patchLayer:j.layer,patchPhase:j.phase,patchError:j.error,selectedFileKey:D,renderKey:a.render.renderKey,theme:N,layout:L,pierre:w,pierrePhase:m,pierreError:C,onRetryPierre:I,onIncludeLineContext:x.includeLineInComment,onIncludeSelectionContext:x.includeSelectionInComment})]})]})}export{bt as RepoDiffViewer,bt as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RepoDiffViewer-CovKjSgb.js","assets/index-Bli6bTLU.js","assets/index-DzlEgstl.css","assets/ui-LM8pS8qE.js","assets/usePierreRuntime-Bq6mXrgd.js","assets/chunk-HRAB3GC3-BUVYXXAp.js","assets/chevron-down-Da5tV19_.js","assets/createLucideIcon-DLlxGjKt.js","assets/check-Bfs7hMb1.js","assets/loader-circle-DoT8gpw6.js","assets/send-horizontal-BXo2uz3Z.js","assets/file-code-corner-CX53Cd9y.js","assets/code-xml-ByQsfOI_.js","assets/x-BJyPzFnn.js","assets/cache-BO2Bd_LV.js","assets/api-DEHEgJ9m.js","assets/message-square-DlY4EneU.js","assets/refresh-cw-IgN2fZLM.js","assets/plus-64n9qucr.js","assets/repo-diff-DyYmQMSA.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as e,r as i,_ as s}from"./index-Bli6bTLU.js";/* empty css */const a=i.lazy(()=>s(()=>import("./RepoDiffViewer-CovKjSgb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])).then(r=>({default:r.RepoDiffViewer})));function t(){return e.jsx("div",{className:"rd-viewer","data-scout-theme":!0,children:e.jsx("div",{className:"rd-center",children:e.jsxs("div",{className:"rd-center-card",children:[e.jsx("div",{className:"rd-spinner","aria-hidden":!0}),e.jsx("div",{className:"rd-center-title",children:"Opening diff viewer…"})]})})})}function c(r){return e.jsx(i.Suspense,{fallback:e.jsx(t,{}),children:e.jsx(a,{...r})})}export{c as R};
|