decocms 4.82.13 → 4.82.14

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 (276) hide show
  1. package/dist/client/assets/{AlertCircle-B6AELEdc.js → AlertCircle-DvPByT3s.js} +1 -1
  2. package/dist/client/assets/{AreaChart-fCNs67j_.js → AreaChart-BtYig8Ye.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-YK2fJPgi.js → ArrowUp-Dh74oxmM.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BKVLcZTe.js → ArrowUpRight-DC6Yb9Jn.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BfxYbuVE.js → CheckCircle-Be2POQuF.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-CQLSXgt3.js → ChevronDown-BE7JvSpD.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-Fgy0rUS_.js → ChevronRight-4-DNv2jL.js} +1 -1
  8. package/dist/client/assets/ChevronUp-Bwx_DvAp.js +1 -0
  9. package/dist/client/assets/{Copy01-B0CQRE_5.js → Copy01-CaaZXEMR.js} +1 -1
  10. package/dist/client/assets/DotsVertical-hH1ie9LK.js +1 -0
  11. package/dist/client/assets/{Eye-CLtdCpUf.js → Eye-s3MCo34O.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DeiGsRZY.js → FilterLines-B8M_kRrg.js} +1 -1
  13. package/dist/client/assets/{Globe01-B52VKYy7.js → Globe01-BNvAFZ7t.js} +1 -1
  14. package/dist/client/assets/{Globe04-B0las6Jv.js → Globe04-B8fLlHyp.js} +1 -1
  15. package/dist/client/assets/{HardDrive-CU-vvmKE.js → HardDrive-DDRUuRUd.js} +1 -1
  16. package/dist/client/assets/{Image01-B-FQwXx8.js → Image01-DxLV4xvs.js} +1 -1
  17. package/dist/client/assets/{Key01-myvTSA8u.js → Key01-Cq8uChmI.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-C0g0LezP.js → LayoutLeft-riUBpORF.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-d9EixhiS.js → LinkExternal01-DU3CPyqq.js} +1 -1
  20. package/dist/client/assets/{Monitor01-BkDBzdlH.js → Monitor01-0ngeB4wd.js} +1 -1
  21. package/dist/client/assets/{Package-eNacrLmv.js → Package-BrNfAbz_.js} +1 -1
  22. package/dist/client/assets/{Palette-BiKqXWvc.js → Palette-CtgW-PAY.js} +1 -1
  23. package/dist/client/assets/{Play-CdkPhmTs.js → Play-CdZJWvJx.js} +1 -1
  24. package/dist/client/assets/{Plus-DWjKZ2wj.js → Plus-Ca4hMAKt.js} +1 -1
  25. package/dist/client/assets/{SearchLg-DBOWvxyl.js → SearchLg-BGyV5Bz4.js} +1 -1
  26. package/dist/client/assets/{SearchMd-CKteZWzZ.js → SearchMd-CFTyyPmA.js} +1 -1
  27. package/dist/client/assets/{Settings02-CM0Uzs0U.js → Settings02-BIuCsH3l.js} +1 -1
  28. package/dist/client/assets/{Shield01-aDvWVv5Z.js → Shield01-DdJSxLoT.js} +1 -1
  29. package/dist/client/assets/{Star01-B-8espqJ.js → Star01-Dg6BZrlI.js} +1 -1
  30. package/dist/client/assets/{Stars01-DsfblQf3.js → Stars01-wVvTShj4.js} +1 -1
  31. package/dist/client/assets/{Stars02-DBH33Ez2.js → Stars02-BF8YOJhr.js} +1 -1
  32. package/dist/client/assets/{Sun-MvOAGgKN.js → Sun-Cd6pfpZ3.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-DUrn8gXV.js → SwitchHorizontal01-T7cYMNoP.js} +1 -1
  34. package/dist/client/assets/{Tool01-4pit7qOS.js → Tool01-BDwVCBnM.js} +1 -1
  35. package/dist/client/assets/{Tool02-tJKj7JcW.js → Tool02-DjIBln53.js} +1 -1
  36. package/dist/client/assets/{Trash01-DEWgFvvg.js → Trash01-CxvmthNE.js} +1 -1
  37. package/dist/client/assets/TrendUp01-DdL0oR_B.js +1 -0
  38. package/dist/client/assets/{Upload01-C8RP0Fvq.js → Upload01-w4HjmReL.js} +1 -1
  39. package/dist/client/assets/{User01-v0Bqr3nA.js → User01-0Zd0134v.js} +1 -1
  40. package/dist/client/assets/{Users01-CPNZ7uMu.js → Users01-j-t-q-sR.js} +1 -1
  41. package/dist/client/assets/{Users03-WVYBBENu.js → Users03-BpRSYTYN.js} +1 -1
  42. package/dist/client/assets/{X-Dm6kY_ek.js → X--0kJVtau.js} +1 -1
  43. package/dist/client/assets/{XCircle-cwYbcP7y.js → XCircle-CWZBOndb.js} +1 -1
  44. package/dist/client/assets/{XClose-DnNyN9T-.js → XClose-CFj_hbve.js} +1 -1
  45. package/dist/client/assets/{Zap-CNRURtEh.js → Zap-BfGgAuT1.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-Dj8pa8Fg.js → ZapSquare-CS1YImRf.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-_psBJlXD.js → ZoomOut-DBunTdui.js} +1 -1
  48. package/dist/client/assets/{access-gate-CPecvlS5.js → access-gate-C3Jf69ZD.js} +1 -1
  49. package/dist/client/assets/{add-section-modal-CcLBxmBX.js → add-section-modal-Ca2kfOel.js} +1 -1
  50. package/dist/client/assets/agent-icon-BdMdPyH8.js +1 -0
  51. package/dist/client/assets/agents-list-s5b3COYS.js +1 -0
  52. package/dist/client/assets/ai-providers-DAXq9GNP.js +1 -0
  53. package/dist/client/assets/{alert-dialog-3VMQ65hF.js → alert-dialog-BjP2s6Nc.js} +1 -1
  54. package/dist/client/assets/{alert-XkDwazoe.js → alert-sYi6c8L0.js} +1 -1
  55. package/dist/client/assets/app-editor-lqTV057s.js +1 -0
  56. package/dist/client/assets/{auth-dSVlMQ86.js → auth-DWUY37QO.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-BVp4zpOf.js → auth-catchall-4BdHIsfs.js} +1 -1
  58. package/dist/client/assets/{auth-entry-C48ylSC_.js → auth-entry-CbO-WTGZ.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-dbrXw6Uq.js → auth-split-layout-Cunbbv7Y.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-BHT9Kp62.js → authenticate-and-persist-oauth-tVxGkZPI.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-PkSpkeID.js → automation-list-row-Bx2czjnJ.js} +1 -1
  62. package/dist/client/assets/automation-runs-CvOQZBIo.js +87 -0
  63. package/dist/client/assets/automations-ZGK89zV_.js +1 -0
  64. package/dist/client/assets/{autosend-D_-616qs.js → autosend-BLRimjZ_.js} +1 -1
  65. package/dist/client/assets/{avatar-UXZ4R5Yb.js → avatar-BVfPlbpm.js} +1 -1
  66. package/dist/client/assets/{badge-CfAmvo-h.js → badge-DNxr1fi7.js} +1 -1
  67. package/dist/client/assets/{block-document-DbCz5f9N.js → block-document-z1ZnryZ2.js} +2 -2
  68. package/dist/client/assets/{brand-context-G_6bLd5F.js → brand-context-CLHvlJV7.js} +1 -1
  69. package/dist/client/assets/buckets-BTIuBcJT.js +1 -0
  70. package/dist/client/assets/bulk-category-panel-BgK98tsF.js +1 -0
  71. package/dist/client/assets/calendar-VVDY0smi.js +102 -0
  72. package/dist/client/assets/{capability-load-error-B9xkkNBq.js → capability-load-error-2OJTaAO-.js} +1 -1
  73. package/dist/client/assets/{card-dLLzWD0r.js → card-CRilZAuB.js} +1 -1
  74. package/dist/client/assets/category-editor-D_whkLw0.js +1 -0
  75. package/dist/client/assets/{chat-context-CyCuyn4t.js → chat-context-BI8_Nmou.js} +13 -11
  76. package/dist/client/assets/checkbox-CcBhppQn.js +1 -0
  77. package/dist/client/assets/{cli-auth-success-zoB4TWhQ.js → cli-auth-success-DEIP-V25.js} +1 -1
  78. package/dist/client/assets/collection-detail-1c1ACTcR.js +1 -0
  79. package/dist/client/assets/collection-display-button-DXJEmTV8.js +1 -0
  80. package/dist/client/assets/{collection-search-C4jDpdZf.js → collection-search-COKgSE9f.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-DIkftYUF.js → collection-table-wrapper-Bkw9b8hk.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-DvvibY6H.js → collection-tabs-ttDF8X2o.js} +1 -1
  83. package/dist/client/assets/{command-EQNrbniG.js → command-vkOcTid-.js} +1 -1
  84. package/dist/client/assets/commerce-onboarding-bjzg6F_h.js +1 -0
  85. package/dist/client/assets/{companions-core-fc2Z_sCB.js → companions-core-B9YYDQ4A.js} +1 -1
  86. package/dist/client/assets/connect-desktop-dialog-D7YkwfUU.js +1 -0
  87. package/dist/client/assets/{connection-card-CtY9PRIw.js → connection-card-DU81gKdu.js} +1 -1
  88. package/dist/client/assets/connection-detail-DABVCpPE.js +1 -0
  89. package/dist/client/assets/{connection-form-helpers-TGmycj7X.js → connection-form-helpers-Dyl58fX0.js} +1 -1
  90. package/dist/client/assets/connections-bXxskjsO.js +1 -0
  91. package/dist/client/assets/{decopilot-sse-pool-DHojW3EC.js → decopilot-sse-pool-B7Q1Pjne.js} +1 -1
  92. package/dist/client/assets/{dialog-CmXDzme5.js → dialog-B1V0iUXV.js} +1 -1
  93. package/dist/client/assets/{domain-settings-GxKzcerZ.js → domain-settings-B1ZyfdYW.js} +1 -1
  94. package/dist/client/assets/{drawer-Ds-r7525.js → drawer-9Bvsh1k7.js} +1 -1
  95. package/dist/client/assets/dropdown-menu-Bel6DI3v.js +1 -0
  96. package/dist/client/assets/{empty-state-CdKwtMyP.js → empty-state-BHQtYUSO.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-CK9iLAoG.js → extract-connection-data-BZuABMOr.js} +1 -1
  98. package/dist/client/assets/file-explorer-PgVeGy2E.js +2 -0
  99. package/dist/client/assets/{file-type-icon-DjNFZnTs.js → file-type-icon-CGkU8X5K.js} +1 -1
  100. package/dist/client/assets/{files-CQYyuV1E.js → files-DZ3SJjR-.js} +1 -1
  101. package/dist/client/assets/{form-x0k-kdB2.js → form-C9jBxN8G.js} +1 -1
  102. package/dist/client/assets/general-CuHItqTO.js +1 -0
  103. package/dist/client/assets/{github-repo-picker-C-tZ-Bba.js → github-repo-picker-DPwCOiEB.js} +1 -1
  104. package/dist/client/assets/{hooks-QHrmNjJQ.js → hooks-DtDviOax.js} +1 -1
  105. package/dist/client/assets/index-B3GkLwEh.js +2 -0
  106. package/dist/client/assets/{index-cG8paP3z.js → index-BRH7yHcF.js} +1 -1
  107. package/dist/client/assets/{index-Czi2ZhJ5.js → index-BcgykEG5.js} +1 -1
  108. package/dist/client/assets/{index-C-B6S6Q9.js → index-CHJYXQSS.js} +1 -1
  109. package/dist/client/assets/{index-DF3zg-P1.js → index-CMuj1duV.js} +3 -3
  110. package/dist/client/assets/{index-T-oY3h3t.js → index-Clopj9KU.js} +1 -1
  111. package/dist/client/assets/{index-CUVgjm02.js → index-CwggL_PJ.js} +1 -1
  112. package/dist/client/assets/{index-CeqD0RVV.js → index-DVJqB6A6.js} +1 -1
  113. package/dist/client/assets/{index-BcWQMJI4.js → index-Df10o6gn.js} +3 -3
  114. package/dist/client/assets/index-Dj5WILcq.css +1 -0
  115. package/dist/client/assets/{index-DonY639O.js → index-Dp8SB-ud.js} +29 -29
  116. package/dist/client/assets/index-DxeK__BQ.js +1 -0
  117. package/dist/client/assets/{index-BCiDnhhX.js → index-gAU-Arvb.js} +4 -4
  118. package/dist/client/assets/{index-BjO8A-VO.js → index-jm5YycYM.js} +1 -1
  119. package/dist/client/assets/{index-redirect-_hpy7g8S.js → index-redirect-CecfnhiM.js} +1 -1
  120. package/dist/client/assets/{index-CzMEWsZX.js → index-z2UBv_6H.js} +1 -1
  121. package/dist/client/assets/{input-BZTiU0ds.js → input-qdMTAJH4.js} +1 -1
  122. package/dist/client/assets/{integration-icon-BfKWLZT4.js → integration-icon-ByqyfRpT.js} +1 -1
  123. package/dist/client/assets/{invite-member-dialog-fPpySKy7.js → invite-member-dialog-cnQXBieX.js} +1 -1
  124. package/dist/client/assets/{label-B1OfKy2N.js → label-CnEhHuVP.js} +1 -1
  125. package/dist/client/assets/{layout-BzlkAZij.js → layout-ofNqb8rV.js} +1 -1
  126. package/dist/client/assets/{login-CfYNPvDo.js → login-knndhvVF.js} +1 -1
  127. package/dist/client/assets/{mcp-oauth-CoKzxQiz.js → mcp-oauth-CAUkOKji.js} +1 -1
  128. package/dist/client/assets/members-Bb6cqv3N.js +1 -0
  129. package/dist/client/assets/{monaco-editor-BzdwB2U8.js → monaco-editor-4EWxCivt.js} +1 -1
  130. package/dist/client/assets/{monitoring-stats-row-C0-lT8X-.js → monitoring-stats-row-CYRhMPF6.js} +1 -1
  131. package/dist/client/assets/{multi-select-BYFsBcLx.js → multi-select-DGg7VcY7.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-D6L6RroV.js → oauth-callback-Txh_HZU1.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-ai-provider-NS24Yhk_.js → oauth-callback-ai-provider-gZcF7GFt.js} +1 -1
  134. package/dist/client/assets/{onboarding-CXfWXP3L.js → onboarding-BNd98v9F.js} +1 -1
  135. package/dist/client/assets/{org-install-CFASOU4_.js → org-install-s29fSk6T.js} +1 -1
  136. package/dist/client/assets/{org-layout-gngtZKVa.js → org-layout-pC6WuH2d.js} +1 -1
  137. package/dist/client/assets/{organization-choice-DB-AR__E.js → organization-choice-Cvpg9cyR.js} +1 -1
  138. package/dist/client/assets/orgs-BH4zqSW4.js +1 -0
  139. package/dist/client/assets/{page-seo-form-DsaBxdUW.js → page-seo-form-DpJbL5qC.js} +1 -1
  140. package/dist/client/assets/page-seo-sheet-BViE3vmf.js +1 -0
  141. package/dist/client/assets/{popover-BzHpXFL_.js → popover-BXXrlEXA.js} +1 -1
  142. package/dist/client/assets/post-editor-DgVq5HAq.js +1 -0
  143. package/dist/client/assets/{primitives-BxBoeZTE.js → primitives-C0YiE9Dl.js} +1 -1
  144. package/dist/client/assets/profile-CdQoqyRv.js +1 -0
  145. package/dist/client/assets/project-app-view-DORLMZaj.js +1 -0
  146. package/dist/client/assets/record-editor-D2PAFmR-.js +1 -0
  147. package/dist/client/assets/redirect-editor-ClaSMwyP.js +1 -0
  148. package/dist/client/assets/registry-DqKNpXHC.js +2 -0
  149. package/dist/client/assets/{registry-layout-B8iHO94t.js → registry-layout-CFETb4kQ.js} +2 -2
  150. package/dist/client/assets/{reports-DFt5o5JU.js → reports-Bd4Konjf.js} +2 -2
  151. package/dist/client/assets/{require-capability-CEBGt_Ot.js → require-capability-D0uXhAfv.js} +1 -1
  152. package/dist/client/assets/{required-auth-layout-vPZ2d-Yx.js → required-auth-layout-uUQ9Dfyr.js} +1 -1
  153. package/dist/client/assets/{reset-password-l6ffdCqx.js → reset-password-InhP_QJS.js} +1 -1
  154. package/dist/client/assets/roles-C8MjshKP.js +1 -0
  155. package/dist/client/assets/{search-input-ByuB0YyC.js → search-input-Bhg65axQ.js} +1 -1
  156. package/dist/client/assets/secrets-CoTCTnY9.js +1 -0
  157. package/dist/client/assets/sections-editor-P9NnL9uS.js +2 -0
  158. package/dist/client/assets/select-Bhj7LCuD.js +1 -0
  159. package/dist/client/assets/{select-model-CebmAt-C.js → select-model-BkLoUhWB.js} +1 -1
  160. package/dist/client/assets/self-tool-result-DdS1heyV.js +1 -0
  161. package/dist/client/assets/seo-editor-5nf9jCaQ.js +1 -0
  162. package/dist/client/assets/{settings-layout-DUpflFya.js → settings-layout-Ct-vBxnm.js} +1 -1
  163. package/dist/client/assets/{settings-section-DS6otYn7.js → settings-section-D-A3Bfgf.js} +1 -1
  164. package/dist/client/assets/{shell-controls-B9xMPAfw.js → shell-controls-DCy9Peje.js} +1 -1
  165. package/dist/client/assets/{shell-layout-Bo6QxW8m.js → shell-layout-DDCV5qM0.js} +1 -1
  166. package/dist/client/assets/{sidebar-BFdShy9x.js → sidebar-DeWKCtxp.js} +1 -1
  167. package/dist/client/assets/{skeleton-BGZh750P.js → skeleton-BbGF1H7-.js} +1 -1
  168. package/dist/client/assets/sso-D7TxlrMn.js +1 -0
  169. package/dist/client/assets/{store-ioH_J-rE.js → store-0pluQIHD.js} +1 -1
  170. package/dist/client/assets/store-registry-CO9GrEkA.js +2 -0
  171. package/dist/client/assets/{studio-tools-bThaob6p.js → studio-tools-CE7lpCkl.js} +1 -1
  172. package/dist/client/assets/{switch-C2KH_TaK.js → switch-BNLG1jmU.js} +1 -1
  173. package/dist/client/assets/{table-XKbQ5Wjx.js → table-ByQcTCqP.js} +1 -1
  174. package/dist/client/assets/{tabs-D-6eQ0wE.js → tabs-CXMTix3U.js} +1 -1
  175. package/dist/client/assets/{textarea-PYu4eHQV.js → textarea-BPWk2Ywn.js} +1 -1
  176. package/dist/client/assets/{toggle-group-BcxqPGrf.js → toggle-group-DPBmxHrX.js} +1 -1
  177. package/dist/client/assets/{toolbar-D90MFc80.js → toolbar-CpK88Wot.js} +1 -1
  178. package/dist/client/assets/{toolbar-icon-button-D3m9VnTI.js → toolbar-icon-button--NaDqMEF.js} +1 -1
  179. package/dist/client/assets/{tooltip-O3iHy7-o.js → tooltip-B8wnTm17.js} +1 -1
  180. package/dist/client/assets/{use-ai-providers-B4nhSJlr.js → use-ai-providers-BO2D28v4.js} +1 -1
  181. package/dist/client/assets/{use-automations-C01orYPa.js → use-automations-CvhBPwX5.js} +1 -1
  182. package/dist/client/assets/{use-autosave-BhfvFfoI.js → use-autosave-DUdpa8zB.js} +1 -1
  183. package/dist/client/assets/{use-capability--WeMT0KP.js → use-capability-B2zRKwHf.js} +1 -1
  184. package/dist/client/assets/use-clock-tick-BfNa5AcO.js +1 -0
  185. package/dist/client/assets/{use-collections-K1HyCAfG.js → use-collections-tP6FM68N.js} +1 -1
  186. package/dist/client/assets/{use-connection-twfWXxwG.js → use-connection-Bubfkk8k.js} +1 -1
  187. package/dist/client/assets/{use-copy-DQ4y4418.js → use-copy-3Mpuxl0p.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-NwJ9x5Kd.js → use-create-virtual-mcp-BhfqxX9Z.js} +1 -1
  189. package/dist/client/assets/{use-debounced-autosave-BdWGMbok.js → use-debounced-autosave-B1u8xEPK.js} +1 -1
  190. package/dist/client/assets/{use-debounced-value-xN0eyoO9.js → use-debounced-value-ToigCZRD.js} +1 -1
  191. package/dist/client/assets/use-deco-credits-We_pqPUY.js +1 -0
  192. package/dist/client/assets/{use-decopilot-events-BEOY-_n2.js → use-decopilot-events-DDSe_K7D.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-BlzYSB_f.js → use-delete-connection-veOzeP_-.js} +1 -1
  194. package/dist/client/assets/{use-deployment-admin-DYO-CLsy.js → use-deployment-admin-uwYQkYfr.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-Bs9N4w-Z.js → use-file-configs-DxQ_uwCG.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-Dt7gLdpr.js → use-infinite-scroll-0uWHf52y.js} +1 -1
  197. package/dist/client/assets/{use-join-requests-D0z99IAk.js → use-join-requests-FGCBDSYD.js} +1 -1
  198. package/dist/client/assets/{use-mcp-auth-status-C7G9bAkb.js → use-mcp-auth-status-CFgkpOhb.js} +1 -1
  199. package/dist/client/assets/{use-mcp-client-DrROXOcH.js → use-mcp-client-D2BCR1MH.js} +1 -1
  200. package/dist/client/assets/{use-mcp-tools-D28ox9dJ.js → use-mcp-tools-DadUkegG.js} +1 -1
  201. package/dist/client/assets/{use-members-mvfsRjey.js → use-members-X6Ssb-cK.js} +1 -1
  202. package/dist/client/assets/{use-mobile-nauPjzo2.js → use-mobile-Cd6_A-wv.js} +1 -1
  203. package/dist/client/assets/{use-navigate-to-agent-BJC_x779.js → use-navigate-to-agent-rb-KJLb8.js} +1 -1
  204. package/dist/client/assets/{use-org-auth-client-jU0nDPT-.js → use-org-auth-client-Bw3VIyYp.js} +1 -1
  205. package/dist/client/assets/{use-org-sso-j8hZyqdO.js → use-org-sso-DBoYR181.js} +1 -1
  206. package/dist/client/assets/{use-organization-roles-thqey2Pm.js → use-organization-roles-B2nz6Y2V.js} +1 -1
  207. package/dist/client/assets/{use-organization-settings-BJ1bjHsL.js → use-organization-settings-B7BUH-ed.js} +1 -1
  208. package/dist/client/assets/{use-registry-app-CeyrXTI4.js → use-registry-app-DnzAi61_.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-D94L7VqK.js → use-registry-connections-dW2A6Cn6.js} +1 -1
  210. package/dist/client/assets/{use-secrets-C1Fme0Ya.js → use-secrets-BDm4jx5-.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-B1YKt2sD.js → use-status-sounds-Bf8VuMQs.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-gP4n4GFH.js → use-view-mode-Rpx9lr2S.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-C964oRwj.js → use-virtual-mcp-BIj51zng.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-B2tGgvl5.js +1 -0
  215. package/dist/client/assets/{useRouterState-Bi7YKwTw.js → useRouterState-DPwhq9G0.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-BYVVsI1f.js +1 -0
  217. package/dist/client/assets/{users-BiDYlXA2.js → users-DAp0zXfL.js} +1 -1
  218. package/dist/client/assets/variant-calendar-ByIjiAPe.js +1 -0
  219. package/dist/client/assets/{view-mode-toggle-kFlOpvCC.js → view-mode-toggle-BbtMRSS5.js} +1 -1
  220. package/dist/client/index.html +2 -2
  221. package/dist/server/cli.js +1 -1
  222. package/dist/server/server.js +1 -1
  223. package/package.json +1 -1
  224. package/dist/client/assets/Check-BF3t7WWi.js +0 -1
  225. package/dist/client/assets/ChevronUp-Y-IpPAUR.js +0 -1
  226. package/dist/client/assets/Circle-0HId1SV6.js +0 -1
  227. package/dist/client/assets/DotsVertical-CYU3Mae1.js +0 -1
  228. package/dist/client/assets/Flag01-B_AKNFoc.js +0 -1
  229. package/dist/client/assets/List-DZAsltZv.js +0 -1
  230. package/dist/client/assets/TrendUp01-7N_6K3-X.js +0 -1
  231. package/dist/client/assets/UserPlus01-D2pAl0t2.js +0 -1
  232. package/dist/client/assets/agent-icon-DmIJ53uv.js +0 -1
  233. package/dist/client/assets/agents-list-GFWV8fSw.js +0 -1
  234. package/dist/client/assets/ai-providers-C93Uux8H.js +0 -1
  235. package/dist/client/assets/app-editor-GnwEYs2F.js +0 -1
  236. package/dist/client/assets/automation-runs-yMzfgCqo.js +0 -188
  237. package/dist/client/assets/automations-Db9v_2wu.js +0 -1
  238. package/dist/client/assets/buckets-Bkz3itxJ.js +0 -1
  239. package/dist/client/assets/bulk-category-panel-EjjgUKdU.js +0 -1
  240. package/dist/client/assets/calendar-BdMqQsTv.js +0 -1
  241. package/dist/client/assets/category-editor-l1ImzDA-.js +0 -1
  242. package/dist/client/assets/checkbox-CxV2vfbv.js +0 -1
  243. package/dist/client/assets/collection-detail-ByPPxvaR.js +0 -1
  244. package/dist/client/assets/collection-display-button-BBHublq2.js +0 -1
  245. package/dist/client/assets/commerce-onboarding-Dgs4FWfH.js +0 -1
  246. package/dist/client/assets/connect-desktop-dialog-CPSwwSyz.js +0 -1
  247. package/dist/client/assets/connection-detail-DuvF3pbE.js +0 -1
  248. package/dist/client/assets/connections-CE66Octw.js +0 -1
  249. package/dist/client/assets/dropdown-menu-BgNr7tM1.js +0 -1
  250. package/dist/client/assets/file-explorer-nG37TAVQ.js +0 -2
  251. package/dist/client/assets/general-c3hgsq_x.js +0 -1
  252. package/dist/client/assets/index-DKadkG06.js +0 -4
  253. package/dist/client/assets/index-DpLPq5a_.css +0 -1
  254. package/dist/client/assets/index-bj26_8KX.js +0 -1
  255. package/dist/client/assets/members-CrKGCoFu.js +0 -1
  256. package/dist/client/assets/orgs-jcqywdGM.js +0 -1
  257. package/dist/client/assets/page-seo-sheet-BF2mpJ0B.js +0 -1
  258. package/dist/client/assets/post-editor-JD3fSSO7.js +0 -1
  259. package/dist/client/assets/profile-CZ9vM3_S.js +0 -1
  260. package/dist/client/assets/project-app-view-40EQ9ogm.js +0 -1
  261. package/dist/client/assets/record-editor-BmGDR-eB.js +0 -1
  262. package/dist/client/assets/redirect-editor-0M8-Neu7.js +0 -1
  263. package/dist/client/assets/registry-CwTOcwuV.js +0 -2
  264. package/dist/client/assets/roles-Bo-eSbrf.js +0 -1
  265. package/dist/client/assets/secrets-C_1Jcs02.js +0 -1
  266. package/dist/client/assets/sections-editor-gaZ0BvyI.js +0 -2
  267. package/dist/client/assets/select-B6GE4jHJ.js +0 -1
  268. package/dist/client/assets/self-tool-result-DJIiUu6Z.js +0 -1
  269. package/dist/client/assets/seo-editor-DNUmLmzw.js +0 -1
  270. package/dist/client/assets/sso-D7EYt-G3.js +0 -1
  271. package/dist/client/assets/store-registry-s8bkhEBH.js +0 -2
  272. package/dist/client/assets/use-clock-tick-DboEo7Cc.js +0 -1
  273. package/dist/client/assets/use-deco-credits-Bm-VH5Hm.js +0 -1
  274. package/dist/client/assets/useInfiniteQuery-DKhJHTs2.js +0 -1
  275. package/dist/client/assets/useSuspenseInfiniteQuery-DAAXTkZt.js +0 -1
  276. package/dist/client/assets/variant-calendar-m6XjJ2dx.js +0 -1
@@ -1 +0,0 @@
1
- import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-DF3zg-P1.js";import{s as q}from"./Plus-DWjKZ2wj.js";import{i as S}from"./Zap-CNRURtEh.js";import{S as D}from"./search-input-ByuB0YyC.js";import{P as l}from"./index-CeqD0RVV.js";import{E as b}from"./empty-state-CdKwtMyP.js";import{c as O}from"./use-automations-C01orYPa.js";import{c as V}from"./use-navigate-to-agent-BJC_x779.js";import{A as F}from"./automation-list-row-PkSpkeID.js";import{f as G}from"./constants-BHDe7bIw.js";import{u as H}from"./use-virtual-mcp-C964oRwj.js";import{R as J}from"./require-capability-CEBGt_Ot.js";import"./SearchMd-CKteZWzZ.js";import"./sidebar-BFdShy9x.js";import"./LayoutLeft-C0g0LezP.js";import"./use-mobile-nauPjzo2.js";import"./X-Dm6kY_ek.js";import"./tooltip-O3iHy7-o.js";import"./use-mcp-client-DrROXOcH.js";import"./auth-dSVlMQ86.js";import"./studio-tools-bThaob6p.js";import"./hooks-QHrmNjJQ.js";import"./decopilot-sse-pool-DHojW3EC.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-3VMQ65hF.js";import"./dropdown-menu-BgNr7tM1.js";import"./Check-BF3t7WWi.js";import"./ChevronRight-Fgy0rUS_.js";import"./Circle-0HId1SV6.js";import"./Stars02-DBH33Ez2.js";import"./DotsVertical-CYU3Mae1.js";import"./Trash01-DEWgFvvg.js";import"./agent-icon-DmIJ53uv.js";import"./AlertCircle-B6AELEdc.js";import"./UserPlus01-D2pAl0t2.js";import"./Tool01-4pit7qOS.js";import"./ArrowUp-YK2fJPgi.js";import"./Settings02-CM0Uzs0U.js";import"./Tool02-tJKj7JcW.js";import"./XCircle-cwYbcP7y.js";import"./ArrowUpRight-BKVLcZTe.js";import"./TrendUp01-7N_6K3-X.js";import"./ZapSquare-Dj8pa8Fg.js";import"./ZoomOut-_psBJlXD.js";import"./Users03-WVYBBENu.js";import"./CheckCircle-BfxYbuVE.js";import"./ChevronDown-CQLSXgt3.js";import"./ChevronUp-Y-IpPAUR.js";import"./Copy01-B0CQRE_5.js";import"./Globe01-B52VKYy7.js";import"./Eye-CLtdCpUf.js";import"./FilterLines-DeiGsRZY.js";import"./Flag01-B_AKNFoc.js";import"./Star01-B-8espqJ.js";import"./Globe04-B0las6Jv.js";import"./SwitchHorizontal01-DUrn8gXV.js";import"./HardDrive-CU-vvmKE.js";import"./Image01-B-FQwXx8.js";import"./Key01-myvTSA8u.js";import"./LinkExternal01-d9EixhiS.js";import"./List-DZAsltZv.js";import"./Monitor01-BkDBzdlH.js";import"./Sun-MvOAGgKN.js";import"./Package-eNacrLmv.js";import"./Palette-BiKqXWvc.js";import"./Play-CdkPhmTs.js";import"./SearchLg-DBOWvxyl.js";import"./Shield01-aDvWVv5Z.js";import"./Stars01-DsfblQf3.js";import"./Upload01-C8RP0Fvq.js";import"./User01-v0Bqr3nA.js";import"./Users01-CPNZ7uMu.js";import"./XClose-DnNyN9T-.js";import"./use-collections-K1HyCAfG.js";import"./use-capability--WeMT0KP.js";import"./access-gate-CPecvlS5.js";import"./capability-load-error-B9xkkNBq.js";function K(){const t=B.c(16),{org:e}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(i=>{if(!g||i.name.toLowerCase().includes(g))return!0;if(i.virtual_mcp_id){const a=y.get(i.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(i,a)=>{const A=a&&y.has(a)?a:G(e.id);N("automations_list_row_clicked",{automation_id:i,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+i}})};let n;t[0]!==d||t[1]!==e.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:e.slug}})},t[0]=d,t[1]=e.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(D,{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 v=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(q,{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(i=>o.jsx(F,{automation:i,showAgent:!0,onClick:()=>P(i.id,i.virtual_mcp_id)},i.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,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 vo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=e):e=t[0],e}export{vo as default};
@@ -1 +0,0 @@
1
- import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-DF3zg-P1.js";import{i as J}from"./AlertCircle-B6AELEdc.js";import{i as O}from"./HardDrive-CU-vvmKE.js";import{s as L}from"./Plus-DWjKZ2wj.js";import{s as Q}from"./Trash01-DEWgFvvg.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-3VMQ65hF.js";import{e as ne,d as le,D as ae,a as oe,h as ce,c as de}from"./dialog-CmXDzme5.js";import{I as N}from"./input-BZTiU0ds.js";import{L as C}from"./label-B1OfKy2N.js";import{S as me,a as ue,b as fe,c as pe,d as q}from"./select-B6GE4jHJ.js";import{S as xe}from"./switch-C2KH_TaK.js";import{S as he}from"./skeleton-BGZh750P.js";import{T as ge}from"./textarea-PYu4eHQV.js";import{P}from"./index-CeqD0RVV.js";import{c as je}from"./settings-section-DS6otYn7.js";import{u as ye,b as be,c as ve}from"./use-file-configs-Bs9N4w-Z.js";import{R as Se}from"./require-capability-CEBGt_Ot.js";import"./X-Dm6kY_ek.js";import"./tooltip-O3iHy7-o.js";import"./Check-BF3t7WWi.js";import"./ChevronDown-CQLSXgt3.js";import"./ChevronUp-Y-IpPAUR.js";import"./sidebar-BFdShy9x.js";import"./LayoutLeft-C0g0LezP.js";import"./use-mobile-nauPjzo2.js";import"./card-dLLzWD0r.js";import"./ArrowUpRight-BKVLcZTe.js";import"./studio-tools-bThaob6p.js";import"./use-capability--WeMT0KP.js";import"./access-gate-CPecvlS5.js";import"./capability-load-error-B9xkkNBq.js";function Ce(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ne(s){const e=D.c(44),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(O,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(O,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(L,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,r,t.jsxs(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(C,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function ot(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{ot as default};
@@ -1 +0,0 @@
1
- import{c as Q,l as Y,j as s,r as W,B as J,i as le}from"./index-DF3zg-P1.js";import{c as Z}from"./ZoomOut-_psBJlXD.js";import{i as ae}from"./X-Dm6kY_ek.js";import{L as O}from"./label-B1OfKy2N.js";import{I as ie,R as oe,a as re}from"./index-C-B6S6Q9.js";import{i as ce}from"./Circle-0HId1SV6.js";import{S as ne,a as de,b as me,c as xe,d as pe}from"./select-B6GE4jHJ.js";import{T as fe,a as ue,b as he}from"./tooltip-O3iHy7-o.js";import"./Check-BF3t7WWi.js";import"./ChevronDown-CQLSXgt3.js";import"./ChevronUp-Y-IpPAUR.js";function ge(a){const e=Q.c(8);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("grid gap-3",i),e[3]=i,e[4]=o):o=e[4];let l;return e[5]!==t||e[6]!==o?(l=s.jsx(oe,{"data-slot":"radio-group",className:o,...t}),e[5]=t,e[6]=o,e[7]=l):l=e[7],l}function X(a){const e=Q.c(9);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",i),e[3]=i,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(re,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:s.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==t||e[7]!==o?(c=s.jsx(ie,{"data-slot":"radio-group-item",className:o,...t,children:l}),e[6]=t,e[7]=o,e[8]=c):c=e[8],c}function Te(a){const e=Q.c(69),{posts:i,categories:t,initialSlug:o,isPending:l,onApply:c,onClose:m}=a,[n,ee]=W.useState(o&&t.some(d=>d.slug===o)?o:t[0]?.slug??""),[x,se]=W.useState("add");let T;if(e[0]!==t||e[1]!==n){let d;e[3]!==n?(d=te=>te.slug===n,e[3]=n,e[4]=d):d=e[4],T=t.find(d),e[0]=t,e[1]=n,e[2]=T}else T=e[2];const p=T,r=i.length,K=r===1?"post":"posts";let f;e[5]!==r||e[6]!==K?(f=s.jsxs("span",{className:"truncate text-sm font-medium",children:[r," ",K," selected"]}),e[5]=r,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ae,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==m?(u=s.jsx(fe,{asChild:!0,children:s.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:m,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=m,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=s.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=r===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${r} ${r===1?"post":"posts"}.`;let j;e[19]!==M?(j=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==t||e[23]!==n?(b=s.jsxs("div",{className:"space-y-2",children:[B,t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):s.jsxs(ne,{value:n,onValueChange:ee,children:[s.jsx(de,{className:"w-full",children:s.jsx(me,{placeholder:"Select a category"})}),s.jsx(xe,{children:t.map(be)})]})]}),e[22]=t,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=d=>se(d),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==x?(y=s.jsxs(ge,{value:x,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=x,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==m?(N=s.jsx(J,{type:"button",variant:"outline",onClick:m,disabled:l,children:"Cancel"}),e[32]=l,e[33]=m,e[34]=N):N=e[34];const D=!p||l||r===0;let v;e[35]!==x||e[36]!==c||e[37]!==p?(v=()=>p&&c(x,{name:p.name,slug:p.slug}),e[35]=x,e[36]=c,e[37]=p,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=s.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=s.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=s.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=r===1?"post":"posts";let w;e[53]!==r||e[54]!==H?(w=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,s.jsxs("span",{className:"text-sm",children:[r," selected ",H]})]}),e[53]=r,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==r||e[57]!==i?(R=r===0?s.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):s.jsx("ul",{className:"divide-y border-t bg-background",children:i.map(je)}),e[56]=r,e[57]=i,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=s.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=s.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(a){return s.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[s.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:a.title}),a.slug&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:a.slug})]})]},a.key)}function be(a){return s.jsx(pe,{value:a.slug,children:s.jsx("span",{className:"truncate",children:a.name})},a.slug)}export{Te as BulkCategoryPanel};
@@ -1 +0,0 @@
1
- import{r as D,j as u,c as ht,l as H,bQ as Pe}from"./index-DF3zg-P1.js";import{n as mt}from"./UserPlus01-D2pAl0t2.js";import{i as vt}from"./ChevronRight-Fgy0rUS_.js";function w(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function S(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function C(e,t){const n=w(e);return isNaN(t)?S(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function j(e,t){const n=w(e);if(isNaN(t))return S(e,NaN);if(!t)return n;const a=n.getDate(),r=S(e,n.getTime());r.setMonth(n.getMonth()+t+1,0);const o=r.getDate();return a>=o?r:(n.setFullYear(r.getFullYear(),r.getMonth(),a),n)}const ye=6048e5,yt=864e5;let gt={};function z(){return gt}function Y(e,t){const n=z(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=w(e),o=r.getDay(),i=(o<a?7:0)+o-a;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function I(e){return Y(e,{weekStartsOn:1})}function Ie(e){const t=w(e),n=t.getFullYear(),a=S(e,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const r=I(a),o=S(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const i=I(o);return t.getTime()>=r.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function A(e){const t=w(e);return t.setHours(0,0,0,0),t}function Z(e){const t=w(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function T(e,t){const n=A(e),a=A(t),r=+n-Z(n),o=+a-Z(a);return Math.round((r-o)/yt)}function bt(e){const t=Ie(e),n=S(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),I(n)}function me(e,t){const n=t*7;return C(e,n)}function pt(e,t){return j(e,t*12)}function wt(e){let t;return e.forEach(function(n){const a=w(n);(t===void 0||t<a||isNaN(Number(a)))&&(t=a)}),t||new Date(NaN)}function xt(e){let t;return e.forEach(n=>{const a=w(n);(!t||t>a||isNaN(+a))&&(t=a)}),t||new Date(NaN)}function P(e,t){const n=A(e),a=A(t);return+n==+a}function ge(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _t(e){if(!ge(e)&&typeof e!="number")return!1;const t=w(e);return!isNaN(Number(t))}function G(e,t){const n=w(e),a=w(t),r=n.getFullYear()-a.getFullYear(),o=n.getMonth()-a.getMonth();return r*12+o}function Dt(e,t,n){const a=Y(e,n),r=Y(t,n),o=+a-Z(a),i=+r-Z(r);return Math.round((o-i)/ye)}function be(e){const t=w(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function O(e){const t=w(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Re(e){const t=w(e),n=S(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function pe(e,t){const n=z(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=w(e),o=r.getDay(),i=(o<a?-7:0)+6-(o-a);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}function Be(e){return pe(e,{weekStartsOn:1})}const Mt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kt=(e,t,n)=>{let a;const r=Mt[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function se(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Nt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ct={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Pt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ot={date:se({formats:Nt,defaultWidth:"full"}),time:se({formats:Ct,defaultWidth:"full"}),dateTime:se({formats:Pt,defaultWidth:"full"})},St={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jt=(e,t,n,a)=>St[e];function X(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,s=n?.width?String(n.width):i;r=e.formattingValues[s]||e.formattingValues[i]}else{const i=e.defaultWidth,s=n?.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(t):t;return r[o]}}const Wt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Tt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Yt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ft={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Et={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Lt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},It=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Rt={ordinalNumber:It,era:X({values:Wt,defaultWidth:"wide"}),quarter:X({values:Tt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:X({values:Yt,defaultWidth:"wide"}),day:X({values:Ft,defaultWidth:"wide"}),dayPeriod:X({values:Et,defaultWidth:"wide",formattingValues:Lt,defaultFormattingWidth:"wide"})};function V(e){return(t,n={})=>{const a=n.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],o=t.match(r);if(!o)return null;const i=o[0],s=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Ht(s,f=>f.test(i)):Bt(s,f=>f.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const l=t.slice(i.length);return{value:d,rest:l}}}function Bt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ht(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function At(e){return(t,n={})=>{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],o=t.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;const s=t.slice(r.length);return{value:i,rest:s}}}const qt=/^(\d+)(th|st|nd|rd)?/i,Qt=/\d+/i,Xt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Vt={any:[/^b/i,/^(a|c)/i]},Gt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zt={any:[/1/i,/2/i,/3/i,/4/i]},Ut={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Jt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Kt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$t={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Zt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},en={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tn={ordinalNumber:At({matchPattern:qt,parsePattern:Qt,valueCallback:e=>parseInt(e,10)}),era:V({matchPatterns:Xt,defaultMatchWidth:"wide",parsePatterns:Vt,defaultParseWidth:"any"}),quarter:V({matchPatterns:Gt,defaultMatchWidth:"wide",parsePatterns:zt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:V({matchPatterns:Ut,defaultMatchWidth:"wide",parsePatterns:Jt,defaultParseWidth:"any"}),day:V({matchPatterns:Kt,defaultMatchWidth:"wide",parsePatterns:$t,defaultParseWidth:"any"}),dayPeriod:V({matchPatterns:Zt,defaultMatchWidth:"any",parsePatterns:en,defaultParseWidth:"any"})},He={code:"en-US",formatDistance:kt,formatLong:Ot,formatRelative:jt,localize:Rt,match:tn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function nn(e){const t=w(e);return T(t,Re(t))+1}function Ae(e){const t=w(e),n=+I(t)-+bt(t);return Math.round(n/ye)+1}function qe(e,t){const n=w(e),a=n.getFullYear(),r=z(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=S(e,0);i.setFullYear(a+1,0,o),i.setHours(0,0,0,0);const s=Y(i,t),c=S(e,0);c.setFullYear(a,0,o),c.setHours(0,0,0,0);const d=Y(c,t);return n.getTime()>=s.getTime()?a+1:n.getTime()>=d.getTime()?a:a-1}function an(e,t){const n=z(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=qe(e,t),o=S(e,0);return o.setFullYear(r,0,a),o.setHours(0,0,0,0),Y(o,t)}function Qe(e,t){const n=w(e),a=+Y(n,t)-+an(n,t);return Math.round(a/ye)+1}function _(e,t){const n=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return n+a}const E={y(e,t){const n=e.getFullYear(),a=n>0?n:1-n;return _(t==="yy"?a%100:a,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):_(n+1,2)},d(e,t){return _(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return _(e.getHours()%12||12,t.length)},H(e,t){return _(e.getHours(),t.length)},m(e,t){return _(e.getMinutes(),t.length)},s(e,t){return _(e.getSeconds(),t.length)},S(e,t){const n=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,n-3));return _(r,t.length)}},B={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Oe={G:function(e,t,n){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return n.ordinalNumber(r,{unit:"year"})}return E.y(e,t)},Y:function(e,t,n,a){const r=qe(e,a),o=r>0?r:1-r;if(t==="YY"){const i=o%100;return _(i,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):_(o,t.length)},R:function(e,t){const n=Ie(e);return _(n,t.length)},u:function(e,t){const n=e.getFullYear();return _(n,t.length)},Q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return _(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return _(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){const a=e.getMonth();switch(t){case"M":case"MM":return E.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return _(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){const r=Qe(e,a);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):_(r,t.length)},I:function(e,t,n){const a=Ae(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):_(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):E.d(e,t)},D:function(e,t,n){const a=nn(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):_(a,t.length)},E:function(e,t,n){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){const r=e.getDay(),o=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return _(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){const r=e.getDay(),o=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return _(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return _(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const a=e.getHours();let r;switch(a===12?r=B.noon:a===0?r=B.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const a=e.getHours();let r;switch(a>=17?r=B.evening:a>=12?r=B.afternoon:a>=4?r=B.morning:r=B.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return E.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):E.H(e,t)},K:function(e,t,n){const a=e.getHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):_(a,t.length)},k:function(e,t,n){let a=e.getHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):_(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):E.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):E.s(e,t)},S:function(e,t){return E.S(e,t)},X:function(e,t,n){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return je(a);case"XXXX":case"XX":return L(a);default:return L(a,":")}},x:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"x":return je(a);case"xxxx":case"xx":return L(a);default:return L(a,":")}},O:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Se(a,":");default:return"GMT"+L(a,":")}},z:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Se(a,":");default:return"GMT"+L(a,":")}},t:function(e,t,n){const a=Math.trunc(e.getTime()/1e3);return _(a,t.length)},T:function(e,t,n){const a=e.getTime();return _(a,t.length)}};function Se(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),o=a%60;return o===0?n+String(r):n+String(r)+t+_(o,2)}function je(e,t){return e%60===0?(e>0?"-":"+")+_(Math.abs(e)/60,2):L(e,t)}function L(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=_(Math.trunc(a/60),2),o=_(a%60,2);return n+r+t+o}const We=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Xe=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},rn=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],a=n[1],r=n[2];if(!r)return We(e,t);let o;switch(a){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",We(a,t)).replace("{{time}}",Xe(r,t))},on={p:Xe,P:rn},sn=/^D+$/,un=/^Y+$/,ln=["D","DD","YY","YYYY"];function cn(e){return sn.test(e)}function dn(e){return un.test(e)}function fn(e,t,n){const a=hn(e,t,n);if(console.warn(a),ln.includes(e))throw new RangeError(a)}function hn(e,t,n){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const mn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yn=/^'([^]*?)'?$/,gn=/''/g,bn=/[a-zA-Z]/;function R(e,t,n){const a=z(),r=n?.locale??a.locale??He,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,s=w(e);if(!_t(s))throw new RangeError("Invalid time value");let c=t.match(vn).map(l=>{const f=l[0];if(f==="p"||f==="P"){const h=on[f];return h(l,r.formatLong)}return l}).join("").match(mn).map(l=>{if(l==="''")return{isToken:!1,value:"'"};const f=l[0];if(f==="'")return{isToken:!1,value:pn(l)};if(Oe[f])return{isToken:!0,value:l};if(f.match(bn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:l}});r.localize.preprocessor&&(c=r.localize.preprocessor(s,c));const d={firstWeekContainsDate:o,weekStartsOn:i,locale:r};return c.map(l=>{if(!l.isToken)return l.value;const f=l.value;(!n?.useAdditionalWeekYearTokens&&dn(f)||!n?.useAdditionalDayOfYearTokens&&cn(f))&&fn(f,t,String(e));const h=Oe[f[0]];return h(s,f,r.localize,d)}).join("")}function pn(e){const t=e.match(yn);return t?t[1].replace(gn,"'"):e}function wn(e){const t=w(e),n=t.getFullYear(),a=t.getMonth(),r=S(e,0);return r.setFullYear(n,a+1,0),r.setHours(0,0,0,0),r.getDate()}function xn(e){return Math.trunc(+w(e)/1e3)}function _n(e){const t=w(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Dn(e,t){return Dt(_n(e),O(e),t)+1}function ve(e,t){const n=w(e),a=w(t);return n.getTime()>a.getTime()}function Ve(e,t){const n=w(e),a=w(t);return+n<+a}function we(e,t){const n=w(e),a=w(t);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()}function Mn(e,t){const n=w(e),a=w(t);return n.getFullYear()===a.getFullYear()}function ue(e,t){return C(e,-t)}function le(e,t){const n=w(e),a=n.getFullYear(),r=n.getDate(),o=S(e,0);o.setFullYear(a,t,15),o.setHours(0,0,0,0);const i=wn(o);return n.setMonth(t,Math.min(r,i)),n}function Te(e,t){const n=w(e);return isNaN(+n)?S(e,NaN):(n.setFullYear(t),n)}var g=function(){return g=Object.assign||function(t){for(var n,a=1,r=arguments.length;a<r;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},g.apply(this,arguments)};function kn(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n}function Ge(e,t,n){for(var a=0,r=t.length,o;a<r;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}function U(e){return e.mode==="multiple"}function J(e){return e.mode==="range"}function te(e){return e.mode==="single"}var Nn={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Cn(e,t){return R(e,"LLLL y",t)}function Pn(e,t){return R(e,"d",t)}function On(e,t){return R(e,"LLLL",t)}function Sn(e){return"".concat(e)}function jn(e,t){return R(e,"cccccc",t)}function Wn(e,t){return R(e,"yyyy",t)}var Tn=Object.freeze({__proto__:null,formatCaption:Cn,formatDay:Pn,formatMonthCaption:On,formatWeekNumber:Sn,formatWeekdayName:jn,formatYearCaption:Wn}),Yn=function(e,t,n){return R(e,"do MMMM (EEEE)",n)},Fn=function(){return"Month: "},En=function(){return"Go to next month"},Ln=function(){return"Go to previous month"},In=function(e,t){return R(e,"cccc",t)},Rn=function(e){return"Week n. ".concat(e)},Bn=function(){return"Year: "},Hn=Object.freeze({__proto__:null,labelDay:Yn,labelMonthDropdown:Fn,labelNext:En,labelPrevious:Ln,labelWeekNumber:Rn,labelWeekday:In,labelYearDropdown:Bn});function An(){var e="buttons",t=Nn,n=He,a={},r={},o=1,i={},s=new Date;return{captionLayout:e,classNames:t,formatters:Tn,labels:Hn,locale:n,modifiersClassNames:a,modifiers:r,numberOfMonths:o,styles:i,today:s,mode:"default"}}function qn(e){var t=e.fromYear,n=e.toYear,a=e.fromMonth,r=e.toMonth,o=e.fromDate,i=e.toDate;return a?o=O(a):t&&(o=new Date(t,0,1)),r?i=be(r):n&&(i=new Date(n,11,31)),{fromDate:o?A(o):void 0,toDate:i?A(i):void 0}}var ze=D.createContext(void 0);function Qn(e){var t,n=e.initialProps,a=An(),r=qn(n),o=r.fromDate,i=r.toDate,s=(t=n.captionLayout)!==null&&t!==void 0?t:a.captionLayout;s!=="buttons"&&(!o||!i)&&(s="buttons");var c;(te(n)||U(n)||J(n))&&(c=n.onSelect);var d=g(g(g({},a),n),{captionLayout:s,classNames:g(g({},a.classNames),n.classNames),components:g({},n.components),formatters:g(g({},a.formatters),n.formatters),fromDate:o,labels:g(g({},a.labels),n.labels),mode:n.mode||a.mode,modifiers:g(g({},a.modifiers),n.modifiers),modifiersClassNames:g(g({},a.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:g(g({},a.styles),n.styles),toDate:i});return u.jsx(ze.Provider,{value:d,children:e.children})}function M(){var e=D.useContext(ze);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Ue(e){var t=M(),n=t.locale,a=t.classNames,r=t.styles,o=t.formatters.formatCaption;return u.jsx("div",{className:a.caption_label,style:r.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function Xn(e){return u.jsx("svg",g({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:u.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Je(e){var t,n,a=e.onChange,r=e.value,o=e.children,i=e.caption,s=e.className,c=e.style,d=M(),l=(n=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Xn;return u.jsxs("div",{className:s,style:c,children:[u.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),u.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:r,onChange:a,children:o}),u.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[i,u.jsx(l,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function Vn(e){var t,n=M(),a=n.fromDate,r=n.toDate,o=n.styles,i=n.locale,s=n.formatters.formatMonthCaption,c=n.classNames,d=n.components,l=n.labels.labelMonthDropdown;if(!a)return u.jsx(u.Fragment,{});if(!r)return u.jsx(u.Fragment,{});var f=[];if(Mn(a,r))for(var h=O(a),m=a.getMonth();m<=r.getMonth();m++)f.push(le(h,m));else for(var h=O(new Date),m=0;m<=11;m++)f.push(le(h,m));var y=function(p){var N=Number(p.target.value),k=le(O(e.displayMonth),N);e.onChange(k)},x=(t=d?.Dropdown)!==null&&t!==void 0?t:Je;return u.jsx(x,{name:"months","aria-label":l(),className:c.dropdown_month,style:o.dropdown_month,onChange:y,value:e.displayMonth.getMonth(),caption:s(e.displayMonth,{locale:i}),children:f.map(function(p){return u.jsx("option",{value:p.getMonth(),children:s(p,{locale:i})},p.getMonth())})})}function Gn(e){var t,n=e.displayMonth,a=M(),r=a.fromDate,o=a.toDate,i=a.locale,s=a.styles,c=a.classNames,d=a.components,l=a.formatters.formatYearCaption,f=a.labels.labelYearDropdown,h=[];if(!r)return u.jsx(u.Fragment,{});if(!o)return u.jsx(u.Fragment,{});for(var m=r.getFullYear(),y=o.getFullYear(),x=m;x<=y;x++)h.push(Te(Re(new Date),x));var p=function(k){var q=Te(O(n),Number(k.target.value));e.onChange(q)},N=(t=d?.Dropdown)!==null&&t!==void 0?t:Je;return u.jsx(N,{name:"years","aria-label":f(),className:c.dropdown_year,style:s.dropdown_year,onChange:p,value:n.getFullYear(),caption:l(n,{locale:i}),children:h.map(function(k){return u.jsx("option",{value:k.getFullYear(),children:l(k,{locale:i})},k.getFullYear())})})}function zn(e,t){var n=D.useState(e),a=n[0],r=n[1],o=t===void 0?a:t;return[o,r]}function Un(e){var t=e.month,n=e.defaultMonth,a=e.today,r=t||n||a||new Date,o=e.toDate,i=e.fromDate,s=e.numberOfMonths,c=s===void 0?1:s;if(o&&G(o,r)<0){var d=-1*(c-1);r=j(o,d)}return i&&G(r,i)<0&&(r=i),O(r)}function Jn(){var e=M(),t=Un(e),n=zn(t,e.month),a=n[0],r=n[1],o=function(i){var s;if(!e.disableNavigation){var c=O(i);r(c),(s=e.onMonthChange)===null||s===void 0||s.call(e,c)}};return[a,o]}function Kn(e,t){for(var n=t.reverseMonths,a=t.numberOfMonths,r=O(e),o=O(j(r,a)),i=G(o,r),s=[],c=0;c<i;c++){var d=j(r,c);s.push(d)}return n&&(s=s.reverse()),s}function $n(e,t){if(!t.disableNavigation){var n=t.toDate,a=t.pagedNavigation,r=t.numberOfMonths,o=r===void 0?1:r,i=a?o:1,s=O(e);if(!n)return j(s,i);var c=G(n,e);if(!(c<o))return j(s,i)}}function Zn(e,t){if(!t.disableNavigation){var n=t.fromDate,a=t.pagedNavigation,r=t.numberOfMonths,o=r===void 0?1:r,i=a?o:1,s=O(e);if(!n)return j(s,-i);var c=G(s,n);if(!(c<=0))return j(s,-i)}}var Ke=D.createContext(void 0);function ea(e){var t=M(),n=Jn(),a=n[0],r=n[1],o=Kn(a,t),i=$n(a,t),s=Zn(a,t),c=function(f){return o.some(function(h){return we(f,h)})},d=function(f,h){c(f)||(h&&Ve(f,h)?r(j(f,1+t.numberOfMonths*-1)):r(f))},l={currentMonth:a,displayMonths:o,goToMonth:r,goToDate:d,previousMonth:s,nextMonth:i,isDateDisplayed:c};return u.jsx(Ke.Provider,{value:l,children:e.children})}function K(){var e=D.useContext(Ke);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function Ye(e){var t,n=M(),a=n.classNames,r=n.styles,o=n.components,i=K().goToMonth,s=function(l){i(j(l,e.displayIndex?-e.displayIndex:0))},c=(t=o?.CaptionLabel)!==null&&t!==void 0?t:Ue,d=u.jsx(c,{id:e.id,displayMonth:e.displayMonth});return u.jsxs("div",{className:a.caption_dropdowns,style:r.caption_dropdowns,children:[u.jsx("div",{className:a.vhidden,children:d}),u.jsx(Vn,{onChange:s,displayMonth:e.displayMonth}),u.jsx(Gn,{onChange:s,displayMonth:e.displayMonth})]})}function ta(e){return u.jsx("svg",g({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:u.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function na(e){return u.jsx("svg",g({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:u.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var ee=D.forwardRef(function(e,t){var n=M(),a=n.classNames,r=n.styles,o=[a.button_reset,a.button];e.className&&o.push(e.className);var i=o.join(" "),s=g(g({},r.button_reset),r.button);return e.style&&Object.assign(s,e.style),u.jsx("button",g({},e,{ref:t,type:"button",className:i,style:s}))});function aa(e){var t,n,a=M(),r=a.dir,o=a.locale,i=a.classNames,s=a.styles,c=a.labels,d=c.labelPrevious,l=c.labelNext,f=a.components;if(!e.nextMonth&&!e.previousMonth)return u.jsx(u.Fragment,{});var h=d(e.previousMonth,{locale:o}),m=[i.nav_button,i.nav_button_previous].join(" "),y=l(e.nextMonth,{locale:o}),x=[i.nav_button,i.nav_button_next].join(" "),p=(t=f?.IconRight)!==null&&t!==void 0?t:na,N=(n=f?.IconLeft)!==null&&n!==void 0?n:ta;return u.jsxs("div",{className:i.nav,style:s.nav,children:[!e.hidePrevious&&u.jsx(ee,{name:"previous-month","aria-label":h,className:m,style:s.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:r==="rtl"?u.jsx(p,{className:i.nav_icon,style:s.nav_icon}):u.jsx(N,{className:i.nav_icon,style:s.nav_icon})}),!e.hideNext&&u.jsx(ee,{name:"next-month","aria-label":y,className:x,style:s.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:r==="rtl"?u.jsx(N,{className:i.nav_icon,style:s.nav_icon}):u.jsx(p,{className:i.nav_icon,style:s.nav_icon})})]})}function Fe(e){var t=M().numberOfMonths,n=K(),a=n.previousMonth,r=n.nextMonth,o=n.goToMonth,i=n.displayMonths,s=i.findIndex(function(y){return we(e.displayMonth,y)}),c=s===0,d=s===i.length-1,l=t>1&&(c||!d),f=t>1&&(d||!c),h=function(){a&&o(a)},m=function(){r&&o(r)};return u.jsx(aa,{displayMonth:e.displayMonth,hideNext:l,hidePrevious:f,nextMonth:r,previousMonth:a,onPreviousClick:h,onNextClick:m})}function ra(e){var t,n=M(),a=n.classNames,r=n.disableNavigation,o=n.styles,i=n.captionLayout,s=n.components,c=(t=s?.CaptionLabel)!==null&&t!==void 0?t:Ue,d;return r?d=u.jsx(c,{id:e.id,displayMonth:e.displayMonth}):i==="dropdown"?d=u.jsx(Ye,{displayMonth:e.displayMonth,id:e.id}):i==="dropdown-buttons"?d=u.jsxs(u.Fragment,{children:[u.jsx(Ye,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),u.jsx(Fe,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=u.jsxs(u.Fragment,{children:[u.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),u.jsx(Fe,{displayMonth:e.displayMonth,id:e.id})]}),u.jsx("div",{className:a.caption,style:o.caption,children:d})}function oa(e){var t=M(),n=t.footer,a=t.styles,r=t.classNames.tfoot;return n?u.jsx("tfoot",{className:r,style:a.tfoot,children:u.jsx("tr",{children:u.jsx("td",{colSpan:8,children:n})})}):u.jsx(u.Fragment,{})}function ia(e,t,n){for(var a=n?I(new Date):Y(new Date,{locale:e,weekStartsOn:t}),r=[],o=0;o<7;o++){var i=C(a,o);r.push(i)}return r}function sa(){var e=M(),t=e.classNames,n=e.styles,a=e.showWeekNumber,r=e.locale,o=e.weekStartsOn,i=e.ISOWeek,s=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=ia(r,o,i);return u.jsxs("tr",{style:n.head_row,className:t.head_row,children:[a&&u.jsx("td",{style:n.head_cell,className:t.head_cell}),d.map(function(l,f){return u.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(l,{locale:r}),children:s(l,{locale:r})},f)})]})}function ua(){var e,t=M(),n=t.classNames,a=t.styles,r=t.components,o=(e=r?.HeadRow)!==null&&e!==void 0?e:sa;return u.jsx("thead",{style:a.head,className:n.head,children:u.jsx(o,{})})}function la(e){var t=M(),n=t.locale,a=t.formatters.formatDay;return u.jsx(u.Fragment,{children:a(e.date,{locale:n})})}var xe=D.createContext(void 0);function ca(e){if(!U(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return u.jsx(xe.Provider,{value:t,children:e.children})}return u.jsx(da,{initialProps:e.initialProps,children:e.children})}function da(e){var t=e.initialProps,n=e.children,a=t.selected,r=t.min,o=t.max,i=function(d,l,f){var h,m;(h=t.onDayClick)===null||h===void 0||h.call(t,d,l,f);var y=!!(l.selected&&r&&a?.length===r);if(!y){var x=!!(!l.selected&&o&&a?.length===o);if(!x){var p=a?Ge([],a):[];if(l.selected){var N=p.findIndex(function(k){return P(d,k)});p.splice(N,1)}else p.push(d);(m=t.onSelect)===null||m===void 0||m.call(t,p,d,l,f)}}},s={disabled:[]};a&&s.disabled.push(function(d){var l=o&&a.length>o-1,f=a.some(function(h){return P(h,d)});return!!(l&&!f)});var c={selected:a,onDayClick:i,modifiers:s};return u.jsx(xe.Provider,{value:c,children:n})}function _e(){var e=D.useContext(xe);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function fa(e,t){var n=t||{},a=n.from,r=n.to;return a&&r?P(r,e)&&P(a,e)?void 0:P(r,e)?{from:r,to:void 0}:P(a,e)?void 0:ve(a,e)?{from:e,to:r}:{from:a,to:e}:r?ve(e,r)?{from:r,to:e}:{from:e,to:r}:a?Ve(e,a)?{from:e,to:a}:{from:a,to:e}:{from:e,to:void 0}}var De=D.createContext(void 0);function ha(e){if(!J(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return u.jsx(De.Provider,{value:t,children:e.children})}return u.jsx(ma,{initialProps:e.initialProps,children:e.children})}function ma(e){var t=e.initialProps,n=e.children,a=t.selected,r=a||{},o=r.from,i=r.to,s=t.min,c=t.max,d=function(m,y,x){var p,N;(p=t.onDayClick)===null||p===void 0||p.call(t,m,y,x);var k=fa(m,a);(N=t.onSelect)===null||N===void 0||N.call(t,k,m,y,x)},l={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(l.range_start=[o],i?(l.range_end=[i],P(o,i)||(l.range_middle=[{after:o,before:i}])):l.range_end=[o]):i&&(l.range_start=[i],l.range_end=[i]),s&&(o&&!i&&l.disabled.push({after:ue(o,s-1),before:C(o,s-1)}),o&&i&&l.disabled.push({after:o,before:C(o,s-1)}),!o&&i&&l.disabled.push({after:ue(i,s-1),before:C(i,s-1)})),c){if(o&&!i&&(l.disabled.push({before:C(o,-c+1)}),l.disabled.push({after:C(o,c-1)})),o&&i){var f=T(i,o)+1,h=c-f;l.disabled.push({before:ue(o,h)}),l.disabled.push({after:C(i,h)})}!o&&i&&(l.disabled.push({before:C(i,-c+1)}),l.disabled.push({after:C(i,c-1)}))}return u.jsx(De.Provider,{value:{selected:a,onDayClick:d,modifiers:l},children:n})}function Me(){var e=D.useContext(De);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function $(e){return Array.isArray(e)?Ge([],e):e!==void 0?[e]:[]}function va(e){var t={};return Object.entries(e).forEach(function(n){var a=n[0],r=n[1];t[a]=$(r)}),t}var W;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(W||(W={}));var ya=W.Selected,F=W.Disabled,ga=W.Hidden,ba=W.Today,ce=W.RangeEnd,de=W.RangeMiddle,fe=W.RangeStart,pa=W.Outside;function wa(e,t,n){var a,r=(a={},a[ya]=$(e.selected),a[F]=$(e.disabled),a[ga]=$(e.hidden),a[ba]=[e.today],a[ce]=[],a[de]=[],a[fe]=[],a[pa]=[],a);return e.fromDate&&r[F].push({before:e.fromDate}),e.toDate&&r[F].push({after:e.toDate}),U(e)?r[F]=r[F].concat(t.modifiers[F]):J(e)&&(r[F]=r[F].concat(n.modifiers[F]),r[fe]=n.modifiers[fe],r[de]=n.modifiers[de],r[ce]=n.modifiers[ce]),r}var $e=D.createContext(void 0);function xa(e){var t=M(),n=_e(),a=Me(),r=wa(t,n,a),o=va(t.modifiers),i=g(g({},r),o);return u.jsx($e.Provider,{value:i,children:e.children})}function Ze(){var e=D.useContext($e);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function _a(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Da(e){return!!(e&&typeof e=="object"&&"from"in e)}function Ma(e){return!!(e&&typeof e=="object"&&"after"in e)}function ka(e){return!!(e&&typeof e=="object"&&"before"in e)}function Na(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Ca(e,t){var n,a=t.from,r=t.to;if(a&&r){var o=T(r,a)<0;o&&(n=[r,a],a=n[0],r=n[1]);var i=T(e,a)>=0&&T(r,e)>=0;return i}return r?P(r,e):a?P(a,e):!1}function Pa(e){return ge(e)}function Oa(e){return Array.isArray(e)&&e.every(ge)}function Sa(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Pa(n))return P(e,n);if(Oa(n))return n.includes(e);if(Da(n))return Ca(e,n);if(Na(n))return n.dayOfWeek.includes(e.getDay());if(_a(n)){var a=T(n.before,e),r=T(n.after,e),o=a>0,i=r<0,s=ve(n.before,n.after);return s?i&&o:o||i}return Ma(n)?T(e,n.after)>0:ka(n)?T(n.before,e)>0:typeof n=="function"?n(e):!1})}function ke(e,t,n){var a=Object.keys(t).reduce(function(o,i){var s=t[i];return Sa(e,s)&&o.push(i),o},[]),r={};return a.forEach(function(o){return r[o]=!0}),n&&!we(e,n)&&(r.outside=!0),r}function ja(e,t){for(var n=O(e[0]),a=be(e[e.length-1]),r,o,i=n;i<=a;){var s=ke(i,t),c=!s.disabled&&!s.hidden;if(!c){i=C(i,1);continue}if(s.selected)return i;s.today&&!o&&(o=i),r||(r=i),i=C(i,1)}return o||r}var Wa=365;function et(e,t){var n=t.moveBy,a=t.direction,r=t.context,o=t.modifiers,i=t.retry,s=i===void 0?{count:0,lastFocused:e}:i,c=r.weekStartsOn,d=r.fromDate,l=r.toDate,f=r.locale,h={day:C,week:me,month:j,year:pt,startOfWeek:function(p){return r.ISOWeek?I(p):Y(p,{locale:f,weekStartsOn:c})},endOfWeek:function(p){return r.ISOWeek?Be(p):pe(p,{locale:f,weekStartsOn:c})}},m=h[n](e,a==="after"?1:-1);a==="before"&&d?m=wt([d,m]):a==="after"&&l&&(m=xt([l,m]));var y=!0;if(o){var x=ke(m,o);y=!x.disabled&&!x.hidden}return y?m:s.count>Wa?s.lastFocused:et(m,{moveBy:n,direction:a,context:r,modifiers:o,retry:g(g({},s),{count:s.count+1})})}var tt=D.createContext(void 0);function Ta(e){var t=K(),n=Ze(),a=D.useState(),r=a[0],o=a[1],i=D.useState(),s=i[0],c=i[1],d=ja(t.displayMonths,n),l=r??(s&&t.isDateDisplayed(s))?s:d,f=function(){c(r),o(void 0)},h=function(p){o(p)},m=M(),y=function(p,N){if(r){var k=et(r,{moveBy:p,direction:N,context:m,modifiers:n});P(r,k)||(t.goToDate(k,r),h(k))}},x={focusedDay:r,focusTarget:l,blur:f,focus:h,focusDayAfter:function(){return y("day","after")},focusDayBefore:function(){return y("day","before")},focusWeekAfter:function(){return y("week","after")},focusWeekBefore:function(){return y("week","before")},focusMonthBefore:function(){return y("month","before")},focusMonthAfter:function(){return y("month","after")},focusYearBefore:function(){return y("year","before")},focusYearAfter:function(){return y("year","after")},focusStartOfWeek:function(){return y("startOfWeek","before")},focusEndOfWeek:function(){return y("endOfWeek","after")}};return u.jsx(tt.Provider,{value:x,children:e.children})}function Ne(){var e=D.useContext(tt);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Ya(e,t){var n=Ze(),a=ke(e,n,t);return a}var Ce=D.createContext(void 0);function Fa(e){if(!te(e.initialProps)){var t={selected:void 0};return u.jsx(Ce.Provider,{value:t,children:e.children})}return u.jsx(Ea,{initialProps:e.initialProps,children:e.children})}function Ea(e){var t=e.initialProps,n=e.children,a=function(o,i,s){var c,d,l;if((c=t.onDayClick)===null||c===void 0||c.call(t,o,i,s),i.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,o,i,s);return}(l=t.onSelect)===null||l===void 0||l.call(t,o,o,i,s)},r={selected:t.selected,onDayClick:a};return u.jsx(Ce.Provider,{value:r,children:n})}function nt(){var e=D.useContext(Ce);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function La(e,t){var n=M(),a=nt(),r=_e(),o=Me(),i=Ne(),s=i.focusDayAfter,c=i.focusDayBefore,d=i.focusWeekAfter,l=i.focusWeekBefore,f=i.blur,h=i.focus,m=i.focusMonthBefore,y=i.focusMonthAfter,x=i.focusYearBefore,p=i.focusYearAfter,N=i.focusStartOfWeek,k=i.focusEndOfWeek,q=function(b){var v,re,oe,ie;te(n)?(v=a.onDayClick)===null||v===void 0||v.call(a,e,t,b):U(n)?(re=r.onDayClick)===null||re===void 0||re.call(r,e,t,b):J(n)?(oe=o.onDayClick)===null||oe===void 0||oe.call(o,e,t,b):(ie=n.onDayClick)===null||ie===void 0||ie.call(n,e,t,b)},ne=function(b){var v;h(e),(v=n.onDayFocus)===null||v===void 0||v.call(n,e,t,b)},ae=function(b){var v;f(),(v=n.onDayBlur)===null||v===void 0||v.call(n,e,t,b)},Q=function(b){var v;(v=n.onDayMouseEnter)===null||v===void 0||v.call(n,e,t,b)},at=function(b){var v;(v=n.onDayMouseLeave)===null||v===void 0||v.call(n,e,t,b)},rt=function(b){var v;(v=n.onDayPointerEnter)===null||v===void 0||v.call(n,e,t,b)},ot=function(b){var v;(v=n.onDayPointerLeave)===null||v===void 0||v.call(n,e,t,b)},it=function(b){var v;(v=n.onDayTouchCancel)===null||v===void 0||v.call(n,e,t,b)},st=function(b){var v;(v=n.onDayTouchEnd)===null||v===void 0||v.call(n,e,t,b)},ut=function(b){var v;(v=n.onDayTouchMove)===null||v===void 0||v.call(n,e,t,b)},lt=function(b){var v;(v=n.onDayTouchStart)===null||v===void 0||v.call(n,e,t,b)},ct=function(b){var v;(v=n.onDayKeyUp)===null||v===void 0||v.call(n,e,t,b)},dt=function(b){var v;switch(b.key){case"ArrowLeft":b.preventDefault(),b.stopPropagation(),n.dir==="rtl"?s():c();break;case"ArrowRight":b.preventDefault(),b.stopPropagation(),n.dir==="rtl"?c():s();break;case"ArrowDown":b.preventDefault(),b.stopPropagation(),d();break;case"ArrowUp":b.preventDefault(),b.stopPropagation(),l();break;case"PageUp":b.preventDefault(),b.stopPropagation(),b.shiftKey?x():m();break;case"PageDown":b.preventDefault(),b.stopPropagation(),b.shiftKey?p():y();break;case"Home":b.preventDefault(),b.stopPropagation(),N();break;case"End":b.preventDefault(),b.stopPropagation(),k();break}(v=n.onDayKeyDown)===null||v===void 0||v.call(n,e,t,b)},ft={onClick:q,onFocus:ne,onBlur:ae,onKeyDown:dt,onKeyUp:ct,onMouseEnter:Q,onMouseLeave:at,onPointerEnter:rt,onPointerLeave:ot,onTouchCancel:it,onTouchEnd:st,onTouchMove:ut,onTouchStart:lt};return ft}function Ia(){var e=M(),t=nt(),n=_e(),a=Me(),r=te(e)?t.selected:U(e)?n.selected:J(e)?a.selected:void 0;return r}function Ra(e){return Object.values(W).includes(e)}function Ba(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(a){var r=e.modifiersClassNames[a];if(r)n.push(r);else if(Ra(a)){var o=e.classNames["day_".concat(a)];o&&n.push(o)}}),n}function Ha(e,t){var n=g({},e.styles.day);return Object.keys(t).forEach(function(a){var r;n=g(g({},n),(r=e.modifiersStyles)===null||r===void 0?void 0:r[a])}),n}function Aa(e,t,n){var a,r,o,i=M(),s=Ne(),c=Ya(e,t),d=La(e,c),l=Ia(),f=!!(i.onDayClick||i.mode!=="default");D.useEffect(function(){var Q;c.outside||s.focusedDay&&f&&P(s.focusedDay,e)&&((Q=n.current)===null||Q===void 0||Q.focus())},[s.focusedDay,e,n,f,c.outside]);var h=Ba(i,c).join(" "),m=Ha(i,c),y=!!(c.outside&&!i.showOutsideDays||c.hidden),x=(o=(r=i.components)===null||r===void 0?void 0:r.DayContent)!==null&&o!==void 0?o:la,p=u.jsx(x,{date:e,displayMonth:t,activeModifiers:c}),N={style:m,className:h,children:p,role:"gridcell"},k=s.focusTarget&&P(s.focusTarget,e)&&!c.outside,q=s.focusedDay&&P(s.focusedDay,e),ne=g(g(g({},N),(a={disabled:c.disabled,role:"gridcell"},a["aria-selected"]=c.selected,a.tabIndex=q||k?0:-1,a)),d),ae={isButton:f,isHidden:y,activeModifiers:c,selectedDays:l,buttonProps:ne,divProps:N};return ae}function qa(e){var t=D.useRef(null),n=Aa(e.date,e.displayMonth,t);return n.isHidden?u.jsx("div",{role:"gridcell"}):n.isButton?u.jsx(ee,g({name:"day",ref:t},n.buttonProps)):u.jsx("div",g({},n.divProps))}function Qa(e){var t=e.number,n=e.dates,a=M(),r=a.onWeekNumberClick,o=a.styles,i=a.classNames,s=a.locale,c=a.labels.labelWeekNumber,d=a.formatters.formatWeekNumber,l=d(Number(t),{locale:s});if(!r)return u.jsx("span",{className:i.weeknumber,style:o.weeknumber,children:l});var f=c(Number(t),{locale:s}),h=function(m){r(t,n,m)};return u.jsx(ee,{name:"week-number","aria-label":f,className:i.weeknumber,style:o.weeknumber,onClick:h,children:l})}function Xa(e){var t,n,a=M(),r=a.styles,o=a.classNames,i=a.showWeekNumber,s=a.components,c=(t=s?.Day)!==null&&t!==void 0?t:qa,d=(n=s?.WeekNumber)!==null&&n!==void 0?n:Qa,l;return i&&(l=u.jsx("td",{className:o.cell,style:r.cell,children:u.jsx(d,{number:e.weekNumber,dates:e.dates})})),u.jsxs("tr",{className:o.row,style:r.row,children:[l,e.dates.map(function(f){return u.jsx("td",{className:o.cell,style:r.cell,role:"presentation",children:u.jsx(c,{displayMonth:e.displayMonth,date:f})},xn(f))})]})}function Ee(e,t,n){for(var a=n?.ISOWeek?Be(t):pe(t,n),r=n?.ISOWeek?I(e):Y(e,n),o=T(a,r),i=[],s=0;s<=o;s++)i.push(C(r,s));var c=i.reduce(function(d,l){var f=n?.ISOWeek?Ae(l):Qe(l,n),h=d.find(function(m){return m.weekNumber===f});return h?(h.dates.push(l),d):(d.push({weekNumber:f,dates:[l]}),d)},[]);return c}function Va(e,t){var n=Ee(O(e),be(e),t);if(t?.useFixedWeeks){var a=Dn(e,t);if(a<6){var r=n[n.length-1],o=r.dates[r.dates.length-1],i=me(o,6-a),s=Ee(me(o,1),i,t);n.push.apply(n,s)}}return n}function Ga(e){var t,n,a,r=M(),o=r.locale,i=r.classNames,s=r.styles,c=r.hideHead,d=r.fixedWeeks,l=r.components,f=r.weekStartsOn,h=r.firstWeekContainsDate,m=r.ISOWeek,y=Va(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:m,locale:o,weekStartsOn:f,firstWeekContainsDate:h}),x=(t=l?.Head)!==null&&t!==void 0?t:ua,p=(n=l?.Row)!==null&&n!==void 0?n:Xa,N=(a=l?.Footer)!==null&&a!==void 0?a:oa;return u.jsxs("table",{id:e.id,className:i.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&u.jsx(x,{}),u.jsx("tbody",{className:i.tbody,style:s.tbody,children:y.map(function(k){return u.jsx(p,{displayMonth:e.displayMonth,dates:k.dates,weekNumber:k.weekNumber},k.weekNumber)})}),u.jsx(N,{displayMonth:e.displayMonth})]})}function za(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Ua=za()?D.useLayoutEffect:D.useEffect,he=!1,Ja=0;function Le(){return"react-day-picker-".concat(++Ja)}function Ka(e){var t,n=e??(he?Le():null),a=D.useState(n),r=a[0],o=a[1];return Ua(function(){r===null&&o(Le())},[]),D.useEffect(function(){he===!1&&(he=!0)},[]),(t=e??r)!==null&&t!==void 0?t:void 0}function $a(e){var t,n,a=M(),r=a.dir,o=a.classNames,i=a.styles,s=a.components,c=K().displayMonths,d=Ka(a.id?"".concat(a.id,"-").concat(e.displayIndex):void 0),l=a.id?"".concat(a.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],h=i.month,m=e.displayIndex===0,y=e.displayIndex===c.length-1,x=!m&&!y;r==="rtl"&&(t=[m,y],y=t[0],m=t[1]),m&&(f.push(o.caption_start),h=g(g({},h),i.caption_start)),y&&(f.push(o.caption_end),h=g(g({},h),i.caption_end)),x&&(f.push(o.caption_between),h=g(g({},h),i.caption_between));var p=(n=s?.Caption)!==null&&n!==void 0?n:ra;return u.jsxs("div",{className:f.join(" "),style:h,children:[u.jsx(p,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),u.jsx(Ga,{id:l,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function Za(e){var t=M(),n=t.classNames,a=t.styles;return u.jsx("div",{className:n.months,style:a.months,children:e.children})}function er(e){var t,n,a=e.initialProps,r=M(),o=Ne(),i=K(),s=D.useState(!1),c=s[0],d=s[1];D.useEffect(function(){r.initialFocus&&o.focusTarget&&(c||(o.focus(o.focusTarget),d(!0)))},[r.initialFocus,c,o.focus,o.focusTarget,o]);var l=[r.classNames.root,r.className];r.numberOfMonths>1&&l.push(r.classNames.multiple_months),r.showWeekNumber&&l.push(r.classNames.with_weeknumber);var f=g(g({},r.styles.root),r.style),h=Object.keys(a).filter(function(y){return y.startsWith("data-")}).reduce(function(y,x){var p;return g(g({},y),(p={},p[x]=a[x],p))},{}),m=(n=(t=a.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Za;return u.jsx("div",g({className:l.join(" "),style:f,dir:r.dir,id:r.id,nonce:a.nonce,title:a.title,lang:a.lang},h,{children:u.jsx(m,{children:i.displayMonths.map(function(y,x){return u.jsx($a,{displayIndex:x,displayMonth:y},x)})})}))}function tr(e){var t=e.children,n=kn(e,["children"]);return u.jsx(Qn,{initialProps:n,children:u.jsx(ea,{children:u.jsx(Fa,{initialProps:n,children:u.jsx(ca,{initialProps:n,children:u.jsx(ha,{initialProps:n,children:u.jsx(xa,{children:u.jsx(Ta,{children:t})})})})})})})}function nr(e){return u.jsx(tr,g({},e,{children:u.jsx(er,{initialProps:e})}))}function ur(e){const t=ht.c(20);let n,a,r,o;t[0]!==e?({className:n,classNames:a,showOutsideDays:o,...r}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=r,t[4]=o):(n=t[1],a=t[2],r=t[3],o=t[4]);const i=o===void 0?!0:o;let s;t[5]!==n?(s=H("p-3",n),t[5]=n,t[6]=s):s=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=H(Pe({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),t[7]=c):c=t[7];const d=r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md";let l;t[8]!==d?(l=H("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",d),t[8]=d,t[9]=l):l=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=H(Pe({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),t[10]=f):f=t[10];let h;t[11]!==a||t[12]!==l?(h={months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:c,nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:l,day:f,day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},t[11]=a,t[12]=l,t[13]=h):h=t[13];let m;t[14]===Symbol.for("react.memo_cache_sentinel")?(m={IconLeft:rr,IconRight:ar},t[14]=m):m=t[14];let y;return t[15]!==r||t[16]!==i||t[17]!==s||t[18]!==h?(y=u.jsx(nr,{showOutsideDays:i,className:s,classNames:h,components:m,...r}),t[15]=r,t[16]=i,t[17]=s,t[18]=h,t[19]=y):y=t[19],y}function ar(e){const{className:t,...n}=e;return u.jsx(vt,{className:H("size-4",t),...n})}function rr(e){const{className:t,...n}=e;return u.jsx(mt,{className:H("size-4",t),...n})}export{ur as C};
@@ -1 +0,0 @@
1
- import{c as q,r as S,l as G,j as t,B as I,i as Q,t as U}from"./index-DF3zg-P1.js";import{i as X}from"./XCircle-cwYbcP7y.js";import{c as T}from"./ZoomOut-_psBJlXD.js";import{n as Y}from"./LinkExternal01-d9EixhiS.js";import{ay as Z}from"./agent-icon-DmIJ53uv.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-3VMQ65hF.js";import{I as M}from"./input-BZTiU0ds.js";import{L}from"./label-B1OfKy2N.js";import{v as mt,w as at,V as nt,o as lt,x as R,A as pt,W as ct,y as dt}from"./index-DonY639O.js";import{c as ut,B as gt,a as xt}from"./block-document-DbCz5f9N.js";import{u as ft}from"./use-autosave-BhfvFfoI.js";import{t as ht}from"./ChevronDown-CQLSXgt3.js";import{J as yt,K as jt,I as vt}from"./automation-runs-yMzfgCqo.js";import{s as v,E as bt}from"./primitives-BxBoeZTE.js";import"./AlertCircle-B6AELEdc.js";import"./UserPlus01-D2pAl0t2.js";import"./Tool01-4pit7qOS.js";import"./ArrowUp-YK2fJPgi.js";import"./Settings02-CM0Uzs0U.js";import"./Tool02-tJKj7JcW.js";import"./ArrowUpRight-BKVLcZTe.js";import"./TrendUp01-7N_6K3-X.js";import"./ZapSquare-Dj8pa8Fg.js";import"./Users03-WVYBBENu.js";import"./CheckCircle-BfxYbuVE.js";import"./Check-BF3t7WWi.js";import"./ChevronRight-Fgy0rUS_.js";import"./ChevronUp-Y-IpPAUR.js";import"./Circle-0HId1SV6.js";import"./Stars02-DBH33Ez2.js";import"./Copy01-B0CQRE_5.js";import"./DotsVertical-CYU3Mae1.js";import"./Globe01-B52VKYy7.js";import"./Eye-CLtdCpUf.js";import"./FilterLines-DeiGsRZY.js";import"./Flag01-B_AKNFoc.js";import"./Star01-B-8espqJ.js";import"./Globe04-B0las6Jv.js";import"./SwitchHorizontal01-DUrn8gXV.js";import"./HardDrive-CU-vvmKE.js";import"./Image01-B-FQwXx8.js";import"./Key01-myvTSA8u.js";import"./LayoutLeft-C0g0LezP.js";import"./List-DZAsltZv.js";import"./Monitor01-BkDBzdlH.js";import"./Sun-MvOAGgKN.js";import"./Package-eNacrLmv.js";import"./Palette-BiKqXWvc.js";import"./Play-CdkPhmTs.js";import"./Plus-DWjKZ2wj.js";import"./SearchLg-DBOWvxyl.js";import"./SearchMd-CKteZWzZ.js";import"./Shield01-aDvWVv5Z.js";import"./Stars01-DsfblQf3.js";import"./Trash01-DEWgFvvg.js";import"./Upload01-C8RP0Fvq.js";import"./User01-v0Bqr3nA.js";import"./Users01-CPNZ7uMu.js";import"./XClose-DnNyN9T-.js";import"./X-Dm6kY_ek.js";import"./Zap-CNRURtEh.js";import"./chat-context-CyCuyn4t.js";import"./autosend-D_-616qs.js";import"./hooks-QHrmNjJQ.js";import"./use-mcp-client-DrROXOcH.js";import"./constants-BHDe7bIw.js";import"./auth-dSVlMQ86.js";import"./decopilot-sse-pool-DHojW3EC.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-bThaob6p.js";import"./use-virtual-mcp-C964oRwj.js";import"./use-collections-K1HyCAfG.js";import"./use-ai-providers-B4nhSJlr.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-BEOY-_n2.js";import"./use-organization-settings-BJ1bjHsL.js";import"./tooltip-O3iHy7-o.js";import"./dialog-CmXDzme5.js";import"./drawer-Ds-r7525.js";import"./collection-search-C4jDpdZf.js";import"./use-mobile-nauPjzo2.js";import"./AreaChart-fCNs67j_.js";import"./index-BjO8A-VO.js";import"./shell-layout-Bo6QxW8m.js";import"./avatar-UXZ4R5Yb.js";import"./required-auth-layout-vPZ2d-Yx.js";import"./use-org-sso-j8hZyqdO.js";import"./form-x0k-kdB2.js";import"./select-B6GE4jHJ.js";import"./tabs-D-6eQ0wE.js";import"./toggle-group-BcxqPGrf.js";import"./use-deco-credits-Bm-VH5Hm.js";import"./extract-connection-data-CK9iLAoG.js";import"./connection-card-CtY9PRIw.js";import"./use-registry-connections-D94L7VqK.js";import"./use-connection-twfWXxwG.js";import"./useInfiniteQuery-DKhJHTs2.js";import"./use-infinite-scroll-Dt7gLdpr.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-dLLzWD0r.js";import"./integration-icon-BfKWLZT4.js";import"./textarea-PYu4eHQV.js";import"./connection-form-helpers-TGmycj7X.js";import"./authenticate-and-persist-oauth-BHT9Kp62.js";import"./mcp-oauth-CoKzxQiz.js";import"./collection-tabs-DvvibY6H.js";import"./badge-CfAmvo-h.js";import"./useSuspenseInfiniteQuery-DAAXTkZt.js";import"./connect-desktop-dialog-CPSwwSyz.js";import"./select-model-CebmAt-C.js";import"./checkbox-CxV2vfbv.js";import"./skeleton-BGZh750P.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DS6otYn7.js";import"./command-EQNrbniG.js";import"./index-CUVgjm02.js";import"./popover-BzHpXFL_.js";import"./dropdown-menu-BgNr7tM1.js";import"./index-BCiDnhhX.js";import"./file-type-icon-DjNFZnTs.js";import"./toolbar-D90MFc80.js";import"./use-debounced-value-xN0eyoO9.js";import"./index-cG8paP3z.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B1YKt2sD.js";import"./empty-state-CdKwtMyP.js";import"./use-mcp-tools-D28ox9dJ.js";import"./use-capability--WeMT0KP.js";import"./toolbar-icon-button-D3m9VnTI.js";import"./use-debounced-autosave-BdWGMbok.js";import"./index-CeqD0RVV.js";import"./sidebar-BFdShy9x.js";import"./search-input-ByuB0YyC.js";import"./use-mcp-auth-status-C7G9bAkb.js";import"./switch-C2KH_TaK.js";import"./use-registry-app-CeyrXTI4.js";import"./github-repo-picker-C-tZ-Bba.js";import"./use-navigate-to-agent-BJC_x779.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./github-repo-scope-DjMZbiKa.js";import"./use-secrets-C1Fme0Ya.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-fc2Z_sCB.js";import"./format-time-BnbuEtat.js";import"./index-DKadkG06.js";import"./get-initials-D-f_fDFw.js";import"./use-members-mvfsRjey.js";import"./use-org-auth-client-jU0nDPT-.js";import"./calendar-BdMqQsTv.js";import"./use-copy-DQ4y4418.js";import"./monaco-editor-BzdwB2U8.js";import"./use-file-configs-Bs9N4w-Z.js";import"./use-automations-C01orYPa.js";import"./automation-list-row-PkSpkeID.js";import"./table-XKbQ5Wjx.js";import"./use-clock-tick-DboEo7Cc.js";function Ct(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,A=b===void 0?!1:b,[x,D]=S.useState(A);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=G("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:D,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function Nr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:A,onManagePosts:x,onOpenPost:D,previewBaseUrl:l}){const i=mt({orgSlug:k,virtualMcpId:e,branch:f}),h=at(b,"categories"),[r,p,c]=ft(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=ut({decofile:d,category:r,previewBaseUrl:l}),m=v(r.slug),[B,y]=S.useState(m),[a,C]=S.useState(null),[N,P]=S.useState(!1),$=m?nt(d).filter(o=>o.categorySlugs.includes(m)):[],j=$.length,W=o=>s("slug",o),H=async(o,w)=>{const V=v(r.name);P(!0);try{let g=0;for(const{key:E,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:V,slug:w});F!==O&&(await i.mutateAsync({blockKey:E,data:R(E,"posts",dt(F))}),g+=1)}const z={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",z)}),c(z),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{P(!1)}},J=()=>{const o=B.trim();if(o===m){B!==o&&y(o);return}if(!o){y(m);return}if(j===0){W(o);return}C({oldSlug:m,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Y,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(bt,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Ct,{icon:Z,title:"Content",defaultOpen:!0,children:t.jsx(gt,{value:xt(r.sections),onChange:o=>s("sections",o),meta:A,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!m,title:m?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(m),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!a,onOpenChange:o=>{o||N||(y(m),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:a?`Changing the slug from "${a.oldSlug}" to "${a.newSlug}" will update ${a.count} ${a.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),a&&H(a.oldSlug,a.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{Nr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as n,l as d,j as c,bE as l,bF as b}from"./index-DF3zg-P1.js";import{i as m}from"./Check-BF3t7WWi.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
@@ -1 +0,0 @@
1
- import{c as y,j as t,B as F,i as Z,H as Ge,I as se,E as Pe,r as T,C as le,M as Qe,l as V,bd as Ye,u as Ze,L as G,t as Xe,e as ae,aZ as ke}from"./index-DF3zg-P1.js";import{E as Ee}from"./empty-state-CdKwtMyP.js";import{u as et,a as Ae}from"./use-collections-K1HyCAfG.js";import{u as ce}from"./use-mcp-client-DrROXOcH.js";import{F as ne,a as tt,b as de,d as me}from"./form-x0k-kdB2.js";import{I as ue}from"./input-BZTiU0ds.js";import{T as re}from"./textarea-PYu4eHQV.js";import{a as st,b as nt,V as pe,O as ot,M as it}from"./index-T-oY3h3t.js";import{ak as rt,K as lt,ag as at,P as ct,_ as dt,al as mt,T as be}from"./agent-icon-DmIJ53uv.js";import{g as ut,M as pt,a as Ne}from"./index-BjO8A-VO.js";import{A as xt,a as ft,b as ht}from"./alert-XkDwazoe.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-B6GE4jHJ.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-O3iHy7-o.js";import{i as jt}from"./AlertCircle-B6AELEdc.js";import{s as bt}from"./Stars02-DBH33Ez2.js";import{a as Nt}from"./Copy01-B0CQRE_5.js";import{i as vt}from"./Play-CdkPhmTs.js";import{i as St}from"./ChevronRight-Fgy0rUS_.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./use-mcp-auth-status-C7G9bAkb.js";import{a as Oe,u as Re}from"./use-connection-twfWXxwG.js";import{a as It}from"./use-mcp-tools-D28ox9dJ.js";import{M as $t,c as Tt}from"./monaco-editor-BzdwB2U8.js";import{I as Te}from"./integration-icon-BfKWLZT4.js";import{h as Pt,m as kt}from"./chat-context-CyCuyn4t.js";import{u as Et}from"./shell-layout-Bo6QxW8m.js";import{n as At}from"./Tool02-tJKj7JcW.js";import"./constants-BHDe7bIw.js";import"./auth-dSVlMQ86.js";import"./label-B1OfKy2N.js";import"./index-CeqD0RVV.js";import"./sidebar-BFdShy9x.js";import"./LayoutLeft-C0g0LezP.js";import"./use-mobile-nauPjzo2.js";import"./X-Dm6kY_ek.js";import"./ZoomOut-_psBJlXD.js";import"./Key01-myvTSA8u.js";import"./extract-connection-data-CK9iLAoG.js";import"./use-registry-connections-D94L7VqK.js";import"./use-organization-settings-BJ1bjHsL.js";import"./studio-tools-bThaob6p.js";import"./Plus-DWjKZ2wj.js";import"./index-C-B6S6Q9.js";import"./index-CUVgjm02.js";import"./popover-BzHpXFL_.js";import"./use-virtual-mcp-C964oRwj.js";import"./Check-BF3t7WWi.js";import"./SearchMd-CKteZWzZ.js";import"./Users03-WVYBBENu.js";import"./use-create-virtual-mcp-NwJ9x5Kd.js";import"./use-navigate-to-agent-BJC_x779.js";import"./hooks-QHrmNjJQ.js";import"./decopilot-sse-pool-DHojW3EC.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./UserPlus01-D2pAl0t2.js";import"./Tool01-4pit7qOS.js";import"./ArrowUp-YK2fJPgi.js";import"./Settings02-CM0Uzs0U.js";import"./XCircle-cwYbcP7y.js";import"./ArrowUpRight-BKVLcZTe.js";import"./TrendUp01-7N_6K3-X.js";import"./ZapSquare-Dj8pa8Fg.js";import"./CheckCircle-BfxYbuVE.js";import"./ChevronDown-CQLSXgt3.js";import"./ChevronUp-Y-IpPAUR.js";import"./Circle-0HId1SV6.js";import"./DotsVertical-CYU3Mae1.js";import"./Globe01-B52VKYy7.js";import"./Eye-CLtdCpUf.js";import"./FilterLines-DeiGsRZY.js";import"./Flag01-B_AKNFoc.js";import"./Star01-B-8espqJ.js";import"./Globe04-B0las6Jv.js";import"./SwitchHorizontal01-DUrn8gXV.js";import"./HardDrive-CU-vvmKE.js";import"./Image01-B-FQwXx8.js";import"./LinkExternal01-d9EixhiS.js";import"./List-DZAsltZv.js";import"./Monitor01-BkDBzdlH.js";import"./Sun-MvOAGgKN.js";import"./Package-eNacrLmv.js";import"./Palette-BiKqXWvc.js";import"./SearchLg-DBOWvxyl.js";import"./Shield01-aDvWVv5Z.js";import"./Stars01-DsfblQf3.js";import"./Trash01-DEWgFvvg.js";import"./Upload01-C8RP0Fvq.js";import"./User01-v0Bqr3nA.js";import"./Users01-CPNZ7uMu.js";import"./XClose-DnNyN9T-.js";import"./Zap-CNRURtEh.js";import"./badge-CfAmvo-h.js";import"./mcp-oauth-CoKzxQiz.js";import"./index-cG8paP3z.js";import"./autosend-D_-616qs.js";import"./use-ai-providers-B4nhSJlr.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-BEOY-_n2.js";import"./avatar-UXZ4R5Yb.js";import"./dialog-CmXDzme5.js";import"./required-auth-layout-vPZ2d-Yx.js";import"./use-org-sso-j8hZyqdO.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:i,isSaving:r,saveLabel:a,undoLabel:c}=s,l=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!i)return null;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(rt,{size:14}),e[0]=p):p=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[p,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let x;e[5]!==r?(x=r?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(lt,{size:14}),e[5]=r,e[6]=x):x=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==x?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":l,children:[x,l]}),e[7]=r,e[8]=o,e[9]=l,e[10]=x,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function ie(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let i;e[1]!==o.control?(i=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=i):i=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsx(tt,{...o,children:l}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:i}=le(),r=o||null;let a;e[0]!==i.id||e[1]!==i.slug||e[2]!==r?(a={connectionId:r,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),l=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),p=u.update.isPending;let m;e[4]!==l?(m=l?{title:l.title,description:l.description??null,body:ie(l)}:void 0,e[4]=l,e[5]=m):m=e[5];let x;e[6]!==m?(x={values:m},e[6]=m,e[7]=x):x=e[7];const f=Qe(x);let g;e[8]!==f||e[9]!==l?(g=()=>{l&&f.reset({title:l.title,description:l.description??null,body:ie(l)})},e[8]=f,e[9]=l,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:ie(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!l){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==l.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:l.title}),e[16]=l.title,e[17]=$):$=e[17];let E;e[18]!==l.description?(E=l.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:l.description})]}):null,e[18]=l.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==p||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:p})}),e[25]=f.formState.isDirty,e[26]=p,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(pe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const i=n;if(!i){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:i,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,i;e[0]!==s?({asChild:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==i||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...i}),e[6]=r,e[7]=i,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,i;e[0]!==s?({children:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==i||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...i,children:a}),e[8]=i,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:i,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const l=wt(c);if(!l.isAuthenticated){let m;return e[2]!==l.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(it,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let p;return e[5]!==n||e[6]!==r||e[7]!==i||e[8]!==u||e[9]!==o?(p=t.jsx(Vt,{toolName:o,connectionId:n,siblings:i,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=i,e[8]=u,e[9]=o,e[10]=p):p=e[10],p}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:i}=Ze({strict:!1}),r=(()=>{if(!i)return null;const d=`replay-${i}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,l]=T.useState(a??{}),[u,p]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,x]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=le(),k=Oe(e),N=Pt(),A=kt(),{openSidePanel:U}=Et(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=Tt(d.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,X]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(X("ui"),Le(!0));const xe=j?.inputSchema?.properties,fe=xe?Object.keys(xe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),x(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);x(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{l(v=>({...v,[d]:h}))},Be=()=>{x(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>p(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(pt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx($t,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(pe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):L.isLoading?t.jsx(Z,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:i}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(x=>x.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const l=c;if(!Oe(l||void 0)||!l){let x;return e[3]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=x):x=e[3],x}let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=p):p=e[4];let m;return e[5]!==l||e[6]!==i||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:p,children:t.jsx(Ft,{toolName:o,connectionId:l,siblings:n,onSelectInstance:a,onBack:i})}),e[5]=l,e[6]=i,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:i,description:r,buttonProps:a,buttonComponent:c,className:l,children:u}=s;let p;e[0]!==l?(p=V("flex flex-col items-center justify-center py-16 text-center",l),e[0]=l,e[1]=p):p=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let x;e[5]!==i?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:i}),e[5]=i,e[6]=x):x=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==x||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[x,f]}),e[9]=x,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==p||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:p,children:[m,g,S,u]}),e[15]=u,e[16]=p,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const l=c,u=Wt;let p;return s[5]!==l||s[6]!==i||s[7]!==a?(p=t.jsx(Jt,{itemId:i,siblings:a,onBack:l,onUpdate:u}),s[5]=l,s[6]=i,s[7]=a,s[8]=p):p=s[8],p}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:l}=le();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,x=m?.id??"",f=x||"no-connection",g=x??null;let S;s[5]!==l.id||s[6]!==l.slug||s[7]!==g?(S={connectionId:g,orgId:l.id,orgSlug:l.slug},s[5]=l.id,s[6]=l.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,i,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==i?(P=i?.toLowerCase(),s[12]=i,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==i?(C=Gt(i),s[14]=i,s[15]=C):C=s[15];const k=C;let N;s[16]!==l.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:l.slug},children:"Connections"})})}),s[16]=l.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==i||s[20]!==m||s[21]!==l.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:n.appSlug},search:{tab:i},children:m.title})})}),t.jsx(Y,{})]}),s[19]=i,s[20]=m,s[21]=l.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(pe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Qn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Qn as default};
@@ -1 +0,0 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-DF3zg-P1.js";import{d as z,a as _,c as $,D as E}from"./dropdown-menu-BgNr7tM1.js";import{i as L,n as O}from"./ArrowUp-YK2fJPgi.js";import{i as S}from"./Check-BF3t7WWi.js";import{i as R,c as A}from"./SwitchHorizontal01-DUrn8gXV.js";import{i as F}from"./List-DZAsltZv.js";import{T as I,a as K,c as P,b as W}from"./tooltip-O3iHy7-o.js";import{V as q}from"./view-mode-toggle-kFlOpvCC.js";import{B as G}from"./badge-CfAmvo-h.js";function le(t){const e=B.c(31),{viewMode:r,onViewModeChange:x,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==x||e[15]!==r?(a=x&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:x,fullWidth:!0,options:[{value:"table",icon:s.jsx(F,{})},{value:"cards",icon:s.jsx(A,{})}]})}),e[14]=x,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let m;e[24]!==a||e[25]!==c||e[26]!==d?(m=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=m):m=e[27];let k;return e[28]!==n||e[29]!==m?(k=s.jsxs(E,{children:[n,m]}),e[28]=n,e[29]=m,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{le as C};
@@ -1 +0,0 @@
1
- import{c as E,j as o,u as Ie,o as De,p as se,r as M,a as Se,b as Fe,q as qe,d as Te,s as Le,Q as He,E as Ve,K as _e,v as Ue,B as je,N as Be}from"./index-DF3zg-P1.js";import{L as Ke,s as ve,S as Pe,a as Ne,b as Ce,c as be,i as Qe,n as pe,C as we,p as xe}from"./self-tool-result-DJIiUu6Z.js";import{A as We}from"./auth-entry-C48ylSC_.js";import{A as Ge}from"./auth-split-layout-dbrXw6Uq.js";import{O as Re}from"./organization-choice-DB-AR__E.js";import{I as Ye}from"./input-BZTiU0ds.js";import{u as Je}from"./use-mcp-client-DrROXOcH.js";import{S as Xe,W as Ze,g as et,a as tt}from"./constants-BHDe7bIw.js";import{i as it}from"./XCircle-cwYbcP7y.js";import"./integration-icon-BfKWLZT4.js";import"./Tool02-tJKj7JcW.js";import"./agent-icon-DmIJ53uv.js";import"./AlertCircle-B6AELEdc.js";import"./UserPlus01-D2pAl0t2.js";import"./Tool01-4pit7qOS.js";import"./ArrowUp-YK2fJPgi.js";import"./Settings02-CM0Uzs0U.js";import"./ArrowUpRight-BKVLcZTe.js";import"./TrendUp01-7N_6K3-X.js";import"./ZapSquare-Dj8pa8Fg.js";import"./ZoomOut-_psBJlXD.js";import"./Users03-WVYBBENu.js";import"./CheckCircle-BfxYbuVE.js";import"./Check-BF3t7WWi.js";import"./ChevronDown-CQLSXgt3.js";import"./ChevronRight-Fgy0rUS_.js";import"./ChevronUp-Y-IpPAUR.js";import"./Circle-0HId1SV6.js";import"./Stars02-DBH33Ez2.js";import"./Copy01-B0CQRE_5.js";import"./DotsVertical-CYU3Mae1.js";import"./Globe01-B52VKYy7.js";import"./Eye-CLtdCpUf.js";import"./FilterLines-DeiGsRZY.js";import"./Flag01-B_AKNFoc.js";import"./Star01-B-8espqJ.js";import"./Globe04-B0las6Jv.js";import"./SwitchHorizontal01-DUrn8gXV.js";import"./HardDrive-CU-vvmKE.js";import"./Image01-B-FQwXx8.js";import"./Key01-myvTSA8u.js";import"./LayoutLeft-C0g0LezP.js";import"./LinkExternal01-d9EixhiS.js";import"./List-DZAsltZv.js";import"./Monitor01-BkDBzdlH.js";import"./Sun-MvOAGgKN.js";import"./Package-eNacrLmv.js";import"./Palette-BiKqXWvc.js";import"./Play-CdkPhmTs.js";import"./Plus-DWjKZ2wj.js";import"./SearchLg-DBOWvxyl.js";import"./SearchMd-CKteZWzZ.js";import"./Shield01-aDvWVv5Z.js";import"./Stars01-DsfblQf3.js";import"./Trash01-DEWgFvvg.js";import"./Upload01-C8RP0Fvq.js";import"./User01-v0Bqr3nA.js";import"./Users01-CPNZ7uMu.js";import"./XClose-DnNyN9T-.js";import"./X-Dm6kY_ek.js";import"./Zap-CNRURtEh.js";import"./dialog-CmXDzme5.js";import"./tooltip-O3iHy7-o.js";import"./companions-core-fc2Z_sCB.js";import"./extract-connection-data-CK9iLAoG.js";import"./github-repo-scope-DjMZbiKa.js";import"./form-x0k-kdB2.js";import"./label-B1OfKy2N.js";import"./use-debounced-value-xN0eyoO9.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./authenticate-and-persist-oauth-BHT9Kp62.js";import"./mcp-oauth-CoKzxQiz.js";import"./auth-dSVlMQ86.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-UXZ4R5Yb.js";const ot={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function nt(l){return ot[l]}function ye(l){const e=E.c(4),{variant:i}=l;let t;e[0]!==i?(t=nt(i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:o.jsx(Ke,{label:t,className:"text-muted-foreground"})}),e[2]=t,e[3]=s):s=e[3],s}function ki(){const l=E.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(st,{}),l[0]=e):e=l[0],e}const Me=M.createContext(null),$e=()=>M.useContext(Me);function R(l){const e=E.c(13);let i,t;e[0]!==l?({visual:t,...i}=l,e[0]=l,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/commerce-onboarding"},e[3]=s):s=e[3];const c=Ie(s),{data:a}=Se.useSession(),n=a?.user?.email;let m;e[4]!==c.siteUrl||e[5]!==n?(m=Ce({siteUrl:c.siteUrl,email:n}),e[4]=c.siteUrl,e[5]=n,e[6]=m):m=e[6];const d=m;let u;e[7]!==d||e[8]!==t?(u=t??o.jsx(be,{href:d}),e[7]=d,e[8]=t,e[9]=u):u=e[9];let v;return e[10]!==i||e[11]!==u?(v=o.jsx(Ge,{...i,visual:u}),e[10]=i,e[11]=u,e[12]=v):v=e[12],v}const rt={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:l=>`Código enviado para ${l}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:l=>`Continuar com ${l}`,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 Oe(l){switch(l){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 l}}let ze=!1;function st(){const l=Ie({from:"/commerce-onboarding"}),{org:e,siteUrl:i}=l,t=ve(i);return!ze&&De()&&(ze=!0,se("commerce_onboarding_viewed",{site_url:i,domain:t??void 0,...t?{$set:{last_scanned_domain:t}}:{}})),o.jsx(Me.Provider,{value:t,children:o.jsx(at,{requestedOrgSlug:e,siteUrl:i})})}function at(l){const e=E.c(8),{requestedOrgSlug:i,siteUrl:t}=l,{data:s,isPending:c}=Se.useSession(),a=$e();if(c){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(R,{children:o.jsx(ye,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!s){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==a?(d=a?o.jsx(Pe,{host:a}):void 0,e[1]=a,e[2]=d):d=e[2];let u;return e[3]!==d?(u=o.jsx(R,{children:o.jsx(We,{callbackUrl:m,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:d,copy:rt})}),e[3]=d,e[4]=u):u=e[4],u}let n;return e[5]!==i||e[6]!==t?(n=o.jsx(lt,{requestedOrgSlug:i,siteUrl:t}),e[5]=i,e[6]=t,e[7]=n):n=e[7],n}function lt(l){const e=E.c(43),{requestedOrgSlug:i,siteUrl:t}=l,s=Fe(),c=qe(),[a,n]=M.useState(null),[m,d]=M.useState(null),u=c.data?.map(mt)??[];let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:ct,retry:!1,onSuccess:r=>{d(r)}},e[0]=v):v=e[0];const p=Te(v);if(c.isPending){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(R,{children:o.jsx(ye,{variant:"workspace"})}),e[1]=r):r=e[1],r}if(c.error){let r;return e[2]!==c?(r=o.jsx(ae,{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:()=>c.refetch()}),e[2]=c,e[3]=r):r=e[3],r}const j=i?u.find(r=>r.slug===i):null;if(j){let r;return e[4]!==j||e[5]!==t?(r=o.jsx(re,{org:j,initialSiteUrl:t}),e[4]=j,e[5]=t,e[6]=r):r=e[6],r}if(i){let r;return e[7]!==c?(r=o.jsx(ae,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[7]=c,e[8]=r):r=e[8],r}if(a){let r;return e[9]!==a||e[10]!==t?(r=o.jsx(re,{org:a,initialSiteUrl:t}),e[9]=a,e[10]=t,e[11]=r):r=e[11],r}if(u.length===1&&u[0]){let r;return e[12]!==u[0]||e[13]!==t?(r=o.jsx(re,{org:u[0],initialSiteUrl:t}),e[12]=u[0],e[13]=t,e[14]=r):r=e[14],r}if(u.length>1){let r;e[15]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(k,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=r):r=e[15];let h;e[16]!==s||e[17]!==t?(h=O=>s({to:"/commerce-onboarding",search:{org:O.slug,siteUrl:t}}),e[16]=s,e[17]=t,e[18]=h):h=e[18];let C;return e[19]!==u||e[20]!==h?(C=o.jsx(R,{children:o.jsxs("div",{className:"grid gap-10",children:[r,o.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:o.jsx(Re,{organizations:u,selectLabel:"Continuar",onSelected:h})})]})}),e[19]=u,e[20]=h,e[21]=C):C=e[21],C}if(!m){let r;e[22]!==p?(r=()=>{p.reset(),p.mutate()},e[22]=p,e[23]=r):r=e[23];let h;return e[24]!==p||e[25]!==r?(h=o.jsx(dt,{mutation:p,onRetry:r}),e[24]=p,e[25]=r,e[26]=h):h=e[26],h}const g=m;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let r;return e[27]!==g.organization||e[28]!==t?(r=o.jsx(re,{org:g.organization,initialSiteUrl:t}),e[27]=g.organization,e[28]=t,e[29]=r):r=e[29],r}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let r;e[30]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(k,{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[30]=r):r=e[30];const h=g.domain??void 0;let C;e[31]!==s||e[32]!==t?(C=($,P)=>{Le(),n({...$,slug:P}),s({to:"/commerce-onboarding",search:{org:P,siteUrl:t}})},e[31]=s,e[32]=t,e[33]=C):C=e[33];let O;return e[34]!==g.organizations||e[35]!==h||e[36]!==C?(O=o.jsx(R,{children:o.jsxs("div",{className:"grid gap-10",children:[r,o.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:o.jsx(Re,{organizations:g.organizations,domain:h,onJoined:C})})]})}),e[34]=g.organizations,e[35]=h,e[36]=C,e[37]=O):O=e[37],O}const S=g?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let _;e[38]!==p?(_=()=>{d(null),p.reset()},e[38]=p,e[39]=_):_=e[39];let I;return e[40]!==S||e[41]!==_?(I=o.jsx(ae,{title:"O onboarding de commerce precisa de suporte",description:S,actionLabel:"Tentar novamente",onRetry:_}),e[40]=S,e[41]=_,e[42]=I):I=e[42],I}async function ct(){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&&Le(),e}function mt(l){return{id:l.id,name:l.name,slug:l.slug,logo:l.logo??null}}function dt(l){const e=E.c(7),{mutation:i,onRetry:t}=l,s=M.useRef(!1);let c;e[0]!==i?(c=d=>{!d||s.current||(s.current=!0,i.mutate())},e[0]=i,e[1]=c):c=e[1];const a=c;if(i.error){let d;return e[2]!==t?(d=o.jsx(ae,{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:t}),e[2]=t,e[3]=d):d=e[3],d}let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx(ye,{variant:"generic"}),e[4]=n):n=e[4];let m;return e[5]!==a?(m=o.jsx(R,{children:o.jsx("div",{ref:a,children:n})}),e[5]=a,e[6]=m):m=e[6],m}function k(l){const e=E.c(8),{title:i,description:t}=l,s=$e();let c;e[0]!==s?(c=s?o.jsx(Pe,{host:s}):o.jsxs("div",{children:[o.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),o.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==i?(a=(i||t)&&o.jsxs("div",{className:"space-y-2",children:[i&&o.jsx("h1",{className:"text-2xl font-medium leading-8",children:i}),t&&o.jsx("p",{className:"text-base text-muted-foreground leading-6",children:t})]}),e[2]=t,e[3]=i,e[4]=a):a=e[4];let n;return e[5]!==c||e[6]!==a?(n=o.jsxs("div",{className:"grid gap-10",children:[c,a]}),e[5]=c,e[6]=a,e[7]=n):n=e[7],n}function ae(l){const e=E.c(9),{title:i,description:t,actionLabel:s,onRetry:c}=l;let a;e[0]!==t||e[1]!==i?(a=o.jsx(k,{title:i,description:t}),e[0]=t,e[1]=i,e[2]=a):a=e[2];let n;e[3]!==s||e[4]!==c?(n=o.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:c,children:s}),e[3]=s,e[4]=c,e[5]=n):n=e[5];let m;return e[6]!==a||e[7]!==n?(m=o.jsx(R,{children:o.jsxs("div",{className:"grid gap-10",children:[a,n]})}),e[6]=a,e[7]=n,e[8]=m):m=e[8],m}function re(l){const e=E.c(11),{org:i,initialSiteUrl:t}=l,{data:s}=Se.useSession(),c=s?.user?.email;let a;e[0]!==t||e[1]!==c?(a=Ce({siteUrl:t,email:c}),e[0]=t,e[1]=c,e[2]=a):a=e[2];const n=a;let m;e[3]!==n||e[4]!==i.id?(m=o.jsx(be,{href:n,orgId:i.id}),e[3]=n,e[4]=i.id,e[5]=m):m=e[5];const d=m;let u;return e[6]!==t||e[7]!==d||e[8]!==i||e[9]!==s?.user?.email?(u=o.jsx(He,{children:v=>{const{reset:p}=v;return o.jsx(Ve,{fallback:j=>{const{error:g,resetError:S}=j;return o.jsx(R,{visual:d,children:o.jsx(ut,{orgName:i.name,message:g instanceof Error?g.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{p(),S()}})})},children:o.jsx(M.Suspense,{fallback:o.jsx(ke,{visual:d}),children:o.jsx(ft,{org:i,initialSiteUrl:t,sessionEmail:s?.user?.email},`${i.id}:${t??""}`)})})}}),e[6]=t,e[7]=d,e[8]=i,e[9]=s?.user?.email,e[10]=u):u=e[10],u}function ke(l){const e=E.c(3),{visual:i}=l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[o.jsx(k,{}),o.jsx(we,{})]}),e[0]=t):t=e[0];let s;return e[1]!==i?(s=o.jsx(R,{align:"fill",visual:i,children:t}),e[1]=i,e[2]=s):s=e[2],s}function ut(l){const e=E.c(10),{orgName:i,message:t,onRetry:s}=l,c=`A configuração de commerce continuará em ${i}.`;let a;e[0]!==c?(a=o.jsx(k,{title:"Diagnóstico de commerce",description:c}),e[0]=c,e[1]=a):a=e[1];let n;e[2]!==t?(n=o.jsx(le,{message:t}),e[2]=t,e[3]=n):n=e[3];let m;e[4]!==s?(m=o.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:s,children:"Tentar novamente"}),e[4]=s,e[5]=m):m=e[5];let d;return e[6]!==a||e[7]!==n||e[8]!==m?(d=o.jsxs("div",{className:"grid gap-10",children:[a,n,m]}),e[6]=a,e[7]=n,e[8]=m,e[9]=d):d=e[9],d}function ft(l){const e=E.c(109),{org:i,initialSiteUrl:t,sessionEmail:s}=l;let c;e[0]!==i.id||e[1]!==i.slug?(c={connectionId:Xe,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=c):c=e[2];const a=Je(c),[n,m]=M.useState(t??""),[d,u]=M.useState(null),v=M.useRef(!1),p=Ze.COMMERCE_DISCOVERY(i.id),j=et(i.id),g=_e.commerceDiscoveryConnection(i.id,p);let S;e[3]!==p||e[4]!==a?(S=async()=>{const f=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(f)},e[3]=p,e[4]=a,e[5]=S):S=e[5];let _;e[6]!==g||e[7]!==S?(_={queryKey:g,queryFn:S,retry:!1},e[6]=g,e[7]=S,e[8]=_):_=e[8];const I=Ue(_),r=_e.commerceDiscoveryVirtualMcp(i.id,j);let h;e[9]!==a||e[10]!==j?(h=async()=>{const f=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:j}});return xe(f)},e[9]=a,e[10]=j,e[11]=h):h=e[11];let C;e[12]!==r||e[13]!==h?(C={queryKey:r,queryFn:h,retry:!1},e[12]=r,e[13]=h,e[14]=C):C=e[14];const O=Ue(C);let $;e[15]!==a?($=async f=>{const x=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:f}});return xe(x)},e[15]=a,e[16]=$):$=e[16];let P;e[17]!==I||e[18]!==i.id||e[19]!==O?(P=(f,x)=>{se("commerce_onboarding_setup_succeeded",{domain:ve(x)??void 0,organization_id:i.id}),u(null),I.refetch(),O.refetch()},e[17]=I,e[18]=i.id,e[19]=O,e[20]=P):P=e[20];let A;e[21]!==i.id?(A=(f,x)=>{se("commerce_onboarding_setup_failed",{domain:ve(x)??void 0,organization_id:i.id,error:f instanceof Error?f.message:String(f)}),u(f instanceof Error?f.message:"A configuração do Commerce Discovery falhou.")},e[21]=i.id,e[22]=A):A=e[22];let Q;e[23]!==A||e[24]!==$||e[25]!==P?(Q={mutationFn:$,retry:!1,onSuccess:P,onError:A},e[23]=A,e[24]=$,e[25]=P,e[26]=Q):Q=e[26];const b=Te(Q),Ae=!!I.data.item&&!!O.data.item,Ee=I.data.item,W=typeof Ee?.metadata?.siteUrl=="string"?Ee.metadata.siteUrl:void 0,ce=t||n||"";let G;e[27]!==W||e[28]!==ce?(G=Qe(ce,W),e[27]=W,e[28]=ce,e[29]=G):G=e[29];const Y=Ae&&G,J=t||n||W||"";let X;e[30]!==J||e[31]!==s?(X=Ce({siteUrl:J,email:s}),e[30]=J,e[31]=s,e[32]=X):X=e[32];const me=X;let Z;e[33]!==me||e[34]!==i.id?(Z=o.jsx(be,{href:me,orgId:i.id}),e[33]=me,e[34]=i.id,e[35]=Z):Z=e[35];const y=Z;let ee;e[36]!==b?(ee=f=>{const x=pe(f);if(!x.ok){u(Oe(x.error));return}u(null),b.mutate(x.value)},e[36]=b,e[37]=ee):ee=e[37];const D=ee;let te;e[38]!==t||e[39]!==D||e[40]!==Y?(te=f=>{!f||v.current||Y||!t||(v.current=!0,D(t))},e[38]=t,e[39]=D,e[40]=Y,e[41]=te):te=e[41];const de=te;let ie;e[42]!==i.id||e[43]!==D||e[44]!==n?(ie=f=>{f.preventDefault();const x=pe(n);x.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(x.value).hostname,organization_id:i.id}),D(n)},e[42]=i.id,e[43]=D,e[44]=n,e[45]=ie):ie=e[45];const z=ie;if(Y){const f=i.slug;let x;e[46]===Symbol.for("react.memo_cache_sentinel")?(x=crypto.randomUUID(),e[46]=x):x=e[46];let T;e[47]!==i.slug?(T={org:f,taskId:x},e[47]=i.slug,e[48]=T):T=e[48];let U;e[49]!==i.id?(U=tt(i.id),e[49]=i.id,e[50]=U):U=e[50];const L=J||void 0;let N;e[51]!==U.id||e[52]!==L?(N={virtualmcpid:U.id,connect:"1",siteUrl:L},e[51]=U.id,e[52]=L,e[53]=N):N=e[53];let w;return e[54]!==T||e[55]!==N?(w=o.jsx(Be,{to:"/$org/$taskId",params:T,search:N,replace:!0}),e[54]=T,e[55]=N,e[56]=w):w=e[56],w}if(b.isPending){let f;return e[57]!==y?(f=o.jsx(ke,{visual:y}),e[57]=y,e[58]=f):f=e[58],f}if(t){let f,x;if(e[59]!==y||e[60]!==z||e[61]!==t||e[62]!==d||e[63]!==i.name||e[64]!==b.isPending||e[65]!==n){x=Symbol.for("react.early_return_sentinel");e:if(f=pe(t),!f.ok){const fe=`A configuração de commerce continuará em ${i.name}.`;let V;e[68]!==fe?(V=o.jsx(k,{title:"Diagnóstico de commerce",description:fe}),e[68]=fe,e[69]=V):V=e[69];const ge=o.jsx(le,{message:Oe(f.error)});let B;e[70]!==z||e[71]!==d||e[72]!==b.isPending||e[73]!==n?(B=o.jsx(he,{siteUrl:n,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[70]=z,e[71]=d,e[72]=b.isPending,e[73]=n,e[74]=B):B=e[74];let K;e[75]!==V||e[76]!==ge||e[77]!==B?(K=o.jsxs("div",{className:"grid gap-10",children:[V,ge,B]}),e[75]=V,e[76]=ge,e[77]=B,e[78]=K):K=e[78];let ne;e[79]!==y||e[80]!==K?(ne=o.jsx(R,{visual:y,children:K}),e[79]=y,e[80]=K,e[81]=ne):ne=e[81],x=ne;break e}e[59]=y,e[60]=z,e[61]=t,e[62]=d,e[63]=i.name,e[64]=b.isPending,e[65]=n,e[66]=f,e[67]=x}else f=e[66],x=e[67];if(x!==Symbol.for("react.early_return_sentinel"))return x;const T=`O Commerce Discovery está sendo preparado para ${f.value}.`;let U;e[82]!==T?(U=o.jsx(k,{title:"Diagnóstico de commerce",description:T}),e[82]=T,e[83]=U):U=e[83];let L;e[84]!==z||e[85]!==d||e[86]!==b.isPending||e[87]!==n?(L=d?o.jsxs(o.Fragment,{children:[o.jsx(le,{message:d}),o.jsx(he,{siteUrl:n,error:null,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z})]}):o.jsx(we,{}),e[84]=z,e[85]=d,e[86]=b.isPending,e[87]=n,e[88]=L):L=e[88];let N;e[89]!==U||e[90]!==L||e[91]!==de?(N=o.jsxs("div",{ref:de,className:"grid gap-10",children:[U,L]}),e[89]=U,e[90]=L,e[91]=de,e[92]=N):N=e[92];let w;return e[93]!==y||e[94]!==N?(w=o.jsx(R,{visual:y,children:N}),e[93]=y,e[94]=N,e[95]=w):w=e[95],w}const ue=`A configuração de commerce continuará em ${i.name}.`;let F;e[96]!==ue?(F=o.jsx(k,{title:"Diagnóstico de commerce",description:ue}),e[96]=ue,e[97]=F):F=e[97];let q;e[98]!==z||e[99]!==d||e[100]!==b.isPending||e[101]!==n?(q=o.jsx(he,{siteUrl:n,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[98]=z,e[99]=d,e[100]=b.isPending,e[101]=n,e[102]=q):q=e[102];let H;e[103]!==F||e[104]!==q?(H=o.jsxs("div",{className:"grid gap-10",children:[F,q]}),e[103]=F,e[104]=q,e[105]=H):H=e[105];let oe;return e[106]!==y||e[107]!==H?(oe=o.jsx(R,{visual:y,children:H}),e[106]=y,e[107]=H,e[108]=oe):oe=e[108],oe}function he(l){const e=E.c(20),{siteUrl:i,error:t,isSubmitting:s,onSiteUrlChange:c,onSubmit:a}=l;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=n):n=e[0];let m;e[1]!==c?(m=_=>c(_.target.value),e[1]=c,e[2]=m):m=e[2];const d=!!t;let u;e[3]!==s||e[4]!==i||e[5]!==m||e[6]!==d?(u=o.jsx(Ye,{id:"commerce-site-url",type:"text",inputMode:"url",value:i,onChange:m,placeholder:"https://example.com","aria-invalid":d,disabled:s}),e[3]=s,e[4]=i,e[5]=m,e[6]=d,e[7]=u):u=e[7];let v;e[8]!==t?(v=t?o.jsx(le,{message:t}):null,e[8]=t,e[9]=v):v=e[9];let p;e[10]!==u||e[11]!==v?(p=o.jsxs("div",{className:"grid gap-2",children:[n,u,v]}),e[10]=u,e[11]=v,e[12]=p):p=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(it,{size:16}),e[13]=j):j=e[13];let g;e[14]!==s?(g=o.jsxs(je,{type:"submit",size:"xl",className:"w-full",disabled:s,children:["Continuar",j]}),e[14]=s,e[15]=g):g=e[15];let S;return e[16]!==a||e[17]!==p||e[18]!==g?(S=o.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[p,g]}),e[16]=a,e[17]=p,e[18]=g,e[19]=S):S=e[19],S}function le(l){const e=E.c(2),{message:i}=l;let t;return e[0]!==i?(t=o.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}),e[0]=i,e[1]=t):t=e[1],t}export{ki as default};
@@ -1 +0,0 @@
1
- import{c as C,j as t,r as y,B as M,l as j}from"./index-DF3zg-P1.js";import{a as D,h as S,D as I,d as R,e as T}from"./dialog-CmXDzme5.js";import{u as _,S as A}from"./chat-context-CyCuyn4t.js";import{i as B}from"./Check-BF3t7WWi.js";import{a as E}from"./Copy01-B0CQRE_5.js";function N(n){const e=C.c(3),{size:l}=n,o=l===void 0?16:l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=i):i=e[0];let s;return e[1]!==o?(s=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i}),e[1]=o,e[2]=s):s=e[2],s}function w(n){const e=C.c(3),{size:l}=n,o=l===void 0?16:l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=i):i=e[0];let s;return e[1]!==o?(s=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:i}),e[1]=o,e[2]=s):s=e[2],s}const $={"claude-code":{label:"Claude Code",Icon:N},codex:{label:"Codex",Icon:w}};function Y(n){return(n&&$[n])??null}const L="bunx decocms@latest link",k=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:t.jsx(N,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:t.jsx(w,{size:18})}];function q(n){return k.filter(e=>n.includes(e.capability)).map(e=>e.label)}function F(n){const e=C.c(23),{open:l,onOpenChange:o}=n;let i;e[0]!==l?(i={fast:l},e[0]=l,e[1]=i):i=e[1];const s=_(i),[h,v]=y.useState(!1),z=s.hostname??s.machineId??"Your desktop",g=s.online?`Connected to ${z}`:"Connect your desktop";let a;e[2]!==g?(a=t.jsx(D,{children:g}),e[2]=g,e[3]=a):a=e[3];const b=s.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let c;e[4]!==b?(c=t.jsx(S,{children:b}),e[4]=b,e[5]=c):c=e[5];let r;e[6]!==a||e[7]!==c?(r=t.jsxs(I,{children:[a,c]}),e[6]=a,e[7]=c,e[8]=r):r=e[8];let d;e[9]!==h||e[10]!==s.online?(d=!s.online&&t.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[t.jsx("span",{className:"flex-1",children:L}),t.jsx(M,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(L),v(!0),setTimeout(()=>v(!1),1500)},children:h?t.jsx(B,{size:14}):t.jsx(E,{size:14})})]}),e[9]=h,e[10]=s.online,e[11]=d):d=e[11];let m;e[12]!==s.capabilities||e[13]!==s.online?(m=s.online?t.jsx("div",{className:"flex flex-col gap-3 text-sm",children:t.jsx("div",{className:"flex flex-col gap-2",children:k.map(x=>{const f=s.capabilities.includes(x.capability);return t.jsxs("div",{className:j("flex items-center gap-3 rounded-md border px-3 py-2",f?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[t.jsx("div",{className:j("flex size-6 items-center justify-center",f?"text-foreground":"text-muted-foreground"),children:x.icon}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium",children:x.label}),t.jsx("p",{className:"text-xs text-muted-foreground",children:f?x.description:"Not detected"})]}),t.jsx("span",{className:j("size-2 rounded-full",f?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(A,{size:"sm"}),"Waiting for desktop…"]}),e[12]=s.capabilities,e[13]=s.online,e[14]=m):m=e[14];let u;e[15]!==r||e[16]!==d||e[17]!==m?(u=t.jsxs(R,{className:"sm:max-w-md",children:[r,d,m]}),e[15]=r,e[16]=d,e[17]=m,e[18]=u):u=e[18];let p;return e[19]!==o||e[20]!==l||e[21]!==u?(p=t.jsx(T,{open:l,onOpenChange:o,children:u}),e[19]=o,e[20]=l,e[21]=u,e[22]=p):p=e[22],p}export{F as C,N as a,w as b,Y as l,q as v};
@@ -1 +0,0 @@
1
- import{H as he,af as Ie,b3 as Ae,I as le,ad as $e,c as P,j as t,i as ge,B as V,r as G,l as je,C as J,v as De,K as ne,b as Y,aI as ce,z as Pe,b4 as Oe,E as Me,e as ze,b5 as Ee,n as Ve,M as Ue,J as Re,t as q,b6 as Fe}from"./index-DF3zg-P1.js";import{g as Le}from"./extract-connection-data-CK9iLAoG.js";import{E as ve}from"./empty-state-CdKwtMyP.js";import{E as He,c as Be,r as We,b as Xe,d as qe}from"./connection-form-helpers-TGmycj7X.js";import{c as Ge,S as Ke,V as Qe}from"./index-T-oY3h3t.js";import{u as be,T as Je}from"./use-mcp-auth-status-C7G9bAkb.js";import{u as Ye}from"./use-members-mvfsRjey.js";import{A as Ze}from"./avatar-UXZ4R5Yb.js";import{a as Ne,b as ye,u as et}from"./use-connection-twfWXxwG.js";import{u as _e}from"./use-mcp-client-DrROXOcH.js";import{a as tt}from"./use-mcp-tools-D28ox9dJ.js";import{c as st,C as nt,a as ot,d as it}from"./AreaChart-fCNs67j_.js";import{i as rt,a as at}from"./mcp-oauth-CoKzxQiz.js";import{I as oe}from"./integration-icon-BfKWLZT4.js";import{s as lt}from"./Plus-DWjKZ2wj.js";import{I as ct,J as dt,aj as mt,af as ut}from"./agent-icon-DmIJ53uv.js";import{a as Ce,s as xt}from"./Settings02-CM0Uzs0U.js";import{s as re}from"./Trash01-DEWgFvvg.js";import{q as pt,p as ft,o as ht,m as gt,n as jt}from"./sidebar-BFdShy9x.js";import{F as L,b as H,c as B,d as E,f as W,e as vt,a as bt}from"./form-x0k-kdB2.js";import{I as X}from"./input-BZTiU0ds.js";import{u as Nt,D as yt}from"./use-delete-connection-BlzYSB_f.js";import{c as _t,B as Ct,a as St,C as wt}from"./monitoring-stats-row-C0-lT8X-.js";import{u as kt}from"./studio-tools-bThaob6p.js";import{u as Tt}from"./use-virtual-mcp-C964oRwj.js";import{i as Se}from"./ChevronRight-Fgy0rUS_.js";import{a as we}from"./Users03-WVYBBENu.js";import{b as ee,c as It,T as te,a as At}from"./tabs-D-6eQ0wE.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-Dj8pa8Fg.js";import{c as Dt}from"./Tool01-4pit7qOS.js";import{g as ae,M as Pt}from"./index-BjO8A-VO.js";import{C as Ot}from"./collection-search-C4jDpdZf.js";import{C as Mt}from"./card-dLLzWD0r.js";import{B as zt}from"./badge-CfAmvo-h.js";import{D as Et,a as Vt,c as Ut,d as de}from"./dropdown-menu-BgNr7tM1.js";import{S as me,a as ue,b as xe,c as pe,d as F}from"./select-B6GE4jHJ.js";import{i as Rt}from"./CheckCircle-BfxYbuVE.js";import{t as Ft}from"./ChevronDown-CQLSXgt3.js";import{n as Lt}from"./Tool02-tJKj7JcW.js";import{s as se}from"./Star01-B-8espqJ.js";import{s as Ht}from"./XClose-DnNyN9T-.js";import"./constants-BHDe7bIw.js";import"./index-CeqD0RVV.js";import"./ZoomOut-_psBJlXD.js";import"./Key01-myvTSA8u.js";import"./auth-dSVlMQ86.js";import"./use-registry-connections-D94L7VqK.js";import"./use-organization-settings-BJ1bjHsL.js";import"./index-C-B6S6Q9.js";import"./index-CUVgjm02.js";import"./popover-BzHpXFL_.js";import"./tooltip-O3iHy7-o.js";import"./Check-BF3t7WWi.js";import"./SearchMd-CKteZWzZ.js";import"./use-mobile-nauPjzo2.js";import"./use-create-virtual-mcp-NwJ9x5Kd.js";import"./use-navigate-to-agent-BJC_x779.js";import"./hooks-QHrmNjJQ.js";import"./decopilot-sse-pool-DHojW3EC.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-CLtdCpUf.js";import"./use-org-auth-client-jU0nDPT-.js";import"./User01-v0Bqr3nA.js";import"./use-collections-K1HyCAfG.js";import"./AlertCircle-B6AELEdc.js";import"./UserPlus01-D2pAl0t2.js";import"./ArrowUp-YK2fJPgi.js";import"./XCircle-cwYbcP7y.js";import"./ArrowUpRight-BKVLcZTe.js";import"./TrendUp01-7N_6K3-X.js";import"./ChevronUp-Y-IpPAUR.js";import"./Circle-0HId1SV6.js";import"./Stars02-DBH33Ez2.js";import"./Copy01-B0CQRE_5.js";import"./DotsVertical-CYU3Mae1.js";import"./Globe01-B52VKYy7.js";import"./FilterLines-DeiGsRZY.js";import"./Flag01-B_AKNFoc.js";import"./Globe04-B0las6Jv.js";import"./SwitchHorizontal01-DUrn8gXV.js";import"./HardDrive-CU-vvmKE.js";import"./Image01-B-FQwXx8.js";import"./LayoutLeft-C0g0LezP.js";import"./LinkExternal01-d9EixhiS.js";import"./List-DZAsltZv.js";import"./Monitor01-BkDBzdlH.js";import"./Sun-MvOAGgKN.js";import"./Package-eNacrLmv.js";import"./Palette-BiKqXWvc.js";import"./Play-CdkPhmTs.js";import"./SearchLg-DBOWvxyl.js";import"./Shield01-aDvWVv5Z.js";import"./Stars01-DsfblQf3.js";import"./Upload01-C8RP0Fvq.js";import"./Users01-CPNZ7uMu.js";import"./X-Dm6kY_ek.js";import"./Zap-CNRURtEh.js";import"./label-B1OfKy2N.js";import"./alert-dialog-3VMQ65hF.js";const Bt=he({scopes:$e(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=be(d),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==a?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>a(n,"active"),children:[t.jsx(ct,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>a(n,"inactive"),title:"Disable",children:t.jsx(dt,{size:13})}),e[20]=n,e[21]=p,e[22]=a,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==i?(S=()=>i(n),e[24]=n,e[25]=i,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function qt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:13}),e[8]=d):d=e[8];let l;e[9]!==a?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:d})}),e[9]=a,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(lt,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==x||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,c]}),e[8]=x,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a){let j;e[17]!==r||e[18]!==i||e[19]!==o||e[20]!==a?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:N,onConfigure:i}),children:t.jsx(Xt,{instance:N,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a})},N.id),e[17]=r,e[18]=i,e[19]=o,e[20]=a,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}function Kt(s,e=3){const n=new Map;for(const i of s){if(!i.isError)continue;const r=(i.errorMessage??"").trim()||"Unknown error";n.set(r,(n.get(r)??0)+1)}return[...n.entries()].map(([i,r])=>({message:i,count:r})).sort((i,r)=>r.count-i.count).slice(0,e)}const Qt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Jt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Yt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Zt(s){const e=P.c(1),{connectionId:n,orgId:i,timeframe:r}=s,o=kt(),a=Jt(r),{data:d}=De({queryKey:ne.connectionActivity(n,r,i),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=_t(d?.logs??[],a),u=l.data,x=l.totalCalls>0,p=Kt(d?.logs??[]),c=l.totalCalls>0?Math.round(l.totalErrors/l.totalCalls*100):0;let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=h):h=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),h]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(st,{config:Yt,className:"h-16 w-full",children:t.jsxs(Ct,{data:u,barCategoryGap:"4%",children:[t.jsx(nt,{content:t.jsx(ot,{labelFormatter:ss}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(ts)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})}),p.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:["Top errors",c>0?` · ${c}% of calls failed`:""]}),t.jsx("ul",{className:"space-y-1.5",children:p.map(es)})]})]})}function es(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ts(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ss(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ns(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function os(s){const e=P.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=Qt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=i,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[a,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ns,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==i?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Zt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function is(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==d||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,u]}),e[11]=o,e[12]=d,e[13]=l,e[14]=x):x=e[14],x}function rs(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=d=>t.jsx(is,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function as(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==i.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(rs,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=l):l=e[6],l}function ls(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let d;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const l=_e(d),u=Ne(i);let x;e[4]!==u||e[5]!==i?(x=u?ke(u):i,e[4]=u,e[5]=i,e[6]=x):x=e[6];const p=x,[c,h]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const S=(n??[]).filter(cs),y=c.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==c?(j=t.jsx(Ot,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=ae(f._meta);return t.jsxs(Mt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function cs(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function ds(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const l=d;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),c=Ne(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(xs),e[12]=o,e[13]=a,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==a||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ls,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=N,e[33]=a,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(us):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(ms):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function ms(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(mt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function us(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function xs(s){return ae(s._meta)}function ps(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let a;e[3]!==r?(a=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=a):a=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[7]=a,e[8]=d,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function fs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),a=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof a!="string"||!a)return!1;try{const c=new URL(a);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=d||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(X,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Rt,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(xt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>c.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(vt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function hs(s){return s.command==="npx"}function gs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function js(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(hs(i)){const a=gs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=js(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function vs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function bs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),c=Nt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=Ge(k,Wt),f=Ue({resolver:Re(Be),values:fe(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const $=f.getValues(),D=vs($),R=h?.id??e;await x.update.mutateAsync({id:R,data:D}),f.reset($)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:$,tokenInfo:D,error:R}=await at({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(R||!$){q.error(`Authentication failed: ${R}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:$}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:$}})}else await x.update.mutateAsync({id:m,data:{connection_token:$}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),q.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const D=await m.text();q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...c}),t.jsx(pt,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ft,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ht,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(gt,{className:"text-base",children:h?.title??s.title}),t.jsx(jt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(bt,{...f,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(fs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||i,className:"flex-1",children:i?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),c.requestDelete(m)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ps,{connection:s,displayTitle:(()=>{const m=d[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(os,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:d,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>c.requestDelete(m),onToggleStatus:async(m,$)=>{try{await x.update.mutateAsync({id:m.id,data:{status:$}}),q.success($==="active"?"Connection enabled":"Connection disabled")}catch{q.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=d[0]??s,$=m.title.replace(/\s*\(\d+\)\s*$/,""),D=d.length+1,R=`${$} (${D})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:R,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await rt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(as,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ds,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function Ns(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),d=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",c=p||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==c?(h={connectionId:c,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=c,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(ks):(x?.tools??[]).map(ws);e:{if(u.length<=1){j=A;break e}const z=new Set,U=[],m=Cs;for(const $ of u){const D=$.id===p?A:m($.tools);for(const R of D)z.has(R.name)||(z.add(R.name),U.push(R))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=it(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(_s),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(ys),s[25]=f,s[26]=w):w=s[26];const M=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==M||s[37]!==u?(O=t.jsx(bs,{org:o,connection:x,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:C,resources:M,siblings:u}),s[30]=d.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=M,s[37]=u,s[38]=O):O=s[38],O}function ys(s){return{name:s.name,description:s.description,uri:s.uri}}function _s(s){return{name:s.name,description:s.description}}function Cs(s){return(s??[]).map(Ss)}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ks(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ns,{})})}),s[0]=e):e=s[0],e}function So(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ts,{}),s[0]=e):e=s[0],e}export{So as default};