decocms 4.3.0 → 4.4.0

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 (249) hide show
  1. package/dist/client/assets/{AlertCircle-DC-zDzV-.js → AlertCircle-CM6D9elR.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-OJZisFPQ.js → ArrowUpRight-Kqa5fEjt.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Cgnheu-R.js → CheckCircle-8DKF8Yx5.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DyHvxYlc.js → ChevronDown-DGuR7uUZ.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-Cpfh3gza.js → ChevronRight-BswIt99A.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-DBpw6M-L.js → ChevronUp-DSdWQUoR.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-5jSu3d1f.js → DotsVertical-DSosYpI1.js} +1 -1
  8. package/dist/client/assets/{Eye-bojNLUjA.js → Eye-Dn1AISrx.js} +1 -1
  9. package/dist/client/assets/{FilterLines-CFl65nng.js → FilterLines-CmWI-8pG.js} +1 -1
  10. package/dist/client/assets/{Globe01-CyfpzbeQ.js → Globe01-CcXDI4W7.js} +1 -1
  11. package/dist/client/assets/{Globe04-DFpdKSRI.js → Globe04-B9Btoycr.js} +1 -1
  12. package/dist/client/assets/{HardDrive-B1mtnaeA.js → HardDrive-BqXWgcmp.js} +1 -1
  13. package/dist/client/assets/{Key01-CwrJlZo0.js → Key01-F6-x7vNY.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-fsm0LcB8.js → LayoutLeft-DpqtgcH3.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-BHwVyDja.js → LinkExternal01-DOU6-C1w.js} +1 -1
  16. package/dist/client/assets/{Monitor01-ChA6ov2I.js → Monitor01-SkSQUhmT.js} +1 -1
  17. package/dist/client/assets/{Palette-DusYqL0W.js → Palette-CnoObDqZ.js} +1 -1
  18. package/dist/client/assets/{Play-CnXG8qqP.js → Play-DzGcMRv3.js} +1 -1
  19. package/dist/client/assets/{Plus-eGxBB1d8.js → Plus-DDlkoJBs.js} +1 -1
  20. package/dist/client/assets/{SearchLg-CDpA_lbT.js → SearchLg-CdT_y89m.js} +1 -1
  21. package/dist/client/assets/{SearchMd-ujiTPCmg.js → SearchMd-UY2xUREv.js} +1 -1
  22. package/dist/client/assets/{Settings02-BcAnTzm5.js → Settings02-QyYEyYyn.js} +1 -1
  23. package/dist/client/assets/{Shield01-ZxmFmrvL.js → Shield01-V8b5EFFL.js} +1 -1
  24. package/dist/client/assets/{Star01-DHEkWySe.js → Star01-GVe4t6O1.js} +1 -1
  25. package/dist/client/assets/{Stars01-BdCaKqhF.js → Stars01-BIVPeWqS.js} +1 -1
  26. package/dist/client/assets/{Stars02-qnq-_X9g.js → Stars02-DVZm69DV.js} +1 -1
  27. package/dist/client/assets/{Sun-lTiqxOzH.js → Sun-B2ndPBZP.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DAZXInW8.js → SwitchHorizontal01-BL4xnvxO.js} +1 -1
  29. package/dist/client/assets/{Tool01-CvnpFI53.js → Tool01-Ci5EQ1tM.js} +1 -1
  30. package/dist/client/assets/{Trash01-ByxlxTiZ.js → Trash01-Cc007jho.js} +1 -1
  31. package/dist/client/assets/{Upload01-Z77n1bV8.js → Upload01-DB9meUjO.js} +1 -1
  32. package/dist/client/assets/{User01-COQtf360.js → User01-Dz-_mMMJ.js} +1 -1
  33. package/dist/client/assets/{Users01-wtRJYQKX.js → Users01-Ctg0iuAM.js} +1 -1
  34. package/dist/client/assets/{Users03-DknrDMtT.js → Users03-BazvU-rC.js} +1 -1
  35. package/dist/client/assets/{X-DrMVHLcw.js → X-_dGiBqSn.js} +1 -1
  36. package/dist/client/assets/{XCircle-Ct0eqqsw.js → XCircle-CmN6DNsv.js} +1 -1
  37. package/dist/client/assets/{XClose-BaZ908gw.js → XClose-BpreRuFP.js} +1 -1
  38. package/dist/client/assets/{Zap-wRIFSWIq.js → Zap-CWxLsQ6b.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-PMiGcZpW.js → ZapSquare-D5x1wm0t.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-6ix2H92j.js → ZoomOut-C0bVPfpC.js} +1 -1
  41. package/dist/client/assets/{access-gate-D6dGDGRI.js → access-gate-CpQ3bOMg.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-DOhGqRCL.js → add-section-modal-D22Rp_ry.js} +1 -1
  43. package/dist/client/assets/agent-icon-BjxA8YR3.js +1 -0
  44. package/dist/client/assets/agents-list-C17XwfcN.js +1 -0
  45. package/dist/client/assets/{ai-providers-Crp7kidL.js → ai-providers-DNjwL7U0.js} +1 -1
  46. package/dist/client/assets/{alert-CKj_5smu.js → alert-CTzYtGwN.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-CYizItFp.js → alert-dialog-DMWXmTGp.js} +2 -2
  48. package/dist/client/assets/app-editor-uAXMllzs.js +1 -0
  49. package/dist/client/assets/{auth-Bej0Tx2Y.js → auth-DraSXrC6.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-CmNVpp-8.js → auth-catchall--3ZAEbBd.js} +1 -1
  51. package/dist/client/assets/{auth-entry-PwLVm-jX.js → auth-entry-DRJ-aW15.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-5YwPgbAb.js → auth-split-layout-B77S9w6i.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-DoPUB_Bh.js → authenticate-and-persist-oauth-HBteAcVm.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CsTyBm4M.js → automation-list-row-NZNZGrlr.js} +1 -1
  55. package/dist/client/assets/automation-runs-BoQeZ1gh.js +1 -0
  56. package/dist/client/assets/automations-bd5MK3eJ.js +1 -0
  57. package/dist/client/assets/{avatar-CJP1BOq4.js → avatar-COMRxqae.js} +1 -1
  58. package/dist/client/assets/{badge-DhpSM7g_.js → badge-B1dPfLuK.js} +1 -1
  59. package/dist/client/assets/{block-document-B2vhG8Ii.js → block-document-B6TgjyKW.js} +2 -2
  60. package/dist/client/assets/{brand-context-BRpHgxfT.js → brand-context-DGv078pp.js} +1 -1
  61. package/dist/client/assets/{buckets-DDR0G33f.js → buckets-LnyV7EWC.js} +1 -1
  62. package/dist/client/assets/bulk-category-panel-BP0Mtj3P.js +1 -0
  63. package/dist/client/assets/{capability-load-error-CCgNL5xi.js → capability-load-error-WTr85D-I.js} +1 -1
  64. package/dist/client/assets/{card-BFb5m83e.js → card-Bys-wDTW.js} +1 -1
  65. package/dist/client/assets/category-editor-Cm1sAVk_.js +1 -0
  66. package/dist/client/assets/{chat-context-n9syhvq-.js → chat-context-huSCeR82.js} +4 -4
  67. package/dist/client/assets/{checkbox-DmOzmKLP.js → checkbox-BIDlFz_0.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BVPtMYcv.js → cli-auth-success-DJ5lbMQC.js} +1 -1
  69. package/dist/client/assets/collection-detail-UTQtN0-J.js +1 -0
  70. package/dist/client/assets/{collection-display-button-Bf9dlJRy.js → collection-display-button-Bnm_JutP.js} +1 -1
  71. package/dist/client/assets/{collection-search-8iNXnGlM.js → collection-search-CKMDHnku.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-KA2be3wH.js → collection-tabs-CWrBkWhe.js} +1 -1
  73. package/dist/client/assets/{command-C34397s2.js → command-DrgMAh0a.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-B8pBrcvE.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-Brra3cMC.js → connect-desktop-dialog-CvuFk-NY.js} +1 -1
  76. package/dist/client/assets/{connection-card-C6NYo4Gp.js → connection-card-DIh-SIqT.js} +1 -1
  77. package/dist/client/assets/connection-detail-CWog7XFK.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-CwZx7WkC.js → connection-form-helpers-DV-bwjt7.js} +1 -1
  79. package/dist/client/assets/connections-BkvcH3F-.js +1 -0
  80. package/dist/client/assets/{context-menu-BW_OZBmV.js → context-menu-BPHfkJEs.js} +1 -1
  81. package/dist/client/assets/{decopilot-BItqS11w.js → decopilot-BxOK0Z8W.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-CvYk1hkc.js → decopilot-sse-pool-Chmwc1_x.js} +1 -1
  83. package/dist/client/assets/{dialog-BAqFyO8a.js → dialog-o7scRbG9.js} +1 -1
  84. package/dist/client/assets/{domain-settings-r_E3rHsG.js → domain-settings-DIv14WFm.js} +1 -1
  85. package/dist/client/assets/{drawer-CFkqEC3w.js → drawer-B-Vy7tMY.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-C62KNjwK.js → dropdown-menu-D-VNET4I.js} +1 -1
  87. package/dist/client/assets/{empty-state-Sh_DuDcy.js → empty-state-1p_UpPHY.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-D6bQrejT.js → extract-connection-data-BVX9Eneo.js} +1 -1
  89. package/dist/client/assets/file-explorer-Bh9kp1sm.js +2 -0
  90. package/dist/client/assets/{file-type-icon-DPWxBpNL.js → file-type-icon-LHBbJJTG.js} +1 -1
  91. package/dist/client/assets/{files-B9ekmQa_.js → files-Bw3w16xX.js} +1 -1
  92. package/dist/client/assets/{form-DGE2mWLL.js → form-DX8cQ4SA.js} +1 -1
  93. package/dist/client/assets/{general-BMDKtyZB.js → general-DzJAxzRR.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-B5tZucJa.js → github-repo-picker-ZmfhFTO6.js} +1 -1
  95. package/dist/client/assets/{hooks-CUSV6Enf.js → hooks-BUt6AoQh.js} +6 -6
  96. package/dist/client/assets/{import-from-deco-dialog-M3CP3Gmn.js → import-from-deco-dialog-DZhtwoRn.js} +1 -1
  97. package/dist/client/assets/{index-Bb-tYGNK.js → index-BBTFoidO.js} +1 -1
  98. package/dist/client/assets/{index-CkTyYAY1.js → index-BPD9Iyv5.js} +1 -1
  99. package/dist/client/assets/index-BcXb7VeZ.css +1 -0
  100. package/dist/client/assets/index-CAV1BNai.js +173 -0
  101. package/dist/client/assets/{index-mEtg0zTM.js → index-CL3KBg-D.js} +1 -1
  102. package/dist/client/assets/{index-CFiyU0D9.js → index-CXy6rN6i.js} +3 -3
  103. package/dist/client/assets/{index-DGzNvPy2.js → index-CjKis1yy.js} +1 -1
  104. package/dist/client/assets/{index-jBUpmiBg.js → index-Cod7u1PQ.js} +1 -1
  105. package/dist/client/assets/{index-CRxAjd1d.js → index-CpgVJVWB.js} +27 -27
  106. package/dist/client/assets/{index-B6hcksS9.js → index-DCwPnlYH.js} +1 -1
  107. package/dist/client/assets/index-DKs6HTlj.js +1 -0
  108. package/dist/client/assets/{index-Dj7TxcSd.js → index-Db3cPjnW.js} +2 -2
  109. package/dist/client/assets/index-DvDkdoxH.js +1 -0
  110. package/dist/client/assets/{index-hmJjUPum.js → index-NJ9aYDVC.js} +1 -1
  111. package/dist/client/assets/{index-DIBoN36v.js → index-VkScKLdP.js} +1 -1
  112. package/dist/client/assets/{index-redirect-C9Kkmz45.js → index-redirect-B6MtHNAq.js} +1 -1
  113. package/dist/client/assets/{input-BwRH-Gsz.js → input-BlhkemhH.js} +1 -1
  114. package/dist/client/assets/{integration-icon-LQhkkaLl.js → integration-icon-BSHD1Ijr.js} +1 -1
  115. package/dist/client/assets/{label-CdBSUJpf.js → label-CL8Vh65B.js} +1 -1
  116. package/dist/client/assets/{login-d0UWtw9N.js → login-B4UwjrwL.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-IblqU9XT.js → mcp-oauth-CXj7zg3h.js} +1 -1
  118. package/dist/client/assets/{members-Bpdrl2e9.js → members-CZJJNFCT.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-5JIc-lnc.js → monaco-editor-DBScTPL_.js} +2 -2
  120. package/dist/client/assets/{monitoring-stats-row-DPsQ-OAn.js → monitoring-stats-row-DS-oLjL7.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-B1AvYYRn.js → oauth-callback-DmaJ1bda.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-BtGHmjpp.js → oauth-callback-ai-provider-BQMnSXh3.js} +1 -1
  123. package/dist/client/assets/{onboarding-DfUmI7F5.js → onboarding-Byb6DxyK.js} +1 -1
  124. package/dist/client/assets/{org-install-CpJAFt1s.js → org-install-DE37K5KN.js} +1 -1
  125. package/dist/client/assets/{org-layout-BsuFzdH_.js → org-layout-des0Y5a9.js} +1 -1
  126. package/dist/client/assets/{organization-choice-DrxWffZp.js → organization-choice-COkZ5W_o.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BLqpZnj6.js → page-seo-form-BcrUATEU.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-D1Z6hzyV.js +1 -0
  129. package/dist/client/assets/popover-SD8gnUXm.js +1 -0
  130. package/dist/client/assets/post-editor-BDlfII0z.js +1 -0
  131. package/dist/client/assets/{primitives-BF1opf4F.js → primitives-CVsZF3ex.js} +1 -1
  132. package/dist/client/assets/{profile-C8meo3ry.js → profile-DBUkydtR.js} +1 -1
  133. package/dist/client/assets/project-app-view-Bk8oTYIF.js +1 -0
  134. package/dist/client/assets/record-editor-DL8IQ3xy.js +1 -0
  135. package/dist/client/assets/registry-Bd0JPSYO.js +2 -0
  136. package/dist/client/assets/{registry-layout-C4UMhzml.js → registry-layout-BL9jjFNp.js} +1 -1
  137. package/dist/client/assets/{require-capability--mIKExbX.js → require-capability-CLQ4GBGj.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-DDJmFi3U.js → required-auth-layout-BzYoSj-D.js} +1 -1
  139. package/dist/client/assets/{reset-password-CuNa1ife.js → reset-password-C3Zmx-Z-.js} +1 -1
  140. package/dist/client/assets/roles-RwbAlbhC.js +1 -0
  141. package/dist/client/assets/{scroll-area-BM-54tW1.js → scroll-area-DgIklajW.js} +54 -54
  142. package/dist/client/assets/{search-input-M7ubuBMG.js → search-input-BwHA7yOt.js} +1 -1
  143. package/dist/client/assets/{secrets-BN1JMG5V.js → secrets-Cu_Gp7gT.js} +1 -1
  144. package/dist/client/assets/{sections-editor-Buouhx1S.js → sections-editor-CaNl1tLu.js} +2 -2
  145. package/dist/client/assets/select-DM3pFFAV.js +1 -0
  146. package/dist/client/assets/{select-model-Cz9R_UN3.js → select-model-C1odlJ1X.js} +1 -1
  147. package/dist/client/assets/seo-editor-C28ZayGa.js +1 -0
  148. package/dist/client/assets/settings-layout-C_nc5y3_.js +1 -0
  149. package/dist/client/assets/{settings-section-MeT61nuY.js → settings-section-6b9w_VoZ.js} +1 -1
  150. package/dist/client/assets/{sheet-DyU03ddw.js → sheet-BJF6qruz.js} +1 -1
  151. package/dist/client/assets/shell-controls-C9tE75mS.js +1 -0
  152. package/dist/client/assets/{shell-layout-Nyz7GHu7.js → shell-layout-gi6XYvgE.js} +1 -1
  153. package/dist/client/assets/shell-route-loading-Agan4lHM.js +1 -0
  154. package/dist/client/assets/{sidebar-BNrafefE.js → sidebar-BD77ZDQ1.js} +1 -1
  155. package/dist/client/assets/{skeleton-B0I93PJP.js → skeleton-CuVDGSZE.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-MymOIPKk.js → sortable.esm-DpWg8tde.js} +2 -2
  157. package/dist/client/assets/{sso-CfyYgWAs.js → sso-B9XBpXX9.js} +1 -1
  158. package/dist/client/assets/{store-T7GJ1SPI.js → store-Il1Qjdpz.js} +1 -1
  159. package/dist/client/assets/store-registry-BN4Ygwm2.js +2 -0
  160. package/dist/client/assets/{studio-tools-CNO5iCKk.js → studio-tools-C-Eel15b.js} +1 -1
  161. package/dist/client/assets/{switch-CCMIMmOF.js → switch-DWXEjjcR.js} +1 -1
  162. package/dist/client/assets/{tab-id-BptcWVWa.js → tab-id-AX1D_RMI.js} +1 -1
  163. package/dist/client/assets/{table-DeNuxLMl.js → table-sXVKQ5vt.js} +1 -1
  164. package/dist/client/assets/{tabs-Ca0vDJqc.js → tabs-BeXAqCdo.js} +1 -1
  165. package/dist/client/assets/{task-status-B3nPzwP7.js → task-status-CaQuE65s.js} +1 -1
  166. package/dist/client/assets/{textarea-BYT525JZ.js → textarea-C30KYfio.js} +1 -1
  167. package/dist/client/assets/{toggle-group-9TrYMc69.js → toggle-group-B6oTaI1f.js} +1 -1
  168. package/dist/client/assets/toolbar-DuZrnshW.js +1 -0
  169. package/dist/client/assets/toolbar-icon-button-CG8gWMNZ.js +1 -0
  170. package/dist/client/assets/{tools-list-uWC3Ij6C.js → tools-list-BSe55AC9.js} +1 -1
  171. package/dist/client/assets/tooltip-BRQCINXK.js +1 -0
  172. package/dist/client/assets/{types-C7syjwde.js → types-ywta9rZ4.js} +4 -4
  173. package/dist/client/assets/{use-ai-providers-C7KmiuqP.js → use-ai-providers-CpUPA2Pj.js} +1 -1
  174. package/dist/client/assets/{use-automations-RMjkwkxX.js → use-automations-BSn8_z4p.js} +1 -1
  175. package/dist/client/assets/{use-capability-C6Dwri-U.js → use-capability-AkUZCu97.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-BcxdOJLx.js → use-clock-tick-7J301cSN.js} +1 -1
  177. package/dist/client/assets/{use-collections-B4atckEK.js → use-collections-BhzLncHB.js} +1 -1
  178. package/dist/client/assets/{use-connection-Dz29RF9P.js → use-connection-CSQdDXlG.js} +1 -1
  179. package/dist/client/assets/{use-copy-Xy0buIqd.js → use-copy-3aLRhzTZ.js} +1 -1
  180. package/dist/client/assets/use-create-virtual-mcp-ClyuqzV0.js +1 -0
  181. package/dist/client/assets/{use-debounced-autosave-B4mbwJnu.js → use-debounced-autosave-DwyO4Yri.js} +1 -1
  182. package/dist/client/assets/{use-debounced-value-C6U3mliE.js → use-debounced-value-BGsbVLHA.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-CpQNzv3e.js → use-decopilot-events-B8-U5_6h.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-CqeuxO_6.js → use-delete-connection-yP5RphYi.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-CFCmr--W.js → use-file-configs-XF2AvMPs.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-BX1nHHVY.js → use-infinite-scroll-CkXtceVR.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-j9WpmFq7.js → use-join-requests-mfteqXVe.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-xOK-OF8p.js → use-mcp-client-CRWIqSWI.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-Crr3H7P7.js → use-mcp-prompts-BV9cBymv.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-C8tMWwG9.js → use-mcp-tools-Dgj65Z69.js} +1 -1
  191. package/dist/client/assets/{use-members-BMNjJExY.js → use-members-BZOJ4ncQ.js} +1 -1
  192. package/dist/client/assets/{use-mobile-NlF-3RoP.js → use-mobile-DgvzRDzB.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-DZubxUSm.js → use-navigate-to-agent-DTqeD3lq.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-C_UJ3Vg_.js → use-org-auth-client-Dx974y4u.js} +1 -1
  195. package/dist/client/assets/{use-org-fs-DyK8omii.js → use-org-fs-DI1Q1Ycz.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-DkqH8Zpz.js → use-org-sso-kfQLtl8D.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-Cu69Rnex.js → use-organization-roles-B2GmBYYT.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-DksiQdGc.js → use-organization-settings-ClL7mSbK.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-BOZLpkM5.js → use-registry-connections-DzyhBLO8.js} +1 -1
  200. package/dist/client/assets/{use-secrets-CLmhH-Rb.js → use-secrets-BX0N_3N-.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-DxV7deix.js → use-status-sounds-BsVH7G2F.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-C2dllj6L.js → use-view-mode-D4v-Vh_n.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-2U_MnYnK.js → use-virtual-mcp-7AWl-thI.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-DbI8AV-k.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-DT-JxV4F.js +1 -0
  206. package/dist/client/assets/{useSuspenseQueries-Cysvk68n.js → useSuspenseQueries-D4Gfj0Tf.js} +1 -1
  207. package/dist/client/assets/variant-calendar-C9mxKuI5.js +1 -0
  208. package/dist/client/assets/{view-mode-toggle-4CQodGfa.js → view-mode-toggle-Dcs21C2T.js} +1 -1
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/cli.js +11 -2
  211. package/dist/server/server.js +1 -1
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronLeft-dyRjFCmp.js +0 -1
  214. package/dist/client/assets/agent-icon-oDx9Z_Be.js +0 -1
  215. package/dist/client/assets/agents-list-BgSM_QG_.js +0 -1
  216. package/dist/client/assets/app-editor-Xoia35dq.js +0 -1
  217. package/dist/client/assets/automation-runs-B-dNDEWH.js +0 -1
  218. package/dist/client/assets/automations-D395202A.js +0 -1
  219. package/dist/client/assets/bulk-category-panel-CM1bMunr.js +0 -1
  220. package/dist/client/assets/category-editor-2T4Y_ABL.js +0 -1
  221. package/dist/client/assets/collection-detail-BQKV3UU7.js +0 -1
  222. package/dist/client/assets/commerce-onboarding-D2H83R0U.js +0 -1
  223. package/dist/client/assets/connection-detail-gJ5ITUXe.js +0 -1
  224. package/dist/client/assets/connections-CicrEJbU.js +0 -1
  225. package/dist/client/assets/file-explorer-C8pgfKCz.js +0 -2
  226. package/dist/client/assets/index-B2yJy2sB.js +0 -1
  227. package/dist/client/assets/index-BqKQnks_.css +0 -1
  228. package/dist/client/assets/index-DQnTjiix.js +0 -1
  229. package/dist/client/assets/index-D_S_Rq8A.js +0 -169
  230. package/dist/client/assets/page-seo-sheet-C7jjKuEW.js +0 -1
  231. package/dist/client/assets/popover-BXFiEQtN.js +0 -1
  232. package/dist/client/assets/post-editor-Tve7DmSa.js +0 -1
  233. package/dist/client/assets/preview-dialog-CQgf0QcR.js +0 -5
  234. package/dist/client/assets/project-app-view-BR2-hR46.js +0 -1
  235. package/dist/client/assets/record-editor-DbXO7U7E.js +0 -1
  236. package/dist/client/assets/registry-jjhvqeDq.js +0 -2
  237. package/dist/client/assets/roles-BMhGnq_F.js +0 -1
  238. package/dist/client/assets/select-C6v8Xcth.js +0 -1
  239. package/dist/client/assets/seo-editor-D9o3utSQ.js +0 -1
  240. package/dist/client/assets/settings-layout-CSaUQUXv.js +0 -1
  241. package/dist/client/assets/shell-controls-DtGb6E4l.js +0 -1
  242. package/dist/client/assets/shell-route-loading-BRcTX0VT.js +0 -1
  243. package/dist/client/assets/store-registry-B-YJeGRV.js +0 -2
  244. package/dist/client/assets/toolbar-p8VcpV1N.js +0 -1
  245. package/dist/client/assets/tooltip-DrpiSbRG.js +0 -1
  246. package/dist/client/assets/use-create-virtual-mcp-DVmI--_C.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-RUqqRph1.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-fRYRtDkY.js +0 -1
  249. package/dist/client/assets/variant-calendar-mZn_D1Zo.js +0 -1
@@ -1 +0,0 @@
1
- import{c as k,j as n,r as $,D as J,m as xe,l as Q,i as le,ao as Z,t as U,K as te,k as se,B as Y,d as st,a8 as nt,E as it,a as ot}from"./index-CFiyU0D9.js";import{u as ge}from"./use-mobile-NlF-3RoP.js";import{u as rt}from"./useSuspenseQueries-Cysvk68n.js";import{i as lt,u as ae,m as at,a as ct,S as dt}from"./use-mcp-client-xOK-OF8p.js";import{u as mt,b as ut,v as ft,a as pt}from"./use-virtual-mcp-2U_MnYnK.js";import{i as ht}from"./ChevronUp-DBpw6M-L.js";import{i as xt,A as ce,t as gt,ac as yt,E as bt,k as jt}from"./agent-icon-oDx9Z_Be.js";import{s as ye}from"./Plus-eGxBB1d8.js";import{i as $e}from"./X-DrMVHLcw.js";import{C as oe}from"./index-mEtg0zTM.js";import{b as vt}from"./chat-context-n9syhvq-.js";import{N as Nt}from"./decopilot-BItqS11w.js";import{g as wt,b as Ae,c as re,K as Pe,P as Ee,D as Me,d as St,S as _t,v as Ct,e as It,C as Tt,s as kt,l as $t,k as At,o as Pt,u as Et,j as Mt,h as zt}from"./sortable.esm-MymOIPKk.js";import{u as ze,a as Oe,o as Ot}from"./use-organization-settings-DksiQdGc.js";import{c as be,b as Lt,h as Dt}from"./shell-layout-Nyz7GHu7.js";import{I as Le}from"./input-BwRH-Gsz.js";import{S as Ht,t as je,P as Rt,j as Ft,s as Ut,g as Bt}from"./scroll-area-BM-54tW1.js";import{S as Vt,a as Kt,b as Wt,c as qt,d as Gt}from"./sheet-DyU03ddw.js";import{S as H}from"./skeleton-B0I93PJP.js";import{t as De}from"./ChevronDown-DyHvxYlc.js";import{c as He}from"./ZoomOut-6ix2H92j.js";import{g as Re,M as Qt}from"./types-C7syjwde.js";import{I as Fe}from"./integration-icon-LQhkkaLl.js";import{b as Jt,c as Xt,S as Zt,a as we,d as Yt}from"./select-C6v8Xcth.js";import{T as es}from"./textarea-BYT525JZ.js";import{u as Ue}from"./studio-tools-CNO5iCKk.js";import{a as ts}from"./use-mcp-tools-C8tMWwG9.js";import{i as ss}from"./XCircle-Ct0eqqsw.js";import{f as ns}from"./tab-id-BptcWVWa.js";import{g as is}from"./use-mcp-prompts-Crr3H7P7.js";import{u as os,w as rs}from"./hooks-CUSV6Enf.js";import{a as ls,g as as,c as cs,b as ds,D as ms}from"./dropdown-menu-C62KNjwK.js";import{s as us}from"./Trash01-ByxlxTiZ.js";import{a as fs,u as ps}from"./use-ai-providers-C7KmiuqP.js";import{u as hs}from"./connect-desktop-dialog-Brra3cMC.js";import{a as xs}from"./toolbar-p8VcpV1N.js";import"./auth-Bej0Tx2Y.js";import"./use-collections-B4atckEK.js";import"./AlertCircle-DC-zDzV-.js";import"./Tool01-CvnpFI53.js";import"./SwitchHorizontal01-DAZXInW8.js";import"./Settings02-BcAnTzm5.js";import"./ArrowUpRight-OJZisFPQ.js";import"./ZapSquare-PMiGcZpW.js";import"./Users03-DknrDMtT.js";import"./CheckCircle-Cgnheu-R.js";import"./ChevronLeft-dyRjFCmp.js";import"./ChevronRight-Cpfh3gza.js";import"./DotsVertical-5jSu3d1f.js";import"./Stars02-qnq-_X9g.js";import"./Eye-bojNLUjA.js";import"./Globe01-CyfpzbeQ.js";import"./FilterLines-CFl65nng.js";import"./Star01-DHEkWySe.js";import"./Globe04-DFpdKSRI.js";import"./HardDrive-B1mtnaeA.js";import"./Key01-CwrJlZo0.js";import"./LayoutLeft-fsm0LcB8.js";import"./LinkExternal01-BHwVyDja.js";import"./Monitor01-ChA6ov2I.js";import"./Sun-lTiqxOzH.js";import"./Palette-DusYqL0W.js";import"./Play-CnXG8qqP.js";import"./SearchLg-CDpA_lbT.js";import"./SearchMd-ujiTPCmg.js";import"./Shield01-ZxmFmrvL.js";import"./Stars01-BdCaKqhF.js";import"./Upload01-Z77n1bV8.js";import"./User01-COQtf360.js";import"./Users01-wtRJYQKX.js";import"./XClose-BaZ908gw.js";import"./Zap-wRIFSWIq.js";import"./tooltip-DrpiSbRG.js";import"./dialog-BAqFyO8a.js";import"./drawer-CFkqEC3w.js";import"./collection-search-8iNXnGlM.js";import"./form-DGE2mWLL.js";import"./label-CdBSUJpf.js";import"./tabs-Ca0vDJqc.js";import"./toggle-group-9TrYMc69.js";import"./popover-BXFiEQtN.js";import"./command-C34397s2.js";import"./index-jBUpmiBg.js";import"./useInfiniteQuery-RUqqRph1.js";import"./use-infinite-scroll-BX1nHHVY.js";import"./use-org-fs-DyK8omii.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-CpQNzv3e.js";import"./decopilot-sse-pool-CvYk1hkc.js";import"./backoff-CrEUbyZT.js";import"./checkbox-DmOzmKLP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CJP1BOq4.js";import"./settings-section-MeT61nuY.js";import"./card-BFb5m83e.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C6NYo4Gp.js";import"./use-registry-connections-BOZLpkM5.js";import"./use-connection-Dz29RF9P.js";import"./extract-connection-data-D6bQrejT.js";import"./collection-tabs-KA2be3wH.js";import"./badge-DhpSM7g_.js";import"./connection-form-helpers-CwZx7WkC.js";import"./authenticate-and-persist-oauth-DoPUB_Bh.js";import"./mcp-oauth-IblqU9XT.js";import"./useSuspenseInfiniteQuery-fRYRtDkY.js";import"./required-auth-layout-DDJmFi3U.js";import"./use-org-sso-DkqH8Zpz.js";import"./use-clock-tick-BcxdOJLx.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Xy0buIqd.js";import"./file-type-icon-DPWxBpNL.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-DZubxUSm.js";import"./delay-CnY5UFtP.js";function Be(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(gs,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function gs(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(es,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=x=>r(x==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Jt,{className:"h-7 text-xs",children:n.jsx(Xt,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(Zt,{children:[n.jsx(we,{value:"true",children:"true"}),n.jsx(we,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(Yt,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(Le,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function ys(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=$.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Vt,{children:"Manage home"}),d=n.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(xt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=x=>r(x.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(Wt,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(Le,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Gs,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(Ht,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(js,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(qt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(Gt,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function bs(t){const e=k.c(32),{org:s}=J(),o=ze();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=Oe(),d=ut(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const x=p>=ne;let y;e[10]!==x||e[11]!==f||e[12]!==a?(y=_=>f(_)||x?Promise.resolve():a.apply(I=>I.includes(_)?null:[...I,_]),e[10]=x,e[11]=f,e[12]=a,e[13]=y):y=e[13];const b=y;let v;e[14]!==a?(v=_=>a.apply(I=>I.filter(T=>T!==_)),e[14]=a,e[15]=v):v=e[15];const N=v;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const g=j;let w;e[18]!==d||e[19]!==x||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,I)=>{await d.update.mutateAsync({id:_.id,data:{metadata:I}}),!f(_.id)&&!x&&await a.apply(T=>T.includes(_.id)?null:[...T,_.id]),await c()},e[18]=d,e[19]=x,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let C;return e[24]!==b||e[25]!==x||e[26]!==r||e[27]!==f||e[28]!==N||e[29]!==g||e[30]!==S?(C={homeIds:r,isOnHome:f,atLimit:x,addAgent:b,removeAgent:N,reorder:g,saveAgentMetadata:S},e[24]=b,e[25]=x,e[26]=r,e[27]=f,e[28]=N,e[29]=g,e[30]=S,e[31]=C):C=e[31],C}function js(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=mt(o);let r;e[1]!==i?(r=new Set(i.map(_s)),e[1]=i,e[2]=r):r=e[2];const a=bs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const x=new Map(i.map(Ss));d=s.trim().toLowerCase();const y=N=>!d||N.title?.toLowerCase().includes(d);l=a.homeIds.map(N=>x.get(N)).filter(ws).filter(y);const b=wt(i);let v;e[9]!==a?(v=N=>!a.isOnHome(N.id),e[9]=a,e[10]=v):v=e[10],m=i.filter(Ns).filter(N=>!b.has(N.id)).filter(v).filter(y).sort(vs),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Cs,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(ks,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function vs(t,e){return(t.title??"").localeCompare(e.title??"")}function Ns(t){return t.id&&!lt(t.id)}function ws(t){return!!t}function Ss(t){return[t.id,t]}function _s(t){return t.id}function Ve(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Cs(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:kt},e[1]=r):r=e[1];const a=Ae(re(Ee,i),re(Pe,r));let d;e[2]!==s?(d=p=>{const{active:h,over:x}=p;if(!x||h.id===x.id)return;const y=s.homeIds,b=y.indexOf(h.id),v=y.indexOf(x.id);b===-1||v===-1||s.reorder($t([...y],b,v)).catch(Ts)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ve,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Me,{sensors:a,collisionDetection:St,onDragEnd:l,children:n.jsx(_t,{items:o.map(Is),strategy:Ct,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(As,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Is(t){return t.id}function Ts(){return U.error("Couldn't reorder home — please try again.")}function ks(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=$.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ve,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Ms,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a($s),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function $s(t){return t+20}function Ke(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function As(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=$.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=It(a),p=Ke(s)||"Quick access";let h;e[2]!==c?(h=Tt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const x=f?.5:void 0,y=f?100:void 0;let b;e[4]!==h||e[5]!==x||e[6]!==y||e[7]!==u?(b={transform:h,transition:u,opacity:x,zIndex:y},e[4]=h,e[5]=x,e[6]=y,e[7]=u,e[8]=b):b=e[8];const v=b,N=f&&"shadow-lg";let j;e[9]!==N?(j=Q("rounded-lg border border-border bg-card",N),e[9]=N,e[10]=j):j=e[10];const g=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(He,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==g?(S=n.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":g,children:w}),e[12]=d,e[13]=l,e[14]=g,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>r(Es),e[16]=C):C=e[16];const _=s.title??s.id;let I;e[17]!==s.icon||e[18]!==_?(I=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=I):I=e[19];const T=s.title??s.id;let P;e[20]!==T?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=P):P=e[21];let M;e[22]!==p?(M=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=M):M=e[23];let z;e[24]!==P||e[25]!==M?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,M]}),e[24]=P,e[25]=M,e[26]=z):z=e[26];const B=i&&"rotate-180";let O;e[27]!==B?(O=Q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=O):O=e[28];let L;e[29]!==O?(L=n.jsx(De,{size:16,className:O}),e[29]=O,e[30]=L):L=e[30];let K;e[31]!==i||e[32]!==I||e[33]!==z||e[34]!==L?(K=n.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,z,L]}),e[31]=i,e[32]=I,e[33]=z,e[34]=L,e[35]=K):K=e[35];let A;e[36]!==s.id||e[37]!==o?(A=()=>o.removeAgent(s.id).catch(Ps),e[36]=s.id,e[37]=o,e[38]=A):A=e[38];const V=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx($e,{size:14}),e[39]=D):D=e[39];let E;e[40]!==A||e[41]!==V?(E=n.jsx("button",{type:"button",onClick:A,"aria-label":V,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=A,e[41]=V,e[42]=E):E=e[42];let R;e[43]!==S||e[44]!==K||e[45]!==E?(R=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,K,E]}),e[43]=S,e[44]=K,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==o?(F=i&&n.jsx(We,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=F):F=e[50];let q;return e[51]!==m||e[52]!==v||e[53]!==R||e[54]!==F||e[55]!==j?(q=n.jsxs("div",{ref:m,style:v,className:j,children:[R,F]}),e[51]=m,e[52]=v,e[53]=R,e[54]=F,e[55]=j,e[56]=q):q=e[56],q}function Ps(){return U.error("Couldn't remove from home — please try again.")}function Es(t){return!t}function Ms({agent:t,home:e}){const[s,o]=$.useState(!1),[i,r]=$.useState(!1),a=Ke(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(De,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(We,{agent:t,home:e})]})}function We(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(zs).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Ls,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Os,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx($.Suspense,{fallback:u,children:n.jsx(Us,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function zs(t){return t.connection_id}function Os(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Ls({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Ue(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const x=Re(h._meta);return x?[{name:h.name,description:h.description,resourceUri:x,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(Rs,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Fs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function qe(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ds(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Hs(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function Rs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=$.useState(!1),[d,l]=$.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=$.useState(()=>Ds(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const x=Z(t.metadata?.ui),y=i.tileId?x.filter(v=>v.tileId!==i.tileId):x.filter(v=>v!==i),b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,b),l(!1)}catch(x){console.error("[home-tiles] failed to remove tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let x;if(m&&o.inputSchema?.properties){const N=qe(c,o.inputSchema.properties);if(!N){U.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(N).length>0&&(x=N)}const b=Z(t.metadata?.ui).map(N=>(i.tileId?N.tileId===i.tileId:N===i)?{...N,toolInput:x}:N),v={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,v),l(!1)}catch(x){console.error("[home-tiles] failed to save tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Hs(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(x=>!x),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(gt,{size:14})}),n.jsx(ve,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(x,y)=>u(b=>({...b,[x]:y}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Fs({agent:t,home:e,connection:s,tool:o}){const[i,r]=$.useState(!1),[a,d]=$.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const b=qe(m,o.inputSchema.properties);if(!b){U.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(b).length>0&&(p=b)}const x=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:x}};await e.saveAgentMetadata(t,y),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),U.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(ve,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(x=>({...x,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function ve(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(yt,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Us(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:g}=await d.listPrompts();return g.map(Ws)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=be(r.slug);let x,y;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let g;e[17]!==s.id?(g=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=g):g=e[18],x=h.prompts.filter(g).map(Ks);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],y=[...w];for(const S of x)y.some(C=>C.name===S.name)||y.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=x,e[16]=y}else x=e[15],y=e[16];if(f&&x.length===0){let g;return e[21]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=g):g=e[21],g}if(p&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(y.length===0)return null;let b;e[22]!==i||e[23]!==y?(b=i??y.map(Vs),e[22]=i,e[23]=y,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const N=v;let j;return e[27]!==s||e[28]!==o||e[29]!==y||e[30]!==N?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(g=>n.jsx(qs,{agent:s,home:o,prompt:g,allPromptNames:y.map(Bs),isPinned:N.has(g.name)},g.name))}),e[27]=s,e[28]=o,e[29]=y,e[30]=N,e[31]=j):j=e[31],j}function Bs(t){return t.name}function Vs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Ws(t){return{name:t.name,title:t.title,description:t.description}}function qs({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),U.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(ve,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function Gs(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Qs)}),t[0]=e):e=t[0],e}function Qs(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ge=`home-board.layout.v${ee}`;function Qe(t){return`home-board.layout.v${ee}.${t}`}const Je={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Je:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Js(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Xs(t){try{const e=localStorage.getItem(Qe(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Se(t,e){try{localStorage.setItem(Qe(t),JSON.stringify(e))}catch{}}async function _e(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function Zs(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=Xs(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${Ge}`);if(b.status===404)return a&&Js(a)?(await _e(t,a),a):Je;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),N=fe(v.value);return Se(t,N),N},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:b=>_e(t,b)},e[11]=t,e[12]=u):u=e[12];const f=st(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=b=>{Se(t,b),s.setQueryData(i,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let x;e[18]!==m?(x=fe(m),e[18]=m,e[19]=x):x=e[19];let y;return e[20]!==c||e[21]!==h||e[22]!==x?(y={layout:x,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=x,e[23]=y):y=e[23],y}const Xe=$.createContext(null);function Ys(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=Zs(o.slug),[r,a]=$.useState(!1),[d,l]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,x=r&&d!==null,y=x?d:i.layout;let b;e[6]!==d||e[7]!==x||e[8]!==i.layout?(b=x?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=x,e[8]=i.layout,e[9]=b):b=e[9];const v=b;let N;e[10]!==r||e[11]!==i?(N=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=N):N=e[12];const j=N;let g;e[13]!==j||e[14]!==c||e[15]!==v||e[16]!==r||e[17]!==y||e[18]!==h||e[19]!==i.isLoading?(g={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:v,layout:y,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=v,e[16]=r,e[17]=y,e[18]=h,e[19]=i.isLoading,e[20]=g):g=e[20];let w;return e[21]!==s||e[22]!==g?(w=n.jsx(Xe.Provider,{value:g,children:s}),e[21]=s,e[22]=g,e[23]=w):w=e[23],w}function Ze(){const t=$.useContext(Xe);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function en({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=os(),{setTaskId:r}=Lt(),[a,d]=$.useState(null),[l,m]=$.useState(!1),c=$.useRef(!1),u=async(y,b)=>{if(!o){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const v=await is(o,y.name,b),N={type:"doc",content:[{type:"paragraph",content:[Ft({id:y.name,name:Ut(y.name,Bt(y._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},j=crypto.randomUUID();rs(sessionStorage,s,j,{tiptapDoc:N}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async y=>{if(!c.current){if(y.arguments&&y.arguments.length>0){d(y);return}await u(y)}},p=async y=>{if(!a)return;const b=a;d(null),await u(b,y)};return{start:f,startBlank:async y=>{if(!c.current){c.current=!0,m(!0);try{const b=crypto.randomUUID();await i({id:b,virtual_mcp_id:t}),r(b,t,y?.main?{main:y.main}:void 0)}catch(b){console.error("[start-thread-from-prompt] startBlank failed",b),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Rt,{prompt:a,setPrompt:y=>d(y),onSubmit:p}),dialogPrompt:a,starting:l}}const W=4,G=100,Ce=12,tn=5,sn={w:2,h:2};class pe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(nt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function nn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=$.useRef(null),[c,u]=$.useState(null),[f,p]=$.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const x=Ae(re(Ee,h),re(Pe)),y=s.reduce(on,0),b=o?Math.max(y+2,4):Math.max(y,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/W,cellHeight:G}:null},e[1]=v):v=e[1];const N=v;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=A=>{u(String(A.active.id)),p(N())},e[2]=j):j=e[2];const g=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=A=>{const V=String(A.active.id),D=f??N();if(u(null),p(null),!D||D.cellWidth<=0)return;const E=s.find(q=>q.id===V);if(!E)return;const R=Math.round(A.delta.x/D.cellWidth),F=Math.round(A.delta.y/D.cellHeight);R===0&&F===0||r(V,{x:E.x+R,y:E.y+F})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let A;if(e[7]!==i||e[8]!==s){let D;e[10]!==i?(D=E=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(E)})},E.id),e[10]=i,e[11]=D):D=e[11],A=s.map(D),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let V;return e[12]!==A?(V=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=V):V=e[13],V}let C,_,I,T,P,M,z,B,O;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==x||e[22]!==s||e[23]!==b){const A=c?s.find(X=>X.id===c):null;_=Me,B=x,O=g,I=S;const V=b*G,D=o?G*4:G;let E;e[33]!==V||e[34]!==D?(E={height:V,minHeight:D},e[33]=V,e[34]=D,e[35]=E):E=e[35];let R;e[36]!==o||e[37]!==s||e[38]!==b?(R=o&&n.jsx(rn,{rows:b,tiles:s}),e[36]=o,e[37]=s,e[38]=b,e[39]=R):R=e[39];let F;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(an,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==E||e[54]!==R||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:E,children:[R,F]}),e[53]=E,e[54]=R,e[55]=F,e[56]=T):T=e[56],C=At,P=null;const q=A&&f?A.w*f.cellWidth-Ce:void 0,de=A&&f?A.h*f.cellHeight-Ce:void 0;e[57]!==q||e[58]!==de?(M={width:q,height:de},e[57]=q,e[58]=de,e[59]=M):M=e[59],z=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=x,e[22]=s,e[23]=b,e[24]=C,e[25]=_,e[26]=I,e[27]=T,e[28]=P,e[29]=M,e[30]=z,e[31]=B,e[32]=O}else C=e[24],_=e[25],I=e[26],T=e[27],P=e[28],M=e[29],z=e[30],B=e[31],O=e[32];let L;e[60]!==C||e[61]!==P||e[62]!==M||e[63]!==z?(L=n.jsx(C,{dropAnimation:P,style:M,children:z}),e[60]=C,e[61]=P,e[62]=M,e[63]=z,e[64]=L):L=e[64];let K;return e[65]!==_||e[66]!==I||e[67]!==T||e[68]!==L||e[69]!==B||e[70]!==O?(K=n.jsxs(_,{sensors:B,onDragStart:O,onDragEnd:I,children:[T,L]}),e[65]=_,e[66]=I,e[67]=T,e[68]=L,e[69]=B,e[70]=O,e[71]=K):K=e[71],K}function on(t,e){return Math.max(t,e.y+e.h)}function rn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<W;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(ln)}),e[5]=a,e[6]=d):d=e[6],d}function ln(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/W*100}%`,top:t.y*G,width:`${1/W*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function an(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Pt(m),h=`${s.x/W*100}%`,x=`${s.w/W*100}%`,y=s.y*G,b=s.h*G,v=p||i,N=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=v&&"opacity-30";let g;e[3]!==N||e[4]!==j?(g=Q("absolute p-1 will-change-[left,top,width,height,opacity]",N,j),e[3]=N,e[4]=j,e[5]=g):g=e[5];let w;e[6]!==b||e[7]!==h||e[8]!==y||e[9]!==x?(w={left:h,top:y,width:x,height:b},e[6]=b,e[7]=h,e[8]=y,e[9]=x,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(He,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(cn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==C||e[24]!==_?(T=n.jsxs("div",{className:C,children:[_,I]}),e[22]=I,e[23]=C,e[24]=_,e[25]=T):T=e[25];let P;return e[26]!==c||e[27]!==T||e[28]!==g||e[29]!==w?(P=n.jsx("div",{ref:c,className:g,style:w,children:T}),e[26]=c,e[27]=T,e[28]=g,e[29]=w,e[30]=P):P=e[30],P}function cn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ls,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(bt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=y=>{o(s.id,y),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(dn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(as,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(us,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(cs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(ds,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let x;return e[17]!==r||e[18]!==h?(x=n.jsxs(ms,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=x):x=e[19],x}function dn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=$.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${W}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:tn},(y,b)=>Array.from({length:W},(v,N)=>{const j=N+1,g=b+1,w=j<i||g<r,S=j<=m.w&&g<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${g}`,onPointerEnter:()=>d({w:j,h:g}),onClick:()=>o({w:j,h:g}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${g}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function mn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=W-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)mn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(W,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(W-s,t)),i=Math.max(0,e);return{x:o,y:i}}function un(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function fn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ze();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let v;e[7]!==a?(v=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=v):v=e[8];const N=t.filter(v);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of N){const g=s.tiles[j.id];if(!g)continue;const w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),{x:_,y:I}=ue(g.x,g.y,S);l.push({id:j.id,x:_,y:I,w:S,h:C,minW:w?.w,minH:w?.h})}for(const j of N){if(l.some(I=>I.id===j.id))continue;const g=j.defaultSize??sn,w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),_=he(l,S,C);l.push({id:j.id,x:_.x,y:_.y,w:S,h:C,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(pn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(v,N)=>{const j={};for(const g of v)j[g.id]={x:g.x,y:g.y,w:g.w,h:g.h};i({version:ee,tiles:j,hidden:N.filter(g=>c.has(g))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(v,N)=>{const j=l.find(S=>S.id===v);if(!j)return;const g=ue(N.x,N.y,j.w);if(g.x===j.x&&g.y===j.y)return;const w=un(l,v,g);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let x;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(x=(v,N)=>{const j=l.find(T=>T.id===v);if(!j)return;const g=d.get(v),{w,h:S}=me(N.w,N.h,g);if(w===j.w&&S===j.h)return;const C={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(T=>T.id!==v),I=[C];for(const T of _){const P=he(I,T.w,T.h);I.push({...T,x:P.x,y:P.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=x):x=e[24];let y;e[25]!==f||e[26]!==s||e[27]!==l?(y=v=>{const N=l.filter(j=>j.id!==v);f(N,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=y):y=e[28];let b;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==x||e[33]!==y?(b={snapshot:p,isLoading:o,moveTile:h,resizeTile:x,hideTile:y},e[29]=o,e[30]=p,e[31]=h,e[32]=x,e[33]=y,e[34]=b):b=e[34],b}function pn(t){return t.id}const hn={w:2,h:4},xn={w:1,h:2},gn={w:1,h:1};function yn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function bn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function jn(t){return t.promptName?t.agentName:t.description}function vn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function Ye(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=at({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=ts(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Re(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?ns(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=en(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(vn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function Nn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let x;e[12]!==s?(x=jn(s),e[12]=s,e[13]=x):x=e[13];let y;e[14]!==x?(y=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=y):y=e[15];let b;e[16]!==y||e[17]!==h?(b=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,y]}),e[16]=y,e[17]=h,e[18]=b):b=e[18];let v;e[19]!==o?(v=!o&&n.jsx(ss,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=o,e[20]=v):v=e[20];let N;e[21]!==a||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(N=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,b,v]}),e[21]=a,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=N):N=e[28];let j;return e[29]!==r||e[30]!==N?(j=n.jsxs(n.Fragment,{children:[N,r]}),e[29]=r,e[30]=N,e[31]=j):j=e[31],j}function wn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Sn)}),t[0]=e):e=t[0],e}function Sn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function _n(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=Ne(s.agentId),u=o.filter(Cn),f=Ye(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const x="flex min-h-0 flex-1 gap-3 overflow-hidden";let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Tn,{}),e[5]=y):y=e[5];let b;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(b=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:y,children:n.jsx(In,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=b):b=e[9];const v=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(g=>n.jsx("button",{type:"button",onClick:()=>d(g),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:g.title})},g.promptName))});let N;e[10]!==b||e[11]!==v?(N=n.jsxs("div",{className:x,children:[b,v]}),e[10]=b,e[11]=v,e[12]=N):N=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==N?(j=n.jsxs("div",{className:p,children:[h,N,m]}),e[13]=m,e[14]=h,e[15]=N,e[16]=j):j=e[16],j}function Cn(t){return!!t.promptName}function In(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(Qt,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function kn(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function $n(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=Ne(s.agentId),m=o.filter(An),c=Ye(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const x=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(b=>n.jsx("button",{type:"button",onClick:()=>!i&&r(b),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let y;return e[6]!==d||e[7]!==h||e[8]!==x?(y=n.jsxs("div",{className:u,children:[h,x,d]}),e[6]=d,e[7]=h,e[8]=x,e[9]=y):y=e[9],y}function An(t){return!!t.promptName}function et({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=be(e.slug),r=ze()?.ids??[],a=new Set(r),d=Oe(),l=Ue(),m=xe(),c=new Set(i.map(g=>g.agentId)),u=new Map;for(const g of o){const w=u.get(g.agentId);w?w.push(g):u.set(g.agentId,[g])}const f=o.filter(g=>!c.has(g.agentId)),p=[...i.map(g=>({kind:"tile",id:bn(g),data:g})),...f.map(g=>({kind:"prompt",id:yn(g),data:g}))],h=new Map(p.map(g=>[g.id,g])),x=fn(p.map(g=>({id:g.id,defaultSize:g.kind==="tile"?hn:gn,minSize:g.kind==="tile"?xn:void 0,pinned:a.has(g.data.agentId)}))),y=g=>{d.apply(w=>w.filter(S=>S!==g)).catch(()=>U.error("Couldn't remove from home — please try again."))},b=async g=>{if(i.filter(S=>S.agentId===g.agentId).length<=1){y(g.agentId);return}try{const C=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:g.agentId})).item;if(!C)throw new Error("Agent not found");const _=Z(C.metadata?.ui),I=g.tileId?_.filter(T=>T.tileId!==g.tileId):_.filter(T=>T.connectionId!==g.connectionId||T.resourceUri!==g.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:g.agentId,data:{metadata:{...C.metadata??{},ui:{...C.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},v=g=>{const w=h.get(g);if(w){if(!a.has(w.data.agentId)){x.hideTile(g);return}w.kind==="tile"?b(w.data):y(w.data.agentId)}},N=g=>{const w=h.get(g.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(it,{fallback:n.jsx($n,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(kn,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(_n,{tile:w.data,prompts:S,isEditMode:t,tileWidth:g.w})})})}return n.jsx(Nn,{entry:w.data,isEditMode:t})};return s||x.isLoading?n.jsx(wn,{}):x.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(nn,{tiles:x.snapshot.visible,isEditMode:t,renderTile:N,onMove:x.moveTile,onResize:x.resizeTile,onRemove:v})})}function Pn(t){const e=k.c(2),{prompts:s,tiles:o}=be(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const Ie=420,Te=305;function tt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Te}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Te}})]}),t[3]=i):i=t[3],i}function ke(){const t=k.c(33),{data:e}=ot.useSession(),{org:s}=J(),o=ge(),i=hs(),{selectedVirtualMcp:r}=vt();let a;t[0]!==s.id?(a=ct(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Dt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:dt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=fs(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Ot(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=ft(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let x;t[17]!==f||t[18]!==p||t[19]!==h?(x={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=x):x=t[20],rt(x);const y=ps(),b=pt(l.id),{hasDecoKey:v,isZeroBalance:N,isInitialFreeCredit:j,balanceDollars:g,hasOnlyDecoProvider:w}=Et(),{hasVisibleTiles:S}=Pn(s.slug),C=Mt(b?.metadata);if(y.length===0&&!(C&&zt(i))){let L;return t[21]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Nt,{})})}),t[21]=L):L=t[21],L}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,P=v&&j&&g!=null,M=v&&N&&w;let z;t[24]!==g||t[25]!==P||t[26]!==M?(z=P?n.jsx(oe.CreditsEyebrow,{balanceDollars:g}):M?n.jsx(oe.NoCreditsEyebrow,{}):null,t[24]=g,t[25]=P,t[26]=M,t[27]=z):z=t[27];const B=z;let O;return t[28]!==B||t[29]!==S||t[30]!==o||t[31]!==T?(O=n.jsx(Ys,{children:o?n.jsx(En,{eyebrow:B,userName:T}):n.jsx(Mn,{eyebrow:B,userName:T,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=o,t[31]=T,t[32]=O):O=t[32],O}function En(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(oe.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(et,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Mn(t){const e=k.c(32),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ze(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==r||e[5]!==d?(p=n.jsx(xs.Right,{children:n.jsx(zn,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=a,e[3]=m,e[4]=r,e[5]=d,e[6]=p):p=e[6];let h;e[7]!==c?(h=n.jsx(ys,{open:c,onOpenChange:u}),e[7]=c,e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{}),e[9]=x):x=e[9];const y=i||r?"pt-32":"flex-1 justify-center";let b;e[10]!==y?(b=Q("relative flex flex-col items-center px-10 pb-4",y),e[10]=y,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let N;e[14]!==o?(N=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[14]=o,e[15]=N):N=e[15];let j;e[16]!==v||e[17]!==N?(j=n.jsxs("div",{className:"text-center mb-10",children:[v,N]}),e[16]=v,e[17]=N,e[18]=j):j=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"relative w-full",children:[n.jsx(On,{}),n.jsx(oe.Input,{showConnectionsBanner:!0})]}),e[19]=g):g=e[19];let w;e[20]!==j?(w=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[j,g]}),e[20]=j,e[21]=w):w=e[21];let S;e[22]!==r?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(et,{isEditMode:r})}),e[22]=r,e[23]=S):S=e[23];let C;e[24]!==w||e[25]!==S||e[26]!==b?(C=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:b,children:[w,S]})})]}),e[24]=w,e[25]=S,e[26]=b,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==p||e[30]!==h?(_=n.jsxs(n.Fragment,{children:[p,h,C]}),e[28]=C,e[29]=p,e[30]=h,e[31]=_):_=e[31],_}function zn(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($e,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ht,{size:14}),e[6]=x):x=e[6];let y;e[7]!==r||e[8]!==h?(y=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=r,e[8]=h,e[9]=y):y=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==y?(b=n.jsxs(n.Fragment,{children:[u,p,y]}),e[10]=u,e[11]=p,e[12]=y,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(jt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function On(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Ko(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(ke,{})}),t[0]=o):o=t[0],o}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(ke,{})})})}),t[1]=s):s=t[1],s}export{Ko as default};
@@ -1,169 +0,0 @@
1
- import{c as $,r as B,j as t,k as Y,B as R,K as L,l as Z,D as Ne,m as st,t as W,b as lt,u as nt,E as Me,ae as Pt}from"./index-CFiyU0D9.js";import{i as Ft}from"./ChevronRight-Cpfh3gza.js";import{s as it}from"./Eye-bojNLUjA.js";import{n as Ot,i as rt}from"./Globe01-CyfpzbeQ.js";import{a as at,e as Et,f as At,i as Mt}from"./ZoomOut-6ix2H92j.js";import{a as je}from"./Palette-DusYqL0W.js";import{s as Ut}from"./Plus-eGxBB1d8.js";import{i as Bt}from"./SearchLg-CDpA_lbT.js";import{t as Lt}from"./Stars01-BdCaKqhF.js";import{i as ye}from"./Upload01-Z77n1bV8.js";import{s as Rt}from"./XClose-BaZ908gw.js";import{i as Le}from"./Zap-wRIFSWIq.js";import{u as ot}from"./use-mobile-NlF-3RoP.js";import{f as _t,a as qt,b as It,c as Kt,d as Vt,e as Ht,A as Gt,g as Qt}from"./alert-dialog-CYizItFp.js";import{d as Re,e as _e,a as qe,f as ct,c as Wt,b as Yt,D as Xt}from"./dialog-BAqFyO8a.js";import{I as we}from"./input-BwRH-Gsz.js";import{S as V}from"./skeleton-B0I93PJP.js";import{F as ne,d as dt,M as ft}from"./file-type-icon-DPWxBpNL.js";import{a as Zt}from"./toolbar-p8VcpV1N.js";import{p as Ie,l as A,c as Jt,L as es,R as ts,j as ss,h as ls,i as Ye,k as ns,S as is,m as le,n as ut,o as rs}from"./preview-dialog-CQgf0QcR.js";import{u as as}from"./use-debounced-value-C6U3mliE.js";import{a as de,i as os,u as Be,j as Ke,k as cs,b as ds,l as mt,m as fs}from"./use-org-fs-DyK8omii.js";import{i as Se}from"./DotsVertical-5jSu3d1f.js";import{i as us}from"./Key01-CwrJlZo0.js";import{s as $e}from"./Trash01-ByxlxTiZ.js";import{a as Ce,c as te,b as De,D as Te}from"./dropdown-menu-C62KNjwK.js";import{T as ms}from"./textarea-BYT525JZ.js";import{t as hs}from"./ChevronDown-DyHvxYlc.js";import{n as ps}from"./ChevronUp-DBpw6M-L.js";import{i as ke}from"./X-DrMVHLcw.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-dyRjFCmp.js";import"./tooltip-DrpiSbRG.js";import"./LinkExternal01-BHwVyDja.js";import"./index-B6hcksS9.js";import"./LayoutLeft-fsm0LcB8.js";import"./popover-BXFiEQtN.js";const xs=new Set(["output","upload","public","home"]),gs=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function ht(s){return xs.has(s)||!gs.test(s)?"home":s}function bs(s){const e=$.c(33);let l,i,n;e[0]!==s?({glyph:l,readOnly:n,...i}=s,e[0]=s,e[1]=l,e[2]=i,e[3]=n):(l=e[1],i=e[2],n=e[3]);const r=B.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let b;e[11]!==l?(b=l&&t.jsx(l,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=l,e[12]=b):b=e[12];let j;e[13]!==n?(j=n&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(it,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=n,e[14]=j):j=e[14];let v,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),g=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=v,e[16]=g):(v=e[15],g=e[16]);let w;e[17]!==a?(w=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[v,g]}),e[17]=a,e[18]=w):w=e[18];let C,k;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("stop",{stopColor:"#72B6FA"}),k=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=C,e[20]=k):(C=e[19],k=e[20]);let S;e[21]!==c?(S=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[C,k]}),e[21]=c,e[22]=S):S=e[22];let D;e[23]!==w||e[24]!==S?(D=t.jsxs("defs",{children:[w,S]}),e[23]=w,e[24]=S,e[25]=D):D=e[25];let T;return e[26]!==i||e[27]!==D||e[28]!==d||e[29]!==f||e[30]!==b||e[31]!==j?(T=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,b,j,D]}),e[26]=i,e[27]=D,e[28]=d,e[29]=f,e[30]=b,e[31]=j,e[32]=T):T=e[32],T}function vs(s,e,l){return e?"color":l?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const js=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ys=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,ws=["svg","png","jpg","jpeg","webp","avif","gif"];function ks(s){return s.split(".").pop()?.toLowerCase()??""}function Ns(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ss(s){const e=s.trim();return ys.test(e)||js.test(e)}function $s(s){const e=s.trim(),l=e.match(/^#([0-9a-f]{3})$/i);return l?.[1]?`#${[...l[1]].map(i=>i+i).join("")}`:e}function pt(s){const e=[],l=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let n;for(;(n=i.exec(s))!==null;){const r=n[1],a=n[2].trim();l.has(r)||e.push(r),l.set(r,a)}return e.map(r=>{const a=l.get(r),c=Ss(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:vs(r,c,o)}})}const Xe=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function Cs(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function Ds(s){const e=[],l=new Map;for(const n of s){if(n.kind!=="color")continue;const r=Cs(n.name);l.has(r)||(e.push(r),l.set(r,[])),l.get(r).push(n)}return e.map(n=>{const r=l.get(n);return{family:n,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((n,r)=>{const a=Xe.indexOf(n.family),c=Xe.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function Ts(s,e,l){const i=new RegExp(`(${Ns(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${l}${o}`);const n=s.search(/:root\s*\{/);if(n!==-1){const a=s.indexOf("{",n)+1;return`${s.slice(0,a)}
2
- ${e}: ${l};${s.slice(a)}`}const r=s.length>0&&!s.endsWith(`
3
- `)?`
4
- `:"";return`${s}${r}:root {
5
- ${e}: ${l};
6
- }
7
- `}function zs(s){const e=s.filter(i=>i.kind==="file"),l=e.find(i=>/(^|\/)logo\.(svg|png|jpe?g|webp|avif|gif)$/i.test(i.path));return l?l.path:e.find(i=>ws.includes(ks(i.path)))?.path??null}function Ps(s){const e={};for(const l of s.split(`
8
- `)){const i=l.match(/^([A-Za-z][\w-]*):\s*(.*)$/);i?.[1]&&i[2]!==void 0&&(e[i[1].toLowerCase()]=i[2].trim())}return e}function Ze(s){for(const e of s.split(/\n\s*\n/)){const l=e.trim();if(!(!l||l.startsWith("#")))return l.replace(/\n/g," ")}return null}function xt(s){const e=s.match(/^---\n([\s\S]*?)\n---\n?/);if(!e||e[1]===void 0)return{name:null,description:Ze(s),body:s};const l=Ps(e[1]),i=s.slice(e[0].length);return{name:l.name||null,description:l.description||Ze(i),body:i}}const Fs=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Os=new Set(["csv","tsv"]),Es=new Set(["mp4","webm","mov","m4v"]),As=new Set(["txt","md","markdown","json","log","yaml","yml","xml","html","htm"]),Ms=256*1024;function fe(s){const e=new Date(s);if(Number.isNaN(e.getTime()))return"";const l=Date.now()-e.getTime(),i=Math.floor(l/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const n=Math.floor(i/60);if(n<24)return`${n}h ago`;const r=Math.floor(n/24);return r<30?`${r}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Us(s){return s.split(".").pop()?.toLowerCase()??""}function Ve(s){const e=$.c(3),{onShare:l}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Et,{size:14}),e[0]=i):i=e[0];let n;return e[1]!==l?(n=t.jsxs(te,{onClick:l,children:[i,"Share"]}),e[1]=l,e[2]=n):n=e[2],n}function Bs(s){const e=$.c(9),{state:l}=s,i=l==="password"?"Password-protected — link + password to view":l==="inherited"?"Shared via a parent folder":"Public — anyone with the link can view",n=l==="password"?us:rt,r=l==="inherited"?"text-muted-foreground/60":"text-primary";let a;e[0]!==r?(a=Z(r),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==i||e[4]!==a?(c=t.jsx(n,{size:12,className:a,"aria-label":i}),e[2]=n,e[3]=i,e[4]=a,e[5]=c):c=e[5];let o;return e[6]!==i||e[7]!==c?(o=t.jsx("span",{title:i,className:"mt-0.5 flex shrink-0 items-center",children:c}),e[6]=i,e[7]=c,e[8]=o):o=e[8],o}function gt(s){const e=$.c(18),{downloadUrl:l,filename:i,onShare:n,onDelete:r}=s,a=`Actions for ${i}`;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:14}),e[0]=c):c=e[0];let o;e[1]!==a?(o=t.jsx(Ce,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Rs,"aria-label":a,children:c})}),e[1]=a,e[2]=o):o=e[2];let d;e[3]!==n?(d=n&&t.jsx(Ve,{onShare:n}),e[3]=n,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ot,{size:14}),e[5]=u):u=e[5];let f;e[6]!==l||e[7]!==i?(f=t.jsx(te,{asChild:!0,children:t.jsxs("a",{href:l,download:i,children:[u,"Download"]})}),e[6]=l,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==r?(m=r&&t.jsxs(te,{variant:"destructive",onClick:r,children:[t.jsx($e,{size:14}),"Delete"]}),e[9]=r,e[10]=m):m=e[10];let h;e[11]!==d||e[12]!==f||e[13]!==m?(h=t.jsxs(De,{align:"end",onClick:Ls,children:[d,f,m]}),e[11]=d,e[12]=f,e[13]=m,e[14]=h):h=e[14];let x;return e[15]!==o||e[16]!==h?(x=t.jsxs(Te,{children:[o,h]}),e[15]=o,e[16]=h,e[17]=x):x=e[17],x}function Ls(s){return s.stopPropagation()}function Rs(s){return s.stopPropagation()}function ue(s){const e=$.c(9),{onOpen:l,children:i,className:n}=s;let r;e[0]!==l?(r=o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),l())},e[0]=l,e[1]=r):r=e[1];let a;e[2]!==n?(a=Z("group/card flex cursor-pointer flex-col gap-3 rounded-2xl border border-border bg-background p-4 text-left transition-colors hover:border-border hover:bg-muted/40",n),e[2]=n,e[3]=a):a=e[3];let c;return e[4]!==i||e[5]!==l||e[6]!==r||e[7]!==a?(c=t.jsx("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:r,className:a,children:i}),e[4]=i,e[5]=l,e[6]=r,e[7]=a,e[8]=c):c=e[8],c}function me(s){const e=$.c(19),{icon:l,name:i,meta:n,subtitle:r,publicState:a,actions:c}=s;let o;e[0]!==i?(o=t.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",title:i,children:i}),e[0]=i,e[1]=o):o=e[1];let d;e[2]!==a?(d=a&&t.jsx(Bs,{state:a}),e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=n&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:n}),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==o||e[7]!==d||e[8]!==u?(f=t.jsxs("div",{className:"flex items-start gap-3",children:[o,d,u]}),e[6]=o,e[7]=d,e[8]=u,e[9]=f):f=e[9];let m;e[10]!==r?(m=r&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",title:r,children:r}),e[10]=r,e[11]=m):m=e[11];let h;e[12]!==f||e[13]!==m?(h=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[f,m]}),e[12]=f,e[13]=m,e[14]=h):h=e[14];let x;return e[15]!==c||e[16]!==l||e[17]!==h?(x=t.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[l,h,c]}),e[15]=c,e[16]=l,e[17]=h,e[18]=x):x=e[18],x}function ze(s){const e=$.c(17),{name:l,meta:i,subtitle:n,glyph:r,readOnly:a,publicState:c,onOpen:o,onShare:d,onDelete:u}=s;let f;e[0]!==r||e[1]!==a?(f=t.jsx(bs,{glyph:r,readOnly:a,className:"size-8 shrink-0"}),e[0]=r,e[1]=a,e[2]=f):f=e[2];let m;e[3]!==l||e[4]!==u||e[5]!==d?(m=d||u?t.jsxs(Te,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:qs,"aria-label":`Actions for ${l}`,children:t.jsx(Se,{size:14})})}),t.jsxs(De,{align:"end",onClick:_s,children:[d&&t.jsx(Ve,{onShare:d}),u&&t.jsxs(te,{variant:"destructive",onClick:u,children:[t.jsx($e,{size:14}),"Delete"]})]})]}):void 0,e[3]=l,e[4]=u,e[5]=d,e[6]=m):m=e[6];let h;e[7]!==i||e[8]!==l||e[9]!==c||e[10]!==n||e[11]!==f||e[12]!==m?(h=t.jsx(me,{icon:f,name:l,meta:i,subtitle:n,publicState:c,actions:m}),e[7]=i,e[8]=l,e[9]=c,e[10]=n,e[11]=f,e[12]=m,e[13]=h):h=e[13];let x;return e[14]!==o||e[15]!==h?(x=t.jsx(ue,{onOpen:o,children:h}),e[14]=o,e[15]=h,e[16]=x):x=e[16],x}function _s(s){return s.stopPropagation()}function qs(s){return s.stopPropagation()}function bt(s){const e=$.c(22),{filename:l,updatedAt:i,downloadUrl:n,subtitle:r,publicState:a,onOpen:c,onShare:o,onDelete:d}=s;let u;e[0]!==l?(u=t.jsx(ne,{filename:l,className:"h-8 w-6.5 shrink-0"}),e[0]=l,e[1]=u):u=e[1];let f;e[2]!==i?(f=fe(i),e[2]=i,e[3]=f):f=e[3];let m;e[4]!==l||e[5]!==r?(m=r??dt(l),e[4]=l,e[5]=r,e[6]=m):m=e[6];let h;e[7]!==n||e[8]!==l||e[9]!==d||e[10]!==o?(h=t.jsx(gt,{downloadUrl:n,filename:l,onShare:o,onDelete:d}),e[7]=n,e[8]=l,e[9]=d,e[10]=o,e[11]=h):h=e[11];let x;e[12]!==l||e[13]!==a||e[14]!==u||e[15]!==f||e[16]!==m||e[17]!==h?(x=t.jsx(me,{icon:u,name:l,meta:f,subtitle:m,publicState:a,actions:h}),e[12]=l,e[13]=a,e[14]=u,e[15]=f,e[16]=m,e[17]=h,e[18]=x):x=e[18];let b;return e[19]!==c||e[20]!==x?(b=t.jsx(ue,{onOpen:c,children:x}),e[19]=c,e[20]=x,e[21]=b):b=e[21],b}function Is(s){const e=$.c(40),{dirName:l,updatedAt:i,skillMdUrl:n,publicState:r,onOpen:a,onBrowse:c,onShare:o,onDelete:d}=s;let u;e[0]!==n?(u=L.fileText(n),e[0]=n,e[1]=u):u=e[1];let f;e[2]!==n?(f=async()=>{const q=await fetch(n,{credentials:"include"});if(!q.ok)throw new Error(`fetch failed: ${q.status}`);return q.text()},e[2]=n,e[3]=f):f=e[3];let m;e[4]!==u||e[5]!==f?(m={queryKey:u,queryFn:f,staleTime:6e4,retry:!1},e[4]=u,e[5]=f,e[6]=m):m=e[6];const{data:h}=Y(m);let x;e[7]!==h?(x=h?xt(h):null,e[7]=h,e[8]=x):x=e[8];const b=x;let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:t.jsx(Le,{size:16})}),e[9]=j):j=e[9];const v=b?.name??l;let g;e[10]!==i?(g=fe(i),e[10]=i,e[11]=g):g=e[11];const w=`Actions for ${l}`;let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Se,{size:14}),e[12]=C):C=e[12];let k;e[13]!==w?(k=t.jsx(Ce,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Vs,"aria-label":w,children:C})}),e[13]=w,e[14]=k):k=e[14];let S;e[15]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(at,{size:14}),e[15]=S):S=e[15];let D;e[16]!==c?(D=t.jsxs(te,{onClick:c,children:[S,"Browse files"]}),e[16]=c,e[17]=D):D=e[17];let T;e[18]!==o?(T=o&&t.jsx(Ve,{onShare:o}),e[18]=o,e[19]=T):T=e[19];let P;e[20]!==d?(P=d&&t.jsxs(te,{variant:"destructive",onClick:d,children:[t.jsx($e,{size:14}),"Delete"]}),e[20]=d,e[21]=P):P=e[21];let F;e[22]!==D||e[23]!==T||e[24]!==P?(F=t.jsxs(De,{align:"end",onClick:Ks,children:[D,T,P]}),e[22]=D,e[23]=T,e[24]=P,e[25]=F):F=e[25];let p;e[26]!==k||e[27]!==F?(p=t.jsxs(Te,{children:[k,F]}),e[26]=k,e[27]=F,e[28]=p):p=e[28];let z;e[29]!==r||e[30]!==p||e[31]!==v||e[32]!==g?(z=t.jsx(me,{icon:j,name:v,meta:g,subtitle:"Skill",publicState:r,actions:p}),e[29]=r,e[30]=p,e[31]=v,e[32]=g,e[33]=z):z=e[33];const O=b?.description??"";let M;e[34]!==O?(M=t.jsx("p",{className:"line-clamp-2 min-h-8 text-xs leading-4 text-muted-foreground",children:O}),e[34]=O,e[35]=M):M=e[35];let _;return e[36]!==a||e[37]!==z||e[38]!==M?(_=t.jsxs(ue,{onOpen:a,children:[z,M]}),e[36]=a,e[37]=z,e[38]=M,e[39]=_):_=e[39],_}function Ks(s){return s.stopPropagation()}function Vs(s){return s.stopPropagation()}function Hs(s){const e=$.c(47),{dirName:l,updatedAt:i,tokensUrl:n,onOpen:r,onBrowse:a,onDelete:c}=s;let o;e[0]!==n?(o=L.fileText(n),e[0]=n,e[1]=o):o=e[1];let d;e[2]!==n?(d=async()=>{const w=await fetch(n,{credentials:"include"});if(!w.ok)throw new Error(`fetch failed: ${w.status}`);return w.text()},e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o||e[5]!==d?(u={queryKey:o,queryFn:d,staleTime:6e4,retry:!1},e[4]=o,e[5]=d,e[6]=u):u=e[6];const{data:f}=Y(u);let m,h,x,b,j;if(e[7]!==f||e[8]!==l||e[9]!==a||e[10]!==c||e[11]!==r||e[12]!==i){const w=f?pt(f).filter(Ys).slice(0,6):[];m=ue,b=r;let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:t.jsx(je,{size:16})}),e[18]=C):C=e[18];let k;e[19]!==i?(k=fe(i),e[19]=i,e[20]=k):k=e[20];const S=`Actions for ${l}`;let D;e[21]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Se,{size:14}),e[21]=D):D=e[21];let T;e[22]!==S?(T=t.jsx(Ce,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Ws,"aria-label":S,children:D})}),e[22]=S,e[23]=T):T=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(at,{size:14}),e[24]=P):P=e[24];let F;e[25]!==a?(F=t.jsxs(te,{onClick:a,children:[P,"Browse files"]}),e[25]=a,e[26]=F):F=e[26];let p;e[27]!==c?(p=c&&t.jsxs(te,{variant:"destructive",onClick:c,children:[t.jsx($e,{size:14}),"Delete"]}),e[27]=c,e[28]=p):p=e[28];let z;e[29]!==F||e[30]!==p?(z=t.jsxs(De,{align:"end",onClick:Qs,children:[F,p]}),e[29]=F,e[30]=p,e[31]=z):z=e[31];let O;e[32]!==T||e[33]!==z?(O=t.jsxs(Te,{children:[T,z]}),e[32]=T,e[33]=z,e[34]=O):O=e[34],e[35]!==l||e[36]!==O||e[37]!==k?(j=t.jsx(me,{icon:C,name:l,meta:k,subtitle:"Brand",actions:O}),e[35]=l,e[36]=O,e[37]=k,e[38]=j):j=e[38],h="flex min-h-5 items-center gap-1.5",x=w.map(Gs),e[7]=f,e[8]=l,e[9]=a,e[10]=c,e[11]=r,e[12]=i,e[13]=m,e[14]=h,e[15]=x,e[16]=b,e[17]=j}else m=e[13],h=e[14],x=e[15],b=e[16],j=e[17];let v;e[39]!==h||e[40]!==x?(v=t.jsx("div",{className:h,children:x}),e[39]=h,e[40]=x,e[41]=v):v=e[41];let g;return e[42]!==m||e[43]!==b||e[44]!==j||e[45]!==v?(g=t.jsxs(m,{onOpen:b,children:[j,v]}),e[42]=m,e[43]=b,e[44]=j,e[45]=v,e[46]=g):g=e[46],g}function Gs(s){return t.jsx("span",{className:"size-5 rounded-full border border-border/60",style:{backgroundColor:s.value},title:`${s.name}: ${s.value}`},s.name)}function Qs(s){return s.stopPropagation()}function Ws(s){return s.stopPropagation()}function Ys(s){return s.isColor}function Ue(s){const e=$.c(4),{children:l}=s,[i,n]=B.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>o=>{if(!o)return;const d=new IntersectionObserver(u=>{const[f]=u;f?.isIntersecting&&(n(!0),d.disconnect())},{rootMargin:"200px"});d.observe(o)},e[0]=r):r=e[0];const[a]=B.useState(r);if(i){let o;return e[1]!==l?(o=t.jsx(t.Fragment,{children:l}),e[1]=l,e[2]=o):o=e[2],o}let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{ref:a,className:"h-full w-full"}),e[3]=c):c=e[3],c}function Xs(s){const e=$.c(11),{url:l}=s;let i;e[0]!==l?(i=L.fileText(l),e[0]=l,e[1]=i):i=e[1];let n;e[2]!==l?(n=async()=>{const d=await fetch(l,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=l,e[3]=n):n=e[3];let r;e[4]!==i||e[5]!==n?(r={queryKey:i,queryFn:n,staleTime:6e4,retry:!1},e[4]=i,e[5]=n,e[6]=r):r=e[6];const{data:a}=Y(r);if(!a)return null;let c;e[7]!==a?(c=a.slice(0,2e3),e[7]=a,e[8]=c):c=e[8];let o;return e[9]!==c?(o=t.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:c}),e[9]=c,e[10]=o):o=e[10],o}function Zs(s){const e=$.c(23),{url:l,ext:i}=s;let n;e[0]!==l?(n=L.csvThumb(l),e[0]=l,e[1]=n):n=e[1];let r;e[2]!==l?(r=async()=>{const j=await fetch(l,{credentials:"include",headers:{Range:"bytes=0-8191"}});if(!j.ok)throw new Error(`fetch failed: ${j.status}`);return j.text()},e[2]=l,e[3]=r):r=e[3];let a;e[4]!==n||e[5]!==r?(a={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=a):a=e[6];const{data:c}=Y(a);if(!c)return null;const o=i==="tsv"?" ":",";let d,u,f,m;if(e[7]!==c||e[8]!==o){m=Symbol.for("react.early_return_sentinel");e:{let j;e[13]!==o?(j=g=>g.split(o).slice(0,6).map(tl),e[13]=o,e[14]=j):j=e[14];const v=c.split(`
9
- `).filter(Boolean).slice(0,7).map(j);if(v.length===0){m=null;break e}f="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",u="w-full border-collapse",d=v.map(Js)}e[7]=c,e[8]=o,e[9]=d,e[10]=u,e[11]=f,e[12]=m}else d=e[9],u=e[10],f=e[11],m=e[12];if(m!==Symbol.for("react.early_return_sentinel"))return m;let h;e[15]!==d?(h=t.jsx("tbody",{children:d}),e[15]=d,e[16]=h):h=e[16];let x;e[17]!==u||e[18]!==h?(x=t.jsx("table",{className:u,children:h}),e[17]=u,e[18]=h,e[19]=x):x=e[19];let b;return e[20]!==f||e[21]!==x?(b=t.jsx("div",{className:f,children:x}),e[20]=f,e[21]=x,e[22]=b):b=e[22],b}function Js(s,e){return t.jsx("tr",{className:Z(e===0&&"bg-muted/50 font-medium"),children:s.map(el)},e)}function el(s,e){return t.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:t.jsx("span",{className:"block truncate",children:s})},e)}function tl(s){return s.trim().replace(/^"|"$/g,"")}function sl(s){const e=$.c(14),{filename:l,size:i,downloadUrl:n}=s;let r;if(e[0]!==n||e[1]!==l||e[2]!==i){const a=Us(l);let c;if(Fs.has(a)){let o;e[4]!==n?(o=t.jsx("img",{src:n,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=n,e[5]=o):o=e[5],c=o}else if(Es.has(a)){const o=`${n}#t=0.1`;let d;e[6]!==o?(d=t.jsx(Ue,{children:t.jsx("video",{src:o,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=o,e[7]=d):d=e[7],c=d}else if(a==="pdf"){let o;e[8]!==l?(o=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(ne,{filename:l,className:"h-14 w-11 opacity-60"})}),e[8]=l,e[9]=o):o=e[9],c=o}else if(Os.has(a))c=t.jsx(Ue,{children:t.jsx(Zs,{url:n,ext:a})});else if(As.has(a)&&i<=Ms){let o;e[10]!==n?(o=t.jsx(Ue,{children:t.jsx(Xs,{url:n})}),e[10]=n,e[11]=o):o=e[11],c=o}else{let o;e[12]!==l?(o=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(ne,{filename:l,className:"h-14 w-11 opacity-60"})}),e[12]=l,e[13]=o):o=e[13],c=o}r=t.jsx("div",{className:"aspect-[400/265] w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",children:c}),e[0]=n,e[1]=l,e[2]=i,e[3]=r}else r=e[3];return r}function ll(s){const e=$.c(27),l=s.onOpen;let i;e[0]!==s.filename?(i=t.jsx(ne,{filename:s.filename,className:"h-8 w-6.5 shrink-0"}),e[0]=s.filename,e[1]=i):i=e[1];const n=s.filename;let r;e[2]!==s.updatedAt?(r=fe(s.updatedAt),e[2]=s.updatedAt,e[3]=r):r=e[3];let a;e[4]!==s.filename||e[5]!==s.subtitle?(a=s.subtitle??dt(s.filename),e[4]=s.filename,e[5]=s.subtitle,e[6]=a):a=e[6];let c;e[7]!==s.downloadUrl||e[8]!==s.filename||e[9]!==s.onDelete||e[10]!==s.onShare?(c=t.jsx(gt,{downloadUrl:s.downloadUrl,filename:s.filename,onShare:s.onShare,onDelete:s.onDelete}),e[7]=s.downloadUrl,e[8]=s.filename,e[9]=s.onDelete,e[10]=s.onShare,e[11]=c):c=e[11];let o;e[12]!==s.filename||e[13]!==s.publicState||e[14]!==i||e[15]!==r||e[16]!==a||e[17]!==c?(o=t.jsx(me,{icon:i,name:n,meta:r,subtitle:a,publicState:s.publicState,actions:c}),e[12]=s.filename,e[13]=s.publicState,e[14]=i,e[15]=r,e[16]=a,e[17]=c,e[18]=o):o=e[18];let d;e[19]!==s.downloadUrl||e[20]!==s.filename||e[21]!==s.size?(d=t.jsx(sl,{filename:s.filename,size:s.size,downloadUrl:s.downloadUrl}),e[19]=s.downloadUrl,e[20]=s.filename,e[21]=s.size,e[22]=d):d=e[22];let u;return e[23]!==s.onOpen||e[24]!==o||e[25]!==d?(u=t.jsxs(ue,{onOpen:l,children:[o,d]}),e[23]=s.onOpen,e[24]=o,e[25]=d,e[26]=u):u=e[26],u}async function nl(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}const il=`
10
- *{box-sizing:border-box}
11
- body{margin:0;padding:24px;background:var(--brand-bg,#0b0f1a);color:var(--brand-fg,#f5f7ff);font-family:var(--brand-font-body,system-ui,sans-serif);font-size:14px;line-height:1.5}
12
- .stack{display:flex;flex-direction:column;gap:18px;max-width:760px}
13
- .row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
14
- h1{font-family:var(--brand-font-display,inherit);font-size:28px;font-weight:700;letter-spacing:-0.02em;margin:0}
15
- .muted{color:var(--brand-fg-muted,#9fb0c9)}
16
- .btn{border:0;border-radius:var(--brand-radius,12px);padding:10px 16px;font:inherit;font-weight:600;cursor:pointer}
17
- .btn-primary{background:var(--brand-primary,#0a84ff);color:#fff}
18
- .btn-secondary{background:transparent;color:var(--brand-fg,#f5f7ff);border:1.5px solid var(--brand-border-strong,rgba(255,255,255,.22))}
19
- .btn-ghost{background:transparent;color:var(--brand-fg-muted,#9fb0c9)}
20
- .card{background:var(--brand-bg-subtle,#121826);border:1px solid var(--brand-border,rgba(255,255,255,.1));border-radius:var(--brand-radius-lg,16px);padding:20px;box-shadow:var(--brand-shadow-md,0 6px 16px rgba(8,12,22,.45))}
21
- .kpi{font-family:var(--brand-font-display,inherit);font-size:44px;font-weight:700;color:var(--brand-primary,#0a84ff);line-height:1;letter-spacing:-0.02em}
22
- .input{width:100%;background:var(--brand-bg-elevated,#1a2233);border:1.5px solid var(--brand-border,rgba(255,255,255,.12));border-radius:var(--brand-radius,12px);padding:10px 12px;color:inherit;font:inherit}
23
- .badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 10px;font-size:12px;font-weight:600}
24
- .badge-success{background:var(--brand-success-bg,#e7f6ec);color:var(--brand-success-fg,#0f7a37)}
25
- .badge-warning{background:var(--brand-warning-bg,#fdf3d6);color:var(--brand-warning-fg,#8a6500)}
26
- .badge-error{background:var(--brand-error-bg,#fde7e8);color:var(--brand-error-fg,#b01319)}
27
- .badge-info{background:var(--brand-info-bg,#e8f1ff);color:var(--brand-info-fg,#0b54a8)}
28
- .chip{border:1.5px solid var(--brand-border-strong,rgba(255,255,255,.22));border-radius:999px;padding:6px 14px;font-size:13px}
29
- .chip-active{background:var(--brand-primary,#0a84ff);border-color:transparent;color:#fff}
30
- `,rl=`
31
- <div class="stack">
32
- <div>
33
- <h1>Your brand, applied</h1>
34
- <p class="muted" style="margin:6px 0 0">Buttons, cards, inputs and badges in your tokens.</p>
35
- </div>
36
- <div class="row">
37
- <button class="btn btn-primary">Primary</button>
38
- <button class="btn btn-secondary">Secondary</button>
39
- <button class="btn btn-ghost">Ghost</button>
40
- </div>
41
- <div class="card">
42
- <p class="muted" style="margin:0 0 6px">Monthly savings</p>
43
- <div class="kpi">$240</div>
44
- </div>
45
- <input class="input" placeholder="you@example.com" />
46
- <div class="row">
47
- <span class="badge badge-success">Success</span>
48
- <span class="badge badge-warning">Warning</span>
49
- <span class="badge badge-error">Error</span>
50
- <span class="badge badge-info">Info</span>
51
- </div>
52
- <div class="row">
53
- <span class="chip chip-active">All</span>
54
- <span class="chip">Income</span>
55
- <span class="chip">Spending</span>
56
- </div>
57
- </div>
58
- `;function al(s){return`<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><style>${s??""}</style><style>${il}</style></head><body>${rl}</body></html>`}function ol(s){const e=$.c(13),{tokensUrl:l}=s;let i;e[0]!==l?(i=L.fileText(l??""),e[0]=l,e[1]=i):i=e[1];const n=!!l;let r;e[2]!==l?(r=()=>nl(l??""),e[2]=l,e[3]=r):r=e[3];let a;e[4]!==i||e[5]!==n||e[6]!==r?(a={queryKey:i,enabled:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=i,e[5]=n,e[6]=r,e[7]=a):a=e[7];const c=Y(a);if(l&&c.isPending){let f;return e[8]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(V,{className:"h-full w-full rounded-xl"})}),e[8]=f):f=e[8],f}const o=c.data??null;let d;e[9]!==o?(d=al(o),e[9]=o,e[10]=d):d=e[10];let u;return e[11]!==d?(u=t.jsx("iframe",{title:"Brand components",srcDoc:d,sandbox:"",className:"block h-full w-full border-0 bg-white"}),e[11]=d,e[12]=u):u=e[12],u}const cl="Theme preview",dl=[`<section class="slide-center">
59
- <p class="eyebrow">Brand deck</p>
60
- <h1 class="deck-h1">Your brand, on every slide</h1>
61
- <p class="deck-sub">A live preview of each slide layout in your brand style.</p>
62
- <p class="deck-meta">Theme preview</p>
63
- </section>`,`<section>
64
- <p class="eyebrow">Agenda</p>
65
- <h2 class="deck-h2">What's in this theme</h2>
66
- <ol class="agenda">
67
- <li>Title &amp; section dividers</li>
68
- <li>Bulleted content</li>
69
- <li>Side-by-side columns</li>
70
- <li>Metrics &amp; timelines</li>
71
- <li>Quotes &amp; closing</li>
72
- </ol>
73
- </section>`,`<section class="slide-center divider">
74
- <p class="giant-number">01</p>
75
- <h2 class="deck-h1">Content layouts</h2>
76
- <p class="deck-sub">How text-heavy slides look.</p>
77
- </section>`,`<section>
78
- <p class="eyebrow">Bullets</p>
79
- <h2 class="deck-h2">Key points land cleanly</h2>
80
- <p class="deck-body intro">Short, scannable lines with the brand accent marker.</p>
81
- <ul class="bullets">
82
- <li>Each point is one idea</li>
83
- <li>Accent color draws the eye</li>
84
- <li>Plenty of breathing room</li>
85
- </ul>
86
- </section>`,`<section>
87
- <p class="eyebrow">Two column</p>
88
- <h2 class="deck-h2">Compare side by side</h2>
89
- <div class="cols">
90
- <div class="card grow">
91
- <h3 class="col-title">Before</h3>
92
- <div class="deck-body"><p>Generic slides that ignore your brand.</p></div>
93
- </div>
94
- <div class="card grow">
95
- <h3 class="col-title">After</h3>
96
- <div class="deck-body"><p>Every deck on-brand, automatically.</p></div>
97
- </div>
98
- </div>
99
- </section>`,`<section>
100
- <p class="eyebrow">Metrics</p>
101
- <h2 class="deck-h2">Numbers that matter</h2>
102
- <div class="cols kpis">
103
- <div class="card kpi grow">
104
- <p class="kpi-value">3&times;</p>
105
- <p class="kpi-label">Faster deck creation</p>
106
- <p class="kpi-delta">since adopting the theme</p>
107
- </div>
108
- <div class="card kpi grow">
109
- <p class="kpi-value">100%</p>
110
- <p class="kpi-label">On-brand slides</p>
111
- <p class="kpi-delta">no manual restyling</p>
112
- </div>
113
- <div class="card kpi grow">
114
- <p class="kpi-value">1</p>
115
- <p class="kpi-label">Source of truth</p>
116
- <p class="kpi-delta">tokens.css</p>
117
- </div>
118
- </div>
119
- </section>`,`<section>
120
- <p class="eyebrow">Timeline</p>
121
- <h2 class="deck-h2">How it unfolds</h2>
122
- <div class="cols timeline">
123
- <div class="step grow">
124
- <p class="step-label">Step 1</p>
125
- <h3 class="col-title">Define</h3>
126
- <p class="deck-body">Set brand tokens once.</p>
127
- </div>
128
- <div class="step grow">
129
- <p class="step-label">Step 2</p>
130
- <h3 class="col-title">Generate</h3>
131
- <p class="deck-body">Create decks from data.</p>
132
- </div>
133
- <div class="step grow">
134
- <p class="step-label">Step 3</p>
135
- <h3 class="col-title">Present</h3>
136
- <p class="deck-body">Ship, always on-brand.</p>
137
- </div>
138
- </div>
139
- </section>`,`<section>
140
- <p class="eyebrow">Comparison</p>
141
- <h2 class="deck-h2">Plans at a glance</h2>
142
- <div class="cols">
143
- <div class="card grow">
144
- <h3 class="col-title">Starter</h3>
145
- <ul class="bullets compact">
146
- <li>Core layouts</li>
147
- <li>Brand colors</li>
148
- <li>Logo</li>
149
- </ul>
150
- </div>
151
- <div class="card grow">
152
- <h3 class="col-title">Pro</h3>
153
- <ul class="bullets compact">
154
- <li>Everything in Starter</li>
155
- <li>Custom fonts</li>
156
- <li>Theme shell</li>
157
- </ul>
158
- </div>
159
- </div>
160
- </section>`,`<section class="slide-center">
161
- <blockquote class="deck-quote">&ldquo;Design once, stay on-brand everywhere.&rdquo;</blockquote>
162
- <p class="attribution">Brand system &middot; Studio</p>
163
- </section>`,`<section class="slide-center">
164
- <h2 class="deck-h1">Ready to present</h2>
165
- <p class="deck-sub">Generate a deck with this theme via the slides skill.</p>
166
- <p class="cta">slides-create --theme &hellip;</p>
167
- </section>`].join(`
168
-
169
- `);async function Je(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function fl(s,e){const l=e?`<style>${e}</style>`:"";return s.replaceAll("{{{slides}}}",dl).replaceAll("{{title}}",cl).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${l}</head>`)}function ul(s){const e=$.c(23),{readUrl:l,title:i,tokensUrl:n}=s;let r;e[0]!==l?(r=L.fileText(l),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==l?(a=()=>Je(l),e[2]=l,e[3]=a):a=e[3];let c;e[4]!==r||e[5]!==a?(c={queryKey:r,queryFn:a,staleTime:6e4,retry:!1},e[4]=r,e[5]=a,e[6]=c):c=e[6];const o=Y(c);let d;e[7]!==n?(d=L.fileText(n??""),e[7]=n,e[8]=d):d=e[8];const u=!!n;let f;e[9]!==n?(f=()=>Je(n??""),e[9]=n,e[10]=f):f=e[10];let m;e[11]!==d||e[12]!==u||e[13]!==f?(m={queryKey:d,enabled:u,queryFn:f,staleTime:6e4,retry:!1},e[11]=d,e[12]=u,e[13]=f,e[14]=m):m=e[14];const h=Y(m);if(o.isPending||n&&h.isPending){let v;return e[15]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:t.jsx(V,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[15]=v):v=e[15],v}if(o.isError||!o.data){let v;return e[16]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[16]=v):v=e[16],v}const x=h.data??null;let b;e[17]!==x||e[18]!==o.data?(b=fl(o.data,x),e[17]=x,e[18]=o.data,e[19]=b):b=e[19];let j;return e[20]!==b||e[21]!==i?(j=t.jsx("iframe",{title:i,srcDoc:b,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[20]=b,e[21]=i,e[22]=j):j=e[22],j}async function et(s){const e=await fetch(s,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function oe(s){const e=$.c(2),{children:l}=s;let i;return e[0]!==l?(i=t.jsx("p",{className:"text-sm font-medium text-foreground",children:l}),e[0]=l,e[1]=i):i=e[1],i}function ml(s){const e=$.c(16),{family:l,tokens:i,editing:n,valueOf:r,onEdit:a}=s;let c;e[0]!==l?(c=t.jsx("span",{className:"text-xs text-muted-foreground",children:l}),e[0]=l,e[1]=c):c=e[1];let o;if(e[2]!==n||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==n||e[8]!==a||e[9]!==r?(f=m=>{const h=r(m),x=`${m.name.replace(/^--brand-/,"")}: ${h}`;return n&&/^#/.test(h)?t.jsx("input",{type:"color","aria-label":m.name,title:x,value:$s(h),onChange:b=>a(m.name,b.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},m.name):t.jsx("span",{title:x,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:h}},m.name)},e[7]=n,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=n,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-wrap gap-1",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function hl(s){const e=$.c(9),{token:l,value:i}=s;if(l.kind==="space"){let r;return e[0]!==i?(r=t.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:t.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:i,maxWidth:"100%"}})}),e[0]=i,e[1]=r):r=e[1],r}if(l.kind==="radius"){let r;return e[2]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:i}}),e[2]=i,e[3]=r):r=e[3],r}if(l.kind==="shadow"){let r;return e[4]!==i?(r=t.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:i}}),e[4]=i,e[5]=r):r=e[5],r}if(l.kind==="type"&&/^--brand-text-/.test(l.name)){const r=`min(${i}, 22px)`;let a;return e[6]!==r?(a=t.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:r},children:"Ag"}),e[6]=r,e[7]=a):a=e[7],a}let n;return e[8]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("span",{className:"size-7 shrink-0"}),e[8]=n):n=e[8],n}function vt(s){const e=$.c(17),{token:l,value:i,editing:n,onEdit:r}=s;let a;e[0]!==l||e[1]!==i?(a=t.jsx(hl,{token:l,value:i}),e[0]=l,e[1]=i,e[2]=a):a=e[2];let c;if(e[3]!==l.name){let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=/^--brand-/,e[5]=f):f=e[5],c=l.name.replace(f,""),e[3]=l.name,e[4]=c}else c=e[4];let o;e[6]!==c?(o=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==r||e[10]!==l.name||e[11]!==i?(d=n?t.jsx(we,{value:i,onChange:f=>r(l.name,f.target.value),className:"h-8 w-40 font-mono text-xs"}):t.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:i}),e[8]=n,e[9]=r,e[10]=l.name,e[11]=i,e[12]=d):d=e[12];let u;return e[13]!==a||e[14]!==o||e[15]!==d?(u=t.jsxs("div",{className:"flex items-center gap-3",children:[a,o,d]}),e[13]=a,e[14]=o,e[15]=d,e[16]=u):u=e[16],u}function ae(s){const e=$.c(16),{label:l,tokens:i,editing:n,valueOf:r,onEdit:a}=s;if(i.length===0)return null;let c;e[0]!==l?(c=t.jsx(oe,{children:l}),e[0]=l,e[1]=c):c=e[1];let o;if(e[2]!==n||e[3]!==a||e[4]!==i||e[5]!==r){let f;e[7]!==n||e[8]!==a||e[9]!==r?(f=m=>t.jsx(vt,{token:m,value:r(m),editing:n,onEdit:a},m.name),e[7]=n,e[8]=a,e[9]=r,e[10]=f):f=e[10],o=i.map(f),e[2]=n,e[3]=a,e[4]=i,e[5]=r,e[6]=o}else o=e[6];let d;e[11]!==o?(d=t.jsx("div",{className:"flex flex-col gap-2.5",children:o}),e[11]=o,e[12]=d):d=e[12];let u;return e[13]!==c||e[14]!==d?(u=t.jsxs("div",{className:"flex flex-col gap-3",children:[c,d]}),e[13]=c,e[14]=d,e[15]=u):u=e[15],u}function jt({brandPath:s,onClose:e,variant:l}){const{org:i}=Ne(),n=Ie(s),r=n.volume??"",a=n.dirPath,c=A(a),o=n.readOnly,d=st(),u=de(),f=os(r),{upload:m,remove:h}=Be(r),x=B.useRef(null),b=Ke(r,a),j=b.data??[],v=y=>j.some(U=>U.kind==="file"&&A(U.path)===y),g=v("tokens.css"),w=v("brand.md"),C=v("slides-theme.html"),k=zs(j),S=u(r,`${a}/tokens.css`),D=u(r,`${a}/brand.md`),T=u(r,`${a}/slides-theme.html`),P=Y({queryKey:L.fileText(S),enabled:g,queryFn:()=>et(S),staleTime:6e4,retry:!1}),F=Y({queryKey:L.fileText(D),enabled:w,queryFn:()=>et(D),staleTime:6e4,retry:!1}),[p,z]=B.useState(!1),[O,M]=B.useState({}),[_,q]=B.useState(null),[Q,E]=B.useState(!1),[I,se]=B.useState(!1),[he,pe]=B.useState("deck"),G=P.data?pt(P.data):[],Oe=y=>G.find(U=>U.name===y)?.value,H=y=>O[y.name]??y.value,ie=Ds(G),xe=G.filter(y=>y.kind==="font"),ge=G.filter(y=>y.kind==="type"),N=G.filter(y=>y.kind==="space"),K=G.filter(y=>y.kind==="radius"),re=G.filter(y=>y.kind==="shadow"),Nt=G.filter(y=>y.kind==="motion"),St=G.filter(y=>y.kind==="other"),J=(y,U)=>M(ve=>({...ve,[y]:U})),be=C&&he==="deck",Ee=_??F.data??"",Ae=Object.entries(O).filter(([y,U])=>Oe(y)!==U),Ge=_!==null&&_!==(F.data??""),$t=Ae.length>0||Ge;function Ct(){M({}),q(null),z(!1)}async function Dt(){E(!0);try{if(Ae.length>0){let y=P.data??"";for(const[U,ve]of Ae)y=Ts(y,U,ve);await f.mutateAsync({path:`${a}/tokens.css`,body:y,contentType:"text/css; charset=utf-8"}),d.invalidateQueries({queryKey:L.fileText(S)})}Ge&&_!==null&&(await f.mutateAsync({path:`${a}/brand.md`,body:_,contentType:"text/markdown; charset=utf-8"}),d.invalidateQueries({queryKey:L.fileText(D)})),d.invalidateQueries({queryKey:L.orgFsVolume(i.id,r)}),d.invalidateQueries({queryKey:L.orgFsRecent(i.id)}),M({}),q(null),z(!1),W.success("Brand saved")}catch(y){W.error(y instanceof Error?y.message:"Failed to save brand")}finally{E(!1)}}async function Tt(y){const U=y?.[0];if(!U)return;const Qe=`logo.${(U.name.split(".").pop()??"png").toLowerCase()}`;try{await m.mutateAsync({dir:a,files:[new File([U],Qe,{type:U.type})]}),k&&A(k)!==Qe&&await h.mutateAsync(k),W.success("Logo updated")}catch(We){W.error(We instanceof Error?We.message:"Logo upload failed")}finally{x.current&&(x.current.value="")}}const zt=!b.isPending&&!g&&!w&&!k;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(je,{size:18})}),l==="dialog"?t.jsx(qe,{className:"flex-1 truncate text-base font-medium text-foreground",children:c}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:c}),!o&&(p?t.jsxs(t.Fragment,{children:[t.jsx(R,{variant:"ghost",size:"sm",onClick:Ct,disabled:Q,children:"Cancel"}),t.jsx(R,{size:"sm",disabled:!$t||Q,onClick:()=>{Dt()},children:Q?"Saving…":"Save"})]}):t.jsxs(R,{variant:"outline",size:"sm",onClick:()=>z(!0),children:[t.jsx(At,{size:14}),"Edit"]})),l==="dialog"?t.jsx(ct,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ke,{size:16})})}):t.jsx(R,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:t.jsx(ke,{size:16})})]}),t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:b.isPending?t.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[t.jsx(V,{className:"h-40 w-full rounded-xl"}),t.jsx(V,{className:"h-4 w-1/3"}),t.jsx(V,{className:"h-4 w-2/3"})]}):zt?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This brand is no longer available."}):t.jsxs(t.Fragment,{children:[(C||g)&&t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-label":I?"Show preview":"Hide preview",onClick:()=>se(y=>!y),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),se(U=>!U))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[t.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:y=>y.stopPropagation(),children:[C&&t.jsx("button",{type:"button",onClick:()=>{pe("deck"),se(!1)},className:Z("rounded-md px-2.5 py-1",be?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Deck"}),t.jsx("button",{type:"button",onClick:()=>{pe("components"),se(!1)},className:Z("rounded-md px-2.5 py-1",be?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Components"})]}),I?t.jsx(hs,{size:16,className:"shrink-0 text-muted-foreground"}):t.jsx(ps,{size:16,className:"shrink-0 text-muted-foreground"})]}),!I&&t.jsx("div",{className:"px-4 pb-4",children:t.jsx("div",{className:Z("w-full overflow-hidden rounded-xl border border-border bg-muted/30",be?"aspect-[16/9]":"h-96"),children:be?t.jsx(ul,{readUrl:T,title:`${c} deck theme`,tokensUrl:S}):t.jsx(ol,{tokensUrl:S})})})]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(oe,{children:"Logo"}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:k?t.jsx("img",{src:u(r,k),alt:`${c} logo`,className:"max-h-full max-w-full object-contain"}):t.jsx(je,{size:28,className:"text-muted-foreground/50"})}),p&&t.jsxs("div",{children:[t.jsxs(R,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>x.current?.click(),children:[t.jsx(ye,{size:14}),k?"Replace logo":"Add logo"]}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:y=>{Tt(y.target.files)}})]})]})]}),ie.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(oe,{children:"Colors"}),ie.map(y=>t.jsx(ml,{family:y.family,tokens:y.tokens,editing:p,valueOf:H,onEdit:J},y.family))]}),(xe.length>0||ge.length>0)&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(oe,{children:"Typography"}),xe.map(y=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:y.name.replace(/^--brand-font-?/,"")||"font"}),p?t.jsx(we,{value:H(y),onChange:U=>J(y.name,U.target.value),className:"h-9"}):t.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:H(y)},children:H(y)})]},y.name)),ge.map(y=>t.jsx(vt,{token:y,value:H(y),editing:p,onEdit:J},y.name))]}),t.jsx(ae,{label:"Spacing",tokens:N,editing:p,valueOf:H,onEdit:J}),t.jsx(ae,{label:"Radius",tokens:K,editing:p,valueOf:H,onEdit:J}),t.jsx(ae,{label:"Shadows",tokens:re,editing:p,valueOf:H,onEdit:J}),t.jsx(ae,{label:"Motion",tokens:Nt,editing:p,valueOf:H,onEdit:J}),t.jsx(ae,{label:"Tokens",tokens:St,editing:p,valueOf:H,onEdit:J}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(oe,{children:"Voice & guidelines"}),p?t.jsx(ms,{value:Ee,onChange:y=>q(y.target.value),placeholder:"Describe the brand voice, tone, do's and don'ts…",className:"min-h-48 font-mono text-sm"}):F.isPending&&w?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(V,{className:"h-3 w-full"}),t.jsx(V,{className:"h-3 w-5/6"})]}):Ee.trim()?t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t.jsx(ft,{id:`brand-preview-${s}`,text:Ee})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"No brand voice written yet."})]})]})]})})]})}function pl(s){const e=$.c(8),{brandPath:l,onClose:i}=s;let n;e[0]!==i?(n=c=>{c||i()},e[0]=i,e[1]=n):n=e[1];let r;e[2]!==l||e[3]!==i?(r=t.jsx(Re,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:t.jsx(jt,{brandPath:l,onClose:i,variant:"dialog"})}),e[2]=l,e[3]=i,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==r?(a=t.jsx(_e,{open:!0,onOpenChange:n,children:r}),e[5]=n,e[6]=r,e[7]=a):a=e[7],a}function xl(s){const e=$.c(3),{brandPath:l,onClose:i}=s;let n;return e[0]!==l||e[1]!==i?(n=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(jt,{brandPath:l,onClose:i,variant:"panel"})}),e[0]=l,e[1]=i,e[2]=n):n=e[2],n}function yt(s){const e=$.c(23),{skillPath:l,onClose:i,variant:n}=s,r=Ie(l),{volume:a,dirPath:c}=r,o=de(),d=o(a??"",`${c}/SKILL.md`),u=L.fileText(d);let f;e[0]!==d?(f=async()=>{const E=await fetch(d,{credentials:"include"});if(!E.ok)throw new Error(`fetch failed: ${E.status}`);return E.text()},e[0]=d,e[1]=f):f=e[1];let m;e[2]!==u||e[3]!==f?(m={queryKey:u,queryFn:f,staleTime:6e4,retry:!1},e[2]=u,e[3]=f,e[4]=m):m=e[4];const h=Y(m),x=Ke(a??"",c);let b;e[5]!==c?(b=A(c),e[5]=c,e[6]=b):b=e[6];const j=b;let v;e[7]!==h.data?(v=h.data?xt(h.data):null,e[7]=h.data,e[8]=v):v=e[8];const g=v,w=bl;let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=(E,I)=>w(E.path)?-1:w(I.path)?1:A(E.path).localeCompare(A(I.path)),e[9]=C):C=e[9];const k=(x.data??[]).filter(gl).sort(C),[S,D]=B.useState(null),T=S===null?null:k.find(E=>E.path===S)??null,P=g?.name??j;let F;e[10]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Le,{size:18})}),e[10]=F):F=e[10];let p;e[11]!==P||e[12]!==n?(p=n==="dialog"?t.jsx(qe,{className:"flex-1 truncate text-base font-medium text-foreground",children:P}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:P}),e[11]=P,e[12]=n,e[13]=p):p=e[13];let z;e[14]!==i||e[15]!==n?(z=n==="dialog"?t.jsx(ct,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(ke,{size:16})})}):t.jsx(R,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:i,children:t.jsx(ke,{size:16})}),e[14]=i,e[15]=n,e[16]=z):z=e[16];let O;e[17]!==p||e[18]!==z?(O=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[F,p,z]}),e[17]=p,e[18]=z,e[19]=O):O=e[19];let M;e[20]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[20]=M):M=e[20];const _="relative flex min-w-0 flex-1 flex-col overflow-y-auto",q=T?t.jsx(Jt,{file:{key:T.path,filename:A(T.path),size:T.size,downloadUrl:o(a??"",T.path)}}):h.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(V,{className:"h-4 w-1/3"}),t.jsx(V,{className:"h-3 w-full"}),t.jsx(V,{className:"h-3 w-5/6"}),t.jsx(V,{className:"h-3 w-2/3"})]}):h.isError||!g?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:g.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ft,{id:`skill-preview-${l}`,text:g.body})})]});let Q;return e[21]!==q?(Q=t.jsx("div",{className:_,children:q}),e[21]=q,e[22]=Q):Q=e[22],t.jsxs(t.Fragment,{children:[O,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[M,x.isPending?t.jsx(V,{className:"mx-2 h-4 w-24"}):k.map(E=>{const I=w(E.path)?T===null:S===E.path;return t.jsxs("button",{type:"button",onClick:()=>D(w(E.path)?null:E.path),className:Z("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",I?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(ne,{filename:A(E.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:Z("truncate text-sm",I?"text-foreground":"text-muted-foreground"),children:A(E.path)})]},E.path)})]}),Q]})]})}function gl(s){return s.kind==="file"}function bl(s){return A(s)==="SKILL.md"}function vl(s){const e=$.c(8),{skillPath:l,onClose:i}=s;let n;e[0]!==i?(n=c=>{c||i()},e[0]=i,e[1]=n):n=e[1];let r;e[2]!==i||e[3]!==l?(r=t.jsx(Re,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:t.jsx(yt,{skillPath:l,onClose:i,variant:"dialog"})}),e[2]=i,e[3]=l,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==r?(a=t.jsx(_e,{open:!0,onOpenChange:n,children:r}),e[5]=n,e[6]=r,e[7]=a):a=e[7],a}function jl(s){const e=$.c(3),{skillPath:l,onClose:i}=s;let n;return e[0]!==i||e[1]!==l?(n=t.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:t.jsx(yt,{skillPath:l,onClose:i,variant:"panel"})}),e[0]=i,e[1]=l,e[2]=n):n=e[2],n}function He(s){return`${window.location.origin}${s}`}function ce(s){if(s.shareMode==="password")return"password";if(s.shareMode==="public"||s.readPublic)return"public";if(s.effectivePublic)return"inherited"}const wt=[{id:"home",description:"Your organization's home folder",glyph:Mt},{id:"uploads",description:"Files your team uploads",glyph:ye},{id:"outputs",description:"Agent run outputs",glyph:Lt}],yl=6;function kt(s,e,l){const i=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",n=ut(s),r=n?`public/${n}`:s==="home"?ht(l):s;return i?`${r}/${i}`:r}function ee(s){const e=$.c(2),{children:l}=s;let i;return e[0]!==l?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:l}),e[0]=l,e[1]=i):i=e[1],i}function X(s){const e=$.c(2),{children:l}=s;let i;return e[0]!==l?(i=t.jsx("div",{className:"@container",children:t.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3",children:l})}),e[0]=l,e[1]=i):i=e[1],i}function Pe(s){const e=$.c(2),{rows:l}=s,i=l===void 0?1:l;let n;return e[0]!==i?(n=t.jsx(X,{children:Array.from({length:i*3},wl)}),e[0]=i,e[1]=n):n=e[1],n}function wl(s,e){return t.jsx(V,{className:"h-16 rounded-2xl"},e)}function Fe(s){const e=$.c(2),{children:l}=s;let i;return e[0]!==l?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:l}),e[0]=l,e[1]=i):i=e[1],i}function kl(s){const e=$.c(6),{volume:l,displayName:i,description:n,glyph:r,onOpen:a}=s,c=fs(l),o=i??l,d=c.data?`${c.data.files} files`:void 0;let u;return e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==o||e[4]!==d?(u=t.jsx(ze,{name:o,meta:d,subtitle:n,glyph:r,onOpen:a}),e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=d,e[5]=u):u=e[5],u}function Nl(s){const e=$.c(8),{segments:l,onNavigate:i}=s;let n;e[0]!==i?(n=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=n):n=e[1];let r;e[2]!==i||e[3]!==l?(r=l.map((c,o)=>{const d=l.slice(0,o+1).join("/"),u=o===l.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(Ft,{size:12,className:"shrink-0 text-muted-foreground"}),u?t.jsx("span",{className:"truncate font-medium text-foreground",children:c}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:c})]},d)}),e[2]=i,e[3]=l,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==r?(a=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[n,r]}),e[5]=n,e[6]=r,e[7]=a):a=e[7],a}function Sl(s){const e=$.c(32),{query:l,stale:i,onOpenFile:n,onShare:r,onDelete:a}=s,{org:c}=Ne(),o=de(),d=cs(l);let u;e[0]!==o||e[1]!==r?(u=k=>r({volume:k.volume,path:k.path,kind:"file",shareMode:k.shareMode??"private",effectivePublic:k.effectivePublic??!1,url:He(o(k.volume,k.path))}),e[0]=o,e[1]=r,e[2]=u):u=e[2];const f=u;if(d.isPending){let k;return e[3]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{rows:2}),e[3]=k):k=e[3],k}let m;e[4]!==d.data?(m=d.data??[],e[4]=d.data,e[5]=m):m=e[5];const h=m;if(h.length===0){let k;return e[6]!==l?(k=t.jsxs(Fe,{children:["No files match “",l,"”."]}),e[6]=l,e[7]=k):k=e[7],k}const x=(i||d.isPlaceholderData)&&"opacity-50";let b;e[8]!==x?(b=Z("flex flex-col gap-3",x),e[8]=x,e[9]=b):b=e[9];const j=h.length===1?"result":"results";let v;e[10]!==h.length||e[11]!==j?(v=t.jsxs(ee,{children:[h.length," ",j]}),e[10]=h.length,e[11]=j,e[12]=v):v=e[12];let g;if(e[13]!==o||e[14]!==a||e[15]!==n||e[16]!==c||e[17]!==h||e[18]!==f){let k;e[20]!==o||e[21]!==a||e[22]!==n||e[23]!==c||e[24]!==f?(k=S=>{const D=ut(S.volume)!==null;return t.jsx(bt,{filename:A(S.path),updatedAt:S.updatedAt,downloadUrl:o(S.volume,S.path),subtitle:kt(S.volume,S.path,c.slug),publicState:ce(S),onOpen:()=>n(rs(S.volume,S.path)),onShare:D?void 0:()=>f(S),onDelete:D?void 0:()=>a({volume:S.volume,path:S.path,kind:"file"})},`${S.volume}/${S.path}`)},e[20]=o,e[21]=a,e[22]=n,e[23]=c,e[24]=f,e[25]=k):k=e[25],g=h.map(k),e[13]=o,e[14]=a,e[15]=n,e[16]=c,e[17]=h,e[18]=f,e[19]=g}else g=e[19];let w;e[26]!==g?(w=t.jsx(X,{children:g}),e[26]=g,e[27]=w):w=e[27];let C;return e[28]!==b||e[29]!==v||e[30]!==w?(C=t.jsxs("div",{className:b,children:[v,w]}),e[28]=b,e[29]=v,e[30]=w,e[31]=C):C=e[31],C}function $l(s){const e=$.c(24),{onOpenDir:l,onOpenFile:i,onShare:n,onDelete:r}=s,{org:a}=Ne(),c=ds(),o=mt(),d=de();let u;e[0]!==d||e[1]!==n?(u=g=>n({volume:g.volume,path:g.path,kind:"file",shareMode:g.shareMode??"private",effectivePublic:g.effectivePublic??!1,url:He(d(g.volume,g.path))}),e[0]=d,e[1]=n,e[2]=u):u=e[2];const f=u;let m;if(e[3]!==d||e[4]!==r||e[5]!==i||e[6]!==a||e[7]!==c.data||e[8]!==c.isPending||e[9]!==f){const g=(c.data??[]).slice(0,yl);m=c.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ee,{children:"Recently added"}),t.jsx(Pe,{})]}):g.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ee,{children:"Recently added"}),t.jsx(X,{children:g.map(w=>t.jsx(ll,{filename:A(w.path),updatedAt:w.updatedAt,size:w.size,downloadUrl:d(w.volume,w.path),subtitle:kt(w.volume,w.path,a.slug),publicState:ce(w),onOpen:()=>i(`${w.volume}/${w.path}`),onShare:()=>f(w),onDelete:()=>r({volume:w.volume,path:w.path,kind:"file"})},`${w.volume}/${w.path}`))})]}):t.jsx(Fe,{children:"No files yet — upload one, or ask an agent to produce something."}),e[3]=d,e[4]=r,e[5]=i,e[6]=a,e[7]=c.data,e[8]=c.isPending,e[9]=f,e[10]=m}else m=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ee,{children:"Folders"}),e[11]=h):h=e[11];let x;e[12]!==l||e[13]!==a?(x=wt.map(g=>t.jsx(kl,{volume:g.id,displayName:g.id==="home"?ht(a.slug):void 0,description:g.description,glyph:g.glyph,onOpen:()=>l(g.id)},g.id)),e[12]=l,e[13]=a,e[14]=x):x=e[14];let b;e[15]!==l||e[16]!==o.data?.length?(b=(o.data?.length??0)>0&&t.jsx(ze,{name:"public",meta:`${o.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:rt,readOnly:!0,onOpen:()=>l("public")}),e[15]=l,e[16]=o.data?.length,e[17]=b):b=e[17];let j;e[18]!==x||e[19]!==b?(j=t.jsxs("div",{className:"flex flex-col gap-3",children:[h,t.jsxs(X,{children:[x,b]})]}),e[18]=x,e[19]=b,e[20]=j):j=e[20];let v;return e[21]!==m||e[22]!==j?(v=t.jsxs(t.Fragment,{children:[m,j]}),e[21]=m,e[22]=j,e[23]=v):v=e[23],v}function Cl(s){const e=$.c(11),{onOpenDir:l}=s,i=mt();if(i.isPending){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Pe,{}),e[0]=o):o=e[0],o}let n;e[1]!==i.data?(n=i.data??[],e[1]=i.data,e[2]=n):n=e[2];const r=n;if(r.length===0){let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Fe,{children:"No public skill sets are configured."}),e[3]=o):o=e[3],o}let a;if(e[4]!==l||e[5]!==r){let o;e[7]!==l?(o=d=>t.jsx(ze,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>l(`public/${d}`)},d),e[7]=l,e[8]=o):o=e[8],a=r.map(o),e[4]=l,e[5]=r,e[6]=a}else a=e[6];let c;return e[9]!==a?(c=t.jsx(X,{children:a}),e[9]=a,e[10]=c):c=e[10],c}function Dl(s){const e=$.c(34),{location:l,onOpenDir:i,onOpenFile:n,onOpenSkill:r,onOpenBrand:a,onShare:c,onDelete:o}=s,d=l.volume??"",u=Ke(d,l.dirPath),f=de();if(u.isPending){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Pe,{rows:2}),e[0]=g):g=e[0],g}if(u.isError){const g=u.error instanceof Error?u.error.message:"Failed to load";let w;return e[1]!==g?(w=t.jsx("p",{className:"text-sm text-destructive",children:g}),e[1]=g,e[2]=w):w=e[2],w}let m,h,x,b,j;if(e[3]!==f||e[4]!==u.data||e[5]!==l||e[6]!==o||e[7]!==a||e[8]!==i||e[9]!==n||e[10]!==r||e[11]!==c||e[12]!==d){j=Symbol.for("react.early_return_sentinel");e:{const g=u.data??[],w=g.filter(Fl),C=g.filter(Pl),k=g.filter(zl),S=g.filter(Tl);if(g.length===0){const p=l.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let z;e[18]!==p?(z=t.jsx(Fe,{children:p}),e[18]=p,e[19]=z):z=e[19],j=z;break e}let D;e[20]!==l.readOnly||e[21]!==o||e[22]!==d?(D=p=>l.readOnly?void 0:()=>o({volume:d,path:p.path,kind:p.kind}),e[20]=l.readOnly,e[21]=o,e[22]=d,e[23]=D):D=e[23];const T=D;let P;e[24]!==f||e[25]!==l.readOnly||e[26]!==c||e[27]!==d?(P=p=>l.readOnly?void 0:()=>c({volume:d,path:p.path,kind:p.kind,shareMode:p.shareMode??"private",effectivePublic:p.effectivePublic??!1,url:p.kind==="file"?He(f(d,p.path)):void 0}),e[24]=f,e[25]=l.readOnly,e[26]=c,e[27]=d,e[28]=P):P=e[28];const F=P;m=w.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ee,{children:"Skills"}),t.jsx(X,{children:w.map(p=>t.jsx(Is,{dirName:A(p.path),updatedAt:p.updatedAt,skillMdUrl:f(d,`${p.path}/SKILL.md`),publicState:ce(p),onOpen:()=>r(le(l,p.path)),onBrowse:()=>i(le(l,p.path)),onShare:F(p),onDelete:T(p)},p.path))})]}),h=C.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ee,{children:"Brands"}),t.jsx(X,{children:C.map(p=>t.jsx(Hs,{dirName:A(p.path),updatedAt:p.updatedAt,tokensUrl:f(d,`${p.path}/tokens.css`),onOpen:()=>a(le(l,p.path)),onBrowse:()=>i(le(l,p.path)),onDelete:T(p)},p.path))})]}),x=k.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ee,{children:"Folders"}),t.jsx(X,{children:k.map(p=>t.jsx(ze,{name:A(p.path),meta:fe(p.updatedAt),readOnly:l.readOnly,publicState:ce(p),onOpen:()=>i(le(l,p.path)),onShare:F(p),onDelete:T(p)},p.path))})]}),b=S.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(ee,{children:"Files"}),t.jsx(X,{children:S.map(p=>t.jsx(bt,{filename:A(p.path),updatedAt:p.updatedAt,downloadUrl:f(d,p.path),publicState:ce(p),onOpen:()=>n(le(l,p.path)),onShare:F(p),onDelete:T(p)},p.path))})]})}e[3]=f,e[4]=u.data,e[5]=l,e[6]=o,e[7]=a,e[8]=i,e[9]=n,e[10]=r,e[11]=c,e[12]=d,e[13]=m,e[14]=h,e[15]=x,e[16]=b,e[17]=j}else m=e[13],h=e[14],x=e[15],b=e[16],j=e[17];if(j!==Symbol.for("react.early_return_sentinel"))return j;let v;return e[29]!==m||e[30]!==h||e[31]!==x||e[32]!==b?(v=t.jsxs(t.Fragment,{children:[m,h,x,b]}),e[29]=m,e[30]=h,e[31]=x,e[32]=b,e[33]=v):v=e[33],v}function Tl(s){return s.kind==="file"}function zl(s){return s.kind==="dir"&&!s.hasSkill&&!s.hasBrand}function Pl(s){return s.kind==="dir"&&s.hasBrand&&!s.hasSkill}function Fl(s){return s.kind==="dir"&&s.hasSkill}function tt(){const{org:s}=Ne(),e=st(),l=lt(),i=ot(),n=nt({strict:!1}),r=n.path??"",a=Ie(r),c=a.segments.length===0,o=(N,K)=>l({to:".",search:re=>({...re,[N]:K||void 0})}),d=N=>o("path",N),u=(N,K)=>l({to:".",search:re=>({...re,preview:void 0,skill:void 0,brand:void 0,[N]:K})}),f=N=>u("preview",N),m=N=>u("skill",N),h=N=>u("brand",N),[x,b]=B.useState(""),j=as(x.trim(),300),[v,g]=B.useState(null),[w,C]=B.useState(null),[k,S]=B.useState(!1),[D,T]=B.useState(""),P=B.useRef(null),[F,p]=B.useState(!1),z=B.useRef(0),O=a.readOnly?null:a.volume??"uploads",M=a.volume?a.dirPath:"",{upload:_,mkdir:q}=Be(O??"uploads"),{remove:Q}=Be(v?.volume??"uploads");async function E(N){if(!(!O||!N||N.length===0))try{await _.mutateAsync({dir:M,files:[...N]}),W.success(N.length===1?`Uploaded ${N[0]?.name}`:`Uploaded ${N.length} files`)}catch(K){W.error(K instanceof Error?K.message:"Upload failed")}finally{P.current&&(P.current.value="")}}const I=O!==null,se=c?"uploads":a.segments.at(-1)??"this folder";function he(N){return N.dataTransfer.types.includes("Files")}function pe(N){!I||!he(N)||(N.preventDefault(),z.current+=1,p(!0))}function G(N){!I||!he(N)||N.preventDefault()}function Oe(){I&&(z.current=Math.max(0,z.current-1),z.current===0&&p(!1))}function H(N){I&&(N.preventDefault(),z.current=0,p(!1),N.dataTransfer.files.length>0&&E(N.dataTransfer.files))}async function ie(){const N=D.trim();if(!(!O||!N))try{await q.mutateAsync(M?`${M}/${N}`:N),W.success(`Folder "${N}" created`),S(!1),T("")}catch(K){W.error(K instanceof Error?K.message:"Failed to create folder")}}async function xe(){if(!v)return;const N=v;try{await Q.mutateAsync(N.path),W.success(`Deleted ${A(N.path)}`)}catch(K){W.error(K instanceof Error?K.message:"Delete failed")}finally{g(null)}}function ge(){for(const N of wt)e.invalidateQueries({queryKey:L.orgFsVolume(s.id,N.id)});a.volume&&e.invalidateQueries({queryKey:L.orgFsVolume(s.id,a.volume)}),e.invalidateQueries({queryKey:L.orgFsRecent(s.id)}),e.invalidateQueries({queryKey:L.orgFsSearchRoot(s.id)}),e.invalidateQueries({queryKey:L.orgFsPublicSets(s.id)})}return t.jsxs("div",{className:"relative h-full",onDragEnter:pe,onDragOver:G,onDragLeave:Oe,onDrop:H,children:[F&&t.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[t.jsx(ye,{size:28,className:"text-primary"}),t.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Drop to upload to ",se]})]})}),t.jsx("div",{className:"h-full overflow-y-auto",children:t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!c&&t.jsx(Nl,{segments:a.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:c?"Library":a.segments.at(-1)??"Library"}),t.jsx(R,{variant:"ghost",size:"icon",onClick:ge,"aria-label":"Refresh",children:t.jsx(Pt,{size:14})}),!c&&O&&t.jsxs(R,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[t.jsx(Ut,{size:14}),"New folder"]}),a.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(it,{size:12}),"Read-only"]}):t.jsxs(R,{size:"sm",disabled:_.isPending,onClick:()=>P.current?.click(),children:[t.jsx(ye,{size:14}),_.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:P,type:"file",multiple:!0,className:"hidden",onChange:N=>{E(N.target.files)}})]})]}),t.jsxs("div",{className:"relative",children:[t.jsx(Bt,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground"}),t.jsx(we,{value:x,onChange:N=>b(N.target.value),onKeyDown:N=>{N.key==="Escape"&&b("")},placeholder:"Search all files…",className:"h-10 rounded-xl pr-9 pl-9"}),x&&t.jsx(R,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-1.5 size-7 -translate-y-1/2",onClick:()=>b(""),"aria-label":"Clear search",children:t.jsx(Rt,{size:14})})]}),j?t.jsx(Sl,{query:j,stale:x.trim()!==j,onOpenFile:f,onShare:C,onDelete:g}):c?t.jsx($l,{onOpenDir:d,onOpenFile:f,onShare:C,onDelete:g}):a.volume===null?t.jsx(Cl,{onOpenDir:d}):t.jsx(Dl,{location:a,onOpenDir:d,onOpenFile:f,onOpenSkill:m,onOpenBrand:h,onShare:C,onDelete:g},a.volume)]})}),i&&(n.preview?t.jsx(ns,{previewPath:n.preview,onClose:()=>o("preview",null)}):n.skill?t.jsx(vl,{skillPath:n.skill,onClose:()=>o("skill",null)},n.skill):n.brand?t.jsx(pl,{brandPath:n.brand,onClose:()=>o("brand",null)},n.brand):null),t.jsx(_e,{open:k,onOpenChange:S,children:t.jsxs(Re,{children:[t.jsxs(Wt,{children:[t.jsx(qe,{children:"New folder"}),t.jsxs(Yt,{children:["Create a folder in ",r||"the library","."]})]}),t.jsx(we,{autoFocus:!0,placeholder:"folder-name",value:D,onChange:N=>T(N.target.value),onKeyDown:N=>{N.key==="Enter"&&ie()}}),t.jsxs(Xt,{children:[t.jsx(R,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),t.jsx(R,{disabled:!D.trim()||q.isPending,onClick:()=>{ie()},children:"Create"})]})]})}),t.jsx(is,{target:w,onOpenChange:N=>{N||C(null)}}),t.jsx(_t,{open:v!==null,onOpenChange:N=>{N||g(null)},children:t.jsxs(qt,{children:[t.jsxs(It,{children:[t.jsxs(Kt,{children:["Delete ",v?A(v.path):"","?"]}),t.jsx(Vt,{children:v?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(Ht,{children:[t.jsx(Gt,{children:"Cancel"}),t.jsx(Qt,{onClick:()=>{xe()},children:"Delete"})]})]})})]})}function gn(){const s=$.c(12),e=ot(),l=lt();let i;s[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},s[0]=i):i=s[0];const n=nt(i);let r;s[1]!==l?(r=d=>l({to:".",search:u=>({...u,[d]:void 0})}),s[1]=l,s[2]=r):r=s[2];const a=r;let c,o;if(s[3]!==a||s[4]!==e||s[5]!==n.brand||s[6]!==n.preview||s[7]!==n.skill){o=Symbol.for("react.early_return_sentinel");e:{const d=n.preview?{key:"preview",path:n.preview,panel:t.jsx(es,{previewPath:n.preview,onClose:()=>a("preview")})}:n.skill?{key:"skill",path:n.skill,panel:t.jsx(jl,{skillPath:n.skill,onClose:()=>a("skill")},n.skill)}:n.brand?{key:"brand",path:n.brand,panel:t.jsx(xl,{brandPath:n.brand,onClose:()=>a("brand")},n.brand)}:null;if(e){let f;s[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(Me,{children:t.jsx(tt,{})})}),s[10]=f):f=s[10],o=f;break e}let u;s[11]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ye,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Me,{children:t.jsx(tt,{})})})})}),s[11]=u):u=s[11],c=t.jsxs(ts,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[u,d&&t.jsxs(t.Fragment,{children:[t.jsx(Zt.Tabs,{children:t.jsx(ss,{title:A(d.path),icon:{kind:"component",Component:f=>d.key==="preview"?t.jsx(ne,{filename:A(d.path),...f}):d.key==="skill"?t.jsx(Le,{...f}):t.jsx(je,{...f})},active:!0,onClick:()=>a(d.key)})}),t.jsx(ls,{className:"bg-sidebar"}),t.jsx(Ye,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(Me,{children:d.panel})})})})]})]})}s[3]=a,s[4]=e,s[5]=n.brand,s[6]=n.preview,s[7]=n.skill,s[8]=c,s[9]=o}else c=s[8],o=s[9];return o!==Symbol.for("react.early_return_sentinel")?o:c}export{gn as default};
@@ -1 +0,0 @@
1
- import{c as it,r as E,j as e,i as rt}from"./index-CFiyU0D9.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-DyU03ddw.js";import{S as nt}from"./scroll-area-BM-54tW1.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-BLqpZnj6.js";import{p as xt}from"./index-CRxAjd1d.js";import"./X-DrMVHLcw.js";import"./agent-icon-oDx9Z_Be.js";import"./AlertCircle-DC-zDzV-.js";import"./Tool01-CvnpFI53.js";import"./SwitchHorizontal01-DAZXInW8.js";import"./Settings02-BcAnTzm5.js";import"./XCircle-Ct0eqqsw.js";import"./ArrowUpRight-OJZisFPQ.js";import"./ZapSquare-PMiGcZpW.js";import"./Users03-DknrDMtT.js";import"./CheckCircle-Cgnheu-R.js";import"./ChevronUp-DBpw6M-L.js";import"./ChevronDown-DyHvxYlc.js";import"./ChevronLeft-dyRjFCmp.js";import"./ChevronRight-Cpfh3gza.js";import"./DotsVertical-5jSu3d1f.js";import"./Stars02-qnq-_X9g.js";import"./Eye-bojNLUjA.js";import"./ZoomOut-6ix2H92j.js";import"./Globe01-CyfpzbeQ.js";import"./FilterLines-CFl65nng.js";import"./Star01-DHEkWySe.js";import"./Globe04-DFpdKSRI.js";import"./HardDrive-B1mtnaeA.js";import"./Key01-CwrJlZo0.js";import"./LayoutLeft-fsm0LcB8.js";import"./LinkExternal01-BHwVyDja.js";import"./Monitor01-ChA6ov2I.js";import"./Sun-lTiqxOzH.js";import"./Palette-DusYqL0W.js";import"./Play-CnXG8qqP.js";import"./Plus-eGxBB1d8.js";import"./SearchLg-CDpA_lbT.js";import"./SearchMd-ujiTPCmg.js";import"./Shield01-ZxmFmrvL.js";import"./Stars01-BdCaKqhF.js";import"./Trash01-ByxlxTiZ.js";import"./Upload01-Z77n1bV8.js";import"./User01-COQtf360.js";import"./Users01-wtRJYQKX.js";import"./XClose-BaZ908gw.js";import"./Zap-wRIFSWIq.js";import"./use-clock-tick-BcxdOJLx.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Xy0buIqd.js";import"./tooltip-DrpiSbRG.js";import"./file-type-icon-DPWxBpNL.js";import"./dialog-BAqFyO8a.js";import"./use-mobile-NlF-3RoP.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-C7syjwde.js";import"./use-mcp-client-xOK-OF8p.js";import"./auth-Bej0Tx2Y.js";import"./chat-context-n9syhvq-.js";import"./hooks-CUSV6Enf.js";import"./decopilot-sse-pool-CvYk1hkc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-2U_MnYnK.js";import"./use-collections-B4atckEK.js";import"./use-ai-providers-C7KmiuqP.js";import"./studio-tools-CNO5iCKk.js";import"./use-decopilot-events-CpQNzv3e.js";import"./use-organization-settings-DksiQdGc.js";import"./shell-layout-Nyz7GHu7.js";import"./avatar-CJP1BOq4.js";import"./required-auth-layout-DDJmFi3U.js";import"./use-org-sso-DkqH8Zpz.js";import"./integration-icon-LQhkkaLl.js";import"./use-navigate-to-agent-DZubxUSm.js";import"./use-connection-Dz29RF9P.js";import"./use-mcp-prompts-Crr3H7P7.js";import"./form-DGE2mWLL.js";import"./label-CdBSUJpf.js";import"./input-BwRH-Gsz.js";import"./select-C6v8Xcth.js";import"./switch-CCMIMmOF.js";import"./index-mEtg0zTM.js";import"./drawer-CFkqEC3w.js";import"./collection-search-8iNXnGlM.js";import"./tabs-Ca0vDJqc.js";import"./toggle-group-9TrYMc69.js";import"./sortable.esm-MymOIPKk.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C6NYo4Gp.js";import"./use-registry-connections-BOZLpkM5.js";import"./useInfiniteQuery-RUqqRph1.js";import"./use-infinite-scroll-BX1nHHVY.js";import"./extract-connection-data-D6bQrejT.js";import"./card-BFb5m83e.js";import"./collection-tabs-KA2be3wH.js";import"./badge-DhpSM7g_.js";import"./textarea-BYT525JZ.js";import"./connection-form-helpers-CwZx7WkC.js";import"./authenticate-and-persist-oauth-DoPUB_Bh.js";import"./mcp-oauth-IblqU9XT.js";import"./useSuspenseInfiniteQuery-fRYRtDkY.js";import"./connect-desktop-dialog-Brra3cMC.js";import"./decopilot-BItqS11w.js";import"./checkbox-DmOzmKLP.js";import"./skeleton-B0I93PJP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-MeT61nuY.js";import"./popover-BXFiEQtN.js";import"./command-C34397s2.js";import"./index-jBUpmiBg.js";import"./use-org-fs-DyK8omii.js";import"./dropdown-menu-C62KNjwK.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DxV7deix.js";import"./empty-state-Sh_DuDcy.js";import"./toolbar-p8VcpV1N.js";import"./preview-dialog-CQgf0QcR.js";import"./index-B6hcksS9.js";import"./use-mcp-tools-C8tMWwG9.js";import"./use-capability-C6Dwri-U.js";import"./shell-route-loading-BRcTX0VT.js";import"./tools-list-uWC3Ij6C.js";import"./alert-dialog-CYizItFp.js";import"./use-debounced-autosave-B4mbwJnu.js";import"./index-Bb-tYGNK.js";import"./sidebar-BNrafefE.js";import"./search-input-M7ubuBMG.js";import"./github-repo-picker-B5tZucJa.js";import"./use-debounced-value-C6U3mliE.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-CLmhH-Rb.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-B-dNDEWH.js";import"./table-DeNuxLMl.js";import"./use-members-BMNjJExY.js";import"./use-org-auth-client-C_UJ3Vg_.js";import"./task-status-B3nPzwP7.js";import"./use-automations-RMjkwkxX.js";import"./use-file-configs-CFCmr--W.js";import"./monaco-editor-5JIc-lnc.js";import"./select-model-Cz9R_UN3.js";import"./automation-list-row-CsTyBm4M.js";function mi(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{mi as SeoSheet};
@@ -1 +0,0 @@
1
- import{r as i,a3 as $,j as c,a4 as L,ak as z,_ as O,V as _,W as g,U as E,Z as j,a2 as G,X as w,dA as H,dB as K,Y as U,dC as V,dD as W,dE as Z,$ as B,a0 as X,a1 as Y,c as R,l as q}from"./index-CFiyU0D9.js";var C="Popover",[b]=U(C,[w]),P=w(),[J,u]=b(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(L,{...p,children:c.jsx(J,{scope:e,contentId:z(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",Q=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(E,{...s,...r,ref:e})});Q.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(S,o),s=P(o),a=O(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(E,{asChild:!0,...s,children:p})});y.displayName=S;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(A,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=A;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=O(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),m=P(o);return W(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(B,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(X,{"data-state":I(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=T;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(Y,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};
@@ -1 +0,0 @@
1
- import{c as H,j as t,B as Z}from"./index-CFiyU0D9.js";import{n as ee}from"./LinkExternal01-BHwVyDja.js";import{aC as te,t as oe}from"./agent-icon-oDx9Z_Be.js";import{I as J}from"./input-BwRH-Gsz.js";import{L as G}from"./label-CdBSUJpf.js";import{M as ie}from"./automation-runs-B-dNDEWH.js";import{T as Q,a as se,b as W,c as le}from"./tabs-Ca0vDJqc.js";import{T as re}from"./textarea-BYT525JZ.js";import{au as ae,av as me,at as pe,aw as ne,ax as ce,ay as de,az as fe}from"./index-CRxAjd1d.js";import{b as ue,a as xe,B as he}from"./block-document-B2vhG8Ii.js";import{u as ge,s as F,E as ve,R as ye,A as je}from"./primitives-BF1opf4F.js";import"./AlertCircle-DC-zDzV-.js";import"./Tool01-CvnpFI53.js";import"./SwitchHorizontal01-DAZXInW8.js";import"./Settings02-BcAnTzm5.js";import"./XCircle-Ct0eqqsw.js";import"./ArrowUpRight-OJZisFPQ.js";import"./ZapSquare-PMiGcZpW.js";import"./Users03-DknrDMtT.js";import"./CheckCircle-Cgnheu-R.js";import"./ChevronUp-DBpw6M-L.js";import"./ChevronDown-DyHvxYlc.js";import"./ChevronLeft-dyRjFCmp.js";import"./ChevronRight-Cpfh3gza.js";import"./DotsVertical-5jSu3d1f.js";import"./Stars02-qnq-_X9g.js";import"./Eye-bojNLUjA.js";import"./ZoomOut-6ix2H92j.js";import"./Globe01-CyfpzbeQ.js";import"./FilterLines-CFl65nng.js";import"./Star01-DHEkWySe.js";import"./Globe04-DFpdKSRI.js";import"./HardDrive-B1mtnaeA.js";import"./Key01-CwrJlZo0.js";import"./LayoutLeft-fsm0LcB8.js";import"./Monitor01-ChA6ov2I.js";import"./Sun-lTiqxOzH.js";import"./Palette-DusYqL0W.js";import"./Play-CnXG8qqP.js";import"./Plus-eGxBB1d8.js";import"./SearchLg-CDpA_lbT.js";import"./SearchMd-ujiTPCmg.js";import"./Shield01-ZxmFmrvL.js";import"./Stars01-BdCaKqhF.js";import"./Trash01-ByxlxTiZ.js";import"./Upload01-Z77n1bV8.js";import"./User01-COQtf360.js";import"./Users01-wtRJYQKX.js";import"./XClose-BaZ908gw.js";import"./X-DrMVHLcw.js";import"./Zap-wRIFSWIq.js";import"./useInfiniteQuery-RUqqRph1.js";import"./use-infinite-scroll-BX1nHHVY.js";import"./use-connection-Dz29RF9P.js";import"./use-collections-B4atckEK.js";import"./use-mcp-client-xOK-OF8p.js";import"./auth-Bej0Tx2Y.js";import"./use-virtual-mcp-2U_MnYnK.js";import"./card-BFb5m83e.js";import"./sheet-DyU03ddw.js";import"./table-DeNuxLMl.js";import"./empty-state-Sh_DuDcy.js";import"./use-members-BMNjJExY.js";import"./use-org-auth-client-C_UJ3Vg_.js";import"./task-status-B3nPzwP7.js";import"./use-automations-RMjkwkxX.js";import"./studio-tools-CNO5iCKk.js";import"./useSuspenseInfiniteQuery-fRYRtDkY.js";import"./badge-DhpSM7g_.js";import"./select-C6v8Xcth.js";import"./tooltip-DrpiSbRG.js";import"./checkbox-DmOzmKLP.js";import"./command-C34397s2.js";import"./index-jBUpmiBg.js";import"./dialog-BAqFyO8a.js";import"./popover-BXFiEQtN.js";import"./avatar-CJP1BOq4.js";import"./scroll-area-BM-54tW1.js";import"./use-clock-tick-BcxdOJLx.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Xy0buIqd.js";import"./file-type-icon-DPWxBpNL.js";import"./use-mobile-NlF-3RoP.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-C7syjwde.js";import"./chat-context-n9syhvq-.js";import"./hooks-CUSV6Enf.js";import"./decopilot-sse-pool-CvYk1hkc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-C7KmiuqP.js";import"./use-decopilot-events-CpQNzv3e.js";import"./use-organization-settings-DksiQdGc.js";import"./shell-layout-Nyz7GHu7.js";import"./required-auth-layout-DDJmFi3U.js";import"./use-org-sso-DkqH8Zpz.js";import"./integration-icon-LQhkkaLl.js";import"./use-navigate-to-agent-DZubxUSm.js";import"./use-mcp-prompts-Crr3H7P7.js";import"./form-DGE2mWLL.js";import"./index-mEtg0zTM.js";import"./drawer-CFkqEC3w.js";import"./collection-search-8iNXnGlM.js";import"./toggle-group-9TrYMc69.js";import"./sortable.esm-MymOIPKk.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C6NYo4Gp.js";import"./use-registry-connections-BOZLpkM5.js";import"./extract-connection-data-D6bQrejT.js";import"./collection-tabs-KA2be3wH.js";import"./connection-form-helpers-CwZx7WkC.js";import"./authenticate-and-persist-oauth-DoPUB_Bh.js";import"./mcp-oauth-IblqU9XT.js";import"./connect-desktop-dialog-Brra3cMC.js";import"./decopilot-BItqS11w.js";import"./skeleton-B0I93PJP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-MeT61nuY.js";import"./use-org-fs-DyK8omii.js";import"./dropdown-menu-C62KNjwK.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DxV7deix.js";import"./toolbar-p8VcpV1N.js";import"./preview-dialog-CQgf0QcR.js";import"./index-B6hcksS9.js";import"./use-mcp-tools-C8tMWwG9.js";import"./use-capability-C6Dwri-U.js";import"./shell-route-loading-BRcTX0VT.js";import"./tools-list-uWC3Ij6C.js";import"./alert-dialog-CYizItFp.js";import"./switch-CCMIMmOF.js";import"./use-debounced-autosave-B4mbwJnu.js";import"./index-Bb-tYGNK.js";import"./sidebar-BNrafefE.js";import"./search-input-M7ubuBMG.js";import"./github-repo-picker-B5tZucJa.js";import"./use-debounced-value-C6U3mliE.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-CLmhH-Rb.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-CFCmr--W.js";import"./monaco-editor-5JIc-lnc.js";import"./select-model-Cz9R_UN3.js";import"./automation-list-row-CsTyBm4M.js";function be(A){return Array.isArray(A)?A.map(e=>({key:F(e?.key),value:F(e?.value)})):[]}function mi(A){const e=H.c(66),{orgSlug:i,virtualMcpId:d,branch:o,blockKey:l,block:p,decofile:m,meta:u,previewBaseUrl:x}=A;let y;e[0]!==o||e[1]!==i||e[2]!==d?(y={orgSlug:i,virtualMcpId:d,branch:o},e[0]=o,e[1]=i,e[2]=d,e[3]=y):y=e[3];const s=ae(y);let n;e[4]!==p?(n=me(p,"posts"),e[4]=p,e[5]=n):n=e[5];const j=n;let b;e[6]!==l||e[7]!==s?(b=T=>{s.mutate({blockKey:l,data:ne(l,"posts",T)})},e[6]=l,e[7]=s,e[8]=b):b=e[8];const[r,_]=ge(j,b);let C;e[9]!==r||e[10]!==_?(C=(T,Y)=>_({...r,[T]:Y}),e[9]=r,e[10]=_,e[11]=C):C=e[11];const h=C;let S;e[12]!==m||e[13]!==r||e[14]!==x?(S=ue({decofile:m,post:r,previewBaseUrl:x}),e[12]=m,e[13]=r,e[14]=x,e[15]=S):S=e[15];const f=S;let a;e[16]!==r.title?(a=F(r.title)||"Untitled post",e[16]=r.title,e[17]=a):a=e[17];let c;e[18]!==a?(c=t.jsx("span",{className:"truncate text-sm font-medium",children:a}),e[18]=a,e[19]=c):c=e[19];let g;e[20]!==s.isError||e[21]!==s.isPending?(g=t.jsx(pe,{isPending:s.isPending,isError:s.isError}),e[20]=s.isError,e[21]=s.isPending,e[22]=g):g=e[22];const k=!f,P=f?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==f?(N=()=>{f&&window.open(f,"_blank","noopener,noreferrer")},e[23]=f,e[24]=N):N=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ee,{size:14}),e[25]=B):B=e[25];let w;e[26]!==P||e[27]!==N||e[28]!==k?(w=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",disabled:k,title:P,onClick:N,children:[B,"See preview"]}),e[26]=P,e[27]=N,e[28]=k,e[29]=w):w=e[29];let E;e[30]!==w||e[31]!==g?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,w]}),e[30]=w,e[31]=g,e[32]=E):E=e[32];let v;e[33]!==E||e[34]!==c?(v=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,E]}),e[33]=E,e[34]=c,e[35]=v):v=e[35];let L;e[36]!==r.title?(L=F(r.title),e[36]=r.title,e[37]=L):L=e[37];let R;e[38]!==h?(R=T=>h("title",T),e[38]=h,e[39]=R):R=e[39];let U;e[40]!==L||e[41]!==R?(U=t.jsx(ve,{value:L,onChange:R,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=L,e[41]=R,e[42]=U):U=e[42];let O;e[43]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Q,{value:"content",children:[t.jsx(te,{}),"Content"]}),e[43]=O):O=e[43];let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(se,{children:[O,t.jsxs(Q,{value:"settings",children:[t.jsx(oe,{}),"Settings"]})]}),e[44]=K):K=e[44];let $;e[45]!==r.sections?($=xe(r.sections),e[45]=r.sections,e[46]=$):$=e[46];let I;e[47]!==h?(I=T=>h("sections",T),e[47]=h,e[48]=I):I=e[48];let M;e[49]!==u||e[50]!==$||e[51]!==I?(M=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(he,{value:$,onChange:I,meta:u,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=u,e[50]=$,e[51]=I,e[52]=M):M=e[52];let z;e[53]!==m||e[54]!==r||e[55]!==h?(z=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Ce,{post:r,decofile:m,onChange:h})})}),e[53]=m,e[54]=r,e[55]=h,e[56]=z):z=e[56];let D;e[57]!==M||e[58]!==z?(D=t.jsxs(le,{defaultValue:"content",className:"mt-6 gap-4",children:[K,M,z]}),e[57]=M,e[58]=z,e[59]=D):D=e[59];let V;e[60]!==U||e[61]!==D?(V=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:[U,D]})}),e[60]=U,e[61]=D,e[62]=V):V=e[62];let q;return e[63]!==v||e[64]!==V?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[v,V]}),e[63]=v,e[64]=V,e[65]=q):q=e[65],q}function Ce(A){const e=H.c(59),{post:i,decofile:d,onChange:o}=A;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(G,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=l):l=e[0];let p;e[1]!==i.excerpt?(p=F(i.excerpt),e[1]=i.excerpt,e[2]=p):p=e[2];let m;e[3]!==o?(m=v=>o("excerpt",v.target.value),e[3]=o,e[4]=m):m=e[4];let u;e[5]!==p||e[6]!==m?(u=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx(re,{id:"post-excerpt",value:p,onChange:m,rows:2})]}),e[5]=p,e[6]=m,e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(G,{htmlFor:"post-slug",children:"Slug"}),e[8]=x):x=e[8];let y;e[9]!==i.slug?(y=F(i.slug),e[9]=i.slug,e[10]=y):y=e[10];let s;e[11]!==o?(s=v=>o("slug",v.target.value),e[11]=o,e[12]=s):s=e[12];let n;e[13]!==y||e[14]!==s?(n=t.jsxs("div",{className:"space-y-2",children:[x,t.jsx(J,{id:"post-slug",value:y,onChange:s,placeholder:"my-post",className:"h-10"})]}),e[13]=y,e[14]=s,e[15]=n):n=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={type:"string",format:"date",title:"Date"},e[16]=j):j=e[16];let b;e[17]!==i.date?(b=F(i.date),e[17]=i.date,e[18]=b):b=e[18];let r;e[19]!==o?(r=v=>o("date",v),e[19]=o,e[20]=r):r=e[20];let _;e[21]!==b||e[22]!==r?(_=t.jsx(fe,{schema:j,value:b,onChange:r,path:"post-date",label:"Date"}),e[21]=b,e[22]=r,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==n?(C=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n,_]}),e[24]=_,e[25]=n,e[26]=C):C=e[26];let h;e[27]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"image-uri",title:"Cover image"},e[27]=h):h=e[27];let S;e[28]!==o?(S=v=>o("image",v),e[28]=o,e[29]=S):S=e[29];let f;e[30]!==i.image||e[31]!==S?(f=t.jsx(ce,{schema:h,value:i.image,onChange:S,path:"post-image",label:"Cover image"}),e[30]=i.image,e[31]=S,e[32]=f):f=e[32];let a;e[33]===Symbol.for("react.memo_cache_sentinel")?(a=["email"],e[33]=a):a=e[33];let c;e[34]!==o?(c=v=>o("authors",v),e[34]=o,e[35]=c):c=e[35];let g;e[36]!==d||e[37]!==i.authors||e[38]!==c?(g=t.jsx(X,{label:"Authors",decofile:d,kind:"authors",valueField:"email",extraFields:a,selected:i.authors,onChange:c}),e[36]=d,e[37]=i.authors,e[38]=c,e[39]=g):g=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=["slug"],e[40]=k):k=e[40];let P;e[41]!==o?(P=v=>o("categories",v),e[41]=o,e[42]=P):P=e[42];let N;e[43]!==d||e[44]!==i.categories||e[45]!==P?(N=t.jsx(X,{label:"Categories",decofile:d,kind:"categories",valueField:"slug",extraFields:k,selected:i.categories,onChange:P}),e[43]=d,e[44]=i.categories,e[45]=P,e[46]=N):N=e[46];let B;e[47]!==o?(B=v=>o("extraProps",v),e[47]=o,e[48]=B):B=e[48];let w;e[49]!==i.extraProps||e[50]!==B?(w=t.jsx(ke,{value:i.extraProps,onChange:B}),e[49]=i.extraProps,e[50]=B,e[51]=w):w=e[51];let E;return e[52]!==C||e[53]!==f||e[54]!==g||e[55]!==N||e[56]!==w||e[57]!==u?(E=t.jsxs("div",{className:"space-y-5",children:[u,C,f,g,N,w]}),e[52]=C,e[53]=f,e[54]=g,e[55]=N,e[56]=w,e[57]=u,e[58]=E):E=e[58],E}function ke(A){const e=H.c(15),{value:i,onChange:d}=A;let o,l,p,m;if(e[0]!==d||e[1]!==i){o=be(i);const y=(s,n)=>d(o.map((j,b)=>b===s?{...j,...n}:j));l="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(G,{children:"Extra props"}),e[6]=p):p=e[6],m=o.length>0&&t.jsx("ul",{className:"space-y-2",children:o.map((s,n)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(J,{value:s.key,onChange:j=>y(n,{key:j.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(J,{value:s.value,onChange:j=>y(n,{value:j.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(ye,{label:"Remove prop",onClick:()=>d(o.filter((j,b)=>b!==n))})]},n))}),e[0]=d,e[1]=i,e[2]=o,e[3]=l,e[4]=p,e[5]=m}else o=e[2],l=e[3],p=e[4],m=e[5];let u;e[7]!==o||e[8]!==d?(u=t.jsx(je,{label:"Add prop",onClick:()=>d([...o,{key:"",value:""}])}),e[7]=o,e[8]=d,e[9]=u):u=e[9];let x;return e[10]!==l||e[11]!==p||e[12]!==m||e[13]!==u?(x=t.jsxs("div",{className:l,children:[p,m,u]}),e[10]=l,e[11]=p,e[12]=m,e[13]=u,e[14]=x):x=e[14],x}function X(A){const e=H.c(31),{label:i,decofile:d,kind:o,valueField:l,extraFields:p,selected:m,onChange:u}=A;let x,y,s;if(e[0]!==d||e[1]!==o||e[2]!==l){x=de(d,o);let f;e[6]!==l?(f=(c,g)=>F(c[l])||g,e[6]=l,e[7]=f):f=e[7],s=f;let a;e[8]!==s?(a=c=>{const{key:g,payload:k}=c;return{value:s(k,g),label:F(k.name)||s(k,g)}},e[8]=s,e[9]=a):a=e[9],y=x.map(a),e[0]=d,e[1]=o,e[2]=l,e[3]=x,e[4]=y,e[5]=s}else x=e[3],y=e[4],s=e[5];const n=y;let j;if(e[10]!==m||e[11]!==l){const f=Array.isArray(m)?m:[];let a;e[13]!==l?(a=c=>F(c[l]),e[13]=l,e[14]=a):a=e[14],j=f.map(a).filter(Boolean),e[10]=m,e[11]=l,e[12]=j}else j=e[12];const b=j;let r;e[15]!==p||e[16]!==u||e[17]!==x||e[18]!==l||e[19]!==s?(r=f=>{u(f.map(a=>{const c=x.find(k=>{const{key:P,payload:N}=k;return s(N,P)===a});if(!c)return{name:a,[l]:a};const g={name:F(c.payload.name)};for(const k of p)g[k]=c.payload[k]??a;return g}))},e[15]=p,e[16]=u,e[17]=x,e[18]=l,e[19]=s,e[20]=r):r=e[20];const _=r;let C;e[21]!==i?(C=t.jsx(G,{children:i}),e[21]=i,e[22]=C):C=e[22];let h;e[23]!==b||e[24]!==_||e[25]!==i||e[26]!==n?(h=n.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",i.toLowerCase()," yet — create some in the"," ",i.toLowerCase()," collection."]}):t.jsx(ie,{options:n,defaultValue:b,onValueChange:_,placeholder:`Select ${i.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=_,e[25]=i,e[26]=n,e[27]=h):h=e[27];let S;return e[28]!==C||e[29]!==h?(S=t.jsxs("div",{className:"space-y-2",children:[C,h]}),e[28]=C,e[29]=h,e[30]=S):S=e[30],S}export{mi as PostEditor};