decocms 4.30.1 → 4.30.2

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 (219) hide show
  1. package/dist/client/assets/{AlertCircle-DQZIoZK3.js → AlertCircle-DnAYXfMU.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BXPXISIu.js → ArrowUpRight-TtNUPTQB.js} +1 -1
  3. package/dist/client/assets/{Check-s3en6K6a.js → Check-BvrjRK-f.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-6oFE8RZY.js → CheckCircle-C6nWvFHV.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DfbvlHGm.js → ChevronDown-DYHTINZW.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BbMxA_we.js → ChevronRight-Bl9YVPs6.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CSojtzH5.js → ChevronUp-B18hle8l.js} +1 -1
  8. package/dist/client/assets/{Circle-4U8mdxgJ.js → Circle-DPVk1czd.js} +1 -1
  9. package/dist/client/assets/{Copy01-CIuFqZaz.js → Copy01-CrUgsJcD.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CcXsbxkI.js → DotsVertical-BndxtaEo.js} +1 -1
  11. package/dist/client/assets/{Eye-C-Ii0MmZ.js → Eye-ClTWumnI.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CRqtZMw9.js → FilterLines-CTf9rlZx.js} +1 -1
  13. package/dist/client/assets/{Globe01-CdJefkBr.js → Globe01-BoyjWYdB.js} +1 -1
  14. package/dist/client/assets/{Globe04-BrDmMJuA.js → Globe04-Cu0R3oaF.js} +1 -1
  15. package/dist/client/assets/{HardDrive-C1TfsRRw.js → HardDrive-PM-PT0eV.js} +1 -1
  16. package/dist/client/assets/{Key01-BuAYoLgF.js → Key01-7XhjBNK3.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-BuFW-ud0.js → LayoutLeft-DfWu_TMe.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DMcxPOk0.js → LinkExternal01-C1Hc9Rj3.js} +1 -1
  19. package/dist/client/assets/{List-Dg43Ye3O.js → List-BSXYor2Z.js} +1 -1
  20. package/dist/client/assets/{Loading02-CLjf_mWB.js → Loading02-ye_m_QAK.js} +1 -1
  21. package/dist/client/assets/{Monitor01-DP1X3LaS.js → Monitor01-CWCFfYgZ.js} +1 -1
  22. package/dist/client/assets/{Palette-6OTpcgOT.js → Palette-DpDs-Lap.js} +1 -1
  23. package/dist/client/assets/{Play-C-6p0BcA.js → Play-lmf5c9Jo.js} +1 -1
  24. package/dist/client/assets/{Plus-DI8G3hjD.js → Plus-DK37ytOg.js} +1 -1
  25. package/dist/client/assets/{SearchLg-CeBJHSxD.js → SearchLg-ox88sikc.js} +1 -1
  26. package/dist/client/assets/{SearchMd-BK3G07RD.js → SearchMd-DbAiVRZR.js} +1 -1
  27. package/dist/client/assets/{Settings02-Cc5NwEaN.js → Settings02-N3uovfLI.js} +1 -1
  28. package/dist/client/assets/{Shield01-CSmFJ1RP.js → Shield01-CGCJBA4k.js} +1 -1
  29. package/dist/client/assets/{Star01-CWyyx_CI.js → Star01-CVz_7GBv.js} +1 -1
  30. package/dist/client/assets/{Stars01-CNNiBNAJ.js → Stars01-D6zQVCEN.js} +1 -1
  31. package/dist/client/assets/{Stars02-zuQltjIB.js → Stars02-CxeSSA7g.js} +1 -1
  32. package/dist/client/assets/{Sun-Cm9IedwX.js → Sun-e9bFqj0N.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-Cw76bjm8.js → SwitchHorizontal01-CTmNw19f.js} +1 -1
  34. package/dist/client/assets/{Tool01-CTeGQUqF.js → Tool01-Do_IYkhs.js} +1 -1
  35. package/dist/client/assets/{Trash01-CeLlU9Hr.js → Trash01-DPHj7EPF.js} +1 -1
  36. package/dist/client/assets/{Upload01-DeL5atjC.js → Upload01-H4u3fcTc.js} +1 -1
  37. package/dist/client/assets/{User01-CVy-WVkE.js → User01-GIEDPABY.js} +1 -1
  38. package/dist/client/assets/{Users01-gmVxoI-k.js → Users01-hbEK4T_M.js} +1 -1
  39. package/dist/client/assets/{Users03-Ba1rCL5_.js → Users03-BjPo5EJz.js} +1 -1
  40. package/dist/client/assets/{X-B4fK1PSH.js → X-B11_-bWv.js} +1 -1
  41. package/dist/client/assets/{XCircle-D680rHaa.js → XCircle-DhEfH4xa.js} +1 -1
  42. package/dist/client/assets/{XClose-DZ-fbd9x.js → XClose-7c8y3nr7.js} +1 -1
  43. package/dist/client/assets/{Zap-CHM8jc7i.js → Zap-C6zrTK7v.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-BjByOqyA.js → ZapSquare-D9UGTwX8.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-Dt1IXaRq.js → ZoomOut-COjlHAto.js} +1 -1
  46. package/dist/client/assets/{access-gate-w4EKvoEv.js → access-gate-cQiB1PTp.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-DogHlV9_.js → add-section-modal-CzTGC6D4.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-giK3bRW-.js → agent-capabilities-DGJfVNFQ.js} +1 -1
  49. package/dist/client/assets/{agent-icon-N5U1HeY1.js → agent-icon-Cg17MSXd.js} +1 -1
  50. package/dist/client/assets/{agents-list-CqlyAaPn.js → agents-list-DtJ5AwUc.js} +1 -1
  51. package/dist/client/assets/{ai-providers--EA2lMFo.js → ai-providers-zedfjYwR.js} +1 -1
  52. package/dist/client/assets/{alert-Bdmkn5IA.js → alert-CH-ji8jT.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-DQf3rZVT.js → alert-dialog-DCVvUTHg.js} +1 -1
  54. package/dist/client/assets/{app-editor-k0YPL4X-.js → app-editor-CcSesL6B.js} +1 -1
  55. package/dist/client/assets/{auth-DLezYwI7.js → auth-D3gb8a1G.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-v82GytbP.js → auth-catchall-OeWX2Rae.js} +1 -1
  57. package/dist/client/assets/{auth-entry-verdsuvy.js → auth-entry-DO2h9Nld.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-D3EcXAD7.js → auth-split-layout-Dhzw613v.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-B89lyITx.js → authenticate-and-persist-oauth-D74XVxJq.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-o2_pLOr4.js → automation-list-row-DESlAeXT.js} +1 -1
  61. package/dist/client/assets/{automation-runs-Dmwa3j9k.js → automation-runs-W3FykFwC.js} +1 -1
  62. package/dist/client/assets/{automations-3TEWqXty.js → automations-BPCmHVJZ.js} +1 -1
  63. package/dist/client/assets/{autosend-e3cesngm.js → autosend-Ci7tspr4.js} +1 -1
  64. package/dist/client/assets/{avatar-0pAXOhlp.js → avatar-pA-6XVGw.js} +1 -1
  65. package/dist/client/assets/{badge-DdUP-taI.js → badge-9NVu_VdI.js} +1 -1
  66. package/dist/client/assets/{block-document-B5oKLw65.js → block-document-D1IvbVsR.js} +1 -1
  67. package/dist/client/assets/{brand-context-DYt7cXJ_.js → brand-context-Cfpp64p-.js} +1 -1
  68. package/dist/client/assets/{breadcrumb-Dx2G4VO9.js → breadcrumb-CyK1O4L9.js} +1 -1
  69. package/dist/client/assets/{buckets-BDVtaRLE.js → buckets-DrIzuaKD.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-DJTbN1Qa.js → bulk-category-panel-fFPPHHPj.js} +1 -1
  71. package/dist/client/assets/{calendar-CcJoOwrC.js → calendar-DN0gI0pg.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-kAN6hK8J.js → capability-load-error-DJ112fpN.js} +1 -1
  73. package/dist/client/assets/{card-CLNI5vTb.js → card-z0DIgOE_.js} +1 -1
  74. package/dist/client/assets/{category-editor-C-c4TOvs.js → category-editor-8gyBAsEs.js} +1 -1
  75. package/dist/client/assets/{chat-context-CDLyvKdU.js → chat-context-BD7KZRIw.js} +8 -8
  76. package/dist/client/assets/{checkbox-BCSDUgIe.js → checkbox-BD6yTuo9.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-BMRSWJHK.js → cli-auth-success-4WAUWGOy.js} +1 -1
  78. package/dist/client/assets/{collection-detail-BxQm_7ex.js → collection-detail-Cw5VsLUF.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-DgkDwQx3.js → collection-display-button-_LfG8OU8.js} +1 -1
  80. package/dist/client/assets/{collection-search-EDEWD1X9.js → collection-search-IlxdiWIS.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-tJUZOEkF.js → collection-table-wrapper-Cm4IDZta.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-Cq6azV_u.js → collection-tabs-B4OrNtqt.js} +1 -1
  83. package/dist/client/assets/{command-DHmaE9JT.js → command-B5VkuRkm.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-DNPVnUn4.js → commerce-onboarding-Cjz_0OMT.js} +1 -1
  85. package/dist/client/assets/{connect-desktop-dialog-DGh-1tLq.js → connect-desktop-dialog-Dl5P-KpW.js} +1 -1
  86. package/dist/client/assets/{connection-card-DT-riPtN.js → connection-card-BkLSl9Um.js} +1 -1
  87. package/dist/client/assets/{connection-detail-DfM_VWgx.js → connection-detail-C2gEsKL9.js} +1 -1
  88. package/dist/client/assets/{connection-form-helpers-DioUFOWc.js → connection-form-helpers-BPxpL3kZ.js} +1 -1
  89. package/dist/client/assets/{connections-bwhbNn_9.js → connections-pkPDtQ8_.js} +1 -1
  90. package/dist/client/assets/{decopilot-sse-pool-BOi7-S8l.js → decopilot-sse-pool-mwjxYiq3.js} +1 -1
  91. package/dist/client/assets/{dialog-C1_sXCgH.js → dialog-1Eqcgb9h.js} +1 -1
  92. package/dist/client/assets/{domain-settings-BZ3H97uq.js → domain-settings-Dohjkz1h.js} +1 -1
  93. package/dist/client/assets/{drawer-BstQPSyC.js → drawer-DgApXJiu.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-BXGfrSiX.js → dropdown-menu-DQljEt7c.js} +1 -1
  95. package/dist/client/assets/{empty-state-CSs6-Bdi.js → empty-state-Ds7boKzG.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-mdwVf3Kr.js → extract-connection-data-BjQiSug0.js} +1 -1
  97. package/dist/client/assets/{file-explorer-BCjGBw7c.js → file-explorer-BsT5nmcT.js} +1 -1
  98. package/dist/client/assets/{file-type-icon-C_PHmk0C.js → file-type-icon-DFmN-X_v.js} +1 -1
  99. package/dist/client/assets/{files-DJf6oJKs.js → files-3UKz8-rY.js} +1 -1
  100. package/dist/client/assets/{form-BB8De_xV.js → form-uObUvJsx.js} +1 -1
  101. package/dist/client/assets/{general-BgbMP2m7.js → general-BRqph6Dj.js} +1 -1
  102. package/dist/client/assets/{github-repo-picker-aJftKcC0.js → github-repo-picker--Ek5Q2kM.js} +1 -1
  103. package/dist/client/assets/{hooks-CksaF-ej.js → hooks-D0_F2fuV.js} +1 -1
  104. package/dist/client/assets/{index-BlHRIOF6.js → index-7MM5fVQo.js} +1 -1
  105. package/dist/client/assets/{index-C0ZQYTpQ.js → index-B4fQG-zs.js} +1 -1
  106. package/dist/client/assets/{index-DDp5gOuw.js → index-BDPw5_B7.js} +1 -1
  107. package/dist/client/assets/{index-ByOvX_ve.js → index-BYp7Ofgs.js} +3 -3
  108. package/dist/client/assets/{index-BgeQc437.js → index-BhkyjzCF.js} +1 -1
  109. package/dist/client/assets/{index-C34RmICP.js → index-BiNiHAi9.js} +1 -1
  110. package/dist/client/assets/{index-BTvzEEE4.js → index-BvSoUF3k.js} +1 -1
  111. package/dist/client/assets/{index-SAeZ5DI1.js → index-CRGi0rZP.js} +1 -1
  112. package/dist/client/assets/{index-PwHmdceA.js → index-CsCCWNU9.js} +5 -5
  113. package/dist/client/assets/{index-B_a3RFg9.js → index-D49TFDgG.js} +1 -1
  114. package/dist/client/assets/{index-C0ZnJYy-.js → index-DLj7x7R3.js} +1 -1
  115. package/dist/client/assets/{index-_3KKuOg4.js → index-DV-YI8KM.js} +1 -1
  116. package/dist/client/assets/{index-eWA8xKaL.js → index-HXlkJk8d.js} +1 -1
  117. package/dist/client/assets/index-R9eJcMBA.js +1 -0
  118. package/dist/client/assets/{index-redirect-uNIA84_Q.js → index-redirect-D_z5S11g.js} +1 -1
  119. package/dist/client/assets/{input-Bt7D33rg.js → input-C7dZO9ym.js} +1 -1
  120. package/dist/client/assets/{integration-icon-C5KirdUg.js → integration-icon-FGiS_d1C.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-BuARwphh.js → invite-member-dialog-D1ExdVDs.js} +1 -1
  122. package/dist/client/assets/{label-BxgEeCbJ.js → label-C1WcZg4i.js} +1 -1
  123. package/dist/client/assets/{login-CaG_4y_B.js → login-DXbx_t2u.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-CL0sljW9.js → mcp-oauth-D_BuxJo5.js} +1 -1
  125. package/dist/client/assets/{members--hV2Q0Ot.js → members-ClFgHkOh.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-CbUVJEKg.js → monaco-editor-bcLWH9Yf.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-DFi_Kdkh.js → monitoring-stats-row-DQjdFov1.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-DAhYaKj8.js → oauth-callback-BONoAGnw.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-CR0F-hQD.js → oauth-callback-ai-provider-D2kGA20A.js} +1 -1
  130. package/dist/client/assets/{onboarding-BUFWneNv.js → onboarding-OfWimmEv.js} +1 -1
  131. package/dist/client/assets/{org-install-Bb2jIZ-L.js → org-install-CDsn26MI.js} +1 -1
  132. package/dist/client/assets/{org-layout-D_gYV_Zs.js → org-layout-C9pMQN-q.js} +1 -1
  133. package/dist/client/assets/{organization-choice-BvtQGOSW.js → organization-choice-S7ZXrRI1.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-BWWbOuxt.js → page-seo-form-DVuWK58d.js} +1 -1
  135. package/dist/client/assets/page-seo-sheet-BPUAn1gD.js +1 -0
  136. package/dist/client/assets/{popover-DzPhoKNT.js → popover-CxakTUJX.js} +1 -1
  137. package/dist/client/assets/{post-editor-Dl6eFOA9.js → post-editor-CuGlxxiD.js} +1 -1
  138. package/dist/client/assets/{primitives-CHpgu7zx.js → primitives-DWMNMXxf.js} +1 -1
  139. package/dist/client/assets/{profile-CuDAW9Ii.js → profile-B08zyo9T.js} +1 -1
  140. package/dist/client/assets/project-app-view-gIjSglNc.js +1 -0
  141. package/dist/client/assets/record-editor-DXrOuKcs.js +1 -0
  142. package/dist/client/assets/registry-Dpup9jP-.js +2 -0
  143. package/dist/client/assets/{registry-layout-BkbFqKCh.js → registry-layout-DEUUoxVX.js} +1 -1
  144. package/dist/client/assets/{require-capability-DGTSD8vx.js → require-capability-u4HmBddy.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-BjrbsMWm.js → required-auth-layout-DQ3D6qQS.js} +1 -1
  146. package/dist/client/assets/{reset-password-BiKRZoQ2.js → reset-password-D5KmVqoe.js} +1 -1
  147. package/dist/client/assets/{roles-zCiQqsuK.js → roles-B9y6HK7U.js} +1 -1
  148. package/dist/client/assets/{search-input-kWxNIRnl.js → search-input-D8kV8LpY.js} +1 -1
  149. package/dist/client/assets/{secrets-viO9Xl5S.js → secrets-BY6FPIEt.js} +1 -1
  150. package/dist/client/assets/{sections-editor-W7VOMkOG.js → sections-editor-CQqC2IMh.js} +1 -1
  151. package/dist/client/assets/{select-8JaYnS6d.js → select-G_YqOyoi.js} +1 -1
  152. package/dist/client/assets/{select-model-B-2xubIJ.js → select-model-CaCFe0Qm.js} +1 -1
  153. package/dist/client/assets/{seo-editor-CFGBoPWr.js → seo-editor-CC4KlJFc.js} +1 -1
  154. package/dist/client/assets/{settings-layout-DNdkL202.js → settings-layout-DdC76rT-.js} +1 -1
  155. package/dist/client/assets/{settings-section-CAqTmyhS.js → settings-section-CLbCpPyp.js} +1 -1
  156. package/dist/client/assets/{shell-controls-Yg88zbSN.js → shell-controls-xp5svzIV.js} +1 -1
  157. package/dist/client/assets/{shell-layout-k2JSKYlm.js → shell-layout-CmMDmGXk.js} +1 -1
  158. package/dist/client/assets/{sidebar-C761eQb1.js → sidebar-DXJheAJA.js} +1 -1
  159. package/dist/client/assets/{skeleton-DSJYqmzp.js → skeleton-BAea7AlB.js} +1 -1
  160. package/dist/client/assets/{sso-CWcGb61Y.js → sso-C7I92c6D.js} +1 -1
  161. package/dist/client/assets/{store-DxbT2BKV.js → store-DIivY7IJ.js} +1 -1
  162. package/dist/client/assets/store-registry-CVneYPwx.js +2 -0
  163. package/dist/client/assets/{studio-tools-CgfSo7j_.js → studio-tools-D970x90m.js} +1 -1
  164. package/dist/client/assets/{switch-DhJhR8Ba.js → switch-D3WvQAp5.js} +1 -1
  165. package/dist/client/assets/{table-CDz46PoK.js → table-UT3NTBNO.js} +1 -1
  166. package/dist/client/assets/{tabs-BUhcO-L3.js → tabs-GPhk4mCA.js} +1 -1
  167. package/dist/client/assets/{textarea-BYx7whqS.js → textarea-ChqR5uQR.js} +1 -1
  168. package/dist/client/assets/{toggle-group-BZ189fjx.js → toggle-group-ClZzbpdF.js} +1 -1
  169. package/dist/client/assets/{toolbar-C5VXYU-N.js → toolbar-CBZulNRe.js} +1 -1
  170. package/dist/client/assets/{toolbar-icon-button-DrS8O_Iq.js → toolbar-icon-button-CJQiVcrq.js} +1 -1
  171. package/dist/client/assets/{tools-list-DlkGTda2.js → tools-list-BwElXZDI.js} +1 -1
  172. package/dist/client/assets/{tooltip-B3P4mjnJ.js → tooltip-DB1pbaN7.js} +1 -1
  173. package/dist/client/assets/{types-CcSVLYhO.js → types-Br8gG1Yy.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-CprIzBUo.js → use-ai-providers-KkX2eDSF.js} +1 -1
  175. package/dist/client/assets/{use-automations-2Be9XmPq.js → use-automations-CooMtuVY.js} +1 -1
  176. package/dist/client/assets/{use-capability-BPxQX6Oj.js → use-capability-BszFKA4z.js} +1 -1
  177. package/dist/client/assets/{use-clock-tick-BjAPnH4G.js → use-clock-tick-a4_ohCGI.js} +1 -1
  178. package/dist/client/assets/{use-collections-b46PF-FB.js → use-collections-CQ-DHlk8.js} +1 -1
  179. package/dist/client/assets/{use-connection-DeGbigio.js → use-connection-BL3pH0HU.js} +1 -1
  180. package/dist/client/assets/{use-copy-D_xDaGph.js → use-copy-U1o477e9.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-B-FWLpM6.js → use-create-virtual-mcp-CEL5Dbuw.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-BuGW5-NP.js → use-debounced-autosave-CVjYZQZj.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-CFIePpm0.js → use-debounced-value-Dkp5tW5n.js} +1 -1
  184. package/dist/client/assets/{use-decopilot-events-BLTRVndf.js → use-decopilot-events-FMOjcbHA.js} +1 -1
  185. package/dist/client/assets/{use-delete-connection-Dl2mZ81L.js → use-delete-connection-3BD9aAiH.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-BTnwV_7n.js → use-file-configs-S4PxYtlV.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-ChaGSzFC.js → use-infinite-scroll-CI-YzSP5.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-BMDS7ZyH.js → use-join-requests-BfcPQxf6.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-u24P-s4P.js → use-mcp-client-DNdH0vv7.js} +1 -1
  190. package/dist/client/assets/{use-mcp-prompts-BDBVNTlN.js → use-mcp-prompts-XEjrzief.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-CocIQ7qB.js → use-mcp-tools-Bi-2En16.js} +1 -1
  192. package/dist/client/assets/{use-members-Bus4og0A.js → use-members-D2Jf8y76.js} +1 -1
  193. package/dist/client/assets/{use-mobile-C93OYfHB.js → use-mobile-DMdcKVFD.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-DjAWkSGL.js → use-navigate-to-agent-cynSQiRw.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-CA5gjmgW.js → use-org-auth-client-DXczVSBm.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-CFBLq8qg.js → use-org-sso-B7dq-Mnj.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-h9scR-Kp.js → use-organization-roles-BAuTLcqM.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-EwmFXWWf.js → use-organization-settings-1kZ641DK.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-D8Q8D5kz.js → use-registry-connections-B0FZfkFl.js} +1 -1
  200. package/dist/client/assets/{use-secrets-W7_VRgqz.js → use-secrets-CjQdbEZR.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-DJJd7nCb.js → use-status-sounds-Csi7Mi_Q.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-B0A1elcL.js → use-view-mode-BbI5V31J.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-Bc6ku1ke.js → use-virtual-mcp-DHTVzUmN.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-DDDNbQaX.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-DPMsxGPA.js +1 -0
  206. package/dist/client/assets/{variant-calendar-DdJwieRy.js → variant-calendar-CwMegenq.js} +1 -1
  207. package/dist/client/assets/{view-mode-toggle-BDMYTtyJ.js → view-mode-toggle-sTfLeCKf.js} +1 -1
  208. package/dist/client/index.html +1 -1
  209. package/dist/server/cli.js +1 -1
  210. package/dist/server/server.js +1 -1
  211. package/package.json +1 -1
  212. package/dist/client/assets/index-CQvqUcGM.js +0 -1
  213. package/dist/client/assets/page-seo-sheet-98Jl6iTy.js +0 -1
  214. package/dist/client/assets/project-app-view-BkSNyja3.js +0 -1
  215. package/dist/client/assets/record-editor-D5qjtt77.js +0 -1
  216. package/dist/client/assets/registry-Dw9uBZ7-.js +0 -2
  217. package/dist/client/assets/store-registry-B_vQy0r8.js +0 -2
  218. package/dist/client/assets/useInfiniteQuery-CwXupu4y.js +0 -1
  219. package/dist/client/assets/useSuspenseInfiniteQuery-ahqYuudo.js +0 -1
@@ -1 +1 @@
1
- import{c as n,p as o,Z as c,j as t,ah as m,B as u,K as x}from"./index-ByOvX_ve.js";function f(){const e=n.c(5),l=o(),{locator:a}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==a||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(a)}),children:"Try again"})]}),e[2]=a,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
1
+ import{c as n,p as o,Z as c,j as t,ah as m,B as u,K as x}from"./index-BYp7Ofgs.js";function f(){const e=n.c(5),l=o(),{locator:a}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==a||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(a)}),children:"Try again"})]}),e[2]=a,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
@@ -1 +1 @@
1
- import{c as o,l as n,j as c}from"./index-ByOvX_ve.js";function i(a){const e=o.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function f(a){const e=o.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
1
+ import{c as o,l as n,j as c}from"./index-BYp7Ofgs.js";function i(a){const e=o.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function f(a){const e=o.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
@@ -1 +1 @@
1
- import{c as q,r as S,l as Q,j as t,B as I,i as V,t as U}from"./index-ByOvX_ve.js";import{i as X}from"./XCircle-D680rHaa.js";import{aG as Y,a9 as T}from"./agent-icon-N5U1HeY1.js";import{n as Z}from"./LinkExternal01-DMcxPOk0.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-DQf3rZVT.js";import{I as L}from"./input-Bt7D33rg.js";import{L as G}from"./label-BxgEeCbJ.js";import{aH as at,aI as mt,aR as nt,aG as lt,aJ as B,aL as pt,aS as ct}from"./index-PwHmdceA.js";import{c as dt,B as ut,a as gt}from"./block-document-B5oKLw65.js";import{u as xt,s as v,E as ft}from"./primitives-CHpgu7zx.js";import{t as ht}from"./ChevronDown-DfbvlHGm.js";import{J as jt,K as yt,I as vt}from"./automation-runs-Dmwa3j9k.js";import"./AlertCircle-DQZIoZK3.js";import"./Tool01-CTeGQUqF.js";import"./SwitchHorizontal01-Cw76bjm8.js";import"./Settings02-Cc5NwEaN.js";import"./ArrowUpRight-BXPXISIu.js";import"./ZapSquare-BjByOqyA.js";import"./Users03-Ba1rCL5_.js";import"./Loading02-CLjf_mWB.js";import"./CheckCircle-6oFE8RZY.js";import"./Check-s3en6K6a.js";import"./ChevronRight-BbMxA_we.js";import"./ChevronUp-CSojtzH5.js";import"./Circle-4U8mdxgJ.js";import"./Stars02-zuQltjIB.js";import"./Copy01-CIuFqZaz.js";import"./ZoomOut-Dt1IXaRq.js";import"./DotsVertical-CcXsbxkI.js";import"./Globe01-CdJefkBr.js";import"./Eye-C-Ii0MmZ.js";import"./FilterLines-CRqtZMw9.js";import"./Star01-CWyyx_CI.js";import"./Globe04-BrDmMJuA.js";import"./HardDrive-C1TfsRRw.js";import"./Key01-BuAYoLgF.js";import"./LayoutLeft-BuFW-ud0.js";import"./List-Dg43Ye3O.js";import"./Monitor01-DP1X3LaS.js";import"./Sun-Cm9IedwX.js";import"./Palette-6OTpcgOT.js";import"./Play-C-6p0BcA.js";import"./Plus-DI8G3hjD.js";import"./SearchLg-CeBJHSxD.js";import"./SearchMd-BK3G07RD.js";import"./Shield01-CSmFJ1RP.js";import"./Stars01-CNNiBNAJ.js";import"./Trash01-CeLlU9Hr.js";import"./Upload01-DeL5atjC.js";import"./User01-CVy-WVkE.js";import"./Users01-gmVxoI-k.js";import"./XClose-DZ-fbd9x.js";import"./X-B4fK1PSH.js";import"./Zap-CHM8jc7i.js";import"./chat-context-CDLyvKdU.js";import"./autosend-e3cesngm.js";import"./hooks-CksaF-ej.js";import"./use-mcp-client-u24P-s4P.js";import"./constants-B72Xmt_K.js";import"./auth-DLezYwI7.js";import"./decopilot-sse-pool-BOi7-S8l.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-Bc6ku1ke.js";import"./use-collections-b46PF-FB.js";import"./use-ai-providers-CprIzBUo.js";import"./studio-tools-CgfSo7j_.js";import"./use-decopilot-events-BLTRVndf.js";import"./tab-id-yjGvxWDL.js";import"./use-organization-settings-EwmFXWWf.js";import"./tooltip-B3P4mjnJ.js";import"./dialog-C1_sXCgH.js";import"./drawer-BstQPSyC.js";import"./collection-search-EDEWD1X9.js";import"./use-mobile-C93OYfHB.js";import"./use-mcp-prompts-BDBVNTlN.js";import"./shell-layout-k2JSKYlm.js";import"./avatar-0pAXOhlp.js";import"./required-auth-layout-BjrbsMWm.js";import"./use-org-sso-CFBLq8qg.js";import"./form-BB8De_xV.js";import"./select-8JaYnS6d.js";import"./tabs-BUhcO-L3.js";import"./toggle-group-BZ189fjx.js";import"./agent-capabilities-giK3bRW-.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DT-riPtN.js";import"./use-registry-connections-D8Q8D5kz.js";import"./use-connection-DeGbigio.js";import"./useInfiniteQuery-CwXupu4y.js";import"./use-infinite-scroll-ChaGSzFC.js";import"./extract-connection-data-mdwVf3Kr.js";import"./card-CLNI5vTb.js";import"./integration-icon-C5KirdUg.js";import"./collection-tabs-Cq6azV_u.js";import"./badge-DdUP-taI.js";import"./textarea-BYx7whqS.js";import"./connection-form-helpers-DioUFOWc.js";import"./authenticate-and-persist-oauth-B89lyITx.js";import"./mcp-oauth-CL0sljW9.js";import"./useSuspenseInfiniteQuery-ahqYuudo.js";import"./connect-desktop-dialog-DGh-1tLq.js";import"./select-model-B-2xubIJ.js";import"./checkbox-BCSDUgIe.js";import"./skeleton-DSJYqmzp.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CAqTmyhS.js";import"./command-DHmaE9JT.js";import"./index-SAeZ5DI1.js";import"./popover-DzPhoKNT.js";import"./dropdown-menu-BXGfrSiX.js";import"./index-BTvzEEE4.js";import"./file-type-icon-C_PHmk0C.js";import"./toolbar-C5VXYU-N.js";import"./use-debounced-value-CFIePpm0.js";import"./index-BgeQc437.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DJJd7nCb.js";import"./empty-state-CSs6-Bdi.js";import"./use-mcp-tools-CocIQ7qB.js";import"./types-CcSVLYhO.js";import"./use-capability-BPxQX6Oj.js";import"./tools-list-DlkGTda2.js";import"./switch-DhJhR8Ba.js";import"./use-debounced-autosave-BuGW5-NP.js";import"./index-B_a3RFg9.js";import"./sidebar-C761eQb1.js";import"./search-input-kWxNIRnl.js";import"./github-repo-picker-aJftKcC0.js";import"./use-navigate-to-agent-DjAWkSGL.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-W7_VRgqz.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-Bus4og0A.js";import"./use-org-auth-client-CA5gjmgW.js";import"./toolbar-icon-button-DrS8O_Iq.js";import"./calendar-CcJoOwrC.js";import"./use-file-configs-BTnwV_7n.js";import"./monaco-editor-CbUVJEKg.js";import"./use-automations-2Be9XmPq.js";import"./automation-list-row-o2_pLOr4.js";import"./table-CDz46PoK.js";import"./use-clock-tick-BjAPnH4G.js";import"./format-time-Cy7tTmZp.js";import"./use-copy-D_xDaGph.js";function bt(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function nr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=z.length,H=o=>s("slug",o),J=async(o,w)=>{const W=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:W,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:B(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:B(n,"categories",E)}),c(E),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},M=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){H(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:M,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&J(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{nr as CategoryEditor};
1
+ import{c as q,r as S,l as Q,j as t,B as I,i as V,t as U}from"./index-BYp7Ofgs.js";import{i as X}from"./XCircle-DhEfH4xa.js";import{aG as Y,a9 as T}from"./agent-icon-Cg17MSXd.js";import{n as Z}from"./LinkExternal01-C1Hc9Rj3.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-DCVvUTHg.js";import{I as L}from"./input-C7dZO9ym.js";import{L as G}from"./label-C1WcZg4i.js";import{aH as at,aI as mt,aR as nt,aG as lt,aJ as B,aL as pt,aS as ct}from"./index-CsCCWNU9.js";import{c as dt,B as ut,a as gt}from"./block-document-D1IvbVsR.js";import{u as xt,s as v,E as ft}from"./primitives-DWMNMXxf.js";import{t as ht}from"./ChevronDown-DYHTINZW.js";import{J as jt,K as yt,I as vt}from"./automation-runs-W3FykFwC.js";import"./AlertCircle-DnAYXfMU.js";import"./Tool01-Do_IYkhs.js";import"./SwitchHorizontal01-CTmNw19f.js";import"./Settings02-N3uovfLI.js";import"./ArrowUpRight-TtNUPTQB.js";import"./ZapSquare-D9UGTwX8.js";import"./Users03-BjPo5EJz.js";import"./Loading02-ye_m_QAK.js";import"./CheckCircle-C6nWvFHV.js";import"./Check-BvrjRK-f.js";import"./ChevronRight-Bl9YVPs6.js";import"./ChevronUp-B18hle8l.js";import"./Circle-DPVk1czd.js";import"./Stars02-CxeSSA7g.js";import"./Copy01-CrUgsJcD.js";import"./ZoomOut-COjlHAto.js";import"./DotsVertical-BndxtaEo.js";import"./Globe01-BoyjWYdB.js";import"./Eye-ClTWumnI.js";import"./FilterLines-CTf9rlZx.js";import"./Star01-CVz_7GBv.js";import"./Globe04-Cu0R3oaF.js";import"./HardDrive-PM-PT0eV.js";import"./Key01-7XhjBNK3.js";import"./LayoutLeft-DfWu_TMe.js";import"./List-BSXYor2Z.js";import"./Monitor01-CWCFfYgZ.js";import"./Sun-e9bFqj0N.js";import"./Palette-DpDs-Lap.js";import"./Play-lmf5c9Jo.js";import"./Plus-DK37ytOg.js";import"./SearchLg-ox88sikc.js";import"./SearchMd-DbAiVRZR.js";import"./Shield01-CGCJBA4k.js";import"./Stars01-D6zQVCEN.js";import"./Trash01-DPHj7EPF.js";import"./Upload01-H4u3fcTc.js";import"./User01-GIEDPABY.js";import"./Users01-hbEK4T_M.js";import"./XClose-7c8y3nr7.js";import"./X-B11_-bWv.js";import"./Zap-C6zrTK7v.js";import"./chat-context-BD7KZRIw.js";import"./autosend-Ci7tspr4.js";import"./hooks-D0_F2fuV.js";import"./use-mcp-client-DNdH0vv7.js";import"./constants-B72Xmt_K.js";import"./auth-D3gb8a1G.js";import"./decopilot-sse-pool-mwjxYiq3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DHTVzUmN.js";import"./use-collections-CQ-DHlk8.js";import"./use-ai-providers-KkX2eDSF.js";import"./studio-tools-D970x90m.js";import"./use-decopilot-events-FMOjcbHA.js";import"./tab-id-yjGvxWDL.js";import"./use-organization-settings-1kZ641DK.js";import"./tooltip-DB1pbaN7.js";import"./dialog-1Eqcgb9h.js";import"./drawer-DgApXJiu.js";import"./collection-search-IlxdiWIS.js";import"./use-mobile-DMdcKVFD.js";import"./use-mcp-prompts-XEjrzief.js";import"./shell-layout-CmMDmGXk.js";import"./avatar-pA-6XVGw.js";import"./required-auth-layout-DQ3D6qQS.js";import"./use-org-sso-B7dq-Mnj.js";import"./form-uObUvJsx.js";import"./select-G_YqOyoi.js";import"./tabs-GPhk4mCA.js";import"./toggle-group-ClZzbpdF.js";import"./agent-capabilities-DGJfVNFQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BkLSl9Um.js";import"./use-registry-connections-B0FZfkFl.js";import"./use-connection-BL3pH0HU.js";import"./useInfiniteQuery-DDDNbQaX.js";import"./use-infinite-scroll-CI-YzSP5.js";import"./extract-connection-data-BjQiSug0.js";import"./card-z0DIgOE_.js";import"./integration-icon-FGiS_d1C.js";import"./collection-tabs-B4OrNtqt.js";import"./badge-9NVu_VdI.js";import"./textarea-ChqR5uQR.js";import"./connection-form-helpers-BPxpL3kZ.js";import"./authenticate-and-persist-oauth-D74XVxJq.js";import"./mcp-oauth-D_BuxJo5.js";import"./useSuspenseInfiniteQuery-DPMsxGPA.js";import"./connect-desktop-dialog-Dl5P-KpW.js";import"./select-model-CaCFe0Qm.js";import"./checkbox-BD6yTuo9.js";import"./skeleton-BAea7AlB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CLbCpPyp.js";import"./command-B5VkuRkm.js";import"./index-CRGi0rZP.js";import"./popover-CxakTUJX.js";import"./dropdown-menu-DQljEt7c.js";import"./index-BvSoUF3k.js";import"./file-type-icon-DFmN-X_v.js";import"./toolbar-CBZulNRe.js";import"./use-debounced-value-Dkp5tW5n.js";import"./index-BhkyjzCF.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Csi7Mi_Q.js";import"./empty-state-Ds7boKzG.js";import"./use-mcp-tools-Bi-2En16.js";import"./types-Br8gG1Yy.js";import"./use-capability-BszFKA4z.js";import"./tools-list-BwElXZDI.js";import"./switch-D3WvQAp5.js";import"./use-debounced-autosave-CVjYZQZj.js";import"./index-D49TFDgG.js";import"./sidebar-DXJheAJA.js";import"./search-input-D8kV8LpY.js";import"./github-repo-picker--Ek5Q2kM.js";import"./use-navigate-to-agent-cynSQiRw.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-CjQdbEZR.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-D2Jf8y76.js";import"./use-org-auth-client-DXczVSBm.js";import"./toolbar-icon-button-CJQiVcrq.js";import"./calendar-DN0gI0pg.js";import"./use-file-configs-S4PxYtlV.js";import"./monaco-editor-bcLWH9Yf.js";import"./use-automations-CooMtuVY.js";import"./automation-list-row-DESlAeXT.js";import"./table-UT3NTBNO.js";import"./use-clock-tick-a4_ohCGI.js";import"./format-time-Cy7tTmZp.js";import"./use-copy-U1o477e9.js";function bt(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function nr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=z.length,H=o=>s("slug",o),J=async(o,w)=>{const W=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:W,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:B(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:B(n,"categories",E)}),c(E),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},M=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){H(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:M,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&J(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{nr as CategoryEditor};
@@ -1,5 +1,5 @@
1
- import{c as ue,l as Ge,by as Ze,j as U,cp as Xe,a0 as Le,p as Ne,Z as se,K as ge,t as ne,Y as le,V as de,b as qe,u as Fe,e as Ye,r as m,M as Je,a as et,a1 as tt,ag as nt}from"./index-ByOvX_ve.js";import{A as je,c as st,a as ot,w as at}from"./autosend-e3cesngm.js";import{S as rt,u as it,d as ct,b as lt}from"./hooks-CksaF-ej.js";import{u as dt}from"./use-mcp-client-u24P-s4P.js";import{a as ut,S as pt}from"./constants-B72Xmt_K.js";import{a as ft}from"./use-virtual-mcp-Bc6ku1ke.js";import{u as ht,a as me}from"./use-ai-providers-CprIzBUo.js";import{u as mt}from"./use-decopilot-events-BLTRVndf.js";import{q as gt,n as yt}from"./tab-id-yjGvxWDL.js";import{f as St}from"./use-organization-settings-EwmFXWWf.js";const xt={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},vt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},It={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},Ct={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},kt={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},bt={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Ue(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function Mt(t){return Ue(t).includes("deepresearch")}const Tt=["sonar","searchpreview","online"];function Qe(t){const e=Ue(t);return e.includes("deepresearch")?!1:Tt.some(n=>e.includes(n))}function Ke(t){return t.asyncResearch!==!0&&Qe(t.modelId)}function Ve(t){return t.asyncResearch===!0||Mt(t.modelId)||Qe(t.modelId)}function ie(t,e,n,s){for(const o of n){const a=t.find(r=>r.modelId===o);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}for(const o of n){const a=t.find(r=>r.modelId.includes(o));if(a)return{keyId:e,modelId:a.modelId,title:a.title}}if(s){const o=t.find(s);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}return null}function wt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const o=e[s.id]??[],a=s.providerId;n.chat.fast||(n.chat.fast=ie(o,s.id,xt[a]??[])),n.chat.smart||(n.chat.smart=ie(o,s.id,vt[a]??[])),n.chat.thinking||(n.chat.thinking=ie(o,s.id,It[a]??[])),n.image||(n.image=ie(o,s.id,Ct[a]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=ie(o,s.id,kt[a]??[],Ke)),n.deepResearch||(n.deepResearch=ie(o,s.id,bt[a]??[],Ve))}return n}const Et=Ze("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function mn(t){const e=ue.c(10),{variant:n,size:s}=t;let o;e[0]!==s||e[1]!==n?(o=Ge(Et({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=o):o=e[2];let a,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=U.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=U.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=a,e[4]=r):(a=e[3],r=e[4]);let l;e[5]!==o?(l=U.jsxs("svg",{"aria-hidden":"true",className:o,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a,r]}),e[5]=o,e[6]=l):l=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=U.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=g):g=e[7];let y;return e[8]!==l?(y=U.jsxs("div",{role:"status",children:[l,g]}),e[8]=l,e[9]=y):y=e[9],y}function At(t,e=[]){return t==="stop"?e.filter(o=>o.type==="text"&&o.text).map(o=>o.text).join(`
2
- `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const Me={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function Rt(t,e){if(!t)return null;const n=e?Xe(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[s,o]of Object.entries(Me))if(o.harness===t&&o.sandbox===n)return s;return null}function gn(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function $t(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function Pt(t){const e=ue.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=Le(n);let o;if(e[1]!==s?.params.appSlug||e[2]!==s?.params.collectionName||e[3]!==s?.params.itemId||e[4]!==t){o=[],t&&o.push(`### Selected Agent
1
+ import{c as ue,l as Ge,by as Ze,j as Q,cp as Xe,a0 as Le,p as Ne,Z as se,K as ge,t as ne,Y as le,V as de,b as qe,u as Fe,e as Ye,r as m,M as Je,a as et,a1 as tt,ag as nt}from"./index-BYp7Ofgs.js";import{A as je,c as st,a as ot,w as at}from"./autosend-Ci7tspr4.js";import{S as rt,u as it,d as ct,b as lt}from"./hooks-D0_F2fuV.js";import{u as dt}from"./use-mcp-client-DNdH0vv7.js";import{a as ut,S as pt}from"./constants-B72Xmt_K.js";import{a as ft}from"./use-virtual-mcp-DHTVzUmN.js";import{u as ht,a as me}from"./use-ai-providers-KkX2eDSF.js";import{u as mt}from"./use-decopilot-events-FMOjcbHA.js";import{q as gt,n as yt}from"./tab-id-yjGvxWDL.js";import{f as St}from"./use-organization-settings-1kZ641DK.js";const xt={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},vt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},It={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},Ct={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},kt={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},bt={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Ue(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function Mt(t){return Ue(t).includes("deepresearch")}const Tt=["sonar","searchpreview","online"];function Qe(t){const e=Ue(t);return e.includes("deepresearch")?!1:Tt.some(n=>e.includes(n))}function Ke(t){return t.asyncResearch!==!0&&Qe(t.modelId)}function Ve(t){return t.asyncResearch===!0||Mt(t.modelId)||Qe(t.modelId)}function ie(t,e,n,s){for(const o of n){const a=t.find(r=>r.modelId===o);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}for(const o of n){const a=t.find(r=>r.modelId.includes(o));if(a)return{keyId:e,modelId:a.modelId,title:a.title}}if(s){const o=t.find(s);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}return null}function wt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const o=e[s.id]??[],a=s.providerId;n.chat.fast||(n.chat.fast=ie(o,s.id,xt[a]??[])),n.chat.smart||(n.chat.smart=ie(o,s.id,vt[a]??[])),n.chat.thinking||(n.chat.thinking=ie(o,s.id,It[a]??[])),n.image||(n.image=ie(o,s.id,Ct[a]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=ie(o,s.id,kt[a]??[],Ke)),n.deepResearch||(n.deepResearch=ie(o,s.id,bt[a]??[],Ve))}return n}const Et=Ze("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function mn(t){const e=ue.c(10),{variant:n,size:s}=t;let o;e[0]!==s||e[1]!==n?(o=Ge(Et({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=o):o=e[2];let a,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=Q.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=Q.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=a,e[4]=r):(a=e[3],r=e[4]);let l;e[5]!==o?(l=Q.jsxs("svg",{"aria-hidden":"true",className:o,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a,r]}),e[5]=o,e[6]=l):l=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=Q.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=g):g=e[7];let S;return e[8]!==l?(S=Q.jsxs("div",{role:"status",children:[l,g]}),e[8]=l,e[9]=S):S=e[9],S}function At(t,e=[]){return t==="stop"?e.filter(o=>o.type==="text"&&o.text).map(o=>o.text).join(`
2
+ `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const Me={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function _t(t,e){if(!t)return null;const n=e?Xe(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[s,o]of Object.entries(Me))if(o.harness===t&&o.sandbox===n)return s;return null}function gn(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function Rt(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function $t(t){const e=ue.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=Le(n);let o;if(e[1]!==s?.params.appSlug||e[2]!==s?.params.collectionName||e[3]!==s?.params.itemId||e[4]!==t){o=[],t&&o.push(`### Selected Agent
3
3
  - ID: ${t}`);let a;e[6]!==s?.params.appSlug||e[7]!==s?.params.collectionName||e[8]!==s?.params.itemId?(a=[],s?.params.appSlug&&a.push(`- Connection ID: ${s?.params.appSlug}`),s?.params.collectionName&&a.push(`- Collection: ${s?.params.collectionName}`),s?.params.itemId&&a.push(`- Item ID: ${s?.params.itemId}`),e[6]=s?.params.appSlug,e[7]=s?.params.collectionName,e[8]=s?.params.itemId,e[9]=a):a=e[9],a.length>0&&o.push(`### Current Resource
4
4
  The user is viewing the following resource:
5
5
  ${a.join(`
@@ -7,8 +7,8 @@ ${a.join(`
7
7
 
8
8
  Help the user understand and work with this resource.`),e[1]=s?.params.appSlug,e[2]=s?.params.collectionName,e[3]=s?.params.itemId,e[4]=t,e[5]=o}else o=e[5];return o.join(`
9
9
 
10
- `)}function _t(){const t=ue.c(5),e=Ne(),{org:n}=se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const o=Le(s);let a;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(a=r=>{const g=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!g||!g[1])return;const y=g[1],I=o?.params.appSlug;if(!I)return;e.invalidateQueries({queryKey:ge.collection(n.slug,I,y)});const T=y.toLowerCase().replace(/_/g," ");ne.success(`${T} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function Dt(){const t=ue.c(4),{org:e,project:n}=se(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=de.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=le(o,Ot);let r;return t[2]!==a?(r={markTaskRead:g=>{a(y=>({...y,[g]:new Date().toISOString()}))}},t[2]=a,t[3]=r):r=t[3],r}function Ot(t){return t??{}}function We(){const t=qe(),{org:e}=se(),n=Fe({strict:!1}),s=Ye({strict:!1}),o=n.virtualmcpid??ut(e.id).id,a=(g,y)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:g},search:I=>{const T={},q=y?.virtualMcpId??I.virtualmcpid;q&&(T.virtualmcpid=q);const p=I.main;return p&&typeof p=="string"&&!gt(p)&&(T.main=p),I.chat&&(T.chat=I.chat),y?.autosend&&(T.autosend=je),T}})},r=m.useRef(crypto.randomUUID()),l=s.taskId??r.current;return{virtualMcpId:o,taskId:l,navigateToTask:a}}function Lt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const o=new TextDecoder().decode(Uint8Array.from(atob(s),a=>a.charCodeAt(0)));return[{type:"text",text:`${e}
11
- ${o}`}]}catch(o){console.error("Failed to decode text file:",o)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function Pe(t,e){const n=[];for(const s of t)"text"in s&&s.text?n.push({type:"text",text:`[${e}]
10
+ `)}function Pt(){const t=ue.c(5),e=Ne(),{org:n}=se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const o=Le(s);let a;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(a=r=>{const g=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!g||!g[1])return;const S=g[1],I=o?.params.appSlug;if(!I)return;e.invalidateQueries({queryKey:ge.collection(n.slug,I,S)});const T=S.toLowerCase().replace(/_/g," ");ne.success(`${T} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function Dt(){const t=ue.c(4),{org:e,project:n}=se(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=de.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=le(o,Ot);let r;return t[2]!==a?(r={markTaskRead:g=>{a(S=>({...S,[g]:new Date().toISOString()}))}},t[2]=a,t[3]=r):r=t[3],r}function Ot(t){return t??{}}function We(){const t=qe(),{org:e}=se(),n=Fe({strict:!1}),s=Ye({strict:!1}),o=n.virtualmcpid??ut(e.id).id,a=(g,S)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:g},search:I=>{const T={},N=S?.virtualMcpId??I.virtualmcpid;N&&(T.virtualmcpid=N);const p=I.main;return p&&typeof p=="string"&&!gt(p)&&(T.main=p),I.chat&&(T.chat=I.chat),S?.autosend&&(T.autosend=je),T}})},r=m.useRef(crypto.randomUUID()),l=s.taskId??r.current;return{virtualMcpId:o,taskId:l,navigateToTask:a}}function Lt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const o=new TextDecoder().decode(Uint8Array.from(atob(s),a=>a.charCodeAt(0)));return[{type:"text",text:`${e}
11
+ ${o}`}]}catch(o){console.error("Failed to decode text file:",o)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function $e(t,e){const n=[];for(const s of t)"text"in s&&s.text?n.push({type:"text",text:`[${e}]
12
12
  ${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function Nt(t,e){const n=(t.files??[]).filter(r=>r.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const o=n.map(r=>`<skill-file path="${r.relPath}">
13
13
  ${r.content.trim()}
14
14
  </skill-file>`).join(`
@@ -19,10 +19,10 @@ Other files in \`${t.sandboxPath}/\`: ${s.join(", ")}`:"";return[{type:"text",te
19
19
  ${o}${a}`}]}function qt(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const o=Array.isArray(s.content)?s.content:[s.content];for(const a of o)switch(a.type){case"text":{const r=a.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
20
20
  ${r}`});break}case"image":case"audio":{if(!a.data||!a.mimeType)continue;n.push({type:"file",url:`data:${a.mimeType};base64,${a.data}`,mediaType:a.mimeType});break}case"resource":{const r=a.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?n.push({type:"text",text:`[${e}]
21
21
  ${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&n.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return n}function Be(t){if(!t)return[];const e=[];let n="";const s=o=>{if(o){if(o.type==="text"&&"text"in o&&typeof o.text=="string")n+=o.text;else if(o.type==="mention"&&o.attrs){const a=o.attrs.char??"/",r=`${a}${o.attrs.name}`;if(n+=r,a==="@"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&"agentId"in l?e.push({type:"text",text:`[DELEGATE TO AGENT: ${l.title??o.attrs.name} (agent_id: ${l.agentId})]
22
- Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...Pe(l,r))}else if(o.attrs.kind==="skill"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Nt(l,r))}else{const l=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(l)&&l.length>0&&"role"in l[0]?e.push(...qt(l,r)):Array.isArray(l)&&e.push(...Pe(l,r))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,r=`[file:://${encodeURIComponent(a.name)}]`;n+=r,e.push(...Lt(a,r))}if("content"in o&&Array.isArray(o.content))for(const a of o.content)s(a)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function yn(t){const e=Be(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function Sn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Ft(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function xn(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function jt(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Ut(t,e){return t.filter(n=>n.messageId!==e)}const _e=new Map,we=new Set;function Qt(t){we.add(t)}function Kt(t){return we.has(t)}function Vt(t){we.delete(t)}function ye(t){let e=_e.get(t);return e||(e=new rt([]),_e.set(t,e)),e}function He(t,e){ye(t).update(n=>jt(n,e))}function Te(t,e){ye(t).update(n=>Ut(n,e))}function Wt(t,e){ye(t).set(e)}const Ie=new Map;function Bt(t,e){Ie.set(`${t}:${e.id}`,e)}function Ht(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function De(t,e){Ie.delete(`${t}:${e}`)}async function Z(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Wt(e,s.items??[])}catch{}}function vn(t){const e=ue.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return m.useSyncExternalStore(s.subscribe,s.get,s.get)}function zt(){const{org:t}=se();return{enqueue:He,refresh:e=>Z(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;Te(e,n);try{const o=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!o.ok&&o.status!==404)throw new Error(`Cancel failed: ${o.status}`);return!0}catch(o){return ne.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await Z(t.slug,e)}}}}const Oe=new Set,ee=new Set;function ce(t){return m.useSyncExternalStore(t.subscribe,t.get,t.get)}function Gt(t){return t.kind==="loading"?"ready":t.kind}function te(t,e,n,s){if(!t)return null;const o=e.find(r=>r.id===t.keyId);if(!o)return null;const a=n.find(r=>r.modelId===t.modelId);return a?{...a,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:o.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Zt(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Xt(t,e,n,s){if(!n||s.length===0)return null;const o=e.find(g=>g.id===n);if(!o)return null;const a=wt([o],{[n]:s}),r=t==="fast"?a.chat.fast:t==="thinking"?a.chat.thinking:a.chat.smart;if(!r)return null;const l=s.find(g=>g.modelId===r.modelId);return l?{...l,keyId:n}:null}const Yt=1e4,Jt=10,Ee=m.createContext(null),Ae=m.createContext(null),Re=m.createContext(null),ze=m.createContext(null);function en({children:t}){const{locator:e}=se(),{virtualMcpId:n}=We(),[s,o]=le(de.chatSelectedImageModel(e),null),[a,r]=le(de.chatSelectedWebSearchModel(e),null),[l,g]=le(de.chatSelectedDeepResearchModel(e),null),[y,I]=m.useState(null),[T,q]=m.useState("default"),p=St(),[R,Q]=le(de.chatSimpleModeTier(e),null),_=Zt(R),C=ht(),k=p.tiers[_],$=y&&C.some(i=>i.id===y)?y:k?.keyId??C[0]?.id??null,{models:S,isLoading:K}=me($??void 0),{models:H}=me(k?.keyId),{models:X}=me(p.tiers.image?.keyId),{models:M}=me(p.tiers.web_search?.keyId),{models:V}=me(p.tiers.deep_research?.keyId),z=te(k,C,H,k?.title)??Xt(_,C,$,S),W=K,B=S.filter(i=>i.capabilities?.includes("image")),F=te(s,C,B),u=te(p.tiers.image,C,X,p.tiers.image?.title)??F??B[0]??null,E=S.filter(Ke),L=te(a,C,E),Y=E.find(i=>i.modelId==="perplexity/sonar")??E[0]??null,j=te(p.tiers.web_search,C,M,p.tiers.web_search?.title)??L??Y,N=S.filter(Ve),b=te(l,C,N),x=N.find(i=>i.modelId==="perplexity/deep-research")??N.find(i=>i.asyncResearch===!0)??N[0]??null,G=te(p.tiers.deep_research,C,V,p.tiers.deep_research?.title)??b??x,Se=ft(n)??{id:n,title:"",description:null,icon:null},[Ce,fe]=m.useState({}),xe=(i,h)=>{const D=[];for(const O of h.content??[])O.type==="text"&&O.text?.trim()&&D.push(O.text.trim());const v=D.join(`
23
- `);if(!v){he(i);return}new TextEncoder().encode(v).length>Yt||fe(O=>Object.keys(O).length>=Jt&&!(i in O)?O:{...O,[i]:v})},he=i=>{fe(h=>{const{[i]:D,...v}=h;return v})},[oe,ke]=le(de.chatLastAgentOption(e),i=>i&&i in Me?i:null),J=sn(),be=J?.isThreadLocked&&J.lockedHarness!=null?Rt(J.lockedHarness,J.lockedSandbox):null,$e=oe,ae=J?.isThreadLocked?be:$e,ve=ae?Me[ae]:null,c=ve?.harness??null,d=ve?.sandbox??null,[w,A]=m.useState(void 0),f=m.useRef(w);f.current=w;const P={selectedModel:z,setModel:()=>{},credentialId:$,setCredentialId:I,allModelsConnections:C,isModelsLoading:W,selectedVirtualMcp:Se,imageModel:u,setImageModel:i=>{o(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:j,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:G,setDeepResearchModel:i=>{g(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:T,setChatMode:q,appContexts:Ce,setAppContext:xe,clearAppContext:he,tiptapDoc:w,setTiptapDoc:A,tiptapDocRef:f,resetInteraction:()=>{},simpleModeTier:_,setSimpleModeTier:i=>Q(i),pendingAgentOption:ae,setPendingAgentOption:ke,pendingHarnessId:c,pendingSandboxProviderKind:d};return U.jsx(Re.Provider,{value:P,children:t})}function In(t){const e=ue.c(41),{virtualMcpId:n,task:s,children:o}=t,{locator:a}=se(),{data:r}=et.useSession(),l=r?.user??null,{taskId:g,virtualMcpId:y,navigateToTask:I}=We(),[T]=tt(),{markTaskRead:q}=Dt(),p=lt(),R=g,Q=y,_=Pt(Q);let C;e[0]!==q||e[1]!==I?(C=(b,x)=>{q(b),I(b,{virtualMcpId:x?.virtualMcpId,autosend:x?.autosend})},e[0]=q,e[1]=I,e[2]=C):C=e[2];const k=C,$=R&&s?.id===R?s:null,S=$?.harness_id??null,K=$?.sandbox_provider_kind??null,H=$?.branch??null,X=S!=null,M=H;let V;e[3]!==M||e[4]!==k||e[5]!==p||e[6]!==n?(V=()=>{const b=crypto.randomUUID();return p.create({id:b,virtual_mcp_id:n,...M?{branch:M}:{}}).then(()=>k(b)).catch(()=>{k(b)}),b},e[3]=M,e[4]=k,e[5]=p,e[6]=n,e[7]=V):V=e[7];const z=V;let W;e[8]!==M||e[9]!==a||e[10]!==k||e[11]!==p||e[12]!==n?(W=b=>{const x=crypto.randomUUID(),G=b.virtualMcpId??n,pe=G===n?M:null;at(sessionStorage,a,x,b.message),p.create({id:x,virtual_mcp_id:G,...pe?{branch:pe}:{}}).then(()=>k(x,{virtualMcpId:b.virtualMcpId,autosend:!0})).catch(()=>{k(x,{virtualMcpId:b.virtualMcpId,autosend:!0})})},e[8]=M,e[9]=a,e[10]=k,e[11]=p,e[12]=n,e[13]=W):W=e[13];const B=W;let F;e[14]!==R||e[15]!==p?(F=b=>{R&&p.setBranch(R,b)},e[14]=R,e[15]=p,e[16]=F):F=e[16];let u;e[17]!==$||e[18]!==z||e[19]!==B||e[20]!==M||e[21]!==R||e[22]!==Q||e[23]!==X||e[24]!==H||e[25]!==S||e[26]!==K||e[27]!==k||e[28]!==F?(u={virtualMcpId:Q,taskId:R,openTask:k,createTask:z,createTaskWithMessage:B,activeTask:$,isThreadLocked:X,lockedHarness:S,lockedSandbox:K,lockedBranch:H,currentBranch:M,setCurrentTaskBranch:F},e[17]=$,e[18]=z,e[19]=B,e[20]=M,e[21]=R,e[22]=Q,e[23]=X,e[24]=H,e[25]=S,e[26]=K,e[27]=k,e[28]=F,e[29]=u):u=e[29];const E=u;let L;e[30]!==_||e[31]!==T||e[32]!==I||e[33]!==l?(L={user:l,contextPrompt:_,preferences:T,rawNavigateToTask:I},e[30]=_,e[31]=T,e[32]=I,e[33]=l,e[34]=L):L=e[34];const Y=L;let j;e[35]!==o||e[36]!==Y?(j=U.jsx(en,{children:U.jsx(ze.Provider,{value:Y,children:o})}),e[35]=o,e[36]=Y,e[37]=j):j=e[37];let N;return e[38]!==j||e[39]!==E?(N=U.jsx(Ae.Provider,{value:E,children:j}),e[38]=j,e[39]=E,e[40]=N):N=e[40],N}function Cn({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:o}=tn();t&&!Oe.has(t)&&(Oe.add(t),Je("chat_opened",{thread_id:t}));const{imageModel:a,webSearchModel:r,deepResearchModel:l,chatMode:g,setChatMode:y,appContexts:I,setTiptapDoc:T,simpleModeTier:q,pendingSandboxProviderKind:p,pendingHarnessId:R}=nn(),Q=m.useContext(ze);if(!Q)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:_,contextPrompt:C,preferences:k,rawNavigateToTask:$}=Q,{org:S,locator:K}=se(),H=zt(),[X,M]=m.useState(null),V=_t(),z=Ne(),W=it(),B=qe(),F=dt({connectionId:pt,orgId:S.id,orgSlug:S.slug}),u=ct(S.slug,t,{client:F});m.use(u.ready);const E=ce(u.messages),L=ce(u.status),Y=ce(u.finishReason),j=ce(u.runStatusStage),N=ce(u.hasMoreOlder),b=ce(u.isFetchingOlder),x=m.useRef({onToolCall:V,queryClient:z,rawNavigateToTask:$,taskId:t,manager:W,navigate:B,orgId:S.id,orgSlug:S.slug});x.current={onToolCall:V,queryClient:z,rawNavigateToTask:$,taskId:t,manager:W,navigate:B,orgId:S.id,orgSlug:S.slug},mt({orgSlug:S.slug,taskId:t,onTaskStatus:c=>{const d=x.current,w=c.data.message_id;if(c.data.status==="in_progress"&&w){Te(d.taskId,w);const A=Ht(d.taskId,w);A&&u.applyLocalMessage(A),Z(d.orgSlug,d.taskId)}Kt(d.taskId)&&(async()=>(await Z(d.orgSlug,d.taskId),await u.reconcileFromServer()&&ye(d.taskId).get().length===0&&Vt(d.taskId)))()}}),m.useEffect(()=>{const c={onData:f=>{if(f.type==="data-thread-title"){const P=f.data;if(!P?.title)return;const i=x.current;if(!i.taskId)return;i.manager.patchThread({id:i.taskId,title:P.title,updated_at:new Date().toISOString()});return}if(f.type==="data-deck-updated"){const P=f.data;if(!P?.path)return;const i=P.path,h=x.current;h.queryClient.invalidateQueries({queryKey:ge.orgFsStat(h.orgId,"home",i)}),h.queryClient.invalidateQueries({queryKey:ge.orgFsRecent(h.orgId)}),h.navigate({to:".",search:D=>({...D,main:yt(i)}),replace:!0});return}},onFinish:(f,P,i)=>{const h=x.current;h.taskId&&Z(h.orgSlug,h.taskId),h.taskId&&h.manager.patchThread({id:h.taskId,status:At(i,f.parts),updated_at:new Date().toISOString()});const D=f.parts?.some(O=>{const re=O;return(re.type==="tool-share_with_user"||re.type==="tool-bash"||re.type==="tool-write")&&re.state==="output-available"});if(h.taskId&&D){const O=ge.threadOutputs(h.taskId);for(const re of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{h.queryClient.invalidateQueries({queryKey:O})},re)}h.queryClient.invalidateQueries({queryKey:ge.homeNextActions(h.orgSlug)});const v=f.metadata?.thread_id;v&&v!==h.taskId&&h.rawNavigateToTask(v)},onError:f=>{M(f),console.error("[chat] Error",f)},onToolCall:f=>x.current.onToolCall(f)};u.observer=c,Z(x.current.orgSlug,x.current.taskId);const d=f=>f==="submitted"||f==="streaming";let w=d(u.status.get().kind);const A=u.status.subscribe(()=>{const f=d(u.status.get().kind);if(f===w)return;w=f;const P=x.current;Z(P.orgSlug,P.taskId)});return()=>{u.observer===c&&(u.observer=null),A()}},[u]);const G=L.kind==="submitted"||L.kind==="streaming",pe=E.length===0,Se=E.at(-1),Ce=!G&&Se?.role==="assistant"&&Se.parts.some(c=>"state"in c&&c.state==="approval-requested"),fe=s,xe=(fe?.status==="in_progress"||fe?.status==="expired")&&L.kind==="ready"&&E.length>0;async function he(c){const d=t,w=n,A=Object.entries(I),f=A.length>0?A.map(([D,v])=>`### App Context: ${D}
24
- ${v}`).join(`
22
+ Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...$e(l,r))}else if(o.attrs.kind==="skill"){const l=o.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Nt(l,r))}else{const l=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(l)&&l.length>0&&"role"in l[0]?e.push(...qt(l,r)):Array.isArray(l)&&e.push(...$e(l,r))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,r=`[file:://${encodeURIComponent(a.name)}]`;n+=r,e.push(...Lt(a,r))}if("content"in o&&Array.isArray(o.content))for(const a of o.content)s(a)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function yn(t){const e=Be(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function Sn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Ft(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function xn(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function jt(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Ut(t,e){return t.filter(n=>n.messageId!==e)}const Pe=new Map,we=new Set;function Qt(t){we.add(t)}function Kt(t){return we.has(t)}function Vt(t){we.delete(t)}function ye(t){let e=Pe.get(t);return e||(e=new rt([]),Pe.set(t,e)),e}function He(t,e){ye(t).update(n=>jt(n,e))}function Te(t,e){ye(t).update(n=>Ut(n,e))}function Wt(t,e){ye(t).set(e)}const Ie=new Map;function Bt(t,e){Ie.set(`${t}:${e.id}`,e)}function Ht(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function De(t,e){Ie.delete(`${t}:${e}`)}async function Z(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Wt(e,s.items??[])}catch{}}function vn(t){const e=ue.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return m.useSyncExternalStore(s.subscribe,s.get,s.get)}function zt(){const{org:t}=se();return{enqueue:He,refresh:e=>Z(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;Te(e,n);try{const o=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!o.ok&&o.status!==404)throw new Error(`Cancel failed: ${o.status}`);return!0}catch(o){return ne.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await Z(t.slug,e)}}}}const Oe=new Set,ee=new Set;function ce(t){return m.useSyncExternalStore(t.subscribe,t.get,t.get)}function Gt(t){return t.kind==="loading"?"ready":t.kind}function te(t,e,n,s){if(!t)return null;const o=e.find(r=>r.id===t.keyId);if(!o)return null;const a=n.find(r=>r.modelId===t.modelId);return a?{...a,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:o.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Zt(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Xt(t,e,n,s){if(!n||s.length===0)return null;const o=e.find(g=>g.id===n);if(!o)return null;const a=wt([o],{[n]:s}),r=t==="fast"?a.chat.fast:t==="thinking"?a.chat.thinking:a.chat.smart;if(!r)return null;const l=s.find(g=>g.modelId===r.modelId);return l?{...l,keyId:n}:null}const Yt=1e4,Jt=10,Ee=m.createContext(null),Ae=m.createContext(null),_e=m.createContext(null),ze=m.createContext(null);function en({children:t}){const{locator:e}=se(),{virtualMcpId:n}=We(),[s,o]=le(de.chatSelectedImageModel(e),null),[a,r]=le(de.chatSelectedWebSearchModel(e),null),[l,g]=le(de.chatSelectedDeepResearchModel(e),null),[S,I]=m.useState(null),[T,N]=m.useState("default"),p=St(),[R,K]=le(de.chatSimpleModeTier(e),null),D=Zt(R),C=ht(),k=p.tiers[D],$=S&&C.some(i=>i.id===S)?S:k?.keyId??C[0]?.id??null,{models:x,isLoading:V}=me($??void 0),{models:H}=me(k?.keyId),{models:X}=me(p.tiers.image?.keyId),{models:M}=me(p.tiers.web_search?.keyId),{models:W}=me(p.tiers.deep_research?.keyId),z=te(k,C,H,k?.title)??Xt(D,C,$,x),q=V,B=x.filter(i=>i.capabilities?.includes("image")),F=te(s,C,B),u=te(p.tiers.image,C,X,p.tiers.image?.title)??F??B[0]??null,E=x.filter(Ke),O=te(a,C,E),Y=E.find(i=>i.modelId==="perplexity/sonar")??E[0]??null,j=te(p.tiers.web_search,C,M,p.tiers.web_search?.title)??O??Y,L=x.filter(Ve),b=te(l,C,L),v=L.find(i=>i.modelId==="perplexity/deep-research")??L.find(i=>i.asyncResearch===!0)??L[0]??null,G=te(p.tiers.deep_research,C,W,p.tiers.deep_research?.title)??b??v,Se=ft(n)??{id:n,title:"",description:null,icon:null},[Ce,fe]=m.useState({}),xe=(i,h)=>{const U=[];for(const y of h.content??[])y.type==="text"&&y.text?.trim()&&U.push(y.text.trim());const _=U.join(`
23
+ `);if(!_){he(i);return}new TextEncoder().encode(_).length>Yt||fe(y=>Object.keys(y).length>=Jt&&!(i in y)?y:{...y,[i]:_})},he=i=>{fe(h=>{const{[i]:U,..._}=h;return _})},[oe,ke]=le(de.chatLastAgentOption(e),i=>i&&i in Me?i:null),J=sn(),be=J?.isThreadLocked&&J.lockedHarness!=null?_t(J.lockedHarness,J.lockedSandbox):null,Re=oe,ae=J?.isThreadLocked?be:Re,ve=ae?Me[ae]:null,c=ve?.harness??null,d=ve?.sandbox??null,[w,A]=m.useState(void 0),f=m.useRef(w);f.current=w;const P={selectedModel:z,setModel:()=>{},credentialId:$,setCredentialId:I,allModelsConnections:C,isModelsLoading:q,selectedVirtualMcp:Se,imageModel:u,setImageModel:i=>{o(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:j,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:G,setDeepResearchModel:i=>{g(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:T,setChatMode:N,appContexts:Ce,setAppContext:xe,clearAppContext:he,tiptapDoc:w,setTiptapDoc:A,tiptapDocRef:f,resetInteraction:()=>{},simpleModeTier:D,setSimpleModeTier:i=>K(i),pendingAgentOption:ae,setPendingAgentOption:ke,pendingHarnessId:c,pendingSandboxProviderKind:d};return Q.jsx(_e.Provider,{value:P,children:t})}function In(t){const e=ue.c(41),{virtualMcpId:n,task:s,children:o}=t,{locator:a}=se(),{data:r}=et.useSession(),l=r?.user??null,{taskId:g,virtualMcpId:S,navigateToTask:I}=We(),[T]=tt(),{markTaskRead:N}=Dt(),p=lt(),R=g,K=S,D=$t(K);let C;e[0]!==N||e[1]!==I?(C=(b,v)=>{N(b),I(b,{virtualMcpId:v?.virtualMcpId,autosend:v?.autosend})},e[0]=N,e[1]=I,e[2]=C):C=e[2];const k=C,$=R&&s?.id===R?s:null,x=$?.harness_id??null,V=$?.sandbox_provider_kind??null,H=$?.branch??null,X=x!=null,M=H;let W;e[3]!==M||e[4]!==k||e[5]!==p||e[6]!==n?(W=()=>{const b=crypto.randomUUID();return p.create({id:b,virtual_mcp_id:n,...M?{branch:M}:{}}).then(()=>k(b)).catch(()=>{k(b)}),b},e[3]=M,e[4]=k,e[5]=p,e[6]=n,e[7]=W):W=e[7];const z=W;let q;e[8]!==M||e[9]!==a||e[10]!==k||e[11]!==p||e[12]!==n?(q=b=>{const v=crypto.randomUUID(),G=b.virtualMcpId??n,pe=G===n?M:null;at(sessionStorage,a,v,b.message),p.create({id:v,virtual_mcp_id:G,...pe?{branch:pe}:{}}).then(()=>k(v,{virtualMcpId:b.virtualMcpId,autosend:!0})).catch(()=>{k(v,{virtualMcpId:b.virtualMcpId,autosend:!0})})},e[8]=M,e[9]=a,e[10]=k,e[11]=p,e[12]=n,e[13]=q):q=e[13];const B=q;let F;e[14]!==R||e[15]!==p?(F=b=>{R&&p.setBranch(R,b)},e[14]=R,e[15]=p,e[16]=F):F=e[16];let u;e[17]!==$||e[18]!==z||e[19]!==B||e[20]!==M||e[21]!==R||e[22]!==K||e[23]!==X||e[24]!==H||e[25]!==x||e[26]!==V||e[27]!==k||e[28]!==F?(u={virtualMcpId:K,taskId:R,openTask:k,createTask:z,createTaskWithMessage:B,activeTask:$,isThreadLocked:X,lockedHarness:x,lockedSandbox:V,lockedBranch:H,currentBranch:M,setCurrentTaskBranch:F},e[17]=$,e[18]=z,e[19]=B,e[20]=M,e[21]=R,e[22]=K,e[23]=X,e[24]=H,e[25]=x,e[26]=V,e[27]=k,e[28]=F,e[29]=u):u=e[29];const E=u;let O;e[30]!==D||e[31]!==T||e[32]!==I||e[33]!==l?(O={user:l,contextPrompt:D,preferences:T,rawNavigateToTask:I},e[30]=D,e[31]=T,e[32]=I,e[33]=l,e[34]=O):O=e[34];const Y=O;let j;e[35]!==o||e[36]!==Y?(j=Q.jsx(en,{children:Q.jsx(ze.Provider,{value:Y,children:o})}),e[35]=o,e[36]=Y,e[37]=j):j=e[37];let L;return e[38]!==j||e[39]!==E?(L=Q.jsx(Ae.Provider,{value:E,children:j}),e[38]=j,e[39]=E,e[40]=L):L=e[40],L}function Cn({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:o}=tn();t&&!Oe.has(t)&&(Oe.add(t),Je("chat_opened",{thread_id:t}));const{imageModel:a,webSearchModel:r,deepResearchModel:l,chatMode:g,setChatMode:S,appContexts:I,setTiptapDoc:T,simpleModeTier:N,pendingSandboxProviderKind:p,pendingHarnessId:R}=nn(),K=m.useContext(ze);if(!K)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:D,contextPrompt:C,preferences:k,rawNavigateToTask:$}=K,{org:x,locator:V}=se(),H=zt(),[X,M]=m.useState(null),W=Pt(),z=Ne(),q=it(),B=qe(),F=dt({connectionId:pt,orgId:x.id,orgSlug:x.slug}),u=ct(x.slug,t,{client:F});m.use(u.ready);const E=ce(u.messages),O=ce(u.status),Y=ce(u.finishReason),j=ce(u.runStatusStage),L=ce(u.hasMoreOlder),b=ce(u.isFetchingOlder),v=m.useRef({onToolCall:W,queryClient:z,rawNavigateToTask:$,taskId:t,manager:q,navigate:B,orgId:x.id,orgSlug:x.slug});v.current={onToolCall:W,queryClient:z,rawNavigateToTask:$,taskId:t,manager:q,navigate:B,orgId:x.id,orgSlug:x.slug},mt({orgSlug:x.slug,taskId:t,onTaskStatus:c=>{const d=v.current,w=c.data.message_id;if(c.data.status==="in_progress"&&w){Te(d.taskId,w);const A=Ht(d.taskId,w);A&&u.applyLocalMessage(A),Z(d.orgSlug,d.taskId)}Kt(d.taskId)&&(async()=>(await Z(d.orgSlug,d.taskId),await u.reconcileFromServer()&&ye(d.taskId).get().length===0&&Vt(d.taskId)))()}}),m.useEffect(()=>{const c={onData:f=>{if(f.type==="data-thread-title"){const P=f.data;if(!P?.title)return;const i=v.current;if(!i.taskId)return;i.manager.patchThread({id:i.taskId,title:P.title,updated_at:new Date().toISOString()});return}if(f.type==="data-deck-updated"){const P=f.data;if(!P?.path)return;const i=P.path,h=v.current;h.queryClient.invalidateQueries({queryKey:ge.orgFsStat(h.orgId,"home",i)}),h.queryClient.invalidateQueries({queryKey:ge.orgFsRecent(h.orgId)}),h.navigate({to:".",search:U=>({...U,main:yt(i)}),replace:!0});return}},onFinish:(f,P,i)=>{const h=v.current;h.taskId&&Z(h.orgSlug,h.taskId),h.taskId&&h.manager.patchThread({id:h.taskId,status:At(i,f.parts),updated_at:new Date().toISOString()});const U=f.parts?.some(y=>{const re=y;return(re.type==="tool-share_with_user"||re.type==="tool-bash"||re.type==="tool-write")&&re.state==="output-available"});if(h.taskId&&U){const y=ge.threadOutputs(h.taskId);for(const re of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{h.queryClient.invalidateQueries({queryKey:y})},re)}h.queryClient.invalidateQueries({queryKey:ge.homeNextActions(h.orgSlug)});const _=f.metadata?.thread_id;_&&_!==h.taskId&&h.rawNavigateToTask(_)},onError:f=>{M(f),console.error("[chat] Error",f)},onToolCall:f=>v.current.onToolCall(f)};u.observer=c,Z(v.current.orgSlug,v.current.taskId);const d=f=>f==="submitted"||f==="streaming";let w=d(u.status.get().kind);const A=u.status.subscribe(()=>{const f=d(u.status.get().kind);if(f===w)return;w=f;const P=v.current;Z(P.orgSlug,P.taskId)});return()=>{u.observer===c&&(u.observer=null),A()}},[u]);const G=O.kind==="submitted"||O.kind==="streaming",pe=E.length===0,Se=E.at(-1),Ce=!G&&Se?.role==="assistant"&&Se.parts.some(c=>"state"in c&&c.state==="approval-requested"),fe=s,xe=(fe?.status==="in_progress"||fe?.status==="expired")&&O.kind==="ready"&&E.length>0;async function he(c){const d=t,w=n,A=Object.entries(I),f=A.length>0?A.map(([_,y])=>`### App Context: ${_}
24
+ ${y}`).join(`
25
25
 
26
26
  `):"",P=[C,f].filter(Boolean).join(`
27
27
 
28
- `);let i=g;i==="gen-image"&&!a&&(i="default"),i==="web-search"&&!r&&(i="default"),i==="deep-research"&&!l&&(i="default"),(i==="web-search"||i==="deep-research")&&y("default");const h={tier:q,mode:i,toolApprovalLevel:k.toolApprovalLevel??nt(),system:P||void 0,agent:{id:w},thread_id:d,...$t({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:R??void 0,sandboxProviderKind:p??void 0,branch:o}})};try{if(G||xe){let D=!0;try{Bt(d,c),await u.enqueue(c,h),He(d,{workflowId:`thread-run:${d}:${c.id}`,messageId:c.id,text:Ft(c.parts),hasAttachments:c.parts.some(v=>v.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Qt(d)}catch(v){D=!1,De(d,c.id),Te(d,c.id),M(v instanceof Error?v:new Error(String(v))),ne.error(v instanceof Error?v.message:"Failed to queue message")}return Z(S.slug,d),D}return await u.submit({kind:"message",message:c},h),!0}finally{ee.delete(d)}}async function oe(c){const d=c.parts??Be(c.tiptapDoc);if(d.length===0||ee.has(t))return;ee.add(t),M(null),T(void 0);const w={tiptapDoc:c.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:_?.image??void 0,name:_?.name??"you"}},A={id:crypto.randomUUID(),role:"user",parts:d,metadata:w};await he(A)}async function ke(c,d){if(ee.has(t))return ne.info("Still sending your previous message — try again in a moment"),!1;if(ee.add(t),!await H.cancel(t,c))return ee.delete(t),ne.error("Couldn't remove the original message"),!1;De(t,c),u.removeLocalMessage(c);const A={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:d}],metadata:{created_at:new Date().toISOString(),user:{avatar:_?.image??void 0,name:_?.name??"you"}}};try{return await he(A)}catch(f){return ne.error(f instanceof Error?f.message:"Failed to send edited message"),!1}}const J=async()=>{u.stop();try{const c=await fetch(`/api/${S.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(c.status===404)return;if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.message??`Cancel failed: ${c.status}`)}}catch(c){const d=c instanceof Error?c.message:"Failed to cancel";ne.error(d),console.error("[chat] cancelRun",c)}},be=c=>c&&typeof c=="object"&&"type"in c?oe({tiptapDoc:c}):oe(c),ae=Fe({strict:!1}).autosend===je;m.useEffect(()=>{if(!ae||E.length>0)return;const c=st(sessionStorage,K,t);c&&oe(c.message).then(()=>{ot(sessionStorage,K,t)})},[ae,E.length,K,t,oe]);const ve={messages:E,status:Gt(L),sendMessage:be,editQueuedMessage:ke,stop:()=>{J()},submit:(c,d)=>u.submit(c,d),removeLocalMessage:c=>u.removeLocalMessage(c),isSendInFlight:()=>ee.has(t),error:X,clearError:()=>M(null),finishReason:Y,runStatusStage:j,clearFinishReason:()=>u.finishReason.set(null),isStreaming:G,isChatEmpty:pe,isWaitingForApprovals:Ce??!1,isRunInProgress:xe,hasMoreOlder:N,isFetchingOlder:b,fetchOlderMessages:u.fetchOlderMessages.bind(u)};return U.jsx(Ee.Provider,{value:ve,children:e})}function kn(){const t=m.useContext(Ee);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function bn(){return m.useContext(Ee)}function tn(){const t=m.useContext(Ae);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function nn(){const t=m.useContext(Re);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function Mn(){return m.useContext(Re)}function sn(){return m.useContext(Ae)}export{Cn as A,en as C,mn as S,kn as a,sn as b,tn as c,vn as d,zt as e,De as f,bn as g,In as h,Sn as i,Be as j,We as k,Mn as l,Ke as m,Ve as n,wt as o,gn as p,xn as s,yn as t,nn as u};
28
+ `);let i=g;i==="gen-image"&&!a&&(i="default"),i==="web-search"&&!r&&(i="default"),i==="deep-research"&&!l&&(i="default"),(i==="web-search"||i==="deep-research")&&S("default");const h=Rt({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:R??void 0,sandboxProviderKind:p??void 0,branch:o}});s?.harness_id||q.patchThread({id:d,harness_id:h.harnessId??"decopilot",sandbox_provider_kind:h.sandboxProviderKind??null,updated_at:new Date().toISOString()});const U={tier:N,mode:i,toolApprovalLevel:k.toolApprovalLevel??nt(),system:P||void 0,agent:{id:w},thread_id:d,...h};try{if(G||xe){let _=!0;try{Bt(d,c),await u.enqueue(c,U),He(d,{workflowId:`thread-run:${d}:${c.id}`,messageId:c.id,text:Ft(c.parts),hasAttachments:c.parts.some(y=>y.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Qt(d)}catch(y){_=!1,De(d,c.id),Te(d,c.id),M(y instanceof Error?y:new Error(String(y))),ne.error(y instanceof Error?y.message:"Failed to queue message")}return Z(x.slug,d),_}return await u.submit({kind:"message",message:c},U),!0}finally{ee.delete(d)}}async function oe(c){const d=c.parts??Be(c.tiptapDoc);if(d.length===0||ee.has(t))return;ee.add(t),M(null),T(void 0);const w={tiptapDoc:c.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:D?.image??void 0,name:D?.name??"you"}},A={id:crypto.randomUUID(),role:"user",parts:d,metadata:w};await he(A)}async function ke(c,d){if(ee.has(t))return ne.info("Still sending your previous message — try again in a moment"),!1;if(ee.add(t),!await H.cancel(t,c))return ee.delete(t),ne.error("Couldn't remove the original message"),!1;De(t,c),u.removeLocalMessage(c);const A={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:d}],metadata:{created_at:new Date().toISOString(),user:{avatar:D?.image??void 0,name:D?.name??"you"}}};try{return await he(A)}catch(f){return ne.error(f instanceof Error?f.message:"Failed to send edited message"),!1}}const J=async()=>{u.stop();try{const c=await fetch(`/api/${x.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(c.status===404)return;if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.message??`Cancel failed: ${c.status}`)}}catch(c){const d=c instanceof Error?c.message:"Failed to cancel";ne.error(d),console.error("[chat] cancelRun",c)}},be=c=>c&&typeof c=="object"&&"type"in c?oe({tiptapDoc:c}):oe(c),ae=Fe({strict:!1}).autosend===je;m.useEffect(()=>{if(!ae||E.length>0)return;const c=st(sessionStorage,V,t);c&&oe(c.message).then(()=>{ot(sessionStorage,V,t)})},[ae,E.length,V,t,oe]);const ve={messages:E,status:Gt(O),sendMessage:be,editQueuedMessage:ke,stop:()=>{J()},submit:(c,d)=>u.submit(c,d),removeLocalMessage:c=>u.removeLocalMessage(c),isSendInFlight:()=>ee.has(t),error:X,clearError:()=>M(null),finishReason:Y,runStatusStage:j,clearFinishReason:()=>u.finishReason.set(null),isStreaming:G,isChatEmpty:pe,isWaitingForApprovals:Ce??!1,isRunInProgress:xe,hasMoreOlder:L,isFetchingOlder:b,fetchOlderMessages:u.fetchOlderMessages.bind(u)};return Q.jsx(Ee.Provider,{value:ve,children:e})}function kn(){const t=m.useContext(Ee);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function bn(){return m.useContext(Ee)}function tn(){const t=m.useContext(Ae);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function nn(){const t=m.useContext(_e);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function Mn(){return m.useContext(_e)}function sn(){return m.useContext(Ae)}export{Cn as A,en as C,mn as S,kn as a,sn as b,tn as c,vn as d,zt as e,De as f,bn as g,In as h,Sn as i,Be as j,We as k,Mn as l,Ke as m,Ve as n,wt as o,gn as p,xn as s,yn as t,nn as u};
@@ -1 +1 @@
1
- import{c as n,l as d,j as c,bA as l,bB as b}from"./index-ByOvX_ve.js";import{i as m}from"./Check-s3en6K6a.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
1
+ import{c as n,l as d,j as c,bA as l,bB as b}from"./index-BYp7Ofgs.js";import{i as m}from"./Check-BvrjRK-f.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
@@ -1 +1 @@
1
- import{c as a,a as c,r as m,j as o}from"./index-ByOvX_ve.js";import{A as u}from"./auth-split-layout-D3EcXAD7.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
1
+ import{c as a,a as c,r as m,j as o}from"./index-BYp7Ofgs.js";import{A as u}from"./auth-split-layout-Dhzw613v.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
@@ -1 +1 @@
1
- import{c as O,j as t,B as F,i as Y,G as Ge,H as te,P as Pe,r as $,Z as re,J as Qe,u as Ye,a7 as K,t as Ze,l as je,e as le,aW as ke}from"./index-ByOvX_ve.js";import{E as Ae}from"./empty-state-CSs6-Bdi.js";import{u as Xe,a as Ee}from"./use-collections-b46PF-FB.js";import{u as ae}from"./use-mcp-client-u24P-s4P.js";import{F as se,a as et,b as ce,d as de}from"./form-BB8De_xV.js";import{I as me}from"./input-Bt7D33rg.js";import{T as ie}from"./textarea-BYx7whqS.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-_3KKuOg4.js";import{aq as it,L as rt,am as lt,$ as at,ac as ct,ar as dt,V as be}from"./agent-icon-N5U1HeY1.js";import{g as mt,M as ut,a as Ne}from"./types-CcSVLYhO.js";import{A as xt,a as pt,b as ft}from"./alert-Bdmkn5IA.js";import{a as ve,c as Se,d as ye,S as we,b as ne}from"./select-8JaYnS6d.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-B3P4mjnJ.js";import{i as gt}from"./AlertCircle-DQZIoZK3.js";import{s as jt}from"./Stars02-zuQltjIB.js";import{a as bt}from"./Copy01-CIuFqZaz.js";import{i as Nt}from"./Play-C-6p0BcA.js";import{a as Oe,b as Re,B as J,c as G,d as Q,e as _e}from"./breadcrumb-Dx2G4VO9.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-DlkGTda2.js";import{a as De,u as Me}from"./use-connection-DeGbigio.js";import{a as wt}from"./use-mcp-tools-CocIQ7qB.js";import{M as Ct,c as It}from"./monaco-editor-CbUVJEKg.js";import{I as Te}from"./integration-icon-C5KirdUg.js";import{g as $t,l as Tt}from"./chat-context-CDLyvKdU.js";import{u as Pt}from"./shell-layout-k2JSKYlm.js";import{n as kt}from"./XCircle-D680rHaa.js";import"./constants-B72Xmt_K.js";import"./auth-DLezYwI7.js";import"./label-BxgEeCbJ.js";import"./index-B_a3RFg9.js";import"./sidebar-C761eQb1.js";import"./LayoutLeft-BuFW-ud0.js";import"./use-mobile-C93OYfHB.js";import"./X-B4fK1PSH.js";import"./ZoomOut-Dt1IXaRq.js";import"./Key01-BuAYoLgF.js";import"./extract-connection-data-mdwVf3Kr.js";import"./use-registry-connections-D8Q8D5kz.js";import"./use-organization-settings-EwmFXWWf.js";import"./studio-tools-CgfSo7j_.js";import"./Plus-DI8G3hjD.js";import"./index-C0ZnJYy-.js";import"./index-C0ZQYTpQ.js";import"./index-SAeZ5DI1.js";import"./popover-DzPhoKNT.js";import"./use-virtual-mcp-Bc6ku1ke.js";import"./Check-s3en6K6a.js";import"./SearchMd-BK3G07RD.js";import"./Users03-Ba1rCL5_.js";import"./use-create-virtual-mcp-B-FWLpM6.js";import"./use-navigate-to-agent-DjAWkSGL.js";import"./hooks-CksaF-ej.js";import"./decopilot-sse-pool-BOi7-S8l.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-qqWu133U.js";import"./Tool01-CTeGQUqF.js";import"./SwitchHorizontal01-Cw76bjm8.js";import"./Settings02-Cc5NwEaN.js";import"./ArrowUpRight-BXPXISIu.js";import"./ZapSquare-BjByOqyA.js";import"./Loading02-CLjf_mWB.js";import"./CheckCircle-6oFE8RZY.js";import"./ChevronDown-DfbvlHGm.js";import"./ChevronRight-BbMxA_we.js";import"./ChevronUp-CSojtzH5.js";import"./Circle-4U8mdxgJ.js";import"./DotsVertical-CcXsbxkI.js";import"./Globe01-CdJefkBr.js";import"./Eye-C-Ii0MmZ.js";import"./FilterLines-CRqtZMw9.js";import"./Star01-CWyyx_CI.js";import"./Globe04-BrDmMJuA.js";import"./HardDrive-C1TfsRRw.js";import"./LinkExternal01-DMcxPOk0.js";import"./List-Dg43Ye3O.js";import"./Monitor01-DP1X3LaS.js";import"./Sun-Cm9IedwX.js";import"./Palette-6OTpcgOT.js";import"./SearchLg-CeBJHSxD.js";import"./Shield01-CSmFJ1RP.js";import"./Stars01-CNNiBNAJ.js";import"./Trash01-CeLlU9Hr.js";import"./Upload01-DeL5atjC.js";import"./User01-CVy-WVkE.js";import"./Users01-gmVxoI-k.js";import"./XClose-DZ-fbd9x.js";import"./Zap-CHM8jc7i.js";import"./mcp-oauth-CL0sljW9.js";import"./badge-DdUP-taI.js";import"./index-BgeQc437.js";import"./autosend-e3cesngm.js";import"./use-ai-providers-CprIzBUo.js";import"./use-decopilot-events-BLTRVndf.js";import"./tab-id-yjGvxWDL.js";import"./avatar-0pAXOhlp.js";import"./dialog-C1_sXCgH.js";import"./alert-dialog-DQf3rZVT.js";import"./required-auth-layout-BjrbsMWm.js";import"./use-org-sso-CFBLq8qg.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Dt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Xe(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function zt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const Lt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=De(e),N=$t(),A=Tt(),{setChatOpen:U}=Pt(),z=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),L=wt({client:_}),j=L.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),V=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=$.useState("json"),[ze,Le]=$.useState(!1);E&&!ze&&(Z("ui"),Le(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const X=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const ge=Number(h[M]);Number.isNaN(ge)||(h[M]=ge)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),We=Math.round(He-a);p(W),g(v),C(h);const Ke=JSON.stringify(W),he=new TextEncoder().encode(Ke).length;y({duration:`${We}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const W=performance.now();y({duration:`${Math.round(W-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??Lt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:X(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>A?.setAppContext(z,a),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!De(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:zt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=Me(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=Me(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Wt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let z;s[24]!==P?(z=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(y){let D;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(D=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let V;return s[38]!==L||s[39]!==E?(V=t.jsx(ue,{breadcrumb:L,children:E}),s[38]=L,s[39]=E,s[40]=V):V=s[40],V}function Gt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[2]=i):i=s[2],i}function Jn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Jn as default};
1
+ import{c as O,j as t,B as F,i as Y,G as Ge,H as te,P as Pe,r as $,Z as re,J as Qe,u as Ye,a7 as K,t as Ze,l as je,e as le,aW as ke}from"./index-BYp7Ofgs.js";import{E as Ae}from"./empty-state-Ds7boKzG.js";import{u as Xe,a as Ee}from"./use-collections-CQ-DHlk8.js";import{u as ae}from"./use-mcp-client-DNdH0vv7.js";import{F as se,a as et,b as ce,d as de}from"./form-uObUvJsx.js";import{I as me}from"./input-C7dZO9ym.js";import{T as ie}from"./textarea-ChqR5uQR.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-DV-YI8KM.js";import{aq as it,L as rt,am as lt,$ as at,ac as ct,ar as dt,V as be}from"./agent-icon-Cg17MSXd.js";import{g as mt,M as ut,a as Ne}from"./types-Br8gG1Yy.js";import{A as xt,a as pt,b as ft}from"./alert-CH-ji8jT.js";import{a as ve,c as Se,d as ye,S as we,b as ne}from"./select-G_YqOyoi.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-DB1pbaN7.js";import{i as gt}from"./AlertCircle-DnAYXfMU.js";import{s as jt}from"./Stars02-CxeSSA7g.js";import{a as bt}from"./Copy01-CrUgsJcD.js";import{i as Nt}from"./Play-lmf5c9Jo.js";import{a as Oe,b as Re,B as J,c as G,d as Q,e as _e}from"./breadcrumb-CyK1O4L9.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-BwElXZDI.js";import{a as De,u as Me}from"./use-connection-BL3pH0HU.js";import{a as wt}from"./use-mcp-tools-Bi-2En16.js";import{M as Ct,c as It}from"./monaco-editor-bcLWH9Yf.js";import{I as Te}from"./integration-icon-FGiS_d1C.js";import{g as $t,l as Tt}from"./chat-context-BD7KZRIw.js";import{u as Pt}from"./shell-layout-CmMDmGXk.js";import{n as kt}from"./XCircle-DhEfH4xa.js";import"./constants-B72Xmt_K.js";import"./auth-D3gb8a1G.js";import"./label-C1WcZg4i.js";import"./index-D49TFDgG.js";import"./sidebar-DXJheAJA.js";import"./LayoutLeft-DfWu_TMe.js";import"./use-mobile-DMdcKVFD.js";import"./X-B11_-bWv.js";import"./ZoomOut-COjlHAto.js";import"./Key01-7XhjBNK3.js";import"./extract-connection-data-BjQiSug0.js";import"./use-registry-connections-B0FZfkFl.js";import"./use-organization-settings-1kZ641DK.js";import"./studio-tools-D970x90m.js";import"./Plus-DK37ytOg.js";import"./index-DLj7x7R3.js";import"./index-B4fQG-zs.js";import"./index-CRGi0rZP.js";import"./popover-CxakTUJX.js";import"./use-virtual-mcp-DHTVzUmN.js";import"./Check-BvrjRK-f.js";import"./SearchMd-DbAiVRZR.js";import"./Users03-BjPo5EJz.js";import"./use-create-virtual-mcp-CEL5Dbuw.js";import"./use-navigate-to-agent-cynSQiRw.js";import"./hooks-D0_F2fuV.js";import"./decopilot-sse-pool-mwjxYiq3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-qqWu133U.js";import"./Tool01-Do_IYkhs.js";import"./SwitchHorizontal01-CTmNw19f.js";import"./Settings02-N3uovfLI.js";import"./ArrowUpRight-TtNUPTQB.js";import"./ZapSquare-D9UGTwX8.js";import"./Loading02-ye_m_QAK.js";import"./CheckCircle-C6nWvFHV.js";import"./ChevronDown-DYHTINZW.js";import"./ChevronRight-Bl9YVPs6.js";import"./ChevronUp-B18hle8l.js";import"./Circle-DPVk1czd.js";import"./DotsVertical-BndxtaEo.js";import"./Globe01-BoyjWYdB.js";import"./Eye-ClTWumnI.js";import"./FilterLines-CTf9rlZx.js";import"./Star01-CVz_7GBv.js";import"./Globe04-Cu0R3oaF.js";import"./HardDrive-PM-PT0eV.js";import"./LinkExternal01-C1Hc9Rj3.js";import"./List-BSXYor2Z.js";import"./Monitor01-CWCFfYgZ.js";import"./Sun-e9bFqj0N.js";import"./Palette-DpDs-Lap.js";import"./SearchLg-ox88sikc.js";import"./Shield01-CGCJBA4k.js";import"./Stars01-D6zQVCEN.js";import"./Trash01-DPHj7EPF.js";import"./Upload01-H4u3fcTc.js";import"./User01-GIEDPABY.js";import"./Users01-hbEK4T_M.js";import"./XClose-7c8y3nr7.js";import"./Zap-C6zrTK7v.js";import"./mcp-oauth-D_BuxJo5.js";import"./badge-9NVu_VdI.js";import"./index-BhkyjzCF.js";import"./autosend-Ci7tspr4.js";import"./use-ai-providers-KkX2eDSF.js";import"./use-decopilot-events-FMOjcbHA.js";import"./tab-id-yjGvxWDL.js";import"./avatar-pA-6XVGw.js";import"./dialog-1Eqcgb9h.js";import"./alert-dialog-DCVvUTHg.js";import"./required-auth-layout-DQ3D6qQS.js";import"./use-org-sso-B7dq-Mnj.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Dt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Xe(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function zt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const Lt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=De(e),N=$t(),A=Tt(),{setChatOpen:U}=Pt(),z=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),L=wt({client:_}),j=L.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),V=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=$.useState("json"),[ze,Le]=$.useState(!1);E&&!ze&&(Z("ui"),Le(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const X=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const ge=Number(h[M]);Number.isNaN(ge)||(h[M]=ge)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),We=Math.round(He-a);p(W),g(v),C(h);const Ke=JSON.stringify(W),he=new TextEncoder().encode(Ke).length;y({duration:`${We}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const W=performance.now();y({duration:`${Math.round(W-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??Lt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:X(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>A?.setAppContext(z,a),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!De(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:zt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=Me(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=Me(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Wt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let z;s[24]!==P?(z=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(y){let D;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(D=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let V;return s[38]!==L||s[39]!==E?(V=t.jsx(ue,{breadcrumb:L,children:E}),s[38]=L,s[39]=E,s[40]=V):V=s[40],V}function Gt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[2]=i):i=s[2],i}function Jn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Jn as default};
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-ByOvX_ve.js";import{c as z,b as _,D as $,a as E}from"./dropdown-menu-BXGfrSiX.js";import{i as L,n as O,b as R,c as A}from"./SwitchHorizontal01-Cw76bjm8.js";import{i as S}from"./Check-s3en6K6a.js";import{i as F}from"./List-Dg43Ye3O.js";import{a as I,b as K,c as P,T as W}from"./tooltip-B3P4mjnJ.js";import{V as q}from"./view-mode-toggle-BDMYTtyJ.js";import{B as G}from"./badge-DdUP-taI.js";function re(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(F,{})},{value:"cards",icon:s.jsx(A,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{re as C};
1
+ import{c as B,j as s,l as M,B as V}from"./index-BYp7Ofgs.js";import{c as z,b as _,D as $,a as E}from"./dropdown-menu-DQljEt7c.js";import{i as L,n as O,b as R,c as A}from"./SwitchHorizontal01-CTmNw19f.js";import{i as S}from"./Check-BvrjRK-f.js";import{i as F}from"./List-BSXYor2Z.js";import{a as I,b as K,c as P,T as W}from"./tooltip-DB1pbaN7.js";import{V as q}from"./view-mode-toggle-sTfLeCKf.js";import{B as G}from"./badge-9NVu_VdI.js";function re(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(F,{})},{value:"cards",icon:s.jsx(A,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{re as C};
@@ -1 +1 @@
1
- import{c as v,l as b,j as a,i as w}from"./index-ByOvX_ve.js";import{i as C}from"./SearchMd-BK3G07RD.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
1
+ import{c as v,l as b,j as a,i as w}from"./index-BYp7Ofgs.js";import{i as C}from"./SearchMd-DbAiVRZR.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
@@ -1 +1 @@
1
- import{c as k,j as s,l as C}from"./index-ByOvX_ve.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-CDz46PoK.js";import{i as D,n as E}from"./SwitchHorizontal01-Cw76bjm8.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
1
+ import{c as k,j as s,l as C}from"./index-BYp7Ofgs.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-UT3NTBNO.js";import{i as D,n as E}from"./SwitchHorizontal01-CTmNw19f.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
@@ -1 +1 @@
1
- import{c as f,l as u,j as m}from"./index-ByOvX_ve.js";import{B as g}from"./badge-DdUP-taI.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{c as f,l as u,j as m}from"./index-BYp7Ofgs.js";import{B as g}from"./badge-9NVu_VdI.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{c as d,l as i,j as n}from"./index-ByOvX_ve.js";import{_ as m}from"./index-SAeZ5DI1.js";import{e as k,a as N,b as j,c as b,d as w}from"./dialog-C1_sXCgH.js";import{i as y}from"./SearchMd-BK3G07RD.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,B as f,S as g};
1
+ import{c as d,l as i,j as n}from"./index-BYp7Ofgs.js";import{_ as m}from"./index-CRGi0rZP.js";import{e as k,a as N,b as j,c as b,d as w}from"./dialog-1Eqcgb9h.js";import{i as y}from"./SearchMd-DbAiVRZR.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,B as f,S as g};