decocms 3.94.2 → 3.94.3

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 (213) hide show
  1. package/dist/client/assets/{AlertCircle-DiN5PNxL.js → AlertCircle-DWRjxcjZ.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BjAmmqz1.js → ArrowUpRight-CLh7cOmb.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-CnuxNI5N.js → CheckCircle-C4Wk34SG.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DjUjI7ZT.js → ChevronDown-DC4RMF38.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-lLbYNeaE.js → ChevronLeft-DdoVJ5fA.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-QnPbpAFs.js → ChevronRight-BBTACrNR.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-DDcyY4lP.js → ChevronUp-jJeRT2mj.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-nNi8MPL2.js → DotsVertical-29yrOwC6.js} +1 -1
  9. package/dist/client/assets/{Eye-C9Xcteq-.js → Eye-YMDMgm08.js} +1 -1
  10. package/dist/client/assets/{FilterLines-Dg7IUTjL.js → FilterLines-CDFJJbs9.js} +1 -1
  11. package/dist/client/assets/{Globe01-BFrZD27Y.js → Globe01-DLVxAcSk.js} +1 -1
  12. package/dist/client/assets/{Globe04-CIm9kMjI.js → Globe04-y517FmZA.js} +1 -1
  13. package/dist/client/assets/{HardDrive-gwEfMPwy.js → HardDrive-CoKqxjZs.js} +1 -1
  14. package/dist/client/assets/{Key01-UGjka7-8.js → Key01-B4CExV41.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-9cH5exAu.js → LayoutLeft-CtuVexdB.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-B7eQGHi-.js → LinkExternal01-crM7UKlh.js} +1 -1
  17. package/dist/client/assets/{Monitor01-DVS9ezxf.js → Monitor01-D9go3rqh.js} +1 -1
  18. package/dist/client/assets/{Palette-T8Kt-mN9.js → Palette-JF4PDx7U.js} +1 -1
  19. package/dist/client/assets/{Play-C6GLqD32.js → Play-DA8a3jos.js} +1 -1
  20. package/dist/client/assets/{Plus-_eqCuzKq.js → Plus-SlW0q5yX.js} +1 -1
  21. package/dist/client/assets/{SearchMd-mD6Ay2_2.js → SearchMd-ClujlLQv.js} +1 -1
  22. package/dist/client/assets/{Settings02--ds2DgAs.js → Settings02-Dp79GuWN.js} +1 -1
  23. package/dist/client/assets/{Shield01-CCDRrSJj.js → Shield01-RdYbiHdR.js} +1 -1
  24. package/dist/client/assets/{Star01-_A6IWzfx.js → Star01-AP7UbAGc.js} +1 -1
  25. package/dist/client/assets/{Stars01-BqxzzW0i.js → Stars01-zyT5SVEM.js} +1 -1
  26. package/dist/client/assets/{Stars02-C1UT1VVg.js → Stars02-CEThiQSi.js} +1 -1
  27. package/dist/client/assets/{Sun-sjbshFON.js → Sun-G4s8dxx3.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-D1Th0ly2.js → SwitchHorizontal01-CB6Ftuon.js} +1 -1
  29. package/dist/client/assets/{Tool01-Bm3M6NoB.js → Tool01-HyTzOpJW.js} +1 -1
  30. package/dist/client/assets/{Trash01-DbUKlIo5.js → Trash01-Ds1aAv2J.js} +1 -1
  31. package/dist/client/assets/{Upload01-BMDi_b3F.js → Upload01-Brjb-Miw.js} +1 -1
  32. package/dist/client/assets/{User01-DZEkuBTV.js → User01-BJ1Ytuty.js} +1 -1
  33. package/dist/client/assets/{Users01-Bx1kyCMQ.js → Users01-D5WbTGiR.js} +1 -1
  34. package/dist/client/assets/{Users03-GYv7mrmw.js → Users03-CqSxH_Qt.js} +1 -1
  35. package/dist/client/assets/{X-D_fWZW_l.js → X-DjWG0hX7.js} +1 -1
  36. package/dist/client/assets/{XCircle-CHDEEtEA.js → XCircle-B1xLViF5.js} +1 -1
  37. package/dist/client/assets/{XClose-YfgGVuLX.js → XClose-BTf3KNPL.js} +1 -1
  38. package/dist/client/assets/{Zap-BHyU9C4-.js → Zap-CEcQSou4.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-CueUsJjX.js → ZapSquare-CdhXF508.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-Cf_spvIb.js → ZoomOut-D42GS1SN.js} +1 -1
  41. package/dist/client/assets/{access-gate-DCFWYXX8.js → access-gate-7IgCDOye.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-DZQu-zLX.js → add-section-modal-CTns5DBV.js} +1 -1
  43. package/dist/client/assets/{agent-icon-yP9sr5R9.js → agent-icon-BTjjwa0L.js} +1 -1
  44. package/dist/client/assets/{agents-list-B23VydJN.js → agents-list-B1JAiezN.js} +1 -1
  45. package/dist/client/assets/{ai-providers-CJVf-P8A.js → ai-providers-DkKVmFnn.js} +1 -1
  46. package/dist/client/assets/{alert-IQpHoeix.js → alert-BYVK5o4v.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-Dc3DtcSF.js → alert-dialog-dU2S0I61.js} +1 -1
  48. package/dist/client/assets/{app-editor-BpSrHNfJ.js → app-editor-CvpWHaFR.js} +1 -1
  49. package/dist/client/assets/{auth-ZfvkJMyI.js → auth-7J11gNlS.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-DUmmUKFy.js → auth-catchall-CThy5pxk.js} +1 -1
  51. package/dist/client/assets/{auth-entry-DYzk1Gu_.js → auth-entry-leDvythG.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-DEcwX6Eu.js → auth-split-layout-BCexxGWd.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-CaRJxoQM.js → authenticate-and-persist-oauth-DEQ0hHIu.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-B3pvC-mo.js → automation-list-row-BaQNQ4vM.js} +1 -1
  55. package/dist/client/assets/{automation-runs-r89Y4nSY.js → automation-runs-Cf33wBM4.js} +1 -1
  56. package/dist/client/assets/{automations-DbhX4Tep.js → automations-Dp9ScK4E.js} +1 -1
  57. package/dist/client/assets/{avatar-Xx6WG8hL.js → avatar-DogX32xW.js} +1 -1
  58. package/dist/client/assets/{badge-CGez4o7S.js → badge-uCngvERR.js} +1 -1
  59. package/dist/client/assets/{block-document-Dogd3JoF.js → block-document-DwSW8R8v.js} +1 -1
  60. package/dist/client/assets/{brand-context-DT1WZQJx.js → brand-context-Dkr3kDLR.js} +1 -1
  61. package/dist/client/assets/{buckets-Csybwk3V.js → buckets-eiFlbJtn.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-CNOWHwg5.js → capability-load-error-CwEekgHi.js} +1 -1
  63. package/dist/client/assets/{card-B13o0f5w.js → card-CeRD1pv9.js} +1 -1
  64. package/dist/client/assets/{category-editor-DUlVawWA.js → category-editor-CjiiticV.js} +1 -1
  65. package/dist/client/assets/{chat-context-xREAp4B7.js → chat-context-D58BzJe_.js} +1 -1
  66. package/dist/client/assets/{checkbox-Bt0kAhDE.js → checkbox-DlxAYuP1.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-xfTT4Fwk.js → cli-auth-success-BiovU8mX.js} +1 -1
  68. package/dist/client/assets/{collection-detail-BDnt03xe.js → collection-detail-Dic7PUV9.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-VzeMJl0p.js → collection-display-button-DaYkaYuR.js} +1 -1
  70. package/dist/client/assets/{collection-search-CkNrHX6K.js → collection-search-CAMpxzMj.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-BfkNqcSd.js → collection-tabs-gfUy8uXO.js} +1 -1
  72. package/dist/client/assets/{command-iQT6jCQU.js → command-BYX4qb2w.js} +1 -1
  73. package/dist/client/assets/commerce-onboarding-CDqksq9U.js +1 -0
  74. package/dist/client/assets/{connect-desktop-dialog-De9JC7oT.js → connect-desktop-dialog-BF0VSR7T.js} +1 -1
  75. package/dist/client/assets/{connection-card-DYHA2ePc.js → connection-card-DwGPJWyE.js} +1 -1
  76. package/dist/client/assets/{connection-detail-sh8xmIan.js → connection-detail-CT9n-QmU.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-ND0px4nU.js → connection-form-helpers-DrUBawqy.js} +1 -1
  78. package/dist/client/assets/{connections-NvKjpKKp.js → connections-C2tp26A-.js} +1 -1
  79. package/dist/client/assets/{context-menu-DB01iJsV.js → context-menu-C6eVQEYm.js} +1 -1
  80. package/dist/client/assets/{decopilot-C9TC61Tp.js → decopilot-CqCNGPx_.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-BgtEj3BO.js → decopilot-sse-pool-Bw_DwJEl.js} +1 -1
  82. package/dist/client/assets/{dialog-vzDSbn7L.js → dialog-CTipuzl6.js} +1 -1
  83. package/dist/client/assets/{domain-settings-B1ZU2GFJ.js → domain-settings-BnkhuJCD.js} +1 -1
  84. package/dist/client/assets/{drawer-Bg7-Dl26.js → drawer-BSwKETX5.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-CuFgB89G.js → dropdown-menu-BBNvR5OT.js} +1 -1
  86. package/dist/client/assets/{empty-state-CvgPTCjJ.js → empty-state-D8k1NLND.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-n-h18tII.js → extract-connection-data-Bz9TVl-K.js} +1 -1
  88. package/dist/client/assets/{file-explorer-DDeLz7xB.js → file-explorer-Bsx6bRNf.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-BRr20zQ9.js → file-type-icon-DjJVM1gG.js} +1 -1
  90. package/dist/client/assets/{files-UWZZJX3_.js → files-Ddzq9b4u.js} +1 -1
  91. package/dist/client/assets/{form-BR7032VY.js → form-Do8pTdBI.js} +1 -1
  92. package/dist/client/assets/{general-BuUOvdGr.js → general-CfkVgJqF.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-Ca8-WZ6L.js → github-repo-picker-N9UkOi7h.js} +1 -1
  94. package/dist/client/assets/{hooks-CaS80xtt.js → hooks-Dx0c1s8_.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-CsA8G5b5.js → import-from-deco-dialog-DI0HmriR.js} +1 -1
  96. package/dist/client/assets/{index-CFxtND-D.js → index-BCcq5mEm.js} +3 -3
  97. package/dist/client/assets/{index-RTUq9ofQ.js → index-BhoafCxK.js} +1 -1
  98. package/dist/client/assets/{index-DgTzpZTX.js → index-Br8MJOrN.js} +1 -1
  99. package/dist/client/assets/{index-lpCPRzwS.js → index-BsqiPdZR.js} +1 -1
  100. package/dist/client/assets/{index-a1rhpXFO.js → index-BySnvWYc.js} +1 -1
  101. package/dist/client/assets/{index-CI9gZKY4.js → index-CeP-Qmzp.js} +1 -1
  102. package/dist/client/assets/{index-1R4D7cwC.js → index-CgXMFXAT.js} +1 -1
  103. package/dist/client/assets/{index-To3riLZY.js → index-DaLw847-.js} +1 -1
  104. package/dist/client/assets/{index-CBquAB3Y.js → index-Db4GgM5K.js} +1 -1
  105. package/dist/client/assets/{index-w_9m850o.js → index-YAeeG7UP.js} +1 -1
  106. package/dist/client/assets/{index-C3Ikqs0n.js → index-ijwETCyv.js} +5 -5
  107. package/dist/client/assets/{index-MCh1C7h8.js → index-jga7AlCH.js} +1 -1
  108. package/dist/client/assets/{index-F1yNAmcr.js → index-oxYt_7ys.js} +1 -1
  109. package/dist/client/assets/{index-redirect-CaD-Bk3y.js → index-redirect-DYCj9zOp.js} +1 -1
  110. package/dist/client/assets/{index-CG5SwyV0.js → index-w4hGyTYy.js} +1 -1
  111. package/dist/client/assets/{input-DgMx0wzZ.js → input-DGk_PSq2.js} +1 -1
  112. package/dist/client/assets/{integration-icon-B9eaFgP5.js → integration-icon-CEyadkOH.js} +1 -1
  113. package/dist/client/assets/{label-COJYTWhT.js → label-BCsKDLMl.js} +1 -1
  114. package/dist/client/assets/{login-BmOTfEC2.js → login-Puo546l4.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-Dz_ZLIOa.js → mcp-oauth-B_uMRHEb.js} +1 -1
  116. package/dist/client/assets/{members-T-ENj2jU.js → members-XpsOBld2.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-KkcyKbDr.js → monaco-editor-DgkI5ejH.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-BCozJ2G1.js → monitoring-stats-row-CB1Lxysi.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-UyIkLBxF.js → oauth-callback-Br6PbuKG.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-DxadaECY.js → oauth-callback-ai-provider-CqnzINYw.js} +1 -1
  121. package/dist/client/assets/{onboarding-HWRkBtpi.js → onboarding-DFUYpI_8.js} +1 -1
  122. package/dist/client/assets/{org-install-Btw6aO95.js → org-install-DeUC7zeN.js} +1 -1
  123. package/dist/client/assets/{org-layout-DkGJ4JJo.js → org-layout-mCHG_IY8.js} +1 -1
  124. package/dist/client/assets/{organization-choice-DS6_apZN.js → organization-choice-BgXOgosL.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-jVEnLnuT.js → page-seo-form-h5dCnFzr.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-Ch0hzhJK.js +1 -0
  127. package/dist/client/assets/{popover-CJsAgEpE.js → popover-3YFp1bur.js} +1 -1
  128. package/dist/client/assets/{post-editor-BYz_o6Vw.js → post-editor-CnVmzXKl.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-DeiamaUR.js → preview-dialog-CWDJwyc7.js} +1 -1
  130. package/dist/client/assets/{primitives-Dy3LeAwC.js → primitives-DVLybABf.js} +1 -1
  131. package/dist/client/assets/{profile-Bh7nWsTb.js → profile-CEAXrYyQ.js} +1 -1
  132. package/dist/client/assets/project-app-view-ur6HVE9s.js +1 -0
  133. package/dist/client/assets/record-editor-CwXasMrO.js +1 -0
  134. package/dist/client/assets/registry-B1ttyxu3.js +2 -0
  135. package/dist/client/assets/{registry-layout-CtCkqVpK.js → registry-layout-Bp9v2hfA.js} +1 -1
  136. package/dist/client/assets/{require-capability-CnGVIAFy.js → require-capability-DP71gdXv.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-CmHxB6sm.js → required-auth-layout-_77fEFR3.js} +1 -1
  138. package/dist/client/assets/{reset-password-BXmhC6bN.js → reset-password-DS2Z-nb7.js} +1 -1
  139. package/dist/client/assets/{roles-Ddlvq9dn.js → roles-CdOxDvwE.js} +1 -1
  140. package/dist/client/assets/{save-status-DRBQPn23.js → save-status-BnVkGo_Q.js} +1 -1
  141. package/dist/client/assets/{scroll-area-CfenrEEW.js → scroll-area-Bh3hUqbK.js} +1 -1
  142. package/dist/client/assets/{search-input-Cw0vBwo5.js → search-input-5ZYBaQ0P.js} +1 -1
  143. package/dist/client/assets/{secrets-CBbes7Ds.js → secrets-BCe7YGa3.js} +1 -1
  144. package/dist/client/assets/{sections-editor-BovBZ8mw.js → sections-editor-D_hJj6Q7.js} +1 -1
  145. package/dist/client/assets/{select-v123Plev.js → select-D9_z8vsC.js} +1 -1
  146. package/dist/client/assets/{select-model-JFlCldo3.js → select-model-Bx7yznIB.js} +1 -1
  147. package/dist/client/assets/{seo-editor-CnFwtTWq.js → seo-editor-CG2hWRFF.js} +1 -1
  148. package/dist/client/assets/{settings-layout-DFSQzxnj.js → settings-layout-wEttcE6A.js} +1 -1
  149. package/dist/client/assets/{settings-section-BmryiFIQ.js → settings-section-DyWUozYt.js} +1 -1
  150. package/dist/client/assets/{sheet-JJCnCeDP.js → sheet-y2VMj6Hv.js} +1 -1
  151. package/dist/client/assets/{shell-controls-DnCKN5Ud.js → shell-controls-CXBHct6v.js} +1 -1
  152. package/dist/client/assets/{shell-layout-Plyn5NRY.js → shell-layout-D4MJikSK.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-BmsMbzWG.js → shell-route-loading-BqdPLAVi.js} +1 -1
  154. package/dist/client/assets/{sidebar-BehvUVpU.js → sidebar-BPKBpkyc.js} +1 -1
  155. package/dist/client/assets/{skeleton-B6FQVjtu.js → skeleton-BoqNEonw.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-C0gt2PqU.js → sortable.esm-CSsw1cz1.js} +1 -1
  157. package/dist/client/assets/{sso-C3OBHGAQ.js → sso-CcosijxX.js} +1 -1
  158. package/dist/client/assets/{store-Dvz6CshC.js → store-DCWW6Mdg.js} +1 -1
  159. package/dist/client/assets/store-registry-B61e-bul.js +2 -0
  160. package/dist/client/assets/{studio-tools-DOSKR-eb.js → studio-tools-BnDVvd4v.js} +1 -1
  161. package/dist/client/assets/{switch-BQ-vU6yK.js → switch-CbCMlxtj.js} +1 -1
  162. package/dist/client/assets/{table-CJawEX9y.js → table-BgPe6DHr.js} +1 -1
  163. package/dist/client/assets/{tabs-D8WMETBf.js → tabs-Bzqh1-WZ.js} +1 -1
  164. package/dist/client/assets/{task-status-BrMs6CVv.js → task-status-DscVmQWJ.js} +1 -1
  165. package/dist/client/assets/{textarea-CY5Vsa-T.js → textarea-ft-VGKJb.js} +1 -1
  166. package/dist/client/assets/{toggle-group-MRG_3v3y.js → toggle-group-BUY5WJjX.js} +1 -1
  167. package/dist/client/assets/{toolbar-W7ENetSC.js → toolbar-CiHnS-SP.js} +1 -1
  168. package/dist/client/assets/{tooltip-DElXTBWP.js → tooltip-D3TPNQPW.js} +1 -1
  169. package/dist/client/assets/{types-Cc424u4b.js → types-B85LSoEX.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-DIlFm4AM.js → use-ai-providers-BcbjLoxo.js} +1 -1
  171. package/dist/client/assets/{use-automations-BZUZ9XFU.js → use-automations-DzasrD2F.js} +1 -1
  172. package/dist/client/assets/{use-capability-cUl1G9Do.js → use-capability-Bl9z3Glp.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-CLRXhn1s.js → use-clock-tick-Cy3vi59F.js} +1 -1
  174. package/dist/client/assets/{use-collections-DTrKVvNZ.js → use-collections-UVFNVv_T.js} +1 -1
  175. package/dist/client/assets/{use-connection-CjqwS69Q.js → use-connection-DIT7phDF.js} +1 -1
  176. package/dist/client/assets/{use-copy-BHQua8yv.js → use-copy-_a9lWNmq.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-CKRlPnJl.js → use-create-virtual-mcp-BQa1akl-.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-FsErIFB3.js → use-debounced-autosave-DrWjeXRE.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-CA4EZnYy.js → use-delete-connection-DXVWH9Za.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-C59dtoKf.js → use-file-configs-obUNcDIJ.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-KnvVbID4.js → use-infinite-scroll-DmspQo1h.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-CQPtg_73.js → use-join-requests-Cj3b4NF2.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-BOmWfyRe.js → use-mcp-client-C_TUAVtl.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-DVjpTNQh.js → use-mcp-prompts-qPiIDSzH.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-ipa9WEE1.js → use-mcp-tools-DwHizuib.js} +1 -1
  186. package/dist/client/assets/{use-members-BNRRCPdZ.js → use-members-CRNvKyvX.js} +1 -1
  187. package/dist/client/assets/{use-mobile-DZPQppT0.js → use-mobile-BxrMQICl.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-GXXWcsnL.js → use-navigate-to-agent-CyvQrB2G.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-Dqbh4-dV.js → use-org-auth-client-DjywUkXs.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-BS7eOw0w.js → use-org-sso-DbifMCMJ.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-QHsDSIHK.js → use-organization-roles-CD54syZF.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-B6o-OHM0.js → use-organization-settings-B5MWsVKM.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-BlbfO2IS.js → use-registry-connections-CXN7j0mL.js} +1 -1
  194. package/dist/client/assets/{use-secrets-D116hNBX.js → use-secrets-CSujo6Xx.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-CJwkGjdA.js → use-status-sounds-Damu-cxJ.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-QIXaEFHP.js → use-view-mode-B5zcwakn.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-BAJGZSzT.js → use-virtual-mcp-D8kOWS7C.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-UlJqHell.js +1 -0
  199. package/dist/client/assets/useSuspenseInfiniteQuery-B6ijARJm.js +1 -0
  200. package/dist/client/assets/{useSuspenseQueries-5nhzR5RI.js → useSuspenseQueries-kwX2iDD9.js} +1 -1
  201. package/dist/client/assets/{variant-calendar-CrA1LQ-_.js → variant-calendar-tFoSt5zU.js} +1 -1
  202. package/dist/client/assets/{view-mode-toggle-VC3gXYv-.js → view-mode-toggle-C4MeyYFK.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +1 -1
  205. package/package.json +1 -1
  206. package/dist/client/assets/commerce-onboarding-Baa8XyuB.js +0 -1
  207. package/dist/client/assets/page-seo-sheet-3yKPfGj2.js +0 -1
  208. package/dist/client/assets/project-app-view-KV11o8fi.js +0 -1
  209. package/dist/client/assets/record-editor-BrHdaws8.js +0 -1
  210. package/dist/client/assets/registry-BJqcdGj4.js +0 -2
  211. package/dist/client/assets/store-registry-DR40on4b.js +0 -2
  212. package/dist/client/assets/useInfiniteQuery-CKC8ud6E.js +0 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-DVOudNKB.js +0 -1
@@ -1 +1 @@
1
- import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-CFxtND-D.js";import{E as Ee}from"./empty-state-CvgPTCjJ.js";import{u as et,a as Ae}from"./use-collections-DTrKVvNZ.js";import{u as ce}from"./use-mcp-client-BOmWfyRe.js";import{F as ne,a as tt,b as de,d as me}from"./form-BR7032VY.js";import{I as ue}from"./input-DgMx0wzZ.js";import{T as re}from"./textarea-CY5Vsa-T.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-CG5SwyV0.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-yP9sr5R9.js";import{g as ut,M as xt,a as Ne}from"./types-Cc424u4b.js";import{A as pt,a as ft,b as ht}from"./alert-IQpHoeix.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-v123Plev.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-DElXTBWP.js";import{i as jt}from"./AlertCircle-DiN5PNxL.js";import{s as bt}from"./Stars02-C1UT1VVg.js";import{a as Nt}from"./Eye-C9Xcteq-.js";import{i as vt}from"./Play-C6GLqD32.js";import{i as St}from"./ChevronRight-QnPbpAFs.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-1R4D7cwC.js";import{a as Oe,u as Re}from"./use-connection-CjqwS69Q.js";import{a as It}from"./use-mcp-tools-ipa9WEE1.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-B9eaFgP5.js";import{f as Tt,h as Pt}from"./chat-context-xREAp4B7.js";import{b as kt}from"./shell-layout-Plyn5NRY.js";import{M as Et}from"./monaco-editor-KkcyKbDr.js";import{n as At}from"./XCircle-CHDEEtEA.js";import"./auth-ZfvkJMyI.js";import"./label-COJYTWhT.js";import"./index-lpCPRzwS.js";import"./sidebar-BehvUVpU.js";import"./LayoutLeft-9cH5exAu.js";import"./use-mobile-DZPQppT0.js";import"./sheet-JJCnCeDP.js";import"./X-D_fWZW_l.js";import"./ZoomOut-Cf_spvIb.js";import"./Key01-UGjka7-8.js";import"./extract-connection-data-n-h18tII.js";import"./use-registry-connections-BlbfO2IS.js";import"./use-organization-settings-B6o-OHM0.js";import"./studio-tools-DOSKR-eb.js";import"./Plus-_eqCuzKq.js";import"./index-To3riLZY.js";import"./index-RTUq9ofQ.js";import"./popover-CJsAgEpE.js";import"./use-virtual-mcp-BAJGZSzT.js";import"./ChevronUp-DDcyY4lP.js";import"./SearchMd-mD6Ay2_2.js";import"./Users03-GYv7mrmw.js";import"./use-create-virtual-mcp-CKRlPnJl.js";import"./use-navigate-to-agent-GXXWcsnL.js";import"./Tool01-Bm3M6NoB.js";import"./SwitchHorizontal01-D1Th0ly2.js";import"./Settings02--ds2DgAs.js";import"./ArrowUpRight-BjAmmqz1.js";import"./ZapSquare-CueUsJjX.js";import"./CheckCircle-CnuxNI5N.js";import"./ChevronDown-DjUjI7ZT.js";import"./ChevronLeft-lLbYNeaE.js";import"./DotsVertical-nNi8MPL2.js";import"./Globe01-BFrZD27Y.js";import"./FilterLines-Dg7IUTjL.js";import"./Star01-_A6IWzfx.js";import"./Globe04-CIm9kMjI.js";import"./HardDrive-gwEfMPwy.js";import"./LinkExternal01-B7eQGHi-.js";import"./Monitor01-DVS9ezxf.js";import"./Sun-sjbshFON.js";import"./Palette-T8Kt-mN9.js";import"./Shield01-CCDRrSJj.js";import"./Stars01-BqxzzW0i.js";import"./Trash01-DbUKlIo5.js";import"./Upload01-BMDi_b3F.js";import"./User01-DZEkuBTV.js";import"./Users01-Bx1kyCMQ.js";import"./XClose-YfgGVuLX.js";import"./Zap-BHyU9C4-.js";import"./mcp-oauth-Dz_ZLIOa.js";import"./badge-CGez4o7S.js";import"./hooks-CaS80xtt.js";import"./decopilot-sse-pool-BgtEj3BO.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-DIlFm4AM.js";import"./tab-id-BptcWVWa.js";import"./avatar-Xx6WG8hL.js";import"./dialog-vzDSbn7L.js";import"./required-auth-layout-CmHxB6sm.js";import"./use-org-sso-BS7eOw0w.js";import"./index-DgTzpZTX.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
1
+ import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-BCcq5mEm.js";import{E as Ee}from"./empty-state-D8k1NLND.js";import{u as et,a as Ae}from"./use-collections-UVFNVv_T.js";import{u as ce}from"./use-mcp-client-C_TUAVtl.js";import{F as ne,a as tt,b as de,d as me}from"./form-Do8pTdBI.js";import{I as ue}from"./input-DGk_PSq2.js";import{T as re}from"./textarea-ft-VGKJb.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-w4hGyTYy.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-BTjjwa0L.js";import{g as ut,M as xt,a as Ne}from"./types-B85LSoEX.js";import{A as pt,a as ft,b as ht}from"./alert-BYVK5o4v.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-D9_z8vsC.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-D3TPNQPW.js";import{i as jt}from"./AlertCircle-DWRjxcjZ.js";import{s as bt}from"./Stars02-CEThiQSi.js";import{a as Nt}from"./Eye-YMDMgm08.js";import{i as vt}from"./Play-DA8a3jos.js";import{i as St}from"./ChevronRight-BBTACrNR.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-CgXMFXAT.js";import{a as Oe,u as Re}from"./use-connection-DIT7phDF.js";import{a as It}from"./use-mcp-tools-DwHizuib.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-CEyadkOH.js";import{f as Tt,h as Pt}from"./chat-context-D58BzJe_.js";import{b as kt}from"./shell-layout-D4MJikSK.js";import{M as Et}from"./monaco-editor-DgkI5ejH.js";import{n as At}from"./XCircle-B1xLViF5.js";import"./auth-7J11gNlS.js";import"./label-BCsKDLMl.js";import"./index-BsqiPdZR.js";import"./sidebar-BPKBpkyc.js";import"./LayoutLeft-CtuVexdB.js";import"./use-mobile-BxrMQICl.js";import"./sheet-y2VMj6Hv.js";import"./X-DjWG0hX7.js";import"./ZoomOut-D42GS1SN.js";import"./Key01-B4CExV41.js";import"./extract-connection-data-Bz9TVl-K.js";import"./use-registry-connections-CXN7j0mL.js";import"./use-organization-settings-B5MWsVKM.js";import"./studio-tools-BnDVvd4v.js";import"./Plus-SlW0q5yX.js";import"./index-DaLw847-.js";import"./index-BhoafCxK.js";import"./popover-3YFp1bur.js";import"./use-virtual-mcp-D8kOWS7C.js";import"./ChevronUp-jJeRT2mj.js";import"./SearchMd-ClujlLQv.js";import"./Users03-CqSxH_Qt.js";import"./use-create-virtual-mcp-BQa1akl-.js";import"./use-navigate-to-agent-CyvQrB2G.js";import"./Tool01-HyTzOpJW.js";import"./SwitchHorizontal01-CB6Ftuon.js";import"./Settings02-Dp79GuWN.js";import"./ArrowUpRight-CLh7cOmb.js";import"./ZapSquare-CdhXF508.js";import"./CheckCircle-C4Wk34SG.js";import"./ChevronDown-DC4RMF38.js";import"./ChevronLeft-DdoVJ5fA.js";import"./DotsVertical-29yrOwC6.js";import"./Globe01-DLVxAcSk.js";import"./FilterLines-CDFJJbs9.js";import"./Star01-AP7UbAGc.js";import"./Globe04-y517FmZA.js";import"./HardDrive-CoKqxjZs.js";import"./LinkExternal01-crM7UKlh.js";import"./Monitor01-D9go3rqh.js";import"./Sun-G4s8dxx3.js";import"./Palette-JF4PDx7U.js";import"./Shield01-RdYbiHdR.js";import"./Stars01-zyT5SVEM.js";import"./Trash01-Ds1aAv2J.js";import"./Upload01-Brjb-Miw.js";import"./User01-BJ1Ytuty.js";import"./Users01-D5WbTGiR.js";import"./XClose-BTf3KNPL.js";import"./Zap-CEcQSou4.js";import"./mcp-oauth-B_uMRHEb.js";import"./badge-uCngvERR.js";import"./hooks-Dx0c1s8_.js";import"./decopilot-sse-pool-Bw_DwJEl.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BcbjLoxo.js";import"./tab-id-BptcWVWa.js";import"./avatar-DogX32xW.js";import"./dialog-CTipuzl6.js";import"./required-auth-layout-_77fEFR3.js";import"./use-org-sso-DbifMCMJ.js";import"./index-Br8MJOrN.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-CFxtND-D.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-CuFgB89G.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-D1Th0ly2.js";import{i as S}from"./ChevronUp-DDcyY4lP.js";import{a as I,b as K,c as P,T as W}from"./tooltip-DElXTBWP.js";import{V as q}from"./view-mode-toggle-VC3gXYv-.js";import{B as G}from"./badge-CGez4o7S.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
1
+ import{c as B,j as s,l as M,B as V}from"./index-BCcq5mEm.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-BBNvR5OT.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-CB6Ftuon.js";import{i as S}from"./ChevronUp-jJeRT2mj.js";import{a as I,b as K,c as P,T as W}from"./tooltip-D3TPNQPW.js";import{V as q}from"./view-mode-toggle-C4MeyYFK.js";import{B as G}from"./badge-uCngvERR.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
@@ -1 +1 @@
1
- import{c as v,l as b,j as a,i as w}from"./index-CFxtND-D.js";import{i as C}from"./SearchMd-mD6Ay2_2.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
1
+ import{c as v,l as b,j as a,i as w}from"./index-BCcq5mEm.js";import{i as C}from"./SearchMd-ClujlLQv.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
@@ -1 +1 @@
1
- import{c as f,l as u,j as m}from"./index-CFxtND-D.js";import{B as g}from"./badge-CGez4o7S.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{c as f,l as u,j as m}from"./index-BCcq5mEm.js";import{B as g}from"./badge-uCngvERR.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{c as d,l as i,j as n}from"./index-CFxtND-D.js";import{_ as m}from"./index-RTUq9ofQ.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-vzDSbn7L.js";import{i as y}from"./SearchMd-mD6Ay2_2.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
1
+ import{c as d,l as i,j as n}from"./index-BCcq5mEm.js";import{_ as m}from"./index-BhoafCxK.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-CTipuzl6.js";import{i as y}from"./SearchMd-ClujlLQv.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
@@ -0,0 +1 @@
1
+ import{c as E,r as D,l as X,j as t,B as V,m as dt,d as Oe,K as W,o as He,s as fe,n as Be,p as Ge,i as ut,k as mt,q as me,Q as ft,E as pt,a as Re,u as gt,b as ht,v as Et,w as xt,L as Tt}from"./index-BCcq5mEm.js";import{A as Ot}from"./auth-entry-leDvythG.js";import{A as Rt}from"./auth-split-layout-BCexxGWd.js";import{O as lt}from"./organization-choice-BgXOgosL.js";import{f as Ut}from"./tab-id-BptcWVWa.js";import{I as Ue}from"./input-DGk_PSq2.js";import{u as $e,W as yt,S as jt,g as $t,C as At}from"./use-mcp-client-C_TUAVtl.js";import{i as bt}from"./XCircle-B1xLViF5.js";import{I as Ct}from"./integration-icon-CEyadkOH.js";import{D as Qe,a as zt,b as Pt,c as Lt,d as Dt,e as Kt}from"./dialog-CTipuzl6.js";import{T as Mt,a as Ft,b as qt}from"./tooltip-D3TPNQPW.js";import{i as We}from"./CheckCircle-C4Wk34SG.js";import{i as Vt}from"./ZoomOut-D42GS1SN.js";import{g as Ht,c as Bt,e as Gt}from"./extract-connection-data-Bz9TVl-K.js";import{F as pe,a as Ye,b as ge,c as Ke,d as he,e as xe}from"./form-Do8pTdBI.js";import{i as Qt}from"./ChevronUp-jJeRT2mj.js";import{s as Wt,a as Yt}from"./Eye-YMDMgm08.js";import{i as Zt}from"./Settings02-Dp79GuWN.js";import{i as Xt}from"./agent-icon-BTjjwa0L.js";import{u as Jt}from"./useSuspenseQueries-kwX2iDD9.js";import{a as en}from"./authenticate-and-persist-oauth-DEQ0hHIu.js";import{i as St}from"./ArrowUpRight-CLh7cOmb.js";import{s as vt}from"./User01-BJ1Ytuty.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DogX32xW.js";import"./auth-7J11gNlS.js";import"./X-DjWG0hX7.js";import"./label-BCsKDLMl.js";import"./AlertCircle-DWRjxcjZ.js";import"./Tool01-HyTzOpJW.js";import"./SwitchHorizontal01-CB6Ftuon.js";import"./ZapSquare-CdhXF508.js";import"./Users03-CqSxH_Qt.js";import"./ChevronDown-DC4RMF38.js";import"./ChevronLeft-DdoVJ5fA.js";import"./ChevronRight-BBTACrNR.js";import"./DotsVertical-29yrOwC6.js";import"./Stars02-CEThiQSi.js";import"./Globe01-DLVxAcSk.js";import"./FilterLines-CDFJJbs9.js";import"./Star01-AP7UbAGc.js";import"./Globe04-y517FmZA.js";import"./HardDrive-CoKqxjZs.js";import"./Key01-B4CExV41.js";import"./LayoutLeft-CtuVexdB.js";import"./LinkExternal01-crM7UKlh.js";import"./Monitor01-D9go3rqh.js";import"./Sun-G4s8dxx3.js";import"./Palette-JF4PDx7U.js";import"./Play-DA8a3jos.js";import"./Plus-SlW0q5yX.js";import"./SearchMd-ClujlLQv.js";import"./Shield01-RdYbiHdR.js";import"./Stars01-zyT5SVEM.js";import"./Trash01-Ds1aAv2J.js";import"./Upload01-Brjb-Miw.js";import"./Users01-D5WbTGiR.js";import"./XClose-BTf3KNPL.js";import"./Zap-CEcQSou4.js";import"./mcp-oauth-B_uMRHEb.js";const tn=/^[a-zA-Z][a-zA-Z\d+.-]*:/,nn=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,sn=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,on=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ee(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=tn.test(e),i=nn.test(e),o=sn.test(e);if(n&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=i?e:`https://${e}`;let r;try{r=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=r.hostname.split(".");return c.length<2||c.some(l=>!l||!on.test(l))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function Fe(s){const e=E.c(14),{children:n,className:i,wrapperClassName:o}=s,[a,r]=D.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=C=>{if(!C)return;const x=()=>{const u=C.scrollHeight-C.scrollTop-C.clientHeight<8;r(u)};x(),C.addEventListener("scroll",x,{passive:!0});const g=new ResizeObserver(x);g.observe(C);for(const u of Array.from(C.children))g.observe(u);return()=>{C.removeEventListener("scroll",x),g.disconnect()}},e[0]=c):c=e[0];const l=c;let m;e[1]!==o?(m=X("relative",o),e[1]=o,e[2]=m):m=e[2];let f;e[3]!==n||e[4]!==i?(f=t.jsx("div",{ref:l,className:i,children:n}),e[3]=n,e[4]=i,e[5]=f):f=e[5];const p=a?"opacity-0":"opacity-100";let d;e[6]!==p?(d=X("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",p),e[6]=p,e[7]=d):d=e[7];let h;e[8]!==d?(h=t.jsx("div",{"aria-hidden":!0,className:d}),e[8]=d,e[9]=h):h=e[9];let j;return e[10]!==m||e[11]!==f||e[12]!==h?(j=t.jsxs("div",{className:m,children:[f,h]}),e[10]=m,e[11]=f,e[12]=h,e[13]=j):j=e[13],j}function rn(s){const e=s.properties;if(!e)return[];const n=[];for(const[i,o]of Object.entries(e)){const c=o?.properties?.__type?.const;typeof c=="string"&&c.length>0&&n.push({fieldKey:i,bindingType:c})}return n}function ln(s,e){const n=[];if(s.length&&n.push({field:["id"],operator:"in",value:s}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function Z(s){const e=s;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??s}function an(s,e,n,i){return{...s??{},[e]:{__type:n,value:i}}}function qe(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(qe):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&qe(n)):!1}function cn(s){return s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function dn(s){return qe(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function un(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const i=dn(n);return i?[{key:e,label:cn(e),value:i}]:[]}):[]}function mn({autoOpenFieldKey:s,card:e}){return s===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function fn(s,e,n){const i=s.filter(o=>o.app_name===e||!!n&&o.app_id===n);return i.length===0?null:(i.sort((o,a)=>{const r=c=>c.status==="active"?0:1;return r(o)!==r(a)?r(o)-r(a):(a.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function pn(s){return s.server?.icons?.[0]?.src??Ht(s.server?.repository)??null}function gn(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function hn(s){const e=[],n=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],a=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!a)continue;const r=s.configurationState?.[i.fieldKey]?.value,c=r?n.get(r):void 0,l=r&&c?r:null,m=l?s.connectionReadiness?.[l]!==!1:!1,f=!!l&&m;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:a,title:gn(a,i.bindingType),icon:pn(a),headline:o?.headline??a._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:l||fn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:l,configurationState:c?.configuration_state??null})}return e}function xn(s,e){if(!s)return null;const n=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=n(s);for(const o of e)if(n(o.siteUrl)===i)return o.siteUrl;return null}function yn(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:o.displayName}))}))}function at(s){const e=E.c(38);let n,i,o,a,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:n,...a}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=a,e[5]=r):(n=e[1],i=e[2],o=e[3],a=e[4],r=e[5]);const[c,l]=D.useState(!1),[m,f]=D.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(z){console.error("Failed to copy text: ",z)}},e[6]=r,e[7]=p):p=e[7];const d=p;let h;e[8]!==c?(h=()=>{l(!c)},e[8]=c,e[9]=h):h=e[9];const j=h,C=c?"text":"password";let x;e[10]!==n?(x=X("pr-20",n),e[10]=n,e[11]=x):x=e[11];let g;e[12]!==i||e[13]!==o||e[14]!==a||e[15]!==C||e[16]!==x||e[17]!==r?(g=t.jsx(Ue,{type:C,value:r,onChange:i,placeholder:o,className:x,...a}),e[12]=i,e[13]=o,e[14]=a,e[15]=C,e[16]=x,e[17]=r,e[18]=g):g=e[18];const u=c?"Hide password":"Show password";let b;e[19]!==c?(b=c?t.jsx(Zt,{size:16}):t.jsx(Wt,{size:16}),e[19]=c,e[20]=b):b=e[20];let y;e[21]!==u||e[22]!==b||e[23]!==j?(y=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:j,title:u,children:b}),e[21]=u,e[22]=b,e[23]=j,e[24]=y):y=e[24];const v=!r,_=m?"Copied!":"Copy token";let N;e[25]!==m?(N=m?t.jsx(Qt,{size:16}):t.jsx(Yt,{size:16}),e[25]=m,e[26]=N):N=e[26];let k;e[27]!==d||e[28]!==_||e[29]!==N||e[30]!==v?(k=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:d,disabled:v,title:_,children:N}),e[27]=d,e[28]=_,e[29]=N,e[30]=v,e[31]=k):k=e[31];let w;e[32]!==k||e[33]!==y?(w=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[y,k]}),e[32]=k,e[33]=y,e[34]=w):w=e[34];let T;return e[35]!==w||e[36]!==g?(T=t.jsxs("div",{className:"relative",children:[g,w]}),e[35]=w,e[36]=g,e[37]=T):T=e[37],T}function Ze(s){const e=E.c(19),{card:n,selfClient:i,org:o,onDone:a,onError:r}=s,c=dt();let l;e[0]!==n||e[1]!==i?(l=async x=>{const g={...n.configurationState??{},...x};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:g}}})},e[0]=n,e[1]=i,e[2]=l):l=e[2];let m;e[3]!==a||e[4]!==o||e[5]!==c?(m=async()=>{await c.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),a()},e[3]=a,e[4]=o,e[5]=c,e[6]=m):m=e[6];let f;e[7]!==r?(f=x=>{r?.(x)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==l||e[10]!==m||e[11]!==f?(p={mutationFn:l,onSuccess:m,onError:f},e[9]=l,e[10]=m,e[11]=f,e[12]=p):p=e[12];const d=Oe(p);let h;e[13]!==d?(h=x=>d.mutate(x),e[13]=d,e[14]=h):h=e[14];const j=h;let C;return e[15]!==d.error||e[16]!==d.isPending||e[17]!==j?(C={save:j,isPending:d.isPending,error:d.error},e[15]=d.error,e[16]=d.isPending,e[17]=j,e[18]=C):C=e[18],C}const jn=He({accountName:fe().min(1,"Account name is required"),appKey:fe().optional(),appToken:fe().optional()});function bn(s){const e=E.c(63),{card:n,selfClient:i,org:o,onDone:a,onIsPendingChange:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Be(jn),e[0]=c):c=e[0];const l=n.configurationState?.accountName||"",m=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let p;e[1]!==l||e[2]!==m||e[3]!==f?(p={resolver:c,defaultValues:{accountName:l,appKey:m,appToken:f}},e[1]=l,e[2]=m,e[3]=f,e[4]=p):p=e[4];const d=Ge(p);let h;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==d?(h=()=>{d.reset({accountName:n.configurationState?.accountName||"",appKey:n.configurationState?.appKey||"",appToken:n.configurationState?.appToken||""})},e[5]=n.configurationState?.accountName,e[6]=n.configurationState?.appKey,e[7]=n.configurationState?.appToken,e[8]=d,e[9]=h):h=e[9];let j;e[10]!==n.configurationState||e[11]!==d?(j=[n.configurationState,d],e[10]=n.configurationState,e[11]=d,e[12]=j):j=e[12],D.useEffect(h,j);let C;e[13]!==n||e[14]!==a||e[15]!==o||e[16]!==i?(C={card:n,selfClient:i,org:o,onDone:a},e[13]=n,e[14]=a,e[15]=o,e[16]=i,e[17]=C):C=e[17];const{save:x,isPending:g,error:u}=Ze(C);let b,y;e[18]!==g||e[19]!==r?(y=()=>{r?.(g)},b=[g,r],e[18]=g,e[19]=r,e[20]=b,e[21]=y):(b=e[20],y=e[21]),D.useEffect(y,b);let v;if(e[22]!==d||e[23]!==x){let K;e[25]!==x?(K=async S=>{x(S)},e[25]=x,e[26]=K):K=e[26],v=d.handleSubmit(K),e[22]=d,e[23]=x,e[24]=v}else v=e[24];const _=v;let N;e[27]!==g?(N=K=>{const{field:S}=K;return t.jsxs(ge,{children:[t.jsx(Ke,{children:"Account Name"}),t.jsx(he,{children:t.jsx(Ue,{placeholder:"Your VTEX account name",...S,disabled:g})}),t.jsx(xe,{})]})},e[27]=g,e[28]=N):N=e[28];let k;e[29]!==d.control||e[30]!==N?(k=t.jsx(pe,{control:d.control,name:"accountName",render:N}),e[29]=d.control,e[30]=N,e[31]=k):k=e[31];let w;e[32]!==g?(w=K=>{const{field:S}=K;return t.jsxs(ge,{children:[t.jsx(Ke,{children:"App Key (optional)"}),t.jsx(he,{children:t.jsx(at,{placeholder:"VTEX app key",...S,disabled:g})}),t.jsx(xe,{})]})},e[32]=g,e[33]=w):w=e[33];let T;e[34]!==d.control||e[35]!==w?(T=t.jsx(pe,{control:d.control,name:"appKey",render:w}),e[34]=d.control,e[35]=w,e[36]=T):T=e[36];let z;e[37]!==g?(z=K=>{const{field:S}=K;return t.jsxs(ge,{children:[t.jsx(Ke,{children:"App Token (optional)"}),t.jsx(he,{children:t.jsx(at,{placeholder:"VTEX app token",...S,disabled:g})}),t.jsx(xe,{})]})},e[37]=g,e[38]=z):z=e[38];let O;e[39]!==d.control||e[40]!==z?(O=t.jsx(pe,{control:d.control,name:"appToken",render:z}),e[39]=d.control,e[40]=z,e[41]=O):O=e[41];let I;e[42]!==d||e[43]!==k||e[44]!==T||e[45]!==O?(I=t.jsxs(Ye,{...d,children:[k,T,O]}),e[42]=d,e[43]=k,e[44]=T,e[45]=O,e[46]=I):I=e[46];let R;e[47]!==u?(R=u&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:u instanceof Error?u.message:"Failed to save configuration"}),e[47]=u,e[48]=R):R=e[48];let A;e[49]!==g||e[50]!==a?(A=t.jsx(V,{type:"button",variant:"outline",onClick:a,disabled:g,children:"Cancel"}),e[49]=g,e[50]=a,e[51]=A):A=e[51];const M=g?"Saving...":"Save";let q;e[52]!==g||e[53]!==M?(q=t.jsx(V,{type:"submit",disabled:g,children:M}),e[52]=g,e[53]=M,e[54]=q):q=e[54];let L;e[55]!==A||e[56]!==q?(L=t.jsxs(Qe,{className:"pt-4",children:[A,q]}),e[55]=A,e[56]=q,e[57]=L):L=e[57];let F;return e[58]!==_||e[59]!==I||e[60]!==R||e[61]!==L?(F=t.jsxs("form",{onSubmit:_,className:"space-y-4",children:[I,R,L]}),e[58]=_,e[59]=I,e[60]=R,e[61]=L,e[62]=F):F=e[62],F}function Nt(s){const e=E.c(30),{options:n,value:i,onChange:o,disabled:a,ariaLabel:r,searchPlaceholder:c}=s,l=c===void 0?"Search…":c,[m,f]=D.useState("");let p,d,h;if(e[0]!==n||e[1]!==m||e[2]!==i){const k=m.trim().toLowerCase();p=k?n.filter(w=>w.label.toLowerCase().includes(k)):n,d=p.map(Cn),h=d.includes(i)?i:d[0]??"",e[0]=n,e[1]=m,e[2]=i,e[3]=p,e[4]=d,e[5]=h}else p=e[3],d=e[4],h=e[5];const j=h;let C;e[6]!==a||e[7]!==d||e[8]!==o?(C=function(w){if(a||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(w.key))return;w.preventDefault();const z=w.currentTarget.dataset.value,O=d.indexOf(z),I=d.length;if(I===0)return;let R;w.key==="ArrowDown"||w.key==="ArrowRight"?R=(O+1)%I:w.key==="ArrowUp"||w.key==="ArrowLeft"?R=(O-1+I)%I:w.key==="Home"?R=0:R=I-1;const A=d[R];o(A),w.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(A)}"]`)?.focus()},e[6]=a,e[7]=d,e[8]=o,e[9]=C):C=e[9];const x=C;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Xt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[10]=g):g=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=k=>f(k.target.value),e[11]=u):u=e[11];const b=`Search ${r}`;let y;e[12]!==a||e[13]!==m||e[14]!==l||e[15]!==b?(y=t.jsxs("div",{className:"relative",children:[g,t.jsx(Ue,{type:"text",value:m,onChange:u,disabled:a,placeholder:l,"aria-label":b,className:"h-8 pl-8"})]}),e[12]=a,e[13]=m,e[14]=l,e[15]=b,e[16]=y):y=e[16];let v;e[17]!==a||e[18]!==p||e[19]!==x||e[20]!==o||e[21]!==j||e[22]!==i?(v=p.length===0?t.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"No results"}):p.map(k=>{const w=k.value===i;return t.jsxs("button",{type:"button",role:"radio","aria-checked":w,disabled:a,"data-value":k.value,tabIndex:k.value===j?0:-1,onClick:()=>o(k.value),onKeyDown:x,className:X("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",w?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[t.jsx("span",{className:"truncate",children:k.label}),w?t.jsx(We,{size:16,className:"shrink-0 text-primary"}):null]},k.value)}),e[17]=a,e[18]=p,e[19]=x,e[20]=o,e[21]=j,e[22]=i,e[23]=v):v=e[23];let _;e[24]!==r||e[25]!==v?(_=t.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:v}),e[24]=r,e[25]=v,e[26]=_):_=e[26];let N;return e[27]!==y||e[28]!==_?(N=t.jsxs("div",{className:"space-y-2",children:[y,_]}),e[27]=y,e[28]=_,e[29]=N):N=e[29],N}function Cn(s){return s.value}function Xe(s){const e=E.c(16),{label:n,iconSize:i,className:o,iconClassName:a,labelClassName:r}=s,c=i===void 0?14:i;let l;e[0]!==o?(l=X("inline-flex items-center gap-2",o),e[0]=o,e[1]=l):l=e[1];let m;e[2]!==a?(m=X("shrink-0 animate-spin",a),e[2]=a,e[3]=m):m=e[3];let f;e[4]!==c||e[5]!==m?(f=t.jsx(ut,{size:c,className:m}),e[4]=c,e[5]=m,e[6]=f):f=e[6];let p;e[7]!==r?(p=X("text-sm",r),e[7]=r,e[8]=p):p=e[8];let d;e[9]!==n||e[10]!==p?(d=t.jsx("span",{className:p,children:n}),e[9]=n,e[10]=p,e[11]=d):d=e[11];let h;return e[12]!==l||e[13]!==f||e[14]!==d?(h=t.jsxs("span",{className:l,children:[f,d]}),e[12]=l,e[13]=f,e[14]=d,e[15]=h):h=e[15],h}const Sn=He({propertyId:fe().min(1,"Property is required")});function vn(s){const e=E.c(55),{card:n,connectionId:i,companionClient:o,selfClient:a,org:r,onDone:c,onIsPendingChange:l}=s;let m;e[0]!==i||e[1]!==r.id?(m=W.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=m):m=e[2];let f;e[3]!==o?(f=async()=>{const S=await o.callTool({name:"get-account-summaries",arguments:{}}),P=Z(S);return yn(P)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==m||e[6]!==f?(p={queryKey:m,queryFn:f},e[5]=m,e[6]=f,e[7]=p):p=e[7];const d=mt(p);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Be(Sn),e[8]=h):h=e[8];const j=n.configurationState?.propertyId||"";let C;e[9]!==j?(C={resolver:h,defaultValues:{propertyId:j}},e[9]=j,e[10]=C):C=e[10];const x=Ge(C);let g;e[11]!==n||e[12]!==c||e[13]!==r||e[14]!==a?(g={card:n,selfClient:a,org:r,onDone:c},e[11]=n,e[12]=c,e[13]=r,e[14]=a,e[15]=g):g=e[15];const{save:u,isPending:b,error:y}=Ze(g);let v,_;e[16]!==b||e[17]!==l?(v=()=>{l?.(b)},_=[b,l],e[16]=b,e[17]=l,e[18]=v,e[19]=_):(v=e[18],_=e[19]),D.useEffect(v,_);let N;if(e[20]!==x||e[21]!==u){let S;e[23]!==u?(S=async P=>{u(P)},e[23]=u,e[24]=S):S=e[24],N=x.handleSubmit(S),e[20]=x,e[21]=u,e[22]=N}else N=e[22];const k=N;if(d.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:t.jsx(Xe,{label:"Loading properties…"})}),e[25]=S):S=e[25],S}if(d.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Analytics properties."})}),e[26]=S):S=e[26],S}let w;e[27]!==d.data?(w=d.data||[],e[27]=d.data,e[28]=w):w=e[28];const T=w;if(T.flatMap(_n).length===0){let S;return e[29]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No Google Analytics properties found. Please connect a Google Analytics account with properties."})}),e[29]=S):S=e[29],S}let O;e[30]!==b||e[31]!==T?(O=S=>{const{field:P}=S;return t.jsxs(ge,{children:[t.jsx(he,{children:t.jsx(Nt,{options:T.flatMap(Nn),value:P.value,onChange:P.onChange,disabled:b,ariaLabel:"Google Analytics Property"})}),t.jsx(xe,{})]})},e[30]=b,e[31]=T,e[32]=O):O=e[32];let I;e[33]!==x.control||e[34]!==O?(I=t.jsx(pe,{control:x.control,name:"propertyId",render:O}),e[33]=x.control,e[34]=O,e[35]=I):I=e[35];let R;e[36]!==x||e[37]!==I?(R=t.jsx(Ye,{...x,children:I}),e[36]=x,e[37]=I,e[38]=R):R=e[38];let A;e[39]!==y?(A=y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Failed to save configuration"}),e[39]=y,e[40]=A):A=e[40];let M;e[41]!==b||e[42]!==c?(M=t.jsx(V,{type:"button",variant:"outline",onClick:c,disabled:b,children:"Cancel"}),e[41]=b,e[42]=c,e[43]=M):M=e[43];const q=b?"Saving...":"Save";let L;e[44]!==b||e[45]!==q?(L=t.jsx(V,{type:"submit",disabled:b,children:q}),e[44]=b,e[45]=q,e[46]=L):L=e[46];let F;e[47]!==M||e[48]!==L?(F=t.jsxs(Qe,{className:"pt-4",children:[M,L]}),e[47]=M,e[48]=L,e[49]=F):F=e[49];let K;return e[50]!==k||e[51]!==R||e[52]!==A||e[53]!==F?(K=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[R,A,F]}),e[50]=k,e[51]=R,e[52]=A,e[53]=F,e[54]=K):K=e[54],K}function Nn(s){return s.options}function _n(s){return s.options}const wn=He({siteUrl:fe().min(1,"Site is required")});function kn(s){const e=E.c(59),{card:n,connectionId:i,companionClient:o,selfClient:a,org:r,contextSiteUrl:c,onDone:l,onIsPendingChange:m}=s;let f;e[0]!==i||e[1]!==r.id?(f=W.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const S=await o.callTool({name:"list_sites",arguments:{}});return Z(S).sites||[]},e[3]=o,e[4]=p):p=e[4];let d;e[5]!==f||e[6]!==p?(d={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=d):d=e[7];const h=mt(d);let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=Be(wn),e[8]=j):j=e[8];const C=n.configurationState?.siteUrl||"";let x;e[9]!==C?(x={resolver:j,defaultValues:{siteUrl:C}},e[9]=C,e[10]=x):x=e[10];const g=Ge(x);let u;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==a?(u={card:n,selfClient:a,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=a,e[15]=u):u=e[15];const{save:b,isPending:y,error:v}=Ze(u);let _,N;e[16]!==y||e[17]!==m?(_=()=>{m?.(y)},N=[y,m],e[16]=y,e[17]=m,e[18]=_,e[19]=N):(_=e[18],N=e[19]),D.useEffect(_,N);let k;if(e[20]!==g||e[21]!==b){let S;e[23]!==b?(S=async P=>{b(P)},e[23]=b,e[24]=S):S=e[24],k=g.handleSubmit(S),e[20]=g,e[21]=b,e[22]=k}else k=e[22];const w=k;if(h.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:t.jsx(Xe,{label:"Loading sites…"})}),e[25]=S):S=e[25],S}if(h.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Search Console sites."})}),e[26]=S):S=e[26],S}let T,z;if(e[27]!==n.configurationState?.siteUrl||e[28]!==c||e[29]!==g||e[30]!==h.data){z=Symbol.for("react.early_return_sentinel");e:{if(T=h.data||[],T.length===0){let P;e[33]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No verified sites found. Please verify a site in Google Search Console."})}),e[33]=P):P=e[33],z=P;break e}const S=n.configurationState?.siteUrl;if(S&&g.getValues("siteUrl")!==S)g.setValue("siteUrl",S);else if(!S&&!g.getValues("siteUrl")){const P=xn(c,T);P&&g.setValue("siteUrl",P)}}e[27]=n.configurationState?.siteUrl,e[28]=c,e[29]=g,e[30]=h.data,e[31]=T,e[32]=z}else T=e[31],z=e[32];if(z!==Symbol.for("react.early_return_sentinel"))return z;let O;e[34]!==y||e[35]!==T?(O=S=>{const{field:P}=S;return t.jsxs(ge,{children:[t.jsx(he,{children:t.jsx(Nt,{options:T.map(In),value:P.value,onChange:P.onChange,disabled:y,ariaLabel:"Verified Site"})}),t.jsx(xe,{})]})},e[34]=y,e[35]=T,e[36]=O):O=e[36];let I;e[37]!==g.control||e[38]!==O?(I=t.jsx(pe,{control:g.control,name:"siteUrl",render:O}),e[37]=g.control,e[38]=O,e[39]=I):I=e[39];let R;e[40]!==g||e[41]!==I?(R=t.jsx(Ye,{...g,children:I}),e[40]=g,e[41]=I,e[42]=R):R=e[42];let A;e[43]!==v?(A=v&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:"Failed to save configuration"}),e[43]=v,e[44]=A):A=e[44];let M;e[45]!==y||e[46]!==l?(M=t.jsx(V,{type:"button",variant:"outline",onClick:l,disabled:y,children:"Cancel"}),e[45]=y,e[46]=l,e[47]=M):M=e[47];const q=y?"Saving...":"Save";let L;e[48]!==y||e[49]!==q?(L=t.jsx(V,{type:"submit",disabled:y,children:q}),e[48]=y,e[49]=q,e[50]=L):L=e[50];let F;e[51]!==M||e[52]!==L?(F=t.jsxs(Qe,{className:"pt-4",children:[M,L]}),e[51]=M,e[52]=L,e[53]=F):F=e[53];let K;return e[54]!==w||e[55]!==R||e[56]!==A||e[57]!==F?(K=t.jsxs("form",{onSubmit:w,className:"space-y-4",children:[R,A,F]}),e[54]=w,e[55]=R,e[56]=A,e[57]=F,e[58]=K):K=e[58],K}function In(s){return{value:s.siteUrl,label:s.siteUrl}}const En={vtex:bn,"google-analytics":vn,"google-search-console":kn};function Tn(){const s=E.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),t.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=n):n=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[n,t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function Ve(s){const e=E.c(3),{children:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(We,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,t.jsx("p",{className:"text-sm text-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o}function On(s){const e=E.c(45),{card:n,connecting:i,disabled:o,onConnect:a,org:r,selfClient:c,siteUrl:l,autoOpenConfigFieldKey:m,onAutoOpenConfigHandled:f}=s,p=n.linkedConnectionId;let d;e[0]!==n.configurationState?(d=un(n.configurationState),e[0]=n.configurationState,e[1]=d):d=e[1];const h=d;let j;e[2]!==n.icon||e[3]!==n.title?(j=t.jsx(Ct,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=n.icon,e[3]=n.title,e[4]=j):j=e[4];let C;e[5]!==n.title?(C=t.jsx("p",{className:"flex-1 text-sm text-foreground",children:n.title}),e[5]=n.title,e[6]=C):C=e[6];let x;e[7]!==n.satisfied||e[8]!==n.title||e[9]!==i||e[10]!==o||e[11]!==a?(x=n.satisfied?t.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[t.jsx(We,{size:16})," Connected"]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:a,"aria-label":`Connect ${n.title}`,children:i?t.jsx(ut,{size:16,className:"animate-spin"}):"Connect"}),e[7]=n.satisfied,e[8]=n.title,e[9]=i,e[10]=o,e[11]=a,e[12]=x):x=e[12];let g;e[13]!==j||e[14]!==C||e[15]!==x?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[j,C,x]}),e[13]=j,e[14]=C,e[15]=x,e[16]=g):g=e[16];let u;e[17]!==n.checks?(u=n.checks!==null&&t.jsxs(Ve,{children:["+ ",n.checks," checks"]}),e[17]=n.checks,e[18]=u):u=e[18];let b;e[19]!==n.headline?(b=n.headline&&t.jsx(Ve,{children:n.headline}),e[19]=n.headline,e[20]=b):b=e[20];let y;e[21]!==n.bullets?(y=n.bullets.map(Rn),e[21]=n.bullets,e[22]=y):y=e[22];let v;e[23]!==n.candidateConnectionId||e[24]!==n.satisfied||e[25]!==n.title?(v=!n.satisfied&&n.candidateConnectionId&&t.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",n.title]}),e[23]=n.candidateConnectionId,e[24]=n.satisfied,e[25]=n.title,e[26]=v):v=e[26];let _;e[27]!==u||e[28]!==b||e[29]!==y||e[30]!==v?(_=t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[u,b,y,v]}),e[27]=u,e[28]=b,e[29]=y,e[30]=v,e[31]=_):_=e[31];let N;e[32]!==m||e[33]!==n||e[34]!==p||e[35]!==f||e[36]!==r||e[37]!==h||e[38]!==c||e[39]!==l?(N=n.satisfied&&p&&t.jsx(D.Suspense,{fallback:t.jsx(An,{}),children:t.jsx(zn,{card:n,org:r,selfClient:c,connectionId:p,savedConfigEntries:h,contextSiteUrl:l,autoOpen:mn({autoOpenFieldKey:m,card:n}),onAutoOpenHandled:f})}),e[32]=m,e[33]=n,e[34]=p,e[35]=f,e[36]=r,e[37]=h,e[38]=c,e[39]=l,e[40]=N):N=e[40];let k;return e[41]!==_||e[42]!==N||e[43]!==g?(k=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[g,_,N]}),e[41]=_,e[42]=N,e[43]=g,e[44]=k):k=e[44],k}function Rn(s){return t.jsx(Ve,{children:s},s)}function Un(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function $n(s){const e=E.c(2),{title:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configuration isn't available here yet for ",n,"."]})}),e[0]=n,e[1]=i):i=e[1],i}function An(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("div",{className:"h-5 w-24 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]})}),s[0]=e):e=s[0],e}function zn(s){const e=E.c(41),{card:n,org:i,selfClient:o,connectionId:a,savedConfigEntries:r,contextSiteUrl:c,autoOpen:l,onAutoOpenHandled:m}=s;let f;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(f={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=f):f=e[3];const p=$e(f),[d,h]=D.useState(l),[j,C]=D.useState(!1),x=En[n.bindingType];let g;e[4]!==l||e[5]!==m?(g=()=>{h(!1),l&&m()},e[4]=l,e[5]=m,e[6]=g):g=e[6];const u=g;let b;e[7]!==u||e[8]!==j?(b=R=>{if(!(!R&&j)){if(!R){u();return}h(!0)}},e[7]=u,e[8]=j,e[9]=b):b=e[9];const y=b;let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[10]=v):v=e[10];let _;e[11]!==r.length?(_=r.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration values saved yet."}),e[11]=r.length,e[12]=_):_=e[12];let N;e[13]!==_?(N=t.jsxs("div",{className:"grid gap-1",children:[v,_]}),e[13]=_,e[14]=N):N=e[14];let k;e[15]!==x||e[16]!==n.title||e[17]!==r.length?(k=r.length>0?t.jsxs(Mt,{children:[t.jsx(Ft,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>h(!0),"aria-label":`Edit ${n.title} configuration`,disabled:!x,children:t.jsx(Vt,{size:14})})}),t.jsx(qt,{children:"Edit configuration"})]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!0),disabled:!x,children:"Configure"}),e[15]=x,e[16]=n.title,e[17]=r.length,e[18]=k):k=e[18];let w;e[19]!==N||e[20]!==k?(w=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N,k]}),e[19]=N,e[20]=k,e[21]=w):w=e[21];let T;e[22]!==r?(T=r.length>0&&t.jsx("dl",{className:"grid gap-2",children:r.map(Pn)}),e[22]=r,e[23]=T):T=e[23];let z;e[24]!==w||e[25]!==T?(z=t.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[w,T]}),e[24]=w,e[25]=T,e[26]=z):z=e[26];let O;e[27]!==x||e[28]!==n||e[29]!==u||e[30]!==p||e[31]!==a||e[32]!==c||e[33]!==d||e[34]!==y||e[35]!==i||e[36]!==o?(O=x?t.jsx(zt,{open:d,onOpenChange:y,children:t.jsxs(Pt,{className:"sm:max-w-lg",children:[t.jsxs(Lt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[t.jsx(Ct,{icon:n.icon,name:n.title,size:"md",fit:"contain",className:"p-1.5"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t.jsx(Dt,{children:n.title}),t.jsxs(Kt,{children:["Configure ",n.title," to enrich data"]})]})]}),t.jsx(x,{card:n,connectionId:a,companionClient:p,selfClient:o,org:i,contextSiteUrl:c,onDone:u,onIsPendingChange:C})]})}):t.jsx($n,{title:n.title}),e[27]=x,e[28]=n,e[29]=u,e[30]=p,e[31]=a,e[32]=c,e[33]=d,e[34]=y,e[35]=i,e[36]=o,e[37]=O):O=e[37];let I;return e[38]!==z||e[39]!==O?(I=t.jsxs(t.Fragment,{children:[z,O]}),e[38]=z,e[39]=O,e[40]=I):I=e[40],I}function Pn(s){return t.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[t.jsx("dt",{className:"text-muted-foreground",children:s.label}),t.jsx("dd",{className:"truncate text-foreground",children:Un(s.key,s.value)})]},s.key)}const Je={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function Ln(s){const e=E.c(30),{selfClient:n,org:i,cdConnectionId:o}=s;let a;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(a={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=a):a=e[3];const r=$e(a);let c;e[4]!==o||e[5]!==i.id?(c=W.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=c):c=e[6];let l;e[7]!==r?(l=async()=>{const U=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return Z(U)},e[7]=r,e[8]=l):l=e[8];let m;e[9]!==c||e[10]!==l?(m={queryKey:c,queryFn:l},e[9]=c,e[10]=l,e[11]=m):m=e[11];const f=me(m),p=rn(f.data?.stateSchema??{properties:{}}),d=p.map(Qn),h=p.map(Gn).filter(Bn),j=p.filter(Hn).map(Vn),C=[...h,...j].sort().join(",");let x;e[12]!==o||e[13]!==i.id?(x=W.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==n?(g=async()=>{const U=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return Z(U)},e[15]=o,e[16]=n,e[17]=g):g=e[17];let u;e[18]!==x||e[19]!==g?(u={queryKey:x,queryFn:g},e[18]=x,e[19]=g,e[20]=u):u=e[20];const y=me(u).data?.item?.configuration_state??null;let v;e[21]!==y?(v=U=>y?.[U.fieldKey]?.value,e[21]=y,e[22]=v):v=e[22];const _=p.map(v).filter(qn),N=[...d.map(Fn),...h.map(Mn),..._.map(Kn)].sort().join(","),w=me({queryKey:W.commerceDiscoveryCompanionConnections(i.id,N),queryFn:async()=>{if(p.length===0)return{items:[]};const U=[{field:["app_name"],operator:"in",value:d},{field:["app_id"],operator:"in",value:h}];_.length>0&&U.push({field:["id"],operator:"in",value:_});const B=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:U},limit:1e3}});return Z(B)}}).data?.items??[],T=new Set(_),z=w.filter(U=>T.has(U.id)),O=z.filter(Dn);let I;e[23]!==i.id||e[24]!==i.slug?(I=U=>({queryKey:W.commerceDiscoveryCompanionOAuthStatus(i.id,U.id),queryFn:async()=>{try{const B=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(U.id)}/oauth-token/status`,{credentials:"include"});return B.ok?{hasToken:(await B.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=i.id,e[24]=i.slug,e[25]=I):I=e[25];const R=Jt({queries:O.map(I)});let A;e[26]!==R?(A=(U,B)=>[U.id,R[B]?.data?.hasToken===!0],e[26]=R,e[27]=A):A=e[27];const M=new Map(O.map(A)),q={};for(const U of z)q[U.id]=!U.oauth_config||!!U.connection_token||M.get(U.id)===!0;const L=me({queryKey:W.commerceDiscoveryCompanionRegistry(i.id,C),queryFn:async()=>{if(p.length===0)return{items:[]};const U=ln(h,j),B=await Bt(yt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...U?{where:U}:{},limit:1e3});return Z(B)}}),F={},K={};for(const U of L.data?.items??[])F[U.id]=U,U.server?.name&&(K[U.server.name]=U);const S=hn({requirements:p,itemsById:F,itemsByName:K,connections:w,connectionReadiness:q,configurationState:y,curated:Je});let P;return e[28]!==S?(P={cards:S},e[28]=S,e[29]=P):P=e[29],P}function Dn(s){return s.oauth_config&&!s.connection_token}function Kn(s){return`linked:${s}`}function Mn(s){return`app:${s}`}function Fn(s){return`binding:${s}`}function qn(s){return typeof s=="string"&&s.length>0}function Vn(s){return s.bindingType}function Hn(s){return!Je[s.bindingType]}function Bn(s){return!!s}function Gn(s){return Je[s.bindingType]?.registryAppId}function Qn(s){return s.bindingType}function Wn({selfClient:s,org:e,userId:n,cdConnectionId:i}){const o=dt(),[a,r]=D.useState(null),[c,l]=D.useState(null),m=async(p,d)=>{const h=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:d}});return Z(h)};async function f(p){r(p.fieldKey),l(null);try{let d=p.candidateConnectionId;if(!d){const u=Gt(p.registryItem,e.id,n,{remoteIndex:0}),b=u.connection_type==="STDIO",y=!!u.connection_url,v=b&&u.connection_headers&&typeof u.connection_headers=="object"&&"command"in u.connection_headers;if(!y&&!v)return l(`${p.title} cannot be connected: no connection method available`),!1;const _=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:u}});d=Z(_).item.id}const h=d,j=await en({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:u=>m(h,{connection_token:u}).then(()=>{})});if(!j.ok)return l(`Couldn't sign in to ${p.title}: ${j.error}`),!1;const C=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),x=Z(C).item?.configuration_state??null,g=an(x,p.fieldKey,p.bindingType,h);return await m(i,{configuration_state:g}),await o.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),!0}catch(d){return l(d instanceof Error?d.message:String(d)),!1}finally{r(null)}}return{connect:f,connectingFieldKey:a,error:c}}const et="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function tt(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),t.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),s[0]=e):e=s[0],e}function Yn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Zn)}),s[0]=e):e=s[0],e}function Zn(s){return t.jsx(Tn,{},s)}function nt(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:et,children:[t.jsx(tt,{}),t.jsx(Yn,{})]}),s[0]=e):e=s[0],e}function Xn(s){const e=E.c(5),{onRetry:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(tt,{}),e[0]=i):i=e[0];let o,a;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),a=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Something went wrong loading your integrations."}),e[1]=o,e[2]=a):(o=e[1],a=e[2]);let r;return e[3]!==n?(r=t.jsxs("div",{className:et,children:[i,t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[o,a,t.jsx(V,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:n,children:"Try again"})]})]}),e[3]=n,e[4]=r):r=e[4],r}function Jn(s){const e=E.c(2);let n;return e[0]!==s?(n=t.jsx(ft,{children:i=>{const{reset:o}=i;return t.jsx(pt,{fallback:a=>{const{resetError:r}=a;return t.jsx(Xn,{onRetry:()=>{o(),r()}})},children:t.jsx(D.Suspense,{fallback:t.jsx(nt,{}),children:t.jsx(es,{...s})})})}}),e[0]=s,e[1]=n):n=e[1],n}function es(s){const e=E.c(35),{org:n,cdConnectionId:i,siteUrl:o}=s,{data:a}=Re.useSession(),r=a?.user?.id??"";let c;e[0]!==n.id||e[1]!==n.slug?(c={connectionId:jt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=c):c=e[2];const l=$e(c);let m;e[3]!==i||e[4]!==n||e[5]!==l?(m={selfClient:l,org:n,cdConnectionId:i},e[3]=i,e[4]=n,e[5]=l,e[6]=m):m=e[6];const{cards:f}=Ln(m);let p;e[7]!==i||e[8]!==n||e[9]!==l||e[10]!==r?(p={selfClient:l,org:n,userId:r,cdConnectionId:i},e[7]=i,e[8]=n,e[9]=l,e[10]=r,e[11]=p):p=e[11];const{connect:d,connectingFieldKey:h,error:j}=Wn(p),[C,x]=D.useState(null);if(f.length===0)return null;const g=h!==null;let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(tt,{}),e[12]=u):u=e[12];let b;e[13]!==j?(b=j&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:j}),e[13]=j,e[14]=b):b=e[14];let y;if(e[15]!==C||e[16]!==g||e[17]!==f||e[18]!==d||e[19]!==h||e[20]!==n||e[21]!==l||e[22]!==o){let _;e[24]!==C||e[25]!==g||e[26]!==d||e[27]!==h||e[28]!==n||e[29]!==l||e[30]!==o?(_=N=>{const k=async()=>{await d(N)&&x(N.fieldKey)};return t.jsx(On,{card:N,connecting:h===N.fieldKey,disabled:g&&h!==N.fieldKey,org:n,selfClient:l,siteUrl:o,autoOpenConfigFieldKey:C,onAutoOpenConfigHandled:()=>x(w=>w===N.fieldKey?null:w),onConnect:()=>{k()}},N.fieldKey)},e[24]=C,e[25]=g,e[26]=d,e[27]=h,e[28]=n,e[29]=l,e[30]=o,e[31]=_):_=e[31],y=f.map(_),e[15]=C,e[16]=g,e[17]=f,e[18]=d,e[19]=h,e[20]=n,e[21]=l,e[22]=o,e[23]=y}else y=e[23];let v;return e[32]!==b||e[33]!==y?(v=t.jsxs("div",{className:et,children:[u,t.jsx(Fe,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[60vh] md:flex-none",children:t.jsxs("div",{className:"grid gap-4",children:[b,y]})})]}),e[32]=b,e[33]=y,e[34]=v):v=e[34],v}const st="https://decocms-tanstack.deco-cx.workers.dev/agendar",ts="Rather have us walk you through it?",ns="Book a 20-minute call and we'll run the diagnostic with you, live.";function it({siteUrl:s,email:e}){const n=new URL(st);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function ss(s){const e=E.c(9),{href:n,size:i,className:o}=s,a=n===void 0?st:n,r=i===void 0?"lg":i;let c;e[0]!==o?(c=X("w-full",o),e[0]=o,e[1]=c):c=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(St,{size:16}),e[2]=l):l=e[2];let m;e[3]!==a?(m=t.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",l]}),e[3]=a,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==c||e[7]!==m?(f=t.jsx(V,{asChild:!0,variant:"outline",size:r,className:c,children:m}),e[5]=r,e[6]=c,e[7]=m,e[8]=f):f=e[8],f}function ct(s){const e=E.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:n}),e[0]=n,e[1]=i):i=e[1],i}function is(){const s=E.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(vt,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:t.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=n):n=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,n,t.jsxs("div",{className:"relative",children:[i,t.jsxs(ct,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function ot(s){const e=E.c(4),{href:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(is,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"grid gap-2",children:[t.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:ts}),t.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:ns})]}),e[1]=o):o=e[1];let a;return e[2]!==n?(a=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,t.jsx(ss,{href:n,size:"xl"})]})}),e[2]=n,e[3]=a):a=e[3],a}function os(s){const e=E.c(8),{className:n,href:i}=s,o=i===void 0?st:i;let a;e[0]!==n?(a=X("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[0]=n,e[1]=a):a=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(vt,{size:20})}),e[2]=r):r=e[2];let c,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[t.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),t.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),l=t.jsx(St,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=c,e[4]=l):(c=e[3],l=e[4]);let m;return e[5]!==o||e[6]!==a?(m=t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:a,children:[r,c,l]}),e[5]=o,e[6]=a,e[7]=m):m=e[7],m}function _t(s){const e=E.c(10),{host:n}=s,i=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let o,a,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=a,e[2]=r):(o=e[0],a=e[1],r=e[2]);let c;e[3]!==i?(c=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=c):c=e[4];let l;e[5]!==n?(l=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=l):l=e[6];let m;return e[7]!==c||e[8]!==l?(m=t.jsxs("div",{className:"flex items-center gap-3",children:[o,a,r,c,l]}),e[7]=c,e[8]=l,e[9]=m):m=e[9],m}const rs={workspace:"Preparing your commerce workspace...",generic:"Preparing workspace..."};function ls(s){return rs[s]}function rt(s){const e=E.c(4),{variant:n}=s;let i;e[0]!==n?(i=ls(n),e[0]=n,e[1]=i):i=e[1];let o;return e[2]!==i?(o=t.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:t.jsx(Xe,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function wi(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(cs,{}),s[0]=e):e=s[0],e}const wt=D.createContext(null),kt=()=>D.useContext(wt);function Q(s){const e=E.c(13);let n,i;e[0]!==s?({visual:i,...n}=s,e[0]=s,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/commerce-onboarding"},e[3]=o):o=e[3];const a=gt(o),{data:r}=Re.useSession(),c=r?.user?.email;let l;e[4]!==a.siteUrl||e[5]!==c?(l=it({siteUrl:a.siteUrl,email:c}),e[4]=a.siteUrl,e[5]=c,e[6]=l):l=e[6];const m=l;let f;e[7]!==m||e[8]!==i?(f=i??t.jsx(ot,{href:m}),e[7]=m,e[8]=i,e[9]=f):f=e[9];let p;return e[10]!==n||e[11]!==f?(p=t.jsx(Rt,{...n,visual:f}),e[10]=n,e[11]=f,e[12]=p):p=e[12],p}function as(s){if(!s)return null;const e=Ee(s);return e.ok?new URL(e.value).hostname:null}function cs(){const s=E.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const n=gt(e),{org:i,siteUrl:o}=n;let a;s[1]!==o?(a=as(o),s[1]=o,s[2]=a):a=s[2];const r=a;let c;s[3]!==i||s[4]!==o?(c=t.jsx(ds,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=c):c=s[5];let l;return s[6]!==r||s[7]!==c?(l=t.jsx(wt.Provider,{value:r,children:c}),s[6]=r,s[7]=c,s[8]=l):l=s[8],l}function ds(s){const e=E.c(8),{requestedOrgSlug:n,siteUrl:i}=s,{data:o,isPending:a}=Re.useSession(),r=kt();if(a){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Q,{children:t.jsx(rt,{variant:"generic"})}),e[0]=l):l=e[0],l}if(!o){const l=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==r?(m=r?t.jsx(_t,{host:r}):void 0,e[1]=r,e[2]=m):m=e[2];let f;return e[3]!==m?(f=t.jsx(Q,{children:t.jsx(Ot,{callbackUrl:l,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:m})}),e[3]=m,e[4]=f):f=e[4],f}let c;return e[5]!==n||e[6]!==i?(c=t.jsx(us,{requestedOrgSlug:n,siteUrl:i}),e[5]=n,e[6]=i,e[7]=c):c=e[7],c}function us(s){const e=E.c(40),{requestedOrgSlug:n,siteUrl:i}=s,o=ht(),a=Et(),[r,c]=D.useState(null),[l,m]=D.useState(null),f=a.data?.map(fs)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:ms,retry:!1,onSuccess:u=>{m(u)}},e[0]=p):p=e[0];const d=Oe(p);if(a.isPending){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Q,{children:t.jsx(rt,{variant:"workspace"})}),e[1]=u):u=e[1],u}if(a.error){let u;return e[2]!==a?(u=t.jsx(Te,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[2]=a,e[3]=u):u=e[3],u}const h=n?f.find(u=>u.slug===n):null;if(h){let u;return e[4]!==h||e[5]!==i?(u=t.jsx(Ie,{org:h,initialSiteUrl:i}),e[4]=h,e[5]=i,e[6]=u):u=e[6],u}if(n){let u;return e[7]!==a?(u=t.jsx(Te,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[7]=a,e[8]=u):u=e[8],u}if(r){let u;return e[9]!==r||e[10]!==i?(u=t.jsx(Ie,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=u):u=e[11],u}if(f.length===1&&f[0]){let u;return e[12]!==f[0]||e[13]!==i?(u=t.jsx(Ie,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=u):u=e[14],u}if(f.length>1){let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(J,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=u):u=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=v=>c(v),e[16]=b):b=e[16];let y;return e[17]!==f?(y=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[u,t.jsx(Fe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(lt,{organizations:f,selectLabel:"Continue",onSelected:b})})]})}),e[17]=f,e[18]=y):y=e[18],y}if(!l){let u;e[19]!==d?(u=()=>{d.reset(),d.mutate()},e[19]=d,e[20]=u):u=e[20];let b;return e[21]!==d||e[22]!==u?(b=t.jsx(ps,{mutation:d,onRetry:u}),e[21]=d,e[22]=u,e[23]=b):b=e[23],b}const j=l;if(j?.success&&(j.status==="created"||j.status==="joined"||j.status==="already_has_organization")&&j.organization){let u;return e[24]!==j.organization||e[25]!==i?(u=t.jsx(Ie,{org:j.organization,initialSiteUrl:i}),e[24]=j.organization,e[25]=i,e[26]=u):u=e[26],u}if(j?.status==="ambiguous"&&j.organizations&&j.organizations.length>0){let u;e[27]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(J,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=u):u=e[27];const b=j.domain??void 0;let y;e[28]!==o||e[29]!==i?(y=(_,N)=>{xt(),c({..._,slug:N}),o({to:"/commerce-onboarding",search:{org:N,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=y):y=e[30];let v;return e[31]!==j.organizations||e[32]!==b||e[33]!==y?(v=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[u,t.jsx(Fe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(lt,{organizations:j.organizations,domain:b,onJoined:y})})]})}),e[31]=j.organizations,e[32]=b,e[33]=y,e[34]=v):v=e[34],v}const C=j?.error??"We could not determine a commerce organization for this account.";let x;e[35]!==d?(x=()=>{m(null),d.reset()},e[35]=d,e[36]=x):x=e[36];let g;return e[37]!==C||e[38]!==x?(g=t.jsx(Te,{title:"Commerce onboarding needs support",description:C,actionLabel:"Try again",onRetry:x}),e[37]=C,e[38]=x,e[39]=g):g=e[39],g}async function ms(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&xt(),e}function fs(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function ps(s){const e=E.c(7),{mutation:n,onRetry:i}=s,o=D.useRef(!1);let a;e[0]!==n?(a=m=>{!m||o.current||(o.current=!0,n.mutate())},e[0]=n,e[1]=a):a=e[1];const r=a;if(n.error){let m;return e[2]!==i?(m=t.jsx(Te,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:i}),e[2]=i,e[3]=m):m=e[3],m}let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(rt,{variant:"generic"}),e[4]=c):c=e[4];let l;return e[5]!==r?(l=t.jsx(Q,{children:t.jsx("div",{ref:r,children:c})}),e[5]=r,e[6]=l):l=e[6],l}function J(s){const e=E.c(8),{title:n,description:i}=s,o=kt();let a;e[0]!==o?(a=o?t.jsx(_t,{host:o}):t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=a):a=e[1];let r;e[2]!==i||e[3]!==n?(r=(n||i)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),i&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let c;return e[5]!==a||e[6]!==r?(c=t.jsxs("div",{className:"grid gap-10",children:[a,r]}),e[5]=a,e[6]=r,e[7]=c):c=e[7],c}function Te(s){const e=E.c(9),{title:n,description:i,actionLabel:o,onRetry:a}=s;let r;e[0]!==i||e[1]!==n?(r=t.jsx(J,{title:n,description:i}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let c;e[3]!==o||e[4]!==a?(c=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:a,children:o}),e[3]=o,e[4]=a,e[5]=c):c=e[5];let l;return e[6]!==r||e[7]!==c?(l=t.jsx(Q,{children:t.jsxs("div",{className:"grid gap-10",children:[r,c]})}),e[6]=r,e[7]=c,e[8]=l):l=e[8],l}function gs(s){return s.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function ke(s){const e=s;if(e.isError)throw new Error(gs(e));return e.structuredContent??s}function Ie(s){const e=E.c(10),{org:n,initialSiteUrl:i}=s,{data:o}=Re.useSession(),a=o?.user?.email;let r;e[0]!==i||e[1]!==a?(r=it({siteUrl:i,email:a}),e[0]=i,e[1]=a,e[2]=r):r=e[2];const c=r;let l;e[3]!==c?(l=t.jsx(ot,{href:c}),e[3]=c,e[4]=l):l=e[4];const m=l;let f;return e[5]!==i||e[6]!==m||e[7]!==n||e[8]!==o?.user?.email?(f=t.jsx(ft,{children:p=>{const{reset:d}=p;return t.jsx(pt,{fallback:h=>{const{error:j,resetError:C}=h;return t.jsx(Q,{visual:m,children:t.jsx(hs,{orgName:n.name,message:j instanceof Error?j.message:"We could not check Commerce Discovery setup.",onRetry:()=>{d(),C()}})})},children:t.jsx(D.Suspense,{fallback:t.jsx(It,{visual:m}),children:t.jsx(xs,{org:n,initialSiteUrl:i,sessionEmail:o?.user?.email},`${n.id}:${i??""}`)})})}}),e[5]=i,e[6]=m,e[7]=n,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function It(s){const e=E.c(3),{visual:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[t.jsx(J,{}),t.jsx(nt,{})]}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsx(Q,{align:"fill",visual:n,children:i}),e[1]=n,e[2]=o):o=e[2],o}function hs(s){const e=E.c(10),{orgName:n,message:i,onRetry:o}=s,a=`Commerce setup will continue for ${n}.`;let r;e[0]!==a?(r=t.jsx(J,{title:"Commerce diagnostics",description:a}),e[0]=a,e[1]=r):r=e[1];let c;e[2]!==i?(c=t.jsx(ye,{message:i}),e[2]=i,e[3]=c):c=e[3];let l;e[4]!==o?(l=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=l):l=e[5];let m;return e[6]!==r||e[7]!==c||e[8]!==l?(m=t.jsxs("div",{className:"grid gap-10",children:[r,c,l]}),e[6]=r,e[7]=c,e[8]=l,e[9]=m):m=e[9],m}function xs(s){const e=E.c(106),{org:n,initialSiteUrl:i,sessionEmail:o}=s,a=ht();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:jt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const c=$e(r),[l,m]=D.useState(i??""),[f,p]=D.useState(null),[d,h]=D.useState(null),j=D.useRef(!1),C=yt.COMMERCE_DISCOVERY(n.id),x=$t(n.id),g=W.commerceDiscoveryConnection(n.id,C);let u;e[3]!==C||e[4]!==c?(u=async()=>{const $=await c.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:C}});return ke($)},e[3]=C,e[4]=c,e[5]=u):u=e[5];let b;e[6]!==g||e[7]!==u?(b={queryKey:g,queryFn:u,retry:!1},e[6]=g,e[7]=u,e[8]=b):b=e[8];const y=me(b),v=W.commerceDiscoveryVirtualMcp(n.id,x);let _;e[9]!==c||e[10]!==x?(_=async()=>{const $=await c.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return ke($)},e[9]=c,e[10]=x,e[11]=_):_=e[11];let N;e[12]!==v||e[13]!==_?(N={queryKey:v,queryFn:_,retry:!1},e[12]=v,e[13]=_,e[14]=N):N=e[14];const k=me(N);let w;e[15]!==c?(w=async $=>{const G=await c.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:$}});return ke(G)},e[15]=c,e[16]=w):w=e[16];let T;e[17]!==y||e[18]!==k?(T=$=>{p($),h(null),y.refetch(),k.refetch()},e[17]=y,e[18]=k,e[19]=T):T=e[19];let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=$=>{h($ instanceof Error?$.message:"Commerce Discovery setup failed.")},e[20]=z):z=e[20];let O;e[21]!==w||e[22]!==T?(O={mutationFn:w,retry:!1,onSuccess:T,onError:z},e[21]=w,e[22]=T,e[23]=O):O=e[23];const I=Oe(O);let R;e[24]!==c?(R={mutationFn:async $=>{const G=await c.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:$}});return ke(G)},retry:!1},e[24]=c,e[25]=R):R=e[25];const A=Oe(R),[M,q]=D.useState(null),L=!!y.data.item&&!!k.data.item,F=y.data.item,K=typeof F?.metadata?.siteUrl=="string"?F.metadata.siteUrl:void 0,S=i||l||K||"";let P;e[26]!==S||e[27]!==o?(P=it({siteUrl:S,email:o}),e[26]=S,e[27]=o,e[28]=P):P=e[28];const U=P;let B;e[29]!==U?(B=t.jsx(ot,{href:U}),e[29]=U,e[30]=B):B=e[30];const H=B;let je;e[31]!==I?(je=$=>{const G=Ee($);if(!G.ok){h(G.error);return}h(null),I.mutate(G.value)},e[31]=I,e[32]=je):je=e[32];const te=je;let be;e[33]!==i||e[34]!==te||e[35]!==L?(be=$=>{!$||j.current||L||!i||(j.current=!0,te(i))},e[33]=i,e[34]=te,e[35]=L,e[36]=be):be=e[36];const Ae=be;let Ce;e[37]!==te||e[38]!==l?(Ce=$=>{$.preventDefault(),te(l)},e[37]=te,e[38]=l,e[39]=Ce):Ce=e[39];const Y=Ce;let Se;e[40]!==C||e[41]!==f?.reportApp||e[42]!==x?(Se=f?.reportApp??{connectionId:C,virtualMcpId:x,toolName:At},e[40]=C,e[41]=f?.reportApp,e[42]=x,e[43]=Se):Se=e[43];const ee=Se;let ve;e[44]!==S||e[45]!==a||e[46]!==n.slug||e[47]!==ee||e[48]!==A?(ve=async()=>{q(null);const $=Ee(S);if($.ok)try{await A.mutateAsync($.value)}catch{q("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(Tt.sidebarOpen(),JSON.stringify(!1)),a({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:ee.virtualMcpId,main:Ut(ee.connectionId,ee.toolName),chat:0}})},e[44]=S,e[45]=a,e[46]=n.slug,e[47]=ee,e[48]=A,e[49]=ve):ve=e[49];const ze=ve;if(L){let $;return e[50]!==U||e[51]!==H||e[52]!==S||e[53]!==ze||e[54]!==n||e[55]!==ee||e[56]!==M||e[57]!==A.isPending?($=t.jsx(ys,{org:n,reportApp:ee,onOpenReport:ze,isSubmitting:A.isPending,error:M,meetingUrl:U,meetingVisual:H,siteUrl:S}),e[50]=U,e[51]=H,e[52]=S,e[53]=ze,e[54]=n,e[55]=ee,e[56]=M,e[57]=A.isPending,e[58]=$):$=e[58],$}if(I.isPending){let $;return e[59]!==H?($=t.jsx(It,{visual:H}),e[59]=H,e[60]=$):$=e[60],$}if(i){let $;e[61]!==i?($=Ee(i),e[61]=i,e[62]=$):$=e[62];const G=$;if(!G.ok){const De=`Commerce setup will continue for ${n.name}.`;let ae;e[63]!==De?(ae=t.jsx(J,{title:"Commerce diagnostics",description:De}),e[63]=De,e[64]=ae):ae=e[64];let ce;e[65]!==G.error?(ce=t.jsx(ye,{message:G.error}),e[65]=G.error,e[66]=ce):ce=e[66];let de;e[67]!==Y||e[68]!==d||e[69]!==I.isPending||e[70]!==l?(de=t.jsx(Me,{siteUrl:l,error:d,isSubmitting:I.isPending,onSiteUrlChange:m,onSubmit:Y}),e[67]=Y,e[68]=d,e[69]=I.isPending,e[70]=l,e[71]=de):de=e[71];let ue;e[72]!==ae||e[73]!==ce||e[74]!==de?(ue=t.jsxs("div",{className:"grid gap-10",children:[ae,ce,de]}),e[72]=ae,e[73]=ce,e[74]=de,e[75]=ue):ue=e[75];let we;return e[76]!==H||e[77]!==ue?(we=t.jsx(Q,{visual:H,children:ue}),e[76]=H,e[77]=ue,e[78]=we):we=e[78],we}const Le=`Commerce Discovery is being prepared for ${G.value}.`;let oe;e[79]!==Le?(oe=t.jsx(J,{title:"Commerce diagnostics",description:Le}),e[79]=Le,e[80]=oe):oe=e[80];let re;e[81]!==Y||e[82]!==d||e[83]!==I.isPending||e[84]!==l?(re=d?t.jsxs(t.Fragment,{children:[t.jsx(ye,{message:d}),t.jsx(Me,{siteUrl:l,error:null,isSubmitting:I.isPending,onSiteUrlChange:m,onSubmit:Y})]}):t.jsx(nt,{}),e[81]=Y,e[82]=d,e[83]=I.isPending,e[84]=l,e[85]=re):re=e[85];let le;e[86]!==oe||e[87]!==re||e[88]!==Ae?(le=t.jsxs("div",{ref:Ae,className:"grid gap-10",children:[oe,re]}),e[86]=oe,e[87]=re,e[88]=Ae,e[89]=le):le=e[89];let _e;return e[90]!==H||e[91]!==le?(_e=t.jsx(Q,{visual:H,children:le}),e[90]=H,e[91]=le,e[92]=_e):_e=e[92],_e}const Pe=`Commerce setup will continue for ${n.name}.`;let ne;e[93]!==Pe?(ne=t.jsx(J,{title:"Commerce diagnostics",description:Pe}),e[93]=Pe,e[94]=ne):ne=e[94];let se;e[95]!==Y||e[96]!==d||e[97]!==I.isPending||e[98]!==l?(se=t.jsx(Me,{siteUrl:l,error:d,isSubmitting:I.isPending,onSiteUrlChange:m,onSubmit:Y}),e[95]=Y,e[96]=d,e[97]=I.isPending,e[98]=l,e[99]=se):se=e[99];let ie;e[100]!==ne||e[101]!==se?(ie=t.jsxs("div",{className:"grid gap-10",children:[ne,se]}),e[100]=ne,e[101]=se,e[102]=ie):ie=e[102];let Ne;return e[103]!==H||e[104]!==ie?(Ne=t.jsx(Q,{visual:H,children:ie}),e[103]=H,e[104]=ie,e[105]=Ne):Ne=e[105],Ne}function Me(s){const e=E.c(20),{siteUrl:n,error:i,isSubmitting:o,onSiteUrlChange:a,onSubmit:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=c):c=e[0];let l;e[1]!==a?(l=x=>a(x.target.value),e[1]=a,e[2]=l):l=e[2];const m=!!i;let f;e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==m?(f=t.jsx(Ue,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:l,placeholder:"https://example.com","aria-invalid":m,disabled:o}),e[3]=o,e[4]=n,e[5]=l,e[6]=m,e[7]=f):f=e[7];let p;e[8]!==i?(p=i?t.jsx(ye,{message:i}):null,e[8]=i,e[9]=p):p=e[9];let d;e[10]!==f||e[11]!==p?(d=t.jsxs("div",{className:"grid gap-2",children:[c,f,p]}),e[10]=f,e[11]=p,e[12]=d):d=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(bt,{size:16}),e[13]=h):h=e[13];let j;e[14]!==o?(j=t.jsxs(V,{type:"submit",size:"xl",className:"w-full",disabled:o,children:["Continue",h]}),e[14]=o,e[15]=j):j=e[15];let C;return e[16]!==r||e[17]!==d||e[18]!==j?(C=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[d,j]}),e[16]=r,e[17]=d,e[18]=j,e[19]=C):C=e[19],C}function ys(s){const e=E.c(26),{org:n,reportApp:i,onOpenReport:o,isSubmitting:a,error:r,meetingUrl:c,meetingVisual:l,siteUrl:m}=s;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(J,{}),e[0]=f):f=e[0];let p;e[1]!==n||e[2]!==i.connectionId||e[3]!==m?(p=t.jsx(Jn,{org:n,cdConnectionId:i.connectionId,siteUrl:m}),e[1]=n,e[2]=i.connectionId,e[3]=m,e[4]=p):p=e[4];let d;e[5]!==c?(d=t.jsx(os,{className:"md:hidden",href:c}),e[5]=c,e[6]=d):d=e[6];let h;e[7]!==r?(h=r?t.jsx(ye,{message:r}):null,e[7]=r,e[8]=h):h=e[8];const j=a||!i.virtualMcpId,C=a?"Opening report...":"See full report";let x;e[9]!==a?(x=a?null:t.jsx(bt,{size:18}),e[9]=a,e[10]=x):x=e[10];let g;e[11]!==o||e[12]!==j||e[13]!==C||e[14]!==x?(g=t.jsxs(V,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:j,children:[C,x]}),e[11]=o,e[12]=j,e[13]=C,e[14]=x,e[15]=g):g=e[15];let u;e[16]!==d||e[17]!==h||e[18]!==g?(u=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[d,h,g]}),e[16]=d,e[17]=h,e[18]=g,e[19]=u):u=e[19];let b;e[20]!==p||e[21]!==u?(b=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[f,p,u]}),e[20]=p,e[21]=u,e[22]=b):b=e[22];let y;return e[23]!==l||e[24]!==b?(y=t.jsx(Q,{align:"fill",visual:l,children:b}),e[23]=l,e[24]=b,e[25]=y):y=e[25],y}function ye(s){const e=E.c(2),{message:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=i):i=e[1],i}export{wi as default};
@@ -1 +1 @@
1
- import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-CFxtND-D.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-vzDSbn7L.js";import{S as _}from"./chat-context-xREAp4B7.js";import{i as $}from"./ChevronUp-DDcyY4lP.js";import{a as A}from"./Eye-C9Xcteq-.js";import{u as B}from"./studio-tools-DOSKR-eb.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
1
+ import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-BCcq5mEm.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-CTipuzl6.js";import{S as _}from"./chat-context-D58BzJe_.js";import{i as $}from"./ChevronUp-jJeRT2mj.js";import{a as A}from"./Eye-YMDMgm08.js";import{u as B}from"./studio-tools-BnDVvd4v.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,C as $,b0 as k,K as D,l as E,j as x}from"./index-CFxtND-D.js";import{u as K}from"./use-registry-connections-BlbfO2IS.js";import{b as Q}from"./use-organization-settings-B6o-OHM0.js";import{S as w,e as F}from"./use-mcp-client-BOmWfyRe.js";import{u as H}from"./useInfiniteQuery-CKC8ud6E.js";import{i as q,f as G}from"./extract-connection-data-n-h18tII.js";import{C as U}from"./card-B13o0f5w.js";import{I as V}from"./integration-icon-B9eaFgP5.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let N=null;try{N=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await N.callTool({name:j,arguments:I}),C=P.structuredContent??P,M=C.nextCursor||C.cursor||void 0,L=G(C?[C]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await N?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let N;e[22]!==r?(N=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=N):N=e[23];let I;e[24]!==v||e[25]!==N||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,N]}),e[24]=v,e[25]=N,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let C;e[30]!==I||e[31]!==P?(C=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=C):C=e[32];let M;return e[33]!==u||e[34]!==C||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:C}),e[33]=u,e[34]=C,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,C as $,b0 as k,K as D,l as E,j as x}from"./index-BCcq5mEm.js";import{u as K}from"./use-registry-connections-CXN7j0mL.js";import{b as Q}from"./use-organization-settings-B5MWsVKM.js";import{S as w,e as F}from"./use-mcp-client-C_TUAVtl.js";import{u as H}from"./useInfiniteQuery-UlJqHell.js";import{i as q,f as G}from"./extract-connection-data-Bz9TVl-K.js";import{C as U}from"./card-CeRD1pv9.js";import{I as V}from"./integration-icon-CEyadkOH.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let N=null;try{N=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await N.callTool({name:j,arguments:I}),C=P.structuredContent??P,M=C.nextCursor||C.cursor||void 0,L=G(C?[C]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await N?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let N;e[22]!==r?(N=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=N):N=e[23];let I;e[24]!==v||e[25]!==N||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,N]}),e[24]=v,e[25]=N,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let C;e[30]!==I||e[31]!==P?(C=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=C):C=e[32];let M;return e[33]!==u||e[34]!==C||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:C}),e[33]=u,e[34]=C,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};