decocms 4.210.2 → 4.211.1

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 (233) hide show
  1. package/dist/client/assets/{AlertCircle-B-VB_v8_.js → AlertCircle-BJ5Laasl.js} +1 -1
  2. package/dist/client/assets/{AreaChart-GISiEbjd.js → AreaChart-CrbfDoCM.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-KvTc6rGE.js → ArrowLeft-D5JGfSA4.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CM4hwO1x.js → ArrowUp-NtTGEiXQ.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-CT3hd3Gz.js → ArrowUpRight-CUs6CbaF.js} +1 -1
  6. package/dist/client/assets/{Check-jVlurWFp.js → Check-DIWR4XW1.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-Dag22p3m.js → CheckCircle-CuraQ81C.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-p_tbIzFd.js → ChevronDown-DgAtwz5C.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-CPHsfQo3.js → ChevronRight-D6-UpKSk.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-vuWH7gGr.js → ChevronUp-DNSB7Nbk.js} +1 -1
  11. package/dist/client/assets/{Copy01-C_8GUzyJ.js → Copy01-DmXxiqc6.js} +1 -1
  12. package/dist/client/assets/{CpuChip01-4na0tDxe.js → CpuChip01-BytaWER7.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DW_FdoX9.js → CreditCard01-DQqlvPia.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-BGG3Ho_u.js → DotsVertical-CL4fwztx.js} +1 -1
  15. package/dist/client/assets/{Eye-Dn-joolw.js → Eye-CBV1oWcB.js} +1 -1
  16. package/dist/client/assets/{FilterLines-CYIS3PyF.js → FilterLines-C8SjCyFi.js} +1 -1
  17. package/dist/client/assets/{Globe01-BMEBgVG2.js → Globe01-Btm0dXhY.js} +1 -1
  18. package/dist/client/assets/{Globe04-DufTt3Vi.js → Globe04-D9qVsCbI.js} +1 -1
  19. package/dist/client/assets/{HardDrive-H4sB7rht.js → HardDrive-CJk4ov6F.js} +1 -1
  20. package/dist/client/assets/{Key01-CH_IVG_t.js → Key01-B5xrezDZ.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-BLZ5NIVe.js → LayoutLeft-D6wv9en6.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-SB0_tkSE.js → LinkExternal01-BH3gOTLA.js} +1 -1
  23. package/dist/client/assets/{LogOut01-BccMqXFZ.js → LogOut01-SZnvpmJV.js} +1 -1
  24. package/dist/client/assets/{Monitor01-DljnePZF.js → Monitor01-UogQCFcQ.js} +1 -1
  25. package/dist/client/assets/{Palette-BkqWyxiz.js → Palette-DM0-_tKV.js} +1 -1
  26. package/dist/client/assets/{Play-BO_bz8z5.js → Play-Ccba2QRM.js} +1 -1
  27. package/dist/client/assets/{Plus-DChWoRcZ.js → Plus-CfCBacjT.js} +1 -1
  28. package/dist/client/assets/{SearchLg-DIkeGuEU.js → SearchLg-B9uL5YOp.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CUHSKZ0C.js → SearchMd-Bn8XXVaA.js} +1 -1
  30. package/dist/client/assets/{Settings02-DwsCOelc.js → Settings02-Le49_mVi.js} +1 -1
  31. package/dist/client/assets/{Share07-BKiSFd-U.js → Share07-CoxyuV_E.js} +1 -1
  32. package/dist/client/assets/{Shield01-DZaZzDZT.js → Shield01-Ds8y5bur.js} +1 -1
  33. package/dist/client/assets/{Star01-CHCsqoaq.js → Star01-BBJKsuL9.js} +1 -1
  34. package/dist/client/assets/{Stars01-sT_rQek5.js → Stars01-8VTZy-Ut.js} +1 -1
  35. package/dist/client/assets/{Stars02-9Za0OT3w.js → Stars02-XZ3eiHDT.js} +1 -1
  36. package/dist/client/assets/{Sun-ftMFixk5.js → Sun-QR_TFyhY.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-Cebat5cd.js → SwitchHorizontal01-DuS0RSqy.js} +1 -1
  38. package/dist/client/assets/{Tool01-DncLlBOd.js → Tool01-Bo8oMlBt.js} +1 -1
  39. package/dist/client/assets/{Tool02-Dop27LUm.js → Tool02-OuC9FD32.js} +1 -1
  40. package/dist/client/assets/{Trash01-BjgXKgr6.js → Trash01-BEQ11EC7.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-DeH0rZDG.js → TrendUp01-BB1RfYtp.js} +1 -1
  42. package/dist/client/assets/{Upload01-C9lBOcvL.js → Upload01-QANNG5Dx.js} +1 -1
  43. package/dist/client/assets/{User01-BJ2PmluK.js → User01-BXiZpiCy.js} +1 -1
  44. package/dist/client/assets/{Users01-CDyoTcZA.js → Users01-Css8HZgb.js} +1 -1
  45. package/dist/client/assets/{Users03-DBRXdvYq.js → Users03-pgncqeuH.js} +1 -1
  46. package/dist/client/assets/{X-JiAwzhaQ.js → X-DEBUZCc1.js} +1 -1
  47. package/dist/client/assets/{XCircle-BAmgho8b.js → XCircle-CRaWHtor.js} +1 -1
  48. package/dist/client/assets/{XClose-DgBj6S8z.js → XClose-B1vS8ayo.js} +1 -1
  49. package/dist/client/assets/{Zap-ywE7kIil.js → Zap-BaTcw9AK.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-4QAPR3zA.js → ZapSquare-NQ-ZfI_o.js} +1 -1
  51. package/dist/client/assets/{access-gate-So3U0BEa.js → access-gate-C3CWDsOs.js} +1 -1
  52. package/dist/client/assets/{agent-icon-BypwlSQB.js → agent-icon-C5KNOKfn.js} +1 -1
  53. package/dist/client/assets/{agents-list-C8CTZGET.js → agents-list-DxzmF9aZ.js} +1 -1
  54. package/dist/client/assets/{ai-providers-CZgWwdeh.js → ai-providers-DEfH_aCV.js} +1 -1
  55. package/dist/client/assets/{alert-DpBr9hws.js → alert-C5HGX8_f.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-CZcxNTn5.js → alert-dialog-Dq-J2sc0.js} +2 -2
  57. package/dist/client/assets/{app-editor-ByEM6PQA.js → app-editor-CEGW49K1.js} +1 -1
  58. package/dist/client/assets/{auth-CgC0zRiu.js → auth-Dhov-tCz.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-Dz8vFuO9.js → auth-catchall-HbUyyBV0.js} +1 -1
  60. package/dist/client/assets/{auth-entry-BllwLBnz.js → auth-entry-CX-IITQd.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-CKjZUbdm.js → auth-split-layout-CZPNhO9J.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-zBYZihEH.js → authenticate-and-persist-oauth-DfniyabI.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-DtC9A60K.js → automation-list-row-BZ2bvhcK.js} +1 -1
  64. package/dist/client/assets/{automation-runs-BlKRnDL3.js → automation-runs-Bl6XRQA5.js} +1 -1
  65. package/dist/client/assets/{automations-CojYI39x.js → automations-Z_Brl5k2.js} +1 -1
  66. package/dist/client/assets/{avatar-BeSTVwN_.js → avatar-C51fT0U1.js} +1 -1
  67. package/dist/client/assets/{badge-7TN3Wktg.js → badge-Ck94mGfj.js} +1 -1
  68. package/dist/client/assets/{billing-Bja42Pi1.js → billing-DduF3_Na.js} +1 -1
  69. package/dist/client/assets/{block-document-BSnBImDv.js → block-document-PEG6toYF.js} +1 -1
  70. package/dist/client/assets/{brand-context-CaGiPaFo.js → brand-context-Cj-9oRfH.js} +1 -1
  71. package/dist/client/assets/{buckets-BFrcNzoB.js → buckets-DcYJfgqi.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-DYieY-aA.js → bulk-category-panel-C2v-WjTo.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-CKYF121O.js → capability-load-error-CPTO6JHG.js} +1 -1
  74. package/dist/client/assets/{card-DcOVhRdn.js → card-C6z0dXO6.js} +1 -1
  75. package/dist/client/assets/{cards-CGo6rBiP.js → cards-CJhOwQK4.js} +1 -1
  76. package/dist/client/assets/{category-editor-DOcP_AaV.js → category-editor-FOJ2bmFs.js} +1 -1
  77. package/dist/client/assets/{chat-context-CHpxk4f9.js → chat-context-owt7LEz8.js} +1 -1
  78. package/dist/client/assets/{checkbox-tzeh-qrP.js → checkbox-C8enJPrg.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-DfRqWz-l.js → cli-auth-success-sYIr9CLo.js} +1 -1
  80. package/dist/client/assets/{collection-detail-D_2wxesW.js → collection-detail-LhbUI4Jo.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-DgdY2-SO.js → collection-display-button-C8VZuoLi.js} +1 -1
  82. package/dist/client/assets/{collection-search-D9_uCTpl.js → collection-search-_DdbFuGk.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-yAMwsEKr.js → collection-table-wrapper-DBV6PVTd.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-Cgws9vFl.js → collection-tabs-B3YjrfoK.js} +1 -1
  85. package/dist/client/assets/{command-vCdEhggD.js → command-B0nd3OkS.js} +1 -1
  86. package/dist/client/assets/commerce-onboarding-C6ugYRlQ.js +1 -0
  87. package/dist/client/assets/{connect-w7lllDYQ.js → connect-CWSIilv_.js} +1 -1
  88. package/dist/client/assets/{connection-VFkeKEW_.js → connection-DfSzJILW.js} +1 -1
  89. package/dist/client/assets/{connection-card-BXKTS1UY.js → connection-card-HalILNEd.js} +1 -1
  90. package/dist/client/assets/{connection-detail-Bq1COctm.js → connection-detail-CUreVl8A.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-ClipGuvp.js → connection-form-helpers-DLptqQMF.js} +1 -1
  92. package/dist/client/assets/{connections-VtLjYpst.js → connections-DvgVSJT6.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-DxtdX756.js → decopilot-sse-pool-Dx_Ili9X.js} +1 -1
  94. package/dist/client/assets/{dialog-BndOy54_.js → dialog-DWhWY4Tz.js} +1 -1
  95. package/dist/client/assets/{domain-settings-D6c9-Vro.js → domain-settings-CCsfDcey.js} +1 -1
  96. package/dist/client/assets/{drawer-CG0exhDi.js → drawer-Dn_54u3I.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-BlydGYwg.js → dropdown-menu-btOyH89q.js} +1 -1
  98. package/dist/client/assets/{empty-state-C-U6aO8t.js → empty-state-0YsdRqeC.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-BTdYO2Ie.js → extract-connection-data-Cqk0dav8.js} +1 -1
  100. package/dist/client/assets/{file-explorer-ChVtqjrB.js → file-explorer-CPyGlTIu.js} +1 -1
  101. package/dist/client/assets/{file-type-icon-umbWZVCL.js → file-type-icon-Cx8Qfxs_.js} +1 -1
  102. package/dist/client/assets/{form-B913lxdw.js → form-Rig6qzpS.js} +1 -1
  103. package/dist/client/assets/{general-qD94BshC.js → general-CzagF8cJ.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-IkpFrAa4.js → github-repo-picker-cBARyZ_Y.js} +1 -1
  105. package/dist/client/assets/{hooks-DSQPS7ZB.js → hooks-BCqdQLfU.js} +1 -1
  106. package/dist/client/assets/{index-phl_pIXQ.js → index-BZMsOOVa.js} +1 -1
  107. package/dist/client/assets/{index-CqMFU0yP.js → index-BuHij7CO.js} +1 -1
  108. package/dist/client/assets/{index-BdXS1C_d.js → index-C5_Tr0Nb.js} +1 -1
  109. package/dist/client/assets/{index-nd630d8o.js → index-CuQo3lkY.js} +1 -1
  110. package/dist/client/assets/{index-D93sMh9L.js → index-CwzhtuKX.js} +1 -1
  111. package/dist/client/assets/{index-BbcBLfTr.js → index-D-T-hY6B.js} +1 -1
  112. package/dist/client/assets/index-DJP7bbyy.css +1 -0
  113. package/dist/client/assets/{index-BVax3vfK.js → index-DlxkR9hM.js} +1 -1
  114. package/dist/client/assets/{index-lvxbMBlt.js → index-TX8UkoDc.js} +55 -55
  115. package/dist/client/assets/{index-fAEWeRk2.js → index-mKK20WHA.js} +1 -1
  116. package/dist/client/assets/{index-D7ruAD9R.js → index-ok9NuJcw.js} +29 -29
  117. package/dist/client/assets/{index-redirect-PIoczkKB.js → index-redirect-BpH3KATs.js} +1 -1
  118. package/dist/client/assets/{input-BywtKe6R.js → input-JQPP3EQY.js} +1 -1
  119. package/dist/client/assets/{integration-icon-BDe33Str.js → integration-icon-CSuW0Kmb.js} +1 -1
  120. package/dist/client/assets/{invite-member-dialog-Cd1X6Vsw.js → invite-member-dialog-BJC7sMui.js} +1 -1
  121. package/dist/client/assets/{label-sPxTCHgi.js → label-BgAf5iSE.js} +1 -1
  122. package/dist/client/assets/{layout-DC7V__Wf.js → layout-CSN6Olpb.js} +1 -1
  123. package/dist/client/assets/{login-4F7Q4eab.js → login-CHixpOxb.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-CNM-bHuQ.js → mcp-oauth-BxZGlZ1j.js} +1 -1
  125. package/dist/client/assets/{members-DvnXbOrX.js → members-Br3ANmCo.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-5TGvXJMP.js → monaco-editor-DpwKi-Ez.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-BvX0Iwku.js → monitoring-stats-row-DlfZnqBB.js} +1 -1
  128. package/dist/client/assets/{multi-select-CfxNtheE.js → multi-select-D8fuM_Dw.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-Bkyx6a7J.js → oauth-callback-TXv8sX4O.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-ai-provider-CaAAAR6l.js → oauth-callback-ai-provider-B3KcVQvV.js} +1 -1
  131. package/dist/client/assets/onboarding-njhfy2kS.js +1 -0
  132. package/dist/client/assets/{org-layout-BwK5e6T_.js → org-layout-DlwARJSZ.js} +1 -1
  133. package/dist/client/assets/organization-choice-eOqeOTgR.js +1 -0
  134. package/dist/client/assets/{orgs-DFSwvs3E.js → orgs-BqSDwaw0.js} +1 -1
  135. package/dist/client/assets/{page-seo-form-CftmESyH.js → page-seo-form-CLznRWuQ.js} +1 -1
  136. package/dist/client/assets/{popover-DMey_8nq.js → popover-ANA17l1N.js} +1 -1
  137. package/dist/client/assets/{post-editor-Duz7yAQd.js → post-editor-DFsEyCvq.js} +1 -1
  138. package/dist/client/assets/{primitives-CYrbLQxI.js → primitives-D8DtUCc9.js} +1 -1
  139. package/dist/client/assets/{profile-CP1J74Pn.js → profile-CbczYJqb.js} +1 -1
  140. package/dist/client/assets/{project-app-view-hgruxcGv.js → project-app-view-CjG6-bFO.js} +1 -1
  141. package/dist/client/assets/record-editor-BJHlOLvO.js +1 -0
  142. package/dist/client/assets/redirect-editor-CbEQbFeF.js +1 -0
  143. package/dist/client/assets/registry-D01LAmOu.js +2 -0
  144. package/dist/client/assets/{registry-layout-BXgtH3-2.js → registry-layout-TcXeUoiT.js} +1 -1
  145. package/dist/client/assets/{reports-j4qlGGA1.js → reports-nV3K8xut.js} +1 -1
  146. package/dist/client/assets/{require-capability-BTVUJu40.js → require-capability-CAK5ssxe.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-D8pQ4hlg.js → required-auth-layout-BFc5VOdo.js} +1 -1
  148. package/dist/client/assets/{reset-password-uH2eEwS5.js → reset-password-ByEez6Ny.js} +1 -1
  149. package/dist/client/assets/{roles-CZj8iSpk.js → roles-3ceQ-bxQ.js} +1 -1
  150. package/dist/client/assets/{search-input-B0dv5yOL.js → search-input-Nwr77UCS.js} +1 -1
  151. package/dist/client/assets/{secrets-Bkf1kD0z.js → secrets-kXzScnTf.js} +1 -1
  152. package/dist/client/assets/{sections-editor-BVnK7z0H.js → sections-editor-DR7M6vNt.js} +1 -1
  153. package/dist/client/assets/{select-BpPnRSd-.js → select-Bvk7MfKx.js} +1 -1
  154. package/dist/client/assets/{select-model-DvmZyKHW.js → select-model-DWIKfANv.js} +1 -1
  155. package/dist/client/assets/self-tool-result-8HyDkuQv.js +1 -0
  156. package/dist/client/assets/{seo-editor-D6Qp5PAw.js → seo-editor-BTTxI9M-.js} +1 -1
  157. package/dist/client/assets/{settings-layout-BSj52fb7.js → settings-layout-DknD11fF.js} +1 -1
  158. package/dist/client/assets/{settings-section-CewjBJDd.js → settings-section-1oLLXagJ.js} +1 -1
  159. package/dist/client/assets/{shell-controls-UGsMszrT.js → shell-controls-6FVyoaOC.js} +1 -1
  160. package/dist/client/assets/{shell-layout-U1XEcaQb.js → shell-layout-BupsvGOi.js} +1 -1
  161. package/dist/client/assets/{sidebar-XtHztjYp.js → sidebar-BcCQis2L.js} +1 -1
  162. package/dist/client/assets/{skeleton-TYssXBL8.js → skeleton-_hFZXK39.js} +1 -1
  163. package/dist/client/assets/{spinner-BDArA5p5.js → spinner-C2Q5NLRi.js} +1 -1
  164. package/dist/client/assets/{sso-CEwCgILO.js → sso-CGJZBBPv.js} +1 -1
  165. package/dist/client/assets/{store-BAtC58cE.js → store-DY-i6CVT.js} +1 -1
  166. package/dist/client/assets/store-registry-BhDdpUUZ.js +2 -0
  167. package/dist/client/assets/{studio-tools-43YF_K-Q.js → studio-tools-DfKuGLE7.js} +1 -1
  168. package/dist/client/assets/{switch-COa2pVfk.js → switch-_y9TlFLi.js} +1 -1
  169. package/dist/client/assets/{synced-repos-BQu96mXT.js → synced-repos-Bi83HqP5.js} +1 -1
  170. package/dist/client/assets/{tab-id-D2hxEf3P.js → tab-id-DvxA9xv9.js} +1 -1
  171. package/dist/client/assets/{table-DPk5SmMs.js → table-DbWpkNmc.js} +1 -1
  172. package/dist/client/assets/{tabs-Y4Dxc2rR.js → tabs-D1ghcutN.js} +1 -1
  173. package/dist/client/assets/{textarea-BJCjQSy4.js → textarea-DqNYu9ZK.js} +1 -1
  174. package/dist/client/assets/{toggle-group-BaXRwZme.js → toggle-group-CU_Q9wTG.js} +1 -1
  175. package/dist/client/assets/{toolbar-WaysqEfz.js → toolbar-DfyVbnX8.js} +1 -1
  176. package/dist/client/assets/{tooltip-2La-f68Q.js → tooltip-zThj01Gf.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-kgciqmRs.js → use-ai-providers-CDkZNfYu.js} +1 -1
  178. package/dist/client/assets/{use-automations-DmPoIHA3.js → use-automations-DIsg-mj0.js} +1 -1
  179. package/dist/client/assets/{use-autosave-CT7wG3Qv.js → use-autosave-B539-Iwl.js} +1 -1
  180. package/dist/client/assets/{use-capability-DxrcT9AW.js → use-capability-BiyIKDOh.js} +1 -1
  181. package/dist/client/assets/{use-clock-tick-n9GtE0Cq.js → use-clock-tick-C2C8PMt_.js} +1 -1
  182. package/dist/client/assets/{use-connection-DNjvpsXX.js → use-connection-YzzOR0Ct.js} +1 -1
  183. package/dist/client/assets/{use-copy-DEnQ3bpL.js → use-copy-E8Z4OROr.js} +1 -1
  184. package/dist/client/assets/{use-create-virtual-mcp-BZMkd898.js → use-create-virtual-mcp-BKD2W9DG.js} +1 -1
  185. package/dist/client/assets/{use-debounced-autosave-Blzii2X5.js → use-debounced-autosave-DBAbG8aO.js} +1 -1
  186. package/dist/client/assets/{use-debounced-value-C2tRwl1G.js → use-debounced-value-Bw1cx2A7.js} +1 -1
  187. package/dist/client/assets/use-deco-credits-VT--W0kt.js +1 -0
  188. package/dist/client/assets/{use-decopilot-events-DgBVDXYP.js → use-decopilot-events-Bja0B28s.js} +1 -1
  189. package/dist/client/assets/{use-delete-connection-xxYRBi8p.js → use-delete-connection-DWwORmBL.js} +1 -1
  190. package/dist/client/assets/{use-deployment-admin-CTV5HKPv.js → use-deployment-admin-CkKA6urG.js} +1 -1
  191. package/dist/client/assets/{use-file-configs-SWRAWh_l.js → use-file-configs-Brx1-Uvm.js} +1 -1
  192. package/dist/client/assets/{use-infinite-scroll-CGISYIMq.js → use-infinite-scroll-zj5ct46-.js} +1 -1
  193. package/dist/client/assets/{use-join-requests-CoVD6BOS.js → use-join-requests-Vel3pjsd.js} +1 -1
  194. package/dist/client/assets/{use-mcp-client-B5b37aiu.js → use-mcp-client-DYojHZ-i.js} +1 -1
  195. package/dist/client/assets/{use-mcp-tools-DD2MmEqL.js → use-mcp-tools-DSV3V5XT.js} +1 -1
  196. package/dist/client/assets/{use-members-DzkjUoJV.js → use-members-kfjccoLo.js} +1 -1
  197. package/dist/client/assets/{use-mobile-CT3yU0Mk.js → use-mobile-BDrP2eQf.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-DpmJRDSG.js → use-navigate-to-agent-DWJIFn-U.js} +1 -1
  199. package/dist/client/assets/{use-open-billing-url-BsBXjjlS.js → use-open-billing-url-zkkAt3Xa.js} +1 -1
  200. package/dist/client/assets/{use-org-auth-client-Bo-CO3rH.js → use-org-auth-client-Blkf0oAf.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-Dzy04a3G.js → use-org-sso-BL3GsPAR.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-DGOLTZKh.js → use-organization-roles-CKV3Jlgy.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-BSdKLcGF.js → use-organization-settings-B4nPAvMF.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-BJ91vRwf.js → use-registry-connections-DHIfDoXy.js} +1 -1
  205. package/dist/client/assets/{use-secrets-DdHTSlNZ.js → use-secrets-CEiI3eff.js} +1 -1
  206. package/dist/client/assets/{use-section-preview-base-BhwwAIIj.js → use-section-preview-base-B18arNxP.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-6JeLPtQS.js → use-status-sounds-CAXZooMN.js} +1 -1
  208. package/dist/client/assets/{use-tags-C4qTyTIP.js → use-tags-K-1ePwAE.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-a2V8IUPD.js → use-view-mode-Br2S-rPx.js} +1 -1
  210. package/dist/client/assets/use-virtual-mcp-CpFoSCpU.js +1 -0
  211. package/dist/client/assets/useInfiniteQuery-Bu3cgth4.js +1 -0
  212. package/dist/client/assets/{useRouterState-CPf57-wY.js → useRouterState-CXd2RHSC.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-CTrP0HMd.js +1 -0
  214. package/dist/client/assets/{users-qSQTwwCC.js → users-CeNUESqE.js} +1 -1
  215. package/dist/client/assets/{variant-calendar-CW881-GE.js → variant-calendar-DedCkW7C.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-CAlt97wR.js → view-mode-toggle-EcFxik9Y.js} +1 -1
  217. package/dist/client/index.html +2 -2
  218. package/dist/server/cli.js +1 -1
  219. package/dist/server/server.js +1 -1
  220. package/package.json +1 -1
  221. package/dist/client/assets/commerce-onboarding-BcbHBN76.js +0 -1
  222. package/dist/client/assets/index-DXMTUPM-.css +0 -1
  223. package/dist/client/assets/onboarding-CQGDI3Bm.js +0 -1
  224. package/dist/client/assets/organization-choice-BRJ5bOuv.js +0 -1
  225. package/dist/client/assets/record-editor-DpRInA4u.js +0 -1
  226. package/dist/client/assets/redirect-editor-WxghSLXV.js +0 -1
  227. package/dist/client/assets/registry-ClpCJTmQ.js +0 -2
  228. package/dist/client/assets/self-tool-result-DPsJP5SW.js +0 -1
  229. package/dist/client/assets/store-registry-CRuDI2z7.js +0 -2
  230. package/dist/client/assets/use-deco-credits-DQwVauly.js +0 -1
  231. package/dist/client/assets/use-virtual-mcp-D1c8M1hh.js +0 -1
  232. package/dist/client/assets/useInfiniteQuery-ueeYN8M9.js +0 -1
  233. package/dist/client/assets/useSuspenseInfiniteQuery-CLfnZXXY.js +0 -1
@@ -1,4 +1,4 @@
1
- import{db as fe,dc as pe,dd as me,cg as _e,de as ge,bU as _,bV as w,df as we,dg as Te,dh as ye,di as $,dj as ve,dk as V,dl as ke,dm as M,dn as Se,dp as G,dq as Re,dr as Ce,ds as Ee,dt as K,bx as be,bz as Ie,bu as Ae,cb as re,cn as qe,ct as Me,cr as Pe,cE as Oe,du as $e,dv as Ne,dw as N,dx as He,dy as Ue,cs as De,co as xe,cp as je,cq as Le,bv as Fe,dz as Ve,dA as Ge,dB as ze,ci as Qe,dC as We,dD as Ke,cA as D,dE as Je,bt as j,c as oe,x as ae,K as Q}from"./index-D7ruAD9R.js";import{U as P,a as H,e as J}from"./auth-CgC0zRiu.js";const qt={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`,COMMERCE_DISCOVERY:a=>`${a}_commerce-discovery`},Mt="get_my_diagnostic",Pt="https://github.com/decocms.png",Ye="self";function R(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function Be(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null,...a.ui?{ui:a.ui}:{}},pinned:!1,connections:[]}}const ne=R("decopilot_"),Ot=ne.is,Ze=ne.get,ie=R("dev_"),$t=ie.get,Nt=ie.is,Xe="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",et="#f59e0b",Ht=`https://api.iconify.design/lucide:bug.svg?color=${encodeURIComponent(et)}`,tt="#6366f1",Ut=`https://api.iconify.design/lucide:file-search.svg?color=${encodeURIComponent(tt)}`;function Dt(a){return Be({id:Ze(a),organizationId:a,title:"Super Agent",description:"Default agent that aggregates all organization connections",icon:Xe,ui:{layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}})}const st=R("commerce-discovery_"),xt=st.get,C={AGENT_MANAGER:R("studio-agent-manager_"),AUTOMATION_MANAGER:R("studio-automation-manager_"),CONNECTION_MANAGER:R("studio-connection-manager_"),API_KEY_MANAGER:R("studio-api-key-manager_"),STORE_MANAGER:R("studio-store-manager_"),BRAND_MANAGER:R("studio-brand-manager_"),TASK_MANAGER:R("studio-task-manager_"),USAGE_MANAGER:R("studio-usage-manager_")},jt={AGENT_MANAGER:C.AGENT_MANAGER.get,AUTOMATION_MANAGER:C.AUTOMATION_MANAGER.get,CONNECTION_MANAGER:C.CONNECTION_MANAGER.get,API_KEY_MANAGER:C.API_KEY_MANAGER.get,STORE_MANAGER:C.STORE_MANAGER.get,BRAND_MANAGER:C.BRAND_MANAGER.get,TASK_MANAGER:C.TASK_MANAGER.get,USAGE_MANAGER:C.USAGE_MANAGER.get};function Lt(a){return a?Object.values(C).some(e=>e.is(a)!==null):!1}function x(a){return!!a._zod}function b(a,e){return x(a)?fe(a,e):a.safeParse(e)}function ce(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 rt(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 I(a){return a==="completed"||a==="failed"||a==="cancelled"}function Y(a){const t=ce(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=rt(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const ot=6e4;class at{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(pe,t=>{this._oncancel(t)}),this.setNotificationHandler(me,t=>{this._onprogress(t)}),this.setRequestHandler(_e,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ge,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(we,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(w.InvalidParams,`Task not found: ${o}`);if(!I(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(I(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[M]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(Te,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 _(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(ye,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(I(r.status))throw new _(w.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 _(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(w.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),$(o)||ve(o)?this._onresponse(o):V(o)?this._onrequest(o,n):ke(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(w.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?.[M]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Se(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(w.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),$(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if($(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),$(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,G,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},I(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(w.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[M]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const g=c instanceof _?c:new _(w.RequestTimeout,String(c));l(g)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const g=b(t,c.result);g.success?p(g.data):l(g.error)}catch(g){l(g)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??ot,v=()=>T(_.fromError(w.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,v,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=g=>{const k=this._responseHandlers.get(f);k?k(g):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(g=>{this._cleanupTimeout(f),l(g)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Re,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},Ce,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Ee,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||{},[M]: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||{},[M]: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||{},[M]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=Y(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=Y(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&V(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(w.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 _(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(w.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 _(w.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=K.parse({method:"notifications/tasks/status",params:i});await this.notification(u),I(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 _(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(I(i.status))throw new _(w.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=K.parse({method:"notifications/tasks/status",params:u});await this.notification(p),I(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function nt(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var it=Ie();const ct=be(it);function lt(){const a=new ct({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ae(a),a}class ut{constructor(e){this._ajv=e??lt()}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 dt{constructor(e){this._client=e}async*callToolStream(e,t=re,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 _(w.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 _(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(w.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 ht(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 ft(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 U(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&&U(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&U(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&U(t,e)}}function pt(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 mt=class extends at{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 ut,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",qe,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Me,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Pe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new dt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=nt(this._capabilities,e)}setRequestHandler(e,t){const r=ce(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(Ge,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=pt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(w.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(w.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(G,T);if(!c.success){const g=c.error instanceof Error?c.error.message:String(c.error);throw new _(w.InvalidParams,`Invalid task creation result: ${g}`)}return c.data}const y=b(ze,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&v.action==="accept"&&v.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{U(h,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Qe,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const v=b(G,f);if(!v.success){const h=v.error instanceof Error?v.error.message:String(v.error);throw new _(w.InvalidParams,`Invalid task creation result: ${h}`)}return v.data}const T=d.tools||d.toolChoice?We:Ke,y=b(T,f);if(!y.success){const v=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid sampling result: ${v}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Oe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Ne.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){ht(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ft(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},N,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},He,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},N,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ue,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},De,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},je,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Le,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},N,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},N,t)}async callTool(e,t=re,s){if(this.isToolTaskRequired(e.name))throw new _(w.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 _(w.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 _(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(w.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},Fe,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ve.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const L=a=>[{type:"text",text:a}];function _t(a){const e=D(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:L(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:L(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:L(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 z(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function gt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...z(e.headers),...z(s.headers)}:e.headers};return a(t,r)}:a}class X 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 ee=10,wt=13,A=32;function F(a){}function Tt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const k=f(h);k!==""&&o.push(k);return}if(h.indexOf(`
1
+ import{db as fe,dc as pe,dd as me,cg as _e,de as ge,bU as _,bV as w,df as we,dg as Te,dh as ye,di as $,dj as ve,dk as V,dl as ke,dm as M,dn as Se,dp as G,dq as Re,dr as Ce,ds as Ee,dt as K,bx as be,bz as Ie,bu as Ae,cb as re,cn as qe,ct as Me,cr as Pe,cE as Oe,du as $e,dv as Ne,dw as N,dx as He,dy as Ue,cs as De,co as xe,cp as je,cq as Le,bv as Fe,dz as Ve,dA as Ge,dB as ze,ci as Qe,dC as We,dD as Ke,cA as D,dE as Je,bt as j,c as oe,x as ae,K as Q}from"./index-ok9NuJcw.js";import{U as P,a as H,e as J}from"./auth-Dhov-tCz.js";const qt={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`,COMMERCE_DISCOVERY:a=>`${a}_commerce-discovery`},Mt="get_my_diagnostic",Pt="https://github.com/decocms.png",Ye="self";function R(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function Be(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null,...a.ui?{ui:a.ui}:{}},pinned:!1,connections:[]}}const ne=R("decopilot_"),Ot=ne.is,Ze=ne.get,ie=R("dev_"),$t=ie.get,Nt=ie.is,Xe="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",et="#f59e0b",Ht=`https://api.iconify.design/lucide:bug.svg?color=${encodeURIComponent(et)}`,tt="#6366f1",Ut=`https://api.iconify.design/lucide:file-search.svg?color=${encodeURIComponent(tt)}`;function Dt(a){return Be({id:Ze(a),organizationId:a,title:"Super Agent",description:"Default agent that aggregates all organization connections",icon:Xe,ui:{layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}})}const st=R("commerce-discovery_"),xt=st.get,C={AGENT_MANAGER:R("studio-agent-manager_"),AUTOMATION_MANAGER:R("studio-automation-manager_"),CONNECTION_MANAGER:R("studio-connection-manager_"),API_KEY_MANAGER:R("studio-api-key-manager_"),STORE_MANAGER:R("studio-store-manager_"),BRAND_MANAGER:R("studio-brand-manager_"),TASK_MANAGER:R("studio-task-manager_"),USAGE_MANAGER:R("studio-usage-manager_")},jt={AGENT_MANAGER:C.AGENT_MANAGER.get,AUTOMATION_MANAGER:C.AUTOMATION_MANAGER.get,CONNECTION_MANAGER:C.CONNECTION_MANAGER.get,API_KEY_MANAGER:C.API_KEY_MANAGER.get,STORE_MANAGER:C.STORE_MANAGER.get,BRAND_MANAGER:C.BRAND_MANAGER.get,TASK_MANAGER:C.TASK_MANAGER.get,USAGE_MANAGER:C.USAGE_MANAGER.get};function Lt(a){return a?Object.values(C).some(e=>e.is(a)!==null):!1}function x(a){return!!a._zod}function b(a,e){return x(a)?fe(a,e):a.safeParse(e)}function ce(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 rt(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 I(a){return a==="completed"||a==="failed"||a==="cancelled"}function Y(a){const t=ce(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=rt(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const ot=6e4;class at{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(pe,t=>{this._oncancel(t)}),this.setNotificationHandler(me,t=>{this._onprogress(t)}),this.setRequestHandler(_e,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ge,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(we,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(w.InvalidParams,`Task not found: ${o}`);if(!I(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(I(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[M]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(Te,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 _(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(ye,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(I(r.status))throw new _(w.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 _(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(w.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),$(o)||ve(o)?this._onresponse(o):V(o)?this._onrequest(o,n):ke(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(w.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?.[M]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Se(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(w.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),$(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if($(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),$(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,G,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},I(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(w.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[M]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const g=c instanceof _?c:new _(w.RequestTimeout,String(c));l(g)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const g=b(t,c.result);g.success?p(g.data):l(g.error)}catch(g){l(g)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??ot,v=()=>T(_.fromError(w.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,v,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=g=>{const k=this._responseHandlers.get(f);k?k(g):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(g=>{this._cleanupTimeout(f),l(g)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Re,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},Ce,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Ee,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||{},[M]: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||{},[M]: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||{},[M]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=Y(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=Y(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&V(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(w.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 _(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(w.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 _(w.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=K.parse({method:"notifications/tasks/status",params:i});await this.notification(u),I(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 _(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(I(i.status))throw new _(w.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=K.parse({method:"notifications/tasks/status",params:u});await this.notification(p),I(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function nt(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var it=Ie();const ct=be(it);function lt(){const a=new ct({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ae(a),a}class ut{constructor(e){this._ajv=e??lt()}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 dt{constructor(e){this._client=e}async*callToolStream(e,t=re,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 _(w.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 _(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(w.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 ht(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 ft(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 U(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&&U(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&U(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&U(t,e)}}function pt(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 mt=class extends at{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 ut,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",qe,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Me,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Pe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new dt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=nt(this._capabilities,e)}setRequestHandler(e,t){const r=ce(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(Ge,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=pt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(w.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(w.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(G,T);if(!c.success){const g=c.error instanceof Error?c.error.message:String(c.error);throw new _(w.InvalidParams,`Invalid task creation result: ${g}`)}return c.data}const y=b(ze,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&v.action==="accept"&&v.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{U(h,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Qe,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const v=b(G,f);if(!v.success){const h=v.error instanceof Error?v.error.message:String(v.error);throw new _(w.InvalidParams,`Invalid task creation result: ${h}`)}return v.data}const T=d.tools||d.toolChoice?We:Ke,y=b(T,f);if(!y.success){const v=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid sampling result: ${v}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Oe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Ne.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){ht(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ft(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},N,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},He,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},N,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ue,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},De,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},je,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Le,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},N,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},N,t)}async callTool(e,t=re,s){if(this.isToolTaskRequired(e.name))throw new _(w.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 _(w.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 _(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(w.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},Fe,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ve.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const L=a=>[{type:"text",text:a}];function _t(a){const e=D(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:L(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:L(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:L(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 z(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function gt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...z(e.headers),...z(s.headers)}:e.headers};return a(t,r)}:a}class X 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 ee=10,wt=13,A=32;function F(a){}function Tt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const k=f(h);k!==""&&o.push(k);return}if(h.indexOf(`
2
2
  `)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const g=f(c);g!==""&&o.push(g)}function f(h){let c=0;if(h.indexOf("\r")===-1){let g=h.indexOf(`
3
3
  `,c);for(;g!==-1;){if(c===g){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=g+1,g=h.indexOf(`
4
4
  `,c);continue}const k=h.charCodeAt(c);if(te(h,c,k)){const S=h.charCodeAt(c+5)===A?c+6:c+5,E=h.slice(S,g);if(p===0&&h.charCodeAt(g+1)===ee){e({id:i,event:l,data:E}),i=void 0,u="",l=void 0,c=g+2,g=h.indexOf(`
@@ -1 +1 @@
1
- import{c as m,n as p,x as q,K as T}from"./index-D7ruAD9R.js";function C(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],q(i)}function K(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],p(i)}function O(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
1
+ import{c as m,n as p,x as q,K as T}from"./index-ok9NuJcw.js";function C(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],q(i)}function K(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],p(i)}function O(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
@@ -1 +1 @@
1
- import{c,F as m,x as b,n as M,K as f}from"./index-D7ruAD9R.js";import{u as y}from"./use-org-auth-client-Bo-CO3rH.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
1
+ import{c,F as m,x as b,n as M,K as f}from"./index-ok9NuJcw.js";import{u as y}from"./use-org-auth-client-Blkf0oAf.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{c as m,r}from"./index-D7ruAD9R.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
1
+ import{c as m,r}from"./index-ok9NuJcw.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
@@ -1 +1 @@
1
- import{G as y,r as c,c as b,j as A,d as C,F as E,a as $}from"./index-D7ruAD9R.js";import{a as _}from"./use-virtual-mcp-D1c8M1hh.js";import{c as G}from"./hooks-DSQPS7ZB.js";import{f as P}from"./reusable-new-chat-CouMjkYR.js";const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function w(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(s=>typeof s=="string"):[]}catch{return[]}}function N(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function U(e){const t=I(e),r=h.get(t);if(r)return r;const s=y.sidebarGroupOrder(e.orgId,e.userId);let a=!1;try{a=localStorage.getItem(s)!==null}catch{}let o=O(s);if(!a&&o.length===0&&e.userId!=="anon"){const i=O(w(e.orgId));i.length>0&&(o=i)}return h.set(t,o),o}function T(e,t){const r=new Set(t);return U(e).filter(s=>!r.has(s))}function j(e,t){h.set(I(e),t),N(y.sidebarGroupOrder(e.orgId,e.userId),t)}function K(e,t,r=[]){if(r.includes(t))return;const s=T(e,r);s.includes(t)||j(e,[t,...s])}const S=c.createContext(null);function Q(e){const t=b.c(7),{children:r}=e,[s,a]=c.useState(!1),[o,i]=c.useState(0);let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i(k),t[0]=d):d=t[0];const l=d;let n;t[1]!==s||t[2]!==o?(n={empty:s,setEmpty:a,orderRevision:o,bumpOrderRevision:l},t[1]=s,t[2]=o,t[3]=n):n=t[3];let u;return t[4]!==r||t[5]!==n?(u=A.jsx(S.Provider,{value:n,children:r}),t[4]=r,t[5]=n,t[6]=u):u=t[6],u}function k(e){return e+1}function W(){return c.useContext(S)?.empty??!1}function D(){return c.useContext(S)?.bumpOrderRevision??J}function J(){}const v=[],L=()=>()=>{};function B(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=b.c(15),t=C(),{org:r}=E(),s=_(),{data:a}=$.useSession(),o=a?.user?.id??"anon";let i;e[0]!==s?(i=B(s),e[0]=s,e[1]=i):i=e[1];const d=i,l=D(),n=G();let u;e[2]!==n?.threads.get?(u=n?.threads.get??H,e[2]=n?.threads.get,e[3]=u):u=e[3];let f;e[4]!==n?.threads.get?(f=n?.threads.get??F,e[4]=n?.threads.get,e[5]=f):f=e[5];const m=c.useSyncExternalStore(n?.threads.subscribe??L,u,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==d||e[11]!==a?.user?.id||e[12]!==o||e[13]!==m?(g=(p,x)=>{K({orgId:r.id,userId:o},p,d),l();const R=P(m,p,a?.user?.id)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=d,e[11]=a?.user?.id,e[12]=o,e[13]=m,e[14]=g):g=e[14],g}function F(){return v}function H(){return v}export{Q as S,D as a,K as b,X as c,B as g,W as u};
1
+ import{G as y,r as c,c as b,j as A,d as C,F as E,a as $}from"./index-ok9NuJcw.js";import{a as _}from"./use-virtual-mcp-CpFoSCpU.js";import{c as G}from"./hooks-BCqdQLfU.js";import{f as P}from"./reusable-new-chat-CouMjkYR.js";const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function w(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(s=>typeof s=="string"):[]}catch{return[]}}function N(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function U(e){const t=I(e),r=h.get(t);if(r)return r;const s=y.sidebarGroupOrder(e.orgId,e.userId);let a=!1;try{a=localStorage.getItem(s)!==null}catch{}let o=O(s);if(!a&&o.length===0&&e.userId!=="anon"){const i=O(w(e.orgId));i.length>0&&(o=i)}return h.set(t,o),o}function T(e,t){const r=new Set(t);return U(e).filter(s=>!r.has(s))}function j(e,t){h.set(I(e),t),N(y.sidebarGroupOrder(e.orgId,e.userId),t)}function K(e,t,r=[]){if(r.includes(t))return;const s=T(e,r);s.includes(t)||j(e,[t,...s])}const S=c.createContext(null);function Q(e){const t=b.c(7),{children:r}=e,[s,a]=c.useState(!1),[o,i]=c.useState(0);let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i(k),t[0]=d):d=t[0];const l=d;let n;t[1]!==s||t[2]!==o?(n={empty:s,setEmpty:a,orderRevision:o,bumpOrderRevision:l},t[1]=s,t[2]=o,t[3]=n):n=t[3];let u;return t[4]!==r||t[5]!==n?(u=A.jsx(S.Provider,{value:n,children:r}),t[4]=r,t[5]=n,t[6]=u):u=t[6],u}function k(e){return e+1}function W(){return c.useContext(S)?.empty??!1}function D(){return c.useContext(S)?.bumpOrderRevision??J}function J(){}const v=[],L=()=>()=>{};function B(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=b.c(15),t=C(),{org:r}=E(),s=_(),{data:a}=$.useSession(),o=a?.user?.id??"anon";let i;e[0]!==s?(i=B(s),e[0]=s,e[1]=i):i=e[1];const d=i,l=D(),n=G();let u;e[2]!==n?.threads.get?(u=n?.threads.get??H,e[2]=n?.threads.get,e[3]=u):u=e[3];let f;e[4]!==n?.threads.get?(f=n?.threads.get??F,e[4]=n?.threads.get,e[5]=f):f=e[5];const m=c.useSyncExternalStore(n?.threads.subscribe??L,u,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==d||e[11]!==a?.user?.id||e[12]!==o||e[13]!==m?(g=(p,x)=>{K({orgId:r.id,userId:o},p,d),l();const R=P(m,p,a?.user?.id)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=d,e[11]=a?.user?.id,e[12]=o,e[13]=m,e[14]=g):g=e[14],g}function F(){return v}function H(){return v}export{Q as S,D as a,K as b,X as c,B as g,W as u};
@@ -1 +1 @@
1
- import{c,b as l,e as p,t as f}from"./index-D7ruAD9R.js";import{u as m}from"./studio-tools-43YF_K-Q.js";function b(n,r){const t=c.c(9),u=m(),i=l();let e;t[0]!==u||t[1]!==n?(e=async()=>{const{url:a}=await u.call(n,{});return a},t[0]=u,t[1]=n,t[2]=e):e=t[2];let s;t[3]!==r||t[4]!==i?(s=a=>f.error(i(r,{message:a.message})),t[3]=r,t[4]=i,t[5]=s):s=t[5];let o;return t[6]!==e||t[7]!==s?(o={mutationFn:e,onSuccess:d,onError:s},t[6]=e,t[7]=s,t[8]=o):o=t[8],p(o)}function d(n){return window.open(n,"_blank","noopener,noreferrer")}export{b as u};
1
+ import{c,b as l,e as p,t as f}from"./index-ok9NuJcw.js";import{u as m}from"./studio-tools-DfKuGLE7.js";function b(n,r){const t=c.c(9),u=m(),i=l();let e;t[0]!==u||t[1]!==n?(e=async()=>{const{url:a}=await u.call(n,{});return a},t[0]=u,t[1]=n,t[2]=e):e=t[2];let s;t[3]!==r||t[4]!==i?(s=a=>f.error(i(r,{message:a.message})),t[3]=r,t[4]=i,t[5]=s):s=t[5];let o;return t[6]!==e||t[7]!==s?(o={mutationFn:e,onSuccess:d,onError:s},t[6]=e,t[7]=s,t[8]=o):o=t[8],p(o)}function d(n){return window.open(n,"_blank","noopener,noreferrer")}export{b as u};
@@ -1 +1 @@
1
- import{c as x,F as j,a as i}from"./index-D7ruAD9R.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,F as j,a as i}from"./index-ok9NuJcw.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 +1 @@
1
- import{c as u,n as S,o as r,e as y,K as c}from"./index-D7ruAD9R.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
1
+ import{c as u,n as S,o as r,e as y,K as c}from"./index-ok9NuJcw.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-Bo-CO3rH.js";import{F as b,n as P,K as y}from"./index-D7ruAD9R.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
1
+ import{u as R}from"./use-org-auth-client-Blkf0oAf.js";import{F as b,n as P,K as y}from"./index-ok9NuJcw.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
@@ -1 +1 @@
1
- import{c as l,F as y,n as E,K as _,o as I,e as M,r as R}from"./index-D7ruAD9R.js";import{W as D}from"./use-mcp-client-B5b37aiu.js";import{c as b,u as G}from"./studio-tools-43YF_K-Q.js";const O={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function $(t,e){return{queryKey:_.organizationSettings(e),queryFn:async()=>{try{return await b(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...O,organizationId:e}}},staleTime:6e4}}function m(t){const e=l.c(6),{org:s}=y();let n;e[0]!==s.id||e[1]!==s.slug?(n=$(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let a;return e[3]!==n||e[4]!==i?(a={...n,select:i},e[3]=n,e[4]=i,e[5]=a):a=e[5],E(a)}function Z(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=$(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=E(n);return i??null}function f(){const t=l.c(9),{org:e}=y(),s=G(),n=I();let i;t[0]!==e||t[1]!==s?(i=async r=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...r});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=i):i=t[2];let a;t[3]!==e||t[4]!==n?(a=r=>{n.setQueryData(_.organizationSettings(e.id),o=>({...o??O,...r}))},t[3]=e,t[4]=n,t[5]=a):a=t[5];let u;return t[6]!==i||t[7]!==a?(u={mutationFn:i,onSuccess:a},t[6]=i,t[7]=a,t[8]=u):u=t[8],M(u)}function P(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:N}function j(){const{data:t}=m(Q);return t??N}function Q(t){return P(t.simple_mode)}function B(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({simple_mode:a},u),n=(a,u)=>e.mutateAsync({simple_mode:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function L(){return C("reports_only")}function C(t){const e=l.c(2);let s;e[0]!==t?(s=i=>i.flags?.[t]??!1,e[0]=t,e[1]=s):s=e[1];const{data:n}=m(s);return n??!1}function v(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u,r)=>e.mutate({flags:{[a]:u}},r),n=(a,u,r)=>e.mutateAsync({flags:{[a]:u}},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function k(){const{data:t}=m(x);return t??null}function x(t){return t.registry_config}function J(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({registry_config:a},u),n=(a,u)=>e.mutateAsync({registry_config:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function V(){const{data:t}=m(U);return t??null}function U(t){return t.default_home_agents}function q(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({default_home_agents:a},u),n=(a,u)=>e.mutateAsync({default_home_agents:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function X(){const t=l.c(14),{org:e}=y(),s=q(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const a=R.useRef(i);let u;t[1]!==e.id?(u=_.organizationSettings(e.id),t[1]=e.id,t[2]=u):u=t[2];const r=u;let o;t[3]!==r||t[4]!==n?(o=()=>n.getQueryData(r)?.default_home_agents?.ids??[],t[3]=r,t[4]=n,t[5]=o):o=t[5];const p=o;let g;t[6]!==r||t[7]!==e.slug||t[8]!==n||t[9]!==s?(g=w=>{const S=a.current.then(async()=>{const T=n.getQueryData(r),A=w(T?.default_home_agents?.ids??[]);if(A!==null){n.setQueryData(r,c=>c&&{...c,default_home_agents:{ids:A}});try{await s.mutateAsync({ids:A}),await n.refetchQueries({queryKey:_.homeNextActions(e.slug),type:"active"})}catch(c){const z=c;throw n.setQueryData(r,T),z}}});return a.current=S.catch(F),S},t[6]=r,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=g):g=t[10];const h=g;let d;return t[11]!==h||t[12]!==p?(d={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=d):d=t[13],d}function F(){}function tt(){const t=l.c(3),{data:e,isPending:s}=m(K),n=e??null;let i;return t[0]!==s||t[1]!==n?(i={mainAgentId:n,isPending:s},t[0]=s,t[1]=n,t[2]=i):i=t[2],i}function K(t){return t.main_agent_id??null}function et(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({main_agent_id:a},u),n=(a,u)=>e.mutateAsync({main_agent_id:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function nt(){const t=l.c(5),{org:e}=y(),s=k();let n;t[0]!==e.id?(n=D.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let a;return t[2]!==i||t[3]!==s?(a=u=>{if(!s)return u===i;const r=s.registries[u];return r?r.enabled:u===i},t[2]=i,t[3]=s,t[4]=a):a=t[4],a}export{L as a,j as b,V as c,X as d,tt as e,nt as f,Z as g,et as h,v as i,B as j,k,J as l,C as u};
1
+ import{c as l,F as y,n as E,K as _,o as I,e as M,r as R}from"./index-ok9NuJcw.js";import{W as D}from"./use-mcp-client-DYojHZ-i.js";import{c as b,u as G}from"./studio-tools-DfKuGLE7.js";const O={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function $(t,e){return{queryKey:_.organizationSettings(e),queryFn:async()=>{try{return await b(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...O,organizationId:e}}},staleTime:6e4}}function m(t){const e=l.c(6),{org:s}=y();let n;e[0]!==s.id||e[1]!==s.slug?(n=$(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let a;return e[3]!==n||e[4]!==i?(a={...n,select:i},e[3]=n,e[4]=i,e[5]=a):a=e[5],E(a)}function Z(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=$(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=E(n);return i??null}function f(){const t=l.c(9),{org:e}=y(),s=G(),n=I();let i;t[0]!==e||t[1]!==s?(i=async r=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...r});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=i):i=t[2];let a;t[3]!==e||t[4]!==n?(a=r=>{n.setQueryData(_.organizationSettings(e.id),o=>({...o??O,...r}))},t[3]=e,t[4]=n,t[5]=a):a=t[5];let u;return t[6]!==i||t[7]!==a?(u={mutationFn:i,onSuccess:a},t[6]=i,t[7]=a,t[8]=u):u=t[8],M(u)}function P(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:N}function j(){const{data:t}=m(Q);return t??N}function Q(t){return P(t.simple_mode)}function B(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({simple_mode:a},u),n=(a,u)=>e.mutateAsync({simple_mode:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function L(){return C("reports_only")}function C(t){const e=l.c(2);let s;e[0]!==t?(s=i=>i.flags?.[t]??!1,e[0]=t,e[1]=s):s=e[1];const{data:n}=m(s);return n??!1}function v(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u,r)=>e.mutate({flags:{[a]:u}},r),n=(a,u,r)=>e.mutateAsync({flags:{[a]:u}},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function k(){const{data:t}=m(x);return t??null}function x(t){return t.registry_config}function J(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({registry_config:a},u),n=(a,u)=>e.mutateAsync({registry_config:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function V(){const{data:t}=m(U);return t??null}function U(t){return t.default_home_agents}function q(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({default_home_agents:a},u),n=(a,u)=>e.mutateAsync({default_home_agents:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function X(){const t=l.c(14),{org:e}=y(),s=q(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const a=R.useRef(i);let u;t[1]!==e.id?(u=_.organizationSettings(e.id),t[1]=e.id,t[2]=u):u=t[2];const r=u;let o;t[3]!==r||t[4]!==n?(o=()=>n.getQueryData(r)?.default_home_agents?.ids??[],t[3]=r,t[4]=n,t[5]=o):o=t[5];const p=o;let g;t[6]!==r||t[7]!==e.slug||t[8]!==n||t[9]!==s?(g=w=>{const S=a.current.then(async()=>{const T=n.getQueryData(r),A=w(T?.default_home_agents?.ids??[]);if(A!==null){n.setQueryData(r,c=>c&&{...c,default_home_agents:{ids:A}});try{await s.mutateAsync({ids:A}),await n.refetchQueries({queryKey:_.homeNextActions(e.slug),type:"active"})}catch(c){const z=c;throw n.setQueryData(r,T),z}}});return a.current=S.catch(F),S},t[6]=r,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=g):g=t[10];const h=g;let d;return t[11]!==h||t[12]!==p?(d={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=d):d=t[13],d}function F(){}function tt(){const t=l.c(3),{data:e,isPending:s}=m(K),n=e??null;let i;return t[0]!==s||t[1]!==n?(i={mainAgentId:n,isPending:s},t[0]=s,t[1]=n,t[2]=i):i=t[2],i}function K(t){return t.main_agent_id??null}function et(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({main_agent_id:a},u),n=(a,u)=>e.mutateAsync({main_agent_id:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function nt(){const t=l.c(5),{org:e}=y(),s=k();let n;t[0]!==e.id?(n=D.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let a;return t[2]!==i||t[3]!==s?(a=u=>{if(!s)return u===i;const r=s.registries[u];return r?r.enabled:u===i},t[2]=i,t[3]=s,t[4]=a):a=t[4],a}export{L as a,j as b,V as c,X as d,tt as e,nt as f,Z as g,et as h,v as i,B as j,k,J as l,C as u};
@@ -1 +1 @@
1
- import{c as C,F as R}from"./index-D7ruAD9R.js";import{u as p}from"./use-connection-DNjvpsXX.js";import{W as a}from"./use-mcp-client-B5b37aiu.js";import{k as y}from"./use-organization-settings-BSdKLcGF.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
1
+ import{c as C,F as R}from"./index-ok9NuJcw.js";import{u as p}from"./use-connection-YzzOR0Ct.js";import{W as a}from"./use-mcp-client-DYojHZ-i.js";import{k as y}from"./use-organization-settings-B4nPAvMF.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
@@ -1 +1 @@
1
- import{c as r,F as a,K as c,x as y,o as d,e as S}from"./index-D7ruAD9R.js";import{u as l}from"./studio-tools-43YF_K-Q.js";function C(){const e=r.c(7),{org:i}=a(),u=l();let o;e[0]!==i.id?(o=c.secrets(i.id),e[0]=i.id,e[1]=o):o=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==o||e[5]!==t?(s={queryKey:o,staleTime:6e4,queryFn:t},e[4]=o,e[5]=t,e[6]=s):s=e[6];const{data:n}=y(s);return n.secrets}function p(){const e=r.c(8),{org:i}=a(),u=l(),o=d();let t;e[0]!==u?(t=async f=>await u.call("SECRET_CREATE",{...f}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==o?(s=()=>{o.invalidateQueries({queryKey:c.secrets(i.id)})},e[2]=i,e[3]=o,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{p as a,C as u};
1
+ import{c as r,F as a,K as c,x as y,o as d,e as S}from"./index-ok9NuJcw.js";import{u as l}from"./studio-tools-DfKuGLE7.js";function C(){const e=r.c(7),{org:i}=a(),u=l();let o;e[0]!==i.id?(o=c.secrets(i.id),e[0]=i.id,e[1]=o):o=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==o||e[5]!==t?(s={queryKey:o,staleTime:6e4,queryFn:t},e[4]=o,e[5]=t,e[6]=s):s=e[6];const{data:n}=y(s);return n.secrets}function p(){const e=r.c(8),{org:i}=a(),u=l(),o=d();let t;e[0]!==u?(t=async f=>await u.call("SECRET_CREATE",{...f}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==o?(s=()=>{o.invalidateQueries({queryKey:c.secrets(i.id)})},e[2]=i,e[3]=o,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{p as a,C as u};
@@ -1 +1 @@
1
- import{c as D,b as X,r as w,j as r,m as J}from"./index-D7ruAD9R.js";import{ad as _}from"./agent-icon-BypwlSQB.js";import{i as Y}from"./SearchMd-CUHSKZ0C.js";import{e as Z,d as ee,b as te,a as re}from"./dialog-BndOy54_.js";import{I as se}from"./input-BywtKe6R.js";import{K as le,L as oe,M as ie,N as K,O as ne,P as ae,Q as ce}from"./index-lvxbMBlt.js";import{u as fe}from"./use-virtual-mcp-D1c8M1hh.js";const de=12,z=new Set,q=new Set;function ue(){for(const s of q)s()}function me(s){return z.has(s)?!0:z.size>=de?!1:(z.add(s),!0)}function Q(s){z.delete(s)&&ue()}function ve(s){return q.add(s),()=>{q.delete(s)}}function pe(s,e){const t=w.useRef(!1),[a,c]=w.useState(!1),i=w.useRef(null),d=w.useRef(null),n=w.useRef(null),l=w.useRef(s);l.current=s;const[f]=w.useState(()=>{const o=()=>{n.current?.(),n.current=null},u=()=>t.current?!0:me(e)?(t.current=!0,c(!0),o(),!0):!1;return v=>{if(d.current=v,i.current&&(i.current.disconnect(),i.current=null),o(),!v){t.current&&(Q(e),t.current=!1,c(!1));return}queueMicrotask(()=>{if(d.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!n.current&&(n.current=ve(()=>{d.current===v&&u()}));return}o(),t.current&&(Q(e),t.current=!1,c(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),i.current=x})}});return{ref:f,iframeActive:a}}function xe(s){const e=D.c(8),{previewUrl:t,title:a,scrollRootRef:c,slotId:i}=s,{ref:d,iframeActive:n}=pe(c,i),[l,f]=w.useState(!1);let o;e[0]!==n||e[1]!==l||e[2]!==t||e[3]!==a?(o=n?r.jsxs(r.Fragment,{children:[!l&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${a}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>f(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=n,e[1]=l,e[2]=t,e[3]=a,e[4]=o):o=e[4];let u;return e[5]!==d||e[6]!==o?(u=r.jsx("div",{ref:d,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:o}),e[5]=d,e[6]=o,e[7]=u):u=e[7],u}function he(s){const e=D.c(26),{entry:t,previewUrl:a,scrollRootRef:c,onSelect:i}=s,d=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let n;e[0]!==d?(n=J("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",d),e[0]=d,e[1]=n):n=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==a||e[5]!==c?(l=r.jsx(xe,{previewUrl:a,title:t.title,scrollRootRef:c,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=a,e[5]=c,e[6]=l):l=e[6];let f;e[7]!==t.isSavedBlock?(f=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=f):f=e[8];let o;e[9]!==f?(o=r.jsx(_,{className:"h-4 w-4 shrink-0",style:f}),e[9]=f,e[10]=o):o=e[10];let u;e[11]!==t.title?(u=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=r.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==o||e[19]!==x?(m=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[o,x]}),e[18]=o,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==i||e[22]!==n||e[23]!==l||e[24]!==m?(h=r.jsxs("button",{type:"button",onClick:i,className:n,children:[l,m]}),e[21]=i,e[22]=n,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Re(s){const e=D.c(51),{open:t,onOpenChange:a,meta:c,decofile:i,previewBaseUrl:d,onSelect:n}=s,l=X(),[f,o]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&o(""));let m,h,S,b,j,N,y,R,g,P,C;if(e[0]!==i||e[1]!==c||e[2]!==a||e[3]!==n||e[4]!==t||e[5]!==d||e[6]!==f||e[7]!==l){const F=t&&c&&i?le(c,i):[],W=c?oe(c):"",V=i?ie(i):void 0,G=new Map;if(t&&W)for(const p of F)G.set(p.resolveType,K(d,W,p.previewBlock,V));const E=f.trim().toLowerCase(),H=E?F.filter(p=>p.title.toLowerCase().includes(E)||p.resolveType.toLowerCase().includes(E)||p.description?.toLowerCase().includes(E)):F;h=Z,P=t,C=a,m=ee,y="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let M;e[19]!==l?(M=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=M):M=e[20];let U;e[21]!==M?(U=r.jsx(te,{children:M}),e[21]=M,e[22]=U):U=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=k):k=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>o(p.target.value),e[24]=$):$=e[24];let A;e[25]!==l?(A=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=A):A=e[26];let B;e[27]!==f||e[28]!==A?(B=r.jsxs("div",{className:"relative pt-2",children:[k,r.jsx(se,{value:f,onChange:$,placeholder:A,className:"h-9 pl-8"})]}),e[27]=f,e[28]=A,e[29]=B):B=e[29],e[30]!==U||e[31]!==B?(g=r.jsxs(re,{className:"shrink-0 border-b px-4 py-3 text-left",children:[U,B]}),e[30]=U,e[31]=B,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=H.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:H.map(p=>r.jsx(he,{entry:p,scrollRootRef:x,previewUrl:G.get(p.resolveType)??K(d,W,p.previewBlock,V),onSelect:()=>n(p)},p.resolveType))}),e[0]=i,e[1]=c,e[2]=a,e[3]=n,e[4]=t,e[5]=d,e[6]=f,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=y,e[15]=R,e[16]=g,e[17]=P,e[18]=C}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],y=e[14],R=e[15],g=e[16],P=e[17],C=e[18];let T;e[33]!==S||e[34]!==b?(T=r.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=T):T=e[35];let I;e[36]!==T||e[37]!==j||e[38]!==N?(I=r.jsx("div",{ref:j,className:N,children:T}),e[36]=T,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==y||e[43]!==R||e[44]!==g?(L=r.jsxs(m,{closeButtonClassName:y,className:R,children:[g,I]}),e[40]=m,e[41]=I,e[42]=y,e[43]=R,e[44]=g,e[45]=L):L=e[45];let O;return e[46]!==h||e[47]!==L||e[48]!==P||e[49]!==C?(O=r.jsx(h,{open:P,onOpenChange:C,children:L}),e[46]=h,e[47]=L,e[48]=P,e[49]=C,e[50]=O):O=e[50],O}function Pe(s){const e=D.c(3),t=fe(s.virtualMcpId);let a;if(e[0]!==s.sandboxUrl||e[1]!==t?.metadata){const{previewServerUrl:c,active:i}=ae(t?.metadata);a=ce({sandboxUrl:s.sandboxUrl,previewServerUrl:c,fastPreviewActive:i}),e[0]=s.sandboxUrl,e[1]=t?.metadata,e[2]=a}else a=e[2];return a}export{Re as A,Pe as u};
1
+ import{c as D,b as X,r as w,j as r,m as J}from"./index-ok9NuJcw.js";import{ad as _}from"./agent-icon-C5KNOKfn.js";import{i as Y}from"./SearchMd-Bn8XXVaA.js";import{e as Z,d as ee,b as te,a as re}from"./dialog-DWhWY4Tz.js";import{I as se}from"./input-JQPP3EQY.js";import{K as le,L as oe,M as ie,N as K,O as ne,P as ae,Q as ce}from"./index-TX8UkoDc.js";import{u as fe}from"./use-virtual-mcp-CpFoSCpU.js";const de=12,z=new Set,q=new Set;function ue(){for(const s of q)s()}function me(s){return z.has(s)?!0:z.size>=de?!1:(z.add(s),!0)}function Q(s){z.delete(s)&&ue()}function ve(s){return q.add(s),()=>{q.delete(s)}}function pe(s,e){const t=w.useRef(!1),[a,c]=w.useState(!1),i=w.useRef(null),d=w.useRef(null),n=w.useRef(null),l=w.useRef(s);l.current=s;const[f]=w.useState(()=>{const o=()=>{n.current?.(),n.current=null},u=()=>t.current?!0:me(e)?(t.current=!0,c(!0),o(),!0):!1;return v=>{if(d.current=v,i.current&&(i.current.disconnect(),i.current=null),o(),!v){t.current&&(Q(e),t.current=!1,c(!1));return}queueMicrotask(()=>{if(d.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!n.current&&(n.current=ve(()=>{d.current===v&&u()}));return}o(),t.current&&(Q(e),t.current=!1,c(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),i.current=x})}});return{ref:f,iframeActive:a}}function xe(s){const e=D.c(8),{previewUrl:t,title:a,scrollRootRef:c,slotId:i}=s,{ref:d,iframeActive:n}=pe(c,i),[l,f]=w.useState(!1);let o;e[0]!==n||e[1]!==l||e[2]!==t||e[3]!==a?(o=n?r.jsxs(r.Fragment,{children:[!l&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${a}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>f(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=n,e[1]=l,e[2]=t,e[3]=a,e[4]=o):o=e[4];let u;return e[5]!==d||e[6]!==o?(u=r.jsx("div",{ref:d,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:o}),e[5]=d,e[6]=o,e[7]=u):u=e[7],u}function he(s){const e=D.c(26),{entry:t,previewUrl:a,scrollRootRef:c,onSelect:i}=s,d=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let n;e[0]!==d?(n=J("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",d),e[0]=d,e[1]=n):n=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==a||e[5]!==c?(l=r.jsx(xe,{previewUrl:a,title:t.title,scrollRootRef:c,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=a,e[5]=c,e[6]=l):l=e[6];let f;e[7]!==t.isSavedBlock?(f=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=f):f=e[8];let o;e[9]!==f?(o=r.jsx(_,{className:"h-4 w-4 shrink-0",style:f}),e[9]=f,e[10]=o):o=e[10];let u;e[11]!==t.title?(u=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=r.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==o||e[19]!==x?(m=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[o,x]}),e[18]=o,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==i||e[22]!==n||e[23]!==l||e[24]!==m?(h=r.jsxs("button",{type:"button",onClick:i,className:n,children:[l,m]}),e[21]=i,e[22]=n,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Re(s){const e=D.c(51),{open:t,onOpenChange:a,meta:c,decofile:i,previewBaseUrl:d,onSelect:n}=s,l=X(),[f,o]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&o(""));let m,h,S,b,j,N,y,R,g,P,C;if(e[0]!==i||e[1]!==c||e[2]!==a||e[3]!==n||e[4]!==t||e[5]!==d||e[6]!==f||e[7]!==l){const F=t&&c&&i?le(c,i):[],W=c?oe(c):"",V=i?ie(i):void 0,G=new Map;if(t&&W)for(const p of F)G.set(p.resolveType,K(d,W,p.previewBlock,V));const E=f.trim().toLowerCase(),H=E?F.filter(p=>p.title.toLowerCase().includes(E)||p.resolveType.toLowerCase().includes(E)||p.description?.toLowerCase().includes(E)):F;h=Z,P=t,C=a,m=ee,y="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let M;e[19]!==l?(M=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=M):M=e[20];let U;e[21]!==M?(U=r.jsx(te,{children:M}),e[21]=M,e[22]=U):U=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=k):k=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>o(p.target.value),e[24]=$):$=e[24];let A;e[25]!==l?(A=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=A):A=e[26];let B;e[27]!==f||e[28]!==A?(B=r.jsxs("div",{className:"relative pt-2",children:[k,r.jsx(se,{value:f,onChange:$,placeholder:A,className:"h-9 pl-8"})]}),e[27]=f,e[28]=A,e[29]=B):B=e[29],e[30]!==U||e[31]!==B?(g=r.jsxs(re,{className:"shrink-0 border-b px-4 py-3 text-left",children:[U,B]}),e[30]=U,e[31]=B,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=H.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:H.map(p=>r.jsx(he,{entry:p,scrollRootRef:x,previewUrl:G.get(p.resolveType)??K(d,W,p.previewBlock,V),onSelect:()=>n(p)},p.resolveType))}),e[0]=i,e[1]=c,e[2]=a,e[3]=n,e[4]=t,e[5]=d,e[6]=f,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=y,e[15]=R,e[16]=g,e[17]=P,e[18]=C}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],y=e[14],R=e[15],g=e[16],P=e[17],C=e[18];let T;e[33]!==S||e[34]!==b?(T=r.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=T):T=e[35];let I;e[36]!==T||e[37]!==j||e[38]!==N?(I=r.jsx("div",{ref:j,className:N,children:T}),e[36]=T,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==y||e[43]!==R||e[44]!==g?(L=r.jsxs(m,{closeButtonClassName:y,className:R,children:[g,I]}),e[40]=m,e[41]=I,e[42]=y,e[43]=R,e[44]=g,e[45]=L):L=e[45];let O;return e[46]!==h||e[47]!==L||e[48]!==P||e[49]!==C?(O=r.jsx(h,{open:P,onOpenChange:C,children:L}),e[46]=h,e[47]=L,e[48]=P,e[49]=C,e[50]=O):O=e[50],O}function Pe(s){const e=D.c(3),t=fe(s.virtualMcpId);let a;if(e[0]!==s.sandboxUrl||e[1]!==t?.metadata){const{previewServerUrl:c,active:i}=ae(t?.metadata);a=ce({sandboxUrl:s.sandboxUrl,previewServerUrl:c,fastPreviewActive:i}),e[0]=s.sandboxUrl,e[1]=t?.metadata,e[2]=a}else a=e[2];return a}export{Re as A,Pe as u};
@@ -1 +1 @@
1
- import{c as r,v as u}from"./index-D7ruAD9R.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-DgBVDXYP.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
1
+ import{c as r,v as u}from"./index-ok9NuJcw.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-Bja0B28s.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
@@ -1 +1 @@
1
- import{c as u,F as f,n as E,o as g,e as T,K as l,t as m}from"./index-D7ruAD9R.js";import{u as y}from"./studio-tools-43YF_K-Q.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],E(a)}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){m.error(e instanceof Error?e.message:"Failed to create tag")}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){m.error(e instanceof Error?e.message:"Failed to delete tag")}function A(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],E(c)}function G(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){m.error(e instanceof Error?e.message:"Failed to update member tags")}export{C as a,M as b,A as c,G as d,K as u};
1
+ import{c as u,F as f,n as E,o as g,e as T,K as l,t as m}from"./index-ok9NuJcw.js";import{u as y}from"./studio-tools-DfKuGLE7.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],E(a)}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){m.error(e instanceof Error?e.message:"Failed to create tag")}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){m.error(e instanceof Error?e.message:"Failed to delete tag")}function A(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],E(c)}function G(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){m.error(e instanceof Error?e.message:"Failed to update member tags")}export{C as a,M as b,A as c,G as d,K as u};
@@ -1 +1 @@
1
- import{c as p,r as f}from"./index-D7ruAD9R.js";import{u as w}from"./use-mobile-CT3yU0Mk.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
1
+ import{c as p,r as f}from"./index-ok9NuJcw.js";import{u as w}from"./use-mobile-BDrP2eQf.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
@@ -0,0 +1 @@
1
+ import{c as d,F as a,e1 as P,bd as L,K as S,bc as p,n as V}from"./index-ok9NuJcw.js";import{S as g,u as C}from"./use-mcp-client-DYojHZ-i.js";function U(s){const t=d.c(5);let e;t[0]!==s?(e=s===void 0?{}:s,t[0]=s,t[1]=e):e=t[1];const n=e,{org:i}=a();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=C(o);return P(i.id,"VIRTUAL_MCP",l,n)}function b(s){const t=d.c(3),{org:e}=a();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=C(n);return p(e.id,"VIRTUAL_MCP",s??void 0,i)}function y(s){const t=d.c(15),{org:e}=a();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const i=C(n);let o,l,u;t[3]!==s||t[4]!==e.id?(o=[...s].sort(),u=V,l=S.virtualMcpLastUsed(e.id,o),t[3]=s,t[4]=e.id,t[5]=o,t[6]=l,t[7]=u):(o=t[5],l=t[6],u=t[7]);const I=o.length>0;let c;t[8]!==i||t[9]!==o?(c=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=c):c=t[10];let r;return t[11]!==l||t[12]!==I||t[13]!==c?(r={queryKey:l,enabled:I,staleTime:3e4,queryFn:c},t[11]=l,t[12]=I,t[13]=c,t[14]=r):r=t[14],u(r)}function R(){const s=d.c(3),{org:t}=a();let e;s[0]!==t.id||s[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=e):e=s[2];const n=C(e);return L(t.id,"VIRTUAL_MCP",n)}export{U as a,R as b,y as c,b as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./use-infinite-scroll-zj5ct46-.js";import{e5 as i}from"./index-ok9NuJcw.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +1 @@
1
- import{b3 as s,r as c,b4 as a,b5 as i}from"./index-D7ruAD9R.js";function f(r){const n=s({warn:r?.router===void 0}),t=r?.router||n,u=c.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const o=i(u.current,r.select(e));return u.current=o,o}return r.select(e)}return e})}export{f as u};
1
+ import{b3 as s,r as c,b4 as a,b5 as i}from"./index-ok9NuJcw.js";function f(r){const n=s({warn:r?.router===void 0}),t=r?.router||n,u=c.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const o=i(u.current,r.select(e));return u.current=o,o}return r.select(e)}return e})}export{f as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./use-infinite-scroll-zj5ct46-.js";import{e5 as u,b2 as n}from"./index-ok9NuJcw.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
@@ -1 +1 @@
1
- import{c as V,b as q,r as z,a as O,n as Y,e as $,j as t,K as J,t as Q,B as W}from"./index-D7ruAD9R.js";import{P as I}from"./index-CqMFU0yP.js";import{C as G}from"./collection-table-wrapper-yAMwsEKr.js";import{E as L}from"./empty-state-C-U6aO8t.js";import{S as H}from"./search-input-B0dv5yOL.js";import{A as X}from"./avatar-BeSTVwN_.js";import{B as D}from"./badge-7TN3Wktg.js";import{u as Z}from"./use-debounced-value-C2tRwl1G.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BnbuEtat.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./sidebar-XtHztjYp.js";import"./LayoutLeft-BLZ5NIVe.js";import"./use-mobile-CT3yU0Mk.js";import"./X-JiAwzhaQ.js";import"./tooltip-2La-f68Q.js";import"./table-DPk5SmMs.js";import"./ArrowUp-CM4hwO1x.js";import"./SearchMd-CUHSKZ0C.js";import"./User01-BJ2PmluK.js";import"./differenceInSeconds-NQ4PDo0z.js";function be(){const e=V.c(58),s=q(),[a,M]=z.useState("");let N;e[0]!==a?(N=a.trim(),e[0]=a,e[1]=N):N=e[1];const r=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==r?(n=J.deploymentAdminUsers(r),e[2]=r,e[3]=n):n=e[3];let l;e[4]!==r?(l=()=>{const i=new URLSearchParams({limit:"100"});return r&&i.set("searchValue",r),K(`/api/_admin/users?${i}`)},e[4]=r,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:re,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==a||e[44]!==j?(g=t.jsx(H,{value:a,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=a,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==r||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:r?s("admin.users.noUsersMatchSearch",{search:r}):s("admin.users.noUsersYet")}),e[46]=r,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function re(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{be as default};
1
+ import{c as V,b as q,r as z,a as O,n as Y,e as $,j as t,K as J,t as Q,B as W}from"./index-ok9NuJcw.js";import{P as I}from"./index-BuHij7CO.js";import{C as G}from"./collection-table-wrapper-DBV6PVTd.js";import{E as L}from"./empty-state-0YsdRqeC.js";import{S as H}from"./search-input-Nwr77UCS.js";import{A as X}from"./avatar-C51fT0U1.js";import{B as D}from"./badge-Ck94mGfj.js";import{u as Z}from"./use-debounced-value-Bw1cx2A7.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BnbuEtat.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./sidebar-BcCQis2L.js";import"./LayoutLeft-D6wv9en6.js";import"./use-mobile-BDrP2eQf.js";import"./X-DEBUZCc1.js";import"./tooltip-zThj01Gf.js";import"./table-DbWpkNmc.js";import"./ArrowUp-NtTGEiXQ.js";import"./SearchMd-Bn8XXVaA.js";import"./User01-BXiZpiCy.js";import"./differenceInSeconds-NQ4PDo0z.js";function be(){const e=V.c(58),s=q(),[a,M]=z.useState("");let N;e[0]!==a?(N=a.trim(),e[0]=a,e[1]=N):N=e[1];const r=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==r?(n=J.deploymentAdminUsers(r),e[2]=r,e[3]=n):n=e[3];let l;e[4]!==r?(l=()=>{const i=new URLSearchParams({limit:"100"});return r&&i.set("searchValue",r),K(`/api/_admin/users?${i}`)},e[4]=r,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:re,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==a||e[44]!==j?(g=t.jsx(H,{value:a,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=a,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==r||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:r?s("admin.users.noUsersMatchSearch",{search:r}):s("admin.users.noUsersYet")}),e[46]=r,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function re(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{be as default};
@@ -1 +1 @@
1
- import{c as K,b as tt,r as et,j as s,m as ot,B as nt}from"./index-D7ruAD9R.js";import{u as vt,a7 as dt,f as yt}from"./agent-icon-BypwlSQB.js";import{i as Tt}from"./ChevronRight-CPHsfQo3.js";import{L as jt}from"./label-sPxTCHgi.js";import{B as pt}from"./automation-runs-BlKRnDL3.js";import{S as Nt}from"./switch-COa2pVfk.js";import{T as wt,c as kt,a as Mt}from"./tooltip-2La-f68Q.js";import{V as _t}from"./view-mode-toggle-CAlt97wR.js";import"./AlertCircle-B-VB_v8_.js";import"./Tool01-DncLlBOd.js";import"./ArrowUp-CM4hwO1x.js";import"./ArrowLeft-KvTc6rGE.js";import"./Tool02-Dop27LUm.js";import"./XCircle-BAmgho8b.js";import"./ArrowUpRight-CT3hd3Gz.js";import"./TrendUp01-DeH0rZDG.js";import"./ZapSquare-4QAPR3zA.js";import"./Users03-DBRXdvYq.js";import"./CheckCircle-Dag22p3m.js";import"./Check-jVlurWFp.js";import"./ChevronDown-p_tbIzFd.js";import"./ChevronUp-vuWH7gGr.js";import"./DotsVertical-BGG3Ho_u.js";import"./Stars02-9Za0OT3w.js";import"./Copy01-C_8GUzyJ.js";import"./CpuChip01-4na0tDxe.js";import"./CreditCard01-DW_FdoX9.js";import"./Globe01-BMEBgVG2.js";import"./Settings02-DwsCOelc.js";import"./Eye-Dn-joolw.js";import"./FilterLines-CYIS3PyF.js";import"./Share07-BKiSFd-U.js";import"./Star01-CHCsqoaq.js";import"./Globe04-DufTt3Vi.js";import"./SwitchHorizontal01-Cebat5cd.js";import"./HardDrive-H4sB7rht.js";import"./Key01-CH_IVG_t.js";import"./LayoutLeft-BLZ5NIVe.js";import"./LinkExternal01-SB0_tkSE.js";import"./LogOut01-BccMqXFZ.js";import"./Monitor01-DljnePZF.js";import"./Sun-ftMFixk5.js";import"./Palette-BkqWyxiz.js";import"./Play-BO_bz8z5.js";import"./Plus-DChWoRcZ.js";import"./SearchLg-DIkeGuEU.js";import"./SearchMd-CUHSKZ0C.js";import"./Shield01-DZaZzDZT.js";import"./Stars01-sT_rQek5.js";import"./Trash01-BjgXKgr6.js";import"./Upload01-C9lBOcvL.js";import"./User01-BJ2PmluK.js";import"./Users01-CDyoTcZA.js";import"./XClose-DgBj6S8z.js";import"./X-JiAwzhaQ.js";import"./Zap-ywE7kIil.js";import"./select-BpPnRSd-.js";import"./useInfiniteQuery-ueeYN8M9.js";import"./use-infinite-scroll-CGISYIMq.js";import"./use-connection-DNjvpsXX.js";import"./use-mcp-client-B5b37aiu.js";import"./auth-CgC0zRiu.js";import"./use-virtual-mcp-D1c8M1hh.js";import"./card-DcOVhRdn.js";import"./sidebar-XtHztjYp.js";import"./use-mobile-CT3yU0Mk.js";import"./table-DPk5SmMs.js";import"./empty-state-C-U6aO8t.js";import"./use-members-DzkjUoJV.js";import"./use-org-auth-client-Bo-CO3rH.js";import"./use-clock-tick-n9GtE0Cq.js";import"./use-automations-DmPoIHA3.js";import"./studio-tools-43YF_K-Q.js";import"./useSuspenseInfiniteQuery-CLfnZXXY.js";import"./avatar-BeSTVwN_.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DEnQ3bpL.js";import"./dialog-BndOy54_.js";import"./tab-id-D2hxEf3P.js";import"./hooks-DSQPS7ZB.js";import"./decopilot-sse-pool-DxtdX756.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-CHpxk4f9.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-kgciqmRs.js";import"./use-decopilot-events-DgBVDXYP.js";import"./use-organization-settings-BSdKLcGF.js";import"./monaco-editor-5TGvXJMP.js";import"./spinner-BDArA5p5.js";import"./index-BVax3vfK.js";import"./shell-layout-U1XEcaQb.js";import"./required-auth-layout-D8pQ4hlg.js";import"./use-org-sso-Dzy04a3G.js";import"./integration-icon-BDe33Str.js";import"./use-navigate-to-agent-DpmJRDSG.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-GISiEbjd.js";import"./form-B913lxdw.js";import"./input-BywtKe6R.js";import"./file-type-icon-umbWZVCL.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Dt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",i=typeof n=="string";if(!r&&!i)return null;const o=r?new Date(t):Ct,a=i?new Date(n):Dt;return Number.isNaN(o.getTime())||Number.isNaN(a.getTime())||r&&i&&a.getTime()<=o.getTime()?null:{start:o,end:a,openStart:!r,openEnd:!i}}function ft(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(Et.has(n)){const r=Rt(e);r&&t.push(r);return}if(St.has(n)){const r=e.matchers;if(Array.isArray(r))for(const i of r)ft(i,t)}}}function Ot(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const n=e.variants;return Array.isArray(n)}function It(e){if(typeof e=="string"){const m=e.trim();if(m.length===0)return null;try{const c=new URL(m).pathname.split("/").filter(Boolean),d=c[c.length-1];if(d)return decodeURIComponent(d)}catch{}return m.length>80?`${m.slice(0,77)}…`:m}if(!e||typeof e!="object")return null;const t=e,n=t.config,i=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,i?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const m of o)if(typeof m=="string"&&m.trim().length>0)return m.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function X(e,t,n,r,i){if(Ot(e)){const o=e.variants,a=e.__resolveType,m=$t.test(a)?"":Pt(r);o.forEach((l,c)=>{if(!l||typeof l!="object")return;const d=l,f=[];if(ft(d.rule,f),f.length===0)return;const x=It(d.value)??(m||n);for(const h of f)i.push({blockKey:t,blockLabel:n,innerPath:m,variantIndex:c,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:a})});for(let l=0;l<o.length;l++){const c=o[l];c&&typeof c=="object"&&X(c.value,t,n,[...r,"variants",l,"value"],i)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)X(e[o],t,n,[...r,o],i);return}if(e&&typeof e=="object")for(const[o,a]of Object.entries(e))o!=="__resolveType"&&X(a,t,n,[...r,o],i)}function Ft(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))X(r,n,Lt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,i)=>{const o=i*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),n}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ut(e,t){return e.get(t)??Ht}const Bt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ht=["January","February","March","April","May","June","July","August","September","October","November","December"],gt=1440*60*1e3;function B(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function xt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function G(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function st(e,t){return Math.round((B(e).getTime()-B(t).getTime())/gt)}function Wt(e){const t=(e.getTime()-B(e).getTime())/gt;return Math.min(Math.max(t,0),1)}function it(e,t){return st(e,t)+Wt(e)}function zt(e){const t=Z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const i=[];for(let o=0;o<7;o++)i.push(Z(t,r*7+o));n.push(i)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Ut(e,t){const n=B(e[0]),r=Z(n,7),i=n.getTime(),o=r.getTime(),a=[];for(const c of t){const d=B(c.start),f=B(c.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?Z(r,-1):f,h=st(u,n),g=st(x,u)+1;if(g<=0)continue;const b=Math.max(c.start.getTime(),i),j=Math.min(c.end.getTime(),o),v=it(new Date(b),n),p=Math.max(it(new Date(j),n)-v,0);p<=0||a.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:p})}a.sort((c,d)=>c.startCol-d.startCol||d.span-c.span||c.variant.blockKey.localeCompare(d.variant.blockKey));const m=[],l=[];for(const c of a){let d=m.findIndex(f=>f<=c.startCol);d===-1&&(d=m.length,m.push(0)),m[d]=c.startCol+c.span,l.push({...c,lane:d})}return l}const at=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Yt(e,t){const n=e.openStart?t("sandbox.variantCalendar.always"):at.format(e.start),r=e.openEnd?t("sandbox.variantCalendar.ongoing"):at.format(e.end);return`${n} → ${r}`}function Gt(e){const t=K.c(18),{variant:n}=e,r=tt();let i;t[0]!==n.blockLabel?(i=s.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=i):i=t[1];let o;t[2]!==n.innerPath?(o=n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=o):o=t[3];let a;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(a=n.label!==n.blockLabel&&n.label!==n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=a):a=t[7];let m;t[8]!==r||t[9]!==n?(m=Yt(n,r),t[8]=r,t[9]=n,t[10]=m):m=t[10];let l;t[11]!==m?(l=s.jsx("div",{className:"mt-1",children:m}),t[11]=m,t[12]=l):l=t[12];let c;return t[13]!==i||t[14]!==o||t[15]!==a||t[16]!==l?(c=s.jsx(Mt,{children:s.jsxs("div",{className:"text-xs",children:[i,o,a,l]})}),t[13]=i,t[14]=o,t[15]=a,t[16]=l,t[17]=c):c=t[17],c}const lt=16;function Kt(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${lt}px, #000 calc(100% - ${lt}px), ${r})`}function bt(e){const t=K.c(26),{variant:n,color:r,style:i,children:o,fadeStart:a,fadeEnd:m}=e,l=a===void 0?!1:a,c=m===void 0?!1:m;let d;t[0]!==c||t[1]!==l?(d=Kt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const f=d;let u;t[3]!==l?(u=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=u):u=t[4];let x;t[5]!==c?(x=c&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=c,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==i||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...i},t[9]=r.bg,t[10]=r.text,t[11]=i,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let j;t[18]!==g||t[19]!==b?(j=s.jsx(wt,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=j):j=t[20];let v;t[21]!==n?(v=s.jsx(Gt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let p;return t[23]!==v||t[24]!==j?(p=s.jsxs(kt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=p):p=t[25],p}function sr(e){const t=K.c(72),{decofile:n}=e,r=tt(),[i,o]=et.useState("calendar"),[a,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,f,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),f=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=f,t[4]=u}else d=t[2],f=t[3],u=t[4];const x=f;let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>m(xt(new Date)),t[5]=h):h=t[5];const g=h;let b;t[6]!==i?(b=()=>m(P=>i==="calendar"?G(P,-1):G(P,-3)),t[6]=i,t[7]=b):b=t[7];const j=b;let v;t[8]!==i?(v=()=>m(P=>i==="calendar"?G(P,1):G(P,3)),t[8]=i,t[9]=v):v=t[9];const p=v;let y;t[10]!==r?(y=r("sandbox.variantCalendar.today"),t[10]=r,t[11]=y):y=t[11];let T;t[12]!==y?(T=s.jsx(nt,{variant:"outline",size:"sm",onClick:g,children:y}),t[12]=y,t[13]=T):T=t[13];let w;t[14]!==r?(w=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=w):w=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(vt,{size:16}),t[16]=D):D=t[16];let k;t[17]!==j||t[18]!==w?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":w,children:D}),t[17]=j,t[18]=w,t[19]=k):k=t[19];let M;t[20]!==r?(M=r("sandbox.variantCalendar.next"),t[20]=r,t[21]=M):M=t[21];let S;t[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Tt,{size:16}),t[22]=S):S=t[22];let A;t[23]!==p||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:p,"aria-label":M,children:S}),t[23]=p,t[24]=M,t[25]=A):A=t[25];const $=ht[a.getMonth()];let C;t[26]!==a?(C=a.getFullYear(),t[26]=a,t[27]=C):C=t[27];let _;t[28]!==$||t[29]!==C?(_=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[$," ",C]}),t[28]=$,t[29]=C,t[30]=_):_=t[30];let N;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(N=s.jsxs("div",{className:"flex items-center gap-2",children:[T,k,A,_]}),t[31]=A,t[32]=_,t[33]=T,t[34]=k,t[35]=N):N=t[35];let L;t[36]!==d||t[37]!==l||t[38]!==r?(L=d>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nt,{id:"show-ongoing",checked:l,onCheckedChange:c}),s.jsx(jt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:r("sandbox.variantCalendar.showOngoing",{count:d})})]}),t[36]=d,t[37]=l,t[38]=r,t[39]=L):L=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(dt,{}),t[40]=H):H=t[40];let F;t[41]!==r?(F=r("sandbox.variantCalendar.calendarMode"),t[41]=r,t[42]=F):F=t[42];let E;t[43]!==F?(E={value:"calendar",icon:H,label:F},t[43]=F,t[44]=E):E=t[44];let W;t[45]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(yt,{}),t[45]=W):W=t[45];let R;t[46]!==r?(R=r("sandbox.variantCalendar.timelineMode"),t[46]=r,t[47]=R):R=t[47];let O;t[48]!==R?(O={value:"timeline",icon:W,label:R},t[48]=R,t[49]=O):O=t[49];let I;t[50]!==E||t[51]!==O?(I=[E,O],t[50]=E,t[51]=O,t[52]=I):I=t[52];let V;t[53]!==I||t[54]!==i?(V=s.jsx(_t,{value:i,onValueChange:o,options:I}),t[53]=I,t[54]=i,t[55]=V):V=t[55];let z;t[56]!==L||t[57]!==V?(z=s.jsxs("div",{className:"flex items-center gap-4",children:[L,V]}),t[56]=L,t[57]=V,t[58]=z):z=t[58];let U;t[59]!==N||t[60]!==z?(U=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[N,z]}),t[59]=N,t[60]=z,t[61]=U):U=t[61];let Y;t[62]!==x||t[63]!==a||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==i?(Y=u.length===0?s.jsx(Zt,{hiddenOngoing:l?0:d}):i==="calendar"?s.jsx(ee,{monthStart:a,variants:u,colorMap:x}):s.jsx(oe,{monthStart:a,variants:u,colorMap:x}),t[62]=x,t[63]=a,t[64]=d,t[65]=l,t[66]=u,t[67]=i,t[68]=Y):Y=t[68];let q;return t[69]!==U||t[70]!==Y?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[U,Y]}),t[69]=U,t[70]=Y,t[71]=q):q=t[71],q}function Jt(e){return e.blockKey}function qt(e){return!e.openEnd}function Qt(e){return e.openEnd}function Xt(){return xt(new Date)}function Zt(e){const t=K.c(4),{hiddenOngoing:n}=e,r=n===void 0?0:n,i=tt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:24,className:"text-muted-foreground/60"}),t[0]=o):o=t[0];let a;return t[1]!==r||t[2]!==i?(a=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[o,r>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noDatedVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.hiddenOngoingVariants",{count:r})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noScheduledVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=r,t[2]=i,t[3]=a):a=t[3],a}const rt=20,ct=2,mt=28,te=6;function ee(e){const t=K.c(17),{monthStart:n,variants:r,colorMap:i}=e;let o,a,m,l,c;if(t[0]!==i||t[1]!==n||t[2]!==r){const u=zt(n),x=B(new Date);o=pt,c="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:Bt.map(re)}),t[8]=m):m=t[8],l=u.map((h,g)=>{const b=Ut(h,r),j=b.reduce(ne,0),v=mt+j*(rt+ct)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:v},children:[h.map((p,y)=>{const T=p.getMonth()===n.getMonth(),w=p.getTime()===x.getTime();return s.jsx("div",{className:ot("border-r last:border-r-0 px-2 pt-1.5 text-xs",T?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:ot("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",w&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},y)}),b.map((p,y)=>{const T=ut(i,p.variant.blockKey),w=mt+p.lane*(rt+ct),D=p.leftUnits/7*100,k=p.widthUnits/7*100,M=p.variant.openStart&&g===0,S=p.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:p.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:w,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${y}`)})]},g)}),t[0]=i,t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=m,t[6]=l,t[7]=c}else o=t[3],a=t[4],m=t[5],l=t[6],c=t[7];let d;t[9]!==a||t[10]!==m||t[11]!==l?(d=s.jsxs("div",{className:a,children:[m,l]}),t[9]=a,t[10]=m,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==o||t[14]!==c||t[15]!==d?(f=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function ne(e,t){return Math.max(e,t.lane+1)}function re(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const Q=4,se=32,J=240;function oe(e){const t=K.c(23),{monthStart:n,variants:r,colorMap:i}=e,o=n,a=G(n,Q),m=new Date,l=new Map;for(const _ of r){const N=l.get(_.blockKey)??[];N.push(_),l.set(_.blockKey,N)}const c=Array.from(l.entries()).sort(le),d=a.getTime()-o.getTime(),f=_=>(Math.max(o.getTime(),Math.min(a.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,N)=>G(o,N),t[0]=o,t[1]=u):u=t[1];const x=Array.from({length:Q},u),h=m.getTime()>=o.getTime()&&m.getTime()<=a.getTime()?f(m):null,g=tt(),b=pt,j="flex-1 min-h-0",v="min-w-[900px] relative";let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p={width:J},t[2]=p):p=t[2];let y;t[3]!==g?(y=g("sandbox.variantCalendar.variantBlock"),t[3]=g,t[4]=y):y=t[4];let T;t[5]!==y?(T=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:p,children:y}),t[5]=y,t[6]=T):T=t[6];let w;t[7]===Symbol.for("react.memo_cache_sentinel")?(w={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=w):w=t[7];const D=x.map(ae);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:w,children:D}),t[8]=D,t[9]=k):k=t[9];let M;t[10]!==T||t[11]!==k?(M=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[T,k]}),t[10]=T,t[11]=k,t[12]=M):M=t[12];let S;t[13]!==g||t[14]!==h?(S=h!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${J}px + (100% - ${J}px) * ${h} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:g("sandbox.variantCalendar.todayLabel")})}),t[13]=g,t[14]=h,t[15]=S):S=t[15];const A=c.map(_=>{const[N,L]=_,H=ut(i,N),F=L[0]?.blockLabel??N;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:J},children:F})}),L.map((E,W)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:se},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:J},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:E.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:x.map(ie)}),(()=>{const R=Math.max(E.start.getTime(),o.getTime()),O=Math.min(E.end.getTime(),a.getTime());if(O<=R)return null;const I=f(new Date(R)),V=f(new Date(O))-I;return s.jsx(bt,{variant:E,color:H,fadeStart:E.openStart,fadeEnd:E.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${I}%`,width:`calc(${V}% - 2px)`,height:22},children:E.label})})()]})]},W))]},N)});let $;t[16]!==M||t[17]!==S||t[18]!==A?($=s.jsxs("div",{className:v,children:[M,S,A]}),t[16]=M,t[17]=S,t[18]=A,t[19]=$):$=t[19];let C;return t[20]!==b||t[21]!==$?(C=s.jsx(b,{className:j,children:$}),t[20]=b,t[21]=$,t[22]=C):C=t[22],C}function ie(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function ae(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ht[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function le(e,t){return e[0].localeCompare(t[0])}export{sr as VariantCalendar};
1
+ import{c as K,b as tt,r as et,j as s,m as ot,B as nt}from"./index-ok9NuJcw.js";import{u as vt,a7 as dt,f as yt}from"./agent-icon-C5KNOKfn.js";import{i as Tt}from"./ChevronRight-D6-UpKSk.js";import{L as jt}from"./label-BgAf5iSE.js";import{B as pt}from"./automation-runs-Bl6XRQA5.js";import{S as Nt}from"./switch-_y9TlFLi.js";import{T as wt,c as kt,a as Mt}from"./tooltip-zThj01Gf.js";import{V as _t}from"./view-mode-toggle-EcFxik9Y.js";import"./AlertCircle-BJ5Laasl.js";import"./Tool01-Bo8oMlBt.js";import"./ArrowUp-NtTGEiXQ.js";import"./ArrowLeft-D5JGfSA4.js";import"./Tool02-OuC9FD32.js";import"./XCircle-CRaWHtor.js";import"./ArrowUpRight-CUs6CbaF.js";import"./TrendUp01-BB1RfYtp.js";import"./ZapSquare-NQ-ZfI_o.js";import"./Users03-pgncqeuH.js";import"./CheckCircle-CuraQ81C.js";import"./Check-DIWR4XW1.js";import"./ChevronDown-DgAtwz5C.js";import"./ChevronUp-DNSB7Nbk.js";import"./DotsVertical-CL4fwztx.js";import"./Stars02-XZ3eiHDT.js";import"./Copy01-DmXxiqc6.js";import"./CpuChip01-BytaWER7.js";import"./CreditCard01-DQqlvPia.js";import"./Globe01-Btm0dXhY.js";import"./Settings02-Le49_mVi.js";import"./Eye-CBV1oWcB.js";import"./FilterLines-C8SjCyFi.js";import"./Share07-CoxyuV_E.js";import"./Star01-BBJKsuL9.js";import"./Globe04-D9qVsCbI.js";import"./SwitchHorizontal01-DuS0RSqy.js";import"./HardDrive-CJk4ov6F.js";import"./Key01-B5xrezDZ.js";import"./LayoutLeft-D6wv9en6.js";import"./LinkExternal01-BH3gOTLA.js";import"./LogOut01-SZnvpmJV.js";import"./Monitor01-UogQCFcQ.js";import"./Sun-QR_TFyhY.js";import"./Palette-DM0-_tKV.js";import"./Play-Ccba2QRM.js";import"./Plus-CfCBacjT.js";import"./SearchLg-B9uL5YOp.js";import"./SearchMd-Bn8XXVaA.js";import"./Shield01-Ds8y5bur.js";import"./Stars01-8VTZy-Ut.js";import"./Trash01-BEQ11EC7.js";import"./Upload01-QANNG5Dx.js";import"./User01-BXiZpiCy.js";import"./Users01-Css8HZgb.js";import"./XClose-B1vS8ayo.js";import"./X-DEBUZCc1.js";import"./Zap-BaTcw9AK.js";import"./select-Bvk7MfKx.js";import"./useInfiniteQuery-Bu3cgth4.js";import"./use-infinite-scroll-zj5ct46-.js";import"./use-connection-YzzOR0Ct.js";import"./use-mcp-client-DYojHZ-i.js";import"./auth-Dhov-tCz.js";import"./use-virtual-mcp-CpFoSCpU.js";import"./card-C6z0dXO6.js";import"./sidebar-BcCQis2L.js";import"./use-mobile-BDrP2eQf.js";import"./table-DbWpkNmc.js";import"./empty-state-0YsdRqeC.js";import"./use-members-kfjccoLo.js";import"./use-org-auth-client-Blkf0oAf.js";import"./use-clock-tick-C2C8PMt_.js";import"./use-automations-DIsg-mj0.js";import"./studio-tools-DfKuGLE7.js";import"./useSuspenseInfiniteQuery-CTrP0HMd.js";import"./avatar-C51fT0U1.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-E8Z4OROr.js";import"./dialog-DWhWY4Tz.js";import"./tab-id-DvxA9xv9.js";import"./hooks-BCqdQLfU.js";import"./decopilot-sse-pool-Dx_Ili9X.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-owt7LEz8.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CDkZNfYu.js";import"./use-decopilot-events-Bja0B28s.js";import"./use-organization-settings-B4nPAvMF.js";import"./monaco-editor-DpwKi-Ez.js";import"./spinner-C2Q5NLRi.js";import"./index-DlxkR9hM.js";import"./shell-layout-BupsvGOi.js";import"./required-auth-layout-BFc5VOdo.js";import"./use-org-sso-BL3GsPAR.js";import"./integration-icon-CSuW0Kmb.js";import"./use-navigate-to-agent-DWJIFn-U.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CrbfDoCM.js";import"./form-Rig6qzpS.js";import"./input-JQPP3EQY.js";import"./file-type-icon-Cx8Qfxs_.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Dt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",i=typeof n=="string";if(!r&&!i)return null;const o=r?new Date(t):Ct,a=i?new Date(n):Dt;return Number.isNaN(o.getTime())||Number.isNaN(a.getTime())||r&&i&&a.getTime()<=o.getTime()?null:{start:o,end:a,openStart:!r,openEnd:!i}}function ft(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(Et.has(n)){const r=Rt(e);r&&t.push(r);return}if(St.has(n)){const r=e.matchers;if(Array.isArray(r))for(const i of r)ft(i,t)}}}function Ot(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const n=e.variants;return Array.isArray(n)}function It(e){if(typeof e=="string"){const m=e.trim();if(m.length===0)return null;try{const c=new URL(m).pathname.split("/").filter(Boolean),d=c[c.length-1];if(d)return decodeURIComponent(d)}catch{}return m.length>80?`${m.slice(0,77)}…`:m}if(!e||typeof e!="object")return null;const t=e,n=t.config,i=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,i?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const m of o)if(typeof m=="string"&&m.trim().length>0)return m.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function X(e,t,n,r,i){if(Ot(e)){const o=e.variants,a=e.__resolveType,m=$t.test(a)?"":Pt(r);o.forEach((l,c)=>{if(!l||typeof l!="object")return;const d=l,f=[];if(ft(d.rule,f),f.length===0)return;const x=It(d.value)??(m||n);for(const h of f)i.push({blockKey:t,blockLabel:n,innerPath:m,variantIndex:c,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:a})});for(let l=0;l<o.length;l++){const c=o[l];c&&typeof c=="object"&&X(c.value,t,n,[...r,"variants",l,"value"],i)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)X(e[o],t,n,[...r,o],i);return}if(e&&typeof e=="object")for(const[o,a]of Object.entries(e))o!=="__resolveType"&&X(a,t,n,[...r,o],i)}function Ft(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))X(r,n,Lt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,i)=>{const o=i*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),n}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ut(e,t){return e.get(t)??Ht}const Bt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ht=["January","February","March","April","May","June","July","August","September","October","November","December"],gt=1440*60*1e3;function B(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function xt(e){return new Date(e.getFullYear(),e.getMonth(),1)}function G(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function st(e,t){return Math.round((B(e).getTime()-B(t).getTime())/gt)}function Wt(e){const t=(e.getTime()-B(e).getTime())/gt;return Math.min(Math.max(t,0),1)}function it(e,t){return st(e,t)+Wt(e)}function zt(e){const t=Z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const i=[];for(let o=0;o<7;o++)i.push(Z(t,r*7+o));n.push(i)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Ut(e,t){const n=B(e[0]),r=Z(n,7),i=n.getTime(),o=r.getTime(),a=[];for(const c of t){const d=B(c.start),f=B(c.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?Z(r,-1):f,h=st(u,n),g=st(x,u)+1;if(g<=0)continue;const b=Math.max(c.start.getTime(),i),j=Math.min(c.end.getTime(),o),v=it(new Date(b),n),p=Math.max(it(new Date(j),n)-v,0);p<=0||a.push({variant:c,startCol:h,span:g,leftUnits:v,widthUnits:p})}a.sort((c,d)=>c.startCol-d.startCol||d.span-c.span||c.variant.blockKey.localeCompare(d.variant.blockKey));const m=[],l=[];for(const c of a){let d=m.findIndex(f=>f<=c.startCol);d===-1&&(d=m.length,m.push(0)),m[d]=c.startCol+c.span,l.push({...c,lane:d})}return l}const at=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Yt(e,t){const n=e.openStart?t("sandbox.variantCalendar.always"):at.format(e.start),r=e.openEnd?t("sandbox.variantCalendar.ongoing"):at.format(e.end);return`${n} → ${r}`}function Gt(e){const t=K.c(18),{variant:n}=e,r=tt();let i;t[0]!==n.blockLabel?(i=s.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=i):i=t[1];let o;t[2]!==n.innerPath?(o=n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=o):o=t[3];let a;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(a=n.label!==n.blockLabel&&n.label!==n.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=a):a=t[7];let m;t[8]!==r||t[9]!==n?(m=Yt(n,r),t[8]=r,t[9]=n,t[10]=m):m=t[10];let l;t[11]!==m?(l=s.jsx("div",{className:"mt-1",children:m}),t[11]=m,t[12]=l):l=t[12];let c;return t[13]!==i||t[14]!==o||t[15]!==a||t[16]!==l?(c=s.jsx(Mt,{children:s.jsxs("div",{className:"text-xs",children:[i,o,a,l]})}),t[13]=i,t[14]=o,t[15]=a,t[16]=l,t[17]=c):c=t[17],c}const lt=16;function Kt(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${lt}px, #000 calc(100% - ${lt}px), ${r})`}function bt(e){const t=K.c(26),{variant:n,color:r,style:i,children:o,fadeStart:a,fadeEnd:m}=e,l=a===void 0?!1:a,c=m===void 0?!1:m;let d;t[0]!==c||t[1]!==l?(d=Kt(l,c),t[0]=c,t[1]=l,t[2]=d):d=t[2];const f=d;let u;t[3]!==l?(u=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=u):u=t[4];let x;t[5]!==c?(x=c&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=c,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==i||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...i},t[9]=r.bg,t[10]=r.text,t[11]=i,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let j;t[18]!==g||t[19]!==b?(j=s.jsx(wt,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=j):j=t[20];let v;t[21]!==n?(v=s.jsx(Gt,{variant:n}),t[21]=n,t[22]=v):v=t[22];let p;return t[23]!==v||t[24]!==j?(p=s.jsxs(kt,{children:[j,v]}),t[23]=v,t[24]=j,t[25]=p):p=t[25],p}function sr(e){const t=K.c(72),{decofile:n}=e,r=tt(),[i,o]=et.useState("calendar"),[a,m]=et.useState(Xt),[l,c]=et.useState(!1);let d,f,u;if(t[0]!==n||t[1]!==l){const P=Ft(n);d=P.filter(Qt).length,u=l?P:P.filter(qt),f=Vt(u.map(Jt)),t[0]=n,t[1]=l,t[2]=d,t[3]=f,t[4]=u}else d=t[2],f=t[3],u=t[4];const x=f;let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>m(xt(new Date)),t[5]=h):h=t[5];const g=h;let b;t[6]!==i?(b=()=>m(P=>i==="calendar"?G(P,-1):G(P,-3)),t[6]=i,t[7]=b):b=t[7];const j=b;let v;t[8]!==i?(v=()=>m(P=>i==="calendar"?G(P,1):G(P,3)),t[8]=i,t[9]=v):v=t[9];const p=v;let y;t[10]!==r?(y=r("sandbox.variantCalendar.today"),t[10]=r,t[11]=y):y=t[11];let T;t[12]!==y?(T=s.jsx(nt,{variant:"outline",size:"sm",onClick:g,children:y}),t[12]=y,t[13]=T):T=t[13];let w;t[14]!==r?(w=r("sandbox.variantCalendar.previous"),t[14]=r,t[15]=w):w=t[15];let D;t[16]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(vt,{size:16}),t[16]=D):D=t[16];let k;t[17]!==j||t[18]!==w?(k=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:j,"aria-label":w,children:D}),t[17]=j,t[18]=w,t[19]=k):k=t[19];let M;t[20]!==r?(M=r("sandbox.variantCalendar.next"),t[20]=r,t[21]=M):M=t[21];let S;t[22]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Tt,{size:16}),t[22]=S):S=t[22];let A;t[23]!==p||t[24]!==M?(A=s.jsx(nt,{variant:"ghost",size:"icon",className:"size-8",onClick:p,"aria-label":M,children:S}),t[23]=p,t[24]=M,t[25]=A):A=t[25];const $=ht[a.getMonth()];let C;t[26]!==a?(C=a.getFullYear(),t[26]=a,t[27]=C):C=t[27];let _;t[28]!==$||t[29]!==C?(_=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[$," ",C]}),t[28]=$,t[29]=C,t[30]=_):_=t[30];let N;t[31]!==A||t[32]!==_||t[33]!==T||t[34]!==k?(N=s.jsxs("div",{className:"flex items-center gap-2",children:[T,k,A,_]}),t[31]=A,t[32]=_,t[33]=T,t[34]=k,t[35]=N):N=t[35];let L;t[36]!==d||t[37]!==l||t[38]!==r?(L=d>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nt,{id:"show-ongoing",checked:l,onCheckedChange:c}),s.jsx(jt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:r("sandbox.variantCalendar.showOngoing",{count:d})})]}),t[36]=d,t[37]=l,t[38]=r,t[39]=L):L=t[39];let H;t[40]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(dt,{}),t[40]=H):H=t[40];let F;t[41]!==r?(F=r("sandbox.variantCalendar.calendarMode"),t[41]=r,t[42]=F):F=t[42];let E;t[43]!==F?(E={value:"calendar",icon:H,label:F},t[43]=F,t[44]=E):E=t[44];let W;t[45]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(yt,{}),t[45]=W):W=t[45];let R;t[46]!==r?(R=r("sandbox.variantCalendar.timelineMode"),t[46]=r,t[47]=R):R=t[47];let O;t[48]!==R?(O={value:"timeline",icon:W,label:R},t[48]=R,t[49]=O):O=t[49];let I;t[50]!==E||t[51]!==O?(I=[E,O],t[50]=E,t[51]=O,t[52]=I):I=t[52];let V;t[53]!==I||t[54]!==i?(V=s.jsx(_t,{value:i,onValueChange:o,options:I}),t[53]=I,t[54]=i,t[55]=V):V=t[55];let z;t[56]!==L||t[57]!==V?(z=s.jsxs("div",{className:"flex items-center gap-4",children:[L,V]}),t[56]=L,t[57]=V,t[58]=z):z=t[58];let U;t[59]!==N||t[60]!==z?(U=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[N,z]}),t[59]=N,t[60]=z,t[61]=U):U=t[61];let Y;t[62]!==x||t[63]!==a||t[64]!==d||t[65]!==l||t[66]!==u||t[67]!==i?(Y=u.length===0?s.jsx(Zt,{hiddenOngoing:l?0:d}):i==="calendar"?s.jsx(ee,{monthStart:a,variants:u,colorMap:x}):s.jsx(oe,{monthStart:a,variants:u,colorMap:x}),t[62]=x,t[63]=a,t[64]=d,t[65]=l,t[66]=u,t[67]=i,t[68]=Y):Y=t[68];let q;return t[69]!==U||t[70]!==Y?(q=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[U,Y]}),t[69]=U,t[70]=Y,t[71]=q):q=t[71],q}function Jt(e){return e.blockKey}function qt(e){return!e.openEnd}function Qt(e){return e.openEnd}function Xt(){return xt(new Date)}function Zt(e){const t=K.c(4),{hiddenOngoing:n}=e,r=n===void 0?0:n,i=tt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:24,className:"text-muted-foreground/60"}),t[0]=o):o=t[0];let a;return t[1]!==r||t[2]!==i?(a=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[o,r>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noDatedVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.hiddenOngoingVariants",{count:r})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:i("sandbox.variantCalendar.noScheduledVariants")}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:i("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=r,t[2]=i,t[3]=a):a=t[3],a}const rt=20,ct=2,mt=28,te=6;function ee(e){const t=K.c(17),{monthStart:n,variants:r,colorMap:i}=e;let o,a,m,l,c;if(t[0]!==i||t[1]!==n||t[2]!==r){const u=zt(n),x=B(new Date);o=pt,c="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:Bt.map(re)}),t[8]=m):m=t[8],l=u.map((h,g)=>{const b=Ut(h,r),j=b.reduce(ne,0),v=mt+j*(rt+ct)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:v},children:[h.map((p,y)=>{const T=p.getMonth()===n.getMonth(),w=p.getTime()===x.getTime();return s.jsx("div",{className:ot("border-r last:border-r-0 px-2 pt-1.5 text-xs",T?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:ot("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",w&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},y)}),b.map((p,y)=>{const T=ut(i,p.variant.blockKey),w=mt+p.lane*(rt+ct),D=p.leftUnits/7*100,k=p.widthUnits/7*100,M=p.variant.openStart&&g===0,S=p.variant.openEnd&&g===u.length-1;return s.jsxs(bt,{variant:p.variant,color:T,fadeStart:M,fadeEnd:S,style:{top:w,left:`calc(${D}% + 2px)`,width:`calc(${k}% - 4px)`,minWidth:te,height:rt},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${y}`)})]},g)}),t[0]=i,t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=m,t[6]=l,t[7]=c}else o=t[3],a=t[4],m=t[5],l=t[6],c=t[7];let d;t[9]!==a||t[10]!==m||t[11]!==l?(d=s.jsxs("div",{className:a,children:[m,l]}),t[9]=a,t[10]=m,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==o||t[14]!==c||t[15]!==d?(f=s.jsx(o,{className:c,children:d}),t[13]=o,t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function ne(e,t){return Math.max(e,t.lane+1)}function re(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const Q=4,se=32,J=240;function oe(e){const t=K.c(23),{monthStart:n,variants:r,colorMap:i}=e,o=n,a=G(n,Q),m=new Date,l=new Map;for(const _ of r){const N=l.get(_.blockKey)??[];N.push(_),l.set(_.blockKey,N)}const c=Array.from(l.entries()).sort(le),d=a.getTime()-o.getTime(),f=_=>(Math.max(o.getTime(),Math.min(a.getTime(),_.getTime()))-o.getTime())/d*100;let u;t[0]!==o?(u=(_,N)=>G(o,N),t[0]=o,t[1]=u):u=t[1];const x=Array.from({length:Q},u),h=m.getTime()>=o.getTime()&&m.getTime()<=a.getTime()?f(m):null,g=tt(),b=pt,j="flex-1 min-h-0",v="min-w-[900px] relative";let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p={width:J},t[2]=p):p=t[2];let y;t[3]!==g?(y=g("sandbox.variantCalendar.variantBlock"),t[3]=g,t[4]=y):y=t[4];let T;t[5]!==y?(T=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:p,children:y}),t[5]=y,t[6]=T):T=t[6];let w;t[7]===Symbol.for("react.memo_cache_sentinel")?(w={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=w):w=t[7];const D=x.map(ae);let k;t[8]!==D?(k=s.jsx("div",{className:"flex-1 grid",style:w,children:D}),t[8]=D,t[9]=k):k=t[9];let M;t[10]!==T||t[11]!==k?(M=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[T,k]}),t[10]=T,t[11]=k,t[12]=M):M=t[12];let S;t[13]!==g||t[14]!==h?(S=h!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${J}px + (100% - ${J}px) * ${h} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:g("sandbox.variantCalendar.todayLabel")})}),t[13]=g,t[14]=h,t[15]=S):S=t[15];const A=c.map(_=>{const[N,L]=_,H=ut(i,N),F=L[0]?.blockLabel??N;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:J},children:F})}),L.map((E,W)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:se},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:J},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:H.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:E.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:x.map(ie)}),(()=>{const R=Math.max(E.start.getTime(),o.getTime()),O=Math.min(E.end.getTime(),a.getTime());if(O<=R)return null;const I=f(new Date(R)),V=f(new Date(O))-I;return s.jsx(bt,{variant:E,color:H,fadeStart:E.openStart,fadeEnd:E.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${I}%`,width:`calc(${V}% - 2px)`,height:22},children:E.label})})()]})]},W))]},N)});let $;t[16]!==M||t[17]!==S||t[18]!==A?($=s.jsxs("div",{className:v,children:[M,S,A]}),t[16]=M,t[17]=S,t[18]=A,t[19]=$):$=t[19];let C;return t[20]!==b||t[21]!==$?(C=s.jsx(b,{className:j,children:$}),t[20]=b,t[21]=$,t[22]=C):C=t[22],C}function ie(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function ae(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ht[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function le(e,t){return e[0].localeCompare(t[0])}export{sr as VariantCalendar};
@@ -1 +1 @@
1
- import{c as $,r as T,m as f,j as i}from"./index-D7ruAD9R.js";import{c as k,T as I,a as P}from"./tooltip-2La-f68Q.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":l.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
1
+ import{c as $,r as T,m as f,j as i}from"./index-ok9NuJcw.js";import{c as k,T as I,a as P}from"./tooltip-zThj01Gf.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":l.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
@@ -50,8 +50,8 @@
50
50
  <meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
51
51
  <meta name="twitter:image" content="/og-image.png" />
52
52
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
53
- <script type="module" crossorigin src="/assets/index-D7ruAD9R.js"></script>
54
- <link rel="stylesheet" crossorigin href="/assets/index-DXMTUPM-.css">
53
+ <script type="module" crossorigin src="/assets/index-ok9NuJcw.js"></script>
54
+ <link rel="stylesheet" crossorigin href="/assets/index-DJP7bbyy.css">
55
55
  </head>
56
56
  <body>
57
57
  <div id="root"></div>