decocms 4.429.3 → 4.429.5

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 (354) hide show
  1. package/dist/client/assets/{AlertCircle-Dz9cBs-m.js → AlertCircle-CXwWyjWL.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DdSEp1PD.js → AreaChart-CWnwFPGD.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-D7Qv40Uj.js → ArrowLeft-DYnQbYxF.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-yu2EcGiJ.js → ArrowRight-C4e8QGnK.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DfDTdHqA.js → ArrowUp-BiYv-XbK.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-D64U_nuI.js → CartesianChart-BGE8uJq6.js} +1 -1
  7. package/dist/client/assets/{Check-D0vo_Hz-.js → Check-C8M8v3vI.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-CumYT0Xg.js → CheckCircle-jESFBkr7.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CtEbEkWq.js → ChevronUp-Q2TBgNib.js} +1 -1
  10. package/dist/client/assets/{Copy01-BpbowiHW.js → Copy01-CaF9W1F_.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-D2EcwWI8.js → CreditCard01-Czi8bh9o.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-EXf2w9q0.js → DotsVertical-DyDeVQCx.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-B8upM3yO.js → ErrorBarContext-D4BkOvp5.js} +1 -1
  14. package/dist/client/assets/{Image01-BdTgRZP1.js → Image01-CsDdVFAJ.js} +1 -1
  15. package/dist/client/assets/{Key01-B4eK1DBH.js → Key01-D2FR3CbZ.js} +1 -1
  16. package/dist/client/assets/{Line-KSe8sJzM.js → Line-BfgHJMc3.js} +1 -1
  17. package/dist/client/assets/{Link01-By2X_oW1.js → Link01-NjQr5iwv.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CBdG7toR.js → LinkExternal01-CR1925bA.js} +1 -1
  19. package/dist/client/assets/{Monitor01-B7ACM5ru.js → Monitor01-50nhII2F.js} +1 -1
  20. package/dist/client/assets/{Palette-DE1SiHuh.js → Palette-AyH3xXYO.js} +1 -1
  21. package/dist/client/assets/{Plus-BkxlBn4y.js → Plus-DP7AHtKt.js} +1 -1
  22. package/dist/client/assets/{SearchMd-LHNOznc4.js → SearchMd-D_KPqWqZ.js} +1 -1
  23. package/dist/client/assets/{Sector-BRrxOLYM.js → Sector-BR7_Ijx1.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-DoxUqYra.js → ShoppingBag01-Dq4UD5Hm.js} +1 -1
  25. package/dist/client/assets/{Sun-DNDTyIac.js → Sun-oSoDHq1v.js} +1 -1
  26. package/dist/client/assets/{Tool01-CpVGuPOC.js → Tool01-D2y7RTX1.js} +1 -1
  27. package/dist/client/assets/{Trash01-TOxKcbID.js → Trash01-64yehlfB.js} +1 -1
  28. package/dist/client/assets/{Upload01-CjVkZP6G.js → Upload01-BvgQ3r-o.js} +1 -1
  29. package/dist/client/assets/{User01-DLdS4GEa.js → User01-CU3qbr5s.js} +1 -1
  30. package/dist/client/assets/{UserSquare-CcCul-Ku.js → UserSquare-nGw6lX43.js} +1 -1
  31. package/dist/client/assets/{Users01-ByxJpuoo.js → Users01-Lf2fvOej.js} +1 -1
  32. package/dist/client/assets/{X-Bv_7H4P-.js → X-NPE_cXRR.js} +1 -1
  33. package/dist/client/assets/{XAxis-Cn9tLjnY.js → XAxis-Drv4sXya.js} +1 -1
  34. package/dist/client/assets/{XClose-pHmDo5-O.js → XClose-CMTvfCel.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-Ya7GOVCv.js → ZoomOut-xQj4oorm.js} +1 -1
  36. package/dist/client/assets/{access-gate-BhPkP25z.js → access-gate-DRBSlBtJ.js} +1 -1
  37. package/dist/client/assets/add-connection-dialog-DHl4H43e.js +1 -0
  38. package/dist/client/assets/{agent-analytics-DHc3-l-w.js → agent-analytics-RDv7d0ta.js} +1 -1
  39. package/dist/client/assets/agent-app-BMOs_YKU.js +1 -0
  40. package/dist/client/assets/{agent-assets-DAEmoFC8.js → agent-assets-QMTortLS.js} +1 -1
  41. package/dist/client/assets/{agent-automation-Cz1jsKJf.js → agent-automation-kP7qIZSD.js} +1 -1
  42. package/dist/client/assets/{agent-automations-EvO0qN6w.js → agent-automations-D5AIE6G6.js} +1 -1
  43. package/dist/client/assets/{agent-connect-sources-9RNHPk2h.js → agent-connect-sources-1UnRN6mW.js} +1 -1
  44. package/dist/client/assets/agent-deck-9_2F3EG2.js +1 -0
  45. package/dist/client/assets/{agent-e2e-CXics08q.js → agent-e2e-DEc1NtfK.js} +1 -1
  46. package/dist/client/assets/{agent-experiments-CkZQ-REV.js → agent-experiments-D33dFCpI.js} +1 -1
  47. package/dist/client/assets/{agent-file-CLSI2x6K.js → agent-file-DxlwynYZ.js} +1 -1
  48. package/dist/client/assets/{agent-git-DR3UCmuP.js → agent-git-DVn4DsKt.js} +1 -1
  49. package/dist/client/assets/{agent-hosting-BWh6v3V_.js → agent-hosting-CgiR8Ql4.js} +1 -1
  50. package/dist/client/assets/{agent-icon-BTsAxpiE.js → agent-icon-TQUkqPJj.js} +1 -1
  51. package/dist/client/assets/agent-library-BoJuDeBh.js +1 -0
  52. package/dist/client/assets/agent-library-file-Dyz9u3bt.js +1 -0
  53. package/dist/client/assets/{agent-monitor-DFjCcLUm.js → agent-monitor-DgcF05B9.js} +1 -1
  54. package/dist/client/assets/{agent-overview-uEke4jgZ.js → agent-overview-dLl0w1eM.js} +1 -1
  55. package/dist/client/assets/agent-settings-MQLrMTV8.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-Cs2D0Grt.js → agent-site-editor-ITnkleU1.js} +1 -1
  57. package/dist/client/assets/agent-site-editor-code-D4dXTr1f.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-Db30XnTN.js → agent-site-editor-content-CNFJoRJD.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-CjnIUhh-.js → agent-site-editor-preview-CNLkTYYB.js} +3 -3
  60. package/dist/client/assets/agent-view-CfCVRWZl.js +1 -0
  61. package/dist/client/assets/{agent-view-guard-xLwNDoFo.js → agent-view-guard-BbHyaShN.js} +1 -1
  62. package/dist/client/assets/{agents-list-Bk-nP-Hz.js → agents-list-D9hihWFU.js} +1 -1
  63. package/dist/client/assets/{ai-providers-Q2xHefD1.js → ai-providers-oyOl9W3y.js} +1 -1
  64. package/dist/client/assets/{alert-ClVmStz3.js → alert-CokNymqA.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-Ba4KW5Tb.js → alert-dialog-DeJgSFRZ.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-sz__W2rJ.js → analytics-sections-DDWh8YnS.js} +1 -1
  67. package/dist/client/assets/{api-keys-WAwxvH4q.js → api-keys-Ch7q_sOP.js} +1 -1
  68. package/dist/client/assets/api-keys-DLiRLY55.js +1 -0
  69. package/dist/client/assets/{app-editor-Bzg858Ei.js → app-editor-BhWLpri1.js} +1 -1
  70. package/dist/client/assets/{asset-utils-Cl-DIW8f.js → asset-utils-BRk3fUR7.js} +1 -1
  71. package/dist/client/assets/{auth-LIeEUIDR.js → auth-BNR-bSJO.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-Ch_Ds6Cn.js → auth-catchall-CJ0eRklU.js} +1 -1
  73. package/dist/client/assets/{auth-entry-vJGoo3g-.js → auth-entry-XcfUUozZ.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-CzKiP8ly.js → auth-split-layout-mYNIGFvp.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-8VvMLeY7.js → authenticate-and-persist-oauth-CZrI0wkU.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-Wm3a5p7E.js → automation-list-row-DfLOPauj.js} +1 -1
  77. package/dist/client/assets/{automation-runs-CPD7oJx0.js → automation-runs-RuvSYlk2.js} +1 -1
  78. package/dist/client/assets/{automations-C7HPgN05.js → automations-CQh_fULy.js} +1 -1
  79. package/dist/client/assets/{autosend-BnYajEPM.js → autosend-h1h21hnM.js} +1 -1
  80. package/dist/client/assets/{avatar-DUUKBKEq.js → avatar-UFbMnkmr.js} +1 -1
  81. package/dist/client/assets/{badge-DzpaGRTk.js → badge-DzTxW-Ts.js} +1 -1
  82. package/dist/client/assets/{block-document-mfhczLQn.js → block-document-hxIwEIoN.js} +3 -3
  83. package/dist/client/assets/{blocks-preview-workspace-context-BntOatBH.js → blocks-preview-workspace-context-DRl7lMaq.js} +1 -1
  84. package/dist/client/assets/{buckets-Cv77xDfH.js → buckets-B-CYwdgC.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-BH3yj16d.js → build-improve-prompt-doc-DNmtsTJk.js} +1 -1
  86. package/dist/client/assets/{calendar-ByzzyV6c.js → calendar-Bx26MiuJ.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-DdZhOWh1.js → capability-load-error-BWTOxRLG.js} +1 -1
  88. package/dist/client/assets/{category-editor-CY9yp7vC.js → category-editor-DjdC64aL.js} +1 -1
  89. package/dist/client/assets/{chart-_tBRgksg.js → chart-BxpZzVsr.js} +1 -1
  90. package/dist/client/assets/{chat-context-BI1s3T66.js → chat-context-DppIIhzA.js} +1 -1
  91. package/dist/client/assets/{chat-draft-D0PL2mCh.js → chat-draft-DiJpqitX.js} +1 -1
  92. package/dist/client/assets/{checkbox-Cpv7L0N6.js → checkbox-BGfnFNv1.js} +1 -1
  93. package/dist/client/assets/{choose-editor-LNwLyfg_.js → choose-editor-DHwWSJiW.js} +1 -1
  94. package/dist/client/assets/{claim-phase-copy-EPhExNlM.js → claim-phase-copy-BRgB3yX1.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-CBcItsza.js → cli-auth-success-BX3DQOO5.js} +1 -1
  96. package/dist/client/assets/{client-icons-DC-8hNpP.js → client-icons-CYZ83j__.js} +1 -1
  97. package/dist/client/assets/{collapsible-pPCznIf4.js → collapsible-C2j127TD.js} +1 -1
  98. package/dist/client/assets/{collection-detail-D_X4bBB3.js → collection-detail-ehNX3PLY.js} +1 -1
  99. package/dist/client/assets/{collection-display-button-B5I1d5Uv.js → collection-display-button-CwIm419d.js} +1 -1
  100. package/dist/client/assets/{collection-search-Be-n29of.js → collection-search-D_azi8Gq.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-D52zfTjc.js → collection-table-wrapper-DMU9yWMT.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-fftcEeJN.js → collection-tabs-C6N84gCC.js} +1 -1
  103. package/dist/client/assets/{combobox-B1AZk18o.js → combobox--XWfS5lw.js} +1 -1
  104. package/dist/client/assets/{command-DQBtHyyq.js → command-D1RoIxg2.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section-7Vm6IlF1.js → companion-mcps-section-Cs-LBxQr.js} +1 -1
  106. package/dist/client/assets/{config-CELJkL0z.js → config-CMMAnMUF.js} +1 -1
  107. package/dist/client/assets/{connect-CqRFxjYq.js → connect-DVE1Hnuy.js} +1 -1
  108. package/dist/client/assets/{connect-layout-XKXgqJNp.js → connect-layout--NwWaqYw.js} +1 -1
  109. package/dist/client/assets/{connection-Cd9kpW2N.js → connection-Ds6vwkGM.js} +1 -1
  110. package/dist/client/assets/{connection-card-C_b6Kn3i.js → connection-card-BPKFHpho.js} +1 -1
  111. package/dist/client/assets/{connection-detail-Bi6mvLNo.js → connection-detail-BroJMnyc.js} +1 -1
  112. package/dist/client/assets/{connection-form-helpers-CRij5u84.js → connection-form-helpers-C4OB4j_3.js} +1 -1
  113. package/dist/client/assets/{connections-HYiawKCj.js → connections-DG2GlCvy.js} +1 -1
  114. package/dist/client/assets/{context-BkyYtq6r.js → context-BL1LKuLQ.js} +1 -1
  115. package/dist/client/assets/{context-menu-B6lNE0Gz.js → context-menu-CBJP1RfU.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-CAvO4TWV.js → create-organization-dialog-BQ0I0t_j.js} +1 -1
  117. package/dist/client/assets/{daily-pulse-BYmWzKWl.js → daily-pulse-Dpp9pCbq.js} +1 -1
  118. package/dist/client/assets/{decopilot-Cb-_oMnP.js → decopilot-BRlhj2Gw.js} +1 -1
  119. package/dist/client/assets/{dialog-CGclnAkN.js → dialog-Mg_Z3ES1.js} +1 -1
  120. package/dist/client/assets/{discover-De-KJC5j.js → discover-DCHf1gBE.js} +1 -1
  121. package/dist/client/assets/{domain-settings-DrGUovmZ.js → domain-settings-CmoTC2Mj.js} +1 -1
  122. package/dist/client/assets/{download-app-dialog-D1557QUF.js → download-app-dialog-B7zcmkcH.js} +1 -1
  123. package/dist/client/assets/{drawer-BDoe-caH.js → drawer-BIoKJwCW.js} +1 -1
  124. package/dist/client/assets/{editor-BJgmcO1D.js → editor-JpZ1gWwV.js} +1 -1
  125. package/dist/client/assets/{empty-state-B18ltfc_.js → empty-state-BayRP7H4.js} +1 -1
  126. package/dist/client/assets/{empty-state-B34CEwUC.js → empty-state-BmztM-Bo.js} +1 -1
  127. package/dist/client/assets/{extract-connection-data-CGsWt1C2.js → extract-connection-data-D5wjQBt3.js} +1 -1
  128. package/dist/client/assets/{feature-gate-DYu08LcP.js → feature-gate-DvQXfI5S.js} +1 -1
  129. package/dist/client/assets/{feature-paywall-C_x6v-Ey.js → feature-paywall-sc2LtOXc.js} +1 -1
  130. package/dist/client/assets/{file-explorer-DFkQYLLD.js → file-explorer-CqjD-skS.js} +1 -1
  131. package/dist/client/assets/{file-preview-oOFgi0tu.js → file-preview-VfWoS2gk.js} +1 -1
  132. package/dist/client/assets/{file-share-button-zWuRzlor.js → file-share-button-BGOzbmtb.js} +1 -1
  133. package/dist/client/assets/{file-type-icon-RYJiailm.js → file-type-icon-BhiPdwxi.js} +1 -1
  134. package/dist/client/assets/flat-project-wkNYEFlO.js +1 -0
  135. package/dist/client/assets/{folder-icon-Bf8F6949.js → folder-icon-DBIJdeY7.js} +1 -1
  136. package/dist/client/assets/{form-bcXKqc8N.js → form-BgAERq-t.js} +1 -1
  137. package/dist/client/assets/{gateway-client-DCdFKKN_.js → gateway-client-CIbTMjGx.js} +1 -1
  138. package/dist/client/assets/{general-16qHlqcQ.js → general-BBuB4XlH.js} +1 -1
  139. package/dist/client/assets/{home-D781nRhS.js → home-C96-FMPc.js} +1 -1
  140. package/dist/client/assets/{icon-button-CIiTk2PX.js → icon-button-CWL5E4Ua.js} +1 -1
  141. package/dist/client/assets/{index-CvEB1wsJ.js → index-2-Z1VD2F.js} +1 -1
  142. package/dist/client/assets/{index-Bw3BnaKs.js → index-B0WfPFpv.js} +1 -1
  143. package/dist/client/assets/{index-D9LnhQDL.js → index-B9dD9jj0.js} +4 -4
  144. package/dist/client/assets/{index-CrqZGA61.js → index-BZOsa8jC.js} +1 -1
  145. package/dist/client/assets/{index-59z4bzDc.js → index-Bv71AEH5.js} +1 -1
  146. package/dist/client/assets/{index-bzuuux9r.js → index-CORXJXSN.js} +1 -1
  147. package/dist/client/assets/{index-Czf46ykC.js → index-CpszPQp_.js} +1 -1
  148. package/dist/client/assets/{index-BS2Uqa0H.js → index-DL-sDqTO.js} +1 -1
  149. package/dist/client/assets/{index-DMU-WXJw.js → index-DR9ob9os.js} +1 -1
  150. package/dist/client/assets/{index---Q5zO6x.js → index-DWe-6mCD.js} +1 -1
  151. package/dist/client/assets/{index-DAh-d37k.js → index-ROw_u5-U.js} +1 -1
  152. package/dist/client/assets/{index-BouVTFfo.js → index-RYaP6qX3.js} +3 -3
  153. package/dist/client/assets/{index-D9sHyQVv.js → index-r8TBLtcZ.js} +1 -1
  154. package/dist/client/assets/{index-redirect-DVgM6RRC.js → index-redirect-DN5m0MeF.js} +1 -1
  155. package/dist/client/assets/{index-DiqXHSnv.js → index-v5QvptSB.js} +1 -1
  156. package/dist/client/assets/{index-BScbcffF.js → index-vYawqXRD.js} +1 -1
  157. package/dist/client/assets/{infiniteQueryObserver-BHgtnfJm.js → infiniteQueryObserver-Ex2lNjjr.js} +1 -1
  158. package/dist/client/assets/{infra-billing-Ce7lPCaU.js → infra-billing-BvYXN3Z1.js} +1 -1
  159. package/dist/client/assets/{input-DANvmr7V.js → input-BZloVZ72.js} +3 -3
  160. package/dist/client/assets/{input-DGRfwNJU.js → input-BmzPGvUi.js} +1 -1
  161. package/dist/client/assets/{input-D_ZVa75L.js → input-Cndqm_5O.js} +1 -1
  162. package/dist/client/assets/{integration-icon-COxNT19S.js → integration-icon-C5NBXdpz.js} +1 -1
  163. package/dist/client/assets/{label-DiLYcWOq.js → label-DpahMcEo.js} +1 -1
  164. package/dist/client/assets/{last-preview-page-3TpsD5I_.js → last-preview-page-Dfux_ulA.js} +1 -1
  165. package/dist/client/assets/{layout-DPfFiV1_.js → layout-C6k3EFd1.js} +1 -1
  166. package/dist/client/assets/{legacy-agents-deep-yBBdl4Te.js → legacy-agents-deep-B_DiKZ0c.js} +1 -1
  167. package/dist/client/assets/{legacy-main-redirect-DXVMcdr-.js → legacy-main-redirect-BgIGaynA.js} +1 -1
  168. package/dist/client/assets/library-D6flTj5t.js +1 -0
  169. package/dist/client/assets/{library-tab-CXCLZRQC.js → library-tab-Bso2C2NG.js} +1 -1
  170. package/dist/client/assets/{login-C4QrpT-9.js → login-CXuSqosI.js} +1 -1
  171. package/dist/client/assets/{markdown-CYbDwdl9.js → markdown-D8U5yexH.js} +1 -1
  172. package/dist/client/assets/{mcp-app-renderer-CqnN_gT7.js → mcp-app-renderer-CWOIFfi6.js} +1 -1
  173. package/dist/client/assets/{mcp-oauth-Bx2SR9KP.js → mcp-oauth-DCDrWVc0.js} +1 -1
  174. package/dist/client/assets/{members-BZBvmhnB.js → members-BfRC0ceX.js} +1 -1
  175. package/dist/client/assets/{message-templates-I2fytmn2.js → message-templates-DgOMle6a.js} +1 -1
  176. package/dist/client/assets/{mini-report-page-eltvP_76.js → mini-report-page-BIktJNbh.js} +1 -1
  177. package/dist/client/assets/{mock-board-CgZiTliz.js → mock-board-DjQ6xrU_.js} +1 -1
  178. package/dist/client/assets/{monaco-editor-FD1izitZ.js → monaco-editor-BRUSLTLk.js} +1 -1
  179. package/dist/client/assets/{monitoring-stats-row-BQCERodS.js → monitoring-stats-row-C4bB2YFf.js} +1 -1
  180. package/dist/client/assets/{multi-select-BfQySwLK.js → multi-select-6bm7qEEn.js} +1 -1
  181. package/dist/client/assets/{mustache-Di_1lUk9.js → mustache-CAmcva4T.js} +1 -1
  182. package/dist/client/assets/new-project-dialog-BejzbVG2.js +1 -0
  183. package/dist/client/assets/{oauth-callback-DKQfywQG.js → oauth-callback-0bxicPCo.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-ai-provider-BHBlU05u.js → oauth-callback-ai-provider-D4kx59om.js} +1 -1
  185. package/dist/client/assets/{onboarding-ByVxEqxG.js → onboarding-C7mIZXvc.js} +1 -1
  186. package/dist/client/assets/{openai-conversation-TGydZ30W.js → openai-conversation-DYPzWsQc.js} +1 -1
  187. package/dist/client/assets/{optimistic-project-sidebar-views-2cxR9DkL.js → optimistic-project-sidebar-views-DHo7EiTm.js} +1 -1
  188. package/dist/client/assets/{org-file-open-context-BZYS0LJs.js → org-file-open-context-CSDcMwBD.js} +1 -1
  189. package/dist/client/assets/{organization-choice-BqUqcpt3.js → organization-choice-BZ-4C5a6.js} +1 -1
  190. package/dist/client/assets/{orgs-BmaONpkl.js → orgs-DnEd_o3Y.js} +1 -1
  191. package/dist/client/assets/{page-seo-form-ChmpTY6H.js → page-seo-form-BjAunJ7T.js} +1 -1
  192. package/dist/client/assets/{pair-DGI5fx0e.js → pair-o8Pcow3m.js} +1 -1
  193. package/dist/client/assets/{plan-ladder-X8Zj9SaM.js → plan-ladder-COYrpP9N.js} +1 -1
  194. package/dist/client/assets/{popover-qQDOtUT-.js → popover-D5s3M61L.js} +1 -1
  195. package/dist/client/assets/{post-calendar-B8almCuR.js → post-calendar-Cl-vAwk3.js} +1 -1
  196. package/dist/client/assets/post-editor-D2HU9kfD.js +2 -0
  197. package/dist/client/assets/{preview-content-Dyu5DkV0.js → preview-content-B9bgsNRh.js} +1 -1
  198. package/dist/client/assets/{preview-dialog-CtBqa24y.js → preview-dialog-CwQ43Y6v.js} +1 -1
  199. package/dist/client/assets/{profile-L1-N4m6i.js → profile-BB1G47uY.js} +1 -1
  200. package/dist/client/assets/{project-app-view-ClwBU9Qs.js → project-app-view-DS-jWTJh.js} +1 -1
  201. package/dist/client/assets/{project-feed-Crh26cH9.js → project-feed-Ceha3l-R.js} +1 -1
  202. package/dist/client/assets/{project-icon-C4nL4fZk.js → project-icon-CmV-Y1UZ.js} +1 -1
  203. package/dist/client/assets/project-reports-M4OcQRnq.js +1 -0
  204. package/dist/client/assets/project-tasks-D2UK5JuX.js +1 -0
  205. package/dist/client/assets/{projects-BSybKzWl.js → projects-Cv5osXsD.js} +1 -1
  206. package/dist/client/assets/{projects-empty-state-Bk1XoaJn.js → projects-empty-state-CaTjevnb.js} +1 -1
  207. package/dist/client/assets/{prompts-5ReZRdb6.js → prompts-BgUtk3zC.js} +1 -1
  208. package/dist/client/assets/record-editor-C0G9mTGj.js +1 -0
  209. package/dist/client/assets/{redirect-editor-Bp56flLw.js → redirect-editor-BpclUTIj.js} +1 -1
  210. package/dist/client/assets/{reports-9unH-pwd.js → reports-CLznlgS5.js} +1 -1
  211. package/dist/client/assets/reports-cbjIbfxK.js +1 -0
  212. package/dist/client/assets/{reports-onboarding-Bd3z6EGO.js → reports-onboarding-BHCXUocU.js} +1 -1
  213. package/dist/client/assets/{reports-tab-CR2TjCBy.js → reports-tab-CoZHZlVb.js} +2 -2
  214. package/dist/client/assets/{repositories-CflRXNfG.js → repositories-DoauYKeu.js} +1 -1
  215. package/dist/client/assets/{repository-binding-5QFpfewx.js → repository-binding-DzrKIMc8.js} +1 -1
  216. package/dist/client/assets/{repository-import-picker-B2sU66dU.js → repository-import-picker-CVP1mN_O.js} +1 -1
  217. package/dist/client/assets/{repository-picker-Vcv9BzsE.js → repository-picker-BIkrH86Z.js} +1 -1
  218. package/dist/client/assets/{require-capability-BW3G4Us3.js → require-capability-CEGMzsiO.js} +1 -1
  219. package/dist/client/assets/{required-auth-layout-CD9nIPTu.js → required-auth-layout-BPzqc-yZ.js} +1 -1
  220. package/dist/client/assets/{reset-password-D1RRMRVB.js → reset-password-CC9lxhEO.js} +1 -1
  221. package/dist/client/assets/{resizable-D9vEsnsF.js → resizable-Ck9CN4S9.js} +1 -1
  222. package/dist/client/assets/{resolve-tab-icon-B5IDCHgC.js → resolve-tab-icon-CgOUF0YA.js} +1 -1
  223. package/dist/client/assets/{review-settings-BrevH4Wn.js → review-settings-cCLUF68J.js} +1 -1
  224. package/dist/client/assets/{rich-text-link-control-BzuTiJzL.js → rich-text-link-control-RS2mJIfp.js} +1 -1
  225. package/dist/client/assets/{roles-DJw04POK.js → roles-DWD7cz1d.js} +1 -1
  226. package/dist/client/assets/{route-Crbe3P1G.js → route-CjKIfVgB.js} +1 -1
  227. package/dist/client/assets/{route-oyHhMnH0.js → route-DI4K2hiz.js} +1 -1
  228. package/dist/client/assets/route-n8gaWLVb.js +1 -0
  229. package/dist/client/assets/{runnable-block-editor-Dm1ttguK.js → runnable-block-editor-h-xGxUBS.js} +1 -1
  230. package/dist/client/assets/{sandbox-lifecycle-context-B7U4JGhb.js → sandbox-lifecycle-context-OPdARg4I.js} +1 -1
  231. package/dist/client/assets/{schema-D-otOqEn.js → schema-BejaMrNT.js} +1 -1
  232. package/dist/client/assets/{scroll-area-BWPHSxC7.js → scroll-area-DjfgE2jb.js} +1 -1
  233. package/dist/client/assets/{search-input-CpX3lkQR.js → search-input-DviARBm2.js} +1 -1
  234. package/dist/client/assets/{search-toggle-HqLOjE33.js → search-toggle-DvOTtKmA.js} +1 -1
  235. package/dist/client/assets/{secret-picker-C3zHxvuV.js → secret-picker-CuEw2DSI.js} +1 -1
  236. package/dist/client/assets/{secrets-B2qQxKlO.js → secrets-CoVAIKwE.js} +1 -1
  237. package/dist/client/assets/{sections-editor-DD2nj5mI.js → sections-editor-CsNiIfgn.js} +1 -1
  238. package/dist/client/assets/{select-C2txP07f.js → select-Cd1ykg-h.js} +1 -1
  239. package/dist/client/assets/{select-model-DHlaKKMM.js → select-model-a344Xqu_.js} +1 -1
  240. package/dist/client/assets/{seo-editor-De017z1l.js → seo-editor-D4_b59uB.js} +1 -1
  241. package/dist/client/assets/{separator--5K9h2sI.js → separator-Ch977YA1.js} +1 -1
  242. package/dist/client/assets/{settings-tab-Cl0o9K4e.js → settings-tab-sWmscvB1.js} +1 -1
  243. package/dist/client/assets/{sheet-B12cZ7x2.js → sheet-lggFYx6M.js} +1 -1
  244. package/dist/client/assets/shell-layout-Bl8of89A.js +1 -0
  245. package/dist/client/assets/{skills-8pBxw9bR.js → skills-CzJ783Zp.js} +1 -1
  246. package/dist/client/assets/{sso-TN5MAp8K.js → sso-DKlO8_Lq.js} +1 -1
  247. package/dist/client/assets/{suggestion-NZIrFsLR.js → suggestion-K--t6EP5.js} +1 -1
  248. package/dist/client/assets/{switch-Bwf4p87L.js → switch-BLWgY1pz.js} +1 -1
  249. package/dist/client/assets/{synced-repos-DLmz0NmT.js → synced-repos-BnWEHPVF.js} +1 -1
  250. package/dist/client/assets/{tab-icon-glyph-DH47_x1a.js → tab-icon-glyph-C_bZ6WrZ.js} +1 -1
  251. package/dist/client/assets/{table-lla-0ZP_.js → table-CufJwyXQ.js} +1 -1
  252. package/dist/client/assets/{tabs-Cqnx8A4d.js → tabs-C1zPDoUI.js} +1 -1
  253. package/dist/client/assets/{task-board-ECBN5WTV.js → task-board-DlEJAtdm.js} +1 -1
  254. package/dist/client/assets/{task-route-BDq4YcnG.js → task-route-z_uMrYh2.js} +1 -1
  255. package/dist/client/assets/{task-status-CnOLwVKV.js → task-status-DrVr4O9O.js} +1 -1
  256. package/dist/client/assets/{taskboard-analytics-uCDwsGG2.js → taskboard-analytics-BEIixlIh.js} +1 -1
  257. package/dist/client/assets/{tasks-BX0Q_hE9.js → tasks-CpEABx-G.js} +1 -1
  258. package/dist/client/assets/tasks-l5i1Y6YC.js +1 -0
  259. package/dist/client/assets/{textarea-D-mcJV9e.js → textarea-r66bOcCD.js} +1 -1
  260. package/dist/client/assets/{thread-analytics-DDKoGJv6.js → thread-analytics-BmowQF8I.js} +1 -1
  261. package/dist/client/assets/{thread-intent-CUdr-H41.js → thread-intent-UQGFcX_y.js} +1 -1
  262. package/dist/client/assets/{thread-route-BWPYI0ZR.js → thread-route-CVz2UKe8.js} +1 -1
  263. package/dist/client/assets/{thread-route-Dxs07flR.js → thread-route-CowkfwAl.js} +1 -1
  264. package/dist/client/assets/{thread-sheet-body-BAKNbMRN.js → thread-sheet-body-CxW1uZ8Z.js} +1 -1
  265. package/dist/client/assets/{toggle-group-C9SgUNwy.js → toggle-group-BQtHqwCK.js} +1 -1
  266. package/dist/client/assets/{toolbar-icon-button-DWT7n987.js → toolbar-icon-button-B4QTn-IO.js} +1 -1
  267. package/dist/client/assets/{tooltip-C-B-WE46.js → tooltip-CM3YyNDC.js} +1 -1
  268. package/dist/client/assets/{track-D7y9daDt.js → track-BqJ0I7ao.js} +1 -1
  269. package/dist/client/assets/{types-CJIIzGfz.js → types-DyM6In73.js} +1 -1
  270. package/dist/client/assets/{usage-stats-H19WpNRU.js → usage-stats-5Vc6zWOp.js} +1 -1
  271. package/dist/client/assets/{use-ai-providers-DKskI-lk.js → use-ai-providers-C98JaJAU.js} +1 -1
  272. package/dist/client/assets/{use-automations-Cx0j7Q3N.js → use-automations-CqbCGltu.js} +1 -1
  273. package/dist/client/assets/{use-autosave-CHQrnT-o.js → use-autosave-tzZy_E8d.js} +1 -1
  274. package/dist/client/assets/{use-chat-layout-state-BjAQ-jEe.js → use-chat-layout-state-BfZJHnkW.js} +1 -1
  275. package/dist/client/assets/{use-connect-companion-BqzewW5u.js → use-connect-companion-DfiphJ3V.js} +1 -1
  276. package/dist/client/assets/{use-connection-DHC7ikhv.js → use-connection-BdSGHKJK.js} +1 -1
  277. package/dist/client/assets/{use-copy-CdZ1BFua.js → use-copy-CiP5Vy7i.js} +1 -1
  278. package/dist/client/assets/{use-create-virtual-mcp-CPtrtZAW.js → use-create-virtual-mcp-CoU2LYN8.js} +1 -1
  279. package/dist/client/assets/{use-date-fns-locale-B7kL8ljG.js → use-date-fns-locale-BQIR67dY.js} +1 -1
  280. package/dist/client/assets/{use-debounced-autosave-CYhKiUyc.js → use-debounced-autosave-6IETzqNZ.js} +1 -1
  281. package/dist/client/assets/{use-debounced-value-CiGe63CI.js → use-debounced-value-DCYhoWzs.js} +1 -1
  282. package/dist/client/assets/{use-deco-credits-Cte4t6Hc.js → use-deco-credits-x58AfrXU.js} +1 -1
  283. package/dist/client/assets/{use-decopilot-events-DRNQZQd4.js → use-decopilot-events-BZQXzmAo.js} +1 -1
  284. package/dist/client/assets/{use-delete-connection-B7AFWvdy.js → use-delete-connection-CzvLG4mr.js} +1 -1
  285. package/dist/client/assets/{use-deployment-admin-DLIzcPao.js → use-deployment-admin-BmH0eskZ.js} +1 -1
  286. package/dist/client/assets/{use-fast-preview-draft-url-xQxrekFA.js → use-fast-preview-draft-url-DFL8djh0.js} +1 -1
  287. package/dist/client/assets/{use-file-configs-Dgw51am7.js → use-file-configs-DRP3Y7X_.js} +1 -1
  288. package/dist/client/assets/{use-infinite-scroll-C8OfQLMA.js → use-infinite-scroll-BjVQV3DR.js} +1 -1
  289. package/dist/client/assets/{use-join-requests-nZ3kOzHD.js → use-join-requests-B6dqmlCQ.js} +1 -1
  290. package/dist/client/assets/{use-main-panel-tabs-DxwYJrDB.js → use-main-panel-tabs-sy9nYCqA.js} +1 -1
  291. package/dist/client/assets/{use-mcp-auth-status-CcDs9GVg.js → use-mcp-auth-status-Cjd2QrWU.js} +1 -1
  292. package/dist/client/assets/{use-mcp-client-DwI8A7i_.js → use-mcp-client-CqsHeShn.js} +1 -1
  293. package/dist/client/assets/{use-mcp-prompts-DldVoJeZ.js → use-mcp-prompts-D2YpCb1K.js} +1 -1
  294. package/dist/client/assets/{use-mcp-tools-CfhB5gVo.js → use-mcp-tools-CHvaFbLg.js} +1 -1
  295. package/dist/client/assets/{use-members-C0vxrdj1.js → use-members-BIhBY7mT.js} +1 -1
  296. package/dist/client/assets/{use-mobile-Bl8tDUow.js → use-mobile-3MM_rw4D.js} +1 -1
  297. package/dist/client/assets/{use-navigate-to-agent-BkimVMTW.js → use-navigate-to-agent-PjEm7mol.js} +1 -1
  298. package/dist/client/assets/use-new-blocks-editor-BAZ5qlTk.js +1 -0
  299. package/dist/client/assets/{use-open-billing-url-C6UjE84T.js → use-open-billing-url-CVEaCqtR.js} +1 -1
  300. package/dist/client/assets/{use-org-auth-client-DveZle8A.js → use-org-auth-client-DM3Q5_fm.js} +1 -1
  301. package/dist/client/assets/{use-org-fs-BgFAHUUb.js → use-org-fs-DazA0BMP.js} +1 -1
  302. package/dist/client/assets/{use-org-repo-syncs-EVtNPamp.js → use-org-repo-syncs-DGjVBBAK.js} +1 -1
  303. package/dist/client/assets/{use-org-sso-BliqnW_C.js → use-org-sso-DGy0uwEN.js} +1 -1
  304. package/dist/client/assets/{use-organization-roles-Bapbgw8R.js → use-organization-roles-Bjw-G0xx.js} +1 -1
  305. package/dist/client/assets/{use-organization-settings-Cwt51JJ-.js → use-organization-settings-DbPbYeMx.js} +1 -1
  306. package/dist/client/assets/{use-panel-navigate-Bs3wrk2o.js → use-panel-navigate-DH6_TAsx.js} +1 -1
  307. package/dist/client/assets/{use-project-scope-B0guFEKE.js → use-project-scope-Bgnjdhs7.js} +1 -1
  308. package/dist/client/assets/{use-releases-ktnIEIhq.js → use-releases-DQGDjOy5.js} +1 -1
  309. package/dist/client/assets/{use-reports-diagnostic-D3V-85up.js → use-reports-diagnostic-BASyyQU9.js} +1 -1
  310. package/dist/client/assets/{use-secrets-BkecMwUf.js → use-secrets-B41nk4LH.js} +1 -1
  311. package/dist/client/assets/{use-section-preview-base-Cx_Jy896.js → use-section-preview-base-DKahorN-.js} +1 -1
  312. package/dist/client/assets/{use-session-runtime-DePI4bwj.js → use-session-runtime-CsLaMszW.js} +1 -1
  313. package/dist/client/assets/{use-tags-oLoiyIWO.js → use-tags-BQ9peM4A.js} +1 -1
  314. package/dist/client/assets/{use-task-board-analytics-Cb5Wgr40.js → use-task-board-analytics-Co6FjpoI.js} +1 -1
  315. package/dist/client/assets/{use-task-board-events-Dh62k4Ty.js → use-task-board-events-BsviWCWn.js} +1 -1
  316. package/dist/client/assets/{use-task-metadata-w1PI2EXQ.js → use-task-metadata-DvgRil5z.js} +1 -1
  317. package/dist/client/assets/{use-thread-analytics-lgnAQ6CS.js → use-thread-analytics-Bf4bUeLT.js} +1 -1
  318. package/dist/client/assets/{use-thread-outputs-C-Wf6OBJ.js → use-thread-outputs-CvWfZHjR.js} +1 -1
  319. package/dist/client/assets/useInfiniteQuery-TQWsreUe.js +1 -0
  320. package/dist/client/assets/{useQueries-Bp03xGbc.js → useQueries-CIVnwtOu.js} +1 -1
  321. package/dist/client/assets/useSuspenseInfiniteQuery-DMyZCSsI.js +1 -0
  322. package/dist/client/assets/{users-BhXTEA2Q.js → users-2Adoo8D9.js} +1 -1
  323. package/dist/client/assets/{utils-DLvRHMkE.js → utils-BeoNvR__.js} +1 -1
  324. package/dist/client/assets/{variant-calendar-dnPy16Uh.js → variant-calendar-C6HvphcB.js} +1 -1
  325. package/dist/client/assets/{variant-matcher-override-Ck-W94Rw.js → variant-matcher-override-De1zsqbc.js} +1 -1
  326. package/dist/client/assets/{view-mode-toggle-B0zbI0V1.js → view-mode-toggle-DtqPFP6s.js} +1 -1
  327. package/dist/client/assets/{virtual-mcp-CXOm_lWW.js → virtual-mcp-Cr9A-Wo0.js} +1 -1
  328. package/dist/client/index.html +1 -1
  329. package/dist/server/cli.js +4 -4
  330. package/dist/server/server.js +4 -4
  331. package/package.json +1 -1
  332. package/dist/client/assets/add-connection-dialog-CMIKgpSn.js +0 -1
  333. package/dist/client/assets/agent-app-DvbjKuoc.js +0 -1
  334. package/dist/client/assets/agent-deck-BOkkFgcN.js +0 -1
  335. package/dist/client/assets/agent-library-C1r0MXrh.js +0 -1
  336. package/dist/client/assets/agent-library-file-D5IDjKQA.js +0 -1
  337. package/dist/client/assets/agent-settings-AbY4U8u3.js +0 -1
  338. package/dist/client/assets/agent-site-editor-code-bJU2jCGA.js +0 -2
  339. package/dist/client/assets/agent-view-DS1snkTk.js +0 -1
  340. package/dist/client/assets/api-keys-ttV9p_C3.js +0 -1
  341. package/dist/client/assets/flat-project-5lJIGqGg.js +0 -1
  342. package/dist/client/assets/library-BetPT5Rc.js +0 -1
  343. package/dist/client/assets/new-project-dialog-BJabJxXa.js +0 -1
  344. package/dist/client/assets/post-editor-3AfRGsBD.js +0 -2
  345. package/dist/client/assets/project-reports--pld6WR0.js +0 -1
  346. package/dist/client/assets/project-tasks-DOClEfO3.js +0 -1
  347. package/dist/client/assets/record-editor-Cz6r4s_z.js +0 -1
  348. package/dist/client/assets/reports-Cs6RnnEs.js +0 -1
  349. package/dist/client/assets/route-B0zINpnC.js +0 -1
  350. package/dist/client/assets/shell-layout-jXhY2XCJ.js +0 -1
  351. package/dist/client/assets/tasks-FILO35tu.js +0 -1
  352. package/dist/client/assets/use-new-blocks-editor-Bg78S2yh.js +0 -1
  353. package/dist/client/assets/useInfiniteQuery-CkfME6EV.js +0 -1
  354. package/dist/client/assets/useSuspenseInfiniteQuery-Cb-DHagn.js +0 -1
@@ -1 +1 @@
1
- import{t as y,c as S,d as x,b as D,e as M}from"./differenceInSeconds-C3x8sHUj.js";import{x as j}from"./index-D9LnhQDL.js";let T={};function F(){return T}function W(e){const a=y(e),t=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return t.setUTCFullYear(a.getFullYear()),+e-+t}function P(e,...a){const t=S.bind(null,e||a.find(o=>typeof o=="object"));return a.map(t)}function v(e,a){const t=+y(e)-+y(a);return t<0?-1:t>0?1:t}function $(e){return S(e,Date.now())}function C(e,a,t){const[o,n]=P(t?.in,e,a),s=o.getFullYear()-n.getFullYear(),i=o.getMonth()-n.getMonth();return s*12+i}function X(e,a){const t=y(e,a?.in);return t.setHours(23,59,59,999),t}function q(e,a){const t=y(e,a?.in),o=t.getMonth();return t.setFullYear(t.getFullYear(),o+1,0),t.setHours(23,59,59,999),t}function z(e,a){const t=y(e,a?.in);return+X(t,a)==+q(t,a)}function A(e,a,t){const[o,n,s]=P(t?.in,e,e,a),i=v(n,s),r=Math.abs(C(n,s));if(r<1)return 0;n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*r);let l=v(n,s)===-i;z(o)&&r===1&&v(o,s)===1&&(l=!1);const u=i*(r-+l);return u===0?0:u}const O={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},N=(e,a,t)=>{let o;const n=O[e];return typeof n=="string"?o=n:a===1?o=n.one:o=n.other.replace("{{count}}",a.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+o:o+" ago":o};function b(e){return(a={})=>{const t=a.width?String(a.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const V={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Y={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},H={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_={date:b({formats:V,defaultWidth:"full"}),time:b({formats:Y,defaultWidth:"full"}),dateTime:b({formats:H,defaultWidth:"full"})},L={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},E=(e,a,t,o)=>L[e];function m(e){return(a,t)=>{const o=t?.context?String(t.context):"standalone";let n;if(o==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,r=t?.width?String(t.width):i;n=e.formattingValues[r]||e.formattingValues[i]}else{const i=e.defaultWidth,r=t?.width?String(t.width):e.defaultWidth;n=e.values[r]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(a):a;return n[s]}}const R={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},I={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Q={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},J={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},B={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},U={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},K=(e,a)=>{const t=Number(e),o=t%100;if(o>20||o<10)switch(o%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},G={ordinalNumber:K,era:m({values:R,defaultWidth:"wide"}),quarter:m({values:I,defaultWidth:"wide",argumentCallback:e=>e-1}),month:m({values:Q,defaultWidth:"wide"}),day:m({values:J,defaultWidth:"wide"}),dayPeriod:m({values:B,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})};function c(e){return(a,t={})=>{const o=t.width,n=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=a.match(n);if(!s)return null;const i=s[0],r=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?ee(r,w=>w.test(i)):Z(r,w=>w.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=t.valueCallback?t.valueCallback(u):u;const h=a.slice(i.length);return{value:u,rest:h}}}function Z(e,a){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&a(e[t]))return t}function ee(e,a){for(let t=0;t<e.length;t++)if(a(e[t]))return t}function k(e){return(a,t={})=>{const o=a.match(e.matchPattern);if(!o)return null;const n=o[0],s=a.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=t.valueCallback?t.valueCallback(i):i;const r=a.slice(n.length);return{value:i,rest:r}}}const te=/^(\d+)(th|st|nd|rd)?/i,ae=/\d+/i,ne={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},oe={any:[/^b/i,/^(a|c)/i]},re={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ie={any:[/1/i,/2/i,/3/i,/4/i]},se={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},de={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ue={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},me={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ce={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},le={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},he={ordinalNumber:k({matchPattern:te,parsePattern:ae,valueCallback:e=>parseInt(e,10)}),era:c({matchPatterns:ne,defaultMatchWidth:"wide",parsePatterns:oe,defaultParseWidth:"any"}),quarter:c({matchPatterns:re,defaultMatchWidth:"wide",parsePatterns:ie,defaultParseWidth:"any",valueCallback:e=>e+1}),month:c({matchPatterns:se,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any"}),day:c({matchPatterns:ue,defaultMatchWidth:"wide",parsePatterns:me,defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:ce,defaultMatchWidth:"any",parsePatterns:le,defaultParseWidth:"any"})},fe={code:"en-US",formatDistance:N,formatLong:_,formatRelative:E,localize:G,match:he,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ge(e,a,t){const o=F(),n=t?.locale??o.locale??fe,s=2520,i=v(e,a);if(isNaN(i))throw new RangeError("Invalid time value");const r=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:i}),[l,u]=P(t?.in,...i>0?[a,e]:[e,a]),h=x(u,l),w=(W(u)-W(l))/1e3,d=Math.round((h-w)/60);let g;if(d<2)return t?.includeSeconds?h<5?n.formatDistance("lessThanXSeconds",5,r):h<10?n.formatDistance("lessThanXSeconds",10,r):h<20?n.formatDistance("lessThanXSeconds",20,r):h<40?n.formatDistance("halfAMinute",0,r):h<60?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",1,r):d===0?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",d,r);if(d<45)return n.formatDistance("xMinutes",d,r);if(d<90)return n.formatDistance("aboutXHours",1,r);if(d<D){const f=Math.round(d/60);return n.formatDistance("aboutXHours",f,r)}else{if(d<s)return n.formatDistance("xDays",1,r);if(d<M){const f=Math.round(d/D);return n.formatDistance("xDays",f,r)}else if(d<M*2)return g=Math.round(d/M),n.formatDistance("aboutXMonths",g,r)}if(g=A(u,l),g<12){const f=Math.round(d/M);return n.formatDistance("xMonths",f,r)}else{const f=g%12,p=Math.trunc(g/12);return f<3?n.formatDistance("aboutXYears",p,r):f<9?n.formatDistance("overXYears",p,r):n.formatDistance("almostXYears",p+1,r)}}function Je(e,a){return ge(e,$(e),a)}const be={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},ye=(e,a,t)=>{let o;const n=be[e];return typeof n=="string"?o=n:a===1?o=n.one:o=n.other.replace("{{count}}",String(a)),t?.addSuffix?t.comparison&&t.comparison>0?"em "+o:"há "+o:o},we={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Me={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ve={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pe={date:b({formats:we,defaultWidth:"full"}),time:b({formats:Me,defaultWidth:"full"}),dateTime:b({formats:ve,defaultWidth:"full"})},Pe={lastWeek:e=>{const a=e.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},De=(e,a,t,o)=>{const n=Pe[e];return typeof n=="function"?n(a):n},We={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Se={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},ke={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},xe={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},je={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Te={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Fe=(e,a)=>{const t=Number(e);return a?.unit==="week"?t+"ª":t+"º"},$e={ordinalNumber:Fe,era:m({values:We,defaultWidth:"wide"}),quarter:m({values:Se,defaultWidth:"wide",argumentCallback:e=>e-1}),month:m({values:ke,defaultWidth:"wide"}),day:m({values:xe,defaultWidth:"wide"}),dayPeriod:m({values:je,defaultWidth:"wide",formattingValues:Te,defaultFormattingWidth:"wide"})},Ce=/^(\d+)[ºªo]?/i,Xe=/\d+/i,qe={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},ze={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},Ae={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Oe={any:[/1/i,/2/i,/3/i,/4/i]},Ne={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Ve={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},Ye={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},He={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},_e={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Le={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},Ee={ordinalNumber:k({matchPattern:Ce,parsePattern:Xe,valueCallback:e=>parseInt(e,10)}),era:c({matchPatterns:qe,defaultMatchWidth:"wide",parsePatterns:ze,defaultParseWidth:"any"}),quarter:c({matchPatterns:Ae,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:c({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:Ve,defaultParseWidth:"any"}),day:c({matchPatterns:Ye,defaultMatchWidth:"wide",parsePatterns:He,defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:_e,defaultMatchWidth:"any",parsePatterns:Le,defaultParseWidth:"any"})},Re={code:"pt-BR",formatDistance:ye,formatLong:pe,formatRelative:De,localize:$e,match:Ee,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Be(){const[e]=j();return e.language==="pt-BR"?Re:void 0}export{W as a,fe as e,Je as f,F as g,P as n,Be as u};
1
+ import{t as y,c as S,d as x,b as D,e as M}from"./differenceInSeconds-C3x8sHUj.js";import{x as j}from"./index-B9dD9jj0.js";let T={};function F(){return T}function W(e){const a=y(e),t=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return t.setUTCFullYear(a.getFullYear()),+e-+t}function P(e,...a){const t=S.bind(null,e||a.find(o=>typeof o=="object"));return a.map(t)}function v(e,a){const t=+y(e)-+y(a);return t<0?-1:t>0?1:t}function $(e){return S(e,Date.now())}function C(e,a,t){const[o,n]=P(t?.in,e,a),s=o.getFullYear()-n.getFullYear(),i=o.getMonth()-n.getMonth();return s*12+i}function X(e,a){const t=y(e,a?.in);return t.setHours(23,59,59,999),t}function q(e,a){const t=y(e,a?.in),o=t.getMonth();return t.setFullYear(t.getFullYear(),o+1,0),t.setHours(23,59,59,999),t}function z(e,a){const t=y(e,a?.in);return+X(t,a)==+q(t,a)}function A(e,a,t){const[o,n,s]=P(t?.in,e,e,a),i=v(n,s),r=Math.abs(C(n,s));if(r<1)return 0;n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*r);let l=v(n,s)===-i;z(o)&&r===1&&v(o,s)===1&&(l=!1);const u=i*(r-+l);return u===0?0:u}const O={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},N=(e,a,t)=>{let o;const n=O[e];return typeof n=="string"?o=n:a===1?o=n.one:o=n.other.replace("{{count}}",a.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+o:o+" ago":o};function b(e){return(a={})=>{const t=a.width?String(a.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const V={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Y={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},H={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_={date:b({formats:V,defaultWidth:"full"}),time:b({formats:Y,defaultWidth:"full"}),dateTime:b({formats:H,defaultWidth:"full"})},L={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},E=(e,a,t,o)=>L[e];function m(e){return(a,t)=>{const o=t?.context?String(t.context):"standalone";let n;if(o==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,r=t?.width?String(t.width):i;n=e.formattingValues[r]||e.formattingValues[i]}else{const i=e.defaultWidth,r=t?.width?String(t.width):e.defaultWidth;n=e.values[r]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(a):a;return n[s]}}const R={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},I={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Q={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},J={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},B={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},U={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},K=(e,a)=>{const t=Number(e),o=t%100;if(o>20||o<10)switch(o%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},G={ordinalNumber:K,era:m({values:R,defaultWidth:"wide"}),quarter:m({values:I,defaultWidth:"wide",argumentCallback:e=>e-1}),month:m({values:Q,defaultWidth:"wide"}),day:m({values:J,defaultWidth:"wide"}),dayPeriod:m({values:B,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})};function c(e){return(a,t={})=>{const o=t.width,n=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=a.match(n);if(!s)return null;const i=s[0],r=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?ee(r,w=>w.test(i)):Z(r,w=>w.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=t.valueCallback?t.valueCallback(u):u;const h=a.slice(i.length);return{value:u,rest:h}}}function Z(e,a){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&a(e[t]))return t}function ee(e,a){for(let t=0;t<e.length;t++)if(a(e[t]))return t}function k(e){return(a,t={})=>{const o=a.match(e.matchPattern);if(!o)return null;const n=o[0],s=a.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=t.valueCallback?t.valueCallback(i):i;const r=a.slice(n.length);return{value:i,rest:r}}}const te=/^(\d+)(th|st|nd|rd)?/i,ae=/\d+/i,ne={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},oe={any:[/^b/i,/^(a|c)/i]},re={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ie={any:[/1/i,/2/i,/3/i,/4/i]},se={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},de={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ue={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},me={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ce={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},le={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},he={ordinalNumber:k({matchPattern:te,parsePattern:ae,valueCallback:e=>parseInt(e,10)}),era:c({matchPatterns:ne,defaultMatchWidth:"wide",parsePatterns:oe,defaultParseWidth:"any"}),quarter:c({matchPatterns:re,defaultMatchWidth:"wide",parsePatterns:ie,defaultParseWidth:"any",valueCallback:e=>e+1}),month:c({matchPatterns:se,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any"}),day:c({matchPatterns:ue,defaultMatchWidth:"wide",parsePatterns:me,defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:ce,defaultMatchWidth:"any",parsePatterns:le,defaultParseWidth:"any"})},fe={code:"en-US",formatDistance:N,formatLong:_,formatRelative:E,localize:G,match:he,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ge(e,a,t){const o=F(),n=t?.locale??o.locale??fe,s=2520,i=v(e,a);if(isNaN(i))throw new RangeError("Invalid time value");const r=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:i}),[l,u]=P(t?.in,...i>0?[a,e]:[e,a]),h=x(u,l),w=(W(u)-W(l))/1e3,d=Math.round((h-w)/60);let g;if(d<2)return t?.includeSeconds?h<5?n.formatDistance("lessThanXSeconds",5,r):h<10?n.formatDistance("lessThanXSeconds",10,r):h<20?n.formatDistance("lessThanXSeconds",20,r):h<40?n.formatDistance("halfAMinute",0,r):h<60?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",1,r):d===0?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",d,r);if(d<45)return n.formatDistance("xMinutes",d,r);if(d<90)return n.formatDistance("aboutXHours",1,r);if(d<D){const f=Math.round(d/60);return n.formatDistance("aboutXHours",f,r)}else{if(d<s)return n.formatDistance("xDays",1,r);if(d<M){const f=Math.round(d/D);return n.formatDistance("xDays",f,r)}else if(d<M*2)return g=Math.round(d/M),n.formatDistance("aboutXMonths",g,r)}if(g=A(u,l),g<12){const f=Math.round(d/M);return n.formatDistance("xMonths",f,r)}else{const f=g%12,p=Math.trunc(g/12);return f<3?n.formatDistance("aboutXYears",p,r):f<9?n.formatDistance("overXYears",p,r):n.formatDistance("almostXYears",p+1,r)}}function Je(e,a){return ge(e,$(e),a)}const be={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},ye=(e,a,t)=>{let o;const n=be[e];return typeof n=="string"?o=n:a===1?o=n.one:o=n.other.replace("{{count}}",String(a)),t?.addSuffix?t.comparison&&t.comparison>0?"em "+o:"há "+o:o},we={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Me={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ve={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pe={date:b({formats:we,defaultWidth:"full"}),time:b({formats:Me,defaultWidth:"full"}),dateTime:b({formats:ve,defaultWidth:"full"})},Pe={lastWeek:e=>{const a=e.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},De=(e,a,t,o)=>{const n=Pe[e];return typeof n=="function"?n(a):n},We={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Se={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},ke={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},xe={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},je={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Te={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Fe=(e,a)=>{const t=Number(e);return a?.unit==="week"?t+"ª":t+"º"},$e={ordinalNumber:Fe,era:m({values:We,defaultWidth:"wide"}),quarter:m({values:Se,defaultWidth:"wide",argumentCallback:e=>e-1}),month:m({values:ke,defaultWidth:"wide"}),day:m({values:xe,defaultWidth:"wide"}),dayPeriod:m({values:je,defaultWidth:"wide",formattingValues:Te,defaultFormattingWidth:"wide"})},Ce=/^(\d+)[ºªo]?/i,Xe=/\d+/i,qe={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},ze={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},Ae={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Oe={any:[/1/i,/2/i,/3/i,/4/i]},Ne={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Ve={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},Ye={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},He={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},_e={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Le={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},Ee={ordinalNumber:k({matchPattern:Ce,parsePattern:Xe,valueCallback:e=>parseInt(e,10)}),era:c({matchPatterns:qe,defaultMatchWidth:"wide",parsePatterns:ze,defaultParseWidth:"any"}),quarter:c({matchPatterns:Ae,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:c({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:Ve,defaultParseWidth:"any"}),day:c({matchPatterns:Ye,defaultMatchWidth:"wide",parsePatterns:He,defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:_e,defaultMatchWidth:"any",parsePatterns:Le,defaultParseWidth:"any"})},Re={code:"pt-BR",formatDistance:ye,formatLong:pe,formatRelative:De,localize:$e,match:Ee,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Be(){const[e]=j();return e.language==="pt-BR"?Re:void 0}export{W as a,fe as e,Je as f,F as g,P as n,Be as u};
@@ -1 +1 @@
1
- import{r as t}from"./index-D9LnhQDL.js";function f({save:u,delayMs:n=1e3}){const r=t.useRef(u);r.current=u;const e=t.useRef(null),c=()=>{r.current().catch(()=>{})},o=()=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,c()},n)},s=()=>(e.current&&(clearTimeout(e.current),e.current=null),r.current());return t.useEffect(()=>()=>{e.current&&(clearTimeout(e.current),e.current=null,c())},[]),{schedule:o,flush:s}}export{f as u};
1
+ import{r as t}from"./index-B9dD9jj0.js";function f({save:u,delayMs:n=1e3}){const r=t.useRef(u);r.current=u;const e=t.useRef(null),c=()=>{r.current().catch(()=>{})},o=()=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,c()},n)},s=()=>(e.current&&(clearTimeout(e.current),e.current=null),r.current());return t.useEffect(()=>()=>{e.current&&(clearTimeout(e.current),e.current=null,c())},[]),{schedule:o,flush:s}}export{f as u};
@@ -1 +1 @@
1
- import{c as m,r as n}from"./index-D9LnhQDL.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
1
+ import{c as m,r as n}from"./index-B9dD9jj0.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
@@ -1 +1 @@
1
- import{X as C,a2 as I,m as g,K,r as S,q as b}from"./index-D9LnhQDL.js";import{u as m}from"./use-ai-providers-DKskI-lk.js";const a=new Map;function w(){const{org:n}=C(),c=I(),s=m(),o=s.find(t=>t.providerId==="deco"),{data:i,isLoading:d,refetch:l,isFetching:u}=g({queryKey:K.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await c.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),e=i?.balanceCents??null,p=e!=null?e/100:null,r=S.useRef(new Map);if(e!=null){const t=a.get(n.id);r.current.get(n.id)&&t!=null&&e>t&&b("credits_topped_up_detected",{organization_id:n.id,delta_cents:e-t,previous_balance_cents:t,new_balance_cents:e}),a.set(n.id,e),r.current.set(n.id,!0)}const y=!!o,f=e!=null&&e>0,_=e!=null&&e===0,h=e!=null&&e===200,v=s.length>0&&s.every(t=>t.providerId==="deco");return{hasDecoKey:y,decoKeyId:o?.id??null,balanceCents:e,balanceDollars:p,hasCredits:f,isZeroBalance:_,isInitialFreeCredit:h,hasOnlyDecoProvider:v,isLoading:d,isFetching:u,refetch:l}}export{w as u};
1
+ import{X as C,a2 as I,m as g,K,r as S,q as b}from"./index-B9dD9jj0.js";import{u as m}from"./use-ai-providers-C98JaJAU.js";const a=new Map;function w(){const{org:n}=C(),c=I(),s=m(),o=s.find(t=>t.providerId==="deco"),{data:i,isLoading:d,refetch:l,isFetching:u}=g({queryKey:K.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await c.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),e=i?.balanceCents??null,p=e!=null?e/100:null,r=S.useRef(new Map);if(e!=null){const t=a.get(n.id);r.current.get(n.id)&&t!=null&&e>t&&b("credits_topped_up_detected",{organization_id:n.id,delta_cents:e-t,previous_balance_cents:t,new_balance_cents:e}),a.set(n.id,e),r.current.set(n.id,!0)}const y=!!o,f=e!=null&&e>0,_=e!=null&&e===0,h=e!=null&&e===200,v=s.length>0&&s.every(t=>t.providerId==="deco");return{hasDecoKey:y,decoKeyId:o?.id??null,balanceCents:e,balanceDollars:p,hasCredits:f,isZeroBalance:_,isInitialFreeCredit:h,hasOnlyDecoProvider:v,isLoading:d,isFetching:u,refetch:l}}export{w as u};
@@ -1 +1 @@
1
- import{c as h,dD as I,K as T,m as P,dE as x,af as D,r as l}from"./index-D9LnhQDL.js";import{j as M,D as S}from"./thread-intent-CUdr-H41.js";const O=1e6;function N(e,t,n){n>0&&e.setQueryData(T.aiPlanEntitlements(t),r=>{if(!r?.usage)return r;const s=r.usage;if(!s.limitMicros||s.usedMicros===null)return r;const u=s.usedMicros+n*O,a=Math.min(1,u/s.limitMicros);return{...r,usage:{...s,usedMicros:u,percent:a,state:a>=1?"exhausted":a>=.8?"warn":"ok"}}})}function g(){return x()?.plansEnabled===!0}function d(){const e=h.c(8),t=I(),n=t?.org.slug,r=g();let s;e[0]!==t?.org.id?(s=T.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=s):s=e[1];const u=!!n&&r;let a;e[2]!==n?(a=()=>D(n,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=n,e[3]=a):a=e[3];let c;return e[4]!==s||e[5]!==u||e[6]!==a?(c={queryKey:s,enabled:u,staleTime:6e4,retry:1,queryFn:a},e[4]=s,e[5]=u,e[6]=a,e[7]=c):c=e[7],P(c)}function C(e){const{data:t}=d();return!e||!t?!0:t.features[e]===!0}function j(){const e=g(),{isPending:t,fetchStatus:n}=d();return!e||n==="idle"||n==="paused"?!0:!t}function w(){const e=h.c(4),t=g(),{isSuccess:n,data:r}=d(),s=r?.features?.model_choice;let u;return e[0]!==n||e[1]!==t||e[2]!==s?(u=_({plansEnabled:t,isSuccess:n,modelChoice:s}),e[0]=n,e[1]=t,e[2]=s,e[3]=u):u=e[3],u}function _({plansEnabled:e,isSuccess:t,modelChoice:n}){return e?t&&n===!0:!0}function K(){const{data:e}=d();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}const m=()=>0;function L(e){const{orgSlug:t,taskId:n,enabled:r=!0,onStep:s,onFinish:u,onTaskStatus:a,onReconnect:c}=e,f=l.useRef({taskId:n,onStep:s,onFinish:u,onTaskStatus:a,onReconnect:c});f.current={taskId:n,onStep:s,onFinish:u,onTaskStatus:a,onReconnect:c};const E=l.useRef(null),b=l.useRef(r),p=l.useRef(t);(!E.current||b.current!==r||p.current!==t)&&(b.current=r,p.current=t,E.current=R=>{if(!r||!t)return()=>{};const k=y=>{let o;try{o=JSON.parse(y.data)}catch{return}const i=f.current;if(!(i.taskId&&o.subject!==i.taskId)){switch(o.type){case S.STEP:i.onStep?.(o);break;case S.FINISH:i.onFinish?.(o);break;case S.THREAD_STATUS:i.onTaskStatus?.(o);break}R()}};return M.subscribe(t,k,()=>f.current.onReconnect?.())}),l.useSyncExternalStore(E.current,m,m)}export{d as a,L as b,w as c,N as d,C as e,j as f,K as g,g as u};
1
+ import{c as h,dD as I,K as T,m as P,dE as x,af as D,r as l}from"./index-B9dD9jj0.js";import{j as M,D as S}from"./thread-intent-UQGFcX_y.js";const O=1e6;function N(e,t,n){n>0&&e.setQueryData(T.aiPlanEntitlements(t),r=>{if(!r?.usage)return r;const s=r.usage;if(!s.limitMicros||s.usedMicros===null)return r;const u=s.usedMicros+n*O,a=Math.min(1,u/s.limitMicros);return{...r,usage:{...s,usedMicros:u,percent:a,state:a>=1?"exhausted":a>=.8?"warn":"ok"}}})}function g(){return x()?.plansEnabled===!0}function d(){const e=h.c(8),t=I(),n=t?.org.slug,r=g();let s;e[0]!==t?.org.id?(s=T.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=s):s=e[1];const u=!!n&&r;let a;e[2]!==n?(a=()=>D(n,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=n,e[3]=a):a=e[3];let c;return e[4]!==s||e[5]!==u||e[6]!==a?(c={queryKey:s,enabled:u,staleTime:6e4,retry:1,queryFn:a},e[4]=s,e[5]=u,e[6]=a,e[7]=c):c=e[7],P(c)}function C(e){const{data:t}=d();return!e||!t?!0:t.features[e]===!0}function j(){const e=g(),{isPending:t,fetchStatus:n}=d();return!e||n==="idle"||n==="paused"?!0:!t}function w(){const e=h.c(4),t=g(),{isSuccess:n,data:r}=d(),s=r?.features?.model_choice;let u;return e[0]!==n||e[1]!==t||e[2]!==s?(u=_({plansEnabled:t,isSuccess:n,modelChoice:s}),e[0]=n,e[1]=t,e[2]=s,e[3]=u):u=e[3],u}function _({plansEnabled:e,isSuccess:t,modelChoice:n}){return e?t&&n===!0:!0}function K(){const{data:e}=d();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}const m=()=>0;function L(e){const{orgSlug:t,taskId:n,enabled:r=!0,onStep:s,onFinish:u,onTaskStatus:a,onReconnect:c}=e,f=l.useRef({taskId:n,onStep:s,onFinish:u,onTaskStatus:a,onReconnect:c});f.current={taskId:n,onStep:s,onFinish:u,onTaskStatus:a,onReconnect:c};const E=l.useRef(null),b=l.useRef(r),p=l.useRef(t);(!E.current||b.current!==r||p.current!==t)&&(b.current=r,p.current=t,E.current=R=>{if(!r||!t)return()=>{};const k=y=>{let o;try{o=JSON.parse(y.data)}catch{return}const i=f.current;if(!(i.taskId&&o.subject!==i.taskId)){switch(o.type){case S.STEP:i.onStep?.(o);break;case S.FINISH:i.onFinish?.(o);break;case S.THREAD_STATUS:i.onTaskStatus?.(o);break}R()}};return M.subscribe(t,k,()=>f.current.onReconnect?.())}),l.useSyncExternalStore(E.current,m,m)}export{d as a,L as b,w as c,N as d,C as e,j as f,K as g,g as u};
@@ -1 +1 @@
1
- import{c as oe,b as le,j as n,X as se,o as ie,a2 as ce,r as re,t as X,fs as ae,ft as de}from"./index-D9LnhQDL.js";import{A as Y,a as z,b as G,c as V,g as Z,d as ee,e as te,f as ne}from"./alert-dialog-Ba4KW5Tb.js";function ge(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=s.mode==="deleting";let f;e[0]!==a?(f=W=>{W||a()},e[0]=a,e[1]=f):f=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(Y,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(z,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(G,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let m;e[16]!==t?(m=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=m):m=e[17];let r;e[18]!==m?(r=n.jsx(V,{children:m}),e[18]=m,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let N;e[31]!==w||e[32]!==j||e[33]!==f?(N=n.jsx(ne,{open:w,onOpenChange:f,children:j}),e[31]=w,e[32]=j,e[33]=f,e[34]=N):N=e[34];const J=s.mode==="force-deleting";let p;e[35]!==a?(p=W=>{W||a()},e[35]=a,e[36]=p):p=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(Y,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let I;e[58]!==A||e[59]!==F?(I=n.jsx(z,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=I):I=e[60];let L;e[61]!==y||e[62]!==I?(L=n.jsxs(G,{children:[y,I]}),e[61]=y,e[62]=I,e[63]=L):L=e[63];let b;e[64]!==t?(b=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=b):b=e[65];let R;e[66]!==b?(R=n.jsx(V,{children:b}),e[66]=b,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==L||e[77]!==K?($=n.jsxs(te,{children:[L,K]}),e[76]=L,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==p||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:p,children:$}),e[79]=J,e[80]=p,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==N||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[N,k]}),e[83]=N,e[84]=k,e[85]=Q):Q=e[85],Q}function ue({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=ce(),[d,c]=re.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{ae(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===de&&l.queryKey[3]===o})},f=o=>{t(),w(o),X.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),f(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),m=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(m);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}X.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),f(o)}catch(l){const i=l instanceof Error?l.message:String(l);X.error(`Failed to delete connection: ${i}`)}}}}export{ge as D,ue as u};
1
+ import{c as oe,b as le,j as n,X as se,o as ie,a2 as ce,r as re,t as X,fs as ae,ft as de}from"./index-B9dD9jj0.js";import{A as Y,a as z,b as G,c as V,g as Z,d as ee,e as te,f as ne}from"./alert-dialog-DeJgSFRZ.js";function ge(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=s.mode==="deleting";let f;e[0]!==a?(f=W=>{W||a()},e[0]=a,e[1]=f):f=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(Y,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(z,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(G,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let m;e[16]!==t?(m=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=m):m=e[17];let r;e[18]!==m?(r=n.jsx(V,{children:m}),e[18]=m,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let N;e[31]!==w||e[32]!==j||e[33]!==f?(N=n.jsx(ne,{open:w,onOpenChange:f,children:j}),e[31]=w,e[32]=j,e[33]=f,e[34]=N):N=e[34];const J=s.mode==="force-deleting";let p;e[35]!==a?(p=W=>{W||a()},e[35]=a,e[36]=p):p=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(Y,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let I;e[58]!==A||e[59]!==F?(I=n.jsx(z,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=I):I=e[60];let L;e[61]!==y||e[62]!==I?(L=n.jsxs(G,{children:[y,I]}),e[61]=y,e[62]=I,e[63]=L):L=e[63];let b;e[64]!==t?(b=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=b):b=e[65];let R;e[66]!==b?(R=n.jsx(V,{children:b}),e[66]=b,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==L||e[77]!==K?($=n.jsxs(te,{children:[L,K]}),e[76]=L,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==p||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:p,children:$}),e[79]=J,e[80]=p,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==N||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[N,k]}),e[83]=N,e[84]=k,e[85]=Q):Q=e[85],Q}function ue({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=ce(),[d,c]=re.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{ae(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===de&&l.queryKey[3]===o})},f=o=>{t(),w(o),X.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),f(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),m=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(m);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}X.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),f(o)}catch(l){const i=l instanceof Error?l.message:String(l);X.error(`Failed to delete connection: ${i}`)}}}}export{ge as D,ue as u};
@@ -1 +1 @@
1
- import{c as s,m,K as c}from"./index-D9LnhQDL.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
1
+ import{c as s,m,K as c}from"./index-B9dD9jj0.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
@@ -1 +1 @@
1
- import{c as s}from"./index-D9LnhQDL.js";import{c as v,w}from"./section-preview-url-Csj0_ZDg.js";import{a1 as h}from"./claim-phase-copy-EPhExNlM.js";import{u as d}from"./use-session-runtime-DePI4bwj.js";function D(e){const t=s.c(4),r=d(e?.virtualMcpId).runtime==="cms",i=h(e);let l;return t[0]!==i||t[1]!==r||t[2]!==e?(l=e&&i&&r?v({...e,...i}):null,t[0]=i,t[1]=r,t[2]=e,t[3]=l):l=t[3],l}function R(e){const t=s.c(11);let r;t[0]!==e?(r=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=r):r=t[1];const i=D(r),l=e?.previewServerUrl??null;let n=null;if(l)try{let c;t[2]!==l?(c=new URL(l),t[2]=l,t[3]=c):c=t[3],n=c.host}catch{n=null}let o;t[4]!==i||t[5]!==e||t[6]!==l?(o=e&&l&&i?w(new URL(e.path,l).toString(),i):null,t[4]=i,t[5]=e,t[6]=l,t[7]=o):o=t[7];const f=o;let u;return t[8]!==n||t[9]!==f?(u={url:f,host:n},t[8]=n,t[9]=f,t[10]=u):u=t[10],u}export{D as a,R as u};
1
+ import{c as s}from"./index-B9dD9jj0.js";import{c as v,w}from"./section-preview-url-Csj0_ZDg.js";import{a1 as h}from"./claim-phase-copy-BRgB3yX1.js";import{u as d}from"./use-session-runtime-CsLaMszW.js";function D(e){const t=s.c(4),r=d(e?.virtualMcpId).runtime==="cms",i=h(e);let l;return t[0]!==i||t[1]!==r||t[2]!==e?(l=e&&i&&r?v({...e,...i}):null,t[0]=i,t[1]=r,t[2]=e,t[3]=l):l=t[3],l}function R(e){const t=s.c(11);let r;t[0]!==e?(r=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=r):r=t[1];const i=D(r),l=e?.previewServerUrl??null;let n=null;if(l)try{let c;t[2]!==l?(c=new URL(l),t[2]=l,t[3]=c):c=t[3],n=c.host}catch{n=null}let o;t[4]!==i||t[5]!==e||t[6]!==l?(o=e&&l&&i?w(new URL(e.path,l).toString(),i):null,t[4]=i,t[5]=e,t[6]=l,t[7]=o):o=t[7];const f=o;let u;return t[8]!==n||t[9]!==f?(u={url:f,host:n},t[8]=n,t[9]=f,t[10]=u):u=t[10],u}export{D as a,R as u};
@@ -1 +1 @@
1
- import{c as u,X as c,a2 as r,K as a,m as y,D as F,o as C,e as d}from"./index-D9LnhQDL.js";function E(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=F(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],y(s)}function m(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_CREATE",{...f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function q(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_DELETE",{id:f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,m as b,q as c,E as u};
1
+ import{c as u,X as c,a2 as r,K as a,m as y,D as F,o as C,e as d}from"./index-B9dD9jj0.js";function E(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=F(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],y(s)}function m(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_CREATE",{...f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function q(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_DELETE",{id:f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,m as b,q as c,E as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-D9LnhQDL.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
1
+ import{r as e}from"./index-B9dD9jj0.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
@@ -1 +1 @@
1
- import{r as L,X as q,o as Q,a as V,at as z,b as B,e as T,q as F,t as S,K as M,j as t,B as P,av as G,c as J,a2 as K,am as U,m as Z}from"./index-D9LnhQDL.js";import{D as k,a as Y,b as $,c as H,d as X,e as W}from"./dialog-CGclnAkN.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-bcXKqc8N.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-C2txP07f.js";import{T as re}from"./textarea-D-mcJV9e.js";import{u as ae}from"./use-org-auth-client-DveZle8A.js";import{u as le}from"./use-organization-roles-Bapbgw8R.js";const ce=G().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=L.useState(!1),{locator:h}=q(),x=ae(),r=Q(),{data:m}=V.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=z({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),v=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async R=>{const y=await x.organization.inviteMember({email:R,role:s});if(y.error)throw new Error(y.error.message);return y.data})),w=a.filter(R=>R.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}v.mutate({emails:p,role:n.role})},b=p.length>0&&!!j;return t.jsxs(k,{open:d,onOpenChange:c,children:[t.jsx(Y,{asChild:!0,children:e}),t.jsxs($,{className:"sm:max-w-lg",children:[t.jsx(H,{children:t.jsx(X,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:v.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:v.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs(W,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:v.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:v.isPending||!b,children:v.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:x}=U(),r=x||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=Z(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function je(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),x=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==x?(m=()=>{x.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),x.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=x,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=b=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:b}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=b=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:b}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const v=T(i);let D;return e[26]!==E||e[27]!==v?(D={approve:E,deny:v},e[26]=E,e[27]=v,e[28]=D):D=e[28],D}export{ve as I,je as a,xe as u};
1
+ import{r as L,X as q,o as Q,a as V,at as z,b as B,e as T,q as F,t as S,K as M,j as t,B as P,av as G,c as J,a2 as K,am as U,m as Z}from"./index-B9dD9jj0.js";import{D as k,a as Y,b as $,c as H,d as X,e as W}from"./dialog-Mg_Z3ES1.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-BgAERq-t.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-Cd1ykg-h.js";import{T as re}from"./textarea-r66bOcCD.js";import{u as ae}from"./use-org-auth-client-DM3Q5_fm.js";import{u as le}from"./use-organization-roles-Bjw-G0xx.js";const ce=G().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=L.useState(!1),{locator:h}=q(),x=ae(),r=Q(),{data:m}=V.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=z({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),v=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async R=>{const y=await x.organization.inviteMember({email:R,role:s});if(y.error)throw new Error(y.error.message);return y.data})),w=a.filter(R=>R.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}v.mutate({emails:p,role:n.role})},b=p.length>0&&!!j;return t.jsxs(k,{open:d,onOpenChange:c,children:[t.jsx(Y,{asChild:!0,children:e}),t.jsxs($,{className:"sm:max-w-lg",children:[t.jsx(H,{children:t.jsx(X,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:v.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:v.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs(W,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:v.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:v.isPending||!b,children:v.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:x}=U(),r=x||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=Z(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function je(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),x=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==x?(m=()=>{x.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),x.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=x,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=b=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:b}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=b=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:b}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const v=T(i);let D;return e[26]!==E||e[27]!==v?(D={approve:E,deny:v},e[26]=E,e[27]=v,e[28]=D):D=e[28],D}export{ve as I,je as a,xe as u};
@@ -1 +1 @@
1
- import{c as tt,b as at,u as ot,X as nt,ef as st,eg as it,eh as we,ei as Ce,ac as rt,aa as Ve,ej as ct,ek as lt,r as ce,d_ as dt,C as Me,el as pt,em as mt}from"./index-D9LnhQDL.js";import{g as ut,h as ft,u as bt,j as Tt,k as vt,l as It}from"./use-chat-layout-state-BjAQ-jEe.js";import{b as gt}from"./agent-icon-BTsAxpiE.js";import{i as yt}from"./Monitor01-B7ACM5ru.js";import{u as Pt}from"./use-connection-DHC7ikhv.js";import{b as ht}from"./use-mcp-client-DwI8A7i_.js";import{u as kt}from"./use-mcp-tools-CfhB5gVo.js";import{a as wt,g as Ct,c as Vt}from"./repository-binding-5QFpfewx.js";import{g as Mt}from"./types-CJIIzGfz.js";import{t as St}from"./utils-CVEq3hMx.js";import{d as Rt,u as At,b as L}from"./use-project-scope-B0guFEKE.js";import"./index-CvEB1wsJ.js";import{d as jt}from"./use-navigate-to-agent-BkimVMTW.js";import{c as Dt,d as Nt}from"./sandbox-lifecycle-context-B7U4JGhb.js";import{F as Se}from"./file-type-icon-RYJiailm.js";import{a as xt,u as Ut}from"./use-panel-navigate-Bs3wrk2o.js";import{r as B}from"./resolve-tab-icon-B5IDCHgC.js";import{u as Ht}from"./use-task-metadata-w1PI2EXQ.js";import{i as Et,r as Ft,s as Ot}from"./shell-layout-jXhY2XCJ.js";import{u as Lt}from"./use-session-runtime-DePI4bwj.js";import{u as Bt}from"./use-is-desktop-app-BNujXJc_.js";import{u as $t}from"./use-organization-settings-Cwt51JJ-.js";import{b as Kt}from"./chat-context-BI1s3T66.js";import{r as Qt}from"./virtual-mcp-CXOm_lWW.js";function Wt(a,e){return!!a&&!!e&&e===`thread:${a}`}function Xt(a){return a.threadHasRepo?"repo":Wt(a.threadId,a.sandboxBranch)?"none":a.agentHasRepo?"repo":"none"}function Pa(a){const e=tt.c(52),l=at(),{openPanel:g,closePanel:$}=xt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={strict:!1},e[0]=y):y=e[0];const Re=ot(y),le=Ut(),de=ut(),s=wt(a.virtualMcpId),P=Ht(a.taskId),{org:n}=nt(),{currentBranch:pe,activeTask:h}=Kt(),me=Bt();let r,d,p,m,k;e[1]!==s||e[2]!==n.id||e[3]!==n.slug?(r=Ct(s),k=jt,d=n.id,p=n.slug,m=Vt(r),e[1]=s,e[2]=n.id,e[3]=n.slug,e[4]=r,e[5]=d,e[6]=p,e[7]=m,e[8]=k):(r=e[4],d=e[5],p=e[6],m=e[7],k=e[8]);const K=r?.owner??"",Q=r?.name??"",W=r?pe:null;let w;e[9]!==d||e[10]!==p||e[11]!==m||e[12]!==K||e[13]!==Q||e[14]!==W?(w={orgId:d,orgSlug:p,target:m,owner:K,repo:Q,branch:W},e[9]=d,e[10]=p,e[11]=m,e[12]=K,e[13]=Q,e[14]=W,e[15]=w):w=e[15];const C=k(w),Ae=C.data?.state==="open",T=s?.metadata.ui?.layout??null,u=T?.tabs??[],v=s?.id?st(s.id):null,V=P?.expanded_tools??[],je=Rt(s),M=$t(),{scopeId:De,project:Ne}=At(),X=ft(De,Ne,s),q=bt(X.project),ue=Tt(X.resolvedScopeId,L(X.project?.metadata),q.presence);let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S={includeVirtual:!0},e[16]=S):S=e[16];const f=Pt(S),xe=Dt(),{vmEntry:fe,previewUrl:be}=Nt(),z=h?.branch??pe;let R;e[17]!==h?.metadata||e[18]!==a.taskId||e[19]!==s?.metadata||e[20]!==P||e[21]!==z?(R=Xt({threadId:a.taskId,sandboxBranch:z,agentHasRepo:L(s?.metadata),threadHasRepo:L(P)||L(h?.metadata)}),e[17]=h?.metadata,e[18]=a.taskId,e[19]=s?.metadata,e[20]=P,e[21]=z,e[22]=R):R=e[22];const Ue=R,Te=xe.lifecycle.phase==="running",{runtime:He,resolved:ve}=Lt(a.virtualMcpId);let A;e[23]!==me||e[24]!==be||e[25]!==fe?(A=void 0,e[23]=me,e[24]=be,e[25]=fe,e[26]=A):A=e[26];const Ee=A,Ie=ht({connectionId:v??void 0,orgId:n.id,orgSlug:n.slug,mcpUrl:Ee}),G=Ie,J=!!Ie&&Te;let j;e[27]!==G||e[28]!==J?(j={client:G,enabled:J},e[27]=G,e[28]=J,e[29]=j):j=e[29];const{data:Fe}=kt(j),ge=v&&Te?(Fe?.tools??[]).filter(Jt).map(t=>({connectionId:v,toolName:t.name,label:St(t.name),icon:null})):[],Y=ge[0],Oe=Y?ge:[],I=Y&&v?{type:"ext-apps",id:v,toolName:Y.toolName}:T?.defaultMainView??null,Le=Qt(T),ye={assets:q.assetsPending,siteAccess:q.siteAccessPending},{activeTab:c,mainOpen:Be}=it({panelTabId:le,mainPanelParam:Re.mainpanel,routeDefaultMain:de,metadata:I||T?{defaultMainView:I,tabs:u.map(Gt)}:null}),Z=je&&(Ae||C.isPending&&c==="git"),$e=I||T?{defaultMainView:I,tabs:u.map(zt)}:null,D=Ft({hasSource:Ue==="repo"||M,runtime:He,cmsMode:Le}),Ke=D.includes("content"),Qe=we($e),We=I?.type,Pe=vt(We,ue,ye,D,ve),N=Pe?we(null):Qe,Xe=It(c,ue,ye),qe=!D.includes("code")&&ve&&Ce(c)!==null,o=!le&&!de&&Pe||c==="git"&&!Z&&!C.isPending||c==="content"&&!Ke||qe||Xe?N:c,b=c==="git"&&!Z&&!C.isPending?!1:Be,_=rt(o);let x;e[30]!==l?(x=t=>l(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[30]=l,e[31]=x):x=e[31];const ze=x,he=[];Z&&he.push({id:"git",title:l("common.mainPanelTabs.reviewChanges")});const ee=new Map;for(const t of V){const i=Ve(t.appId,t.toolName);ee.set(i,{id:i,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Oe){if(t.toolName==="fetch_assets")continue;const i=Ve(t.connectionId,t.toolName);ee.set(i,{id:i,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const te=ct(o),ae=te?te.key.split("/").pop()??te.key:null,Ge=ae?[{id:o,title:ae,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Se,{filename:ae,...t})}}]:[],U=lt(o),Je=U?[{id:o,title:(U.path.split("/").pop()??U.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>ce.createElement(U.path.startsWith("pages/")?gt:yt,t)}}]:[],oe=dt(o),ne=oe?oe.path.split("/").pop()??oe.path:null,Ye=ne?[{id:o,title:ne,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Se,{filename:ne,...t})}}]:[],Ze=Et(o)?D.map(t=>({id:t==="code"&&Ce(o)?o:t,title:ze(t),kind:"system",icon:B({tabId:t,kind:"system",connections:f})})):[];let H;e[32]!==f?(H=t=>({id:pt(t.id),title:t.title,kind:"agent",icon:B({tabId:t.id,kind:"agent",appId:t.view.appId,connections:f})}),e[32]=f,e[33]=H):H=e[33];const _e=[...Ze,...he.map(t=>({id:t.id,title:t.title,kind:"system",icon:B({tabId:t.id,kind:"system",connections:f})})),...Ge,...Je,...Ye,...u.map(H),...Array.from(ee.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:B({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:f})}))],ke=new Set,se=_e.filter(t=>ke.has(t.id)?!1:(ke.add(t.id),!0)),et=a.virtualMcpId;let E;e[34]!==n.id?(E=Me(n.id),e[34]=n.id,e[35]=E):E=e[35];const ie=et===E;let F;e[36]!==o||e[37]!==$||e[38]!==b||e[39]!==ie||e[40]!==g||e[41]!==n.id||e[42]!==M?(F=t=>{if(Ot({reportsOnly:M,onReportAgent:ie,tabId:t})){g(t,{virtualmcpid:Me(n.id),search:qt});return}const i=mt({clickedId:t,activeTab:o,mainOpen:b});"close"in i?$():g(i.tabId)},e[36]=o,e[37]=$,e[38]=b,e[39]=ie,e[40]=g,e[41]=n.id,e[42]=M,e[43]=F):F=e[43];const re=F;let O;return e[44]!==o||e[45]!==_||e[46]!==V||e[47]!==u||e[48]!==b||e[49]!==re||e[50]!==se?(O={activeTab:o,mainOpen:b,setActiveTab:re,layoutTabs:u,expandedTools:V,automationTabParsed:_,tabs:se},e[44]=o,e[45]=_,e[46]=V,e[47]=u,e[48]=b,e[49]=re,e[50]=se,e[51]=O):O=e[51],O}function qt(a){return{...a,thread:void 0}}function zt(a){return{id:a.id}}function Gt(a){return{id:a.id}}function Jt(a){return!!Mt(a._meta)}export{Xt as r,Pa as u};
1
+ import{c as tt,b as at,u as ot,X as nt,ef as st,eg as it,eh as we,ei as Ce,ac as rt,aa as Ve,ej as ct,ek as lt,r as ce,d_ as dt,C as Me,el as pt,em as mt}from"./index-B9dD9jj0.js";import{g as ut,h as ft,u as bt,j as Tt,k as vt,l as It}from"./use-chat-layout-state-BfZJHnkW.js";import{b as gt}from"./agent-icon-TQUkqPJj.js";import{i as yt}from"./Monitor01-50nhII2F.js";import{u as Pt}from"./use-connection-BdSGHKJK.js";import{b as ht}from"./use-mcp-client-CqsHeShn.js";import{u as kt}from"./use-mcp-tools-CHvaFbLg.js";import{a as wt,g as Ct,c as Vt}from"./repository-binding-DzrKIMc8.js";import{g as Mt}from"./types-DyM6In73.js";import{t as St}from"./utils-CVEq3hMx.js";import{d as Rt,u as At,b as L}from"./use-project-scope-Bgnjdhs7.js";import"./index-2-Z1VD2F.js";import{d as jt}from"./use-navigate-to-agent-PjEm7mol.js";import{c as Dt,d as Nt}from"./sandbox-lifecycle-context-OPdARg4I.js";import{F as Se}from"./file-type-icon-BhiPdwxi.js";import{a as xt,u as Ut}from"./use-panel-navigate-DH6_TAsx.js";import{r as B}from"./resolve-tab-icon-CgOUF0YA.js";import{u as Ht}from"./use-task-metadata-DvgRil5z.js";import{i as Et,r as Ft,s as Ot}from"./shell-layout-Bl8of89A.js";import{u as Lt}from"./use-session-runtime-CsLaMszW.js";import{u as Bt}from"./use-is-desktop-app-BNujXJc_.js";import{u as $t}from"./use-organization-settings-DbPbYeMx.js";import{b as Kt}from"./chat-context-DppIIhzA.js";import{r as Qt}from"./virtual-mcp-Cr9A-Wo0.js";function Wt(a,e){return!!a&&!!e&&e===`thread:${a}`}function Xt(a){return a.threadHasRepo?"repo":Wt(a.threadId,a.sandboxBranch)?"none":a.agentHasRepo?"repo":"none"}function Pa(a){const e=tt.c(52),l=at(),{openPanel:g,closePanel:$}=xt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={strict:!1},e[0]=y):y=e[0];const Re=ot(y),le=Ut(),de=ut(),s=wt(a.virtualMcpId),P=Ht(a.taskId),{org:n}=nt(),{currentBranch:pe,activeTask:h}=Kt(),me=Bt();let r,d,p,m,k;e[1]!==s||e[2]!==n.id||e[3]!==n.slug?(r=Ct(s),k=jt,d=n.id,p=n.slug,m=Vt(r),e[1]=s,e[2]=n.id,e[3]=n.slug,e[4]=r,e[5]=d,e[6]=p,e[7]=m,e[8]=k):(r=e[4],d=e[5],p=e[6],m=e[7],k=e[8]);const K=r?.owner??"",Q=r?.name??"",W=r?pe:null;let w;e[9]!==d||e[10]!==p||e[11]!==m||e[12]!==K||e[13]!==Q||e[14]!==W?(w={orgId:d,orgSlug:p,target:m,owner:K,repo:Q,branch:W},e[9]=d,e[10]=p,e[11]=m,e[12]=K,e[13]=Q,e[14]=W,e[15]=w):w=e[15];const C=k(w),Ae=C.data?.state==="open",T=s?.metadata.ui?.layout??null,u=T?.tabs??[],v=s?.id?st(s.id):null,V=P?.expanded_tools??[],je=Rt(s),M=$t(),{scopeId:De,project:Ne}=At(),X=ft(De,Ne,s),q=bt(X.project),ue=Tt(X.resolvedScopeId,L(X.project?.metadata),q.presence);let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S={includeVirtual:!0},e[16]=S):S=e[16];const f=Pt(S),xe=Dt(),{vmEntry:fe,previewUrl:be}=Nt(),z=h?.branch??pe;let R;e[17]!==h?.metadata||e[18]!==a.taskId||e[19]!==s?.metadata||e[20]!==P||e[21]!==z?(R=Xt({threadId:a.taskId,sandboxBranch:z,agentHasRepo:L(s?.metadata),threadHasRepo:L(P)||L(h?.metadata)}),e[17]=h?.metadata,e[18]=a.taskId,e[19]=s?.metadata,e[20]=P,e[21]=z,e[22]=R):R=e[22];const Ue=R,Te=xe.lifecycle.phase==="running",{runtime:He,resolved:ve}=Lt(a.virtualMcpId);let A;e[23]!==me||e[24]!==be||e[25]!==fe?(A=void 0,e[23]=me,e[24]=be,e[25]=fe,e[26]=A):A=e[26];const Ee=A,Ie=ht({connectionId:v??void 0,orgId:n.id,orgSlug:n.slug,mcpUrl:Ee}),G=Ie,J=!!Ie&&Te;let j;e[27]!==G||e[28]!==J?(j={client:G,enabled:J},e[27]=G,e[28]=J,e[29]=j):j=e[29];const{data:Fe}=kt(j),ge=v&&Te?(Fe?.tools??[]).filter(Jt).map(t=>({connectionId:v,toolName:t.name,label:St(t.name),icon:null})):[],Y=ge[0],Oe=Y?ge:[],I=Y&&v?{type:"ext-apps",id:v,toolName:Y.toolName}:T?.defaultMainView??null,Le=Qt(T),ye={assets:q.assetsPending,siteAccess:q.siteAccessPending},{activeTab:c,mainOpen:Be}=it({panelTabId:le,mainPanelParam:Re.mainpanel,routeDefaultMain:de,metadata:I||T?{defaultMainView:I,tabs:u.map(Gt)}:null}),Z=je&&(Ae||C.isPending&&c==="git"),$e=I||T?{defaultMainView:I,tabs:u.map(zt)}:null,D=Ft({hasSource:Ue==="repo"||M,runtime:He,cmsMode:Le}),Ke=D.includes("content"),Qe=we($e),We=I?.type,Pe=vt(We,ue,ye,D,ve),N=Pe?we(null):Qe,Xe=It(c,ue,ye),qe=!D.includes("code")&&ve&&Ce(c)!==null,o=!le&&!de&&Pe||c==="git"&&!Z&&!C.isPending||c==="content"&&!Ke||qe||Xe?N:c,b=c==="git"&&!Z&&!C.isPending?!1:Be,_=rt(o);let x;e[30]!==l?(x=t=>l(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[30]=l,e[31]=x):x=e[31];const ze=x,he=[];Z&&he.push({id:"git",title:l("common.mainPanelTabs.reviewChanges")});const ee=new Map;for(const t of V){const i=Ve(t.appId,t.toolName);ee.set(i,{id:i,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Oe){if(t.toolName==="fetch_assets")continue;const i=Ve(t.connectionId,t.toolName);ee.set(i,{id:i,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const te=ct(o),ae=te?te.key.split("/").pop()??te.key:null,Ge=ae?[{id:o,title:ae,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Se,{filename:ae,...t})}}]:[],U=lt(o),Je=U?[{id:o,title:(U.path.split("/").pop()??U.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>ce.createElement(U.path.startsWith("pages/")?gt:yt,t)}}]:[],oe=dt(o),ne=oe?oe.path.split("/").pop()??oe.path:null,Ye=ne?[{id:o,title:ne,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Se,{filename:ne,...t})}}]:[],Ze=Et(o)?D.map(t=>({id:t==="code"&&Ce(o)?o:t,title:ze(t),kind:"system",icon:B({tabId:t,kind:"system",connections:f})})):[];let H;e[32]!==f?(H=t=>({id:pt(t.id),title:t.title,kind:"agent",icon:B({tabId:t.id,kind:"agent",appId:t.view.appId,connections:f})}),e[32]=f,e[33]=H):H=e[33];const _e=[...Ze,...he.map(t=>({id:t.id,title:t.title,kind:"system",icon:B({tabId:t.id,kind:"system",connections:f})})),...Ge,...Je,...Ye,...u.map(H),...Array.from(ee.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:B({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:f})}))],ke=new Set,se=_e.filter(t=>ke.has(t.id)?!1:(ke.add(t.id),!0)),et=a.virtualMcpId;let E;e[34]!==n.id?(E=Me(n.id),e[34]=n.id,e[35]=E):E=e[35];const ie=et===E;let F;e[36]!==o||e[37]!==$||e[38]!==b||e[39]!==ie||e[40]!==g||e[41]!==n.id||e[42]!==M?(F=t=>{if(Ot({reportsOnly:M,onReportAgent:ie,tabId:t})){g(t,{virtualmcpid:Me(n.id),search:qt});return}const i=mt({clickedId:t,activeTab:o,mainOpen:b});"close"in i?$():g(i.tabId)},e[36]=o,e[37]=$,e[38]=b,e[39]=ie,e[40]=g,e[41]=n.id,e[42]=M,e[43]=F):F=e[43];const re=F;let O;return e[44]!==o||e[45]!==_||e[46]!==V||e[47]!==u||e[48]!==b||e[49]!==re||e[50]!==se?(O={activeTab:o,mainOpen:b,setActiveTab:re,layoutTabs:u,expandedTools:V,automationTabParsed:_,tabs:se},e[44]=o,e[45]=_,e[46]=V,e[47]=u,e[48]=b,e[49]=re,e[50]=se,e[51]=O):O=e[51],O}function qt(a){return{...a,thread:void 0}}function zt(a){return{id:a.id}}function Gt(a){return{id:a.id}}function Jt(a){return!!Mt(a._meta)}export{Xt as r,Pa as u};
@@ -1 +1 @@
1
- import{c as b,b as S,Z as k,aJ as N,j as o,X as $,K as A,D as L}from"./index-D9LnhQDL.js";import{B as g}from"./badge-DzpaGRTk.js";import{b as v,T,a as I,c as _}from"./tooltip-C-B-WE46.js";import{g as H}from"./types-CJIIzGfz.js";import{s as P}from"./Image01-BdTgRZP1.js";import{p as U,aS as w}from"./agent-icon-BTsAxpiE.js";import{i as O}from"./mcp-oauth-Bx2SR9KP.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function F(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=S();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let p;e[15]!==n||e[16]!==a||e[17]!==u?(p=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=p):p=e[18];let m;return e[19]!==s||e[20]!==p?(m=o.jsx(s,{children:p}),e[19]=s,e[20]=p,e[21]=m):m=e[21],m}function J(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{F as T,J as u};
1
+ import{c as b,b as S,Z as k,aJ as N,j as o,X as $,K as A,D as L}from"./index-B9dD9jj0.js";import{B as g}from"./badge-DzTxW-Ts.js";import{b as v,T,a as I,c as _}from"./tooltip-CM3YyNDC.js";import{g as H}from"./types-DyM6In73.js";import{s as P}from"./Image01-CsDdVFAJ.js";import{p as U,aS as w}from"./agent-icon-TQUkqPJj.js";import{i as O}from"./mcp-oauth-DCDrWVc0.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function F(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=S();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let p;e[15]!==n||e[16]!==a||e[17]!==u?(p=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=p):p=e[18];let m;return e[19]!==s||e[20]!==p?(m=o.jsx(s,{children:p}),e[19]=s,e[20]=p,e[21]=m):m=e[21],m}function J(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{F as T,J as u};
@@ -1,4 +1,4 @@
1
- import{c3 as ue,c4 as de,c5 as he,c6 as fe,c7 as pe,c8 as _,c9 as g,ca as me,cb as _e,cc as we,cd as M,ce as ge,cf as D,cg as Te,ch as q,ci as ye,cj as L,ck as ke,cl as ve,cm as Se,cn as W,co as Ce,cp as be,cq as Re,cr as se,cs as Ie,ct as Ee,cu as qe,b3 as Pe,cv as $e,cw as Me,cx as A,cy as Ae,cz as He,cA as Oe,cB as Ue,cC as xe,cD as Ne,cE as je,cF as Fe,cG as De,cH as Le,cI as Ve,cJ as ze,cK as Qe,aW as U,cL as Je,cM as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-D9LnhQDL.js";import{U as P,b as H,c as K}from"./auth-LIeEUIDR.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function G(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(_e,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function at(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function nt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let it=class extends Ze{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?ze:Qe,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=se,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const X=10,ut=13,I=32;function F(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
1
+ import{c3 as ue,c4 as de,c5 as he,c6 as fe,c7 as pe,c8 as _,c9 as g,ca as me,cb as _e,cc as we,cd as M,ce as ge,cf as D,cg as Te,ch as q,ci as ye,cj as L,ck as ke,cl as ve,cm as Se,cn as W,co as Ce,cp as be,cq as Re,cr as se,cs as Ie,ct as Ee,cu as qe,b3 as Pe,cv as $e,cw as Me,cx as A,cy as Ae,cz as He,cA as Oe,cB as Ue,cC as xe,cD as Ne,cE as je,cF as Fe,cG as De,cH as Le,cI as Ve,cJ as ze,cK as Qe,aW as U,cL as Je,cM as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-B9dD9jj0.js";import{U as P,b as H,c as K}from"./auth-BNR-bSJO.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ge(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function G(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(_e,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ke,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function at(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function nt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let it=class extends Ze{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?ze:Qe,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=se,s){if(this.isToolTaskRequired(e.name))throw new _(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=U(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const X=10,ut=13,I=32;function F(a){}function dt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
2
2
  `)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const w=f(c);w!==""&&o.push(w)}function f(h){let c=0;if(h.indexOf("\r")===-1){let w=h.indexOf(`
3
3
  `,c);for(;w!==-1;){if(c===w){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=w+1,w=h.indexOf(`
4
4
  `,c);continue}const v=h.charCodeAt(c);if(ee(h,c,v)){const S=h.charCodeAt(c+5)===I?c+6:c+5,C=h.slice(S,w);if(p===0&&h.charCodeAt(w+1)===X){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=w+2,w=h.indexOf(`
@@ -1 +1 @@
1
- import{c as l,m as u,c8 as m,c9 as f,D as y,K as n}from"./index-D9LnhQDL.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
1
+ import{c as l,m as u,c8 as m,c9 as f,D as y,K as n}from"./index-B9dD9jj0.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
@@ -1 +1 @@
1
- import{c as f,D as p,m as q,K as m}from"./index-D9LnhQDL.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
1
+ import{c as f,D as p,m as q,K as m}from"./index-B9dD9jj0.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
@@ -1 +1 @@
1
- import{c,X as m,D as b,m as M,K as f}from"./index-D9LnhQDL.js";import{u as y}from"./use-org-auth-client-DveZle8A.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
1
+ import{c,X as m,D as b,m as M,K as f}from"./index-B9dD9jj0.js";import{u as y}from"./use-org-auth-client-DM3Q5_fm.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-D9LnhQDL.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
1
+ import{r as s}from"./index-B9dD9jj0.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
@@ -1 +1 @@
1
- import{c as m,m as p,K as E,af as S,X as B,d as G,o as H,a as Q,Y as j,cZ as k,c_ as F}from"./index-D9LnhQDL.js";import{r as _,h as C,g as O,c as D,i as I,j as V}from"./repository-binding-5QFpfewx.js";import{i as Y,u as x,d as A,w as X}from"./thread-intent-CUdr-H41.js";function $(t,e){if(!e)return!0;if(t.partial)return!1;const n=Y(t.metadata?.runtime);return n===null||n===e}function U(t,e,n,a,s){let o=null;for(const r of t)r.virtual_mcp_id===e&&r.created_by===n&&(r.hidden||$(r,a)&&(s&&r.branch===s||(!o||r.updated_at>o.updated_at)&&(o=r)));return o}function me(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&$(s,a))}function Z(t,e,n,a,s,o){return s?U(t,e,n,a,o?.baseBranch)??void 0:U(t,e,n,a)??void 0}const z=6e4,v=3e4;function q(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function J(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function N(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:E.githubPrState(e,_(n),a,s,o),queryFn:()=>S(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&C(n)&&!!a&&!!s,refetchInterval:z,refetchIntervalInBackground:!1,staleTime:v}}function W(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:M},e[2]=n,e[3]=a):a=e[3],p(a)}function M(t){return t.changeRequest?q(t.changeRequest):null}function ge(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],p(a)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(J):[]}function be(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:te},e[2]=n,e[3]=a):a=e[3],p(a)}function te(t){return(t.changeRequest?.comments??[]).map(ne)}function ne(t){return{id:t.id,author:t.author,body:t.body,createdAt:t.createdAt,htmlUrl:t.url}}const ae=5*6e4;function pe(t){const e=m.c(20),{orgSlug:n,target:a,owner:s,repo:o,base:r}=t;let i;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(i=E.githubLastPublishedPr(n,_(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==r||e[7]!==n||e[8]!==a?(u=()=>S(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=u):u=e[9];let l;e[10]!==t.enabled||e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==a?(l=(t.enabled??!0)&&!!r&&C(a)&&!!s&&!!o,e[10]=t.enabled,e[11]=r,e[12]=s,e[13]=o,e[14]=a,e[15]=l):l=e[15];let c;return e[16]!==i||e[17]!==u||e[18]!==l?(c={queryKey:i,queryFn:u,enabled:l,staleTime:ae,select:se},e[16]=i,e[17]=u,e[18]=l,e[19]=c):c=e[19],p(c)}function se(t){return t.changeRequest?q(t.changeRequest):null}const re=50;function ye(t){const e=m.c(17),{orgSlug:n,target:a,owner:s,repo:o}=t;let r;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==a?(r=E.githubOpenPrs(n,_(a),s,o),e[0]=n,e[1]=s,e[2]=o,e[3]=a,e[4]=r):r=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>S(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:re}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==o||e[11]!==a?(u=(t.enabled??!0)&&C(a)&&!!s&&!!o,e[8]=t.enabled,e[9]=s,e[10]=o,e[11]=a,e[12]=u):u=e[12];let l;return e[13]!==r||e[14]!==i||e[15]!==u?(l={queryKey:r,queryFn:i,enabled:u,staleTime:v,select:oe},e[13]=r,e[14]=i,e[15]=u,e[16]=l):l=e[16],p(l)}function oe(t){return t.changeRequests.map(q)}function Re(t){const e=m.c(14),{orgSlug:n,target:a,owner:s,repo:o,checkRunId:r}=t;let i;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(i=E.githubCheckRun(n,_(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==r||e[7]!==n||e[8]!==a?(u=()=>S(n,"CHANGE_REQUEST_CHECK_LOG",{...a,checkId:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=u):u=e[9];const l=t.enabled&&!!r;let c;return e[10]!==i||e[11]!==u||e[12]!==l?(c={queryKey:i,queryFn:u,enabled:l,staleTime:v,select:ie},e[10]=i,e[11]=u,e[12]=l,e[13]=c):c=e[13],p(c)}function ie(t){return{title:null,summary:t.report,text:null}}function ue(t,e){const{org:n}=B(),a=O(t);return W({orgId:n.id,orgSlug:n.slug,target:D(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const le=[];function Te(){const t=m.c(14),e=G(),{org:n,locator:a}=B(),s=H(),o=I(),{data:r}=Q.useSession(),i=x(),u=ue(void 0,null),l=j();let c;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==l||t[7]!==r?.user?.id?(c=(f,d,R)=>{if(l&&!d?.panel){e({to:"/$org/projects",params:{org:n.slug},search:P=>({...P,project:f,virtualmcpid:void 0,view:void 0})});return}const h=d?.panel??"overview";if(k(h).kind==="org-destination"){F(e,{tabId:h,org:n.slug,agentId:f,replace:!1});return}const b=(o??[]).find(P=>P.id===f),K=!!(b&&O(b)),L=!d?.runtime,w=L?void 0:Z(i?.threads.get()??le,f,r?.user?.id,R??(b?A(b.metadata):void 0),K,{baseBranch:u}),T=L?void 0:w?.id??crypto.randomUUID();T&&!w&&d?.runtime&&X(sessionStorage,a,T,{runtime:d.runtime}),F(e,{tabId:h,org:n.slug,agentId:f,search:()=>T?{thread:T}:{},replace:!1})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=l,t[7]=r?.user?.id,t[8]=c):c=t[8];const g=c;let y;return t[9]!==o||t[10]!==g||t[11]!==n||t[12]!==s?(y=(f,d)=>{if(k(d?.panel??"overview").kind==="org-destination")return g(f,d,void 0);const R=o.find(h=>h.id===f);if(d?.runtime)return g(f,d,d.runtime);if(R)return g(f,d,A(R.metadata));V(s,n).then(h=>h.find(b=>b.id===f)).catch(ce).then(h=>g(f,d,h?A(h.metadata):void 0))},t[9]=o,t[10]=g,t[11]=n,t[12]=s,t[13]=y):y=t[13],y}function ce(){}export{ue as a,Z as b,ye as c,W as d,pe as e,me as f,ge as g,Re as h,be as i,N as p,Te as u};
1
+ import{c as m,m as p,K as E,af as S,X as B,d as G,o as H,a as Q,Y as j,cZ as k,c_ as F}from"./index-B9dD9jj0.js";import{r as _,h as C,g as O,c as D,i as I,j as V}from"./repository-binding-DzrKIMc8.js";import{i as Y,u as x,d as A,w as X}from"./thread-intent-UQGFcX_y.js";function $(t,e){if(!e)return!0;if(t.partial)return!1;const n=Y(t.metadata?.runtime);return n===null||n===e}function U(t,e,n,a,s){let o=null;for(const r of t)r.virtual_mcp_id===e&&r.created_by===n&&(r.hidden||$(r,a)&&(s&&r.branch===s||(!o||r.updated_at>o.updated_at)&&(o=r)));return o}function me(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&$(s,a))}function Z(t,e,n,a,s,o){return s?U(t,e,n,a,o?.baseBranch)??void 0:U(t,e,n,a)??void 0}const z=6e4,v=3e4;function q(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function J(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function N(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:E.githubPrState(e,_(n),a,s,o),queryFn:()=>S(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&C(n)&&!!a&&!!s,refetchInterval:z,refetchIntervalInBackground:!1,staleTime:v}}function W(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:M},e[2]=n,e[3]=a):a=e[3],p(a)}function M(t){return t.changeRequest?q(t.changeRequest):null}function ge(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],p(a)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(J):[]}function be(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:te},e[2]=n,e[3]=a):a=e[3],p(a)}function te(t){return(t.changeRequest?.comments??[]).map(ne)}function ne(t){return{id:t.id,author:t.author,body:t.body,createdAt:t.createdAt,htmlUrl:t.url}}const ae=5*6e4;function pe(t){const e=m.c(20),{orgSlug:n,target:a,owner:s,repo:o,base:r}=t;let i;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(i=E.githubLastPublishedPr(n,_(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==r||e[7]!==n||e[8]!==a?(u=()=>S(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=u):u=e[9];let l;e[10]!==t.enabled||e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==a?(l=(t.enabled??!0)&&!!r&&C(a)&&!!s&&!!o,e[10]=t.enabled,e[11]=r,e[12]=s,e[13]=o,e[14]=a,e[15]=l):l=e[15];let c;return e[16]!==i||e[17]!==u||e[18]!==l?(c={queryKey:i,queryFn:u,enabled:l,staleTime:ae,select:se},e[16]=i,e[17]=u,e[18]=l,e[19]=c):c=e[19],p(c)}function se(t){return t.changeRequest?q(t.changeRequest):null}const re=50;function ye(t){const e=m.c(17),{orgSlug:n,target:a,owner:s,repo:o}=t;let r;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==a?(r=E.githubOpenPrs(n,_(a),s,o),e[0]=n,e[1]=s,e[2]=o,e[3]=a,e[4]=r):r=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>S(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:re}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==o||e[11]!==a?(u=(t.enabled??!0)&&C(a)&&!!s&&!!o,e[8]=t.enabled,e[9]=s,e[10]=o,e[11]=a,e[12]=u):u=e[12];let l;return e[13]!==r||e[14]!==i||e[15]!==u?(l={queryKey:r,queryFn:i,enabled:u,staleTime:v,select:oe},e[13]=r,e[14]=i,e[15]=u,e[16]=l):l=e[16],p(l)}function oe(t){return t.changeRequests.map(q)}function Re(t){const e=m.c(14),{orgSlug:n,target:a,owner:s,repo:o,checkRunId:r}=t;let i;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(i=E.githubCheckRun(n,_(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==r||e[7]!==n||e[8]!==a?(u=()=>S(n,"CHANGE_REQUEST_CHECK_LOG",{...a,checkId:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=u):u=e[9];const l=t.enabled&&!!r;let c;return e[10]!==i||e[11]!==u||e[12]!==l?(c={queryKey:i,queryFn:u,enabled:l,staleTime:v,select:ie},e[10]=i,e[11]=u,e[12]=l,e[13]=c):c=e[13],p(c)}function ie(t){return{title:null,summary:t.report,text:null}}function ue(t,e){const{org:n}=B(),a=O(t);return W({orgId:n.id,orgSlug:n.slug,target:D(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const le=[];function Te(){const t=m.c(14),e=G(),{org:n,locator:a}=B(),s=H(),o=I(),{data:r}=Q.useSession(),i=x(),u=ue(void 0,null),l=j();let c;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==l||t[7]!==r?.user?.id?(c=(f,d,R)=>{if(l&&!d?.panel){e({to:"/$org/projects",params:{org:n.slug},search:P=>({...P,project:f,virtualmcpid:void 0,view:void 0})});return}const h=d?.panel??"overview";if(k(h).kind==="org-destination"){F(e,{tabId:h,org:n.slug,agentId:f,replace:!1});return}const b=(o??[]).find(P=>P.id===f),K=!!(b&&O(b)),L=!d?.runtime,w=L?void 0:Z(i?.threads.get()??le,f,r?.user?.id,R??(b?A(b.metadata):void 0),K,{baseBranch:u}),T=L?void 0:w?.id??crypto.randomUUID();T&&!w&&d?.runtime&&X(sessionStorage,a,T,{runtime:d.runtime}),F(e,{tabId:h,org:n.slug,agentId:f,search:()=>T?{thread:T}:{},replace:!1})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=l,t[7]=r?.user?.id,t[8]=c):c=t[8];const g=c;let y;return t[9]!==o||t[10]!==g||t[11]!==n||t[12]!==s?(y=(f,d)=>{if(k(d?.panel??"overview").kind==="org-destination")return g(f,d,void 0);const R=o.find(h=>h.id===f);if(d?.runtime)return g(f,d,d.runtime);if(R)return g(f,d,A(R.metadata));V(s,n).then(h=>h.find(b=>b.id===f)).catch(ce).then(h=>g(f,d,h?A(h.metadata):void 0))},t[9]=o,t[10]=g,t[11]=n,t[12]=s,t[13]=y):y=t[13],y}function ce(){}export{ue as a,Z as b,ye as c,W as d,pe as e,me as f,ge as g,Re as h,be as i,N as p,Te as u};
@@ -0,0 +1 @@
1
+ import{a as o}from"./use-organization-settings-DbPbYeMx.js";function e(){return o("new_blocks_editor")}export{e as u};
@@ -1 +1 @@
1
- import{c as l,a2 as f,b as p,e as T,t as m}from"./index-D9LnhQDL.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
1
+ import{c as l,a2 as f,b as p,e as T,t as m}from"./index-B9dD9jj0.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
@@ -1 +1 @@
1
- import{c as x,X as j,a as i}from"./index-D9LnhQDL.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{c as x,X as j,a as i}from"./index-B9dD9jj0.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};