decocms 3.103.2 → 3.103.4

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 (218) hide show
  1. package/dist/client/assets/{AlertCircle-B7YwjVuv.js → AlertCircle-BJzQ1lVJ.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DvElag-V.js → ArrowUpRight-CA22UP6Q.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DIxU9fNb.js → CheckCircle-p5tYLXMg.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-D7t2IbgZ.js → ChevronDown-DM7Zg7z0.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-DnVztwcc.js → ChevronLeft-lcwdftXp.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-Cw6r4eF5.js → ChevronRight-CKc4NZet.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-DrHOs0IB.js → ChevronUp-uk87fvlM.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-p5cw6bzY.js → DotsVertical-DXDm8Xzs.js} +1 -1
  9. package/dist/client/assets/{Eye-CPb9WDyf.js → Eye-BHPT57Tm.js} +1 -1
  10. package/dist/client/assets/{FilterLines-2uX2Gf4U.js → FilterLines-HsRbW4y-.js} +1 -1
  11. package/dist/client/assets/{Globe01-D51Pf1ib.js → Globe01-DD63JJzL.js} +1 -1
  12. package/dist/client/assets/{Globe04-8CmI5zRW.js → Globe04-CokcJjWp.js} +1 -1
  13. package/dist/client/assets/{HardDrive-fBNuw9RE.js → HardDrive-xu95HLc0.js} +1 -1
  14. package/dist/client/assets/{Key01-B-V8oh6M.js → Key01-V7SPr6j-.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-B7KWV4nT.js → LayoutLeft-y1fOcQ0I.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-Cd3gNz9H.js → LinkExternal01-DCed5R2c.js} +1 -1
  17. package/dist/client/assets/{Monitor01-BzxQo8OV.js → Monitor01-BKqFs8Gp.js} +1 -1
  18. package/dist/client/assets/{Palette-TV4PomkE.js → Palette-DkcZCW1n.js} +1 -1
  19. package/dist/client/assets/{Play-B9WHtGRe.js → Play-CKPBuURg.js} +1 -1
  20. package/dist/client/assets/{Plus-DrCr8atg.js → Plus-Bi8BbQwT.js} +1 -1
  21. package/dist/client/assets/{SearchLg-C45t9PQZ.js → SearchLg-D0nJXyNY.js} +1 -1
  22. package/dist/client/assets/{SearchMd-C5JuA4Q_.js → SearchMd-BkXN-Kzx.js} +1 -1
  23. package/dist/client/assets/{Settings02-CWsiKyfu.js → Settings02-C-qi4-Q_.js} +1 -1
  24. package/dist/client/assets/{Shield01-BP8Krja8.js → Shield01-BaBnwolv.js} +1 -1
  25. package/dist/client/assets/{Star01-BvLdWUOq.js → Star01-D2l7-L0I.js} +1 -1
  26. package/dist/client/assets/{Stars01-ledCttL2.js → Stars01-CBpnmt-0.js} +1 -1
  27. package/dist/client/assets/{Stars02-CZ3C1sQr.js → Stars02-DC4cG_dc.js} +1 -1
  28. package/dist/client/assets/{Sun-DPnjEA61.js → Sun-ubimVQVz.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-fTq_Xj_0.js → SwitchHorizontal01-DkcNGyLK.js} +1 -1
  30. package/dist/client/assets/{Tool01-MvyjXDCb.js → Tool01-D4LA61If.js} +1 -1
  31. package/dist/client/assets/{Trash01-C3HJx9Eu.js → Trash01-CbqEHpx0.js} +1 -1
  32. package/dist/client/assets/{Upload01-DvSZDpgm.js → Upload01-C_kFf8l0.js} +1 -1
  33. package/dist/client/assets/{User01-TldGh0YP.js → User01-Cykpl4hh.js} +1 -1
  34. package/dist/client/assets/{Users01-B63UEiqj.js → Users01-fhFCwrP8.js} +1 -1
  35. package/dist/client/assets/{Users03-BiIAwLFR.js → Users03-BkBCkWQn.js} +1 -1
  36. package/dist/client/assets/{X-D1lT84o6.js → X-DEdLuuqP.js} +1 -1
  37. package/dist/client/assets/{XCircle-B1aV7AX3.js → XCircle-IAOWYKKA.js} +1 -1
  38. package/dist/client/assets/{XClose-9xeu7JIP.js → XClose-ChjX78ei.js} +1 -1
  39. package/dist/client/assets/{Zap-C8z5Nmtq.js → Zap-DE8YfoLa.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-C-BUl6mg.js → ZapSquare-hkjSQWO8.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-DnuKetHD.js → ZoomOut-DoQt1wdd.js} +1 -1
  42. package/dist/client/assets/{access-gate-BY3tN2ja.js → access-gate-C9EgwKjC.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-B07Xr2Kn.js → add-section-modal-uGR2Gjzo.js} +1 -1
  44. package/dist/client/assets/{agent-icon-SFzfjqT3.js → agent-icon-C1dYfmgT.js} +1 -1
  45. package/dist/client/assets/agents-list-BYujSwxP.js +1 -0
  46. package/dist/client/assets/{ai-providers-CKzZgnvl.js → ai-providers-BNI68B_k.js} +1 -1
  47. package/dist/client/assets/{alert-Xi4tmGdJ.js → alert-D_TmabeW.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-Dv-S36Xs.js → alert-dialog-DZvgeli3.js} +1 -1
  49. package/dist/client/assets/{app-editor-DkeeVFb9.js → app-editor-CzvUrXdA.js} +1 -1
  50. package/dist/client/assets/{auth-B9AdzGWs.js → auth-CPEoqZ5f.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-0TYVm2fW.js → auth-catchall-B0YsSe8e.js} +1 -1
  52. package/dist/client/assets/{auth-entry-DnJxnsQa.js → auth-entry-BNBDxAD5.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-CRM5rJ4I.js → auth-split-layout-TVpnUfp8.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-CWwDFJ5t.js → authenticate-and-persist-oauth-BgoQZkYE.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-CsaQkLKW.js → automation-list-row-Bic_MYAx.js} +1 -1
  56. package/dist/client/assets/{automation-runs-B7uMDF25.js → automation-runs-B_ZKhNSO.js} +1 -1
  57. package/dist/client/assets/automations-B-nS9KAc.js +1 -0
  58. package/dist/client/assets/{avatar-CdYywjB8.js → avatar-VZM5i0Ki.js} +1 -1
  59. package/dist/client/assets/{badge-Dxlv54DZ.js → badge-BGbD2JMR.js} +1 -1
  60. package/dist/client/assets/{block-document-DmBsan0A.js → block-document-alsZITys.js} +1 -1
  61. package/dist/client/assets/{brand-context-BXcXRl5I.js → brand-context-DSNeUFQk.js} +1 -1
  62. package/dist/client/assets/{buckets-bgNzTmcE.js → buckets-htbDyfKS.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-CFxZVJfo.js → capability-load-error-7-bUVJZE.js} +1 -1
  64. package/dist/client/assets/{card-Dt5JuJj0.js → card-DjLKG66H.js} +1 -1
  65. package/dist/client/assets/{category-editor-4VhAzI64.js → category-editor-DlDVDfZO.js} +1 -1
  66. package/dist/client/assets/{chat-context-rSGx0F1S.js → chat-context-DJ9kQ1Gu.js} +5 -5
  67. package/dist/client/assets/{checkbox-D5qKxHwE.js → checkbox-CHfAThPE.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-fK-z6B11.js → cli-auth-success-C0Rp_k77.js} +1 -1
  69. package/dist/client/assets/{collection-detail-CKsULKt8.js → collection-detail-WRW5wTM9.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-D1GAS3K4.js → collection-display-button-V-CSOAM6.js} +1 -1
  71. package/dist/client/assets/{collection-search-Yx1Vcd74.js → collection-search-C4TcbQ-p.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-DEvCjzY2.js → collection-tabs-CA6SI6KD.js} +1 -1
  73. package/dist/client/assets/{command--DrDkfnb.js → command-CZZOMfiA.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-B618DbMl.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-Ny2ddpDi.js → connect-desktop-dialog-C7OzpQot.js} +1 -1
  76. package/dist/client/assets/{connection-card-DGJrNSMY.js → connection-card-CFZ9gVcC.js} +1 -1
  77. package/dist/client/assets/{connection-detail-CrxMas_a.js → connection-detail-Dz4PneDx.js} +1 -1
  78. package/dist/client/assets/{connection-form-helpers-Cco6Qbpt.js → connection-form-helpers-CF-WQyTc.js} +1 -1
  79. package/dist/client/assets/{connections-D2DZU5GB.js → connections-3TpGWQgy.js} +1 -1
  80. package/dist/client/assets/{context-menu-BLuGnyVu.js → context-menu-DyhUbPtL.js} +1 -1
  81. package/dist/client/assets/{decopilot-DMutZh6M.js → decopilot-DrrsAbRN.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool--1mtBHxz.js → decopilot-sse-pool-CyIsiJ1H.js} +1 -1
  83. package/dist/client/assets/{dialog-Dy6eXpKe.js → dialog-Dj81EdMo.js} +1 -1
  84. package/dist/client/assets/{domain-settings-C1eV-9a-.js → domain-settings-xhuDCJzA.js} +1 -1
  85. package/dist/client/assets/{drawer-Dvd-9Sja.js → drawer-tdj9aCh7.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-OVr8TMr_.js → dropdown-menu-UriF3iJ3.js} +1 -1
  87. package/dist/client/assets/{empty-state-DQfglbNM.js → empty-state-pCesbyUM.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-DrUVsxqd.js → extract-connection-data-DumI9Ge5.js} +1 -1
  89. package/dist/client/assets/{file-explorer-CkPnNmO8.js → file-explorer-BrAHdPYq.js} +1 -1
  90. package/dist/client/assets/{file-type-icon-SP0v8UlM.js → file-type-icon-Czo8zyOj.js} +1 -1
  91. package/dist/client/assets/{files-Wz-xIRKZ.js → files-2-ylEzlS.js} +1 -1
  92. package/dist/client/assets/{form-CkEHHrgu.js → form--KUjsjlO.js} +1 -1
  93. package/dist/client/assets/{general-DdP8ztNk.js → general-CESQV-oz.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-DSR-TwBo.js → github-repo-picker-B2FrynHJ.js} +1 -1
  95. package/dist/client/assets/{hooks-o8yCDzJC.js → hooks-dZjznYow.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-CEW3ZJjT.js → import-from-deco-dialog-BR852fbZ.js} +1 -1
  97. package/dist/client/assets/{index-XoC6Mv98.js → index-0P9allDr.js} +1 -1
  98. package/dist/client/assets/{index-DuwRwNmr.js → index-BBWislhf.js} +1 -1
  99. package/dist/client/assets/{index-B6kdF_L8.js → index-BWNTd3xK.js} +1 -1
  100. package/dist/client/assets/{index-Dp_9MLtk.js → index-BcYiAjiX.js} +1 -1
  101. package/dist/client/assets/{index-j1EmgqV8.js → index-BlbGtC1U.js} +3 -3
  102. package/dist/client/assets/{index-_cWo9NQL.js → index-BxxTJpbB.js} +30 -30
  103. package/dist/client/assets/{index-DrmUu6Oi.js → index-CCANgKdB.js} +1 -1
  104. package/dist/client/assets/{index-D3y2G80O.js → index-CSUPQJzr.js} +1 -1
  105. package/dist/client/assets/{index-Z9ET5M46.js → index-CTgm7OBW.js} +1 -1
  106. package/dist/client/assets/{index-kU0DbGlO.js → index-CsOdgboE.js} +1 -1
  107. package/dist/client/assets/{index-DgC1qvp3.js → index-Dc1mL4BR.js} +1 -1
  108. package/dist/client/assets/{index-_iXFFHGt.js → index-S2ZDAOoZ.js} +1 -1
  109. package/dist/client/assets/{index-BFhrz-f4.js → index-bqGy9pqv.js} +1 -1
  110. package/dist/client/assets/{index-C0th2ciG.js → index-gxmWeiHj.js} +1 -1
  111. package/dist/client/assets/{index-redirect-Cq22Ou3t.js → index-redirect-DfTnv8HP.js} +1 -1
  112. package/dist/client/assets/{input-zUoMTUjz.js → input-DHDgjmX0.js} +1 -1
  113. package/dist/client/assets/{integration-icon-Cpv4CIQ_.js → integration-icon-m4V5ew5R.js} +1 -1
  114. package/dist/client/assets/{label-DIdfff7-.js → label-PsbKXPB5.js} +1 -1
  115. package/dist/client/assets/{login-0NOIPa_i.js → login-CjZD7E7q.js} +1 -1
  116. package/dist/client/assets/{mcp-oauth-iKgiXli9.js → mcp-oauth-D8vUJRgp.js} +1 -1
  117. package/dist/client/assets/{members-CnFYAz0Z.js → members-BPqR9Tpk.js} +1 -1
  118. package/dist/client/assets/{monaco-editor-DvDR9w-L.js → monaco-editor-C6TIlc3v.js} +1 -1
  119. package/dist/client/assets/{monitoring-stats-row-BbY_q-eo.js → monitoring-stats-row-CuYST9yW.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-BPtayFiR.js → oauth-callback-MIwBkTTF.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-ai-provider-K5aCOvaH.js → oauth-callback-ai-provider-DE51OBIS.js} +1 -1
  122. package/dist/client/assets/{onboarding-ZiU6JGv-.js → onboarding-D2dd9Hw0.js} +1 -1
  123. package/dist/client/assets/{org-install-Cy54wLGw.js → org-install-TvXy2En0.js} +1 -1
  124. package/dist/client/assets/{org-layout-D-P2tcqC.js → org-layout-B7of36Ug.js} +1 -1
  125. package/dist/client/assets/{organization-choice-C1y80Okj.js → organization-choice-ClD6fu3y.js} +1 -1
  126. package/dist/client/assets/{page-seo-form-xc_ndIWR.js → page-seo-form-B43PbD8q.js} +1 -1
  127. package/dist/client/assets/page-seo-sheet-Bms3CN63.js +1 -0
  128. package/dist/client/assets/{popover-DU5qAOzi.js → popover-Do5OoBkb.js} +1 -1
  129. package/dist/client/assets/{post-editor-Bu1uK3RV.js → post-editor-DyiVSt54.js} +1 -1
  130. package/dist/client/assets/{preview-dialog-C9-3VKyJ.js → preview-dialog-DxRKsymK.js} +1 -1
  131. package/dist/client/assets/{primitives-CykDcCCX.js → primitives-DxWZCDhA.js} +1 -1
  132. package/dist/client/assets/{profile-BKoUm-g9.js → profile-BhdJgKGB.js} +1 -1
  133. package/dist/client/assets/project-app-view-CI4_btQ-.js +1 -0
  134. package/dist/client/assets/record-editor-BXTRvz07.js +1 -0
  135. package/dist/client/assets/registry-Du_E4iar.js +2 -0
  136. package/dist/client/assets/{registry-layout-B9FmRjJz.js → registry-layout-B9PDVzF6.js} +1 -1
  137. package/dist/client/assets/{require-capability-CehH7jAZ.js → require-capability-D2RrR3BZ.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-CU8fve_K.js → required-auth-layout-BdWFlHgh.js} +1 -1
  139. package/dist/client/assets/{reset-password-zdekZmVd.js → reset-password-ZLVvnqus.js} +1 -1
  140. package/dist/client/assets/{roles-D-x_wkGo.js → roles-3wYBxtCJ.js} +1 -1
  141. package/dist/client/assets/{scroll-area-BAz3Rj9i.js → scroll-area-B3-Gj80e.js} +1 -1
  142. package/dist/client/assets/{search-input-DRzQD01R.js → search-input-Cmd3sBC3.js} +1 -1
  143. package/dist/client/assets/{secrets-CuUGkNhM.js → secrets-DwdsYco7.js} +1 -1
  144. package/dist/client/assets/{sections-editor-DPVFX_7V.js → sections-editor-DC39EH-a.js} +1 -1
  145. package/dist/client/assets/{select-svPYG6Bw.js → select-DxONb3Kt.js} +1 -1
  146. package/dist/client/assets/{select-model-Dq-JstQ8.js → select-model-RfbC0RGe.js} +1 -1
  147. package/dist/client/assets/{seo-editor-BFJub-eW.js → seo-editor-kUNtMQs9.js} +1 -1
  148. package/dist/client/assets/{settings-layout-a74u_hLy.js → settings-layout-BqoYV9gy.js} +1 -1
  149. package/dist/client/assets/{settings-section-CNscyKHW.js → settings-section-BlH2FRiM.js} +1 -1
  150. package/dist/client/assets/{sheet-DahuGsa4.js → sheet-C2Kfge9r.js} +1 -1
  151. package/dist/client/assets/{shell-controls-K52T5sMB.js → shell-controls-CHbMUihJ.js} +1 -1
  152. package/dist/client/assets/{shell-layout-Buk6j896.js → shell-layout-BihuyTtm.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-B0z1lBof.js → shell-route-loading-De-l4N89.js} +1 -1
  154. package/dist/client/assets/{sidebar-D5j5gPeI.js → sidebar-BjIzPMot.js} +1 -1
  155. package/dist/client/assets/{skeleton-U2Av8cLZ.js → skeleton-BG0I4KDd.js} +1 -1
  156. package/dist/client/assets/sortable.esm-DUIS-SLz.js +5 -0
  157. package/dist/client/assets/{sso-BoRzwrWA.js → sso-DHlsuJgQ.js} +1 -1
  158. package/dist/client/assets/{store-vubGBkGy.js → store-CF-c7AjJ.js} +1 -1
  159. package/dist/client/assets/store-registry-C91x-W79.js +2 -0
  160. package/dist/client/assets/{studio-tools-BAmwKCdT.js → studio-tools-7mZABBZl.js} +1 -1
  161. package/dist/client/assets/{switch-CjEoRRuC.js → switch-Dprre6Tx.js} +1 -1
  162. package/dist/client/assets/{table-T8p77nDy.js → table-2dv8FC6q.js} +1 -1
  163. package/dist/client/assets/{tabs-DDAkKuLU.js → tabs-nJ0qk72w.js} +1 -1
  164. package/dist/client/assets/{task-status-Dc-JFjIj.js → task-status-CvjZ7N6W.js} +1 -1
  165. package/dist/client/assets/{textarea-BrxTK711.js → textarea-HTN5AIWJ.js} +1 -1
  166. package/dist/client/assets/{toggle-group-r5JjNYaj.js → toggle-group-D22tG_vD.js} +1 -1
  167. package/dist/client/assets/{toolbar-Cd-zT0GV.js → toolbar-DktIJIGj.js} +1 -1
  168. package/dist/client/assets/{tooltip-D2IcwsrW.js → tooltip-oPF11xOc.js} +1 -1
  169. package/dist/client/assets/{types-DdqgwoF-.js → types-DZM3oHCm.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-B7DE5RlO.js → use-ai-providers-CZx1BFdY.js} +1 -1
  171. package/dist/client/assets/{use-automations-BaLowkA-.js → use-automations-DttN1_QI.js} +1 -1
  172. package/dist/client/assets/{use-capability-BYfWBphf.js → use-capability-CREa5hxg.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-vJNeZS2R.js → use-clock-tick-D4shCSZy.js} +1 -1
  174. package/dist/client/assets/{use-collections-DOhjyZoW.js → use-collections-DZi4alPB.js} +1 -1
  175. package/dist/client/assets/{use-connection-a48WkDyi.js → use-connection-BaK7gZK8.js} +1 -1
  176. package/dist/client/assets/{use-copy-Dm0W_H8p.js → use-copy-BGXnmJ0Y.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-BRQVpCUG.js → use-create-virtual-mcp-BzfjXCKR.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-oRzID6xD.js → use-debounced-autosave-DCle0l35.js} +1 -1
  179. package/dist/client/assets/{use-debounced-value-B1GdK5fU.js → use-debounced-value-D0ar8P23.js} +1 -1
  180. package/dist/client/assets/{use-delete-connection-CKYm7fJS.js → use-delete-connection-IE5Qqa0Q.js} +1 -1
  181. package/dist/client/assets/{use-file-configs-F_Lh19IF.js → use-file-configs-CZMtO580.js} +1 -1
  182. package/dist/client/assets/{use-infinite-scroll-Cs1p0W0X.js → use-infinite-scroll-c7yDanFw.js} +1 -1
  183. package/dist/client/assets/{use-join-requests-Cx83Qjv9.js → use-join-requests-CiTPLtoo.js} +1 -1
  184. package/dist/client/assets/{use-mcp-client-B1E7Nyjd.js → use-mcp-client-BYcrk6lz.js} +1 -1
  185. package/dist/client/assets/{use-mcp-prompts-B4idSZTh.js → use-mcp-prompts-BjyIsgXC.js} +1 -1
  186. package/dist/client/assets/{use-mcp-tools-CqHv2Xxs.js → use-mcp-tools-DYc-d8kf.js} +1 -1
  187. package/dist/client/assets/{use-members-BqgoI8LN.js → use-members-CDV7-ikh.js} +1 -1
  188. package/dist/client/assets/{use-mobile-CWv_pUWp.js → use-mobile-BKRfr7ic.js} +1 -1
  189. package/dist/client/assets/{use-navigate-to-agent-CWpJGmq-.js → use-navigate-to-agent-D_fgYk51.js} +1 -1
  190. package/dist/client/assets/{use-org-auth-client-C3mEUOcx.js → use-org-auth-client-C2F1ILpp.js} +1 -1
  191. package/dist/client/assets/{use-org-sso-Dop9y0HC.js → use-org-sso-DHz7VJ1a.js} +1 -1
  192. package/dist/client/assets/{use-organization-roles-BJ74MotE.js → use-organization-roles-9DZ9iYns.js} +1 -1
  193. package/dist/client/assets/{use-organization-settings-8LInvXec.js → use-organization-settings-ClKaDrE7.js} +1 -1
  194. package/dist/client/assets/{use-registry-connections-D2DhXJmA.js → use-registry-connections-Bgebk2mm.js} +1 -1
  195. package/dist/client/assets/{use-secrets-BLkb7BZG.js → use-secrets-DLWDaup6.js} +1 -1
  196. package/dist/client/assets/{use-status-sounds-MjzDR8jw.js → use-status-sounds-CBCN2gk-.js} +1 -1
  197. package/dist/client/assets/{use-view-mode-pvlDGqxN.js → use-view-mode-MNe61YUF.js} +1 -1
  198. package/dist/client/assets/{use-virtual-mcp-BcsK_V5p.js → use-virtual-mcp-Bkiriz_M.js} +1 -1
  199. package/dist/client/assets/useInfiniteQuery-bB2OO4_F.js +1 -0
  200. package/dist/client/assets/useSuspenseInfiniteQuery-CgFmFjuu.js +1 -0
  201. package/dist/client/assets/{useSuspenseQueries-C20MRsU9.js → useSuspenseQueries-DO4LObMF.js} +1 -1
  202. package/dist/client/assets/{variant-calendar-Dnj2EkPc.js → variant-calendar-B-NYPIkC.js} +1 -1
  203. package/dist/client/assets/{view-mode-toggle-DQyCEqbJ.js → view-mode-toggle-DbKux4TQ.js} +1 -1
  204. package/dist/client/index.html +1 -1
  205. package/dist/server/cli.js +510 -451
  206. package/dist/server/migrate.js +156 -97
  207. package/package.json +1 -1
  208. package/dist/client/assets/agents-list-DjZyRbNh.js +0 -1
  209. package/dist/client/assets/automations-Dss23VYg.js +0 -1
  210. package/dist/client/assets/commerce-onboarding-C0r_RGc5.js +0 -1
  211. package/dist/client/assets/page-seo-sheet-CL3gCFpf.js +0 -1
  212. package/dist/client/assets/project-app-view-y5DH-I8K.js +0 -1
  213. package/dist/client/assets/record-editor-CvDeMQ2G.js +0 -1
  214. package/dist/client/assets/registry-BaFm0L19.js +0 -2
  215. package/dist/client/assets/sortable.esm-DHLm3dqa.js +0 -5
  216. package/dist/client/assets/store-registry-3H_xbQFv.js +0 -2
  217. package/dist/client/assets/useInfiniteQuery-QT7BExxx.js +0 -1
  218. package/dist/client/assets/useSuspenseInfiniteQuery-CVusVKT2.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "3.103.2",
3
+ "version": "3.103.4",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{c as se,j as s,B as Z,D as me,r as Y,w as v,t as de}from"./index-j1EmgqV8.js";import{c as w,b as ne,a as ee,D as te}from"./dropdown-menu-OVr8TMr_.js";import{s as pe}from"./Star01-BvLdWUOq.js";import{a as fe}from"./Users03-BiIAwLFR.js";import{a as ge,G as ue}from"./github-repo-picker-DSR-TwBo.js";import{S as he,u as xe,H as ie,W as oe,I as je}from"./import-from-deco-dialog-CEW3ZJjT.js";import{u as _e,b as Ce,c as be}from"./use-virtual-mcp-BcsK_V5p.js";import{P as K}from"./index-DuwRwNmr.js";import{a as ye}from"./DotsVertical-p5cw6bzY.js";import{a as Ne}from"./Settings02-CWsiKyfu.js";import{s as Se}from"./Trash01-C3HJx9Eu.js";import{A as De,aw as ve}from"./agent-icon-SFzfjqT3.js";import{m as Ae}from"./use-navigate-to-agent-CWpJGmq-.js";import{C as we}from"./card-Dt5JuJj0.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ke}from"./use-capability-BYfWBphf.js";import{E as Te}from"./empty-state-DQfglbNM.js";import{u as ze}from"./use-create-virtual-mcp-BRQVpCUG.js";import{c as Ie,b as Pe,d as He,A as Ee,e as Me,g as Oe,a as Be,f as Ge}from"./alert-dialog-Dv-S36Xs.js";import{S as $e}from"./search-input-DRzQD01R.js";import{s as le}from"./Plus-DrCr8atg.js";import"./ChevronUp-DrHOs0IB.js";import"./ChevronRight-Cw6r4eF5.js";import"./dialog-Dy6eXpKe.js";import"./X-D1lT84o6.js";import"./checkbox-D5qKxHwE.js";import"./collection-search-Yx1Vcd74.js";import"./SearchMd-C5JuA4Q_.js";import"./use-debounced-value-B1GdK5fU.js";import"./use-connection-a48WkDyi.js";import"./use-collections-DOhjyZoW.js";import"./use-mcp-client-B1E7Nyjd.js";import"./auth-B9AdzGWs.js";import"./authenticate-and-persist-oauth-CWwDFJ5t.js";import"./mcp-oauth-iKgiXli9.js";import"./use-mcp-tools-CqHv2Xxs.js";import"./extract-connection-data-DrUVsxqd.js";import"./sidebar-D5j5gPeI.js";import"./LayoutLeft-B7KWV4nT.js";import"./use-mobile-CWv_pUWp.js";import"./sheet-DahuGsa4.js";import"./tooltip-D2IcwsrW.js";import"./AlertCircle-B7YwjVuv.js";import"./Tool01-MvyjXDCb.js";import"./SwitchHorizontal01-fTq_Xj_0.js";import"./XCircle-B1aV7AX3.js";import"./ArrowUpRight-DvElag-V.js";import"./ZapSquare-C-BUl6mg.js";import"./CheckCircle-DIxU9fNb.js";import"./ChevronDown-D7t2IbgZ.js";import"./ChevronLeft-DnVztwcc.js";import"./Stars02-CZ3C1sQr.js";import"./Eye-CPb9WDyf.js";import"./ZoomOut-DnuKetHD.js";import"./Globe01-D51Pf1ib.js";import"./FilterLines-2uX2Gf4U.js";import"./Globe04-8CmI5zRW.js";import"./HardDrive-fBNuw9RE.js";import"./Key01-B-V8oh6M.js";import"./LinkExternal01-Cd3gNz9H.js";import"./Monitor01-BzxQo8OV.js";import"./Sun-DPnjEA61.js";import"./Palette-TV4PomkE.js";import"./Play-B9WHtGRe.js";import"./SearchLg-C45t9PQZ.js";import"./Shield01-BP8Krja8.js";import"./Stars01-ledCttL2.js";import"./Upload01-DvSZDpgm.js";import"./User01-TldGh0YP.js";import"./Users01-B63UEiqj.js";import"./XClose-9xeu7JIP.js";import"./Zap-C8z5Nmtq.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(w,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(w,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:he,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(w,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ge,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(w,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(w,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(w,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(w,{variant:"destructive",onClick:k=>{k.stopPropagation(),l(k)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(we,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function ns(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=xe(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=ke("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=K,A=K,k=K;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(K.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const q=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==k.Body||t[19]!==I||t[20]!==q?(P=s.jsxs(k.Body,{children:[I,q,J]}),t[17]=J,t[18]=k.Body,t[19]=I,t[20]=q,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(ue,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{ns as default};
@@ -1 +0,0 @@
1
- import{c as B,j as o,D as L,b as T,r as $,B as M,w as N}from"./index-j1EmgqV8.js";import{s as D}from"./Plus-DrCr8atg.js";import{i as S}from"./Zap-C8z5Nmtq.js";import{S as q}from"./search-input-DRzQD01R.js";import{P as l}from"./index-DuwRwNmr.js";import{E as b}from"./empty-state-DQfglbNM.js";import{c as O}from"./use-automations-BaLowkA-.js";import{m as V}from"./use-navigate-to-agent-CWpJGmq-.js";import{A as F}from"./automation-list-row-CsaQkLKW.js";import{o as G}from"./use-mcp-client-B1E7Nyjd.js";import{u as H}from"./use-virtual-mcp-BcsK_V5p.js";import{R as J}from"./require-capability-CehH7jAZ.js";import"./SearchMd-C5JuA4Q_.js";import"./sidebar-D5j5gPeI.js";import"./LayoutLeft-B7KWV4nT.js";import"./use-mobile-CWv_pUWp.js";import"./sheet-DahuGsa4.js";import"./X-D1lT84o6.js";import"./tooltip-D2IcwsrW.js";import"./studio-tools-BAmwKCdT.js";import"./alert-dialog-Dv-S36Xs.js";import"./dropdown-menu-OVr8TMr_.js";import"./ChevronUp-DrHOs0IB.js";import"./ChevronRight-Cw6r4eF5.js";import"./DotsVertical-p5cw6bzY.js";import"./Stars02-CZ3C1sQr.js";import"./Trash01-C3HJx9Eu.js";import"./agent-icon-SFzfjqT3.js";import"./AlertCircle-B7YwjVuv.js";import"./Tool01-MvyjXDCb.js";import"./SwitchHorizontal01-fTq_Xj_0.js";import"./Settings02-CWsiKyfu.js";import"./XCircle-B1aV7AX3.js";import"./ArrowUpRight-DvElag-V.js";import"./ZapSquare-C-BUl6mg.js";import"./Users03-BiIAwLFR.js";import"./CheckCircle-DIxU9fNb.js";import"./ChevronDown-D7t2IbgZ.js";import"./ChevronLeft-DnVztwcc.js";import"./Eye-CPb9WDyf.js";import"./ZoomOut-DnuKetHD.js";import"./Globe01-D51Pf1ib.js";import"./FilterLines-2uX2Gf4U.js";import"./Star01-BvLdWUOq.js";import"./Globe04-8CmI5zRW.js";import"./HardDrive-fBNuw9RE.js";import"./Key01-B-V8oh6M.js";import"./LinkExternal01-Cd3gNz9H.js";import"./Monitor01-BzxQo8OV.js";import"./Sun-DPnjEA61.js";import"./Palette-TV4PomkE.js";import"./Play-B9WHtGRe.js";import"./SearchLg-C45t9PQZ.js";import"./Shield01-BP8Krja8.js";import"./Stars01-ledCttL2.js";import"./Upload01-DvSZDpgm.js";import"./User01-TldGh0YP.js";import"./Users01-B63UEiqj.js";import"./XClose-9xeu7JIP.js";import"./auth-B9AdzGWs.js";import"./use-collections-DOhjyZoW.js";import"./use-capability-BYfWBphf.js";import"./access-gate-BY3tN2ja.js";import"./capability-load-error-CFxZVJfo.js";function K(){const t=B.c(16),{org:i}=L(),{data:v}=O(void 0),u=v===void 0?[]:v,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(q,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const w=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(D,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==w?(s=o.jsxs(j.Body,{children:[r,w]}),t[6]=j.Body,t[7]=r,t[8]=w,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function ro(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{ro as default};
@@ -1 +0,0 @@
1
- import{c as P,r as K,l as se,j as t,B,m as Ye,d as Se,K as Z,o as Pe,s as xe,n as Le,p as $e,i as Je,k as Ze,t as ht,q as he,Q as xt,E as yt,a as ze,u as bt,v as Ht,w as Bt,b as jt,x as Gt,y as vt,L as Qt}from"./index-j1EmgqV8.js";import{A as Wt}from"./auth-entry-DnJxnsQa.js";import{A as Yt}from"./auth-split-layout-CRM5rJ4I.js";import{O as ut}from"./organization-choice-C1y80Okj.js";import{f as Jt}from"./tab-id-BptcWVWa.js";import{I as _e}from"./input-zUoMTUjz.js";import{u as De,W as Ct,S as St,g as Zt,C as Xt}from"./use-mcp-client-B1E7Nyjd.js";import{i as Nt}from"./XCircle-B1aV7AX3.js";import{I as Xe}from"./integration-icon-Cpv4CIQ_.js";import{D as Fe,a as _t,b as Et,c as wt,d as It,e as Tt}from"./dialog-Dy6eXpKe.js";import{T as Ot,a as At,b as kt}from"./tooltip-D2IcwsrW.js";import{i as et}from"./CheckCircle-DIxU9fNb.js";import{i as en,t as Rt}from"./agent-icon-SFzfjqT3.js";import{g as tn,c as nn,e as sn}from"./extract-connection-data-DrUVsxqd.js";import{F as ye,a as Me,b as be,c as ke,d as je,e as ve,f as on}from"./form-CkEHHrgu.js";import{i as rn}from"./ChevronUp-DrHOs0IB.js";import{s as an,a as Ut}from"./Eye-CPb9WDyf.js";import{i as ln}from"./Settings02-CWsiKyfu.js";import{u as cn}from"./useSuspenseQueries-C20MRsU9.js";import{a as dn}from"./authenticate-and-persist-oauth-CWwDFJ5t.js";import{i as Pt}from"./ArrowUpRight-DvElag-V.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-CdYywjB8.js";import"./User01-TldGh0YP.js";import"./auth-B9AdzGWs.js";import"./X-D1lT84o6.js";import"./AlertCircle-B7YwjVuv.js";import"./Tool01-MvyjXDCb.js";import"./SwitchHorizontal01-fTq_Xj_0.js";import"./ZapSquare-C-BUl6mg.js";import"./Users03-BiIAwLFR.js";import"./ChevronDown-D7t2IbgZ.js";import"./ChevronLeft-DnVztwcc.js";import"./ChevronRight-Cw6r4eF5.js";import"./DotsVertical-p5cw6bzY.js";import"./Stars02-CZ3C1sQr.js";import"./ZoomOut-DnuKetHD.js";import"./Globe01-D51Pf1ib.js";import"./FilterLines-2uX2Gf4U.js";import"./Star01-BvLdWUOq.js";import"./Globe04-8CmI5zRW.js";import"./HardDrive-fBNuw9RE.js";import"./Key01-B-V8oh6M.js";import"./LayoutLeft-B7KWV4nT.js";import"./LinkExternal01-Cd3gNz9H.js";import"./Monitor01-BzxQo8OV.js";import"./Sun-DPnjEA61.js";import"./Palette-TV4PomkE.js";import"./Play-B9WHtGRe.js";import"./Plus-DrCr8atg.js";import"./SearchLg-C45t9PQZ.js";import"./SearchMd-C5JuA4Q_.js";import"./Shield01-BP8Krja8.js";import"./Stars01-ledCttL2.js";import"./Trash01-C3HJx9Eu.js";import"./Upload01-DvSZDpgm.js";import"./Users01-B63UEiqj.js";import"./XClose-9xeu7JIP.js";import"./Zap-C8z5Nmtq.js";import"./label-DIdfff7-.js";import"./mcp-oauth-iKgiXli9.js";const un=/^[a-zA-Z][a-zA-Z\d+.-]*:/,mn=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,fn=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,pn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Re(o){const e=o.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=un.test(e),s=mn.test(e),i=fn.test(e);if(n&&!s&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=s?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 l=r.hostname.split(".");return l.length<2||l.some(c=>!c||!pn.test(c))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function Qe(o){const e=P.c(14),{children:n,className:s,wrapperClassName:i}=o,[a,r]=K.useState(!0);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=v=>{if(!v)return;const j=()=>{const u=v.scrollHeight-v.scrollTop-v.clientHeight<8;r(u)};j(),v.addEventListener("scroll",j,{passive:!0});const p=new ResizeObserver(j);p.observe(v);for(const u of Array.from(v.children))p.observe(u);return()=>{v.removeEventListener("scroll",j),p.disconnect()}},e[0]=l):l=e[0];const c=l;let m;e[1]!==i?(m=se("relative",i),e[1]=i,e[2]=m):m=e[2];let f;e[3]!==n||e[4]!==s?(f=t.jsx("div",{ref:c,className:s,children:n}),e[3]=n,e[4]=s,e[5]=f):f=e[5];const g=a?"opacity-0":"opacity-100";let d;e[6]!==g?(d=se("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",g),e[6]=g,e[7]=d):d=e[7];let x;e[8]!==d?(x=t.jsx("div",{"aria-hidden":!0,className:d}),e[8]=d,e[9]=x):x=e[9];let b;return e[10]!==m||e[11]!==f||e[12]!==x?(b=t.jsxs("div",{className:m,children:[f,x]}),e[10]=m,e[11]=f,e[12]=x,e[13]=b):b=e[13],b}function gn(o){const e=o.properties;if(!e)return[];const n=[];for(const[s,i]of Object.entries(e)){const l=i?.properties?.__type?.const;typeof l=="string"&&l.length>0&&n.push({fieldKey:s,bindingType:l})}return n}function hn(o,e){const n=[];if(o.length&&n.push({field:["id"],operator:"in",value:o}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function ne(o){const e=o;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??o}function xn(o,e,n,s){return{...o??{},[e]:{__type:n,value:s}}}function We(o){return o==null?!1:typeof o=="string"?o.trim().length>0:typeof o=="number"||typeof o=="boolean"?!0:Array.isArray(o)?o.some(We):typeof o=="object"?Object.entries(o).some(([e,n])=>!e.startsWith("__")&&We(n)):!1}function yn(o){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[o]?e[o]:o.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function bn(o){return We(o)?typeof o=="string"?o.trim():typeof o=="number"||typeof o=="boolean"?String(o):JSON.stringify(o):null}function jn(o){return o?Object.entries(o).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const s=bn(n);return s?[{key:e,label:yn(e),value:s}]:[]}):[]}function vn({autoOpenFieldKey:o,card:e}){return o===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function Cn(o,e,n){const s=o.filter(i=>i.app_name===e||!!n&&i.app_id===n);return s.length===0?null:(s.sort((i,a)=>{const r=l=>l.status==="active"?0:1;return r(i)!==r(a)?r(i)-r(a):(a.updated_at??"").localeCompare(i.updated_at??"")}),s[0].id)}function Sn(o){return o.server?.icons?.[0]?.src??tn(o.server?.repository)??null}function Nn(o,e){const n=o._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||o.title||o.server?.title||o.server?.name||e}function _n(o){const e=[],n=new Map(o.connections.map(s=>[s.id,s]));for(const s of o.requirements){const i=o.curated[s.bindingType],a=i?o.itemsById[i.registryAppId]:o.itemsByName[s.bindingType];if(!a)continue;const r=o.configurationState?.[s.fieldKey]?.value,l=r?n.get(r):void 0,c=r&&l?r:null,m=c?o.connectionReadiness?.[c]!==!1:!1,f=!!c&&m,g=f?void 0:o.saBindings?.[s.bindingType],d=f||!!g,x=f?"oauth":g?"sa":null;e.push({fieldKey:s.fieldKey,bindingType:s.bindingType,registryItem:a,title:Nn(a,s.bindingType),icon:Sn(a),headline:i?.headline??a._meta?.["mcp.mesh"]?.short_description??null,area:i?.area??null,bullets:i?.bullets??[],satisfied:d,candidateConnectionId:d?null:c||Cn(o.connections,s.bindingType,i?.registryAppId),linkedConnectionId:c,configurationState:l?.configuration_state??null,boundVia:x,boundResource:g?.resource??null})}return e}function En(o,e){if(!o)return null;const n=i=>{if(i.startsWith("sc-domain:"))return i.substring(10);try{let r=new URL(i.startsWith("http")?i:`https://${i}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return i}},s=n(o);for(const i of e)if(n(i.siteUrl)===s)return i.siteUrl;return null}function wn(o){return(o?.response?.accountSummaries??[]).map(s=>({account:s.account,options:(s.propertySummaries??[]).map(i=>({value:i.property,label:`${i.displayName} (${s.displayName})`}))}))}function mt(o){const e=P.c(38);let n,s,i,a,r;e[0]!==o?({value:r,onChange:s,placeholder:i,className:n,...a}=o,e[0]=o,e[1]=n,e[2]=s,e[3]=i,e[4]=a,e[5]=r):(n=e[1],s=e[2],i=e[3],a=e[4],r=e[5]);const[l,c]=K.useState(!1),[m,f]=K.useState(!1);let g;e[6]!==r?(g=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(U){console.error("Failed to copy text: ",U)}},e[6]=r,e[7]=g):g=e[7];const d=g;let x;e[8]!==l?(x=()=>{c(!l)},e[8]=l,e[9]=x):x=e[9];const b=x,v=l?"text":"password";let j;e[10]!==n?(j=se("pr-20",n),e[10]=n,e[11]=j):j=e[11];let p;e[12]!==s||e[13]!==i||e[14]!==a||e[15]!==v||e[16]!==j||e[17]!==r?(p=t.jsx(_e,{type:v,value:r,onChange:s,placeholder:i,className:j,...a}),e[12]=s,e[13]=i,e[14]=a,e[15]=v,e[16]=j,e[17]=r,e[18]=p):p=e[18];const u=l?"Hide password":"Show password";let h;e[19]!==l?(h=l?t.jsx(ln,{size:16}):t.jsx(an,{size:16}),e[19]=l,e[20]=h):h=e[20];let y;e[21]!==u||e[22]!==h||e[23]!==b?(y=t.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:b,title:u,children:h}),e[21]=u,e[22]=h,e[23]=b,e[24]=y):y=e[24];const C=!r,w=m?"Copied!":"Copy token";let E;e[25]!==m?(E=m?t.jsx(rn,{size:16}):t.jsx(Ut,{size:16}),e[25]=m,e[26]=E):E=e[26];let N;e[27]!==d||e[28]!==w||e[29]!==E||e[30]!==C?(N=t.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:d,disabled:C,title:w,children:E}),e[27]=d,e[28]=w,e[29]=E,e[30]=C,e[31]=N):N=e[31];let _;e[32]!==N||e[33]!==y?(_=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[y,N]}),e[32]=N,e[33]=y,e[34]=_):_=e[34];let I;return e[35]!==_||e[36]!==p?(I=t.jsxs("div",{className:"relative",children:[p,_]}),e[35]=_,e[36]=p,e[37]=I):I=e[37],I}function tt(o){const e=P.c(19),{card:n,selfClient:s,org:i,onDone:a,onError:r}=o,l=Ye();let c;e[0]!==n||e[1]!==s?(c=async j=>{const p={...n.configurationState??{},...j};await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:p}}})},e[0]=n,e[1]=s,e[2]=c):c=e[2];let m;e[3]!==a||e[4]!==i||e[5]!==l?(m=async()=>{await l.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),a()},e[3]=a,e[4]=i,e[5]=l,e[6]=m):m=e[6];let f;e[7]!==r?(f=j=>{r?.(j)},e[7]=r,e[8]=f):f=e[8];let g;e[9]!==c||e[10]!==m||e[11]!==f?(g={mutationFn:c,onSuccess:m,onError:f},e[9]=c,e[10]=m,e[11]=f,e[12]=g):g=e[12];const d=Se(g);let x;e[13]!==d?(x=j=>d.mutate(j),e[13]=d,e[14]=x):x=e[14];const b=x;let v;return e[15]!==d.error||e[16]!==d.isPending||e[17]!==b?(v={save:b,isPending:d.isPending,error:d.error},e[15]=d.error,e[16]=d.isPending,e[17]=b,e[18]=v):v=e[18],v}const In=Pe({accountName:xe().min(1,"Informe o nome da conta"),appKey:xe().optional(),appToken:xe().optional()});function Tn(o){const e=P.c(63),{card:n,selfClient:s,org:i,onDone:a,onIsPendingChange:r}=o;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Le(In),e[0]=l):l=e[0];const c=n.configurationState?.accountName||"",m=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let g;e[1]!==c||e[2]!==m||e[3]!==f?(g={resolver:l,defaultValues:{accountName:c,appKey:m,appToken:f}},e[1]=c,e[2]=m,e[3]=f,e[4]=g):g=e[4];const d=$e(g);let x;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==d?(x=()=>{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]=x):x=e[9];let b;e[10]!==n.configurationState||e[11]!==d?(b=[n.configurationState,d],e[10]=n.configurationState,e[11]=d,e[12]=b):b=e[12],K.useEffect(x,b);let v;e[13]!==n||e[14]!==a||e[15]!==i||e[16]!==s?(v={card:n,selfClient:s,org:i,onDone:a},e[13]=n,e[14]=a,e[15]=i,e[16]=s,e[17]=v):v=e[17];const{save:j,isPending:p,error:u}=tt(v);let h,y;e[18]!==p||e[19]!==r?(y=()=>{r?.(p)},h=[p,r],e[18]=p,e[19]=r,e[20]=h,e[21]=y):(h=e[20],y=e[21]),K.useEffect(y,h);let C;if(e[22]!==d||e[23]!==j){let q;e[25]!==j?(q=async S=>{j(S)},e[25]=j,e[26]=q):q=e[26],C=d.handleSubmit(q),e[22]=d,e[23]=j,e[24]=C}else C=e[24];const w=C;let E;e[27]!==p?(E=q=>{const{field:S}=q;return t.jsxs(be,{children:[t.jsx(ke,{children:"Nome da conta"}),t.jsx(je,{children:t.jsx(_e,{placeholder:"Nome da sua conta VTEX",...S,disabled:p})}),t.jsx(ve,{})]})},e[27]=p,e[28]=E):E=e[28];let N;e[29]!==d.control||e[30]!==E?(N=t.jsx(ye,{control:d.control,name:"accountName",render:E}),e[29]=d.control,e[30]=E,e[31]=N):N=e[31];let _;e[32]!==p?(_=q=>{const{field:S}=q;return t.jsxs(be,{children:[t.jsx(ke,{children:"App Key (opcional)"}),t.jsx(je,{children:t.jsx(mt,{placeholder:"App Key da VTEX",...S,disabled:p})}),t.jsx(ve,{})]})},e[32]=p,e[33]=_):_=e[33];let I;e[34]!==d.control||e[35]!==_?(I=t.jsx(ye,{control:d.control,name:"appKey",render:_}),e[34]=d.control,e[35]=_,e[36]=I):I=e[36];let U;e[37]!==p?(U=q=>{const{field:S}=q;return t.jsxs(be,{children:[t.jsx(ke,{children:"App Token (opcional)"}),t.jsx(je,{children:t.jsx(mt,{placeholder:"App Token da VTEX",...S,disabled:p})}),t.jsx(ve,{})]})},e[37]=p,e[38]=U):U=e[38];let T;e[39]!==d.control||e[40]!==U?(T=t.jsx(ye,{control:d.control,name:"appToken",render:U}),e[39]=d.control,e[40]=U,e[41]=T):T=e[41];let O;e[42]!==d||e[43]!==N||e[44]!==I||e[45]!==T?(O=t.jsxs(Me,{...d,children:[N,I,T]}),e[42]=d,e[43]=N,e[44]=I,e[45]=T,e[46]=O):O=e[46];let k;e[47]!==u?(k=u&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:u instanceof Error?u.message:"Não foi possível salvar a configuração"}),e[47]=u,e[48]=k):k=e[48];let R;e[49]!==p||e[50]!==a?(R=t.jsx(B,{type:"button",variant:"outline",onClick:a,disabled:p,children:"Cancelar"}),e[49]=p,e[50]=a,e[51]=R):R=e[51];const $=p?"Salvando...":"Salvar";let M;e[52]!==p||e[53]!==$?(M=t.jsx(B,{type:"submit",disabled:p,children:$}),e[52]=p,e[53]=$,e[54]=M):M=e[54];let L;e[55]!==R||e[56]!==M?(L=t.jsxs(Fe,{className:"pt-4",children:[R,M]}),e[55]=R,e[56]=M,e[57]=L):L=e[57];let F;return e[58]!==w||e[59]!==O||e[60]!==k||e[61]!==L?(F=t.jsxs("form",{onSubmit:w,className:"space-y-4",children:[O,k,L]}),e[58]=w,e[59]=O,e[60]=k,e[61]=L,e[62]=F):F=e[62],F}function Lt(o){const e=P.c(30),{options:n,value:s,onChange:i,disabled:a,ariaLabel:r,searchPlaceholder:l}=o,c=l===void 0?"Buscar...":l,[m,f]=K.useState("");let g,d,x;if(e[0]!==n||e[1]!==m||e[2]!==s){const N=m.trim().toLowerCase();g=N?n.filter(_=>_.label.toLowerCase().includes(N)):n,d=g.map(On),x=d.includes(s)?s:d[0]??"",e[0]=n,e[1]=m,e[2]=s,e[3]=g,e[4]=d,e[5]=x}else g=e[3],d=e[4],x=e[5];const b=x;let v;e[6]!==a||e[7]!==d||e[8]!==i?(v=function(_){if(a||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(_.key))return;_.preventDefault();const U=_.currentTarget.dataset.value,T=d.indexOf(U),O=d.length;if(O===0)return;let k;_.key==="ArrowDown"||_.key==="ArrowRight"?k=(T+1)%O:_.key==="ArrowUp"||_.key==="ArrowLeft"?k=(T-1+O)%O:_.key==="Home"?k=0:k=O-1;const R=d[k];i(R),_.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(R)}"]`)?.focus()},e[6]=a,e[7]=d,e[8]=i,e[9]=v):v=e[9];const j=v;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(en,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[10]=p):p=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=N=>f(N.target.value),e[11]=u):u=e[11];const h=`Buscar ${r}`;let y;e[12]!==a||e[13]!==m||e[14]!==c||e[15]!==h?(y=t.jsxs("div",{className:"relative",children:[p,t.jsx(_e,{type:"text",value:m,onChange:u,disabled:a,placeholder:c,"aria-label":h,className:"h-8 pl-8"})]}),e[12]=a,e[13]=m,e[14]=c,e[15]=h,e[16]=y):y=e[16];let C;e[17]!==a||e[18]!==g||e[19]!==j||e[20]!==i||e[21]!==b||e[22]!==s?(C=g.length===0?t.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):g.map(N=>{const _=N.value===s;return t.jsxs("button",{type:"button",role:"radio","aria-checked":_,disabled:a,"data-value":N.value,tabIndex:N.value===b?0:-1,onClick:()=>i(N.value),onKeyDown:j,className:se("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",_?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[t.jsx("span",{className:"truncate",children:N.label}),_?t.jsx(et,{size:16,className:"shrink-0 text-primary"}):null]},N.value)}),e[17]=a,e[18]=g,e[19]=j,e[20]=i,e[21]=b,e[22]=s,e[23]=C):C=e[23];let w;e[24]!==r||e[25]!==C?(w=t.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:C}),e[24]=r,e[25]=C,e[26]=w):w=e[26];let E;return e[27]!==y||e[28]!==w?(E=t.jsxs("div",{className:"space-y-2",children:[y,w]}),e[27]=y,e[28]=w,e[29]=E):E=e[29],E}function On(o){return o.value}function nt(o){const e=P.c(16),{label:n,iconSize:s,className:i,iconClassName:a,labelClassName:r}=o,l=s===void 0?14:s;let c;e[0]!==i?(c=se("inline-flex items-center gap-2",i),e[0]=i,e[1]=c):c=e[1];let m;e[2]!==a?(m=se("shrink-0 animate-spin",a),e[2]=a,e[3]=m):m=e[3];let f;e[4]!==l||e[5]!==m?(f=t.jsx(Je,{size:l,className:m}),e[4]=l,e[5]=m,e[6]=f):f=e[6];let g;e[7]!==r?(g=se("text-sm",r),e[7]=r,e[8]=g):g=e[8];let d;e[9]!==n||e[10]!==g?(d=t.jsx("span",{className:g,children:n}),e[9]=n,e[10]=g,e[11]=d):d=e[11];let x;return e[12]!==c||e[13]!==f||e[14]!==d?(x=t.jsxs("span",{className:c,children:[f,d]}),e[12]=c,e[13]=f,e[14]=d,e[15]=x):x=e[15],x}const An=Pe({propertyId:xe().min(1,"Selecione uma propriedade")});function kn(o){const e=P.c(55),{card:n,connectionId:s,companionClient:i,selfClient:a,org:r,onDone:l,onIsPendingChange:c}=o;let m;e[0]!==s||e[1]!==r.id?(m=Z.commerceDiscoveryCompanionGaProperties(r.id,s),e[0]=s,e[1]=r.id,e[2]=m):m=e[2];let f;e[3]!==i?(f=async()=>{const S=await i.callTool({name:"get-account-summaries",arguments:{}}),z=ne(S);return wn(z)},e[3]=i,e[4]=f):f=e[4];let g;e[5]!==m||e[6]!==f?(g={queryKey:m,queryFn:f},e[5]=m,e[6]=f,e[7]=g):g=e[7];const d=Ze(g);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=Le(An),e[8]=x):x=e[8];const b=n.configurationState?.propertyId||"";let v;e[9]!==b?(v={resolver:x,defaultValues:{propertyId:b}},e[9]=b,e[10]=v):v=e[10];const j=$e(v);let p;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==a?(p={card:n,selfClient:a,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=a,e[15]=p):p=e[15];const{save:u,isPending:h,error:y}=tt(p);let C,w;e[16]!==h||e[17]!==c?(C=()=>{c?.(h)},w=[h,c],e[16]=h,e[17]=c,e[18]=C,e[19]=w):(C=e[18],w=e[19]),K.useEffect(C,w);let E;if(e[20]!==j||e[21]!==u){let S;e[23]!==u?(S=async z=>{u(z)},e[23]=u,e[24]=S):S=e[24],E=j.handleSubmit(S),e[20]=j,e[21]=u,e[22]=E}else E=e[22];const N=E;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(nt,{label:"Carregando propriedades..."})}),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:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=S):S=e[26],S}let _;e[27]!==d.data?(_=d.data||[],e[27]=d.data,e[28]=_):_=e[28];const I=_;if(I.flatMap(Un).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:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."})}),e[29]=S):S=e[29],S}let T;e[30]!==h||e[31]!==I?(T=S=>{const{field:z}=S;return t.jsxs(be,{children:[t.jsx(je,{children:t.jsx(Lt,{options:I.flatMap(Rn),value:z.value,onChange:z.onChange,disabled:h,ariaLabel:"Propriedade do Google Analytics"})}),t.jsx(ve,{})]})},e[30]=h,e[31]=I,e[32]=T):T=e[32];let O;e[33]!==j.control||e[34]!==T?(O=t.jsx(ye,{control:j.control,name:"propertyId",render:T}),e[33]=j.control,e[34]=T,e[35]=O):O=e[35];let k;e[36]!==j||e[37]!==O?(k=t.jsx(Me,{...j,children:O}),e[36]=j,e[37]=O,e[38]=k):k=e[38];let R;e[39]!==y?(R=y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[39]=y,e[40]=R):R=e[40];let $;e[41]!==h||e[42]!==l?($=t.jsx(B,{type:"button",variant:"outline",onClick:l,disabled:h,children:"Cancelar"}),e[41]=h,e[42]=l,e[43]=$):$=e[43];const M=h?"Salvando...":"Salvar";let L;e[44]!==h||e[45]!==M?(L=t.jsx(B,{type:"submit",disabled:h,children:M}),e[44]=h,e[45]=M,e[46]=L):L=e[46];let F;e[47]!==$||e[48]!==L?(F=t.jsxs(Fe,{className:"pt-4",children:[$,L]}),e[47]=$,e[48]=L,e[49]=F):F=e[49];let q;return e[50]!==N||e[51]!==k||e[52]!==R||e[53]!==F?(q=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[k,R,F]}),e[50]=N,e[51]=k,e[52]=R,e[53]=F,e[54]=q):q=e[54],q}function Rn(o){return o.options}function Un(o){return o.options}const Pn=Pe({siteUrl:xe().min(1,"Selecione um site")});function Ln(o){const e=P.c(59),{card:n,connectionId:s,companionClient:i,selfClient:a,org:r,contextSiteUrl:l,onDone:c,onIsPendingChange:m}=o;let f;e[0]!==s||e[1]!==r.id?(f=Z.commerceDiscoveryCompanionGscSites(r.id,s),e[0]=s,e[1]=r.id,e[2]=f):f=e[2];let g;e[3]!==i?(g=async()=>{const S=await i.callTool({name:"list_sites",arguments:{}});return ne(S).sites||[]},e[3]=i,e[4]=g):g=e[4];let d;e[5]!==f||e[6]!==g?(d={queryKey:f,queryFn:g},e[5]=f,e[6]=g,e[7]=d):d=e[7];const x=Ze(d);let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=Le(Pn),e[8]=b):b=e[8];const v=n.configurationState?.siteUrl||"";let j;e[9]!==v?(j={resolver:b,defaultValues:{siteUrl:v}},e[9]=v,e[10]=j):j=e[10];const p=$e(j);let u;e[11]!==n||e[12]!==c||e[13]!==r||e[14]!==a?(u={card:n,selfClient:a,org:r,onDone:c},e[11]=n,e[12]=c,e[13]=r,e[14]=a,e[15]=u):u=e[15];const{save:h,isPending:y,error:C}=tt(u);let w,E;e[16]!==y||e[17]!==m?(w=()=>{m?.(y)},E=[y,m],e[16]=y,e[17]=m,e[18]=w,e[19]=E):(w=e[18],E=e[19]),K.useEffect(w,E);let N;if(e[20]!==p||e[21]!==h){let S;e[23]!==h?(S=async z=>{h(z)},e[23]=h,e[24]=S):S=e[24],N=p.handleSubmit(S),e[20]=p,e[21]=h,e[22]=N}else N=e[22];const _=N;if(x.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(nt,{label:"Carregando sites..."})}),e[25]=S):S=e[25],S}if(x.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:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=S):S=e[26],S}let I,U;if(e[27]!==n.configurationState?.siteUrl||e[28]!==l||e[29]!==p||e[30]!==x.data){U=Symbol.for("react.early_return_sentinel");e:{if(I=x.data||[],I.length===0){let z;e[33]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=z):z=e[33],U=z;break e}const S=n.configurationState?.siteUrl;if(S&&p.getValues("siteUrl")!==S)p.setValue("siteUrl",S);else if(!S&&!p.getValues("siteUrl")){const z=En(l,I);z&&p.setValue("siteUrl",z)}}e[27]=n.configurationState?.siteUrl,e[28]=l,e[29]=p,e[30]=x.data,e[31]=I,e[32]=U}else I=e[31],U=e[32];if(U!==Symbol.for("react.early_return_sentinel"))return U;let T;e[34]!==y||e[35]!==I?(T=S=>{const{field:z}=S;return t.jsxs(be,{children:[t.jsx(je,{children:t.jsx(Lt,{options:I.map($n),value:z.value,onChange:z.onChange,disabled:y,ariaLabel:"Site verificado"})}),t.jsx(ve,{})]})},e[34]=y,e[35]=I,e[36]=T):T=e[36];let O;e[37]!==p.control||e[38]!==T?(O=t.jsx(ye,{control:p.control,name:"siteUrl",render:T}),e[37]=p.control,e[38]=T,e[39]=O):O=e[39];let k;e[40]!==p||e[41]!==O?(k=t.jsx(Me,{...p,children:O}),e[40]=p,e[41]=O,e[42]=k):k=e[42];let R;e[43]!==C?(R=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Não foi possível salvar a configuração"}),e[43]=C,e[44]=R):R=e[44];let $;e[45]!==y||e[46]!==c?($=t.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:y,children:"Cancelar"}),e[45]=y,e[46]=c,e[47]=$):$=e[47];const M=y?"Salvando...":"Salvar";let L;e[48]!==y||e[49]!==M?(L=t.jsx(B,{type:"submit",disabled:y,children:M}),e[48]=y,e[49]=M,e[50]=L):L=e[50];let F;e[51]!==$||e[52]!==L?(F=t.jsxs(Fe,{className:"pt-4",children:[$,L]}),e[51]=$,e[52]=L,e[53]=F):F=e[53];let q;return e[54]!==_||e[55]!==k||e[56]!==R||e[57]!==F?(q=t.jsxs("form",{onSubmit:_,className:"space-y-4",children:[k,R,F]}),e[54]=_,e[55]=k,e[56]=R,e[57]=F,e[58]=q):q=e[58],q}function $n(o){return{value:o.siteUrl,label:o.siteUrl}}const zn={vtex:Tn,"google-analytics":kn,"google-search-console":Ln},Ce="deco-reader@decocms.iam.gserviceaccount.com",$t={"google-analytics":"ga4","google-search-console":"gsc"},zt={ga4:{label:"Google Analytics",resourceLabel:"ID da propriedade",resourcePlaceholder:"ex: 123456789",resourceHint:"No GA4: Admin → Detalhes da propriedade → ID da propriedade (só números).",connectSteps:["Abra o Google Analytics (GA4) da sua loja.","Vá em Admin → Acesso à propriedade (Gerenciamento de acesso).",`Clique em + → Adicionar usuários, cole ${Ce} e conceda o papel Leitor.`,"Copie o ID da propriedade (Admin → Detalhes da propriedade) e cole abaixo."]},gsc:{label:"Google Search Console",resourceLabel:"Site / propriedade",resourcePlaceholder:"ex: sc-domain:sualoja.com.br",resourceHint:"Use o mesmo formato que aparece no Search Console: sc-domain:sualoja.com.br ou https://www.sualoja.com.br/.",connectSteps:["Abra o Google Search Console da sua loja.","Vá em Configurações → Usuários e permissões.",`Clique em Adicionar usuário, cole ${Ce} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function Dn(o,e){const n=zt[o].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${n}.`,steps:o==="ga4"?[`Confirme que ${Ce} foi adicionado em Admin → Acesso à propriedade com o papel Leitor.`,"Confira se o ID da propriedade está correto (só números, sem o prefixo 'properties/').","A concessão de acesso pode levar alguns segundos — tente novamente."]:[`Confirme que ${Ce} foi adicionado em Configurações → Usuários e permissões.`,"A permissão precisa ser Completa ou Restrita — 'Não verificado' não funciona.","Confira se o endereço do site está exatamente como aparece no Search Console."]};case"no-web-stream":return{title:"Esta propriedade do GA4 não tem um fluxo de dados da Web (site) configurado.",steps:["No GA4, vá em Admin → Fluxos de dados.","Clique em Adicionar fluxo → Web.","Informe a URL do site da sua loja e salve o fluxo.","Volte aqui e tente vincular de novo. (Propriedades só de app precisam de vínculo manual — fale com o suporte.)"]};case"no-match":return{title:"O recurso informado não corresponde ao domínio desta loja.",steps:o==="ga4"?["Verifique se digitou o ID da propriedade certa — provavelmente é de outro site.","No GA4, o site medido aparece em Admin → Fluxos de dados → (seu fluxo Web) → URL do stream."]:["Verifique se selecionou a propriedade do Search Console referente a esta loja.","O endereço precisa cobrir o mesmo domínio do diagnóstico."]};case"resource_already_bound":return{title:"Este recurso já está vinculado a outra loja.",steps:["Se este recurso é realmente desta loja, fale com o suporte para uma revisão manual.","Caso tenha digitado o id errado, confira e tente novamente."]};default:return{title:"Não foi possível verificar o acesso a este recurso.",steps:["Revise os passos de acesso acima e tente novamente.","Se persistir, fale com o suporte."]}}}function Fn(o){const e=P.c(76),{provider:n,siteUrl:s,selfClient:i,org:a,initialResourceId:r,onDone:l,onIsPendingChange:c,onOAuthInstead:m}=o,f=zt[n],g=Ye(),[d,x]=K.useState(null);let b,v;if(e[0]!==f.resourceLabel){const A=Pe({resourceId:xe().trim().min(1,`Informe o ${f.resourceLabel.toLowerCase()}`)});v=$e,b=Le(A),e[0]=f.resourceLabel,e[1]=b,e[2]=v}else b=e[1],v=e[2];const j=r??"";let p;e[3]!==j?(p={resourceId:j},e[3]=j,e[4]=p):p=e[4];let u;e[5]!==b||e[6]!==p?(u={resolver:b,defaultValues:p},e[5]=b,e[6]=p,e[7]=u):u=e[7];const h=v(u);let y;e[8]!==n||e[9]!==i||e[10]!==s?(y=async A=>{if(!s)throw new Error("URL da loja indisponível — recarregue a página.");const V=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:s,provider:n,resourceId:A.resourceId}});return ne(V)},e[8]=n,e[9]=i,e[10]=s,e[11]=y):y=e[11];let C,w;e[12]!==c?(C=()=>c?.(!0),w=()=>c?.(!1),e[12]=c,e[13]=C,e[14]=w):(C=e[13],w=e[14]);let E;e[15]!==f.label||e[16]!==l||e[17]!==a||e[18]!==n||e[19]!==g||e[20]!==s?(E=async A=>{if(A.ok){x(null),ht.success(`${f.label} conectado`),s&&await g.invalidateQueries({queryKey:Z.commerceDiscoveryConnectionStatus(a.id,s)}),l();return}x({...Dn(n,A.reason??"unknown"),detail:A.detail})},e[15]=f.label,e[16]=l,e[17]=a,e[18]=n,e[19]=g,e[20]=s,e[21]=E):E=e[21];let N;e[22]!==y||e[23]!==C||e[24]!==w||e[25]!==E?(N={mutationFn:y,onMutate:C,onSettled:w,onSuccess:E},e[22]=y,e[23]=C,e[24]=w,e[25]=E,e[26]=N):N=e[26];const _=Se(N);let I;if(e[27]!==h||e[28]!==_){let A;e[30]!==_?(A=V=>_.mutate(V),e[30]=_,e[31]=A):A=e[31],I=h.handleSubmit(A),e[27]=h,e[28]=_,e[29]=I}else I=e[29];const U=I,T=_.isPending,O=Kn;let k;e[32]!==f.connectSteps?(k=f.connectSteps.map(qn),e[32]=f.connectSteps,e[33]=k):k=e[33];let R;e[34]!==k?(R=t.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:k}),e[34]=k,e[35]=R):R=e[35];let $;e[36]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:Ce}),e[36]=$):$=e[36];let M;e[37]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[$,t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:O,"aria-label":"Copiar e-mail do service account",children:t.jsx(Ut,{size:16})})]}),e[37]=M):M=e[37];let L;e[38]!==f.resourceHint||e[39]!==f.resourceLabel||e[40]!==f.resourcePlaceholder||e[41]!==T?(L=A=>{const{field:V}=A;return t.jsxs(be,{children:[t.jsx(ke,{children:f.resourceLabel}),t.jsx(je,{children:t.jsx(_e,{...V,placeholder:f.resourcePlaceholder,disabled:T,autoComplete:"off"})}),t.jsx(on,{children:f.resourceHint}),t.jsx(ve,{})]})},e[38]=f.resourceHint,e[39]=f.resourceLabel,e[40]=f.resourcePlaceholder,e[41]=T,e[42]=L):L=e[42];let F;e[43]!==h.control||e[44]!==L?(F=t.jsx(ye,{control:h.control,name:"resourceId",render:L}),e[43]=h.control,e[44]=L,e[45]=F):F=e[45];let q;e[46]!==h||e[47]!==F?(q=t.jsx(Me,{...h,children:F}),e[46]=h,e[47]=F,e[48]=q):q=e[48];let S;e[49]!==d?(S=d&&t.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:d.title}),t.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:d.steps.map(Mn)})]}),e[49]=d,e[50]=S):S=e[50];let z;e[51]!==_.error||e[52]!==_.isError?(z=_.isError&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:_.error instanceof Error?_.error.message:"Não foi possível vincular."}),e[51]=_.error,e[52]=_.isError,e[53]=z):z=e[53];let Q;e[54]!==T||e[55]!==m?(Q=m?t.jsx("button",{type:"button",onClick:m,disabled:T,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):t.jsx("span",{}),e[54]=T,e[55]=m,e[56]=Q):Q=e[56];let G;e[57]!==T||e[58]!==l?(G=t.jsx(B,{type:"button",variant:"outline",onClick:l,disabled:T,children:"Cancelar"}),e[57]=T,e[58]=l,e[59]=G):G=e[59];const H=T?"Verificando...":"Vincular";let X;e[60]!==T||e[61]!==H?(X=t.jsx(B,{type:"submit",disabled:T,children:H}),e[60]=T,e[61]=H,e[62]=X):X=e[62];let W;e[63]!==G||e[64]!==X?(W=t.jsxs("div",{className:"flex gap-2",children:[G,X]}),e[63]=G,e[64]=X,e[65]=W):W=e[65];let Y;e[66]!==Q||e[67]!==W?(Y=t.jsxs(Fe,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[Q,W]}),e[66]=Q,e[67]=W,e[68]=Y):Y=e[68];let ee;return e[69]!==U||e[70]!==R||e[71]!==q||e[72]!==S||e[73]!==z||e[74]!==Y?(ee=t.jsxs("form",{onSubmit:U,className:"space-y-4",children:[R,M,q,S,z,Y]}),e[69]=U,e[70]=R,e[71]=q,e[72]=S,e[73]=z,e[74]=Y,e[75]=ee):ee=e[75],ee}function Mn(o){return t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{"aria-hidden":!0,children:"•"}),t.jsx("span",{children:o})]},o)}function qn(o,e){return t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-foreground",children:e+1}),t.jsx("span",{children:o})]},o)}function Kn(){navigator.clipboard?.writeText(Ce),ht.success("E-mail copiado")}function Vn(){const o=P.c(2);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0];let n;return o[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-4 sm:h-full sm:flex-col sm:items-stretch",children:[e,t.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[t.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"h-3 w-full animate-pulse rounded bg-muted/60"})]}),t.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),o[1]=n):n=o[1],n}const ft="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function Hn(o){const e=P.c(37),{card:n,connecting:s,disabled:i,onConnect:a,org:r,selfClient:l,siteUrl:c,autoOpenConfigFieldKey:m,onAutoOpenConfigHandled:f}=o,g=n.linkedConnectionId,d=$t[n.bindingType],x=!!d&&n.boundVia!=="oauth";let b;e[0]!==m||e[1]!==n||e[2]!==s||e[3]!==i||e[4]!==g||e[5]!==f||e[6]!==a||e[7]!==r||e[8]!==d||e[9]!==l||e[10]!==c||e[11]!==x?(b=x&&d?t.jsx(Bn,{card:n,provider:d,org:r,selfClient:l,siteUrl:c,onOAuthInstead:a,disabled:i,connecting:s}):n.satisfied&&g?t.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[t.jsx(et,{size:16,className:"text-success"})," Conectado"]}),t.jsx(K.Suspense,{fallback:t.jsx(Gn,{}),children:t.jsx(Qn,{card:n,org:r,selfClient:l,connectionId:g,contextSiteUrl:c,autoOpen:vn({autoOpenFieldKey:m,card:n}),onAutoOpenHandled:f})})]}):t.jsx(B,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:i||s,onClick:a,"aria-label":`Conectar ${n.title}`,children:s?t.jsx(Je,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=m,e[1]=n,e[2]=s,e[3]=i,e[4]=g,e[5]=f,e[6]=a,e[7]=r,e[8]=d,e[9]=l,e[10]=c,e[11]=x,e[12]=b):b=e[12];const v=b;let j;e[13]!==n.icon||e[14]!==n.title?(j=t.jsx(Xe,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[13]=n.icon,e[14]=n.title,e[15]=j):j=e[15];let p;e[16]!==n.area?(p=n.area&&t.jsx("span",{className:se("hidden sm:inline-block",ft),children:n.area}),e[16]=n.area,e[17]=p):p=e[17];let u;e[18]!==j||e[19]!==p?(u=t.jsxs("div",{className:"shrink-0 self-start sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[j,p]}),e[18]=j,e[19]=p,e[20]=u):u=e[20];let h;e[21]!==n.area?(h=n.area&&t.jsx("span",{className:se("mb-1 inline-block sm:hidden",ft),children:n.area}),e[21]=n.area,e[22]=h):h=e[22];let y;e[23]!==n.title?(y=t.jsx("p",{className:"text-sm font-medium text-foreground",children:n.title}),e[23]=n.title,e[24]=y):y=e[24];let C;e[25]!==n.headline?(C=n.headline&&t.jsx("p",{className:"mt-0.5 line-clamp-2 text-sm leading-5 text-muted-foreground",children:n.headline}),e[25]=n.headline,e[26]=C):C=e[26];let w;e[27]!==h||e[28]!==y||e[29]!==C?(w=t.jsxs("div",{className:"min-w-0 flex-1",children:[h,y,C]}),e[27]=h,e[28]=y,e[29]=C,e[30]=w):w=e[30];let E;e[31]!==v?(E=t.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:v}),e[31]=v,e[32]=E):E=e[32];let N;return e[33]!==u||e[34]!==w||e[35]!==E?(N=t.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-4 sm:h-full sm:flex-col sm:items-stretch",children:[u,w,E]}),e[33]=u,e[34]=w,e[35]=E,e[36]=N):N=e[36],N}function Bn(o){const e=P.c(39),{card:n,provider:s,org:i,selfClient:a,siteUrl:r,onOAuthInstead:l,disabled:c,connecting:m}=o,[f,g]=K.useState(!1),[d,x]=K.useState(!1);let b;e[0]!==d?(b=O=>{!O&&d||g(O)},e[0]=d,e[1]=b):b=e[1];const v=b;let j;e[2]!==n.satisfied||e[3]!==n.title||e[4]!==m||e[5]!==c?(j=n.satisfied?t.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[t.jsx(et,{size:16,className:"text-success"})," Conectado"]}),t.jsxs(Ot,{children:[t.jsx(At,{asChild:!0,children:t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>g(!0),"aria-label":`Configurar ${n.title}`,children:t.jsx(Rt,{size:16})})}),t.jsx(kt,{children:"Editar configuração"})]})]}):t.jsx(B,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:c||m,onClick:()=>g(!0),"aria-label":`Conectar ${n.title}`,children:m?t.jsx(Je,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=n.satisfied,e[3]=n.title,e[4]=m,e[5]=c,e[6]=j):j=e[6];let p;e[7]!==n.icon||e[8]!==n.title?(p=t.jsx(Xe,{icon:n.icon,name:n.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=n.icon,e[8]=n.title,e[9]=p):p=e[9];let u;e[10]!==n.title?(u=t.jsx(_t,{children:n.title}),e[10]=n.title,e[11]=u):u=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Et,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=h):h=e[12];let y;e[13]!==u?(y=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[u,h]}),e[13]=u,e[14]=y):y=e[14];let C;e[15]!==p||e[16]!==y?(C=t.jsxs(wt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[p,y]}),e[15]=p,e[16]=y,e[17]=C):C=e[17];const w=n.boundResource??void 0;let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=()=>g(!1),e[18]=E):E=e[18];let N;e[19]!==n.satisfied||e[20]!==l?(N=n.satisfied?void 0:()=>{g(!1),l()},e[19]=n.satisfied,e[20]=l,e[21]=N):N=e[21];let _;e[22]!==i||e[23]!==s||e[24]!==a||e[25]!==r||e[26]!==N||e[27]!==w?(_=t.jsx(Fn,{provider:s,siteUrl:r,selfClient:a,org:i,initialResourceId:w,onDone:E,onIsPendingChange:x,onOAuthInstead:N}),e[22]=i,e[23]=s,e[24]=a,e[25]=r,e[26]=N,e[27]=w,e[28]=_):_=e[28];let I;e[29]!==_||e[30]!==C?(I=t.jsxs(It,{className:"sm:max-w-lg",children:[C,_]}),e[29]=_,e[30]=C,e[31]=I):I=e[31];let U;e[32]!==v||e[33]!==f||e[34]!==I?(U=t.jsx(Tt,{open:f,onOpenChange:v,children:I}),e[32]=v,e[33]=f,e[34]=I,e[35]=U):U=e[35];let T;return e[36]!==U||e[37]!==j?(T=t.jsxs(t.Fragment,{children:[j,U]}),e[36]=U,e[37]=j,e[38]=T):T=e[38],T}function Gn(){const o=P.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0],e}function Qn(o){const e=P.c(46),{card:n,org:s,selfClient:i,connectionId:a,contextSiteUrl:r,autoOpen:l,onAutoOpenHandled:c}=o;let m;e[0]!==a||e[1]!==s.id||e[2]!==s.slug?(m={connectionId:a,orgId:s.id,orgSlug:s.slug},e[0]=a,e[1]=s.id,e[2]=s.slug,e[3]=m):m=e[3];const f=De(m),[g,d]=K.useState(l),[x,b]=K.useState(!1),v=zn[n.bindingType],j=jn(n.configurationState);let p;e[4]!==l||e[5]!==c?(p=()=>{d(!1),l&&c()},e[4]=l,e[5]=c,e[6]=p):p=e[6];const u=p;let h;e[7]!==u||e[8]!==x?(h=F=>{if(!(!F&&x)){if(!F){u();return}d(!0)}},e[7]=u,e[8]=x,e[9]=h):h=e[9];const y=h;if(!v)return null;let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C=()=>d(!0),e[10]=C):C=e[10];const w=`Configurar ${n.title}`;let E;e[11]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Rt,{size:16}),e[11]=E):E=e[11];let N;e[12]!==w?(N=t.jsx(At,{asChild:!0,children:t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:C,"aria-label":w,children:E})}),e[12]=w,e[13]=N):N=e[13];const _=j.length>0?"Editar configuração":"Configurar";let I;e[14]!==_?(I=t.jsx(kt,{children:_}),e[14]=_,e[15]=I):I=e[15];let U;e[16]!==N||e[17]!==I?(U=t.jsxs(Ot,{children:[N,I]}),e[16]=N,e[17]=I,e[18]=U):U=e[18];let T;e[19]!==n.icon||e[20]!==n.title?(T=t.jsx(Xe,{icon:n.icon,name:n.title,size:"md",fit:"contain",className:"p-1.5"}),e[19]=n.icon,e[20]=n.title,e[21]=T):T=e[21];let O;e[22]!==n.title?(O=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t.jsx(_t,{children:n.title}),t.jsxs(Et,{children:["Configure o ",n.title," para enriquecer os dados"]})]}),e[22]=n.title,e[23]=O):O=e[23];let k;e[24]!==T||e[25]!==O?(k=t.jsxs(wt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[T,O]}),e[24]=T,e[25]=O,e[26]=k):k=e[26];let R;e[27]!==v||e[28]!==n||e[29]!==u||e[30]!==f||e[31]!==a||e[32]!==r||e[33]!==s||e[34]!==i?(R=t.jsx(v,{card:n,connectionId:a,companionClient:f,selfClient:i,org:s,contextSiteUrl:r,onDone:u,onIsPendingChange:b}),e[27]=v,e[28]=n,e[29]=u,e[30]=f,e[31]=a,e[32]=r,e[33]=s,e[34]=i,e[35]=R):R=e[35];let $;e[36]!==k||e[37]!==R?($=t.jsxs(It,{className:"sm:max-w-lg",children:[k,R]}),e[36]=k,e[37]=R,e[38]=$):$=e[38];let M;e[39]!==g||e[40]!==y||e[41]!==$?(M=t.jsx(Tt,{open:g,onOpenChange:y,children:$}),e[39]=g,e[40]=y,e[41]=$,e[42]=M):M=e[42];let L;return e[43]!==U||e[44]!==M?(L=t.jsxs(t.Fragment,{children:[U,M]}),e[43]=U,e[44]=M,e[45]=L):L=e[45],L}const st={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."}};function Wn(o){const e=P.c(40),{selfClient:n,org:s,cdConnectionId:i,siteUrl:a}=o;let r;e[0]!==i||e[1]!==s.id||e[2]!==s.slug?(r={connectionId:i,orgId:s.id,orgSlug:s.slug},e[0]=i,e[1]=s.id,e[2]=s.slug,e[3]=r):r=e[3];const l=De(r);let c;e[4]!==i||e[5]!==s.id?(c=Z.commerceDiscoveryCompanionSchema(s.id,i),e[4]=i,e[5]=s.id,e[6]=c):c=e[6];let m;e[7]!==l?(m=async()=>{const A=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ne(A)},e[7]=l,e[8]=m):m=e[8];let f;e[9]!==c||e[10]!==m?(f={queryKey:c,queryFn:m},e[9]=c,e[10]=m,e[11]=f):f=e[11];const g=he(f),d=gn(g.data?.stateSchema??{properties:{}}),x=d.map(is),b=d.map(os).filter(ss),v=d.filter(ns).map(ts),j=[...b,...v].sort().join(",");let p;e[12]!==i||e[13]!==s.id?(p=Z.commerceDiscoveryConnection(s.id,i),e[12]=i,e[13]=s.id,e[14]=p):p=e[14];let u;e[15]!==i||e[16]!==n?(u=async()=>{const A=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return ne(A)},e[15]=i,e[16]=n,e[17]=u):u=e[17];let h;e[18]!==p||e[19]!==u?(h={queryKey:p,queryFn:u},e[18]=p,e[19]=u,e[20]=h):h=e[20];const C=he(h).data?.item?.configuration_state??null;let w;e[21]!==C?(w=A=>C?.[A.fieldKey]?.value,e[21]=C,e[22]=w):w=e[22];const E=d.map(w).filter(es),N=[...x.map(Xn),...b.map(Zn),...E.map(Jn)].sort().join(","),I=he({queryKey:Z.commerceDiscoveryCompanionConnections(s.id,N),queryFn:async()=>{if(d.length===0)return{items:[]};const A=[{field:["app_name"],operator:"in",value:x},{field:["app_id"],operator:"in",value:b}];E.length>0&&A.push({field:["id"],operator:"in",value:E});const V=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:A},limit:1e3}});return ne(V)}}).data?.items??[],U=new Set(E),T=I.filter(A=>U.has(A.id)),O=T.filter(Yn);let k;e[23]!==s.id||e[24]!==s.slug?(k=A=>({queryKey:Z.commerceDiscoveryCompanionOAuthStatus(s.id,A.id),queryFn:async()=>{try{const V=await fetch(`/api/${encodeURIComponent(s.slug)}/connections/${encodeURIComponent(A.id)}/oauth-token/status`,{credentials:"include"});return V.ok?{hasToken:(await V.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=s.id,e[24]=s.slug,e[25]=k):k=e[25];const R=cn({queries:O.map(k)});let $;e[26]!==R?($=(A,V)=>[A.id,R[V]?.data?.hasToken===!0],e[26]=R,e[27]=$):$=e[27];const M=new Map(O.map($)),L={};for(const A of T)L[A.id]=!A.oauth_config||!!A.connection_token||M.get(A.id)===!0;const F=he({queryKey:Z.commerceDiscoveryCompanionRegistry(s.id,j),queryFn:async()=>{if(d.length===0)return{items:[]};const A=hn(b,v),V=await nn(Ct.REGISTRY(s.id),s.id,s.slug,"COLLECTION_REGISTRY_APP_LIST",{...A?{where:A}:{},limit:1e3});return ne(V)}}),q={},S={};for(const A of F.data?.items??[])q[A.id]=A,A.server?.name&&(S[A.server.name]=A);let z;e[28]!==s.id||e[29]!==a?(z=Z.commerceDiscoveryConnectionStatus(s.id,a??""),e[28]=s.id,e[29]=a,e[30]=z):z=e[30];const Q=!!a;let G;e[31]!==n||e[32]!==a?(G=async()=>{const A=await n.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:a}});return ne(A)},e[31]=n,e[32]=a,e[33]=G):G=e[33];let H;e[34]!==z||e[35]!==Q||e[36]!==G?(H={queryKey:z,enabled:Q,queryFn:G},e[34]=z,e[35]=Q,e[36]=G,e[37]=H):H=e[37];const X=Ze(H),W={};for(const[A,V]of Object.entries($t)){const oe=X.data?.providers?.[V];oe?.connected&&oe.via==="sa"&&(W[A]={resource:oe.resource??null})}const Y=_n({requirements:d,itemsById:q,itemsByName:S,connections:I,connectionReadiness:L,configurationState:C,curated:st,saBindings:W});let ee;return e[38]!==Y?(ee={cards:Y},e[38]=Y,e[39]=ee):ee=e[39],ee}function Yn(o){return o.oauth_config&&!o.connection_token}function Jn(o){return`linked:${o}`}function Zn(o){return`app:${o}`}function Xn(o){return`binding:${o}`}function es(o){return typeof o=="string"&&o.length>0}function ts(o){return o.bindingType}function ns(o){return!st[o.bindingType]}function ss(o){return!!o}function os(o){return st[o.bindingType]?.registryAppId}function is(o){return o.bindingType}function rs({selfClient:o,org:e,userId:n,cdConnectionId:s}){const i=Ye(),[a,r]=K.useState(null),[l,c]=K.useState(null),m=async(g,d)=>{const x=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:g,data:d}});return ne(x)};async function f(g){r(g.fieldKey),c(null);try{let d=g.candidateConnectionId;if(!d){const u=sn(g.registryItem,e.id,n,{remoteIndex:0}),h=u.connection_type==="STDIO",y=!!u.connection_url,C=h&&u.connection_headers&&typeof u.connection_headers=="object"&&"command"in u.connection_headers;if(!y&&!C)return c(`${g.title} cannot be connected: no connection method available`),!1;const w=await o.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:u}});d=ne(w).item.id}const x=d,b=await dn({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:u=>m(x,{connection_token:u}).then(()=>{})});if(!b.ok)return c(`Couldn't sign in to ${g.title}: ${b.error}`),!1;const v=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),j=ne(v).item?.configuration_state??null,p=xn(j,g.fieldKey,g.bindingType,x);return await m(s,{configuration_state:p}),await i.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,s)}),await i.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),!0}catch(d){return c(d instanceof Error?d.message:String(d)),!1}finally{r(null)}}return{connect:f,connectingFieldKey:a,error:l}}const ot="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function it(){const o=P.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("h1",{className:"text-2xl font-medium leading-8 text-foreground",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),o[0]=e):e=o[0],e}function as(){const o=P.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(ls)}),o[0]=e):e=o[0],e}function ls(o){return t.jsx(Vn,{},o)}function rt(){const o=P.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:ot,children:[t.jsx(it,{}),t.jsx(as,{})]}),o[0]=e):e=o[0],e}function cs(o){const e=P.c(5),{onRetry:n}=o;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(it,{}),e[0]=s):s=e[0];let i,a;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),a=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=a):(i=e[1],a=e[2]);let r;return e[3]!==n?(r=t.jsxs("div",{className:ot,children:[s,t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,a,t.jsx(B,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:n,children:"Tentar novamente"})]})]}),e[3]=n,e[4]=r):r=e[4],r}function ds(o){const e=P.c(2);let n;return e[0]!==o?(n=t.jsx(xt,{children:s=>{const{reset:i}=s;return t.jsx(yt,{fallback:a=>{const{resetError:r}=a;return t.jsx(cs,{onRetry:()=>{i(),r()}})},children:t.jsx(K.Suspense,{fallback:t.jsx(rt,{}),children:t.jsx(us,{...o})})})}}),e[0]=o,e[1]=n):n=e[1],n}function us(o){const e=P.c(38),{org:n,cdConnectionId:s,siteUrl:i}=o,{data:a}=ze.useSession(),r=a?.user?.id??"";let l;e[0]!==n.id||e[1]!==n.slug?(l={connectionId:St,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const c=De(l);let m;e[3]!==s||e[4]!==n||e[5]!==c||e[6]!==i?(m={selfClient:c,org:n,cdConnectionId:s,siteUrl:i},e[3]=s,e[4]=n,e[5]=c,e[6]=i,e[7]=m):m=e[7];const{cards:f}=Wn(m);let g;e[8]!==s||e[9]!==n||e[10]!==c||e[11]!==r?(g={selfClient:c,org:n,userId:r,cdConnectionId:s},e[8]=s,e[9]=n,e[10]=c,e[11]=r,e[12]=g):g=e[12];const{connect:d,connectingFieldKey:x,error:b}=rs(g),[v,j]=K.useState(null);if(f.length===0)return null;const p=x!==null;let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(it,{}),e[13]=u):u=e[13];let h;e[14]!==b?(h=b&&t.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:b}),e[14]=b,e[15]=h):h=e[15];let y;if(e[16]!==v||e[17]!==p||e[18]!==f||e[19]!==d||e[20]!==x||e[21]!==n||e[22]!==c||e[23]!==i){let E;e[25]!==v||e[26]!==p||e[27]!==d||e[28]!==x||e[29]!==n||e[30]!==c||e[31]!==i?(E=N=>{const _=async()=>{await d(N)&&j(N.fieldKey)};return t.jsx(Hn,{card:N,connecting:x===N.fieldKey,disabled:p&&x!==N.fieldKey,org:n,selfClient:c,siteUrl:i,autoOpenConfigFieldKey:v,onAutoOpenConfigHandled:()=>j(I=>I===N.fieldKey?null:I),onConnect:()=>{_()}},N.fieldKey)},e[25]=v,e[26]=p,e[27]=d,e[28]=x,e[29]=n,e[30]=c,e[31]=i,e[32]=E):E=e[32],y=f.map(E),e[16]=v,e[17]=p,e[18]=f,e[19]=d,e[20]=x,e[21]=n,e[22]=c,e[23]=i,e[24]=y}else y=e[24];let C;e[33]!==y?(C=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:y}),e[33]=y,e[34]=C):C=e[34];let w;return e[35]!==h||e[36]!==C?(w=t.jsxs("div",{className:ot,children:[u,t.jsxs(Qe,{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-[min(60vh,calc(100dvh-330px))] md:flex-none",children:[h,C]})]}),e[35]=h,e[36]=C,e[37]=w):w=e[37],w}const at="https://decocms.com/agendar",ms="Precisa de ajuda? Fale conosco",fs="Agende uma chamada de 20 minutos e rodamos o diagnóstico com você, ao vivo.",Dt={photo:"https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200"},Ft="var(--brand-green-dark)";function lt({siteUrl:o,email:e}){const n=new URL(at);return o&&n.searchParams.set("siteUrl",o),e&&n.searchParams.set("email",e),n.toString()}function ps(o){const e=P.c(9),{href:n,size:s,className:i}=o,a=n===void 0?at:n,r=s===void 0?"lg":s;let l;e[0]!==i?(l=se("w-full",i),e[0]=i,e[1]=l):l=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Pt,{size:16}),e[2]=c):c=e[2];let m;e[3]!==a?(m=t.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",children:["Agendar uma reunião",c]}),e[3]=a,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==l||e[7]!==m?(f=t.jsx(B,{asChild:!0,variant:"outline",size:r,className:l,children:m}),e[5]=r,e[6]=l,e[7]=m,e[8]=f):f=e[8],f}function gs(o){const e=P.c(6),{size:n}=o,s=n===void 0?72:n;let i;e[0]!==s?(i={width:s,height:s},e[0]=s,e[1]=i):i=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:t.jsx("img",{src:Dt.photo,alt:"Especialista da deco",className:"h-full w-full object-cover",loading:"lazy"})}),e[2]=a):a=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[t.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),t.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]}),e[3]=r):r=e[3];let l;return e[4]!==i?(l=t.jsxs("div",{className:"relative shrink-0",style:i,children:[a,r]}),e[4]=i,e[5]=l):l=e[5],l}function ct(o){const e=P.c(5),{href:n}=o;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"h-20",style:{backgroundColor:Ft}}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"-mt-9 mb-4",children:t.jsx(gs,{})}),e[1]=i):i=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:ms}),t.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:fs})]}),e[2]=a):a=e[2];let r;return e[3]!==n?(r=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[s,t.jsxs("div",{className:"px-8 pb-8",children:[i,a,t.jsx(ps,{href:n,size:"lg",className:"mt-6"})]})]})}),e[3]=n,e[4]=r):r=e[4],r}function hs(o){const e=P.c(8),{className:n,href:s}=o,i=s===void 0?at:s;let a;e[0]!==n?(a=se("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.jsxs("span",{className:"relative shrink-0",children:[t.jsx("span",{className:"block h-11 w-11 overflow-hidden rounded-full",style:{boxShadow:`0 0 0 2px ${Ft}`},children:t.jsx("img",{src:Dt.photo,alt:"Especialista da deco",className:"h-full w-full object-cover",loading:"lazy"})}),t.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-3 w-3 rounded-full border-2 border-card bg-success","aria-hidden":!0})]}),e[2]=r):r=e[2];let l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("span",{className:"flex-1 text-base font-medium leading-5 text-foreground",children:["Precisa de ajuda?",t.jsx("br",{}),"Fale conosco"]}),c=t.jsx(Pt,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=l,e[4]=c):(l=e[3],c=e[4]);let m;return e[5]!==i||e[6]!==a?(m=t.jsxs("a",{href:i,target:"_blank",rel:"noreferrer",className:a,children:[r,l,c]}),e[5]=i,e[6]=a,e[7]=m):m=e[7],m}function Mt(o){const e=P.c(10),{host:n}=o,s=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let i,a,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i,e[1]=a,e[2]=r):(i=e[0],a=e[1],r=e[2]);let l;e[3]!==s?(l=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:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=l):l=e[4];let c;e[5]!==n?(c=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=c):c=e[6];let m;return e[7]!==l||e[8]!==c?(m=t.jsxs("div",{className:"flex items-center gap-3",children:[i,a,r,l,c]}),e[7]=l,e[8]=c,e[9]=m):m=e[9],m}const xs={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ys(o){return xs[o]}function dt(o){const e=P.c(4),{variant:n}=o;let s;e[0]!==n?(s=ys(n),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==s?(i=t.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:t.jsx(nt,{label:s,className:"text-muted-foreground"})}),e[2]=s,e[3]=i):i=e[3],i}function Fo(){const o=P.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(vs,{}),o[0]=e):e=o[0],e}const qt=K.createContext(null),Kt=()=>K.useContext(qt);function te(o){const e=P.c(13);let n,s;e[0]!==o?({visual:s,...n}=o,e[0]=o,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/commerce-onboarding"},e[3]=i):i=e[3];const a=bt(i),{data:r}=ze.useSession(),l=r?.user?.email;let c;e[4]!==a.siteUrl||e[5]!==l?(c=lt({siteUrl:a.siteUrl,email:l}),e[4]=a.siteUrl,e[5]=l,e[6]=c):c=e[6];const m=c;let f;e[7]!==m||e[8]!==s?(f=s??t.jsx(ct,{href:m}),e[7]=m,e[8]=s,e[9]=f):f=e[9];let g;return e[10]!==n||e[11]!==f?(g=t.jsx(Yt,{...n,visual:f}),e[10]=n,e[11]=f,e[12]=g):g=e[12],g}const bs={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:o=>`Código enviado para ${o}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:o=>`Continuar com ${o}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function js(o){if(!o)return null;const e=Re(o);return e.ok?new URL(e.value).hostname:null}function pt(o){switch(o){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return o}}let gt=!1;function vs(){const o=bt({from:"/commerce-onboarding"}),{org:e,siteUrl:n}=o,s=js(n);return!gt&&Ht()&&(gt=!0,Bt("commerce_onboarding_viewed",{site_url:n,domain:s??void 0,...s?{$set:{last_scanned_domain:s}}:{}})),t.jsx(qt.Provider,{value:s,children:t.jsx(Cs,{requestedOrgSlug:e,siteUrl:n})})}function Cs(o){const e=P.c(8),{requestedOrgSlug:n,siteUrl:s}=o,{data:i,isPending:a}=ze.useSession(),r=Kt();if(a){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(te,{children:t.jsx(dt,{variant:"generic"})}),e[0]=c):c=e[0],c}if(!i){const c=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==r?(m=r?t.jsx(Mt,{host:r}):void 0,e[1]=r,e[2]=m):m=e[2];let f;return e[3]!==m?(f=t.jsx(te,{children:t.jsx(Wt,{callbackUrl:c,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:m,copy:bs})}),e[3]=m,e[4]=f):f=e[4],f}let l;return e[5]!==n||e[6]!==s?(l=t.jsx(Ss,{requestedOrgSlug:n,siteUrl:s}),e[5]=n,e[6]=s,e[7]=l):l=e[7],l}function Ss(o){const e=P.c(40),{requestedOrgSlug:n,siteUrl:s}=o,i=jt(),a=Gt(),[r,l]=K.useState(null),[c,m]=K.useState(null),f=a.data?.map(_s)??[];let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={mutationFn:Ns,retry:!1,onSuccess:u=>{m(u)}},e[0]=g):g=e[0];const d=Se(g);if(a.isPending){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(te,{children:t.jsx(dt,{variant:"workspace"})}),e[1]=u):u=e[1],u}if(a.error){let u;return e[2]!==a?(u=t.jsx(Ue,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>a.refetch()}),e[2]=a,e[3]=u):u=e[3],u}const x=n?f.find(u=>u.slug===n):null;if(x){let u;return e[4]!==x||e[5]!==s?(u=t.jsx(Ae,{org:x,initialSiteUrl:s}),e[4]=x,e[5]=s,e[6]=u):u=e[6],u}if(n){let u;return e[7]!==a?(u=t.jsx(Ue,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>a.refetch()}),e[7]=a,e[8]=u):u=e[8],u}if(r){let u;return e[9]!==r||e[10]!==s?(u=t.jsx(Ae,{org:r,initialSiteUrl:s}),e[9]=r,e[10]=s,e[11]=u):u=e[11],u}if(f.length===1&&f[0]){let u;return e[12]!==f[0]||e[13]!==s?(u=t.jsx(Ae,{org:f[0],initialSiteUrl:s}),e[12]=f[0],e[13]=s,e[14]=u):u=e[14],u}if(f.length>1){let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ie,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=u):u=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=C=>l(C),e[16]=h):h=e[16];let y;return e[17]!==f?(y=t.jsx(te,{children:t.jsxs("div",{className:"grid gap-10",children:[u,t.jsx(Qe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(ut,{organizations:f,selectLabel:"Continuar",onSelected:h})})]})}),e[17]=f,e[18]=y):y=e[18],y}if(!c){let u;e[19]!==d?(u=()=>{d.reset(),d.mutate()},e[19]=d,e[20]=u):u=e[20];let h;return e[21]!==d||e[22]!==u?(h=t.jsx(Es,{mutation:d,onRetry:u}),e[21]=d,e[22]=u,e[23]=h):h=e[23],h}const b=c;if(b?.success&&(b.status==="created"||b.status==="joined"||b.status==="already_has_organization")&&b.organization){let u;return e[24]!==b.organization||e[25]!==s?(u=t.jsx(Ae,{org:b.organization,initialSiteUrl:s}),e[24]=b.organization,e[25]=s,e[26]=u):u=e[26],u}if(b?.status==="ambiguous"&&b.organizations&&b.organizations.length>0){let u;e[27]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ie,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[27]=u):u=e[27];const h=b.domain??void 0;let y;e[28]!==i||e[29]!==s?(y=(w,E)=>{vt(),l({...w,slug:E}),i({to:"/commerce-onboarding",search:{org:E,siteUrl:s}})},e[28]=i,e[29]=s,e[30]=y):y=e[30];let C;return e[31]!==b.organizations||e[32]!==h||e[33]!==y?(C=t.jsx(te,{children:t.jsxs("div",{className:"grid gap-10",children:[u,t.jsx(Qe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(ut,{organizations:b.organizations,domain:h,onJoined:y})})]})}),e[31]=b.organizations,e[32]=h,e[33]=y,e[34]=C):C=e[34],C}const v=b?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let j;e[35]!==d?(j=()=>{m(null),d.reset()},e[35]=d,e[36]=j):j=e[36];let p;return e[37]!==v||e[38]!==j?(p=t.jsx(Ue,{title:"O onboarding de commerce precisa de suporte",description:v,actionLabel:"Tentar novamente",onRetry:j}),e[37]=v,e[38]=j,e[39]=p):p=e[39],p}async function Ns(){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&&vt(),e}function _s(o){return{id:o.id,name:o.name,slug:o.slug,logo:o.logo??null}}function Es(o){const e=P.c(7),{mutation:n,onRetry:s}=o,i=K.useRef(!1);let a;e[0]!==n?(a=m=>{!m||i.current||(i.current=!0,n.mutate())},e[0]=n,e[1]=a):a=e[1];const r=a;if(n.error){let m;return e[2]!==s?(m=t.jsx(Ue,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:s}),e[2]=s,e[3]=m):m=e[3],m}let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(dt,{variant:"generic"}),e[4]=l):l=e[4];let c;return e[5]!==r?(c=t.jsx(te,{children:t.jsx("div",{ref:r,children:l})}),e[5]=r,e[6]=c):c=e[6],c}function ie(o){const e=P.c(8),{title:n,description:s}=o,i=Kt();let a;e[0]!==i?(a=i?t.jsx(Mt,{host:i}):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]=i,e[1]=a):a=e[1];let r;e[2]!==s||e[3]!==n?(r=(n||s)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),s&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=n,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=t.jsxs("div",{className:"grid gap-10",children:[a,r]}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Ue(o){const e=P.c(9),{title:n,description:s,actionLabel:i,onRetry:a}=o;let r;e[0]!==s||e[1]!==n?(r=t.jsx(ie,{title:n,description:s}),e[0]=s,e[1]=n,e[2]=r):r=e[2];let l;e[3]!==i||e[4]!==a?(l=t.jsx(B,{type:"button",size:"xl",className:"w-full",onClick:a,children:i}),e[3]=i,e[4]=a,e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==l?(c=t.jsx(te,{children:t.jsxs("div",{className:"grid gap-10",children:[r,l]})}),e[6]=r,e[7]=l,e[8]=c):c=e[8],c}function ws(o){return o.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function Oe(o){const e=o;if(e.isError)throw new Error(ws(e));return e.structuredContent??o}function Ae(o){const e=P.c(10),{org:n,initialSiteUrl:s}=o,{data:i}=ze.useSession(),a=i?.user?.email;let r;e[0]!==s||e[1]!==a?(r=lt({siteUrl:s,email:a}),e[0]=s,e[1]=a,e[2]=r):r=e[2];const l=r;let c;e[3]!==l?(c=t.jsx(ct,{href:l}),e[3]=l,e[4]=c):c=e[4];const m=c;let f;return e[5]!==s||e[6]!==m||e[7]!==n||e[8]!==i?.user?.email?(f=t.jsx(xt,{children:g=>{const{reset:d}=g;return t.jsx(yt,{fallback:x=>{const{error:b,resetError:v}=x;return t.jsx(te,{visual:m,children:t.jsx(Is,{orgName:n.name,message:b instanceof Error?b.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{d(),v()}})})},children:t.jsx(K.Suspense,{fallback:t.jsx(Vt,{visual:m}),children:t.jsx(Ts,{org:n,initialSiteUrl:s,sessionEmail:i?.user?.email},`${n.id}:${s??""}`)})})}}),e[5]=s,e[6]=m,e[7]=n,e[8]=i?.user?.email,e[9]=f):f=e[9],f}function Vt(o){const e=P.c(3),{visual:n}=o;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[t.jsx(ie,{}),t.jsx(rt,{})]}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=t.jsx(te,{align:"fill",visual:n,children:s}),e[1]=n,e[2]=i):i=e[2],i}function Is(o){const e=P.c(10),{orgName:n,message:s,onRetry:i}=o,a=`A configuração de commerce continuará em ${n}.`;let r;e[0]!==a?(r=t.jsx(ie,{title:"Diagnóstico de commerce",description:a}),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==s?(l=t.jsx(Ne,{message:s}),e[2]=s,e[3]=l):l=e[3];let c;e[4]!==i?(c=t.jsx(B,{type:"button",size:"xl",className:"w-full",onClick:i,children:"Tentar novamente"}),e[4]=i,e[5]=c):c=e[5];let m;return e[6]!==r||e[7]!==l||e[8]!==c?(m=t.jsxs("div",{className:"grid gap-10",children:[r,l,c]}),e[6]=r,e[7]=l,e[8]=c,e[9]=m):m=e[9],m}function Ts(o){const e=P.c(111),{org:n,initialSiteUrl:s,sessionEmail:i}=o,a=jt();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:St,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const l=De(r),[c,m]=K.useState(s??""),[f,g]=K.useState(null),[d,x]=K.useState(null),b=K.useRef(!1),v=Ct.COMMERCE_DISCOVERY(n.id),j=Zt(n.id),p=Z.commerceDiscoveryConnection(n.id,v);let u;e[3]!==v||e[4]!==l?(u=async()=>{const D=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:v}});return Oe(D)},e[3]=v,e[4]=l,e[5]=u):u=e[5];let h;e[6]!==p||e[7]!==u?(h={queryKey:p,queryFn:u,retry:!1},e[6]=p,e[7]=u,e[8]=h):h=e[8];const y=he(h),C=Z.commerceDiscoveryVirtualMcp(n.id,j);let w;e[9]!==l||e[10]!==j?(w=async()=>{const D=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:j}});return Oe(D)},e[9]=l,e[10]=j,e[11]=w):w=e[11];let E;e[12]!==C||e[13]!==w?(E={queryKey:C,queryFn:w,retry:!1},e[12]=C,e[13]=w,e[14]=E):E=e[14];const N=he(E);let _;e[15]!==l?(_=async D=>{const J=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:D}});return Oe(J)},e[15]=l,e[16]=_):_=e[16];let I;e[17]!==y||e[18]!==N?(I=D=>{g(D),x(null),y.refetch(),N.refetch()},e[17]=y,e[18]=N,e[19]=I):I=e[19];let U;e[20]===Symbol.for("react.memo_cache_sentinel")?(U=D=>{x(D instanceof Error?D.message:"A configuração do Commerce Discovery falhou.")},e[20]=U):U=e[20];let T;e[21]!==_||e[22]!==I?(T={mutationFn:_,retry:!1,onSuccess:I,onError:U},e[21]=_,e[22]=I,e[23]=T):T=e[23];const O=Se(T);let k;e[24]!==l?(k={mutationFn:async D=>{const J=await l.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:D}});return Oe(J)},retry:!1},e[24]=l,e[25]=k):k=e[25];const R=Se(k),[$,M]=K.useState(null),L=!!y.data.item&&!!N.data.item,F=y.data.item,q=typeof F?.metadata?.siteUrl=="string"?F.metadata.siteUrl:void 0,S=s||c||q||"";let z;e[26]!==S||e[27]!==i?(z=lt({siteUrl:S,email:i}),e[26]=S,e[27]=i,e[28]=z):z=e[28];const Q=z;let G;e[29]!==Q?(G=t.jsx(ct,{href:Q}),e[29]=Q,e[30]=G):G=e[30];const H=G;let X;e[31]!==O?(X=D=>{const J=Re(D);if(!J.ok){x(pt(J.error));return}x(null),O.mutate(J.value)},e[31]=O,e[32]=X):X=e[32];const W=X;let Y;e[33]!==s||e[34]!==W||e[35]!==L?(Y=D=>{!D||b.current||L||!s||(b.current=!0,W(s))},e[33]=s,e[34]=W,e[35]=L,e[36]=Y):Y=e[36];const ee=Y;let A;e[37]!==W||e[38]!==c?(A=D=>{D.preventDefault(),W(c)},e[37]=W,e[38]=c,e[39]=A):A=e[39];const V=A;let oe;e[40]!==v||e[41]!==f?.reportApp||e[42]!==j?(oe=f?.reportApp??{connectionId:v,virtualMcpId:j,toolName:Xt},e[40]=v,e[41]=f?.reportApp,e[42]=j,e[43]=oe):oe=e[43];const re=oe;let Ee;e[44]!==S||e[45]!==a||e[46]!==n.slug||e[47]!==re||e[48]!==R?(Ee=async()=>{M(null);const D=Re(S);if(D.ok)try{await R.mutateAsync(D.value)}catch{M("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(Qt.sidebarOpen(),JSON.stringify(!1)),a({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:re.virtualMcpId,main:Jt(re.connectionId,re.toolName),chat:0}})},e[44]=S,e[45]=a,e[46]=n.slug,e[47]=re,e[48]=R,e[49]=Ee):Ee=e[49];const qe=Ee;if(L){let D;return e[50]!==Q||e[51]!==H||e[52]!==S||e[53]!==qe||e[54]!==n||e[55]!==re||e[56]!==$||e[57]!==R.isPending?(D=t.jsx(Os,{org:n,reportApp:re,onOpenReport:qe,isSubmitting:R.isPending,error:$,meetingUrl:Q,meetingVisual:H,siteUrl:S}),e[50]=Q,e[51]=H,e[52]=S,e[53]=qe,e[54]=n,e[55]=re,e[56]=$,e[57]=R.isPending,e[58]=D):D=e[58],D}if(O.isPending){let D;return e[59]!==H?(D=t.jsx(Vt,{visual:H}),e[59]=H,e[60]=D):D=e[60],D}if(s){let D,J;if(e[61]!==H||e[62]!==V||e[63]!==s||e[64]!==d||e[65]!==n.name||e[66]!==O.isPending||e[67]!==c){J=Symbol.for("react.early_return_sentinel");e:if(D=Re(s),!D.ok){const He=`A configuração de commerce continuará em ${n.name}.`;let fe;e[70]!==He?(fe=t.jsx(ie,{title:"Diagnóstico de commerce",description:He}),e[70]=He,e[71]=fe):fe=e[71];const Be=t.jsx(Ne,{message:pt(D.error)});let pe;e[72]!==V||e[73]!==d||e[74]!==O.isPending||e[75]!==c?(pe=t.jsx(Ge,{siteUrl:c,error:d,isSubmitting:O.isPending,onSiteUrlChange:m,onSubmit:V}),e[72]=V,e[73]=d,e[74]=O.isPending,e[75]=c,e[76]=pe):pe=e[76];let ge;e[77]!==fe||e[78]!==Be||e[79]!==pe?(ge=t.jsxs("div",{className:"grid gap-10",children:[fe,Be,pe]}),e[77]=fe,e[78]=Be,e[79]=pe,e[80]=ge):ge=e[80];let Te;e[81]!==H||e[82]!==ge?(Te=t.jsx(te,{visual:H,children:ge}),e[81]=H,e[82]=ge,e[83]=Te):Te=e[83],J=Te;break e}e[61]=H,e[62]=V,e[63]=s,e[64]=d,e[65]=n.name,e[66]=O.isPending,e[67]=c,e[68]=D,e[69]=J}else D=e[68],J=e[69];if(J!==Symbol.for("react.early_return_sentinel"))return J;const Ve=`O Commerce Discovery está sendo preparado para ${D.value}.`;let de;e[84]!==Ve?(de=t.jsx(ie,{title:"Diagnóstico de commerce",description:Ve}),e[84]=Ve,e[85]=de):de=e[85];let ue;e[86]!==V||e[87]!==d||e[88]!==O.isPending||e[89]!==c?(ue=d?t.jsxs(t.Fragment,{children:[t.jsx(Ne,{message:d}),t.jsx(Ge,{siteUrl:c,error:null,isSubmitting:O.isPending,onSiteUrlChange:m,onSubmit:V})]}):t.jsx(rt,{}),e[86]=V,e[87]=d,e[88]=O.isPending,e[89]=c,e[90]=ue):ue=e[90];let me;e[91]!==de||e[92]!==ue||e[93]!==ee?(me=t.jsxs("div",{ref:ee,className:"grid gap-10",children:[de,ue]}),e[91]=de,e[92]=ue,e[93]=ee,e[94]=me):me=e[94];let Ie;return e[95]!==H||e[96]!==me?(Ie=t.jsx(te,{visual:H,children:me}),e[95]=H,e[96]=me,e[97]=Ie):Ie=e[97],Ie}const Ke=`A configuração de commerce continuará em ${n.name}.`;let ae;e[98]!==Ke?(ae=t.jsx(ie,{title:"Diagnóstico de commerce",description:Ke}),e[98]=Ke,e[99]=ae):ae=e[99];let le;e[100]!==V||e[101]!==d||e[102]!==O.isPending||e[103]!==c?(le=t.jsx(Ge,{siteUrl:c,error:d,isSubmitting:O.isPending,onSiteUrlChange:m,onSubmit:V}),e[100]=V,e[101]=d,e[102]=O.isPending,e[103]=c,e[104]=le):le=e[104];let ce;e[105]!==ae||e[106]!==le?(ce=t.jsxs("div",{className:"grid gap-10",children:[ae,le]}),e[105]=ae,e[106]=le,e[107]=ce):ce=e[107];let we;return e[108]!==H||e[109]!==ce?(we=t.jsx(te,{visual:H,children:ce}),e[108]=H,e[109]=ce,e[110]=we):we=e[110],we}function Ge(o){const e=P.c(20),{siteUrl:n,error:s,isSubmitting:i,onSiteUrlChange:a,onSubmit:r}=o;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=l):l=e[0];let c;e[1]!==a?(c=j=>a(j.target.value),e[1]=a,e[2]=c):c=e[2];const m=!!s;let f;e[3]!==i||e[4]!==n||e[5]!==c||e[6]!==m?(f=t.jsx(_e,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:c,placeholder:"https://example.com","aria-invalid":m,disabled:i}),e[3]=i,e[4]=n,e[5]=c,e[6]=m,e[7]=f):f=e[7];let g;e[8]!==s?(g=s?t.jsx(Ne,{message:s}):null,e[8]=s,e[9]=g):g=e[9];let d;e[10]!==f||e[11]!==g?(d=t.jsxs("div",{className:"grid gap-2",children:[l,f,g]}),e[10]=f,e[11]=g,e[12]=d):d=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Nt,{size:16}),e[13]=x):x=e[13];let b;e[14]!==i?(b=t.jsxs(B,{type:"submit",size:"xl",className:"w-full",disabled:i,children:["Continuar",x]}),e[14]=i,e[15]=b):b=e[15];let v;return e[16]!==r||e[17]!==d||e[18]!==b?(v=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[d,b]}),e[16]=r,e[17]=d,e[18]=b,e[19]=v):v=e[19],v}function Os(o){const e=P.c(26),{org:n,reportApp:s,onOpenReport:i,isSubmitting:a,error:r,meetingUrl:l,meetingVisual:c,siteUrl:m}=o;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ie,{}),e[0]=f):f=e[0];let g;e[1]!==n||e[2]!==s.connectionId||e[3]!==m?(g=t.jsx(ds,{org:n,cdConnectionId:s.connectionId,siteUrl:m}),e[1]=n,e[2]=s.connectionId,e[3]=m,e[4]=g):g=e[4];let d;e[5]!==l?(d=t.jsx(hs,{className:"md:hidden",href:l}),e[5]=l,e[6]=d):d=e[6];let x;e[7]!==r?(x=r?t.jsx(Ne,{message:r}):null,e[7]=r,e[8]=x):x=e[8];const b=a||!s.virtualMcpId,v=a?"Abrindo relatório...":"Ver relatório completo";let j;e[9]!==a?(j=a?null:t.jsx(Nt,{size:18}),e[9]=a,e[10]=j):j=e[10];let p;e[11]!==i||e[12]!==b||e[13]!==v||e[14]!==j?(p=t.jsxs(B,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:i,disabled:b,children:[v,j]}),e[11]=i,e[12]=b,e[13]=v,e[14]=j,e[15]=p):p=e[15];let u;e[16]!==d||e[17]!==x||e[18]!==p?(u=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[d,x,p]}),e[16]=d,e[17]=x,e[18]=p,e[19]=u):u=e[19];let h;e[20]!==g||e[21]!==u?(h=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[f,g,u]}),e[20]=g,e[21]=u,e[22]=h):h=e[22];let y;return e[23]!==c||e[24]!==h?(y=t.jsx(te,{align:"fill",visual:c,children:h}),e[23]=c,e[24]=h,e[25]=y):y=e[25],y}function Ne(o){const e=P.c(2),{message:n}=o;let s;return e[0]!==n?(s=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=s):s=e[1],s}export{Fo as default};
@@ -1 +0,0 @@
1
- import{c as it,r as E,j as e,i as rt}from"./index-j1EmgqV8.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-DahuGsa4.js";import{S as nt}from"./scroll-area-BAz3Rj9i.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-xc_ndIWR.js";import{p as xt}from"./index-_cWo9NQL.js";import"./X-D1lT84o6.js";import"./agent-icon-SFzfjqT3.js";import"./AlertCircle-B7YwjVuv.js";import"./Tool01-MvyjXDCb.js";import"./SwitchHorizontal01-fTq_Xj_0.js";import"./Settings02-CWsiKyfu.js";import"./XCircle-B1aV7AX3.js";import"./ArrowUpRight-DvElag-V.js";import"./ZapSquare-C-BUl6mg.js";import"./Users03-BiIAwLFR.js";import"./CheckCircle-DIxU9fNb.js";import"./ChevronUp-DrHOs0IB.js";import"./ChevronDown-D7t2IbgZ.js";import"./ChevronLeft-DnVztwcc.js";import"./ChevronRight-Cw6r4eF5.js";import"./DotsVertical-p5cw6bzY.js";import"./Stars02-CZ3C1sQr.js";import"./Eye-CPb9WDyf.js";import"./ZoomOut-DnuKetHD.js";import"./Globe01-D51Pf1ib.js";import"./FilterLines-2uX2Gf4U.js";import"./Star01-BvLdWUOq.js";import"./Globe04-8CmI5zRW.js";import"./HardDrive-fBNuw9RE.js";import"./Key01-B-V8oh6M.js";import"./LayoutLeft-B7KWV4nT.js";import"./LinkExternal01-Cd3gNz9H.js";import"./Monitor01-BzxQo8OV.js";import"./Sun-DPnjEA61.js";import"./Palette-TV4PomkE.js";import"./Play-B9WHtGRe.js";import"./Plus-DrCr8atg.js";import"./SearchLg-C45t9PQZ.js";import"./SearchMd-C5JuA4Q_.js";import"./Shield01-BP8Krja8.js";import"./Stars01-ledCttL2.js";import"./Trash01-C3HJx9Eu.js";import"./Upload01-DvSZDpgm.js";import"./User01-TldGh0YP.js";import"./Users01-B63UEiqj.js";import"./XClose-9xeu7JIP.js";import"./Zap-C8z5Nmtq.js";import"./use-clock-tick-vJNeZS2R.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dm0W_H8p.js";import"./tooltip-D2IcwsrW.js";import"./file-type-icon-SP0v8UlM.js";import"./dialog-Dy6eXpKe.js";import"./use-mobile-CWv_pUWp.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-DdqgwoF-.js";import"./use-mcp-client-B1E7Nyjd.js";import"./auth-B9AdzGWs.js";import"./chat-context-rSGx0F1S.js";import"./hooks-o8yCDzJC.js";import"./decopilot-sse-pool--1mtBHxz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BcsK_V5p.js";import"./use-collections-DOhjyZoW.js";import"./use-ai-providers-B7DE5RlO.js";import"./studio-tools-BAmwKCdT.js";import"./use-organization-settings-8LInvXec.js";import"./shell-layout-Buk6j896.js";import"./avatar-CdYywjB8.js";import"./required-auth-layout-CU8fve_K.js";import"./use-org-sso-Dop9y0HC.js";import"./integration-icon-Cpv4CIQ_.js";import"./use-navigate-to-agent-CWpJGmq-.js";import"./use-connection-a48WkDyi.js";import"./use-mcp-prompts-B4idSZTh.js";import"./form-CkEHHrgu.js";import"./label-DIdfff7-.js";import"./input-zUoMTUjz.js";import"./select-svPYG6Bw.js";import"./switch-CjEoRRuC.js";import"./index-XoC6Mv98.js";import"./drawer-Dvd-9Sja.js";import"./collection-search-Yx1Vcd74.js";import"./tabs-DDAkKuLU.js";import"./toggle-group-r5JjNYaj.js";import"./sortable.esm-DHLm3dqa.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DGJrNSMY.js";import"./use-registry-connections-D2DhXJmA.js";import"./useInfiniteQuery-QT7BExxx.js";import"./use-infinite-scroll-Cs1p0W0X.js";import"./extract-connection-data-DrUVsxqd.js";import"./card-Dt5JuJj0.js";import"./collection-tabs-DEvCjzY2.js";import"./badge-Dxlv54DZ.js";import"./textarea-BrxTK711.js";import"./connection-form-helpers-Cco6Qbpt.js";import"./authenticate-and-persist-oauth-CWwDFJ5t.js";import"./mcp-oauth-iKgiXli9.js";import"./useSuspenseInfiniteQuery-CVusVKT2.js";import"./connect-desktop-dialog-Ny2ddpDi.js";import"./decopilot-DMutZh6M.js";import"./checkbox-D5qKxHwE.js";import"./skeleton-U2Av8cLZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CNscyKHW.js";import"./popover-DU5qAOzi.js";import"./command--DrDkfnb.js";import"./index-D3y2G80O.js";import"./dropdown-menu-OVr8TMr_.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-MjzDR8jw.js";import"./empty-state-DQfglbNM.js";import"./toolbar-Cd-zT0GV.js";import"./preview-dialog-C9-3VKyJ.js";import"./index-Z9ET5M46.js";import"./use-mcp-tools-CqHv2Xxs.js";import"./use-capability-BYfWBphf.js";import"./shell-route-loading-B0z1lBof.js";import"./index-kU0DbGlO.js";import"./alert-dialog-Dv-S36Xs.js";import"./use-debounced-autosave-oRzID6xD.js";import"./index-DuwRwNmr.js";import"./sidebar-D5j5gPeI.js";import"./search-input-DRzQD01R.js";import"./github-repo-picker-DSR-TwBo.js";import"./use-debounced-value-B1GdK5fU.js";import"./use-secrets-BLkb7BZG.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DQyCEqbJ.js";import"./automation-runs-B7uMDF25.js";import"./table-T8p77nDy.js";import"./use-members-BqgoI8LN.js";import"./use-org-auth-client-C3mEUOcx.js";import"./task-status-Dc-JFjIj.js";import"./use-automations-BaLowkA-.js";import"./use-file-configs-F_Lh19IF.js";import"./monaco-editor-DvDR9w-L.js";import"./select-model-Dq-JstQ8.js";import"./automation-list-row-CsaQkLKW.js";function ii(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{ii as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as $,D as H,j as A}from"./index-j1EmgqV8.js";import{l as L,g as E,s as y}from"./scroll-area-BAz3Rj9i.js";import{p as O,u as k}from"./use-mcp-client-B1E7Nyjd.js";import{b as q,c as B}from"./use-mcp-tools-CqHv2Xxs.js";import{u as Y}from"./index-_cWo9NQL.js";import{c as G}from"./content-blocks-o63cs2vh.js";import{g as K,M as V,a as w}from"./types-DdqgwoF-.js";import{u as z,b as F}from"./chat-context-rSGx0F1S.js";import{b as J}from"./shell-layout-Buk6j896.js";import"./agent-icon-SFzfjqT3.js";import"./AlertCircle-B7YwjVuv.js";import"./Tool01-MvyjXDCb.js";import"./SwitchHorizontal01-fTq_Xj_0.js";import"./Settings02-CWsiKyfu.js";import"./XCircle-B1aV7AX3.js";import"./ArrowUpRight-DvElag-V.js";import"./ZapSquare-C-BUl6mg.js";import"./Users03-BiIAwLFR.js";import"./CheckCircle-DIxU9fNb.js";import"./ChevronUp-DrHOs0IB.js";import"./ChevronDown-D7t2IbgZ.js";import"./ChevronLeft-DnVztwcc.js";import"./ChevronRight-Cw6r4eF5.js";import"./DotsVertical-p5cw6bzY.js";import"./Stars02-CZ3C1sQr.js";import"./Eye-CPb9WDyf.js";import"./ZoomOut-DnuKetHD.js";import"./Globe01-D51Pf1ib.js";import"./FilterLines-2uX2Gf4U.js";import"./Star01-BvLdWUOq.js";import"./Globe04-8CmI5zRW.js";import"./HardDrive-fBNuw9RE.js";import"./Key01-B-V8oh6M.js";import"./LayoutLeft-B7KWV4nT.js";import"./LinkExternal01-Cd3gNz9H.js";import"./Monitor01-BzxQo8OV.js";import"./Sun-DPnjEA61.js";import"./Palette-TV4PomkE.js";import"./Play-B9WHtGRe.js";import"./Plus-DrCr8atg.js";import"./SearchLg-C45t9PQZ.js";import"./SearchMd-C5JuA4Q_.js";import"./Shield01-BP8Krja8.js";import"./Stars01-ledCttL2.js";import"./Trash01-C3HJx9Eu.js";import"./Upload01-DvSZDpgm.js";import"./User01-TldGh0YP.js";import"./Users01-B63UEiqj.js";import"./XClose-9xeu7JIP.js";import"./X-D1lT84o6.js";import"./Zap-C8z5Nmtq.js";import"./use-clock-tick-vJNeZS2R.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dm0W_H8p.js";import"./tooltip-D2IcwsrW.js";import"./file-type-icon-SP0v8UlM.js";import"./dialog-Dy6eXpKe.js";import"./use-mobile-CWv_pUWp.js";import"./tab-id-BptcWVWa.js";import"./hooks-o8yCDzJC.js";import"./decopilot-sse-pool--1mtBHxz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-BAmwKCdT.js";import"./sheet-DahuGsa4.js";import"./integration-icon-Cpv4CIQ_.js";import"./use-virtual-mcp-BcsK_V5p.js";import"./use-collections-DOhjyZoW.js";import"./use-navigate-to-agent-CWpJGmq-.js";import"./use-connection-a48WkDyi.js";import"./use-mcp-prompts-B4idSZTh.js";import"./form-CkEHHrgu.js";import"./label-DIdfff7-.js";import"./input-zUoMTUjz.js";import"./select-svPYG6Bw.js";import"./auth-B9AdzGWs.js";import"./index-XoC6Mv98.js";import"./drawer-Dvd-9Sja.js";import"./collection-search-Yx1Vcd74.js";import"./tabs-DDAkKuLU.js";import"./toggle-group-r5JjNYaj.js";import"./sortable.esm-DHLm3dqa.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DGJrNSMY.js";import"./use-registry-connections-D2DhXJmA.js";import"./use-organization-settings-8LInvXec.js";import"./useInfiniteQuery-QT7BExxx.js";import"./use-infinite-scroll-Cs1p0W0X.js";import"./extract-connection-data-DrUVsxqd.js";import"./card-Dt5JuJj0.js";import"./collection-tabs-DEvCjzY2.js";import"./badge-Dxlv54DZ.js";import"./textarea-BrxTK711.js";import"./connection-form-helpers-Cco6Qbpt.js";import"./authenticate-and-persist-oauth-CWwDFJ5t.js";import"./mcp-oauth-iKgiXli9.js";import"./useSuspenseInfiniteQuery-CVusVKT2.js";import"./use-ai-providers-B7DE5RlO.js";import"./connect-desktop-dialog-Ny2ddpDi.js";import"./decopilot-DMutZh6M.js";import"./checkbox-D5qKxHwE.js";import"./skeleton-U2Av8cLZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CdYywjB8.js";import"./settings-section-CNscyKHW.js";import"./popover-DU5qAOzi.js";import"./command--DrDkfnb.js";import"./index-D3y2G80O.js";import"./dropdown-menu-OVr8TMr_.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-MjzDR8jw.js";import"./empty-state-DQfglbNM.js";import"./toolbar-Cd-zT0GV.js";import"./preview-dialog-C9-3VKyJ.js";import"./index-Z9ET5M46.js";import"./use-capability-BYfWBphf.js";import"./shell-route-loading-B0z1lBof.js";import"./index-kU0DbGlO.js";import"./alert-dialog-Dv-S36Xs.js";import"./switch-CjEoRRuC.js";import"./use-debounced-autosave-oRzID6xD.js";import"./index-DuwRwNmr.js";import"./sidebar-D5j5gPeI.js";import"./search-input-DRzQD01R.js";import"./github-repo-picker-DSR-TwBo.js";import"./use-debounced-value-B1GdK5fU.js";import"./use-secrets-BLkb7BZG.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DQyCEqbJ.js";import"./automation-runs-B7uMDF25.js";import"./table-T8p77nDy.js";import"./use-members-BqgoI8LN.js";import"./use-org-auth-client-C3mEUOcx.js";import"./task-status-Dc-JFjIj.js";import"./use-automations-BaLowkA-.js";import"./use-file-configs-F_Lh19IF.js";import"./monaco-editor-DvDR9w-L.js";import"./select-model-Dq-JstQ8.js";import"./automation-list-row-CsaQkLKW.js";import"./required-auth-layout-CU8fve_K.js";import"./use-org-sso-Dop9y0HC.js";const Q={};function W(S){const t=$.c(37),{client:r,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=S,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{setChatOpen:f,openTab:g}=J(),e=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==r||t[3]!==o.name||t[4]!==s?(c={client:r,toolName:o.name,toolArguments:s},t[2]=r,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:i}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=y(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const b=N;let _;t[15]!==I||t[16]!==f?(_=C=>{const D=G(C.content);D.content.length>0&&(f(!0),I({tiptapDoc:D}))},t[15]=I,t[16]=f,t[17]=_):_=t[17];const j=_;let P;t[18]!==b?(P={tool:b},t[18]=b,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==e?(T=C=>u(e,C),t[20]=u,t[21]=e,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==e?(R=()=>n(e),t[23]=n,t[24]=e,t[25]=R):R=t[25];let v;return t[26]!==r||t[27]!==j||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==i?(v=A.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:i,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:r,onMessage:j,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=r,t[27]=j,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=i,t[36]=v):v=t[36],v}function ye(S){const t=$.c(24),{connectionId:r,toolName:h,args:o}=S,{org:p}=H(),l=Y();let M;t[0]!==r||t[1]!==l?(M=O(r)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=r,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==r||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:r,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=r,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=k(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let e,a,m;t[10]!==h||t[11]!==g.tools?(e=L(decodeURIComponent(h)),m=g.tools.find(i=>i.name===e)??g.tools.find(i=>{const x=E(i._meta);if(!x)return!1;if(y(i.name,x)===e)return!0;const d=y(e,x);return d!==e&&i.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=e,t[13]=a,t[14]=m):(e=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let i;return t[15]!==e?(i=A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',e,'" not found or has no UI']})}),t[15]=e,t[16]=i):i=t[16],i}let c;return t[17]!==o||t[18]!==n||t[19]!==r||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=A.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:r,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=r,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{ye as AppViewContent};
@@ -1 +0,0 @@
1
- import{c as S,j as r}from"./index-j1EmgqV8.js";import{I as T}from"./input-zUoMTUjz.js";import{L as C}from"./label-DIdfff7-.js";import{T as L}from"./textarea-BrxTK711.js";import{au as A,av as R,at as D,aw as J,ax as K}from"./index-_cWo9NQL.js";import{u as M,s as P}from"./primitives-CykDcCCX.js";import"./index-XoC6Mv98.js";import"./chat-context-rSGx0F1S.js";import"./hooks-o8yCDzJC.js";import"./use-mcp-client-B1E7Nyjd.js";import"./auth-B9AdzGWs.js";import"./decopilot-sse-pool--1mtBHxz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BcsK_V5p.js";import"./use-collections-DOhjyZoW.js";import"./use-ai-providers-B7DE5RlO.js";import"./studio-tools-BAmwKCdT.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-8LInvXec.js";import"./scroll-area-BAz3Rj9i.js";import"./agent-icon-SFzfjqT3.js";import"./AlertCircle-B7YwjVuv.js";import"./Tool01-MvyjXDCb.js";import"./SwitchHorizontal01-fTq_Xj_0.js";import"./Settings02-CWsiKyfu.js";import"./XCircle-B1aV7AX3.js";import"./ArrowUpRight-DvElag-V.js";import"./ZapSquare-C-BUl6mg.js";import"./Users03-BiIAwLFR.js";import"./CheckCircle-DIxU9fNb.js";import"./ChevronUp-DrHOs0IB.js";import"./ChevronDown-D7t2IbgZ.js";import"./ChevronLeft-DnVztwcc.js";import"./ChevronRight-Cw6r4eF5.js";import"./DotsVertical-p5cw6bzY.js";import"./Stars02-CZ3C1sQr.js";import"./Eye-CPb9WDyf.js";import"./ZoomOut-DnuKetHD.js";import"./Globe01-D51Pf1ib.js";import"./FilterLines-2uX2Gf4U.js";import"./Star01-BvLdWUOq.js";import"./Globe04-8CmI5zRW.js";import"./HardDrive-fBNuw9RE.js";import"./Key01-B-V8oh6M.js";import"./LayoutLeft-B7KWV4nT.js";import"./LinkExternal01-Cd3gNz9H.js";import"./Monitor01-BzxQo8OV.js";import"./Sun-DPnjEA61.js";import"./Palette-TV4PomkE.js";import"./Play-B9WHtGRe.js";import"./Plus-DrCr8atg.js";import"./SearchLg-C45t9PQZ.js";import"./SearchMd-C5JuA4Q_.js";import"./Shield01-BP8Krja8.js";import"./Stars01-ledCttL2.js";import"./Trash01-C3HJx9Eu.js";import"./Upload01-DvSZDpgm.js";import"./User01-TldGh0YP.js";import"./Users01-B63UEiqj.js";import"./XClose-9xeu7JIP.js";import"./X-D1lT84o6.js";import"./Zap-C8z5Nmtq.js";import"./use-clock-tick-vJNeZS2R.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dm0W_H8p.js";import"./tooltip-D2IcwsrW.js";import"./file-type-icon-SP0v8UlM.js";import"./dialog-Dy6eXpKe.js";import"./use-mobile-CWv_pUWp.js";import"./content-blocks-o63cs2vh.js";import"./types-DdqgwoF-.js";import"./shell-layout-Buk6j896.js";import"./avatar-CdYywjB8.js";import"./required-auth-layout-CU8fve_K.js";import"./use-org-sso-Dop9y0HC.js";import"./sheet-DahuGsa4.js";import"./integration-icon-Cpv4CIQ_.js";import"./use-navigate-to-agent-CWpJGmq-.js";import"./use-connection-a48WkDyi.js";import"./use-mcp-prompts-B4idSZTh.js";import"./form-CkEHHrgu.js";import"./select-svPYG6Bw.js";import"./drawer-Dvd-9Sja.js";import"./collection-search-Yx1Vcd74.js";import"./tabs-DDAkKuLU.js";import"./toggle-group-r5JjNYaj.js";import"./sortable.esm-DHLm3dqa.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DGJrNSMY.js";import"./use-registry-connections-D2DhXJmA.js";import"./useInfiniteQuery-QT7BExxx.js";import"./use-infinite-scroll-Cs1p0W0X.js";import"./extract-connection-data-DrUVsxqd.js";import"./card-Dt5JuJj0.js";import"./collection-tabs-DEvCjzY2.js";import"./badge-Dxlv54DZ.js";import"./connection-form-helpers-Cco6Qbpt.js";import"./authenticate-and-persist-oauth-CWwDFJ5t.js";import"./mcp-oauth-iKgiXli9.js";import"./useSuspenseInfiniteQuery-CVusVKT2.js";import"./connect-desktop-dialog-Ny2ddpDi.js";import"./decopilot-DMutZh6M.js";import"./checkbox-D5qKxHwE.js";import"./skeleton-U2Av8cLZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CNscyKHW.js";import"./popover-DU5qAOzi.js";import"./command--DrDkfnb.js";import"./index-D3y2G80O.js";import"./dropdown-menu-OVr8TMr_.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-MjzDR8jw.js";import"./empty-state-DQfglbNM.js";import"./toolbar-Cd-zT0GV.js";import"./preview-dialog-C9-3VKyJ.js";import"./index-Z9ET5M46.js";import"./use-mcp-tools-CqHv2Xxs.js";import"./use-capability-BYfWBphf.js";import"./shell-route-loading-B0z1lBof.js";import"./index-kU0DbGlO.js";import"./alert-dialog-Dv-S36Xs.js";import"./switch-CjEoRRuC.js";import"./use-debounced-autosave-oRzID6xD.js";import"./index-DuwRwNmr.js";import"./sidebar-D5j5gPeI.js";import"./search-input-DRzQD01R.js";import"./github-repo-picker-DSR-TwBo.js";import"./use-debounced-value-B1GdK5fU.js";import"./use-secrets-BLkb7BZG.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DQyCEqbJ.js";import"./automation-runs-B7uMDF25.js";import"./table-T8p77nDy.js";import"./use-members-BqgoI8LN.js";import"./use-org-auth-client-C3mEUOcx.js";import"./task-status-Dc-JFjIj.js";import"./use-automations-BaLowkA-.js";import"./use-file-configs-F_Lh19IF.js";import"./monaco-editor-DvDR9w-L.js";import"./select-model-Dq-JstQ8.js";import"./automation-list-row-CsaQkLKW.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}]},q={authors:"Author"};function fr(B){const t=S.c(34),{orgSlug:v,virtualMcpId:j,branch:w,kind:p,blockKey:g,block:f}=B;let y;t[0]!==w||t[1]!==v||t[2]!==j?(y={orgSlug:v,virtualMcpId:j,branch:w},t[0]=w,t[1]=v,t[2]=j,t[3]=y):y=t[3];const m=A(y);let d;t[4]!==f||t[5]!==p?(d=R(f,p),t[4]=f,t[5]=p,t[6]=d):d=t[6];const F=d;let h;t[7]!==g||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:g,data:J(g,p,e)})},t[7]=g,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=M(F,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(D,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(K,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:u=>a(o.key,u),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(C,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:P(i[o.key]),onChange:u=>a(o.key,u.target.value),rows:3}):r.jsx(T,{id:o.key,value:P(i[o.key]),placeholder:o.placeholder,onChange:u=>a(o.key,u.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let x;t[29]!==c?(x=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=x):x=t[30];let b;return t[31]!==x||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,x]}),t[31]=x,t[32]=n,t[33]=b):b=t[33],b}export{fr as RecordEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-B9FmRjJz.js","assets/index-j1EmgqV8.js","assets/index-BBz2M403.css","assets/XCircle-B1aV7AX3.js","assets/CheckCircle-DIxU9fNb.js","assets/Settings02-CWsiKyfu.js","assets/use-mcp-client-B1E7Nyjd.js","assets/auth-B9AdzGWs.js","assets/useInfiniteQuery-QT7BExxx.js","assets/use-infinite-scroll-Cs1p0W0X.js","assets/studio-tools-BAmwKCdT.js","assets/badge-Dxlv54DZ.js","assets/input-zUoMTUjz.js","assets/dropdown-menu-OVr8TMr_.js","assets/ChevronUp-DrHOs0IB.js","assets/ChevronRight-Cw6r4eF5.js","assets/DotsVertical-p5cw6bzY.js","assets/table-T8p77nDy.js","assets/toggle-group-r5JjNYaj.js","assets/use-view-mode-pvlDGqxN.js","assets/use-mobile-CWv_pUWp.js","assets/FilterLines-2uX2Gf4U.js","assets/Globe01-D51Pf1ib.js","assets/SearchMd-C5JuA4Q_.js","assets/dialog-Dy6eXpKe.js","assets/X-D1lT84o6.js","assets/AlertCircle-B7YwjVuv.js","assets/Upload01-DvSZDpgm.js","assets/alert-dialog-Dv-S36Xs.js","assets/card-Dt5JuJj0.js","assets/Trash01-C3HJx9Eu.js","assets/label-DIdfff7-.js","assets/select-svPYG6Bw.js","assets/tooltip-D2IcwsrW.js","assets/ChevronDown-D7t2IbgZ.js","assets/switch-CjEoRRuC.js","assets/textarea-BrxTK711.js","assets/checkbox-D5qKxHwE.js","assets/Eye-CPb9WDyf.js","assets/LinkExternal01-Cd3gNz9H.js","assets/use-copy-Dm0W_H8p.js","assets/Key01-B-V8oh6M.js","assets/Plus-DrCr8atg.js","assets/mcp-oauth-iKgiXli9.js","assets/Play-B9WHtGRe.js"])))=>i.map(i=>d[i]);
2
- import{c as s,j as e,r as i,i as a,am as o}from"./index-j1EmgqV8.js";import{R as m}from"./require-capability-CehH7jAZ.js";import"./use-capability-BYfWBphf.js";import"./access-gate-BY3tN2ja.js";import"./capability-load-error-CFxZVJfo.js";const n=i.lazy(()=>o(()=>import("./registry-layout-B9FmRjJz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function f(){const r=s.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
@@ -1,5 +0,0 @@
1
- import{D as Ft,a as Tn,z as pr,p as vr,n as mr,j as i,B as Ye,t as Le,r as u,m as br,b as xr,i as At,w as J,K as ht,c as yr,C as wr,L as Cr,l as Sr,k as Dr,ah as z,aQ as ft}from"./index-j1EmgqV8.js";import{g as Rr}from"./connection-slug-eyAPH6o3.js";import{u as _n,a as kn,g as jr,C as Ht}from"./connection-card-DGJrNSMY.js";import{C as Nr}from"./collection-search-Yx1Vcd74.js";import{C as Ir}from"./collection-tabs-DEvCjzY2.js";import{a as Ar,b as Er,e as Tr,g as _r}from"./extract-connection-data-DrUVsxqd.js";import{e as Mn,d as On,c as Pn,a as Ln,b as kr,D as Mr}from"./dialog-Dy6eXpKe.js";import{D as Or,a as Pr,c as Lr,b as Fr,d as zr,e as Br,f as $r}from"./drawer-Dvd-9Sja.js";import{u as Vr}from"./use-mobile-CWv_pUWp.js";import{F as De,b as Re,c as je,d as Ne,e as Ie,a as fn}from"./form-CkEHHrgu.js";import{I as He}from"./input-zUoMTUjz.js";import{d as Xr,b as Kr,c as Ur,S as Hr,a as ut}from"./select-svPYG6Bw.js";import{T as Yr}from"./textarea-BrxTK711.js";import{b as Fn}from"./use-connection-a48WkDyi.js";import{n as Et,c as Yt}from"./XCircle-B1aV7AX3.js";import{s as Wt}from"./Star01-BvLdWUOq.js";import{a8 as Wr}from"./agent-icon-SFzfjqT3.js";import{s as qr}from"./XClose-9xeu7JIP.js";import{c as Gr,i as Dt,a as hn,E as Jr,p as Qr,b as Zr,d as eo}from"./connection-form-helpers-Cco6Qbpt.js";import{u as gn}from"./use-infinite-scroll-Cs1p0W0X.js";import{a as qt}from"./authenticate-and-persist-oauth-CWwDFJ5t.js";import{B as Rt}from"./badge-Dxlv54DZ.js";import{T as Gt,a as Jt,b as Qt}from"./tooltip-D2IcwsrW.js";import{u as to}from"./useSuspenseInfiniteQuery-CVusVKT2.js";import{S as no,u as ro}from"./use-mcp-client-B1E7Nyjd.js";import{i as pn}from"./ChevronUp-DrHOs0IB.js";import{s as oo}from"./Plus-DrCr8atg.js";import{u as so}from"./studio-tools-BAmwKCdT.js";import{u as io}from"./use-ai-providers-B7DE5RlO.js";function ao(t){const e=t?.metadata?.githubRepo;return e?e.connectionId?t?.connections?.some(r=>r.connection_id===e.connectionId)?e:null:e:null}function Pi(t){if(typeof t!="object"||t===null)return!1;const n=t.githubRepo?.url;return typeof n=="string"&&n.length>0}function co(t){return!!ao(t??null)?.connectionId}function Li(t){return co(t)}function Fi(t){const e=new Set;for(const n of t??[]){const r=n.metadata?.liveAgentId;typeof r=="string"&&r&&e.add(n.id)}return e}function zi(t){const e=new Map,n=new Map;for(const r of t??[]){const o=r.metadata?.liveAgentId;typeof o=="string"&&o&&(n.set(r.id,o),e.set(o,r.id))}return{liveToDev:e,devToLive:n}}function Bi(t,e){if(!t)return null;const n=t.metadata?.liveAgentId;if(typeof n=="string"&&n)return{mode:"dev",targetId:n};const r=(e??[]).find(o=>o.metadata?.liveAgentId===t.id);return r?{mode:"live",targetId:r.id}:null}function $i(t){return t.online?t.capabilities.includes("claude-code")||t.capabilities.includes("codex"):!1}function lo({open:t,onOpenChange:e,onCreated:n}){const{org:r}=Ft(),{data:o}=Tn.useSession(),{stdioEnabled:s}=pr(),a=Vr(),c=Fn(),l=_n(),h=kn(l,"").items,d=vr({resolver:mr(Gr),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),g=d.watch("ui_type"),m=d.watch("connection_url"),N=d.watch("npx_package"),x=Dt({uiType:g,connectionUrl:m??"",npxPackage:N??""})??hn({uiType:g,connectionUrl:m??"",registryItems:h}),v=p=>{const y=p.trim();if(!y)return;const b=!!d.formState.dirtyFields.title,w=!!d.formState.dirtyFields.description,I=!!d.formState.dirtyFields.env_vars,O=E=>{if(E&&(!b&&!d.getValues("title").trim()&&E.title&&d.setValue("title",E.title,{shouldDirty:!1}),!w&&!(d.getValues("description")??"").trim()&&E.description&&d.setValue("description",E.description,{shouldDirty:!1}),!I&&E.envVarKeys?.length)){const B=d.getValues("env_vars")??[],ae=new Set(B.map(Y=>Y.key)),X=E.envVarKeys.filter(Y=>!ae.has(Y));X.length>0&&d.setValue("env_vars",[...B,...X.map(Y=>({key:Y,value:""}))],{shouldDirty:!0})}},k=Qr(y);if(k&&s){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",k.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),O(Dt({uiType:"NPX",npxPackage:k.packageName}));return}if(y.startsWith("http://")||y.startsWith("https://")){const E=g==="HTTP"||g==="SSE"||g==="Websocket"?g:"HTTP";d.setValue("ui_type",E,{shouldDirty:!0}),d.setValue("connection_url",y,{shouldDirty:!0}),O(Dt({uiType:E,connectionUrl:y})??hn({uiType:E,connectionUrl:y,registryItems:h}));return}g==="NPX"&&O(Dt({uiType:"NPX",npxPackage:y}))},R=p=>{p||d.reset(),e(p)},C=async p=>{let y,b=null,w=null,I=null;p.ui_type==="NPX"?(y="STDIO",b="",I=Zr(p.npx_package||"",p.env_vars||[])):p.ui_type==="STDIO"?(y="STDIO",b="",I=eo(p.stdio_command||"",p.stdio_args||"",p.stdio_cwd,p.env_vars||[])):(y=p.ui_type,b=p.connection_url||"",w=p.connection_token||null);const O=Ar("conn");try{await c.create.mutateAsync({id:O,title:p.title,description:p.description||null,connection_type:y,connection_url:b,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:r.id,icon:p.icon??null,app_name:null,app_id:null,connection_headers:I,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),n?.(O)}catch{Le.error("Failed to create connection")}},S="Create Connection",j="Create a custom connection in your organization. Fill in the details below.",T=d.formState.isSubmitting?"Saving...":"Create Connection",A=i.jsxs("div",{className:"grid gap-4",children:[i.jsx(De,{control:d.control,name:"ui_type",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Type *"}),i.jsxs(Xr,{value:p.value,onValueChange:p.onChange,children:[i.jsx(Ne,{children:i.jsx(Kr,{children:i.jsx(Ur,{})})}),i.jsxs(Hr,{children:[i.jsx(ut,{value:"HTTP",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Wt,{className:"w-4 h-4"}),"HTTP"]})}),i.jsx(ut,{value:"SSE",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Wt,{className:"w-4 h-4"}),"SSE"]})}),i.jsx(ut,{value:"Websocket",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Wt,{className:"w-4 h-4"}),"Websocket"]})}),s&&i.jsxs(i.Fragment,{children:[i.jsx(ut,{value:"NPX",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Et,{className:"w-4 h-4"}),"NPX Package"]})}),i.jsx(ut,{value:"STDIO",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Wr,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),i.jsx(Ie,{})]})}),g==="NPX"&&i.jsx(De,{control:d.control,name:"npx_package",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"NPM Package *"}),i.jsx(Ne,{children:i.jsx(He,{placeholder:"@perplexity-ai/mcp-server",...p,value:p.value??"",onPaste:y=>{const b=y.clipboardData.getData("text");b&&(y.preventDefault(),d.setValue("npx_package",b.trim(),{shouldDirty:!0}),v(b))},onBlur:y=>{v(y.target.value),p.onBlur()}})}),i.jsx(Ie,{})]})}),g==="STDIO"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[i.jsx(De,{control:d.control,name:"stdio_command",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Command *"}),i.jsx(Ne,{children:i.jsx(He,{placeholder:"node, bun, python...",...p,value:p.value??""})}),i.jsx(Ie,{})]})}),i.jsx(De,{control:d.control,name:"stdio_args",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Arguments"}),i.jsx(Ne,{children:i.jsx(He,{placeholder:"arg1 arg2 --flag value",...p,value:p.value??""})}),i.jsx(Ie,{})]})})]}),i.jsx(De,{control:d.control,name:"stdio_cwd",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Working Directory"}),i.jsx(Ne,{children:i.jsx(He,{placeholder:"/path/to/project (optional)",...p,value:p.value??""})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),i.jsx(Ie,{})]})})]}),(g==="NPX"||g==="STDIO")&&i.jsx(De,{control:d.control,name:"env_vars",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Environment Variables"}),i.jsx(Ne,{children:i.jsx(Jr,{value:p.value??[],onChange:p.onChange})}),i.jsx(Ie,{})]})}),g!=="NPX"&&g!=="STDIO"&&i.jsxs(i.Fragment,{children:[i.jsx(De,{control:d.control,name:"connection_url",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"URL *"}),i.jsx(Ne,{children:i.jsx(He,{placeholder:"https://example.com/mcp",...p,value:p.value??"",onPaste:y=>{const b=y.clipboardData.getData("text");b&&(y.preventDefault(),d.setValue("connection_url",b.trim(),{shouldDirty:!0}),v(b))},onBlur:y=>{v(y.target.value),p.onBlur()}})}),i.jsx(Ie,{})]})}),i.jsx(De,{control:d.control,name:"connection_token",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:x?.token?.label??"Token (optional)"}),i.jsx(Ne,{children:i.jsx(He,{type:"password",placeholder:x?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...p,value:p.value??""})}),x?.token?.helperText&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&i.jsxs(i.Fragment,{children:[" ","·"," ",i.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),i.jsx(Ie,{})]})})]}),i.jsx(De,{control:d.control,name:"title",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Name *"}),i.jsx(Ne,{children:i.jsx(He,{placeholder:"My Connection",...p})}),i.jsx(Ie,{})]})}),i.jsx(De,{control:d.control,name:"description",render:({field:p})=>i.jsxs(Re,{children:[i.jsx(je,{children:"Description"}),i.jsx(Ne,{children:i.jsx(Yr,{placeholder:"A brief description of this connection",rows:3,...p,value:p.value??""})}),i.jsx(Ie,{})]})})]});return a?i.jsx(Or,{open:t,onOpenChange:R,children:i.jsxs(Pr,{className:"max-h-[90vh]",children:[i.jsx(Lr,{className:"pb-2",children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"flex-1 text-left",children:[i.jsx(Fr,{children:S}),i.jsx(zr,{className:"mt-1",children:j})]}),i.jsx(Br,{asChild:!0,children:i.jsx(Ye,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:i.jsx(qr,{size:16})})})]})}),i.jsx(fn,{...d,children:i.jsxs("form",{onSubmit:d.handleSubmit(C),children:[i.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:A}),i.jsx($r,{children:i.jsx(Ye,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:T})})]})})]})}):i.jsx(Mn,{open:t,onOpenChange:R,children:i.jsxs(On,{className:"sm:max-w-[525px]",children:[i.jsxs(Pn,{children:[i.jsx(Ln,{children:S}),i.jsx(kr,{children:j})]}),i.jsx(fn,{...d,children:i.jsxs("form",{onSubmit:d.handleSubmit(C),children:[i.jsx("div",{className:"py-4",children:A}),i.jsxs(Mr,{children:[i.jsx(Ye,{type:"button",variant:"outline",onClick:()=>R(!1),children:"Cancel"}),i.jsx(Ye,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:T})]})]})})]})})}function uo(t){const e=yr.c(73),{mode:n,agentId:r,addedConnectionIds:o,onAdd:s,onCloneAndAdd:a,onConnectAndAdd:c,connectingItemId:l,search:f,onCreateConnection:h,onBrowseNavigate:d,defaultTab:g}=t,m=n===void 0?"add":n,N=g===void 0?"connected":g,{org:x}=Ft(),v=u.useDeferredValue(f),R=f!==v,C=v.trim().toLowerCase();let S;e[0]!==N?(S=D=>D??N,e[0]=N,e[1]=S):S=e[1];const[j,T]=wr(Cr.connectionsTab(x.slug)+(N==="all"?":home-modal":":agent-modal"),S);let A;e[2]!==j||e[3]!==T?(A=D=>{D!==j&&J("connections_dialog_tab_changed",{to_tab:D}),T(D)},e[2]=j,e[3]=T,e[4]=A):A=e[4];const p=A;let y;e[5]!==x.id||e[6]!==x.slug?(y={connectionId:no,orgId:x.id,orgSlug:x.slug},e[5]=x.id,e[6]=x.slug,e[7]=y):y=e[7];const b=ro(y);let w,I,O;if(e[8]!==b||e[9]!==v||e[10]!==x.id){O=v?.trim()?{operator:"or",conditions:[{field:["title"],operator:"contains",value:v.trim()},{field:["description"],operator:"contains",value:v.trim()}]}:void 0;const D={...O&&{where:O},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},P=JSON.stringify(D);I=to,w=ht.collectionListInfinite(b,x.id,"","CONNECTIONS",P),e[8]=b,e[9]=v,e[10]=x.id,e[11]=w,e[12]=I,e[13]=O}else w=e[11],I=e[12],O=e[13];let k;e[14]!==b||e[15]!==O?(k=async D=>{const{pageParam:P}=D,de=P===void 0?0:P;return(await b.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...O&&{where:O},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:de}})).structuredContent},e[14]=b,e[15]=O,e[16]=k):k=e[16];let E;e[17]!==w||e[18]!==k?(E={queryKey:w,queryFn:k,initialPageParam:0,getNextPageParam:mo,staleTime:3e4},e[17]=w,e[18]=k,e[19]=E):E=e[19];const{data:B,fetchNextPage:ae,hasNextPage:X,isFetchingNextPage:Y}=I(E),ce=B?.pages.flatMap(vo)??[],xe=jr(ce),qe=new Set(ce.filter(po).map(go)),$=_n(),U=kn($,v),he=gn(U.loadMore,U.hasMore,U.isLoadingMore),Ae=gn(ae,X??!1,Y),L=j==="all"||!!C,Ue=L?U.items.filter(D=>{const P=Er(D);if(P&&qe.has(P))return!1;if(!C)return!0;const de=D._meta?.["mcp.mesh"];return[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,de?.friendly_name,de?.friendlyName].filter(Boolean).join(" ").toLowerCase().includes(C)}):[],Z=Ue.filter(ho),W=Ue.filter(fo);let M;e[20]!==o?(M=D=>D.some(P=>o.has(P.id)),e[20]=o,e[21]=M):M=e[21];const Ee=M;let q;e[22]!==o||e[23]!==r||e[24]!==l||e[25]!==Ee||e[26]!==m||e[27]!==s||e[28]!==d||e[29]!==a?(q=(D,P,de,ze,ve)=>{const Ze=Ee(ve),Be=ve.find(F=>!o.has(F.id)),te=ve[0];if(m==="browse"){const F=Rr(te);return i.jsx(Ht,{connection:{title:P,icon:de,description:ve.length>1?`${ve.length} instances`:ze??void 0},fallbackIcon:i.jsx(Et,{}),headerActionsAlwaysVisible:!0,headerActions:i.jsxs(Rt,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[i.jsx(pn,{size:11})," Connected"]}),onClick:()=>{J("connection_browse_clicked",{app_name:te.app_name??null,connection_id:te.id,instances_count:ve.length}),d?.(F)}},D)}return i.jsx(Ht,{connection:{title:P,icon:de,description:ze},fallbackIcon:i.jsx(Et,{}),headerActionsAlwaysVisible:!0,headerActions:i.jsxs("div",{className:"flex items-center gap-1.5",children:[Ze&&i.jsxs(Rt,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[i.jsx(pn,{size:11})," Added"]}),i.jsx(Ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:F=>{F.stopPropagation(),Be?(J("connection_add_clicked",{action:"use_existing",app_name:te.app_name??null,connection_id:Be.id}),r&&J("agent_connection_attached",{agent_id:r,connection_id:Be.id,app_name:te.app_name??null,mode:"existing"}),s(Be.id)):(J("connection_add_clicked",{action:"clone",app_name:te.app_name??null,base_connection_id:te.id}),a(te))},children:"Add"})]})},D)},e[22]=o,e[23]=r,e[24]=l,e[25]=Ee,e[26]=m,e[27]=s,e[28]=d,e[29]=a,e[30]=q):q=e[30];const ge=q;let ee;e[31]!==l||e[32]!==m||e[33]!==c?(ee=D=>{const P=D._meta?.["mcp.mesh"],de=P?.friendlyName||P?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ze=D.server?.description||D.description||null,ve=D.server?.icons?.[0]?.src||_r(D.server?.repository)||null,Ze=P?.official===!0,Be=P?.verified===!0,te=P?.owner==="deco";return i.jsx(Ht,{connection:{title:de,description:ze,icon:ve},fallbackIcon:i.jsx(Et,{}),headerActionsAlwaysVisible:!0,headerActions:i.jsxs("div",{className:"flex items-center gap-1.5",children:[te&&i.jsxs(Gt,{children:[i.jsx(Jt,{asChild:!0,children:i.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:i.jsx("img",{src:"/logos/deco logo.svg",alt:"Made by Deco",className:"size-3"})})}),i.jsx(Qt,{children:"Built and maintained by Deco"})]}),!te&&Ze&&i.jsxs(Gt,{children:[i.jsx(Jt,{asChild:!0,children:i.jsx(Rt,{variant:"outline",size:"icon",children:i.jsx(Yt,{})})}),i.jsx(Qt,{children:"Built and maintained by the official vendor"})]}),!te&&!Ze&&Be&&i.jsxs(Gt,{children:[i.jsx(Jt,{asChild:!0,children:i.jsx(Rt,{variant:"outline",size:"icon",children:i.jsx(Yt,{})})}),i.jsx(Qt,{children:"Verified by the Deco team"})]}),i.jsx(Ye,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:F=>{F.stopPropagation(),J("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:P?.friendlyName||D.server?.name||D.name||null}),c(D)},children:l===D.id?i.jsx(At,{size:14,className:"animate-spin"}):m==="browse"?"Connect":"Add"})]})},`catalog-${D.id}`)},e[31]=l,e[32]=m,e[33]=c,e[34]=ee):ee=e[34];const Te=ee,ye=!C&&i.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[i.jsx(Ir,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:D=>p(D)}),i.jsxs(Ye,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{J("connections_dialog_custom_clicked"),h()},children:[i.jsx(oo,{size:12}),"Custom Connection"]})]}),Ge=R&&"opacity-50 pointer-events-none";let _e;e[35]!==Ge?(_e=Sr("flex-1 overflow-auto p-5 transition-opacity duration-150",Ge),e[35]=Ge,e[36]=_e):_e=e[36];const st="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ne;e[37]!==ge?(ne=D=>{if(D.type==="group")return ge(D.key,D.title,D.icon,null,D.connections);const P=D.connection;return ge(P.id,P.title,P.icon,P.description??null,[P])},e[37]=ge,e[38]=ne):ne=e[38];const Fe=xe.map(ne);let pe;e[39]!==Ae?(pe=i.jsx("div",{ref:Ae,className:"col-span-full h-1"}),e[39]=Ae,e[40]=pe):pe=e[40];let ke;e[41]!==Y?(ke=Y&&i.jsx("div",{className:"col-span-full flex justify-center py-6",children:i.jsx(At,{size:24,className:"animate-spin text-muted-foreground"})}),e[41]=Y,e[42]=ke):ke=e[42];const Je=L&&Z.length>0&&i.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[i.jsx(Yt,{size:13,className:"text-muted-foreground shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),i.jsx("div",{className:"flex-1 h-px bg-border"})]}),it=L&&Z.map(Te),at=L&&W.length>0&&i.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[i.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),i.jsx("div",{className:"flex-1 h-px bg-border"})]}),we=L&&W.map(Te);let re;e[43]!==he||e[44]!==$||e[45]!==L?(re=L&&$.length>0&&i.jsx("div",{ref:he,className:"col-span-full h-1"}),e[43]=he,e[44]=$,e[45]=L,e[46]=re):re=e[46];let le;e[47]!==U.isLoadingMore||e[48]!==L?(le=L&&U.isLoadingMore&&i.jsx("div",{className:"col-span-full flex justify-center py-6",children:i.jsx(At,{size:24,className:"animate-spin text-muted-foreground"})}),e[47]=U.isLoadingMore,e[48]=L,e[49]=le):le=e[49];let Me;e[50]!==Fe||e[51]!==pe||e[52]!==ke||e[53]!==Je||e[54]!==it||e[55]!==at||e[56]!==we||e[57]!==re||e[58]!==le?(Me=i.jsxs("div",{className:st,children:[Fe,pe,ke,Je,it,at,we,re,le]}),e[50]=Fe,e[51]=pe,e[52]=ke,e[53]=Je,e[54]=it,e[55]=at,e[56]=we,e[57]=re,e[58]=le,e[59]=Me):Me=e[59];let G;e[60]!==j||e[61]!==xe.length||e[62]!==W||e[63]!==f||e[64]!==Z?(G=xe.length===0&&Z.length===0&&W.length===0&&i.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:f?`No connections match "${f}"`:j==="connected"?"No connections yet":"No connections available"}),e[60]=j,e[61]=xe.length,e[62]=W,e[63]=f,e[64]=Z,e[65]=G):G=e[65];let Oe;e[66]!==_e||e[67]!==Me||e[68]!==G?(Oe=i.jsxs("div",{className:_e,children:[Me,G]}),e[66]=_e,e[67]=Me,e[68]=G,e[69]=Oe):Oe=e[69];let Qe;return e[70]!==ye||e[71]!==Oe?(Qe=i.jsxs(i.Fragment,{children:[ye,Oe]}),e[70]=ye,e[71]=Oe,e[72]=Qe):Qe=e[72],Qe}function fo(t){return!t.verified&&!t._meta?.["mcp.mesh"]?.verified&&!t.meta?.verified}function ho(t){return t.verified||t._meta?.["mcp.mesh"]?.verified||t.meta?.verified}function go(t){return t.app_name}function po(t){return t.app_name}function vo(t){return t?.items??[]}function mo(t,e){if(t?.hasMore)return e.reduce(bo,0)}function bo(t,e){return t+(e?.items?.length??0)}function Vi({open:t,onOpenChange:e,defaultTab:n,initialSearch:r="",...o}){const s=o.mode??"add",a="agentId"in o?o.agentId:void 0,c="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,l="onAdd"in o&&o.onAdd?o.onAdd:b=>{},f=(b,w,I)=>{a&&J("agent_connection_attached",{agent_id:a,connection_id:b,app_name:w,mode:I})},[h,d]=u.useState(null),[g,m]=u.useState(r),[N,x]=u.useState(!1),{org:v}=Ft(),{data:R}=Tn.useSession(),C=Fn(),S=br(),j=xr(),T=b=>{e(!1),j({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:b}})},A=()=>{S.invalidateQueries({predicate:b=>{const w=b.queryKey;return w[1]===v.id&&w[3]==="collection"&&w[4]==="CONNECTIONS"}})},p=async b=>{d(b.app_name??b.id);try{const I=`${b.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,k=(await C.create.mutateAsync({title:I,description:b.description??null,connection_type:b.connection_type,connection_url:b.connection_url??null,connection_token:null,icon:b.icon??null,app_name:b.app_name??null,app_id:b.app_id??null,connection_headers:b.connection_headers??null})).id,E=await qt({connectionId:k,orgId:v.id,orgSlug:v.slug,persistFallback:B=>C.update.mutateAsync({id:k,data:{connection_token:B}}).then(()=>{})});if(E.ran&&!E.ok){J("connection_oauth_failed",{connection_id:k,flow:"clone",error:E.error??"no_token"}),Le.error(`Authentication failed: ${E.error??"no token received"}`),await C.delete.mutateAsync(k);return}if(E.ran){J("connection_oauth_succeeded",{connection_id:k,flow:"clone"});const B=new URL(`/api/${v.slug}/mcp/${k}`,window.location.origin);await S.invalidateQueries({queryKey:ht.isMCPAuthenticated(B.href,null)}),A()}f(k,b.app_name??null,"clone"),l(k)}catch(w){console.error("Failed to add connection:",w),Le.error("Failed to add connection")}finally{d(null)}},y=async b=>{if(!(!v||!R?.user?.id)){d(b.id);try{const w=Tr(b,v.id,R.user.id,{remoteIndex:0}),I=w.connection_type==="STDIO",O=!!w.connection_url,k=I&&w.connection_headers&&typeof w.connection_headers=="object"&&"command"in w.connection_headers;if(!O&&!k){Le.error("This MCP Server cannot be connected: no connection method available"),d(null);return}const{id:E}=await C.create.mutateAsync(w),B=await qt({connectionId:E,orgId:v.id,orgSlug:v.slug,persistFallback:ae=>C.update.mutateAsync({id:E,data:{connection_token:ae}}).then(()=>{})});if(B.ran&&!B.ok){J("connection_oauth_failed",{connection_id:E,flow:"connect_new",error:B.error??"no_token"}),Le.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${B.error??"no token received"})`}),f(E,w.app_name??null,"new"),l(E);return}if(B.ran){J("connection_oauth_succeeded",{connection_id:E,flow:"connect_new"});const ae=new URL(`/api/${v.slug}/mcp/${E}`,window.location.origin);await S.invalidateQueries({queryKey:ht.isMCPAuthenticated(ae.href,null)}),A(),Le.success("Connected and authenticated")}else Le.success("Connected");f(E,w.app_name??null,"new"),l(E)}catch(w){console.error("Failed to connect:",w),Le.error("Failed to connect")}finally{d(null)}}};return i.jsxs(Mn,{open:t,onOpenChange:e,children:[i.jsxs(On,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[i.jsx(Pn,{className:"px-6 pt-5 pb-0 shrink-0",children:i.jsx(Ln,{className:"text-base font-semibold",children:s==="browse"?"Connections":"Add Connection"})}),i.jsx("div",{className:"pt-3 shrink-0",children:i.jsx(Nr,{value:g,onChange:m,placeholder:"Search connections..."})}),i.jsx(u.Suspense,{fallback:i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsx(At,{size:24,className:"animate-spin text-muted-foreground"})}),children:i.jsx(uo,{mode:s,agentId:a,addedConnectionIds:c,onAdd:l,onCloneAndAdd:p,onConnectAndAdd:y,connectingItemId:h,search:g,onCreateConnection:()=>x(!0),onBrowseNavigate:T,defaultTab:n})})]}),i.jsx(lo,{open:N,onOpenChange:x,onCreated:async b=>{x(!1);const w=await qt({connectionId:b,orgId:v.id,orgSlug:v.slug,persistFallback:I=>C.update.mutateAsync({id:b,data:{connection_token:I}}).then(()=>{})});if(w.ran&&!w.ok){J("connection_oauth_failed",{connection_id:b,flow:"custom_create",error:w.error??"no_token"}),Le.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${w.error??"no token received"})`}),f(b,null,"custom"),l(b),e(!1);return}if(w.ran){J("connection_oauth_succeeded",{connection_id:b,flow:"custom_create"});const I=new URL(`/api/${v.slug}/mcp/${b}`,window.location.origin);await S.invalidateQueries({queryKey:ht.isMCPAuthenticated(I.href,null)}),A()}f(b,null,"custom"),l(b),e(!1)}})]})}const vn=new Map;function Xi(){const{org:t}=Ft(),e=so(),n=io(),r=n.find(v=>v.providerId==="deco"),{data:o,isLoading:s,refetch:a,isFetching:c}=Dr({queryKey:ht.aiProviderCredits(t.id,"deco"),enabled:!!r,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=o?.balanceCents??null,f=l!=null?l/100:null,h=u.useRef(new Map);if(l!=null){const v=vn.get(t.id);h.current.get(t.id)&&v!=null&&l>v&&J("credits_topped_up_detected",{organization_id:t.id,delta_cents:l-v,previous_balance_cents:v,new_balance_cents:l}),vn.set(t.id,l),h.current.set(t.id,!0)}const d=!!r,g=l!=null&&l>0,m=l!=null&&l===0,N=l!=null&&l===200,x=n.length>0&&n.every(v=>v.providerId==="deco");return{hasDecoKey:d,decoKeyId:r?.id??null,balanceCents:l,balanceDollars:f,hasCredits:g,isZeroBalance:m,isInitialFreeCredit:N,hasOnlyDecoProvider:x,isLoading:s,isFetching:c,refetch:a}}function xo(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return u.useMemo(()=>r=>{e.forEach(o=>o(r))},e)}const zt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function nt(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function an(t){return"nodeType"in t}function Q(t){var e,n;return t?nt(t)?t:an(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function cn(t){const{Document:e}=Q(t);return t instanceof e}function yt(t){return nt(t)?!1:t instanceof Q(t).HTMLElement}function zn(t){return t instanceof Q(t).SVGElement}function rt(t){return t?nt(t)?t.document:an(t)?cn(t)?t:yt(t)||zn(t)?t.ownerDocument:document:document:document}const me=zt?u.useLayoutEffect:u.useEffect;function Bt(t){const e=u.useRef(t);return me(()=>{e.current=t}),u.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}function yo(){const t=u.useRef(null),e=u.useCallback((r,o)=>{t.current=setInterval(r,o)},[]),n=u.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function mt(t,e){e===void 0&&(e=[t]);const n=u.useRef(t);return me(()=>{n.current!==t&&(n.current=t)},e),n}function wt(t,e){const n=u.useRef();return u.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function _t(t){const e=Bt(t),n=u.useRef(null),r=u.useCallback(o=>{o!==n.current&&e?.(o,n.current),n.current=o},[]);return[n,r]}function kt(t){const e=u.useRef();return u.useEffect(()=>{e.current=t},[t]),e.current}let Zt={};function Ct(t,e){return u.useMemo(()=>{if(e)return e;const n=Zt[t]==null?0:Zt[t]+1;return Zt[t]=n,t+"-"+n},[t,e])}function Bn(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const c=Object.entries(a);for(const[l,f]of c){const h=s[l];h!=null&&(s[l]=h+t*f)}return s},{...e})}}const tt=Bn(1),bt=Bn(-1);function wo(t){return"clientX"in t&&"clientY"in t}function $t(t){if(!t)return!1;const{KeyboardEvent:e}=Q(t.target);return e&&t instanceof e}function Co(t){if(!t)return!1;const{TouchEvent:e}=Q(t.target);return e&&t instanceof e}function Mt(t){if(Co(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return wo(t)?{x:t.clientX,y:t.clientY}:null}const We=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[We.Translate.toString(t),We.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),mn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function So(t){return t.matches(mn)?t:t.querySelector(mn)}const Do={display:"none"};function Ro(t){let{id:e,value:n}=t;return z.createElement("div",{id:e,style:Do},n)}function jo(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return z.createElement("div",{id:e,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function No(){const[t,e]=u.useState("");return{announce:u.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const $n=u.createContext(null);function Io(t){const e=u.useContext($n);u.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Ao(){const[t]=u.useState(()=>new Set),e=u.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[u.useCallback(r=>{let{type:o,event:s}=r;t.forEach(a=>{var c;return(c=a[o])==null?void 0:c.call(a,s)})},[t]),e]}const Eo={draggable:`
2
- To pick up a draggable item, press the space bar.
3
- While dragging, use the arrow keys to move the item.
4
- Press space again to drop the item in its new position, or press escape to cancel.
5
- `},To={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function _o(t){let{announcements:e=To,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Eo}=t;const{announce:s,announcement:a}=No(),c=Ct("DndLiveRegion"),[l,f]=u.useState(!1);if(u.useEffect(()=>{f(!0)},[]),Io(u.useMemo(()=>({onDragStart(d){let{active:g}=d;s(e.onDragStart({active:g}))},onDragMove(d){let{active:g,over:m}=d;e.onDragMove&&s(e.onDragMove({active:g,over:m}))},onDragOver(d){let{active:g,over:m}=d;s(e.onDragOver({active:g,over:m}))},onDragEnd(d){let{active:g,over:m}=d;s(e.onDragEnd({active:g,over:m}))},onDragCancel(d){let{active:g,over:m}=d;s(e.onDragCancel({active:g,over:m}))}}),[s,e])),!l)return null;const h=z.createElement(z.Fragment,null,z.createElement(Ro,{id:r,value:o.draggable}),z.createElement(jo,{id:c,announcement:a}));return n?ft.createPortal(h,n):h}var V;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(V||(V={}));function Ot(){}function Ki(t,e){return u.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Ui(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return u.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const be=Object.freeze({x:0,y:0});function Vn(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function ko(t,e){const n=Mt(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function Xn(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Mo(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function bn(t){let{left:e,top:n,height:r,width:o}=t;return[{x:e,y:n},{x:e+o,y:n},{x:e,y:n+r},{x:e+o,y:n+r}]}function Kn(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function xn(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Hi=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=xn(e,e.left,e.top),s=[];for(const a of r){const{id:c}=a,l=n.get(c);if(l){const f=Vn(xn(l),o);s.push({id:c,data:{droppableContainer:a,value:f}})}}return s.sort(Xn)},Oo=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=bn(e),s=[];for(const a of r){const{id:c}=a,l=n.get(c);if(l){const f=bn(l),h=o.reduce((g,m,N)=>g+Vn(f[N],m),0),d=Number((h/4).toFixed(4));s.push({id:c,data:{droppableContainer:a,value:d}})}}return s.sort(Xn)};function Po(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),o=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),a=o-r,c=s-n;if(r<o&&n<s){const l=e.width*e.height,f=t.width*t.height,h=a*c,d=h/(l+f-h);return Number(d.toFixed(4))}return 0}const Lo=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const l=Po(c,e);l>0&&o.push({id:a,data:{droppableContainer:s,value:l}})}}return o.sort(Mo)};function Fo(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function Un(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:be}function zo(t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((a,c)=>({...a,top:a.top+t*c.y,bottom:a.bottom+t*c.y,left:a.left+t*c.x,right:a.right+t*c.x}),{...n})}}const Bo=zo(1);function Hn(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function $o(t,e,n){const r=Hn(e);if(!r)return t;const{scaleX:o,scaleY:s,x:a,y:c}=r,l=t.left-a-(1-o)*parseFloat(n),f=t.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?t.width/o:t.width,d=s?t.height/s:t.height;return{width:h,height:d,top:f,right:l+h,bottom:f+d,left:l}}const Vo={ignoreTransform:!1};function ot(t,e){e===void 0&&(e=Vo);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:f,transformOrigin:h}=Q(t).getComputedStyle(t);f&&(n=$o(n,f,h))}const{top:r,left:o,width:s,height:a,bottom:c,right:l}=n;return{top:r,left:o,width:s,height:a,bottom:c,right:l}}function yn(t){return ot(t,{ignoreTransform:!0})}function Xo(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function Ko(t,e){return e===void 0&&(e=Q(t).getComputedStyle(t)),e.position==="fixed"}function Uo(t,e){e===void 0&&(e=Q(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=e[o];return typeof s=="string"?n.test(s):!1})}function Vt(t,e){const n=[];function r(o){if(e!=null&&n.length>=e||!o)return n;if(cn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!yt(o)||zn(o)||n.includes(o))return n;const s=Q(t).getComputedStyle(o);return o!==t&&Uo(o,s)&&n.push(o),Ko(o,s)?n:r(o.parentNode)}return t?r(t):n}function Yn(t){const[e]=Vt(t,1);return e??null}function en(t){return!zt||!t?null:nt(t)?t:an(t)?cn(t)||t===rt(t).scrollingElement?window:yt(t)?t:null:null}function Wn(t){return nt(t)?t.scrollX:t.scrollLeft}function qn(t){return nt(t)?t.scrollY:t.scrollTop}function rn(t){return{x:Wn(t),y:qn(t)}}var K;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(K||(K={}));function Gn(t){return!zt||!t?!1:t===document.scrollingElement}function Jn(t){const e={x:0,y:0},n=Gn(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},o=t.scrollTop<=e.y,s=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,c=t.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:a,isRight:c,maxScroll:r,minScroll:e}}const Ho={x:.2,y:.2};function Yo(t,e,n,r,o){let{top:s,left:a,right:c,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=Ho);const{isTop:f,isBottom:h,isLeft:d,isRight:g}=Jn(t),m={x:0,y:0},N={x:0,y:0},x={height:e.height*o.y,width:e.width*o.x};return!f&&s<=e.top+x.height?(m.y=K.Backward,N.y=r*Math.abs((e.top+x.height-s)/x.height)):!h&&l>=e.bottom-x.height&&(m.y=K.Forward,N.y=r*Math.abs((e.bottom-x.height-l)/x.height)),!g&&c>=e.right-x.width?(m.x=K.Forward,N.x=r*Math.abs((e.right-x.width-c)/x.width)):!d&&a<=e.left+x.width&&(m.x=K.Backward,N.x=r*Math.abs((e.left+x.width-a)/x.width)),{direction:m,speed:N}}function Wo(t){if(t===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:e,left:n,right:r,bottom:o}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:o,width:t.clientWidth,height:t.clientHeight}}function Qn(t){return t.reduce((e,n)=>tt(e,rn(n)),be)}function qo(t){return t.reduce((e,n)=>e+Wn(n),0)}function Go(t){return t.reduce((e,n)=>e+qn(n),0)}function Zn(t,e){if(e===void 0&&(e=ot),!t)return;const{top:n,left:r,bottom:o,right:s}=e(t);Yn(t)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Jo=[["x",["left","right"],qo],["y",["top","bottom"],Go]];class ln{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Vt(n),o=Qn(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,a,c]of Jo)for(const l of a)Object.defineProperty(this,l,{get:()=>{const f=c(r),h=o[s]-f;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gt{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var o;(o=this.target)==null||o.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function Qo(t){const{EventTarget:e}=Q(t);return t instanceof e?t:rt(t)}function tn(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var fe;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(fe||(fe={}));function wn(t){t.preventDefault()}function Zo(t){t.stopPropagation()}var _;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(_||(_={}));const er={start:[_.Space,_.Enter],cancel:[_.Esc],end:[_.Space,_.Enter,_.Tab]},es=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case _.Right:return{...n,x:n.x+25};case _.Left:return{...n,x:n.x-25};case _.Down:return{...n,y:n.y+25};case _.Up:return{...n,y:n.y-25}}};class tr{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new gt(rt(n)),this.windowListeners=new gt(Q(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&Zn(r),n(be)}handleKeyDown(e){if($t(e)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=er,coordinateGetter:a=es,scrollBehavior:c="smooth"}=o,{code:l}=e;if(s.end.includes(l)){this.handleEnd(e);return}if(s.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:f}=r.current,h=f?{x:f.left,y:f.top}:be;this.referenceCoordinates||(this.referenceCoordinates=h);const d=a(e,{active:n,context:r.current,currentCoordinates:h});if(d){const g=bt(d,h),m={x:0,y:0},{scrollableAncestors:N}=r.current;for(const x of N){const v=e.code,{isTop:R,isRight:C,isLeft:S,isBottom:j,maxScroll:T,minScroll:A}=Jn(x),p=Wo(x),y={x:Math.min(v===_.Right?p.right-p.width/2:p.right,Math.max(v===_.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(v===_.Down?p.bottom-p.height/2:p.bottom,Math.max(v===_.Down?p.top:p.top+p.height/2,d.y))},b=v===_.Right&&!C||v===_.Left&&!S,w=v===_.Down&&!j||v===_.Up&&!R;if(b&&y.x!==d.x){const I=x.scrollLeft+g.x,O=v===_.Right&&I<=T.x||v===_.Left&&I>=A.x;if(O&&!g.y){x.scrollTo({left:I,behavior:c});return}O?m.x=x.scrollLeft-I:m.x=v===_.Right?x.scrollLeft-T.x:x.scrollLeft-A.x,m.x&&x.scrollBy({left:-m.x,behavior:c});break}else if(w&&y.y!==d.y){const I=x.scrollTop+g.y,O=v===_.Down&&I<=T.y||v===_.Up&&I>=A.y;if(O&&!g.x){x.scrollTo({top:I,behavior:c});return}O?m.y=x.scrollTop-I:m.y=v===_.Down?x.scrollTop-T.y:x.scrollTop-A.y,m.y&&x.scrollBy({top:-m.y,behavior:c});break}}this.handleMove(e,tt(bt(d,this.referenceCoordinates),m))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}tr.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=er,onActivation:o}=e,{active:s}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const c=s.activatorNode.current;return c&&t.target!==c?!1:(t.preventDefault(),o?.({event:t.nativeEvent}),!0)}return!1}}];function Cn(t){return!!(t&&"distance"in t)}function Sn(t){return!!(t&&"delay"in t)}class dn{constructor(e,n,r){var o;r===void 0&&(r=Qo(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:s}=e,{target:a}=s;this.props=e,this.events=n,this.document=rt(a),this.documentListeners=new gt(this.document),this.listeners=new gt(r),this.windowListeners=new gt(Q(a)),this.initialCoordinates=(o=Mt(s))!=null?o:be,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,wn),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,wn),this.documentListeners.add(fe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Sn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Cn(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:o}=this.props;o(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(fe.Click,Zo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fe.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:c}}=s;if(!o)return;const l=(n=Mt(e))!=null?n:be,f=bt(o,l);if(!r&&c){if(Cn(c)){if(c.tolerance!=null&&tn(f,c.tolerance))return this.handleCancel();if(tn(f,c.distance))return this.handleStart()}if(Sn(c)&&tn(f,c.tolerance))return this.handleCancel();this.handlePending(c,f);return}e.cancelable&&e.preventDefault(),a(l)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===_.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const ts={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class nr extends dn{constructor(e){const{event:n}=e,r=rt(n.target);super(e,ts,r)}}nr.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const ns={move:{name:"mousemove"},end:{name:"mouseup"}};var on;(function(t){t[t.RightClick=2]="RightClick"})(on||(on={}));class rs extends dn{constructor(e){super(e,ns,rt(e.event.target))}}rs.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===on.RightClick?!1:(r?.({event:n}),!0)}}];const nn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class os extends dn{constructor(e){super(e,nn)}static setup(){return window.addEventListener(nn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(nn.move.name,e)};function e(){}}}os.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var pt;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(pt||(pt={}));var Pt;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Pt||(Pt={}));function ss(t){let{acceleration:e,activator:n=pt.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:c=Pt.TreeOrder,pointerCoordinates:l,scrollableAncestors:f,scrollableAncestorRects:h,delta:d,threshold:g}=t;const m=as({delta:d,disabled:!s}),[N,x]=yo(),v=u.useRef({x:0,y:0}),R=u.useRef({x:0,y:0}),C=u.useMemo(()=>{switch(n){case pt.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case pt.DraggableRect:return o}},[n,o,l]),S=u.useRef(null),j=u.useCallback(()=>{const A=S.current;if(!A)return;const p=v.current.x*R.current.x,y=v.current.y*R.current.y;A.scrollBy(p,y)},[]),T=u.useMemo(()=>c===Pt.TreeOrder?[...f].reverse():f,[c,f]);u.useEffect(()=>{if(!s||!f.length||!C){x();return}for(const A of T){if(r?.(A)===!1)continue;const p=f.indexOf(A),y=h[p];if(!y)continue;const{direction:b,speed:w}=Yo(A,y,C,e,g);for(const I of["x","y"])m[I][b[I]]||(w[I]=0,b[I]=0);if(w.x>0||w.y>0){x(),S.current=A,N(j,a),v.current=w,R.current=b;return}}v.current={x:0,y:0},R.current={x:0,y:0},x()},[e,j,r,x,s,a,JSON.stringify(C),JSON.stringify(m),N,f,T,h,JSON.stringify(g)])}const is={x:{[K.Backward]:!1,[K.Forward]:!1},y:{[K.Backward]:!1,[K.Forward]:!1}};function as(t){let{delta:e,disabled:n}=t;const r=kt(e);return wt(o=>{if(n||!r||!o)return is;const s={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[K.Backward]:o.x[K.Backward]||s.x===-1,[K.Forward]:o.x[K.Forward]||s.x===1},y:{[K.Backward]:o.y[K.Backward]||s.y===-1,[K.Forward]:o.y[K.Forward]||s.y===1}}},[n,e,r])}function cs(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return wt(o=>{var s;return e==null?null:(s=r??o)!=null?s:null},[r,e])}function ls(t,e){return u.useMemo(()=>t.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...s]},[]),[t,e])}var xt;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(xt||(xt={}));var sn;(function(t){t.Optimized="optimized"})(sn||(sn={}));const Dn=new Map;function ds(t,e){let{dragging:n,dependencies:r,config:o}=e;const[s,a]=u.useState(null),{frequency:c,measure:l,strategy:f}=o,h=u.useRef(t),d=v(),g=mt(d),m=u.useCallback(function(R){R===void 0&&(R=[]),!g.current&&a(C=>C===null?R:C.concat(R.filter(S=>!C.includes(S))))},[g]),N=u.useRef(null),x=wt(R=>{if(d&&!n)return Dn;if(!R||R===Dn||h.current!==t||s!=null){const C=new Map;for(let S of t){if(!S)continue;if(s&&s.length>0&&!s.includes(S.id)&&S.rect.current){C.set(S.id,S.rect.current);continue}const j=S.node.current,T=j?new ln(l(j),j):null;S.rect.current=T,T&&C.set(S.id,T)}return C}return R},[t,s,n,d,l]);return u.useEffect(()=>{h.current=t},[t]),u.useEffect(()=>{d||m()},[n,d]),u.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),u.useEffect(()=>{d||typeof c!="number"||N.current!==null||(N.current=setTimeout(()=>{m(),N.current=null},c))},[c,d,m,...r]),{droppableRects:x,measureDroppableContainers:m,measuringScheduled:s!=null};function v(){switch(f){case xt.Always:return!1;case xt.BeforeDragging:return n;default:return!n}}}function un(t,e){return wt(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function us(t,e){return un(t,e)}function fs(t){let{callback:e,disabled:n}=t;const r=Bt(e),o=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return u.useEffect(()=>()=>o?.disconnect(),[o]),o}function Xt(t){let{callback:e,disabled:n}=t;const r=Bt(e),o=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return u.useEffect(()=>()=>o?.disconnect(),[o]),o}function hs(t){return new ln(ot(t),t)}function Rn(t,e,n){e===void 0&&(e=hs);const[r,o]=u.useState(null);function s(){o(l=>{if(!t)return null;if(t.isConnected===!1){var f;return(f=l??n)!=null?f:null}const h=e(t);return JSON.stringify(l)===JSON.stringify(h)?l:h})}const a=fs({callback(l){if(t)for(const f of l){const{type:h,target:d}=f;if(h==="childList"&&d instanceof HTMLElement&&d.contains(t)){s();break}}}}),c=Xt({callback:s});return me(()=>{s(),t?(c?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),a?.disconnect())},[t]),r}function gs(t){const e=un(t);return Un(t,e)}const jn=[];function ps(t){const e=u.useRef(t),n=wt(r=>t?r&&r!==jn&&t&&e.current&&t.parentNode===e.current.parentNode?r:Vt(t):jn,[t]);return u.useEffect(()=>{e.current=t},[t]),n}function vs(t){const[e,n]=u.useState(null),r=u.useRef(t),o=u.useCallback(s=>{const a=en(s.target);a&&n(c=>c?(c.set(a,rn(a)),new Map(c)):null)},[]);return u.useEffect(()=>{const s=r.current;if(t!==s){a(s);const c=t.map(l=>{const f=en(l);return f?(f.addEventListener("scroll",o,{passive:!0}),[f,rn(f)]):null}).filter(l=>l!=null);n(c.length?new Map(c):null),r.current=t}return()=>{a(t),a(s)};function a(c){c.forEach(l=>{const f=en(l);f?.removeEventListener("scroll",o)})}},[o,t]),u.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,a)=>tt(s,a),be):Qn(t):be,[t,e])}function Nn(t,e){e===void 0&&(e=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},e),u.useEffect(()=>{const r=t!==be;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?bt(t,n.current):be}function ms(t){u.useEffect(()=>{if(!zt)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function bs(t,e){return u.useMemo(()=>t.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=a=>{s(a,e)},n},{}),[t,e])}function rr(t){return u.useMemo(()=>t?Xo(t):null,[t])}const In=[];function xs(t,e){e===void 0&&(e=ot);const[n]=t,r=rr(n?Q(n):null),[o,s]=u.useState(In);function a(){s(()=>t.length?t.map(l=>Gn(l)?r:new ln(e(l),l)):In)}const c=Xt({callback:a});return me(()=>{c?.disconnect(),a(),t.forEach(l=>c?.observe(l))},[t]),o}function or(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return yt(e)?e:t}function ys(t){let{measure:e}=t;const[n,r]=u.useState(null),o=u.useCallback(f=>{for(const{target:h}of f)if(yt(h)){r(d=>{const g=e(h);return d?{...d,width:g.width,height:g.height}:g});break}},[e]),s=Xt({callback:o}),a=u.useCallback(f=>{const h=or(f);s?.disconnect(),h&&s?.observe(h),r(h?e(h):null)},[e,s]),[c,l]=_t(a);return u.useMemo(()=>({nodeRef:c,rect:n,setRef:l}),[n,c,l])}const ws=[{sensor:nr,options:{}},{sensor:tr,options:{}}],Cs={current:{}},Tt={draggable:{measure:yn},droppable:{measure:yn,strategy:xt.WhileDragging,frequency:sn.Optimized},dragOverlay:{measure:ot}};class vt extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const Ss={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ot},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Tt,measureDroppableContainers:Ot,windowRect:null,measuringScheduled:!1},sr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ot,draggableNodes:new Map,over:null,measureDroppableContainers:Ot},St=u.createContext(sr),ir=u.createContext(Ss);function Ds(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vt}}}function Rs(t,e){switch(e.type){case V.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case V.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case V.DragEnd:case V.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case V.RegisterDroppable:{const{element:n}=e,{id:r}=n,o=new vt(t.droppable.containers);return o.set(r,n),{...t,droppable:{...t.droppable,containers:o}}}case V.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const a=new vt(t.droppable.containers);return a.set(n,{...s,disabled:o}),{...t,droppable:{...t.droppable,containers:a}}}case V.UnregisterDroppable:{const{id:n,key:r}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const s=new vt(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function js(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:o}=u.useContext(St),s=kt(r),a=kt(n?.id);return u.useEffect(()=>{if(!e&&!r&&s&&a!=null){if(!$t(s)||document.activeElement===s.target)return;const c=o.get(a);if(!c)return;const{activatorNode:l,node:f}=c;if(!l.current&&!f.current)return;requestAnimationFrame(()=>{for(const h of[l.current,f.current]){if(!h)continue;const d=So(h);if(d){d.focus();break}}})}},[r,e,o,a,s]),null}function ar(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((o,s)=>s({transform:o,...r}),n):n}function Ns(t){return u.useMemo(()=>({draggable:{...Tt.draggable,...t?.draggable},droppable:{...Tt.droppable,...t?.droppable},dragOverlay:{...Tt.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Is(t){let{activeNode:e,measure:n,initialRect:r,config:o=!0}=t;const s=u.useRef(!1),{x:a,y:c}=typeof o=="boolean"?{x:o,y:o}:o;me(()=>{if(!a&&!c||!e){s.current=!1;return}if(s.current||!r)return;const f=e?.node.current;if(!f||f.isConnected===!1)return;const h=n(f),d=Un(h,r);if(a||(d.x=0),c||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const g=Yn(f);g&&g.scrollBy({top:d.y,left:d.x})}},[e,a,c,r,n])}const Kt=u.createContext({...be,scaleX:1,scaleY:1});var Ke;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ke||(Ke={}));const Yi=u.memo(function(e){var n,r,o,s;let{id:a,accessibility:c,autoScroll:l=!0,children:f,sensors:h=ws,collisionDetection:d=Lo,measuring:g,modifiers:m,...N}=e;const x=u.useReducer(Rs,void 0,Ds),[v,R]=x,[C,S]=Ao(),[j,T]=u.useState(Ke.Uninitialized),A=j===Ke.Initialized,{draggable:{active:p,nodes:y,translate:b},droppable:{containers:w}}=v,I=p!=null?y.get(p):null,O=u.useRef({initial:null,translated:null}),k=u.useMemo(()=>{var F;return p!=null?{id:p,data:(F=I?.data)!=null?F:Cs,rect:O}:null},[p,I]),E=u.useRef(null),[B,ae]=u.useState(null),[X,Y]=u.useState(null),ce=mt(N,Object.values(N)),xe=Ct("DndDescribedBy",a),qe=u.useMemo(()=>w.getEnabled(),[w]),$=Ns(g),{droppableRects:U,measureDroppableContainers:he,measuringScheduled:Ae}=ds(qe,{dragging:A,dependencies:[b.x,b.y],config:$.droppable}),L=cs(y,p),Ue=u.useMemo(()=>X?Mt(X):null,[X]),Z=te(),W=us(L,$.draggable.measure);Is({activeNode:p!=null?y.get(p):null,config:Z.layoutShiftCompensation,initialRect:W,measure:$.draggable.measure});const M=Rn(L,$.draggable.measure,W),Ee=Rn(L?L.parentElement:null),q=u.useRef({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:w,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=w.getNodeFor((n=q.current.over)==null?void 0:n.id),ee=ys({measure:$.dragOverlay.measure}),Te=(r=ee.nodeRef.current)!=null?r:L,ye=A?(o=ee.rect)!=null?o:M:null,Ge=!!(ee.nodeRef.current&&ee.rect),_e=gs(Ge?null:M),st=rr(Te?Q(Te):null),ne=ps(A?ge??L:null),Fe=xs(ne),pe=ar(m,{transform:{x:b.x-_e.x,y:b.y-_e.y,scaleX:1,scaleY:1},activatorEvent:X,active:k,activeNodeRect:M,containerNodeRect:Ee,draggingNodeRect:ye,over:q.current.over,overlayNodeRect:ee.rect,scrollableAncestors:ne,scrollableAncestorRects:Fe,windowRect:st}),ke=Ue?tt(Ue,b):null,Je=vs(ne),it=Nn(Je),at=Nn(Je,[M]),we=tt(pe,it),re=ye?Bo(ye,pe):null,le=k&&re?d({active:k,collisionRect:re,droppableRects:U,droppableContainers:qe,pointerCoordinates:ke}):null,Me=Kn(le,"id"),[G,Oe]=u.useState(null),Qe=Ge?pe:tt(pe,at),D=Fo(Qe,(s=G?.rect)!=null?s:null,M),P=u.useRef(null),de=u.useCallback((F,oe)=>{let{sensor:se,options:$e}=oe;if(E.current==null)return;const ue=y.get(E.current);if(!ue)return;const ie=F.nativeEvent,Ce=new se({active:E.current,activeNode:ue,event:ie,options:$e,context:q,onAbort(H){if(!y.get(H))return;const{onDragAbort:Se}=ce.current,Pe={id:H};Se?.(Pe),C({type:"onDragAbort",event:Pe})},onPending(H,Ve,Se,Pe){if(!y.get(H))return;const{onDragPending:lt}=ce.current,Xe={id:H,constraint:Ve,initialCoordinates:Se,offset:Pe};lt?.(Xe),C({type:"onDragPending",event:Xe})},onStart(H){const Ve=E.current;if(Ve==null)return;const Se=y.get(Ve);if(!Se)return;const{onDragStart:Pe}=ce.current,ct={activatorEvent:ie,active:{id:Ve,data:Se.data,rect:O}};ft.unstable_batchedUpdates(()=>{Pe?.(ct),T(Ke.Initializing),R({type:V.DragStart,initialCoordinates:H,active:Ve}),C({type:"onDragStart",event:ct}),ae(P.current),Y(ie)})},onMove(H){R({type:V.DragMove,coordinates:H})},onEnd:et(V.DragEnd),onCancel:et(V.DragCancel)});P.current=Ce;function et(H){return async function(){const{active:Se,collisions:Pe,over:ct,scrollAdjustedTranslate:lt}=q.current;let Xe=null;if(Se&&lt){const{cancelDrop:dt}=ce.current;Xe={activatorEvent:ie,active:Se,collisions:Pe,delta:lt,over:ct},H===V.DragEnd&&typeof dt=="function"&&await Promise.resolve(dt(Xe))&&(H=V.DragCancel)}E.current=null,ft.unstable_batchedUpdates(()=>{R({type:H}),T(Ke.Uninitialized),Oe(null),ae(null),Y(null),P.current=null;const dt=H===V.DragEnd?"onDragEnd":"onDragCancel";if(Xe){const Ut=ce.current[dt];Ut?.(Xe),C({type:dt,event:Xe})}})}}},[y]),ze=u.useCallback((F,oe)=>(se,$e)=>{const ue=se.nativeEvent,ie=y.get($e);if(E.current!==null||!ie||ue.dndKit||ue.defaultPrevented)return;const Ce={active:ie};F(se,oe.options,Ce)===!0&&(ue.dndKit={capturedBy:oe.sensor},E.current=$e,de(se,oe))},[y,de]),ve=ls(h,ze);ms(h),me(()=>{M&&j===Ke.Initializing&&T(Ke.Initialized)},[M,j]),u.useEffect(()=>{const{onDragMove:F}=ce.current,{active:oe,activatorEvent:se,collisions:$e,over:ue}=q.current;if(!oe||!se)return;const ie={active:oe,activatorEvent:se,collisions:$e,delta:{x:we.x,y:we.y},over:ue};ft.unstable_batchedUpdates(()=>{F?.(ie),C({type:"onDragMove",event:ie})})},[we.x,we.y]),u.useEffect(()=>{const{active:F,activatorEvent:oe,collisions:se,droppableContainers:$e,scrollAdjustedTranslate:ue}=q.current;if(!F||E.current==null||!oe||!ue)return;const{onDragOver:ie}=ce.current,Ce=$e.get(Me),et=Ce&&Ce.rect.current?{id:Ce.id,rect:Ce.rect.current,data:Ce.data,disabled:Ce.disabled}:null,H={active:F,activatorEvent:oe,collisions:se,delta:{x:ue.x,y:ue.y},over:et};ft.unstable_batchedUpdates(()=>{Oe(et),ie?.(H),C({type:"onDragOver",event:H})})},[Me]),me(()=>{q.current={activatorEvent:X,active:k,activeNode:L,collisionRect:re,collisions:le,droppableRects:U,draggableNodes:y,draggingNode:Te,draggingNodeRect:ye,droppableContainers:w,over:G,scrollableAncestors:ne,scrollAdjustedTranslate:we},O.current={initial:ye,translated:re}},[k,L,le,re,y,Te,ye,U,w,G,ne,we]),ss({...Z,delta:b,draggingRect:re,pointerCoordinates:ke,scrollableAncestors:ne,scrollableAncestorRects:Fe});const Ze=u.useMemo(()=>({active:k,activeNode:L,activeNodeRect:M,activatorEvent:X,collisions:le,containerNodeRect:Ee,dragOverlay:ee,draggableNodes:y,droppableContainers:w,droppableRects:U,over:G,measureDroppableContainers:he,scrollableAncestors:ne,scrollableAncestorRects:Fe,measuringConfiguration:$,measuringScheduled:Ae,windowRect:st}),[k,L,M,X,le,Ee,ee,y,w,U,G,he,ne,Fe,$,Ae,st]),Be=u.useMemo(()=>({activatorEvent:X,activators:ve,active:k,activeNodeRect:M,ariaDescribedById:{draggable:xe},dispatch:R,draggableNodes:y,over:G,measureDroppableContainers:he}),[X,ve,k,M,R,xe,y,G,he]);return z.createElement($n.Provider,{value:S},z.createElement(St.Provider,{value:Be},z.createElement(ir.Provider,{value:Ze},z.createElement(Kt.Provider,{value:D},f)),z.createElement(js,{disabled:c?.restoreFocus===!1})),z.createElement(_o,{...c,hiddenTextDescribedById:xe}));function te(){const F=B?.autoScrollEnabled===!1,oe=typeof l=="object"?l.enabled===!1:l===!1,se=A&&!F&&!oe;return typeof l=="object"?{...l,enabled:se}:{enabled:se}}}),As=u.createContext(null),An="button",Es="Draggable";function Ts(t){let{id:e,data:n,disabled:r=!1,attributes:o}=t;const s=Ct(Es),{activators:a,activatorEvent:c,active:l,activeNodeRect:f,ariaDescribedById:h,draggableNodes:d,over:g}=u.useContext(St),{role:m=An,roleDescription:N="draggable",tabIndex:x=0}=o??{},v=l?.id===e,R=u.useContext(v?Kt:As),[C,S]=_t(),[j,T]=_t(),A=bs(a,e),p=mt(n);me(()=>(d.set(e,{id:e,key:s,node:C,activatorNode:j,data:p}),()=>{const b=d.get(e);b&&b.key===s&&d.delete(e)}),[d,e]);const y=u.useMemo(()=>({role:m,tabIndex:x,"aria-disabled":r,"aria-pressed":v&&m===An?!0:void 0,"aria-roledescription":N,"aria-describedby":h.draggable}),[r,m,x,v,N,h.draggable]);return{active:l,activatorEvent:c,activeNodeRect:f,attributes:y,isDragging:v,listeners:r?void 0:A,node:C,over:g,setNodeRef:S,setActivatorNodeRef:T,transform:R}}function cr(){return u.useContext(ir)}const _s="Droppable",ks={timeout:25};function Ms(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:o}=t;const s=Ct(_s),{active:a,dispatch:c,over:l,measureDroppableContainers:f}=u.useContext(St),h=u.useRef({disabled:n}),d=u.useRef(!1),g=u.useRef(null),m=u.useRef(null),{disabled:N,updateMeasurementsFor:x,timeout:v}={...ks,...o},R=mt(x??r),C=u.useCallback(()=>{if(!d.current){d.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{f(Array.isArray(R.current)?R.current:[R.current]),m.current=null},v)},[v]),S=Xt({callback:C,disabled:N||!a}),j=u.useCallback((y,b)=>{S&&(b&&(S.unobserve(b),d.current=!1),y&&S.observe(y))},[S]),[T,A]=_t(j),p=mt(e);return u.useEffect(()=>{!S||!T.current||(S.disconnect(),d.current=!1,S.observe(T.current))},[T,S]),u.useEffect(()=>(c({type:V.RegisterDroppable,element:{id:r,key:s,disabled:n,node:T,rect:g,data:p}}),()=>c({type:V.UnregisterDroppable,key:s,id:r})),[r]),u.useEffect(()=>{n!==h.current.disabled&&(c({type:V.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,c]),{active:a,rect:g,isOver:l?.id===r,node:T,over:l,setNodeRef:A}}function Os(t){let{animation:e,children:n}=t;const[r,o]=u.useState(null),[s,a]=u.useState(null),c=kt(n);return!n&&!r&&c&&o(c),me(()=>{if(!s)return;const l=r?.key,f=r?.props.id;if(l==null||f==null){o(null);return}Promise.resolve(e(f,s)).then(()=>{o(null)})},[e,r,s]),z.createElement(z.Fragment,null,n,r?u.cloneElement(r,{ref:a}):null)}const Ps={x:0,y:0,scaleX:1,scaleY:1};function Ls(t){let{children:e}=t;return z.createElement(St.Provider,{value:sr},z.createElement(Kt.Provider,{value:Ps},e))}const Fs={position:"fixed",touchAction:"none"},zs=t=>$t(t)?"transform 250ms ease":void 0,Bs=u.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:a,rect:c,style:l,transform:f,transition:h=zs}=t;if(!c)return null;const d=o?f:{...f,scaleX:1,scaleY:1},g={...Fs,width:c.width,height:c.height,top:c.top,left:c.left,transform:We.Transform.toString(d),transformOrigin:o&&r?ko(r,c):void 0,transition:typeof h=="function"?h(r):h,...l};return z.createElement(n,{className:a,style:g,ref:e},s)}),$s=t=>e=>{let{active:n,dragOverlay:r}=e;const o={},{styles:s,className:a}=t;if(s!=null&&s.active)for(const[c,l]of Object.entries(s.active))l!==void 0&&(o[c]=n.node.style.getPropertyValue(c),n.node.style.setProperty(c,l));if(s!=null&&s.dragOverlay)for(const[c,l]of Object.entries(s.dragOverlay))l!==void 0&&r.node.style.setProperty(c,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,f]of Object.entries(o))n.node.style.setProperty(l,f);a!=null&&a.active&&n.node.classList.remove(a.active)}},Vs=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:We.Transform.toString(e)},{transform:We.Transform.toString(n)}]},Xs={duration:250,easing:"ease",keyframes:Vs,sideEffects:$s({styles:{active:{opacity:"0"}}})};function Ks(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=t;return Bt((s,a)=>{if(e===null)return;const c=n.get(s);if(!c)return;const l=c.node.current;if(!l)return;const f=or(a);if(!f)return;const{transform:h}=Q(a).getComputedStyle(a),d=Hn(h);if(!d)return;const g=typeof e=="function"?e:Us(e);return Zn(l,o.draggable.measure),g({active:{id:s,data:c.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:o.dragOverlay.measure(f)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function Us(t){const{duration:e,easing:n,sideEffects:r,keyframes:o}={...Xs,...t};return s=>{let{active:a,dragOverlay:c,transform:l,...f}=s;if(!e)return;const h={x:c.rect.left-a.rect.left,y:c.rect.top-a.rect.top},d={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/c.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/c.rect.height:1},g={x:l.x-h.x,y:l.y-h.y,...d},m=o({...f,active:a,dragOverlay:c,transform:{initial:l,final:g}}),[N]=m,x=m[m.length-1];if(JSON.stringify(N)===JSON.stringify(x))return;const v=r?.({active:a,dragOverlay:c,...f}),R=c.node.animate(m,{duration:e,easing:n,fill:"forwards"});return new Promise(C=>{R.onfinish=()=>{v?.(),C()}})}}let En=0;function Hs(t){return u.useMemo(()=>{if(t!=null)return En++,En},[t])}const Wi=z.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:a,wrapperElement:c="div",className:l,zIndex:f=999}=t;const{activatorEvent:h,active:d,activeNodeRect:g,containerNodeRect:m,draggableNodes:N,droppableContainers:x,dragOverlay:v,over:R,measuringConfiguration:C,scrollableAncestors:S,scrollableAncestorRects:j,windowRect:T}=cr(),A=u.useContext(Kt),p=Hs(d?.id),y=ar(a,{activatorEvent:h,active:d,activeNodeRect:g,containerNodeRect:m,draggingNodeRect:v.rect,over:R,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:j,transform:A,windowRect:T}),b=un(g),w=Ks({config:r,draggableNodes:N,droppableContainers:x,measuringConfiguration:C}),I=b?v.setRef:void 0;return z.createElement(Ls,null,z.createElement(Os,{animation:w},d&&p?z.createElement(Bs,{key:p,id:d.id,ref:I,as:c,activatorEvent:h,adjustScale:e,className:l,transition:s,rect:b,style:{zIndex:f,...o},transform:y},n):null))});function lr(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function Ys(t,e){return t.reduce((n,r,o)=>{const s=e.get(r);return s&&(n[o]=s),n},Array(t.length))}function jt(t){return t!==null&&t>=0}function Ws(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function qs(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Nt={scaleX:1,scaleY:1},qi=t=>{var e;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:a}=t;const c=(e=n[o])!=null?e:r;if(!c)return null;const l=Gs(n,a,o);if(a===o){const f=n[s];return f?{x:o<s?f.left+f.width-(c.left+c.width):f.left-c.left,y:0,...Nt}:null}return a>o&&a<=s?{x:-c.width-l,y:0,...Nt}:a<o&&a>=s?{x:c.width+l,y:0,...Nt}:{x:0,y:0,...Nt}};function Gs(t,e,n){const r=t[e],o=t[e-1],s=t[e+1];return!r||!o&&!s?0:n<e?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const dr=t=>{let{rects:e,activeIndex:n,overIndex:r,index:o}=t;const s=lr(e,r,n),a=e[o],c=s[o];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},It={scaleX:1,scaleY:1},Gi=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:a}=t;const c=(e=s[n])!=null?e:r;if(!c)return null;if(o===n){const f=s[a];return f?{x:0,y:n<a?f.top+f.height-(c.top+c.height):f.top-c.top,...It}:null}const l=Js(s,o,n);return o>n&&o<=a?{x:0,y:-c.height-l,...It}:o<n&&o>=a?{x:0,y:c.height+l,...It}:{x:0,y:0,...It}};function Js(t,e,n){const r=t[e],o=t[e-1],s=t[e+1];return r?n<e?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const ur="Sortable",fr=z.createContext({activeIndex:-1,containerId:ur,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dr,disabled:{draggable:!1,droppable:!1}});function Ji(t){let{children:e,id:n,items:r,strategy:o=dr,disabled:s=!1}=t;const{active:a,dragOverlay:c,droppableRects:l,over:f,measureDroppableContainers:h}=cr(),d=Ct(ur,n),g=c.rect!==null,m=u.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),N=a!=null,x=a?m.indexOf(a.id):-1,v=f?m.indexOf(f.id):-1,R=u.useRef(m),C=!Ws(m,R.current),S=v!==-1&&x===-1||C,j=qs(s);me(()=>{C&&N&&h(m)},[C,m,N,h]),u.useEffect(()=>{R.current=m},[m]);const T=u.useMemo(()=>({activeIndex:x,containerId:d,disabled:j,disableTransforms:S,items:m,overIndex:v,useDragOverlay:g,sortedRects:Ys(m,l),strategy:o}),[x,d,j.draggable,j.droppable,S,m,v,l,g,o]);return z.createElement(fr.Provider,{value:T},e)}const Qs=t=>{let{id:e,items:n,activeIndex:r,overIndex:o}=t;return lr(n,r,o).indexOf(e)},Zs=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:o,items:s,newIndex:a,previousItems:c,previousContainerId:l,transition:f}=t;return!f||!r||c!==s&&o===a?!1:n?!0:a!==o&&e===l},ei={duration:200,easing:"ease"},hr="transform",ti=We.Transition.toString({property:hr,duration:0,easing:"linear"}),ni={roleDescription:"sortable"};function ri(t){let{disabled:e,index:n,node:r,rect:o}=t;const[s,a]=u.useState(null),c=u.useRef(n);return me(()=>{if(!e&&n!==c.current&&r.current){const l=o.current;if(l){const f=ot(r.current,{ignoreTransform:!0}),h={x:l.left-f.left,y:l.top-f.top,scaleX:l.width/f.width,scaleY:l.height/f.height};(h.x||h.y)&&a(h)}}n!==c.current&&(c.current=n)},[e,n,r,o]),u.useEffect(()=>{s&&a(null)},[s]),s}function Qi(t){let{animateLayoutChanges:e=Zs,attributes:n,disabled:r,data:o,getNewIndex:s=Qs,id:a,strategy:c,resizeObserverConfig:l,transition:f=ei}=t;const{items:h,containerId:d,activeIndex:g,disabled:m,disableTransforms:N,sortedRects:x,overIndex:v,useDragOverlay:R,strategy:C}=u.useContext(fr),S=oi(r,m),j=h.indexOf(a),T=u.useMemo(()=>({sortable:{containerId:d,index:j,items:h},...o}),[d,o,j,h]),A=u.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:p,node:y,isOver:b,setNodeRef:w}=Ms({id:a,data:T,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...l}}),{active:I,activatorEvent:O,activeNodeRect:k,attributes:E,setNodeRef:B,listeners:ae,isDragging:X,over:Y,setActivatorNodeRef:ce,transform:xe}=Ts({id:a,data:T,attributes:{...ni,...n},disabled:S.draggable}),qe=xo(w,B),$=!!I,U=$&&!N&&jt(g)&&jt(v),he=!R&&X,Ae=he&&U?xe:null,Ue=U?Ae??(c??C)({rects:x,activeNodeRect:k,activeIndex:g,overIndex:v,index:j}):null,Z=jt(g)&&jt(v)?s({id:a,items:h,activeIndex:g,overIndex:v}):j,W=I?.id,M=u.useRef({activeId:W,items:h,newIndex:Z,containerId:d}),Ee=h!==M.current.items,q=e({active:I,containerId:d,isDragging:X,isSorting:$,id:a,index:j,items:h,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:f,wasDragging:M.current.activeId!=null}),ge=ri({disabled:!q,index:j,node:y,rect:p});return u.useEffect(()=>{$&&M.current.newIndex!==Z&&(M.current.newIndex=Z),d!==M.current.containerId&&(M.current.containerId=d),h!==M.current.items&&(M.current.items=h)},[$,Z,d,h]),u.useEffect(()=>{if(W===M.current.activeId)return;if(W!=null&&M.current.activeId==null){M.current.activeId=W;return}const Te=setTimeout(()=>{M.current.activeId=W},50);return()=>clearTimeout(Te)},[W]),{active:I,activeIndex:g,attributes:E,data:T,rect:p,index:j,newIndex:Z,items:h,isOver:b,isSorting:$,isDragging:X,listeners:ae,node:y,overIndex:v,over:Y,setNodeRef:qe,setActivatorNodeRef:ce,setDroppableNodeRef:w,setDraggableNodeRef:B,transform:ge??Ue,transition:ee()};function ee(){if(ge||Ee&&M.current.newIndex===j)return ti;if(!(he&&!$t(O)||!f)&&($||q))return We.Transition.toString({...f,property:hr})}}function oi(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function Lt(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const si=[_.Down,_.Right,_.Up,_.Left],Zi=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:a,scrollableAncestors:c}}=e;if(si.includes(t.code)){if(t.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const g=o.get(d.id);if(g)switch(t.code){case _.Down:r.top<g.top&&l.push(d);break;case _.Up:r.top>g.top&&l.push(d);break;case _.Left:r.left>g.left&&l.push(d);break;case _.Right:r.left<g.left&&l.push(d);break}});const f=Oo({collisionRect:r,droppableRects:o,droppableContainers:l});let h=Kn(f,"id");if(h===a?.id&&f.length>1&&(h=f[1].id),h!=null){const d=s.get(n.id),g=s.get(h),m=g?o.get(g.id):null,N=g?.node.current;if(N&&m&&d&&g){const v=Vt(N).some((A,p)=>c[p]!==A),R=gr(d,g),C=ii(d,g),S=v||!R?{x:0,y:0}:{x:C?r.width-m.width:0,y:C?r.height-m.height:0},j={x:m.left,y:m.top};return S.x&&S.y?j:bt(j,S)}}}};function gr(t,e){return!Lt(t)||!Lt(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function ii(t,e){return!Lt(t)||!Lt(e)||!gr(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}export{Vi as A,We as C,Yi as D,tr as K,nr as P,Ji as S,ao as a,Ui as b,Ki as c,Hi as d,Qi as e,zi as f,Fi as g,$i as h,co as i,Pi as j,Wi as k,lr as l,Bi as m,Li as n,Ts as o,qi as p,Zi as s,Xi as u,Gi as v};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-B9FmRjJz.js","assets/index-j1EmgqV8.js","assets/index-BBz2M403.css","assets/XCircle-B1aV7AX3.js","assets/CheckCircle-DIxU9fNb.js","assets/Settings02-CWsiKyfu.js","assets/use-mcp-client-B1E7Nyjd.js","assets/auth-B9AdzGWs.js","assets/useInfiniteQuery-QT7BExxx.js","assets/use-infinite-scroll-Cs1p0W0X.js","assets/studio-tools-BAmwKCdT.js","assets/badge-Dxlv54DZ.js","assets/input-zUoMTUjz.js","assets/dropdown-menu-OVr8TMr_.js","assets/ChevronUp-DrHOs0IB.js","assets/ChevronRight-Cw6r4eF5.js","assets/DotsVertical-p5cw6bzY.js","assets/table-T8p77nDy.js","assets/toggle-group-r5JjNYaj.js","assets/use-view-mode-pvlDGqxN.js","assets/use-mobile-CWv_pUWp.js","assets/FilterLines-2uX2Gf4U.js","assets/Globe01-D51Pf1ib.js","assets/SearchMd-C5JuA4Q_.js","assets/dialog-Dy6eXpKe.js","assets/X-D1lT84o6.js","assets/AlertCircle-B7YwjVuv.js","assets/Upload01-DvSZDpgm.js","assets/alert-dialog-Dv-S36Xs.js","assets/card-Dt5JuJj0.js","assets/Trash01-C3HJx9Eu.js","assets/label-DIdfff7-.js","assets/select-svPYG6Bw.js","assets/tooltip-D2IcwsrW.js","assets/ChevronDown-D7t2IbgZ.js","assets/switch-CjEoRRuC.js","assets/textarea-BrxTK711.js","assets/checkbox-D5qKxHwE.js","assets/Eye-CPb9WDyf.js","assets/LinkExternal01-Cd3gNz9H.js","assets/use-copy-Dm0W_H8p.js","assets/Key01-B-V8oh6M.js","assets/Plus-DrCr8atg.js","assets/mcp-oauth-iKgiXli9.js","assets/Play-B9WHtGRe.js"])))=>i.map(i=>d[i]);
2
- import{c as m,b as n,e as c,j as t,i as p,r as l,am as f}from"./index-j1EmgqV8.js";import{R as u}from"./require-capability-CehH7jAZ.js";import"./use-capability-BYfWBphf.js";import"./access-gate-BY3tN2ja.js";import"./capability-load-error-CFxZVJfo.js";const g=l.lazy(()=>f(()=>import("./registry-layout-B9FmRjJz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(p,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-Cs1p0W0X.js";import{cJ as i}from"./index-j1EmgqV8.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-Cs1p0W0X.js";import{cJ as u,aC as n}from"./index-j1EmgqV8.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};