decocms 3.98.0 → 3.99.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/dist/client/assets/{AlertCircle-kcMUHNYP.js → AlertCircle-VcwplCRi.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-KPaHD_ZU.js → ArrowUpRight-CAv7CUnJ.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Do934x7B.js → CheckCircle-V30FMM2D.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DJ5SHmhN.js → ChevronDown-URo4LveF.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-QZNH5ck-.js → ChevronLeft-aMkPes9N.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BXEszS6k.js → ChevronRight-oz8o6WPV.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CUesWqmK.js → ChevronUp-HJUE3-BD.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-F-o-_a2z.js → DotsVertical-QF46dzdi.js} +1 -1
  9. package/dist/client/assets/{Eye-FmUDnTHn.js → Eye-BSiFxHQB.js} +1 -1
  10. package/dist/client/assets/{FilterLines-eS3dI9hB.js → FilterLines-CEzORaPw.js} +1 -1
  11. package/dist/client/assets/{Globe01-Ckwe4UHh.js → Globe01-wGomueqV.js} +1 -1
  12. package/dist/client/assets/{Globe04-iXhOnFjr.js → Globe04-CsKOsQ4z.js} +1 -1
  13. package/dist/client/assets/{HardDrive-CNIST2bR.js → HardDrive-BuI4Q48l.js} +1 -1
  14. package/dist/client/assets/{Key01-wlyPB5nN.js → Key01-r6MDYdDw.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-C_wbh4sE.js → LayoutLeft-BFxGsVdk.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BoVxtqR2.js → LinkExternal01-BWnRnxGs.js} +1 -1
  17. package/dist/client/assets/{Monitor01-DNvJhnf-.js → Monitor01-SEZLDRFN.js} +1 -1
  18. package/dist/client/assets/{Palette-Bf6p_3g1.js → Palette-CEjENuG4.js} +1 -1
  19. package/dist/client/assets/{Play-D6BtU9Uh.js → Play-BDoh8EAp.js} +1 -1
  20. package/dist/client/assets/{Plus-8zBKSNee.js → Plus-Bw9lc6SR.js} +1 -1
  21. package/dist/client/assets/{SearchMd-57vTBUjU.js → SearchMd-BMfw7gZ4.js} +1 -1
  22. package/dist/client/assets/{Settings02-k7X7M16V.js → Settings02-DbH9OAzT.js} +1 -1
  23. package/dist/client/assets/{Shield01-6X9Jy9--.js → Shield01-C1R4fpvK.js} +1 -1
  24. package/dist/client/assets/{Star01-BUumId75.js → Star01-BwAv907s.js} +1 -1
  25. package/dist/client/assets/{Stars01-BvvUaY8d.js → Stars01-D1icdaCh.js} +1 -1
  26. package/dist/client/assets/{Stars02-f3tbtjbB.js → Stars02-PPXsboxW.js} +1 -1
  27. package/dist/client/assets/{Sun-42Xfv_Dc.js → Sun-Dw86eVev.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BeteqXsq.js → SwitchHorizontal01-F_1MjTR3.js} +1 -1
  29. package/dist/client/assets/{Tool01-DKUGTxge.js → Tool01-DvTGD1Yt.js} +1 -1
  30. package/dist/client/assets/{Trash01-DDwxWuR_.js → Trash01-d58N8w5a.js} +1 -1
  31. package/dist/client/assets/{Upload01-CvwE1uG-.js → Upload01-C_hHbDSF.js} +1 -1
  32. package/dist/client/assets/{User01-KLLrp_Cb.js → User01-BDtU1dk1.js} +1 -1
  33. package/dist/client/assets/{Users01-BoxxsDP9.js → Users01-PX3eYoC8.js} +1 -1
  34. package/dist/client/assets/{Users03-Cnldjgk9.js → Users03-CL71IAQ8.js} +1 -1
  35. package/dist/client/assets/{X-D5odjFOj.js → X-D7X7Z50V.js} +1 -1
  36. package/dist/client/assets/{XCircle-CkFuQ7IG.js → XCircle-PlbEvjyp.js} +1 -1
  37. package/dist/client/assets/{XClose-CQQFXdbB.js → XClose-BbuWQhNb.js} +1 -1
  38. package/dist/client/assets/{Zap-D2QyQXL2.js → Zap-BQKeuD4l.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-DWfiiAgK.js → ZapSquare-CvkoTQDM.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-CGeRz2Xe.js → ZoomOut-DxqRFWA_.js} +1 -1
  41. package/dist/client/assets/{access-gate-B1FO8IUq.js → access-gate-6AWas-Ss.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-C4vE7N12.js → add-section-modal-jgpkoBcW.js} +1 -1
  43. package/dist/client/assets/{agent-icon-AqXPfJak.js → agent-icon-B2N3zGQH.js} +1 -1
  44. package/dist/client/assets/{agents-list-D_wYa6fb.js → agents-list-Cd9i8250.js} +1 -1
  45. package/dist/client/assets/{ai-providers-T-u5bvaJ.js → ai-providers-CG207wTX.js} +1 -1
  46. package/dist/client/assets/{alert-BbYDxfTx.js → alert-Cg3WXwSx.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-C-zjIGep.js → alert-dialog-DvWgcmQI.js} +1 -1
  48. package/dist/client/assets/{app-editor-B1BV7cVP.js → app-editor-tLSi5KV_.js} +1 -1
  49. package/dist/client/assets/{auth-DhQO5_HB.js → auth-DZDiXt1m.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-Di4BNeJO.js → auth-catchall-kuEh1_rd.js} +1 -1
  51. package/dist/client/assets/{auth-entry-_k3gk7s2.js → auth-entry-CavsOUDq.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-bCFbyvYe.js → auth-split-layout-dFpcxyJe.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-DBMlTO0L.js → authenticate-and-persist-oauth-CGYbK6H8.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-Bs5UJwPA.js → automation-list-row-CAUoBpVq.js} +1 -1
  55. package/dist/client/assets/{automation-runs-BZimcr-h.js → automation-runs-DyKvgj21.js} +1 -1
  56. package/dist/client/assets/{automations-X1kqWMvM.js → automations-wXAz-GXj.js} +1 -1
  57. package/dist/client/assets/{avatar-BVLQzOkg.js → avatar-Dv3IrttI.js} +1 -1
  58. package/dist/client/assets/{badge-DySIiC0W.js → badge-toKsUzoB.js} +1 -1
  59. package/dist/client/assets/{block-document-DAnpzS1z.js → block-document-DRbnuwCo.js} +1 -1
  60. package/dist/client/assets/{brand-context-Dw4JnvNB.js → brand-context-BaVxi4M4.js} +1 -1
  61. package/dist/client/assets/{buckets-B3emByFY.js → buckets-BKwGKvkZ.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-dMfRi5Lm.js → capability-load-error-BRyHg_Rt.js} +1 -1
  63. package/dist/client/assets/{card-Dcgr1F8G.js → card-Chq65iX4.js} +1 -1
  64. package/dist/client/assets/{category-editor-DxkVuATo.js → category-editor-LeiO5-YX.js} +1 -1
  65. package/dist/client/assets/{chat-context-Bw2XBdCM.js → chat-context-Bspy4m-d.js} +1 -1
  66. package/dist/client/assets/{checkbox-DtAK_uVJ.js → checkbox-KUrNOBQk.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-C1VkvMBP.js → cli-auth-success-B36KwAFt.js} +1 -1
  68. package/dist/client/assets/{collection-detail-CwmHQu2v.js → collection-detail-CbhoYXmP.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-CwlHCCWA.js → collection-display-button-DNbt3d2y.js} +1 -1
  70. package/dist/client/assets/{collection-search-ChsfwSm5.js → collection-search-BPoBI_I5.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-BKP4OHUr.js → collection-tabs-FH3-RtUV.js} +1 -1
  72. package/dist/client/assets/{command-BxulIERM.js → command-DMsCjDdA.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-Dg7vjIhZ.js → commerce-onboarding-Cv30K_3D.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-CRTSitBm.js → connect-desktop-dialog-G37q3fkg.js} +1 -1
  75. package/dist/client/assets/{connection-card-DHEsTOvl.js → connection-card-BG_Nwlzj.js} +1 -1
  76. package/dist/client/assets/{connection-detail-Dug72TML.js → connection-detail-oU0C71F8.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-DydZsosn.js → connection-form-helpers-DLOiycDJ.js} +1 -1
  78. package/dist/client/assets/{connections-D1302Qtf.js → connections-BgFAjnb1.js} +1 -1
  79. package/dist/client/assets/{context-menu-CIuP6HS5.js → context-menu-BRDnNrnF.js} +1 -1
  80. package/dist/client/assets/{decopilot-CTSJKb4z.js → decopilot-DfFzELja.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-BiYcCf8O.js → decopilot-sse-pool-TIer_srZ.js} +1 -1
  82. package/dist/client/assets/{dialog-CbpDnZu8.js → dialog-CxQBoX40.js} +1 -1
  83. package/dist/client/assets/{domain-settings-CoN7-60k.js → domain-settings-gFWo85oP.js} +1 -1
  84. package/dist/client/assets/{drawer-UU4w29Dz.js → drawer-CoRZTii0.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-QpPxe1tm.js → dropdown-menu-5CWPgj7f.js} +1 -1
  86. package/dist/client/assets/{empty-state-Do7xKqQm.js → empty-state-B-ezQrZT.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-DVGeC9AU.js → extract-connection-data-BaXkJtVr.js} +1 -1
  88. package/dist/client/assets/{file-explorer-D2afeXPb.js → file-explorer-CwlDpz6e.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-Cs_SK9tU.js → file-type-icon-Cd8oKt-R.js} +1 -1
  90. package/dist/client/assets/{files-5aenLfPW.js → files-CkNnfKPK.js} +1 -1
  91. package/dist/client/assets/{form-HH5S6Yti.js → form-CpFt_4sy.js} +1 -1
  92. package/dist/client/assets/{general-BnR0HO7J.js → general-9kWrBaDN.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-DvVBXFrQ.js → github-repo-picker-CvyWRbaM.js} +1 -1
  94. package/dist/client/assets/{hooks-fHAHvlgy.js → hooks-BAG9TZjZ.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-gGGcEtn9.js → import-from-deco-dialog-ga5lUGZx.js} +1 -1
  96. package/dist/client/assets/{index--YoOFH0C.js → index-ALZP0-mx.js} +1 -1
  97. package/dist/client/assets/{index-BMiO2DRK.js → index-BAfXUZ9K.js} +1 -1
  98. package/dist/client/assets/{index-Dm5Wtwak.js → index-BLMNER8l.js} +1 -1
  99. package/dist/client/assets/{index-1K74hihp.js → index-BU8Nad-n.js} +1 -1
  100. package/dist/client/assets/{index-GSJQ2HSb.js → index-BeB2S664.js} +1 -1
  101. package/dist/client/assets/{index-BlCwbTgh.js → index-BwC0cAdP.js} +1 -1
  102. package/dist/client/assets/{index-Cnw7T0fh.js → index-C_Ih0jtP.js} +1 -1
  103. package/dist/client/assets/{index-DEuymgXg.js → index-CiVkOVzW.js} +26 -26
  104. package/dist/client/assets/{index-DUxlPTha.js → index-DPI_0XE-.js} +1 -1
  105. package/dist/client/assets/{index-CJHqjy38.js → index-DS2I5JM3.js} +1 -1
  106. package/dist/client/assets/{index-CutM526i.js → index-DUdLsOJu.js} +1 -1
  107. package/dist/client/assets/{index-uyO8STkD.js → index-DZCgQXLz.js} +1 -1
  108. package/dist/client/assets/{index-DVyj5fuq.js → index-I8Uum3Jx.js} +4 -4
  109. package/dist/client/assets/{index-Cr1XkGY8.js → index-JhgoGL0k.js} +1 -1
  110. package/dist/client/assets/{index-redirect-B3cwEJb7.js → index-redirect-CP9ATXDl.js} +1 -1
  111. package/dist/client/assets/{input-GyW6rRcJ.js → input-CutcETvq.js} +1 -1
  112. package/dist/client/assets/{integration-icon-BtlW6ioP.js → integration-icon-D3W1euXX.js} +1 -1
  113. package/dist/client/assets/{label-DZS4CYvt.js → label-DtGUWURu.js} +1 -1
  114. package/dist/client/assets/{login-8FZgzert.js → login-DUTSfri0.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-BKEDlyVy.js → mcp-oauth-CSZ5TVrK.js} +1 -1
  116. package/dist/client/assets/{members-BJYRHZsS.js → members-Dq59tJj1.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-CGqqNDfH.js → monaco-editor-x5JEAvo5.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-D3Ly6cXH.js → monitoring-stats-row-BsPY2-bU.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-Dwd806qn.js → oauth-callback-BXF1WEWL.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-CC85HfxS.js → oauth-callback-ai-provider-MpQ7zAqW.js} +1 -1
  121. package/dist/client/assets/{onboarding-D0JBHrcc.js → onboarding-CKZFzjtY.js} +1 -1
  122. package/dist/client/assets/{org-install-DQyhSRpe.js → org-install-DVysq6Hz.js} +1 -1
  123. package/dist/client/assets/{org-layout-Cr-WH3RD.js → org-layout-hE5dYTZz.js} +1 -1
  124. package/dist/client/assets/{organization-choice-CoeFbp4N.js → organization-choice-y8WYOYM0.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-B7y574iK.js → page-seo-form-gPXTm6pw.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-CpMq28JR.js +1 -0
  127. package/dist/client/assets/{popover-DCt-yH34.js → popover-C8AJAJSa.js} +1 -1
  128. package/dist/client/assets/{post-editor-BZKlC439.js → post-editor-DrZmKifS.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-CvZ5HrrM.js → preview-dialog-D1-LAakL.js} +1 -1
  130. package/dist/client/assets/{primitives-DU5cdK_v.js → primitives-D7qGIw1V.js} +1 -1
  131. package/dist/client/assets/{profile-VCalx_au.js → profile-DwtHhCaD.js} +1 -1
  132. package/dist/client/assets/project-app-view-H9YA_3uu.js +1 -0
  133. package/dist/client/assets/record-editor-C64a4aNL.js +1 -0
  134. package/dist/client/assets/registry-CxYUBbU6.js +2 -0
  135. package/dist/client/assets/{registry-layout-UOOnsAxo.js → registry-layout-CZALtE-Q.js} +1 -1
  136. package/dist/client/assets/{require-capability-B3soU3U-.js → require-capability-DAovjPYR.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-DJ9sUOZj.js → required-auth-layout-BFGUeccA.js} +1 -1
  138. package/dist/client/assets/{reset-password-Cbn69hRw.js → reset-password-CrnrgmIx.js} +1 -1
  139. package/dist/client/assets/{roles-BUk_bsvO.js → roles-DRg1cyfq.js} +1 -1
  140. package/dist/client/assets/{save-status-CV3d48oi.js → save-status-BmnvufMt.js} +1 -1
  141. package/dist/client/assets/{scroll-area-BOzFl7qs.js → scroll-area-DnauLcxE.js} +1 -1
  142. package/dist/client/assets/{search-input-Bkwrx7tI.js → search-input-BVF4N9EW.js} +1 -1
  143. package/dist/client/assets/{secrets-BaUhAjXu.js → secrets-DPqx_gXC.js} +1 -1
  144. package/dist/client/assets/{sections-editor-B1yHaLKY.js → sections-editor-BLU0buUC.js} +1 -1
  145. package/dist/client/assets/{select-C3uZV2A_.js → select-CeO9pIG_.js} +1 -1
  146. package/dist/client/assets/{select-model-Q-rnyaMQ.js → select-model-mprfSN1i.js} +1 -1
  147. package/dist/client/assets/{seo-editor-tIrWl6nj.js → seo-editor-Dyh0ncgL.js} +1 -1
  148. package/dist/client/assets/{settings-layout-DTBcjBLr.js → settings-layout-BcPbOkgS.js} +1 -1
  149. package/dist/client/assets/{settings-section-BLfkvtRw.js → settings-section-B3kXnqLg.js} +1 -1
  150. package/dist/client/assets/{sheet-n3UWOPEl.js → sheet-CaSXRGPU.js} +1 -1
  151. package/dist/client/assets/{shell-controls-DhJC4c0p.js → shell-controls-D2Qn9uVj.js} +1 -1
  152. package/dist/client/assets/{shell-layout-xNLL_s4g.js → shell-layout-BgovnITR.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-Cpya0EwH.js → shell-route-loading-w2qYEgt-.js} +1 -1
  154. package/dist/client/assets/{sidebar-B5rVQTnV.js → sidebar-BNKGZwsk.js} +1 -1
  155. package/dist/client/assets/{skeleton-D20LVfuJ.js → skeleton-1BUBAFib.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-bhnYhglv.js → sortable.esm-BQBGtGRV.js} +1 -1
  157. package/dist/client/assets/{sso-1G-Lrcz1.js → sso-B5RA5Egt.js} +1 -1
  158. package/dist/client/assets/{store-B2Ao3pPp.js → store-Ni3ANns9.js} +1 -1
  159. package/dist/client/assets/store-registry-kIHn_jDR.js +2 -0
  160. package/dist/client/assets/{studio-tools-BvOjHliA.js → studio-tools-bjPFQfXc.js} +1 -1
  161. package/dist/client/assets/{switch-aFiGEpQz.js → switch-B9PlH85E.js} +1 -1
  162. package/dist/client/assets/{table-DerXyAj5.js → table-Bh38Wtyx.js} +1 -1
  163. package/dist/client/assets/{tabs-C2oZPeQe.js → tabs-C0RM8s7M.js} +1 -1
  164. package/dist/client/assets/{task-status-D2kMSoyM.js → task-status-sw3Y4pwg.js} +1 -1
  165. package/dist/client/assets/{textarea-C8t5NRp5.js → textarea-CvR7iHW3.js} +1 -1
  166. package/dist/client/assets/{toggle-group-DJ8r0lkn.js → toggle-group-qpErv2AC.js} +1 -1
  167. package/dist/client/assets/{toolbar-CH6VbS3Q.js → toolbar-CB27CeHy.js} +1 -1
  168. package/dist/client/assets/{tooltip-3uKRhKGc.js → tooltip-Cs84Kx7a.js} +1 -1
  169. package/dist/client/assets/{types-pwajyff_.js → types-pQkRXbdZ.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-CWY8hivp.js → use-ai-providers-BgadC07_.js} +1 -1
  171. package/dist/client/assets/{use-automations-D3-t22-_.js → use-automations-P1MHR3DS.js} +1 -1
  172. package/dist/client/assets/{use-capability-BjlflkMO.js → use-capability-BUm2GwYJ.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-CzIilxCh.js → use-clock-tick-DNfOIVGO.js} +1 -1
  174. package/dist/client/assets/{use-collections-DCQeHkgD.js → use-collections-KLUYE1x1.js} +1 -1
  175. package/dist/client/assets/{use-connection-CzcC522C.js → use-connection-BcZ8SPdu.js} +1 -1
  176. package/dist/client/assets/{use-copy-DwazvcnZ.js → use-copy-3_Rhxcs5.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-Bd6NX9e2.js → use-create-virtual-mcp-BUg1GOjA.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-7QeHZ0an.js → use-debounced-autosave-CSkDAooO.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-BuL4NUvH.js → use-delete-connection-CRtYZbhZ.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-CElizRPA.js → use-file-configs-YBpYKsXP.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-BXMBgtt1.js → use-infinite-scroll-BJoUj4tJ.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-BNKnZPHN.js → use-join-requests-7lEKJyAD.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-fdcDDNuq.js → use-mcp-client-Bq9g8m5J.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-D-HAq_yv.js → use-mcp-prompts-B5FIxmOZ.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-B6s0E39X.js → use-mcp-tools-LraQQ1bu.js} +1 -1
  186. package/dist/client/assets/{use-members-GGq7DYTP.js → use-members-D283HZiN.js} +1 -1
  187. package/dist/client/assets/{use-mobile-CvxOtGtu.js → use-mobile-C0mpADhR.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-DwfR9Suw.js → use-navigate-to-agent-CRQ9sIAj.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-DXTnBB9n.js → use-org-auth-client-WATciLg3.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-B6LnDpoK.js → use-org-sso-HWNvOeDC.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-tYXE1Sad.js → use-organization-roles-Cyp5dthQ.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-BnxEz1nn.js → use-organization-settings-oh1iUWuA.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-B-i9Sftv.js → use-registry-connections-d6Abj3O4.js} +1 -1
  194. package/dist/client/assets/{use-secrets-DS1SrxPb.js → use-secrets-CkVHtz_G.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-9_fdEsNO.js → use-status-sounds-MBoAiBsc.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-DFO97l4B.js → use-view-mode-Dhn_wt1k.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-ufrd8iJJ.js → use-virtual-mcp-C5aoCVVQ.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-RfoATJAI.js +1 -0
  199. package/dist/client/assets/useSuspenseInfiniteQuery-DBiSYggu.js +1 -0
  200. package/dist/client/assets/{useSuspenseQueries-CKrSo39Z.js → useSuspenseQueries-C6KWJru5.js} +1 -1
  201. package/dist/client/assets/{variant-calendar-DotXoiJr.js → variant-calendar-krPIZ_Rp.js} +1 -1
  202. package/dist/client/assets/{view-mode-toggle-C9lZfxMp.js → view-mode-toggle-DTMt6lCZ.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +361 -361
  205. package/dist/server/server.js +255 -255
  206. package/package.json +1 -1
  207. package/dist/client/assets/page-seo-sheet-C7aYjteJ.js +0 -1
  208. package/dist/client/assets/project-app-view-DY9V3RKN.js +0 -1
  209. package/dist/client/assets/record-editor-Iup_3GZW.js +0 -1
  210. package/dist/client/assets/registry-C1pjl2mg.js +0 -2
  211. package/dist/client/assets/store-registry-CnLvGy-0.js +0 -2
  212. package/dist/client/assets/useInfiniteQuery-D6zHLjhR.js +0 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-BEAkaT6v.js +0 -1
@@ -1 +1 @@
1
- import{cG as C,c as f,j as c,af as j,r as d,l as p,bg as b,cH as v,cI as h}from"./index-DVyj5fuq.js";import{L as N}from"./label-DZS4CYvt.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,R as e,y as f};
1
+ import{cG as C,c as f,j as c,af as j,r as d,l as p,bg as b,cH as v,cI as h}from"./index-I8Uum3Jx.js";import{L as N}from"./label-DtGUWURu.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,R as e,y as f};
@@ -1 +1 @@
1
- import{b as M,D as $,m as U,p as Q,n as Y,d as q,w as P,t as w,K as L,j as n,af as I,o as Z,s as k,c as E,r as T,B as H,L as B,y as J}from"./index-DVyj5fuq.js";import{P as N}from"./index-1K74hihp.js";import{u as W}from"./use-org-auth-client-DXTnBB9n.js";import{u as X}from"./use-debounced-autosave-7QeHZ0an.js";import{A as ee}from"./avatar-BVLQzOkg.js";import{I as V}from"./input-GyW6rRcJ.js";import{S as K,a as G,b as A,c as te}from"./settings-section-BLfkvtRw.js";import{D as ne}from"./domain-settings-CoN7-60k.js";import{u as ae}from"./studio-tools-BvOjHliA.js";import{c as se,b as oe,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-C-zjIGep.js";import{R as me}from"./require-capability-B3soU3U-.js";import"./sidebar-B5rVQTnV.js";import"./LayoutLeft-C_wbh4sE.js";import"./use-mobile-CvxOtGtu.js";import"./sheet-n3UWOPEl.js";import"./X-D5odjFOj.js";import"./tooltip-3uKRhKGc.js";import"./User01-KLLrp_Cb.js";import"./card-Dcgr1F8G.js";import"./ArrowUpRight-KPaHD_ZU.js";import"./badge-DySIiC0W.js";import"./select-C3uZV2A_.js";import"./ChevronUp-CUesWqmK.js";import"./ChevronDown-DJ5SHmhN.js";import"./use-capability-BjlflkMO.js";import"./access-gate-B1FO8IUq.js";import"./capability-load-error-dMfRi5Lm.js";const ge=Z({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function fe(e){const t=E.c(13),{value:v,onChange:h,name:o,disabled:d}=e,m=T.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=pe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let s;t[3]!==d||t[4]!==a?(s=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=s):s=t[5];const i=v||void 0,p=o??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==s||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,g]}),t[9]=d,t[10]=s,t[11]=g,t[12]=f):f=t[12],f}function pe(){return w.error("Failed to read image")}function he(){const e=M(),{org:t}=$(),v=W(),h=U(),o=Q({resolver:Y(ge),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=q({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const i=await v.organization.update({data:s});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,s)=>{P("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:L.organizations()}),h.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,s)=>{P("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const i=o.getValues(),p=o.control._defaultValues;o.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{o.reset(p,{keepValues:!0})}}}),r=o.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(K,{children:n.jsxs(G,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(fe,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(I,{control:o.control,name:"name",render:({field:a})=>n.jsx(V,{id:"org-name",...a,onChange:s=>{a.onChange(s),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(I,{control:o.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:s=>{const i=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function xe(){const e=E.c(42),{org:t}=$(),[v,h]=T.useState(!1),[o,d]=T.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{P("organization_deleted",{organization_id:t.id}),localStorage.getItem(B.lastOrgSlug())===t.slug&&localStorage.removeItem(B.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:je},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=q(c);let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=()=>h(!0),e[9]=s):s=e[9];let i;e[10]!==a.isPending?(i=n.jsx(K,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(G,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(H,{variant:"destructive",size:"sm",onClick:s,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(se,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==o||e[20]!==t.name?(u=n.jsx(V,{value:o,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=o,e[20]=t.name,e[21]=u):u=e[21];let y;e[22]!==u||e[23]!==f||e[24]!==x?(y=n.jsxs(oe,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=y):y=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(re,{children:"Cancel"}),e[26]=D):D=e[26];let b;e[27]!==a?(b=()=>a.mutate(),e[27]=a,e[28]=b):b=e[28];const F=o!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==b||e[30]!==F||e[31]!==R?(S=n.jsxs(le,{children:[D,n.jsx(ce,{onClick:b,disabled:F,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=b,e[30]=F,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ue,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let _;return e[39]!==C||e[40]!==i?(_=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=_):_=e[41],_}function je(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ve(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(he,{}),n.jsx(ne,{}),n.jsx(xe,{})]})})})}),e[0]=t):t=e[0],t}function Qe(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ve,{})}),e[0]=t):t=e[0],t}export{Qe as default};
1
+ import{b as M,D as $,m as U,p as Q,n as Y,d as q,w as P,t as w,K as L,j as n,af as I,o as Z,s as k,c as E,r as T,B as H,L as B,y as J}from"./index-I8Uum3Jx.js";import{P as N}from"./index-BU8Nad-n.js";import{u as W}from"./use-org-auth-client-WATciLg3.js";import{u as X}from"./use-debounced-autosave-CSkDAooO.js";import{A as ee}from"./avatar-Dv3IrttI.js";import{I as V}from"./input-CutcETvq.js";import{S as K,a as G,b as A,c as te}from"./settings-section-B3kXnqLg.js";import{D as ne}from"./domain-settings-gFWo85oP.js";import{u as ae}from"./studio-tools-bjPFQfXc.js";import{c as se,b as oe,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-DvWgcmQI.js";import{R as me}from"./require-capability-DAovjPYR.js";import"./sidebar-BNKGZwsk.js";import"./LayoutLeft-BFxGsVdk.js";import"./use-mobile-C0mpADhR.js";import"./sheet-CaSXRGPU.js";import"./X-D7X7Z50V.js";import"./tooltip-Cs84Kx7a.js";import"./User01-BDtU1dk1.js";import"./card-Chq65iX4.js";import"./ArrowUpRight-CAv7CUnJ.js";import"./badge-toKsUzoB.js";import"./select-CeO9pIG_.js";import"./ChevronUp-HJUE3-BD.js";import"./ChevronDown-URo4LveF.js";import"./use-capability-BUm2GwYJ.js";import"./access-gate-6AWas-Ss.js";import"./capability-load-error-BRyHg_Rt.js";const ge=Z({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function fe(e){const t=E.c(13),{value:v,onChange:h,name:o,disabled:d}=e,m=T.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=pe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let s;t[3]!==d||t[4]!==a?(s=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=s):s=t[5];const i=v||void 0,p=o??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==s||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,g]}),t[9]=d,t[10]=s,t[11]=g,t[12]=f):f=t[12],f}function pe(){return w.error("Failed to read image")}function he(){const e=M(),{org:t}=$(),v=W(),h=U(),o=Q({resolver:Y(ge),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=q({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const i=await v.organization.update({data:s});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,s)=>{P("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:L.organizations()}),h.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,s)=>{P("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const i=o.getValues(),p=o.control._defaultValues;o.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{o.reset(p,{keepValues:!0})}}}),r=o.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(K,{children:n.jsxs(G,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(fe,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(I,{control:o.control,name:"name",render:({field:a})=>n.jsx(V,{id:"org-name",...a,onChange:s=>{a.onChange(s),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(I,{control:o.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:s=>{const i=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function xe(){const e=E.c(42),{org:t}=$(),[v,h]=T.useState(!1),[o,d]=T.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{P("organization_deleted",{organization_id:t.id}),localStorage.getItem(B.lastOrgSlug())===t.slug&&localStorage.removeItem(B.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:je},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=q(c);let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=()=>h(!0),e[9]=s):s=e[9];let i;e[10]!==a.isPending?(i=n.jsx(K,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(G,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(H,{variant:"destructive",size:"sm",onClick:s,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(se,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==o||e[20]!==t.name?(u=n.jsx(V,{value:o,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=o,e[20]=t.name,e[21]=u):u=e[21];let y;e[22]!==u||e[23]!==f||e[24]!==x?(y=n.jsxs(oe,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=y):y=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(re,{children:"Cancel"}),e[26]=D):D=e[26];let b;e[27]!==a?(b=()=>a.mutate(),e[27]=a,e[28]=b):b=e[28];const F=o!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==b||e[30]!==F||e[31]!==R?(S=n.jsxs(le,{children:[D,n.jsx(ce,{onClick:b,disabled:F,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=b,e[30]=F,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ue,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let _;return e[39]!==C||e[40]!==i?(_=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=_):_=e[41],_}function je(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ve(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(he,{}),n.jsx(ne,{}),n.jsx(xe,{})]})})})}),e[0]=t):t=e[0],t}function Qe(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ve,{})}),e[0]=t):t=e[0],t}export{Qe as default};
@@ -1 +1 @@
1
- import{c as L,j as t,D as Q,a as te,m as W,r as A,a7 as B,i as F,d as ne,t as z,K as V,k as se,l as K,q as oe,ag as re}from"./index-DVyj5fuq.js";import{c as ie,d as ae,b as le,a as ce}from"./dialog-CbpDnZu8.js";import{C as J}from"./checkbox-DtAK_uVJ.js";import{C as ue}from"./collection-search-ChsfwSm5.js";import{b as de,u as me}from"./use-connection-CzcC522C.js";import{W as fe,u as H,S as X}from"./use-mcp-client-fdcDDNuq.js";import{b as Z}from"./Settings02-k7X7M16V.js";import{v as pe}from"./agent-icon-AqXPfJak.js";import{a as ge}from"./authenticate-and-persist-oauth-DBMlTO0L.js";import{u as xe}from"./use-mcp-tools-B6s0E39X.js";import{e as he}from"./extract-connection-data-DVGeC9AU.js";import{m as be}from"./use-navigate-to-agent-DwfR9Suw.js";function U(s){const e=L.c(4),{size:n,className:o}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=c):c=e[0];let a;return e[1]!==o||e[2]!==n?(a=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:c}),e[1]=o,e[2]=n,e[3]=a):a=e[3],a}function ye(s,e){const n=L.c(12),{org:o}=Q();let c;n[0]!==o.id?(c=fe.REGISTRY(o.id),n[0]=o.id,n[1]=c):c=n[1];const a=c;let r;n[2]!==o.id||n[3]!==o.slug||n[4]!==a?(r={connectionId:a,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=a,n[5]=r):r=n[5];const m=H(r);let f;n[6]!==s?(f={name:s},n[6]=s,n[7]=f):f=n[7];const i=e?.enabled??!0;let h;return n[8]!==m||n[9]!==f||n[10]!==i?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:i,staleTime:3e5,select:we},n[8]=m,n[9]=f,n[10]=i,n[11]=h):h=n[11],xe(h)}function we(s){return s.structuredContent?.item??null}const Ne="deco/mcp-github";function Ie(s){const{org:e}=Q(),{data:n}=te.useSession(),o=de(),c=W(),[a,r]=A.useState("idle"),[m,f]=A.useState(null),[i,h]=A.useState(null),{data:x,isLoading:l}=ye(Ne,{enabled:s.enabled}),w=A.useRef(!1);s.enabled&&x&&!l&&!w.current&&n?.user?.id&&a==="idle"&&(w.current=!0,y());async function y(){if(!(!x||!n?.user?.id||!e))try{r("installing"),f(null);const b=he(x,e.id,n.user.id,{remoteIndex:0});if(!b.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:S}=await o.create.mutateAsync(b);r("authenticating");const p=await ge({connectionId:S,orgId:e.id,orgSlug:e.slug,persistFallback:d=>o.update.mutateAsync({id:S,data:{connection_token:d}}).then(()=>{})});if(p.ran&&!p.ok){try{await o.delete.mutateAsync(S)}catch{}throw new Error(p.error&&p.error!=="no token received"?p.error:"No token received from GitHub")}B(c,e.id),h(b),r("ready")}catch(b){f(b instanceof Error?b.message:String(b)),r("error")}}function N(){r("idle"),f(null),h(null),w.current=!1}return s.enabled&&l&&a==="idle"?{status:"installing",error:null,connection:null,retry:N}:{status:a,error:m,connection:i,retry:N}}const M={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return M;const e=s;return Object.values(e).some(n=>typeof n!="string")?M:e}function je(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ce(s){const e=s.metadata?.repoScope;if(!e||typeof e.installationId!="number"||!Number.isFinite(e.installationId)||!Number.isInteger(e.installationId)||e.installationId<=0||typeof e.owner!="string"||typeof e.repo!="string"||e.owner.length===0||e.repo.length===0)return null;const n=je(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Se(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function ve(s){return(s??[]).filter(e=>Ce(e)===null)}async function Ee(s,e){const o=(await s({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:e}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(o)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function We(s,e){const n=e.toLowerCase();return s.find(o=>o.login.toLowerCase()===n)}const Y="GitHub MCP did not return refreshable repo grant metadata";function $(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function Te(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function _e(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function ke(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:c,repo:a,githubCallTool:r,selfCallTool:m}=s,f=await r({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:c,repo:a,permissions:M}}),i=f.structuredContent;if(f.isError||!i?.token){const T=f.content?.find(v=>v.type==="text")?.text;throw new Error(T?`Failed to mint a repo-scoped GitHub token: ${T}`:"Failed to mint a repo-scoped GitHub token")}const h=$(i.refreshToken),x=$(i.tokenEndpoint),l=$(i.clientId);if(!h||!x||!l)throw new Error(Y);if(!Te(x))throw new Error(Y);const w=$(i.repository?.owner),y=$(i.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==c.toLowerCase()))throw new Error(N);if(i.repository?.name!==void 0&&(!y||y.toLowerCase()!==a.toLowerCase()))throw new Error(N);const b=_e(i.repository?.id),I=i.expiresAt?Date.parse(i.expiresAt):NaN,S=Number.isFinite(I)?Math.max(0,Math.floor((I-Date.now())/1e3)):null,d=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??S,j=await m({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${c}/${a}`,description:`Repo-scoped GitHub access for ${c}/${a}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{repoScope:{installationId:o,repositoryId:b,owner:c,repo:a,permissions:M,grantProvider:"github-mcp"}}}}}),g=j.structuredContent??j,C=g.item?.id??g.id;if(!C)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${C}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:d,scope:i.scope??null,clientId:l,tokenEndpoint:x})})).ok)throw await m({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:C}}function Re(s,e){const n=L.c(4),[o,c]=A.useState(s);let a,r;return n[0]!==e||n[1]!==s?(a=()=>{const m=setTimeout(()=>c(s),e);return()=>clearTimeout(m)},r=[s,e],n[0]=e,n[1]=s,n[2]=a,n[3]=r):(a=n[2],r=n[3]),A.useEffect(a,r),o}const D=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A new GitHub issue has been opened in ${s}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A pull request was opened in ${s}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:s,name:e})=>`A pull request was closed in ${s}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function Ae(s,e){const n=new Set;if(s.paramsSchema)for(const c of Object.keys(s.paramsSchema))n.add(c);if(Array.isArray(s.params))for(const c of s.params)n.add(c.name);else if(s.params&&typeof s.params=="object")for(const c of Object.keys(s.params))n.add(c);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const o={};return n.has("owner")&&(o.owner=e.owner),n.has("name")&&(o.name=e.name),n.has("repository")&&(o.repository=`${e.owner}/${e.name}`),o}async function Oe({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:c,selectedKeys:a}){const r=await s({name:"TRIGGER_LIST",arguments:{}}),m=r.structuredContent??r,f=new Map((m.triggers??[]).map(l=>[l.type,l])),i=D.filter(l=>a.has(l.key)),h=await Promise.allSettled(i.map(async l=>{const w=f.get(l.triggerType);if(!w)throw new Error(`Trigger ${l.triggerType} not exposed`);const y=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${l.nameSuffix}`,virtual_mcp_id:n,messages:l.instructions(o),active:!0}}),N=(y.structuredContent??y).id;if(!N)throw new Error(`AUTOMATION_CREATE returned no id for ${l.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:N,type:"event",connection_id:c,event_type:l.triggerType,params:Ae(w,o)}})})),x=h.filter(l=>l.status==="rejected").length;return x>0&&console.error("Some GitHub automations failed to set up:",h.filter(l=>l.status==="rejected")),{total:h.length,failed:x}}function Xe(s){const e=L.c(22),{open:n,onOpenChange:o,title:c,hideAutoRespondCheckbox:a,onImportComplete:r}=s,m=c===void 0?"Import from GitHub":c,f=a===void 0?!1:a,[i,h]=A.useState(null);let x;e[0]!==m?(x=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:m})}),e[0]=m,e[1]=x):x=e[1];let l;e[2]!==i||e[3]!==m?(l=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:i?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>h(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Z,{size:16})}),t.jsx("img",{src:i.avatarUrl,alt:i.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(U,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:m})]})}),e[2]=i,e[3]=m,e[4]=l):l=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let y;e[6]!==o?(y=()=>o(!1),e[6]=o,e[7]=y):y=e[7];let N;e[8]!==f||e[9]!==r||e[10]!==n||e[11]!==i||e[12]!==y?(N=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(A.Suspense,{fallback:w,children:t.jsx(Ge,{open:n,onComplete:y,selectedInstallation:i,onSelectInstallation:h,hideAutoRespondCheckbox:f,onImportComplete:r})})}),e[8]=f,e[9]=r,e[10]=n,e[11]=i,e[12]=y,e[13]=N):N=e[13];let b;e[14]!==x||e[15]!==l||e[16]!==N?(b=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[x,l,N]}),e[14]=x,e[15]=l,e[16]=N,e[17]=b):b=e[17];let I;return e[18]!==o||e[19]!==n||e[20]!==b?(I=t.jsx(ce,{open:n,onOpenChange:o,children:b}),e[18]=o,e[19]=n,e[20]=b,e[21]=I):I=e[21],I}function Ge({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:c,onImportComplete:a}){const{org:r}=Q(),m=W(),f=be(),[i,h]=A.useState(null),[x,l]=A.useState(!0),[w,y]=A.useState(()=>new Set(D.filter(u=>u.defaultEnabled).map(u=>u.key))),N=D.filter(u=>u.defaultEnabled).map(u=>u.key),b=c?new Set(N):x?w:new Set,I=me({slug:"mcp-github"}),S=ve(I),p=Ie({enabled:s&&S.length===0}),d=S.length===1?S[0]??null:i,j=H({connectionId:d?.id??"",orgId:r.id,orgSlug:r.slug}),g=H({connectionId:X,orgId:r.id,orgSlug:r.slug}),C=async(u,E)=>{try{const G=await j.callTool({name:"get_file_contents",arguments:{owner:u.owner,repo:u.name,path:E}});if(G.isError)return null;const P=G.content?.find(R=>R.type==="resource")?.resource?.text;if(!P)return null;try{const R=JSON.parse(P);return typeof R=="string"?R:JSON.stringify(R)}catch{return P}}catch{return null}},O=(u,E)=>{Promise.all([C(E,"AGENTS.md"),C(E,"CLAUDE.md")]).then(async([k,G])=>{const _=k??G??null;_&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:u,data:{metadata:{instructions:_}}}}),B(m,r.id))}).catch(k=>{console.error("GitHub instructions fetch failed:",k)})},T=async({virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G})=>{const{total:_,failed:P}=await Oe({githubCallTool:R=>j.callTool(R),selfCallTool:R=>g.callTool(R),virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G});P>0&&z.warning(`Set up ${_-P}/${_} GitHub automations. Add the rest from the automations view.`)},v=ne({mutationFn:async u=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:k}=await ke({orgSlug:r.slug,sourceConnection:d,installationId:E,owner:u.owner,repo:u.name,githubCallTool:_=>j.callTool(_),selfCallTool:_=>g.callTool(_)});let G=null;try{const _=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:u.name,description:u.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:u.owner,name:u.name,url:u.url,installationId:E,connectionId:k},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:k}]}}}),P=_.structuredContent??_,R=P.item?.id;if(!P.item||!R)throw new Error("Failed to create the imported agent");return G=R,b.size>0&&await T({virtualMcpId:R,repo:u,connectionId:k,selectedKeys:b}).catch(ee=>{console.error("Failed to set up GitHub automations:",ee),z.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:R,repo:u,connectionId:k,item:P.item}}catch(_){throw G&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:G}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),_}},onSuccess:({virtualMcpId:u,repo:E,connectionId:k,item:G})=>{if(m.setQueryData(V.collectionItem(g,r.id,"","VIRTUAL_MCP",u),{item:G}),B(m,r.id),O(u,E),a){a({virtualMcpId:u,repo:E,connectionId:k});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),f(u)},onError:u=>{z.error("Failed to import repo: "+(u instanceof Error?u.message:"Unknown error"))}});return p.status==="installing"||p.status==="authenticating"?t.jsx(q,{status:p.status,error:null,retry:p.retry}):p.status==="error"?t.jsx(q,{status:"error",error:p.error,retry:p.retry}):S.length===0&&p.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:p.retry}):S.length>1&&!d?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),S.map(u=>t.jsxs("button",{type:"button",onClick:()=>h(u),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[u.icon?t.jsx("img",{src:u.icon,alt:u.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(U,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:u.title})]},u.id))]}):d?n?t.jsx(Le,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:u=>v.mutate(u),isSaving:v.isPending,autoRespondEnabled:x,onAutoRespondChange:l,selectedAutomationKeys:w,onAutomationKeysChange:y,hideAutoRespondCheckbox:c}):t.jsx(Pe,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,onSelect:o,showBackButton:S.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=L.c(31),{connectionId:n,orgId:o,orgSlug:c,onSelect:a,showBackButton:r,onBack:m}=s;let f;e[0]!==o||e[1]!==c?(f={connectionId:X,orgId:o,orgSlug:c},e[0]=o,e[1]=c,e[2]=f):f=e[2];const i=H(f);let h;e[3]!==n||e[4]!==o?(h=V.githubUserOrgs(o,n),e[3]=n,e[4]=o,e[5]=h):h=e[5];let x;e[6]!==n||e[7]!==i?(x=()=>Ee(g=>i.callTool(g),n),e[6]=n,e[7]=i,e[8]=x):x=e[8];let l;e[9]!==h||e[10]!==x?(l={queryKey:h,queryFn:x},e[9]=h,e[10]=x,e[11]=l):l=e[11];const w=se(l);if(w.isLoading){let g;return e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=g):g=e[12],g}if(w.isError){let g;return e[13]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=g):g=e[13],g}const y=w.data;if(!y)return null;let N;e[14]!==m||e[15]!==r?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Z,{size:12}),"Change connection"]})}),e[14]=m,e[15]=r,e[16]=N):N=e[16];let b;if(e[17]!==y.installations||e[18]!==a){let g;e[20]!==a?(g=C=>t.jsxs("button",{type:"button",onClick:()=>a(C),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:C.avatarUrl,alt:C.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:C.login}),C.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},C.installationId),e[20]=a,e[21]=g):g=e[21],b=y.installations.map(g),e[17]=y.installations,e[18]=a,e[19]=b}else b=e[19];let I;e[22]!==b?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:b}),e[22]=b,e[23]=I):I=e[23];const S=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=p):p=e[24];let d;e[25]!==S?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",p]})}),e[25]=S,e[26]=d):d=e[26];let j;return e[27]!==d||e[28]!==N||e[29]!==I?(j=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,I,d]}),e[27]=d,e[28]=N,e[29]=I,e[30]=j):j=e[30],j}function Le(s){const e=L.c(27),{connectionId:n,orgId:o,orgSlug:c,installation:a,onSelectRepo:r,isSaving:m,autoRespondEnabled:f,onAutoRespondChange:i,selectedAutomationKeys:h,onAutomationKeysChange:x,hideAutoRespondCheckbox:l}=s,[w,y]=A.useState(""),N=Re(w,300),b=A.useDeferredValue(N),I=w!==b;let S;e[0]!==I||e[1]!==w?(S=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:y,isSearching:I}),e[0]=I,e[1]=w,e[2]=S):S=e[2];const p=I?"opacity-40":"opacity-100";let d;e[3]!==p?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",p),e[3]=p,e[4]=d):d=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let g;e[6]!==n||e[7]!==b||e[8]!==a||e[9]!==m||e[10]!==r||e[11]!==o||e[12]!==c?(g=t.jsx(A.Suspense,{fallback:j,children:t.jsx($e,{connectionId:n,orgId:o,orgSlug:c,installation:a,query:b,onSelectRepo:r,isSaving:m})}),e[6]=n,e[7]=b,e[8]=a,e[9]=m,e[10]=r,e[11]=o,e[12]=c,e[13]=g):g=e[13];let C;e[14]!==d||e[15]!==g?(C=t.jsx("div",{className:d,children:g}),e[14]=d,e[15]=g,e[16]=C):C=e[16];let O;e[17]!==f||e[18]!==l||e[19]!==i||e[20]!==x||e[21]!==h?(O=!l&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(J,{checked:f,onCheckedChange:v=>i(v===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),f&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.map(v=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(J,{checked:h.has(v.key),onCheckedChange:u=>{const E=new Set(h);u===!0?E.add(v.key):E.delete(v.key),x(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:v.label})]},v.key))})]}),e[17]=f,e[18]=l,e[19]=i,e[20]=x,e[21]=h,e[22]=O):O=e[22];let T;return e[23]!==S||e[24]!==C||e[25]!==O?(T=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[S,C,O]}),e[23]=S,e[24]=C,e[25]=O,e[26]=T):T=e[26],T}function $e(s){const e=L.c(29),{connectionId:n,orgId:o,orgSlug:c,installation:a,query:r,onSelectRepo:m,isSaving:f}=s;let i;e[0]!==n||e[1]!==o||e[2]!==c?(i={connectionId:n,orgId:o,orgSlug:c},e[0]=n,e[1]=o,e[2]=c,e[3]=i):i=e[3];const h=H(i),x=a.type==="User"?"user":"org",l=r?`${x}:${a.login} ${r} in:name`:`${x}:${a.login}`;let w;e[4]!==n||e[5]!==a.login||e[6]!==o||e[7]!==r?(w=V.githubOrgRepos(o,n,a.login,r),e[4]=n,e[5]=a.login,e[6]=o,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==h||e[10]!==l?(y=async p=>{const{signal:d}=p,g=(await h.callTool({name:"search_repositories",arguments:{query:l,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!g)throw new Error("No response from search_repositories");return(JSON.parse(g).items??[]).map(He)},e[9]=h,e[10]=l,e[11]=y):y=e[11];let N;e[12]!==w||e[13]!==y?(N={queryKey:w,queryFn:y},e[12]=w,e[13]=y,e[14]=N):N=e[14];const{data:b}=oe(N);if(b.length===0){let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=p):p=e[15];let d;e[16]!==r?(d=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=r,e[17]=d):d=e[17];let j;return e[18]!==d?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[p,d]}),e[18]=d,e[19]=j):j=e[19],j}let I;if(e[20]!==f||e[21]!==m||e[22]!==b){let p;e[24]!==f||e[25]!==m?(p=d=>t.jsxs("button",{type:"button",onClick:()=>m(d),disabled:f,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(U,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:d.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[d.private?t.jsx(re,{size:10}):t.jsx(pe,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=f,e[25]=m,e[26]=p):p=e[26],I=b.map(p),e[20]=f,e[21]=m,e[22]=b,e[23]=I}else I=e[23];let S;return e[27]!==I?(S=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:I}),e[27]=I,e[28]=S):S=e[28],S}function He(s){return{name:s.name,fullName:s.full_name,owner:s.full_name.split("/")[0]??"",url:s.html_url,private:s.private,description:s.description,updatedAt:s.updated_at}}function q(s){const e=L.c(33),{status:n,error:o,retry:c}=s;if(n==="error"){let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-destructive"})}),e[0]=g):g=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=C):C=e[1];const O=o??"Something went wrong while connecting to GitHub.";let T;e[2]!==O?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:O})]}),e[2]=O,e[3]=T):T=e[3];let v;e[4]!==c?(v=t.jsx("button",{type:"button",onClick:c,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=c,e[5]=v):v=e[5];let u;return e[6]!==T||e[7]!==v?(u=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[g,T,v]}),e[6]=T,e[7]=v,e[8]=u):u=e[8],u}const a=n==="authenticating";let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-foreground"})}),e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(F,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const f=a?"Authenticating with GitHub":"Setting up GitHub";let i;e[11]!==f?(i=t.jsx("p",{className:"text-sm font-medium",children:f}),e[11]=f,e[12]=i):i=e[12];const h=a?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let x;e[13]!==h?(x=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=x):x=e[14];let l;e[15]!==i||e[16]!==x?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[i,x]}),e[15]=i,e[16]=x,e[17]=l):l=e[17];const w=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let y;e[18]!==w?(y=K("size-1.5 rounded-full",w),e[18]=w,e[19]=y):y=e[19];let N;e[20]!==y?(N=t.jsx("span",{className:y}),e[20]=y,e[21]=N):N=e[21];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let I;e[22]!==b?(I=K("size-1.5 rounded-full",b),e[22]=b,e[23]=I):I=e[23];let S;e[24]!==I?(S=t.jsx("span",{className:I}),e[24]=I,e[25]=S):S=e[25];let p;e[26]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=p):p=e[26];let d;e[27]!==N||e[28]!==S?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,S,p]}),e[27]=N,e[28]=S,e[29]=d):d=e[29];let j;return e[30]!==d||e[31]!==l?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,l,d]}),e[30]=d,e[31]=l,e[32]=j):j=e[32],j}export{Xe as G,U as a,We as b,Ee as f,ve as g,ke as p,Ie as u};
1
+ import{c as L,j as t,D as Q,a as te,m as W,r as A,a7 as B,i as F,d as ne,t as z,K as V,k as se,l as K,q as oe,ag as re}from"./index-I8Uum3Jx.js";import{c as ie,d as ae,b as le,a as ce}from"./dialog-CxQBoX40.js";import{C as J}from"./checkbox-KUrNOBQk.js";import{C as ue}from"./collection-search-BPoBI_I5.js";import{b as de,u as me}from"./use-connection-BcZ8SPdu.js";import{W as fe,u as H,S as X}from"./use-mcp-client-Bq9g8m5J.js";import{b as Z}from"./Settings02-DbH9OAzT.js";import{v as pe}from"./agent-icon-B2N3zGQH.js";import{a as ge}from"./authenticate-and-persist-oauth-CGYbK6H8.js";import{u as xe}from"./use-mcp-tools-LraQQ1bu.js";import{e as he}from"./extract-connection-data-BaXkJtVr.js";import{m as be}from"./use-navigate-to-agent-CRQ9sIAj.js";function U(s){const e=L.c(4),{size:n,className:o}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=c):c=e[0];let a;return e[1]!==o||e[2]!==n?(a=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:c}),e[1]=o,e[2]=n,e[3]=a):a=e[3],a}function ye(s,e){const n=L.c(12),{org:o}=Q();let c;n[0]!==o.id?(c=fe.REGISTRY(o.id),n[0]=o.id,n[1]=c):c=n[1];const a=c;let r;n[2]!==o.id||n[3]!==o.slug||n[4]!==a?(r={connectionId:a,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=a,n[5]=r):r=n[5];const m=H(r);let f;n[6]!==s?(f={name:s},n[6]=s,n[7]=f):f=n[7];const i=e?.enabled??!0;let h;return n[8]!==m||n[9]!==f||n[10]!==i?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:i,staleTime:3e5,select:we},n[8]=m,n[9]=f,n[10]=i,n[11]=h):h=n[11],xe(h)}function we(s){return s.structuredContent?.item??null}const Ne="deco/mcp-github";function Ie(s){const{org:e}=Q(),{data:n}=te.useSession(),o=de(),c=W(),[a,r]=A.useState("idle"),[m,f]=A.useState(null),[i,h]=A.useState(null),{data:x,isLoading:l}=ye(Ne,{enabled:s.enabled}),w=A.useRef(!1);s.enabled&&x&&!l&&!w.current&&n?.user?.id&&a==="idle"&&(w.current=!0,y());async function y(){if(!(!x||!n?.user?.id||!e))try{r("installing"),f(null);const b=he(x,e.id,n.user.id,{remoteIndex:0});if(!b.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:S}=await o.create.mutateAsync(b);r("authenticating");const p=await ge({connectionId:S,orgId:e.id,orgSlug:e.slug,persistFallback:d=>o.update.mutateAsync({id:S,data:{connection_token:d}}).then(()=>{})});if(p.ran&&!p.ok){try{await o.delete.mutateAsync(S)}catch{}throw new Error(p.error&&p.error!=="no token received"?p.error:"No token received from GitHub")}B(c,e.id),h(b),r("ready")}catch(b){f(b instanceof Error?b.message:String(b)),r("error")}}function N(){r("idle"),f(null),h(null),w.current=!1}return s.enabled&&l&&a==="idle"?{status:"installing",error:null,connection:null,retry:N}:{status:a,error:m,connection:i,retry:N}}const M={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return M;const e=s;return Object.values(e).some(n=>typeof n!="string")?M:e}function je(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ce(s){const e=s.metadata?.repoScope;if(!e||typeof e.installationId!="number"||!Number.isFinite(e.installationId)||!Number.isInteger(e.installationId)||e.installationId<=0||typeof e.owner!="string"||typeof e.repo!="string"||e.owner.length===0||e.repo.length===0)return null;const n=je(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Se(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function ve(s){return(s??[]).filter(e=>Ce(e)===null)}async function Ee(s,e){const o=(await s({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:e}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(o)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function We(s,e){const n=e.toLowerCase();return s.find(o=>o.login.toLowerCase()===n)}const Y="GitHub MCP did not return refreshable repo grant metadata";function $(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function Te(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function _e(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function ke(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:c,repo:a,githubCallTool:r,selfCallTool:m}=s,f=await r({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:c,repo:a,permissions:M}}),i=f.structuredContent;if(f.isError||!i?.token){const T=f.content?.find(v=>v.type==="text")?.text;throw new Error(T?`Failed to mint a repo-scoped GitHub token: ${T}`:"Failed to mint a repo-scoped GitHub token")}const h=$(i.refreshToken),x=$(i.tokenEndpoint),l=$(i.clientId);if(!h||!x||!l)throw new Error(Y);if(!Te(x))throw new Error(Y);const w=$(i.repository?.owner),y=$(i.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==c.toLowerCase()))throw new Error(N);if(i.repository?.name!==void 0&&(!y||y.toLowerCase()!==a.toLowerCase()))throw new Error(N);const b=_e(i.repository?.id),I=i.expiresAt?Date.parse(i.expiresAt):NaN,S=Number.isFinite(I)?Math.max(0,Math.floor((I-Date.now())/1e3)):null,d=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??S,j=await m({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${c}/${a}`,description:`Repo-scoped GitHub access for ${c}/${a}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{repoScope:{installationId:o,repositoryId:b,owner:c,repo:a,permissions:M,grantProvider:"github-mcp"}}}}}),g=j.structuredContent??j,C=g.item?.id??g.id;if(!C)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${C}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:d,scope:i.scope??null,clientId:l,tokenEndpoint:x})})).ok)throw await m({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:C}}function Re(s,e){const n=L.c(4),[o,c]=A.useState(s);let a,r;return n[0]!==e||n[1]!==s?(a=()=>{const m=setTimeout(()=>c(s),e);return()=>clearTimeout(m)},r=[s,e],n[0]=e,n[1]=s,n[2]=a,n[3]=r):(a=n[2],r=n[3]),A.useEffect(a,r),o}const D=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A new GitHub issue has been opened in ${s}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A pull request was opened in ${s}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:s,name:e})=>`A pull request was closed in ${s}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function Ae(s,e){const n=new Set;if(s.paramsSchema)for(const c of Object.keys(s.paramsSchema))n.add(c);if(Array.isArray(s.params))for(const c of s.params)n.add(c.name);else if(s.params&&typeof s.params=="object")for(const c of Object.keys(s.params))n.add(c);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const o={};return n.has("owner")&&(o.owner=e.owner),n.has("name")&&(o.name=e.name),n.has("repository")&&(o.repository=`${e.owner}/${e.name}`),o}async function Oe({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:c,selectedKeys:a}){const r=await s({name:"TRIGGER_LIST",arguments:{}}),m=r.structuredContent??r,f=new Map((m.triggers??[]).map(l=>[l.type,l])),i=D.filter(l=>a.has(l.key)),h=await Promise.allSettled(i.map(async l=>{const w=f.get(l.triggerType);if(!w)throw new Error(`Trigger ${l.triggerType} not exposed`);const y=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${l.nameSuffix}`,virtual_mcp_id:n,messages:l.instructions(o),active:!0}}),N=(y.structuredContent??y).id;if(!N)throw new Error(`AUTOMATION_CREATE returned no id for ${l.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:N,type:"event",connection_id:c,event_type:l.triggerType,params:Ae(w,o)}})})),x=h.filter(l=>l.status==="rejected").length;return x>0&&console.error("Some GitHub automations failed to set up:",h.filter(l=>l.status==="rejected")),{total:h.length,failed:x}}function Xe(s){const e=L.c(22),{open:n,onOpenChange:o,title:c,hideAutoRespondCheckbox:a,onImportComplete:r}=s,m=c===void 0?"Import from GitHub":c,f=a===void 0?!1:a,[i,h]=A.useState(null);let x;e[0]!==m?(x=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:m})}),e[0]=m,e[1]=x):x=e[1];let l;e[2]!==i||e[3]!==m?(l=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:i?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>h(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Z,{size:16})}),t.jsx("img",{src:i.avatarUrl,alt:i.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(U,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:m})]})}),e[2]=i,e[3]=m,e[4]=l):l=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let y;e[6]!==o?(y=()=>o(!1),e[6]=o,e[7]=y):y=e[7];let N;e[8]!==f||e[9]!==r||e[10]!==n||e[11]!==i||e[12]!==y?(N=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(A.Suspense,{fallback:w,children:t.jsx(Ge,{open:n,onComplete:y,selectedInstallation:i,onSelectInstallation:h,hideAutoRespondCheckbox:f,onImportComplete:r})})}),e[8]=f,e[9]=r,e[10]=n,e[11]=i,e[12]=y,e[13]=N):N=e[13];let b;e[14]!==x||e[15]!==l||e[16]!==N?(b=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[x,l,N]}),e[14]=x,e[15]=l,e[16]=N,e[17]=b):b=e[17];let I;return e[18]!==o||e[19]!==n||e[20]!==b?(I=t.jsx(ce,{open:n,onOpenChange:o,children:b}),e[18]=o,e[19]=n,e[20]=b,e[21]=I):I=e[21],I}function Ge({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:c,onImportComplete:a}){const{org:r}=Q(),m=W(),f=be(),[i,h]=A.useState(null),[x,l]=A.useState(!0),[w,y]=A.useState(()=>new Set(D.filter(u=>u.defaultEnabled).map(u=>u.key))),N=D.filter(u=>u.defaultEnabled).map(u=>u.key),b=c?new Set(N):x?w:new Set,I=me({slug:"mcp-github"}),S=ve(I),p=Ie({enabled:s&&S.length===0}),d=S.length===1?S[0]??null:i,j=H({connectionId:d?.id??"",orgId:r.id,orgSlug:r.slug}),g=H({connectionId:X,orgId:r.id,orgSlug:r.slug}),C=async(u,E)=>{try{const G=await j.callTool({name:"get_file_contents",arguments:{owner:u.owner,repo:u.name,path:E}});if(G.isError)return null;const P=G.content?.find(R=>R.type==="resource")?.resource?.text;if(!P)return null;try{const R=JSON.parse(P);return typeof R=="string"?R:JSON.stringify(R)}catch{return P}}catch{return null}},O=(u,E)=>{Promise.all([C(E,"AGENTS.md"),C(E,"CLAUDE.md")]).then(async([k,G])=>{const _=k??G??null;_&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:u,data:{metadata:{instructions:_}}}}),B(m,r.id))}).catch(k=>{console.error("GitHub instructions fetch failed:",k)})},T=async({virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G})=>{const{total:_,failed:P}=await Oe({githubCallTool:R=>j.callTool(R),selfCallTool:R=>g.callTool(R),virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G});P>0&&z.warning(`Set up ${_-P}/${_} GitHub automations. Add the rest from the automations view.`)},v=ne({mutationFn:async u=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:k}=await ke({orgSlug:r.slug,sourceConnection:d,installationId:E,owner:u.owner,repo:u.name,githubCallTool:_=>j.callTool(_),selfCallTool:_=>g.callTool(_)});let G=null;try{const _=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:u.name,description:u.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:u.owner,name:u.name,url:u.url,installationId:E,connectionId:k},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:k}]}}}),P=_.structuredContent??_,R=P.item?.id;if(!P.item||!R)throw new Error("Failed to create the imported agent");return G=R,b.size>0&&await T({virtualMcpId:R,repo:u,connectionId:k,selectedKeys:b}).catch(ee=>{console.error("Failed to set up GitHub automations:",ee),z.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:R,repo:u,connectionId:k,item:P.item}}catch(_){throw G&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:G}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),_}},onSuccess:({virtualMcpId:u,repo:E,connectionId:k,item:G})=>{if(m.setQueryData(V.collectionItem(g,r.id,"","VIRTUAL_MCP",u),{item:G}),B(m,r.id),O(u,E),a){a({virtualMcpId:u,repo:E,connectionId:k});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),f(u)},onError:u=>{z.error("Failed to import repo: "+(u instanceof Error?u.message:"Unknown error"))}});return p.status==="installing"||p.status==="authenticating"?t.jsx(q,{status:p.status,error:null,retry:p.retry}):p.status==="error"?t.jsx(q,{status:"error",error:p.error,retry:p.retry}):S.length===0&&p.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:p.retry}):S.length>1&&!d?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),S.map(u=>t.jsxs("button",{type:"button",onClick:()=>h(u),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[u.icon?t.jsx("img",{src:u.icon,alt:u.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(U,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:u.title})]},u.id))]}):d?n?t.jsx(Le,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:u=>v.mutate(u),isSaving:v.isPending,autoRespondEnabled:x,onAutoRespondChange:l,selectedAutomationKeys:w,onAutomationKeysChange:y,hideAutoRespondCheckbox:c}):t.jsx(Pe,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,onSelect:o,showBackButton:S.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=L.c(31),{connectionId:n,orgId:o,orgSlug:c,onSelect:a,showBackButton:r,onBack:m}=s;let f;e[0]!==o||e[1]!==c?(f={connectionId:X,orgId:o,orgSlug:c},e[0]=o,e[1]=c,e[2]=f):f=e[2];const i=H(f);let h;e[3]!==n||e[4]!==o?(h=V.githubUserOrgs(o,n),e[3]=n,e[4]=o,e[5]=h):h=e[5];let x;e[6]!==n||e[7]!==i?(x=()=>Ee(g=>i.callTool(g),n),e[6]=n,e[7]=i,e[8]=x):x=e[8];let l;e[9]!==h||e[10]!==x?(l={queryKey:h,queryFn:x},e[9]=h,e[10]=x,e[11]=l):l=e[11];const w=se(l);if(w.isLoading){let g;return e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=g):g=e[12],g}if(w.isError){let g;return e[13]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=g):g=e[13],g}const y=w.data;if(!y)return null;let N;e[14]!==m||e[15]!==r?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Z,{size:12}),"Change connection"]})}),e[14]=m,e[15]=r,e[16]=N):N=e[16];let b;if(e[17]!==y.installations||e[18]!==a){let g;e[20]!==a?(g=C=>t.jsxs("button",{type:"button",onClick:()=>a(C),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:C.avatarUrl,alt:C.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:C.login}),C.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},C.installationId),e[20]=a,e[21]=g):g=e[21],b=y.installations.map(g),e[17]=y.installations,e[18]=a,e[19]=b}else b=e[19];let I;e[22]!==b?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:b}),e[22]=b,e[23]=I):I=e[23];const S=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=p):p=e[24];let d;e[25]!==S?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",p]})}),e[25]=S,e[26]=d):d=e[26];let j;return e[27]!==d||e[28]!==N||e[29]!==I?(j=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,I,d]}),e[27]=d,e[28]=N,e[29]=I,e[30]=j):j=e[30],j}function Le(s){const e=L.c(27),{connectionId:n,orgId:o,orgSlug:c,installation:a,onSelectRepo:r,isSaving:m,autoRespondEnabled:f,onAutoRespondChange:i,selectedAutomationKeys:h,onAutomationKeysChange:x,hideAutoRespondCheckbox:l}=s,[w,y]=A.useState(""),N=Re(w,300),b=A.useDeferredValue(N),I=w!==b;let S;e[0]!==I||e[1]!==w?(S=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:y,isSearching:I}),e[0]=I,e[1]=w,e[2]=S):S=e[2];const p=I?"opacity-40":"opacity-100";let d;e[3]!==p?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",p),e[3]=p,e[4]=d):d=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let g;e[6]!==n||e[7]!==b||e[8]!==a||e[9]!==m||e[10]!==r||e[11]!==o||e[12]!==c?(g=t.jsx(A.Suspense,{fallback:j,children:t.jsx($e,{connectionId:n,orgId:o,orgSlug:c,installation:a,query:b,onSelectRepo:r,isSaving:m})}),e[6]=n,e[7]=b,e[8]=a,e[9]=m,e[10]=r,e[11]=o,e[12]=c,e[13]=g):g=e[13];let C;e[14]!==d||e[15]!==g?(C=t.jsx("div",{className:d,children:g}),e[14]=d,e[15]=g,e[16]=C):C=e[16];let O;e[17]!==f||e[18]!==l||e[19]!==i||e[20]!==x||e[21]!==h?(O=!l&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(J,{checked:f,onCheckedChange:v=>i(v===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),f&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.map(v=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(J,{checked:h.has(v.key),onCheckedChange:u=>{const E=new Set(h);u===!0?E.add(v.key):E.delete(v.key),x(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:v.label})]},v.key))})]}),e[17]=f,e[18]=l,e[19]=i,e[20]=x,e[21]=h,e[22]=O):O=e[22];let T;return e[23]!==S||e[24]!==C||e[25]!==O?(T=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[S,C,O]}),e[23]=S,e[24]=C,e[25]=O,e[26]=T):T=e[26],T}function $e(s){const e=L.c(29),{connectionId:n,orgId:o,orgSlug:c,installation:a,query:r,onSelectRepo:m,isSaving:f}=s;let i;e[0]!==n||e[1]!==o||e[2]!==c?(i={connectionId:n,orgId:o,orgSlug:c},e[0]=n,e[1]=o,e[2]=c,e[3]=i):i=e[3];const h=H(i),x=a.type==="User"?"user":"org",l=r?`${x}:${a.login} ${r} in:name`:`${x}:${a.login}`;let w;e[4]!==n||e[5]!==a.login||e[6]!==o||e[7]!==r?(w=V.githubOrgRepos(o,n,a.login,r),e[4]=n,e[5]=a.login,e[6]=o,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==h||e[10]!==l?(y=async p=>{const{signal:d}=p,g=(await h.callTool({name:"search_repositories",arguments:{query:l,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!g)throw new Error("No response from search_repositories");return(JSON.parse(g).items??[]).map(He)},e[9]=h,e[10]=l,e[11]=y):y=e[11];let N;e[12]!==w||e[13]!==y?(N={queryKey:w,queryFn:y},e[12]=w,e[13]=y,e[14]=N):N=e[14];const{data:b}=oe(N);if(b.length===0){let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=p):p=e[15];let d;e[16]!==r?(d=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=r,e[17]=d):d=e[17];let j;return e[18]!==d?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[p,d]}),e[18]=d,e[19]=j):j=e[19],j}let I;if(e[20]!==f||e[21]!==m||e[22]!==b){let p;e[24]!==f||e[25]!==m?(p=d=>t.jsxs("button",{type:"button",onClick:()=>m(d),disabled:f,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(U,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:d.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[d.private?t.jsx(re,{size:10}):t.jsx(pe,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=f,e[25]=m,e[26]=p):p=e[26],I=b.map(p),e[20]=f,e[21]=m,e[22]=b,e[23]=I}else I=e[23];let S;return e[27]!==I?(S=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:I}),e[27]=I,e[28]=S):S=e[28],S}function He(s){return{name:s.name,fullName:s.full_name,owner:s.full_name.split("/")[0]??"",url:s.html_url,private:s.private,description:s.description,updatedAt:s.updated_at}}function q(s){const e=L.c(33),{status:n,error:o,retry:c}=s;if(n==="error"){let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-destructive"})}),e[0]=g):g=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=C):C=e[1];const O=o??"Something went wrong while connecting to GitHub.";let T;e[2]!==O?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:O})]}),e[2]=O,e[3]=T):T=e[3];let v;e[4]!==c?(v=t.jsx("button",{type:"button",onClick:c,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=c,e[5]=v):v=e[5];let u;return e[6]!==T||e[7]!==v?(u=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[g,T,v]}),e[6]=T,e[7]=v,e[8]=u):u=e[8],u}const a=n==="authenticating";let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-foreground"})}),e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(F,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const f=a?"Authenticating with GitHub":"Setting up GitHub";let i;e[11]!==f?(i=t.jsx("p",{className:"text-sm font-medium",children:f}),e[11]=f,e[12]=i):i=e[12];const h=a?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let x;e[13]!==h?(x=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=x):x=e[14];let l;e[15]!==i||e[16]!==x?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[i,x]}),e[15]=i,e[16]=x,e[17]=l):l=e[17];const w=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let y;e[18]!==w?(y=K("size-1.5 rounded-full",w),e[18]=w,e[19]=y):y=e[19];let N;e[20]!==y?(N=t.jsx("span",{className:y}),e[20]=y,e[21]=N):N=e[21];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let I;e[22]!==b?(I=K("size-1.5 rounded-full",b),e[22]=b,e[23]=I):I=e[23];let S;e[24]!==I?(S=t.jsx("span",{className:I}),e[24]=I,e[25]=S):S=e[25];let p;e[26]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=p):p=e[26];let d;e[27]!==N||e[28]!==S?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,S,p]}),e[27]=N,e[28]=S,e[29]=d):d=e[29];let j;return e[30]!==d||e[31]!==l?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,l,d]}),e[30]=d,e[31]=l,e[32]=j):j=e[32],j}export{Xe as G,U as a,Ie as b,We as c,Ee as f,ve as g,ke as p,Re as u};
@@ -1,4 +1,4 @@
1
- import{L as _t,cw as St,cx as Et,bl as C,s as c,cy as ue,br as Ve,by as It,bk as Tt,al as wt,aG as O,aF as Y,aD as ne,o as S,bm as f,b7 as B,cz as At,cA as E,aE as Mt,t as ge,r as J,c as Ee,D as Ot,j as Ct}from"./index-DVyj5fuq.js";import{S as Rt,u as Nt}from"./use-mcp-client-fdcDDNuq.js";import{d as xt,D as Pt}from"./decopilot-sse-pool-BiYcCf8O.js";import{d as Dt}from"./delay-CnY5UFtP.js";import{e as Lt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class de extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof de))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}de.create=t=>new de(t);var Me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Me||(Me={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));const kt=1e4,Yr="true";function pe(t,e){return _t.chatAutosend(t,e)}function jt(t){return t==="pending"||t==="sending"}function Zt(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return!e||typeof e!="object"||typeof e.createdAt!="number"||typeof e.message!="object"||!jt(e.status)?null:e}function Wr(t,e,a,r,s=Date.now()){const o={message:r,createdAt:s,status:"pending"};return t.setItem(pe(e,a),JSON.stringify(o)),o}function $t(t,e,a){const r=pe(e,a),s=Zt(t.getItem(r));return s||(t.removeItem(r),null)}function Hr(t,e,a,r=Date.now()){const s=pe(e,a),o=$t(t,e,a);return!o||o.status!=="pending"?null:r-o.createdAt>=kt?(t.removeItem(s),null):(t.setItem(s,JSON.stringify({...o,status:"sending"})),{message:o.message,createdAt:o.createdAt})}function qr(t,e,a){t.removeItem(pe(e,a))}var ze="vercel.ai.error",Ut=Symbol.for(ze),Oe,Ce,j=class Je extends(Ce=Error,Oe=Ut,Ce){constructor({name:e,message:a,cause:r}){super(a),this[Oe]=!0,this.name=e,this.cause=r}static isInstance(e){return Je.hasMarker(e,ze)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var We="AI_InvalidArgumentError",He=`vercel.ai.error.${We}`,Bt=Symbol.for(He),Re,Ne,Ft=class extends(Ne=j,Re=Bt,Ne){constructor({message:t,cause:e,argument:a}){super({name:We,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return j.hasMarker(t,He)}},qe="AI_JSONParseError",Ge=`vercel.ai.error.${qe}`,Vt=Symbol.for(Ge),xe,Pe,De=class extends(Pe=j,xe=Vt,Pe){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
1
+ import{L as _t,cw as St,cx as Et,bl as C,s as c,cy as ue,br as Ve,by as It,bk as Tt,al as wt,aG as O,aF as Y,aD as ne,o as S,bm as f,b7 as B,cz as At,cA as E,aE as Mt,t as ge,r as J,c as Ee,D as Ot,j as Ct}from"./index-I8Uum3Jx.js";import{S as Rt,u as Nt}from"./use-mcp-client-Bq9g8m5J.js";import{d as xt,D as Pt}from"./decopilot-sse-pool-TIer_srZ.js";import{d as Dt}from"./delay-CnY5UFtP.js";import{e as Lt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class de extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof de))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}de.create=t=>new de(t);var Me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Me||(Me={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));const kt=1e4,Yr="true";function pe(t,e){return _t.chatAutosend(t,e)}function jt(t){return t==="pending"||t==="sending"}function Zt(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return!e||typeof e!="object"||typeof e.createdAt!="number"||typeof e.message!="object"||!jt(e.status)?null:e}function Wr(t,e,a,r,s=Date.now()){const o={message:r,createdAt:s,status:"pending"};return t.setItem(pe(e,a),JSON.stringify(o)),o}function $t(t,e,a){const r=pe(e,a),s=Zt(t.getItem(r));return s||(t.removeItem(r),null)}function Hr(t,e,a,r=Date.now()){const s=pe(e,a),o=$t(t,e,a);return!o||o.status!=="pending"?null:r-o.createdAt>=kt?(t.removeItem(s),null):(t.setItem(s,JSON.stringify({...o,status:"sending"})),{message:o.message,createdAt:o.createdAt})}function qr(t,e,a){t.removeItem(pe(e,a))}var ze="vercel.ai.error",Ut=Symbol.for(ze),Oe,Ce,j=class Je extends(Ce=Error,Oe=Ut,Ce){constructor({name:e,message:a,cause:r}){super(a),this[Oe]=!0,this.name=e,this.cause=r}static isInstance(e){return Je.hasMarker(e,ze)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var We="AI_InvalidArgumentError",He=`vercel.ai.error.${We}`,Bt=Symbol.for(He),Re,Ne,Ft=class extends(Ne=j,Re=Bt,Ne){constructor({message:t,cause:e,argument:a}){super({name:We,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return j.hasMarker(t,He)}},qe="AI_JSONParseError",Ge=`vercel.ai.error.${qe}`,Vt=Symbol.for(Ge),xe,Pe,De=class extends(Pe=j,xe=Vt,Pe){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Ye(e)}`,cause:e}),this[xe]=!0,this.text=t}static isInstance(t){return j.hasMarker(t,Ge)}},Xe="AI_TypeValidationError",Qe=`vercel.ai.error.${Xe}`,zt=Symbol.for(Qe),Le,ke,X=class ve extends(ke=j,Le=zt,ke){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Xe,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Ye(a)}`,cause:a}),this[Le]=!0,this.value=e,this.context=r}static isInstance(e){return j.hasMarker(e,Qe)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},oe=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Ft({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};oe();var Jt=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Yt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function je(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Jt.test(t)===!1&&Yt.test(t)===!1?e:Wt(e)}function Wt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function Ht(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return je(t)}try{return je(t)}finally{Error.stackTraceLimit=e}}function Ie(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Ie(t)}var qt=Symbol("Let zodToJsonSchema decide on which parser to use"),Ze={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Gt=t=>typeof t=="string"?{...Ze,name:t}:{...Ze,...t};function N(){return{}}function Xt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Qt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Kt(){return{type:"boolean"}}function Ke(t,e){return b(t.type._def,e)}var ea=(t,e)=>b(t.innerType._def,e);function et(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>et(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return ta(t)}}var ta=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function aa(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function ra(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function sa(t){return{type:"string",enum:Array.from(t.values)}}var na=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function oa(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(na(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function ia(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function tt(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":M(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":M(a,r.regex,r.message,e);break;case"cuid":M(a,P.cuid,r.message,e);break;case"cuid2":M(a,P.cuid2,r.message,e);break;case"startsWith":M(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":M(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{M(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":M(a,P.base64url,r.message,e);break;case"jwt":M(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&M(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&M(a,P.ipv6Cidr,r.message,e);break}case"emoji":M(a,P.emoji(),r.message,e);break;case"ulid":{M(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{M(a,P.base64,r.message,e);break}}break}case"nanoid":M(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?ua(t):t}var la=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ua(t){let e="";for(let a=0;a<t.length;a++)la.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function M(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:$e(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=$e(e,r)}function $e(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r
@@ -1,4 +1,4 @@
1
- import{c as oe,D as se,m as ie,a as re,r as A,k as ae,K as R,d as le,w as k,t as K,j as t,B as F,l as ce}from"./index-DVyj5fuq.js";import{b as de}from"./use-virtual-mcp-ufrd8iJJ.js";import{m as Z}from"./use-navigate-to-agent-DwfR9Suw.js";import{u as ue}from"./use-connection-CzcC522C.js";import{u as Y,S as me}from"./use-mcp-client-fdcDDNuq.js";import{g as pe,u as he,f as ge,b as fe,p as Ce,a as xe}from"./github-repo-picker-DvVBXFrQ.js";import{a as be,b as we,c as ye,d as je,D as Ie}from"./dialog-CbpDnZu8.js";import{b as Se}from"./Settings02-k7X7M16V.js";import{C as ve}from"./collection-search-ChsfwSm5.js";const Ee=`<svg width="74" height="84" viewBox="0 0 74 84" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ import{c as oe,D as se,m as ie,a as re,r as A,k as ae,K as R,d as le,w as k,t as K,j as t,B as F,l as ce}from"./index-I8Uum3Jx.js";import{b as de}from"./use-virtual-mcp-C5aoCVVQ.js";import{m as Z}from"./use-navigate-to-agent-CRQ9sIAj.js";import{u as ue}from"./use-connection-BcZ8SPdu.js";import{u as Y,S as me}from"./use-mcp-client-Bq9g8m5J.js";import{g as pe,b as he,f as ge,c as fe,p as Ce,a as xe}from"./github-repo-picker-CvyWRbaM.js";import{a as be,b as we,c as ye,d as je,D as Ie}from"./dialog-CxQBoX40.js";import{b as Se}from"./Settings02-DbH9OAzT.js";import{C as ve}from"./collection-search-BPoBI_I5.js";const Ee=`<svg width="74" height="84" viewBox="0 0 74 84" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M63.4462 15.3005C63.1414 15.2764 57.2333 15.1845 57.2333 15.1845C57.2333 15.1845 52.2906 10.3849 51.8019 9.89426C51.6127 9.71981 51.3729 9.60981 51.1172 9.58008V83.0253L73.2664 77.5175C73.2664 77.5175 64.2277 16.3953 64.1696 15.9772C64.1417 15.7997 64.055 15.6366 63.9235 15.5139C63.7919 15.3913 63.6255 15.3162 63.4462 15.3005Z" fill="#171717"/>
3
3
  <path fill-rule="evenodd" clip-rule="evenodd" d="M32.748 0.00356357C34.8334 -0.0568526 36.5759 0.651298 37.9307 2.10122C38.0276 2.20613 38.1209 2.31463 38.2109 2.42544L38.2354 2.42349C38.4434 2.40657 38.6494 2.38638 38.8574 2.38638H38.8672C41.9831 2.3913 44.5571 4.16796 46.3184 7.527C46.8023 8.4621 47.2004 9.43976 47.5068 10.4469L49.9883 9.67837C50.3609 9.56961 51.315 9.42163 51.8037 9.90981L51.9922 82.3883L51.1162 83.0387L0 74.1979C0.0195597 74.0466 6.09952 27.0238 6.3291 25.3629C6.63636 23.1661 6.70922 23.0933 9.03906 22.361L16.957 19.9079C17.4531 16.377 19.1884 11.8165 21.4746 8.18423C24.7237 3.02487 28.7273 0.119714 32.748 0.00356357ZM38.8408 26.7077C38.8133 26.694 36.5926 25.6009 32.2842 25.8747C21.032 26.5853 15.9341 34.4515 16.4229 42.2213C17.0059 51.4485 26.2283 51.1199 26.584 56.734C26.6686 58.0922 25.8271 60.0114 23.4658 60.1588C19.8562 60.3883 15.3438 56.9831 15.3438 56.9831L13.6191 64.3249C13.6191 64.3249 18.1021 69.1296 26.2432 68.6149C33.027 68.1895 37.7351 62.759 37.2344 54.8249C36.5981 44.7397 25.2729 43.7966 25.002 39.4948C24.9512 38.7038 25.0055 35.556 29.9932 35.2418C33.3786 35.0279 36.2354 36.3195 36.2666 36.3336L38.8408 26.7077ZM32.8262 2.6813C26.6181 2.86014 21.2028 12.5587 19.8213 19.0211L26.8311 16.8512C27.6101 12.7476 29.5648 8.48928 32.1221 5.74868C33.0162 4.76667 34.0719 3.94401 35.2432 3.31704H35.2451C34.5654 2.87005 33.7695 2.66203 32.8262 2.6813ZM36.9775 5.46548C35.7921 5.95366 34.7952 6.80972 34.0791 7.57583C32.1608 9.63716 30.5951 12.7807 29.7725 15.9391L38.3057 13.2956C38.3322 11.0721 38.0904 7.7854 36.9775 5.46548ZM39.7568 5.14907C40.7052 7.59721 40.9505 10.4321 40.9795 12.4694L44.9473 11.2389C44.3133 9.17981 42.8075 5.72907 39.7568 5.14907Z" fill="#393939"/>
4
4
  </svg>`,Ne=`data:image/svg+xml,${encodeURIComponent(Ee)}`,Ve={title:"New Website",description:"Website cloned from a public template",url:"https://github.com/decocms/webapp-template",owner:"decocms",name:"webapp-template"},Ue={title:"Shopify Headless Store",description:"Shopify Headless Store cloned from a public template",url:"https://github.com/Shopify/hydrogen-demo-store",owner:"Shopify",name:"hydrogen-demo-store",icon:Ne};function ze(){const n=oe.c(6),s=de(),i=Z();let o;n[0]!==s.create||n[1]!==i?(o=async d=>{const c=await s.create.mutateAsync({title:d.title,description:d.description,icon:d.icon??null,status:"active",pinned:!1,connections:[],metadata:{githubRepo:{url:d.url,owner:d.owner,name:d.name},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}});return c.id&&i(c.id),c},n[0]=s.create,n[1]=i,n[2]=o):o=n[2];const u=o;let m;return n[3]!==s.create.isPending||n[4]!==u?(m={createFromTemplate:u,isCreating:s.create.isPending},n[3]=s.create.isPending,n[4]=u,n[5]=m):m=n[5],m}const Le="deco-sites";function Te(n){if(!n||typeof n!="object")return null;const s=n.github;if(!s||typeof s!="object")return null;const i=s.owner,o=s.repo;return typeof i!="string"||typeof o!="string"||i.length===0||o.length===0?null:{owner:i,repo:o}}function _e(n,s){const i=s?Te(s):null,o=i?.owner??Le,u=i?.repo??n;return{owner:o,name:u,url:`https://github.com/${o}/${u}`}}function Ge(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Oe(n){const s=await fetch(`/api/${n}/deco-sites`);if(!s.ok){const i=await s.json().catch(()=>({}));throw new Error(i.error??`Failed to load sites (${s.status})`)}return s.json()}function Be({open:n,onOpenChange:s,onBack:i}){const{org:o}=se(),u=Z(),m=ie(),{data:d}=re.useSession(),[c,$]=A.useState(null),[q,V]=A.useState(null),[y,N]=A.useState(""),h=Y({connectionId:me,orgId:o.id,orgSlug:o.slug}),Q=ue({slug:"mcp-github"}),f=pe(Q),r=he({enabled:n&&f.length===0}),C=f.length===1?f[0]??null:q,j=f.length>1&&!C,W=Y({connectionId:C?.id??"",orgId:o.id,orgSlug:o.slug}),x=n&&f.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:J,isLoading:I,error:X}=ae({queryKey:R.decoSites(d?.user?.email),queryFn:()=>Oe(o.slug),enabled:n&&!!d?.user?.email,staleTime:6e4,retry:!1}),S=J?.sites??[],L=e=>{e||($(null),V(null),N("")),s(e)},T=S.filter(e=>e.name.toLowerCase().includes(y.toLowerCase())||(e.domains?.[0]?.domain?.toLowerCase().includes(y.toLowerCase())??!1)),ee=!c||T.some(e=>e.name===c),v=le({mutationFn:async e=>{if(!C)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");k("deco_site_import_started",{site_name:e});const{installations:p,appSlug:g}=await ge(l=>h.callTool(l),C.id),b=S.find(l=>l.name===e);if(!b)throw new Error("Selected site is no longer available");const a=_e(e,b.metadata),_=fe(p,a.owner);if(!_){const l=g?`https://github.com/apps/${g}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${a.owner}" organization to import this site. ${l}`)}let G=null,O=null,D=null;const te=async()=>{D&&await h.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:D}}).catch(()=>{}),O&&await h.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:O,force:!0}}).catch(()=>{}),G&&await h.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:G,force:!0}}).catch(()=>{})};try{const l=await fetch(`/api/${o.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:e})}),M=await l.json().catch(()=>({}));if(!l.ok)throw new Error(M.error??`Failed to create connection (${l.status})`);const w=M.connId;if(!w)throw new Error("Server did not return a connection ID");G=w;const{childConnectionId:H}=await Ce({orgSlug:o.slug,sourceConnection:C,installationId:_.installationId,owner:a.owner,repo:a.name,githubCallTool:P=>W.callTool(P),selfCallTool:P=>h.callTool(P)});O=H;const U=M.icon??null,z=Ge(e),ne=e.toLowerCase(),B=await h.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:e,description:"Imported from deco.cx",pinned:!1,icon:U??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:ne,githubRepo:{owner:a.owner,name:a.name,url:a.url,installationId:_.installationId,connectionId:H},ui:{banner:null,bannerColor:"#22C55E",icon:U,themeColor:"#22C55E",slug:z,pinnedViews:[{connectionId:w,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:w,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:w},{connection_id:H}]}}}),E=B.structuredContent??B;if(!E.item?.id)throw new Error("Failed to create the imported agent");return D=E.item.id,{slug:z,virtualMcpId:E.item.id,connId:w,item:E.item}}catch(l){throw await te(),l}},onSuccess:({slug:e,virtualMcpId:p,item:g})=>{k("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:e}),m.setQueryData(R.collectionItem(h,o.id,"","VIRTUAL_MCP",p),{item:g}),m.invalidateQueries({predicate:b=>{const a=b.queryKey;return a[1]===o.id&&a[3]==="collection"&&a[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:R.projects(o.id)}),K.success(`Imported ${e} from deco.cx`),L(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),u(p)},onError:e=>{k("deco_site_import_failed",{error:e instanceof Error?e.message:"Unknown error"}),K.error("Import failed: "+(e instanceof Error?e.message:"Unknown error"))}});return t.jsx(be,{open:n,onOpenChange:L,children:t.jsxs(we,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[t.jsx(ye,{className:"sr-only",children:t.jsx(je,{children:"Import from deco.cx"})}),t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&t.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Se,{size:18})}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),t.jsx("div",{children:t.jsx(ve,{value:y,onChange:N,placeholder:"Search sites...",onKeyDown:e=>{e.key==="Escape"&&N("")}})}),t.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&t.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[t.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),t.jsx(F,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),x&&r.status!=="error"&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),j&&!x&&r.status!=="error"&&t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-8 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),f.map(e=>t.jsxs("button",{type:"button",onClick:()=>V(e),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[e.icon?t.jsx("img",{src:e.icon,alt:e.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(xe,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:e.title})]},e.id))]}),I&&!x&&r.status!=="error"&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!I&&!x&&!j&&r.status!=="error"&&!X&&S.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!I&&!x&&!j&&r.status!=="error"&&S.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[T.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",y,"”"]}),T.map(e=>{const p=e.domains?.find(b=>b.production)?.domain??e.domains?.[0]?.domain,g=c===e.name;return t.jsxs("button",{type:"button",onClick:()=>$(e.name),className:ce("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:e.thumb_url?t.jsx("img",{src:e.thumb_url,alt:e.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:e.name}),p&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},e.name)})]})]}),t.jsxs(Ie,{className:"px-8 py-5 border-t border-border",children:[t.jsx(F,{variant:"outline",onClick:()=>L(!1),disabled:v.isPending,children:"Cancel"}),t.jsx(F,{disabled:!c||!ee||v.isPending||I||x||j||!C||r.status==="error",onClick:()=>c&&v.mutate(c),children:v.isPending?"Importing...":"Import"})]})]})})}export{Ue as H,Be as I,Ne as S,Ve as W,ze as u};
@@ -1,4 +1,4 @@
1
- import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,D as Fe,m as Je,t as W,b as et,u as tt,E as Te,ae as Tt}from"./index-DVyj5fuq.js";import{i as zt}from"./ChevronRight-BXEszS6k.js";import{s as st}from"./Eye-FmUDnTHn.js";import{n as Pt,i as nt}from"./Globe01-Ckwe4UHh.js";import{b as lt,e as Ft,f as Ot,a as Et}from"./ZoomOut-CGeRz2Xe.js";import{a as pe}from"./Palette-Bf6p_3g1.js";import{s as At}from"./Plus-8zBKSNee.js";import{t as Mt}from"./Stars01-BvvUaY8d.js";import{i as xe}from"./Upload01-CvwE1uG-.js";import{i as Oe}from"./Zap-D2QyQXL2.js";import{u as it}from"./use-mobile-CvxOtGtu.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-C-zjIGep.js";import{b as Ee,a as Ae,d as Me,f as rt,c as Ht,e as Vt,D as Gt}from"./dialog-CbpDnZu8.js";import{I as Ue}from"./input-GyW6rRcJ.js";import{S as K}from"./skeleton-D20LVfuJ.js";import{F as ie,d as at,M as ot}from"./file-type-icon-Cs_SK9tU.js";import{a as Qt}from"./toolbar-CH6VbS3Q.js";import{r as Be,s as A,a as be,t as Wt,u as Pe,v as Le,h as Yt,L as Xt,o as Zt,p as Jt,n as es,R as Ve,q as ts,S as ss,b as ns,w as ct,x as le,y as ls}from"./preview-dialog-CvZ5HrrM.js";import{a as ve}from"./DotsVertical-F-o-_a2z.js";import{i as is}from"./Key01-wlyPB5nN.js";import{s as je}from"./Trash01-DDwxWuR_.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-QpPxe1tm.js";import{T as rs}from"./textarea-C8t5NRp5.js";import{t as as}from"./ChevronDown-DJ5SHmhN.js";import{n as os}from"./ChevronUp-CUesWqmK.js";import{i as ge}from"./X-D5odjFOj.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-QZNH5ck-.js";import"./tooltip-3uKRhKGc.js";import"./LinkExternal01-BoVxtqR2.js";import"./XClose-CQQFXdbB.js";import"./index-DUxlPTha.js";import"./LayoutLeft-C_wbh4sE.js";import"./popover-DCt-yH34.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let P;e[23]!==N||e[24]!==D?(P=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=P):P=e[25];let $;return e[26]!==i||e[27]!==P||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,P]}),e[26]=i,e[27]=P,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
1
+ import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,D as Fe,m as Je,t as W,b as et,u as tt,E as Te,ae as Tt}from"./index-I8Uum3Jx.js";import{i as zt}from"./ChevronRight-oz8o6WPV.js";import{s as st}from"./Eye-BSiFxHQB.js";import{n as Pt,i as nt}from"./Globe01-wGomueqV.js";import{b as lt,e as Ft,f as Ot,a as Et}from"./ZoomOut-DxqRFWA_.js";import{a as pe}from"./Palette-CEjENuG4.js";import{s as At}from"./Plus-Bw9lc6SR.js";import{t as Mt}from"./Stars01-D1icdaCh.js";import{i as xe}from"./Upload01-C_hHbDSF.js";import{i as Oe}from"./Zap-BQKeuD4l.js";import{u as it}from"./use-mobile-C0mpADhR.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-DvWgcmQI.js";import{b as Ee,a as Ae,d as Me,f as rt,c as Ht,e as Vt,D as Gt}from"./dialog-CxQBoX40.js";import{I as Ue}from"./input-CutcETvq.js";import{S as K}from"./skeleton-1BUBAFib.js";import{F as ie,d as at,M as ot}from"./file-type-icon-Cd8oKt-R.js";import{a as Qt}from"./toolbar-CB27CeHy.js";import{r as Be,s as A,a as be,t as Wt,u as Pe,v as Le,h as Yt,L as Xt,o as Zt,p as Jt,n as es,R as Ve,q as ts,S as ss,b as ns,w as ct,x as le,y as ls}from"./preview-dialog-D1-LAakL.js";import{a as ve}from"./DotsVertical-QF46dzdi.js";import{i as is}from"./Key01-r6MDYdDw.js";import{s as je}from"./Trash01-d58N8w5a.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-5CWPgj7f.js";import{T as rs}from"./textarea-CvR7iHW3.js";import{t as as}from"./ChevronDown-URo4LveF.js";import{n as os}from"./ChevronUp-HJUE3-BD.js";import{i as ge}from"./X-D7X7Z50V.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-aMkPes9N.js";import"./tooltip-Cs84Kx7a.js";import"./LinkExternal01-BWnRnxGs.js";import"./XClose-BbuWQhNb.js";import"./index-DPI_0XE-.js";import"./LayoutLeft-BFxGsVdk.js";import"./popover-C8AJAJSa.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let P;e[23]!==N||e[24]!==D?(P=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=P):P=e[25];let $;return e[26]!==i||e[27]!==P||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,P]}),e[26]=i,e[27]=P,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
2
2
  ${e}: ${n};${s.slice(a)}`}const r=s.length>0&&!s.endsWith(`
3
3
  `)?`
4
4
  `:"";return`${s}${r}:root {
@@ -1,4 +1,4 @@
1
- import{c as le,r as K,b as yt,D as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a8 as rs,u as ls,w as xt,E as os}from"./index-DVyj5fuq.js";import{S as as}from"./search-input-Bkwrx7tI.js";import{P as De}from"./index-1K74hihp.js";import{E as St}from"./empty-state-Do7xKqQm.js";import{R as ns}from"./require-capability-B3soU3U-.js";import{J as Tt,S as is}from"./scroll-area-BOzFl7qs.js";import{u as vt}from"./use-connection-CzcC522C.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-DySIiC0W.js";import{P as ct,a as dt,b as mt}from"./popover-DCt-yH34.js";import{T as Ze,a as et,b as tt}from"./tooltip-3uKRhKGc.js";import{i as ft,n as cs}from"./ChevronUp-CUesWqmK.js";import{a as Xe}from"./Eye-FmUDnTHn.js";import{n as Mt}from"./Globe01-Ckwe4UHh.js";import{i as At}from"./FilterLines-eS3dI9hB.js";import{i as ds}from"./Key01-wlyPB5nN.js";import{i as ms}from"./Play-D6BtU9Uh.js";import{ak as us,T as xs,M as fs}from"./agent-icon-AqXPfJak.js";import{M as _t}from"./monaco-editor-CGqqNDfH.js";import{u as ps}from"./use-members-GGq7DYTP.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-fdcDDNuq.js";import{u as vs}from"./use-virtual-mcp-ufrd8iJJ.js";import{n as Qe}from"./XCircle-CkFuQ7IG.js";import{c as Ns}from"./SwitchHorizontal01-BeteqXsq.js";import{s as bs}from"./Plus-8zBKSNee.js";import{s as ys}from"./Trash01-DDwxWuR_.js";import{I as Ge}from"./input-GyW6rRcJ.js";import{C as ws,g as Ss,b as Dt,f as st,a as Vt,c as pt,d as Is,e as Lt,h as Ut,A as Cs,T as ks,i as Ts,M as ht}from"./automation-runs-BZimcr-h.js";import{b as lt,c as ot,S as at,a as $e,d as nt}from"./select-C3uZV2A_.js";import{t as Kt}from"./ChevronDown-DJ5SHmhN.js";import{s as Ms}from"./Stars02-f3tbtjbB.js";import{T as _s}from"./textarea-C8t5NRp5.js";import{C as qt}from"./collection-tabs-BKP4OHUr.js";import{S as Ds}from"./switch-aFiGEpQz.js";import{L as Ls}from"./label-DZS4CYvt.js";import{I as qe}from"./integration-icon-BtlW6ioP.js";import{A as Bt}from"./avatar-BVLQzOkg.js";import{A as Fs,a as Rs,b as $s}from"./alert-BbYDxfTx.js";import{C as Ht}from"./card-Dcgr1F8G.js";import{K as Me}from"./monitoring-stats-row-D3Ly6cXH.js";import{u as Jt}from"./studio-tools-BvOjHliA.js";import{u as zs}from"./useSuspenseInfiniteQuery-BEAkaT6v.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-n3UWOPEl.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-DerXyAj5.js";import{u as Vs}from"./use-infinite-scroll-BXMBgtt1.js";import{c as Us,b as Ks}from"./use-automations-D3-t22-_.js";import"./SearchMd-57vTBUjU.js";import"./sidebar-B5rVQTnV.js";import"./LayoutLeft-C_wbh4sE.js";import"./use-mobile-CvxOtGtu.js";import"./use-capability-BjlflkMO.js";import"./access-gate-B1FO8IUq.js";import"./capability-load-error-dMfRi5Lm.js";import"./Stars01-BvvUaY8d.js";import"./ChevronRight-BXEszS6k.js";import"./use-clock-tick-CzIilxCh.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DwazvcnZ.js";import"./file-type-icon-Cs_SK9tU.js";import"./dialog-CbpDnZu8.js";import"./X-D5odjFOj.js";import"./ZoomOut-CGeRz2Xe.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-pwajyff_.js";import"./chat-context-Bw2XBdCM.js";import"./hooks-fHAHvlgy.js";import"./decopilot-sse-pool-BiYcCf8O.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CWY8hivp.js";import"./use-organization-settings-BnxEz1nn.js";import"./AlertCircle-kcMUHNYP.js";import"./Star01-BUumId75.js";import"./XClose-CQQFXdbB.js";import"./ZapSquare-DWfiiAgK.js";import"./Tool01-DKUGTxge.js";import"./Monitor01-DNvJhnf-.js";import"./Upload01-CvwE1uG-.js";import"./shell-layout-xNLL_s4g.js";import"./Users03-Cnldjgk9.js";import"./CheckCircle-Do934x7B.js";import"./Zap-D2QyQXL2.js";import"./required-auth-layout-DJ9sUOZj.js";import"./use-org-sso-B6LnDpoK.js";import"./LinkExternal01-BoVxtqR2.js";import"./ArrowUpRight-KPaHD_ZU.js";import"./Palette-Bf6p_3g1.js";import"./use-navigate-to-agent-DwfR9Suw.js";import"./use-mcp-prompts-D-HAq_yv.js";import"./form-HH5S6Yti.js";import"./use-collections-DCQeHkgD.js";import"./Settings02-k7X7M16V.js";import"./ChevronLeft-QZNH5ck-.js";import"./DotsVertical-F-o-_a2z.js";import"./Globe04-iXhOnFjr.js";import"./HardDrive-CNIST2bR.js";import"./Sun-42Xfv_Dc.js";import"./Shield01-6X9Jy9--.js";import"./User01-KLLrp_Cb.js";import"./Users01-BoxxsDP9.js";import"./index-DUxlPTha.js";import"./use-org-auth-client-DXTnBB9n.js";import"./auth-DhQO5_HB.js";import"./useInfiniteQuery-D6zHLjhR.js";import"./task-status-D2kMSoyM.js";import"./checkbox-DtAK_uVJ.js";import"./command-BxulIERM.js";import"./index-Dm5Wtwak.js";import"./index-CutM526i.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{c as le,r as K,b as yt,D as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a8 as rs,u as ls,w as xt,E as os}from"./index-I8Uum3Jx.js";import{S as as}from"./search-input-BVF4N9EW.js";import{P as De}from"./index-BU8Nad-n.js";import{E as St}from"./empty-state-B-ezQrZT.js";import{R as ns}from"./require-capability-DAovjPYR.js";import{J as Tt,S as is}from"./scroll-area-DnauLcxE.js";import{u as vt}from"./use-connection-BcZ8SPdu.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-toKsUzoB.js";import{P as ct,a as dt,b as mt}from"./popover-C8AJAJSa.js";import{T as Ze,a as et,b as tt}from"./tooltip-Cs84Kx7a.js";import{i as ft,n as cs}from"./ChevronUp-HJUE3-BD.js";import{a as Xe}from"./Eye-BSiFxHQB.js";import{n as Mt}from"./Globe01-wGomueqV.js";import{i as At}from"./FilterLines-CEzORaPw.js";import{i as ds}from"./Key01-r6MDYdDw.js";import{i as ms}from"./Play-BDoh8EAp.js";import{ak as us,T as xs,M as fs}from"./agent-icon-B2N3zGQH.js";import{M as _t}from"./monaco-editor-x5JEAvo5.js";import{u as ps}from"./use-members-D283HZiN.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-Bq9g8m5J.js";import{u as vs}from"./use-virtual-mcp-C5aoCVVQ.js";import{n as Qe}from"./XCircle-PlbEvjyp.js";import{c as Ns}from"./SwitchHorizontal01-F_1MjTR3.js";import{s as bs}from"./Plus-Bw9lc6SR.js";import{s as ys}from"./Trash01-d58N8w5a.js";import{I as Ge}from"./input-CutcETvq.js";import{C as ws,g as Ss,b as Dt,f as st,a as Vt,c as pt,d as Is,e as Lt,h as Ut,A as Cs,T as ks,i as Ts,M as ht}from"./automation-runs-DyKvgj21.js";import{b as lt,c as ot,S as at,a as $e,d as nt}from"./select-CeO9pIG_.js";import{t as Kt}from"./ChevronDown-URo4LveF.js";import{s as Ms}from"./Stars02-PPXsboxW.js";import{T as _s}from"./textarea-CvR7iHW3.js";import{C as qt}from"./collection-tabs-FH3-RtUV.js";import{S as Ds}from"./switch-B9PlH85E.js";import{L as Ls}from"./label-DtGUWURu.js";import{I as qe}from"./integration-icon-D3W1euXX.js";import{A as Bt}from"./avatar-Dv3IrttI.js";import{A as Fs,a as Rs,b as $s}from"./alert-Cg3WXwSx.js";import{C as Ht}from"./card-Chq65iX4.js";import{K as Me}from"./monitoring-stats-row-BsPY2-bU.js";import{u as Jt}from"./studio-tools-bjPFQfXc.js";import{u as zs}from"./useSuspenseInfiniteQuery-DBiSYggu.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-CaSXRGPU.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-Bh38Wtyx.js";import{u as Vs}from"./use-infinite-scroll-BJoUj4tJ.js";import{c as Us,b as Ks}from"./use-automations-P1MHR3DS.js";import"./SearchMd-BMfw7gZ4.js";import"./sidebar-BNKGZwsk.js";import"./LayoutLeft-BFxGsVdk.js";import"./use-mobile-C0mpADhR.js";import"./use-capability-BUm2GwYJ.js";import"./access-gate-6AWas-Ss.js";import"./capability-load-error-BRyHg_Rt.js";import"./Stars01-D1icdaCh.js";import"./ChevronRight-oz8o6WPV.js";import"./use-clock-tick-DNfOIVGO.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-3_Rhxcs5.js";import"./file-type-icon-Cd8oKt-R.js";import"./dialog-CxQBoX40.js";import"./X-D7X7Z50V.js";import"./ZoomOut-DxqRFWA_.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-pQkRXbdZ.js";import"./chat-context-Bspy4m-d.js";import"./hooks-BAG9TZjZ.js";import"./decopilot-sse-pool-TIer_srZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BgadC07_.js";import"./use-organization-settings-oh1iUWuA.js";import"./AlertCircle-VcwplCRi.js";import"./Star01-BwAv907s.js";import"./XClose-BbuWQhNb.js";import"./ZapSquare-CvkoTQDM.js";import"./Tool01-DvTGD1Yt.js";import"./Monitor01-SEZLDRFN.js";import"./Upload01-C_hHbDSF.js";import"./shell-layout-BgovnITR.js";import"./Users03-CL71IAQ8.js";import"./CheckCircle-V30FMM2D.js";import"./Zap-BQKeuD4l.js";import"./required-auth-layout-BFGUeccA.js";import"./use-org-sso-HWNvOeDC.js";import"./LinkExternal01-BWnRnxGs.js";import"./ArrowUpRight-CAv7CUnJ.js";import"./Palette-CEjENuG4.js";import"./use-navigate-to-agent-CRQ9sIAj.js";import"./use-mcp-prompts-B5FIxmOZ.js";import"./form-CpFt_4sy.js";import"./use-collections-KLUYE1x1.js";import"./Settings02-DbH9OAzT.js";import"./ChevronLeft-aMkPes9N.js";import"./DotsVertical-QF46dzdi.js";import"./Globe04-CsKOsQ4z.js";import"./HardDrive-BuI4Q48l.js";import"./Sun-Dw86eVev.js";import"./Shield01-C1R4fpvK.js";import"./User01-BDtU1dk1.js";import"./Users01-PX3eYoC8.js";import"./index-DPI_0XE-.js";import"./use-org-auth-client-WATciLg3.js";import"./auth-DZDiXt1m.js";import"./useInfiniteQuery-RfoATJAI.js";import"./task-status-sw3Y4pwg.js";import"./checkbox-KUrNOBQk.js";import"./command-DMsCjDdA.js";import"./index-BLMNER8l.js";import"./index-DUdLsOJu.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Ft(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{r as n,ak as q,cB as R,cC as Ee,cD as ke,cE as Se,bT as xe,cF as j}from"./index-DVyj5fuq.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...B}=t,U=q(),ne=q(),H=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:B,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Be=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Oe=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Oe,Item:Ve,Input:Be,Group:je,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
1
+ import{r as n,ak as q,cB as R,cC as Ee,cD as ke,cE as Se,bT as xe,cF as j}from"./index-I8Uum3Jx.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...B}=t,U=q(),ne=q(),H=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:B,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Be=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Oe=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Oe,Item:Ve,Input:Be,Group:je,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
@@ -1 +1 @@
1
- import{c as f,l as d,r as p,j as r}from"./index-DVyj5fuq.js";import{m as w}from"./sidebar-B5rVQTnV.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
1
+ import{c as f,l as d,r as p,j as r}from"./index-I8Uum3Jx.js";import{m as w}from"./sidebar-BNKGZwsk.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
@@ -1 +1 @@
1
- import{r as h}from"./index-DVyj5fuq.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
1
+ import{r as h}from"./index-I8Uum3Jx.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});