decocms 4.505.2 → 4.507.0

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 (387) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-BGmgNUi8.js → ActiveShapeUtils-qG-AEsLH.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-BIhx1OOA.js → AlertCircle-DZq02EzT.js} +1 -1
  3. package/dist/client/assets/{AreaChart-NTOYQV4b.js → AreaChart-BtdW-Fy2.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-C_xMypbp.js → ArrowLeft-C_qdjo3L.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-D8ia-BLP.js → ArrowUp-B_lKPC5O.js} +1 -1
  6. package/dist/client/assets/{BarChart-z81pvLho.js → BarChart-4XWgQXi5.js} +1 -1
  7. package/dist/client/assets/{Building02-Bu9sfjbg.js → Building02-LYkR_QXB.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-DVVR_K8B.js → CategoricalChart-CHtvdKKv.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-C0zUZT_f.js → CheckCircle-B9QHilAa.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-BXcOXVLY.js → ChevronSelectorVertical-0ysVIDar.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-BNQKU6Cu.js → ChevronUp-D4PiHnN0.js} +1 -1
  12. package/dist/client/assets/{Copy01-7StEdMvr.js → Copy01-DJEr7OLy.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-B-OOpOuj.js → CreditCard01-b36fqa11.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-DlD0BohB.js → DotsVertical-CV1b1y4C.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-DyfMq1Vf.js → ErrorBarContext-UL-jymXX.js} +1 -1
  16. package/dist/client/assets/{Globe04-CkYPSYr8.js → Globe04-DKUCyty7.js} +1 -1
  17. package/dist/client/assets/{Image01-DH2NgDr7.js → Image01-CyRCJwXT.js} +1 -1
  18. package/dist/client/assets/{Key01-DPrJgF_f.js → Key01-DWXRgH6w.js} +1 -1
  19. package/dist/client/assets/{Link01-EwrQnCAj.js → Link01-CNb9DW_9.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-CKnd9LCY.js → LinkBroken01-BU-4AKfc.js} +1 -1
  21. package/dist/client/assets/{Monitor01-BSew-T8c.js → Monitor01-yE6iFgVP.js} +1 -1
  22. package/dist/client/assets/{Play-bKNPMcOD.js → Play-ChRMrCTB.js} +1 -1
  23. package/dist/client/assets/{Plus-C1jGf_Gu.js → Plus-DtZhz_pb.js} +1 -1
  24. package/dist/client/assets/{SearchMd-DjoAJ_aH.js → SearchMd-BQTuqO8x.js} +1 -1
  25. package/dist/client/assets/{Sector-_F0EuVMq.js → Sector-DeEfQN_u.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-BynB5rGF.js → ShoppingBag01-CQIeNQm_.js} +1 -1
  27. package/dist/client/assets/{Sun-B5VGOrX8.js → Sun-kLYmwsq0.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-CoAm6c3b.js → SwitchHorizontal01-DGImzN1R.js} +1 -1
  29. package/dist/client/assets/{Tool01-gHo5_usT.js → Tool01-BRVvW2LV.js} +1 -1
  30. package/dist/client/assets/{Trash01-B2L35h4N.js → Trash01-Bt3rK1ka.js} +1 -1
  31. package/dist/client/assets/{Upload01-BmOSnWKa.js → Upload01-s7SnRMvp.js} +1 -1
  32. package/dist/client/assets/{User01-DeoupK5c.js → User01-BmCbB_zb.js} +1 -1
  33. package/dist/client/assets/{UserSquare-DGLSfuGI.js → UserSquare-DL7MdeuL.js} +1 -1
  34. package/dist/client/assets/{Users01-staROqDK.js → Users01-BVggEmV6.js} +1 -1
  35. package/dist/client/assets/{XAxis-BkGXfrFX.js → XAxis-CDuxbcPP.js} +1 -1
  36. package/dist/client/assets/{XClose-SgZ1xYAr.js → XClose-UWi3HSZE.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-GzEhPwmD.js → ZoomOut-B4Rw_R2z.js} +1 -1
  38. package/dist/client/assets/{access-gate-CZeXfxLf.js → access-gate-D3L-T38D.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-BGa3ZBmA.js → add-connection-dialog-8k8OTwPv.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-DPwSJREO.js → agent-analytics-bu3kFNJu.js} +1 -1
  41. package/dist/client/assets/agent-app-BMA5upH5.js +1 -0
  42. package/dist/client/assets/{agent-assets-DCX0ywK3.js → agent-assets-DJjZB71J.js} +1 -1
  43. package/dist/client/assets/{agent-automation-Ddwg84ee.js → agent-automation-5jRP2Yu0.js} +1 -1
  44. package/dist/client/assets/{agent-automations-CMrVMHoV.js → agent-automations-DBSfm1Um.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-DyZZpidr.js → agent-connect-sources-C1dugrdG.js} +1 -1
  46. package/dist/client/assets/agent-deck-BJf1WFap.js +1 -0
  47. package/dist/client/assets/{agent-e2e-LNoWf1q1.js → agent-e2e-PI2OzWvI.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-DhSnChQH.js → agent-experiments-DRdlymR5.js} +1 -1
  49. package/dist/client/assets/{agent-file-D7lhfRwe.js → agent-file-BzADFUid.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-z-dkVRLB.js → agent-hosting-CPH-NeL_.js} +1 -1
  51. package/dist/client/assets/{agent-icon-Cgp1-Rbx.js → agent-icon-Blcoi2NV.js} +1 -1
  52. package/dist/client/assets/agent-library-BqFtXY1m.js +1 -0
  53. package/dist/client/assets/agent-library-file-CQDlY3Yr.js +1 -0
  54. package/dist/client/assets/{agent-monitor-lcAtszWh.js → agent-monitor-PGLXk9dq.js} +1 -1
  55. package/dist/client/assets/{agent-overview-A0XZkNZX.js → agent-overview-D278LRIL.js} +1 -1
  56. package/dist/client/assets/{agent-releases-CdrTvT-G.js → agent-releases-CwPpC6Zn.js} +1 -1
  57. package/dist/client/assets/agent-settings-DeB5MuX_.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-rsHLltUo.js → agent-site-editor-BSI5T3i7.js} +1 -1
  59. package/dist/client/assets/agent-site-editor-code-Dq4KRDBk.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-Blm2auu-.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-CCk80iIG.js +1 -0
  62. package/dist/client/assets/agent-view-Cl8uWNJN.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-qqtbmzn8.js → agent-view-guard-CVWBSVAR.js} +1 -1
  64. package/dist/client/assets/{agents-list-Bl683eN3.js → agents-list-DYmELJk-.js} +1 -1
  65. package/dist/client/assets/ai-providers-B3x7urKU.js +6 -0
  66. package/dist/client/assets/{alert-CBqUZF_B.js → alert-Dp8EatFO.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-CWY9Kc3Y.js → alert-dialog-qlQC4zlU.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-CaEiZicR.js → analytics-sections-BirEZrZQ.js} +1 -1
  69. package/dist/client/assets/{api-keys-ZpWV4LWE.js → api-keys-7UDmxa_w.js} +1 -1
  70. package/dist/client/assets/api-keys-DSwUfsL4.js +1 -0
  71. package/dist/client/assets/{app-editor-CpBb0p40.js → app-editor-tLSj0Sjg.js} +1 -1
  72. package/dist/client/assets/{asset-utils-xrLuSjSE.js → asset-utils-DYZVbDw1.js} +1 -1
  73. package/dist/client/assets/{auth-DN7Bvt0x.js → auth-CLglKqB6.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-LDgnpYFX.js → auth-catchall-CrJHPLPw.js} +1 -1
  75. package/dist/client/assets/{auth-entry-DBQx8en_.js → auth-entry-CD3L2RvS.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-Fwc5hwZ5.js → auth-split-layout-UjhzYVxM.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-DxbO9IXQ.js → authenticate-and-persist-oauth-ClVBgGv4.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-D5qFdHQB.js → automation-list-row-CAEPQbgy.js} +1 -1
  79. package/dist/client/assets/{automation-runs-DcR0jeNA.js → automation-runs-dUM-MaiP.js} +1 -1
  80. package/dist/client/assets/{automations-Dityp5_M.js → automations-megKF7It.js} +1 -1
  81. package/dist/client/assets/{autosend-CGqWx5OM.js → autosend-CE_yiNtR.js} +1 -1
  82. package/dist/client/assets/{avatar-BEzB55DL.js → avatar-B8cS3VPt.js} +1 -1
  83. package/dist/client/assets/{badge-BH_WGjDS.js → badge-Qzxf6tet.js} +1 -1
  84. package/dist/client/assets/{block-document-5J5cVbgF.js → block-document-AKpwbifj.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-Cbvinja6.js → blocks-preview-workspace-context-VkiPmc8G.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-Cr3Mgd7m.js → blocks-tab-states-BbjL1qhZ.js} +3 -3
  87. package/dist/client/assets/{blog-schema-Izy6f_kE.js → blog-schema-DL-wxhkE.js} +1 -1
  88. package/dist/client/assets/{board-analytics-DmM8aqHX.js → board-analytics-C1pwywOy.js} +1 -1
  89. package/dist/client/assets/{buckets-geowc7lF.js → buckets-DZKIT9DY.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-5cXWIMm8.js → build-improve-prompt-doc-1VLAf1m8.js} +1 -1
  91. package/dist/client/assets/{calendar-D2pB4wtO.js → calendar-BuSRVV5D.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-Dds-uRz2.js → capability-load-error-DBmMi5Hs.js} +1 -1
  93. package/dist/client/assets/{category-editor-BTiGDErD.js → category-editor-DVRF9hj1.js} +1 -1
  94. package/dist/client/assets/{chart-BES0Ixch.js → chart-NrDAd4pe.js} +1 -1
  95. package/dist/client/assets/{chat-context-DnIdZBaI.js → chat-context-Ch-VpD9W.js} +1 -1
  96. package/dist/client/assets/{chat-draft-CRVPT9el.js → chat-draft-B2p2B6Yw.js} +1 -1
  97. package/dist/client/assets/{checkbox-Uc-RZ_Vx.js → checkbox-C0-Eo7G1.js} +1 -1
  98. package/dist/client/assets/{choose-editor-tZFlebbQ.js → choose-editor-BeLyDWVx.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-CRs28Mxh.js → cli-auth-success-DUKgfRgt.js} +1 -1
  100. package/dist/client/assets/{client-icons-mh3r1xQL.js → client-icons-DtQhx8-x.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-Dxh-Mvqb.js +1 -0
  102. package/dist/client/assets/{collapsible-Ds-16t3Z.js → collapsible-EpmgpNpi.js} +1 -1
  103. package/dist/client/assets/{collection-detail-BUD1Fj-1.js → collection-detail-BTHodnm7.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-B4UCXL7F.js → collection-display-button-__Pm6Nmn.js} +1 -1
  105. package/dist/client/assets/{collection-search-DRsC_wPy.js → collection-search-ehqGBK_4.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-B4kBTbV1.js → collection-table-wrapper-BBPmRt9r.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-G4I4mgEg.js → collection-tabs-iTmpvLeT.js} +1 -1
  108. package/dist/client/assets/{column-rules-Bx5p17lP.js → column-rules-adUN8XvK.js} +1 -1
  109. package/dist/client/assets/{combobox-BjJigzYO.js → combobox-BUo7EBrO.js} +1 -1
  110. package/dist/client/assets/{command-DYQfaTJP.js → command-BAgcQ2fh.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-g374jTYK.js → companion-mcps-section-CAn17bJY.js} +1 -1
  112. package/dist/client/assets/{config-TpF0U9xK.js → config-BDu66MgM.js} +1 -1
  113. package/dist/client/assets/{connect-CX0GhSHk.js → connect-2yc9-JJp.js} +1 -1
  114. package/dist/client/assets/{connect-layout-BMKwPFI2.js → connect-layout-DtIoh422.js} +1 -1
  115. package/dist/client/assets/{connection-Chcd5gfb.js → connection-B8e9uIdy.js} +1 -1
  116. package/dist/client/assets/{connection-card-BZ2hvQNx.js → connection-card-CLVSIR42.js} +1 -1
  117. package/dist/client/assets/{connection-detail-F-9yuMeT.js → connection-detail-DN36Ozvh.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-CYVYxK9g.js → connection-form-helpers-CSZF_TQx.js} +1 -1
  119. package/dist/client/assets/{connections-BrK9YMjs.js → connections-DC5XESZs.js} +1 -1
  120. package/dist/client/assets/{content-tab-KxngU340.js → content-tab-DUe9Pk3L.js} +3 -3
  121. package/dist/client/assets/{context-tSOe45h9.js → context-DdNfBAMU.js} +1 -1
  122. package/dist/client/assets/{context-menu-BXe1H0QA.js → context-menu-DJ87apJ2.js} +1 -1
  123. package/dist/client/assets/{core.esm-CPRa5yRj.js → core.esm-C7s0VVJH.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-B9kEJeCB.js → create-organization-dialog-DoF61er3.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-BA8HcQTn.js → daily-pulse-C775e_y-.js} +1 -1
  126. package/dist/client/assets/{discover-ut7HMfOm.js → discover-C_Que9Au.js} +1 -1
  127. package/dist/client/assets/{domain-settings-DReys8Mx.js → domain-settings-CT-S0BOV.js} +1 -1
  128. package/dist/client/assets/{drawer-WlRFS7Ay.js → drawer-CixpU7n-.js} +1 -1
  129. package/dist/client/assets/{editor-DATgPuQr.js → editor-BKRP2Iwc.js} +1 -1
  130. package/dist/client/assets/{editor-classes-Dqv6lj24.js → editor-classes-DZByr-lI.js} +1 -1
  131. package/dist/client/assets/{empty-state-moJi-5lI.js → empty-state-BZZcWHI_.js} +1 -1
  132. package/dist/client/assets/{empty-state-B1yxQlJg.js → empty-state-DQLm0d5k.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data--Fovqgj9.js → extract-connection-data-DJs0gTBx.js} +1 -1
  134. package/dist/client/assets/{feature-gate-DijBSCNJ.js → feature-gate-CgRSy5_Q.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-v1Fb6fZF.js → feature-paywall-EueGiC9A.js} +1 -1
  136. package/dist/client/assets/{file-explorer-CisB6hMY.js → file-explorer-cu0ZoZ2i.js} +1 -1
  137. package/dist/client/assets/{file-preview-BUCUOt-k.js → file-preview-BJ_PkL7X.js} +1 -1
  138. package/dist/client/assets/{file-share-button-BUqpTgXp.js → file-share-button-rEinR-qh.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-IzZjwu7K.js → file-type-icon-C2JXE2hG.js} +1 -1
  140. package/dist/client/assets/flat-project-fhJMf2Fo.js +1 -0
  141. package/dist/client/assets/{folder-icon-Bsi0vn7I.js → folder-icon-Cayf6XFB.js} +1 -1
  142. package/dist/client/assets/{form-DSbydQ9O.js → form-BivWj0r6.js} +1 -1
  143. package/dist/client/assets/{general-DcBh6hf3.js → general-BQtDTtDD.js} +1 -1
  144. package/dist/client/assets/{home-Bq-bjcAt.js → home-DncG44Vc.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-C0L18XKn.js → hosted-publish-feedback-CfrjUALv.js} +1 -1
  146. package/dist/client/assets/{icon-button-C0jFpnCv.js → icon-button-DxqkkLQj.js} +1 -1
  147. package/dist/client/assets/{index-BiA-t4Hy.js → index-5vR8G6oj.js} +1 -1
  148. package/dist/client/assets/{index-B4FWh-TU.js → index-B26ImUL7.js} +1 -1
  149. package/dist/client/assets/{index-BOYIuRkz.js → index-BF64aC--.js} +1 -1
  150. package/dist/client/assets/{index-BQ2qZBgx.js → index-BYmaAL9a.js} +1 -1
  151. package/dist/client/assets/{index-CeKAW7ia.js → index-BmYzltjg.js} +1 -1
  152. package/dist/client/assets/{index-_CyfhGXa.js → index-BtcVoJOD.js} +1 -1
  153. package/dist/client/assets/{index-WULssi-Q.js → index-BvuLMeCw.js} +3 -3
  154. package/dist/client/assets/{index-BbDc7Y9O.js → index-C-gf76Hu.js} +1 -1
  155. package/dist/client/assets/{index-C1tHNU3p.js → index-C47EvNjt.js} +1 -1
  156. package/dist/client/assets/{index-DR8Su143.js → index-CZciUUmu.js} +1 -1
  157. package/dist/client/assets/{index-CpsTTiQE.js → index-CvK4-KP3.js} +1 -1
  158. package/dist/client/assets/{index-Bio6kNpV.js → index-DV6FL3mH.js} +1 -1
  159. package/dist/client/assets/{index-D7sc3WaJ.js → index-NRMbjvM1.js} +1 -1
  160. package/dist/client/assets/{index-wFdxw2k_.js → index-TD9q6ZAx.js} +5 -5
  161. package/dist/client/assets/{index-redirect-w-0W0NUM.js → index-redirect-CCsqcmui.js} +1 -1
  162. package/dist/client/assets/{index-DCKP2AL5.js → index-xlh3U8dq.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-1Nb7ygTX.js → infiniteQueryObserver-X8qh_Va6.js} +1 -1
  164. package/dist/client/assets/{infra-billing-hV6CHYxH.js → infra-billing-fufjpAYz.js} +1 -1
  165. package/dist/client/assets/{input-Ceh9947-.js → input-BSUErVvJ.js} +3 -3
  166. package/dist/client/assets/{input-CzNDxW-p.js → input-h8042dl0.js} +1 -1
  167. package/dist/client/assets/{integration-icon-BPag0HQm.js → integration-icon-DJtlg_0w.js} +1 -1
  168. package/dist/client/assets/{jira-icon-ifmeQn21.js → jira-icon-D0XL00z9.js} +1 -1
  169. package/dist/client/assets/{label-CQYxH0TR.js → label-B-SEr3Fs.js} +1 -1
  170. package/dist/client/assets/{layout-CdChXOi6.js → layout-BI2BIstR.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-BtUjTNH_.js → legacy-agents-deep-jcGaNAHc.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-CGRT9wAN.js → legacy-main-redirect-D6tF7agn.js} +1 -1
  173. package/dist/client/assets/library-DntM1dnS.js +1 -0
  174. package/dist/client/assets/{library-tab-nrpvyINN.js → library-tab-BZkqrpuT.js} +1 -1
  175. package/dist/client/assets/{login-DQqSSnqy.js → login-C9lgbiSh.js} +1 -1
  176. package/dist/client/assets/{markdown-DurQwPzV.js → markdown-B-jDeUMA.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-NiFsT2pJ.js → mcp-app-renderer-Bk4hyaxU.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-XpCTKkfu.js → mcp-oauth-CaxV9wcl.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-Dff3yojn.js → mcp-oauth-V-o-AEQP.js} +1 -1
  180. package/dist/client/assets/{members-DMVi5o98.js → members-BLeFrNm9.js} +1 -1
  181. package/dist/client/assets/{memory-DIF2ywrA.js → memory-BsNDNxr2.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-DHPkzjD_.js → mini-report-page-B0fqOWnH.js} +1 -1
  183. package/dist/client/assets/mock-board-BFTY4RvG.js +1 -0
  184. package/dist/client/assets/{monaco-editor-Dct1EfHT.js → monaco-editor-D49CJi8U.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-DMDJZVd2.js → monitoring-stats-row-BB3CDHWN.js} +1 -1
  186. package/dist/client/assets/{multi-select-Cn966z1g.js → multi-select-BvMK4932.js} +1 -1
  187. package/dist/client/assets/{mustache-BYEVEnz3.js → mustache-HTehKKTG.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-BDSi2lYl.js → new-project-dialog-DoLb5YVK.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-DXdUEFpc.js → oauth-callback-Blwmfj1R.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-ai-provider-DlAWIja6.js → oauth-callback-ai-provider-Dc9onjjw.js} +1 -1
  191. package/dist/client/assets/{onboarding-SJ6Q72M4.js → onboarding-K-cgEcDl.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-lYlmwIzY.js → openai-conversation-R6WmtJ5r.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-Bp7eA4v5.js → optimistic-project-sidebar-views-Bmh9CacI.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-t8Y-HAbt.js → order-monitor-day-CZfhLaiW.js} +1 -1
  195. package/dist/client/assets/{organization-choice-xE4qpP6H.js → organization-choice-dC-onaYV.js} +1 -1
  196. package/dist/client/assets/{orgs-BnzYsVdt.js → orgs-BOJwmOLw.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-Dm5HWm7X.js → page-seo-form-CrsEBL3M.js} +1 -1
  198. package/dist/client/assets/{pair-B_9py9M_.js → pair-CYYi6JKh.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-hsk9sMi3.js → plan-ladder-Okx-KzN5.js} +1 -1
  200. package/dist/client/assets/{popover-B8WQyYwE.js → popover-gJO3R5Ii.js} +1 -1
  201. package/dist/client/assets/{post-calendar-HzlqyoFX.js → post-calendar-BgDWtRgx.js} +1 -1
  202. package/dist/client/assets/{post-editor-_yiJ-Kct.js → post-editor-CxINLeRV.js} +1 -1
  203. package/dist/client/assets/{preview-content-B8YyjekZ.js → preview-content-Cfi8bwXI.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-bksJINeP.js → preview-dialog-jZ9sRQON.js} +1 -1
  205. package/dist/client/assets/{preview-panel-B8wW3oOG.js → preview-panel-CN8PRsYc.js} +1 -1
  206. package/dist/client/assets/{preview-tab-D_zCwBYM.js → preview-tab-DRuTgCNI.js} +3 -3
  207. package/dist/client/assets/{product-picker-dialog-DbDjfkAQ.js → product-picker-dialog-DB4JPBCA.js} +1 -1
  208. package/dist/client/assets/{profile-DdCmH2hW.js → profile-DEiIcjHZ.js} +1 -1
  209. package/dist/client/assets/{project-app-view-ChMgcNAY.js → project-app-view-Ml2wH3iy.js} +1 -1
  210. package/dist/client/assets/{project-feed-CB9OPO_N.js → project-feed-CfssvHDQ.js} +1 -1
  211. package/dist/client/assets/{project-icon-BwmwhXEd.js → project-icon-BlJz5cOI.js} +1 -1
  212. package/dist/client/assets/project-reports-CsI0AQuY.js +1 -0
  213. package/dist/client/assets/project-tasks-DLi14b92.js +1 -0
  214. package/dist/client/assets/{projects-BmqEzMnN.js → projects-Dzy3_FXd.js} +1 -1
  215. package/dist/client/assets/{projects-empty-state-BscYKwea.js → projects-empty-state-BDYeDrMv.js} +1 -1
  216. package/dist/client/assets/{prompts-DopKJbNh.js → prompts-DV4Kjfa5.js} +1 -1
  217. package/dist/client/assets/record-editor-wOnCkFPK.js +1 -0
  218. package/dist/client/assets/{redirect-editor-Bh_26SDR.js → redirect-editor-DFCv83sL.js} +1 -1
  219. package/dist/client/assets/reports-AMpsYdUr.js +1 -0
  220. package/dist/client/assets/{reports-DNvLVhhR.js → reports-DXYrq_BO.js} +1 -1
  221. package/dist/client/assets/{reports-onboarding-aJM_IDTw.js → reports-onboarding-1VulbTO6.js} +1 -1
  222. package/dist/client/assets/{reports-tab-BMc9C4Qh.js → reports-tab-DmNt_T04.js} +2 -2
  223. package/dist/client/assets/{repositories-BD5gqmJg.js → repositories-D6jC23CW.js} +1 -1
  224. package/dist/client/assets/{repository-binding-09n9zNFN.js → repository-binding-BnejFX7t.js} +1 -1
  225. package/dist/client/assets/{repository-import-picker-DL9csYfh.js → repository-import-picker-h-r8nnEf.js} +1 -1
  226. package/dist/client/assets/{repository-picker-DABBo0DW.js → repository-picker-FTAXO4Nx.js} +1 -1
  227. package/dist/client/assets/{require-capability-BEWYbP4S.js → require-capability-BewAou1A.js} +1 -1
  228. package/dist/client/assets/{required-auth-layout-BF8PRozy.js → required-auth-layout-gIZfj42y.js} +1 -1
  229. package/dist/client/assets/{reset-password-ScHjA5IF.js → reset-password-Bq09blPf.js} +1 -1
  230. package/dist/client/assets/{resizable-DkYJhCH3.js → resizable-CGzf0YCQ.js} +1 -1
  231. package/dist/client/assets/{resolve-tab-icon-BFjWL9qV.js → resolve-tab-icon-Daxo01Gi.js} +1 -1
  232. package/dist/client/assets/{review-settings-BGU-nfDw.js → review-settings-DR_kj-Ru.js} +1 -1
  233. package/dist/client/assets/roles-DWOkvlO_.js +1 -0
  234. package/dist/client/assets/{route-C0_qtTp0.js → route-B-p6J_u6.js} +1 -1
  235. package/dist/client/assets/route-G0-ZvPpf.js +1 -0
  236. package/dist/client/assets/route-UiPRedfp.js +1 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-Ue82FfDC.js → sandbox-lifecycle-context-rc29IhVV.js} +1 -1
  238. package/dist/client/assets/{schema-Fm9WpUHJ.js → schema-BGirdKR7.js} +1 -1
  239. package/dist/client/assets/schema-DTvMW5Bj.js +1 -0
  240. package/dist/client/assets/{scroll-area-CB_2Aaiz.js → scroll-area-D0jo1bkt.js} +1 -1
  241. package/dist/client/assets/{search-input-BLMScalM.js → search-input-DIOUBltI.js} +1 -1
  242. package/dist/client/assets/{search-toggle-CRC9Uyem.js → search-toggle-BWyMsPKk.js} +1 -1
  243. package/dist/client/assets/{secret-ciphertext-DKMPhCC7.js → secret-ciphertext-ANOQlePB.js} +1 -1
  244. package/dist/client/assets/{secret-picker-Ct5TqLUt.js → secret-picker--4BFyqbe.js} +1 -1
  245. package/dist/client/assets/{secrets-W81BJ6O0.js → secrets-BxBi0DW0.js} +1 -1
  246. package/dist/client/assets/{sections-editor-CoFpY6Pb.js → sections-editor-cLAvYqLX.js} +1 -1
  247. package/dist/client/assets/{select-model-Dao29CnX.js → select-model-Dqb1K6bc.js} +1 -1
  248. package/dist/client/assets/{select-XSwSofuZ.js → select-vip2MDSn.js} +1 -1
  249. package/dist/client/assets/{seo-editor-CXJw5HQb.js → seo-editor-DDZSfwYW.js} +1 -1
  250. package/dist/client/assets/{separator-DKnUckca.js → separator-BQ3AM4Ug.js} +1 -1
  251. package/dist/client/assets/{settings-tab-B0y-8xZD.js → settings-tab-eia9Fz-X.js} +1 -1
  252. package/dist/client/assets/{sheet-BvEf_UVQ.js → sheet-IYrYpc2B.js} +1 -1
  253. package/dist/client/assets/{shell-layout-CBiOwFtT.js → shell-layout-BM51_FIv.js} +1 -1
  254. package/dist/client/assets/site-editor-C5iX5zAy.js +1 -0
  255. package/dist/client/assets/{site-editor-toast-DZvdp8hl.js → site-editor-toast-DbJhMk7V.js} +1 -1
  256. package/dist/client/assets/{skills-B9A_KuNf.js → skills-D2FiXzGW.js} +1 -1
  257. package/dist/client/assets/{slider-CIERvkTu.js → slider-CwnL3HRa.js} +1 -1
  258. package/dist/client/assets/{sortable.esm-DVeag0L1.js → sortable.esm-BmwNKHYn.js} +1 -1
  259. package/dist/client/assets/{sso-SHUpqa2t.js → sso-DMQ-B__P.js} +1 -1
  260. package/dist/client/assets/{suggestion-8feXh3Uo.js → suggestion-B_X9vnmO.js} +1 -1
  261. package/dist/client/assets/{switch-CIYZwU4n.js → switch-B9eCMptF.js} +1 -1
  262. package/dist/client/assets/{symbol-BBXD1fl1.js → symbol-BnsdD8oy.js} +1 -1
  263. package/dist/client/assets/{synced-repos-DUkzQSzh.js → synced-repos-VO9uiFX2.js} +1 -1
  264. package/dist/client/assets/{tab-icon-glyph-Di0eKueD.js → tab-icon-glyph-D53P8msf.js} +1 -1
  265. package/dist/client/assets/{table-D32JWTgg.js → table-D9fzXIkZ.js} +1 -1
  266. package/dist/client/assets/{tabs-DWLSC789.js → tabs-BawejvDB.js} +1 -1
  267. package/dist/client/assets/task-board-ouLvp423.js +1 -0
  268. package/dist/client/assets/{task-route-DcEcJOK4.js → task-route-CjHIKjev.js} +1 -1
  269. package/dist/client/assets/{task-status-DCsFB7tb.js → task-status-Buh7B1MG.js} +1 -1
  270. package/dist/client/assets/taskboard-analytics-DhwjY7M5.js +1 -0
  271. package/dist/client/assets/tasks-Ds4uIhX_.js +1 -0
  272. package/dist/client/assets/{tasks-CxWkzUmt.js → tasks-FmvKs9d3.js} +1 -1
  273. package/dist/client/assets/{textarea-BRAhDvOh.js → textarea-B-TS083j.js} +1 -1
  274. package/dist/client/assets/{thread-analytics-C2SSbO3U.js → thread-analytics-ykgOvgFb.js} +1 -1
  275. package/dist/client/assets/{thread-intent-DLRGXMNS.js → thread-intent-S-gJClOG.js} +1 -1
  276. package/dist/client/assets/{thread-route-zVWhMReX.js → thread-route-CQmCTEyn.js} +1 -1
  277. package/dist/client/assets/{thread-route-uTiqhl-l.js → thread-route-DtCL8-V4.js} +1 -1
  278. package/dist/client/assets/{thread-sheet-body-BxMopJ4Q.js → thread-sheet-body-DacE2e8a.js} +1 -1
  279. package/dist/client/assets/{time-range-picker-DrHQe3U8.js → time-range-picker-BIBoZiWJ.js} +1 -1
  280. package/dist/client/assets/{toggle-group-D9ChEXcL.js → toggle-group-DI4ttUmk.js} +1 -1
  281. package/dist/client/assets/{tool-namespace-B6bl3mST.js → tool-namespace-DSuLhjHC.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-CrX4dIfH.js → toolbar-icon-button-UylaJSAo.js} +1 -1
  283. package/dist/client/assets/{tooltip-BP_lFNWX.js → tooltip-D3Lno7Sd.js} +1 -1
  284. package/dist/client/assets/{tooltipContext-BwHz9WYB.js → tooltipContext-BF4YYYQ4.js} +1 -1
  285. package/dist/client/assets/{track-XuWYLpsB.js → track-9gnPqqM1.js} +1 -1
  286. package/dist/client/assets/{types-DzDNRCBv.js → types-oDc7dHni.js} +1 -1
  287. package/dist/client/assets/{url-slug-DZjL4P4N.js → url-slug-CzRjxv-k.js} +1 -1
  288. package/dist/client/assets/{usage-stats-BrfBlLKo.js → usage-stats-DadTD3M-.js} +1 -1
  289. package/dist/client/assets/{use-ai-providers-bNjYR9g2.js → use-ai-providers-AcvGe9-V.js} +1 -1
  290. package/dist/client/assets/{use-app-takeover-n62Fmu8v.js → use-app-takeover-BEzFC8oO.js} +1 -1
  291. package/dist/client/assets/{use-automations-CS_cSvCE.js → use-automations-CN350YMB.js} +1 -1
  292. package/dist/client/assets/{use-autosave-cTT6Hu-H.js → use-autosave-Dav7fRBX.js} +1 -1
  293. package/dist/client/assets/{use-chat-navigation-CO4_t1mA.js → use-chat-navigation-DlxbS2Ir.js} +1 -1
  294. package/dist/client/assets/{use-clock-tick-DpInA1iA.js → use-clock-tick-Biiz8lzy.js} +1 -1
  295. package/dist/client/assets/{use-connect-companion-XyjuBcsZ.js → use-connect-companion-VKAyFcK2.js} +1 -1
  296. package/dist/client/assets/{use-connection-CHo2bcMw.js → use-connection-OOD0tHd7.js} +1 -1
  297. package/dist/client/assets/{use-content-sync-BfdqJCQu.js → use-content-sync-BQvWp4_o.js} +1 -1
  298. package/dist/client/assets/{use-copy-DUoQxyl0.js → use-copy-Cn4Z57YH.js} +1 -1
  299. package/dist/client/assets/{use-create-virtual-mcp-DEnk__H8.js → use-create-virtual-mcp-CZW2rCq7.js} +1 -1
  300. package/dist/client/assets/{use-date-fns-locale-HDKinbV-.js → use-date-fns-locale-ZV1qLyjT.js} +1 -1
  301. package/dist/client/assets/{use-debounced-autosave-DYYkzWY_.js → use-debounced-autosave-DoWWmWzG.js} +1 -1
  302. package/dist/client/assets/{use-debounced-value-G0eXCuJA.js → use-debounced-value-WEbEbeed.js} +1 -1
  303. package/dist/client/assets/{use-deco-credits-DM3bKm1X.js → use-deco-credits-D1idFaA8.js} +1 -1
  304. package/dist/client/assets/{use-decopilot-events-1AtUjySK.js → use-decopilot-events-BITSrHb-.js} +1 -1
  305. package/dist/client/assets/{use-delete-connection-Cg3msRwS.js → use-delete-connection-KMdMK-5V.js} +1 -1
  306. package/dist/client/assets/{use-deployment-admin-BH9iAY5E.js → use-deployment-admin-B_soKFRv.js} +1 -1
  307. package/dist/client/assets/{use-ensure-project-folder-Ba1RyXTm.js → use-ensure-project-folder-BUN6VVAV.js} +1 -1
  308. package/dist/client/assets/{use-fast-preview-draft-url-DuVBfmnv.js → use-fast-preview-draft-url-CSXqCUZ_.js} +1 -1
  309. package/dist/client/assets/{use-file-configs-DpVdr_mk.js → use-file-configs-DMVCBG-z.js} +1 -1
  310. package/dist/client/assets/{use-infinite-scroll-fbccvd5L.js → use-infinite-scroll-DjYaDj_j.js} +1 -1
  311. package/dist/client/assets/{use-join-requests-BU-AH2wa.js → use-join-requests-Be-FCByX.js} +1 -1
  312. package/dist/client/assets/{use-main-panel-tabs-BbpwWXur.js → use-main-panel-tabs-Cloon3zW.js} +1 -1
  313. package/dist/client/assets/{use-mcp-auth-status-DRC6-H1Z.js → use-mcp-auth-status-Bv4IbKQl.js} +1 -1
  314. package/dist/client/assets/{use-mcp-client-CgigId7h.js → use-mcp-client-fTyLcuiX.js} +1 -1
  315. package/dist/client/assets/{use-mcp-prompts-C5fo7JyP.js → use-mcp-prompts-CyqOUVUD.js} +1 -1
  316. package/dist/client/assets/{use-mcp-tools-CMQDcWNX.js → use-mcp-tools-sv7pv5ex.js} +1 -1
  317. package/dist/client/assets/{use-members-DKO2z7jU.js → use-members-CvY21L2Q.js} +1 -1
  318. package/dist/client/assets/{use-mobile-BLPp5y7v.js → use-mobile-2T0aye5I.js} +1 -1
  319. package/dist/client/assets/{use-navigate-to-agent-CVa4wG4H.js → use-navigate-to-agent-BpeT4fqu.js} +1 -1
  320. package/dist/client/assets/{use-open-billing-url-BNJHjUYg.js → use-open-billing-url-Db0e3guK.js} +1 -1
  321. package/dist/client/assets/{use-org-auth-client-BryWu6mx.js → use-org-auth-client-CWA2hWCM.js} +1 -1
  322. package/dist/client/assets/{use-org-fs-Busfyhv0.js → use-org-fs-CPNJqv-N.js} +1 -1
  323. package/dist/client/assets/{use-org-repo-syncs-Bz1fQYYa.js → use-org-repo-syncs-MWiNxGjz.js} +1 -1
  324. package/dist/client/assets/{use-org-sso-bcSBbFXH.js → use-org-sso-BMLNRQyf.js} +1 -1
  325. package/dist/client/assets/{use-organization-roles-DffTFg63.js → use-organization-roles-DwFJmstu.js} +1 -1
  326. package/dist/client/assets/{use-organization-settings-Cc-OpUav.js → use-organization-settings-lug340cj.js} +1 -1
  327. package/dist/client/assets/{use-panel-navigate-Cse0kIZg.js → use-panel-navigate-CfJ9Qf-l.js} +1 -1
  328. package/dist/client/assets/{use-project-native-view-presence-DgHBfVGR.js → use-project-native-view-presence-DdsfKci4.js} +1 -1
  329. package/dist/client/assets/{use-project-scope-B3ANi1IJ.js → use-project-scope-C99MQSqi.js} +1 -1
  330. package/dist/client/assets/{use-recent-apps-ClF4CK3T.js → use-recent-apps-BumxbfgY.js} +1 -1
  331. package/dist/client/assets/{use-releases-D0BOJZ8M.js → use-releases-CRk_-gGM.js} +1 -1
  332. package/dist/client/assets/{use-reports-diagnostic-CoBZgwNK.js → use-reports-diagnostic-WXyHMxuT.js} +1 -1
  333. package/dist/client/assets/{use-secrets-J4K2lbya.js → use-secrets-nvhTtgV_.js} +1 -1
  334. package/dist/client/assets/{use-section-preview-base-C2OLAuvH.js → use-section-preview-base-BBIzI-Pc.js} +1 -1
  335. package/dist/client/assets/{use-tags-pVd2xiCJ.js → use-tags-Dawb8nJP.js} +1 -1
  336. package/dist/client/assets/{use-task-board-analytics-gYEm-02X.js → use-task-board-analytics-BaDTyaMf.js} +1 -1
  337. package/dist/client/assets/{use-task-board-events-Df7dgtVf.js → use-task-board-events-viqZq2i-.js} +1 -1
  338. package/dist/client/assets/{use-task-board-item-prs-DkQx7M2j.js → use-task-board-item-prs-BTOeRNoi.js} +1 -1
  339. package/dist/client/assets/{use-task-board-items-C6IVrd-u.js → use-task-board-items-Dp3mGHSl.js} +1 -1
  340. package/dist/client/assets/{use-task-metadata-B_eO6NAU.js → use-task-metadata-Buvn0eAk.js} +1 -1
  341. package/dist/client/assets/{use-thread-analytics-DtMoL4PA.js → use-thread-analytics-DOC2eb9z.js} +1 -1
  342. package/dist/client/assets/{use-thread-outputs-BI5SHJYx.js → use-thread-outputs-Bmumw8UE.js} +1 -1
  343. package/dist/client/assets/useInfiniteQuery-CQY9cAw7.js +1 -0
  344. package/dist/client/assets/{useQueries-CNpRnVIa.js → useQueries-4Zja_Hbg.js} +1 -1
  345. package/dist/client/assets/useSuspenseInfiniteQuery-XqqzZbmr.js +1 -0
  346. package/dist/client/assets/{users-ivFpS9Lq.js → users-Cbsspkn2.js} +1 -1
  347. package/dist/client/assets/{utils-bWD-X54y.js → utils-zbsUBoHt.js} +1 -1
  348. package/dist/client/assets/{variant-calendar-DksJ_7_J.js → variant-calendar-BnIxTRkB.js} +1 -1
  349. package/dist/client/assets/{variant-draft-pointer-Bmae6Tqf.js → variant-draft-pointer-DEL-ZLWj.js} +1 -1
  350. package/dist/client/assets/{view-mode-toggle-C21oeZ12.js → view-mode-toggle-CGu3ANob.js} +1 -1
  351. package/dist/client/assets/{virtual-mcp-DQ5n4L-p.js → virtual-mcp-DQFtuDZf.js} +1 -1
  352. package/dist/client/assets/{watch-sse-pool-DENohcwv.js → watch-sse-pool-C7fmCtIy.js} +1 -1
  353. package/dist/client/index.html +1 -1
  354. package/dist/server/cli.js +1 -1
  355. package/dist/server/migrate-dbos.js +1 -1
  356. package/dist/server/migrate.js +218 -214
  357. package/dist/server/server.js +754 -754
  358. package/package.json +1 -1
  359. package/dist/client/assets/agent-app-CLxKR8tP.js +0 -1
  360. package/dist/client/assets/agent-deck-CrnhUXqK.js +0 -1
  361. package/dist/client/assets/agent-library-DaueecGi.js +0 -1
  362. package/dist/client/assets/agent-library-file-9M8Zj4zk.js +0 -1
  363. package/dist/client/assets/agent-settings-BmHxaKU2.js +0 -1
  364. package/dist/client/assets/agent-site-editor-code-y6AvE-5T.js +0 -2
  365. package/dist/client/assets/agent-site-editor-content-B1_2Oozw.js +0 -1
  366. package/dist/client/assets/agent-site-editor-preview-BwrdNA-b.js +0 -1
  367. package/dist/client/assets/agent-view-BuDZYnBO.js +0 -1
  368. package/dist/client/assets/ai-providers-Cn_Nj1qE.js +0 -6
  369. package/dist/client/assets/api-keys-_y0SevGg.js +0 -1
  370. package/dist/client/assets/cms-settings-editor-DXaCAKpH.js +0 -1
  371. package/dist/client/assets/flat-project-BVJS2Ar0.js +0 -1
  372. package/dist/client/assets/library-UKyRew3D.js +0 -1
  373. package/dist/client/assets/mock-board-BOb4XDb6.js +0 -1
  374. package/dist/client/assets/project-reports-C6XPjSeE.js +0 -1
  375. package/dist/client/assets/project-tasks-DEZ-La_L.js +0 -1
  376. package/dist/client/assets/record-editor-Cyo5F4-b.js +0 -1
  377. package/dist/client/assets/reports-DBoKBg_K.js +0 -1
  378. package/dist/client/assets/roles-D7RemnKj.js +0 -1
  379. package/dist/client/assets/route-DuM3NpZo.js +0 -1
  380. package/dist/client/assets/route-OZFS68ac.js +0 -1
  381. package/dist/client/assets/schema-v1GsTRkZ.js +0 -1
  382. package/dist/client/assets/site-editor-CjiR59U-.js +0 -1
  383. package/dist/client/assets/task-board-CjLfzLYs.js +0 -1
  384. package/dist/client/assets/taskboard-analytics-ZWeq2HS-.js +0 -1
  385. package/dist/client/assets/tasks-By3Yi7H-.js +0 -1
  386. package/dist/client/assets/useInfiniteQuery-D7970gdx.js +0 -1
  387. package/dist/client/assets/useSuspenseInfiniteQuery-BFNRElUS.js +0 -1
@@ -1 +1 @@
1
- import{t as y,c as S,d as j,b as D,e as M}from"./differenceInSeconds-C3x8sHUj.js";import{F as x}from"./index-wFdxw2k_.js";let F={};function T(){return F}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=T(),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=j(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"]},je={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"]},xe={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"}},Fe={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"}},Te=(e,a)=>{const t=Number(e);return a?.unit==="week"?t+"ª":t+"º"},$e={ordinalNumber:Te,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:je,defaultWidth:"wide"}),dayPeriod:m({values:xe,defaultWidth:"wide",formattingValues:Fe,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]=x();return e.language==="pt-BR"?Re:void 0}export{W as a,fe as e,Je as f,T as g,P as n,Be as u};
1
+ import{t as y,c as S,d as j,b as D,e as M}from"./differenceInSeconds-C3x8sHUj.js";import{F as x}from"./index-TD9q6ZAx.js";let F={};function T(){return F}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=T(),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=j(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"]},je={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"]},xe={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"}},Fe={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"}},Te=(e,a)=>{const t=Number(e);return a?.unit==="week"?t+"ª":t+"º"},$e={ordinalNumber:Te,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:je,defaultWidth:"wide"}),dayPeriod:m({values:xe,defaultWidth:"wide",formattingValues:Fe,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]=x();return e.language==="pt-BR"?Re:void 0}export{W as a,fe as e,Je as f,T as g,P as n,Be as u};
@@ -1 +1 @@
1
- import{r as t}from"./index-wFdxw2k_.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-TD9q6ZAx.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-wFdxw2k_.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-TD9q6ZAx.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{a2 as C,a9 as I,m as g,K,r as S,y as b}from"./index-wFdxw2k_.js";import{u as m}from"./use-ai-providers-bNjYR9g2.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{a2 as C,a9 as I,m as g,K,r as S,y as b}from"./index-TD9q6ZAx.js";import{u as m}from"./use-ai-providers-AcvGe9-V.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,dU as I,K as T,m as P,dV as x,ao as M,r as l}from"./index-wFdxw2k_.js";import{m as D}from"./thread-intent-DLRGXMNS.js";import{D as E}from"./watch-sse-pool-DENohcwv.js";const O=1e6;function C(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,o=Math.min(1,u/s.limitMicros);return{...r,usage:{...s,usedMicros:u,percent:o,state:o>=1?"exhausted":o>=.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 o;e[2]!==n?(o=()=>M(n,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==u||e[6]!==o?(a={queryKey:s,enabled:u,staleTime:6e4,retry:1,queryFn:o},e[4]=s,e[5]=u,e[6]=o,e[7]=a):a=e[7],P(a)}function U(e){const{data:t}=d();return!e||!t?!0:t.features[e]===!0}function w(){const e=g(),{isPending:t,fetchStatus:n}=d();return!e||n==="idle"||n==="paused"?!0:!t}function K(){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 L(){const{data:e}=d();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}const b=()=>0;function j(e){const{orgSlug:t,taskId:n,enabled:r=!0,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a}=e,f=l.useRef({taskId:n,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a});f.current={taskId:n,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a};const S=l.useRef(null),m=l.useRef(r),p=l.useRef(t);(!S.current||m.current!==r||p.current!==t)&&(m.current=r,p.current=t,S.current=R=>{if(!r||!t)return()=>{};const k=y=>{let c;try{c=JSON.parse(y.data)}catch{return}const i=f.current;if(!(i.taskId&&c.subject!==i.taskId)){switch(c.type){case E.STEP:i.onStep?.(c);break;case E.FINISH:i.onFinish?.(c);break;case E.THREAD_STATUS:i.onTaskStatus?.(c);break}R()}};return D.subscribe(t,k,()=>f.current.onReconnect?.())}),l.useSyncExternalStore(S.current,b,b)}export{d as a,j as b,K as c,C as d,U as e,w as f,L as g,g as u};
1
+ import{c as h,dU as I,K as T,m as P,dV as x,ao as M,r as l}from"./index-TD9q6ZAx.js";import{m as D}from"./thread-intent-S-gJClOG.js";import{D as E}from"./watch-sse-pool-C7fmCtIy.js";const O=1e6;function C(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,o=Math.min(1,u/s.limitMicros);return{...r,usage:{...s,usedMicros:u,percent:o,state:o>=1?"exhausted":o>=.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 o;e[2]!==n?(o=()=>M(n,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==u||e[6]!==o?(a={queryKey:s,enabled:u,staleTime:6e4,retry:1,queryFn:o},e[4]=s,e[5]=u,e[6]=o,e[7]=a):a=e[7],P(a)}function U(e){const{data:t}=d();return!e||!t?!0:t.features[e]===!0}function w(){const e=g(),{isPending:t,fetchStatus:n}=d();return!e||n==="idle"||n==="paused"?!0:!t}function K(){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 L(){const{data:e}=d();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}const b=()=>0;function j(e){const{orgSlug:t,taskId:n,enabled:r=!0,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a}=e,f=l.useRef({taskId:n,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a});f.current={taskId:n,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a};const S=l.useRef(null),m=l.useRef(r),p=l.useRef(t);(!S.current||m.current!==r||p.current!==t)&&(m.current=r,p.current=t,S.current=R=>{if(!r||!t)return()=>{};const k=y=>{let c;try{c=JSON.parse(y.data)}catch{return}const i=f.current;if(!(i.taskId&&c.subject!==i.taskId)){switch(c.type){case E.STEP:i.onStep?.(c);break;case E.FINISH:i.onFinish?.(c);break;case E.THREAD_STATUS:i.onTaskStatus?.(c);break}R()}};return D.subscribe(t,k,()=>f.current.onReconnect?.())}),l.useSyncExternalStore(S.current,b,b)}export{d as a,j as b,K as c,C as d,U as e,w as f,L as g,g as u};
@@ -1 +1 @@
1
- import{c as oe,b as le,j as n,a2 as se,o as ie,a9 as ce,r as re,t as Y,fN as ae,fO as de}from"./index-wFdxw2k_.js";import{A as z,a as G,b as V,c as X,g as Z,d as ee,e as te,f as ne}from"./alert-dialog-CWY9Kc3Y.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(z,{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(G,{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(V,{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(X,{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(z,{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(G,{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(V,{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(X,{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),Y.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{}Y.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);Y.error(`Failed to delete connection: ${i}`)}}}}export{ge as D,ue as u};
1
+ import{c as oe,b as le,j as n,a2 as se,o as ie,a9 as ce,r as re,t as Y,fN as ae,fO as de}from"./index-TD9q6ZAx.js";import{A as z,a as G,b as V,c as X,g as Z,d as ee,e as te,f as ne}from"./alert-dialog-qlQC4zlU.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(z,{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(G,{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(V,{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(X,{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(z,{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(G,{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(V,{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(X,{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),Y.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{}Y.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);Y.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-wFdxw2k_.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-TD9q6ZAx.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 o,a2 as n,o as m,K as E,m as I,ao as T,dX as f}from"./index-wFdxw2k_.js";import{k as F,m as N,H as y}from"./location-BjlyegC2.js";import{o as P}from"./use-org-fs-Busfyhv0.js";function g(i){const e=o.c(14),{org:s}=n(),r=m();let l;e[0]!==s.id||e[1]!==i?(l=E.projectFolderEnsure(s.id,i?.id??"",i?F(i):""),e[0]=s.id,e[1]=i,e[2]=l):l=e[2];let t;e[3]!==s.id||e[4]!==s.slug||e[5]!==i?.id||e[6]!==r?(t=async()=>{const u=await T(s.slug,"PROJECT_FOLDER_ENSURE",{id:i?.id??""});return u.created&&(P(r,s.id,y),f(r,s.id,"VIRTUAL_MCP")),u},e[3]=s.id,e[4]=s.slug,e[5]=i?.id,e[6]=r,e[7]=t):t=e[7];let a;e[8]!==i?(a=!!i&&!N(i),e[8]=i,e[9]=a):a=e[9];let d;e[10]!==l||e[11]!==t||e[12]!==a?(d={queryKey:l,queryFn:t,enabled:a,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY,retry:!1},e[10]=l,e[11]=t,e[12]=a,e[13]=d):d=e[13],I(d)}export{g as u};
1
+ import{c as o,a2 as n,o as m,K as E,m as I,ao as T,dX as f}from"./index-TD9q6ZAx.js";import{k as F,m as N,H as y}from"./location-BjlyegC2.js";import{o as P}from"./use-org-fs-CPNJqv-N.js";function g(i){const e=o.c(14),{org:s}=n(),r=m();let l;e[0]!==s.id||e[1]!==i?(l=E.projectFolderEnsure(s.id,i?.id??"",i?F(i):""),e[0]=s.id,e[1]=i,e[2]=l):l=e[2];let t;e[3]!==s.id||e[4]!==s.slug||e[5]!==i?.id||e[6]!==r?(t=async()=>{const u=await T(s.slug,"PROJECT_FOLDER_ENSURE",{id:i?.id??""});return u.created&&(P(r,s.id,y),f(r,s.id,"VIRTUAL_MCP")),u},e[3]=s.id,e[4]=s.slug,e[5]=i?.id,e[6]=r,e[7]=t):t=e[7];let a;e[8]!==i?(a=!!i&&!N(i),e[8]=i,e[9]=a):a=e[9];let d;e[10]!==l||e[11]!==t||e[12]!==a?(d={queryKey:l,queryFn:t,enabled:a,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY,retry:!1},e[10]=l,e[11]=t,e[12]=a,e[13]=d):d=e[13],I(d)}export{g as u};
@@ -1 +1 @@
1
- import{c as s}from"./index-wFdxw2k_.js";import{w as v,c as d}from"./section-preview-url-7zfngvgW.js";import{u as h,ak as w,al as P}from"./site-editor-toast-DZvdp8hl.js";import{a as b}from"./input-Ceh9947-.js";function g(e){const t=s.c(3),i=b(e?.virtualMcpId).runtime==="cms",r=h(e?.virtualMcpId,e?.branch),n=r.kind==="protocol"&&r.source==="github",o=w(e),u=P(n?e:null);if(!e||!i)return null;if(n)return u;let l;return t[0]!==o||t[1]!==e?(l=o?d({...e,...o}):null,t[0]=o,t[1]=e,t[2]=l):l=t[2],l}function I(e){const t=s.c(11);let i;t[0]!==e?(i=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=i):i=t[1];const r=g(i),n=e?.previewServerUrl??null;let o=null;if(n)try{let f;t[2]!==n?(f=new URL(n),t[2]=n,t[3]=f):f=t[3],o=f.host}catch{o=null}let u;t[4]!==r||t[5]!==e||t[6]!==n?(u=e&&n&&r?v(new URL(e.path,n).toString(),r):null,t[4]=r,t[5]=e,t[6]=n,t[7]=u):u=t[7];const l=u;let c;return t[8]!==o||t[9]!==l?(c={url:l,host:o},t[8]=o,t[9]=l,t[10]=c):c=t[10],c}export{g as a,I as u};
1
+ import{c as s}from"./index-TD9q6ZAx.js";import{w as v,c as d}from"./section-preview-url-7zfngvgW.js";import{u as h,ak as w,al as P}from"./site-editor-toast-DbJhMk7V.js";import{a as b}from"./input-BSUErVvJ.js";function g(e){const t=s.c(3),i=b(e?.virtualMcpId).runtime==="cms",r=h(e?.virtualMcpId,e?.branch),n=r.kind==="protocol"&&r.source==="github",o=w(e),u=P(n?e:null);if(!e||!i)return null;if(n)return u;let l;return t[0]!==o||t[1]!==e?(l=o?d({...e,...o}):null,t[0]=o,t[1]=e,t[2]=l):l=t[2],l}function I(e){const t=s.c(11);let i;t[0]!==e?(i=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=i):i=t[1];const r=g(i),n=e?.previewServerUrl??null;let o=null;if(n)try{let f;t[2]!==n?(f=new URL(n),t[2]=n,t[3]=f):f=t[3],o=f.host}catch{o=null}let u;t[4]!==r||t[5]!==e||t[6]!==n?(u=e&&n&&r?v(new URL(e.path,n).toString(),r):null,t[4]=r,t[5]=e,t[6]=n,t[7]=u):u=t[7];const l=u;let c;return t[8]!==o||t[9]!==l?(c={url:l,host:o},t[8]=o,t[9]=l,t[10]=c):c=t[10],c}export{g as a,I as u};
@@ -1 +1 @@
1
- import{c as r,a2 as f,a9 as d,K as C,m as E,R as I,o as F,e as g}from"./index-wFdxw2k_.js";function q(){const e=r.c(7),{org:t}=f(),o=d();let n;e[0]!==t.id?(n=C.fileConfigs(t.id),e[0]=t.id,e[1]=n):n=e[1];let i;e[2]!==o?(i=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=i):i=e[3];let s;e[4]!==n||e[5]!==i?(s={queryKey:n,staleTime:6e4,queryFn:i},e[4]=n,e[5]=i,e[6]=s):s=e[6];const{data:l}=I(s);return l.configs}function _(e){const t=r.c(10);let o;t[0]!==e?(o=e===void 0?{}:e,t[0]=e,t[1]=o):o=t[1];const{enabled:n}=o,i=n===void 0?!0:n,{org:s}=f(),l=d();let u;t[2]!==s.id?(u=C.fileConfigs(s.id),t[2]=s.id,t[3]=u):u=t[3];const y=i&&!!s.id;let c;t[4]!==l?(c=()=>l.call("FILE_CONFIG_LIST",{}),t[4]=l,t[5]=c):c=t[5];let a;return t[6]!==u||t[7]!==y||t[8]!==c?(a={queryKey:u,enabled:y,staleTime:6e4,queryFn:c},t[6]=u,t[7]=y,t[8]=c,t[9]=a):a=t[9],E(a)}function L(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_CREATE",{...u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}function S(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_DELETE",{id:u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}export{q as a,L as b,S as c,_ as u};
1
+ import{c as r,a2 as f,a9 as d,K as C,m as E,R as I,o as F,e as g}from"./index-TD9q6ZAx.js";function q(){const e=r.c(7),{org:t}=f(),o=d();let n;e[0]!==t.id?(n=C.fileConfigs(t.id),e[0]=t.id,e[1]=n):n=e[1];let i;e[2]!==o?(i=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=i):i=e[3];let s;e[4]!==n||e[5]!==i?(s={queryKey:n,staleTime:6e4,queryFn:i},e[4]=n,e[5]=i,e[6]=s):s=e[6];const{data:l}=I(s);return l.configs}function _(e){const t=r.c(10);let o;t[0]!==e?(o=e===void 0?{}:e,t[0]=e,t[1]=o):o=t[1];const{enabled:n}=o,i=n===void 0?!0:n,{org:s}=f(),l=d();let u;t[2]!==s.id?(u=C.fileConfigs(s.id),t[2]=s.id,t[3]=u):u=t[3];const y=i&&!!s.id;let c;t[4]!==l?(c=()=>l.call("FILE_CONFIG_LIST",{}),t[4]=l,t[5]=c):c=t[5];let a;return t[6]!==u||t[7]!==y||t[8]!==c?(a={queryKey:u,enabled:y,staleTime:6e4,queryFn:c},t[6]=u,t[7]=y,t[8]=c,t[9]=a):a=t[9],E(a)}function L(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_CREATE",{...u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}function S(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_DELETE",{id:u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}export{q as a,L as b,S as c,_ as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-wFdxw2k_.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-TD9q6ZAx.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,a2 as q,o as Q,a as V,aE as z,b as B,e as T,y as F,t as S,K as M,j as t,D as G,p as U,q as Z,s as k,v as Y,w as $,B as P,aG as H,c as J,a9 as K,ax as W,m as X}from"./index-wFdxw2k_.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-DSbydQ9O.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-XSwSofuZ.js";import{T as re}from"./textarea-BRAhDvOh.js";import{u as ae}from"./use-org-auth-client-BryWu6mx.js";import{u as le}from"./use-organization-roles-DffTFg63.js";const ce=H().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(),b=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(),x=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async y=>{const R=await b.organization.inviteMember({email:y,role:s});if(R.error)throw new Error(R.error.message);return R.data})),w=a.filter(y=>y.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}x.mutate({emails:p,role:n.role})},v=p.length>0&&!!j;return t.jsxs(G,{open:d,onOpenChange:c,children:[t.jsx(U,{asChild:!0,children:e}),t.jsxs(Z,{className:"sm:max-w-lg",children:[t.jsx(k,{children:t.jsx(Y,{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:x.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:x.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($,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:x.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:x.isPending||!v,children:x.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:b}=W(),r=b||!!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}=X(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function be(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),b=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==b?(m=()=>{b.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),b.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=b,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=v=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:v}),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=v=>S.error(v instanceof Error?v.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=v=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:v}),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=v=>S.error(v instanceof Error?v.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 x=T(i);let D;return e[26]!==E||e[27]!==x?(D={approve:E,deny:x},e[26]=E,e[27]=x,e[28]=D):D=e[28],D}export{ve as I,be as a,xe as u};
1
+ import{r as L,a2 as q,o as Q,a as V,aE as z,b as B,e as T,y as F,t as S,K as M,j as t,D as G,p as U,q as Z,s as k,v as Y,w as $,B as P,aG as H,c as J,a9 as K,ax as W,m as X}from"./index-TD9q6ZAx.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-BivWj0r6.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-vip2MDSn.js";import{T as re}from"./textarea-B-TS083j.js";import{u as ae}from"./use-org-auth-client-CWA2hWCM.js";import{u as le}from"./use-organization-roles-DwFJmstu.js";const ce=H().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(),b=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(),x=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async y=>{const R=await b.organization.inviteMember({email:y,role:s});if(R.error)throw new Error(R.error.message);return R.data})),w=a.filter(y=>y.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}x.mutate({emails:p,role:n.role})},v=p.length>0&&!!j;return t.jsxs(G,{open:d,onOpenChange:c,children:[t.jsx(U,{asChild:!0,children:e}),t.jsxs(Z,{className:"sm:max-w-lg",children:[t.jsx(k,{children:t.jsx(Y,{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:x.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:x.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($,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:x.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:x.isPending||!v,children:x.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:b}=W(),r=b||!!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}=X(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function be(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),b=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==b?(m=()=>{b.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),b.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=b,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=v=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:v}),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=v=>S.error(v instanceof Error?v.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=v=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:v}),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=v=>S.error(v instanceof Error?v.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 x=T(i);let D;return e[26]!==E||e[27]!==x?(D={approve:E,deny:x},e[26]=E,e[27]=x,e[28]=D):D=e[28],D}export{ve as I,be as a,xe as u};
@@ -1 +1 @@
1
- import{c as Ue,b as He,u as Le,a2 as Oe,fe as Be,ff as Ke,fg as le,fh as de,al as $e,aj as me,fi as We,fj as qe,r as Y,dW as Qe,M as pe,fk as _e,fl as ze}from"./index-wFdxw2k_.js";import{o as Ge,q as Je,u as Xe,c as Ye,v as Ze,a as x,w as et,x as tt}from"./use-project-native-view-presence-DgHBfVGR.js";import{b as at}from"./agent-icon-Cgp1-Rbx.js";import{i as ot}from"./Monitor01-BSew-T8c.js";import{u as nt}from"./use-connection-CHo2bcMw.js";import{a as st}from"./use-mcp-client-CgigId7h.js";import{u as it}from"./use-mcp-tools-CMQDcWNX.js";import{a as ct}from"./repository-binding-09n9zNFN.js";import{g as rt}from"./types-DzDNRCBv.js";import{t as lt}from"./utils-CVEq3hMx.js";import{u as dt}from"./index-BQ2qZBgx.js";import{F as ue}from"./file-type-icon-IzZjwu7K.js";import{a as mt,u as pt}from"./use-panel-navigate-Cse0kIZg.js";import{r as Z}from"./resolve-tab-icon-BFjWL9qV.js";import{u as ut}from"./use-task-metadata-B_eO6NAU.js";import{r as ft}from"./preview-source-BsRLGWUP.js";import{i as bt,r as Tt,s as vt}from"./shell-layout-CBiOwFtT.js";import{a as It}from"./input-Ceh9947-.js";import{u as Pt}from"./use-organization-settings-Cc-OpUav.js";import{u as kt}from"./use-project-scope-B3ANi1IJ.js";import{c as wt}from"./chat-context-DnIdZBaI.js";import{r as yt}from"./virtual-mcp-DQ5n4L-p.js";function Gt(o){const e=Ue.c(35),d=He(),{openPanel:f,closePanel:F}=mt();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const fe=Le(b),ee=pt(),te=Ge(),i=ct(o.virtualMcpId),T=ut(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:v}=wt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Be(i.id):null,I=T?.expanded_tools??[],P=Pt(),{scopeId:Te,project:ve}=kt(),k=Je(Te,ve,i),w=Xe(k.project);Ye(k.project?.id);const ae=Ze(k.resolvedScopeId,x(k.project?.metadata),w.presence);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y={includeVirtual:!0},e[1]=y):y=e[1];const p=nt(y),Ie=dt(),E=v?.branch??be;let g;e[2]!==v?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==E?(g=ft({threadId:o.taskId,sandboxBranch:E,agentHasRepo:x(i?.metadata),threadHasRepo:x(T)||x(v?.metadata)}),e[2]=v?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=T,e[6]=E,e[7]=g):g=e[7];const Pe=g,U=Ie.lifecycle.phase==="running",{runtime:ke,resolved:oe}=It(o.virtualMcpId),H=!!r&&U;let h;e[8]!==H?(h={enabled:H},e[8]=H,e[9]=h):h=e[9];const ne=st({connectionId:r,orgId:n.id,orgSlug:n.slug},h),L=ne,O=!!ne&&U;let V;e[10]!==L||e[11]!==O?(V={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=V):V=e[12];const{data:we}=it(V),se=r&&U?(we?.tools??[]).filter(Mt).map(t=>({connectionId:r,toolName:t.name,label:lt(t.name),icon:null})):[],B=se[0],ye=B?se:[],u=B&&r?{type:"ext-apps",id:r,toolName:B.toolName}:m?.defaultMainView??null,ge=yt(m),ie={assets:w.assetsPending,siteAccess:w.siteAccessPending,releases:w.releasesPending},{activeTab:M,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:u||m?{defaultMainView:u,tabs:c.map(Vt)}:null}),he=u||m?{defaultMainView:u,tabs:c.map(ht)}:null,C=Tt({hasSource:Pe==="repo"||P,runtime:ke,cmsMode:ge}),Ve=C.includes("content"),Me=le(he),Ce=u?.type,ce=et(Ce,ae,ie,C,oe),K=ce?le(null):Me,Se=tt(M,ae,ie),je=!C.includes("code")&&oe&&de(M)!==null,a=!ee&&!te&&ce||M==="content"&&!Ve||je||Se?K:M,$=$e(a);let S;e[13]!==d?(S=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=S):S=e[14];const Ne=S,W=new Map;for(const t of I){const s=me(t.appId,t.toolName);W.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ye){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);W.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const q=We(a),Q=q?q.key.split("/").pop()??q.key:null,Ae=Q?[{id:a,title:Q,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:Q,...t})}}]:[],j=qe(a),De=j?[{id:a,title:(j.path.split("/").pop()??j.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(j.path.startsWith("pages/")?at:ot,t)}}]:[],_=Qe(a),z=_?_.path.split("/").pop()??_.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],xe=bt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:Ne(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:p})})):[];let N;e[15]!==p?(N=t=>({id:_e(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:p})}),e[15]=p,e[16]=N):N=e[16];const Fe=[...xe,...Ae,...De,...Re,...c.map(N),...Array.from(W.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:p})}))],re=new Set,G=Fe.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),Ee=o.virtualMcpId;let A;e[17]!==n.id?(A=pe(n.id),e[17]=n.id,e[18]=A):A=e[18];const J=Ee===A;let D;e[19]!==a||e[20]!==F||e[21]!==l||e[22]!==J||e[23]!==f||e[24]!==n.id||e[25]!==P?(D=t=>{if(vt({reportsOnly:P,onReportAgent:J,tabId:t})){f(t,{virtualmcpid:pe(n.id),search:gt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?F():f(s.tabId)},e[19]=a,e[20]=F,e[21]=l,e[22]=J,e[23]=f,e[24]=n.id,e[25]=P,e[26]=D):D=e[26];const X=D;let R;return e[27]!==a||e[28]!==$||e[29]!==I||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==G?(R={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:I,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=I,e[30]=c,e[31]=l,e[32]=X,e[33]=G,e[34]=R):R=e[34],R}function gt(o){return{...o,thread:void 0}}function ht(o){return{id:o.id}}function Vt(o){return{id:o.id}}function Mt(o){return!!rt(o._meta)}export{Gt as u};
1
+ import{c as Ue,b as He,u as Le,a2 as Oe,fe as Be,ff as Ke,fg as le,fh as de,al as $e,aj as me,fi as We,fj as qe,r as Y,dW as Qe,M as pe,fk as _e,fl as ze}from"./index-TD9q6ZAx.js";import{o as Ge,q as Je,u as Xe,c as Ye,v as Ze,a as x,w as et,x as tt}from"./use-project-native-view-presence-DdsfKci4.js";import{b as at}from"./agent-icon-Blcoi2NV.js";import{i as ot}from"./Monitor01-yE6iFgVP.js";import{u as nt}from"./use-connection-OOD0tHd7.js";import{a as st}from"./use-mcp-client-fTyLcuiX.js";import{u as it}from"./use-mcp-tools-sv7pv5ex.js";import{a as ct}from"./repository-binding-BnejFX7t.js";import{g as rt}from"./types-oDc7dHni.js";import{t as lt}from"./utils-CVEq3hMx.js";import{u as dt}from"./index-BYmaAL9a.js";import{F as ue}from"./file-type-icon-C2JXE2hG.js";import{a as mt,u as pt}from"./use-panel-navigate-CfJ9Qf-l.js";import{r as Z}from"./resolve-tab-icon-Daxo01Gi.js";import{u as ut}from"./use-task-metadata-Buvn0eAk.js";import{r as ft}from"./preview-source-BsRLGWUP.js";import{i as bt,r as Tt,s as vt}from"./shell-layout-BM51_FIv.js";import{a as It}from"./input-BSUErVvJ.js";import{u as Pt}from"./use-organization-settings-lug340cj.js";import{u as kt}from"./use-project-scope-C99MQSqi.js";import{c as wt}from"./chat-context-Ch-VpD9W.js";import{r as yt}from"./virtual-mcp-DQFtuDZf.js";function Gt(o){const e=Ue.c(35),d=He(),{openPanel:f,closePanel:F}=mt();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const fe=Le(b),ee=pt(),te=Ge(),i=ct(o.virtualMcpId),T=ut(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:v}=wt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Be(i.id):null,I=T?.expanded_tools??[],P=Pt(),{scopeId:Te,project:ve}=kt(),k=Je(Te,ve,i),w=Xe(k.project);Ye(k.project?.id);const ae=Ze(k.resolvedScopeId,x(k.project?.metadata),w.presence);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y={includeVirtual:!0},e[1]=y):y=e[1];const p=nt(y),Ie=dt(),E=v?.branch??be;let g;e[2]!==v?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==E?(g=ft({threadId:o.taskId,sandboxBranch:E,agentHasRepo:x(i?.metadata),threadHasRepo:x(T)||x(v?.metadata)}),e[2]=v?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=T,e[6]=E,e[7]=g):g=e[7];const Pe=g,U=Ie.lifecycle.phase==="running",{runtime:ke,resolved:oe}=It(o.virtualMcpId),H=!!r&&U;let h;e[8]!==H?(h={enabled:H},e[8]=H,e[9]=h):h=e[9];const ne=st({connectionId:r,orgId:n.id,orgSlug:n.slug},h),L=ne,O=!!ne&&U;let V;e[10]!==L||e[11]!==O?(V={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=V):V=e[12];const{data:we}=it(V),se=r&&U?(we?.tools??[]).filter(Mt).map(t=>({connectionId:r,toolName:t.name,label:lt(t.name),icon:null})):[],B=se[0],ye=B?se:[],u=B&&r?{type:"ext-apps",id:r,toolName:B.toolName}:m?.defaultMainView??null,ge=yt(m),ie={assets:w.assetsPending,siteAccess:w.siteAccessPending,releases:w.releasesPending},{activeTab:M,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:u||m?{defaultMainView:u,tabs:c.map(Vt)}:null}),he=u||m?{defaultMainView:u,tabs:c.map(ht)}:null,C=Tt({hasSource:Pe==="repo"||P,runtime:ke,cmsMode:ge}),Ve=C.includes("content"),Me=le(he),Ce=u?.type,ce=et(Ce,ae,ie,C,oe),K=ce?le(null):Me,Se=tt(M,ae,ie),je=!C.includes("code")&&oe&&de(M)!==null,a=!ee&&!te&&ce||M==="content"&&!Ve||je||Se?K:M,$=$e(a);let S;e[13]!==d?(S=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=S):S=e[14];const Ne=S,W=new Map;for(const t of I){const s=me(t.appId,t.toolName);W.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ye){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);W.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const q=We(a),Q=q?q.key.split("/").pop()??q.key:null,Ae=Q?[{id:a,title:Q,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:Q,...t})}}]:[],j=qe(a),De=j?[{id:a,title:(j.path.split("/").pop()??j.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(j.path.startsWith("pages/")?at:ot,t)}}]:[],_=Qe(a),z=_?_.path.split("/").pop()??_.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],xe=bt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:Ne(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:p})})):[];let N;e[15]!==p?(N=t=>({id:_e(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:p})}),e[15]=p,e[16]=N):N=e[16];const Fe=[...xe,...Ae,...De,...Re,...c.map(N),...Array.from(W.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:p})}))],re=new Set,G=Fe.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),Ee=o.virtualMcpId;let A;e[17]!==n.id?(A=pe(n.id),e[17]=n.id,e[18]=A):A=e[18];const J=Ee===A;let D;e[19]!==a||e[20]!==F||e[21]!==l||e[22]!==J||e[23]!==f||e[24]!==n.id||e[25]!==P?(D=t=>{if(vt({reportsOnly:P,onReportAgent:J,tabId:t})){f(t,{virtualmcpid:pe(n.id),search:gt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?F():f(s.tabId)},e[19]=a,e[20]=F,e[21]=l,e[22]=J,e[23]=f,e[24]=n.id,e[25]=P,e[26]=D):D=e[26];const X=D;let R;return e[27]!==a||e[28]!==$||e[29]!==I||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==G?(R={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:I,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=I,e[30]=c,e[31]=l,e[32]=X,e[33]=G,e[34]=R):R=e[34],R}function gt(o){return{...o,thread:void 0}}function ht(o){return{id:o.id}}function Vt(o){return{id:o.id}}function Mt(o){return!!rt(o._meta)}export{Gt as u};
@@ -1 +1 @@
1
- import{c as b,b as k,a3 as N,aW as S,j as o,a2 as $,K as A,R as L}from"./index-wFdxw2k_.js";import{B as g}from"./badge-BH_WGjDS.js";import{c as v,T,a as I,b as R}from"./tooltip-BP_lFNWX.js";import{g as _}from"./types-DzDNRCBv.js";import{s as H}from"./Image01-DH2NgDr7.js";import{q as P,aR as U}from"./agent-icon-Cgp1-Rbx.js";import{i as w}from"./mcp-oauth-XpCTKkfu.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:H,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:P,variant:"outline"}];function Q(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=_(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?O.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=R,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(U,{})})}),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 m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function Y(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=()=>w({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{Q as T,Y as u};
1
+ import{c as b,b as k,a3 as N,aW as S,j as o,a2 as $,K as A,R as L}from"./index-TD9q6ZAx.js";import{B as g}from"./badge-Qzxf6tet.js";import{c as v,T,a as I,b as R}from"./tooltip-D3Lno7Sd.js";import{g as _}from"./types-oDc7dHni.js";import{s as H}from"./Image01-CyRCJwXT.js";import{q as P,aR as U}from"./agent-icon-Blcoi2NV.js";import{i as w}from"./mcp-oauth-CaxV9wcl.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:H,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:P,variant:"outline"}];function Q(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=_(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?O.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=R,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(U,{})})}),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 m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function Y(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=()=>w({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{Q as T,Y as u};
@@ -1,4 +1,4 @@
1
- import{ca as ce,cb as le,cc as ue,cd as de,ce as he,cf as m,cg as g,ch as fe,ci as pe,cj as me,ck as M,cl as _e,cm as F,cn as we,co as q,cp as ge,cq as D,cr as Te,cs as ye,ct as ke,cu as z,cv as ve,cw as Se,cx as Ce,cy as ee,cz as be,cA as Re,cB as Ie,bk as Ee,cC as qe,cD as Pe,cE as A,cF as $e,cG as Me,cH as Ae,cI as He,cJ as Oe,cK as xe,cL as Ne,cM as Ue,cN as je,cO as Fe,cP as De,cQ as Le,cR as Ve,bb as V,cS as Qe,cT as N,K as te,J as ze,c as se,R as Je,m as We}from"./index-wFdxw2k_.js";import{U as P,b as H,c as J}from"./auth-DN7Bvt0x.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(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 Ke(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 W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{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(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,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 h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} 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 m(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(pe,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 m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(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 m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(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),m.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)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(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=m.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(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(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 h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},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 h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={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:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).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 m(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=m.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 m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(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 m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(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 m?n:new m(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 h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=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 _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{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},Te,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},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,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=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(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=W(e);this._notificationHandlers.set(s,r=>{const o=K(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"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(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 m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(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 m(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=z.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 m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(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=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(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];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}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 st{constructor(e){this._client=e}async*callToolStream(e,t=ee,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 m(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 m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(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 rt(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 ot(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 at(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 nt=class extends Be{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 tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(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(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.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:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.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){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(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},$e,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},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,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=ee,s){if(this.isToolTaskRequired(e.name))throw new m(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 m(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 m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(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},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.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 h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);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 U=a=>[{type:"text",text:a}];function it(a){const e=V(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(h){const f=h instanceof Error?h.message:"Network error";return{content:U(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:U(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:U(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 L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B 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 Z=10,lt=13,I=32;function j(a){}function ut(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=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
1
+ import{ca as ce,cb as le,cc as ue,cd as de,ce as he,cf as m,cg as g,ch as fe,ci as pe,cj as me,ck as M,cl as _e,cm as F,cn as we,co as q,cp as ge,cq as D,cr as Te,cs as ye,ct as ke,cu as z,cv as ve,cw as Se,cx as Ce,cy as ee,cz as be,cA as Re,cB as Ie,bk as Ee,cC as qe,cD as Pe,cE as A,cF as $e,cG as Me,cH as Ae,cI as He,cJ as Oe,cK as xe,cL as Ne,cM as Ue,cN as je,cO as Fe,cP as De,cQ as Le,cR as Ve,bb as V,cS as Qe,cT as N,K as te,J as ze,c as se,R as Je,m as We}from"./index-TD9q6ZAx.js";import{U as P,b as H,c as J}from"./auth-CLglKqB6.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(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 Ke(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 W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{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(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,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 h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} 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 m(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(pe,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 m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(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 m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(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),m.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)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(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=m.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(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(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 h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},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 h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={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:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).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 m(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=m.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 m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(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 m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(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 m?n:new m(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 h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=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 _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{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},Te,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},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,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=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(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=W(e);this._notificationHandlers.set(s,r=>{const o=K(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"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(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 m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(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 m(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=z.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 m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(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=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(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];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}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 st{constructor(e){this._client=e}async*callToolStream(e,t=ee,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 m(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 m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(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 rt(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 ot(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 at(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 nt=class extends Be{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 tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(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(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.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:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.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){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(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},$e,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},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,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=ee,s){if(this.isToolTaskRequired(e.name))throw new m(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 m(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 m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(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},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.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 h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);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 U=a=>[{type:"text",text:a}];function it(a){const e=V(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(h){const f=h instanceof Error?h.message:"Network error";return{content:U(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:U(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:U(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 L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B 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 Z=10,lt=13,I=32;function j(a){}function ut(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=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
2
2
  `)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
3
3
  `,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=_+1,_=d.indexOf(`
4
4
  `,c);continue}const v=d.charCodeAt(c);if(Y(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(p===0&&d.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
@@ -1 +1 @@
1
- import{c as l,m as u,cf as m,cg as f,R as y,K as n}from"./index-wFdxw2k_.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,cf as m,cg as f,R as y,K as n}from"./index-TD9q6ZAx.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,R as p,m as q,K as m}from"./index-wFdxw2k_.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,R as p,m as q,K as m}from"./index-TD9q6ZAx.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,a2 as m,m as b,R as M,K as f}from"./index-wFdxw2k_.js";import{u as y}from"./use-org-auth-client-BryWu6mx.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],M(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],b(l)}export{d as a,q as u};
1
+ import{c,a2 as m,m as b,R as M,K as f}from"./index-TD9q6ZAx.js";import{u as y}from"./use-org-auth-client-CWA2hWCM.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],M(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],b(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-wFdxw2k_.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-TD9q6ZAx.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 b,m as S,K as E,ao as P,a2 as A,d as Q,o as G,a as H,ab as B,d6 as C,d7 as k,db as D}from"./index-wFdxw2k_.js";import{r as _,h as N,g as $,d as I,i as V,k as Y}from"./repository-binding-09n9zNFN.js";import{h as x,u as z,d as v,w as J}from"./thread-intent-DLRGXMNS.js";function j(t,e){if(!e)return!0;if(t.partial)return!1;const n=x(t.metadata?.runtime);return n===null||n===e}function F(t,e,n,a,s){let r=null;for(const o of t)o.virtual_mcp_id===e&&o.created_by===n&&(o.hidden||j(o,a)&&(s&&o.branch===s||(!r||o.updated_at>r.updated_at)&&(r=o)));return r}function he(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&&j(s,a))}function W(t,e,n,a,s,r){return s?F(t,e,n,a,r?.baseBranch)??void 0:F(t,e,n,a)??void 0}const X=6e4,O=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 Z(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 U(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:r}=t;return{queryKey:E.githubPrState(e,_(n),a,s,r),queryFn:()=>P(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&N(n)&&!!a&&!!s,refetchInterval:X,refetchIntervalInBackground:!1,staleTime:O}}function M(t){const e=b.c(4);let n;e[0]!==t?(n=U(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],S(a)}function ee(t){return t.changeRequest?q(t.changeRequest):null}function fe(t){const e=b.c(4);let n;e[0]!==t?(n=U(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],S(a)}function te(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(Z):[]}const ne=5*6e4;function ge(t){const e=b.c(20),{orgSlug:n,target:a,owner:s,repo:r,base:o}=t;let i;e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==r||e[4]!==a?(i=E.githubLastPublishedPr(n,_(a),s,r,o),e[0]=o,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==o||e[7]!==n||e[8]!==a?(u=()=>P(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:o}),e[6]=o,e[7]=n,e[8]=a,e[9]=u):u=e[9];let l;e[10]!==t.enabled||e[11]!==o||e[12]!==s||e[13]!==r||e[14]!==a?(l=(t.enabled??!0)&&!!o&&N(a)&&!!s&&!!r,e[10]=t.enabled,e[11]=o,e[12]=s,e[13]=r,e[14]=a,e[15]=l):l=e[15];let f;return e[16]!==i||e[17]!==u||e[18]!==l?(f={queryKey:i,queryFn:u,enabled:l,staleTime:ne,select:ae},e[16]=i,e[17]=u,e[18]=l,e[19]=f):f=e[19],S(f)}function ae(t){return t.changeRequest?q(t.changeRequest):null}const se=50;function me(t){const e=b.c(17),{orgSlug:n,target:a,owner:s,repo:r}=t;let o;e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==a?(o=E.githubOpenPrs(n,_(a),s,r),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>P(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:se}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==r||e[11]!==a?(u=(t.enabled??!0)&&N(a)&&!!s&&!!r,e[8]=t.enabled,e[9]=s,e[10]=r,e[11]=a,e[12]=u):u=e[12];let l;return e[13]!==o||e[14]!==i||e[15]!==u?(l={queryKey:o,queryFn:i,enabled:u,staleTime:O,select:re},e[13]=o,e[14]=i,e[15]=u,e[16]=l):l=e[16],S(l)}function re(t){return t.changeRequests.map(q)}function oe(t,e){const{org:n}=A(),a=$(t);return M({orgId:n.id,orgSlug:n.slug,target:I(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ie=[];function be(){const t=b.c(14),e=Q(),{org:n,locator:a}=A(),s=G(),r=V(),{data:o}=H.useSession(),i=z(),u=oe(void 0,null),l=B();let f;t[0]!==u||t[1]!==r||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==l||t[7]!==o?.user?.id?(f=(d,c,T)=>{if(l&&!c?.panel){e({to:"/$org/projects",params:{org:n.slug},search:y=>({...y,project:d,virtualmcpid:void 0,view:void 0})});return}const h=c?.panel??"overview";if(C(h).kind==="org-destination"){k(e,{tabId:h,org:n.slug,agentId:d,replace:!1});return}const m=(r??[]).find(y=>y.id===d),K=!!(m&&$(m)),w=!c?.runtime,L=w?void 0:W(i?.threads.get()??ie,d,o?.user?.id,T??(m?v(m.metadata):void 0),K,{baseBranch:u}),R=w?void 0:L?.id??crypto.randomUUID();R&&!L&&c?.runtime&&J(sessionStorage,a,R,{runtime:c.runtime}),k(e,{tabId:h,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=r,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=l,t[7]=o?.user?.id,t[8]=f):f=t[8];const g=f;let p;return t[9]!==r||t[10]!==g||t[11]!==n||t[12]!==s?(p=(d,c)=>{if(C(c?.panel??"overview").kind==="org-destination")return g(d,c,void 0);const T=r.find(h=>h.id===d);if(c?.runtime)return g(d,c,c.runtime);if(T)return g(d,c,v(T.metadata));Y(s,n).then(h=>h.find(m=>m.id===d)).catch(ue).then(h=>g(d,c,h?v(h.metadata):void 0))},t[9]=r,t[10]=g,t[11]=n,t[12]=s,t[13]=p):p=t[13],p}function ue(){}function pe(){const t=b.c(3),{org:e}=A(),n=B();let a;return t[0]!==e.slug||t[1]!==n?(a=(s,r)=>{if(n&&!r)return{to:"/$org/projects",params:{org:e.slug},search:i=>({...i,project:s,virtualmcpid:void 0,view:void 0})};const o=D({tabId:r??"overview",org:e.slug,agentId:s});return{to:o.to,params:o.params,search:o.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{pe as a,oe as b,W as c,me as d,M as e,he as f,ge as g,fe as h,U as p,be as u};
1
+ import{c as b,m as S,K as E,ao as P,a2 as A,d as Q,o as G,a as H,ab as B,d6 as C,d7 as k,db as D}from"./index-TD9q6ZAx.js";import{r as _,h as N,g as $,d as I,i as V,k as Y}from"./repository-binding-BnejFX7t.js";import{h as x,u as z,d as v,w as J}from"./thread-intent-S-gJClOG.js";function j(t,e){if(!e)return!0;if(t.partial)return!1;const n=x(t.metadata?.runtime);return n===null||n===e}function F(t,e,n,a,s){let r=null;for(const o of t)o.virtual_mcp_id===e&&o.created_by===n&&(o.hidden||j(o,a)&&(s&&o.branch===s||(!r||o.updated_at>r.updated_at)&&(r=o)));return r}function he(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&&j(s,a))}function W(t,e,n,a,s,r){return s?F(t,e,n,a,r?.baseBranch)??void 0:F(t,e,n,a)??void 0}const X=6e4,O=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 Z(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 U(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:r}=t;return{queryKey:E.githubPrState(e,_(n),a,s,r),queryFn:()=>P(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&N(n)&&!!a&&!!s,refetchInterval:X,refetchIntervalInBackground:!1,staleTime:O}}function M(t){const e=b.c(4);let n;e[0]!==t?(n=U(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],S(a)}function ee(t){return t.changeRequest?q(t.changeRequest):null}function fe(t){const e=b.c(4);let n;e[0]!==t?(n=U(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],S(a)}function te(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(Z):[]}const ne=5*6e4;function ge(t){const e=b.c(20),{orgSlug:n,target:a,owner:s,repo:r,base:o}=t;let i;e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==r||e[4]!==a?(i=E.githubLastPublishedPr(n,_(a),s,r,o),e[0]=o,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==o||e[7]!==n||e[8]!==a?(u=()=>P(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:o}),e[6]=o,e[7]=n,e[8]=a,e[9]=u):u=e[9];let l;e[10]!==t.enabled||e[11]!==o||e[12]!==s||e[13]!==r||e[14]!==a?(l=(t.enabled??!0)&&!!o&&N(a)&&!!s&&!!r,e[10]=t.enabled,e[11]=o,e[12]=s,e[13]=r,e[14]=a,e[15]=l):l=e[15];let f;return e[16]!==i||e[17]!==u||e[18]!==l?(f={queryKey:i,queryFn:u,enabled:l,staleTime:ne,select:ae},e[16]=i,e[17]=u,e[18]=l,e[19]=f):f=e[19],S(f)}function ae(t){return t.changeRequest?q(t.changeRequest):null}const se=50;function me(t){const e=b.c(17),{orgSlug:n,target:a,owner:s,repo:r}=t;let o;e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==a?(o=E.githubOpenPrs(n,_(a),s,r),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>P(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:se}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==r||e[11]!==a?(u=(t.enabled??!0)&&N(a)&&!!s&&!!r,e[8]=t.enabled,e[9]=s,e[10]=r,e[11]=a,e[12]=u):u=e[12];let l;return e[13]!==o||e[14]!==i||e[15]!==u?(l={queryKey:o,queryFn:i,enabled:u,staleTime:O,select:re},e[13]=o,e[14]=i,e[15]=u,e[16]=l):l=e[16],S(l)}function re(t){return t.changeRequests.map(q)}function oe(t,e){const{org:n}=A(),a=$(t);return M({orgId:n.id,orgSlug:n.slug,target:I(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ie=[];function be(){const t=b.c(14),e=Q(),{org:n,locator:a}=A(),s=G(),r=V(),{data:o}=H.useSession(),i=z(),u=oe(void 0,null),l=B();let f;t[0]!==u||t[1]!==r||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==l||t[7]!==o?.user?.id?(f=(d,c,T)=>{if(l&&!c?.panel){e({to:"/$org/projects",params:{org:n.slug},search:y=>({...y,project:d,virtualmcpid:void 0,view:void 0})});return}const h=c?.panel??"overview";if(C(h).kind==="org-destination"){k(e,{tabId:h,org:n.slug,agentId:d,replace:!1});return}const m=(r??[]).find(y=>y.id===d),K=!!(m&&$(m)),w=!c?.runtime,L=w?void 0:W(i?.threads.get()??ie,d,o?.user?.id,T??(m?v(m.metadata):void 0),K,{baseBranch:u}),R=w?void 0:L?.id??crypto.randomUUID();R&&!L&&c?.runtime&&J(sessionStorage,a,R,{runtime:c.runtime}),k(e,{tabId:h,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=r,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=l,t[7]=o?.user?.id,t[8]=f):f=t[8];const g=f;let p;return t[9]!==r||t[10]!==g||t[11]!==n||t[12]!==s?(p=(d,c)=>{if(C(c?.panel??"overview").kind==="org-destination")return g(d,c,void 0);const T=r.find(h=>h.id===d);if(c?.runtime)return g(d,c,c.runtime);if(T)return g(d,c,v(T.metadata));Y(s,n).then(h=>h.find(m=>m.id===d)).catch(ue).then(h=>g(d,c,h?v(h.metadata):void 0))},t[9]=r,t[10]=g,t[11]=n,t[12]=s,t[13]=p):p=t[13],p}function ue(){}function pe(){const t=b.c(3),{org:e}=A(),n=B();let a;return t[0]!==e.slug||t[1]!==n?(a=(s,r)=>{if(n&&!r)return{to:"/$org/projects",params:{org:e.slug},search:i=>({...i,project:s,virtualmcpid:void 0,view:void 0})};const o=D({tabId:r??"overview",org:e.slug,agentId:s});return{to:o.to,params:o.params,search:o.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{pe as a,oe as b,W as c,me as d,M as e,he as f,ge as g,fe as h,U as p,be as u};
@@ -1 +1 @@
1
- import{c as l,a9 as f,b as p,e as T,t as m}from"./index-wFdxw2k_.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,a9 as f,b as p,e as T,t as m}from"./index-TD9q6ZAx.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,a2 as j,a as i}from"./index-wFdxw2k_.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,a2 as j,a as i}from"./index-TD9q6ZAx.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};