@openscout/scout 0.2.105 → 0.2.107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (575) hide show
  1. package/README.md +26 -0
  2. package/bin/scoutd +0 -0
  3. package/dist/build-manifest.json +3 -3
  4. package/dist/chat.mjs +23 -1
  5. package/dist/client/assets/ActivityScreen-CZmGwQ2U.js +1 -0
  6. package/dist/client/assets/{AddProjectForm-CHNJ4NnS.js → AddProjectForm-CusDRiVO.js} +1 -1
  7. package/dist/client/assets/{AdventureEvidence-B4mEvXeD.js → AdventureEvidence-CyegKk1V.js} +1 -1
  8. package/dist/client/assets/{AdventureReader-ZsBDQITY.js → AdventureReader-X-hbTOi0.js} +1 -1
  9. package/dist/client/assets/{AdventureScenery-DSxDlqG1.js → AdventureScenery-LPXSVP67.js} +1 -1
  10. package/dist/client/assets/AgentAdventures-BAgxdOF8.js +1 -0
  11. package/dist/client/assets/AgentAvatar-CrP1eXxk.js +1 -0
  12. package/dist/client/assets/AgentConfigurationScreen-1L0IQm2w.js +1 -0
  13. package/dist/client/assets/AgentDefinitionsWorkspace-DguGs7jZ.js +1 -0
  14. package/dist/client/assets/{AgentDetailCard-MIEBKw_S.js → AgentDetailCard-DtHT3sCo.js} +1 -1
  15. package/dist/client/assets/AgentFloorView-DH4jiDgw.js +1 -0
  16. package/dist/client/assets/{AgentFloorWorld-BTqwmK5G.js → AgentFloorWorld-CjoIa6jA.js} +1 -1
  17. package/dist/client/assets/AgentInfoScreen-DYtmKkeE.js +1 -0
  18. package/dist/client/assets/{AgentLaneCard-C4rKLLdT.js → AgentLaneCard-BaZ2g-f8.js} +1 -1
  19. package/dist/client/assets/{AgentLaneChrome-fGC-ZrJS.js → AgentLaneChrome-TF1SlJSc.js} +1 -1
  20. package/dist/client/assets/{AgentLaneDetailSheet-BTF4_th9.js → AgentLaneDetailSheet-EzEPsn3g.js} +1 -1
  21. package/dist/client/assets/{AgentLaneSummaryResize-DgSeA_vS.js → AgentLaneSummaryResize-dpp7YvrX.js} +1 -1
  22. package/dist/client/assets/AgentLanesEmbedScreen-BlSof_6S.js +1 -0
  23. package/dist/client/assets/{AgentLanesPreflight-CcS23wij.js → AgentLanesPreflight-Ry-aqDTr.js} +1 -1
  24. package/dist/client/assets/AgentLanesView-BJi9xXz6.js +2 -0
  25. package/dist/client/assets/{AgentLiveActions-6Kfr1uOT.js → AgentLiveActions-CfTupTEl.js} +1 -1
  26. package/dist/client/assets/AgentMasterScreen-EJhmuKgl.js +1 -0
  27. package/dist/client/assets/AgentSessions-B1gOhDBf.js +6 -0
  28. package/dist/client/assets/AgentsConsole-RXGqRvcb.js +1 -0
  29. package/dist/client/assets/AgentsScreen-ChwMBs11.js +1 -0
  30. package/dist/client/assets/AgentsSubnav-DwNX4yy0.js +1 -0
  31. package/dist/client/assets/{AstronautSuit-D67fIBdR.js → AstronautSuit-Cchnc4Ug.js} +1 -1
  32. package/dist/client/assets/{AtopView-Ck30FbzG.js → AtopView-gkEp4y__.js} +1 -1
  33. package/dist/client/assets/{BackToPicker-CkBhGRlD.js → BackToPicker-CUkjnoVk.js} +1 -1
  34. package/dist/client/assets/BriefingDetailScreen-DrlC3qkm.js +1 -0
  35. package/dist/client/assets/{BriefingsScreen-DTxYMr3a.js → BriefingsScreen-B1HlBMGZ.js} +1 -1
  36. package/dist/client/assets/{BrokerMetadataPanel-crirZCdo.js → BrokerMetadataPanel-Dk242Yh_.js} +1 -1
  37. package/dist/client/assets/BrokerScreen-DwOF6bMA.js +8 -0
  38. package/dist/client/assets/{Canvas-CRP0KjKb.js → Canvas-X9pVSkw3.js} +1 -1
  39. package/dist/client/assets/{CastPicker-ZPomvOf-.js → CastPicker-BXUtPAGC.js} +1 -1
  40. package/dist/client/assets/ChannelComposer-DoK7IDGa.js +1 -0
  41. package/dist/client/assets/ChannelSidebar-e9DOPulb.js +1 -0
  42. package/dist/client/assets/{CharacterFamilyPreview-ckVkecDO.js → CharacterFamilyPreview-DMfw7UM_.js} +1 -1
  43. package/dist/client/assets/{ChatAvatar-DKBsbOqk.js → ChatAvatar-C3a_o5Hj.js} +1 -1
  44. package/dist/client/assets/ChatBits-CsvxbToF.js +1 -0
  45. package/dist/client/assets/{ChatCollapsedStrip-Co0NmqOO.js → ChatCollapsedStrip-FEmQ_G9J.js} +1 -1
  46. package/dist/client/assets/ChatRichInput-DhtwFxQE.js +31 -0
  47. package/dist/client/assets/ChatRightPanel-C1h_aIkn.js +1 -0
  48. package/dist/client/assets/ChatSpaceSurface-BXyLYKHn.js +1 -0
  49. package/dist/client/assets/ChatSpaceTheme-3wLZGsvT.css +1 -0
  50. package/dist/client/assets/ChatSpaceTheme-CUH8bTZc.js +1 -0
  51. package/dist/client/assets/{CodeDiffPane-D-iv28LJ.js → CodeDiffPane-DuQRwpgK.js} +1 -1
  52. package/dist/client/assets/{CodeProjectPicker-CZ3gDdiT.js → CodeProjectPicker-ZQ6gSBpg.js} +1 -1
  53. package/dist/client/assets/{CodeScreen-CSC-zbP9.js → CodeScreen-BXyKeL5T.js} +1 -1
  54. package/dist/client/assets/{CommsCanvas-DdNAwjGW.js → CommsCanvas-THp0r_U8.js} +1 -1
  55. package/dist/client/assets/{CommsDeck-mGWY7Ivi.js → CommsDeck-BVmSMV2V.js} +1 -1
  56. package/dist/client/assets/{CommsFlowGraph-voDD9M5R.js → CommsFlowGraph-DxoOaLF_.js} +1 -1
  57. package/dist/client/assets/{CommsFlowMap-C33sgD48.js → CommsFlowMap-Vi8ziCPg.js} +1 -1
  58. package/dist/client/assets/{CommsSelection-BL8aYD7z.js → CommsSelection-BUoRbu9o.js} +1 -1
  59. package/dist/client/assets/ComposerAttachments-DW0AIb8k.js +1 -0
  60. package/dist/client/assets/ConversationComposer-CUQyArlk.js +1 -0
  61. package/dist/client/assets/ConversationFeedRows-DWiOfT-y.js +1 -0
  62. package/dist/client/assets/ConversationHeader-C-ZWscKj.js +1 -0
  63. package/dist/client/assets/{ConversationPanels-6pprBpmq.js → ConversationPanels-D9oC0xG5.js} +2 -2
  64. package/dist/client/assets/ConversationScreen-9MlMnEo4.css +1 -0
  65. package/dist/client/assets/ConversationScreen-CUfsQ4MR.js +2 -0
  66. package/dist/client/assets/ConversationStatus--IPm2nGh.js +1 -0
  67. package/dist/client/assets/{CrewAvatar-D0c9z5Qr.css → CrewAvatar-BnIPIn_Z.css} +1 -1
  68. package/dist/client/assets/CrewAvatar-kTznzqcO.js +1 -0
  69. package/dist/client/assets/{CrewSprite-Dp9KBBGY.js → CrewSprite-Dhryjx2c.js} +1 -1
  70. package/dist/client/assets/CrewStage-vdO0qm3D.js +1 -0
  71. package/dist/client/assets/CrewWorkspaces-DCBzAAS4.js +1 -0
  72. package/dist/client/assets/{DataTable-av71ehJV.js → DataTable-aH-jCyDq.js} +1 -1
  73. package/dist/client/assets/{DispatchAftermath-CcYGUB10.js → DispatchAftermath-66uQAorV.js} +1 -1
  74. package/dist/client/assets/{DocumentFocusViewer-DlMiEALb.js → DocumentFocusViewer-DJr0v0D_.js} +1 -1
  75. package/dist/client/assets/{EmbeddableSurfacesLab-CTkO_tQR.js → EmbeddableSurfacesLab-BBa70EhJ.js} +1 -1
  76. package/dist/client/assets/{EmptyState-CYUwYyAW.js → EmptyState-CZlrHXy-.js} +1 -1
  77. package/dist/client/assets/{FileViewerPane-Cxhixtks.js → FileViewerPane-BAO6mtjD.js} +1 -1
  78. package/dist/client/assets/FleetRollCallHud-C5q2567n.js +1 -0
  79. package/dist/client/assets/FlightObserveScreen-DZ2mrw91.js +1 -0
  80. package/dist/client/assets/{FloorContextSheet-Vj_wVZq1.js → FloorContextSheet-2_NVPQor.js} +1 -1
  81. package/dist/client/assets/{FloorExchangePanel-CjHSDXad.js → FloorExchangePanel-BU1pPu8K.js} +1 -1
  82. package/dist/client/assets/{FloorMessagePasses-BG4ebnX5.js → FloorMessagePasses-cLW2UGNP.js} +1 -1
  83. package/dist/client/assets/{FloorReplay-BoYaGY9t.js → FloorReplay-VFzA6Kxc.js} +1 -1
  84. package/dist/client/assets/FloorResourcesSheet-C-kQ6Ren.js +1 -0
  85. package/dist/client/assets/{FloorSavedWork-jbtRs-YE.js → FloorSavedWork-BeHDejWz.js} +1 -1
  86. package/dist/client/assets/FloorTacticalHUD-CO-iiFpb.js +1 -0
  87. package/dist/client/assets/{FollowScreen-CupyOgt4.js → FollowScreen-CFfkIbc6.js} +1 -1
  88. package/dist/client/assets/HarnessMark-C4naWc16.js +1 -0
  89. package/dist/client/assets/HarnessesScreen-DX3NLcDG.js +1 -0
  90. package/dist/client/assets/{HerdrSession-Dcm3vf9U.js → HerdrSession-_t7yM8vX.js} +2 -2
  91. package/dist/client/assets/{HomeHero-pIZtE1cC.js → HomeHero-DouPyNmz.js} +1 -1
  92. package/dist/client/assets/{HostAdvisorView-Dv5meXo2.js → HostAdvisorView-CnM1i8hW.js} +1 -1
  93. package/dist/client/assets/InviteLandingScreen-CEjG2E34.js +1 -0
  94. package/dist/client/assets/InviteSheet-CwxZtWCl.js +1 -0
  95. package/dist/client/assets/{JumpPalette-BmiSOEmp.js → JumpPalette-O1aJE9gR.js} +1 -1
  96. package/dist/client/assets/{KnowledgeSearchInspector-B8yiM524.js → KnowledgeSearchInspector-32n9baT-.js} +1 -1
  97. package/dist/client/assets/KnowledgeSearchScreen-Dd6jrQ0A.js +1 -0
  98. package/dist/client/assets/{LaneToolHoverCard-D2cnTeUd.js → LaneToolHoverCard-CJa110yk.js} +1 -1
  99. package/dist/client/assets/LaneTraceDetailSheet-DYrd0BIf.js +1 -0
  100. package/dist/client/assets/{LaneTraceEventFocus-BLhVHwff.js → LaneTraceEventFocus-TbrNHRj_.js} +1 -1
  101. package/dist/client/assets/{MeshCanvas-BR25OBTJ.js → MeshCanvas-DWZHYh1A.js} +2 -2
  102. package/dist/client/assets/{MeshCanvasMinimap-ClVolr4-.js → MeshCanvasMinimap-iswYFpIb.js} +1 -1
  103. package/dist/client/assets/MeshScreen-8nAzQVbm.js +1 -0
  104. package/dist/client/assets/{MeshTopologyView-BT3ke2D1.js → MeshTopologyView-BVvtqI8q.js} +2 -2
  105. package/dist/client/assets/MessageEmbeds-ksPazAKH.js +1 -0
  106. package/dist/client/assets/MessagesScreen-C3WB4T21.js +1 -0
  107. package/dist/client/assets/{MissionContextRail-CafjuseK.js → MissionContextRail-D62-Wis8.js} +1 -1
  108. package/dist/client/assets/MissionControlView-B9cNPXvl.js +1 -0
  109. package/dist/client/assets/{MissionFocusOverlay-nhy3hkxQ.js → MissionFocusOverlay-C1zys3Jv.js} +1 -1
  110. package/dist/client/assets/MissionLeftAgentRow-vycMV77n.js +1 -0
  111. package/dist/client/assets/{MissionLogPane-DiUf3vWW.js → MissionLogPane-B19lYSY9.js} +1 -1
  112. package/dist/client/assets/NativeAreaScreen-B1RLa85C.js +1 -0
  113. package/dist/client/assets/NativeAreaScreen-CV0OhGra.js +1 -0
  114. package/dist/client/assets/NativeAreaScreen-CzuZt6o1.js +1 -0
  115. package/dist/client/assets/{NewAgentModal-BQ2wQ5gp.js → NewAgentModal-Bh-L-emz.js} +1 -1
  116. package/dist/client/assets/NewChatComposer-C97-iTMK.js +19 -0
  117. package/dist/client/assets/{NewChatOrigin-C8ROO4ps.js → NewChatOrigin-DFbF_XvR.js} +1 -1
  118. package/dist/client/assets/{NodeDetailPanel-BNTqYC7m.js → NodeDetailPanel-CElOEpCh.js} +1 -1
  119. package/dist/client/assets/{NodeMenu-CcOeFRCB.js → NodeMenu-B-jjHf1c.js} +1 -1
  120. package/dist/client/assets/ObserveEmbedScreen-B7Qt69Ms.js +2 -0
  121. package/dist/client/assets/{ObserveTextFlow-CC5mnngm.js → ObserveTextFlow-PFnG_10h.js} +2 -2
  122. package/dist/client/assets/{ObservedTopologyPanel-DF6tRZL_.js → ObservedTopologyPanel-CUTIoLZJ.js} +1 -1
  123. package/dist/client/assets/OpenScoutAppShell-37PDFfA4.js +31 -0
  124. package/dist/client/assets/OpsAgentsView-DajlX8LO.js +1 -0
  125. package/dist/client/assets/OpsScreen-jVcaBKGi.js +1 -0
  126. package/dist/client/assets/OpsSubnav-BOOYShHE.js +1 -0
  127. package/dist/client/assets/ProjectAgentProfile-D_wlW4sQ.js +1 -0
  128. package/dist/client/assets/{ProjectAgentProfileBar-C8z22pJ2.js → ProjectAgentProfileBar-DHuMKJj-.js} +1 -1
  129. package/dist/client/assets/ProjectAgentProfileHero-Dbebtug1.js +1 -0
  130. package/dist/client/assets/ProjectsInbox-B8zYE4vP.css +1 -0
  131. package/dist/client/assets/ProjectsInbox-Cgu7B4--.js +2 -0
  132. package/dist/client/assets/ProjectsRail-CDWocin_.js +1 -0
  133. package/dist/client/assets/ProjectsScreen-B_CJycqW.js +1 -0
  134. package/dist/client/assets/ProjectsThreadAside-1MMl_qUD.js +1 -0
  135. package/dist/client/assets/Provider-C35yu29I.js +5 -0
  136. package/dist/client/assets/{RailRow-DUPqXMZh.js → RailRow-BjmWK420.js} +1 -1
  137. package/dist/client/assets/RawSessionsTable-DzT90hWu.js +1 -0
  138. package/dist/client/assets/RealtimeVoiceScreen-B6ylX3WQ.js +16 -0
  139. package/dist/client/assets/{RenderedWorkerSprite-C8fxndAh.js → RenderedWorkerSprite-Dhlyg89J.js} +1 -1
  140. package/dist/client/assets/{ReplayClock-DUVJjrIu.js → ReplayClock-348f17bW.js} +1 -1
  141. package/dist/client/assets/{ReplayLog-Bek1Vc4W.js → ReplayLog-CBnAM3ui.js} +1 -1
  142. package/dist/client/assets/{ReplayOutpost-DlRg3172.js → ReplayOutpost-DyRPfNFx.js} +1 -1
  143. package/dist/client/assets/{RepoDiffEmbedScreen-CVUMnt6A.js → RepoDiffEmbedScreen-BWxvRDrS.js} +1 -1
  144. package/dist/client/assets/{RepoDiffPageScreen-D9-s5PyB.js → RepoDiffPageScreen-DN94irmY.js} +1 -1
  145. package/dist/client/assets/{RepoDiffViewer-D7FN-oyY.js → RepoDiffViewer-_4JVXBIW.js} +1 -1
  146. package/dist/client/assets/RepoDiffViewerLazy-XGVC3WXv.js +2 -0
  147. package/dist/client/assets/{ReposScreen-BQ7HO1om.js → ReposScreen-uMCpt0e9.js} +2 -2
  148. package/dist/client/assets/{RiggedWorkerCharacter-CJMWlvV-.js → RiggedWorkerCharacter-q6QRc7_o.js} +1 -1
  149. package/dist/client/assets/{SageModelStudio-B526NSnw.js → SageModelStudio-CNDhZhgD.js} +1 -1
  150. package/dist/client/assets/{ScoutDeckSurface-ChkvGyEW.js → ScoutDeckSurface-CUaU4R6T.js} +1 -1
  151. package/dist/client/assets/{ScoutSurface-6g1f5chk.js → ScoutSurface-3_25USO_.js} +1 -1
  152. package/dist/client/assets/{ScoutbotFxLab-BuwBdnPf.js → ScoutbotFxLab-CRqhYe0a.js} +1 -1
  153. package/dist/client/assets/{SecondaryNav-Bs-_VwTC.js → SecondaryNav-D7dbV2qo.js} +1 -1
  154. package/dist/client/assets/SessionContextStrip-CXfs9hUD.js +1 -0
  155. package/dist/client/assets/SessionContextStrip-DAIXwtHd.css +1 -0
  156. package/dist/client/assets/{SessionEmbedScreen-C2wf35-P.js → SessionEmbedScreen-D0zFmou-.js} +1 -1
  157. package/dist/client/assets/SessionHopMenu-E6VJZrE0.js +1 -0
  158. package/dist/client/assets/{SessionObserve-B64YsYhy.js → SessionObserve-DXxBvejJ.js} +9 -9
  159. package/dist/client/assets/SessionObserveEvidence-Cuj_KHxR.js +1 -0
  160. package/dist/client/assets/SessionRefScreen-DqLSUlCE.js +1 -0
  161. package/dist/client/assets/SessionsScreen-BLIRkohT.js +1 -0
  162. package/dist/client/assets/SettingsDrawer-juCpnbH6.js +3 -0
  163. package/dist/client/assets/SettingsScreen-BtGzE2-O.js +1 -0
  164. package/dist/client/assets/{SharedFloorCharacter-V04kD5T9.js → SharedFloorCharacter-DNEiaOUh.js} +1 -1
  165. package/dist/client/assets/SharedWorkFloor-0rqtdF-n.css +1 -0
  166. package/dist/client/assets/SharedWorkFloor-D9mf9KSg.js +2 -0
  167. package/dist/client/assets/{ShikiPane-XwFI-pCp.js → ShikiPane-CRtTYkMj.js} +1 -1
  168. package/dist/client/assets/{SlidePanel-BMpkXai_.js → SlidePanel-_CHAQdOa.js} +1 -1
  169. package/dist/client/assets/SpaceSwitcher-BLgSCf_T.js +1 -0
  170. package/dist/client/assets/{SpriteAvatar-aHeF4ZQZ.js → SpriteAvatar-CpZWf54-.js} +1 -1
  171. package/dist/client/assets/{SproutActionSprite-DI5N3gOj.js → SproutActionSprite-BSiTS4en.js} +1 -1
  172. package/dist/client/assets/{StatusPill-Dw4LP7wu.js → StatusPill-2gCP6H7A.js} +1 -1
  173. package/dist/client/assets/{TailView-BofjmUMJ.js → TailView-CYSijNTy.js} +2 -2
  174. package/dist/client/assets/Terminal-Bi97yb5s.js +4 -0
  175. package/dist/client/assets/TerminalEmbedScreen-Bqop67Bq.js +1 -0
  176. package/dist/client/assets/{TerminalHeaderMount-CwbQhXcI.js → TerminalHeaderMount-Cq4OD_xN.js} +1 -1
  177. package/dist/client/assets/{TerminalRelay--qOBwnbR.js → TerminalRelay-DrikpUSJ.js} +3 -3
  178. package/dist/client/assets/{TextDocumentSurface-BK6Qy41F.js → TextDocumentSurface-D52m7Vd8.js} +1 -1
  179. package/dist/client/assets/{TmuxPeek-DpUT9Tpc.js → TmuxPeek-CXFeweMg.js} +1 -1
  180. package/dist/client/assets/VoiceControlWell-DF3bjcYA.js +1 -0
  181. package/dist/client/assets/VoicePathDiagram-CmpHWfO-.js +1 -0
  182. package/dist/client/assets/{VoicePermissionsPanel-D35fOnQj.js → VoicePermissionsPanel-Ok2nfxHw.js} +1 -1
  183. package/dist/client/assets/VoiceTurnDetails-wAByRaNB.js +8 -0
  184. package/dist/client/assets/VoiceTurnStage-edoJalLV.js +1 -0
  185. package/dist/client/assets/VoiceTurnView-D-8g5E4r.js +1 -0
  186. package/dist/client/assets/WorkDetailScreen-zQkNVy2F.js +5 -0
  187. package/dist/client/assets/{WorkFilesViewer-t8AEyx3Q.js → WorkFilesViewer-vNt01sDd.js} +1 -1
  188. package/dist/client/assets/{WorkRunView-_mhG_FR2.js → WorkRunView-BDkR7Edq.js} +1 -1
  189. package/dist/client/assets/WorldActorTalk-BvSg_b1y.js +1 -0
  190. package/dist/client/assets/{WorldCharacter-BRrj3MQN.js → WorldCharacter-CIIlutQq.js} +1 -1
  191. package/dist/client/assets/WorldMinimap-B6HNgcDe.js +1 -0
  192. package/dist/client/assets/{WorldSky-D-RJzSa6.js → WorldSky-Jm2Z6dfW.js} +1 -1
  193. package/dist/client/assets/{activity-BJqFrZyB.js → activity-CIlFrfPJ.js} +1 -1
  194. package/dist/client/assets/{addon-fit-CHohcvS3.js → addon-fit-dFpj9Kfq.js} +1 -1
  195. package/dist/client/assets/{addon-webgl-CaRy2x2b.js → addon-webgl-BFCGRtGh.js} +1 -1
  196. package/dist/client/assets/{agent-essentials-bKWYOZaH.js → agent-essentials-BGGvT5G6.js} +1 -1
  197. package/dist/client/assets/{agent-master-model-C-KdOFDK.js → agent-master-model-Bk_yuUXJ.js} +1 -1
  198. package/dist/client/assets/{agent-specialization-BplZUa_0.js → agent-specialization-DDc7mLCW.js} +1 -1
  199. package/dist/client/assets/agents-screen-BYakbO50.css +1 -0
  200. package/dist/client/assets/{arc.es-CubLvQ4W.js → arc.es-C1SQHJ3k.js} +1 -1
  201. package/dist/client/assets/{arrow-left-DFfKAq0d.js → arrow-left-MVUKauwQ.js} +1 -1
  202. package/dist/client/assets/{arrow-right-DmAWnyAH.js → arrow-right-Bp-FpE5V.js} +1 -1
  203. package/dist/client/assets/{arrow-up-right-B0aLKiyF.js → arrow-up-right-BPedAgxO.js} +1 -1
  204. package/dist/client/assets/{book-open-BL9qvhEI.js → book-open-CV98WMSp.js} +1 -1
  205. package/dist/client/assets/{bot-BhAVbcCA.js → bot-B4zLQ4IN.js} +1 -1
  206. package/dist/client/assets/chat-api-DSJMBYoT.js +2 -0
  207. package/dist/client/assets/chat-message-markup-91DIry6R.js +1 -0
  208. package/dist/client/assets/chat-space-model-aW3Fd8_U.js +4 -0
  209. package/dist/client/assets/chat-transport-DNS5CB2I.js +1 -0
  210. package/dist/client/assets/{check-g7D7-c1J.js → check-lrJ3a73a.js} +1 -1
  211. package/dist/client/assets/{chevron-down-CDzRQQGl.js → chevron-down-l1mrh5S9.js} +1 -1
  212. package/dist/client/assets/{chevron-right-DKGTLiqc.js → chevron-right-DrfqcerI.js} +1 -1
  213. package/dist/client/assets/{chevron-up-DX7R6KY2.js → chevron-up-CETZJzjV.js} +1 -1
  214. package/dist/client/assets/{chunk-HRAB3GC3-Dvk_QpRq.js → chunk-HRAB3GC3-DbVLgbWX.js} +1 -1
  215. package/dist/client/assets/{clock-CQb4FeMf.js → clock-BV1aqPkK.js} +1 -1
  216. package/dist/client/assets/{code-xml-Cmadr3pQ.js → code-xml-BhcNbLWU.js} +1 -1
  217. package/dist/client/assets/{coffee-ljG1_krY.js → coffee-D7EAOdCk.js} +1 -1
  218. package/dist/client/assets/{compass-CvzkzkIh.js → compass-63TUaz5_.js} +1 -1
  219. package/dist/client/assets/content-B1lgE8qr.js +1 -0
  220. package/dist/client/assets/content-B5l11YyQ.js +1 -0
  221. package/dist/client/assets/content-BNZOZEpX.js +1 -0
  222. package/dist/client/assets/content-BRIxP155.js +1 -0
  223. package/dist/client/assets/content-BWd8gt8L.js +1 -0
  224. package/dist/client/assets/content-BfwS2jAK.js +1 -0
  225. package/dist/client/assets/content-C4p43_eT.js +1 -0
  226. package/dist/client/assets/content-CdYfaoDV.js +1 -0
  227. package/dist/client/assets/content-CzldLxw0.js +1 -0
  228. package/dist/client/assets/content-D-olnc4U.js +1 -0
  229. package/dist/client/assets/content-DTioimq4.js +1 -0
  230. package/dist/client/assets/content-LOebm3_d.js +1 -0
  231. package/dist/client/assets/{content-CKJ9zb7Z.js → content-nGlEZhUI.js} +1 -1
  232. package/dist/client/assets/{content-D1Ze_FG9.js → content-oyzDM-LK.js} +1 -1
  233. package/dist/client/assets/content-x1PHxED7.js +1 -0
  234. package/dist/client/assets/content-zX3ZY3T9.js +1 -0
  235. package/dist/client/assets/{conversation-icons-CIRaxmid.js → conversation-icons-Tqba2d56.js} +1 -1
  236. package/dist/client/assets/conversation-model-FxDeWlle.js +1 -0
  237. package/dist/client/assets/conversation-motion-features-C5zjuNwE.js +1 -0
  238. package/dist/client/assets/conversations-DoAAO6kA.js +1 -0
  239. package/dist/client/assets/{copy-BGOC1tJB.js → copy-xKeM5ZtU.js} +1 -1
  240. package/dist/client/assets/{cpu-Q6nrHFTN.js → cpu-BOTa_WLr.js} +1 -1
  241. package/dist/client/assets/{createLucideIcon-ChvMq-zl.js → createLucideIcon-zZ8Hx7er.js} +1 -1
  242. package/dist/client/assets/ctx-panel-BC8fpcWJ.css +1 -0
  243. package/dist/client/assets/direct-voice-BbLPuJ04.js +2 -0
  244. package/dist/client/assets/direct-voice-DbO7CSv_.css +1 -0
  245. package/dist/client/assets/discover-DJFxyV1k.js +2 -0
  246. package/dist/client/assets/embed-entry-Lyvu0Kfc.js +2 -0
  247. package/dist/client/assets/{external-link-BVccgH0n.js → external-link-CUObqmgX.js} +1 -1
  248. package/dist/client/assets/{eye-CsGfEVR6.js → eye-LrO-cXQt.js} +1 -1
  249. package/dist/client/assets/{file-code-corner-Be6da5l3.js → file-code-corner-CsU7jJpu.js} +1 -1
  250. package/dist/client/assets/{file-text-DP6txVW-.js → file-text-CnISiiw6.js} +1 -1
  251. package/dist/client/assets/{flag-DAFE2wZ5.js → flag-C4wl8z2-.js} +1 -1
  252. package/dist/client/assets/fleet-roll-call-BUgf7w-V.css +1 -0
  253. package/dist/client/assets/{folder-B_S7gBVr.js → folder-D5prSkzz.js} +1 -1
  254. package/dist/client/assets/{gauge-DQCGlE3o.js → gauge-D9_5iJEm.js} +1 -1
  255. package/dist/client/assets/{gestures-CofqY4Km.js → gestures-QZub3Ot9.js} +1 -1
  256. package/dist/client/assets/{git-branch-DcUCsWdJ.js → git-branch-B0_fPLO7.js} +1 -1
  257. package/dist/client/assets/{go-shortcuts-KQy-ZOpV.js → go-shortcuts-DicR7sUf.js} +1 -1
  258. package/dist/client/assets/home-moving-signal-rpMhsOJB.js +1 -0
  259. package/dist/client/assets/home-now-card-ByE6Umcx.js +1 -0
  260. package/dist/client/assets/{home-now-card-nano-CvU8B61b.js → home-now-card-nano-B5Dv3-pb.js} +1 -1
  261. package/dist/client/assets/hooks-_eCZZPsR.js +2 -0
  262. package/dist/client/assets/index-724SdE6r.js +1 -0
  263. package/dist/client/assets/{index-kkXUq-zf.js → index-CHD0qcfL.js} +1 -1
  264. package/dist/client/assets/index-CN4rBB_s.css +1 -0
  265. package/dist/client/assets/index-D1d98iYf.js +1 -0
  266. package/dist/client/assets/{index-DReVb7jZ.js → index-EsrkGBcv.js} +8 -8
  267. package/dist/client/assets/index-gGHPA-By.js +1 -0
  268. package/dist/client/assets/{inspector-panel-CLU7wjnT.js → inspector-panel-BkgUDn6G.js} +2 -2
  269. package/dist/client/assets/{keyboard-nav-CJXPaHXj.js → keyboard-nav-DDHegDbx.js} +1 -1
  270. package/dist/client/assets/{lane-roster-store-Ch9t6lb0.js → lane-roster-store-D-RSWjb-.js} +1 -1
  271. package/dist/client/assets/{layers-BOwyWodP.js → layers-C8PDiMul.js} +1 -1
  272. package/dist/client/assets/{layout-grid-B36Qsh0y.js → layout-grid-Cor2frzj.js} +1 -1
  273. package/dist/client/assets/left-Bn5X7x2o.js +2 -0
  274. package/dist/client/assets/left-BqS0fYX1.js +1 -0
  275. package/dist/client/assets/left-CTCeeeD3.js +1 -0
  276. package/dist/client/assets/left-DhtVPVux.js +1 -0
  277. package/dist/client/assets/left-K39b-Wvx.js +2 -0
  278. package/dist/client/assets/left-KGmueNPt.js +1 -0
  279. package/dist/client/assets/left-P_GOYB-s.js +1 -0
  280. package/dist/client/assets/left-advisor-B0N47De2.js +1 -0
  281. package/dist/client/assets/left-agents-CsSNc51Y.js +1 -0
  282. package/dist/client/assets/left-default-BlO5LP2T.js +1 -0
  283. package/dist/client/assets/left-lanes-C4PhaJE6.js +1 -0
  284. package/dist/client/assets/left-mission-BjTE5vPa.js +1 -0
  285. package/dist/client/assets/library-CkWNPHRp.js +1 -0
  286. package/dist/client/assets/{loader-circle-DNUsuPWz.js → loader-circle-OvccU82H.js} +1 -1
  287. package/dist/client/assets/{local-agents-I40PawYA.js → local-agents-BqnoxJrq.js} +1 -1
  288. package/dist/client/assets/log-in-7SnYqW5w.js +1 -0
  289. package/dist/client/assets/{machine-children-CdhNzDF0.js → machine-children-DxcqCLmd.js} +1 -1
  290. package/dist/client/assets/media-blobs-Bi8pxr1u.js +1 -0
  291. package/dist/client/assets/{mentions-Ck_Vjnyp.js → mentions-ByUvhS-v.js} +1 -1
  292. package/dist/client/assets/{mesh-ops-DSlvHp-D.js → mesh-ops-CiZ8xSAx.js} +1 -1
  293. package/dist/client/assets/{mesh-view-store-C1-mdP3P.js → mesh-view-store-DZvJC4KU.js} +1 -1
  294. package/dist/client/assets/{message-circle-cI5_A5mj.js → message-circle-CxRVKNE-.js} +1 -1
  295. package/dist/client/assets/message-markup-BQW5jdJw.js +15 -0
  296. package/dist/client/assets/message-markup-Zwo3t4cI.js +1 -0
  297. package/dist/client/assets/{message-square-CJW4WRlo.js → message-square-BxesYglW.js} +1 -1
  298. package/dist/client/assets/mission-control-model-BpJHDV5D.js +1 -0
  299. package/dist/client/assets/{mission-control-store-p_cboAm4.js → mission-control-store-elEEsIvb.js} +1 -1
  300. package/dist/client/assets/{mission-wall-DOuGOxQy.js → mission-wall-CAo4BKfa.js} +1 -1
  301. package/dist/client/assets/{monitor-C7_cHlkC.js → monitor-DTTYEb73.js} +1 -1
  302. package/dist/client/assets/{nav-destinations-CU_euC-Q.js → nav-destinations-uorRqFxf.js} +1 -1
  303. package/dist/client/assets/{observe-CtS0l3zu.js → observe-BJqERJVj.js} +1 -1
  304. package/dist/client/assets/{page-status-DwFR4wSw.js → page-status-BswZLqvA.js} +1 -1
  305. package/dist/client/assets/{panel-right-qP17MwMl.js → panel-right-Bv7sP_fc.js} +1 -1
  306. package/dist/client/assets/paperclip-BjcuP_Hx.js +1 -0
  307. package/dist/client/assets/{pause-B_hliKuR.js → pause-C2XTlkjs.js} +1 -1
  308. package/dist/client/assets/{persistent-state-BUsTTZFE.js → persistent-state-KRk_yb0q.js} +1 -1
  309. package/dist/client/assets/{pin-Oi4qHR6M.js → pin-C2mFOV1l.js} +1 -1
  310. package/dist/client/assets/{play-CVeRmqLH.js → play-FT6K3It1.js} +1 -1
  311. package/dist/client/assets/{plus-D5NLH_fM.js → plus-DFDDeGKu.js} +1 -1
  312. package/dist/client/assets/profile-DTmzN16I.js +1 -0
  313. package/dist/client/assets/{projects-inbox-CfwxCTdN.js → projects-inbox-C0FUCv_p.js} +1 -1
  314. package/dist/client/assets/projects-inbox-ColX6lpx.css +1 -0
  315. package/dist/client/assets/{provider-DwmCoSlc.js → provider-Dojd8quC.js} +1 -1
  316. package/dist/client/assets/{proxy-DgzP27W8.js → proxy-AJsmwA6h.js} +1 -1
  317. package/dist/client/assets/{radio-Cas2qg1D.js → radio-DRoOZsws.js} +1 -1
  318. package/dist/client/assets/{refresh-cw-IcD2lPoT.js → refresh-cw-BmVr7sCD.js} +1 -1
  319. package/dist/client/assets/resolve-panes-pbY1fCWi.js +1 -0
  320. package/dist/client/assets/resolve-sidebar-context-YWkZTq1t.js +1 -0
  321. package/dist/client/assets/right-49kO-6nD.js +1 -0
  322. package/dist/client/assets/right-APtItA8A.js +1 -0
  323. package/dist/client/assets/right-BJwhPqtn.js +1 -0
  324. package/dist/client/assets/right-BPqrf4ek.js +1 -0
  325. package/dist/client/assets/right-D7djOy6K.js +1 -0
  326. package/dist/client/assets/right-DKOUCRob.js +1 -0
  327. package/dist/client/assets/right-DMNrVzg7.js +1 -0
  328. package/dist/client/assets/{right-cjPTwPXS.js → right-DWPVB-nK.js} +1 -1
  329. package/dist/client/assets/right-DppeMCy4.js +1 -0
  330. package/dist/client/assets/right-GAL5Mw1v.js +1 -0
  331. package/dist/client/assets/{rocket-DAqYvu8I.js → rocket-CGl4RTV7.js} +1 -1
  332. package/dist/client/assets/router-DCtl8wqb.js +1 -0
  333. package/dist/client/assets/runtime-picker-DXu2bOTh.js +1 -0
  334. package/dist/client/assets/{scope-views-Dl3ml9OZ.js → scope-views-RUWwCVAr.js} +1 -1
  335. package/dist/client/assets/scout-voice-CZx60X6E.js +1 -0
  336. package/dist/client/assets/{scoutbot-markdown-DwvGQOWo.js → scoutbot-markdown-BKEBSbG0.js} +1 -1
  337. package/dist/client/assets/{scroll-text-B0tKI9Sg.js → scroll-text-DNjxhyO2.js} +1 -1
  338. package/dist/client/assets/{search-UsM-9-_W.js → search-DT42oyRW.js} +1 -1
  339. package/dist/client/assets/secondaryNavConfig-CS1svh6n.js +1 -0
  340. package/dist/client/assets/{selection-bridge-OTS2iFkt.js → selection-bridge-x3wFUjxj.js} +1 -1
  341. package/dist/client/assets/{send-horizontal-BlQsRK6C.js → send-horizontal-CH0-fbZE.js} +1 -1
  342. package/dist/client/assets/{send-to-agent-session-C1mgqdow.js → send-to-agent-session-DoKCDBJ4.js} +1 -1
  343. package/dist/client/assets/{server-DBlPW0Mp.js → server-QfsgMLk1.js} +1 -1
  344. package/dist/client/assets/{session-catalog-CnpZMB7C.js → session-catalog-CvSdPHPe.js} +1 -1
  345. package/dist/client/assets/session-recap-lanes-D-eVJnpY.js +1 -0
  346. package/dist/client/assets/session-recap-queue-41l2XVkI.js +1 -0
  347. package/dist/client/assets/{session-table-CGkfG5Yd.js → session-table-L-pns6Zl.js} +1 -1
  348. package/dist/client/assets/{sessions-view-Bge4XZ4I.js → sessions-view-Dc-QAa7O.js} +1 -1
  349. package/dist/client/assets/{settings-C69Zjrpq.js → settings-BVh7kldq.js} +1 -1
  350. package/dist/client/assets/{sliders-horizontal-6bzeod7c.js → sliders-horizontal-782VC_yy.js} +1 -1
  351. package/dist/client/assets/{sparkles-Cc5lPZRv.js → sparkles-BjHq_DNK.js} +1 -1
  352. package/dist/client/assets/{sse-A8AyLH0g.js → sse-BCPRocpq.js} +1 -1
  353. package/dist/client/assets/system-surfaces-redesign-q2BmCB7e.css +1 -0
  354. package/dist/client/assets/{tail-events-C4WdhVeK.js → tail-events-d0yAYxR0.js} +1 -1
  355. package/dist/client/assets/{terminal-DMZjX1es.js → terminal-hQKQygcf.js} +1 -1
  356. package/dist/client/assets/{terminal-relay-mO89dX-Y.js → terminal-relay-Bxs1hp-j.js} +1 -1
  357. package/dist/client/assets/{terminal-takeover-CZZsnPzj.js → terminal-takeover-Ay5C2c-M.js} +1 -1
  358. package/dist/client/assets/theme-vars-DNK0nn3k.js +1 -0
  359. package/dist/client/assets/triangle-alert-CHoRGdVO.js +1 -0
  360. package/dist/client/assets/{use-beside-D3cJpA5p.js → use-beside-DoRC1nt0.js} +1 -1
  361. package/dist/client/assets/{use-conversation-list-D5EnpVba.js → use-conversation-list-CY4JciOV.js} +1 -1
  362. package/dist/client/assets/{use-fleet-active-asks-D_QOmjg5.js → use-fleet-active-asks-CymmXWH4.js} +1 -1
  363. package/dist/client/assets/{use-mesh-node-state-3V3ADQ-G.js → use-mesh-node-state-BvaqtODo.js} +1 -1
  364. package/dist/client/assets/{use-mesh-ops-items-DI9GKWlF.js → use-mesh-ops-items-BSYaqH_0.js} +1 -1
  365. package/dist/client/assets/{use-reduced-motion-CiaZHMnk.js → use-reduced-motion-3gMYZNIp.js} +1 -1
  366. package/dist/client/assets/{use-scout-dev-flags-CkdAHlDR.js → use-scout-dev-flags-DS_pYYQd.js} +1 -1
  367. package/dist/client/assets/{useAgentHoverCard-A3QGXqIy.js → useAgentHoverCard-BANmpjMh.js} +1 -1
  368. package/dist/client/assets/useContentSecondaryNav-C6OBu-3_.js +1 -0
  369. package/dist/client/assets/{useEmbedHeadline-atkQVfGw.js → useEmbedHeadline-D6pJRxUg.js} +1 -1
  370. package/dist/client/assets/usePersistentState-B8lP7TRb.js +1 -0
  371. package/dist/client/assets/{usePierreRuntime-DTvcwISe.js → usePierreRuntime-BAQdiN0L.js} +1 -1
  372. package/dist/client/assets/useSidebarCollapse-OL_8J5cL.js +1 -0
  373. package/dist/client/assets/{users-RLK3P5U4.js → users-BUjx36gx.js} +1 -1
  374. package/dist/client/assets/voice-paths-CJUuBPh3.css +1 -0
  375. package/dist/client/assets/voice-turn-DftA0iIb.css +1 -0
  376. package/dist/client/assets/voice-turn-ledger-BMZxlSjg.js +1 -0
  377. package/dist/client/assets/{wrench-B4maQJai.js → wrench-DR0i5BU7.js} +1 -1
  378. package/dist/client/assets/{x-rlMdRqJF.js → x-DAehov0E.js} +1 -1
  379. package/dist/client/assets/{xterm-B1zHHOLQ.js → xterm-BXQiLVnI.js} +1 -1
  380. package/dist/client/assets/{zap-B4X0OrEw.js → zap-CEjZNZbI.js} +1 -1
  381. package/dist/client/crew/sheets/eye-plate-v1/look-down-left.webp +0 -0
  382. package/dist/client/crew/sheets/eye-plate-v1/look-down-right.webp +0 -0
  383. package/dist/client/crew/sheets/eye-plate-v1/look-down.webp +0 -0
  384. package/dist/client/crew/sheets/eye-plate-v1/look-up-left.webp +0 -0
  385. package/dist/client/crew/sheets/eye-plate-v1/look-up-right.webp +0 -0
  386. package/dist/client/crew/sheets/eye-plate-v1/look-up.webp +0 -0
  387. package/dist/client/crew/sheets/sprout/blink-half.webp +0 -0
  388. package/dist/client/crew/sheets/sprout/blink-shut.webp +0 -0
  389. package/dist/client/crew/sheets/sprout/look-down-left.webp +0 -0
  390. package/dist/client/crew/sheets/sprout/look-down-right.webp +0 -0
  391. package/dist/client/crew/sheets/sprout/look-down.webp +0 -0
  392. package/dist/client/crew/sheets/sprout/look-left.webp +0 -0
  393. package/dist/client/crew/sheets/sprout/look-right.webp +0 -0
  394. package/dist/client/crew/sheets/sprout/look-up-left.webp +0 -0
  395. package/dist/client/crew/sheets/sprout/look-up-right.webp +0 -0
  396. package/dist/client/crew/sheets/sprout/look-up.webp +0 -0
  397. package/dist/client/index.html +2 -2
  398. package/dist/drizzle/0020_message_reactions.sql +11 -0
  399. package/dist/drizzle/meta/_journal.json +7 -0
  400. package/dist/main.mjs +542 -150
  401. package/dist/node/main.mjs +131 -17
  402. package/dist/pairing-runtime-controller.mjs +375 -78
  403. package/dist/runtime/base-daemon.mjs +98 -5
  404. package/dist/runtime/broker-daemon.mjs +1879 -1198
  405. package/dist/runtime/broker-process-manager.mjs +96 -3
  406. package/dist/runtime/mesh-discover.mjs +96 -3
  407. package/dist/scout-control-plane-web.mjs +4817 -1616
  408. package/dist/update-helper.mjs +211 -39
  409. package/package.json +5 -3
  410. package/server.json +31 -0
  411. package/dist/client/assets/ActivityScreen-CcDdQTBK.js +0 -1
  412. package/dist/client/assets/AgentAdventures-BxrYq_2v.js +0 -1
  413. package/dist/client/assets/AgentAvatar-NZOqcsB2.js +0 -1
  414. package/dist/client/assets/AgentConfigurationScreen-BhD1PEAM.js +0 -1
  415. package/dist/client/assets/AgentDefinitionsWorkspace-BqS6MXqF.js +0 -1
  416. package/dist/client/assets/AgentFloorView-A0dDRlRV.js +0 -1
  417. package/dist/client/assets/AgentInfoScreen-DuaN0sgE.js +0 -1
  418. package/dist/client/assets/AgentLanesEmbedScreen-CeNiaZ9_.js +0 -1
  419. package/dist/client/assets/AgentLanesView-WZhEDBFE.js +0 -2
  420. package/dist/client/assets/AgentMasterScreen-DUDUTAnU.js +0 -1
  421. package/dist/client/assets/AgentSessions-CO1WGa8Z.js +0 -6
  422. package/dist/client/assets/AgentsConsole-BQOWkj35.js +0 -1
  423. package/dist/client/assets/AgentsScreen-BMNAj1PH.js +0 -1
  424. package/dist/client/assets/AgentsSubnav-CeHhuzyM.js +0 -1
  425. package/dist/client/assets/BriefingDetailScreen-yZG8_m4h.js +0 -1
  426. package/dist/client/assets/BrokerScreen-CT37VQiL.js +0 -8
  427. package/dist/client/assets/ChannelComposer-BVItWlEz.js +0 -1
  428. package/dist/client/assets/ChannelSidebar-B-2spawY.js +0 -1
  429. package/dist/client/assets/ChatBits-CLJ71hTY.js +0 -1
  430. package/dist/client/assets/ChatRightPanel-pKQtkAgl.js +0 -1
  431. package/dist/client/assets/ChatSpaceSurface-NrLwdPkE.js +0 -1
  432. package/dist/client/assets/ChatSpaceTheme-BPMgPdVK.css +0 -1
  433. package/dist/client/assets/ChatSpaceTheme-D37Jk7bl.js +0 -1
  434. package/dist/client/assets/ConversationComposer-DNcn5U6D.js +0 -1
  435. package/dist/client/assets/ConversationFeedRows-RnYSa7Io.js +0 -1
  436. package/dist/client/assets/ConversationHeader-Y9TEJxP_.js +0 -1
  437. package/dist/client/assets/ConversationScreen-Brfas2y0.css +0 -1
  438. package/dist/client/assets/ConversationScreen-tpj4cqWs.js +0 -2
  439. package/dist/client/assets/ConversationStatus-Cv-7hErW.js +0 -1
  440. package/dist/client/assets/CrewAvatar-zgzC3cbU.js +0 -1
  441. package/dist/client/assets/CrewWorkspaces-K2jcyLec.js +0 -1
  442. package/dist/client/assets/FlightObserveScreen-CvzhzuWc.js +0 -1
  443. package/dist/client/assets/FloorResourcesSheet-_Iy5UqgY.js +0 -1
  444. package/dist/client/assets/FloorTacticalHUD-BhyOqlL5.js +0 -1
  445. package/dist/client/assets/HarnessMark-DSvM_H7H.js +0 -1
  446. package/dist/client/assets/HarnessesScreen-DyjqbZ4k.js +0 -1
  447. package/dist/client/assets/InviteLandingScreen-xZQ2na1z.js +0 -1
  448. package/dist/client/assets/InviteSheet--5Zjct25.js +0 -1
  449. package/dist/client/assets/KnowledgeSearchScreen-BPqAjHnH.js +0 -1
  450. package/dist/client/assets/LaneTraceDetailSheet-jl4XQmEx.js +0 -1
  451. package/dist/client/assets/MeshScreen-BW1dMFWF.js +0 -1
  452. package/dist/client/assets/MessagesScreen-CtNMfIvC.js +0 -1
  453. package/dist/client/assets/MissionControlView-BjPOViGY.js +0 -1
  454. package/dist/client/assets/MissionLeftAgentRow-Dms0DBjO.js +0 -1
  455. package/dist/client/assets/NativeAreaScreen-BQSTo8As.js +0 -1
  456. package/dist/client/assets/NativeAreaScreen-Brix6xDB.js +0 -1
  457. package/dist/client/assets/NativeAreaScreen-D7HyQNlM.js +0 -1
  458. package/dist/client/assets/NewChatComposer-BEXS8vV6.js +0 -19
  459. package/dist/client/assets/ObserveEmbedScreen-Dh30EjAQ.js +0 -2
  460. package/dist/client/assets/OpenScoutAppShell-D9pgw36i.js +0 -31
  461. package/dist/client/assets/OpsAgentsView-D3rM0udq.js +0 -1
  462. package/dist/client/assets/OpsScreen-DySeNQ1V.js +0 -1
  463. package/dist/client/assets/OpsSubnav-C9E0r3GZ.js +0 -1
  464. package/dist/client/assets/ProjectAgentProfile-FUav75j2.js +0 -1
  465. package/dist/client/assets/ProjectAgentProfileHero-BLK0EwMg.js +0 -1
  466. package/dist/client/assets/ProjectsInbox-DfCXReZK.js +0 -2
  467. package/dist/client/assets/ProjectsRail-CELVubfJ.js +0 -1
  468. package/dist/client/assets/ProjectsScreen-DMw4TLKy.js +0 -1
  469. package/dist/client/assets/ProjectsThreadAside-D1Sh4fnX.js +0 -1
  470. package/dist/client/assets/Provider-CNZluAZb.js +0 -5
  471. package/dist/client/assets/RailToggle-BwmY70B8.js +0 -1
  472. package/dist/client/assets/RawSessionsTable-6OVJq0JZ.js +0 -1
  473. package/dist/client/assets/RealtimeVoiceScreen-D41TYY0x.js +0 -9
  474. package/dist/client/assets/RepoDiffViewerLazy-BpMR7tlx.js +0 -2
  475. package/dist/client/assets/SessionObserveEvidence-CS1aQBpQ.js +0 -1
  476. package/dist/client/assets/SessionRefScreen-DURV0MpF.js +0 -1
  477. package/dist/client/assets/SessionsScreen-D71ZR-8t.js +0 -1
  478. package/dist/client/assets/SettingsDrawer-Nz98oBVl.js +0 -3
  479. package/dist/client/assets/SettingsScreen-CYBHal6y.js +0 -1
  480. package/dist/client/assets/SharedWorkFloor-BCmdeb3Q.css +0 -1
  481. package/dist/client/assets/SharedWorkFloor-C0xxW4SN.js +0 -2
  482. package/dist/client/assets/SpaceSwitcher-BfeIf-ad.js +0 -1
  483. package/dist/client/assets/Terminal-jIqnIZZ6.js +0 -4
  484. package/dist/client/assets/TerminalEmbedScreen-3XsjuySR.js +0 -1
  485. package/dist/client/assets/WorkDetailScreen-Bcf_yHhU.js +0 -5
  486. package/dist/client/assets/WorldActorTalk-CKerDikx.js +0 -1
  487. package/dist/client/assets/WorldMinimap-DOptgrc4.js +0 -1
  488. package/dist/client/assets/agent-autocomplete-C7xwIcwd.css +0 -1
  489. package/dist/client/assets/agent-autocomplete-_u9o5EZu.js +0 -2
  490. package/dist/client/assets/agents-screen-BMu6PpRY.css +0 -1
  491. package/dist/client/assets/at-sign-DM7xeppo.js +0 -1
  492. package/dist/client/assets/chat-api-BPVC0asu.js +0 -1
  493. package/dist/client/assets/chat-space-model-B6Jg2CY4.js +0 -4
  494. package/dist/client/assets/content-0AXa0klu.js +0 -1
  495. package/dist/client/assets/content-BEyJ19Lx.js +0 -1
  496. package/dist/client/assets/content-BN5weWKW.js +0 -1
  497. package/dist/client/assets/content-BNokkm7C.js +0 -1
  498. package/dist/client/assets/content-BV4PUM9q.js +0 -1
  499. package/dist/client/assets/content-BxUPlcx5.js +0 -1
  500. package/dist/client/assets/content-CIC5sku8.js +0 -1
  501. package/dist/client/assets/content-CdkTyxqk.js +0 -1
  502. package/dist/client/assets/content-CnhhSCZq.js +0 -1
  503. package/dist/client/assets/content-DY3F9Vfr.js +0 -1
  504. package/dist/client/assets/content-DrKBYpcb.js +0 -1
  505. package/dist/client/assets/content-LSStQYj5.js +0 -1
  506. package/dist/client/assets/content-YvU-D0hF.js +0 -1
  507. package/dist/client/assets/content-oKQMyVnH.js +0 -1
  508. package/dist/client/assets/conversation-model-m8HhzroS.js +0 -1
  509. package/dist/client/assets/conversation-motion-features-D9PxLoDt.js +0 -1
  510. package/dist/client/assets/conversations-Cbg9h_Af.js +0 -1
  511. package/dist/client/assets/ctx-panel-F05jXK4Q.css +0 -1
  512. package/dist/client/assets/discover-DlwbftpC.js +0 -2
  513. package/dist/client/assets/embed-entry-c0lwtjBG.js +0 -2
  514. package/dist/client/assets/home-moving-signal-BIHUGNfI.js +0 -1
  515. package/dist/client/assets/home-now-card-CaLgZze2.js +0 -1
  516. package/dist/client/assets/hooks-DaUOREpP.js +0 -2
  517. package/dist/client/assets/index-CGbs0SBm.css +0 -1
  518. package/dist/client/assets/index-CbqBwfIW.js +0 -1
  519. package/dist/client/assets/index-CyPMl7Up.js +0 -1
  520. package/dist/client/assets/index-PQpJveGO.js +0 -1
  521. package/dist/client/assets/left-0vBrvrBG.js +0 -2
  522. package/dist/client/assets/left-C6SyaqlJ.js +0 -1
  523. package/dist/client/assets/left-CTuXysZR.js +0 -2
  524. package/dist/client/assets/left-Cc6s4DT2.js +0 -1
  525. package/dist/client/assets/left-DF5caiyh.js +0 -1
  526. package/dist/client/assets/left-DgT4tWCx.js +0 -1
  527. package/dist/client/assets/left-R0wppTTr.js +0 -1
  528. package/dist/client/assets/left-advisor-C-kt8V28.js +0 -1
  529. package/dist/client/assets/left-agents-thnBO156.js +0 -1
  530. package/dist/client/assets/left-default-CT42fnpF.js +0 -1
  531. package/dist/client/assets/left-lanes-CSmZgciK.js +0 -1
  532. package/dist/client/assets/left-mission-C86x6i9h.js +0 -1
  533. package/dist/client/assets/library-DdhYL_9v.js +0 -1
  534. package/dist/client/assets/message-markup-6Tgo4qFJ.js +0 -15
  535. package/dist/client/assets/mission-control-model-C30vU1Fe.js +0 -1
  536. package/dist/client/assets/profile-BegEUmB7.js +0 -1
  537. package/dist/client/assets/projects-inbox-CKPLZN8s.css +0 -1
  538. package/dist/client/assets/resolve-panes-pfZTezKo.js +0 -1
  539. package/dist/client/assets/resolve-sidebar-context-D5ksvrb_.js +0 -1
  540. package/dist/client/assets/right-BDaCJ0CF.js +0 -1
  541. package/dist/client/assets/right-BP6lXRFS.js +0 -1
  542. package/dist/client/assets/right-Cb1VCrdj.js +0 -1
  543. package/dist/client/assets/right-CeFaxfBo.js +0 -1
  544. package/dist/client/assets/right-Ck2SrYCj.js +0 -1
  545. package/dist/client/assets/right-D-uv5YfF.js +0 -1
  546. package/dist/client/assets/right-DJMSICky.js +0 -1
  547. package/dist/client/assets/right-Dnljs8ah.js +0 -1
  548. package/dist/client/assets/right-SdCSF8PP.js +0 -1
  549. package/dist/client/assets/router-C-MF5-mb.js +0 -1
  550. package/dist/client/assets/runtime-picker-C_AVYF63.js +0 -1
  551. package/dist/client/assets/scout-voice-CqAyfblr.js +0 -1
  552. package/dist/client/assets/secondaryNavConfig-DzNHk6IH.js +0 -1
  553. package/dist/client/assets/system-surfaces-redesign-DKFg4GB5.css +0 -1
  554. package/dist/client/assets/useContentSecondaryNav-DrL_nkCZ.js +0 -1
  555. package/dist/client/assets/usePersistentState-Y8XwSTg-.js +0 -1
  556. package/dist/drizzle/meta/0000_snapshot.json +0 -4575
  557. package/dist/drizzle/meta/0001_snapshot.json +0 -4624
  558. package/dist/drizzle/meta/0002_snapshot.json +0 -4631
  559. package/dist/drizzle/meta/0003_snapshot.json +0 -4952
  560. package/dist/drizzle/meta/0004_snapshot.json +0 -5235
  561. package/dist/drizzle/meta/0005_snapshot.json +0 -5599
  562. package/dist/drizzle/meta/0006_snapshot.json +0 -5606
  563. package/dist/drizzle/meta/0007_snapshot.json +0 -5767
  564. package/dist/drizzle/meta/0008_snapshot.json +0 -5774
  565. package/dist/drizzle/meta/0009_snapshot.json +0 -6262
  566. package/dist/drizzle/meta/0010_snapshot.json +0 -6286
  567. package/dist/drizzle/meta/0011_snapshot.json +0 -6337
  568. package/dist/drizzle/meta/0012_snapshot.json +0 -6458
  569. package/dist/drizzle/meta/0013_snapshot.json +0 -6465
  570. package/dist/drizzle/meta/0014_snapshot.json +0 -6503
  571. package/dist/drizzle/meta/0015_snapshot.json +0 -6596
  572. package/dist/drizzle/meta/0016_snapshot.json +0 -6611
  573. package/dist/drizzle/meta/0017_snapshot.json +0 -6785
  574. package/dist/drizzle/meta/0018_snapshot.json +0 -6804
  575. package/dist/drizzle/meta/0019_snapshot.json +0 -6804
@@ -1,9 +0,0 @@
1
- import{r as h,j as i}from"./index-DReVb7jZ.js";import{a as Ht}from"./provider-DwmCoSlc.js";import{u as ks,E as bi,F as Wt,A as Gt,a as Si,G as De,H as ws,I as ki,J as js}from"./Provider-CNZluAZb.js";import{H as wi,A as ji,S as Ci,o as Pi,a as Ei,b as wo,c as jo}from"./agent-autocomplete-_u9o5EZu.js";import{a as Z}from"./api-DSqpVKC7.js";import{c as rt}from"./clipboard-e3fSpeo7.js";import{e as Ti}from"./credentials-OeoF-VKJ.js";import{b as Cs,u as Ni,a as Le}from"./persistent-state-BUsTTZFE.js";import{s as Se,e as Ri,S as Ps}from"./scoutbot-Bk3nyrkj.js";import{g as Di,s as Li,l as Ai,j as Vi,e as Mi,a as Ii}from"./scout-voice-CqAyfblr.js";import{d as Bi,f as Es,n as Be}from"./time-Dhsh_2EG.js";import{S as Oi}from"./scoutbot-markdown-DwvGQOWo.js";import{L as re}from"./loader-circle-DNUsuPWz.js";import{P as Co}from"./plus-D5NLH_fM.js";import{C as Mt}from"./chevron-down-CDzRQQGl.js";import{C as _i}from"./chevron-up-DX7R6KY2.js";import{c as ft}from"./createLucideIcon-ChvMq-zl.js";import{S as Po,a as Eo}from"./runtime-picker-C_AVYF63.js";import{S as Ui}from"./send-horizontal-BlQsRK6C.js";import{C as zi}from"./copy-BGOC1tJB.js";import{m as V,p as dt,a as Fi,n as je,i as $i,b as To,d as No,r as It,t as Ro,f as z,e as Oe,S as Hi,g as G,h as Do,j as jt,k as Lo,o as M,q as ke,s as Ct,v as Ts,M as Wi,w as Ao,P as Vo,x as Gi,y as Mo,z as Ns,A as Yi,B as Ae,C as qi,c as Xi,u as Io}from"./use-reduced-motion-CiaZHMnk.js";import{i as ne,b as Ki,r as Ji,s as Rs,p as Bt,d as Zi,e as Bo,f as Qi,h as ye,t as be,j as Pt,k as Ds,l as en,m as tn,n as sn,o as on,q as Yt,u as Et,v as nn,w as rn,x as Oo,y as an,z as cn,A as ln,B as un,C as Ls,D as dn,F as _o,g as hn,a as mn,c as fn}from"./gestures-CofqY4Km.js";import{R as As}from"./rocket-DAqYvu8I.js";import{X as pn}from"./x-rlMdRqJF.js";import{R as xn}from"./refresh-cw-IcD2lPoT.js";import{S as gn}from"./settings-C69Zjrpq.js";import{V as Vs}from"./fx-z37u1o2z.js";import{B as vn}from"./bot-BhAVbcCA.js";import{d as yn}from"./types-B0PlfpKc.js";const bn=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Sn=ft("archive",bn);const kn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wn=ft("circle-check",kn);const jn=[["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"}]],Uo=ft("volume-2",jn);const Cn=[["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"}]],zo=ft("volume-x",Cn);function Pn(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 Ki(e)&&"ownerSVGElement"in e}const at=new WeakMap;let ct;const Fo=(e,t,s)=>(o,r)=>r&&r[0]?r[0][e+"Size"]:qt(o)&&"getBBox"in o?o.getBBox()[t]:o[s],En=Fo("inline","width","offsetWidth"),Tn=Fo("block","height","offsetHeight");function Nn({target:e,borderBoxSize:t}){at.get(e)?.forEach(s=>{s(e,{get width(){return En(e,t)},get height(){return Tn(e,t)}})})}function Rn(e){e.forEach(Nn)}function Dn(){typeof ResizeObserver>"u"||(ct=new ResizeObserver(Rn))}function Ln(e,t){ct||Dn();const s=Ji(e);return s.forEach(o=>{let r=at.get(o);r||(r=new Set,at.set(o,r)),r.add(t),ct?.observe(o)}),()=>{s.forEach(o=>{const r=at.get(o);r?.delete(t),r?.size||ct?.unobserve(o)})}}const lt=new Set;let we;function An(){we=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};lt.forEach(t=>t(e))},window.addEventListener("resize",we)}function Vn(e){return lt.add(e),we||An(),()=>{lt.delete(e),!lt.size&&typeof we=="function"&&(window.removeEventListener("resize",we),we=void 0)}}function Ms(e,t){return typeof e=="function"?Vn(e):Ln(e,t)}function Mn(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 Is(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const $o=1e-4,In=1-$o,Bn=1+$o,Ho=.01,On=0-Ho,_n=0+Ho;function F(e){return e.max-e.min}function Un(e,t,s){return Math.abs(e-t)<=s}function Bs(e,t,s,o=.5){e.origin=o,e.originPoint=V(t.min,t.max,e.origin),e.scale=F(s)/F(t),e.translate=V(s.min,s.max,e.origin)-e.originPoint,(e.scale>=In&&e.scale<=Bn||isNaN(e.scale))&&(e.scale=1),(e.translate>=On&&e.translate<=_n||isNaN(e.translate))&&(e.translate=0)}function Me(e,t,s,o){Bs(e.x,t.x,s.x,o?o.originX:void 0),Bs(e.y,t.y,s.y,o?o.originY:void 0)}function Os(e,t,s,o=0){const r=o?V(s.min,s.max,o):s.min;e.min=r+t.min,e.max=e.min+F(t)}function zn(e,t,s,o){Os(e.x,t.x,s.x,o?.x),Os(e.y,t.y,s.y,o?.y)}function _s(e,t,s,o=0){const r=o?V(s.min,s.max,o):s.min;e.min=t.min-r,e.max=e.min+F(t)}function ht(e,t,s,o){_s(e.x,t.x,s.x,o?.x),_s(e.y,t.y,s.y,o?.y)}function Us(e,t,s,o,r){return e-=t,e=Rs(e,1/s,o),r!==void 0&&(e=Rs(e,1/r,o)),e}function Fn(e,t=0,s=1,o=.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,o);e===c&&(a-=t),e.min=Us(e.min,t,s,a,r),e.max=Us(e.max,t,s,a,r)}function zs(e,t,[s,o,r],c,n){Fn(e,t[s],t[o],t[r],t.scale,c,n)}const $n=["x","scaleX","originX"],Hn=["y","scaleY","originY"];function Fs(e,t,s,o){zs(e.x,t,$n,s?s.x:void 0,o?o.x:void 0),zs(e.y,t,Hn,s?s.y:void 0,o?o.y:void 0)}function $s(e){return e.translate===0&&e.scale===1}function Wo(e){return $s(e.x)&&$s(e.y)}function Hs(e,t){return e.min===t.min&&e.max===t.max}function Wn(e,t){return Hs(e.x,t.x)&&Hs(e.y,t.y)}function Ws(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Go(e,t){return Ws(e.x,t.x)&&Ws(e.y,t.y)}function Gs(e){return F(e.x)/F(e.y)}function Ys(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Q(e){return[e("x"),e("y")]}function Gn(e,t,s){let o="";const r=e.x.translate/t.x,c=e.y.translate/t.y,n=s?.z||0;if((r||c||n)&&(o=`translate3d(${r}px, ${c}px, ${n}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:l,rotate:d,pathRotation:f,rotateX:m,rotateY:x,skewX:v,skewY:b}=s;l&&(o=`perspective(${l}px) ${o}`),d&&(o+=`rotate(${d}deg) `),f&&(o+=`rotate(${f}deg) `),m&&(o+=`rotateX(${m}deg) `),x&&(o+=`rotateY(${x}deg) `),v&&(o+=`skewX(${v}deg) `),b&&(o+=`skewY(${b}deg) `)}const a=e.x.scale*t.x,u=e.y.scale*t.y;return(a!==1||u!==1)&&(o+=`scale(${a}, ${u})`),o||"none"}const Yo=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Yn=Yo.length,qs=e=>typeof e=="string"?parseFloat(e):e,Xs=e=>typeof e=="number"||Fi.test(e);function qn(e,t,s,o,r,c){r?(e.opacity=V(0,s.opacity??1,Xn(o)),e.opacityExit=V(t.opacity??1,0,Kn(o))):c&&(e.opacity=V(t.opacity??1,s.opacity??1,o));for(let n=0;n<Yn;n++){const a=Yo[n];let u=Ks(t,a),l=Ks(s,a);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||Xs(u)===Xs(l)?(e[a]=Math.max(V(qs(u),qs(l),o),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,o))}function Ks(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Xn=qo(0,.5,Zi),Kn=qo(.5,.95,je);function qo(e,t,s){return o=>o<e?0:o>t?1:s(Bt(e,t,o))}function Jn(e,t,s){const o=$i(e)?e:To(e);return o.start(Bo("",o,t,s)),o.animation}const Zn=(e,t)=>e.depth-t.depth;class Qn{constructor(){this.children=[],this.isDirty=!1}add(t){No(this.children,t),this.isDirty=!0}remove(t){It(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Zn),this.isDirty=!1,this.children.forEach(t)}}function er(e,t){const s=Ro.now(),o=({timestamp:r})=>{const c=r-s;c>=t&&(Oe(o),e(c-t))};return z.setup(o,!0),()=>Oe(o)}class tr{constructor(){this.members=[]}add(t){No(this.members,t);for(let s=this.members.length-1;s>=0;s--){const o=this.members[s];if(o===t||o===this.lead||o===this.prevLead)continue;const r=o.instance;(!r||r.isConnected===!1)&&!o.snapshot&&(It(this.members,o),o.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 o=this.members[s];if(o.isPresent!==!1&&o.instance?.isConnected!==!1)return this.promote(o),!0}return!1}promote(t,s){const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.updateSnapshot(),t.scheduleRender();const{layoutDependency:r}=o.options,{layoutDependency:c}=t.options;(r===void 0||r!==c)&&(t.resumeFrom=o,s&&(o.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&o.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"],sr=1e3;let or=0;function Nt(e,t,s,o){const{latestValues:r}=t;r[e]&&(s[e]=r[e],t.setStaticValue(e,0),o&&(o[e]=0))}function Xo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=on(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:r,layoutId:c}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",z,!(r||c))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&Xo(o)}function Ko({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(n={},a=t?.()){this.id=or++,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(rr),this.nodes.forEach(hr),this.nodes.forEach(mr),this.nodes.forEach(ar)},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 Qn)}addEventListener(n,a){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Hi),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)&&!Mn(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 d,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,d&&d(),d=er(m,250),ut.hasAnimatedSinceResize&&(ut.hasAnimatedSinceResize=!1,this.nodes.forEach(Qs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||u)&&this.addEventListener("didUpdate",({delta:d,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()||vr,{onLayoutAnimationStart:b,onLayoutAnimationComplete:j}=l.getProps(),S=!this.targetLayout||!Go(this.targetLayout,x),w=!f&&m;if(this.options.layoutRoot||this.resumeFrom||w||f&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...Qi(v,"layout"),onPlay:b,onComplete:j};(l.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(d,w,P.path)}else f||Qs(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(),Oe(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(fr),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&&Xo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];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(lr),this.nodes.forEach(Js);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Zs);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ur),this.nodes.forEach(dr),this.nodes.forEach(ir),this.nodes.forEach(nr)):this.nodes.forEach(Zs),this.clearAllSnapshots();const a=Ro.now();G.delta=Do(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,Lo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cr),this.sharedNodes.forEach(pr)}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&&!F(this.snapshot.measuredBox.x)&&!F(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=o(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&&!Wo(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,d=l!==this.prevTransformTemplateValue;n&&this.instance&&(a||ye(this.latestValues)||d)&&(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)),yr(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(br))){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:d,options:f}=l;l!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&J(a,n),be(a.x,d.offset.x),be(a.y,d.offset.y))}return a}applyTransform(n,a=!1,u){const l=u||M();J(l,n);for(let d=0;d<this.path.length;d++){const f=this.path[d];!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 d;l.instance&&(Ds(l.latestValues)&&l.updateSnapshot(),d=M(),J(d,l.measurePageBox())),Fs(a,l.latestValues,l.snapshot?.layoutBox,d)}return ye(this.latestValues)&&Fs(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:d,layoutId:f}=this.options;if(!this.layout||!(d||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(),zn(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),en(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||Ds(this.parent.latestValues)||tn(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(),ht(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:d}=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||d))return;J(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;sn(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():(Is(this.prevProjectionDelta.x,this.projectionDelta.x),Is(this.prevProjectionDelta.y,this.projectionDelta.y)),Me(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ys(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ys(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,d=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,b=this.layout?this.layout.source:void 0,j=v!==b,S=this.getStack(),w=!S||S.members.length<=1,P=!!(j&&!w&&this.options.crossfade===!0&&!this.path.some(gr));this.animationProgress=0;let C;const N=u?.interpolateProjection(n);this.mixTargetDelta=L=>{const D=L/1e3,y=N?.(D);y?(m.x.translate=y.x,m.x.scale=V(n.x.scale,1,D),m.x.origin=n.x.origin,m.x.originPoint=n.x.originPoint,m.y.translate=y.y,m.y.scale=V(n.y.scale,1,D),m.y.origin=n.y.origin,m.y.originPoint=n.y.originPoint):(eo(m.x,n.x,D),eo(m.y,n.y,D)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ht(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),xr(this.relativeTarget,this.relativeTargetOrigin,x,D),C&&Wn(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=M()),J(C,this.relativeTarget)),j&&(this.animationValues=f,qn(f,d,this.latestValues,D,P,w)),y&&y.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=y.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(n){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Oe(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=z.update(()=>{ut.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=To(0)),this.motionValue.jump(0,!1),this.currentAnimation=Jn(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(sr),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const n=this.getLead();let{targetWithTransforms:a,target:u,layout:l,latestValues:d}=n;if(!(!a||!u||!l)){if(this!==n&&this.layout&&l&&Jo(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||M();const f=F(this.layout.layoutBox.x);u.x.min=n.target.x.min,u.x.max=u.x.min+f;const m=F(this.layout.layoutBox.y);u.y.min=n.target.y.min,u.y.max=u.y.min+m}J(a,u),Pt(a,d),Me(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(n,a){this.sharedNodes.has(n)||this.sharedNodes.set(n,new tr),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 d=0;d<Tt.length;d++)Nt(`rotate${Tt[d]}`,n,l,this.animationValues),Nt(`skew${Tt[d]}`,n,l,this.animationValues);n.render();for(const d in l)n.setStaticValue(d,l[d]),this.animationValues&&(this.animationValues[d]=l[d]);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 d=l.animationValues||l.latestValues;this.applyTransformsToTarget();let f=Gn(this.projectionDeltaWithTransform,this.treeScale,d);u&&(f=u(d,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?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:n.opacity=l===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in Ts){if(d[v]===void 0)continue;const{correct:b,applyTo:j,isCSSVariable:S}=Ts[v],w=f==="none"?d[v]:b(d[v],l);if(j){const P=j.length;for(let C=0;C<P;C++)n[j[C]]=w}else S?this.options.visualElement.renderState.vars[v]=w:n[v]=w}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(Js),this.root.sharedNodes.clear()}}}function ir(e){e.updateLayout()}function nr(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=e.layout,{animationType:r}=e.options,c=t.source!==e.layout.source;if(r==="size")Q(d=>{const f=c?t.measuredBox[d]:t.layoutBox[d],m=F(f);f.min=s[d].min,f.max=f.min+m});else if(r==="x"||r==="y"){const d=r==="x"?"y":"x";Ot(c?t.measuredBox[d]:t.layoutBox[d],s[d])}else Jo(r,t.layoutBox,s)&&Q(d=>{const f=c?t.measuredBox[d]:t.layoutBox[d],m=F(s[d]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+m)});const n=ke();Me(n,s,t.layoutBox);const a=ke();c?Me(a,e.applyTransform(o,!0),t.measuredBox):Me(a,s,t.layoutBox);const u=!Wo(n);let l=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:m}=d;if(f&&m){const x=e.options.layoutAnchor||void 0,v=M();ht(v,t.layoutBox,f.layoutBox,x);const b=M();ht(b,s,m.layoutBox,x),Go(v,b)||(l=!0),d.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=v,e.relativeParent=d)}}}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 rr(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 ar(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cr(e){e.clearSnapshot()}function Js(e){e.clearMeasurements()}function lr(e){e.isLayoutDirty=!0,e.updateLayout()}function Zs(e){e.isLayoutDirty=!1}function ur(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function dr(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Qs(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hr(e){e.resolveTargetDelta()}function mr(e){e.calcProjection()}function fr(e){e.resetSkewAndRotation()}function pr(e){e.removeLeadSnapshot()}function eo(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 to(e,t,s,o){e.min=V(t.min,s.min,o),e.max=V(t.max,s.max,o)}function xr(e,t,s,o){to(e.x,t.x,s.x,o),to(e.y,t.y,s.y,o)}function gr(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vr={duration:.45,ease:[.4,0,.1,1]},so=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oo=so("applewebkit/")&&!so("chrome/")?Math.round:je;function io(e){e.min=oo(e.min),e.max=oo(e.max)}function yr(e){io(e.x),io(e.y)}function Jo(e,t,s){return e==="position"||e==="preserve-aspect"&&!Un(Gs(t),Gs(s),.2)}function br(e){return e!==e.root&&e.scroll?.wasRoot}const Sr=Ko({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},Zo=Ko({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rt.current){const e=new Sr({});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 no(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kr(...e){return t=>{let s=!1;const o=e.map(r=>{const c=no(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<o.length;r++){const c=o[r];typeof c=="function"?c():no(e[r],null)}}}}function wr(...e){return h.useCallback(kr(...e),e)}class jr extends h.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(Et(s)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=s.offsetParent,r=Et(o)&&o.offsetWidth||0,c=Et(o)&&o.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 Cr({children:e,isPresent:t,anchorX:s,anchorY:o,root:r,pop:c}){const n=h.useId(),a=h.useRef(null),u=h.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=h.useContext(Wi),d=e.props?.ref??e?.ref,f=wr(a,d);return h.useInsertionEffect(()=>{const{width:m,height:x,top:v,left:b,right:j,bottom:S,direction:w}=u.current;if(t||c===!1||!a.current||!m||!x)return;const P=w==="rtl",C=s==="left"?P?`right: ${j}`:`left: ${b}`:P?`left: ${b}`:`right: ${j}`,N=o==="bottom"?`bottom: ${S}`:`top: ${v}`;a.current.dataset.motionPopId=n;const L=document.createElement("style");l&&(L.nonce=l);const D=r??document.head;return D.appendChild(L),L.sheet&&L.sheet.insertRule(`
2
- [data-motion-pop-id="${n}"] {
3
- position: absolute !important;
4
- width: ${m}px !important;
5
- height: ${x}px !important;
6
- ${C}px !important;
7
- ${N}px !important;
8
- }
9
- `),()=>{a.current?.removeAttribute("data-motion-pop-id"),D.contains(L)&&D.removeChild(L)}},[t]),i.jsx(jr,{isPresent:t,childRef:a,sizeRef:u,pop:c,children:c===!1?e:h.cloneElement(e,{ref:f})})}const Pr=({children:e,initial:t,isPresent:s,onExitComplete:o,custom:r,presenceAffectsLayout:c,mode:n,anchorX:a,anchorY:u,root:l})=>{const d=Ao(Er),f=h.useId();let m=!0,x=h.useMemo(()=>(m=!1,{id:f,initial:t,isPresent:s,custom:r,onExitComplete:v=>{d.set(v,!0);for(const b of d.values())if(!b)return;o&&o()},register:v=>(d.set(v,!1),()=>d.delete(v))}),[s,d,o]);return c&&m&&(x={...x}),h.useMemo(()=>{d.forEach((v,b)=>d.set(b,!1))},[s]),h.useEffect(()=>{!s&&!d.size&&o&&o()},[s]),e=i.jsx(Cr,{pop:n==="popLayout",isPresent:s,anchorX:a,anchorY:u,root:l,children:e}),i.jsx(Vo.Provider,{value:x,children:e})};function Er(){return new Map}function Qo(e=!0){const t=h.useContext(Vo);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:r}=t,c=h.useId();h.useEffect(()=>{if(e)return r(c)},[e]);const n=h.useCallback(()=>e&&o&&o(c),[c,o,e]);return!s&&o?[!1,n]:[!0]}const st=e=>e.key||"";function ro(e){const t=[];return h.Children.forEach(e,s=>{h.isValidElement(s)&&t.push(s)}),t}const Tr=({children:e,custom:t,initial:s=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:c="sync",propagate:n=!1,anchorX:a="left",anchorY:u="top",root:l})=>{const[d,f]=Qo(n),m=h.useMemo(()=>ro(e),[e]),x=n&&!d?[]:m.map(st),v=h.useRef(!0),b=h.useRef(m),j=Ao(()=>new Map),S=h.useRef(new Set),[w,P]=h.useState(m),[C,N]=h.useState(m);Gi(()=>{v.current=!1,b.current=m;for(let y=0;y<C.length;y++){const T=st(C[y]);x.includes(T)?(j.delete(T),S.current.delete(T)):j.get(T)!==!0&&j.set(T,!1)}},[C,x.length,x.join("-")]);const L=[];if(m!==w){let y=[...m];for(let T=0;T<C.length;T++){const I=C[T],A=st(I);x.includes(A)||(y.splice(T,0,I),L.push(I))}return c==="wait"&&L.length&&(y=L),N(ro(y)),P(m),null}const{forceRender:D}=h.useContext(Mo);return i.jsx(i.Fragment,{children:C.map(y=>{const T=st(y),I=n&&!d?!1:m===C||x.includes(T),A=()=>{if(S.current.has(T))return;if(j.has(T))S.current.add(T),j.set(T,!0);else return;let B=!0;j.forEach(q=>{q||(B=!1)}),B&&(D?.(),N(b.current),n&&f?.(),o&&o())};return i.jsx(Pr,{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:y},T)})})};function Ie(e,t,s,o){return Yt(e,t,nn(s),o)}const ei=({current:e})=>e?e.ownerDocument.defaultView:null,ao=(e,t)=>Math.abs(e-t);function Nr(e,t){const s=ao(e.x,t.x),o=ao(e.y,t.y);return Math.sqrt(s**2+o**2)}const co=new Set(["auto","scroll"]);class ti{constructor(t,s,{transformPagePoint:o,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=ot(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Dt(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,b=Nr(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!b)return;const{point:j}=x,{timestamp:S}=G;this.history.push({...j,timestamp:S});const{onStart:w,onMove:P}=this.handlers;v||(w&&w(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,v)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=v,this.lastMoveEventInfo=ot(v,this.transformPagePoint),z.update(this.updatePoint,!0)},this.handlePointerUp=(x,v)=>{this.end();const{onEnd:b,onSessionEnd:j,resumeAnimation:S}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Dt(x.type==="pointercancel"?this.lastMoveEventInfo:ot(v,this.transformPagePoint),this.history);this.startEvent&&b&&b(x,w),j&&j(x,w)},!rn(t))return;this.dragSnapToOrigin=c,this.handlers=s,this.transformPagePoint=o,this.distanceThreshold=n,this.contextWindow=r||window;const u=Oo(t),l=ot(u,this.transformPagePoint),{point:d}=l,{timestamp:f}=G;this.history=[{...d,timestamp:f}];const{onSessionStart:m}=s;m&&m(t,Dt(l,this.history)),this.removeListeners=an(Ie(this.contextWindow,"pointermove",this.handlePointerMove),Ie(this.contextWindow,"pointerup",this.handlePointerUp),Ie(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let s=t.parentElement;for(;s;){const o=getComputedStyle(s);(co.has(o.overflowX)||co.has(o.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 o=t===window,r=o?{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||(o?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(),Oe(this.updatePoint)}}function ot(e,t){return t?{point:t(e.point)}:e}function lo(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Dt({point:e},t){return{point:e,delta:lo(e,si(t)),offset:lo(e,Rr(t)),velocity:Dr(t,.1)}}function Rr(e){return e[0]}function si(e){return e[e.length-1]}function Dr(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,o=null;const r=si(e);for(;s>=0&&(o=e[s],!(r.timestamp-o.timestamp>Ns(t)));)s--;if(!o)return{x:0,y:0};o===e[0]&&e.length>2&&r.timestamp-o.timestamp>Ns(t)*2&&(o=e[1]);const c=Yi(r.timestamp-o.timestamp);if(c===0)return{x:0,y:0};const n={x:(r.x-o.x)/c,y:(r.y-o.y)/c};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}function Lr(e,{min:t,max:s},o){return t!==void 0&&e<t?e=o?V(t,e,o.min):Math.max(e,t):s!==void 0&&e>s&&(e=o?V(s,e,o.max):Math.min(e,s)),e}function uo(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 Ar(e,{top:t,left:s,bottom:o,right:r}){return{x:uo(e.x,s,r),y:uo(e.y,t,o)}}function ho(e,t){let s=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,o]=[o,s]),{min:s,max:o}}function Vr(e,t){return{x:ho(e.x,t.x),y:ho(e.y,t.y)}}function Mr(e,t){let s=.5;const o=F(e),r=F(t);return r>o?s=Bt(t.min,t.max-o,e.min):o>r&&(s=Bt(e.min,e.max-r,t.min)),Do(0,1,s)}function Ir(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 Br(e=_t){return e===!1?e=0:e===!0&&(e=_t),{x:mo(e,"left","right"),y:mo(e,"top","bottom")}}function mo(e,t,s){return{min:fo(e,t),max:fo(e,s)}}function fo(e,t){return typeof e=="number"?e:e[t]||0}const Or=new WeakMap;class _r{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:o}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const c=f=>{s&&this.snapToCursor(Oo(f).point),this.stopAnimation()},n=(f,m)=>{const{drag:x,dragPropagation:v,onDragStart:b}=this.getProps();if(x&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Pn(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(S=>{let w=this.getAxisMotionValue(S).get()||0;if(dt.test(w)){const{projection:P}=this.visualElement;if(P&&P.layout){const C=P.layout.layoutBox[S];C&&(w=F(C)*(parseFloat(w)/100))}}this.originPoint[S]=w}),b&&z.update(()=>b(f,m),!1,!0),Ls(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;const{dragPropagation:x,dragDirectionLock:v,onDirectionLock:b,onDrag:j}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:S}=m;if(v&&this.currentDirection===null){this.currentDirection=zr(S),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",m.point,S),this.updateAxis("y",m.point,S),this.visualElement.render(),j&&z.update(()=>j(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:d}=this.getProps();this.panSession=new ti(t,{onSessionStart:c,onStart:n,onMove:a,onSessionEnd:u,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:o,contextWindow:ei(this.visualElement),element:this.visualElement.current})}stop(t,s){const o=t||this.latestPointerEvent,r=s||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!r||!o)return;const{velocity:n}=r;this.startAnimation(n);const{onDragEnd:a}=this.getProps();a&&z.postRender(()=>a(o,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:o}=this.getProps();!o&&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,o){const{drag:r}=this.getProps();if(!o||!it(t,r,this.currentDirection))return;const c=this.getAxisMotionValue(t);let n=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(n=Lr(n,this.constraints[t],this.elastic[t])),c.set(n)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&&Ae(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=Ar(o.layoutBox,t):this.constraints=!1,this.elastic=Br(s),r!==this.constraints&&!Ae(t)&&o&&this.constraints&&!this.hasMutatedConstraints&&Q(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=Ir(o.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Ae(t))return!1;const o=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const c=cn(o,r.root,this.visualElement.getTransformPagePoint());let n=Vr(r.layout.layoutBox,c);if(s){const a=s(ln(n));this.hasMutatedConstraints=!!a,a&&(n=un(a))}return n}startAnimation(t){const{drag:s,dragMomentum:o,dragElastic:r,dragTransition:c,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},l=Q(d=>{if(!it(d,s,this.currentDirection))return;let f=u&&u[d]||{};(n===!0||n===d)&&(f={min:0,max:0});const m=r?200:1e6,x=r?40:1e7,v={type:"inertia",velocity:o?t[d]:0,bounceStiffness:m,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...c,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(l).then(a)}startAxisValueAnimation(t,s){const o=this.getAxisMotionValue(t);return Ls(this.visualElement,t),o.start(Bo(t,o,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:o}=this.getProps();if(!it(s,o,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:o}=this.visualElement;if(!Ae(s)||!o||!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]=Mr({min:u,max:u},this.constraints[n])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.constraints=!1,this.resolveConstraints(),Q(n=>{if(!it(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;Or.set(this.visualElement,this);const t=this.visualElement.current,s=Ie(t,"pointerdown",l=>{const{drag:d,dragListener:f=!0}=this.getProps(),m=l.target,x=m!==t&&dn(m);d&&f&&!x&&this.start(l)});let o;const r=()=>{const{dragConstraints:l}=this.getProps();Ae(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),o||(o=Ur(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:d})=>{this.isDragging&&d&&(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(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:c=!1,dragElastic:n=_t,dragMomentum:a=!0}=t;return{...t,drag:s,dragDirectionLock:o,dragPropagation:r,dragConstraints:c,dragElastic:n,dragMomentum:a}}}function po(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Ur(e,t,s){const o=Ms(e,po(s)),r=Ms(t,po(s));return()=>{o(),r()}}function it(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function zr(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class Fr extends _o{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new _r(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 $r extends _o{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new ti(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ei(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lt(t),onStart:Lt(s),onMove:Lt(o),onEnd:(c,n)=>{delete this.session,r&&z.postRender(()=>r(c,n))}}}mount(){this.removePointerDownListener=Ie(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 Hr extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:o,layoutId:r}=this.props,{projection:c}=t;c&&(s.group&&s.group.add(c),o&&o.register&&r&&o.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:o,drag:r,isPresent:c}=this.props,{projection:n}=o;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:o}=t;o&&(o.options.layoutAnchor=s,o.root.didUpdate(),Lo.postRender(()=>{!o.currentAnimation&&o.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:r}=t;At=!0,r&&(r.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function oi(e){const[t,s]=Qo(),o=h.useContext(Mo);return i.jsx(Hr,{...e,layoutGroup:o,switchLayoutGroup:h.useContext(qi),isPresent:t,safeToRemove:s})}const Wr={pan:{Feature:$r},drag:{Feature:Fr,ProjectionNode:Zo,MeasureLayout:oi}},Gr={layout:{ProjectionNode:Zo,MeasureLayout:oi}},Yr={...mn,...hn,...Wr,...Gr},ii=Xi(Yr,fn),qr=new Set(["air-local","local","mini","node"]),Xr=new Set(["main","master","trunk"]);function Kr(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=>Jr(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,o)=>`${s.toLowerCase()} ending in ${Ut(o)}`).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)=>Zr(t)?t:Qr(s)).replace(/`([^`]+)`/g,(t,s)=>ea(s)).replace(/\s+/g," ").trim()}function Jr(e){try{return new URL(e).hostname.replace(/^www\./,"").replace(/\./g," dot ")}catch{return"link"}}function Zr(e){const t=e.replace(/^@/,"").toLowerCase();return/\.(com|app|dev|org|net|io|local)(?:\b|\/)/.test(t)&&!t.endsWith(".air-local")}function Qr(e){const t=e.split(".").filter(Boolean);if(t.length<2)return e;const s=[...t];for(;s.length>1&&qr.has(s.at(-1).toLowerCase());)s.pop();const[o,...r]=s,c=r.filter(n=>!Xr.has(n.toLowerCase())).map(zt).filter(Boolean);return[zt(o),...c].filter(Boolean).join(", ")}function ea(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 ta({state:e,chatExpanded:t,onToggleExpanded:s,sessionPickerOpen:o,onToggleSessionPicker:r,onStartNewChat:c,startingNewChat:n,onSwitchSession:a,switchingSessionId:u,sending:l,briefing:d,pendingAsk:f,onArchiveSession:m,archivingSessionId:x,onAssistantContextMenu:v,suggestedPrompts:b,onSelectPrompt:j}){const w=e.session.messages,P=t?w:w.slice(-4),C=t?0:Math.max(0,w.length-P.length),N=w.length,L=e.sessions.length,D=e.retention,y=w.length===0&&!f&&!l&&!d,T=n||l||d||!!u||!!x,I=e.session.createdAt?Bi(e.session.createdAt):null,A=y?"Scout conversation":e.session.title&&e.session.title!=="New Scout Session"?e.session.title:`Session ${e.session.id.slice(0,8)}`,B=h.useRef(null),q=w[w.length-1]?.id??null,ee=w[w.length-1]?.body??"";return h.useEffect(()=>{const R=B.current;R&&(R.scrollTop=R.scrollHeight)},[q,ee,f,l,t,e.session.id]),i.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:[i.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:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"min-w-0 truncate text-[var(--scout-chrome-ink)]",title:e.session.id,children:A}),I&&!y&&i.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",I]}),!y&&i.jsxs("span",{className:"shrink-0 text-[var(--scout-chrome-ink-ghost)]",children:["· ",N," msg",N===1?"":"s"]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsxs("button",{type:"button",title:"Start a new chat (keeps this chat in Chats)","aria-label":"Start new chat",onClick:c,disabled:T,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?i.jsx(re,{size:10,className:"animate-spin"}):i.jsx(Co,{size:10}),i.jsx("span",{children:n?"Starting":"New chat"})]}),i.jsxs("button",{type:"button",title:`Switch chat (${L} 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 ${o?"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:[i.jsx(wi,{size:10}),i.jsx("span",{children:"Chats"}),i.jsx("span",{className:"text-[var(--scout-chrome-ink-ghost)]",children:L}),i.jsx(Mt,{size:9,className:o?"rotate-180 transition-transform":"transition-transform"})]}),N>4&&i.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:[i.jsx("span",{children:t?"Collapse":"Full"}),t?i.jsx(_i,{size:9}):i.jsx(Mt,{size:9})]})]})]}),o&&i.jsxs("div",{className:"shrink-0 border-b border-[var(--scout-chrome-border-soft)] px-2 py-1.5",children:[i.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:[i.jsx("span",{children:"Recent chats"}),D&&D.archivedCount>0&&i.jsxs("span",{children:[D.archivedCount," archived"]})]}),i.jsx("div",{className:"flex max-h-40 flex-col gap-0.5 overflow-y-auto pr-0.5",children:e.sessions.map(R=>{const X=R.id===e.session.id,ae=u===R.id,K=x===R.id,_=Es(R.updatedAt)||"unknown",$=R.title&&R.title!=="New Scout Session"?R.title:`Session ${R.id.slice(0,8)}`;return i.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:[i.jsxs("button",{type:"button",onClick:()=>{X||a(R.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:[i.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${X?"bg-lime-300":"bg-[var(--scout-chrome-ink-ghost)]"}`}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--scout-chrome-ink)]",children:$}),i.jsxs("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:[R.messageCount," msg"]}),i.jsx("span",{className:"shrink-0 text-2xs text-[var(--scout-chrome-ink-ghost)]",children:_}),ae&&i.jsx(re,{size:10,className:"shrink-0 animate-spin text-lime-200"})]}),i.jsx("button",{type:"button",title:"Archive chat","aria-label":`Archive chat ${$}`,onClick:()=>m(R.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?i.jsx(re,{size:10,className:"animate-spin"}):i.jsx(Sn,{size:10})})]},R.id)})})]}),i.jsxs("div",{ref:B,className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-2.5 py-2",children:[C>0&&i.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:["↑ ",C," earlier message",C===1?"":"s"]}),y&&i.jsx(sa,{suggestedPrompts:b,onSelectPrompt:j}),P.map((R,X)=>{const ae=na(P[X-1],R),K=ra(R.createdAt);return i.jsxs("div",{className:"flex flex-col gap-1",children:[ae&&i.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:Es(R.createdAt),"aria-label":K,children:K}),i.jsx(xo,{role:R.role,body:R.body,onContextMenu:R.role==="assistant"&&v?_=>v(_,R.body):void 0})]},R.id)}),f&&i.jsx(xo,{role:"user",body:f,pending:!0}),l&&!f&&i.jsx("p",{className:"text-[var(--scout-chrome-ink-ghost)]",children:"Reading the control plane…"}),d&&i.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:[i.jsx(re,{size:12,className:"shrink-0 animate-spin text-lime-300","aria-hidden":"true"}),i.jsxs("div",{className:"min-w-0 flex flex-col gap-0.5",children:[i.jsx("span",{className:"text-xs uppercase tracking-[0.14em] text-lime-300",children:"Briefing"}),i.jsx("span",{className:"text-[var(--scout-chrome-ink)]",children:"Codex is reviewing the control-plane snapshot. Voice will pick up when it lands."})]})]})]})]})}function sa({suggestedPrompts:e=[],onSelectPrompt:t}){return i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col justify-start gap-2 px-1 py-2.5",children:[e.length>0?i.jsx("div",{className:"grid gap-1",children:e.slice(0,3).map(s=>i.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,i.jsxs("div",{className:"max-w-[30rem]",children:[i.jsx("div",{className:"font-sans text-lg font-semibold leading-tight text-[var(--scout-chrome-ink)]",children:"Start with a question."}),i.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 oa({agents:e,draft:t,onDraftChange:s,onSubmit:o,sending:r,recording:c,voiceLabel:n,voiceBusy:a,voiceUnavailable:u,voiceHeld:l=!1,onMicClick:d,prominent:f=!1,autoFocus:m,focusSignal:x}){const v=h.useRef(null),b=h.useCallback(()=>{const P=v.current;P&&(P.textarea?P.textarea.focus({preventScroll:!0}):P.focus())},[]);h.useEffect(()=>{m&&b()},[m,b]),h.useEffect(()=>{x&&b()},[x,b]);let j="Start talking";u&&(j="Set up Scout voice"),c&&(j="Stop talking"),(a||l)&&(j=n);const S=a||c||l,w=["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 i.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:P=>{P.preventDefault(),o()},children:[i.jsx(ji,{ref:v,agents:e,value:t,onChange:s,onSubmit:()=>{t.trim()&&!r&&o()},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:w}),i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("button",{type:"button",title:j,"aria-label":j,onClick:d,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)]"} ${S?"gap-1.5 px-3 font-mono text-xs uppercase tracking-[0.12em]":"w-9"}`,children:[a?i.jsx(re,{size:13,className:"animate-spin"}):c?i.jsx(Po,{size:12,className:"fill-current"}):i.jsx(Eo,{size:13}),S&&i.jsx("span",{className:"truncate",children:n})]}),i.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?i.jsx(re,{size:13,className:"animate-spin"}):i.jsx(Ui,{size:13})})]})]})}function xo({role:e,body:t,pending:s=!1,onContextMenu:o}){const r=e==="user",c=r?t:Se(t),[n,a]=h.useState(!1),u=h.useCallback(()=>{rt(c).then(()=>{a(!0),window.setTimeout(()=>a(!1),1200)}).catch(()=>{})},[c]);return i.jsxs("div",{className:"group flex flex-col gap-0.5",onContextMenu:o,children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.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"]}),i.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?i.jsx(wn,{size:11}):i.jsx(zi,{size:11})})]}),r?i.jsx("p",{className:`whitespace-pre-wrap break-words text-sm leading-relaxed text-[var(--scout-chrome-ink)] ${s?"opacity-60":""}`,children:c}):i.jsx("div",{className:s?"opacity-60":"",children:i.jsx(Oi,{text:c})})]})}const ia=5*6e4;function na(e,t){if(!e||!Ft(e.createdAt,t.createdAt))return!0;const s=Be(e.createdAt),o=Be(t.createdAt);return s===null||o===null?!0:Math.abs(o-s)>=ia}function Ft(e,t){const s=Be(e),o=Be(t);if(s===null||o===null)return!1;const r=new Date(s),c=new Date(o);return r.getFullYear()===c.getFullYear()&&r.getMonth()===c.getMonth()&&r.getDate()===c.getDate()}function ra(e){const t=Be(e);if(t===null)return"";const s=new Date(t),o=new Date,r=new Date(o);r.setDate(o.getDate()-1);const c=s.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return Ft(t,o.getTime())?`Today ${c}`:Ft(t,r.getTime())?`Yesterday ${c}`:s.getFullYear()===o.getFullYear()?`${s.toLocaleDateString([],{month:"short",day:"numeric"})} ${c}`:`${s.toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})} ${c}`}const aa={"--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"},go=[2,4,7,5,3,6,9,5,3,4,8,6,3,5,9,6,3,5,7,4,2,4,6,3],ca=go.map((e,t)=>{const s=t/go.length*Math.PI*2-Math.PI/2,o=24-e/2,r=24+e/2;return{x1:36+Math.cos(s)*o,y1:36+Math.sin(s)*o,x2:36+Math.cos(s)*r,y2:36+Math.sin(s)*r}});function la({recording:e,sending:t,speaking:s,voiceAvailable:o,voiceProbeState:r,voiceState:c}){return s?"speaking":t?"thinking":e&&c==="processing"?"processing":e?"listening":r!=="idle"||c==="starting"||o===null?"checking":o===!1?"unavailable":"ready"}const ua={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 da(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 ha(e){return e==="listening"||e==="processing"?"listen":e==="thinking"?"think":e==="speaking"?"speak":null}function ma({phase:e,disabled:t,onClick:s}){const o=Io(),r=e==="listening"||e==="speaking",c=da(e);return i.jsx(ii.div,{animate:r&&!o?{scale:[1,1.025,1]}:{scale:1},transition:r&&!o?{duration:2.2,ease:"easeInOut",repeat:1/0}:{duration:.18},children:i.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:i.jsxs("svg",{viewBox:"0 0 72 72",className:"h-[72px] w-[72px]","aria-hidden":"true",children:[i.jsx("circle",{cx:"36",cy:"36",r:"24",fill:"none",stroke:"#d2cec6",strokeWidth:"0.8"}),ca.map((n,a)=>i.jsx("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:r?"#817b71":"#a5a198",strokeWidth:"1.15",strokeLinecap:"round"},a)),i.jsx("circle",{cx:"36",cy:"36",r:"7.5",fill:r?"#b98a3b":"#d3b16d"})]})})})}const fa=[{id:"listen",label:"Listen"},{id:"think",label:"Think"},{id:"speak",label:"Speak"}];function pa({messages:e,pendingAsk:t,partial:s,error:o,status:r,recording:c,sending:n,speaking:a,voiceAvailable:u,voiceInputSource:l,voiceProbeState:d,voiceState:f,voiceReplies:m,settingsOpen:x,setupPanel:v,settingsPanel:b,assistantModel:j,onPrimaryAction:S,onToggleVoiceReplies:w,onToggleSettings:P,onNewChat:C,onOpenLive:N}){const L=Io(),D=h.useRef(null),y=la({recording:c,sending:n,speaking:a,voiceAvailable:u,voiceProbeState:d,voiceState:f}),T=ua[y],I=y==="checking"||y==="processing"||y==="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,R=ha(y),X=j?.trim()||"Turn-based voice",ae=u===!1?"Mic offline":u===null?"Checking mic":"Mic active",K=y==="unavailable"?"bg-[#a25549]":y==="ready"||y==="checking"?"bg-[#a7a49d]":"bg-[#b58a3f]";return h.useEffect(()=>{D.current?.scrollIntoView({block:"nearest"})},[e.length,t]),i.jsxs("section",{className:"relative flex h-full min-h-0 w-full flex-col overflow-hidden bg-[#f3f0e9] text-[#2a2d2f]",style:aa,"aria-label":"Direct voice conversation",children:[i.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:[i.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[i.jsx("h1",{className:"truncate font-[var(--font-accent-title)] text-[15px] font-semibold tracking-[-0.018em] text-[#171a1c] sm:text-[17px]",children:"Direct Voice"}),i.jsx("span",{className:"hidden h-4 w-px bg-[#d6d1c7] sm:block","aria-hidden":"true"}),i.jsxs("div",{className:"hidden min-w-0 items-center gap-2 sm:flex","aria-live":"polite",children:[i.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${K}`,"aria-hidden":"true"}),i.jsx("span",{className:"truncate text-xs text-[#6f716e]",children:T.label})]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 sm:gap-2",children:[i.jsxs("div",{className:"flex rounded-md border border-[#cbc5ba] bg-[#e8e3da] p-0.5",role:"tablist","aria-label":"Voice mode",children:[i.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"}),i.jsx("button",{type:"button",role:"tab","aria-selected":"false",onClick:N,disabled:!N,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"})]}),i.jsxs("button",{type:"button",onClick:C,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:[i.jsx(Co,{size:14,"aria-hidden":"true"}),i.jsx("span",{className:"hidden md:inline",children:"New chat"})]}),i.jsx("button",{type:"button",onClick:w,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?i.jsx(Uo,{size:15}):i.jsx(zo,{size:15})}),i.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:i.jsx(Ci,{size:15})})]})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i.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:i.jsxs("div",{className:"w-full max-w-[720px]",children:[ee?i.jsxs("div",{className:"pt-1",children:[i.jsx("p",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#8b8983]",children:"Conversation"}),i.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."})]}):i.jsxs("div",{className:"space-y-8 sm:space-y-9",children:[B.map(_=>{const $=_.role==="assistant";return i.jsxs("article",{className:"max-w-[68ch]",children:[i.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[i.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#575a59]",children:$?"Scout":"You"}),$&&i.jsx("span",{className:"text-[10px] text-[#8a8983]",children:X})]}),i.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[15px] leading-6 text-[#25292a] sm:text-base sm:leading-7",children:$?Se(_.body):_.body})]},_.id)}),q&&i.jsxs("article",{className:"max-w-[68ch]","aria-live":"polite",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-[#765923]",children:"You"}),i.jsx("span",{className:"text-[10px] text-[#9a7a40]",children:s?"Listening":"Sending"})]}),i.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[15px] leading-6 text-[#25292a] sm:text-base sm:leading-7",children:q})]})]}),i.jsx("div",{ref:D})]})})}),i.jsx(Tr,{initial:!1,children:(v||x||o)&&i.jsx(ii.div,{initial:L?!1:{opacity:0,y:6},animate:{opacity:1,y:0},exit:L?void 0:{opacity:0,y:6},className:"max-h-[34vh] shrink-0 overflow-y-auto border-y border-[#d9d4ca] bg-[#eeeae2]",children:i.jsxs("div",{className:"mx-auto w-full max-w-[880px] px-6 py-4 sm:px-10 lg:px-14",children:[o&&i.jsx("p",{className:"mb-3 text-sm leading-6 text-[#93483f]",children:o}),v,x&&b]})})}),i.jsxs("div",{className:"shrink-0 px-5 pb-4 pt-3 sm:px-8 sm:pb-5",children:[i.jsxs("div",{className:"flex flex-col items-center text-center",children:[i.jsx(ma,{phase:y,disabled:I,onClick:S}),i.jsxs("div",{className:"mt-3","aria-live":"polite",children:[i.jsx("p",{className:"text-sm font-semibold text-[#24282a]",children:T.label}),i.jsx("p",{className:"mt-0.5 text-xs text-[#7a7b76]",children:T.helper})]}),i.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-[#7b6a49]",children:[i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#b58a3f]","aria-hidden":"true"}),i.jsx("span",{children:ae})]})]}),i.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:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(Eo,{size:12,className:"shrink-0 text-[#8b7350]","aria-hidden":"true"}),i.jsxs("span",{className:"truncate",children:["Input: ",A]})]}),i.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 sm:justify-start","aria-label":`Voice turn state: ${T.label}`,children:fa.map(_=>{const $=R===_.id;return i.jsx("span",{className:$?"font-medium text-[#5e4821]":"text-[#96948e]",children:_.label},_.id)})}),r&&!n&&y!=="listening"&&i.jsx("span",{className:"hidden max-w-48 truncate text-right text-[#96948e] lg:block",children:r})]})]})]})}function vo({icon:e,title:t,onClick:s,disabled:o,active:r,badge:c}){return i.jsxs("button",{type:"button",title:t,"aria-label":t,onClick:s,disabled:o,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&&i.jsx("span",{className:"font-mono text-3xs tracking-tight",children:c})]})}function yo({issue:e,probeState:t,onLaunch:s,onRetry:o,onSettings:r,onDismiss:c}){const n=t==="probing"||t==="launching";return i.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:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(As,{size:13,className:"mt-0.5 shrink-0 text-[var(--scout-chrome-ink-faint)]"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"uppercase tracking-[0.14em] text-[var(--scout-chrome-ink-faint)]",children:"Scout Voice"}),i.jsx("p",{className:"mt-1 leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Open Scout Menu to use speech."}),e&&i.jsx("p",{className:"mt-2 break-words leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:e})]}),c?i.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:i.jsx(pn,{size:11})}):null]}),i.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-1.5",children:[i.jsx(Vt,{icon:t==="launching"?i.jsx(re,{size:12,className:"animate-spin"}):i.jsx(As,{size:12}),label:t==="launching"?"Opening":"Open",onClick:s,disabled:t==="probing",title:"Open Scout services"}),i.jsx(Vt,{icon:t==="probing"?i.jsx(re,{size:12,className:"animate-spin"}):i.jsx(xn,{size:12}),label:"Retry",onClick:o,disabled:n,title:"Check Scout voice again"}),i.jsx(Vt,{icon:i.jsx(gn,{size:12}),label:"Voice",onClick:r,disabled:t==="probing",title:"Open Scoutbot voice settings"})]})]})}function Vt({icon:e,label:t,onClick:s,disabled:o,title:r}){return i.jsxs("button",{type:"button",title:r,onClick:s,disabled:o,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 Ve="gpt-4o-mini-tts",xa={openai:"OpenAI",elevenlabs:"ElevenLabs",nvidia:"NVIDIA",system:"System"},$t="us-woman",mt=[{id:"us-woman",label:"US Woman",locale:"US English",presentation:"Woman",voiceName:"Marin",description:"Warm, clear, and conversational.",provider:"openai",accentFromPrompt:!1,speech:{modelId:Ve,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.",provider:"openai",accentFromPrompt:!1,speech:{modelId:Ve,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.",provider:"openai",accentFromPrompt:!0,speech:{modelId:Ve,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.",provider:"openai",accentFromPrompt:!0,speech:{modelId:Ve,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:Ve,voiceId:"marin",instructions:"Speak naturally, clearly, and conversationally."},ga={modelId:"",voiceId:"",instructions:"",playback:"host"};function va(e){return e==="custom"||e==="device"||mt.some(t=>t.id===e)}function ya(e,t={}){return e==="device"?ga:e==="custom"?{modelId:t.modelId?.trim()||Ce.modelId,voiceId:t.voiceId?.trim()||Ce.voiceId,instructions:t.instructions?.trim()||Ce.instructions}:mt.find(s=>s.id===e)?.speech??mt.find(s=>s.id===$t).speech}function bo({presentation:e,voicePresetId:t,onVoicePresetId:s,speechSelectionId:o,onSpeechSelectionId:r,customSpeechModelId:c,onCustomSpeechModelId:n,customSpeechVoiceId:a,onCustomSpeechVoiceId:u,customSpeechInstructions:l,onCustomSpeechInstructions:d,voiceDefaults:f,modelDraft:m,onModelDraft:x,modelOptions:v=[],promptDraft:b,onPromptDraft:j,configLoading:S,configSaving:w,configError:P,configStatus:C,onSave:N,onReload:L}){const D=e==="direct-voice";return i.jsx("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-surface)] p-3",children:i.jsxs("div",{className:"flex flex-col gap-3",children:[D?i.jsxs("fieldset",{className:"flex flex-col gap-2",children:[i.jsx("legend",{className:"mb-1 font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Scout voice"}),i.jsx("div",{className:"grid grid-cols-2 gap-2",role:"radiogroup","aria-label":"Scout voice",children:mt.map(y=>{const T=o===y.id;return i.jsxs("button",{type:"button",role:"radio","aria-checked":T,onClick:()=>r(y.id),className:`min-h-20 rounded border p-2.5 text-left transition ${T?"border-[var(--hud-accent)] bg-[var(--hud-accent-soft)] text-[var(--scout-chrome-ink)]":"border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[i.jsx("span",{className:"block font-mono text-xs font-bold uppercase tracking-[0.1em]",children:y.label}),i.jsxs("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:[y.voiceName," · ",y.description]}),i.jsxs("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:[xa[y.provider]," · ",y.speech.modelId," · ",y.speech.voiceId]}),y.accentFromPrompt&&i.jsx("span",{className:"mt-1 block font-mono text-2xs leading-relaxed text-[var(--scout-chrome-ink-ghost)]",children:"Accent is prompted, not a separate voice."})]},y.id)})}),i.jsxs("button",{type:"button",role:"radio","aria-checked":o==="device",onClick:()=>r("device"),className:`rounded border px-2.5 py-2 text-left font-mono text-xs transition ${o==="device"?"border-[var(--hud-accent)] bg-[var(--hud-accent-soft)] text-[var(--scout-chrome-ink)]":"border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[i.jsx("span",{className:"font-bold uppercase tracking-[0.1em]",children:"This Mac's voice"}),i.jsx("span",{className:"ml-2 text-[var(--scout-chrome-ink-ghost)]",children:"Speaks through Scout Menu in its own Settings › Voice pick. The only way to hear installed voices such as Kokoro."})]}),i.jsxs("button",{type:"button",role:"radio","aria-checked":o==="custom",onClick:()=>r("custom"),className:`rounded border px-2.5 py-2 text-left font-mono text-xs transition ${o==="custom"?"border-[var(--hud-accent)] bg-[var(--hud-accent-soft)] text-[var(--scout-chrome-ink)]":"border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] text-[var(--scout-chrome-ink-faint)] hover:bg-[var(--scout-chrome-hover)]"}`,children:[i.jsx("span",{className:"font-bold uppercase tracking-[0.1em]",children:"Custom voice"}),i.jsx("span",{className:"ml-2 text-[var(--scout-chrome-ink-ghost)]",children:"Use any supported model, voice, and style."})]}),o==="custom"&&i.jsxs("div",{className:"grid gap-2 rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] p-2.5",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.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",i.jsx("input",{value:c,onChange:y=>n(y.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)] bg-[var(--hud-bg)]"})]}),i.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",i.jsx("input",{value:a,onChange:y=>u(y.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)] bg-[var(--hud-bg)]"})]})]}),i.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",i.jsx("textarea",{value:l,onChange:y=>d(y.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)] bg-[var(--hud-bg)]"})]})]}),i.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."})]}):i.jsxs(i.Fragment,{children:[i.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",i.jsx("select",{value:t,onChange:y=>s(y.target.value),className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] px-2 py-1.5 font-mono text-sm normal-case tracking-normal text-[var(--scout-chrome-ink)]",children:Vs.map(y=>i.jsxs("option",{value:y.id,children:[y.label," — ",y.family]},y.id))}),i.jsx("span",{className:"font-mono text-2xs normal-case leading-relaxed tracking-normal text-[var(--scout-chrome-ink-ghost)]",children:Vs.find(y=>y.id===t)?.description??"Custom voice mood for spoken replies."})]}),i.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",i.jsx("div",{className:"rounded border border-[var(--scout-chrome-border-soft)] bg-[var(--hud-bg)] 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"})]})]}),i.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",v.length>0?i.jsx("select",{value:m,onChange:y=>x(y.target.value),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)] bg-[var(--hud-bg)]",disabled:S||w,children:v.map(y=>i.jsx("option",{value:y.id,children:y.label},y.id))}):i.jsx("input",{value:m,onChange:y=>x(y.target.value),placeholder:"gpt-5.6-luna",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)] bg-[var(--hud-bg)]",disabled:S||w})]}),i.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",i.jsx("textarea",{value:b,onChange:y=>j(y.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)] bg-[var(--hud-bg)]",disabled:S||w})]}),P&&i.jsx("div",{className:"font-mono text-xs leading-relaxed text-[var(--hud-status-error)]",children:P}),C&&i.jsx("div",{className:"font-mono text-xs leading-relaxed text-[var(--hud-accent)]",children:C}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:N,disabled:S||w||!b.trim(),className:"flex items-center justify-center gap-2 rounded bg-[var(--hud-accent)] px-2.5 py-2 font-mono text-xs font-bold uppercase tracking-[0.12em] text-black transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:[(S||w)&&i.jsx(re,{size:13,className:"animate-spin"}),w?"Saving":"Save"]}),i.jsx("button",{type:"button",onClick:L,disabled:S||w,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 ba="chill-dispatcher",Sa=6e4,ka=2500,wa=1.2,ja={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 Ca(e){const t=Math.min(1,e/8);return{saturationAmount:.035+t*.025,presencePeakDb:1.5+t*1.5}}function Pa(e,t){return{...e==="chill-dispatcher"?ja:{},...Ca(t)}}function ni(e,t,s){return new Promise((o,r)=>{const c=window.setTimeout(()=>r(new Error(s)),t);e.then(o,r).finally(()=>window.clearTimeout(c))})}async function nt(e,t={}){!e.sessionId&&!t.allowCurrentSession||await ni(e.cancel(),ka,"Timed out releasing Scout voice session.").catch(()=>{})}function Ea(e){const t=e instanceof Error?e.message:String(e);return/session_cancelled|was cancelled|cancelled/i.test(t)}const So=new RegExp("(?:^|(?<=[\\s(`'\"<>]))(?:~\\/|\\/(?:Users|home|opt|var|etc|tmp|private)\\/)[^\\s)`'\"<>]+\\.[A-Za-z0-9]{1,8}\\b","g");function Ta(e){const t=[],s=new Set;So.lastIndex=0;let o;for(;(o=So.exec(e))!==null;)s.has(o[0])||(s.add(o[0]),t.push(o[0]));return t}function ko(e){const t=e.split("/").filter(Boolean);return t.length<=2?e:`…/${t.slice(-2).join("/")}`}function Na(){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 Ra=["Explain what went wrong here.","Help me rewrite this message.","What should I try next?"];function Da({height:e,forceExpanded:t=!1,fill:s=!1,presentation:o="chat",onOpenLive:r}={}){const{applyScoutbotUiAction:c,agents:n,route:a,onlineCount:u}=ks(),l=bi(),d=Ht(Wt,!0),f=Gt(),m=d&&(f.state==="connecting"||f.state==="live"),[x,v]=Cs("openscout.scoutbot.collapsed",!0),[b,j]=h.useState(""),[S,w]=h.useState(!1),[P,C]=h.useState(null),[N,L]=h.useState(null),[D,y]=h.useState(null),[T,I]=h.useState("idle"),[A,B]=Cs("openscout.scoutbot.voiceReplies",!1),[q]=Ni("openscout.scoutbot.voiceSpeed",wa),[ee,R]=Le("openscout.scoutbot.voicePresetId",ba),[X,ae]=Le("openscout.scoutbot.speechProfileId",$t),[K,_]=Le("openscout.scoutbot.customSpeechModelId",Ce.modelId),[$,Xt]=Le("openscout.scoutbot.customSpeechVoiceId",Ce.voiceId),[_e,Kt]=Le("openscout.scoutbot.customSpeechInstructions",Ce.instructions),[te,Ue]=h.useState(!1),[pt,le]=h.useState(null),[xt,Pe]=h.useState(""),[se,gt]=h.useState(!1),[ai,Jt]=h.useState(null),[Zt,vt]=h.useState(null),[Va,ze]=h.useState(null),[yt,H]=h.useState(null),[de,Ee]=h.useState(!1),[ci,Fe]=h.useState(!1),[Y,he]=h.useState(null),[me,Qt]=h.useState(!1),[bt,es]=h.useState(null),[ts,ss]=h.useState(!1),[os,is]=h.useState(!1),[ns,$e]=h.useState(null),[rs,St]=h.useState(null),[He,We]=h.useState(""),[as,cs]=h.useState([]),[Ge,Ye]=h.useState(""),[ls,us]=h.useState(null),[li,fe]=h.useState(!1),[ui,pe]=h.useState(0),[di,qe]=h.useState(!1),[kt,ds]=h.useState(null),Xe=va(X)?X:$t,Te=h.useMemo(()=>ya(Xe,{modelId:K,voiceId:$,instructions:_e}),[_e,K,$,Xe]),Ke=h.useRef(Di()),xe=h.useRef(!1),oe=h.useRef(null),ge=h.useRef(null),ue=h.useRef(null),Je=h.useRef(A);Je.current=A,h.useEffect(()=>{o==="direct-voice"&&(Je.current=!0,B(!0))},[o,B]),h.useEffect(()=>(xe.current=!0,()=>{xe.current=!1,ge.current="discard";const p=oe.current;oe.current=null,p&&nt(p,{allowCurrentSession:!0}),ue.current?.stop(),ue.current=null}),[]);const O=h.useCallback(()=>{ue.current?.stop(),ue.current=null,gt(!1)},[]),Ze=h.useCallback(p=>{if(!p)return;O();const g=Kr(p),k=o==="direct-voice"?Li(g,{speed:q,modelId:Te.modelId,voiceId:Te.voiceId,instructions:Te.instructions,playback:Te.playback}):Ai(g,{speed:q,presetId:ee,params:Pa(ee,u)});ue.current=k,gt(!0),k.promise.catch(E=>{Vi(E)||console.warn("[scoutbot] reply speech unavailable",{message:E instanceof Error?E.message:String(E)})}).finally(()=>{ue.current===k&&(ue.current=null,gt(!1))})},[O,q,Te,u,o,ee]),hs=h.useCallback(p=>{Je.current&&Ze(p)},[Ze]),ms=h.useCallback(p=>{Ze(Se(p))},[Ze]),{openFilePreview:fs}=ks(),ps=Si(),hi=h.useCallback((p,g)=>{const k=window.getSelection()?.toString().trim(),E=Se(g),U=Ta(E),W=[];if(k&&(W.push({kind:"action",label:"Copy selection",shortcut:"⌘C",onSelect:()=>{rt(k)}}),W.push({kind:"separator"})),W.push({kind:"action",label:"Copy message",onSelect:()=>{rt(E)}}),U.length>0){W.push({kind:"separator"});for(const ce of U.slice(0,5)){const wt=ko(ce);W.push({kind:"action",label:`Preview ${wt}`,onSelect:()=>fs(ce)})}for(const ce of U.slice(0,5)){const wt=ko(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:()=>ms(g)}),ps(p,W)},[fs,ms,ps,se]);h.useEffect(()=>()=>{O()},[O]);const mi=Ra,ve=h.useCallback(p=>{const g=[...p.messages].reverse().find(E=>E.role==="user"),k=[...p.messages].reverse().find(E=>E.role==="assistant");vt(g?.body??null),ze(k?Se(k.body):null)},[]),Ne=h.useCallback(async()=>{try{const p=await Z("/api/scoutbot/session");he(p),ve(p.session)}catch{he(null)}},[ve]);h.useEffect(()=>{Ne()},[Ne]);const Qe=h.useCallback(async()=>{ss(!0),$e(null);try{const p=await Z("/api/scoutbot/config");We(p.model),cs(p.modelOptions??[]),Ye(p.systemPrompt),St(null)}catch(p){$e(p instanceof Error?p.message:"Could not load settings.")}finally{ss(!1)}},[]);h.useEffect(()=>{de&&Qe()},[Qe,de]),h.useEffect(()=>{if(!de)return;let p=!1;return Z("/api/voice/defaults").then(g=>{p||us(g)}).catch(()=>{p||us(null)}),()=>{p=!0}},[de]);const xs=h.useCallback(async()=>{is(!0),$e(null),St(null);try{const p=await Z("/api/scoutbot/config",{method:"POST",body:JSON.stringify({model:He,systemPrompt:Ge})});We(p.config.model),cs(p.config.modelOptions??[]),Ye(p.config.systemPrompt),St("Saved")}catch(p){$e(p instanceof Error?p.message:"Could not save settings.")}finally{is(!1)}},[He,Ge]),fi=h.useCallback(async p=>{if(!(!p||kt)){ds(p),C(null),O();try{const g=await Z("/api/scoutbot/session/switch",{method:"POST",body:JSON.stringify({id:p})});he(g),ve(g.session),qe(!1),fe(!1),window.dispatchEvent(new CustomEvent(De,{detail:{id:g.session.id}}))}catch(g){C(g instanceof Error?g.message:"Could not switch session.")}finally{ds(null)}}},[O,kt,ve]),et=h.useCallback(async()=>{if(!(me||S)){if(Y?.session.messages.length===0){j(""),C(null),fe(!1),qe(!1),H("New chat ready"),pe(p=>p+1);return}Qt(!0),C(null),H("Starting new chat"),O();try{const p=await Z("/api/scoutbot/session/reset",{method:"POST"});he(p),j(""),vt(null),ze(null),fe(!1),qe(!1),H("New chat ready"),pe(g=>g+1),window.dispatchEvent(new CustomEvent(De,{detail:{id:p.session.id}}))}catch(p){H(null),C(p instanceof Error?p.message:"Could not start a new chat.")}finally{Qt(!1)}}},[me,S,Y,O]),pi=h.useCallback(async p=>{if(!(!p||bt)){es(p),C(null),O();try{const g=await Z("/api/scoutbot/session/archive",{method:"POST",body:JSON.stringify({id:p})});he(g),ve(g.session),fe(!1),H("session archived"),window.dispatchEvent(new CustomEvent(De,{detail:{id:g.session.id}}))}catch(g){C(g instanceof Error?g.message:"Could not archive session.")}finally{es(null)}}},[bt,O,ve]),tt=h.useCallback((p,g)=>{L(g),Jt(p.activeInputDeviceName),y(g?null:p.lastUnavailableReason??"Scout voice service is not reachable."),I("idle")},[]),ie=h.useCallback(async(p=!1)=>{const g=Ke.current;I(E=>E==="launching"?E:"probing");const k=await g.probe(p?{force:!0}:void 0);return tt(g,k),k},[tt]);h.useEffect(()=>{Mi();const p=Ke.current,g=Ii(k=>{L(k.ok),Jt(k.inputDeviceName),y(k.ok?null:k.reason),I("idle")});return p.connectionState==="unknown"?ie():tt(p,p.connectionState==="connected"),g},[tt,ie]);const gs=h.useCallback(()=>{const p=Ke.current;C(null),I("launching"),p.launch({source:"openscout",context:Na()}),window.setTimeout(()=>{ie(!0)},2400)},[ie]),vs=h.useCallback(p=>{const g=Se(p);ze(g);for(const k of Ri(p))k.type==="ask-agent"?(H(`Sending to ${k.targetLabel}`),Z("/api/scoutbot/actions/ask",{method:"POST",body:JSON.stringify({targetLabel:k.targetLabel,targetAgentId:k.targetAgentId,body:k.body,channel:k.channel})}).then(E=>{H(E.flightId?`Sent to ${E.targetAgentId??E.targetLabel} · run ${E.flightId}`:`Sent to ${E.targetAgentId??E.targetLabel}`)}).catch(E=>{H(null),C(E instanceof Error?E.message:"Could not send to agent.")})):k.type!=="reminder"&&c(k);hs(g)},[c,hs]);h.useEffect(()=>{const p=()=>{H("Scoutbot replied by voice"),Ne()},g=()=>{H("Scoutbot chat changed"),Ne()};return window.addEventListener(ws,p),window.addEventListener(De,g),()=>{window.removeEventListener(ws,p),window.removeEventListener(De,g)}},[Ne]);const Re=h.useCallback(async p=>{const g=p.trim();if(!(!g||S)){w(!0),C(null),vt(g),ze(null),H("Sending"),j(k=>k.trim()===g?"":k);try{await Ti().catch(()=>null);const k=await Z("/api/scoutbot/chat",{method:"POST",body:JSON.stringify({body:g,route:a,uiContext:ki("web")})});he({session:k.session,sessions:k.sessions,config:k.config}),H("Reply received"),vs(k.reply.body)}catch(k){H(null),C(k instanceof Error?k.message:"Could not send.")}finally{w(!1)}}},[vs,a,S]),ys=h.useCallback(async()=>{if(te)return;const p=Ke.current;if(ge.current=null,C(null),Pe(""),le("starting"),N!==!0&&!await ie(!0)){le(null);return}let g=null,k=!1;const E=async()=>{!g||k||(k=!0,await nt(g,{allowCurrentSession:oe.current===g}),oe.current===g&&(oe.current=null))};try{if(g=await p.startLive({onState:le,onPartial:Pe},{surface:o==="direct-voice"?"direct-voice":"chat-composer"}),!xe.current){await nt(g,{allowCurrentSession:!0});return}oe.current=g,Ue(!0);const U=await g.result;if(await E(),!xe.current||(Ue(!1),Pe(""),ge.current))return;le("done"),U.text&&await Re(U.text)}catch(U){const W=ge.current;if(!xe.current)return;const ce=!!W||Ea(U);if(await E(),Ue(!1),Pe(""),W==="stop-failed")return;le(ce?null:"error"),ce||C(U instanceof Error?U.message:"Scout voice recording failed.")}finally{xe.current&&await E(),ge.current=null}},[Re,o,ie,te,N]),bs=h.useCallback(async()=>{const p=oe.current;if(p){le("processing");try{await ni(p.stop(),Sa,"Scout voice did not finish processing the recording.")}catch(g){ge.current="stop-failed",await nt(p,{allowCurrentSession:!0}),oe.current===p&&(oe.current=null,Ue(!1),Pe(""),le("error")),C(g instanceof Error?`Scout voice recording did not finish: ${g.message}`:"Scout voice recording did not finish.")}}},[]);h.useEffect(()=>{const p=()=>v(!1);return window.addEventListener("scout:scoutbot-panel-open",p),()=>window.removeEventListener("scout:scoutbot-panel-open",p)},[v]),h.useEffect(()=>Pi(()=>v(!x)),[x,v]),h.useEffect(()=>{const p=g=>{const k=g.detail,E=k&&typeof k=="object"&&"body"in k?k.body:null;typeof E=="string"&&E.trim()&&(v(!1),Re(E))};return window.addEventListener(Ps,p),()=>window.removeEventListener(Ps,p)},[Re,v]),h.useEffect(()=>{const p=g=>{const k=g.detail,E=k&&typeof k=="object"&&"body"in k?k.body:null;typeof E=="string"&&E.trim()&&(v(!1),j(E),pe(U=>U+1))};return window.addEventListener("scout:scoutbot-compose",p),()=>window.removeEventListener("scout:scoutbot-compose",p)},[v]);const Ss=h.useMemo(()=>{const p=se?"speaking":S?"thinking":te?"listening":"idle",g=Y?.session??null,k=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:N,setupBlocked:N===!1,replies:A},error:P,session:{title:g?.title??null,lastActivityAt:k?.createdAt??g?.updatedAt??null},conversation:{messageCount:g?.messages.length??0,loading:Y===null}}},[se,S,te,N,A,P,Y]);h.useEffect(()=>{l?.publishState(Ss)},[l,Ss]),h.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]),h.useEffect(()=>{N===!0&&Fe(!1)},[N]);const xi=m?"Live call":te?pt==="processing"?"Sending":"Stop":T==="probing"?"Checking Voice":T==="launching"?"Opening Scout":N===!1?"Open Scout":"Start Talking",gi=Y!==null&&Y.session.messages.length===0&&!S;if(o==="direct-voice")return i.jsx(pa,{messages:Y?.session.messages??[],pendingAsk:S?Zt:null,partial:xt,error:P,status:yt,recording:te,sending:S,speaking:se,voiceAvailable:N,voiceInputSource:ai,voiceProbeState:T,voiceState:pt,voiceReplies:A,settingsOpen:de,assistantModel:Y?.session.model??Y?.config.model??null,setupPanel:N===!1?i.jsx(yo,{issue:D,probeState:T,onLaunch:gs,onRetry:()=>{ie(!0)},onSettings:()=>Ee(!0),onDismiss:()=>Fe(!1)}):null,settingsPanel:i.jsx(bo,{presentation:"direct-voice",voicePresetId:ee,onVoicePresetId:R,speechSelectionId:Xe,onSpeechSelectionId:ae,customSpeechModelId:K,onCustomSpeechModelId:_,customSpeechVoiceId:$,onCustomSpeechVoiceId:Xt,customSpeechInstructions:_e,onCustomSpeechInstructions:Kt,voiceDefaults:ls,modelDraft:He,onModelDraft:We,modelOptions:as,promptDraft:Ge,onPromptDraft:Ye,configLoading:ts,configSaving:os,configError:ns,configStatus:rs,onSave:()=>{xs()},onReload:()=>{Qe()}}),onPrimaryAction:()=>{se?O():te?bs():N===!1?ie(!0):ys()},onToggleVoiceReplies:()=>{const p=!A;Je.current=p,B(p),p||O()},onToggleSettings:()=>Ee(p=>!p),onNewChat:()=>{me||et()},onOpenLive:r});if(x&&!t)return i.jsx("div",{className:"flex shrink-0 items-center border-t border-[var(--scout-chrome-border-soft)] px-3 py-1.5",children:i.jsx(Ei,{})});const vi=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)]",yi=e===void 0||s?void 0:{height:`${e}px`};return i.jsxs("section",{className:vi,style:yi,children:[i.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-3 pt-2.5 pb-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:"flex min-w-0 items-center gap-2",children:i.jsx(vn,{size:20,className:"shrink-0 text-lime-300","aria-hidden":"true"})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[i.jsx(vo,{icon:A?i.jsx(Uo,{size:11}):i.jsx(zo,{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&&i.jsx(vo,{icon:i.jsx(Mt,{size:11}),title:"Minimize",onClick:()=>v(!0)})]})]}),de&&i.jsx(bo,{presentation:"chat",voicePresetId:ee,onVoicePresetId:R,speechSelectionId:Xe,onSpeechSelectionId:ae,customSpeechModelId:K,onCustomSpeechModelId:_,customSpeechVoiceId:$,onCustomSpeechVoiceId:Xt,customSpeechInstructions:_e,onCustomSpeechInstructions:Kt,voiceDefaults:ls,modelDraft:He,onModelDraft:We,modelOptions:as,promptDraft:Ge,onPromptDraft:Ye,configLoading:ts,configSaving:os,configError:ns,configStatus:rs,onSave:()=>{xs()},onReload:()=>{Qe()}})]}),i.jsx("div",{className:"flex min-h-0 flex-1 flex-col px-3 pb-1.5",children:Y&&i.jsx(ta,{state:Y,chatExpanded:li,onToggleExpanded:()=>fe(p=>!p),sessionPickerOpen:di,onToggleSessionPicker:()=>qe(p=>!p),onStartNewChat:()=>{et()},startingNewChat:me,onSwitchSession:p=>{fi(p)},switchingSessionId:kt,sending:S,briefing:!1,pendingAsk:S?Zt:null,onArchiveSession:p=>{pi(p)},archivingSessionId:bt,onAssistantContextMenu:hi,suggestedPrompts:mi,onSelectPrompt:p=>{j(p),fe(!1)}})}),i.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:[N===!1&&ci&&!m&&i.jsx(yo,{issue:D,probeState:T,onLaunch:gs,onRetry:()=>{ie(!0)},onSettings:()=>Ee(!0),onDismiss:()=>Fe(!1)}),(xt||se)&&!m&&i.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:[i.jsx("span",{className:"min-w-0 truncate",children:se?"Speaking reply…":xt}),se&&i.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:i.jsx(Po,{size:11,className:"fill-current"})})]}),yt&&!S&&i.jsx("div",{className:"font-mono text-2xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-ghost)]",children:yt}),i.jsx(oa,{agents:n,draft:b,onDraftChange:j,onSubmit:()=>{Re(b)},sending:S,recording:te,voiceLabel:xi,voiceBusy:pt==="processing"||T==="probing"||T==="launching",voiceUnavailable:N===!1,voiceHeld:m,onMicClick:()=>{if(!m){if(N===!1){Fe(!0);return}te?bs():ys()}},prominent:gi&&!m,autoFocus:t,focusSignal:ui}),P&&i.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 ri({dictationActive:e=!1,autoStart:t=!1}){const s=Ht(Wt,!0),{enabled:o,state:r,leaseId:c,startCall:n,endCall:a}=Gt(),u=h.useRef(!1),l=h.useRef(null),[d,f]=h.useState(()=>window.innerWidth>=720&&window.innerHeight>=520?"page":"compact"),m=window.webkit?.messageHandlers?.scoutRealtimeVoice;return h.useEffect(()=>{const x=()=>{f(window.innerWidth>=720&&window.innerHeight>=520?"page":"compact")};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),h.useEffect(()=>{m?.postMessage({kind:"session-state",state:r,leaseId:c})},[c,m,r]),h.useEffect(()=>{const x=()=>{if(l.current)return l.current;const b=a().finally(()=>{l.current===b&&(l.current=null)});return l.current=b,b},v=()=>{x()};return window.__scoutRealtimeVoiceStop=x,window.addEventListener(js,v),window.__scoutRealtimeVoiceStopRequested&&x(),()=>{window.removeEventListener(js,v),window.__scoutRealtimeVoiceStop===x&&delete window.__scoutRealtimeVoiceStop}},[a]),h.useEffect(()=>{!t||e||!s||!o||u.current||r!=="idle"&&r!=="ended"&&r!=="error"||(u.current=!0,n())},[t,e,s,o,n,r]),s?o?i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsx(wo,{state:r,onMinimize:m?()=>m.postMessage("minimize"):void 0,onExpand:m?()=>m.postMessage(d==="page"?"restore":"expand"):void 0,layout:d}),i.jsx(jo,{dictationActive:e,layout:d})]}):i.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[i.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is disabled"}),i.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."})]}):i.jsxs("div",{className:"flex h-full flex-col justify-center gap-2 p-4",children:[i.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.12em] text-[var(--scout-chrome-ink-faint)]",children:"Live voice is off"}),i.jsx("p",{className:"text-sm leading-snug text-[var(--scout-chrome-ink-faint)]",children:"This Scout build has live conversations disabled. Calls use the configured OpenAI API account when the feature is available."})]})}function La(){const e=Ht(Wt,!0),{enabled:t,state:s}=Gt(),[o,r]=h.useState("direct"),c=e&&t;return o==="direct"?i.jsx("main",{className:"h-full min-h-0 overflow-hidden bg-[#f3f0e9]",children:i.jsx(Da,{forceExpanded:!0,fill:!0,presentation:"direct-voice",onOpenLive:()=>r("realtime")})}):i.jsxs("main",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-[var(--scout-chrome-bg)]",children:[i.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:[i.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[i.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"}),i.jsx("span",{className:"hidden h-4 w-px bg-[var(--scout-chrome-border-soft)] sm:block","aria-hidden":"true"}),i.jsxs("span",{className:"hidden items-center gap-2 text-xs text-[var(--scout-chrome-ink-faint)] sm:flex",children:[i.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"]})]}),i.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:[i.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"}),i.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"})]})]}),i.jsx("section",{className:"min-h-0 flex-1 overflow-hidden",children:c?i.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[i.jsx(wo,{state:s,layout:"page"}),i.jsx(jo,{dictationActive:!1,layout:"page"})]}):i.jsx(ri,{})})]})}const Aa=yn({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"})}}),dc=Object.freeze(Object.defineProperty({__proto__:null,RealtimeVoicePage:La,RealtimeVoiceScreen:ri,scoutSurface:Aa},Symbol.toStringTag,{value:"Module"}));export{La as R,Da as S,dc as a};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RepoDiffViewer-D7FN-oyY.js","assets/index-DReVb7jZ.js","assets/index-CGbs0SBm.css","assets/ui-LM8pS8qE.js","assets/usePierreRuntime-DTvcwISe.js","assets/chunk-HRAB3GC3-Dvk_QpRq.js","assets/chevron-down-CDzRQQGl.js","assets/createLucideIcon-ChvMq-zl.js","assets/check-g7D7-c1J.js","assets/loader-circle-DNUsuPWz.js","assets/send-horizontal-BlQsRK6C.js","assets/file-code-corner-Be6da5l3.js","assets/code-xml-Cmadr3pQ.js","assets/x-rlMdRqJF.js","assets/cache-DGBo3vIf.js","assets/api-DSqpVKC7.js","assets/message-square-CJW4WRlo.js","assets/refresh-cw-IcD2lPoT.js","assets/plus-D5NLH_fM.js","assets/repo-diff-DyYmQMSA.css"])))=>i.map(i=>d[i]);
2
- import{j as e,r as i,_ as s}from"./index-DReVb7jZ.js";/* empty css */const a=i.lazy(()=>s(()=>import("./RepoDiffViewer-D7FN-oyY.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};
@@ -1 +0,0 @@
1
- import{j as s}from"./index-DReVb7jZ.js";function c(e){return e?e.length>18?`${e.slice(0,8)}...${e.slice(-6)}`:e:"no session"}const a="Native session",l="Scout-managed chat";function d({source:e,fidelity:i,sessionId:t,evidence:r,originLabel:n=a}){return s.jsxs("div",{className:"s-observe-embed-status","data-tone":r.tone,children:[n?s.jsx("span",{className:"s-observe-embed-status-origin",children:n}):s.jsx("span",{className:"s-observe-embed-status-source",children:e}),s.jsx("span",{children:i}),s.jsx("span",{title:t??void 0,children:c(t)}),s.jsx("span",{children:r.eventCountLabel}),r.tone==="live"&&s.jsx("span",{className:"s-observe-embed-status-live",children:"Live"})]})}function p({events:e}){return s.jsxs("section",{className:"s-observe-receipt-view","aria-label":"Session setup receipts",children:[s.jsxs("div",{className:"s-observe-receipt-view-copy",children:[s.jsx("strong",{children:"No observed trace activity"}),s.jsx("span",{children:"These broker lifecycle records confirm setup only."})]}),e.length>0&&s.jsx("ul",{className:"s-observe-receipt-list",children:e.map(i=>s.jsxs("li",{className:"s-observe-receipt",children:[s.jsx("span",{children:i.text}),i.detail&&s.jsx("small",{children:i.detail})]},i.id))})]})}export{a as NATIVE_SESSION_ORIGIN_LABEL,l as SCOUT_MANAGED_CHAT_ORIGIN_LABEL,d as SessionObserveEmbedStatus,p as SessionObserveReceiptView};
@@ -1 +0,0 @@
1
- import{r as l,j as e}from"./index-DReVb7jZ.js";import{a as g}from"./api-DSqpVKC7.js";import{u as I}from"./sse-A8AyLH0g.js";import{u as N}from"./tail-events-C4WdhVeK.js";import{B as k}from"./BackToPicker-CkBhGRlD.js";import{ConversationScreen as S}from"./ConversationScreen-tpj4cqWs.js";import{S as R,a as y}from"./SessionObserve-B64YsYhy.js";import{NATIVE_SESSION_ORIGIN_LABEL as E}from"./SessionObserveEvidence-CS1aQBpQ.js";import{c as w,a as T,b as C,s as u}from"./session-ref-lookup-state-SATH_jAP.js";/* empty css */import"./index-BWHgHrtv.js";import"./router-C-MF5-mb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./NewChatComposer-BEXS8vV6.js";import"./runtime-picker-C_AVYF63.js";import"./scout-voice-CqAyfblr.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DNUsuPWz.js";import"./createLucideIcon-ChvMq-zl.js";import"./conversation-model-m8HhzroS.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./time-Dhsh_2EG.js";import"./conversations-Cbg9h_Af.js";import"./index-CbqBwfIW.js";import"./HarnessMark-DSvM_H7H.js";import"./NewChatOrigin-C8ROO4ps.js";import"./keyboard-nav-CJXPaHXj.js";import"./x-rlMdRqJF.js";import"./chevron-down-CDzRQQGl.js";import"./search-UsM-9-_W.js";import"./file-text-DP6txVW-.js";import"./ConversationComposer-DNcn5U6D.js";import"./AgentAvatar-NZOqcsB2.js";import"./Provider-CNZluAZb.js";import"./provider-DwmCoSlc.js";import"./machine-scope-DJt9RZ2w.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DlMiEALb.js";import"./TextDocumentSurface-BK6Qy41F.js";import"./index-kkXUq-zf.js";import"./chevron-right-DKGTLiqc.js";import"./folder-B_S7gBVr.js";import"./chevron-up-DX7R6KY2.js";import"./code-xml-Cmadr3pQ.js";import"./arrow-left-DFfKAq0d.js";import"./arrow-right-DmAWnyAH.js";import"./chunk-HRAB3GC3-Dvk_QpRq.js";import"./SpriteAvatar-aHeF4ZQZ.js";import"./CrewAvatar-zgzC3cbU.js";import"./zap-B4X0OrEw.js";import"./message-markup-6Tgo4qFJ.js";import"./mentions-Ck_Vjnyp.js";import"./AgentDetailCard-MIEBKw_S.js";import"./AgentLiveActions-6Kfr1uOT.js";import"./terminal-takeover-CZZsnPzj.js";import"./openContent-C6XO6kr5.js";import"./eye-CsGfEVR6.js";import"./terminal-DMZjX1es.js";import"./message-visibility-DwxgcgYK.js";import"./operator-attention-DBaRg5ep.js";import"./sessionRead-CvFz2RHv.js";import"./clipboard-e3fSpeo7.js";import"./types-B0PlfpKc.js";/* empty css */import"./ConversationHeader-Y9TEJxP_.js";import"./AstronautSuit-D67fIBdR.js";import"./panel-right-qP17MwMl.js";import"./CommsFlowGraph-voDD9M5R.js";import"./comms-gesture-_aGFo6g3.js";import"./CommsCanvas-DdNAwjGW.js";import"./comms-deck-CBhsXnY-.js";import"./CommsFlowMap-C33sgD48.js";import"./CommsSelection-BL8aYD7z.js";/* empty css */import"./use-conversation-list-D5EnpVba.js";import"./agent-master-model-C-KdOFDK.js";import"./use-beside-D3cJpA5p.js";import"./ConversationFeedRows-RnYSa7Io.js";import"./ConversationPanels-6pprBpmq.js";import"./tail-display-DHSNmvor.js";import"./lane-edit-display-BjdT9oZl.js";import"./use-reduced-motion-CiaZHMnk.js";import"./proxy-DgzP27W8.js";import"./activity-BJqFrZyB.js";import"./message-circle-cI5_A5mj.js";import"./ConversationStatus-Cv-7hErW.js";import"./check-g7D7-c1J.js";import"./sparkles-Cc5lPZRv.js";import"./bash-format-BRV5C6Gv.js";import"./lane-tool-detail-Czggx8oM.js";import"./LaneToolHoverCard-D2cnTeUd.js";import"./lane-observe-CteDwdD-.js";import"./lane-ask-display-BTVSakyo.js";import"./ObservedTopologyPanel-DF6tRZL_.js";import"./ObserveTextFlow-CC5mnngm.js";import"./wrench-B4maQJai.js";import"./external-link-BVccgH0n.js";function v(r){const o=r?.trim()??"",t=o.split(/[\\/]/).filter(Boolean).at(-1)??o;return t.endsWith(".jsonl")?t.slice(0,-6):t}function L(r){return r.startsWith("native:process:")}function x(r){const[o,t]=l.useState(()=>({sessionRef:r,lookup:null,loading:!0,error:null})),n=l.useRef(null),c=l.useRef(null);c.current||(c.current=w(m=>g(`/api/session-ref/${encodeURIComponent(m)}`),({sessionRef:m,result:a})=>{if(a.ok){t({sessionRef:m,lookup:a.lookup,loading:!1,error:null});return}t({sessionRef:m,lookup:null,loading:!1,error:a.error instanceof Error?a.error.message:String(a.error)})}));const s=l.useCallback(async()=>{await c.current.request(r)},[r]);l.useEffect(()=>(t({sessionRef:r,lookup:null,loading:!0,error:null}),s(),()=>{c.current?.invalidate(),n.current&&(clearTimeout(n.current),n.current=null)}),[s,r]);const{lookup:i,loading:p,error:d}=T(o,r),f=l.useCallback(()=>{n.current||(n.current=setTimeout(()=>{n.current=null,s()},1e3))},[s]);return I(m=>{const a=[r,i?.refId,i?.kind==="conversation"?i.conversationId:null,i?.session?.agentId,i?.kind==="observe"?i.observe.agentId:null,i?.kind==="observe"?i.observe.sessionId:null];C(m,a)&&f()}),N(m=>{const a=v(m.sessionId),j=v(r),h=i?.kind==="observe"?v(i.observe.sessionId??i.observe.refId):"",b=i?.kind==="observe"?v(i.observe.data.metadata?.session?.externalSessionId):"";!u(a,j)&&(!h||!u(a,h))&&(!b||!u(a,b))||f()}),l.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),{lookup:i,loading:p,error:d}}function ys({sessionRef:r}){const{lookup:o,loading:t,error:n}=x(r);return o?.kind==="observe"?e.jsx(y,{data:o.observe.data,agentId:o.observe.agentId??o.session?.agentId??void 0,sessionId:o.observe.sessionId??o.observe.refId,surface:"context",observeSource:o.observe.source,observeFidelity:o.observe.fidelity}):e.jsx("aside",{className:"s-observe-rail s-observe-rail--context",children:e.jsxs("div",{children:[e.jsx("div",{className:"s-observe-rail-label",children:o?.kind==="conversation"?"Conversation":"Session context"}),e.jsx("div",{className:"s-observe-empty",children:t?"Resolving session reference":n?"Session context unavailable":"No observe context captured for this session"})]})})}function Es({sessionRef:r,navigate:o,renderBeforeContent:t,showObserveRail:n=!0,onLookup:c}){const{lookup:s,loading:i,error:p}=x(r);if(l.useEffect(()=>{s&&c?.(s)},[s,c]),s?.kind==="conversation")return e.jsxs(e.Fragment,{children:[t?.(s),e.jsx(S,{conversationId:s.conversationId,navigate:o})]});if(s?.kind==="observe")return e.jsxs(e.Fragment,{children:[t?.(s),e.jsx(R,{data:s.observe.data,agentId:s.observe.agentId??s.session?.agentId??void 0,sessionId:s.observe.sessionId??s.observe.refId,conversationId:s.session?.id??null,showRail:n,observeSource:s.observe.source,observeFidelity:s.observe.fidelity,originLabel:E,defaultPresentation:"conversation"})]});if(i)return e.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:e.jsx("section",{className:"s-thread-overview",children:e.jsxs("div",{className:"s-thread-overview-copy",children:[e.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[e.jsx("h2",{className:"s-page-title",children:"Session"}),e.jsx("span",{className:"s-meta s-tabular",children:r.slice(0,8)})]}),e.jsxs("p",{className:"s-thread-overview-summary s-session-ref-loading",children:[e.jsx("span",{className:"s-session-ref-loading-dot"}),e.jsx("span",{className:"s-session-ref-loading-dot"}),e.jsx("span",{className:"s-session-ref-loading-dot"}),"Resolving session reference"]})]})})});const d=L(r);return e.jsx("div",{className:"s-sessions-screen s-inbox-thread-redesign",children:e.jsx("section",{className:"s-thread-overview",children:e.jsxs("div",{className:"s-thread-overview-copy",children:[e.jsxs("div",{className:"s-sessions-header s-thread-overview-heading",children:[e.jsx("h2",{className:"s-page-title",children:d?"Process trace unavailable":"Session not found"}),e.jsx("span",{className:"s-meta s-tabular",children:r.slice(0,8)})]}),e.jsx("p",{className:"s-thread-overview-summary",children:d?"This is a live process handle, not a transcript session. No replayable session archive is attached yet.":"This session may have ended or the archive is not available on this machine."}),p&&e.jsx("p",{className:"s-session-ref-error-detail",children:p}),e.jsx("div",{className:"s-session-ref-nav-hint",children:e.jsx(k,{slot:"sessions",fallback:{view:"sessions"},navigate:o})})]})})})}export{ys as SessionRefContextRail,Es as SessionRefScreen};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-DReVb7jZ.js";import{RawSessionsTable as t}from"./RawSessionsTable-6OVJq0JZ.js";/* empty css */import"./DataTable-av71ehJV.js";/* empty css */import"./api-DSqpVKC7.js";import"./time-Dhsh_2EG.js";import"./tail-events-C4WdhVeK.js";import"./index-BWHgHrtv.js";import"./openContent-C6XO6kr5.js";import"./Provider-CNZluAZb.js";import"./provider-DwmCoSlc.js";import"./router-C-MF5-mb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-A8AyLH0g.js";import"./surface-activity-B1rgWB1i.js";import"./agent-state-DDhnFEEP.js";import"./scoutbot-Bk3nyrkj.js";import"./NewChatComposer-BEXS8vV6.js";import"./runtime-picker-C_AVYF63.js";import"./scout-voice-CqAyfblr.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DNUsuPWz.js";import"./createLucideIcon-ChvMq-zl.js";import"./conversation-model-m8HhzroS.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-CbqBwfIW.js";import"./HarnessMark-DSvM_H7H.js";import"./NewChatOrigin-C8ROO4ps.js";import"./keyboard-nav-CJXPaHXj.js";import"./x-rlMdRqJF.js";import"./chevron-down-CDzRQQGl.js";import"./search-UsM-9-_W.js";import"./file-text-DP6txVW-.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DlMiEALb.js";import"./TextDocumentSurface-BK6Qy41F.js";import"./index-kkXUq-zf.js";import"./chevron-right-DKGTLiqc.js";import"./folder-B_S7gBVr.js";import"./chevron-up-DX7R6KY2.js";import"./code-xml-Cmadr3pQ.js";import"./arrow-left-DFfKAq0d.js";import"./arrow-right-DmAWnyAH.js";import"./chunk-HRAB3GC3-Dvk_QpRq.js";function _({navigate:o}){return r.jsx(t,{navigate:o})}export{_ as SessionsScreen};
@@ -1,3 +0,0 @@
1
- import{E as Z,t as fe,u as Se,C as se,r as o,y as Ne,j as e,A as te,a9 as we,D as ke}from"./index-DReVb7jZ.js";import{a as Ce}from"./provider-DwmCoSlc.js";import{a as B}from"./api-DSqpVKC7.js";import{g as Ae,a as Ee,e as Te,s as Oe,b as Re,d as Pe,c as Ie}from"./credentials-OeoF-VKJ.js";import{u as ee,F as $e,K as Le,M as Me,N as De}from"./Provider-CNZluAZb.js";import{t as _e}from"./time-Dhsh_2EG.js";import{k as Ve,m as He,n as ze}from"./scout-voice-CqAyfblr.js";import{u as Be}from"./keyboard-nav-CJXPaHXj.js";import{a as Fe}from"./router-C-MF5-mb.js";import{C as J}from"./CrewAvatar-zgzC3cbU.js";import{C as Ue}from"./CastPicker-ZPomvOf-.js";import{p as ae}from"./AgentAvatar-NZOqcsB2.js";import{S as ne}from"./SpriteAvatar-aHeF4ZQZ.js";import{VoiceHostStatusBanner as Ke,VoicePermissionsPanel as We}from"./VoicePermissionsPanel-D35fOnQj.js";import{u as Ge}from"./chunk-HRAB3GC3-Dvk_QpRq.js";import{C as _}from"./check-g7D7-c1J.js";import{M as qe}from"./monitor-C7_cHlkC.js";import{c as ge}from"./createLucideIcon-ChvMq-zl.js";import{R as Ye}from"./refresh-cw-IcD2lPoT.js";import{C as Xe}from"./copy-BGOC1tJB.js";import{a as Ze}from"./DocumentFocusViewer-DlMiEALb.js";import{S as Qe}from"./sparkles-Cc5lPZRv.js";const Je=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],es=ge("moon",Je);const ss=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ts=ge("sun",ss);function as(t){const[s,n]=o.useState(0),i=o.useRef([]);return o.useEffect(()=>{if(t<3||typeof window>"u"||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const h=()=>{i.current.push(window.setTimeout(()=>{n(1),i.current.push(window.setTimeout(()=>n(2),40)),i.current.push(window.setTimeout(()=>n(1),90)),i.current.push(window.setTimeout(()=>{n(0),h()},130))},2600+Math.random()*4200))};h();const m=i.current;return()=>{m.forEach(x=>window.clearTimeout(x)),m.length=0}},[t]),t<3?0:s}function ns({slug:t,open:s=!1,onToggle:n,coin:i=56,figure:h=240,hue:m,state:x="idle",interactive:b=!0,className:f,style:d,children:c}){const a=t.toLowerCase(),r=se[a]??se.milo,p=fe[a],N=Z.find(M=>M.slug===a)??Z[0],I=as(p?p.roles.length+1:1),S=p&&I>0?Se[I]?.role:void 0,[w,A,$]=r.coin,v=i/$,D=h*r.w/r.h,O=h/r.h,V=s?D:i,H=s?h:i,z=s?D:r.w*v,R=s?h:r.h*v,E=s?0:-w*v,L=s?0:-A*v,T=o.useMemo(()=>Ne(m??null,r.ink),[m,r.ink]),G=p?p.patch[2]*(s?O:v):0,F=p?p.patch[3]*(s?O:v):0,P=p?(s?0:E)+p.patch[0]*(s?O:v):0,U=p?(s?0:L)+p.patch[1]*(s?O:v):0;return e.jsxs("div",{className:`xc-stage-wrapper ${f||""}`,style:d,"data-open":s?"true":"false",children:[e.jsxs("div",{className:"xc-stage",role:b?"button":void 0,tabIndex:b?0:void 0,"aria-label":`${N.name} (${s?"Full body breakout":"Coin disc"})`,onClick:b?n:void 0,onKeyDown:b&&n?M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),n())}:void 0,style:{width:V,height:H,borderRadius:s?"16px":"50%"},children:[e.jsx("span",{className:"xc-stage-ground",style:{background:T,opacity:s?.92:1,borderRadius:s?"16px":"50%"}}),e.jsx("img",{src:te(`${a}-bust.webp`),alt:N.name,className:"xc-stage-img",style:{width:z,height:R,left:E,top:L}}),p&&S&&e.jsx("img",{src:te(`${p.dir}/${S}.webp`),alt:"",className:"xc-stage-patch",style:{width:G,height:F,left:P,top:U}})]}),c]})}const pe="/api/voice/playback/settings",is="scout:voice-playback-settings",ls="OPENSCOUT_VOICE_PLAYBACK",rs="openscout.voice-playback-settings";function os(t){return B(pe,{signal:t,cache:"no-store"})}function cs(t){return B(pe,{method:"PUT",body:JSON.stringify({playback:t})})}function ds(t){if(window.dispatchEvent(new CustomEvent(is,{detail:t})),!("BroadcastChannel"in window))return;const s=new BroadcastChannel(rs);s.postMessage(t),s.close()}const us=[195,125,300,45,355,210];function hs(t){return`oklch(0.80 0.14 ${t})`}function j({label:t,right:s}){return e.jsxs("div",{className:"s-settings-section-rule",children:[e.jsx("span",{className:"s-settings-section-label",children:t}),e.jsx("span",{className:"s-settings-section-line"}),s&&e.jsx("span",{className:"s-settings-section-right",children:s})]})}function k({label:t,hint:s,children:n}){return e.jsxs("div",{className:"s-settings-field",children:[e.jsx("label",{className:"s-settings-field-label",children:t}),n,s&&e.jsx("span",{className:"s-settings-field-hint",children:s})]})}function K({value:t,onChange:s,mono:n}){return e.jsx("input",{className:`s-settings-input${n?" s-settings-input--mono":""}`,value:t,onChange:i=>s(i.target.value)})}function ie({value:t,onChange:s,rows:n=3}){return e.jsx("textarea",{className:"s-settings-textarea",value:t,onChange:i=>s(i.target.value),rows:n})}function ms({value:t,onChange:s,min:n,max:i,step:h=1,unit:m=""}){return e.jsxs("div",{className:"s-settings-slider-wrap",children:[e.jsx("input",{type:"range",min:n,max:i,step:h,value:t,onChange:x=>s(Number(x.target.value))}),e.jsxs("span",{className:"s-settings-slider-value",children:[t," ",m]})]})}function W({value:t,onChange:s,options:n,stacked:i,columns:h}){return e.jsx("div",{className:i?"s-settings-option-stacked":"s-settings-option-grid",style:i?void 0:{gridTemplateColumns:`repeat(${h??n.length}, 1fr)`},children:n.map(m=>e.jsxs("button",{className:`s-settings-option-btn${t===m.id?" s-settings-option-btn--active":""}`,onClick:()=>s(m.id),children:[e.jsx("span",{className:"s-settings-option-label",children:m.label}),e.jsx("span",{className:"s-settings-option-sub",children:m.sub})]},m.id))})}const gs=[{id:"system",label:"System",sub:"Follow this device",icon:qe},{id:"light",label:"Light",sub:"Bright workspace",icon:ts},{id:"dark",label:"Dark",sub:"Low-light workspace",icon:es}],ps=[{id:"scout",label:"Scout",sub:"Control-room navigation"},{id:"slack",label:"Slack",sub:"Workspace rail and channel-style lists"}],le=[{id:"scout",label:"Scout",sub:"Near-neutral control room",spec:"SLATE · LIME"},{id:"graphite",label:"Graphite",sub:"Monochrome technical chassis",spec:"BLACK · SLATE"},{id:"polar",label:"Polar",sub:"Nord-inspired arctic slate",spec:"POLAR · FROST"},{id:"solar",label:"Solar",sub:"Solarized-inspired measured contrast",spec:"TEAL · PAPER"}],re=[{id:"hudson",label:"Rounded",sub:"Soft corners and luminous chrome",spec:"8PX"},{id:"editorial",label:"Compact",sub:"Tighter corners and flatter hierarchy",spec:"4PX"},{id:"drafting",label:"Square",sub:"Zero-radius technical grid",spec:"0PX"}],oe=[{id:"soft",label:"Soft",sub:"Quiet separators"},{id:"balanced",label:"Defined",sub:"Clear structure"},{id:"strong",label:"Strong",sub:"High separation"}],ce=[{id:"theme",label:"Theme"},{id:"lime",label:"Lime"},{id:"cyan",label:"Cyan"},{id:"violet",label:"Violet"},{id:"amber",label:"Amber"}],bs=[{id:"crew",label:"Crew Cast",sub:"Rendered character art with 4-slot status ring & eye animation",spec:"4-SLOT CAST"},{id:"sprite",label:"Generative",sub:"Deterministic 7×7 creatures from name hashes",spec:"PRNG VECTOR"},{id:"chip",label:"Pixel Chip",sub:"Pixel portraits of the chip cast; everyone else stays generative",spec:"PIXEL ART"}],de=bs,ue=[{id:"compact",label:"Compact",sub:"More rows per screen; the name carries"},{id:"regular",label:"Regular",sub:"Scout's default balance"},{id:"large",label:"Large",sub:"Faces legible at a glance"}],vs=["milo","vex","sprout"];function Q({className:t,theme:s,template:n,palette:i,contrast:h,accent:m,children:x}){return e.jsx("div",{className:t,"data-scout-theme":s,"data-scout-theme-mode":s,"data-scout-palette":i,"data-scout-contrast":h,"data-scout-accent":m,"data-hudson-theme":s,"data-hudson-template":n,children:x})}function xs({palette:t,theme:s,template:n}){return e.jsxs(Q,{className:"s-settings-palette-sample",theme:s,template:n,palette:t,contrast:"balanced",accent:"theme",children:[e.jsxs("span",{className:"s-settings-palette-rail",children:[e.jsx("i",{}),e.jsx("i",{"data-active":!0}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-settings-palette-list",children:[e.jsx("i",{}),e.jsx("i",{"data-selected":!0}),e.jsx("i",{})]}),e.jsxs("span",{className:"s-settings-palette-detail",children:[e.jsx("i",{"data-title":!0}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{"data-action":!0})]})]})}function js({theme:t,template:s,palette:n,contrast:i,accent:h}){return e.jsxs(Q,{className:"s-settings-live-preview",theme:t,template:s,palette:n,contrast:i,accent:h,children:[e.jsxs("div",{className:"s-settings-live-preview-bar",children:[e.jsxs("span",{children:[e.jsx("i",{})," SCOUT"]}),e.jsxs("span",{className:"s-settings-live-preview-state",children:[e.jsx("i",{})," WORKING"]})]}),e.jsxs("div",{className:"s-settings-live-preview-shell",children:[e.jsxs("div",{className:"s-settings-live-preview-rail","aria-hidden":"true",children:[e.jsx("i",{"data-active":!0}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsxs("div",{className:"s-settings-live-preview-list",children:[e.jsx("span",{className:"s-settings-live-preview-kicker",children:"CONVERSATIONS"}),e.jsxs("span",{className:"s-settings-live-preview-row","data-selected":!0,children:[e.jsx("i",{}),e.jsx("b",{children:"Openscout"}),e.jsx("small",{children:"now"})]}),e.jsxs("span",{className:"s-settings-live-preview-row",children:[e.jsx("i",{}),e.jsx("b",{children:"Hudson"}),e.jsx("small",{children:"8m"})]}),e.jsxs("span",{className:"s-settings-live-preview-row",children:[e.jsx("i",{}),e.jsx("b",{children:"Scout"}),e.jsx("small",{children:"1h"})]})]}),e.jsxs("div",{className:"s-settings-live-preview-detail",children:[e.jsx("span",{className:"s-settings-live-preview-kicker",children:"ACTIVE FLIGHT"}),e.jsx("strong",{children:"Theme system review"}),e.jsx("p",{children:"Separating palette, interface shape, and contrast keeps every choice honest."}),e.jsxs("div",{className:"s-settings-live-preview-event",children:[e.jsx("i",{})," Agent is working · updated now"]}),e.jsx("button",{type:"button",tabIndex:-1,children:"Open trace"})]})]})]})}function ys(){const t=Ge(),{appearanceDetails:s,updateAppearanceDetails:n}=ee();if(!t)return e.jsx("div",{className:"s-settings-inline-note",children:"Theme controls are unavailable in this embedded surface."});const i=t.resolvedTheme??"dark",h=we(t.template)??"hudson",m=le.find(a=>a.id===s.palette)?.label??"Scout",x=re.find(a=>a.id===h)?.label??"Rounded",b=oe.find(a=>a.id===s.contrast)?.label??"Defined",f=ce.find(a=>a.id===s.accent)?.label??"Theme",d=de.find(a=>a.id===s.avatarStyle)?.label??"Generative",c=ue.find(a=>a.id===s.avatarSize)?.label??"Regular";return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"App layout",right:`currently ${s.shell}`}),e.jsx("div",{className:"s-settings-shell-grid",role:"group","aria-label":"App layout",children:ps.map(a=>{const r=s.shell===a.id;return e.jsxs("button",{type:"button",className:"s-settings-shell-choice","data-shell":a.id,"data-active":r||void 0,"aria-pressed":r,onClick:()=>n({shell:a.id}),children:[e.jsxs("span",{className:"s-settings-shell-sample","aria-hidden":"true",children:[e.jsx("i",{"data-part":"top"}),e.jsx("i",{"data-part":"rail"}),e.jsxs("i",{"data-part":"list",children:[e.jsx("b",{}),e.jsx("b",{}),e.jsx("b",{})]}),e.jsxs("i",{"data-part":"content",children:[e.jsx("b",{}),e.jsx("b",{}),e.jsx("b",{})]})]}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub})]})]},a.id)})}),e.jsx(j,{label:"Color mode",right:`currently ${i}`}),e.jsx("div",{className:"s-settings-theme-mode-grid",role:"group","aria-label":"Color mode",children:gs.map(a=>{const r=a.icon,p=t.theme===a.id,N=a.id==="system"?`Follow this device · resolves to ${t.resolvedTheme??"…"}`:a.sub;return e.jsxs("button",{type:"button",className:"s-settings-theme-mode","data-active":p||void 0,"aria-pressed":p,onClick:()=>t.setTheme(a.id),children:[e.jsx(r,{size:18,strokeWidth:1.7,"aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("strong",{children:a.label}),e.jsx("small",{children:N})]}),p?e.jsx(_,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]},a.id)})}),e.jsxs("div",{className:"s-settings-appearance-workbench",children:[e.jsxs("div",{className:"s-settings-appearance-controls",children:[e.jsx(j,{label:"Color theme",right:`currently ${m.toLowerCase()}`}),e.jsx("div",{className:"s-settings-palette-grid",role:"group","aria-label":"Color theme",children:le.map(a=>{const r=s.palette===a.id;return e.jsxs("button",{type:"button",className:"s-settings-palette-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({palette:a.id}),children:[e.jsx(xs,{palette:a.id,theme:i,template:h}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:15,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{children:a.spec})]})]},a.id)})}),e.jsx(j,{label:"Interface shape",right:`currently ${x.toLowerCase()}`}),e.jsx("div",{className:"s-settings-interface-grid",role:"group","aria-label":"Interface shape",children:re.map(a=>{const r=h===a.id;return e.jsxs("button",{type:"button",className:"s-settings-interface-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>t.setTemplate(a.id),children:[e.jsx(Q,{className:"s-settings-shape-sample",theme:i,template:a.id,palette:s.palette,contrast:s.contrast,accent:s.accent,children:e.jsx("i",{children:e.jsx("i",{})})}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{children:a.spec})]})]},a.id)})}),e.jsx(j,{label:"Separation",right:`currently ${b.toLowerCase()}`}),e.jsx("div",{className:"s-settings-contrast-grid",role:"group","aria-label":"Interface contrast",children:oe.map(a=>{const r=s.contrast===a.id;return e.jsxs("button",{type:"button",className:"s-settings-contrast-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({contrast:a.id}),children:[e.jsxs("span",{className:"s-settings-contrast-lines","data-level":a.id,"aria-hidden":!0,children:[e.jsx("i",{}),e.jsx("i",{}),e.jsx("i",{})]}),e.jsx("strong",{children:a.label}),e.jsx("small",{children:a.sub})]},a.id)})}),e.jsx(j,{label:"Signal accent",right:`currently ${f.toLowerCase()}`}),e.jsx("div",{className:"s-settings-accent-row",role:"group","aria-label":"Signal accent",children:ce.map(a=>{const r=s.accent===a.id;return e.jsxs("button",{type:"button",className:"s-settings-accent-choice","data-accent-option":a.id,"data-active":r||void 0,"aria-pressed":r,"aria-label":`${a.label} accent`,onClick:()=>n({accent:a.id}),children:[e.jsx(Q,{className:"s-settings-accent-dot",theme:i,template:h,palette:s.palette,contrast:s.contrast,accent:a.id,children:e.jsx("i",{})}),e.jsx("span",{children:a.label}),r?e.jsx(_,{size:13,"aria-hidden":!0}):null]},a.id)})}),e.jsx(j,{label:"Avatar system",right:`currently ${d.toLowerCase()}`}),e.jsx("div",{className:"s-settings-avatar-grid",role:"group","aria-label":"Avatar system",children:de.map(a=>{const r=s.avatarStyle===a.id;return e.jsxs("button",{type:"button",className:"s-settings-palette-choice s-settings-avatar-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({avatarStyle:a.id}),children:[e.jsx("div",{className:"s-settings-avatar-preview",children:a.id==="crew"?e.jsx(J,{slug:"milo",size:38,ring:!1,badge:!1}):a.id==="chip"?e.jsx(J,{slug:"milo",size:38,chip:!0,ring:!1,badge:!1}):e.jsx(ne,{name:"Milo",size:38})}),e.jsxs("span",{className:"s-settings-choice-copy",children:[e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsxs("span",{children:[a.spec,(()=>{const p=ke(a.id);return p?` · ${p.covered} of ${p.total} cast`:" · every agent"})()]})]})]},a.id)})}),e.jsx(j,{label:"Avatar size",right:`currently ${c.toLowerCase()}`}),e.jsx("div",{className:"s-settings-avatar-size-row",role:"group","aria-label":"Avatar size",children:ue.map(a=>{const r=s.avatarSize===a.id,p=ae("row",a.id)??24;return e.jsxs("button",{type:"button",className:"s-settings-avatar-size-choice","data-active":r||void 0,"aria-pressed":r,onClick:()=>n({avatarSize:a.id}),children:[e.jsx("span",{className:"s-settings-avatar-size-sample","aria-hidden":!0,children:vs.map(N=>s.avatarStyle==="sprite"?e.jsx(ne,{name:N,size:p},N):e.jsx(J,{slug:N,size:p,chip:s.avatarStyle==="chip",ring:!1,badge:!1},N))}),e.jsxs("span",{className:"s-settings-choice-title",children:[e.jsx("strong",{children:a.label}),r?e.jsx(_,{className:"s-settings-theme-check",size:14,"aria-hidden":!0}):null]}),e.jsx("small",{children:a.sub}),e.jsx("span",{className:"s-settings-avatar-size-spec",children:`${p}PX ROW · ${ae("inspector",a.id)}PX TILE`})]},a.id)})}),e.jsxs("div",{className:"s-settings-appearance-note",children:[e.jsx("strong",{children:"Saved on this device"}),e.jsx("span",{children:"Layout, mode, palette, shape, separation, and accent stay in sync across tabs. URL overrides remain available for embeds and visual QA."})]})]}),e.jsxs("aside",{className:"s-settings-preview-column","aria-label":"Live appearance preview",children:[e.jsx(j,{label:"Live specimen",right:i}),e.jsx(js,{theme:i,template:h,palette:s.palette,contrast:s.contrast,accent:s.accent}),e.jsxs("dl",{className:"s-settings-theme-readout",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Palette"}),e.jsx("dd",{children:m})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Shape"}),e.jsx("dd",{children:x})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Separation"}),e.jsx("dd",{children:b})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Accent"}),e.jsx("dd",{children:f})]})]}),e.jsx("p",{className:"s-settings-preview-note",children:"Each control changes one visual axis. Success, warning, and failure colors keep their meaning."})]})]})]})}function fs({profile:t,update:s}){const{appearanceDetails:n,updateAppearanceDetails:i}=ee(),[h,m]=o.useState(n.operatorCharacter||"milo"),x=h,[b,f]=o.useState(!0),d=Z.find(a=>a.slug.toLowerCase()===x.toLowerCase())??Z[0],c=a=>{m(a),i({operatorCharacter:a})};return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Operator Character Stage",right:"cast mascot & identity"}),e.jsxs("div",{className:"s-settings-stage-hero-card","data-open":b?"true":"false",children:[e.jsxs("div",{className:"s-settings-stage-hero-header",children:[e.jsxs("div",{className:"s-settings-stage-hero-badge",children:[e.jsx("span",{className:"s-settings-stage-live-dot"}),e.jsx("span",{className:"s-settings-stage-badge-text",children:b?"FULL FIGURE BREAKOUT":"COIN DISC FRAMING"})]}),e.jsx("button",{type:"button",className:"s-settings-stage-toggle-btn",onClick:()=>f(a=>!a),title:b?"Collapse to coin framing":"Break out to full body figure",children:b?e.jsxs(e.Fragment,{children:[e.jsx(Ze,{size:13,"aria-hidden":!0}),e.jsx("span",{children:"Coin Framing"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Qe,{size:13,"aria-hidden":!0}),e.jsx("span",{children:"Breakout Figure"})]})})]}),e.jsxs("div",{className:"s-settings-stage-hero-body",children:[e.jsxs("div",{className:"s-settings-stage-art-col",children:[e.jsx(ns,{slug:x,open:b,onToggle:()=>f(a=>!a),coin:64,figure:256,state:"working"}),e.jsx("span",{className:"s-settings-stage-click-hint",children:b?"Click avatar to collapse":"Click avatar to break out"})]}),e.jsxs("div",{className:"s-settings-stage-meta-col",children:[e.jsxs("div",{className:"s-settings-stage-title-row",children:[e.jsx("span",{className:"s-settings-stage-char-name",children:d.name}),e.jsx("span",{className:"s-settings-stage-char-title",children:d.title})]}),e.jsx("div",{className:"s-settings-stage-kernel-pill",children:e.jsx("code",{children:d.kernel})}),e.jsx("p",{className:"s-settings-stage-blurb",children:d.blurb}),e.jsxs("div",{className:"s-settings-stage-identity-group",children:[e.jsxs("div",{className:"s-settings-stage-operator-id",children:[e.jsx("strong",{children:t.name||"Operator"}),e.jsxs("span",{children:[t.handle||"@you"," · ",t.pronouns||"—"]})]}),e.jsxs("div",{className:"s-settings-hue-wrap",children:[e.jsx("span",{className:"s-settings-field-label",children:"Stage & Identity Hue"}),e.jsx("div",{className:"s-settings-hue-row",children:us.map(a=>e.jsx("button",{type:"button",onClick:()=>s({hue:a}),className:`s-settings-hue-dot${t.hue===a?" s-settings-hue-dot--active":""}`,style:{background:hs(a)},title:`Hue ${a}°`},a))})]})]})]})]})]}),e.jsxs(e.Fragment,{children:[e.jsx(j,{label:"Your character mascot",right:`currently ${d.name.toLowerCase()}`}),e.jsx("div",{className:"s-settings-cast-grid-wrap",children:e.jsx(Ue,{selectedSlug:x,onSelect:c})})]}),e.jsx(k,{label:"Display name",hint:"Shown when agents address you.",children:e.jsx(K,{value:t.name,onChange:a=>s({name:a})})}),e.jsx(k,{label:"Handle",hint:"Used in @mentions across threads.",children:e.jsx(K,{value:t.handle,onChange:a=>s({handle:a}),mono:!0})}),e.jsx(k,{label:"Pronouns",children:e.jsx(K,{value:t.pronouns,onChange:a=>s({pronouns:a})})}),e.jsx(j,{label:"How agents understand you",right:"shipped as system prompt context"}),e.jsx(k,{label:"Operator bio",hint:"How you want to be worked with. Agents read this before asking you things.",children:e.jsx(ie,{value:t.bio,onChange:a=>s({bio:a}),rows:4})}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(k,{label:"Timezone",children:e.jsx(K,{value:t.timezone,onChange:a=>s({timezone:a}),mono:!0})}),e.jsx(k,{label:"Working hours",children:e.jsx(K,{value:t.workingHours,onChange:a=>s({workingHours:a}),mono:!0})})]}),e.jsx(j,{label:"Ephemeral agent names",right:"rotation pool for one-off agents"}),e.jsx(k,{label:"Name pool",hint:t.provisionalAgentNames.length>0?`${t.provisionalAgentNamesResolvedCount} names active (${t.provisionalAgentNamesSource}). Preview: ${t.provisionalAgentNamesPreview.join(", ")}${t.provisionalAgentNamesResolvedCount>t.provisionalAgentNamesPreview.length?", …":""}`:"Leave empty to use Scout's built-in rotation. One short name per line.",children:e.jsx(ie,{value:t.provisionalAgentNames.join(`
2
- `),onChange:a=>s({provisionalAgentNames:a.split(/\r?\n/u).map(r=>r.trim()).filter(Boolean)}),rows:6})}),e.jsx(k,{label:"Pool mode",hint:"Replace uses only your list. Add to defaults prepends yours, then Scout's built-in names.",children:e.jsx(W,{value:t.provisionalAgentNamesMode,onChange:a=>s({provisionalAgentNamesMode:a}),options:[{id:"replace",label:"Replace",sub:"your list only"},{id:"extend",label:"Add to defaults",sub:"yours first, then Scout"}],columns:2})})]})}function Ss({profile:t,update:s}){return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Interrupt policy"}),e.jsx(k,{label:"When agents can ping you directly",hint:"Blocking-only means only asks that truly stall work. Others get batched.",children:e.jsx(W,{value:t.interruptThreshold,onChange:n=>s({interruptThreshold:n}),options:[{id:"always",label:"Always",sub:"any ask, any time"},{id:"blocking-only",label:"Blocking only",sub:"stuck agents · default"},{id:"batched",label:"Batched",sub:"grouped every 15m"},{id:"never",label:"Never",sub:"queue only, I'll check in"}]})}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(k,{label:"Batch window (min)",children:e.jsx(ms,{value:t.batchWindow,min:5,max:60,step:5,onChange:n=>s({batchWindow:n}),unit:"min"})}),e.jsx(k,{label:"Quiet hours",children:e.jsx(K,{value:t.quietHours,onChange:n=>s({quietHours:n}),mono:!0})})]}),e.jsx(j,{label:"Where to reach you"}),e.jsx(k,{label:"Preferred channel",children:e.jsx(W,{value:t.channel,onChange:n=>s({channel:n}),options:[{id:"here",label:"Here only",sub:"desktop app"},{id:"mobile",label:"Mobile only",sub:"paired phone"},{id:"here+mobile",label:"Both",sub:"whichever is active"}]})}),e.jsx(j,{label:"Tone calibration",right:"how agents write to you"}),e.jsxs("div",{className:"s-settings-two-col",children:[e.jsx(k,{label:"Verbosity",children:e.jsx(W,{stacked:!0,value:t.verbosity,onChange:n=>s({verbosity:n}),options:[{id:"terse",label:"Terse",sub:"one-liners, answers only"},{id:"normal",label:"Normal",sub:"context + answer"},{id:"detailed",label:"Detailed",sub:"show reasoning"}]})}),e.jsx(k,{label:"Tone",children:e.jsx(W,{stacked:!0,value:t.tone,onChange:n=>s({tone:n}),options:[{id:"direct",label:"Direct",sub:"no hedging"},{id:"warm",label:"Warm",sub:"friendly, conversational"},{id:"formal",label:"Formal",sub:"business-like"}]})})]})]})}function Ns({clientCredentials:t,serverCredentials:s,reloadCredentials:n}){const[i,h]=o.useState(""),[m,x]=o.useState(!1),[b,f]=o.useState(null),d=s?.openai??null,c=!!d?.configured,a=d?.source==="env"?"OPENAI_API_KEY":d?.source==="local-config"?"local Scout config":d?.source==="local-store"?"local OpenScout store":"missing",r=d?.source==="local-store"&&t?.configured?"local OpenScout store + HudVault mirror":a,p=d?.preview??t?.preview??null,N=async()=>{x(!0),f(null);try{const S=i.trim();await Oe(S);let w=null;try{await Re(S)}catch(A){w=A instanceof Error?A.message:"HudVault save failed."}h(""),await n(),f(w?`Saved to local OpenScout store. Browser mirror failed: ${w}`:"Saved to local OpenScout store and Hudson Vault.")}catch(S){f(S instanceof Error?S.message:"Could not save key.")}finally{x(!1)}},I=async()=>{x(!0),f(null);try{const[S,w]=await Promise.allSettled([Pe(),Ie()]);h(""),await n(),S.status==="rejected"||w.status==="rejected"?f("Cleared what I could; one credential store did not respond."):f(d?.source==="env"||d?.source==="local-config"?"Removed saved key. Server fallback is still configured.":"Removed saved key.")}catch(S){f(S instanceof Error?S.message:"Could not clear key.")}finally{x(!1)}};return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:"Model providers",right:c?`configured · ${r}`:"missing"}),e.jsx("div",{className:"s-settings-relay-card",children:e.jsxs("div",{children:[e.jsxs("div",{className:"s-settings-relay-title",children:["OpenAI · ",e.jsxs("span",{className:"s-settings-device-status",style:{color:c?"var(--green)":"var(--dim)"},children:["●"," ",c?"ready":"missing"]})]}),e.jsxs("div",{className:"s-settings-relay-meta",children:[p??"No key stored"," · ",r]}),e.jsx("div",{className:"s-settings-relay-desc",children:"Scout stores user-entered keys in the local OpenScout credential store and keeps a HudVault mirror for this browser profile."})]})}),e.jsx(k,{label:"OpenAI API key",hint:"Saved locally. Existing keys are never shown again.",children:e.jsx("input",{className:"s-settings-input s-settings-input--mono",type:"password",value:i,placeholder:c?"Saved key configured":"sk-...",autoComplete:"off",spellCheck:!1,onChange:S=>h(S.target.value)})}),b&&e.jsx("div",{className:"s-settings-field-hint",children:b}),e.jsxs("div",{className:"s-settings-button-row",children:[e.jsx("button",{type:"button",className:"s-btn",disabled:m||!i.trim(),onClick:()=>{N()},children:m?"Saving":"Save key"}),e.jsx("button",{type:"button",className:"s-btn",disabled:m||!(t?.configured||d?.source==="local-store"),onClick:()=>{I()},children:"Clear saved key"})]})]})}const ws=[{id:"auto",label:"Auto",sub:"Parakeet when warm, Apple fallback"},{id:"parakeet",label:"Parakeet",sub:"on-device, best quality"},{id:"apple",label:"Apple Speech",sub:"instant, no model warmup"}];function ks(){const t=Ce($e,!0),[s,n]=o.useState(null),[i,h]=o.useState(null),[m,x]=o.useState(null),[b,f]=o.useState([]),[d,c]=o.useState([]),[a,r]=o.useState(!0),[p,N]=o.useState(!1),[I,S]=o.useState(!1),[w,A]=o.useState(!1),[$,v]=o.useState(null),D=o.useCallback(async()=>{r(!0);try{const[l,u,y,X]=await Promise.all([Ve(),He(12).catch(()=>[]),Le().catch(()=>null),os().catch(()=>null)]);n(l.settings),f(l.devices),c(u),h(y),x(X),v(null)}catch(l){v(l instanceof Error?l.message:String(l))}finally{r(!1)}},[]);o.useEffect(()=>{D()},[D]);const O=o.useCallback(async l=>{N(!0),v(null);try{const u=await ze(l);n(u.settings),f(u.devices)}catch(u){v(u instanceof Error?u.message:String(u))}finally{N(!1)}},[]),V=o.useCallback(async l=>{S(!0),v(null);try{const u=await Me(l);h(u),De(u)}catch(u){v(u instanceof Error?u.message:String(u))}finally{S(!1)}},[]),H=o.useCallback(async l=>{A(!0),v(null);try{const u=await cs(l?"host":"browser");x(u),ds(u)}catch(u){v(u instanceof Error?u.message:String(u))}finally{A(!1)}},[]);if(a&&!s)return e.jsx("div",{className:"s-settings-field-hint",children:"Loading voice settings…"});const z=s?.inputDeviceId??b.find(l=>l.isDefault)?.id??"",R=s?.permissions?.find(l=>l.kind==="microphone")??null,E=s?.permissions?.find(l=>l.kind==="speechRecognition")??null,L=(s?.permissions?.length??0)>0||b.length>0,T=t&&i?.enabled===!0,G=I||!t||!i||i.locked,F=t?i?i.locked?`Controlled by OPENSCOUT_REALTIME_VOICE_ENABLED · ${i.enabled?"on":"off"}`:T?"Ready. Use Voice in the footer to start a call.":"Off. No microphone or OpenAI connection runs in the background.":"Live voice settings are temporarily unavailable.":"Unavailable in this build.",P=m?.playback==="host",U=w||!m||m.locked,M=m?m.locked?`Controlled by ${ls} · ${m.playback}`:P?L?"On. Scout Menu speaks replies on this Mac in its own voice.":"On, but Scout Menu is offline. Launch it on this Mac to hear replies.":"Off. Replies play in this browser.":"Playback settings are temporarily unavailable.",g=[L?null:"Scout voice host is offline. Launch Scout Menu on this Mac — the browser does not capture audio.",R?.status==="denied"||R?.status==="restricted"?R?.status==="restricted"?"Microphone access is restricted on this Mac.":"Microphone access is off for Scout Menu. Choose Retry access to reopen the macOS permission pane.":R?.canRequest?"Microphone has not been requested yet. Request access or tap the mic in chat to show the macOS prompt.":null,!E?.granted&&(E?.status==="denied"||E?.status==="restricted")?E?.status==="restricted"?"Speech recognition is restricted on this Mac.":"Speech recognition is off for Scout Menu. Open Privacy & Security → Speech Recognition to change it.":null,s?.modelReady?null:"Parakeet may download on first use. Apple Speech stays available while the model warms.","Dictation requires Scout Menu running. The browser does not capture audio.","If transcription hangs on Processing, wait up to 60 seconds or tap the mic again to cancel."].filter(l=>!!l);return e.jsxs("div",{className:"s-settings-col-gap",children:[$&&e.jsx("div",{className:"s-settings-field-hint",style:{color:"var(--amber)"},children:$}),e.jsx(j,{label:"Realtime conversation",right:"operator control"}),e.jsxs("div",{className:"s-settings-realtime-voice","data-enabled":T||void 0,"data-unavailable":!t||void 0,children:[e.jsxs("span",{className:"s-settings-realtime-voice-copy",children:[e.jsx("strong",{children:"Enable live voice on this Scout"}),e.jsx("span",{children:"Allows live conversations with Scoutbot. Microphone audio and OpenAI usage begin only when you explicitly start a call."}),e.jsx("em",{children:F})]}),e.jsxs("button",{type:"button",role:"switch","aria-checked":T,"aria-label":"Enable live voice on this Scout",disabled:G,"data-checked":T||void 0,className:"s-settings-switch",onClick:()=>{V(!T)},children:[e.jsx("span",{className:"s-settings-switch-thumb","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:T?"On":"Off"})]})]}),e.jsx(j,{label:"Spoken replies",right:"where they play"}),e.jsxs("div",{className:"s-settings-realtime-voice","data-enabled":P||void 0,children:[e.jsxs("span",{className:"s-settings-realtime-voice-copy",children:[e.jsx("strong",{children:"Speak on this Mac"}),e.jsx("span",{children:"Spoken replies and briefs play through Scout Menu on the Mac instead of this browser tab, in the voice chosen in Scout Menu › Voice. Installed voices such as Kokoro work only this way. A surface or agent can still name the browser for one utterance."}),e.jsx("em",{children:M})]}),e.jsxs("button",{type:"button",role:"switch","aria-checked":P,"aria-label":"Speak on this Mac",disabled:U,"data-checked":P||void 0,className:"s-settings-switch",onClick:()=>{H(!P)},children:[e.jsx("span",{className:"s-settings-switch-thumb","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:P?"On":"Off"})]})]}),e.jsx(Ke,{hostOnline:L,micPermission:R,speechPermission:E,modelReady:s?.modelReady}),e.jsx(j,{label:"Scout Menu permissions",right:"voice host"}),e.jsx(We,{permissions:s?.permissions,hostOnline:L,disabled:p||a,onError:l=>v(l),onRefresh:D}),e.jsx(j,{label:"Transcription"}),e.jsx(k,{label:"Engine",hint:s?.modelReady?"Parakeet is warm and ready.":s?.modelInstalled?"Parakeet is installed; first dictation may warm the model.":"Parakeet downloads on first use. Apple Speech stays available meanwhile.",children:e.jsx(W,{value:s?.preference??"auto",onChange:l=>{n(u=>u&&{...u,preference:l}),O({preference:l})},options:ws,columns:3})}),e.jsx(k,{label:"Microphone input",hint:"Scout Menu uses the macOS system default input unless you pick a device here. The browser never captures audio.",children:b.length>0?e.jsx("select",{className:"s-settings-input",value:z,disabled:p,onChange:l=>{const u=l.target.value||null;n(y=>y&&{...y,inputDeviceId:u,inputDeviceName:b.find(X=>X.id===u)?.name??null}),O({inputDeviceId:u})},children:b.map(l=>e.jsxs("option",{value:l.id,children:[l.name,l.isDefault?" (system default)":""]},l.id))}):e.jsx("div",{className:"s-settings-field-hint",children:"Scout Menu is not reporting microphones. Launch Scout Menu, grant mic access, then refresh."})}),e.jsx(j,{label:"Diagnostics"}),e.jsx("ul",{className:"s-settings-field-hint",style:{margin:0,paddingLeft:"1.1rem",display:"grid",gap:"0.35rem"},children:g.map(l=>e.jsx("li",{children:l},l))}),e.jsx(j,{label:"Recent sessions",right:d.length?`${d.length} shown`:"none"}),d.length===0?e.jsx("div",{className:"s-settings-field-hint",children:"No recent dictation sessions on this web server. History fills as you use the mic in chat."}):e.jsx("div",{className:"s-settings-col-gap",style:{gap:"0.35rem"},children:d.map(l=>e.jsx("div",{className:"s-settings-device-row",style:{alignItems:"flex-start"},children:e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{className:"s-settings-device-name",style:{fontFamily:"var(--mono)"},children:[l.status," · ",l.lastEvent??"started"]}),e.jsxs("div",{className:"s-settings-device-meta",children:[l.surface," · ",_e(l.updatedAt),l.error?` · ${l.error}`:""]}),l.lastTranscript?e.jsx("div",{className:"s-settings-field-hint",style:{marginTop:"0.2rem"},children:l.lastTranscript.length>96?`${l.lastTranscript.slice(0,96)}…`:l.lastTranscript}):null]})},l.sessionId))}),e.jsx("div",{className:"s-settings-button-row",children:e.jsx("button",{type:"button",className:"s-btn",disabled:a||p,onClick:()=>{D()},children:a?"Refreshing…":"Refresh"})})]})}const Cs={desktop:"◻",mobile:"▯",tablet:"▭"};function As({device:t}){const s=t.status==="this-device"?"var(--accent)":t.status==="online"?"var(--green)":"var(--dim)";return e.jsxs("div",{className:"s-settings-device-row",children:[e.jsx("span",{className:"s-settings-device-icon",children:Cs[t.kind]??"□"}),e.jsxs("div",{children:[e.jsx("div",{className:"s-settings-device-name",children:t.name}),e.jsxs("div",{className:"s-settings-device-meta",children:[t.kind," · via ",t.relay," · ",t.lastSeen]})]}),e.jsxs("span",{className:"s-settings-device-status",style:{color:s},children:["●"," ",t.status==="this-device"?"this device":t.status]}),e.jsx("button",{className:"s-btn",disabled:t.status==="this-device",children:t.status==="this-device"?"—":"Unpair"})]})}function Es({pairing:t}){const s=[{id:"local",name:"This machine",kind:"desktop",status:"this-device",relay:"local",lastSeen:"now"}];if(t?.trustedPeers)for(const n of t.trustedPeers){const i=n.fingerprint===t.connectedPeerFingerprint;s.push({id:n.fingerprint,name:n.name??"Paired device",kind:"mobile",status:i?"online":"offline",relay:"tailscale",lastSeen:n.lastSeenLabel??"—"})}return e.jsxs("div",{className:"s-settings-col-gap",children:[e.jsx(j,{label:`Paired devices · ${s.length}`}),e.jsx("div",{className:"s-settings-col-gap",style:{gap:10},children:s.map(n=>e.jsx(As,{device:n},n.id))}),e.jsx(j,{label:"Relay"}),e.jsxs("div",{className:"s-settings-relay-card",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"s-settings-relay-title",children:["Relay · ",e.jsxs("span",{className:"s-settings-device-status",style:{color:t?.isRunning?"var(--green)":"var(--dim)"},children:["●"," ",t?.isRunning?"connected":"offline"]})]}),e.jsxs("div",{className:"s-settings-relay-meta",children:[t?.relay??"not configured"," · tailscale"]}),e.jsx("div",{className:"s-settings-relay-desc",children:"Agents route through your relay to reach mobile when the app is backgrounded. End-to-end encrypted; keys never leave your devices."})]}),e.jsx("button",{className:"s-btn",children:"Configure"})]})]})}function Y(t,s,n=!1){if(!t&&!s)return"Not reported";const i=t||"detached";return s?`${i} @ ${s}${n?" (modified)":""}`:i}function be(){return navigator.userAgentData?.platform||navigator.platform||"Unknown"}function C({label:t,value:s,detail:n}){return e.jsxs("div",{className:"s-settings-about-fact",children:[e.jsx("dt",{children:t}),e.jsxs("dd",{children:[e.jsx("code",{children:s}),n?e.jsx("span",{children:n}):null]})]})}function he(t){const{build:s,mesh:n}=t,i=n?.health.build??null,h=n?.localNode?n.nodes[n.localNode.id]?.host:void 0,m=be();return["OpenScout troubleshooting report",`Collected: ${t.collectedAt.toISOString()}`,"","[Web]",`Observed: ${t.buildCollectedAt?.toISOString()??"unknown"}`,`Version: ${s?.version??"unknown"}`,`Mode: ${s?.mode??"unknown"}`,`Source: ${Y(s?.branch,s?.commit,s?.dirty===!0)}`,`Server: ${s?.server?`${s.server.engine} ${s.server.engineVersion}`:"unknown"}`,`Server platform: ${s?.server?`${s.server.platform}/${s.server.arch}`:"unknown"}`,"","[Broker]",`Observed: ${t.meshCollectedAt?.toISOString()??"unknown"}`,`Reachable: ${n?.health.reachable===void 0?"unknown":n.health.reachable?"yes":"no"}`,`Healthy: ${n?.health.ok===void 0?"unknown":n.health.ok?"yes":"no"}`,`Error: ${n?.health.error??"none reported"}`,`Package: ${i?.packageName??"unknown"}`,`Version: ${i?.version??"unknown"}`,`Mode: ${i?.mode??"unknown"}`,`Source: ${Y(i?.branch,i?.commit)}`,`Build: ${i?.buildNumber??i?.buildId??"not reported"}`,`Node: ${n?.health.nodeId??"unknown"}`,`Broker URL: ${n?.brokerUrl??"unknown"}`,"","[Host]",`Name: ${n?.localNode?.name??"unknown"}`,`Scout version: ${h?.scoutVersion??"not reported"}`,`System: ${h?.os??"unknown"}`,`Architecture: ${h?.arch??s?.server?.arch??"unknown"}`,"","[Browser]",`Platform: ${m}`,`User agent: ${navigator.userAgent}`,`Origin: ${window.location.origin}`].join(`
3
- `)}async function Ts(t){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const n=document.execCommand("copy");if(s.remove(),!n)throw new Error("Clipboard access is unavailable")}function Os(){const[t,s]=o.useState(null),[n,i]=o.useState(!0),[h,m]=o.useState(null),[x,b]=o.useState("idle"),f=o.useCallback(async(S=!1)=>{i(!0),m(null),b("idle");const[w,A]=await Promise.allSettled([B(S?"/api/build?refresh=1":"/api/build"),B("/api/mesh")]),$=new Date;if(s(v=>({build:w.status==="fulfilled"?w.value:v?.build??null,mesh:A.status==="fulfilled"?A.value:v?.mesh??null,collectedAt:$,buildCollectedAt:w.status==="fulfilled"?$:v?.buildCollectedAt??null,meshCollectedAt:A.status==="fulfilled"?$:v?.meshCollectedAt??null})),w.status==="rejected"||A.status==="rejected"){const v=[w.status==="rejected"?"web build":null,A.status==="rejected"?"broker":null].filter(Boolean).join(" and ");m(`Could not refresh ${v} details. Last reported values are kept when available.`)}i(!1)},[]);o.useEffect(()=>{f()},[f]);const d=t?.build??null,c=t?.mesh??null,a=c?.health.build??null,r=c?.localNode?c.nodes[c.localNode.id]?.host:void 0,p=be(),N=c===null?"not reported":c.health.reachable?c.health.ok?"healthy":"degraded":"unreachable",I=o.useCallback(()=>{t&&Ts(he(t)).then(()=>{b("copied"),setTimeout(()=>b("idle"),1800)}).catch(()=>{b("error")})},[t]);return n&&!t?e.jsx("div",{className:"s-settings-loading",children:"Collecting version details…"}):e.jsxs("div",{className:"s-settings-about",children:[e.jsxs("div",{className:"s-settings-about-summary",children:[e.jsxs("div",{children:[e.jsx("span",{className:"s-settings-about-product",children:"OpenScout Web"}),e.jsx("strong",{children:d?.version?`v${d.version}`:"Version unavailable"}),e.jsxs("span",{className:"s-settings-about-source",children:[d?.mode??"unknown mode"," · ",Y(d?.branch,d?.commit,d?.dirty===!0)]}),e.jsxs("span",{className:"s-settings-about-collected",children:["Snapshot collected ",t?.collectedAt.toLocaleString()??"—"]})]}),e.jsxs("div",{className:"s-settings-about-actions",children:[e.jsxs("button",{type:"button",className:"s-btn",onClick:()=>{f(!0)},disabled:n,children:[e.jsx(Ye,{size:13,"aria-hidden":!0}),n?"Refreshing…":"Refresh"]}),e.jsxs("button",{type:"button",className:"s-btn s-settings-about-copy",onClick:I,disabled:!t,children:[x==="copied"?e.jsx(_,{size:13,"aria-hidden":!0}):e.jsx(Xe,{size:13,"aria-hidden":!0}),x==="copied"?"Copied report":x==="error"?"Copy failed":"Copy report"]})]})]}),h?e.jsx("div",{className:"s-settings-about-warning",role:"status",children:h}):null,x==="error"&&t?e.jsxs("div",{className:"s-settings-about-copy-fallback",role:"alert",children:[e.jsx("strong",{children:"Clipboard access was denied."}),e.jsx("span",{children:"Select and copy the report below."}),e.jsx("textarea",{readOnly:!0,value:he(t),"aria-label":"OpenScout troubleshooting report"})]}):null,e.jsx(j,{label:"Web application",right:"release and source identity"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Package version",value:d?.version??"Unknown",detail:`Observed ${t?.buildCollectedAt?.toLocaleString()??"at an unknown time"}. Use this when comparing releases.`}),e.jsx(C,{label:"Run mode",value:d?.mode??"Unknown"}),e.jsx(C,{label:"Source checkout",value:Y(d?.branch,d?.commit,d?.dirty===!0),detail:"A dev SHA identifies the running checkout; it is not the release version."}),e.jsx(C,{label:"Server engine",value:d?.server?`${d.server.engine} ${d.server.engineVersion}`:"Not reported",detail:d?.server?`Node compatibility ${d.server.nodeVersion} · ${d.server.platform}/${d.server.arch}`:void 0})]}),e.jsx(j,{label:"Broker",right:N}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Status",value:N,detail:[`Observed ${t?.meshCollectedAt?.toLocaleString()??"at an unknown time"}.`,c?.health.error].filter(Boolean).join(" ")}),e.jsx(C,{label:"Package",value:a?.packageName??"Not reported"}),e.jsx(C,{label:"Version",value:a?.version??"Not reported"}),e.jsx(C,{label:"Source",value:Y(a?.branch,a?.commit)}),e.jsx(C,{label:"Build",value:a?.buildNumber??a?.buildId??"Not reported"}),e.jsx(C,{label:"Node",value:c?.health.nodeId??"Not reported",detail:c?.brokerUrl})]}),e.jsx(j,{label:"Host and browser",right:"troubleshooting context"}),e.jsxs("dl",{className:"s-settings-about-ledger",children:[e.jsx(C,{label:"Host",value:c?.localNode?.name??"Not reported"}),e.jsx(C,{label:"Host Scout",value:r?.scoutVersion??"Not reported"}),e.jsx(C,{label:"Host system",value:[r?.os,r?.arch??d?.server?.arch].filter(Boolean).join(" · ")||"Not reported"}),e.jsx(C,{label:"Browser platform",value:p}),e.jsx(C,{label:"Browser",value:navigator.userAgent}),e.jsx(C,{label:"Page origin",value:window.location.origin})]}),e.jsx("p",{className:"s-settings-about-note",children:"Native app and CLI versions are shown only when those components report them. Scout does not infer a version from a nearby checkout."})]})}const q=[{id:"appearance",label:"Appearance",sub:"mode · workspace style"},{id:"operator",label:"Operator",sub:"identity · bio · hours"},{id:"comms",label:"Communication",sub:"how agents reach you"},{id:"voice",label:"Voice",sub:"realtime · playback · permissions · dictation"},{id:"credentials",label:"Credentials",sub:"model provider keys"},{id:"devices",label:"Paired devices",sub:"relay · connected"},{id:"about",label:"About",sub:"versions · build · runtime"}],me={appearance:"Appearance",operator:"Operator identity",comms:"Communication",voice:"Voice",credentials:"Credentials",devices:"Paired devices",about:"About OpenScout"},Rs={appearance:"Choose how Scout looks on this device. Changes apply immediately across the workspace.",operator:"Your identity, availability, and the context agents receive when they work with you.",comms:"Set interruption rules, delivery channels, response style, and quiet hours.",voice:"Configure dictation, realtime voice, permissions, and input devices.",credentials:"Manage model-provider credentials stored by this Scout installation.",devices:"Review the relay and devices currently connected to this Scout workspace.",about:"Exact release, source, broker, host, and browser details for troubleshooting."},Ps={name:"",handle:"",pronouns:"",hue:195,bio:"",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,workingHours:"08:00 – 18:00",interruptThreshold:"blocking-only",batchWindow:15,channel:"here+mobile",verbosity:"terse",tone:"direct",quietHours:"22:00 – 07:00",provisionalAgentNames:[],provisionalAgentNamesMode:"replace",provisionalAgentNamesResolvedCount:0,provisionalAgentNamesPreview:[],provisionalAgentNamesSource:"default"};function ve({open:t,onClose:s,section:n,onSectionChange:i,presentation:h}){const{refreshOnboarding:m}=ee(),{ref:x,onKeyDown:b}=Be(t&&h==="drawer"),[f,d]=o.useState("appearance"),c=n??f,a=o.useCallback(g=>{i?i(g):d(g)},[i]),[r,p]=o.useState(Ps),[N,I]=o.useState(null),[S,w]=o.useState(null),[A,$]=o.useState(null),[v,D]=o.useState(!1),[O,V]=o.useState("saved"),H=o.useRef(null),z=o.useRef(!0),R=o.useRef(null);o.useEffect(()=>()=>{z.current=!1},[]);const E=o.useCallback(async()=>{const[g,l]=await Promise.allSettled([Ae(),Ee()]),u=g.status==="fulfilled"?g.value:null;let y=l.status==="fulfilled"?l.value:null;u?.configured&&!y?.openai.configured&&(y=await Te().catch(()=>y)),w(u),$(y)},[]),L=o.useCallback(async()=>{try{const g=B("/api/user"),l=Promise.race([B("/api/pairing-state"),new Promise((X,ye)=>setTimeout(()=>ye(new Error("timeout")),3e3))]),[u,y]=await Promise.allSettled([g,l]);u.status==="fulfilled"&&p(u.value),y.status==="fulfilled"&&I(y.value),await E()}finally{D(!0)}},[E]);o.useEffect(()=>{t&&c!=="appearance"&&c!=="about"&&!v&&L()},[v,t,L,c]),o.useEffect(()=>{if(!t||!window.matchMedia("(max-width: 760px)").matches)return;const g=window.requestAnimationFrame(()=>{R.current?.scrollIntoView({block:"nearest",inline:"nearest"})});return()=>window.cancelAnimationFrame(g)},[t,c]);const T=o.useCallback(g=>{const u=(q.findIndex(y=>y.id===c)+g+q.length)%q.length;a(q[u].id)},[c]),G=o.useCallback(g=>{if(b(g),h==="drawer"&&g.key==="Escape"){g.preventDefault(),s();return}g.target?.closest(".s-settings-rail")&&(g.key==="ArrowDown"?(g.preventDefault(),T(1)):g.key==="ArrowUp"&&(g.preventDefault(),T(-1)))},[T,s,b,h]),F=o.useCallback(g=>{H.current&&clearTimeout(H.current),V("saving"),H.current=setTimeout(()=>{B("/api/user",{method:"POST",body:JSON.stringify(g)}).then(()=>m()).then(()=>{z.current&&V("saved")}).catch(()=>{z.current&&V("error")})},400)},[m]),P=o.useCallback(g=>{p(l=>{const u={...l,...g};return F(u),u})},[F]),U=e.jsx("nav",{className:"s-settings-rail","aria-label":"Settings pages",children:q.map(g=>{const l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"s-settings-rail-label",children:g.label}),e.jsx("span",{className:"s-settings-rail-sub",children:g.sub})]}),u=`s-settings-rail-btn${c===g.id?" s-settings-rail-btn--active":""}`;return h==="page"?e.jsx("a",{ref:c===g.id?y=>{R.current=y}:void 0,href:Fe({view:"settings",section:g.id}),"aria-current":c===g.id?"page":void 0,className:u,onClick:y=>{y.button!==0||y.metaKey||y.ctrlKey||y.shiftKey||y.altKey||(y.preventDefault(),a(g.id))},children:l},g.id):e.jsx("button",{ref:c===g.id?y=>{R.current=y}:void 0,onClick:()=>a(g.id),"aria-current":c===g.id?"page":void 0,className:u,children:l},g.id)})}),M=e.jsx("main",{className:"s-settings-content",id:`settings-${c}`,"data-settings-section":c,tabIndex:-1,children:c==="appearance"?e.jsx(ys,{}):c==="about"?e.jsx(Os,{}):v?e.jsxs(e.Fragment,{children:[c==="operator"&&e.jsx(fs,{profile:r,update:P}),c==="comms"&&e.jsx(Ss,{profile:r,update:P}),c==="credentials"&&e.jsx(Ns,{clientCredentials:S,serverCredentials:A,reloadCredentials:E}),c==="voice"&&e.jsx(ks,{}),c==="devices"&&e.jsx(Es,{pairing:N})]}):e.jsx("div",{className:"s-settings-loading",children:"Loading settings…"})});return h==="page"?e.jsxs("section",{className:"s-settings-page","aria-labelledby":"settings-page-title",children:[e.jsxs("header",{className:"s-settings-page-header",children:[e.jsxs("div",{children:[e.jsx("div",{className:"s-settings-page-kicker",children:"Settings"}),e.jsx("h1",{id:"settings-page-title",children:me[c]}),e.jsx("p",{children:Rs[c]})]}),c==="about"?e.jsxs("div",{className:"s-settings-page-save-state","data-state":"neutral",children:[e.jsx("span",{"aria-hidden":"true"}),"Diagnostic snapshot"]}):e.jsxs("div",{className:"s-settings-page-save-state","data-state":O,role:"status","aria-live":"polite",children:[e.jsx("span",{"aria-hidden":"true"}),O==="saving"?"Saving changes…":O==="error"?"Couldn’t save changes":"Saved automatically"]})]}),e.jsxs("div",{className:"s-settings-page-layout",children:[U,M]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`s-settings-scrim ${t?"s-settings-scrim--open":"s-settings-scrim--closed"}`,onClick:s}),e.jsxs("div",{ref:x,role:"dialog","aria-modal":"true","aria-label":"Settings",className:`s-settings-drawer ${t?"s-settings-drawer--open":"s-settings-drawer--closed"}`,onKeyDown:G,children:[e.jsxs("div",{className:"s-settings-header",children:[e.jsxs("div",{className:"s-settings-header-title",children:["⚙"," SETTINGS"]}),e.jsx("span",{className:"s-settings-header-sep",children:"/"}),e.jsx("span",{className:"s-settings-header-section",children:me[c]}),e.jsx("span",{style:{flex:1}}),e.jsx("span",{className:"s-settings-header-hint",children:"ESC to close"}),e.jsx("button",{className:"s-settings-close",onClick:s,children:"×"})]}),U,M,e.jsxs("div",{className:"s-settings-footer",children:[e.jsxs("span",{className:"s-settings-footer-sync",children:["●"," synced"]}),e.jsx("span",{children:"·"}),e.jsx("span",{children:"changes apply instantly to every agent in your fleet"}),e.jsx("span",{style:{flex:1}}),e.jsx("button",{className:"s-btn",onClick:s,children:"Done"})]})]})]})}function xe(t){return e.jsx(ve,{...t,presentation:"drawer"})}function je({section:t="appearance",onSectionChange:s}){return e.jsx(ve,{open:!0,onClose:()=>{},section:t,onSectionChange:s,presentation:"page"})}const st=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:xe,SettingsPage:je},Symbol.toStringTag,{value:"Module"})),tt=Object.freeze(Object.defineProperty({__proto__:null,SettingsDrawer:xe,SettingsPage:je},Symbol.toStringTag,{value:"Module"}));export{je as S,st as a,tt as b};
@@ -1 +0,0 @@
1
- import{j as i,r as d}from"./index-DReVb7jZ.js";import{E as it}from"./EmptyState-CYUwYyAW.js";import{S as B}from"./StatusPill-Dw4LP7wu.js";import{a as M}from"./api-DSqpVKC7.js";import{p as Rt}from"./status-tone-BM_zuRy1.js";import{t as ot}from"./time-Dhsh_2EG.js";import{AgentConfigurationScreen as Mt}from"./AgentConfigurationScreen-BhD1PEAM.js";import{S as At}from"./SettingsDrawer-Nz98oBVl.js";/* empty css */import"./CastPicker-ZPomvOf-.js";import"./CrewAvatar-zgzC3cbU.js";import"./HarnessMark-DSvM_H7H.js";import"./check-g7D7-c1J.js";import"./createLucideIcon-ChvMq-zl.js";import"./NewChatComposer-BEXS8vV6.js";import"./runtime-picker-C_AVYF63.js";import"./scout-voice-CqAyfblr.js";import"./fx-z37u1o2z.js";import"./voice-levels-Dcr3jglk.js";import"./loader-circle-DNUsuPWz.js";import"./router-C-MF5-mb.js";import"./synthetic-agent-routing-aduMYO7P.js";import"./terminal-sessions-3RfJpen8.js";import"./conversation-model-m8HhzroS.js";import"./agent-state-DDhnFEEP.js";import"./colors-CFlbwC25.js";import"./conversations-Cbg9h_Af.js";import"./index-CbqBwfIW.js";import"./NewChatOrigin-C8ROO4ps.js";import"./keyboard-nav-CJXPaHXj.js";import"./x-rlMdRqJF.js";import"./chevron-down-CDzRQQGl.js";import"./search-UsM-9-_W.js";import"./file-text-DP6txVW-.js";import"./Provider-CNZluAZb.js";import"./provider-DwmCoSlc.js";import"./machine-scope-DJt9RZ2w.js";import"./sse-A8AyLH0g.js";import"./index-BWHgHrtv.js";import"./surface-activity-B1rgWB1i.js";import"./scoutbot-Bk3nyrkj.js";import"./model-CBkMvT1w.js";import"./DocumentFocusViewer-DlMiEALb.js";import"./TextDocumentSurface-BK6Qy41F.js";import"./index-kkXUq-zf.js";import"./chevron-right-DKGTLiqc.js";import"./folder-B_S7gBVr.js";import"./chevron-up-DX7R6KY2.js";import"./code-xml-Cmadr3pQ.js";import"./arrow-left-DFfKAq0d.js";import"./arrow-right-DmAWnyAH.js";import"./chunk-HRAB3GC3-Dvk_QpRq.js";import"./openContent-C6XO6kr5.js";import"./AgentsSubnav-CeHhuzyM.js";import"./SecondaryNav-Bs-_VwTC.js";import"./secondaryNavConfig-DzNHk6IH.js";import"./nav-destinations-CU_euC-Q.js";import"./message-square-CJW4WRlo.js";import"./terminal-DMZjX1es.js";import"./compass-CvzkzkIh.js";import"./settings-C69Zjrpq.js";import"./git-branch-DcUCsWdJ.js";import"./scroll-text-B0tKI9Sg.js";import"./refresh-cw-IcD2lPoT.js";import"./bot-BhAVbcCA.js";import"./wrench-B4maQJai.js";import"./server-DBlPW0Mp.js";import"./cpu-Q6nrHFTN.js";import"./credentials-OeoF-VKJ.js";import"./AgentAvatar-NZOqcsB2.js";import"./SpriteAvatar-aHeF4ZQZ.js";import"./VoicePermissionsPanel-D35fOnQj.js";import"./monitor-C7_cHlkC.js";import"./copy-BGOC1tJB.js";import"./sparkles-Cc5lPZRv.js";var k=(t=>(t[t.Border=-1]="Border",t[t.Data=0]="Data",t[t.Function=1]="Function",t[t.Position=2]="Position",t[t.Timing=3]="Timing",t[t.Alignment=4]="Alignment",t))(k||{});const Ct=[0,1],dt=[1,0],ht=[2,3],ft=[3,2],It={L:Ct,M:dt,Q:ht,H:ft},zt=/^\d*$/,Ft=/^[A-Z0-9 $%*+./:-]*$/,L="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",T=1,q=40,at=3,Bt=3,I=40,Lt=10,mt=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],pt=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class _t{constructor(e,s,n,r){if(this.version=e,this.ecc=s,e<T||e>q)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=e*4+17;const o=Array.from({length:this.size}).fill(!1);for(let c=0;c<this.size;c++)this.modules.push(o.slice()),this.types.push(o.map(()=>0));this.drawFunctionPatterns();const a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let c=1e9;for(let u=0;u<8;u++){this.applyMask(u),this.drawFormatBits(u);const h=this.getPenaltyScore();h<c&&(r=u,c=h),this.applyMask(u)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,s){return e>=0&&e<this.size&&s>=0&&s<this.size&&this.modules[s][e]}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2===0,k.Timing),this.setFunctionModule(n,6,n%2===0,k.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),s=e.length;for(let n=0;n<s;n++)for(let r=0;r<s;r++)n===0&&r===0||n===0&&r===s-1||n===s-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const s=this.ecc[1]<<3|e;let n=s;for(let o=0;o<10;o++)n=n<<1^(n>>>9)*1335;const r=(s<<10|n)^21522;for(let o=0;o<=5;o++)this.setFunctionModule(8,o,x(r,o));this.setFunctionModule(8,7,x(r,6)),this.setFunctionModule(8,8,x(r,7)),this.setFunctionModule(7,8,x(r,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,x(r,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,x(r,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,x(r,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^(e>>>11)*7973;const s=this.version<<12|e;for(let n=0;n<18;n++){const r=x(s,n),o=this.size-11+n%3,a=Math.floor(n/3);this.setFunctionModule(o,a,r),this.setFunctionModule(a,o,r)}}drawFinderPattern(e,s){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),a=e+r,c=s+n;a>=0&&a<this.size&&c>=0&&c<this.size&&this.setFunctionModule(a,c,o!==2&&o!==4,k.Position)}}drawAlignmentPattern(e,s){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,s+n,Math.max(Math.abs(r),Math.abs(n))!==1,k.Alignment)}setFunctionModule(e,s,n,r=k.Function){this.modules[s][e]=n,this.types[s][e]=r}addEccAndInterleave(e){const s=this.version,n=this.ecc;if(e.length!==z(s,n))throw new RangeError("Invalid argument");const r=pt[n[0]][s],o=mt[n[0]][s],a=Math.floor(O(s)/8),c=r-a%r,u=Math.floor(a/r),h=[],p=Yt(o);for(let f=0,b=0;f<r;f++){const g=e.slice(b,b+u-o+(f<c?0:1));b+=g.length;const E=Gt(g,p);f<c&&g.push(0),h.push(g.concat(E))}const m=[];for(let f=0;f<h[0].length;f++)h.forEach((b,g)=>{(f!==u-o||g>=c)&&m.push(b[f])});return m}drawCodewords(e){if(e.length!==Math.floor(O(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const a=n-o,u=(n+1&2)===0?this.size-1-r:r;!this.types[u][a]&&s<e.length*8&&(this.modules[u][a]=x(e[s>>>3],7-(s&7)),s++)}}}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+s)%2===0;break;case 1:r=s%2===0;break;case 2:r=n%3===0;break;case 3:r=(n+s)%3===0;break;case 4:r=(Math.floor(n/3)+Math.floor(s/2))%2===0;break;case 5:r=n*s%2+n*s%3===0;break;case 6:r=(n*s%2+n*s%3)%2===0;break;case 7:r=((n+s)%2+n*s%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[s][n]&&r&&(this.modules[s][n]=!this.modules[s][n])}}getPenaltyScore(){let e=0;for(let o=0;o<this.size;o++){let a=!1,c=0;const u=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[o][h]===a?(c++,c===5?e+=at:c>5&&e++):(this.finderPenaltyAddHistory(c,u),a||(e+=this.finderPenaltyCountPatterns(u)*I),a=this.modules[o][h],c=1);e+=this.finderPenaltyTerminateAndCount(a,c,u)*I}for(let o=0;o<this.size;o++){let a=!1,c=0;const u=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][o]===a?(c++,c===5?e+=at:c>5&&e++):(this.finderPenaltyAddHistory(c,u),a||(e+=this.finderPenaltyCountPatterns(u)*I),a=this.modules[h][o],c=1);e+=this.finderPenaltyTerminateAndCount(a,c,u)*I}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){const c=this.modules[o][a];c===this.modules[o][a+1]&&c===this.modules[o+1][a]&&c===this.modules[o+1][a+1]&&(e+=Bt)}let s=0;for(const o of this.modules)s=o.reduce((a,c)=>a+(c?1:0),s);const n=this.size*this.size,r=Math.ceil(Math.abs(s*20-n*10)/n)-1;return e+=r*Lt,e}getAlignmentPatternPositions(){if(this.version===1)return[];{const e=Math.floor(this.version/7)+2,s=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=s)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){const s=e[1],n=s>0&&e[2]===s&&e[3]===s*3&&e[4]===s&&e[5]===s;return(n&&e[0]>=s*4&&e[6]>=s?1:0)+(n&&e[6]>=s*4&&e[0]>=s?1:0)}finderPenaltyTerminateAndCount(e,s,n){return e&&(this.finderPenaltyAddHistory(s,n),s=0),s+=this.size,this.finderPenaltyAddHistory(s,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,s){s[0]===0&&(e+=this.size),s.pop(),s.unshift(e)}}function N(t,e,s){if(e<0||e>31||t>>>e)throw new RangeError("Value out of range");for(let n=e-1;n>=0;n--)s.push(t>>>n&1)}function x(t,e){return(t>>>e&1)!==0}class V{constructor(e,s,n){if(this.mode=e,this.numChars=s,this.bitData=n,s<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}const $t=[1,10,12,14],Ot=[2,9,11,13],Ut=[4,8,16,16];function gt(t,e){return t[Math.floor((e+7)/17)+1]}function yt(t){const e=[];for(const s of t)N(s,8,e);return new V(Ut,t.length,e)}function Dt(t){if(!bt(t))throw new RangeError("String contains non-numeric characters");const e=[];for(let s=0;s<t.length;){const n=Math.min(t.length-s,3);N(Number.parseInt(t.substring(s,s+n),10),n*3+1,e),s+=n}return new V($t,t.length,e)}function Tt(t){if(!vt(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");const e=[];let s;for(s=0;s+2<=t.length;s+=2){let n=L.indexOf(t.charAt(s))*45;n+=L.indexOf(t.charAt(s+1)),N(n,11,e)}return s<t.length&&N(L.indexOf(t.charAt(s)),6,e),new V(Ot,t.length,e)}function qt(t){return t===""?[]:bt(t)?[Dt(t)]:vt(t)?[Tt(t)]:[yt(Ht(t))]}function bt(t){return zt.test(t)}function vt(t){return Ft.test(t)}function Vt(t,e){let s=0;for(const n of t){const r=gt(n.mode,e);if(n.numChars>=1<<r)return Number.POSITIVE_INFINITY;s+=4+r+n.bitData.length}return s}function Ht(t){t=encodeURI(t);const e=[];for(let s=0;s<t.length;s++)t.charAt(s)!=="%"?e.push(t.charCodeAt(s)):(e.push(Number.parseInt(t.substring(s+1,s+3),16)),s+=2);return e}function O(t){if(t<T||t>q)throw new RangeError("Version number out of range");let e=(16*t+128)*t+64;if(t>=2){const s=Math.floor(t/7)+2;e-=(25*s-10)*s-55,t>=7&&(e-=36)}return e}function z(t,e){return Math.floor(O(t)/8)-mt[e[0]][t]*pt[e[0]][t]}function Yt(t){if(t<1||t>255)throw new RangeError("Degree out of range");const e=[];for(let n=0;n<t-1;n++)e.push(0);e.push(1);let s=1;for(let n=0;n<t;n++){for(let r=0;r<e.length;r++)e[r]=U(e[r],s),r+1<e.length&&(e[r]^=e[r+1]);s=U(s,2)}return e}function Gt(t,e){const s=e.map(n=>0);for(const n of t){const r=n^s.shift();s.push(0),e.forEach((o,a)=>s[a]^=U(o,r))}return s}function U(t,e){if(t>>>8||e>>>8)throw new RangeError("Byte out of range");let s=0;for(let n=7;n>=0;n--)s=s<<1^(s>>>7)*285,s^=(e>>>n&1)*t;return s}function Wt(t,e,s=1,n=40,r=-1,o=!0){if(!(T<=s&&s<=n&&n<=q)||r<-1||r>7)throw new RangeError("Invalid value");let a,c;for(a=s;;a++){const m=z(a,e)*8,f=Vt(t,a);if(f<=m){c=f;break}if(a>=n)throw new RangeError("Data too long")}for(const m of[dt,ht,ft])o&&c<=z(a,m)*8&&(e=m);const u=[];for(const m of t){N(m.mode[0],4,u),N(m.numChars,gt(m.mode,a),u);for(const f of m.getData())u.push(f)}const h=z(a,e)*8;N(0,Math.min(4,h-u.length),u),N(0,(8-u.length%8)%8,u);for(let m=236;u.length<h;m^=253)N(m,8,u);const p=Array.from({length:Math.ceil(u.length/8)},()=>0);return u.forEach((m,f)=>p[f>>>3]|=m<<7-(f&7)),new _t(a,e,p,r)}function Xt(t,e){const{ecc:s="L",boostEcc:n=!1,minVersion:r=1,maxVersion:o=40,maskPattern:a=-1,border:c=1}=e||{},u=typeof t=="string"?qt(t):Array.isArray(t)?[yt(t)]:void 0;if(!u)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof t}`);const h=Wt(u,It[s],r,o,a,n),p=Jt({version:h.version,maskPattern:h.mask,size:h.size,data:h.modules,types:h.types},c);return e?.invert&&(p.data=p.data.map(m=>m.map(f=>!f))),e?.onEncoded?.(p),p}function Jt(t,e=1){if(!e)return t;const{size:s}=t,n=s+e*2;t.size=n,t.data.forEach(o=>{for(let a=0;a<e;a++)o.unshift(!1),o.push(!1)});for(let o=0;o<e;o++)t.data.unshift(Array.from({length:n},a=>!1)),t.data.push(Array.from({length:n},a=>!1));const r=k.Border;t.types.forEach(o=>{for(let a=0;a<e;a++)o.unshift(r),o.push(r)});for(let o=0;o<e;o++)t.types.unshift(Array.from({length:n},a=>r)),t.types.push(Array.from({length:n},a=>r));return t}function lt(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Kt(t,e={}){const s=Xt(t,e),{pixelSize:n=10,whiteColor:r="white",blackColor:o="black"}=e,a=s.size*n,c=s.size*n;let u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${c} ${a}">`;const h=[];for(let p=0;p<s.size;p++)for(let m=0;m<s.size;m++){const f=m*n,b=p*n;s.data[p][m]&&h.push(`M${f},${b}h${n}v${n}h-${n}z`)}return u+=`<rect fill="${lt(r)}" width="${c}" height="${a}"/>`,u+=`<path fill="${lt(o)}" d="${h.join("")}"/>`,u+="</svg>",u}const Zt="scout",Qt="pair";function _(t){const e=typeof t=="string"?t.trim():"";return e?`${Zt}://${Qt}?payload=${encodeURIComponent(e)}`:null}function te(t){const e=ee(t),s=_(t);if(!e)return{default:s,lan:null,tailnet:null};const n=xt(e.relay,e.fallbackRelays??[]),r=n.find(se),o=n.find(ne);return{default:s,lan:r?_(JSON.stringify(ct(e,r))):null,tailnet:o?_(JSON.stringify(ct(e,o))):null}}function ee(t){const e=typeof t=="string"?t.trim():"";if(!e)return null;try{const s=JSON.parse(e);return!s||typeof s!="object"||typeof s.relay!="string"?null:s}catch{return null}}function ct(t,e){const s=xt(e,[t.relay,...Array.isArray(t.fallbackRelays)?t.fallbackRelays:[]]),n={...t,relay:s[0]};return s.length>1?n.fallbackRelays=s.slice(1):delete n.fallbackRelays,n}function xt(t,e){const s=[],n=new Set;for(const r of[t,...e]){if(typeof r!="string")continue;const o=r.trim();!o||n.has(o)||(n.add(o),s.push(o))}return s}function se(t){const e=Nt(t);if(!e)return!1;if(e.endsWith(".local"))return!0;const s=wt(e);if(!s)return!1;const[n,r]=s;return n===10||n===192&&r===168||n===172&&r>=16&&r<=31||n===169&&r===254}function ne(t){const e=Nt(t);if(!e)return!1;if(e.endsWith(".ts.net"))return!0;const s=wt(e);if(!s)return!1;const[n,r]=s;return n===100&&r>=64&&r<=127}function Nt(t){try{return new URL(t).hostname.toLowerCase()}catch{return""}}function wt(t){const e=t.split(".");if(e.length!==4)return null;const s=e.map(n=>{if(!/^\d+$/.test(n))return Number.NaN;const r=Number(n);return r>=0&&r<=255?r:Number.NaN});return s.every(Number.isFinite)?s:null}function re(t){return t?t.replace(/^wss?:\/\//,"").replace(/:\d+$/,""):null}function ut(t){return t?t.length<=18?t:`${t.slice(0,10)}...${t.slice(-6)}`:null}function ie(t,e){if(!t)return null;const s=Math.max(0,Math.floor((t-e)/1e3));if(s===0)return null;if(s<60)return`${s}s`;const n=Math.floor(s/60),r=s%60;return r>0?`${n}m ${r}s`:`${n}m`}function D({value:t}){const[e,s]=d.useState(!1),n=d.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[t]);return i.jsx("button",{type:"button",className:"sys-copy-btn",onClick:n,title:"Copy",children:e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),i.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}function $({label:t,value:e}){return i.jsxs("span",{className:"sys-settings-route-link",children:[i.jsx("a",{className:"sys-settings-link",href:e,title:e,"aria-label":`Open Scout ${t} pairing link`,children:i.jsx("code",{children:t})}),i.jsx(D,{value:e})]})}function oe({agentId:t,navigate:e}){return d.useEffect(()=>{e({view:"agents-v2",agentId:t,tab:"config"})},[t,e]),null}function As({navigate:t,section:e,agentId:s}){if(e==="agents"&&s)return i.jsx(oe,{agentId:s,navigate:t});if(e==="agents")return i.jsx(Mt,{navigate:t,selectedAgentId:s});if(e===void 0||e==="appearance"||e==="operator"||e==="comms"||e==="credentials"||e==="voice"||e==="devices"||e==="about"){const n=e??"appearance";return i.jsx(At,{section:n,onSectionChange:r=>t({view:"settings",section:r})})}return i.jsx(ae,{})}function ae(){const[t,e]=d.useState(null),[s,n]=d.useState(""),[r,o]=d.useState(""),[a,c]=d.useState(!0),[u,h]=d.useState(!1),[p,m]=d.useState(!1),[f,b]=d.useState(null),[g,E]=d.useState(null),[H,A]=d.useState(null),[C,Y]=d.useState(null),[jt,G]=d.useState(()=>Date.now()),[W,X]=d.useState(null),J=d.useRef(null),w=d.useRef(0),K=d.useRef(null);d.useEffect(()=>{J.current=t},[t]),d.useEffect(()=>{K.current=f},[f]),d.useEffect(()=>{!t||window.location.hash!=="#trusted-peers"||window.requestAnimationFrame(()=>{document.getElementById("trusted-peers")?.scrollIntoView({block:"start"})})},[t]);const j=d.useCallback(async(l="initial")=>{if(l==="background"&&K.current)return;const v=++w.current;!(J.current!==null)&&l!=="background"?(c(!0),E(null)):h(!0);try{const R=await M(l==="manual"?"/api/pairing-state/refresh":"/api/pairing-state");if(v!==w.current)return;e(R),E(null),Y(Date.now())}catch(R){if(v!==w.current)return;E(R instanceof Error?R.message:String(R))}finally{v===w.current&&(c(!1),h(!1))}},[]),Z=d.useCallback(async()=>{try{const l=await M("/api/user");o(l.name),n(l.name),A(null)}catch(l){A(l instanceof Error?l.message:String(l))}},[]),Q=d.useRef(!1);d.useEffect(()=>{j("initial"),Z()},[j,Z]),d.useEffect(()=>{const l=setInterval(()=>{j("background")},1e4);return()=>clearInterval(l)},[j]),d.useEffect(()=>{if(!t?.pairing?.expiresAt)return;G(Date.now());const l=setInterval(()=>{G(Date.now())},1e3);return()=>clearInterval(l)},[t?.pairing?.expiresAt]);const tt=d.useCallback(async()=>{m(!0),A(null);try{const l=await M("/api/user",{method:"POST",body:JSON.stringify({name:s})});o(l.name),n(l.name)}catch(l){A(l instanceof Error?l.message:String(l))}finally{m(!1)}},[s]),S=d.useCallback(async l=>{const v=++w.current;b(l),E(null);try{const P=await M("/api/pairing/control",{method:"POST",body:JSON.stringify({action:l})});if(v!==w.current)return;e(P),Y(Date.now())}catch(P){if(v!==w.current)return;E(P instanceof Error?P.message:String(P))}finally{v===w.current&&b(null)}},[]);d.useEffect(()=>{!t||t.isRunning||Q.current||(Q.current=!0,S("start"))},[t,S]);const Et=d.useCallback(async l=>{X(l);try{await M(`/api/pairing/peers/${encodeURIComponent(l)}`,{method:"DELETE"}),j("manual")}catch{}finally{X(null)}},[j]),et=d.useMemo(()=>{const l=t?.pairing?.qrValue?.trim();return l?Kt(l,{border:2,ecc:"M",pixelSize:8}):null},[t?.pairing?.qrValue]),y=d.useMemo(()=>te(t?.pairing?.qrValue),[t?.pairing?.qrValue]),kt=!!(y.lan||y.tailnet||y.default),F=re(t?.pairing?.relay??t?.relay??null),st=ie(t?.pairing?.expiresAt,jt),nt=(t?.trustedPeers.find(l=>l.fingerprint===t.connectedPeerFingerprint)??null)?.name??ut(t?.connectedPeerFingerprint??null),Pt=Rt(t),rt=s.trim()!==r,St=!a&&!t&&!!g;return i.jsxs("div",{className:"sys-surface-page sys-settings-page",children:[i.jsxs("div",{className:"sys-page-head",children:[i.jsxs("div",{className:"sys-page-title-group",children:[i.jsx("h2",{className:"sys-page-title",children:"Settings"}),i.jsx("p",{className:"sys-page-subtitle",children:"Identity, pairing, and trusted devices."})]}),i.jsxs("div",{className:"sys-page-actions",children:[t&&i.jsx(B,{tone:Pt,children:t.statusLabel}),i.jsx("div",{className:"sys-sync-note",children:a?"Loading...":g&&t?`Snapshot from ${C?ot(C):"earlier"}`:C?`Updated ${ot(C)}`:""}),i.jsx("button",{type:"button",className:"s-btn",disabled:a||u||!!f,onClick:()=>{j("manual")},children:u?"Refreshing...":"Refresh"})]})]}),g&&t&&i.jsxs("div",{className:"sys-banner sys-banner-warning",children:[i.jsx("strong",{children:"Refresh failed."}),i.jsx("span",{children:g})]}),H&&i.jsxs("div",{className:"sys-banner sys-banner-warning",children:[i.jsx("strong",{children:"Identity error."}),i.jsx("span",{children:H})]}),a&&!t&&i.jsx(it,{title:"Loading settings",body:"Checking relay status and trusted peers."}),St&&i.jsx(it,{className:"sys-state-card-error",title:"Pairing unavailable",body:g,action:i.jsx("button",{type:"button",className:"s-btn",onClick:()=>{j("manual")},children:"Try again"})}),i.jsxs("div",{className:"sys-settings-hero",children:[i.jsx("div",{className:"sys-settings-qr-col",children:et?i.jsxs("div",{className:"sys-settings-qr-frame",children:[i.jsx("div",{className:"s-qr",dangerouslySetInnerHTML:{__html:et}}),st&&i.jsxs("span",{className:"sys-settings-qr-expires",children:["Expires in ",st]})]}):i.jsx("div",{className:"sys-settings-qr-empty",children:i.jsx("span",{className:"sys-settings-qr-empty-label",children:"Generating QR..."})})}),i.jsxs("div",{className:"sys-settings-info-col",children:[i.jsxs("div",{className:"sys-input-row",children:[i.jsx("input",{className:"sys-input",type:"text",placeholder:"Your name",value:s,onChange:l=>n(l.target.value),onKeyDown:l=>{l.key==="Enter"&&rt&&!p&&tt()}}),i.jsx("button",{type:"button",className:"s-btn s-btn-primary",disabled:!rt||p,onClick:()=>{tt()},children:p?"Saving...":"Save"})]}),i.jsxs("div",{className:"sys-settings-kv-list",children:[t?.identityFingerprint&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Fingerprint"}),i.jsxs("span",{className:"sys-settings-kv-value",children:[i.jsx("code",{children:t.identityFingerprint}),i.jsx(D,{value:t.identityFingerprint})]})]}),F&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Relay"}),i.jsxs("span",{className:"sys-settings-kv-value",children:[i.jsx("code",{children:F}),i.jsx(D,{value:F})]})]}),kt&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Links"}),i.jsxs("span",{className:"sys-settings-kv-value sys-settings-link-list",children:[y.lan&&i.jsx($,{label:"LAN",value:y.lan}),y.tailnet&&i.jsx($,{label:"TSN",value:y.tailnet}),!y.lan&&!y.tailnet&&y.default&&i.jsx($,{label:"PAIR",value:y.default})]})]}),t?.statusDetail&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Status"}),i.jsx("span",{className:"sys-settings-kv-value sys-settings-kv-nowrap",children:t.statusDetail})]}),nt&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Connected"}),i.jsx("span",{className:"sys-settings-kv-value",children:nt})]}),t?.secure&&i.jsxs("div",{className:"sys-settings-kv",children:[i.jsx("span",{className:"sys-settings-kv-label",children:"Security"}),i.jsx("span",{className:"sys-settings-kv-value",children:i.jsx(B,{tone:"success",children:"Noise XX"})})]})]}),t&&i.jsx("div",{className:"sys-inline-actions sys-settings-controls",children:t.isRunning?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"s-btn",disabled:!!f,onClick:()=>{S("restart")},children:f==="restart"?"Restarting...":"Restart"}),i.jsx("button",{type:"button",className:"s-btn",disabled:!!f,onClick:()=>{S("stop")},children:f==="stop"?"Stopping...":"Stop"})]}):i.jsx("button",{type:"button",className:"s-btn s-btn-primary",disabled:!!f,onClick:()=>{S("start")},children:f==="start"?"Starting...":"Start pairing"})})]})]}),t&&i.jsxs("section",{className:"sys-settings-peers",id:"trusted-peers",children:[i.jsx("div",{className:"sys-section-head",children:i.jsxs("div",{children:[i.jsx("h3",{className:"sys-section-title",children:"Trusted peers"}),i.jsxs("p",{className:"sys-section-subtitle",children:[t.trustedPeers.length," device",t.trustedPeers.length!==1?"s":""," paired with this broker."]})]})}),t.trustedPeers.length===0?i.jsxs("div",{className:"sys-list-empty",children:[i.jsx("h3",{children:"No trusted peers"}),i.jsx("p",{children:"Devices appear here after completing pairing."})]}):i.jsxs("table",{className:"sys-peers-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Device"}),i.jsx("th",{children:"Fingerprint"}),i.jsx("th",{children:"Paired"}),i.jsx("th",{children:"Last seen"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:t.trustedPeers.map(l=>{const v=l.fingerprint===t.connectedPeerFingerprint;return i.jsxs("tr",{className:v?"sys-peers-row-connected":"",children:[i.jsx("td",{children:i.jsxs("span",{className:"sys-peers-name",children:[l.name??ut(l.fingerprint)??"Peer",v&&i.jsx(B,{tone:"success",className:"sys-peers-badge",children:"Connected"})]})}),i.jsx("td",{children:i.jsx("code",{className:"sys-peers-fp",children:l.fingerprint})}),i.jsx("td",{children:l.pairedAtLabel??"—"}),i.jsx("td",{children:l.lastSeenLabel??"—"}),i.jsx("td",{children:i.jsx("button",{type:"button",className:"sys-peers-remove",disabled:W===l.fingerprint,onClick:()=>{Et(l.fingerprint)},title:"Remove peer",children:W===l.fingerprint?"...":"Remove"})})]},l.fingerprint)})})]})]})]})}export{As as SettingsScreen};