@microvac/ui 0.1.0-rc.14 → 0.1.0-rc.15

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 (280) hide show
  1. package/dist/assets/{ActiveAgentsPanel-C9AP9hJu.js → ActiveAgentsPanel-BEx06tMt.js} +1 -1
  2. package/dist/assets/{AdapterManager-CmxTUKJH.js → AdapterManager-3kEEQWFJ.js} +1 -1
  3. package/dist/assets/{AdvancedToolsRoute-CXsQnTei.js → AdvancedToolsRoute-CgS6B-oh.js} +1 -1
  4. package/dist/assets/{AgentActionButtons-DWq2OuVK.js → AgentActionButtons-Cz3jCEd7.js} +1 -1
  5. package/dist/assets/{AgentAdvancedTab-dhBDxF-H.js → AgentAdvancedTab-BG6ZIAuN.js} +1 -1
  6. package/dist/assets/{AgentBulkSettingsSheet-DYT4ovDg.js → AgentBulkSettingsSheet-BrrbvspS.js} +1 -1
  7. package/dist/assets/{AgentChat-r0TPOfPK.js → AgentChat-Dw9iXD6H.js} +1 -1
  8. package/dist/assets/{AgentDetailPage-Bc_okBuS.js → AgentDetailPage-CuVIHv_q.js} +3 -3
  9. package/dist/assets/{AgentIdentityChip-CB2NBXkZ.js → AgentIdentityChip-BrVCcuHQ.js} +1 -1
  10. package/dist/assets/{AgentRosterFilters-b7qMLv8-.js → AgentRosterFilters-GQ2bdXfW.js} +2 -2
  11. package/dist/assets/{Agents-BsvXy3pZ.js → Agents-clrVQnvc.js} +2 -2
  12. package/dist/assets/{Agents.production-BeOZmzaF.js → Agents.production-DTopo7XB.js} +2 -2
  13. package/dist/assets/{AnimatedDialogContent-CWshmxP2.js → AnimatedDialogContent-CDLfw-dJ.js} +1 -1
  14. package/dist/assets/{AppDetail-DbqENTF_.js → AppDetail-BcWBg5yW.js} +1 -1
  15. package/dist/assets/{AppNotConnected-BhnCqL0F.js → AppNotConnected-NgfyHZ4L.js} +1 -1
  16. package/dist/assets/{ApprovalDetail-B2KiYLTj.js → ApprovalDetail-Dm_1V4tC.js} +1 -1
  17. package/dist/assets/{Approvals-j-wRmqKj.js → Approvals-i5AB3JPj.js} +1 -1
  18. package/dist/assets/{AppsConnect-CcPVEZ0C.js → AppsConnect-D660Tpuo.js} +1 -1
  19. package/dist/assets/{AppsReview-B8eWvKkS.js → AppsReview-DdTqOisY.js} +1 -1
  20. package/dist/assets/{ArtifactEmptyGraphic-5mdkS5jj.js → ArtifactEmptyGraphic-DzxCruYA.js} +1 -1
  21. package/dist/assets/{Artifacts-Bz7Oo6VX.js → Artifacts-CkXBz6nh.js} +1 -1
  22. package/dist/assets/{AssigneePickerInner-DdpF7hck.js → AssigneePickerInner-BNjyABBe.js} +1 -1
  23. package/dist/assets/{AssistantConnection-BpaaJDc_.js → AssistantConnection-CNF6mDmO.js} +1 -1
  24. package/dist/assets/{AttentionInlineVerbs-DlPQVCO-.js → AttentionInlineVerbs-BiyZ1ekZ.js} +1 -1
  25. package/dist/assets/{AttentionQueueRow-BC6ezctS.js → AttentionQueueRow-Bh0dKHpF.js} +1 -1
  26. package/dist/assets/{AuditHub-BVP7LKL9.js → AuditHub-BK848cb4.js} +1 -1
  27. package/dist/assets/{AuditRuns-DqizHgX1.js → AuditRuns-CUdlbP7S.js} +1 -1
  28. package/dist/assets/{Auth-DOF0snjp.js → Auth-DDqxm5gD.js} +1 -1
  29. package/dist/assets/{BoardChat-BYAbDtfd.js → BoardChat-fvKqk0R7.js} +1 -1
  30. package/dist/assets/{BoardClaim-7y41Pr8e.js → BoardClaim-BEC5BZfz.js} +1 -1
  31. package/dist/assets/{BootstrapSetupUxLab-BftH1vOv.js → BootstrapSetupUxLab-CXzErrin.js} +1 -1
  32. package/dist/assets/{Browse-Ck01W1Yl.js → Browse-DoovSMuF.js} +1 -1
  33. package/dist/assets/{BudgetPolicyCard-CKhrzfgy.js → BudgetPolicyCard-BYMlczCq.js} +1 -1
  34. package/dist/assets/{CaseDetail-qlXKJ66D.js → CaseDetail-UMAcSH_x.js} +1 -1
  35. package/dist/assets/{CaseStatus-B3RiZVDH.js → CaseStatus-BI0aMl9l.js} +1 -1
  36. package/dist/assets/{Cases-CFV3V-5X.js → Cases-CMTkGghU.js} +1 -1
  37. package/dist/assets/{ChatEndpointDetail-7Hi5TJNt.js → ChatEndpointDetail-CocNEInH.js} +1 -1
  38. package/dist/assets/{ChatEndpointSetup-CtwgH6sg.js → ChatEndpointSetup-Cyi2tI9K.js} +1 -1
  39. package/dist/assets/{ChatIdentityConfirm-CXjksBwX.js → ChatIdentityConfirm-Ba3JuTX1.js} +1 -1
  40. package/dist/assets/{CliAuth-KVjrGMfZ.js → CliAuth-D2jnueGH.js} +1 -1
  41. package/dist/assets/{Companies-oeJem3De.js → Companies-K75I9dJs.js} +1 -1
  42. package/dist/assets/{CompanyAccess-vWT6G-n_.js → CompanyAccess-Cw6nLUhE.js} +1 -1
  43. package/dist/assets/{CompanyActivity-zOzzeN1B.js → CompanyActivity-BsgmVpWS.js} +1 -1
  44. package/dist/assets/CompanyActivity.production-w-KGxvo6.js +1 -0
  45. package/dist/assets/{CompanyConnections-llSEaVa2.js → CompanyConnections-yRPYSdm7.js} +1 -1
  46. package/dist/assets/{CompanyEnvironments-DNyyGC_S.js → CompanyEnvironments-BA7kWdOJ.js} +1 -1
  47. package/dist/assets/{CompanyExport-CFa-F8Es.js → CompanyExport-DfsK4b9c.js} +1 -1
  48. package/dist/assets/{CompanyImport-DG6qwQ8F.js → CompanyImport-DJHAsmSF.js} +1 -1
  49. package/dist/assets/{CompanySettings-Dv5Z3ZQi.js → CompanySettings-DwzHGXec.js} +1 -1
  50. package/dist/assets/{CompanySettingsPluginPage-CZk1d_0d.js → CompanySettingsPluginPage-Bpa81PF3.js} +1 -1
  51. package/dist/assets/{CompanySkills-CdzWhJfQ.js → CompanySkills-eTqgbqQN.js} +1 -1
  52. package/dist/assets/{CompanySkills.production-IoCRW5FQ.js → CompanySkills.production-CQSWfH0r.js} +1 -1
  53. package/dist/assets/{ConfigureBuiltInAgentModal-BwW7XQ1O.js → ConfigureBuiltInAgentModal-DgeD7t_i.js} +1 -1
  54. package/dist/assets/{CopyableGatewayUrl-PTn061ft.js → CopyableGatewayUrl-B6K3rOal.js} +1 -1
  55. package/dist/assets/{CordisPluginSettings-C_BeeGEc.js → CordisPluginSettings-DD3AnD2G.js} +1 -1
  56. package/dist/assets/{Costs-DhuNxwSj.js → Costs-orBM8T-a.js} +1 -1
  57. package/dist/assets/{CrossIssueCollaborationUxLab-ZaAXq46r.js → CrossIssueCollaborationUxLab-Bv9y9-NE.js} +1 -1
  58. package/dist/assets/{Dashboard-BaDnqiKo.js → Dashboard-CrSBNKX1.js} +1 -1
  59. package/dist/assets/{DashboardLive-D-Ed7osd.js → DashboardLive-Cg8C9RiS.js} +1 -1
  60. package/dist/assets/{DecisionDateChips-D3pl_mLn.js → DecisionDateChips-BLZKZH71.js} +1 -1
  61. package/dist/assets/{DecisionHistoryPanel-D5MzyrOh.js → DecisionHistoryPanel-yK-CP7Qg.js} +1 -1
  62. package/dist/assets/{DecisionQueuePage-D3UZ9oRk.js → DecisionQueuePage-BKXbERai.js} +1 -1
  63. package/dist/assets/{DesignGuide-COTo7ICj.js → DesignGuide-2FswNsXz.js} +1 -1
  64. package/dist/assets/{DesignSandboxTaskThread-CMeCSQid.js → DesignSandboxTaskThread-CGU--FXR.js} +1 -1
  65. package/dist/assets/{EmailConnectionAccess-kCL7obSr.js → EmailConnectionAccess-CZ5QRKyg.js} +1 -1
  66. package/dist/assets/{EmailEndpointSetup-BGrksR_u.js → EmailEndpointSetup-BI2vsd8Y.js} +1 -1
  67. package/dist/assets/{EnforcementBanner-_Eb_nK3M.js → EnforcementBanner-B-iX466h.js} +1 -1
  68. package/dist/assets/{EntityRow-gpsOgEtu.js → EntityRow-BsICt6pd.js} +1 -1
  69. package/dist/assets/{ExecutionWorkspaceDetail-DwGkH6d3.js → ExecutionWorkspaceDetail-CMqR9puh.js} +1 -1
  70. package/dist/assets/{ExternalAgentInviteDialog-CGid6pM9.js → ExternalAgentInviteDialog-De30ZrLP.js} +1 -1
  71. package/dist/assets/{FilterBar-1D-VhrvG.js → FilterBar-rCmsTtG4.js} +1 -1
  72. package/dist/assets/{FolderControls-CQ6kef3c.js → FolderControls-CmnB7Ap-.js} +1 -1
  73. package/dist/assets/{GatewayDetail-CCqekM1J.js → GatewayDetail-Duw9pJ10.js} +1 -1
  74. package/dist/assets/{GatewaysList-nFsRcszh.js → GatewaysList-BBhVGhRq.js} +1 -1
  75. package/dist/assets/{GitHubConnectionRecovery-B9sFWJup.js → GitHubConnectionRecovery-6VshLoNV.js} +1 -1
  76. package/dist/assets/{GoalDetail-BQ8y55P-.js → GoalDetail-CahntjlI.js} +1 -1
  77. package/dist/assets/{GoalTree-laRjXp0P.js → GoalTree-CU4GBFCh.js} +1 -1
  78. package/dist/assets/{Goals-Cm14EaeP.js → Goals-CzM2NDFR.js} +1 -1
  79. package/dist/assets/{InstanceAccess-DxQ-Akt_.js → InstanceAccess-CZzkE65W.js} +1 -1
  80. package/dist/assets/{InstanceExperimentalSettings-BxwqbXNw.js → InstanceExperimentalSettings-DWumKtOK.js} +1 -1
  81. package/dist/assets/{InviteLanding-Cf0L_u6s.js → InviteLanding-BIy2z50u.js} +1 -1
  82. package/dist/assets/{IssueChatLongThreadPerf-BfsF6FdF.js → IssueChatLongThreadPerf-D4DJvdOG.js} +1 -1
  83. package/dist/assets/{JoinRequestQueue-BXCdTFG_.js → JoinRequestQueue-C5rauGYm.js} +1 -1
  84. package/dist/assets/{Layout.production-CqzU0qMi.js → Layout.production-BSDWnupa.js} +1 -1
  85. package/dist/assets/{McpConnect-COWnZ9Eb.js → McpConnect-BN8ST0RS.js} +1 -1
  86. package/dist/assets/{MembershipAction-C9i9Sdmi.js → MembershipAction-DTjhGn-L.js} +1 -1
  87. package/dist/assets/{MetricCard-Bwnt3_p3.js → MetricCard-CeL9Pdn5.js} +1 -1
  88. package/dist/assets/{MissingPluginTabPlaceholder-B0Zxv1Kx.js → MissingPluginTabPlaceholder-CbQiSVnZ.js} +1 -1
  89. package/dist/assets/{NewAgent-BIlJ5Dyt.js → NewAgent-BszrNpQk.js} +1 -1
  90. package/dist/assets/{NewAgentDialog-CJdMxxYL.js → NewAgentDialog-U9qAcTzc.js} +1 -1
  91. package/dist/assets/{NewGoalDialog-B8izfKLm.js → NewGoalDialog-DqKbk4-i.js} +1 -1
  92. package/dist/assets/{NewProjectDialog-DXqjTYFK.js → NewProjectDialog-DrlUAF-N.js} +1 -1
  93. package/dist/assets/{OnboardingPrimitives-DHYBqn_0.js → OnboardingPrimitives-BkgPF4Mu.js} +1 -1
  94. package/dist/assets/{OnboardingWizard-DqSfZ13V.js → OnboardingWizard-CMBMcuXv.js} +1 -1
  95. package/dist/assets/{OrgChart.production-DrSFUf7i.js → OrgChart.production-BLczTjRj.js} +1 -1
  96. package/dist/assets/{PaperclipCloudOAuthHandoff-jPUvjJ8q.js → PaperclipCloudOAuthHandoff-BTtF8UPD.js} +1 -1
  97. package/dist/assets/{PluginManager-h3LFPaUq.js → PluginManager-CCcqlfgK.js} +1 -1
  98. package/dist/assets/{PluginPage-E5Im4454.js → PluginPage-B1empV69.js} +1 -1
  99. package/dist/assets/{PluginSettings-BBO0jAgo.js → PluginSettings-DtopaRqR.js} +1 -1
  100. package/dist/assets/{ProfileDetailRoute-CQBD7fms.js → ProfileDetailRoute-BqvVpBZi.js} +1 -1
  101. package/dist/assets/{ProfileSettings-BwnVEHLp.js → ProfileSettings-5__tVfGi.js} +1 -1
  102. package/dist/assets/{ProfileWizardRoute-By_SC6Gn.js → ProfileWizardRoute-vt-MRLuD.js} +1 -1
  103. package/dist/assets/{ProjectDetail-CbiwFBAE.js → ProjectDetail-DJ4zjube.js} +1 -1
  104. package/dist/assets/{ProjectRepositoryInput-DZF9bX4E.js → ProjectRepositoryInput-BJcnj3At.js} +1 -1
  105. package/dist/assets/{ProjectWorkspaceDetail-DPsl_4bD.js → ProjectWorkspaceDetail-DEAO3q6v.js} +1 -1
  106. package/dist/assets/{ProjectWorkspacesContent-COH4dOWK.js → ProjectWorkspacesContent-CZvO7p0i.js} +1 -1
  107. package/dist/assets/{Projects-Ch9Qu7sn.js → Projects-Dm7-zXUH.js} +1 -1
  108. package/dist/assets/{QuotaBar-DIFOT9Uh.js → QuotaBar-Drp3CaxX.js} +1 -1
  109. package/dist/assets/{RepositoryEditor-DHB1bqId.js → RepositoryEditor-BT_VAkJu.js} +1 -1
  110. package/dist/assets/{Responsibilities-C5O0JXXG.js → Responsibilities-DbUEtGZu.js} +1 -1
  111. package/dist/assets/{ResponsibilityDetail-D6NpZpkm.js → ResponsibilityDetail--S8_GOkb.js} +1 -1
  112. package/dist/assets/{ResponsibleUserDenialUxLab-CFrIWYwe.js → ResponsibleUserDenialUxLab-1PB3JNG0.js} +1 -1
  113. package/dist/assets/{ReviewQueueCard-BPC4Lm67.js → ReviewQueueCard-B8w9aXKU.js} +1 -1
  114. package/dist/assets/{RoutineAuditActivity-sKyzMajz.js → RoutineAuditActivity-BCo7pYe5.js} +1 -1
  115. package/dist/assets/{RoutineDetail-CG8HF5fp.js → RoutineDetail-C9Dwn5G9.js} +1 -1
  116. package/dist/assets/{RoutineRunVariablesDialog-CKh3CmLD.js → RoutineRunVariablesDialog-Baomcbe3.js} +1 -1
  117. package/dist/assets/{Routines-tF2qfUKo.js → Routines-Dkv4gJno.js} +1 -1
  118. package/dist/assets/{Routines.production-BTyj1Ljr.js → Routines.production-Cs2Y-lpt.js} +1 -1
  119. package/dist/assets/{RoutinesToolbar-CvUFVCGN.js → RoutinesToolbar-BNKfCrTo.js} +1 -1
  120. package/dist/assets/{Search-Z9D0NuS1.js → Search-CVx4cl2o.js} +1 -1
  121. package/dist/assets/{Secrets-DgmbLOJK.js → Secrets-C2qv2HKZ.js} +1 -1
  122. package/dist/assets/{SkillBinaryFile-F3_9qcaM.js → SkillBinaryFile-DDkhLlfC.js} +1 -1
  123. package/dist/assets/{SkillCardIcon-CXHUCMej.js → SkillCardIcon-Cp_hws0N.js} +1 -1
  124. package/dist/assets/{SkillFolderTree-CB3lrTIE.js → SkillFolderTree-Cv0CmfYx.js} +1 -1
  125. package/dist/assets/{SkillSourceTree-BbuciCo6.js → SkillSourceTree-DmjlUswf.js} +1 -1
  126. package/dist/assets/{SkillSources-Dlo6Cew3.js → SkillSources-nmlYypUU.js} +1 -1
  127. package/dist/assets/{SkillStudio-ZO-Nf7eI.js → SkillStudio-BK3y_3zr.js} +1 -1
  128. package/dist/assets/{SkillsNavigationTabs-B9Iqnlqt.js → SkillsNavigationTabs-DRwMP1eu.js} +1 -1
  129. package/dist/assets/{SpekoPhoneCallback-C4VnMiZh.js → SpekoPhoneCallback-Cqi7AIyH.js} +1 -1
  130. package/dist/assets/{SpekoProviderSetup-I4evPZb3.js → SpekoProviderSetup-CJI4oXk5.js} +1 -1
  131. package/dist/assets/{StatusCards-D0MVzbsw.js → StatusCards-DKyyY81S.js} +1 -1
  132. package/dist/assets/{SummarySlotCard-DUXgZPxG.js → SummarySlotCard-f3RomdZS.js} +1 -1
  133. package/dist/assets/{TailscaleConnector-CMhT73gj.js → TailscaleConnector-yQWLR1Ra.js} +1 -1
  134. package/dist/assets/{TaskChatLab-D9-KAE-7.js → TaskChatLab-Dsr7eyj4.js} +1 -1
  135. package/dist/assets/{TaskSummaryList-CUxieFNe.js → TaskSummaryList-eFDfK_QH.js} +1 -1
  136. package/dist/assets/{Timeline-BNMoRbtK.js → Timeline-BWA9dyk6.js} +1 -1
  137. package/dist/assets/{ToolsAdminGate-CEr0zy2T.js → ToolsAdminGate-DpBg30hQ.js} +1 -1
  138. package/dist/assets/{TrustPresetSection-B9YXZtkh.js → TrustPresetSection-DtWjK9Kp.js} +1 -1
  139. package/dist/assets/{UserProfile-D-tnW96X.js → UserProfile-C66UI5xx.js} +1 -1
  140. package/dist/assets/{WebhookUrlWarning-Ba_DixKh.js → WebhookUrlWarning-CDygVnDH.js} +1 -1
  141. package/dist/assets/{WhatNeedsMe-B-Jzj8_M.js → WhatNeedsMe-BQ82RHus.js} +1 -1
  142. package/dist/assets/{Workspaces-BqhDI_Bl.js → Workspaces-DrjJes30.js} +1 -1
  143. package/dist/assets/{abnfDiagram-YUKMZFIV-Bn9P-nUW.js → abnfDiagram-YUKMZFIV-Crkksu2D.js} +1 -1
  144. package/dist/assets/{architecture-WOLXFQ4H-V1ldsZlt.js → architecture-WOLXFQ4H-bHU8FW0c.js} +1 -1
  145. package/dist/assets/{architectureDiagram-47P4ROYG-BkYxt-Gc.js → architectureDiagram-47P4ROYG-Bj5Styf9.js} +1 -1
  146. package/dist/assets/{arrow-down-left-o81ENfeW.js → arrow-down-left-Ck9VQyqQ.js} +1 -1
  147. package/dist/assets/{blockDiagram-E7TT5TSB-BO7pPYbp.js → blockDiagram-E7TT5TSB-OeHpNCQ-.js} +1 -1
  148. package/dist/assets/{budgets-0Dw6TH1A.js → budgets-CAWPqcn4.js} +1 -1
  149. package/dist/assets/{building-complex-DciZTnys.js → building-complex-Dxiyk_pH.js} +1 -1
  150. package/dist/assets/{c4Diagram-CRA5TL53-D4EpmmzV.js → c4Diagram-CRA5TL53-QbK5p76P.js} +1 -1
  151. package/dist/assets/channel-BSmZkKA8.js +1 -0
  152. package/dist/assets/{chat-channels-DWyry-9M.js → chat-channels-CzTZV2fr.js} +1 -1
  153. package/dist/assets/{chunk-2BW5OAIV-DFXIyCJy.js → chunk-2BW5OAIV-Ckr4HfBO.js} +1 -1
  154. package/dist/assets/{chunk-3YJQHVM4-Dj5wEKIw.js → chunk-3YJQHVM4-C_uoPpLR.js} +1 -1
  155. package/dist/assets/{chunk-4EA7E6EY-5XiUVgzK.js → chunk-4EA7E6EY-BeMEfIRS.js} +1 -1
  156. package/dist/assets/{chunk-7TKQ45FW-D0opKcsy.js → chunk-7TKQ45FW-DiwqWHvN.js} +1 -1
  157. package/dist/assets/{chunk-AW2ZBBNX-DnjsTe04.js → chunk-AW2ZBBNX-Cf57K3PO.js} +1 -1
  158. package/dist/assets/{chunk-DBDB3WZW-DNqSQPZ0.js → chunk-DBDB3WZW-B2qouVQO.js} +1 -1
  159. package/dist/assets/{chunk-E2ZNV5FY-cjSf_BTz.js → chunk-E2ZNV5FY-DG8wQ_NS.js} +1 -1
  160. package/dist/assets/{chunk-EU5HNXII-CZYBiaSw.js → chunk-EU5HNXII-cxRrXRGV.js} +1 -1
  161. package/dist/assets/{chunk-FVRAUYC3-DSc0-wJA.js → chunk-FVRAUYC3-Dizswk0V.js} +1 -1
  162. package/dist/assets/{chunk-HJ2JQQFS-MXK0gYSP.js → chunk-HJ2JQQFS-DL4lnpSv.js} +1 -1
  163. package/dist/assets/{chunk-HTAEGDNF-BjDZm_5k.js → chunk-HTAEGDNF-Zxjdb6kj.js} +1 -1
  164. package/dist/assets/{chunk-KQW6MTUR-Bfj0tDmO.js → chunk-KQW6MTUR-BsVaJdnu.js} +1 -1
  165. package/dist/assets/{chunk-NTY3LDVX-Bpz5TkVb.js → chunk-NTY3LDVX-DyT9N5sM.js} +1 -1
  166. package/dist/assets/{chunk-VPRB5NB3-CfeHjtbb.js → chunk-VPRB5NB3-BNz5CtBn.js} +1 -1
  167. package/dist/assets/{chunk-XC4XBNZT-FBCWmi6K.js → chunk-XC4XBNZT-CCgIhjYS.js} +1 -1
  168. package/dist/assets/{circle-slash-DqKFFqfb.js → circle-slash-uNv_ha0X.js} +1 -1
  169. package/dist/assets/{classDiagram-v2-K4WV4PDN-DbC_J0kK.js → classDiagram-v2-K4WV4PDN-Cdh3CEl4.js} +1 -1
  170. package/dist/assets/{coins-BztUbqyl.js → coins-BDAh8hDQ.js} +1 -1
  171. package/dist/assets/{collections-BxrcELwt.js → collections-B58p51lw.js} +1 -1
  172. package/dist/assets/{connection-owner-D-ikSHyR.js → connection-owner-D8fNrFqC.js} +1 -1
  173. package/dist/assets/{cynefin-EF2NZ3EQ-COwSJ4qP.js → cynefin-EF2NZ3EQ-BkwhfqJ0.js} +1 -1
  174. package/dist/assets/{cynefinDiagram-3GCD6N5R-diaEJq9Y.js → cynefinDiagram-3GCD6N5R-DuGb_wq2.js} +1 -1
  175. package/dist/assets/{dagre-W4DXFKR2-BPAMRuIj.js → dagre-W4DXFKR2-Bxq_Mhia.js} +1 -1
  176. package/dist/assets/{diagram-2UJZ2QOL-BvRnO1Id.js → diagram-2UJZ2QOL-B-P_hrXV.js} +1 -1
  177. package/dist/assets/{diagram-OVF4WLC6-CDgBeD0m.js → diagram-OVF4WLC6-Ds0BqQWH.js} +1 -1
  178. package/dist/assets/{diagram-PFPMY2P6-DAw9lREG.js → diagram-PFPMY2P6-Dpqb2-Cb.js} +1 -1
  179. package/dist/assets/{diagram-UMYRVEAY-ZQqQn22t.js → diagram-UMYRVEAY-BJSoxjiu.js} +1 -1
  180. package/dist/assets/{diagram-YEKJPTXX-CoJtGgWs.js → diagram-YEKJPTXX-BxaG_9tT.js} +1 -1
  181. package/dist/assets/{diagram-ZIFT7M5P-qW_Zn_bO.js → diagram-ZIFT7M5P-6acvVOtc.js} +1 -1
  182. package/dist/assets/{dist-B2E6oBK1.js → dist-0EWXio4m.js} +1 -1
  183. package/dist/assets/{dist-IcdxEhjC.js → dist-BGvZP_Cl.js} +1 -1
  184. package/dist/assets/{dist-DXjkgaZX.js → dist-BZ7AbEhN.js} +1 -1
  185. package/dist/assets/{dist-_EtfntKJ.js → dist-BlosHr86.js} +1 -1
  186. package/dist/assets/{dist-DylHAy-6.js → dist-Bmr4uhSk.js} +1 -1
  187. package/dist/assets/{dist-DML0cJH3.js → dist-C6yMfMNS.js} +1 -1
  188. package/dist/assets/{dist-Dl94YqeS.js → dist-CMZQedYl.js} +1 -1
  189. package/dist/assets/{dist-DKyBHaH2.js → dist-C_N_-eaT.js} +1 -1
  190. package/dist/assets/{dist-CvRpZH53.js → dist-CaUbG4Hl.js} +1 -1
  191. package/dist/assets/{dist-ptDa9fKh.js → dist-Cn7-nxjU.js} +1 -1
  192. package/dist/assets/{dist-CG-phytt.js → dist-Cnj95_pX.js} +1 -1
  193. package/dist/assets/{dist-DbXGl-wj.js → dist-D9DR7k9k.js} +1 -1
  194. package/dist/assets/{dist-CjRqeLFz.js → dist-DIwsVdS2.js} +1 -1
  195. package/dist/assets/{dist-BCJybC91.js → dist-DVE0lLId.js} +1 -1
  196. package/dist/assets/{dist-CPgRB-NQ.js → dist-DkAPL4CQ.js} +1 -1
  197. package/dist/assets/{dist-CeSzCyeG.js → dist-Dl6N3kpQ.js} +1 -1
  198. package/dist/assets/{dist-DZruZxAk.js → dist-DmBvXBzK.js} +1 -1
  199. package/dist/assets/{dist-CdmdXwCZ.js → dist-DpgXK0aZ.js} +1 -1
  200. package/dist/assets/{dist-CYRzGbSY.js → dist-gMRyU9GJ.js} +1 -1
  201. package/dist/assets/{dist-CG6fC1Db.js → dist-jQQX2kOU.js} +1 -1
  202. package/dist/assets/{dist-DZIxMHOT.js → dist-lUaUoFTq.js} +1 -1
  203. package/dist/assets/{dist-CuwPDbnL.js → dist-qw1ZF2vD.js} +1 -1
  204. package/dist/assets/{dist-B6Qde8KJ.js → dist-rH4qrNAn.js} +1 -1
  205. package/dist/assets/{ebnfDiagram-VR2GEFS7-DA4UvKXV.js → ebnfDiagram-VR2GEFS7-Ytj3Z5qC.js} +1 -1
  206. package/dist/assets/{elk-IJKZMXRS-CM74d3mJ.js → elk-IJKZMXRS-CJurNqqK.js} +1 -1
  207. package/dist/assets/{erDiagram-O2IAPWRE-d869V0qL.js → erDiagram-O2IAPWRE-hyXckW2d.js} +1 -1
  208. package/dist/assets/{eventmodeling-K75KTNOO-C-oz_eyI.js → eventmodeling-K75KTNOO-D3xQujrh.js} +1 -1
  209. package/dist/assets/flowDiagram-OXPTDLAJ-D4ojBTuY.js +1 -0
  210. package/dist/assets/{folder-plus-CxWXoYCi.js → folder-plus-BJZSMzuj.js} +1 -1
  211. package/dist/assets/{ganttDiagram-R7TSEDQI-BBul4Kpm.js → ganttDiagram-R7TSEDQI-C8U_ITl4.js} +1 -1
  212. package/dist/assets/{gitGraph-VSP46ZUC-BriEZgAq.js → gitGraph-VSP46ZUC-CDeq3yKT.js} +1 -1
  213. package/dist/assets/{gitGraphDiagram-XJZIOB7I-I12rg8s1.js → gitGraphDiagram-XJZIOB7I-CST3EWE9.js} +1 -1
  214. package/dist/assets/{goals-CvMWzjH4.js → goals-BNJZ4nzg.js} +1 -1
  215. package/dist/assets/{index-Bt31d8ga.js → index-BJtnP7H1.js} +8 -8
  216. package/dist/assets/{info-OHQRW6UA-CxrcGiem.js → info-OHQRW6UA-CPvTWk7J.js} +1 -1
  217. package/dist/assets/{infoDiagram-5W2HQ5XZ-4Sm0LiOu.js → infoDiagram-5W2HQ5XZ-BPUiNdxI.js} +1 -1
  218. package/dist/assets/{ishikawaDiagram-K3B6WC7H-CKXvKV-s.js → ishikawaDiagram-K3B6WC7H-D5Z3rmaA.js} +1 -1
  219. package/dist/assets/{issue-detail-4PCbYpdv.js → issue-detail-CZfjXs0M.js} +3 -3
  220. package/dist/assets/{journeyDiagram-COXZFDF6-BHsrZLvQ.js → journeyDiagram-COXZFDF6-CEkwEYdR.js} +1 -1
  221. package/dist/assets/{kanban-definition-P3RFRI5V-8HhnIs_l.js → kanban-definition-P3RFRI5V-8h_R6Qjq.js} +1 -1
  222. package/dist/assets/{line-rrKrpB-b.js → line-Ljt_vfsb.js} +1 -1
  223. package/dist/assets/{link-BecLzmfo.js → link-DvgFK0mz.js} +1 -1
  224. package/dist/assets/{list-filter-BC3D4IoX.js → list-filter-BR4_dvwm.js} +1 -1
  225. package/dist/assets/{log-in-BJCGwGGT.js → log-in-Dvx9-FMC.js} +1 -1
  226. package/dist/assets/{mcpSkills-DRs3pGKn.js → mcpSkills-76szK_k1.js} +1 -1
  227. package/dist/assets/{mermaid-parser.core-DmG0b4S0.js → mermaid-parser.core-BjFu937m.js} +3 -3
  228. package/dist/assets/{mermaid.core-D1vILTuF.js → mermaid.core-B0t95EIS.js} +4 -4
  229. package/dist/assets/{mindmap-definition-LZFPQGKD-DIMpL0de.js → mindmap-definition-LZFPQGKD-TVnHYUR4.js} +1 -1
  230. package/dist/assets/{packet-JDAUHWVQ-BnbYht3G.js → packet-JDAUHWVQ-aNGiRWLy.js} +1 -1
  231. package/dist/assets/{pegDiagram-BGZESJAR-BUjtJVjT.js → pegDiagram-BGZESJAR-DDadxqWQ.js} +1 -1
  232. package/dist/assets/{pie-XZMESJXO-CM4VXUb-.js → pie-XZMESJXO-CydFP1hd.js} +1 -1
  233. package/dist/assets/{pieDiagram-CAPJLFHJ-B3v8ryvG.js → pieDiagram-CAPJLFHJ-KhdUDwDS.js} +1 -1
  234. package/dist/assets/{power-0mw59G-l.js → power-sYV-WuqQ.js} +1 -1
  235. package/dist/assets/{profile-summary-B5rPf8v-.js → profile-summary-D4LPX-Dv.js} +1 -1
  236. package/dist/assets/{quadrantDiagram-GDMTTRAM-Cv-dS2Rn.js → quadrantDiagram-GDMTTRAM-B1X8K2Fs.js} +1 -1
  237. package/dist/assets/{radar-ABXABTNO-v6yZj4Fk.js → radar-ABXABTNO-BqodkLpx.js} +1 -1
  238. package/dist/assets/{railroad-I3PHUGI6-D-U8Cs0m.js → railroad-I3PHUGI6-HmRKXDJj.js} +1 -1
  239. package/dist/assets/{railroad-abnf-LNEFI6M7-Dw3fkrVy.js → railroad-abnf-LNEFI6M7-CkBttaHp.js} +1 -1
  240. package/dist/assets/{railroad-ebnf-DWYD2UWJ-_ln-e3Tx.js → railroad-ebnf-DWYD2UWJ-C6DBawFA.js} +1 -1
  241. package/dist/assets/{railroad-peg-JR7BVNR7-Bf8u1-RZ.js → railroad-peg-JR7BVNR7-Z9df3u5o.js} +1 -1
  242. package/dist/assets/{railroadDiagram-SM67HX2B-Drr5UhQI.js → railroadDiagram-SM67HX2B-2vDUUppL.js} +1 -1
  243. package/dist/assets/{requirementDiagram-X7JNWC4A-D5ef6_ac.js → requirementDiagram-X7JNWC4A-DAuP39Hc.js} +1 -1
  244. package/dist/assets/{sankeyDiagram-UM26HJRW-DncJWIz_.js → sankeyDiagram-UM26HJRW-ByS54QZK.js} +1 -1
  245. package/dist/assets/{saved-permissions-CizWg8-P.js → saved-permissions-CPiYtxkZ.js} +1 -1
  246. package/dist/assets/{scroll-text-Ck6HB7eM.js → scroll-text-CVSt6aO2.js} +1 -1
  247. package/dist/assets/{sdk-CWyUlmcn.js → sdk-vrG4HtB4.js} +1 -1
  248. package/dist/assets/{search-DkTqg7ab.js → search-CG-QtPVH.js} +1 -1
  249. package/dist/assets/{send-CYVi50sh.js → send-CH-0xdLm.js} +1 -1
  250. package/dist/assets/{sequenceDiagram-ZO4K6R2Y-Cs0nGCCg.js → sequenceDiagram-ZO4K6R2Y-DvWxKTLK.js} +1 -1
  251. package/dist/assets/{shared-CIwISWMj.js → shared-D37zfckm.js} +1 -1
  252. package/dist/assets/{smoke-lab-matrix-A7ubFpfk.js → smoke-lab-matrix-C5gR81E3.js} +1 -1
  253. package/dist/assets/{stateDiagram-v2-TBUQTH76-Dpp3m5Wq.js → stateDiagram-v2-TBUQTH76-DtiiZIXq.js} +1 -1
  254. package/dist/assets/{swimlanes-N4OXWK64-NXVbx1w8.js → swimlanes-N4OXWK64-BWSEtCbX.js} +1 -1
  255. package/dist/assets/swimlanesDiagram-K3J5GTZL-Bl_9DvHU.js +8 -0
  256. package/dist/assets/{timeline-definition-YOQAKGHF-DqI-Mv2e.js → timeline-definition-YOQAKGHF-U4QcniMh.js} +1 -1
  257. package/dist/assets/{treeView-D4JQ5SDB-CZBlE7ya.js → treeView-D4JQ5SDB-B2tdrtsj.js} +1 -1
  258. package/dist/assets/{treemap-SAJKECNS-BlueznID.js → treemap-SAJKECNS-DodN8j4n.js} +1 -1
  259. package/dist/assets/{useAgentlessOnboardingAutoOpen-CnFwEQ-H.js → useAgentlessOnboardingAutoOpen-DSWW7Juw.js} +1 -1
  260. package/dist/assets/{useAuthorizationWindow-DnFQsiFj.js → useAuthorizationWindow-tg3aKEU7.js} +1 -1
  261. package/dist/assets/{useDateRange-9EbqkWXy.js → useDateRange-CnZQr2KO.js} +1 -1
  262. package/dist/assets/{useFastResponsesEnabled-D8dunm4j.js → useFastResponsesEnabled-B8tHSJ1y.js} +1 -1
  263. package/dist/assets/{usePageView-BiX5i8ck.js → usePageView-CtFMs34g.js} +1 -1
  264. package/dist/assets/{useProfilesData-0VYQ4lAT.js → useProfilesData-CWHdMSuL.js} +1 -1
  265. package/dist/assets/{useReviewCount-WBWxwKI3.js → useReviewCount-W_bCZ2Hz.js} +1 -1
  266. package/dist/assets/{useRoutineFormOptions-DnX5DBn1.js → useRoutineFormOptions-CCLMmVSF.js} +1 -1
  267. package/dist/assets/{useSummaryDraftStream-DPQRvaXT.js → useSummaryDraftStream-NVNYNt72.js} +1 -1
  268. package/dist/assets/{useTailscaleConnections-BDff6dWx.js → useTailscaleConnections-Dy52nCY3.js} +1 -1
  269. package/dist/assets/{usecaseDiagram-VIAY4XPW-BSDn8OaJ.js → usecaseDiagram-VIAY4XPW-kEHhqgOj.js} +1 -1
  270. package/dist/assets/{vennDiagram-BLWOH2XV-BBSA9KNN.js → vennDiagram-BLWOH2XV-NPJU0aCU.js} +1 -1
  271. package/dist/assets/{wardley-7MLQ67FV-CsT-rTZ9.js → wardley-7MLQ67FV-bUGKvIPT.js} +1 -1
  272. package/dist/assets/{wardleyDiagram-YMQ3BMBF-BLClsIjw.js → wardleyDiagram-YMQ3BMBF-qtUDHfhb.js} +1 -1
  273. package/dist/assets/{xychartDiagram-TAQBALBS-2x4wB0gq.js → xychartDiagram-TAQBALBS-C-z57aZj.js} +1 -1
  274. package/dist/index.html +4 -4
  275. package/dist/sw.js +1 -1
  276. package/package.json +1 -1
  277. package/dist/assets/CompanyActivity.production-DbaFBsM0.js +0 -1
  278. package/dist/assets/channel-BQh2vFIU.js +0 -1
  279. package/dist/assets/flowDiagram-OXPTDLAJ-Be1xLbJu.js +0 -1
  280. package/dist/assets/swimlanesDiagram-K3J5GTZL-Ct3LnXZt.js +0 -8
@@ -1 +1 @@
1
- var zs=Object.defineProperty;var n=(s,t)=>zs(s,"name",{value:t,configurable:!0});import{a as fs}from"./rolldown-runtime-DhZMWcEn.js";import{bi as Xe}from"./issue-detail-4PCbYpdv.js";import{$A as Bs,$C as qs,$E as Fs,$S as Ks,$_ as $s,$f as Us,$p as Gs,AT as Fe,Ao as hs,Av as Ws,BC as Ze,BT as Hs,Bv as Vs,Bw as Qs,CT as Xs,Cr as Zs,Cw as Ys,Cx as Js,DC as en,DT as sn,Dv as nn,Dy as Ne,Ei as tn,Ev as Ke,Ew as an,Ex as on,FE as gs,Fb as Ye,Fi as rn,Fr as ln,Fw as cn,GS as _,G_ as we,Gb as J,Gv as dn,Gw as un,HC as pn,H_ as Je,IC as mn,IE as Re,IT as xn,I_ as fn,Ir as hn,Iv as gn,Iy as ee,J_ as bn,Jo as bs,Jp as fe,Jr as vn,Jv as yn,KC as jn,K_ as es,Kb as $e,Kf as Cn,Ko as vs,Kv as ys,Kw as Sn,LS as te,La as Nn,Li as wn,Lr as kn,Lv as In,MD as je,ME as An,MT as Pn,Mv as Tn,NC as Rn,NE as ke,Ni as _n,OC as En,Oo as js,Or as Ln,Ov as Mn,Ow as On,Pb as ss,Pi as Cs,Pv as Dn,QT as zn,Q_ as Oe,Qf as Bn,Qo as ns,R_ as De,Ra as qn,Rb as ts,Rp as Fn,Rv as as,Si as Kn,Sr as $n,Sy as Ue,TC as Un,Tr as Gn,Tw as Wn,Tx as Hn,VC as Vn,Vb as Qn,W_ as Xn,XC as Zn,X_ as Yn,Xo as Ss,YS as Ge,Y_ as Jn,Yb as Ns,Yo as ws,Yv as et,Z_ as st,Zf as nt,Zo as tt,_b as at,_v as U,_w as Ce,aE as ot,ai as rt,ar as it,as as lt,av as ct,bC as dt,bE as ut,bT as pt,bi as mt,bw as xt,ci as ft,cr as ht,cv as gt,dC as bt,dr as vt,dv as yt,dw as jt,eE as Ct,es as St,ev as We,ey as ks,fC as Is,fp as Nt,gi as wt,gy as kt,hC as It,hv as He,hw as At,iE as Pt,iT as Tt,ib as Rt,ii as _t,ir as Et,is as Lt,iw as Mt,iy as Ot,jb as Dt,jo as As,jv as zt,ko as Ps,kr as Bt,ky as qt,lT as Ft,lr as Kt,lv as $t,mC as Ut,mT as Gt,mi as Wt,mp as os,mw as Ie,nE as he,nT as Ts,ni as Ht,nj as Vt,nr as Qt,oi as rs,ov as Xt,oy as Zt,pC as Yt,pE as Jt,pi as ea,pp as sa,pv as Ve,qC as Rs,q_ as na,qo as ta,qv as aa,qw as oa,rO as ra,rS as _s,rT as ia,rb as _e,ri as la,rr as ca,rs as da,rx as ua,ry as Qe,sC as ze,sT as pa,si as ma,sr as xa,ss as Es,sw as fa,ts as Ee,tw as ha,ur as ga,uv as ba,vC as va,vb as ya,vi as ja,vs as Ca,vv as Sa,wC as Na,wc as wa,wi as ka,wr as Ia,ww as Aa,xC as Ls,xE as z,xT as Pa,x_ as Ta,xb as Ra,xv as ye,xw as _a,yb as Ea,ys as La,zE as E,zT as Ma,zv as Oa}from"./index-Bt31d8ga.js";var Ms={name:"mail-plus",size:24,node:[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M16 19h6",key:"xwg31i"}]]};Ms.node;var Da=zn(Ms),d=fs(Vt(),1),e=fs(Bs(),1);function g({to:s,label:t,icon:r,iconNode:p,end:a,className:l,labelClassName:f,badge:m,badgeTone:x="default",badgeLabel:o,textBadge:h,textBadgeTone:v="default",alert:i=!1,liveCount:y,active:N,trailing:j,liveAccessory:w}){const{isMobile:I,setSidebarOpen:u}=ee(),S=m!=null&&m>0,R=y!=null&&y>0;return(0,e.jsxs)($e,{to:s,state:we,end:a,onClick:n(()=>{I&&u(!1)},"onClick"),className:n(({isActive:L})=>E("flex items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium transition-colors",N??L?"bg-accent text-foreground":"text-foreground/80 hover:bg-accent/50 hover:text-foreground",l),"className"),children:[(0,e.jsxs)("span",{className:"relative shrink-0",children:[p??(r?(0,e.jsx)(r,{className:"h-4 w-4"}):null),i&&(0,e.jsx)("span",{className:"absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full bg-red-500 shadow-(--shadow-extract-12)","aria-hidden":"true"})]}),(0,e.jsx)("span",{className:E("min-w-0 flex-1 truncate",f),children:t}),j,h&&(0,e.jsx)(Je,{variant:"ghost",className:E("ml-auto px-1.5 text-(length:--text-nano) leading-none",v==="amber"?"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-400":"bg-muted text-muted-foreground"),children:h}),(R||w)&&(0,e.jsxs)("span",{className:"ml-auto flex items-center gap-1.5",children:[w,R&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,e.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-600 dark:bg-blue-400 opacity-75"}),(0,e.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-600 dark:bg-blue-400"})]}),(0,e.jsxs)("span",{className:"text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400",children:[y," live"]})]})]}),S&&(0,e.jsx)(Je,{variant:"ghost",className:E("ml-auto px-1.5 leading-none",x==="danger"?"bg-red-600/90 text-red-50":x==="warning"?"bg-amber-500/90 text-amber-50":"bg-primary text-primary-foreground"),children:m})]})}n(g,"SidebarNavItem");var za=3,is=12e4,Ba=[{value:"top",label:"Top"},{value:"alphabetical",label:"Alphabetical"},{value:"recent",label:"Recent"}];function pe(s,t){const r=s[t];if(!r)return 0;const p=new Date(r).getTime();return Number.isFinite(p)?p:0}n(pe,"agentTimestamp");function ls(s,t){if(t==="top")return s;const r=[...s];return t==="alphabetical"?(r.sort((p,a)=>p.name.localeCompare(a.name,void 0,{sensitivity:"base"})),r):(r.sort((p,a)=>{const l=pe(a,"lastHeartbeatAt")-pe(p,"lastHeartbeatAt");if(l!==0)return l;const f=pe(a,"updatedAt")-pe(p,"updatedAt");if(f!==0)return f;const m=pe(a,"createdAt")-pe(p,"createdAt");return m!==0?m:p.name.localeCompare(a.name,void 0,{sensitivity:"base"})}),r)}n(ls,"sortAgents");var qa="opacity-0 transition-opacity group-hover/agent:opacity-100 group-focus-within/agent:opacity-100";function Fa({activeAgentId:s,activeTab:t,agent:r,disabled:p,isMobile:a,leaving:l,onLeaveAgent:f,onPauseResume:m,runCount:x,setSidebarOpen:o,builtInStatus:h,starred:v=!1,onToggleStar:i,starPending:y=!1}){const N=gs(r),j=t?`${Re(r)}/${t}`:Re(r),w=`${Re(r)}/configuration`,I=s===N,u=r.status==="paused",S=u&&r.pauseReason==="budget",R=r.orgChainHealth?.status==="invalid_org_chain",L=u?"Resume agent":"Pause agent",A=p||r.status==="pending_approval"||S||u&&R,k=p?"Updating...":S?"Budget paused":u&&R?"Invalid org chain":L,B=h==="needs_setup"||h==="pending_approval",q=(0,e.jsx)(g,{to:j,label:r.name,iconNode:(0,e.jsx)(Dt,{agent:r,size:16,className:"shrink-0 h-4 w-4"}),active:I,liveCount:x,labelClassName:B?"min-w-(--sz-4_5rem) flex-initial":void 0,className:E("min-w-0 flex-1",v&&!a?"pr-14":"pr-8"),trailing:B||R?(0,e.jsxs)("span",{className:"ml-1 flex shrink-0 items-center gap-1",children:[B?(0,e.jsx)(Lt,{status:h,compact:!0}):null,R?(0,e.jsx)(It,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):null]}):void 0,liveAccessory:r.pauseReason==="budget"?(0,e.jsx)(Ps,{title:"Agent paused by budget"}):void 0});return(0,e.jsxs)("div",{className:"group/agent relative flex items-center",children:[q,v&&!a&&i?(0,e.jsx)("span",{className:"absolute right-10 top-1/2 -translate-y-1/2",children:(0,e.jsx)(js,{size:"row",quiet:!0,starred:!0,pending:y,resourceName:r.name,onToggle:n(()=>i(r,!1),"onToggle"),revealClassName:qa})}):null,(0,e.jsxs)(Ve,{children:[(0,e.jsx)(Ke,{asChild:!0,children:(0,e.jsx)(ke,{variant:"ghost",size:"icon-xs",className:E("absolute right-3 top-1/2 h-6 w-6 -translate-y-1/2 transition-opacity data-[state=open]:pointer-events-auto data-[state=open]:opacity-100",a?"opacity-100":"pointer-events-none opacity-0 group-hover/agent:pointer-events-auto group-hover/agent:opacity-100 group-focus-within/agent:pointer-events-auto group-focus-within/agent:opacity-100"),"aria-label":`Open actions for ${r.name}`,children:(0,e.jsx)(Ts,{className:"h-3.5 w-3.5"})})}),(0,e.jsxs)(He,{align:"end",className:"w-48",children:[i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(U,{onClick:n(()=>{y||i(r,!v)},"onClick"),disabled:y,children:[y?(0,e.jsx)(Ce,{className:"size-4 motion-safe:animate-spin"}):(0,e.jsx)(Ls,{className:E("size-4",v&&"fill-amber-500 text-amber-500")}),(0,e.jsx)("span",{children:v?"Remove from starred":"Star agent"})]}),(0,e.jsx)(ye,{})]}):null,(0,e.jsx)(U,{asChild:!0,children:(0,e.jsxs)(J,{to:w,onClick:n(()=>{a&&o(!1)},"onClick"),children:[(0,e.jsx)(Zn,{className:"size-4"}),(0,e.jsx)("span",{children:"Edit agent"})]})}),(0,e.jsx)(ye,{}),(0,e.jsxs)(U,{onClick:n(()=>{A||m(r,u?"resume":"pause")},"onClick"),disabled:A,title:S?"Agent was paused by budget limits":void 0,children:[u?(0,e.jsx)(pt,{className:"size-4"}):(0,e.jsx)(Pa,{className:"size-4"}),(0,e.jsx)("span",{children:k})]}),(0,e.jsx)(ye,{}),(0,e.jsxs)(U,{onClick:n(()=>{l||f(r)},"onClick"),disabled:l,children:[l?(0,e.jsx)(Ce,{className:"size-4 motion-safe:animate-spin"}):(0,e.jsx)(Ie,{className:"size-4"}),(0,e.jsx)("span",{children:l?"Leaving...":"Leave agent"})]})]})]})]})}n(Fa,"SidebarAgentItem");function Ka({streamlined:s=!1}={}){const[t,r]=(0,d.useState)(!0),[p,a]=(0,d.useState)(()=>new Set),[l,f]=(0,d.useState)(0),m=(0,d.useRef)(new Map),x=An(),{selectedCompanyId:o}=te(),h=at(o),{openNewAgent:v}=Ne(),{isMobile:i,setSidebarOpen:y}=ee(),{pushToast:N}=gt(),j=he(),{data:w}=z({queryKey:_.agents.list(o),queryFn:n(()=>_e.list(o),"queryFn"),enabled:!!o}),{data:I}=z({queryKey:_.instance.experimentalSettings,queryFn:n(()=>ys.getExperimental(),"queryFn"),enabled:!!o}),u=I?.enableBuiltInAgents===!0,{data:S}=z({queryKey:_.builtInAgents.list(o),queryFn:n(()=>lt.list(o),"queryFn"),enabled:!!o&&u}),R=(0,d.useMemo)(()=>{const c=new Map;if(!u)return c;for(const b of S??[])b.agentId&&c.set(b.agentId,b.status);return c},[S,u]),{data:L}=z({queryKey:_.auth.session,queryFn:n(()=>Ge.getSession(),"queryFn")}),A=Ss(o),k=ws(o),B=_.liveRuns(o),q=As({companyId:o,resourceKey:"live-runs",queryKey:B,enabled:!!o,refetchInterval:!1,leaderOnly:!0}),{data:F,dataUpdatedAt:G}=z({queryKey:B,queryFn:n(()=>_s.liveRunsForCompany(o),"queryFn"),enabled:q.enabled,refetchInterval:q.refetchInterval});hs(q,F,G);const T=(0,d.useMemo)(()=>{const c=new Map;for(const b of F??[])Es(b)||c.set(b.agentId,(c.get(b.agentId)??0)+1);return c},[F]),W=(0,d.useMemo)(()=>new Set((F??[]).map(c=>c.agentId)),[F]),Q=(0,d.useMemo)(()=>(w??[]).filter(c=>c.status!=="terminated"&&(!A.isSuccess||ta(A.data,"agent",c.id)!=="left")),[w,A.data,A.isSuccess]),ce=L?.user?.id??L?.session?.userId??null,M=(0,d.useMemo)(()=>o?St(o,ce):null,[ce,o]),[D,se]=(0,d.useState)(()=>M?Ee(M):"top"),{orderedAgents:ae}=tt({agents:Q,companyId:o,userId:ce}),C=(0,d.useMemo)(()=>ls(ae,D),[ae,D]),H=(0,d.useMemo)(()=>new Set(C.map(c=>c.id)),[C]);(0,d.useEffect)(()=>{const c=Date.now();for(const b of W)m.current.set(b,c);for(const b of m.current.keys())H.has(b)||m.current.delete(b)},[W,H]);const V=(0,d.useMemo)(()=>{const c=Date.now(),b=m.current;return C.filter(O=>{if((T.get(O.id)??0)>0)return!0;const $=b.get(O.id);return $!==void 0&&c-$<=is})},[T,l,C]),X=V.length>0,ne=s?X?V:C.slice(0,za):C,oe=s&&C.length>0,de=j.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)(?:\/([^/]+))?/),Z=de?.[1]??null,Ae=de?.[2]??null;(0,d.useEffect)(()=>{if(!M){se("top");return}se(Ee(M))},[M]),(0,d.useEffect)(()=>{if(!M)return;const c=n(O=>{O.key===M&&se(Ee(M))},"onStorage"),b=n(O=>{const $=O.detail;!$||$.storageKey!==M||se($.sortMode)},"onCustomEvent");return window.addEventListener("storage",c),window.addEventListener(ns,b),()=>{window.removeEventListener("storage",c),window.removeEventListener(ns,b)}},[M]),(0,d.useEffect)(()=>{if(!s)return;const c=Date.now();let b=null;for(const $ of C){if((T.get($.id)??0)>0)continue;const xe=m.current.get($.id);if(xe===void 0)continue;const Te=xe+is;Te<c||(b=b===null?Te:Math.min(b,Te))}if(b===null)return;const O=window.setTimeout(()=>{f($=>$+1)},Math.max(0,b-c+1));return()=>{window.clearTimeout(O)}},[s,C,T,l]);const Pe=(0,d.useCallback)(c=>{const b=c==="alphabetical"||c==="recent"?c:"top";se(b),M&&da(M,b)},[M]),P=ut({mutationFn:n(({agent:c,action:b})=>b==="pause"?_e.pause(c.id,o??void 0):_e.resume(c.id,o??void 0),"mutationFn"),onMutate:n(({agent:c})=>{a(b=>{const O=new Set(b);return O.add(c.id),O})},"onMutate"),onSuccess:n(async(c,{agent:b,action:O})=>{o&&await Promise.all([x.invalidateQueries({queryKey:_.agents.list(o)}),x.invalidateQueries({queryKey:_.liveRuns(o)}),x.invalidateQueries({queryKey:_.dashboard(o)})]),await Promise.all([x.invalidateQueries({queryKey:_.agents.detail(b.id)}),x.invalidateQueries({queryKey:_.agents.detail(gs(b))})]),N({title:O==="pause"?"Agent paused":"Agent resumed",body:b.name,tone:"success"})},"onSuccess"),onError:n((c,{agent:b,action:O})=>{N({title:O==="pause"?"Could not pause agent":"Could not resume agent",body:c instanceof Error?c.message:b.name,tone:"error"})},"onError"),onSettled:n((c,b,{agent:O})=>{a($=>{const xe=new Set($);return xe.delete(O.id),xe})},"onSettled")}),K=(0,d.useCallback)(c=>k.mutate({resourceType:"agent",resourceId:c.id,resourceName:c.name,state:"left"}),[k]),re=(0,d.useCallback)(c=>k.isPending&&k.variables?.resourceType==="agent"&&k.variables.resourceId===c.id,[k.isPending,k.variables]),ie=(0,d.useCallback)((c,b)=>k.mutate({resourceType:"agent",resourceId:c.id,resourceName:c.name,starred:b}),[k]),ue=(0,d.useCallback)(c=>k.isPending&&k.variables?.resourceType==="agent"&&k.variables.resourceId===c.id&&k.variables.starred!==void 0,[k.isPending,k.variables]),le=(0,d.useMemo)(()=>new Set(bs(A.data,"agent")),[A.data]),ge=(0,d.useMemo)(()=>ls(Q.filter(c=>le.has(c.id)),"alphabetical"),[Q,le]),me=(0,d.useMemo)(()=>ne.filter(c=>!le.has(c.id)),[ne,le]),Y=h&&!h.loading?Q.find(c=>c.id===h.primaryAgentId):void 0,be=n((c,b)=>(0,e.jsx)(Fa,{activeAgentId:Z,activeTab:Ae,agent:c,disabled:p.has(c.id),isMobile:i,leaving:re(c),onLeaveAgent:K,onPauseResume:n((O,$)=>P.mutate({agent:O,action:$}),"onPauseResume"),runCount:T.get(c.id)??0,setSidebarOpen:y,builtInStatus:R.get(c.id),starred:b||vs(A.data,"agent",c.id),onToggleStar:ie,starPending:ue(c)},c.id),"renderAgentRow");return(0,e.jsxs)(De,{label:"Agents",collapsible:{open:t,onOpenChange:r},headerAction:{ariaLabel:"New agent",icon:Rs,onClick:v},menu:{ariaLabel:"Agents section actions",actions:[{type:"item",label:"Browse agents",icon:ze,href:"/agents/all"},{type:"separator"}],radioLabel:"Agent sort",radioChoices:Ba,radioValue:D,onRadioValueChange:Pe},children:[[...Y?[Y]:[],...ge.filter(c=>c.id!==Y?.id),...me.filter(c=>c.id!==Y?.id)].map(c=>be(c,le.has(c.id))),oe&&(0,e.jsxs)(J,{to:"/agents/all",state:we,onClick:n(()=>{i&&y(!1)},"onClick"),className:"flex items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,e.jsx)(ze,{className:"shrink-0 h-4 w-4"}),(0,e.jsx)("span",{children:"See all agents"})]})]})}n(Ka,"SidebarAgents");var $a="opacity-0 transition-opacity group-hover/starred-project:opacity-100 group-focus-within/starred-project:opacity-100";function Ua(){const{selectedCompanyId:s}=te(),{isMobile:t,setSidebarOpen:r}=ee(),p=he(),{data:a}=z({...Ta(s),enabled:!!s}),l=Ss(s),f=ws(s),m=p.pathname.match(/^\/(?:[^/]+\/)?projects\/([^/]+)/)?.[1]??null,x=(0,d.useMemo)(()=>{if(!l.isSuccess)return[];const i=new Set(bs(l.data,"project"));if(i.size===0)return[];const y=new Map((a??[]).map(N=>[N.id,N]));return Array.from(i).map(N=>y.get(N)).filter(N=>!!N).sort((N,j)=>N.name.localeCompare(j.name,void 0,{sensitivity:"base"}))},[l.data,l.isSuccess,a]),o=(0,d.useCallback)(i=>f.mutate({resourceType:"project",resourceId:i.id,resourceName:i.name,starred:!1}),[f]),h=(0,d.useCallback)(i=>f.mutate({resourceType:"project",resourceId:i.id,resourceName:i.name,state:"left"}),[f]),v=(0,d.useCallback)(i=>f.isPending&&f.variables?.resourceType==="project"&&f.variables.resourceId===i.id,[f.isPending,f.variables]);return!l.isSuccess||x.length===0?null:(0,e.jsx)("div",{className:"flex flex-col gap-0.5","aria-label":"Starred projects",children:x.map(i=>{const y=Fs(i),N=m===y||m===i.id,j=v(i),w=j&&f.variables?.starred===!1,I=j&&f.variables?.state==="left",u=vs(l.data,"project",i.id),S=(0,e.jsxs)($e,{to:`/projects/${y}/issues`,state:we,onClick:n(()=>{t&&r(!1)},"onClick"),className:E("flex min-w-0 flex-1 items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 pr-8 text-(length:--text-compact) font-medium transition-colors","pl-6",N?"bg-accent text-foreground":"text-foreground/80 hover:bg-accent/50 hover:text-foreground"),children:[(0,e.jsx)(ua,{color:i.color??null,icon:i.icon??null,size:"xs"}),(0,e.jsx)("span",{className:"flex-1 truncate",children:i.name}),i.visibility==="private"?(0,e.jsx)(At,{className:"size-3.5 shrink-0 text-muted-foreground","aria-label":"Private project"}):null,i.pauseReason==="budget"?(0,e.jsx)(Ps,{title:"Project paused by budget"}):null]});return(0,e.jsxs)("div",{className:"group/starred-project relative flex items-center",children:[S,t?null:(0,e.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:(0,e.jsx)(js,{size:"row",quiet:!0,starred:u,pending:w,resourceName:i.name,onToggle:n(()=>o(i),"onToggle"),revealClassName:$a})}),t?(0,e.jsxs)(Ve,{children:[(0,e.jsx)(Ke,{asChild:!0,children:(0,e.jsx)(ke,{variant:"ghost",size:"icon-xs",className:"absolute right-3 top-1/2 h-6 w-6 -translate-y-1/2 opacity-100","aria-label":`Open actions for ${i.name}`,children:(0,e.jsx)(Ts,{className:"h-3.5 w-3.5"})})}),(0,e.jsxs)(He,{align:"end",className:"w-48",children:[(0,e.jsxs)(U,{onClick:n(()=>{j||o(i)},"onClick"),disabled:j,children:[w?(0,e.jsx)(Ce,{className:"size-4 motion-safe:animate-spin"}):(0,e.jsx)(Ls,{className:"size-4 fill-amber-500 text-amber-500"}),(0,e.jsx)("span",{children:"Remove from starred"})]}),(0,e.jsx)(ye,{}),(0,e.jsxs)(U,{onClick:n(()=>{j||h(i)},"onClick"),disabled:j,children:[I?(0,e.jsx)(Ce,{className:"size-4 motion-safe:animate-spin"}):(0,e.jsx)(Ie,{className:"size-4"}),(0,e.jsx)("span",{children:"Leave project"})]})]})]}):null]},i.id)})})}n(Ua,"SidebarStarredProjects");var Ga="size-5 shrink-0 rounded-md text-(length:--text-micro)",Wa="size-(--organization-popover-avatar-size) shrink-0 rounded-lg text-(length:--text-micro)",Ha="h-(--organization-popover-company-row-height) min-w-0 gap-(--organization-popover-row-gap) rounded-lg px-2.5 py-0 text-(length:--text-compact) focus:bg-accent/50 focus:text-foreground",Le="h-(--organization-popover-action-row-height) gap-(--organization-popover-row-gap) rounded-lg px-2.5 py-0 text-(length:--text-compact) font-medium leading-(--organization-popover-action-line-height) text-foreground focus:bg-accent/50 focus:text-foreground";function Os({company:s,inPopover:t=!1}){return(0,e.jsx)(ba,{companyName:s.name,logoUrl:s.logoUrl,className:t?Wa:Ga})}n(Os,"WorkspaceIcon");function Va({company:s,isEditing:t,isSelected:r,onSelect:p}){const{attributes:a,listeners:l,setActivatorNodeRef:f,setNodeRef:m,transform:x,transition:o,isDragging:h}=Ws({id:s.id,disabled:!t});return(0,e.jsxs)(U,{ref:m,style:{transform:Vs.Transform.toString(x),transition:o,zIndex:h?10:void 0},onSelect:n(v=>{if(t){v.preventDefault();return}p(s)},"onSelect"),className:E(Ha,t&&"cursor-grab",h&&"opacity-80"),children:[(0,e.jsx)(Os,{company:s,inPopover:!0}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block truncate font-medium leading-(--organization-popover-name-line-height)",children:s.name}),t?null:(0,e.jsx)("span",{className:"block truncate text-(length:--text-nano) leading-(--organization-popover-prefix-line-height) text-muted-foreground",children:s.issuePrefix})]}),t?(0,e.jsx)("button",{type:"button",ref:f,"aria-label":`Reorder ${s.name}`,className:"inline-flex size-8 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-(length:--rad-2) focus-visible:ring-ring",onClick:n(v=>{v.preventDefault(),v.stopPropagation()},"onClick"),...a,...l,children:(0,e.jsx)(cn,{className:"size-4","aria-hidden":"true"})}):(0,e.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center",children:r?(0,e.jsx)(Pn,{className:"size-4 text-foreground"}):null})]})}n(Va,"SortableCompanyItem");function Qa(s={}){return(0,e.jsx)(Yn,{...s,children:(0,e.jsx)(Xa,{...s})})}n(Qa,"SidebarCompanyMenu");function Xa({open:s,onOpenChange:t}){const[r,p]=(0,d.useState)(!1),[a,l]=(0,d.useState)(!1),{companies:f,selectedCompany:m,setSelectedCompanyId:x,companyListUnavailable:o,retryCompanies:h}=te(),{openOnboarding:v}=Ne(),{isMobile:i,setSidebarOpen:y}=ee(),N=he(),j=Ns(),w=s??r,I=t??p,u=Oa(as(Dn,{activationConstraint:{distance:8}}),as(gn,{activationConstraint:{delay:180,tolerance:6}})),S=(0,d.useMemo)(()=>f.filter(C=>C.status!=="archived"),[f]),{data:R}=z({queryKey:_.auth.session,queryFn:n(()=>Ge.getSession(),"queryFn")}),L=R?.user?.id??R?.session?.userId??null,{orderedCompanies:A,persistOrder:k}=yt({companies:S,userId:L}),{hidden:B,loaded:q}=Qe(),F=q&&!je(B,"company.members")&&!je(B,"company.invites"),G="company",T=m?.name??null,W=!!Ue(),Q=ks({onSignedOut:M});function ce(C){C||l(!1),I(C)}n(ce,"handleOpenChange");function M(){I(!1),l(!1),i&&y(!1)}n(M,"closeNavigationChrome");function D(C){const H=N.pathname.split("/")[1]?.toUpperCase(),V=S.some(ne=>ne.issuePrefix.toUpperCase()===H),X=C.id!==m?.id&&(N.pathname.startsWith("/instance/")||V);x(C.id),I(!1),i&&y(!1),X&&j(`/${C.issuePrefix}/dashboard`)}n(D,"selectCompany");function se(){W||(I(!1),i&&y(!1),v({initialStep:1}))}n(se,"addCompany");const ae=(0,d.useCallback)(C=>{const{active:H,over:V}=C;if(!V||H.id===V.id)return;const X=A.map(de=>de.id),ne=X.indexOf(H.id),oe=X.indexOf(V.id);ne===-1||oe===-1||k(Mn(X,ne,oe))},[A,k]);return(0,e.jsxs)(Ve,{open:w,onOpenChange:ce,children:[(0,e.jsx)(Ke,{asChild:!0,children:(0,e.jsxs)(ke,{variant:"ghost",className:"h-9 min-w-0 flex-1 justify-start gap-2 px-4 text-left hover:bg-accent/50 hover:text-foreground has-[>svg]:px-4 dark:hover:bg-accent/50","aria-label":T?`Open ${T} ${G} switcher`:`Open ${G} switcher`,children:[(0,e.jsxs)("span",{className:E("flex min-w-0 flex-1 items-center gap-2",Ks),children:[m?(0,e.jsx)(Os,{company:m}):null,(0,e.jsx)("span",{className:"min-w-0 truncate text-sm font-bold text-foreground",title:T??void 0,children:T??`Select ${G}`})]}),(0,e.jsx)(sn,{className:"size-3.5 shrink-0 text-muted-foreground"})]})}),(0,e.jsxs)(He,{align:"start",sideOffset:8,className:"ml-2 w-(--organization-popover-width) max-w-(--sz-calc-24) overflow-hidden rounded-xl border-border bg-popover p-0 shadow-(--shadow-profile-popover)",children:[(0,e.jsxs)("div",{className:"flex h-(--organization-popover-header-height) items-center justify-between gap-2 px-3.5",children:[(0,e.jsx)(Sa,{className:"p-0 text-(length:--text-compact) font-semibold text-foreground",children:"Organizations"}),(0,e.jsx)("button",{type:"button",onClick:n(C=>{C.preventDefault(),C.stopPropagation(),l(H=>!H)},"onClick"),className:"rounded px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:a?"Done":"Edit"})]}),(0,e.jsxs)("div",{className:"flex max-h-96 flex-col gap-0.5 overflow-y-auto px-2.5 pb-2 pt-1",children:[(0,e.jsx)(Tn,{sensors:u,collisionDetection:In,onDragEnd:ae,children:(0,e.jsx)(nn,{items:A.map(C=>C.id),strategy:zt,children:A.map(C=>(0,e.jsx)(Va,{company:C,isEditing:a,isSelected:C.id===m?.id,onSelect:D},C.id))})}),A.length===0?o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(U,{disabled:!0,children:"Couldn't load companies"}),(0,e.jsxs)(U,{onSelect:n(C=>{C.preventDefault(),h()},"onSelect"),children:[(0,e.jsx)(pn,{className:"h-4 w-4 mr-2"}),"Try again"]})]}):(0,e.jsx)(U,{disabled:!0,children:"No companies"}):null]}),(0,e.jsxs)("div",{className:"flex flex-col gap-0.5 border-t border-border px-2.5 pb-2.5 pt-2",children:[!W&&(0,e.jsxs)(U,{onClick:se,className:Le,disabled:a,children:[(0,e.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:(0,e.jsx)(Rs,{className:"size-4"})}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:"Create organization"})]}),F?(0,e.jsx)(U,{asChild:!0,disabled:a,className:Le,children:(0,e.jsxs)(J,{to:"/company/settings/invites",onClick:n(C=>{if(a){C.preventDefault();return}M()},"onClick"),children:[(0,e.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:(0,e.jsx)(Is,{className:"size-4"})}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:T?`Invite people to ${T}`:"Invite people"})]})}):null,R?.session?(0,e.jsxs)(U,{className:Le,onClick:n(()=>Q.mutate(),"onClick"),disabled:a||Q.isPending,children:[(0,e.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:(0,e.jsx)(Ie,{className:"size-4"})}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:Q.isPending?"Signing out...":"Sign out"})]}):null]})]})]})}n(Xa,"BuiltinCompanyMenu");function cs(){const{openNewIssue:s}=Ne(),[t,r]=(0,d.useState)(!0),[p,a]=(0,d.useState)(!0),{selectedCompanyId:l,selectedCompany:f}=te(),m=wn(l),{data:x}=z({queryKey:_.instance.experimentalSettings,queryFn:n(()=>ys.getExperimental(),"queryFn")}),o=_.liveRuns(l),h=As({companyId:l,resourceKey:"live-runs",queryKey:o,enabled:!!l,refetchInterval:!1,leaderOnly:!0}),{data:v,dataUpdatedAt:i}=z({queryKey:o,queryFn:n(()=>_s.liveRunsForCompany(l),"queryFn"),enabled:h.enabled,refetchInterval:h.refetchInterval});hs(h,v,i);const y=(v??[]).filter(T=>!Es(T)).length,N=x?.enableIsolatedWorkspaces===!0,j=x?.enableApps===!0,w=x?.enableStatusCards===!0,I=x===void 0,u=x?.enableGoalsSidebarLink===!0,S=x?.enableDecisions===!0,{count:R}=qn(l,{enabled:S,refetchInterval:6e4}),L=x?.enableCases===!0,A=!0,k=x?.enableConferenceRoomChat===!0,{enabled:B}=Jn(),q=(0,e.jsx)(g,{to:"/issues",label:"Tasks",icon:Xs}),F=(0,e.jsx)(g,{to:"/dashboard",label:"Dashboard",icon:Aa,liveCount:y}),G={companyId:l,companyPrefix:f?.issuePrefix??null};return(0,e.jsxs)("aside",{className:"w-full h-full min-h-0 border-r border-border bg-background flex flex-col",children:[(0,e.jsx)("div",{className:"flex items-center gap-1 px-3 h-12 shrink-0",children:(0,e.jsx)(Qa,{})}),(0,e.jsxs)("nav",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-auto-hide flex flex-col gap-4 pointer-coarse:gap-3 px-3 py-2",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,e.jsxs)("button",{onClick:n(()=>s(),"onClick"),"data-slot":"icon-button",className:"flex items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium text-foreground/80 hover:bg-accent/50 hover:text-foreground transition-colors",children:[(0,e.jsx)(Na,{className:"h-4 w-4 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:"New Task"})]}),(0,e.jsx)(g,{to:"/search",label:"Search",icon:mn}),B?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(g,{to:"/responsibilities",label:"Dashboard",icon:Ft}),q]}):F,(0,e.jsx)(g,{to:"/inbox",label:"Inbox",icon:On,badge:m.inbox,badgeLabel:"unread",badgeTone:m.failedRuns>0?"danger":"default",alert:m.failedRuns>0}),S?(0,e.jsx)(Ca,{slot:"decisions",fallback:R,companyId:l,children:n(T=>(0,e.jsx)(g,{to:"/decisions",label:"Decisions",icon:xt,badge:T,badgeLabel:"decisions"}),"children")}):null,(0,e.jsx)(La,{slot:"blocked",companyId:l,children:n((T,W)=>(0,e.jsx)(g,{to:T.to,label:T.label,iconNode:(0,e.jsx)(T.icon,{className:"h-4 w-4"}),badge:W,badgeLabel:T.label.toLowerCase()}),"children")}),w?(0,e.jsx)(g,{to:"/status",label:"Status",icon:Ys,textBadge:"beta"}):null,k?(0,e.jsx)(g,{to:"/board-chat",label:"Conference Room",icon:fa}):null]}),(0,e.jsxs)(De,{label:"Work",collapsible:{open:t,onOpenChange:r},children:[B?null:q,L?(0,e.jsx)(g,{to:"/cases",label:"Cases",icon:Wn,textBadge:"beta"}):null,(0,e.jsx)(g,{to:"/routines",label:"Routines",icon:Vn}),u?(0,e.jsx)(g,{to:"/goals",label:"Goals",icon:va}):I?(0,e.jsx)("div",{"data-testid":"sidebar-goals-placeholder",className:"h-8 pointer-coarse:h-7","aria-hidden":"true"}):null,(0,e.jsx)(g,{to:"/artifacts",label:"Artifacts",icon:qs}),(0,e.jsx)(g,{to:"/skills",label:"Skills",icon:xn}),N?(0,e.jsx)(g,{to:"/workspaces",label:"Workspaces",icon:Qs}):null,(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(g,{to:"/projects",label:"Projects",icon:un}),(0,e.jsx)(Ua,{})]}),(0,e.jsx)(Oe,{slotTypes:["sidebar"],context:G,className:"flex flex-col gap-0.5",itemClassName:"text-(length:--text-compact) font-medium",missingBehavior:"placeholder"}),(0,e.jsx)(Cs,{placementZones:["sidebar"],context:G,className:"flex flex-col gap-0.5",itemClassName:"text-(length:--text-compact) font-medium"})]}),null,(0,e.jsx)(Ka,{streamlined:A}),(0,e.jsxs)(De,{label:"Company",collapsible:{open:p,onOpenChange:a},children:[(0,e.jsx)(g,{to:"/org",label:"Org",icon:ha}),j?(0,e.jsx)(g,{to:"/apps",label:"Connectors",icon:Ut}):null,(0,e.jsx)(g,{to:"/timeline",label:"Timeline",icon:Un}),(0,e.jsx)(g,{to:"/costs",label:"Costs",icon:Tt}),(0,e.jsx)(g,{to:"/activity",label:"Activity",icon:Ze}),(0,e.jsx)(g,{to:"/activity/commentary",label:"Commentary",icon:Ze}),(0,e.jsx)(g,{to:"/company/settings",label:"Settings",icon:Rn})]}),(0,e.jsx)(Oe,{slotTypes:["sidebarPanel"],context:G,className:"flex flex-col gap-3",itemClassName:"rounded-lg border border-border p-3",missingBehavior:"placeholder"})]})]})}n(cs,"Sidebar");function Za(s){const t=s.manifestJson.environmentDrivers??[];return t.length===0?!1:t.every(r=>r.kind==="sandbox_provider")}n(Za,"isSandboxProviderOnly");function Ya(){const{selectedCompany:s,selectedCompanyId:t}=te(),{isMobile:r,setSidebarOpen:p}=ee(),{hidden:a}=Qe(),l=n(i=>!a.has(i),"showPage"),f=l("instance.plugins"),m=!!Ue(),{slots:x}=We({slotTypes:["companySettingsPage"],companyId:t,enabled:!!t}),{data:o}=z({queryKey:t?_.sidebarBadges(t):["sidebar-badges","__disabled__"],queryFn:n(async()=>{try{return await Nn.get(t)}catch(i){if(i instanceof Jt&&(i.status===401||i.status===403))return null;throw i}},"queryFn"),enabled:!!t,refetchInterval:15e3}),{data:h}=z({queryKey:_.plugins.all,queryFn:n(()=>$t.list(),"queryFn"),enabled:f}),v=(h??[]).filter(i=>!Za(i));return(0,e.jsxs)("aside",{className:"w-full h-full min-h-0 border-r border-border bg-background flex flex-col",children:[(0,e.jsx)("div",{className:"flex flex-col gap-1 px-3 py-3 shrink-0",children:(0,e.jsxs)(J,{to:"/dashboard",onClick:n(()=>{r&&p(!1)},"onClick"),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,e.jsx)(Fe,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:s?.name??"Company"})]})}),(0,e.jsx)("nav",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-auto-hide px-3 py-2",children:(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,e.jsx)(g,{to:"/company/settings",label:"General",icon:en,end:!0}),l("instance.profile")&&(0,e.jsx)(g,{to:"/company/settings/instance/profile",label:"Profile",icon:bt,end:!0}),l("company.members")&&(0,e.jsx)(g,{to:"/company/settings/members",label:"Members",icon:ze,badge:o?.joinRequests??0,end:!0}),x.filter(i=>i.routePath).map(i=>(0,e.jsx)(g,{to:`/company/settings/${i.routePath}`,label:i.displayName,icon:jn,end:!0},`${i.pluginKey}:${i.id}`)),l("company.invites")&&(0,e.jsx)(g,{to:"/company/settings/invites",label:"Invites",icon:Da,end:!0}),l("company.secrets")&&(0,e.jsx)(g,{to:"/company/settings/secrets",label:"Secrets",icon:an,end:!0}),l("instance.environments")&&(0,e.jsx)(g,{to:"/company/settings/instance/environments",label:"Environments",icon:Mt,end:!0}),(0,e.jsx)(g,{to:"/company/settings/connections",label:"Connections",icon:_a,end:!0}),l("instance.access")&&(0,e.jsx)(g,{to:"/company/settings/instance/access",label:"Access",icon:En,end:!0}),l("instance.heartbeats")&&(0,e.jsx)(g,{to:"/company/settings/instance/heartbeats",label:"Heartbeats",icon:Gt,end:!0}),l("company.export")&&(0,e.jsx)(g,{to:"/company/export",label:"Export",icon:ia}),!m&&l("company.import")&&(0,e.jsx)(g,{to:"/company/import",label:"Import",icon:Yt,end:!0}),l("instance.experimental")&&(0,e.jsx)(g,{to:"/company/settings/instance/experimental",label:"Experimental",icon:Sn}),l("instance.cordis-plugins")&&(0,e.jsx)(g,{to:"/company/settings/instance/cordis-plugins",label:"Plugins",icon:Hs}),f&&v.length>0?(0,e.jsx)("div",{className:"ml-4 mt-1 flex flex-col gap-0.5 border-l border-border/70 pl-3",children:v.map(i=>(0,e.jsx)($e,{to:`${ct}/plugins/${i.id}`,state:we,className:n(({isActive:y})=>["rounded-md px-2 py-1.5 text-xs transition-colors",y?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"].join(" "),"className"),children:i.manifestJson.displayName??i.packageName},i.id))}):null,l("instance.adapters")&&(0,e.jsx)(g,{to:"/company/settings/instance/adapters",label:"Adapters",icon:pa})]})})]})}n(Ya,"CompanySettingsSidebar");function Ja(){const{pathname:s}=he(),{selectedCompany:t}=te(),{isMobile:r,setSidebarOpen:p}=ee(),{enabled:a}=Wt(),l=wt.filter(m=>!mt(m.key)||a);if(s.endsWith("/apps/chat/connect"))return(0,e.jsx)(Kn,{NavItem:g});const f=s.match(/\/apps\/chat\/([^/]+)(?:\/(?:settings|access|conversations|activity)|\/reviews(?:\/[^/]+)?)?\/?$/);return f?(0,e.jsx)(ka,{endpointId:f[1],NavItem:g}):(0,e.jsxs)("aside",{className:"w-full h-full min-h-0 border-r border-border bg-background flex flex-col",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1 px-3 py-3 shrink-0",children:[(0,e.jsxs)(J,{to:"/dashboard",onClick:n(()=>{r&&p(!1)},"onClick"),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,e.jsx)(Fe,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:t?.name??"Company"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1",children:[(0,e.jsx)(Xe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,e.jsx)("span",{className:"flex-1 truncate text-sm font-bold text-foreground",children:"Connectors"})]})]}),(0,e.jsxs)("nav",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-auto-hide px-3 py-2",children:[(0,e.jsx)("div",{className:"px-3 pb-1 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:"Connectors"}),(0,e.jsx)("div",{className:"flex flex-col gap-0.5",children:(0,e.jsx)(g,{to:"/apps",label:"All plugins",icon:dt,end:!0})}),(0,e.jsx)("div",{className:"px-3 pb-1 pt-4 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:"Developer"}),(0,e.jsx)("p",{className:"px-3 pb-1.5 text-(length:--text-micro) leading-snug text-muted-foreground/70",children:"Advanced setup for developers. Most teams never open this."}),(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,e.jsx)(g,{to:"/apps/connections",label:"Connections",icon:Xe,end:!0}),l.map(m=>(0,e.jsx)(g,{to:ja(m.key),label:m.label,icon:m.icon,end:!0},m.key))]})]})]})}n(Ja,"AppsSidebar");function eo(s){const{selectedCompanyId:t}=te(),{isMobile:r,setSidebarOpen:p}=ee(),a=z({queryKey:_.tools.connection(s.kind==="connection"?s.connectionId:"__none__"),queryFn:n(()=>fe.getConnection(s.kind==="connection"?s.connectionId:""),"queryFn"),enabled:s.kind==="connection"&&!!s.connectionId}),l=z({queryKey:_.tools.applications(t??"__none__"),queryFn:n(()=>fe.listApplications(t),"queryFn"),enabled:s.kind==="application"&&!!t}),f=z({queryKey:_.tools.connections(t??"__none__"),queryFn:n(()=>fe.listConnections(t),"queryFn"),enabled:s.kind==="application"&&!!t}),m=z({queryKey:_.apps.gallery(t??"__none__"),queryFn:n(()=>fe.listGallery(t),"queryFn"),enabled:!!t}),x=a.data,o=s.kind==="application"?(l.data?.applications??[]).find(w=>w.id===s.applicationId):null,h=to(s.kind==="application"?(f.data?.connections??[]).filter(w=>w.applicationId===s.applicationId):[]),v=x?ra(x):o?.name??"App",i=no(m.data?.apps??[],x,o??void 0),y=x?.id??h?.id??null,N=z({queryKey:_.apps.connectionReviewCounts(t??"__none__",y??"__none__"),queryFn:n(()=>fe.getConnectionReviewCounts(y),"queryFn"),enabled:!!t&&!!y,refetchInterval:3e4}),j=(N.data?.pendingActionRequestCount??0)+((N.data?.quarantinedCatalogEntryCount??0)>0?1:0);return(0,e.jsxs)("aside",{className:"flex h-full min-h-0 w-full flex-col border-r border-border bg-background",children:[(0,e.jsxs)("div",{className:"flex shrink-0 flex-col gap-3 px-3 py-3",children:[(0,e.jsxs)(J,{to:"/apps/connections",onClick:n(()=>{r&&p(!1)},"onClick"),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,e.jsx)(Fe,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:"All apps"})]}),(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2 px-2 py-1",children:[(0,e.jsx)(Fn,{name:v,logoUrl:Nt(i),size:28}),(0,e.jsx)("span",{className:"flex-1 truncate text-sm font-bold text-foreground",children:v})]})]}),(0,e.jsx)("nav",{className:"scrollbar-auto-hide min-h-0 flex-1 overflow-y-auto px-3 py-2",children:(0,e.jsx)("div",{className:"flex flex-col gap-0.5",children:nt.map(w=>(0,e.jsx)(g,{to:so(s,w.key),label:w.label,icon:w.icon,end:!0,badge:w.key==="review"&&j>0?j:void 0,badgeTone:"danger",badgeLabel:"needing review"},w.key))})})]})}n(eo,"AppDetailSidebar");function so(s,t){return s.kind==="connection"?Us(s.connectionId,t):Bn(s.applicationId,t)}n(so,"tabHref");function no(s,t,r){if(r?.applicationKey){const a=s.find(l=>os(l)===r.applicationKey);if(a)return a}const p=(t?.name??r?.name)?.toLowerCase();return p?s.find(a=>sa(a).toLowerCase()===p)??s.find(a=>os(a)===p)??null:null}n(no,"galleryEntryFor");function to(s){const t=s.filter(r=>r.status==="archived");return t.length===0?null:t.reduce((r,p)=>{const a=new Date(r.updatedAt??r.createdAt??0).getTime();return new Date(p.updatedAt??p.createdAt??0).getTime()>a?p:r})}n(to,"latestArchivedConnection");function Me({identifier:s}){return s?(0,e.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:s}):null}n(Me,"CrumbIdentifier");function ao({context:s}){const{slots:t}=We({slotTypes:["globalToolbarButton"],companyId:s.companyId}),{launchers:r}=rn({placementZones:["globalToolbarButton"],companyId:s.companyId,enabled:!!s.companyId});return(0,e.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1 pl-2 empty:hidden",children:[t.length>0?(0,e.jsx)(Oe,{slotTypes:["globalToolbarButton"],context:s,className:"flex items-center gap-1"}):null,r.length>0?(0,e.jsx)(Cs,{placementZones:["globalToolbarButton"],context:s,className:"flex items-center gap-1"}):null]})}n(ao,"GlobalToolbar");function oo(){const{breadcrumbs:s,mobileToolbar:t}=Rt(),{toggleSidebar:r,isMobile:p}=ee(),{selectedCompanyId:a,selectedCompany:l}=te(),f=(0,d.useMemo)(()=>({companyId:a??null,companyPrefix:l?.issuePrefix??null}),[a,l?.issuePrefix]),m=(0,e.jsx)(ao,{context:f});if(p&&t)return(0,e.jsx)("div",{className:"border-b border-border px-2 h-12 shrink-0 flex items-center",children:t});if(s.length===0)return(0,e.jsx)("div",{className:"border-b border-border px-4 md:px-6 h-12 shrink-0 flex items-center justify-end",children:m});const x=p&&(0,e.jsx)(ke,{variant:"ghost",size:"icon-sm",className:"mr-2 shrink-0",onClick:r,"aria-label":"Open sidebar",children:(0,e.jsx)(jt,{className:"h-5 w-5"})});return s.length===1?(0,e.jsxs)("div",{className:"border-b border-border px-4 md:px-6 h-12 shrink-0 flex items-center",children:[x,(0,e.jsx)("div",{className:"min-w-0 overflow-hidden flex-1",children:s[0].leading||s[0].identifier?(0,e.jsxs)("h1",{className:"flex items-center gap-1.5 text-sm font-semibold uppercase tracking-wider",children:[s[0].leading&&(0,e.jsx)("span",{className:"flex shrink-0 items-center",children:s[0].leading}),(0,e.jsx)(Me,{identifier:s[0].identifier}),(0,e.jsx)("span",{className:"truncate",children:s[0].label})]}):(0,e.jsx)("h1",{className:"text-sm font-semibold uppercase tracking-wider truncate",children:s[0].label})}),m]}):(0,e.jsxs)("div",{className:"border-b border-border px-4 md:px-6 h-12 shrink-0 flex items-center",children:[x,(0,e.jsx)("div",{className:"min-w-0 overflow-hidden flex-1",children:(0,e.jsx)(Ht,{className:"min-w-0 overflow-hidden",children:(0,e.jsx)(rt,{className:"flex-nowrap",children:s.map((o,h)=>{const v=h===s.length-1;return(0,e.jsxs)(d.Fragment,{children:[h>0&&(0,e.jsx)(ma,{}),(0,e.jsx)(la,{className:v?"min-w-0":"shrink-0",children:v||!o.href?o.leading||o.identifier?(0,e.jsxs)(rs,{className:"flex min-w-0 items-center gap-1.5",children:[o.leading&&(0,e.jsx)("span",{className:"flex shrink-0 items-center",children:o.leading}),(0,e.jsx)(Me,{identifier:o.identifier}),(0,e.jsx)("span",{className:"truncate",children:o.label})]}):(0,e.jsx)(rs,{className:"truncate",children:o.label}):(0,e.jsx)(_t,{asChild:!0,children:o.leading||o.identifier?(0,e.jsxs)(J,{to:o.href,onClick:o.onClick,className:"flex items-center gap-1.5",children:[o.leading&&(0,e.jsx)("span",{className:"flex shrink-0 items-center",children:o.leading}),(0,e.jsx)(Me,{identifier:o.identifier}),(0,e.jsx)("span",{className:"truncate",children:o.label})]}):(0,e.jsx)(J,{to:o.href,onClick:o.onClick,children:o.label})})})]},h)})})})}),m]})}n(oo,"BreadcrumbBar");var ve=240,Be=208,qe=420,ds=16;function Se(s){return Math.min(qe,Math.max(Be,s))}n(Se,"clampSidebarWidth");function us(s){if(typeof window>"u")return ve;try{const t=window.localStorage.getItem(s);if(!t)return ve;const r=Number.parseInt(t,10);return Number.isFinite(r)?Se(r):ve}catch{return ve}}n(us,"readStoredSidebarWidth");function ps(s,t){if(!(typeof window>"u"))try{window.localStorage.setItem(s,String(Se(t)))}catch{}}n(ps,"writeStoredSidebarWidth");function ro({children:s,open:t,resizable:r=!1,storageKey:p="paperclip.sidebar.width",className:a}){const[l,f]=(0,d.useState)(()=>us(p)),[m,x]=(0,d.useState)(!1),o=(0,d.useRef)(l),h=(0,d.useRef)(null);(0,d.useEffect)(()=>{const u=us(p);o.current=u,f(u)},[p]);const v=r&&t,i=(0,d.useMemo)(()=>({width:t?`${l}px`:"0px"}),[t,l]),y=(0,d.useCallback)(u=>{const S=Se(u);o.current=S,f(S),ps(p,S)},[p]),N=(0,d.useCallback)(u=>{v&&(u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),h.current={startX:u.clientX,startWidth:o.current},x(!0))},[v]),j=(0,d.useCallback)(u=>{if(!h.current)return;const S=Se(h.current.startWidth+u.clientX-h.current.startX);o.current=S,f(S)},[]),w=(0,d.useCallback)(()=>{h.current&&(h.current=null,x(!1),ps(p,o.current))},[p]),I=(0,d.useCallback)(u=>{v&&(u.key==="ArrowLeft"?(u.preventDefault(),y(l-ds)):u.key==="ArrowRight"?(u.preventDefault(),y(l+ds)):u.key==="Home"?(u.preventDefault(),y(Be)):u.key==="End"&&(u.preventDefault(),y(qe)))},[v,y,l]);return(0,e.jsx)("div",{className:E("relative h-full shrink-0",a),style:i,children:(0,e.jsxs)("div",{className:"absolute inset-y-0 left-0 flex flex-col overflow-hidden z-0",style:i,children:[s,v?(0,e.jsx)("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical","aria-valuemin":Be,"aria-valuemax":qe,"aria-valuenow":l,tabIndex:0,className:E("absolute inset-y-0 right-0 z-20 w-3 cursor-col-resize touch-none outline-none","before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-transparent before:transition-colors","hover:before:bg-border focus-visible:before:bg-ring",m&&"before:bg-ring"),onPointerDown:N,onPointerMove:j,onPointerUp:w,onPointerCancel:w,onLostPointerCapture:w,onKeyDown:I}):null]})})}n(ro,"SidebarShell");function io({children:s,className:t}){return(0,e.jsx)("div",{"data-secondary-sidebar":"",className:E("h-full w-60 shrink-0 overflow-y-auto border-r border-border bg-background",t),children:s})}n(io,"SecondarySidebar");var lo="/company/settings/members?tab=invites",co="https://docs.paperclip.ing/",uo="https://paperclip.ing/feedback";function po(s){const t=s.trim().split(/\s+/).filter(Boolean);return t.length>=2?`${t[0]?.[0]??""}${t[t.length-1]?.[0]??""}`.toUpperCase():s.slice(0,2).toUpperCase()}n(po,"deriveInitials");function ms({label:s,description:t,icon:r,onClick:p,href:a,external:l=!1,topLevel:f=!1}){const m="flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-accent/60",x=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"mt-0.5 rounded-lg border border-border bg-background/70 p-2 text-muted-foreground",children:(0,e.jsx)(r,{className:"size-4"})}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm font-medium text-foreground",children:s}),(0,e.jsx)("span",{className:"block text-xs text-muted-foreground",children:t})]})]});return a?l?(0,e.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:m,onClick:p,children:x}):f?(0,e.jsx)("a",{href:a,className:m,onClick:p,children:x}):(0,e.jsx)(J,{to:a,className:m,onClick:p,children:x}):(0,e.jsx)("button",{type:"button",className:m,onClick:p,children:x})}n(ms,"MenuAction");function xs({deploymentMode:s,open:t,onOpenChange:r}){const p=Ue(),a=!!p,{hidden:l,loaded:f}=Qe(),{inviteUrl:m,slackFeedback:x}=kt(p),o=Ot(!a),h=a?m:o?lo:null,v=f&&h!==null&&!je(l,"company.members")&&!je(l,"company.invites"),[i,y]=(0,d.useState)(!1),{isMobile:N,setSidebarOpen:j}=ee(),w=t??i,I=et(w),u=r??y,{data:S}=z({queryKey:_.auth.session,queryFn:n(()=>Ge.getSession(),"queryFn")}),R=ks({onSignedOut:q}),L=S?.user.name?.trim()||"Board",A=S?.user.email?.trim()||(s==="authenticated"?"Signed in":"Local workspace board"),k=po(L),B=yn(S?.user);function q(){u(!1),N&&j(!1)}n(q,"closeNavigationChrome");function F(){R.mutate()}return n(F,"handleSignOut"),(0,e.jsx)("div",{className:"border-t border-r border-border bg-background px-3 py-2",children:(0,e.jsxs)("div",{className:"flex items-center gap-0.5 px-2",children:[(0,e.jsxs)(Js,{open:w,onOpenChange:u,children:[(0,e.jsx)(on,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",className:E("flex min-w-0 items-center gap-2.5 rounded-lg text-left text-(length:--text-compact) font-medium text-foreground/80 transition-colors hover:bg-accent/50 hover:text-foreground","flex-1 px-2 py-1.5"),"aria-label":"Open account menu",children:[(0,e.jsxs)(ss,{size:"sm",children:[S?.user.image?(0,e.jsx)(ts,{src:S.user.image,alt:L}):null,(0,e.jsx)(Ye,{children:k})]}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:L})]})}),(0,e.jsxs)(Hn,{side:"top",align:"start",sideOffset:10,className:"w-(--sz-277px) max-w-(--sz-calc-24) overflow-hidden rounded-t-2xl rounded-b-none border-border p-0 shadow-2xl",children:[(0,e.jsx)("div",{className:"h-24 bg-(image:--gradient-extract-25)"}),(0,e.jsxs)("div",{className:"-mt-8 px-4 pb-4",children:[(0,e.jsxs)("div",{className:"relative flex items-start gap-3",children:[(0,e.jsx)(J,{to:B,"aria-label":"View profile",onClick:q,className:"absolute inset-0 rounded-xl transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),(0,e.jsx)("div",{className:"pointer-events-none relative rounded-2xl border-4 border-popover bg-popover p-0.5 shadow-sm",children:(0,e.jsxs)(ss,{size:"lg",children:[S?.user.image?(0,e.jsx)(ts,{src:S.user.image,alt:L}):null,(0,e.jsx)(Ye,{children:k})]})}),(0,e.jsxs)("div",{className:"pointer-events-none relative min-w-0 flex-1 pt-1",children:[(0,e.jsx)("h2",{className:"truncate text-base font-semibold text-foreground",children:L}),(0,e.jsx)("p",{className:"truncate text-sm text-muted-foreground",children:A}),I?(0,e.jsxs)("a",{className:"pointer-events-auto block truncate font-mono text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-muted-foreground hover:underline focus-visible:underline",href:`https://github.com/paperclipai/paperclip/commit/${I}`,target:"_blank",rel:"noreferrer","aria-label":`View commit ${I} on GitHub`,title:I,children:["SHA ",I.slice(0,7)]}):null]})]}),(0,e.jsxs)("div",{className:"mt-4 space-y-1",children:[v&&h?(0,e.jsx)(ms,{label:"Invite",description:"Invite people to your organization.",icon:Is,href:h,topLevel:a,onClick:q}):null,(0,e.jsx)(ms,{label:"Documentation",description:"Open Microvac docs in a new tab.",icon:Ma,href:co,external:!0,onClick:n(()=>u(!1),"onClick")}),(0,e.jsx)(aa,{variant:"menu-action",onAfterToggle:n(()=>u(!1),"onAfterToggle")}),s==="authenticated"?(0,e.jsxs)("button",{type:"button",className:E("flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-destructive/10",R.isPending&&"cursor-not-allowed opacity-60"),onClick:F,disabled:R.isPending,children:[(0,e.jsx)("span",{className:"mt-0.5 rounded-lg border border-border bg-background/70 p-2 text-muted-foreground",children:(0,e.jsx)(Ie,{className:"size-4"})}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm font-medium text-foreground",children:R.isPending?"Signing out...":"Sign out"}),(0,e.jsx)("span",{className:"block text-xs text-muted-foreground",children:"End this browser session."})]})]}):null,(0,e.jsx)(dn,{})]})]})]})]}),x&&(0,e.jsx)(Zt,{feedback:x,className:"hover:bg-accent/50"}),a?null:(0,e.jsxs)(ya,{children:[(0,e.jsx)(Ra,{asChild:!0,children:(0,e.jsx)("a",{href:uo,target:"_blank",rel:"noreferrer","aria-label":"Share feedback",className:"flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground/50 transition-colors hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,e.jsx)(oa,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,e.jsx)(Ea,{side:"top",children:"Share feedback"})]})]})})}n(xs,"SidebarAccountMenu");function mo(s,t){return Ds(s,t)[0]?.toLowerCase()??null}n(mo,"getCompanyRouteSegment");function Ds(s,t){if(!t)return[];const r=s.split("/").filter(Boolean);return r.length<2?[]:r[0]?.toUpperCase()!==t.toUpperCase()?[]:r.slice(1)}n(Ds,"getCompanyPathSegments");function bo(){const s=qt(),{sidebarOpen:t,setSidebarOpen:r,toggleSidebar:p,isMobile:a}=ee(),{openNewIssue:l,openOnboarding:f}=Ne(),{togglePanelVisible:m}=ft(),x=Xt()?.pushToast??null,{companies:o,loading:h,selectedCompany:v,selectedCompanyId:i,selectionSource:y,setSelectedCompanyId:N}=te(),{companyPrefix:j,pluginRoutePath:w}=ot(),I=Ns(),u=he(),S=Pt(),R=_n(u.pathname,j).isTaskDetail,L=["/company/settings","/company/export","/company/import"].some(P=>u.pathname.includes(P)),A=Ds(u.pathname,j);A[0]?.toLowerCase();const k=A[0]?.toLowerCase()==="apps"&&A[1]?.toLowerCase()==="app"&&A[2]?A[2]:null,B=(0,d.useRef)(!1),q=(0,d.useRef)(null),F=(0,d.useRef)(null),G=(0,d.useRef)(new Xn),T=(0,d.useRef)(u.key),W=Kt(a,u.pathname),Q=ht(!0),[ce,M]=(0,d.useState)(!1),D=(0,d.useMemo)(()=>{if(!j)return null;const P=j.toUpperCase();return o.find(K=>K.issuePrefix.toUpperCase()===P)??null},[o,j]),se=!!j&&!h&&o.length>0&&!D,ae=(0,d.useMemo)(()=>w?.toLowerCase()??mo(u.pathname,j),[j,u.pathname,w]),C=D?.id??null,H=D?.issuePrefix??null,{slots:V}=We({slotTypes:["page","routeSidebar"],companyId:C,enabled:!!(C&&ae)}),X=(0,d.useMemo)(()=>$s(V,ae),[ae,V]),ne=(0,d.useMemo)(()=>({companyId:C,companyPrefix:H}),[C,H]),oe=L?(0,e.jsx)(Ya,{}):k?(0,e.jsx)(eo,{kind:"application",applicationId:k}):ea(A,!0)?(0,e.jsx)(Ja,{}):X?(0,e.jsx)(st,{slot:X,context:ne,className:"h-full w-full",missingBehavior:"placeholder"}):null,de=oe!=null,{data:Z}=z({queryKey:_.health,queryFn:n(()=>Qn.get(),"queryFn"),refetchInterval:n(P=>P.state.data?.devServer?.enabled?2e3:!1,"refetchInterval"),refetchIntervalInBackground:!1});(0,d.useEffect)(()=>{h||B.current||Z?.deploymentMode!=="authenticated"&&(Z?.cloud||o.length===0&&(B.current=!0,f()))},[o,h,f,Z?.cloud,Z?.deploymentMode]),(0,d.useEffect)(()=>{if(!j||h||o.length===0)return;if(!D){const K=(i?o.find(re=>re.id===i):null)??o[0]??null;K&&i!==K.id&&N(K.id,{source:"route_sync"});return}if(j!==D.issuePrefix){const K=u.pathname.replace(/^\/[^/]+/,"");I(`/${D.issuePrefix}${K}${u.search}`,{replace:!0});return}const P=it({matchedCompany:D,selectedCompanyId:i,companies:o});if(P){x?.({title:`${D.name} is archived`,body:`Switched to ${P.name}.`,tone:"info",dedupeKey:`archived-company-bounce:${D.id}`}),N(P.id,{source:"route_sync"}),I(`/${P.issuePrefix}/dashboard`,{replace:!0});return}xa({selectionSource:y,selectedCompanyId:i,routeCompanyId:D.id})&&N(D.id,{source:"route_sync"})},[j,o,h,D,u.pathname,u.search,I,x,y,i,N]);const Ae=m,Pe=(0,d.useCallback)(()=>{document.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0,cancelable:!0}))},[]);return ga(),vt({onNewIssue:n(()=>l(),"onNewIssue"),onSearch:Pe,onToggleSidebar:p,onTogglePanel:Ae,onShowShortcuts:n(()=>M(!0),"onShowShortcuts"),onGoToInbox:n(()=>I("/inbox"),"onGoToInbox")}),(0,d.useEffect)(()=>{if(!a)return;const P=30,K=50,re=75;let ie=0,ue=0;const le=n(me=>{const Y=me.touches[0];ie=Y.clientX,ue=Y.clientY},"onTouchStart"),ge=n(me=>{const Y=me.changedTouches[0],be=Y.clientX-ie;if(!(Math.abs(Y.clientY-ue)>re)){if(!t&&ie<P&&be>K){r(!0);return}t&&be<-50&&r(!1)}},"onTouchEnd");return document.addEventListener("touchstart",le,{passive:!0}),document.addEventListener("touchend",ge,{passive:!0}),()=>{document.removeEventListener("touchstart",le),document.removeEventListener("touchend",ge)}},[a,t,r]),(0,d.useEffect)(()=>{const P=document.body.style.overflow;return document.body.style.overflow=a?"visible":"clip",()=>{document.body.style.overflow=P}},[a]),(0,d.useEffect)(()=>{if(!a)return ca()},[a]),(0,d.useEffect)(()=>{if(typeof document>"u")return;const P=F.current;return Et(P)},[u.pathname]),(0,d.useEffect)(()=>{const P=F.current;if(!P)return;const K=n(()=>{G.current.remember(T.current,P.scrollTop)},"recordScroll");return P.addEventListener("scroll",K,{passive:!0}),()=>P.removeEventListener("scroll",K)},[]),(0,d.useLayoutEffect)(()=>{const P=F.current,K=bn({previousPathname:q.current,pathname:u.pathname,navigationType:S,state:u.state});q.current=u.pathname;const re=S==="POP",ie=re?G.current.recall(u.key):0;if(T.current=u.key,re){es(P,ie);const ue=requestAnimationFrame(()=>es(P,ie));return()=>cancelAnimationFrame(ue)}K&&na(P)},[u.key,u.pathname,u.state,S]),(0,e.jsx)(Cn,{children:(0,e.jsxs)("div",{ref:Q,"data-mobile":a?"true":void 0,className:E("paperclip-app-shell bg-background text-foreground pt-(--sz-safe-top)",a?"min-h-dvh overflow-x-clip":"flex h-dvh flex-col overflow-clip"),children:[(0,e.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-(--z-200) focus:rounded-md focus:bg-background focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Skip to Main Content"}),(0,e.jsx)(Gn,{}),(0,e.jsx)(Ia,{devServer:Z?.devServer}),(0,e.jsxs)("div",{className:E("app-main-row min-h-0 flex-1",a?"w-full":"flex overflow-clip"),children:[a&&t&&(0,e.jsx)("button",{type:"button",className:"fixed inset-0 z-40 bg-black/50",onClick:n(()=>r(!1),"onClick"),"aria-label":"Close sidebar"}),a?(0,e.jsxs)("div",{className:E("fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden pt-(--sz-safe-top) transition-transform duration-100 ease-out",t?"translate-x-0":"-translate-x-full"),children:[(0,e.jsx)("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:(0,e.jsx)("div",{className:"w-60 shrink-0 overflow-hidden",children:de?oe:(0,e.jsx)(cs,{})})}),(0,e.jsx)(xs,{deploymentMode:Z?.deploymentMode})]}):(0,e.jsx)(ro,{open:t,resizable:!0,storageKey:s?"paperclip.design-proposals.sandbox.sidebar-width":void 0,children:s?(0,e.jsx)(fn,{}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex flex-1 min-h-0",children:(0,e.jsx)(cs,{})}),(0,e.jsx)(xs,{deploymentMode:Z?.deploymentMode})]})}),!a&&de?(0,e.jsx)(io,{children:oe}):null,(0,e.jsxs)("div",{className:E("app-content-column flex min-w-0 flex-col",a?"w-full":"h-full flex-1"),children:[(0,e.jsxs)("div",{className:E("app-breadcrumb",a&&"sticky top-0 z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/85"),children:[(0,e.jsx)(Zs,{mobile:a}),(0,e.jsx)(oo,{}),a&&L?(0,e.jsx)("div",{className:"border-b border-border px-4 pb-3",children:(0,e.jsx)(tn,{})}):null]}),(0,e.jsxs)("div",{className:E("app-content-row",a?"block":"flex flex-1 min-h-0"),children:[(0,e.jsx)("main",{id:"main-content",ref:F,tabIndex:-1,style:a?{"--tc-composer-bottom":W?"var(--tc-composer-visible-nav-offset)":"var(--sz-calc-8)","--mobile-nav-motion-duration":W?"var(--motion-mobile-nav-enter)":"var(--motion-mobile-nav-exit)","--mobile-nav-motion-ease":W?"var(--motion-ease-out-expo)":"var(--motion-ease-standard)"}:void 0,className:E("flex-1 p-4 outline-none md:p-6",a?R?"overflow-visible pb-(--tc-composer-visible-nav-offset)":"overflow-visible pb-(--sz-calc-14)":"overflow-auto [scrollbar-gutter:stable]"),children:se?(0,e.jsx)(Qt,{scope:"invalid_company_prefix",requestedPrefix:j??v?.issuePrefix}):(0,e.jsx)($n,{children:(0,e.jsx)(Ct,{})})}),(0,e.jsx)(vn,{})]})]})]}),a&&(0,e.jsx)(Ln,{visible:W}),(0,e.jsx)(kn,{}),(0,e.jsx)(Gs,{}),(0,e.jsx)(wa,{}),(0,e.jsx)(hn,{open:ce,onOpenChange:M}),(0,e.jsx)(ln,{}),(0,e.jsx)(Bt,{localTrusted:Z?.deploymentMode==="local_trusted"})]})})}n(bo,"Layout");export{bo as Layout};
1
+ var zs=Object.defineProperty;var n=(s,t)=>zs(s,"name",{value:t,configurable:!0});import{a as fs}from"./rolldown-runtime-DhZMWcEn.js";import{bi as Xe}from"./issue-detail-CZfjXs0M.js";import{$A as Bs,$C as qs,$E as Fs,$S as Ks,$_ as $s,$f as Us,$p as Gs,AT as Fe,Ao as hs,Av as Ws,BC as Ze,BT as Hs,Bv as Vs,Bw as Qs,CT as Xs,Cr as Zs,Cw as Ys,Cx as Js,DC as en,DT as sn,Dv as nn,Dy as Ne,Ei as tn,Ev as Ke,Ew as an,Ex as on,FE as gs,Fb as Ye,Fi as rn,Fr as ln,Fw as cn,GS as _,G_ as we,Gb as J,Gv as dn,Gw as un,HC as pn,H_ as Je,IC as mn,IE as Re,IT as xn,I_ as fn,Ir as hn,Iv as gn,Iy as ee,J_ as bn,Jo as bs,Jp as fe,Jr as vn,Jv as yn,KC as jn,K_ as es,Kb as $e,Kf as Cn,Ko as vs,Kv as ys,Kw as Sn,LS as te,La as Nn,Li as wn,Lr as kn,Lv as In,MD as je,ME as An,MT as Pn,Mv as Tn,NC as Rn,NE as ke,Ni as _n,OC as En,Oo as js,Or as Ln,Ov as Mn,Ow as On,Pb as ss,Pi as Cs,Pv as Dn,QT as zn,Q_ as Oe,Qf as Bn,Qo as ns,R_ as De,Ra as qn,Rb as ts,Rp as Fn,Rv as as,Si as Kn,Sr as $n,Sy as Ue,TC as Un,Tr as Gn,Tw as Wn,Tx as Hn,VC as Vn,Vb as Qn,W_ as Xn,XC as Zn,X_ as Yn,Xo as Ss,YS as Ge,Y_ as Jn,Yb as Ns,Yo as ws,Yv as et,Z_ as st,Zf as nt,Zo as tt,_b as at,_v as U,_w as Ce,aE as ot,ai as rt,ar as it,as as lt,av as ct,bC as dt,bE as ut,bT as pt,bi as mt,bw as xt,ci as ft,cr as ht,cv as gt,dC as bt,dr as vt,dv as yt,dw as jt,eE as Ct,es as St,ev as We,ey as ks,fC as Is,fp as Nt,gi as wt,gy as kt,hC as It,hv as He,hw as At,iE as Pt,iT as Tt,ib as Rt,ii as _t,ir as Et,is as Lt,iw as Mt,iy as Ot,jb as Dt,jo as As,jv as zt,ko as Ps,kr as Bt,ky as qt,lT as Ft,lr as Kt,lv as $t,mC as Ut,mT as Gt,mi as Wt,mp as os,mw as Ie,nE as he,nT as Ts,ni as Ht,nj as Vt,nr as Qt,oi as rs,ov as Xt,oy as Zt,pC as Yt,pE as Jt,pi as ea,pp as sa,pv as Ve,qC as Rs,q_ as na,qo as ta,qv as aa,qw as oa,rO as ra,rS as _s,rT as ia,rb as _e,ri as la,rr as ca,rs as da,rx as ua,ry as Qe,sC as ze,sT as pa,si as ma,sr as xa,ss as Es,sw as fa,ts as Ee,tw as ha,ur as ga,uv as ba,vC as va,vb as ya,vi as ja,vs as Ca,vv as Sa,wC as Na,wc as wa,wi as ka,wr as Ia,ww as Aa,xC as Ls,xE as z,xT as Pa,x_ as Ta,xb as Ra,xv as ye,xw as _a,yb as Ea,ys as La,zE as E,zT as Ma,zv as Oa}from"./index-BJtnP7H1.js";var Ms={name:"mail-plus",size:24,node:[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M16 19h6",key:"xwg31i"}]]};Ms.node;var Da=zn(Ms),d=fs(Vt(),1),e=fs(Bs(),1);function g({to:s,label:t,icon:r,iconNode:p,end:a,className:l,labelClassName:f,badge:m,badgeTone:x="default",badgeLabel:o,textBadge:h,textBadgeTone:v="default",alert:i=!1,liveCount:y,active:N,trailing:j,liveAccessory:w}){const{isMobile:I,setSidebarOpen:u}=ee(),S=m!=null&&m>0,R=y!=null&&y>0;return(0,e.jsxs)($e,{to:s,state:we,end:a,onClick:n(()=>{I&&u(!1)},"onClick"),className:n(({isActive:L})=>E("flex items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium transition-colors",N??L?"bg-accent text-foreground":"text-foreground/80 hover:bg-accent/50 hover:text-foreground",l),"className"),children:[(0,e.jsxs)("span",{className:"relative shrink-0",children:[p??(r?(0,e.jsx)(r,{className:"h-4 w-4"}):null),i&&(0,e.jsx)("span",{className:"absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full bg-red-500 shadow-(--shadow-extract-12)","aria-hidden":"true"})]}),(0,e.jsx)("span",{className:E("min-w-0 flex-1 truncate",f),children:t}),j,h&&(0,e.jsx)(Je,{variant:"ghost",className:E("ml-auto px-1.5 text-(length:--text-nano) leading-none",v==="amber"?"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-400":"bg-muted text-muted-foreground"),children:h}),(R||w)&&(0,e.jsxs)("span",{className:"ml-auto flex items-center gap-1.5",children:[w,R&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,e.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-600 dark:bg-blue-400 opacity-75"}),(0,e.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-600 dark:bg-blue-400"})]}),(0,e.jsxs)("span",{className:"text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400",children:[y," live"]})]})]}),S&&(0,e.jsx)(Je,{variant:"ghost",className:E("ml-auto px-1.5 leading-none",x==="danger"?"bg-red-600/90 text-red-50":x==="warning"?"bg-amber-500/90 text-amber-50":"bg-primary text-primary-foreground"),children:m})]})}n(g,"SidebarNavItem");var za=3,is=12e4,Ba=[{value:"top",label:"Top"},{value:"alphabetical",label:"Alphabetical"},{value:"recent",label:"Recent"}];function pe(s,t){const r=s[t];if(!r)return 0;const p=new Date(r).getTime();return Number.isFinite(p)?p:0}n(pe,"agentTimestamp");function ls(s,t){if(t==="top")return s;const r=[...s];return t==="alphabetical"?(r.sort((p,a)=>p.name.localeCompare(a.name,void 0,{sensitivity:"base"})),r):(r.sort((p,a)=>{const l=pe(a,"lastHeartbeatAt")-pe(p,"lastHeartbeatAt");if(l!==0)return l;const f=pe(a,"updatedAt")-pe(p,"updatedAt");if(f!==0)return f;const m=pe(a,"createdAt")-pe(p,"createdAt");return m!==0?m:p.name.localeCompare(a.name,void 0,{sensitivity:"base"})}),r)}n(ls,"sortAgents");var qa="opacity-0 transition-opacity group-hover/agent:opacity-100 group-focus-within/agent:opacity-100";function Fa({activeAgentId:s,activeTab:t,agent:r,disabled:p,isMobile:a,leaving:l,onLeaveAgent:f,onPauseResume:m,runCount:x,setSidebarOpen:o,builtInStatus:h,starred:v=!1,onToggleStar:i,starPending:y=!1}){const N=gs(r),j=t?`${Re(r)}/${t}`:Re(r),w=`${Re(r)}/configuration`,I=s===N,u=r.status==="paused",S=u&&r.pauseReason==="budget",R=r.orgChainHealth?.status==="invalid_org_chain",L=u?"Resume agent":"Pause agent",A=p||r.status==="pending_approval"||S||u&&R,k=p?"Updating...":S?"Budget paused":u&&R?"Invalid org chain":L,B=h==="needs_setup"||h==="pending_approval",q=(0,e.jsx)(g,{to:j,label:r.name,iconNode:(0,e.jsx)(Dt,{agent:r,size:16,className:"shrink-0 h-4 w-4"}),active:I,liveCount:x,labelClassName:B?"min-w-(--sz-4_5rem) flex-initial":void 0,className:E("min-w-0 flex-1",v&&!a?"pr-14":"pr-8"),trailing:B||R?(0,e.jsxs)("span",{className:"ml-1 flex shrink-0 items-center gap-1",children:[B?(0,e.jsx)(Lt,{status:h,compact:!0}):null,R?(0,e.jsx)(It,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):null]}):void 0,liveAccessory:r.pauseReason==="budget"?(0,e.jsx)(Ps,{title:"Agent paused by budget"}):void 0});return(0,e.jsxs)("div",{className:"group/agent relative flex items-center",children:[q,v&&!a&&i?(0,e.jsx)("span",{className:"absolute right-10 top-1/2 -translate-y-1/2",children:(0,e.jsx)(js,{size:"row",quiet:!0,starred:!0,pending:y,resourceName:r.name,onToggle:n(()=>i(r,!1),"onToggle"),revealClassName:qa})}):null,(0,e.jsxs)(Ve,{children:[(0,e.jsx)(Ke,{asChild:!0,children:(0,e.jsx)(ke,{variant:"ghost",size:"icon-xs",className:E("absolute right-3 top-1/2 h-6 w-6 -translate-y-1/2 transition-opacity data-[state=open]:pointer-events-auto data-[state=open]:opacity-100",a?"opacity-100":"pointer-events-none opacity-0 group-hover/agent:pointer-events-auto group-hover/agent:opacity-100 group-focus-within/agent:pointer-events-auto group-focus-within/agent:opacity-100"),"aria-label":`Open actions for ${r.name}`,children:(0,e.jsx)(Ts,{className:"h-3.5 w-3.5"})})}),(0,e.jsxs)(He,{align:"end",className:"w-48",children:[i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(U,{onClick:n(()=>{y||i(r,!v)},"onClick"),disabled:y,children:[y?(0,e.jsx)(Ce,{className:"size-4 motion-safe:animate-spin"}):(0,e.jsx)(Ls,{className:E("size-4",v&&"fill-amber-500 text-amber-500")}),(0,e.jsx)("span",{children:v?"Remove from starred":"Star agent"})]}),(0,e.jsx)(ye,{})]}):null,(0,e.jsx)(U,{asChild:!0,children:(0,e.jsxs)(J,{to:w,onClick:n(()=>{a&&o(!1)},"onClick"),children:[(0,e.jsx)(Zn,{className:"size-4"}),(0,e.jsx)("span",{children:"Edit agent"})]})}),(0,e.jsx)(ye,{}),(0,e.jsxs)(U,{onClick:n(()=>{A||m(r,u?"resume":"pause")},"onClick"),disabled:A,title:S?"Agent was paused by budget limits":void 0,children:[u?(0,e.jsx)(pt,{className:"size-4"}):(0,e.jsx)(Pa,{className:"size-4"}),(0,e.jsx)("span",{children:k})]}),(0,e.jsx)(ye,{}),(0,e.jsxs)(U,{onClick:n(()=>{l||f(r)},"onClick"),disabled:l,children:[l?(0,e.jsx)(Ce,{className:"size-4 motion-safe:animate-spin"}):(0,e.jsx)(Ie,{className:"size-4"}),(0,e.jsx)("span",{children:l?"Leaving...":"Leave agent"})]})]})]})]})}n(Fa,"SidebarAgentItem");function Ka({streamlined:s=!1}={}){const[t,r]=(0,d.useState)(!0),[p,a]=(0,d.useState)(()=>new Set),[l,f]=(0,d.useState)(0),m=(0,d.useRef)(new Map),x=An(),{selectedCompanyId:o}=te(),h=at(o),{openNewAgent:v}=Ne(),{isMobile:i,setSidebarOpen:y}=ee(),{pushToast:N}=gt(),j=he(),{data:w}=z({queryKey:_.agents.list(o),queryFn:n(()=>_e.list(o),"queryFn"),enabled:!!o}),{data:I}=z({queryKey:_.instance.experimentalSettings,queryFn:n(()=>ys.getExperimental(),"queryFn"),enabled:!!o}),u=I?.enableBuiltInAgents===!0,{data:S}=z({queryKey:_.builtInAgents.list(o),queryFn:n(()=>lt.list(o),"queryFn"),enabled:!!o&&u}),R=(0,d.useMemo)(()=>{const c=new Map;if(!u)return c;for(const b of S??[])b.agentId&&c.set(b.agentId,b.status);return c},[S,u]),{data:L}=z({queryKey:_.auth.session,queryFn:n(()=>Ge.getSession(),"queryFn")}),A=Ss(o),k=ws(o),B=_.liveRuns(o),q=As({companyId:o,resourceKey:"live-runs",queryKey:B,enabled:!!o,refetchInterval:!1,leaderOnly:!0}),{data:F,dataUpdatedAt:G}=z({queryKey:B,queryFn:n(()=>_s.liveRunsForCompany(o),"queryFn"),enabled:q.enabled,refetchInterval:q.refetchInterval});hs(q,F,G);const T=(0,d.useMemo)(()=>{const c=new Map;for(const b of F??[])Es(b)||c.set(b.agentId,(c.get(b.agentId)??0)+1);return c},[F]),W=(0,d.useMemo)(()=>new Set((F??[]).map(c=>c.agentId)),[F]),Q=(0,d.useMemo)(()=>(w??[]).filter(c=>c.status!=="terminated"&&(!A.isSuccess||ta(A.data,"agent",c.id)!=="left")),[w,A.data,A.isSuccess]),ce=L?.user?.id??L?.session?.userId??null,M=(0,d.useMemo)(()=>o?St(o,ce):null,[ce,o]),[D,se]=(0,d.useState)(()=>M?Ee(M):"top"),{orderedAgents:ae}=tt({agents:Q,companyId:o,userId:ce}),C=(0,d.useMemo)(()=>ls(ae,D),[ae,D]),H=(0,d.useMemo)(()=>new Set(C.map(c=>c.id)),[C]);(0,d.useEffect)(()=>{const c=Date.now();for(const b of W)m.current.set(b,c);for(const b of m.current.keys())H.has(b)||m.current.delete(b)},[W,H]);const V=(0,d.useMemo)(()=>{const c=Date.now(),b=m.current;return C.filter(O=>{if((T.get(O.id)??0)>0)return!0;const $=b.get(O.id);return $!==void 0&&c-$<=is})},[T,l,C]),X=V.length>0,ne=s?X?V:C.slice(0,za):C,oe=s&&C.length>0,de=j.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)(?:\/([^/]+))?/),Z=de?.[1]??null,Ae=de?.[2]??null;(0,d.useEffect)(()=>{if(!M){se("top");return}se(Ee(M))},[M]),(0,d.useEffect)(()=>{if(!M)return;const c=n(O=>{O.key===M&&se(Ee(M))},"onStorage"),b=n(O=>{const $=O.detail;!$||$.storageKey!==M||se($.sortMode)},"onCustomEvent");return window.addEventListener("storage",c),window.addEventListener(ns,b),()=>{window.removeEventListener("storage",c),window.removeEventListener(ns,b)}},[M]),(0,d.useEffect)(()=>{if(!s)return;const c=Date.now();let b=null;for(const $ of C){if((T.get($.id)??0)>0)continue;const xe=m.current.get($.id);if(xe===void 0)continue;const Te=xe+is;Te<c||(b=b===null?Te:Math.min(b,Te))}if(b===null)return;const O=window.setTimeout(()=>{f($=>$+1)},Math.max(0,b-c+1));return()=>{window.clearTimeout(O)}},[s,C,T,l]);const Pe=(0,d.useCallback)(c=>{const b=c==="alphabetical"||c==="recent"?c:"top";se(b),M&&da(M,b)},[M]),P=ut({mutationFn:n(({agent:c,action:b})=>b==="pause"?_e.pause(c.id,o??void 0):_e.resume(c.id,o??void 0),"mutationFn"),onMutate:n(({agent:c})=>{a(b=>{const O=new Set(b);return O.add(c.id),O})},"onMutate"),onSuccess:n(async(c,{agent:b,action:O})=>{o&&await Promise.all([x.invalidateQueries({queryKey:_.agents.list(o)}),x.invalidateQueries({queryKey:_.liveRuns(o)}),x.invalidateQueries({queryKey:_.dashboard(o)})]),await Promise.all([x.invalidateQueries({queryKey:_.agents.detail(b.id)}),x.invalidateQueries({queryKey:_.agents.detail(gs(b))})]),N({title:O==="pause"?"Agent paused":"Agent resumed",body:b.name,tone:"success"})},"onSuccess"),onError:n((c,{agent:b,action:O})=>{N({title:O==="pause"?"Could not pause agent":"Could not resume agent",body:c instanceof Error?c.message:b.name,tone:"error"})},"onError"),onSettled:n((c,b,{agent:O})=>{a($=>{const xe=new Set($);return xe.delete(O.id),xe})},"onSettled")}),K=(0,d.useCallback)(c=>k.mutate({resourceType:"agent",resourceId:c.id,resourceName:c.name,state:"left"}),[k]),re=(0,d.useCallback)(c=>k.isPending&&k.variables?.resourceType==="agent"&&k.variables.resourceId===c.id,[k.isPending,k.variables]),ie=(0,d.useCallback)((c,b)=>k.mutate({resourceType:"agent",resourceId:c.id,resourceName:c.name,starred:b}),[k]),ue=(0,d.useCallback)(c=>k.isPending&&k.variables?.resourceType==="agent"&&k.variables.resourceId===c.id&&k.variables.starred!==void 0,[k.isPending,k.variables]),le=(0,d.useMemo)(()=>new Set(bs(A.data,"agent")),[A.data]),ge=(0,d.useMemo)(()=>ls(Q.filter(c=>le.has(c.id)),"alphabetical"),[Q,le]),me=(0,d.useMemo)(()=>ne.filter(c=>!le.has(c.id)),[ne,le]),Y=h&&!h.loading?Q.find(c=>c.id===h.primaryAgentId):void 0,be=n((c,b)=>(0,e.jsx)(Fa,{activeAgentId:Z,activeTab:Ae,agent:c,disabled:p.has(c.id),isMobile:i,leaving:re(c),onLeaveAgent:K,onPauseResume:n((O,$)=>P.mutate({agent:O,action:$}),"onPauseResume"),runCount:T.get(c.id)??0,setSidebarOpen:y,builtInStatus:R.get(c.id),starred:b||vs(A.data,"agent",c.id),onToggleStar:ie,starPending:ue(c)},c.id),"renderAgentRow");return(0,e.jsxs)(De,{label:"Agents",collapsible:{open:t,onOpenChange:r},headerAction:{ariaLabel:"New agent",icon:Rs,onClick:v},menu:{ariaLabel:"Agents section actions",actions:[{type:"item",label:"Browse agents",icon:ze,href:"/agents/all"},{type:"separator"}],radioLabel:"Agent sort",radioChoices:Ba,radioValue:D,onRadioValueChange:Pe},children:[[...Y?[Y]:[],...ge.filter(c=>c.id!==Y?.id),...me.filter(c=>c.id!==Y?.id)].map(c=>be(c,le.has(c.id))),oe&&(0,e.jsxs)(J,{to:"/agents/all",state:we,onClick:n(()=>{i&&y(!1)},"onClick"),className:"flex items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,e.jsx)(ze,{className:"shrink-0 h-4 w-4"}),(0,e.jsx)("span",{children:"See all agents"})]})]})}n(Ka,"SidebarAgents");var $a="opacity-0 transition-opacity group-hover/starred-project:opacity-100 group-focus-within/starred-project:opacity-100";function Ua(){const{selectedCompanyId:s}=te(),{isMobile:t,setSidebarOpen:r}=ee(),p=he(),{data:a}=z({...Ta(s),enabled:!!s}),l=Ss(s),f=ws(s),m=p.pathname.match(/^\/(?:[^/]+\/)?projects\/([^/]+)/)?.[1]??null,x=(0,d.useMemo)(()=>{if(!l.isSuccess)return[];const i=new Set(bs(l.data,"project"));if(i.size===0)return[];const y=new Map((a??[]).map(N=>[N.id,N]));return Array.from(i).map(N=>y.get(N)).filter(N=>!!N).sort((N,j)=>N.name.localeCompare(j.name,void 0,{sensitivity:"base"}))},[l.data,l.isSuccess,a]),o=(0,d.useCallback)(i=>f.mutate({resourceType:"project",resourceId:i.id,resourceName:i.name,starred:!1}),[f]),h=(0,d.useCallback)(i=>f.mutate({resourceType:"project",resourceId:i.id,resourceName:i.name,state:"left"}),[f]),v=(0,d.useCallback)(i=>f.isPending&&f.variables?.resourceType==="project"&&f.variables.resourceId===i.id,[f.isPending,f.variables]);return!l.isSuccess||x.length===0?null:(0,e.jsx)("div",{className:"flex flex-col gap-0.5","aria-label":"Starred projects",children:x.map(i=>{const y=Fs(i),N=m===y||m===i.id,j=v(i),w=j&&f.variables?.starred===!1,I=j&&f.variables?.state==="left",u=vs(l.data,"project",i.id),S=(0,e.jsxs)($e,{to:`/projects/${y}/issues`,state:we,onClick:n(()=>{t&&r(!1)},"onClick"),className:E("flex min-w-0 flex-1 items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 pr-8 text-(length:--text-compact) font-medium transition-colors","pl-6",N?"bg-accent text-foreground":"text-foreground/80 hover:bg-accent/50 hover:text-foreground"),children:[(0,e.jsx)(ua,{color:i.color??null,icon:i.icon??null,size:"xs"}),(0,e.jsx)("span",{className:"flex-1 truncate",children:i.name}),i.visibility==="private"?(0,e.jsx)(At,{className:"size-3.5 shrink-0 text-muted-foreground","aria-label":"Private project"}):null,i.pauseReason==="budget"?(0,e.jsx)(Ps,{title:"Project paused by budget"}):null]});return(0,e.jsxs)("div",{className:"group/starred-project relative flex items-center",children:[S,t?null:(0,e.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:(0,e.jsx)(js,{size:"row",quiet:!0,starred:u,pending:w,resourceName:i.name,onToggle:n(()=>o(i),"onToggle"),revealClassName:$a})}),t?(0,e.jsxs)(Ve,{children:[(0,e.jsx)(Ke,{asChild:!0,children:(0,e.jsx)(ke,{variant:"ghost",size:"icon-xs",className:"absolute right-3 top-1/2 h-6 w-6 -translate-y-1/2 opacity-100","aria-label":`Open actions for ${i.name}`,children:(0,e.jsx)(Ts,{className:"h-3.5 w-3.5"})})}),(0,e.jsxs)(He,{align:"end",className:"w-48",children:[(0,e.jsxs)(U,{onClick:n(()=>{j||o(i)},"onClick"),disabled:j,children:[w?(0,e.jsx)(Ce,{className:"size-4 motion-safe:animate-spin"}):(0,e.jsx)(Ls,{className:"size-4 fill-amber-500 text-amber-500"}),(0,e.jsx)("span",{children:"Remove from starred"})]}),(0,e.jsx)(ye,{}),(0,e.jsxs)(U,{onClick:n(()=>{j||h(i)},"onClick"),disabled:j,children:[I?(0,e.jsx)(Ce,{className:"size-4 motion-safe:animate-spin"}):(0,e.jsx)(Ie,{className:"size-4"}),(0,e.jsx)("span",{children:"Leave project"})]})]})]}):null]},i.id)})})}n(Ua,"SidebarStarredProjects");var Ga="size-5 shrink-0 rounded-md text-(length:--text-micro)",Wa="size-(--organization-popover-avatar-size) shrink-0 rounded-lg text-(length:--text-micro)",Ha="h-(--organization-popover-company-row-height) min-w-0 gap-(--organization-popover-row-gap) rounded-lg px-2.5 py-0 text-(length:--text-compact) focus:bg-accent/50 focus:text-foreground",Le="h-(--organization-popover-action-row-height) gap-(--organization-popover-row-gap) rounded-lg px-2.5 py-0 text-(length:--text-compact) font-medium leading-(--organization-popover-action-line-height) text-foreground focus:bg-accent/50 focus:text-foreground";function Os({company:s,inPopover:t=!1}){return(0,e.jsx)(ba,{companyName:s.name,logoUrl:s.logoUrl,className:t?Wa:Ga})}n(Os,"WorkspaceIcon");function Va({company:s,isEditing:t,isSelected:r,onSelect:p}){const{attributes:a,listeners:l,setActivatorNodeRef:f,setNodeRef:m,transform:x,transition:o,isDragging:h}=Ws({id:s.id,disabled:!t});return(0,e.jsxs)(U,{ref:m,style:{transform:Vs.Transform.toString(x),transition:o,zIndex:h?10:void 0},onSelect:n(v=>{if(t){v.preventDefault();return}p(s)},"onSelect"),className:E(Ha,t&&"cursor-grab",h&&"opacity-80"),children:[(0,e.jsx)(Os,{company:s,inPopover:!0}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block truncate font-medium leading-(--organization-popover-name-line-height)",children:s.name}),t?null:(0,e.jsx)("span",{className:"block truncate text-(length:--text-nano) leading-(--organization-popover-prefix-line-height) text-muted-foreground",children:s.issuePrefix})]}),t?(0,e.jsx)("button",{type:"button",ref:f,"aria-label":`Reorder ${s.name}`,className:"inline-flex size-8 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-(length:--rad-2) focus-visible:ring-ring",onClick:n(v=>{v.preventDefault(),v.stopPropagation()},"onClick"),...a,...l,children:(0,e.jsx)(cn,{className:"size-4","aria-hidden":"true"})}):(0,e.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center",children:r?(0,e.jsx)(Pn,{className:"size-4 text-foreground"}):null})]})}n(Va,"SortableCompanyItem");function Qa(s={}){return(0,e.jsx)(Yn,{...s,children:(0,e.jsx)(Xa,{...s})})}n(Qa,"SidebarCompanyMenu");function Xa({open:s,onOpenChange:t}){const[r,p]=(0,d.useState)(!1),[a,l]=(0,d.useState)(!1),{companies:f,selectedCompany:m,setSelectedCompanyId:x,companyListUnavailable:o,retryCompanies:h}=te(),{openOnboarding:v}=Ne(),{isMobile:i,setSidebarOpen:y}=ee(),N=he(),j=Ns(),w=s??r,I=t??p,u=Oa(as(Dn,{activationConstraint:{distance:8}}),as(gn,{activationConstraint:{delay:180,tolerance:6}})),S=(0,d.useMemo)(()=>f.filter(C=>C.status!=="archived"),[f]),{data:R}=z({queryKey:_.auth.session,queryFn:n(()=>Ge.getSession(),"queryFn")}),L=R?.user?.id??R?.session?.userId??null,{orderedCompanies:A,persistOrder:k}=yt({companies:S,userId:L}),{hidden:B,loaded:q}=Qe(),F=q&&!je(B,"company.members")&&!je(B,"company.invites"),G="company",T=m?.name??null,W=!!Ue(),Q=ks({onSignedOut:M});function ce(C){C||l(!1),I(C)}n(ce,"handleOpenChange");function M(){I(!1),l(!1),i&&y(!1)}n(M,"closeNavigationChrome");function D(C){const H=N.pathname.split("/")[1]?.toUpperCase(),V=S.some(ne=>ne.issuePrefix.toUpperCase()===H),X=C.id!==m?.id&&(N.pathname.startsWith("/instance/")||V);x(C.id),I(!1),i&&y(!1),X&&j(`/${C.issuePrefix}/dashboard`)}n(D,"selectCompany");function se(){W||(I(!1),i&&y(!1),v({initialStep:1}))}n(se,"addCompany");const ae=(0,d.useCallback)(C=>{const{active:H,over:V}=C;if(!V||H.id===V.id)return;const X=A.map(de=>de.id),ne=X.indexOf(H.id),oe=X.indexOf(V.id);ne===-1||oe===-1||k(Mn(X,ne,oe))},[A,k]);return(0,e.jsxs)(Ve,{open:w,onOpenChange:ce,children:[(0,e.jsx)(Ke,{asChild:!0,children:(0,e.jsxs)(ke,{variant:"ghost",className:"h-9 min-w-0 flex-1 justify-start gap-2 px-4 text-left hover:bg-accent/50 hover:text-foreground has-[>svg]:px-4 dark:hover:bg-accent/50","aria-label":T?`Open ${T} ${G} switcher`:`Open ${G} switcher`,children:[(0,e.jsxs)("span",{className:E("flex min-w-0 flex-1 items-center gap-2",Ks),children:[m?(0,e.jsx)(Os,{company:m}):null,(0,e.jsx)("span",{className:"min-w-0 truncate text-sm font-bold text-foreground",title:T??void 0,children:T??`Select ${G}`})]}),(0,e.jsx)(sn,{className:"size-3.5 shrink-0 text-muted-foreground"})]})}),(0,e.jsxs)(He,{align:"start",sideOffset:8,className:"ml-2 w-(--organization-popover-width) max-w-(--sz-calc-24) overflow-hidden rounded-xl border-border bg-popover p-0 shadow-(--shadow-profile-popover)",children:[(0,e.jsxs)("div",{className:"flex h-(--organization-popover-header-height) items-center justify-between gap-2 px-3.5",children:[(0,e.jsx)(Sa,{className:"p-0 text-(length:--text-compact) font-semibold text-foreground",children:"Organizations"}),(0,e.jsx)("button",{type:"button",onClick:n(C=>{C.preventDefault(),C.stopPropagation(),l(H=>!H)},"onClick"),className:"rounded px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:a?"Done":"Edit"})]}),(0,e.jsxs)("div",{className:"flex max-h-96 flex-col gap-0.5 overflow-y-auto px-2.5 pb-2 pt-1",children:[(0,e.jsx)(Tn,{sensors:u,collisionDetection:In,onDragEnd:ae,children:(0,e.jsx)(nn,{items:A.map(C=>C.id),strategy:zt,children:A.map(C=>(0,e.jsx)(Va,{company:C,isEditing:a,isSelected:C.id===m?.id,onSelect:D},C.id))})}),A.length===0?o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(U,{disabled:!0,children:"Couldn't load companies"}),(0,e.jsxs)(U,{onSelect:n(C=>{C.preventDefault(),h()},"onSelect"),children:[(0,e.jsx)(pn,{className:"h-4 w-4 mr-2"}),"Try again"]})]}):(0,e.jsx)(U,{disabled:!0,children:"No companies"}):null]}),(0,e.jsxs)("div",{className:"flex flex-col gap-0.5 border-t border-border px-2.5 pb-2.5 pt-2",children:[!W&&(0,e.jsxs)(U,{onClick:se,className:Le,disabled:a,children:[(0,e.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:(0,e.jsx)(Rs,{className:"size-4"})}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:"Create organization"})]}),F?(0,e.jsx)(U,{asChild:!0,disabled:a,className:Le,children:(0,e.jsxs)(J,{to:"/company/settings/invites",onClick:n(C=>{if(a){C.preventDefault();return}M()},"onClick"),children:[(0,e.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:(0,e.jsx)(Is,{className:"size-4"})}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:T?`Invite people to ${T}`:"Invite people"})]})}):null,R?.session?(0,e.jsxs)(U,{className:Le,onClick:n(()=>Q.mutate(),"onClick"),disabled:a||Q.isPending,children:[(0,e.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:(0,e.jsx)(Ie,{className:"size-4"})}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:Q.isPending?"Signing out...":"Sign out"})]}):null]})]})]})}n(Xa,"BuiltinCompanyMenu");function cs(){const{openNewIssue:s}=Ne(),[t,r]=(0,d.useState)(!0),[p,a]=(0,d.useState)(!0),{selectedCompanyId:l,selectedCompany:f}=te(),m=wn(l),{data:x}=z({queryKey:_.instance.experimentalSettings,queryFn:n(()=>ys.getExperimental(),"queryFn")}),o=_.liveRuns(l),h=As({companyId:l,resourceKey:"live-runs",queryKey:o,enabled:!!l,refetchInterval:!1,leaderOnly:!0}),{data:v,dataUpdatedAt:i}=z({queryKey:o,queryFn:n(()=>_s.liveRunsForCompany(l),"queryFn"),enabled:h.enabled,refetchInterval:h.refetchInterval});hs(h,v,i);const y=(v??[]).filter(T=>!Es(T)).length,N=x?.enableIsolatedWorkspaces===!0,j=x?.enableApps===!0,w=x?.enableStatusCards===!0,I=x===void 0,u=x?.enableGoalsSidebarLink===!0,S=x?.enableDecisions===!0,{count:R}=qn(l,{enabled:S,refetchInterval:6e4}),L=x?.enableCases===!0,A=!0,k=x?.enableConferenceRoomChat===!0,{enabled:B}=Jn(),q=(0,e.jsx)(g,{to:"/issues",label:"Tasks",icon:Xs}),F=(0,e.jsx)(g,{to:"/dashboard",label:"Dashboard",icon:Aa,liveCount:y}),G={companyId:l,companyPrefix:f?.issuePrefix??null};return(0,e.jsxs)("aside",{className:"w-full h-full min-h-0 border-r border-border bg-background flex flex-col",children:[(0,e.jsx)("div",{className:"flex items-center gap-1 px-3 h-12 shrink-0",children:(0,e.jsx)(Qa,{})}),(0,e.jsxs)("nav",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-auto-hide flex flex-col gap-4 pointer-coarse:gap-3 px-3 py-2",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,e.jsxs)("button",{onClick:n(()=>s(),"onClick"),"data-slot":"icon-button",className:"flex items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium text-foreground/80 hover:bg-accent/50 hover:text-foreground transition-colors",children:[(0,e.jsx)(Na,{className:"h-4 w-4 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:"New Task"})]}),(0,e.jsx)(g,{to:"/search",label:"Search",icon:mn}),B?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(g,{to:"/responsibilities",label:"Dashboard",icon:Ft}),q]}):F,(0,e.jsx)(g,{to:"/inbox",label:"Inbox",icon:On,badge:m.inbox,badgeLabel:"unread",badgeTone:m.failedRuns>0?"danger":"default",alert:m.failedRuns>0}),S?(0,e.jsx)(Ca,{slot:"decisions",fallback:R,companyId:l,children:n(T=>(0,e.jsx)(g,{to:"/decisions",label:"Decisions",icon:xt,badge:T,badgeLabel:"decisions"}),"children")}):null,(0,e.jsx)(La,{slot:"blocked",companyId:l,children:n((T,W)=>(0,e.jsx)(g,{to:T.to,label:T.label,iconNode:(0,e.jsx)(T.icon,{className:"h-4 w-4"}),badge:W,badgeLabel:T.label.toLowerCase()}),"children")}),w?(0,e.jsx)(g,{to:"/status",label:"Status",icon:Ys,textBadge:"beta"}):null,k?(0,e.jsx)(g,{to:"/board-chat",label:"Conference Room",icon:fa}):null]}),(0,e.jsxs)(De,{label:"Work",collapsible:{open:t,onOpenChange:r},children:[B?null:q,L?(0,e.jsx)(g,{to:"/cases",label:"Cases",icon:Wn,textBadge:"beta"}):null,(0,e.jsx)(g,{to:"/routines",label:"Routines",icon:Vn}),u?(0,e.jsx)(g,{to:"/goals",label:"Goals",icon:va}):I?(0,e.jsx)("div",{"data-testid":"sidebar-goals-placeholder",className:"h-8 pointer-coarse:h-7","aria-hidden":"true"}):null,(0,e.jsx)(g,{to:"/artifacts",label:"Artifacts",icon:qs}),(0,e.jsx)(g,{to:"/skills",label:"Skills",icon:xn}),N?(0,e.jsx)(g,{to:"/workspaces",label:"Workspaces",icon:Qs}):null,(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(g,{to:"/projects",label:"Projects",icon:un}),(0,e.jsx)(Ua,{})]}),(0,e.jsx)(Oe,{slotTypes:["sidebar"],context:G,className:"flex flex-col gap-0.5",itemClassName:"text-(length:--text-compact) font-medium",missingBehavior:"placeholder"}),(0,e.jsx)(Cs,{placementZones:["sidebar"],context:G,className:"flex flex-col gap-0.5",itemClassName:"text-(length:--text-compact) font-medium"})]}),null,(0,e.jsx)(Ka,{streamlined:A}),(0,e.jsxs)(De,{label:"Company",collapsible:{open:p,onOpenChange:a},children:[(0,e.jsx)(g,{to:"/org",label:"Org",icon:ha}),j?(0,e.jsx)(g,{to:"/apps",label:"Connectors",icon:Ut}):null,(0,e.jsx)(g,{to:"/timeline",label:"Timeline",icon:Un}),(0,e.jsx)(g,{to:"/costs",label:"Costs",icon:Tt}),(0,e.jsx)(g,{to:"/activity",label:"Activity",icon:Ze}),(0,e.jsx)(g,{to:"/activity/commentary",label:"Commentary",icon:Ze}),(0,e.jsx)(g,{to:"/company/settings",label:"Settings",icon:Rn})]}),(0,e.jsx)(Oe,{slotTypes:["sidebarPanel"],context:G,className:"flex flex-col gap-3",itemClassName:"rounded-lg border border-border p-3",missingBehavior:"placeholder"})]})]})}n(cs,"Sidebar");function Za(s){const t=s.manifestJson.environmentDrivers??[];return t.length===0?!1:t.every(r=>r.kind==="sandbox_provider")}n(Za,"isSandboxProviderOnly");function Ya(){const{selectedCompany:s,selectedCompanyId:t}=te(),{isMobile:r,setSidebarOpen:p}=ee(),{hidden:a}=Qe(),l=n(i=>!a.has(i),"showPage"),f=l("instance.plugins"),m=!!Ue(),{slots:x}=We({slotTypes:["companySettingsPage"],companyId:t,enabled:!!t}),{data:o}=z({queryKey:t?_.sidebarBadges(t):["sidebar-badges","__disabled__"],queryFn:n(async()=>{try{return await Nn.get(t)}catch(i){if(i instanceof Jt&&(i.status===401||i.status===403))return null;throw i}},"queryFn"),enabled:!!t,refetchInterval:15e3}),{data:h}=z({queryKey:_.plugins.all,queryFn:n(()=>$t.list(),"queryFn"),enabled:f}),v=(h??[]).filter(i=>!Za(i));return(0,e.jsxs)("aside",{className:"w-full h-full min-h-0 border-r border-border bg-background flex flex-col",children:[(0,e.jsx)("div",{className:"flex flex-col gap-1 px-3 py-3 shrink-0",children:(0,e.jsxs)(J,{to:"/dashboard",onClick:n(()=>{r&&p(!1)},"onClick"),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,e.jsx)(Fe,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:s?.name??"Company"})]})}),(0,e.jsx)("nav",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-auto-hide px-3 py-2",children:(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,e.jsx)(g,{to:"/company/settings",label:"General",icon:en,end:!0}),l("instance.profile")&&(0,e.jsx)(g,{to:"/company/settings/instance/profile",label:"Profile",icon:bt,end:!0}),l("company.members")&&(0,e.jsx)(g,{to:"/company/settings/members",label:"Members",icon:ze,badge:o?.joinRequests??0,end:!0}),x.filter(i=>i.routePath).map(i=>(0,e.jsx)(g,{to:`/company/settings/${i.routePath}`,label:i.displayName,icon:jn,end:!0},`${i.pluginKey}:${i.id}`)),l("company.invites")&&(0,e.jsx)(g,{to:"/company/settings/invites",label:"Invites",icon:Da,end:!0}),l("company.secrets")&&(0,e.jsx)(g,{to:"/company/settings/secrets",label:"Secrets",icon:an,end:!0}),l("instance.environments")&&(0,e.jsx)(g,{to:"/company/settings/instance/environments",label:"Environments",icon:Mt,end:!0}),(0,e.jsx)(g,{to:"/company/settings/connections",label:"Connections",icon:_a,end:!0}),l("instance.access")&&(0,e.jsx)(g,{to:"/company/settings/instance/access",label:"Access",icon:En,end:!0}),l("instance.heartbeats")&&(0,e.jsx)(g,{to:"/company/settings/instance/heartbeats",label:"Heartbeats",icon:Gt,end:!0}),l("company.export")&&(0,e.jsx)(g,{to:"/company/export",label:"Export",icon:ia}),!m&&l("company.import")&&(0,e.jsx)(g,{to:"/company/import",label:"Import",icon:Yt,end:!0}),l("instance.experimental")&&(0,e.jsx)(g,{to:"/company/settings/instance/experimental",label:"Experimental",icon:Sn}),l("instance.cordis-plugins")&&(0,e.jsx)(g,{to:"/company/settings/instance/cordis-plugins",label:"Plugins",icon:Hs}),f&&v.length>0?(0,e.jsx)("div",{className:"ml-4 mt-1 flex flex-col gap-0.5 border-l border-border/70 pl-3",children:v.map(i=>(0,e.jsx)($e,{to:`${ct}/plugins/${i.id}`,state:we,className:n(({isActive:y})=>["rounded-md px-2 py-1.5 text-xs transition-colors",y?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"].join(" "),"className"),children:i.manifestJson.displayName??i.packageName},i.id))}):null,l("instance.adapters")&&(0,e.jsx)(g,{to:"/company/settings/instance/adapters",label:"Adapters",icon:pa})]})})]})}n(Ya,"CompanySettingsSidebar");function Ja(){const{pathname:s}=he(),{selectedCompany:t}=te(),{isMobile:r,setSidebarOpen:p}=ee(),{enabled:a}=Wt(),l=wt.filter(m=>!mt(m.key)||a);if(s.endsWith("/apps/chat/connect"))return(0,e.jsx)(Kn,{NavItem:g});const f=s.match(/\/apps\/chat\/([^/]+)(?:\/(?:settings|access|conversations|activity)|\/reviews(?:\/[^/]+)?)?\/?$/);return f?(0,e.jsx)(ka,{endpointId:f[1],NavItem:g}):(0,e.jsxs)("aside",{className:"w-full h-full min-h-0 border-r border-border bg-background flex flex-col",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1 px-3 py-3 shrink-0",children:[(0,e.jsxs)(J,{to:"/dashboard",onClick:n(()=>{r&&p(!1)},"onClick"),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,e.jsx)(Fe,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:t?.name??"Company"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1",children:[(0,e.jsx)(Xe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,e.jsx)("span",{className:"flex-1 truncate text-sm font-bold text-foreground",children:"Connectors"})]})]}),(0,e.jsxs)("nav",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-auto-hide px-3 py-2",children:[(0,e.jsx)("div",{className:"px-3 pb-1 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:"Connectors"}),(0,e.jsx)("div",{className:"flex flex-col gap-0.5",children:(0,e.jsx)(g,{to:"/apps",label:"All plugins",icon:dt,end:!0})}),(0,e.jsx)("div",{className:"px-3 pb-1 pt-4 text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:"Developer"}),(0,e.jsx)("p",{className:"px-3 pb-1.5 text-(length:--text-micro) leading-snug text-muted-foreground/70",children:"Advanced setup for developers. Most teams never open this."}),(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,e.jsx)(g,{to:"/apps/connections",label:"Connections",icon:Xe,end:!0}),l.map(m=>(0,e.jsx)(g,{to:ja(m.key),label:m.label,icon:m.icon,end:!0},m.key))]})]})]})}n(Ja,"AppsSidebar");function eo(s){const{selectedCompanyId:t}=te(),{isMobile:r,setSidebarOpen:p}=ee(),a=z({queryKey:_.tools.connection(s.kind==="connection"?s.connectionId:"__none__"),queryFn:n(()=>fe.getConnection(s.kind==="connection"?s.connectionId:""),"queryFn"),enabled:s.kind==="connection"&&!!s.connectionId}),l=z({queryKey:_.tools.applications(t??"__none__"),queryFn:n(()=>fe.listApplications(t),"queryFn"),enabled:s.kind==="application"&&!!t}),f=z({queryKey:_.tools.connections(t??"__none__"),queryFn:n(()=>fe.listConnections(t),"queryFn"),enabled:s.kind==="application"&&!!t}),m=z({queryKey:_.apps.gallery(t??"__none__"),queryFn:n(()=>fe.listGallery(t),"queryFn"),enabled:!!t}),x=a.data,o=s.kind==="application"?(l.data?.applications??[]).find(w=>w.id===s.applicationId):null,h=to(s.kind==="application"?(f.data?.connections??[]).filter(w=>w.applicationId===s.applicationId):[]),v=x?ra(x):o?.name??"App",i=no(m.data?.apps??[],x,o??void 0),y=x?.id??h?.id??null,N=z({queryKey:_.apps.connectionReviewCounts(t??"__none__",y??"__none__"),queryFn:n(()=>fe.getConnectionReviewCounts(y),"queryFn"),enabled:!!t&&!!y,refetchInterval:3e4}),j=(N.data?.pendingActionRequestCount??0)+((N.data?.quarantinedCatalogEntryCount??0)>0?1:0);return(0,e.jsxs)("aside",{className:"flex h-full min-h-0 w-full flex-col border-r border-border bg-background",children:[(0,e.jsxs)("div",{className:"flex shrink-0 flex-col gap-3 px-3 py-3",children:[(0,e.jsxs)(J,{to:"/apps/connections",onClick:n(()=>{r&&p(!1)},"onClick"),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,e.jsx)(Fe,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:"All apps"})]}),(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2 px-2 py-1",children:[(0,e.jsx)(Fn,{name:v,logoUrl:Nt(i),size:28}),(0,e.jsx)("span",{className:"flex-1 truncate text-sm font-bold text-foreground",children:v})]})]}),(0,e.jsx)("nav",{className:"scrollbar-auto-hide min-h-0 flex-1 overflow-y-auto px-3 py-2",children:(0,e.jsx)("div",{className:"flex flex-col gap-0.5",children:nt.map(w=>(0,e.jsx)(g,{to:so(s,w.key),label:w.label,icon:w.icon,end:!0,badge:w.key==="review"&&j>0?j:void 0,badgeTone:"danger",badgeLabel:"needing review"},w.key))})})]})}n(eo,"AppDetailSidebar");function so(s,t){return s.kind==="connection"?Us(s.connectionId,t):Bn(s.applicationId,t)}n(so,"tabHref");function no(s,t,r){if(r?.applicationKey){const a=s.find(l=>os(l)===r.applicationKey);if(a)return a}const p=(t?.name??r?.name)?.toLowerCase();return p?s.find(a=>sa(a).toLowerCase()===p)??s.find(a=>os(a)===p)??null:null}n(no,"galleryEntryFor");function to(s){const t=s.filter(r=>r.status==="archived");return t.length===0?null:t.reduce((r,p)=>{const a=new Date(r.updatedAt??r.createdAt??0).getTime();return new Date(p.updatedAt??p.createdAt??0).getTime()>a?p:r})}n(to,"latestArchivedConnection");function Me({identifier:s}){return s?(0,e.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:s}):null}n(Me,"CrumbIdentifier");function ao({context:s}){const{slots:t}=We({slotTypes:["globalToolbarButton"],companyId:s.companyId}),{launchers:r}=rn({placementZones:["globalToolbarButton"],companyId:s.companyId,enabled:!!s.companyId});return(0,e.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1 pl-2 empty:hidden",children:[t.length>0?(0,e.jsx)(Oe,{slotTypes:["globalToolbarButton"],context:s,className:"flex items-center gap-1"}):null,r.length>0?(0,e.jsx)(Cs,{placementZones:["globalToolbarButton"],context:s,className:"flex items-center gap-1"}):null]})}n(ao,"GlobalToolbar");function oo(){const{breadcrumbs:s,mobileToolbar:t}=Rt(),{toggleSidebar:r,isMobile:p}=ee(),{selectedCompanyId:a,selectedCompany:l}=te(),f=(0,d.useMemo)(()=>({companyId:a??null,companyPrefix:l?.issuePrefix??null}),[a,l?.issuePrefix]),m=(0,e.jsx)(ao,{context:f});if(p&&t)return(0,e.jsx)("div",{className:"border-b border-border px-2 h-12 shrink-0 flex items-center",children:t});if(s.length===0)return(0,e.jsx)("div",{className:"border-b border-border px-4 md:px-6 h-12 shrink-0 flex items-center justify-end",children:m});const x=p&&(0,e.jsx)(ke,{variant:"ghost",size:"icon-sm",className:"mr-2 shrink-0",onClick:r,"aria-label":"Open sidebar",children:(0,e.jsx)(jt,{className:"h-5 w-5"})});return s.length===1?(0,e.jsxs)("div",{className:"border-b border-border px-4 md:px-6 h-12 shrink-0 flex items-center",children:[x,(0,e.jsx)("div",{className:"min-w-0 overflow-hidden flex-1",children:s[0].leading||s[0].identifier?(0,e.jsxs)("h1",{className:"flex items-center gap-1.5 text-sm font-semibold uppercase tracking-wider",children:[s[0].leading&&(0,e.jsx)("span",{className:"flex shrink-0 items-center",children:s[0].leading}),(0,e.jsx)(Me,{identifier:s[0].identifier}),(0,e.jsx)("span",{className:"truncate",children:s[0].label})]}):(0,e.jsx)("h1",{className:"text-sm font-semibold uppercase tracking-wider truncate",children:s[0].label})}),m]}):(0,e.jsxs)("div",{className:"border-b border-border px-4 md:px-6 h-12 shrink-0 flex items-center",children:[x,(0,e.jsx)("div",{className:"min-w-0 overflow-hidden flex-1",children:(0,e.jsx)(Ht,{className:"min-w-0 overflow-hidden",children:(0,e.jsx)(rt,{className:"flex-nowrap",children:s.map((o,h)=>{const v=h===s.length-1;return(0,e.jsxs)(d.Fragment,{children:[h>0&&(0,e.jsx)(ma,{}),(0,e.jsx)(la,{className:v?"min-w-0":"shrink-0",children:v||!o.href?o.leading||o.identifier?(0,e.jsxs)(rs,{className:"flex min-w-0 items-center gap-1.5",children:[o.leading&&(0,e.jsx)("span",{className:"flex shrink-0 items-center",children:o.leading}),(0,e.jsx)(Me,{identifier:o.identifier}),(0,e.jsx)("span",{className:"truncate",children:o.label})]}):(0,e.jsx)(rs,{className:"truncate",children:o.label}):(0,e.jsx)(_t,{asChild:!0,children:o.leading||o.identifier?(0,e.jsxs)(J,{to:o.href,onClick:o.onClick,className:"flex items-center gap-1.5",children:[o.leading&&(0,e.jsx)("span",{className:"flex shrink-0 items-center",children:o.leading}),(0,e.jsx)(Me,{identifier:o.identifier}),(0,e.jsx)("span",{className:"truncate",children:o.label})]}):(0,e.jsx)(J,{to:o.href,onClick:o.onClick,children:o.label})})})]},h)})})})}),m]})}n(oo,"BreadcrumbBar");var ve=240,Be=208,qe=420,ds=16;function Se(s){return Math.min(qe,Math.max(Be,s))}n(Se,"clampSidebarWidth");function us(s){if(typeof window>"u")return ve;try{const t=window.localStorage.getItem(s);if(!t)return ve;const r=Number.parseInt(t,10);return Number.isFinite(r)?Se(r):ve}catch{return ve}}n(us,"readStoredSidebarWidth");function ps(s,t){if(!(typeof window>"u"))try{window.localStorage.setItem(s,String(Se(t)))}catch{}}n(ps,"writeStoredSidebarWidth");function ro({children:s,open:t,resizable:r=!1,storageKey:p="paperclip.sidebar.width",className:a}){const[l,f]=(0,d.useState)(()=>us(p)),[m,x]=(0,d.useState)(!1),o=(0,d.useRef)(l),h=(0,d.useRef)(null);(0,d.useEffect)(()=>{const u=us(p);o.current=u,f(u)},[p]);const v=r&&t,i=(0,d.useMemo)(()=>({width:t?`${l}px`:"0px"}),[t,l]),y=(0,d.useCallback)(u=>{const S=Se(u);o.current=S,f(S),ps(p,S)},[p]),N=(0,d.useCallback)(u=>{v&&(u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),h.current={startX:u.clientX,startWidth:o.current},x(!0))},[v]),j=(0,d.useCallback)(u=>{if(!h.current)return;const S=Se(h.current.startWidth+u.clientX-h.current.startX);o.current=S,f(S)},[]),w=(0,d.useCallback)(()=>{h.current&&(h.current=null,x(!1),ps(p,o.current))},[p]),I=(0,d.useCallback)(u=>{v&&(u.key==="ArrowLeft"?(u.preventDefault(),y(l-ds)):u.key==="ArrowRight"?(u.preventDefault(),y(l+ds)):u.key==="Home"?(u.preventDefault(),y(Be)):u.key==="End"&&(u.preventDefault(),y(qe)))},[v,y,l]);return(0,e.jsx)("div",{className:E("relative h-full shrink-0",a),style:i,children:(0,e.jsxs)("div",{className:"absolute inset-y-0 left-0 flex flex-col overflow-hidden z-0",style:i,children:[s,v?(0,e.jsx)("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical","aria-valuemin":Be,"aria-valuemax":qe,"aria-valuenow":l,tabIndex:0,className:E("absolute inset-y-0 right-0 z-20 w-3 cursor-col-resize touch-none outline-none","before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-transparent before:transition-colors","hover:before:bg-border focus-visible:before:bg-ring",m&&"before:bg-ring"),onPointerDown:N,onPointerMove:j,onPointerUp:w,onPointerCancel:w,onLostPointerCapture:w,onKeyDown:I}):null]})})}n(ro,"SidebarShell");function io({children:s,className:t}){return(0,e.jsx)("div",{"data-secondary-sidebar":"",className:E("h-full w-60 shrink-0 overflow-y-auto border-r border-border bg-background",t),children:s})}n(io,"SecondarySidebar");var lo="/company/settings/members?tab=invites",co="https://docs.paperclip.ing/",uo="https://paperclip.ing/feedback";function po(s){const t=s.trim().split(/\s+/).filter(Boolean);return t.length>=2?`${t[0]?.[0]??""}${t[t.length-1]?.[0]??""}`.toUpperCase():s.slice(0,2).toUpperCase()}n(po,"deriveInitials");function ms({label:s,description:t,icon:r,onClick:p,href:a,external:l=!1,topLevel:f=!1}){const m="flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-accent/60",x=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"mt-0.5 rounded-lg border border-border bg-background/70 p-2 text-muted-foreground",children:(0,e.jsx)(r,{className:"size-4"})}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm font-medium text-foreground",children:s}),(0,e.jsx)("span",{className:"block text-xs text-muted-foreground",children:t})]})]});return a?l?(0,e.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:m,onClick:p,children:x}):f?(0,e.jsx)("a",{href:a,className:m,onClick:p,children:x}):(0,e.jsx)(J,{to:a,className:m,onClick:p,children:x}):(0,e.jsx)("button",{type:"button",className:m,onClick:p,children:x})}n(ms,"MenuAction");function xs({deploymentMode:s,open:t,onOpenChange:r}){const p=Ue(),a=!!p,{hidden:l,loaded:f}=Qe(),{inviteUrl:m,slackFeedback:x}=kt(p),o=Ot(!a),h=a?m:o?lo:null,v=f&&h!==null&&!je(l,"company.members")&&!je(l,"company.invites"),[i,y]=(0,d.useState)(!1),{isMobile:N,setSidebarOpen:j}=ee(),w=t??i,I=et(w),u=r??y,{data:S}=z({queryKey:_.auth.session,queryFn:n(()=>Ge.getSession(),"queryFn")}),R=ks({onSignedOut:q}),L=S?.user.name?.trim()||"Board",A=S?.user.email?.trim()||(s==="authenticated"?"Signed in":"Local workspace board"),k=po(L),B=yn(S?.user);function q(){u(!1),N&&j(!1)}n(q,"closeNavigationChrome");function F(){R.mutate()}return n(F,"handleSignOut"),(0,e.jsx)("div",{className:"border-t border-r border-border bg-background px-3 py-2",children:(0,e.jsxs)("div",{className:"flex items-center gap-0.5 px-2",children:[(0,e.jsxs)(Js,{open:w,onOpenChange:u,children:[(0,e.jsx)(on,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",className:E("flex min-w-0 items-center gap-2.5 rounded-lg text-left text-(length:--text-compact) font-medium text-foreground/80 transition-colors hover:bg-accent/50 hover:text-foreground","flex-1 px-2 py-1.5"),"aria-label":"Open account menu",children:[(0,e.jsxs)(ss,{size:"sm",children:[S?.user.image?(0,e.jsx)(ts,{src:S.user.image,alt:L}):null,(0,e.jsx)(Ye,{children:k})]}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:L})]})}),(0,e.jsxs)(Hn,{side:"top",align:"start",sideOffset:10,className:"w-(--sz-277px) max-w-(--sz-calc-24) overflow-hidden rounded-t-2xl rounded-b-none border-border p-0 shadow-2xl",children:[(0,e.jsx)("div",{className:"h-24 bg-(image:--gradient-extract-25)"}),(0,e.jsxs)("div",{className:"-mt-8 px-4 pb-4",children:[(0,e.jsxs)("div",{className:"relative flex items-start gap-3",children:[(0,e.jsx)(J,{to:B,"aria-label":"View profile",onClick:q,className:"absolute inset-0 rounded-xl transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),(0,e.jsx)("div",{className:"pointer-events-none relative rounded-2xl border-4 border-popover bg-popover p-0.5 shadow-sm",children:(0,e.jsxs)(ss,{size:"lg",children:[S?.user.image?(0,e.jsx)(ts,{src:S.user.image,alt:L}):null,(0,e.jsx)(Ye,{children:k})]})}),(0,e.jsxs)("div",{className:"pointer-events-none relative min-w-0 flex-1 pt-1",children:[(0,e.jsx)("h2",{className:"truncate text-base font-semibold text-foreground",children:L}),(0,e.jsx)("p",{className:"truncate text-sm text-muted-foreground",children:A}),I?(0,e.jsxs)("a",{className:"pointer-events-auto block truncate font-mono text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-muted-foreground hover:underline focus-visible:underline",href:`https://github.com/paperclipai/paperclip/commit/${I}`,target:"_blank",rel:"noreferrer","aria-label":`View commit ${I} on GitHub`,title:I,children:["SHA ",I.slice(0,7)]}):null]})]}),(0,e.jsxs)("div",{className:"mt-4 space-y-1",children:[v&&h?(0,e.jsx)(ms,{label:"Invite",description:"Invite people to your organization.",icon:Is,href:h,topLevel:a,onClick:q}):null,(0,e.jsx)(ms,{label:"Documentation",description:"Open Microvac docs in a new tab.",icon:Ma,href:co,external:!0,onClick:n(()=>u(!1),"onClick")}),(0,e.jsx)(aa,{variant:"menu-action",onAfterToggle:n(()=>u(!1),"onAfterToggle")}),s==="authenticated"?(0,e.jsxs)("button",{type:"button",className:E("flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-destructive/10",R.isPending&&"cursor-not-allowed opacity-60"),onClick:F,disabled:R.isPending,children:[(0,e.jsx)("span",{className:"mt-0.5 rounded-lg border border-border bg-background/70 p-2 text-muted-foreground",children:(0,e.jsx)(Ie,{className:"size-4"})}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm font-medium text-foreground",children:R.isPending?"Signing out...":"Sign out"}),(0,e.jsx)("span",{className:"block text-xs text-muted-foreground",children:"End this browser session."})]})]}):null,(0,e.jsx)(dn,{})]})]})]})]}),x&&(0,e.jsx)(Zt,{feedback:x,className:"hover:bg-accent/50"}),a?null:(0,e.jsxs)(ya,{children:[(0,e.jsx)(Ra,{asChild:!0,children:(0,e.jsx)("a",{href:uo,target:"_blank",rel:"noreferrer","aria-label":"Share feedback",className:"flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground/50 transition-colors hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,e.jsx)(oa,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,e.jsx)(Ea,{side:"top",children:"Share feedback"})]})]})})}n(xs,"SidebarAccountMenu");function mo(s,t){return Ds(s,t)[0]?.toLowerCase()??null}n(mo,"getCompanyRouteSegment");function Ds(s,t){if(!t)return[];const r=s.split("/").filter(Boolean);return r.length<2?[]:r[0]?.toUpperCase()!==t.toUpperCase()?[]:r.slice(1)}n(Ds,"getCompanyPathSegments");function bo(){const s=qt(),{sidebarOpen:t,setSidebarOpen:r,toggleSidebar:p,isMobile:a}=ee(),{openNewIssue:l,openOnboarding:f}=Ne(),{togglePanelVisible:m}=ft(),x=Xt()?.pushToast??null,{companies:o,loading:h,selectedCompany:v,selectedCompanyId:i,selectionSource:y,setSelectedCompanyId:N}=te(),{companyPrefix:j,pluginRoutePath:w}=ot(),I=Ns(),u=he(),S=Pt(),R=_n(u.pathname,j).isTaskDetail,L=["/company/settings","/company/export","/company/import"].some(P=>u.pathname.includes(P)),A=Ds(u.pathname,j);A[0]?.toLowerCase();const k=A[0]?.toLowerCase()==="apps"&&A[1]?.toLowerCase()==="app"&&A[2]?A[2]:null,B=(0,d.useRef)(!1),q=(0,d.useRef)(null),F=(0,d.useRef)(null),G=(0,d.useRef)(new Xn),T=(0,d.useRef)(u.key),W=Kt(a,u.pathname),Q=ht(!0),[ce,M]=(0,d.useState)(!1),D=(0,d.useMemo)(()=>{if(!j)return null;const P=j.toUpperCase();return o.find(K=>K.issuePrefix.toUpperCase()===P)??null},[o,j]),se=!!j&&!h&&o.length>0&&!D,ae=(0,d.useMemo)(()=>w?.toLowerCase()??mo(u.pathname,j),[j,u.pathname,w]),C=D?.id??null,H=D?.issuePrefix??null,{slots:V}=We({slotTypes:["page","routeSidebar"],companyId:C,enabled:!!(C&&ae)}),X=(0,d.useMemo)(()=>$s(V,ae),[ae,V]),ne=(0,d.useMemo)(()=>({companyId:C,companyPrefix:H}),[C,H]),oe=L?(0,e.jsx)(Ya,{}):k?(0,e.jsx)(eo,{kind:"application",applicationId:k}):ea(A,!0)?(0,e.jsx)(Ja,{}):X?(0,e.jsx)(st,{slot:X,context:ne,className:"h-full w-full",missingBehavior:"placeholder"}):null,de=oe!=null,{data:Z}=z({queryKey:_.health,queryFn:n(()=>Qn.get(),"queryFn"),refetchInterval:n(P=>P.state.data?.devServer?.enabled?2e3:!1,"refetchInterval"),refetchIntervalInBackground:!1});(0,d.useEffect)(()=>{h||B.current||Z?.deploymentMode!=="authenticated"&&(Z?.cloud||o.length===0&&(B.current=!0,f()))},[o,h,f,Z?.cloud,Z?.deploymentMode]),(0,d.useEffect)(()=>{if(!j||h||o.length===0)return;if(!D){const K=(i?o.find(re=>re.id===i):null)??o[0]??null;K&&i!==K.id&&N(K.id,{source:"route_sync"});return}if(j!==D.issuePrefix){const K=u.pathname.replace(/^\/[^/]+/,"");I(`/${D.issuePrefix}${K}${u.search}`,{replace:!0});return}const P=it({matchedCompany:D,selectedCompanyId:i,companies:o});if(P){x?.({title:`${D.name} is archived`,body:`Switched to ${P.name}.`,tone:"info",dedupeKey:`archived-company-bounce:${D.id}`}),N(P.id,{source:"route_sync"}),I(`/${P.issuePrefix}/dashboard`,{replace:!0});return}xa({selectionSource:y,selectedCompanyId:i,routeCompanyId:D.id})&&N(D.id,{source:"route_sync"})},[j,o,h,D,u.pathname,u.search,I,x,y,i,N]);const Ae=m,Pe=(0,d.useCallback)(()=>{document.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0,cancelable:!0}))},[]);return ga(),vt({onNewIssue:n(()=>l(),"onNewIssue"),onSearch:Pe,onToggleSidebar:p,onTogglePanel:Ae,onShowShortcuts:n(()=>M(!0),"onShowShortcuts"),onGoToInbox:n(()=>I("/inbox"),"onGoToInbox")}),(0,d.useEffect)(()=>{if(!a)return;const P=30,K=50,re=75;let ie=0,ue=0;const le=n(me=>{const Y=me.touches[0];ie=Y.clientX,ue=Y.clientY},"onTouchStart"),ge=n(me=>{const Y=me.changedTouches[0],be=Y.clientX-ie;if(!(Math.abs(Y.clientY-ue)>re)){if(!t&&ie<P&&be>K){r(!0);return}t&&be<-50&&r(!1)}},"onTouchEnd");return document.addEventListener("touchstart",le,{passive:!0}),document.addEventListener("touchend",ge,{passive:!0}),()=>{document.removeEventListener("touchstart",le),document.removeEventListener("touchend",ge)}},[a,t,r]),(0,d.useEffect)(()=>{const P=document.body.style.overflow;return document.body.style.overflow=a?"visible":"clip",()=>{document.body.style.overflow=P}},[a]),(0,d.useEffect)(()=>{if(!a)return ca()},[a]),(0,d.useEffect)(()=>{if(typeof document>"u")return;const P=F.current;return Et(P)},[u.pathname]),(0,d.useEffect)(()=>{const P=F.current;if(!P)return;const K=n(()=>{G.current.remember(T.current,P.scrollTop)},"recordScroll");return P.addEventListener("scroll",K,{passive:!0}),()=>P.removeEventListener("scroll",K)},[]),(0,d.useLayoutEffect)(()=>{const P=F.current,K=bn({previousPathname:q.current,pathname:u.pathname,navigationType:S,state:u.state});q.current=u.pathname;const re=S==="POP",ie=re?G.current.recall(u.key):0;if(T.current=u.key,re){es(P,ie);const ue=requestAnimationFrame(()=>es(P,ie));return()=>cancelAnimationFrame(ue)}K&&na(P)},[u.key,u.pathname,u.state,S]),(0,e.jsx)(Cn,{children:(0,e.jsxs)("div",{ref:Q,"data-mobile":a?"true":void 0,className:E("paperclip-app-shell bg-background text-foreground pt-(--sz-safe-top)",a?"min-h-dvh overflow-x-clip":"flex h-dvh flex-col overflow-clip"),children:[(0,e.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-(--z-200) focus:rounded-md focus:bg-background focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Skip to Main Content"}),(0,e.jsx)(Gn,{}),(0,e.jsx)(Ia,{devServer:Z?.devServer}),(0,e.jsxs)("div",{className:E("app-main-row min-h-0 flex-1",a?"w-full":"flex overflow-clip"),children:[a&&t&&(0,e.jsx)("button",{type:"button",className:"fixed inset-0 z-40 bg-black/50",onClick:n(()=>r(!1),"onClick"),"aria-label":"Close sidebar"}),a?(0,e.jsxs)("div",{className:E("fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden pt-(--sz-safe-top) transition-transform duration-100 ease-out",t?"translate-x-0":"-translate-x-full"),children:[(0,e.jsx)("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:(0,e.jsx)("div",{className:"w-60 shrink-0 overflow-hidden",children:de?oe:(0,e.jsx)(cs,{})})}),(0,e.jsx)(xs,{deploymentMode:Z?.deploymentMode})]}):(0,e.jsx)(ro,{open:t,resizable:!0,storageKey:s?"paperclip.design-proposals.sandbox.sidebar-width":void 0,children:s?(0,e.jsx)(fn,{}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex flex-1 min-h-0",children:(0,e.jsx)(cs,{})}),(0,e.jsx)(xs,{deploymentMode:Z?.deploymentMode})]})}),!a&&de?(0,e.jsx)(io,{children:oe}):null,(0,e.jsxs)("div",{className:E("app-content-column flex min-w-0 flex-col",a?"w-full":"h-full flex-1"),children:[(0,e.jsxs)("div",{className:E("app-breadcrumb",a&&"sticky top-0 z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/85"),children:[(0,e.jsx)(Zs,{mobile:a}),(0,e.jsx)(oo,{}),a&&L?(0,e.jsx)("div",{className:"border-b border-border px-4 pb-3",children:(0,e.jsx)(tn,{})}):null]}),(0,e.jsxs)("div",{className:E("app-content-row",a?"block":"flex flex-1 min-h-0"),children:[(0,e.jsx)("main",{id:"main-content",ref:F,tabIndex:-1,style:a?{"--tc-composer-bottom":W?"var(--tc-composer-visible-nav-offset)":"var(--sz-calc-8)","--mobile-nav-motion-duration":W?"var(--motion-mobile-nav-enter)":"var(--motion-mobile-nav-exit)","--mobile-nav-motion-ease":W?"var(--motion-ease-out-expo)":"var(--motion-ease-standard)"}:void 0,className:E("flex-1 p-4 outline-none md:p-6",a?R?"overflow-visible pb-(--tc-composer-visible-nav-offset)":"overflow-visible pb-(--sz-calc-14)":"overflow-auto [scrollbar-gutter:stable]"),children:se?(0,e.jsx)(Qt,{scope:"invalid_company_prefix",requestedPrefix:j??v?.issuePrefix}):(0,e.jsx)($n,{children:(0,e.jsx)(Ct,{})})}),(0,e.jsx)(vn,{})]})]})]}),a&&(0,e.jsx)(Ln,{visible:W}),(0,e.jsx)(kn,{}),(0,e.jsx)(Gs,{}),(0,e.jsx)(wa,{}),(0,e.jsx)(hn,{open:ce,onOpenChange:M}),(0,e.jsx)(ln,{}),(0,e.jsx)(Bt,{localTrusted:Z?.deploymentMode==="local_trusted"})]})})}n(bo,"Layout");export{bo as Layout};
@@ -1 +1 @@
1
- var X=Object.defineProperty;var a=(i,r)=>X(i,"name",{value:r,configurable:!0});import{a as D}from"./rolldown-runtime-DhZMWcEn.js";import{S as ee}from"./issue-detail-4PCbYpdv.js";import{$A as se,E_ as k,Gb as P,Iw as ne,ME as te,Mb as ae,NE as h,Nb as re,QC as E,Sp as ie,__ as O,aE as oe,ab as S,bE as A,hE as _,nj as ce,uE as j,ub as L,uv as F,xE as B,zE as de}from"./index-Bt31d8ga.js";import{n as le}from"./connection-owner-D-ikSHyR.js";var g=D(ce(),1),e=D(se(),1),U=/^[A-Za-z0-9_-]{32}$/;function W({origin:i}){const[r,c]=(0,g.useState)(!1);let d;try{const o=new URL(i);o.origin==="https://claude.ai"?d="/brands/claude-color.svg":["https://chatgpt.com","https://chat.openai.com","https://openai.com"].includes(o.origin)&&(d="/brands/codex-color.svg")}catch{}return(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d&&!r?(0,e.jsx)("img",{src:d,alt:"",className:"size-4 shrink-0 object-contain",referrerPolicy:"no-referrer",crossOrigin:"anonymous",onError:a(()=>c(!0),"onError")}):(0,e.jsx)(ne,{className:"size-4 shrink-0","aria-hidden":"true"}),(0,e.jsx)("bdi",{className:"min-w-0 break-all",children:i})]})}a(W,"ClientOrigin");function je({agentPairingOnly:i=!1}={}){const{id:r=""}=oe();return(0,e.jsx)(Q,{id:r,agentPairingOnly:i},r)}a(je,"McpConnectPage");function fe({initialCode:i}={}){const[r,c]=(0,g.useState)(i??new URLSearchParams(window.location.search).get("user_code")??""),[d,o]=(0,g.useState)(r);return d?(0,e.jsx)(Q,{id:d,device:!0,onEditCode:a(()=>o(""),"onEditCode")},d):(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(k,{className:"space-y-4 p-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(E,{className:"size-8 shrink-0"}),(0,e.jsx)("h1",{className:"min-w-0 text-xl font-semibold",children:"Connect your assistant to Microvac"})]}),(0,e.jsxs)("form",{className:"space-y-4",onSubmit:a(n=>{n.preventDefault(),o(r.trim())},"onSubmit"),children:[(0,e.jsx)("label",{htmlFor:"device-code",className:"text-sm",children:"Enter the code shown by your assistant"}),(0,e.jsx)(O,{id:"device-code",autoComplete:"off",value:r,onChange:a(n=>c(n.target.value),"onChange"),required:!0,maxLength:12}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(h,{type:"submit",children:"Continue"})})]})]})})}a(fe,"McpDevicePage");function Q({id:i,device:r=!1,agentPairingOnly:c=!1,onEditCode:d}){const o=c?"/dot-mcp/requests":"/mcp/requests",[n,N]=(0,g.useState)(""),[f,v]=(0,g.useState)(""),[T,K]=(0,g.useState)(!0),[q,Y]=(0,g.useState)(null),$=B({queryKey:[r?"mcp-device":c?"dot-mcp-request":"mcp-request",i],queryFn:a(()=>j.get(r?`/mcp/device?user_code=${encodeURIComponent(i)}`:`${o}/${encodeURIComponent(i)}`),"queryFn")}),p=L($),s=$.data,C=f.trim(),b=!!s?.agentConnection&&!r&&U.test(C),u=ee({key:["dot-pairing-preview",o,i,C],enabled:b,fetcher:a(t=>j.post(`${o}/${encodeURIComponent(i)}/dot-pairing/preview`,{pairingCode:C},{signal:t}),"fetcher")}),l=b&&(u.view.kind==="ready"||u.view.kind==="stale")?u.data??null:null,G=b&&(u.view.kind==="loading"||u.view.kind==="reconnecting"),I=s?.requestedCompanyId??(n||s?.companies[0]?.id||"");(0,g.useEffect)(()=>{!n&&!s?.requestedCompanyId&&s?.companies[0]&&N(s.companies[0].id)},[n,s]);const R=s?.clientName.trim(),V=R&&!/^(assistant|mcp client)$/i.test(R)?R:"your assistant",w=s?.clientOrigin||s?.redirectOrigin,m=s?.companies.find(t=>t.id===I),z=!!(!s?.agentConnection&&m?.canWrite&&T),Z=!!(s?.requestedWrite&&z),H=!!(s?.requestedConfigure&&z),x=A({mutationFn:a(t=>j.post(r?"/mcp/device/consent":`/mcp/requests/${encodeURIComponent(i)}/consent`,{decision:t,companyId:I||void 0,allowWrites:t==="approve"&&Z,allowConfiguration:t==="approve"&&H,...r?{userCode:i}:{}}),"mutationFn"),onSuccess:a(({redirectUrl:t,status:M})=>{r&&M?Y(M):t&&window.location.assign(t)},"onSuccess")}),y=A({mutationFn:a(()=>j.post(`${o}/${encodeURIComponent(i)}/dot-pairing`,{pairingCode:f.trim()}),"mutationFn"),onSuccess:a(({redirectUrl:t})=>{v(""),window.location.assign(t)},"onSuccess")});if(q)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(k,{className:"block space-y-4 p-6",children:[(0,e.jsx)(E,{className:"size-8"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:q==="approved"?"Access approved":"Connection declined"}),(0,e.jsx)("p",{className:"text-sm",children:q==="approved"?"Return to your assistant. It will finish connecting automatically.":"No access was granted. You can start a new connection from your assistant."}),(0,e.jsx)(h,{variant:"outline",asChild:!0,children:(0,e.jsx)(P,{to:"/",children:"Back to Microvac"})})]})});const J=r?`/mcp-device?user_code=${encodeURIComponent(i)}`:`${c?"/dot-connect":"/mcp-connect"}/${i}`;return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(k,{className:"block space-y-4 p-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(E,{className:"size-8 shrink-0 text-foreground",role:"img","aria-label":"Microvac"}),(0,e.jsxs)("h1",{className:"min-w-0 break-words text-xl font-semibold",children:["Connect ",(0,e.jsx)("bdi",{children:V})," to Microvac"]})]}),w&&(0,e.jsx)(W,{origin:w},w),!r&&s?.redirectOrigin&&s.redirectOrigin!==w&&(0,e.jsx)(W,{origin:s.redirectOrigin},s.redirectOrigin),r&&(0,e.jsxs)("p",{className:"text-sm",children:["Confirm this matches the code shown by your assistant: ",(0,e.jsx)("strong",{className:de("font-mono","ph-no-capture"),children:i.toUpperCase()})]}),(p.kind==="loading"||p.kind==="reconnecting")&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading connection request…"}),p.kind==="error"&&(0,e.jsx)(S,{error:p.error,action:"load this connection request",onRetry:p.retry,retrying:p.isFetching}),p.kind==="error"&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Start a new connection from your assistant."}),r&&p.kind==="error"&&(0,e.jsx)(h,{variant:"outline",onClick:d,children:"Enter a different code"}),s?.agentConnection&&!r&&(0,e.jsxs)("form",{className:"space-y-3",onSubmit:a(t=>{t.preventDefault(),y.mutate()},"onSubmit"),children:[(0,e.jsx)("p",{className:"text-sm",children:"Enter the one-use code from Microvac’s agent setup to review this connection’s access. Keep the code out of Bot chat. Access is granted only when you approve the named agent below."}),(0,e.jsx)("label",{htmlFor:"dot-pairing-code",className:"text-sm",children:"Pairing code"}),(0,e.jsx)(O,{id:"dot-pairing-code",type:"password",autoComplete:"off",value:f,onChange:a(t=>v(t.target.value),"onChange"),required:!0,maxLength:32}),G&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Checking pairing code…"}),l?.providerKind==="grok_bot"&&(0,e.jsxs)("p",{className:"text-sm font-medium",children:["Allow this connection to work as ",l.agent.name," in ",l.company.name,"."]}),l&&(0,e.jsxs)("dl",{className:"space-y-2 rounded-md border border-border p-3 text-sm",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Company"}),(0,e.jsxs)("dd",{children:[l.company.name," ",(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",l.company.id,")"]})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Agent"}),(0,e.jsxs)("dd",{children:[l.agent.name," ",(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",l.agent.id,")"]})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Permissions"}),(0,e.jsx)("dd",{children:l.permissions})]}),l.authorizingPerson&&(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Authorized by"}),(0,e.jsx)("dd",{children:l.authorizingPerson})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Access duration"}),(0,e.jsx)("dd",{children:l.accessDuration})]})]}),b&&u.view.kind==="error"&&(0,e.jsx)(S,{size:"inline",error:u.error,action:"check this pairing code",onRetry:u.view.retry,retrying:u.view.isFetching}),y.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:_(y.error,{action:"connect Dot"}).body}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(h,{type:"submit",disabled:!l||!U.test(C)||y.isPending,children:y.isPending?"Connecting…":"Allow agent connection"})})]}),s&&(0,e.jsx)(e.Fragment,{children:s.requiresSignIn?(0,e.jsx)(h,{asChild:!0,children:(0,e.jsx)(P,{to:`/auth?next=${encodeURIComponent(J)}`,children:"Sign in / Create account"})}):(0,e.jsxs)(e.Fragment,{children:[s.requestedCompanyId?(0,e.jsxs)("div",{className:"flex items-center gap-4 rounded-md border border-border p-4",children:[m&&(0,e.jsx)(F,{companyName:m.name,logoUrl:m.logoUrl,className:"size-14 shrink-0 rounded-lg text-xl"}),(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Organization"}),m?(0,e.jsx)("p",{className:"break-words text-lg font-semibold",children:m.name}):(0,e.jsx)("p",{className:"text-sm text-destructive",children:"The selected organization is no longer available to this account. Cancel and reconnect from your assistant to choose an organization you can access."})]})]}):(0,e.jsxs)("fieldset",{className:"space-y-2",disabled:x.isPending,children:[(0,e.jsx)("legend",{className:"mb-2 text-sm font-medium",children:"Organization"}),s.companies.map(t=>(0,e.jsxs)("label",{className:"flex items-center gap-3 rounded-md border border-border p-3 text-sm",children:[(0,e.jsx)("input",{type:"radio",name:"company","aria-label":t.name,value:t.id,checked:I===t.id,onChange:a(()=>N(t.id),"onChange")}),(0,e.jsx)(F,{companyName:t.name,logoUrl:t.logoUrl,className:"size-12 shrink-0 rounded-lg"}),(0,e.jsx)("span",{className:"min-w-0 break-words font-medium",children:t.name})]},t.id)),!s.companies.length&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"This account has no available organizations. Ask an organization owner to add you, then reconnect from your assistant."})]}),(0,e.jsx)("p",{className:"text-sm",children:s.agentConnection?"Connect Dot as a Microvac agent. Pair it with an agent after connecting; assigned work uses that agent’s permissions.":"Read all of your Microvac data"}),(s.requestedWrite||s.requestedConfigure)&&!s.agentConnection&&(0,e.jsxs)("label",{htmlFor:"mcp-allow-writes",className:"flex items-start gap-3 text-sm leading-6",children:[(0,e.jsx)("span",{className:"flex h-6 shrink-0 items-center",children:(0,e.jsx)(ie,{id:"mcp-allow-writes",checked:z,disabled:!m?.canWrite||x.isPending,onCheckedChange:a(t=>K(t===!0),"onCheckedChange")})}),(0,e.jsx)("span",{children:"Write all of your Microvac data"})]}),m&&!m.canWrite&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your role in this organization is read-only."}),x.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:_(x.error).body}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)(h,{variant:"outline",disabled:x.isPending,onClick:a(()=>x.mutate("deny"),"onClick"),children:"Cancel"}),(0,e.jsx)(h,{className:"h-auto min-h-10 min-w-0 shrink whitespace-normal",disabled:!m||s.agentConnection&&!m.canWrite||x.isPending,onClick:a(()=>x.mutate("approve"),"onClick"),children:x.isPending?"Connecting…":s.agentConnection?"Connect Dot agent":"Connect organization"})]})]})})]})})}a(Q,"McpConnectRequest");function ye(){const i=te(),r=B({queryKey:["mcp-connections"],queryFn:a(()=>j.get("/mcp/connections"),"queryFn")}),c=L(r),d=r.data?.filter(n=>!n.revokedAt),o=A({mutationFn:a(n=>j.delete(`/mcp/connections/${n}`),"mutationFn"),onSuccess:a((n,N)=>(i.setQueryData(["mcp-connections"],f=>f?.filter(v=>v.id!==N)),i.invalidateQueries({queryKey:["mcp-connections"]})),"onSuccess")});return(0,e.jsxs)("div",{className:"mx-auto max-w-xl space-y-4 py-10",children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Assistant connections"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Revoking a connection stops its future tool calls. Work already delegated continues under your organization’s normal controls."}),(c.kind==="loading"||c.kind==="reconnecting")&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading connections…"}),c.kind==="error"&&(0,e.jsx)(S,{error:c.error,action:"load assistant connections",onRetry:c.retry,retrying:c.isFetching}),o.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:_(o.error,{action:"revoke the connection"}).body}),d?.length===0&&(0,e.jsx)("p",{className:"text-sm",children:"No assistant connections."}),d?.map(n=>(0,e.jsxs)(k,{className:"block space-y-2 p-4",children:[(0,e.jsx)("h2",{className:"font-medium",children:(0,e.jsx)(ae,{name:le(n),avatarUrl:n.user?.image,initials:re(n.user?.name??"You")})}),(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Organization: ",n.companyName]}),n.agent&&(0,e.jsxs)("p",{className:"text-sm",children:["Works as ",(0,e.jsx)(P,{className:"underline",to:`/${n.companyPrefix??n.companyId}/agents/${n.agent.id}/runtime`,children:n.agent.name}),n.user?` · Authorized by ${n.user.name}`:""]}),(0,e.jsx)("p",{className:"text-sm",children:n.scopes.includes("paperclip:agent")?"Agent connection":n.scopes.includes("paperclip:write")?"Read and edit work":"Read only"}),n.scopes.includes("paperclip:configure")&&(0,e.jsx)("p",{className:"text-sm",children:"Configure agents, projects and skills"}),(0,e.jsx)(h,{variant:"outline",disabled:o.isPending,onClick:a(()=>o.mutate(n.id),"onClick"),children:"Revoke connection"})]},n.id)),(0,e.jsx)(P,{className:"text-sm underline",to:"/",children:"Back to Microvac"})]})}a(ye,"AssistantConnectionsPage");export{ye as AssistantConnectionsPage,je as McpConnectPage,fe as McpDevicePage};
1
+ var X=Object.defineProperty;var a=(i,r)=>X(i,"name",{value:r,configurable:!0});import{a as D}from"./rolldown-runtime-DhZMWcEn.js";import{S as ee}from"./issue-detail-CZfjXs0M.js";import{$A as se,E_ as k,Gb as P,Iw as ne,ME as te,Mb as ae,NE as h,Nb as re,QC as E,Sp as ie,__ as O,aE as oe,ab as S,bE as A,hE as _,nj as ce,uE as j,ub as L,uv as F,xE as B,zE as de}from"./index-BJtnP7H1.js";import{n as le}from"./connection-owner-D8fNrFqC.js";var g=D(ce(),1),e=D(se(),1),U=/^[A-Za-z0-9_-]{32}$/;function W({origin:i}){const[r,c]=(0,g.useState)(!1);let d;try{const o=new URL(i);o.origin==="https://claude.ai"?d="/brands/claude-color.svg":["https://chatgpt.com","https://chat.openai.com","https://openai.com"].includes(o.origin)&&(d="/brands/codex-color.svg")}catch{}return(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d&&!r?(0,e.jsx)("img",{src:d,alt:"",className:"size-4 shrink-0 object-contain",referrerPolicy:"no-referrer",crossOrigin:"anonymous",onError:a(()=>c(!0),"onError")}):(0,e.jsx)(ne,{className:"size-4 shrink-0","aria-hidden":"true"}),(0,e.jsx)("bdi",{className:"min-w-0 break-all",children:i})]})}a(W,"ClientOrigin");function je({agentPairingOnly:i=!1}={}){const{id:r=""}=oe();return(0,e.jsx)(Q,{id:r,agentPairingOnly:i},r)}a(je,"McpConnectPage");function fe({initialCode:i}={}){const[r,c]=(0,g.useState)(i??new URLSearchParams(window.location.search).get("user_code")??""),[d,o]=(0,g.useState)(r);return d?(0,e.jsx)(Q,{id:d,device:!0,onEditCode:a(()=>o(""),"onEditCode")},d):(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(k,{className:"space-y-4 p-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(E,{className:"size-8 shrink-0"}),(0,e.jsx)("h1",{className:"min-w-0 text-xl font-semibold",children:"Connect your assistant to Microvac"})]}),(0,e.jsxs)("form",{className:"space-y-4",onSubmit:a(n=>{n.preventDefault(),o(r.trim())},"onSubmit"),children:[(0,e.jsx)("label",{htmlFor:"device-code",className:"text-sm",children:"Enter the code shown by your assistant"}),(0,e.jsx)(O,{id:"device-code",autoComplete:"off",value:r,onChange:a(n=>c(n.target.value),"onChange"),required:!0,maxLength:12}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(h,{type:"submit",children:"Continue"})})]})]})})}a(fe,"McpDevicePage");function Q({id:i,device:r=!1,agentPairingOnly:c=!1,onEditCode:d}){const o=c?"/dot-mcp/requests":"/mcp/requests",[n,N]=(0,g.useState)(""),[f,v]=(0,g.useState)(""),[T,K]=(0,g.useState)(!0),[q,Y]=(0,g.useState)(null),$=B({queryKey:[r?"mcp-device":c?"dot-mcp-request":"mcp-request",i],queryFn:a(()=>j.get(r?`/mcp/device?user_code=${encodeURIComponent(i)}`:`${o}/${encodeURIComponent(i)}`),"queryFn")}),p=L($),s=$.data,C=f.trim(),b=!!s?.agentConnection&&!r&&U.test(C),u=ee({key:["dot-pairing-preview",o,i,C],enabled:b,fetcher:a(t=>j.post(`${o}/${encodeURIComponent(i)}/dot-pairing/preview`,{pairingCode:C},{signal:t}),"fetcher")}),l=b&&(u.view.kind==="ready"||u.view.kind==="stale")?u.data??null:null,G=b&&(u.view.kind==="loading"||u.view.kind==="reconnecting"),I=s?.requestedCompanyId??(n||s?.companies[0]?.id||"");(0,g.useEffect)(()=>{!n&&!s?.requestedCompanyId&&s?.companies[0]&&N(s.companies[0].id)},[n,s]);const R=s?.clientName.trim(),V=R&&!/^(assistant|mcp client)$/i.test(R)?R:"your assistant",w=s?.clientOrigin||s?.redirectOrigin,m=s?.companies.find(t=>t.id===I),z=!!(!s?.agentConnection&&m?.canWrite&&T),Z=!!(s?.requestedWrite&&z),H=!!(s?.requestedConfigure&&z),x=A({mutationFn:a(t=>j.post(r?"/mcp/device/consent":`/mcp/requests/${encodeURIComponent(i)}/consent`,{decision:t,companyId:I||void 0,allowWrites:t==="approve"&&Z,allowConfiguration:t==="approve"&&H,...r?{userCode:i}:{}}),"mutationFn"),onSuccess:a(({redirectUrl:t,status:M})=>{r&&M?Y(M):t&&window.location.assign(t)},"onSuccess")}),y=A({mutationFn:a(()=>j.post(`${o}/${encodeURIComponent(i)}/dot-pairing`,{pairingCode:f.trim()}),"mutationFn"),onSuccess:a(({redirectUrl:t})=>{v(""),window.location.assign(t)},"onSuccess")});if(q)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(k,{className:"block space-y-4 p-6",children:[(0,e.jsx)(E,{className:"size-8"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:q==="approved"?"Access approved":"Connection declined"}),(0,e.jsx)("p",{className:"text-sm",children:q==="approved"?"Return to your assistant. It will finish connecting automatically.":"No access was granted. You can start a new connection from your assistant."}),(0,e.jsx)(h,{variant:"outline",asChild:!0,children:(0,e.jsx)(P,{to:"/",children:"Back to Microvac"})})]})});const J=r?`/mcp-device?user_code=${encodeURIComponent(i)}`:`${c?"/dot-connect":"/mcp-connect"}/${i}`;return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(k,{className:"block space-y-4 p-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(E,{className:"size-8 shrink-0 text-foreground",role:"img","aria-label":"Microvac"}),(0,e.jsxs)("h1",{className:"min-w-0 break-words text-xl font-semibold",children:["Connect ",(0,e.jsx)("bdi",{children:V})," to Microvac"]})]}),w&&(0,e.jsx)(W,{origin:w},w),!r&&s?.redirectOrigin&&s.redirectOrigin!==w&&(0,e.jsx)(W,{origin:s.redirectOrigin},s.redirectOrigin),r&&(0,e.jsxs)("p",{className:"text-sm",children:["Confirm this matches the code shown by your assistant: ",(0,e.jsx)("strong",{className:de("font-mono","ph-no-capture"),children:i.toUpperCase()})]}),(p.kind==="loading"||p.kind==="reconnecting")&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading connection request…"}),p.kind==="error"&&(0,e.jsx)(S,{error:p.error,action:"load this connection request",onRetry:p.retry,retrying:p.isFetching}),p.kind==="error"&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Start a new connection from your assistant."}),r&&p.kind==="error"&&(0,e.jsx)(h,{variant:"outline",onClick:d,children:"Enter a different code"}),s?.agentConnection&&!r&&(0,e.jsxs)("form",{className:"space-y-3",onSubmit:a(t=>{t.preventDefault(),y.mutate()},"onSubmit"),children:[(0,e.jsx)("p",{className:"text-sm",children:"Enter the one-use code from Microvac’s agent setup to review this connection’s access. Keep the code out of Bot chat. Access is granted only when you approve the named agent below."}),(0,e.jsx)("label",{htmlFor:"dot-pairing-code",className:"text-sm",children:"Pairing code"}),(0,e.jsx)(O,{id:"dot-pairing-code",type:"password",autoComplete:"off",value:f,onChange:a(t=>v(t.target.value),"onChange"),required:!0,maxLength:32}),G&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Checking pairing code…"}),l?.providerKind==="grok_bot"&&(0,e.jsxs)("p",{className:"text-sm font-medium",children:["Allow this connection to work as ",l.agent.name," in ",l.company.name,"."]}),l&&(0,e.jsxs)("dl",{className:"space-y-2 rounded-md border border-border p-3 text-sm",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Company"}),(0,e.jsxs)("dd",{children:[l.company.name," ",(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",l.company.id,")"]})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Agent"}),(0,e.jsxs)("dd",{children:[l.agent.name," ",(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",l.agent.id,")"]})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Permissions"}),(0,e.jsx)("dd",{children:l.permissions})]}),l.authorizingPerson&&(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Authorized by"}),(0,e.jsx)("dd",{children:l.authorizingPerson})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Access duration"}),(0,e.jsx)("dd",{children:l.accessDuration})]})]}),b&&u.view.kind==="error"&&(0,e.jsx)(S,{size:"inline",error:u.error,action:"check this pairing code",onRetry:u.view.retry,retrying:u.view.isFetching}),y.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:_(y.error,{action:"connect Dot"}).body}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(h,{type:"submit",disabled:!l||!U.test(C)||y.isPending,children:y.isPending?"Connecting…":"Allow agent connection"})})]}),s&&(0,e.jsx)(e.Fragment,{children:s.requiresSignIn?(0,e.jsx)(h,{asChild:!0,children:(0,e.jsx)(P,{to:`/auth?next=${encodeURIComponent(J)}`,children:"Sign in / Create account"})}):(0,e.jsxs)(e.Fragment,{children:[s.requestedCompanyId?(0,e.jsxs)("div",{className:"flex items-center gap-4 rounded-md border border-border p-4",children:[m&&(0,e.jsx)(F,{companyName:m.name,logoUrl:m.logoUrl,className:"size-14 shrink-0 rounded-lg text-xl"}),(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Organization"}),m?(0,e.jsx)("p",{className:"break-words text-lg font-semibold",children:m.name}):(0,e.jsx)("p",{className:"text-sm text-destructive",children:"The selected organization is no longer available to this account. Cancel and reconnect from your assistant to choose an organization you can access."})]})]}):(0,e.jsxs)("fieldset",{className:"space-y-2",disabled:x.isPending,children:[(0,e.jsx)("legend",{className:"mb-2 text-sm font-medium",children:"Organization"}),s.companies.map(t=>(0,e.jsxs)("label",{className:"flex items-center gap-3 rounded-md border border-border p-3 text-sm",children:[(0,e.jsx)("input",{type:"radio",name:"company","aria-label":t.name,value:t.id,checked:I===t.id,onChange:a(()=>N(t.id),"onChange")}),(0,e.jsx)(F,{companyName:t.name,logoUrl:t.logoUrl,className:"size-12 shrink-0 rounded-lg"}),(0,e.jsx)("span",{className:"min-w-0 break-words font-medium",children:t.name})]},t.id)),!s.companies.length&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"This account has no available organizations. Ask an organization owner to add you, then reconnect from your assistant."})]}),(0,e.jsx)("p",{className:"text-sm",children:s.agentConnection?"Connect Dot as a Microvac agent. Pair it with an agent after connecting; assigned work uses that agent’s permissions.":"Read all of your Microvac data"}),(s.requestedWrite||s.requestedConfigure)&&!s.agentConnection&&(0,e.jsxs)("label",{htmlFor:"mcp-allow-writes",className:"flex items-start gap-3 text-sm leading-6",children:[(0,e.jsx)("span",{className:"flex h-6 shrink-0 items-center",children:(0,e.jsx)(ie,{id:"mcp-allow-writes",checked:z,disabled:!m?.canWrite||x.isPending,onCheckedChange:a(t=>K(t===!0),"onCheckedChange")})}),(0,e.jsx)("span",{children:"Write all of your Microvac data"})]}),m&&!m.canWrite&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your role in this organization is read-only."}),x.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:_(x.error).body}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)(h,{variant:"outline",disabled:x.isPending,onClick:a(()=>x.mutate("deny"),"onClick"),children:"Cancel"}),(0,e.jsx)(h,{className:"h-auto min-h-10 min-w-0 shrink whitespace-normal",disabled:!m||s.agentConnection&&!m.canWrite||x.isPending,onClick:a(()=>x.mutate("approve"),"onClick"),children:x.isPending?"Connecting…":s.agentConnection?"Connect Dot agent":"Connect organization"})]})]})})]})})}a(Q,"McpConnectRequest");function ye(){const i=te(),r=B({queryKey:["mcp-connections"],queryFn:a(()=>j.get("/mcp/connections"),"queryFn")}),c=L(r),d=r.data?.filter(n=>!n.revokedAt),o=A({mutationFn:a(n=>j.delete(`/mcp/connections/${n}`),"mutationFn"),onSuccess:a((n,N)=>(i.setQueryData(["mcp-connections"],f=>f?.filter(v=>v.id!==N)),i.invalidateQueries({queryKey:["mcp-connections"]})),"onSuccess")});return(0,e.jsxs)("div",{className:"mx-auto max-w-xl space-y-4 py-10",children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Assistant connections"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Revoking a connection stops its future tool calls. Work already delegated continues under your organization’s normal controls."}),(c.kind==="loading"||c.kind==="reconnecting")&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading connections…"}),c.kind==="error"&&(0,e.jsx)(S,{error:c.error,action:"load assistant connections",onRetry:c.retry,retrying:c.isFetching}),o.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:_(o.error,{action:"revoke the connection"}).body}),d?.length===0&&(0,e.jsx)("p",{className:"text-sm",children:"No assistant connections."}),d?.map(n=>(0,e.jsxs)(k,{className:"block space-y-2 p-4",children:[(0,e.jsx)("h2",{className:"font-medium",children:(0,e.jsx)(ae,{name:le(n),avatarUrl:n.user?.image,initials:re(n.user?.name??"You")})}),(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Organization: ",n.companyName]}),n.agent&&(0,e.jsxs)("p",{className:"text-sm",children:["Works as ",(0,e.jsx)(P,{className:"underline",to:`/${n.companyPrefix??n.companyId}/agents/${n.agent.id}/runtime`,children:n.agent.name}),n.user?` · Authorized by ${n.user.name}`:""]}),(0,e.jsx)("p",{className:"text-sm",children:n.scopes.includes("paperclip:agent")?"Agent connection":n.scopes.includes("paperclip:write")?"Read and edit work":"Read only"}),n.scopes.includes("paperclip:configure")&&(0,e.jsx)("p",{className:"text-sm",children:"Configure agents, projects and skills"}),(0,e.jsx)(h,{variant:"outline",disabled:o.isPending,onClick:a(()=>o.mutate(n.id),"onClick"),children:"Revoke connection"})]},n.id)),(0,e.jsx)(P,{className:"text-sm underline",to:"/",children:"Back to Microvac"})]})}a(ye,"AssistantConnectionsPage");export{ye as AssistantConnectionsPage,je as McpConnectPage,fe as McpDevicePage};
@@ -1 +1 @@
1
- var y=Object.defineProperty;var e=(o,i)=>y(o,"name",{value:i,configurable:!0});import{a as L}from"./rolldown-runtime-DhZMWcEn.js";import{t as b}from"./log-in-BJCGwGGT.js";import{$A as j,NE as v,_w as _,mw as w,zE as n}from"./index-Bt31d8ga.js";var t=L(j(),1);function k({state:o,resourceName:i,pending:a=!1,pendingState:c=null,compact:l=!1,onJoin:m,onLeave:p}){const s=o==="left",u=a?c==="left"?"Leaving...":"Joining...":s?"Join":"Leave",f=`${s?"Join":"Leave"} ${i}`,x=a?_:s?b:w;function h(r){r.preventDefault(),r.stopPropagation(),!a&&(s?m():p())}return e(h,"handleClick"),(0,t.jsx)("span",{className:n("flex w-(--sz-66px) shrink-0 justify-end",!s&&!l?"opacity-100 sm:opacity-0 sm:transition-opacity sm:group-hover:opacity-100 sm:group-focus-within:opacity-100":"opacity-100"),children:(0,t.jsxs)(v,{type:"button",size:"xs",variant:"ghost","aria-label":f,"aria-busy":a?"true":void 0,disabled:a,onClick:h,className:"w-(--sz-66px)",children:[(0,t.jsx)(x,{className:n("h-3 w-3",a&&"motion-safe:animate-spin")}),(0,t.jsx)("span",{children:u})]})})}e(k,"MembershipAction");export{k as t};
1
+ var y=Object.defineProperty;var e=(o,i)=>y(o,"name",{value:i,configurable:!0});import{a as L}from"./rolldown-runtime-DhZMWcEn.js";import{t as b}from"./log-in-Dvx9-FMC.js";import{$A as j,NE as v,_w as _,mw as w,zE as n}from"./index-BJtnP7H1.js";var t=L(j(),1);function k({state:o,resourceName:i,pending:a=!1,pendingState:c=null,compact:l=!1,onJoin:m,onLeave:p}){const s=o==="left",u=a?c==="left"?"Leaving...":"Joining...":s?"Join":"Leave",f=`${s?"Join":"Leave"} ${i}`,x=a?_:s?b:w;function h(r){r.preventDefault(),r.stopPropagation(),!a&&(s?m():p())}return e(h,"handleClick"),(0,t.jsx)("span",{className:n("flex w-(--sz-66px) shrink-0 justify-end",!s&&!l?"opacity-100 sm:opacity-0 sm:transition-opacity sm:group-hover:opacity-100 sm:group-focus-within:opacity-100":"opacity-100"),children:(0,t.jsxs)(v,{type:"button",size:"xs",variant:"ghost","aria-label":f,"aria-busy":a?"true":void 0,disabled:a,onClick:h,className:"w-(--sz-66px)",children:[(0,t.jsx)(x,{className:n("h-3 w-3",a&&"motion-safe:animate-spin")}),(0,t.jsx)("span",{children:u})]})})}e(k,"MembershipAction");export{k as t};
@@ -1 +1 @@
1
- var u=Object.defineProperty;var d=(t,r)=>u(t,"name",{value:r,configurable:!0});import{a as f}from"./rolldown-runtime-DhZMWcEn.js";import{$A as h,E_ as j,Gb as N}from"./index-Bt31d8ga.js";var e=f(h(),1);function b({icon:t,value:r,label:x,description:i,to:n,onClick:s,appearance:l="plain"}){const o=!!(n||s),m=(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:`text-2xl sm:text-3xl font-semibold tracking-tight tabular-nums${l==="card"?" text-foreground":""}`,children:r}),(0,e.jsx)("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground mt-1",children:x}),i&&(0,e.jsx)("div",{className:"text-xs text-muted-foreground/70 mt-1.5 hidden sm:block",children:i})]}),(0,e.jsx)(t,{className:"h-4 w-4 text-muted-foreground/50 shrink-0 mt-1.5"})]}),c=`h-full px-4 py-4 sm:px-5 sm:py-5 rounded-lg transition-colors${o?" hover:bg-accent/50 cursor-pointer":""}`,a=l==="card"?(0,e.jsx)(j,{elevation:"low",className:c,children:m}):(0,e.jsx)("div",{className:c,children:m});return n?(0,e.jsx)(N,{to:n,className:"no-underline text-inherit h-full",onClick:s,children:a}):s?(0,e.jsx)("div",{className:"h-full",onClick:s,children:a}):a}d(b,"MetricCard");export{b as t};
1
+ var u=Object.defineProperty;var d=(t,r)=>u(t,"name",{value:r,configurable:!0});import{a as f}from"./rolldown-runtime-DhZMWcEn.js";import{$A as h,E_ as j,Gb as N}from"./index-BJtnP7H1.js";var e=f(h(),1);function b({icon:t,value:r,label:x,description:i,to:n,onClick:s,appearance:l="plain"}){const o=!!(n||s),m=(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:`text-2xl sm:text-3xl font-semibold tracking-tight tabular-nums${l==="card"?" text-foreground":""}`,children:r}),(0,e.jsx)("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground mt-1",children:x}),i&&(0,e.jsx)("div",{className:"text-xs text-muted-foreground/70 mt-1.5 hidden sm:block",children:i})]}),(0,e.jsx)(t,{className:"h-4 w-4 text-muted-foreground/50 shrink-0 mt-1.5"})]}),c=`h-full px-4 py-4 sm:px-5 sm:py-5 rounded-lg transition-colors${o?" hover:bg-accent/50 cursor-pointer":""}`,a=l==="card"?(0,e.jsx)(j,{elevation:"low",className:c,children:m}):(0,e.jsx)("div",{className:c,children:m});return n?(0,e.jsx)(N,{to:n,className:"no-underline text-inherit h-full",onClick:s,children:a}):s?(0,e.jsx)("div",{className:"h-full",onClick:s,children:a}):a}d(b,"MetricCard");export{b as t};
@@ -1 +1 @@
1
- var t=Object.defineProperty;var i=(e,s)=>t(e,"name",{value:s,configurable:!0});import{a}from"./rolldown-runtime-DhZMWcEn.js";import{$A as o,Gb as n,NE as d}from"./index-Bt31d8ga.js";var r=a(o(),1);function x({defaultTabHref:e,defaultTabLabel:s}){return(0,r.jsx)("div",{className:"rounded-lg border border-dashed border-border bg-background px-4 py-8 text-sm text-muted-foreground",children:(0,r.jsxs)("div",{className:"flex flex-col items-start gap-3",children:[(0,r.jsx)("p",{children:"Workspace plugin tab is not available."}),(0,r.jsx)(d,{variant:"outline",size:"sm",asChild:!0,children:(0,r.jsx)(n,{to:e,children:s})})]})})}i(x,"MissingPluginTabPlaceholder");export{x as t};
1
+ var t=Object.defineProperty;var i=(e,s)=>t(e,"name",{value:s,configurable:!0});import{a}from"./rolldown-runtime-DhZMWcEn.js";import{$A as o,Gb as n,NE as d}from"./index-BJtnP7H1.js";var r=a(o(),1);function x({defaultTabHref:e,defaultTabLabel:s}){return(0,r.jsx)("div",{className:"rounded-lg border border-dashed border-border bg-background px-4 py-8 text-sm text-muted-foreground",children:(0,r.jsxs)("div",{className:"flex flex-col items-start gap-3",children:[(0,r.jsx)("p",{children:"Workspace plugin tab is not available."}),(0,r.jsx)(d,{variant:"outline",size:"sm",asChild:!0,children:(0,r.jsx)(n,{to:e,children:s})})]})})}i(x,"MissingPluginTabPlaceholder");export{x as t};