decocms 4.504.0 → 4.504.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-B0u9jV2c.js → ActiveShapeUtils-Cx07-cYR.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-C1f-lxgM.js → AlertCircle-Bec1dxaS.js} +1 -1
  3. package/dist/client/assets/{AreaChart-Clm2J7Jy.js → AreaChart-AYJHOtjZ.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-I3l36ZjU.js → ArrowLeft-B66-ad90.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CN7A9Moq.js → ArrowUp-CSeqbspv.js} +1 -1
  6. package/dist/client/assets/{BarChart--mNl1LYx.js → BarChart-CDSH2Akh.js} +1 -1
  7. package/dist/client/assets/{Building02-CmYuhs9q.js → Building02-Bu4UAsgO.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-DNjlW_Tb.js → CategoricalChart-iujTK0KL.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-Bbdmy3-4.js → CheckCircle-BSvXc66Q.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-DnykG0uP.js → ChevronSelectorVertical-n7b_5Q6B.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-BSosmJSL.js → ChevronUp-bmzgw7dV.js} +1 -1
  12. package/dist/client/assets/{Copy01-ClJqHrSL.js → Copy01-BISq6vrL.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DMXUjEhW.js → CreditCard01-CbXaQViz.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-Bq-FhyDz.js → DotsVertical-M1fm8bjv.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-CPCe9K_K.js → ErrorBarContext-RuQNhaXV.js} +1 -1
  16. package/dist/client/assets/{Globe04-tkCkwAZ7.js → Globe04-BRIK-LcF.js} +1 -1
  17. package/dist/client/assets/{Image01-BdJJuBkl.js → Image01-C8Z3a6q4.js} +1 -1
  18. package/dist/client/assets/{Key01-pWArwON-.js → Key01-CAPfBcFM.js} +1 -1
  19. package/dist/client/assets/{Link01-B9ootJcD.js → Link01-DJt14Rj5.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-DdphioXH.js → LinkBroken01-B6cSnLw2.js} +1 -1
  21. package/dist/client/assets/{Monitor01-z4WYVE55.js → Monitor01-BNRWrf3F.js} +1 -1
  22. package/dist/client/assets/{Play-BI5wPgvY.js → Play-CB3VpTFO.js} +1 -1
  23. package/dist/client/assets/{Plus-COolVLwU.js → Plus-DmY-I-W1.js} +1 -1
  24. package/dist/client/assets/{SearchMd-y-lLgqEG.js → SearchMd-Dqev4UbC.js} +1 -1
  25. package/dist/client/assets/{Sector-D5VTGjOA.js → Sector-NYaG1AEA.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-C6o3UxmP.js → ShoppingBag01-Crf2xSz3.js} +1 -1
  27. package/dist/client/assets/{Sun-odOLuJdq.js → Sun-DJ4L7xwP.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-f0pF3KQj.js → SwitchHorizontal01-BspP-O9B.js} +1 -1
  29. package/dist/client/assets/{Tool01-D1AhyVfW.js → Tool01-CbGwYE-2.js} +1 -1
  30. package/dist/client/assets/{Trash01-DfoQYxMm.js → Trash01-DArHDncW.js} +1 -1
  31. package/dist/client/assets/{Upload01-BBOzClAk.js → Upload01-DlUMQy0J.js} +1 -1
  32. package/dist/client/assets/{User01-BErnjQ_p.js → User01-B-tTyVsO.js} +1 -1
  33. package/dist/client/assets/{UserSquare-C_0tdrPK.js → UserSquare-zw-tgJGh.js} +1 -1
  34. package/dist/client/assets/{Users01-C3dqLukD.js → Users01-BI0nawB5.js} +1 -1
  35. package/dist/client/assets/{XAxis-BmFzpX5P.js → XAxis-D40NyhoU.js} +1 -1
  36. package/dist/client/assets/{XClose-DVNhmkHc.js → XClose-DxE71MU7.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-BBC9JXN3.js → ZoomOut-Cyw3AXuM.js} +1 -1
  38. package/dist/client/assets/{access-gate-CqFl_kWf.js → access-gate-BE8SqF7m.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-C9PNcfRX.js → add-connection-dialog-D59AnSQs.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-C1SI5Vkt.js → agent-analytics-CullbrRF.js} +1 -1
  41. package/dist/client/assets/agent-app-Btba9qrn.js +1 -0
  42. package/dist/client/assets/{agent-assets-D8cFncEj.js → agent-assets-D6KY0tjV.js} +1 -1
  43. package/dist/client/assets/{agent-automation-CEBlRtkL.js → agent-automation-BPYqK28y.js} +1 -1
  44. package/dist/client/assets/{agent-automations-CvApYTzK.js → agent-automations--Qo-l1fi.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-BuJe6Thd.js → agent-connect-sources-DGgWflBR.js} +1 -1
  46. package/dist/client/assets/agent-deck-BRFz34C5.js +1 -0
  47. package/dist/client/assets/{agent-e2e-YWuEAYUF.js → agent-e2e-COewOX58.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-DZv1N0aU.js → agent-experiments-MT61jDl1.js} +1 -1
  49. package/dist/client/assets/{agent-file-Da2frUD5.js → agent-file-DecvJxa1.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-DHsvA3BB.js → agent-hosting-DW-JvZV7.js} +1 -1
  51. package/dist/client/assets/{agent-icon-mVoV_Rm6.js → agent-icon-Czh6MNam.js} +1 -1
  52. package/dist/client/assets/agent-library-D5NccfWU.js +1 -0
  53. package/dist/client/assets/agent-library-file-CEh3yNi1.js +1 -0
  54. package/dist/client/assets/{agent-monitor-CwTiyjyb.js → agent-monitor-BEgctWY1.js} +1 -1
  55. package/dist/client/assets/{agent-overview-DwFQxgFj.js → agent-overview-CP1VKdfr.js} +1 -1
  56. package/dist/client/assets/{agent-releases-DYFb1Byr.js → agent-releases-BqBTam8W.js} +1 -1
  57. package/dist/client/assets/agent-settings-D0vOcbo4.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-BfLlWboZ.js → agent-site-editor-CuYMD6kh.js} +1 -1
  59. package/dist/client/assets/agent-site-editor-code-CjBhJz3a.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-CGwPwTYo.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-D1rLRPRY.js +1 -0
  62. package/dist/client/assets/agent-view-FlUwvnPb.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-cXaf8JJF.js → agent-view-guard-D0QGa17N.js} +1 -1
  64. package/dist/client/assets/{agents-list-CV3vNbLb.js → agents-list-BT9TpMpA.js} +1 -1
  65. package/dist/client/assets/{ai-providers-sqc2LUIA.js → ai-providers-DykxIfM3.js} +1 -1
  66. package/dist/client/assets/{alert-BLv8wvgQ.js → alert-D-kHUOW5.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-fu6AQXnF.js → alert-dialog-D1kkgyaQ.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-DNHEhXPF.js → analytics-sections-CFj-EITt.js} +1 -1
  69. package/dist/client/assets/api-keys-BgnbvEMg.js +1 -0
  70. package/dist/client/assets/{api-keys-DOY3ThBS.js → api-keys-CQSDswwH.js} +1 -1
  71. package/dist/client/assets/{app-editor-BgwkvJx7.js → app-editor-Dr8QE24J.js} +1 -1
  72. package/dist/client/assets/{asset-utils-Cgltntmg.js → asset-utils-DyAwxctJ.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-BZbSd08K.js → auth-catchall-DcEJgoW5.js} +1 -1
  74. package/dist/client/assets/{auth-D9R4x8R2.js → auth-eKkR4KqF.js} +1 -1
  75. package/dist/client/assets/{auth-entry-CdPsiMxs.js → auth-entry-DN1yBH_X.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-DhsS4SKE.js → auth-split-layout-DQptZiat.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-BXYWE9_-.js → authenticate-and-persist-oauth-CFzJEYoH.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-WMoP_2fn.js → automation-list-row-Cz8Wl6TZ.js} +1 -1
  79. package/dist/client/assets/{automation-runs-DdI2CowH.js → automation-runs-ZQZ-ZfdL.js} +1 -1
  80. package/dist/client/assets/{automations-DVZMUJGA.js → automations-Bi5MrN34.js} +1 -1
  81. package/dist/client/assets/{autosend-BPQxe36t.js → autosend-Cp8JwTOk.js} +1 -1
  82. package/dist/client/assets/{avatar-CU0Kskf0.js → avatar-DdSak0Sb.js} +1 -1
  83. package/dist/client/assets/{badge-BDdWebYk.js → badge-Dmtt-CEm.js} +1 -1
  84. package/dist/client/assets/{block-document-y1eID6_9.js → block-document-D6HEkp1z.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-DhQHnT9o.js → blocks-preview-workspace-context-BAqnuZhZ.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-B2kc7rv0.js → blocks-tab-states-BNV3yj99.js} +7 -7
  87. package/dist/client/assets/{blog-schema-DlleEDCu.js → blog-schema-C2E88VA3.js} +1 -1
  88. package/dist/client/assets/{board-analytics-CipNMpf1.js → board-analytics-LuwxUF7A.js} +1 -1
  89. package/dist/client/assets/{buckets-DqxBroBh.js → buckets-D4C_xVrZ.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-D5tL_bT5.js → build-improve-prompt-doc-D9tpl3BX.js} +1 -1
  91. package/dist/client/assets/{calendar-sXxwWaqb.js → calendar-BMATLdVs.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-BxoOfmPv.js → capability-load-error-DiGMeo-2.js} +1 -1
  93. package/dist/client/assets/{category-editor-CAmx2N2u.js → category-editor-Bu6l5zLZ.js} +1 -1
  94. package/dist/client/assets/{chart-e-O0GJkY.js → chart-CjhNJQDa.js} +1 -1
  95. package/dist/client/assets/{chat-context-Beu1j-5J.js → chat-context-7iPEBonn.js} +1 -1
  96. package/dist/client/assets/{chat-draft-G2JgvBd_.js → chat-draft-g8x2IwR8.js} +1 -1
  97. package/dist/client/assets/{checkbox-stYexPFQ.js → checkbox-xsx9w-sP.js} +1 -1
  98. package/dist/client/assets/{choose-editor-BN1qqOSE.js → choose-editor-r9EQMwQK.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-DdYKZu6Q.js → cli-auth-success-mhWAQy14.js} +1 -1
  100. package/dist/client/assets/{client-icons-D6-xxRtK.js → client-icons-B4guPQZd.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-BeilhGPn.js +1 -0
  102. package/dist/client/assets/{collapsible-kni6e36V.js → collapsible-zZncAZBc.js} +1 -1
  103. package/dist/client/assets/{collection-detail-CYbAeUcP.js → collection-detail-ClMsO2zA.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-BJ2zvxlJ.js → collection-display-button-Dcv9cmSy.js} +1 -1
  105. package/dist/client/assets/{collection-search-FUqdxX3H.js → collection-search-C0fvUi6S.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-aQAtPqRL.js → collection-table-wrapper-Cn4jrf8s.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-C65YIOoy.js → collection-tabs-CtpJB22o.js} +1 -1
  108. package/dist/client/assets/{column-rules-B9Tzvv4V.js → column-rules-CbXpTJRV.js} +1 -1
  109. package/dist/client/assets/{combobox-BkmwK3A-.js → combobox-nBsbDngO.js} +1 -1
  110. package/dist/client/assets/{command-DxMlrlhO.js → command-Dz8D1H9z.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-COrWYMIu.js → companion-mcps-section-D22vLHNd.js} +1 -1
  112. package/dist/client/assets/{config-DRb_vE2e.js → config-CFzYPymH.js} +1 -1
  113. package/dist/client/assets/{connect-BZehkwIx.js → connect-DGmViujb.js} +1 -1
  114. package/dist/client/assets/{connect-layout-CLkmVS0Y.js → connect-layout-C1_jUYFW.js} +1 -1
  115. package/dist/client/assets/{connection-BP1usXEe.js → connection-D2EgMJ9G.js} +1 -1
  116. package/dist/client/assets/{connection-card-Dj9jvO4L.js → connection-card-CI5YjmPA.js} +1 -1
  117. package/dist/client/assets/{connection-detail-CohzGwW_.js → connection-detail-3sVF5dQt.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-DKKu5de3.js → connection-form-helpers-CY2wGEex.js} +1 -1
  119. package/dist/client/assets/{connections-BsSmEWSO.js → connections-Twa_JYzc.js} +1 -1
  120. package/dist/client/assets/{content-tab-BUwSLZJz.js → content-tab-BhYfvgHJ.js} +3 -3
  121. package/dist/client/assets/{context-xpJ5nJyK.js → context-CE7HH71W.js} +1 -1
  122. package/dist/client/assets/{context-menu-ByavF3-l.js → context-menu-CPfLEqbb.js} +1 -1
  123. package/dist/client/assets/{core.esm-mOT7IIiz.js → core.esm-DajKxe8q.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-BOo3mBs5.js → create-organization-dialog-CK2tPr-0.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-CQXP9z0w.js → daily-pulse-DyH5JpV6.js} +1 -1
  126. package/dist/client/assets/{discover-Mns8PIjM.js → discover-is1IWBp5.js} +1 -1
  127. package/dist/client/assets/{domain-settings-0XV0ZoxS.js → domain-settings-BVhs7QfA.js} +1 -1
  128. package/dist/client/assets/{drawer-B7KRQQab.js → drawer-Cc1xeysa.js} +1 -1
  129. package/dist/client/assets/{editor-DxGSQWBn.js → editor-C6KJlQxQ.js} +1 -1
  130. package/dist/client/assets/{editor-classes-Bm-ecdGw.js → editor-classes-D4Aoqmls.js} +1 -1
  131. package/dist/client/assets/{empty-state-Bfikw9C9.js → empty-state-D6Tozrpr.js} +1 -1
  132. package/dist/client/assets/{empty-state-Br6GEUGF.js → empty-state-Dwaj7cbq.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-Bb0jwaQt.js → extract-connection-data-CVZ9OfNz.js} +1 -1
  134. package/dist/client/assets/{feature-gate-B1vh3qv2.js → feature-gate-BS2HgDV3.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-DJ1kFhSu.js → feature-paywall-RTg-o893.js} +1 -1
  136. package/dist/client/assets/{file-explorer-C5b7Tkm1.js → file-explorer-BnGtvEoY.js} +1 -1
  137. package/dist/client/assets/{file-preview-CUKTqYDW.js → file-preview-Dmc96YwA.js} +1 -1
  138. package/dist/client/assets/{file-share-button-Vl0ZcNvz.js → file-share-button-UHs8Nomv.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-BWqwNVgv.js → file-type-icon-CNWOnF7H.js} +1 -1
  140. package/dist/client/assets/flat-project-C8GOOCEy.js +1 -0
  141. package/dist/client/assets/{folder-icon-Bfrgku9r.js → folder-icon-DrCMgncu.js} +1 -1
  142. package/dist/client/assets/{form-DwJJGoHU.js → form-Rtl3vzMe.js} +1 -1
  143. package/dist/client/assets/{general-XBJNq5G1.js → general-DmQRdBrG.js} +1 -1
  144. package/dist/client/assets/{home-D2fIlBWy.js → home-CljKZLNm.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-kDSDa6Az.js → hosted-publish-feedback-gLFMJ1nL.js} +1 -1
  146. package/dist/client/assets/{icon-button-DZGm8Il3.js → icon-button-B0hKyHBr.js} +1 -1
  147. package/dist/client/assets/{index-DL6kkjqE.js → index-BuWS6DRb.js} +1 -1
  148. package/dist/client/assets/{index-x_2oF3jU.js → index-BuzdQEje.js} +1 -1
  149. package/dist/client/assets/{index-D9jZYEo5.js → index-C2fABs9c.js} +1 -1
  150. package/dist/client/assets/{index-i1tVWfKf.js → index-CmBG44Dg.js} +1 -1
  151. package/dist/client/assets/{index-DxNvYUCM.js → index-CpaXiO1D.js} +1 -1
  152. package/dist/client/assets/{index-BYGMglaI.js → index-DHO4wqtP.js} +1 -1
  153. package/dist/client/assets/{index-DyI_ThcP.js → index-DLcIWoL2.js} +1 -1
  154. package/dist/client/assets/{index-9utrdjuC.js → index-D_e1FjwV.js} +4 -4
  155. package/dist/client/assets/{index-C7oYZY8J.js → index-DhgK6U3I.js} +1 -1
  156. package/dist/client/assets/{index-BpojREws.js → index-Dq0Ol_2W.js} +1 -1
  157. package/dist/client/assets/{index-Dhzv1EaX.js → index-DtKQdTUE.js} +1 -1
  158. package/dist/client/assets/{index-D-E1gNW5.js → index-DxY3oFXt.js} +3 -3
  159. package/dist/client/assets/{index-DawT02V4.js → index-PeCPnjbD.js} +1 -1
  160. package/dist/client/assets/{index-B6j23Txc.js → index-SOl_d7Ed.js} +1 -1
  161. package/dist/client/assets/{index-redirect-CULfv6Fj.js → index-redirect-Zv_6_d3i.js} +1 -1
  162. package/dist/client/assets/{index-B-s777t7.js → index-zmOiuX4C.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-h_ZnRx7A.js → infiniteQueryObserver-Cj4qEdRl.js} +1 -1
  164. package/dist/client/assets/{infra-billing-tY8-FqGS.js → infra-billing-XmfyQcIH.js} +1 -1
  165. package/dist/client/assets/{input-CoM10iw9.js → input-8F-iHbM0.js} +1 -1
  166. package/dist/client/assets/{input-D8LiOOPc.js → input-BoJbhypv.js} +3 -3
  167. package/dist/client/assets/{integration-icon-DrkScr6s.js → integration-icon-XTPBo75P.js} +1 -1
  168. package/dist/client/assets/{jira-icon-DMdRVVRh.js → jira-icon-XNoWqDpB.js} +1 -1
  169. package/dist/client/assets/{label-jgD_YhxC.js → label-BpvNCEnb.js} +1 -1
  170. package/dist/client/assets/{layout-D7mYBZuY.js → layout-ChpQshpT.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-CrPzD3d0.js → legacy-agents-deep-ByS-MUYE.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-CzjxEO-Z.js → legacy-main-redirect-Ccy3USd6.js} +1 -1
  173. package/dist/client/assets/library-B_bfBK5V.js +1 -0
  174. package/dist/client/assets/{library-tab-BNmqv1A-.js → library-tab-BhoaLjah.js} +1 -1
  175. package/dist/client/assets/{login-CX9MC3yR.js → login-BxrSgy89.js} +1 -1
  176. package/dist/client/assets/{markdown-CRrGNQ7w.js → markdown-CeBYrFC5.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-CKOO4BIM.js → mcp-app-renderer-NvRGXYxY.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-dXdRlURk.js → mcp-oauth-Bzq_QRWa.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-B4GQK3-6.js → mcp-oauth-DkhydAIA.js} +1 -1
  180. package/dist/client/assets/{members-Bgkks4fJ.js → members-CNJowEzx.js} +1 -1
  181. package/dist/client/assets/{memory-luW8UULR.js → memory-BsfWf-3x.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-CZGuZyMk.js → mini-report-page-DYL62IF4.js} +1 -1
  183. package/dist/client/assets/{mock-board-DPhntenP.js → mock-board-B1usHoAz.js} +1 -1
  184. package/dist/client/assets/{monaco-editor-DTd4Ml1s.js → monaco-editor-CW4KzWG5.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CmwPaZzs.js → monitoring-stats-row-DJLs7kug.js} +1 -1
  186. package/dist/client/assets/{multi-select-RmuNYdER.js → multi-select-lHaavCdi.js} +1 -1
  187. package/dist/client/assets/{mustache-CB_JcmYM.js → mustache-CLtZ-aXC.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-CBpaJ8k6.js → new-project-dialog-C3L9bSPP.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-Db6kY3Ny.js → oauth-callback-Do75xVB6.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-ai-provider-BYjLxIUx.js → oauth-callback-ai-provider-CpsuEWpa.js} +1 -1
  191. package/dist/client/assets/{onboarding-Bb3EEJ4K.js → onboarding-sPfgk87n.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-DxDXLfOM.js → openai-conversation-CuZL6fUQ.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-CeKaHQes.js → optimistic-project-sidebar-views-DW_dnUjn.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-DzRzOSRM.js → order-monitor-day-Bb9K11tz.js} +1 -1
  195. package/dist/client/assets/{organization-choice-Bxl6iQK7.js → organization-choice-BMAzua6G.js} +1 -1
  196. package/dist/client/assets/{orgs-Bqj7_U_a.js → orgs-scelK5uZ.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-DXuib-HU.js → page-seo-form-OSL5OFoV.js} +1 -1
  198. package/dist/client/assets/{pair-BQUvnIb5.js → pair-8ShsH0Qr.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-BhRiIQHY.js → plan-ladder-DNwkxUp1.js} +1 -1
  200. package/dist/client/assets/{popover-2IxOscUb.js → popover-CEeE7dqd.js} +1 -1
  201. package/dist/client/assets/{post-calendar-Cg1CYZFY.js → post-calendar-DnCFSuZ4.js} +1 -1
  202. package/dist/client/assets/{post-editor-DLhk35T_.js → post-editor-mXZG4iNT.js} +1 -1
  203. package/dist/client/assets/{preview-content-DGb8rCNt.js → preview-content-BuceHm_H.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-Dnk_-SyH.js → preview-dialog-BNy1YFe2.js} +1 -1
  205. package/dist/client/assets/{preview-panel-B626d_hv.js → preview-panel-C8vnMQIp.js} +1 -1
  206. package/dist/client/assets/{preview-tab-5NIcFdNQ.js → preview-tab-DiG38Ij2.js} +3 -3
  207. package/dist/client/assets/{product-picker-dialog-B8VpGtvo.js → product-picker-dialog-B1zUb2w5.js} +1 -1
  208. package/dist/client/assets/{profile-i4IB_ZqA.js → profile-BuPfp227.js} +1 -1
  209. package/dist/client/assets/{project-app-view-Chi_XpbU.js → project-app-view-CvRL57OS.js} +1 -1
  210. package/dist/client/assets/{project-feed-qbzKWba3.js → project-feed-fL5vvnmG.js} +1 -1
  211. package/dist/client/assets/{project-icon-Dxu4JaaE.js → project-icon-BE0w-kOZ.js} +1 -1
  212. package/dist/client/assets/project-reports-BztuNJ7u.js +1 -0
  213. package/dist/client/assets/project-tasks-Dawdfx-2.js +1 -0
  214. package/dist/client/assets/{projects-empty-state-sBpkEd8M.js → projects-empty-state-DtbadfhN.js} +1 -1
  215. package/dist/client/assets/{projects-CrW8i-da.js → projects-k3ePWrM8.js} +1 -1
  216. package/dist/client/assets/{prompts-CFQNoJU7.js → prompts-CJZlFPbL.js} +1 -1
  217. package/dist/client/assets/record-editor-rGrL5tBb.js +1 -0
  218. package/dist/client/assets/{redirect-editor-DniIzbjX.js → redirect-editor-COF5GTOq.js} +1 -1
  219. package/dist/client/assets/{reports-BvVAAvq1.js → reports-DH-0HmmT.js} +1 -1
  220. package/dist/client/assets/reports-PVKR-t5Z.js +1 -0
  221. package/dist/client/assets/{reports-onboarding-6BZEXDSr.js → reports-onboarding-5FMXCy6G.js} +1 -1
  222. package/dist/client/assets/{reports-tab-BPQagRR7.js → reports-tab-SMeFV_jI.js} +2 -2
  223. package/dist/client/assets/{repositories-DtMJxHQY.js → repositories-CbdeVce3.js} +1 -1
  224. package/dist/client/assets/{repository-binding-CQrhlIgt.js → repository-binding-Ck0_Tx8R.js} +1 -1
  225. package/dist/client/assets/{repository-import-picker-BakXAFwC.js → repository-import-picker-VJIbkDWe.js} +1 -1
  226. package/dist/client/assets/{repository-picker-D87Y1ek1.js → repository-picker-BZ1KCv_T.js} +1 -1
  227. package/dist/client/assets/{require-capability-DqkzPn3t.js → require-capability-BZ_ajaXn.js} +1 -1
  228. package/dist/client/assets/{required-auth-layout-Bu384CZN.js → required-auth-layout--gIjKGIN.js} +1 -1
  229. package/dist/client/assets/{reset-password-DLApkooi.js → reset-password-DpZaypJp.js} +1 -1
  230. package/dist/client/assets/{resizable-nPzQU7Gj.js → resizable-h5h9Y5oq.js} +1 -1
  231. package/dist/client/assets/{resolve-tab-icon-B1kXJBt1.js → resolve-tab-icon-D5sQsZKt.js} +1 -1
  232. package/dist/client/assets/{review-settings-DIhDZ3QW.js → review-settings-BKbSdDuH.js} +1 -1
  233. package/dist/client/assets/{roles-43B24aQj.js → roles-Bc-Hepcl.js} +1 -1
  234. package/dist/client/assets/{route-CzP0oOIr.js → route-BxYltIIL.js} +1 -1
  235. package/dist/client/assets/route-Dcad-yYp.js +1 -0
  236. package/dist/client/assets/{route-DsqdjZgh.js → route-DeZoxv-n.js} +1 -1
  237. package/dist/client/assets/{sandbox-lifecycle-context-CWStTPRQ.js → sandbox-lifecycle-context-B8nV6BWB.js} +1 -1
  238. package/dist/client/assets/{schema-DMZs6sOV.js → schema-Bwgawxt5.js} +1 -1
  239. package/dist/client/assets/{schema-QYPrIfYk.js → schema-Cg0_pwUT.js} +1 -1
  240. package/dist/client/assets/{scroll-area-Nr9Xl-Uo.js → scroll-area-C_lb7Jje.js} +1 -1
  241. package/dist/client/assets/{search-input-BW_s9pS-.js → search-input-TJxcwdFg.js} +1 -1
  242. package/dist/client/assets/{search-toggle-BZtSC8QC.js → search-toggle-C7I5-G7C.js} +1 -1
  243. package/dist/client/assets/secret-ciphertext-C6okMcC_.js +1 -0
  244. package/dist/client/assets/{secret-picker-DEIrJAjz.js → secret-picker-DCWsgdxf.js} +1 -1
  245. package/dist/client/assets/{secrets-CCTibVJ6.js → secrets-B58GVNd7.js} +1 -1
  246. package/dist/client/assets/{sections-editor-SDeVJ13p.js → sections-editor-BJ2SmDL2.js} +1 -1
  247. package/dist/client/assets/{select-CTeWg4zR.js → select-DEQANoyw.js} +1 -1
  248. package/dist/client/assets/{select-model-BRhQutV3.js → select-model-KVl-kNMM.js} +1 -1
  249. package/dist/client/assets/{seo-editor-Dd5hjU06.js → seo-editor-B_E5uosh.js} +1 -1
  250. package/dist/client/assets/{separator-DIQQHVsX.js → separator-CKc1h60H.js} +1 -1
  251. package/dist/client/assets/{settings-tab-Dwxz35-w.js → settings-tab-FrEyMoMV.js} +1 -1
  252. package/dist/client/assets/{sheet-CxN2-ZnF.js → sheet-CjAkecww.js} +1 -1
  253. package/dist/client/assets/{shell-layout-CZlXU8th.js → shell-layout-CvexXVVk.js} +1 -1
  254. package/dist/client/assets/site-editor-DIC96wDj.js +1 -0
  255. package/dist/client/assets/{site-editor-toast-ChmKWuIo.js → site-editor-toast-C-uD6zRF.js} +1 -1
  256. package/dist/client/assets/{skills-B0GaxxVf.js → skills-DhUBc3J8.js} +1 -1
  257. package/dist/client/assets/{slider-B56vNbN3.js → slider-l3C2nqf3.js} +1 -1
  258. package/dist/client/assets/{sortable.esm-CLyBckMe.js → sortable.esm-CEz1t63K.js} +1 -1
  259. package/dist/client/assets/{sso-DY0yxTqY.js → sso-CCNbtfyT.js} +1 -1
  260. package/dist/client/assets/{suggestion-BoCjWU35.js → suggestion-BA2-bTFu.js} +1 -1
  261. package/dist/client/assets/{switch-DU47sqvK.js → switch-BB4BMta4.js} +1 -1
  262. package/dist/client/assets/{symbol-CIakABEA.js → symbol-46mbKQic.js} +1 -1
  263. package/dist/client/assets/{synced-repos-CxHQhVsp.js → synced-repos-CUWDki9D.js} +1 -1
  264. package/dist/client/assets/{tab-icon-glyph-CKpjmt2U.js → tab-icon-glyph-r9KIUo9C.js} +1 -1
  265. package/dist/client/assets/{table-B-nmL0_-.js → table-4bjRQyHR.js} +1 -1
  266. package/dist/client/assets/{tabs-DUrf1MvN.js → tabs-DKbHk2Gg.js} +1 -1
  267. package/dist/client/assets/{task-board-Bf2FSU7b.js → task-board-BUaSu7tb.js} +1 -1
  268. package/dist/client/assets/{task-route-BeWr2PUl.js → task-route-BGG7sh2_.js} +1 -1
  269. package/dist/client/assets/{task-status-BYBShlgT.js → task-status-Ds5uxdx_.js} +1 -1
  270. package/dist/client/assets/taskboard-analytics-BMTrT5Ho.js +1 -0
  271. package/dist/client/assets/{tasks-CcDtjTiB.js → tasks-DQ28yWoo.js} +1 -1
  272. package/dist/client/assets/tasks-q2yo5cXh.js +1 -0
  273. package/dist/client/assets/{textarea-Cuvx1CdP.js → textarea-CE7MtUgX.js} +1 -1
  274. package/dist/client/assets/{thread-analytics-DLibYnON.js → thread-analytics-CXQy9ASJ.js} +1 -1
  275. package/dist/client/assets/{thread-intent-BNqGpPmv.js → thread-intent-C7y-mNi3.js} +1 -1
  276. package/dist/client/assets/{thread-route-DMUWje40.js → thread-route-BWDDQkT0.js} +1 -1
  277. package/dist/client/assets/{thread-route-Dus8j51h.js → thread-route-CDdp5O6O.js} +1 -1
  278. package/dist/client/assets/{thread-sheet-body-D_pd7pwg.js → thread-sheet-body-1zwREK0R.js} +1 -1
  279. package/dist/client/assets/{time-range-picker-X_Mbeps7.js → time-range-picker-Bn8GwnfG.js} +1 -1
  280. package/dist/client/assets/{toggle-group-CE4nFV3j.js → toggle-group-B1hqsL49.js} +1 -1
  281. package/dist/client/assets/{tool-namespace-Bn3NH_CO.js → tool-namespace-D-DKxP1V.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-yph4TT_t.js → toolbar-icon-button-QlJA74MF.js} +1 -1
  283. package/dist/client/assets/{tooltip-Csaklmt2.js → tooltip-Co4Z1kVi.js} +1 -1
  284. package/dist/client/assets/{tooltipContext-CMqVcQGs.js → tooltipContext-DMOc99qE.js} +1 -1
  285. package/dist/client/assets/{track-CXUUAYti.js → track-DMvXnx4V.js} +1 -1
  286. package/dist/client/assets/{types-E7V9DsSf.js → types-B2yiAKQY.js} +1 -1
  287. package/dist/client/assets/{url-slug-D2I7DZDe.js → url-slug-DF80tWtk.js} +1 -1
  288. package/dist/client/assets/{usage-stats-v3RVb3y_.js → usage-stats-D_UoN7cn.js} +1 -1
  289. package/dist/client/assets/{use-ai-providers-z0VfKQkA.js → use-ai-providers-BUCZRHcb.js} +1 -1
  290. package/dist/client/assets/{use-app-takeover-BPHco5S8.js → use-app-takeover-zvHtuBka.js} +1 -1
  291. package/dist/client/assets/{use-automations-D3__ecGN.js → use-automations-8zdg7l-n.js} +1 -1
  292. package/dist/client/assets/{use-autosave-rp1D1hy-.js → use-autosave-DR8EweDn.js} +1 -1
  293. package/dist/client/assets/{use-chat-navigation-Bvu49eld.js → use-chat-navigation-W8PH0UW2.js} +1 -1
  294. package/dist/client/assets/{use-clock-tick-CTGpjemP.js → use-clock-tick-BsIDA-Cf.js} +1 -1
  295. package/dist/client/assets/{use-connect-companion-Cf_p5pBS.js → use-connect-companion-BQ9821ac.js} +1 -1
  296. package/dist/client/assets/{use-connection-BSkRPmzW.js → use-connection-DO0-79cg.js} +1 -1
  297. package/dist/client/assets/{use-copy-C2gLm1MS.js → use-copy-OgMUCz7y.js} +1 -1
  298. package/dist/client/assets/{use-create-virtual-mcp-BJspE5E5.js → use-create-virtual-mcp-D5jpP5gm.js} +1 -1
  299. package/dist/client/assets/{use-date-fns-locale-BpcWUHYq.js → use-date-fns-locale-D0QCtxiN.js} +1 -1
  300. package/dist/client/assets/{use-debounced-autosave-DQjwS2nW.js → use-debounced-autosave-DOOn5Tkv.js} +1 -1
  301. package/dist/client/assets/{use-debounced-value-aN3O60O8.js → use-debounced-value-CBiGkTw1.js} +1 -1
  302. package/dist/client/assets/{use-deco-credits-FcmcEJSN.js → use-deco-credits-rXC7k5gk.js} +1 -1
  303. package/dist/client/assets/{use-decopilot-events-CJACnvkW.js → use-decopilot-events-c99VQCYk.js} +1 -1
  304. package/dist/client/assets/{use-delete-connection-BwhO1TUh.js → use-delete-connection-Bgit0egW.js} +1 -1
  305. package/dist/client/assets/{use-deployment-admin-CWuPuIyB.js → use-deployment-admin-C1exj-sx.js} +1 -1
  306. package/dist/client/assets/{use-ensure-project-folder-m1Ct0HuE.js → use-ensure-project-folder-BSBM_pCV.js} +1 -1
  307. package/dist/client/assets/{use-fast-preview-draft-url-Dv4NwiLW.js → use-fast-preview-draft-url-BAQhnabN.js} +1 -1
  308. package/dist/client/assets/{use-file-configs-RvPbtnWJ.js → use-file-configs-DUPfNney.js} +1 -1
  309. package/dist/client/assets/{use-infinite-scroll-B_Pt9LIF.js → use-infinite-scroll-pMxa0Zn4.js} +1 -1
  310. package/dist/client/assets/{use-join-requests-CuDM9NPn.js → use-join-requests-gg3cOI-B.js} +1 -1
  311. package/dist/client/assets/{use-main-panel-tabs-Cu_VIDGa.js → use-main-panel-tabs-CsBwc9G6.js} +1 -1
  312. package/dist/client/assets/{use-mcp-auth-status-Dy2gzk_k.js → use-mcp-auth-status-Cpx5wFs6.js} +1 -1
  313. package/dist/client/assets/{use-mcp-client-9df5aDnm.js → use-mcp-client-CfQ2861m.js} +1 -1
  314. package/dist/client/assets/{use-mcp-prompts-DXCZ6ETO.js → use-mcp-prompts-CmJ6-k3W.js} +1 -1
  315. package/dist/client/assets/{use-mcp-tools-DYCe1kmW.js → use-mcp-tools-D9QrmiTi.js} +1 -1
  316. package/dist/client/assets/{use-members-CkAWHXUS.js → use-members-DCpyBD9E.js} +1 -1
  317. package/dist/client/assets/{use-mobile-iljyEqdw.js → use-mobile-DAFwKM65.js} +1 -1
  318. package/dist/client/assets/{use-navigate-to-agent-5vkTFy3L.js → use-navigate-to-agent-DX_GuI9O.js} +1 -1
  319. package/dist/client/assets/{use-open-billing-url-DMVEBNGQ.js → use-open-billing-url-D8kQwZuK.js} +1 -1
  320. package/dist/client/assets/{use-org-auth-client-nmfdksya.js → use-org-auth-client-DlfdiRta.js} +1 -1
  321. package/dist/client/assets/{use-org-fs-D_boDaBx.js → use-org-fs-DUumxOLe.js} +1 -1
  322. package/dist/client/assets/{use-org-repo-syncs-wNbXiKM9.js → use-org-repo-syncs-CSC6XXGX.js} +1 -1
  323. package/dist/client/assets/{use-org-sso-DHEqWneE.js → use-org-sso-a6wytjjs.js} +1 -1
  324. package/dist/client/assets/{use-organization-roles-zxl4Jt7J.js → use-organization-roles-5s2YK1bp.js} +1 -1
  325. package/dist/client/assets/{use-organization-settings-NJoOWX7O.js → use-organization-settings-BRX6WalP.js} +1 -1
  326. package/dist/client/assets/{use-panel-navigate-CUtjjENr.js → use-panel-navigate-CwT4H5Ol.js} +1 -1
  327. package/dist/client/assets/{use-project-native-view-presence-D5_yzHhC.js → use-project-native-view-presence-C_S3HChZ.js} +1 -1
  328. package/dist/client/assets/{use-project-scope-BNx_AZUx.js → use-project-scope-CaxkCPVW.js} +1 -1
  329. package/dist/client/assets/{use-recent-apps-B1It8623.js → use-recent-apps-ByQEPEB4.js} +1 -1
  330. package/dist/client/assets/{use-releases-CupGy3Tl.js → use-releases-BUCOTm_R.js} +1 -1
  331. package/dist/client/assets/{use-reports-diagnostic-CKMmh23y.js → use-reports-diagnostic-Dbl7LVl2.js} +1 -1
  332. package/dist/client/assets/{use-secrets-staEZx8d.js → use-secrets-BYpVBz5m.js} +1 -1
  333. package/dist/client/assets/{use-section-preview-base-BiMz81Fh.js → use-section-preview-base-BdA5oDe6.js} +1 -1
  334. package/dist/client/assets/{use-tags-B6AdI8pR.js → use-tags-uU7Lu-ly.js} +1 -1
  335. package/dist/client/assets/{use-task-board-analytics-ZIKzvLzl.js → use-task-board-analytics-ZCbpEWlZ.js} +1 -1
  336. package/dist/client/assets/{use-task-board-events-Dg4L1ieC.js → use-task-board-events-B4NRIZnD.js} +1 -1
  337. package/dist/client/assets/{use-task-board-item-prs-CH8WxPPp.js → use-task-board-item-prs-B24H-YiX.js} +1 -1
  338. package/dist/client/assets/{use-task-board-items-D9lWoOvP.js → use-task-board-items-BrTvq28_.js} +1 -1
  339. package/dist/client/assets/{use-task-metadata-CVVlEbjb.js → use-task-metadata-DNmLWRKy.js} +1 -1
  340. package/dist/client/assets/{use-thread-analytics-BRfcGq-3.js → use-thread-analytics-kgocd4t_.js} +1 -1
  341. package/dist/client/assets/{use-thread-outputs-DdmQKcR8.js → use-thread-outputs-BnYz2rDr.js} +1 -1
  342. package/dist/client/assets/useInfiniteQuery-DwBftn5D.js +1 -0
  343. package/dist/client/assets/{useQueries-B8PhDBvp.js → useQueries-CjOre9_n.js} +1 -1
  344. package/dist/client/assets/useSuspenseInfiniteQuery-B3xhj5gS.js +1 -0
  345. package/dist/client/assets/{users-BZ8ENwTn.js → users-CabPjBXN.js} +1 -1
  346. package/dist/client/assets/{utils-Do9ZGmDL.js → utils-CA46iRUR.js} +1 -1
  347. package/dist/client/assets/{variant-calendar-w_ec5z_l.js → variant-calendar-zo0Qm_85.js} +1 -1
  348. package/dist/client/assets/{variant-draft-pointer-BR8wu_RN.js → variant-draft-pointer-CE2lhiPh.js} +1 -1
  349. package/dist/client/assets/{view-mode-toggle-CBuTqb7n.js → view-mode-toggle-CGFj4l63.js} +1 -1
  350. package/dist/client/assets/{virtual-mcp-C4e_L0IJ.js → virtual-mcp-BjHRjwkd.js} +1 -1
  351. package/dist/client/assets/{watch-sse-pool-fI8J8UBb.js → watch-sse-pool-BmJipakz.js} +1 -1
  352. package/dist/client/index.html +1 -1
  353. package/dist/server/server.js +1 -1
  354. package/package.json +1 -1
  355. package/dist/client/assets/agent-app-HWGVbOJ7.js +0 -1
  356. package/dist/client/assets/agent-deck-CoQD2PVX.js +0 -1
  357. package/dist/client/assets/agent-library-DR5yBaBG.js +0 -1
  358. package/dist/client/assets/agent-library-file-EMpTesYN.js +0 -1
  359. package/dist/client/assets/agent-settings-0qe-PPXP.js +0 -1
  360. package/dist/client/assets/agent-site-editor-code-BurdFTIc.js +0 -2
  361. package/dist/client/assets/agent-site-editor-content-CFqI7nhX.js +0 -1
  362. package/dist/client/assets/agent-site-editor-preview-DGAKgZoJ.js +0 -1
  363. package/dist/client/assets/agent-view-DZcQ6Dei.js +0 -1
  364. package/dist/client/assets/api-keys-BVyBsvzB.js +0 -1
  365. package/dist/client/assets/cms-settings-editor-C1FGv_Uu.js +0 -1
  366. package/dist/client/assets/flat-project-DyiXD5GS.js +0 -1
  367. package/dist/client/assets/library-6Nzoxihu.js +0 -1
  368. package/dist/client/assets/project-reports-Cui6JfE5.js +0 -1
  369. package/dist/client/assets/project-tasks-w5Q_JaaD.js +0 -1
  370. package/dist/client/assets/record-editor-BwwhJYb1.js +0 -1
  371. package/dist/client/assets/reports-q6TL2P6e.js +0 -1
  372. package/dist/client/assets/route-Bcyjd3x1.js +0 -1
  373. package/dist/client/assets/secret-ciphertext-DJ2PgtXB.js +0 -1
  374. package/dist/client/assets/site-editor-B8QECspx.js +0 -1
  375. package/dist/client/assets/taskboard-analytics-Bn9Uw-wM.js +0 -1
  376. package/dist/client/assets/tasks-BfKoPHRY.js +0 -1
  377. package/dist/client/assets/useInfiniteQuery-DS2Ac8OP.js +0 -1
  378. package/dist/client/assets/useSuspenseInfiniteQuery-0gOUIT7Y.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as $,b as j,r as E,j as x,l as q,ah as Tt,t as ue,aX as Xe,a2 as vt,m as At,K as Mt,b4 as St,h as Je}from"./index-9utrdjuC.js";import{a as Ct,n as Ye,E as ie,o as Rt,x as Et,y as P,z as $t,A as _t,B as et,C as N,G as Ee,H as Lt,I as It,J as $e,K as zt,L as Z,N as D,m as H,O as Y,T as tt,R as ke,Q as be,U as Pt,V as Ht,W as jt,X as Nt,Y as Ot,s as Bt,Z as Dt,u as Ft,b as qt}from"./usage-stats-v3RVb3y_.js";import{T as _,n as Wt,i as Ut,E as Gt}from"./editor-classes-Bm-ecdGw.js";import{a as Vt,e as nt,s as Zt,S as Kt}from"./suggestion-BoCjWU35.js";import{B as Qt,c as Xt,t as Jt,C as rt,f as Yt,g as _e,s as en,m as Le,a as Ie,b as tn,d as ze,e as nn,h as rn,i as sn,j as an,k as on,l as ln,n as cn}from"./index-DyI_ThcP.js";import{ag as un,ah as hn,aj as dn,L as pn,bd as fn,aV as gn}from"./agent-icon-mVoV_Rm6.js";import{i as mn}from"./SwitchHorizontal01-f0pF3KQj.js";import{i as kn}from"./Link01-B9ootJcD.js";import{s as bn}from"./Trash01-DfoQYxMm.js";import{i as xn,b as wn}from"./use-org-fs-D_boDaBx.js";import{E as Pe,i as st,c as yn,d as Tn,A as vn,e as An,m as Mn,f as Sn,g as Cn}from"./markdown-CRrGNQ7w.js";import{A as Rn}from"./avatar-CU0Kskf0.js";import{d as En,e as $n,c as _n,C as Ln,b as In}from"./command-DxMlrlhO.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-nmfdksya.js";import{I as Hn}from"./icon-button-DZGm8Il3.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=Wt(a);if(M===""){g();return}if(!Ut(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(Tt,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=Ct(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Qt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(dn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(mn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(fn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=st(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?yn:Tn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Ye("uploadSlots"),Gn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Rt({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Vn(t,e){return ee.getState(t)?.get(e)}function Zn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Et.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Kn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=st(g);Zn(h,Vn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Kn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:K,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
1
+ import{c as $,b as j,r as E,j as x,l as q,ah as Tt,t as ue,aX as Xe,a2 as vt,m as At,K as Mt,b4 as St,h as Je}from"./index-D_e1FjwV.js";import{a as Ct,n as Ye,E as ie,o as Rt,x as Et,y as P,z as $t,A as _t,B as et,C as N,G as Ee,H as Lt,I as It,J as $e,K as zt,L as Z,N as D,m as H,O as Y,T as tt,R as ke,Q as be,U as Pt,V as Ht,W as jt,X as Nt,Y as Ot,s as Bt,Z as Dt,u as Ft,b as qt}from"./usage-stats-D_UoN7cn.js";import{T as _,n as Wt,i as Ut,E as Gt}from"./editor-classes-D4Aoqmls.js";import{a as Vt,e as nt,s as Zt,S as Kt}from"./suggestion-BA2-bTFu.js";import{B as Qt,c as Xt,t as Jt,C as rt,f as Yt,g as _e,s as en,m as Le,a as Ie,b as tn,d as ze,e as nn,h as rn,i as sn,j as an,k as on,l as ln,n as cn}from"./index-DLcIWoL2.js";import{ag as un,ah as hn,aj as dn,L as pn,bd as fn,aV as gn}from"./agent-icon-Czh6MNam.js";import{i as mn}from"./SwitchHorizontal01-BspP-O9B.js";import{i as kn}from"./Link01-DJt14Rj5.js";import{s as bn}from"./Trash01-DArHDncW.js";import{i as xn,b as wn}from"./use-org-fs-DUumxOLe.js";import{E as Pe,i as st,c as yn,d as Tn,A as vn,e as An,m as Mn,f as Sn,g as Cn}from"./markdown-CeBYrFC5.js";import{A as Rn}from"./avatar-DdSak0Sb.js";import{d as En,e as $n,c as _n,C as Ln,b as In}from"./command-Dz8D1H9z.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-DlfdiRta.js";import{I as Hn}from"./icon-button-B0hKyHBr.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=Wt(a);if(M===""){g();return}if(!Ut(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(Tt,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=Ct(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Qt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(dn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(mn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(fn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=st(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?yn:Tn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Ye("uploadSlots"),Gn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Rt({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Vn(t,e){return ee.getState(t)?.get(e)}function Zn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Et.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Kn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=st(g);Zn(h,Vn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Kn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:K,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",lt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ur=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ut=/^( {2,}|\\)\n(?!\s*$)/,dr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,oe=/[\s\p{P}\p{S}]/u,Me=/[^\s\p{P}\p{S}]/u,pr=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oe).getRegex(),ht=/(?!~)[\p{P}\p{S}]/u,fr=/(?!~)[\s\p{P}\p{S}]/u,gr=/(?:[^\s\p{P}\p{S}]|~)/u,mr=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kr=A(dt,"u").replace(/punct/g,W).getRegex(),br=A(dt,"u").replace(/punct/g,ht).getRegex(),pt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=A(pt,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),wr=A(pt,"gu").replace(/notPunctSpace/g,gr).replace(/punctSpace/g,fr).replace(/punct/g,ht).getRegex(),yr=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Tr=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),vr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ar=A(vr,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Mr=A(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),Sr=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cr=A(ve).replace("(?:-->|$)","-->").getRegex(),Rr=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Er=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ft=A(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",Te).getRegex(),gt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),$r=A("reflink|nolink(?!\\()","g").replace("reflink",ft).replace("nolink",gt).getRegex(),Ne=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Se={_backpedal:O,anyPunctuation:Mr,autolink:Sr,blockSkip:mr,br:ut,code:hr,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:kr,emStrongRDelimAst:xr,emStrongRDelimUnd:yr,escape:ur,link:Er,nolink:gt,punctuation:pr,reflink:ft,reflinkSearch:$r,tag:Rr,text:dr,url:O},_r={...Se,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},de={...Se,emStrongRDelimAst:wr,emStrongLDelim:br,delLDelim:Tr,delRDelim:Ar,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ne).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ne).getRegex()},Lr={...de,br:A(ut).replace("{2,}","*").getRegex(),text:A(de.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:Ae,gfm:lr,pedantic:cr},U={normal:Se,gfm:de,breaks:Lr,pedantic:_r},Ir={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Oe=t=>Ir[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,Oe)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,Oe);return t}function Be(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function De(t,e){let n=t.replace(R.findPipe,(i,a,l)=>{let o=!1,u=a;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(R.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(R.slashPipe,"|");return r}function G(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function zr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Pr(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function Fe(t,e,n,r,s){let i=e.href,a=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,o}function Hr(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
3
3
  `).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
4
4
  `)}var ne=class{options;rules;lexer;constructor(t){this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:G(n,`
@@ -1 +1 @@
1
- import{c as L,r as G,l as B,j as i,b as X,B as je,a as he,t as te,G as Te,at as fe,av as ge,a2 as we,d as Ie,E as Le,L as ze,Y as Ee,y as ue,ab as Pe,P as $e}from"./index-9utrdjuC.js";import{h as Me,P as Oe,u as xe,i as De,j as Ke,l as We,m as Be}from"./use-app-takeover-BPHco5S8.js";import{S as Fe,a as Ge,b as Xe}from"./sheet-CxN2-ZnF.js";import{u as He}from"./use-mobile-iljyEqdw.js";import{u as Ye,a as qe,D as Ue,c as Je,C as Ve,P as Ze}from"./core.esm-mOT7IIiz.js";import{S as Qe,v as et,u as tt}from"./sortable.esm-CLyBckMe.js";import{i as st}from"./Tool01-D1AhyVfW.js";import{A as nt,z as ve,B as it}from"./agent-icon-mVoV_Rm6.js";import{s as rt}from"./Plus-COolVLwU.js";import{s as _e}from"./XClose-DVNhmkHc.js";import{T as ie,a as re,c as oe}from"./tooltip-Csaklmt2.js";import{C as me,f as ot,g as lt,e as at}from"./context-menu-ByavF3-l.js";import{C as ct}from"./create-organization-dialog-BOo3mBs5.js";import{u as dt,a as ut,b as ft}from"./use-recent-apps-B1It8623.js";import{i as ht}from"./UserSquare-C_0tdrPK.js";import{e as mt,C as pt,b as gt,c as xt,f as bt}from"./command-DxMlrlhO.js";function jt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const o=Math.abs(e)%360;return{backgroundColor:`hsl(${o} 55% 70%)`,color:`hsl(${o} 55% 20%)`}}const vt={xs:{box:"size-5",text:"text-[9px]"},sm:{box:"size-6",text:"text-xs"},lg:{box:"size-9",text:"text-sm"}};function be(t){const e=L.c(14),{org:o,size:r,rounded:n}=t,l=r===void 0?"sm":r,s=n===void 0?"rounded-md":n,{box:a,text:c}=vt[l],[d,p]=G.useState(null),u=o.logo&&o.logo!==d?o.logo:null;let h;e[0]!==s||e[1]!==a?(h=B(a,s,"shrink-0 flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=s,e[1]=a,e[2]=h):h=e[2];let m;e[3]!==u||e[4]!==o.name?(m=u?void 0:jt(o.name),e[3]=u,e[4]=o.name,e[5]=m):m=e[5];let f;e[6]!==u||e[7]!==o.name||e[8]!==c?(f=u?i.jsx("img",{src:u,alt:"",className:"size-full object-cover",onError:()=>p(u)}):i.jsx("span",{className:B("font-semibold leading-none",c),children:o.name.slice(0,2).toUpperCase()}),e[6]=u,e[7]=o.name,e[8]=c,e[9]=f):f=e[9];let g;return e[10]!==h||e[11]!==m||e[12]!==f?(g=i.jsx("div",{className:h,style:m,children:f}),e[10]=h,e[11]=m,e[12]=f,e[13]=g):g=e[13],g}function bs({invitation:t,onChanged:e}){const o=X(),[r,n]=G.useState(!1),l=t.organizationName??o("header.orgSwitcher.unknownOrganization"),s=async()=>{n(!0);try{const d=await he.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),n(!1);return}}catch{te.error(o("header.orgSwitcher.failedToAcceptInvitation")),n(!1);return}te.success(o("header.orgSwitcher.joined",{name:l})),Te();let c;try{c=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{n(!0);try{const c=await he.organization.rejectInvitation({invitationId:t.id});if(c.error){te.error(c.error.message),n(!1);return}te.success(o("header.orgSwitcher.invitationDeclined")),n(!1),e()}catch{te.error(o("header.orgSwitcher.failedToDeclineInvitation")),n(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(be,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:o("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:s,disabled:r,children:o("header.orgSwitcher.accept")}),i.jsx(je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:r,"aria-label":o("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(_e,{size:14})})]})]})}const yt=3,Ce=10,St=440,wt=55;function Re(t){const e=Math.floor((t-St)/wt);return Math.min(Ce,Math.max(yt,e))}function zt(t,e,o=Ce*3,r=[]){return[...new Set([e,...r,...t])].slice(0,o)}function Ot(t,e,o,r,n=[]){if(t.length<=r)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),s=new Set;o&&l.has(o)&&s.add(o);for(const a of n)l.has(a)&&s.add(a);for(const a of e){if(s.size>=r)break;l.has(a)&&s.add(a)}for(const a of t){if(s.size>=r)break;s.add(a.slug)}return{shown:t.filter(a=>s.has(a.slug)),hidden:t.filter(a=>!s.has(a.slug))}}const ye=[];function _t(){const t=L.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ge.recentOrgs(),t[0]=e):e=t[0];const[o,r]=fe(e,ye),n=Array.isArray(o)?o:ye;let l;t[1]!==r?(l=(a,c)=>r(d=>zt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=r,t[2]=l):l=t[2];let s;return t[3]!==n||t[4]!==l?(s={recent:n,remember:l},t[3]=n,t[4]=l,t[5]=s):s=t[5],s}const Ne={hidden:[],pinned:[],order:[]},ne=(t,e)=>t.filter(o=>o!==e);function se(t){if(typeof t!="object"||t===null)return Ne;const e=r=>Array.isArray(r)?r.filter(n=>typeof n=="string"):[],o=t;return{hidden:e(o.hidden),pinned:e(o.pinned),order:e(o.order)}}function Ct(t,e){return{...t,hidden:[...ne(t.hidden,e),e],pinned:ne(t.pinned,e)}}function Rt(t,e){return{...t,hidden:ne(t.hidden,e)}}function Nt(t,e){return t.pinned.includes(e)?{...t,pinned:ne(t.pinned,e)}:{...t,hidden:ne(t.hidden,e),pinned:[...t.pinned,e]}}function At(t,e,o){const r=n=>{const l=e.order.indexOf(n);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(n=>n.slug===o||!e.hidden.includes(n.slug)).map((n,l)=>({org:n,index:l})).sort((n,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(n.org.slug))||r(n.org.slug)-r(l.org.slug)||n.index-l.index).map(({org:n})=>n)}function kt(t,e,o,r){const n=e.indexOf(o),l=e.indexOf(r);if(n===-1||l===-1||n===l||t.pinned.includes(o)!==t.pinned.includes(r))return t;const s=[...e];return s.splice(n,1),s.splice(l,0,o),{...t,order:[...s,...t.order.filter(a=>!s.includes(a))]}}function le(t){const e=L.c(11),{active:o,label:r,children:n}=t,l=o?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let s;e[0]!==l?(s=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==s?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-0 flex h-9 items-center",children:i.jsx("span",{className:s})}),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==o||e[5]!==r?(c=r&&i.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",o?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=o,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==n||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,n,c]}),e[7]=n,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Tt(t){const e=L.c(47),{orgs:o,currentSlug:r,hiddenCount:n,onSelect:l}=t,s=X(),[a,c]=G.useState(!1);let d;e[0]!==s?(d=s("sidebar.rail.searchOrganizations"),e[0]=s,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[2]=p):p=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ht,{size:18}),e[3]=u):u=e[3];let h;e[4]!==d?(h=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":d,onClick:p,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u})}),e[4]=d,e[5]=h):h=e[5];let m;e[6]!==n||e[7]!==s?(m=n>0?s("sidebar.rail.searchMoreOrganizations",{count:n}):s("sidebar.rail.searchOrganizations"),e[6]=n,e[7]=s,e[8]=m):m=e[8];let f;e[9]!==m?(f=i.jsx(re,{side:"right",children:m}),e[9]=m,e[10]=f):f=e[10];let g;e[11]!==h||e[12]!==f?(g=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[h,f]})}),e[11]=h,e[12]=f,e[13]=g):g=e[13];let b;e[14]!==s?(b=s("sidebar.rail.searchOrganizations"),e[14]=s,e[15]=b):b=e[15];let y;e[16]!==s?(y=s("sidebar.rail.searchPlaceholder"),e[16]=s,e[17]=y):y=e[17];let v;e[18]!==s?(v=s("sidebar.rail.searchPlaceholder"),e[18]=s,e[19]=v):v=e[19];let w;e[20]!==v?(w=i.jsx(mt,{placeholder:v}),e[20]=v,e[21]=w):w=e[21];let S;e[22]!==s?(S=s("sidebar.rail.searchEmpty"),e[22]=s,e[23]=S):S=e[23];let j;e[24]!==S?(j=i.jsx(pt,{children:S}),e[24]=S,e[25]=j):j=e[25];let x;if(e[26]!==r||e[27]!==l||e[28]!==o||e[29]!==s){let R;e[31]!==r||e[32]!==l||e[33]!==s?(R=_=>i.jsxs(gt,{value:`${_.name} ${_.slug}`,onSelect:()=>{c(!1),_.slug!==r&&l(_.slug)},className:"gap-2.5",children:[i.jsx(be,{org:_,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:_.name}),_.slug===r&&i.jsx("span",{className:"text-meta shrink-0",children:s("sidebar.rail.currentOrganization")})]},_.id),e[31]=r,e[32]=l,e[33]=s,e[34]=R):R=e[34],x=o.map(R),e[26]=r,e[27]=l,e[28]=o,e[29]=s,e[30]=x}else x=e[30];let O;e[35]!==j||e[36]!==x?(O=i.jsxs(xt,{children:[j,x]}),e[35]=j,e[36]=x,e[37]=O):O=e[37];let C;e[38]!==a||e[39]!==w||e[40]!==O||e[41]!==b||e[42]!==y?(C=i.jsxs(bt,{open:a,onOpenChange:c,title:b,description:y,children:[w,O]}),e[38]=a,e[39]=w,e[40]=O,e[41]=b,e[42]=y,e[43]=C):C=e[43];let N;return e[44]!==C||e[45]!==g?(N=i.jsxs(i.Fragment,{children:[g,C]}),e[44]=C,e[45]=g,e[46]=N):N=e[46],N}function It(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Lt=()=>Re(globalThis.innerHeight),Et=()=>Re(0);function Pt(t){const e=L.c(57),{org:o,active:r,onSelect:n,pinned:l,onOpenSettings:s,onTogglePin:a,onHide:c}=t,d=X();let p;e[0]!==o.slug?(p={id:o.slug},e[0]=o.slug,e[1]=p):p=e[1];const{setNodeRef:u,listeners:h,transform:m,transition:f,isDragging:g}=tt(p);let b;e[2]!==m?(b=Ve.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=b):b=e[3];const y=g?1:void 0;let v;e[4]!==b||e[5]!==y||e[6]!==f?(v={transform:b,transition:f,zIndex:y},e[4]=b,e[5]=y,e[6]=f,e[7]=v):v=e[7];const w=o.name,S=r||void 0,j=r?void 0:n,x=r?"opacity-100":"cursor-pointer opacity-60 hover:scale-105 hover:opacity-100";let O;e[8]!==x?(O=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",x),e[8]=x,e[9]=O):O=e[9];let C;e[10]!==o?(C=i.jsx(be,{org:o,size:"lg",rounded:"rounded-xl"}),e[10]=o,e[11]=C):C=e[11];let N;e[12]!==l?(N=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(ve,{size:9})}),e[12]=l,e[13]=N):N=e[13];let R;e[14]!==o.name||e[15]!==C||e[16]!==N||e[17]!==S||e[18]!==j||e[19]!==O?(R=i.jsx(ie,{asChild:!0,children:i.jsx(ot,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":w,"aria-current":S,onClick:j,className:O,children:[C,N]})})}),e[14]=o.name,e[15]=C,e[16]=N,e[17]=S,e[18]=j,e[19]=O,e[20]=R):R=e[20];let _;e[21]!==o.name?(_=i.jsx(re,{side:"right",children:o.name}),e[21]=o.name,e[22]=_):_=e[22];let A;e[23]!==R||e[24]!==_?(A=i.jsxs(oe,{children:[R,_]}),e[23]=R,e[24]=_,e[25]=A):A=e[25];let E;e[26]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(it,{}),e[26]=E):E=e[26];let $;e[27]!==d?($=d("sidebar.rail.organizationSettings"),e[27]=d,e[28]=$):$=e[28];let M;e[29]!==s||e[30]!==$?(M=i.jsxs(me,{onSelect:s,children:[E,$]}),e[29]=s,e[30]=$,e[31]=M):M=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=i.jsx(ve,{}),e[32]=F):F=e[32];let D;e[33]!==l||e[34]!==d?(D=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[33]=l,e[34]=d,e[35]=D):D=e[35];let K;e[36]!==a||e[37]!==D?(K=i.jsxs(me,{onSelect:a,children:[F,D]}),e[36]=a,e[37]=D,e[38]=K):K=e[38];let W;e[39]!==c||e[40]!==d?(W=c&&i.jsxs(me,{onSelect:c,children:[i.jsx(st,{}),d("sidebar.rail.hideOrganization")]}),e[39]=c,e[40]=d,e[41]=W):W=e[41];let k;e[42]!==M||e[43]!==K||e[44]!==W?(k=i.jsxs(lt,{children:[M,K,W]}),e[42]=M,e[43]=K,e[44]=W,e[45]=k):k=e[45];let T;e[46]!==A||e[47]!==k?(T=i.jsxs(at,{children:[A,k]}),e[46]=A,e[47]=k,e[48]=T):T=e[48];let I;e[49]!==r||e[50]!==T?(I=i.jsx(le,{active:r,children:T}),e[49]=r,e[50]=T,e[51]=I):I=e[51];let P;return e[52]!==h||e[53]!==u||e[54]!==I||e[55]!==v?(P=i.jsx("div",{ref:u,...h,style:v,className:"w-full shrink-0 touch-none",children:I}),e[52]=h,e[53]=u,e[54]=I,e[55]=v,e[56]=P):P=e[56],P}function $t(t,e,o){const r={org:e,agentId:t.projectId};if(t.connection){const{label:l,icon:s,id:a,toolName:c}=t.connection;return{label:l,link:{to:Ee.app,params:{...r,connectionId:a,toolName:c}},glyph:i.jsx(nt,{icon:s,name:l,size:"sm+",className:"size-9 rounded-xl"})}}const n=Oe[t.app];return n?{label:o(n.labelKey),link:{to:n.to,params:r},tone:n.tone,glyph:i.jsx(n.Icon,{size:18})}:null}function Mt(t){const e=L.c(31),{entry:o,orgSlug:r,active:n,onClose:l}=t,s=X();let a,c,d,p,u,h,m,f;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s){f=Symbol.for("react.early_return_sentinel");e:{const j=$t(o,r,s);if(!j){f=null;break e}a=le,h=n,m=j.label,p="relative";let x;e[12]!==o.projectTitle?(x=i.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",o.projectTitle]}),e[12]=o.projectTitle,e[13]=x):x=e[13],u=i.jsxs(oe,{children:[i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:j.link.to,params:j.link.params,"aria-label":`${j.label} · ${o.projectTitle}`,"aria-current":n||void 0,onClick:Dt,className:B("flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",j.tone,n?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100"),children:j.glyph})}),i.jsxs(re,{side:"right",children:[j.label,x]})]}),c="button",d=s("sidebar.rail.closeApp",{name:j.label})}e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=p,e[8]=u,e[9]=h,e[10]=m,e[11]=f}else a=e[4],c=e[5],d=e[6],p=e[7],u=e[8],h=e[9],m=e[10],f=e[11];if(f!==Symbol.for("react.early_return_sentinel"))return f;let g;e[14]!==l?(g=()=>{ue("org_rail_recent_app_closed"),l()},e[14]=l,e[15]=g):g=e[15];let b,y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=B("absolute -top-1.5 -right-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),b=i.jsx(_e,{size:10}),e[16]=b,e[17]=y):(b=e[16],y=e[17]);let v;e[18]!==c||e[19]!==d||e[20]!==g?(v=i.jsx("button",{type:c,"aria-label":d,onClick:g,className:y,children:b}),e[18]=c,e[19]=d,e[20]=g,e[21]=v):v=e[21];let w;e[22]!==v||e[23]!==p||e[24]!==u?(w=i.jsxs("div",{className:p,children:[u,v]}),e[22]=v,e[23]=p,e[24]=u,e[25]=w):w=e[25];let S;return e[26]!==a||e[27]!==w||e[28]!==h||e[29]!==m?(S=i.jsx(a,{active:h,label:m,children:w}),e[26]=a,e[27]=w,e[28]=h,e[29]=m,e[30]=S):S=e[30],S}function Dt(){return ue("org_rail_recent_app_opened")}const Kt={"site-editor":"/site-editor"};function Wt(t){const e=L.c(26),{app:o}=t,r=X(),n=Oe[o],l=Kt[o];if(!n||!l)return null;let s;e[0]!==n.labelKey||e[1]!==r?(s=r(n.labelKey),e[0]=n.labelKey,e[1]=r,e[2]=s):s=e[2];let a;e[3]!==n.labelKey||e[4]!==r?(a=r(n.labelKey),e[3]=n.labelKey,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==n.tone?(c=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",n.tone),e[6]=n.tone,e[7]=c):c=e[7];let d;e[8]!==n.Icon?(d=i.jsx(n.Icon,{size:18}),e[8]=n.Icon,e[9]=d):d=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(p=i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=p):p=e[14];let u;e[15]!==n.labelKey||e[16]!==r?(u=r(n.labelKey),e[15]=n.labelKey,e[16]=r,e[17]=u):u=e[17];let h;e[18]!==u?(h=i.jsx(re,{side:"right",children:u}),e[18]=u,e[19]=h):h=e[19];let m;e[20]!==p||e[21]!==h?(m=i.jsxs(oe,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=m):m=e[22];let f;return e[23]!==s||e[24]!==m?(f=i.jsx(le,{active:!0,label:s,children:m}),e[23]=s,e[24]=m,e[25]=f):f=e[25],f}function Bt(){const{org:t}=we();return dt(t.slug),null}function Ft(){const t=L.c(56),e=X(),o=Ie(),{org:r}=we(),{data:n}=Le(),[l,s]=G.useState(!1),a=Me(),{recent:c,forget:d}=ut(r.slug),p=ft(),u=p&&p.projectId===null?p.app:null;let h;t[0]!==u||t[1]!==c?(h=u?[]:c,t[0]=u,t[1]=c,t[2]=h):h=t[2];const m=h,f=n??[],{recent:g,remember:b}=_t();let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=ge.railOrgPrefs(),t[3]=y):y=t[3];const[v,w]=fe(y,Ne),S=se(v),j=G.useSyncExternalStore(It,Lt,Et),{shown:x}=Ot(At(f,S,r.slug),g,r.slug,j,S.pinned);let O;t[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},t[4]=O):O=t[4];const C=Ye(qe(Ze,O)),N=z=>{const{active:H,over:ee}=z;ee&&(ue("org_rail_reordered"),w(ke=>kt(se(ke),x.map(Ht),String(H.id),String(ee.id))))},R=z=>{ue("org_rail_travel");const H=x.some(ee=>ee.slug===z);w(ee=>Rt(se(ee),z)),b(z,H?x.map(Xt):void 0),o({to:"/$org/home",params:{org:z}})},_=!a&&"border-r border-sidebar-border";let A;t[5]!==_?(A=B("flex w-16 shrink-0 flex-col items-center gap-1.5 overflow-y-auto bg-sidebar pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",_),t[5]=_,t[6]=A):A=t[6];let E;t[7]!==e?(E=e("sidebar.rail.ariaLabel"),t[7]=e,t[8]=E):E=t[8];const $=Ue,M=Je,F=Qe,D=x.map(Gt),K=et,W=x.map(z=>i.jsx(Pt,{org:z,active:z.slug===r.slug,pinned:S.pinned.includes(z.slug),onSelect:()=>R(z.slug),onOpenSettings:()=>o({to:"/$org/settings",params:{org:z.slug}}),onTogglePin:()=>w(H=>Nt(se(H),z.slug)),onHide:z.slug===r.slug?void 0:()=>w(H=>Ct(se(H),z.slug))},z.id));let k;t[9]!==F||t[10]!==W||t[11]!==D||t[12]!==K?(k=i.jsx(F,{items:D,strategy:K,children:W}),t[9]=F,t[10]=W,t[11]=D,t[12]=K,t[13]=k):k=t[13];let T;t[14]!==$||t[15]!==N||t[16]!==C||t[17]!==k||t[18]!==M?(T=i.jsx($,{sensors:C,collisionDetection:M,onDragEnd:N,children:k}),t[14]=$,t[15]=N,t[16]=C,t[17]=k,t[18]=M,t[19]=T):T=t[19];let I;t[20]!==r.slug||t[21]!==f||t[22]!==x.length||t[23]!==R?(I=f.length>x.length&&i.jsx(Tt,{orgs:f,currentSlug:r.slug,hiddenCount:f.length-x.length,onSelect:R}),t[20]=r.slug,t[21]=f,t[22]=x.length,t[23]=R,t[24]=I):I=t[24];let P;t[25]!==e?(P=e("sidebar.picker.newOrganization"),t[25]=e,t[26]=P):P=t[26];let ae;t[27]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>s(!0),t[27]=ae):ae=t[27];let ce;t[28]===Symbol.for("react.memo_cache_sentinel")?(ce=i.jsx(rt,{size:18}),t[28]=ce):ce=t[28];let Y;t[29]!==P?(Y=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":P,onClick:ae,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:ce})}),t[29]=P,t[30]=Y):Y=t[30];let q;t[31]!==e?(q=e("sidebar.picker.newOrganization"),t[31]=e,t[32]=q):q=t[32];let U;t[33]!==q?(U=i.jsx(re,{side:"right",children:q}),t[33]=q,t[34]=U):U=t[34];let J;t[35]!==Y||t[36]!==U?(J=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[Y,U]})}),t[35]=Y,t[36]=U,t[37]=J):J=t[37];let V;t[38]!==r.slug||t[39]!==d||t[40]!==u||t[41]!==p||t[42]!==m?(V=(m.length>0||u)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),m.map(z=>i.jsx(Mt,{entry:z,orgSlug:r.slug,active:p?.app===z.app&&p.projectId===z.projectId,onClose:()=>d(z)},`${z.app}:${z.projectId}`)),u&&i.jsx(Wt,{app:u})]}),t[38]=r.slug,t[39]=d,t[40]=u,t[41]=p,t[42]=m,t[43]=V):V=t[43];let Z;t[44]!==T||t[45]!==I||t[46]!==J||t[47]!==V||t[48]!==A||t[49]!==E?(Z=i.jsxs("div",{className:A,"aria-label":E,children:[T,I,J,V]}),t[44]=T,t[45]=I,t[46]=J,t[47]=V,t[48]=A,t[49]=E,t[50]=Z):Z=t[50];let Q;t[51]!==l?(Q=i.jsx(ct,{open:l,onOpenChange:s}),t[51]=l,t[52]=Q):Q=t[52];let de;return t[53]!==Z||t[54]!==Q?(de=i.jsxs(i.Fragment,{children:[Z,Q]}),t[53]=Z,t[54]=Q,t[55]=de):de=t[55],de}function Gt(t){return t.slug}function Xt(t){return t.slug}function Ht(t){return t.slug}function Yt(){const{state:t,isMobile:e}=xe();return t==="collapsed"&&!e}function qt(t){const e=L.c(15),{width:o,minWidth:r,maxWidth:n,onPointerDown:l,onKeyDown:s,onDoubleClick:a}=t,c=X(),{isMobile:d}=xe(),p=Yt();if(d||p)return null;let u;e[0]!==c?(u=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=u):u=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let m,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},f=i.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=f):(m=e[4],f=e[5]);let g;return e[6]!==n||e[7]!==r||e[8]!==a||e[9]!==s||e[10]!==l||e[11]!==u||e[12]!==h||e[13]!==o?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":u,"aria-valuenow":o,"aria-valuemin":r,"aria-valuemax":n,title:h,tabIndex:0,onPointerDown:l,onKeyDown:s,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:f}),e[6]=n,e[7]=r,e[8]=a,e[9]=s,e[10]=l,e[11]=u,e[12]=h,e[13]=o,e[14]=g):g=e[14],g}const pe=400,Se=16,Ut="sidebar.width.v2";function Jt(){const t=L.c(14),e=Vt;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=f=>typeof f=="number"?e(f):192,t[0]=o):o=t[0];const[r,n]=fe(Ut,o),l=G.useRef(null);let s;t[1]!==n||t[2]!==r?(s=f=>{f.preventDefault();const g=f.clientX,b=e(r),y=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),v=y?Array.from(y.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const j of v)j.style.transition="none";const w=j=>{const x=e(b+(j.clientX-g));y?.style.setProperty("--sidebar-width",`${x}px`)},S=j=>{const x=e(b+(j.clientX-g));n(x);for(const O of v)O.style.transition="";window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",w),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)},t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s;let c;t[4]!==n?(c=()=>{n(192)},t[4]=n,t[5]=c):c=t[5];const d=c;let p;t[6]!==n||t[7]!==r?(p=f=>{if(f.key==="ArrowLeft")n(e(r-Se));else if(f.key==="ArrowRight")n(e(r+Se));else if(f.key==="Home")n(192);else if(f.key==="End")n(pe);else return;f.preventDefault()},t[6]=n,t[7]=r,t[8]=p):p=t[8];const u=p,h=e(r);let m;return t[9]!==u||t[10]!==a||t[11]!==d||t[12]!==h?(m={width:h,minWidth:192,maxWidth:pe,wrapperRef:l,onStartResize:a,onKeyDownResize:u,resetWidth:d},t[9]=u,t[10]=a,t[11]=d,t[12]=h,t[13]=m):m=t[13],m}function Vt(t){return Math.max(192,Math.min(pe,t))}const Ae=G.createContext(null);function Zt(){const t=G.use(Ae);if(!t)throw new Error("Layout regions require a Layout");return t}function Qt({children:t,notice:e,outsideOrg:o}){const r=He(),[n,l]=fe(ge.sidebarOpen(),!0),s=Jt(),a=Pe();return i.jsx(Ae,{value:{isMobile:r,resize:s},children:i.jsx(De,{open:n,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!o&&i.jsx(Bt,{}),!r&&a&&(o?.rail??!0)&&i.jsx(Ft,{}),i.jsx(Ke,{ref:s.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${s.width}px`,"--sidebar-width-icon":a?"3.25rem":"3.125rem"},children:i.jsx(We,{children:t})})]})]})})})}function es(t){const e=L.c(26),{children:o,renderMobile:r}=t,n=X(),{isMobile:l,resize:s}=Zt(),{openMobile:a,setOpenMobile:c}=xe();if(!l){let g;e[0]!==s.maxWidth||e[1]!==s.minWidth||e[2]!==s.onKeyDownResize||e[3]!==s.onStartResize||e[4]!==s.resetWidth||e[5]!==s.width?(g=i.jsx(qt,{width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth,onPointerDown:s.onStartResize,onKeyDown:s.onKeyDownResize,onDoubleClick:s.resetWidth}),e[0]=s.maxWidth,e[1]=s.minWidth,e[2]=s.onKeyDownResize,e[3]=s.onStartResize,e[4]=s.resetWidth,e[5]=s.width,e[6]=g):g=e[6];let b;return e[7]!==o||e[8]!==g?(b=i.jsxs(i.Fragment,{children:[o,g]}),e[7]=o,e[8]=g,e[9]=b):b=e[9],b}let d;e[10]!==n?(d=n("layouts.shellControls.navigationTitle"),e[10]=n,e[11]=d):d=e[11];let p;e[12]!==d?(p=i.jsx(Fe,{className:"sr-only",children:d}),e[12]=d,e[13]=p):p=e[13];let u;e[14]!==c?(u=()=>c(!1),e[14]=c,e[15]=u):u=e[15];let h;e[16]!==r||e[17]!==u?(h=r({onClose:u}),e[16]=r,e[17]=u,e[18]=h):h=e[18];let m;e[19]!==p||e[20]!==h?(m=i.jsxs(Ge,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[p,h]}),e[19]=p,e[20]=h,e[21]=m):m=e[21];let f;return e[22]!==a||e[23]!==c||e[24]!==m?(f=i.jsx(Xe,{open:a,onOpenChange:c,children:m}),e[22]=a,e[23]=c,e[24]=m,e[25]=f):f=e[25],f}function ts(t){const e=L.c(3),{children:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let n;return e[1]!==o?(n=i.jsx(Be,{className:"flex flex-col min-h-0",style:r,children:i.jsx($e,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o})})}),e[1]=o,e[2]=n):n=e[2],n}const js=Object.assign(Qt,{Sidebar:es,Content:ts});export{bs as I,js as L,be as O,Yt as u};
1
+ import{c as L,r as G,l as B,j as i,b as X,B as je,a as he,t as te,G as Te,at as fe,av as ge,a2 as we,d as Ie,E as Le,L as ze,Y as Ee,y as ue,ab as Pe,P as $e}from"./index-D_e1FjwV.js";import{h as Me,P as Oe,u as xe,i as De,j as Ke,l as We,m as Be}from"./use-app-takeover-zvHtuBka.js";import{S as Fe,a as Ge,b as Xe}from"./sheet-CjAkecww.js";import{u as He}from"./use-mobile-DAFwKM65.js";import{u as Ye,a as qe,D as Ue,c as Je,C as Ve,P as Ze}from"./core.esm-DajKxe8q.js";import{S as Qe,v as et,u as tt}from"./sortable.esm-CEz1t63K.js";import{i as st}from"./Tool01-CbGwYE-2.js";import{A as nt,z as ve,B as it}from"./agent-icon-Czh6MNam.js";import{s as rt}from"./Plus-DmY-I-W1.js";import{s as _e}from"./XClose-DxE71MU7.js";import{T as ie,a as re,c as oe}from"./tooltip-Co4Z1kVi.js";import{C as me,f as ot,g as lt,e as at}from"./context-menu-CPfLEqbb.js";import{C as ct}from"./create-organization-dialog-CK2tPr-0.js";import{u as dt,a as ut,b as ft}from"./use-recent-apps-ByQEPEB4.js";import{i as ht}from"./UserSquare-zw-tgJGh.js";import{e as mt,C as pt,b as gt,c as xt,f as bt}from"./command-Dz8D1H9z.js";function jt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const o=Math.abs(e)%360;return{backgroundColor:`hsl(${o} 55% 70%)`,color:`hsl(${o} 55% 20%)`}}const vt={xs:{box:"size-5",text:"text-[9px]"},sm:{box:"size-6",text:"text-xs"},lg:{box:"size-9",text:"text-sm"}};function be(t){const e=L.c(14),{org:o,size:r,rounded:n}=t,l=r===void 0?"sm":r,s=n===void 0?"rounded-md":n,{box:a,text:c}=vt[l],[d,p]=G.useState(null),u=o.logo&&o.logo!==d?o.logo:null;let h;e[0]!==s||e[1]!==a?(h=B(a,s,"shrink-0 flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=s,e[1]=a,e[2]=h):h=e[2];let m;e[3]!==u||e[4]!==o.name?(m=u?void 0:jt(o.name),e[3]=u,e[4]=o.name,e[5]=m):m=e[5];let f;e[6]!==u||e[7]!==o.name||e[8]!==c?(f=u?i.jsx("img",{src:u,alt:"",className:"size-full object-cover",onError:()=>p(u)}):i.jsx("span",{className:B("font-semibold leading-none",c),children:o.name.slice(0,2).toUpperCase()}),e[6]=u,e[7]=o.name,e[8]=c,e[9]=f):f=e[9];let g;return e[10]!==h||e[11]!==m||e[12]!==f?(g=i.jsx("div",{className:h,style:m,children:f}),e[10]=h,e[11]=m,e[12]=f,e[13]=g):g=e[13],g}function bs({invitation:t,onChanged:e}){const o=X(),[r,n]=G.useState(!1),l=t.organizationName??o("header.orgSwitcher.unknownOrganization"),s=async()=>{n(!0);try{const d=await he.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),n(!1);return}}catch{te.error(o("header.orgSwitcher.failedToAcceptInvitation")),n(!1);return}te.success(o("header.orgSwitcher.joined",{name:l})),Te();let c;try{c=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{n(!0);try{const c=await he.organization.rejectInvitation({invitationId:t.id});if(c.error){te.error(c.error.message),n(!1);return}te.success(o("header.orgSwitcher.invitationDeclined")),n(!1),e()}catch{te.error(o("header.orgSwitcher.failedToDeclineInvitation")),n(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(be,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:o("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:s,disabled:r,children:o("header.orgSwitcher.accept")}),i.jsx(je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:r,"aria-label":o("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(_e,{size:14})})]})]})}const yt=3,Ce=10,St=440,wt=55;function Re(t){const e=Math.floor((t-St)/wt);return Math.min(Ce,Math.max(yt,e))}function zt(t,e,o=Ce*3,r=[]){return[...new Set([e,...r,...t])].slice(0,o)}function Ot(t,e,o,r,n=[]){if(t.length<=r)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),s=new Set;o&&l.has(o)&&s.add(o);for(const a of n)l.has(a)&&s.add(a);for(const a of e){if(s.size>=r)break;l.has(a)&&s.add(a)}for(const a of t){if(s.size>=r)break;s.add(a.slug)}return{shown:t.filter(a=>s.has(a.slug)),hidden:t.filter(a=>!s.has(a.slug))}}const ye=[];function _t(){const t=L.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ge.recentOrgs(),t[0]=e):e=t[0];const[o,r]=fe(e,ye),n=Array.isArray(o)?o:ye;let l;t[1]!==r?(l=(a,c)=>r(d=>zt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=r,t[2]=l):l=t[2];let s;return t[3]!==n||t[4]!==l?(s={recent:n,remember:l},t[3]=n,t[4]=l,t[5]=s):s=t[5],s}const Ne={hidden:[],pinned:[],order:[]},ne=(t,e)=>t.filter(o=>o!==e);function se(t){if(typeof t!="object"||t===null)return Ne;const e=r=>Array.isArray(r)?r.filter(n=>typeof n=="string"):[],o=t;return{hidden:e(o.hidden),pinned:e(o.pinned),order:e(o.order)}}function Ct(t,e){return{...t,hidden:[...ne(t.hidden,e),e],pinned:ne(t.pinned,e)}}function Rt(t,e){return{...t,hidden:ne(t.hidden,e)}}function Nt(t,e){return t.pinned.includes(e)?{...t,pinned:ne(t.pinned,e)}:{...t,hidden:ne(t.hidden,e),pinned:[...t.pinned,e]}}function At(t,e,o){const r=n=>{const l=e.order.indexOf(n);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(n=>n.slug===o||!e.hidden.includes(n.slug)).map((n,l)=>({org:n,index:l})).sort((n,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(n.org.slug))||r(n.org.slug)-r(l.org.slug)||n.index-l.index).map(({org:n})=>n)}function kt(t,e,o,r){const n=e.indexOf(o),l=e.indexOf(r);if(n===-1||l===-1||n===l||t.pinned.includes(o)!==t.pinned.includes(r))return t;const s=[...e];return s.splice(n,1),s.splice(l,0,o),{...t,order:[...s,...t.order.filter(a=>!s.includes(a))]}}function le(t){const e=L.c(11),{active:o,label:r,children:n}=t,l=o?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let s;e[0]!==l?(s=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==s?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-0 flex h-9 items-center",children:i.jsx("span",{className:s})}),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==o||e[5]!==r?(c=r&&i.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",o?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=o,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==n||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,n,c]}),e[7]=n,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Tt(t){const e=L.c(47),{orgs:o,currentSlug:r,hiddenCount:n,onSelect:l}=t,s=X(),[a,c]=G.useState(!1);let d;e[0]!==s?(d=s("sidebar.rail.searchOrganizations"),e[0]=s,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[2]=p):p=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ht,{size:18}),e[3]=u):u=e[3];let h;e[4]!==d?(h=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":d,onClick:p,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u})}),e[4]=d,e[5]=h):h=e[5];let m;e[6]!==n||e[7]!==s?(m=n>0?s("sidebar.rail.searchMoreOrganizations",{count:n}):s("sidebar.rail.searchOrganizations"),e[6]=n,e[7]=s,e[8]=m):m=e[8];let f;e[9]!==m?(f=i.jsx(re,{side:"right",children:m}),e[9]=m,e[10]=f):f=e[10];let g;e[11]!==h||e[12]!==f?(g=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[h,f]})}),e[11]=h,e[12]=f,e[13]=g):g=e[13];let b;e[14]!==s?(b=s("sidebar.rail.searchOrganizations"),e[14]=s,e[15]=b):b=e[15];let y;e[16]!==s?(y=s("sidebar.rail.searchPlaceholder"),e[16]=s,e[17]=y):y=e[17];let v;e[18]!==s?(v=s("sidebar.rail.searchPlaceholder"),e[18]=s,e[19]=v):v=e[19];let w;e[20]!==v?(w=i.jsx(mt,{placeholder:v}),e[20]=v,e[21]=w):w=e[21];let S;e[22]!==s?(S=s("sidebar.rail.searchEmpty"),e[22]=s,e[23]=S):S=e[23];let j;e[24]!==S?(j=i.jsx(pt,{children:S}),e[24]=S,e[25]=j):j=e[25];let x;if(e[26]!==r||e[27]!==l||e[28]!==o||e[29]!==s){let R;e[31]!==r||e[32]!==l||e[33]!==s?(R=_=>i.jsxs(gt,{value:`${_.name} ${_.slug}`,onSelect:()=>{c(!1),_.slug!==r&&l(_.slug)},className:"gap-2.5",children:[i.jsx(be,{org:_,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:_.name}),_.slug===r&&i.jsx("span",{className:"text-meta shrink-0",children:s("sidebar.rail.currentOrganization")})]},_.id),e[31]=r,e[32]=l,e[33]=s,e[34]=R):R=e[34],x=o.map(R),e[26]=r,e[27]=l,e[28]=o,e[29]=s,e[30]=x}else x=e[30];let O;e[35]!==j||e[36]!==x?(O=i.jsxs(xt,{children:[j,x]}),e[35]=j,e[36]=x,e[37]=O):O=e[37];let C;e[38]!==a||e[39]!==w||e[40]!==O||e[41]!==b||e[42]!==y?(C=i.jsxs(bt,{open:a,onOpenChange:c,title:b,description:y,children:[w,O]}),e[38]=a,e[39]=w,e[40]=O,e[41]=b,e[42]=y,e[43]=C):C=e[43];let N;return e[44]!==C||e[45]!==g?(N=i.jsxs(i.Fragment,{children:[g,C]}),e[44]=C,e[45]=g,e[46]=N):N=e[46],N}function It(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Lt=()=>Re(globalThis.innerHeight),Et=()=>Re(0);function Pt(t){const e=L.c(57),{org:o,active:r,onSelect:n,pinned:l,onOpenSettings:s,onTogglePin:a,onHide:c}=t,d=X();let p;e[0]!==o.slug?(p={id:o.slug},e[0]=o.slug,e[1]=p):p=e[1];const{setNodeRef:u,listeners:h,transform:m,transition:f,isDragging:g}=tt(p);let b;e[2]!==m?(b=Ve.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=b):b=e[3];const y=g?1:void 0;let v;e[4]!==b||e[5]!==y||e[6]!==f?(v={transform:b,transition:f,zIndex:y},e[4]=b,e[5]=y,e[6]=f,e[7]=v):v=e[7];const w=o.name,S=r||void 0,j=r?void 0:n,x=r?"opacity-100":"cursor-pointer opacity-60 hover:scale-105 hover:opacity-100";let O;e[8]!==x?(O=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",x),e[8]=x,e[9]=O):O=e[9];let C;e[10]!==o?(C=i.jsx(be,{org:o,size:"lg",rounded:"rounded-xl"}),e[10]=o,e[11]=C):C=e[11];let N;e[12]!==l?(N=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(ve,{size:9})}),e[12]=l,e[13]=N):N=e[13];let R;e[14]!==o.name||e[15]!==C||e[16]!==N||e[17]!==S||e[18]!==j||e[19]!==O?(R=i.jsx(ie,{asChild:!0,children:i.jsx(ot,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":w,"aria-current":S,onClick:j,className:O,children:[C,N]})})}),e[14]=o.name,e[15]=C,e[16]=N,e[17]=S,e[18]=j,e[19]=O,e[20]=R):R=e[20];let _;e[21]!==o.name?(_=i.jsx(re,{side:"right",children:o.name}),e[21]=o.name,e[22]=_):_=e[22];let A;e[23]!==R||e[24]!==_?(A=i.jsxs(oe,{children:[R,_]}),e[23]=R,e[24]=_,e[25]=A):A=e[25];let E;e[26]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(it,{}),e[26]=E):E=e[26];let $;e[27]!==d?($=d("sidebar.rail.organizationSettings"),e[27]=d,e[28]=$):$=e[28];let M;e[29]!==s||e[30]!==$?(M=i.jsxs(me,{onSelect:s,children:[E,$]}),e[29]=s,e[30]=$,e[31]=M):M=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=i.jsx(ve,{}),e[32]=F):F=e[32];let D;e[33]!==l||e[34]!==d?(D=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[33]=l,e[34]=d,e[35]=D):D=e[35];let K;e[36]!==a||e[37]!==D?(K=i.jsxs(me,{onSelect:a,children:[F,D]}),e[36]=a,e[37]=D,e[38]=K):K=e[38];let W;e[39]!==c||e[40]!==d?(W=c&&i.jsxs(me,{onSelect:c,children:[i.jsx(st,{}),d("sidebar.rail.hideOrganization")]}),e[39]=c,e[40]=d,e[41]=W):W=e[41];let k;e[42]!==M||e[43]!==K||e[44]!==W?(k=i.jsxs(lt,{children:[M,K,W]}),e[42]=M,e[43]=K,e[44]=W,e[45]=k):k=e[45];let T;e[46]!==A||e[47]!==k?(T=i.jsxs(at,{children:[A,k]}),e[46]=A,e[47]=k,e[48]=T):T=e[48];let I;e[49]!==r||e[50]!==T?(I=i.jsx(le,{active:r,children:T}),e[49]=r,e[50]=T,e[51]=I):I=e[51];let P;return e[52]!==h||e[53]!==u||e[54]!==I||e[55]!==v?(P=i.jsx("div",{ref:u,...h,style:v,className:"w-full shrink-0 touch-none",children:I}),e[52]=h,e[53]=u,e[54]=I,e[55]=v,e[56]=P):P=e[56],P}function $t(t,e,o){const r={org:e,agentId:t.projectId};if(t.connection){const{label:l,icon:s,id:a,toolName:c}=t.connection;return{label:l,link:{to:Ee.app,params:{...r,connectionId:a,toolName:c}},glyph:i.jsx(nt,{icon:s,name:l,size:"sm+",className:"size-9 rounded-xl"})}}const n=Oe[t.app];return n?{label:o(n.labelKey),link:{to:n.to,params:r},tone:n.tone,glyph:i.jsx(n.Icon,{size:18})}:null}function Mt(t){const e=L.c(31),{entry:o,orgSlug:r,active:n,onClose:l}=t,s=X();let a,c,d,p,u,h,m,f;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s){f=Symbol.for("react.early_return_sentinel");e:{const j=$t(o,r,s);if(!j){f=null;break e}a=le,h=n,m=j.label,p="relative";let x;e[12]!==o.projectTitle?(x=i.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",o.projectTitle]}),e[12]=o.projectTitle,e[13]=x):x=e[13],u=i.jsxs(oe,{children:[i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:j.link.to,params:j.link.params,"aria-label":`${j.label} · ${o.projectTitle}`,"aria-current":n||void 0,onClick:Dt,className:B("flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",j.tone,n?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100"),children:j.glyph})}),i.jsxs(re,{side:"right",children:[j.label,x]})]}),c="button",d=s("sidebar.rail.closeApp",{name:j.label})}e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=p,e[8]=u,e[9]=h,e[10]=m,e[11]=f}else a=e[4],c=e[5],d=e[6],p=e[7],u=e[8],h=e[9],m=e[10],f=e[11];if(f!==Symbol.for("react.early_return_sentinel"))return f;let g;e[14]!==l?(g=()=>{ue("org_rail_recent_app_closed"),l()},e[14]=l,e[15]=g):g=e[15];let b,y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=B("absolute -top-1.5 -right-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),b=i.jsx(_e,{size:10}),e[16]=b,e[17]=y):(b=e[16],y=e[17]);let v;e[18]!==c||e[19]!==d||e[20]!==g?(v=i.jsx("button",{type:c,"aria-label":d,onClick:g,className:y,children:b}),e[18]=c,e[19]=d,e[20]=g,e[21]=v):v=e[21];let w;e[22]!==v||e[23]!==p||e[24]!==u?(w=i.jsxs("div",{className:p,children:[u,v]}),e[22]=v,e[23]=p,e[24]=u,e[25]=w):w=e[25];let S;return e[26]!==a||e[27]!==w||e[28]!==h||e[29]!==m?(S=i.jsx(a,{active:h,label:m,children:w}),e[26]=a,e[27]=w,e[28]=h,e[29]=m,e[30]=S):S=e[30],S}function Dt(){return ue("org_rail_recent_app_opened")}const Kt={"site-editor":"/site-editor"};function Wt(t){const e=L.c(26),{app:o}=t,r=X(),n=Oe[o],l=Kt[o];if(!n||!l)return null;let s;e[0]!==n.labelKey||e[1]!==r?(s=r(n.labelKey),e[0]=n.labelKey,e[1]=r,e[2]=s):s=e[2];let a;e[3]!==n.labelKey||e[4]!==r?(a=r(n.labelKey),e[3]=n.labelKey,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==n.tone?(c=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",n.tone),e[6]=n.tone,e[7]=c):c=e[7];let d;e[8]!==n.Icon?(d=i.jsx(n.Icon,{size:18}),e[8]=n.Icon,e[9]=d):d=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(p=i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=p):p=e[14];let u;e[15]!==n.labelKey||e[16]!==r?(u=r(n.labelKey),e[15]=n.labelKey,e[16]=r,e[17]=u):u=e[17];let h;e[18]!==u?(h=i.jsx(re,{side:"right",children:u}),e[18]=u,e[19]=h):h=e[19];let m;e[20]!==p||e[21]!==h?(m=i.jsxs(oe,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=m):m=e[22];let f;return e[23]!==s||e[24]!==m?(f=i.jsx(le,{active:!0,label:s,children:m}),e[23]=s,e[24]=m,e[25]=f):f=e[25],f}function Bt(){const{org:t}=we();return dt(t.slug),null}function Ft(){const t=L.c(56),e=X(),o=Ie(),{org:r}=we(),{data:n}=Le(),[l,s]=G.useState(!1),a=Me(),{recent:c,forget:d}=ut(r.slug),p=ft(),u=p&&p.projectId===null?p.app:null;let h;t[0]!==u||t[1]!==c?(h=u?[]:c,t[0]=u,t[1]=c,t[2]=h):h=t[2];const m=h,f=n??[],{recent:g,remember:b}=_t();let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=ge.railOrgPrefs(),t[3]=y):y=t[3];const[v,w]=fe(y,Ne),S=se(v),j=G.useSyncExternalStore(It,Lt,Et),{shown:x}=Ot(At(f,S,r.slug),g,r.slug,j,S.pinned);let O;t[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},t[4]=O):O=t[4];const C=Ye(qe(Ze,O)),N=z=>{const{active:H,over:ee}=z;ee&&(ue("org_rail_reordered"),w(ke=>kt(se(ke),x.map(Ht),String(H.id),String(ee.id))))},R=z=>{ue("org_rail_travel");const H=x.some(ee=>ee.slug===z);w(ee=>Rt(se(ee),z)),b(z,H?x.map(Xt):void 0),o({to:"/$org/home",params:{org:z}})},_=!a&&"border-r border-sidebar-border";let A;t[5]!==_?(A=B("flex w-16 shrink-0 flex-col items-center gap-1.5 overflow-y-auto bg-sidebar pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",_),t[5]=_,t[6]=A):A=t[6];let E;t[7]!==e?(E=e("sidebar.rail.ariaLabel"),t[7]=e,t[8]=E):E=t[8];const $=Ue,M=Je,F=Qe,D=x.map(Gt),K=et,W=x.map(z=>i.jsx(Pt,{org:z,active:z.slug===r.slug,pinned:S.pinned.includes(z.slug),onSelect:()=>R(z.slug),onOpenSettings:()=>o({to:"/$org/settings",params:{org:z.slug}}),onTogglePin:()=>w(H=>Nt(se(H),z.slug)),onHide:z.slug===r.slug?void 0:()=>w(H=>Ct(se(H),z.slug))},z.id));let k;t[9]!==F||t[10]!==W||t[11]!==D||t[12]!==K?(k=i.jsx(F,{items:D,strategy:K,children:W}),t[9]=F,t[10]=W,t[11]=D,t[12]=K,t[13]=k):k=t[13];let T;t[14]!==$||t[15]!==N||t[16]!==C||t[17]!==k||t[18]!==M?(T=i.jsx($,{sensors:C,collisionDetection:M,onDragEnd:N,children:k}),t[14]=$,t[15]=N,t[16]=C,t[17]=k,t[18]=M,t[19]=T):T=t[19];let I;t[20]!==r.slug||t[21]!==f||t[22]!==x.length||t[23]!==R?(I=f.length>x.length&&i.jsx(Tt,{orgs:f,currentSlug:r.slug,hiddenCount:f.length-x.length,onSelect:R}),t[20]=r.slug,t[21]=f,t[22]=x.length,t[23]=R,t[24]=I):I=t[24];let P;t[25]!==e?(P=e("sidebar.picker.newOrganization"),t[25]=e,t[26]=P):P=t[26];let ae;t[27]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>s(!0),t[27]=ae):ae=t[27];let ce;t[28]===Symbol.for("react.memo_cache_sentinel")?(ce=i.jsx(rt,{size:18}),t[28]=ce):ce=t[28];let Y;t[29]!==P?(Y=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":P,onClick:ae,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:ce})}),t[29]=P,t[30]=Y):Y=t[30];let q;t[31]!==e?(q=e("sidebar.picker.newOrganization"),t[31]=e,t[32]=q):q=t[32];let U;t[33]!==q?(U=i.jsx(re,{side:"right",children:q}),t[33]=q,t[34]=U):U=t[34];let J;t[35]!==Y||t[36]!==U?(J=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[Y,U]})}),t[35]=Y,t[36]=U,t[37]=J):J=t[37];let V;t[38]!==r.slug||t[39]!==d||t[40]!==u||t[41]!==p||t[42]!==m?(V=(m.length>0||u)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),m.map(z=>i.jsx(Mt,{entry:z,orgSlug:r.slug,active:p?.app===z.app&&p.projectId===z.projectId,onClose:()=>d(z)},`${z.app}:${z.projectId}`)),u&&i.jsx(Wt,{app:u})]}),t[38]=r.slug,t[39]=d,t[40]=u,t[41]=p,t[42]=m,t[43]=V):V=t[43];let Z;t[44]!==T||t[45]!==I||t[46]!==J||t[47]!==V||t[48]!==A||t[49]!==E?(Z=i.jsxs("div",{className:A,"aria-label":E,children:[T,I,J,V]}),t[44]=T,t[45]=I,t[46]=J,t[47]=V,t[48]=A,t[49]=E,t[50]=Z):Z=t[50];let Q;t[51]!==l?(Q=i.jsx(ct,{open:l,onOpenChange:s}),t[51]=l,t[52]=Q):Q=t[52];let de;return t[53]!==Z||t[54]!==Q?(de=i.jsxs(i.Fragment,{children:[Z,Q]}),t[53]=Z,t[54]=Q,t[55]=de):de=t[55],de}function Gt(t){return t.slug}function Xt(t){return t.slug}function Ht(t){return t.slug}function Yt(){const{state:t,isMobile:e}=xe();return t==="collapsed"&&!e}function qt(t){const e=L.c(15),{width:o,minWidth:r,maxWidth:n,onPointerDown:l,onKeyDown:s,onDoubleClick:a}=t,c=X(),{isMobile:d}=xe(),p=Yt();if(d||p)return null;let u;e[0]!==c?(u=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=u):u=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let m,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},f=i.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=f):(m=e[4],f=e[5]);let g;return e[6]!==n||e[7]!==r||e[8]!==a||e[9]!==s||e[10]!==l||e[11]!==u||e[12]!==h||e[13]!==o?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":u,"aria-valuenow":o,"aria-valuemin":r,"aria-valuemax":n,title:h,tabIndex:0,onPointerDown:l,onKeyDown:s,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:f}),e[6]=n,e[7]=r,e[8]=a,e[9]=s,e[10]=l,e[11]=u,e[12]=h,e[13]=o,e[14]=g):g=e[14],g}const pe=400,Se=16,Ut="sidebar.width.v2";function Jt(){const t=L.c(14),e=Vt;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=f=>typeof f=="number"?e(f):192,t[0]=o):o=t[0];const[r,n]=fe(Ut,o),l=G.useRef(null);let s;t[1]!==n||t[2]!==r?(s=f=>{f.preventDefault();const g=f.clientX,b=e(r),y=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),v=y?Array.from(y.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const j of v)j.style.transition="none";const w=j=>{const x=e(b+(j.clientX-g));y?.style.setProperty("--sidebar-width",`${x}px`)},S=j=>{const x=e(b+(j.clientX-g));n(x);for(const O of v)O.style.transition="";window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",w),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)},t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s;let c;t[4]!==n?(c=()=>{n(192)},t[4]=n,t[5]=c):c=t[5];const d=c;let p;t[6]!==n||t[7]!==r?(p=f=>{if(f.key==="ArrowLeft")n(e(r-Se));else if(f.key==="ArrowRight")n(e(r+Se));else if(f.key==="Home")n(192);else if(f.key==="End")n(pe);else return;f.preventDefault()},t[6]=n,t[7]=r,t[8]=p):p=t[8];const u=p,h=e(r);let m;return t[9]!==u||t[10]!==a||t[11]!==d||t[12]!==h?(m={width:h,minWidth:192,maxWidth:pe,wrapperRef:l,onStartResize:a,onKeyDownResize:u,resetWidth:d},t[9]=u,t[10]=a,t[11]=d,t[12]=h,t[13]=m):m=t[13],m}function Vt(t){return Math.max(192,Math.min(pe,t))}const Ae=G.createContext(null);function Zt(){const t=G.use(Ae);if(!t)throw new Error("Layout regions require a Layout");return t}function Qt({children:t,notice:e,outsideOrg:o}){const r=He(),[n,l]=fe(ge.sidebarOpen(),!0),s=Jt(),a=Pe();return i.jsx(Ae,{value:{isMobile:r,resize:s},children:i.jsx(De,{open:n,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!o&&i.jsx(Bt,{}),!r&&a&&(o?.rail??!0)&&i.jsx(Ft,{}),i.jsx(Ke,{ref:s.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${s.width}px`,"--sidebar-width-icon":a?"3.25rem":"3.125rem"},children:i.jsx(We,{children:t})})]})]})})})}function es(t){const e=L.c(26),{children:o,renderMobile:r}=t,n=X(),{isMobile:l,resize:s}=Zt(),{openMobile:a,setOpenMobile:c}=xe();if(!l){let g;e[0]!==s.maxWidth||e[1]!==s.minWidth||e[2]!==s.onKeyDownResize||e[3]!==s.onStartResize||e[4]!==s.resetWidth||e[5]!==s.width?(g=i.jsx(qt,{width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth,onPointerDown:s.onStartResize,onKeyDown:s.onKeyDownResize,onDoubleClick:s.resetWidth}),e[0]=s.maxWidth,e[1]=s.minWidth,e[2]=s.onKeyDownResize,e[3]=s.onStartResize,e[4]=s.resetWidth,e[5]=s.width,e[6]=g):g=e[6];let b;return e[7]!==o||e[8]!==g?(b=i.jsxs(i.Fragment,{children:[o,g]}),e[7]=o,e[8]=g,e[9]=b):b=e[9],b}let d;e[10]!==n?(d=n("layouts.shellControls.navigationTitle"),e[10]=n,e[11]=d):d=e[11];let p;e[12]!==d?(p=i.jsx(Fe,{className:"sr-only",children:d}),e[12]=d,e[13]=p):p=e[13];let u;e[14]!==c?(u=()=>c(!1),e[14]=c,e[15]=u):u=e[15];let h;e[16]!==r||e[17]!==u?(h=r({onClose:u}),e[16]=r,e[17]=u,e[18]=h):h=e[18];let m;e[19]!==p||e[20]!==h?(m=i.jsxs(Ge,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[p,h]}),e[19]=p,e[20]=h,e[21]=m):m=e[21];let f;return e[22]!==a||e[23]!==c||e[24]!==m?(f=i.jsx(Xe,{open:a,onOpenChange:c,children:m}),e[22]=a,e[23]=c,e[24]=m,e[25]=f):f=e[25],f}function ts(t){const e=L.c(3),{children:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let n;return e[1]!==o?(n=i.jsx(Be,{className:"flex flex-col min-h-0",style:r,children:i.jsx($e,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o})})}),e[1]=o,e[2]=n):n=e[2],n}const js=Object.assign(Qt,{Sidebar:es,Content:ts});export{bs as I,js as L,be as O,Yt as u};
@@ -1 +1 @@
1
- import{r as i,j as t,bC as o}from"./index-9utrdjuC.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
1
+ import{r as i,j as t,bC as o}from"./index-D_e1FjwV.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
@@ -1,2 +1,2 @@
1
- import{a2 as X,o as Be,r as k,j as n,K as W,b8 as ie,c as F,aL as Oe,l as H,H as Ae,b as Z,t as ce,h as ue,s as be,v as ye,q as ve,D as Se,d as je,y as de,aM as Ie,B as Ee}from"./index-9utrdjuC.js";import{u as we,d as $e,b as Ne,f as Fe,T as He,A as ze,i as Ke,c as qe,j as Ge,k as Ue,p as Qe,L as Ve}from"./chat-context-Beu1j-5J.js";import{b as Ye}from"./sandbox-url-D3mC8qhT.js";import{a as Je}from"./repository-binding-CQrhlIgt.js";import{e as We}from"./backoff-CrEUbyZT.js";import{n as Xe}from"./ArrowUp-CN7A9Moq.js";import{s as Ze,g as Ce,d as et}from"./tool-namespace-Bn3NH_CO.js";import{b as se,T as tt,a as st,c as nt}from"./tooltip-Csaklmt2.js";import{d as rt,b as at,a as ot,D as lt}from"./drawer-B7KRQQab.js";import{C as it}from"./collection-search-FUqdxX3H.js";import{u as ct}from"./use-mobile-iljyEqdw.js";import{u as ut}from"./use-mcp-client-9df5aDnm.js";import{u as dt,g as ft}from"./use-mcp-prompts-DXCZ6ETO.js";import{c as mt,P as pt}from"./usage-stats-v3RVb3y_.js";import{T as ht,d as gt,c as xt,e as bt,H as yt}from"./input-D8LiOOPc.js";import{u as vt,a as St,S as jt,M as fe}from"./pair-BQUvnIb5.js";import{a as Et}from"./use-panel-navigate-CUtjjENr.js";import{u as wt}from"./thread-intent-BNqGpPmv.js";import{N as Nt}from"./index-B6j23Txc.js";import{i as Ct}from"./LinkBroken01-DdphioXH.js";import{e as Te}from"./agent-icon-mVoV_Rm6.js";import{e as Tt}from"./use-decopilot-events-CJACnvkW.js";import{u as kt}from"./use-deco-credits-FcmcEJSN.js";import{F as Pt}from"./feature-paywall-DJ1kFhSu.js";import{i as Dt}from"./AlertCircle-C1f-lxgM.js";function me(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const Rt={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ke=k.createContext(Rt),pe=16384;class _t{data="";append(e){this.data+=e,this.data.length>pe&&(this.data=this.data.slice(this.data.length-pe))}get(){return this.data}clear(){this.data=""}}const Lt=1e3,Mt=3e4,Bt=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],ge="log";function Ot(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function At(t){return t===404}async function It(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Bt)});return await e.body?.cancel().catch(()=>{}),At(e.status)}catch{return!1}}function Ds({virtualMcpId:t,branch:e,previewUrl:r=null,enabled:o=!0,children:s}){const{org:a}=X(),l=Be(),i=we()?.taskId??null,[c,u]=k.useState(null),[d,f]=k.useState({phase:"idle"}),[m,S]=k.useState({state:"running"}),[j,E]=k.useState({kind:"unknown"}),[x,b]=k.useState(!1),[C,y]=k.useState([]),[P,g]=k.useState([]),[,D]=k.useState(0),T=k.useRef(new Map),B=k.useRef(new Set),M=k.useRef(new Set),L=k.useRef(null),_=Ot(r),p=Je(t)?.metadata?.runtime?.selected==="deno",w=v=>{let N=T.current.get(v);return N||(N=new _t,T.current.set(v,N)),N};k.useEffect(()=>{if(u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),L.current=null,b(!1),y([]),g([]),T.current.clear(),!t||!e||!o)return;const v=Ye({orgSlug:a.slug,virtualMcpId:t,branch:e,threadId:i??null},"events");let N=!1,$=0,Y=null,q=null,G=null,K=null,z=null,J=null;const Le=R=>{try{const O=JSON.parse(R.data);u(O),O.kind!=="failed"&&(b(!1),$=0),O.kind==="ready"&&oe()}catch(O){console.warn("[vm-events] bad phase payload",O)}},ne=()=>{b(!0),u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),y([]),g([]),T.current.clear()},re=R=>{try{const O=JSON.parse(R.data);if(typeof O.data!="string")return;$=0;const I=O.data.replace(/\r?\n/g,`\r
1
+ import{a2 as X,o as Be,r as k,j as n,K as W,b8 as ie,c as F,aL as Oe,l as H,H as Ae,b as Z,t as ce,h as ue,s as be,v as ye,q as ve,D as Se,d as je,y as de,aM as Ie,B as Ee}from"./index-D_e1FjwV.js";import{u as we,d as $e,b as Ne,f as Fe,T as He,A as ze,i as Ke,c as qe,j as Ge,k as Ue,p as Qe,L as Ve}from"./chat-context-7iPEBonn.js";import{b as Ye}from"./sandbox-url-D3mC8qhT.js";import{a as Je}from"./repository-binding-Ck0_Tx8R.js";import{e as We}from"./backoff-CrEUbyZT.js";import{n as Xe}from"./ArrowUp-CSeqbspv.js";import{s as Ze,g as Ce,d as et}from"./tool-namespace-D-DKxP1V.js";import{b as se,T as tt,a as st,c as nt}from"./tooltip-Co4Z1kVi.js";import{d as rt,b as at,a as ot,D as lt}from"./drawer-Cc1xeysa.js";import{C as it}from"./collection-search-C0fvUi6S.js";import{u as ct}from"./use-mobile-DAFwKM65.js";import{u as ut}from"./use-mcp-client-CfQ2861m.js";import{u as dt,g as ft}from"./use-mcp-prompts-CmJ6-k3W.js";import{c as mt,P as pt}from"./usage-stats-D_UoN7cn.js";import{T as ht,d as gt,c as xt,e as bt,H as yt}from"./input-BoJbhypv.js";import{u as vt,a as St,S as jt,M as fe}from"./pair-8ShsH0Qr.js";import{a as Et}from"./use-panel-navigate-CwT4H5Ol.js";import{u as wt}from"./thread-intent-C7y-mNi3.js";import{N as Nt}from"./index-SOl_d7Ed.js";import{i as Ct}from"./LinkBroken01-B6cSnLw2.js";import{e as Te}from"./agent-icon-Czh6MNam.js";import{e as Tt}from"./use-decopilot-events-c99VQCYk.js";import{u as kt}from"./use-deco-credits-rXC7k5gk.js";import{F as Pt}from"./feature-paywall-RTg-o893.js";import{i as Dt}from"./AlertCircle-Bec1dxaS.js";function me(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const Rt={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ke=k.createContext(Rt),pe=16384;class _t{data="";append(e){this.data+=e,this.data.length>pe&&(this.data=this.data.slice(this.data.length-pe))}get(){return this.data}clear(){this.data=""}}const Lt=1e3,Mt=3e4,Bt=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],ge="log";function Ot(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function At(t){return t===404}async function It(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Bt)});return await e.body?.cancel().catch(()=>{}),At(e.status)}catch{return!1}}function Ds({virtualMcpId:t,branch:e,previewUrl:r=null,enabled:o=!0,children:s}){const{org:a}=X(),l=Be(),i=we()?.taskId??null,[c,u]=k.useState(null),[d,f]=k.useState({phase:"idle"}),[m,S]=k.useState({state:"running"}),[j,E]=k.useState({kind:"unknown"}),[x,b]=k.useState(!1),[C,y]=k.useState([]),[P,g]=k.useState([]),[,D]=k.useState(0),T=k.useRef(new Map),B=k.useRef(new Set),M=k.useRef(new Set),L=k.useRef(null),_=Ot(r),p=Je(t)?.metadata?.runtime?.selected==="deno",w=v=>{let N=T.current.get(v);return N||(N=new _t,T.current.set(v,N)),N};k.useEffect(()=>{if(u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),L.current=null,b(!1),y([]),g([]),T.current.clear(),!t||!e||!o)return;const v=Ye({orgSlug:a.slug,virtualMcpId:t,branch:e,threadId:i??null},"events");let N=!1,$=0,Y=null,q=null,G=null,K=null,z=null,J=null;const Le=R=>{try{const O=JSON.parse(R.data);u(O),O.kind!=="failed"&&(b(!1),$=0),O.kind==="ready"&&oe()}catch(O){console.warn("[vm-events] bad phase payload",O)}},ne=()=>{b(!0),u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),y([]),g([]),T.current.clear()},re=R=>{try{const O=JSON.parse(R.data);if(typeof O.data!="string")return;$=0;const I=O.data.replace(/\r?\n/g,`\r
2
2
  `);w(O.source).append(I);for(const A of B.current)try{A(O.source,I)}catch{}D(A=>A+1)}catch{}},ae=R=>{const O=R.type;try{const I=JSON.parse(R.data);switch($=0,O){case"lifecycle":{const A=I;f(A.state);const U=`${a.slug}/${t}/${e}`;if(me(A.state.phase)&&!(J&&me(J))){ie(l,a.id);const V=W.decofile(U);l.getQueryData(V)===void 0&&l.invalidateQueries({queryKey:V})}A.state.phase==="running"&&J!=="running"&&(ie(l,a.id),l.invalidateQueries({queryKey:W.decofile(U)}),l.invalidateQueries({queryKey:W.liveMeta(a.slug,t,e)})),J=A.state.phase;const Q=A.state.phase==="running"?A.state.port:null,te=L.current;if(L.current=Q,te!==null&&Q!==null&&te!==Q)for(const V of M.current)try{V()}catch{}return}case"status":S(I);return;case"tasks":{const U=I.active.map(Q=>Q.logName??"").filter(Boolean);g(U);return}case"scripts":y(I.scripts);return;case"branch":{const A=I.meta;E(A);return}case"reload":for(const A of M.current)try{A()}catch{}return;case"file-changed":{const{path:A}=I,U=`${a.slug}/${t}/${e}`;if(A.startsWith(".deco/")||A.includes("/.deco/")){if(!(J==="running"))return;G&&clearTimeout(G),G=setTimeout(()=>{if(G=null,l.invalidateQueries({queryKey:W.decofile(U)}),p)for(const V of M.current)try{V()}catch{}},500)}else q&&clearTimeout(q),q=setTimeout(()=>{q=null,l.invalidateQueries({queryKey:W.liveMeta(a.slug,t,e)})},1e3);return}}}catch{}};function ee(){if(N)return;const R=new EventSource(v);K=R,R.onopen=()=>{},R.onerror=()=>{K===R&&R.readyState===EventSource.CLOSED&&le("studio")},R.addEventListener("phase",Le),R.addEventListener("gone",ne),R.addEventListener(ge,re);for(const O of he)R.addEventListener(O,ae)}function oe(){if(N||!_||z)return;const R=new EventSource(_);z=R;let O=!1;R.onopen=()=>{if(N||z!==R)return;O=!0,$=0;const I=K;K=null,I?.close()},R.onerror=()=>{z===R&&R.readyState===EventSource.CLOSED&&Me(R,O)},R.addEventListener(ge,re);for(const I of he)R.addEventListener(I,ae)}async function Me(R,O){const I=_?await It(_):!1;if(!(N||z!==R)){if(R.close(),z=null,I){ne(),K||ee();return}O&&le("direct")}}function le(R){if(N||Y)return;const O=We(Mt,Lt,$,2,0);$++,Y=setTimeout(()=>{if(Y=null,!N){if(R==="direct"){z?.close(),z=null,oe();return}K?.close(),K=null,ee()}},O)}return ee(),()=>{N=!0,K?.close(),z?.close(),Y&&clearTimeout(Y),q&&clearTimeout(q),G&&clearTimeout(G)}},[t,e,a.slug,a.id,o,i,_,l,p]);const h={phase:c,lifecycle:d,status:m,branch:j,notFound:x,scripts:C,activeProcesses:P,getBuffer:v=>T.current.get(v)?.get()??"",hasData:v=>(T.current.get(v)?.get().length??0)>0,subscribeChunks:v=>(B.current.add(v),()=>{B.current.delete(v)}),subscribeReload:v=>(M.current.add(v),()=>{M.current.delete(v)})};return n.jsx(ke,{value:h,children:s})}function Pe(){return k.use(ke)}function Rs(t){const{subscribeChunks:e}=Pe(),r=k.useRef(t);r.current=t,k.useEffect(()=>e((a,l)=>{r.current?.(a,l)}),[e])}function _s(t){const{subscribeReload:e}=Pe(),r=k.useRef(t);r.current=t,k.useEffect(()=>e(()=>{r.current?.()}),[e])}const xe=3,De="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",$t="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function Re(t){const e=F.c(46),{item:r,onSelect:o,isLoading:s,isDisabled:a,variant:l}=t,i=l===void 0?"pill":l,{prompt:c}=r;let u;if(e[0]!==c._meta||e[1]!==c.name||e[2]!==c.title){const T=Ce(c._meta);u=c.title??et(c.name,T),e[0]=c._meta,e[1]=c.name,e[2]=c.title,e[3]=u}else u=e[3];const d=u,f=c.description||null;if(i==="card"){let T;e[4]!==o||e[5]!==c?(T=()=>o(c),e[4]=o,e[5]=c,e[6]=T):T=e[6];const B=a||s,M=s&&"bg-accent/40",L=(a||s)&&"cursor-not-allowed opacity-50";let _;e[7]!==M||e[8]!==L?(_=H($t,"hover:bg-accent/60 text-foreground",M,L),e[7]=M,e[8]=L,e[9]=_):_=e[9];let p;e[10]!==d?(p=n.jsx("span",{className:"font-medium truncate capitalize",children:d}),e[10]=d,e[11]=p):p=e[11];let w;e[12]!==s?(w=s&&n.jsx(ue,{size:"xs"}),e[12]=s,e[13]=w):w=e[13];let h;e[14]!==p||e[15]!==w?(h=n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p,w]}),e[14]=p,e[15]=w,e[16]=h):h=e[16];let v;e[17]!==f?(v=f&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=v):v=e[18];let N;return e[19]!==h||e[20]!==v||e[21]!==T||e[22]!==B||e[23]!==_?(N=n.jsxs("button",{type:"button",onClick:T,disabled:B,className:_,children:[h,v]}),e[19]=h,e[20]=v,e[21]=T,e[22]=B,e[23]=_,e[24]=N):N=e[24],N}let m;e[25]!==o||e[26]!==c?(m=()=>o(c),e[25]=o,e[26]=c,e[27]=m):m=e[27];const S=a||s,j=s&&"bg-muted/50",E=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==j||e[29]!==E?(x=H(De,"hover:bg-muted/70 hover:text-foreground",j,E),e[28]=j,e[29]=E,e[30]=x):x=e[30];let b;e[31]!==d?(b=n.jsx("span",{className:"capitalize",children:d}),e[31]=d,e[32]=b):b=e[32];let C;e[33]!==s?(C=s&&n.jsx(ue,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let y;e[35]!==m||e[36]!==S||e[37]!==x||e[38]!==b||e[39]!==C?(y=n.jsx(tt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:m,disabled:S,className:x,children:[b,C]})}),e[35]=m,e[36]=S,e[37]=x,e[38]=b,e[39]=C,e[40]=y):y=e[40];const P=f??d;let g;e[41]!==P?(g=n.jsx(st,{side:"top",className:"max-w-xs",children:n.jsx("p",{className:"text-xs",children:P})}),e[41]=P,e[42]=g):g=e[42];let D;return e[43]!==y||e[44]!==g?(D=n.jsxs(nt,{delayDuration:400,children:[y,g]}),e[43]=y,e[44]=g,e[45]=D):D=e[45],D}function Ft(t){const e=F.c(61),{items:r,open:o,onOpenChange:s,onSelect:a,loadingPrompt:l}=t,i=Z(),[c,u]=k.useState(""),d=!!l;let f;e[0]!==r||e[1]!==c?(f=c.trim()?r.filter(p=>{const w=c.toLowerCase();return p.prompt.name.toLowerCase().includes(w)||(p.prompt.title??"").toLowerCase().includes(w)||(p.prompt.description??"").toLowerCase().includes(w)}):r,e[0]=r,e[1]=c,e[2]=f):f=e[2];const m=f,S=ct();let j;e[3]!==m.length||e[4]!==c||e[5]!==i?(j=m.length===0&&n.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:i("chat.iceBreakers.noPromptsMatch",{search:c})}),e[3]=m.length,e[4]=c,e[5]=i,e[6]=j):j=e[6];let E;if(e[7]!==m||e[8]!==d||e[9]!==l?.name||e[10]!==s||e[11]!==a){let p;e[13]!==d||e[14]!==l?.name||e[15]!==s||e[16]!==a?(p=w=>n.jsx(Re,{item:w,variant:"card",onSelect:h=>{s(!1),a(h)},isLoading:l?.name===w.prompt.name,isDisabled:d&&l?.name!==w.prompt.name},w.prompt.name),e[13]=d,e[14]=l?.name,e[15]=s,e[16]=a,e[17]=p):p=e[17],E=m.map(p),e[7]=m,e[8]=d,e[9]=l?.name,e[10]=s,e[11]=a,e[12]=E}else E=e[12];let x;e[18]!==j||e[19]!==E?(x=n.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[j,E]})}),e[18]=j,e[19]=E,e[20]=x):x=e[20];const b=x;let C;e[21]!==i?(C=i("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=i,e[22]=C):C=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=p=>{p.key==="Escape"&&u("")},e[23]=y):y=e[23];let P;e[24]!==c||e[25]!==C?(P=n.jsx(it,{value:c,onChange:u,placeholder:C,onKeyDown:y}),e[24]=c,e[25]=C,e[26]=P):P=e[26];const g=P;if(S){let p;e[27]!==i?(p=i("chat.iceBreakers.allPromptsTitle"),e[27]=i,e[28]=p):p=e[28];let w;e[29]!==p?(w=n.jsx(rt,{className:"sr-only",children:n.jsx(at,{children:p})}),e[29]=p,e[30]=w):w=e[30];let h;e[31]!==i?(h=i("chat.iceBreakers.promptsLabel"),e[31]=i,e[32]=h):h=e[32];let v;e[33]!==h?(v=n.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:n.jsx("span",{className:"text-sm font-medium text-foreground",children:h})}),e[33]=h,e[34]=v):v=e[34];let N;e[35]!==b||e[36]!==g||e[37]!==v||e[38]!==w?(N=n.jsxs(ot,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[w,v,g,b]}),e[35]=b,e[36]=g,e[37]=v,e[38]=w,e[39]=N):N=e[39];let $;return e[40]!==s||e[41]!==o||e[42]!==N?($=n.jsx(se,{delayDuration:400,children:n.jsx(lt,{open:o,onOpenChange:s,children:N})}),e[40]=s,e[41]=o,e[42]=N,e[43]=$):$=e[43],$}let D;e[44]!==i?(D=i("chat.iceBreakers.allPromptsTitle"),e[44]=i,e[45]=D):D=e[45];let T;e[46]!==D?(T=n.jsx(be,{className:"sr-only",children:n.jsx(ye,{children:D})}),e[46]=D,e[47]=T):T=e[47];let B;e[48]!==i?(B=i("chat.iceBreakers.promptsLabel"),e[48]=i,e[49]=B):B=e[49];let M;e[50]!==B?(M=n.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:n.jsx("span",{className:"text-sm font-medium text-foreground",children:B})}),e[50]=B,e[51]=M):M=e[51];let L;e[52]!==b||e[53]!==g||e[54]!==M||e[55]!==T?(L=n.jsxs(ve,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[T,M,g,b]}),e[52]=b,e[53]=g,e[54]=M,e[55]=T,e[56]=L):L=e[56];let _;return e[57]!==s||e[58]!==o||e[59]!==L?(_=n.jsx(se,{delayDuration:400,children:n.jsx(Se,{open:o,onOpenChange:s,children:L})}),e[57]=s,e[58]=o,e[59]=L,e[60]=_):_=e[60],_}function Ht(t){const e=F.c(30),{items:r,onSelect:o,loadingPrompt:s,className:a}=t,l=Z(),[i,c]=k.useState(!1);if(r.length===0)return null;let u,d,f,m,S;if(e[0]!==a||e[1]!==r||e[2]!==s||e[3]!==o||e[4]!==l){const b=r.slice(0,xe),C=r.slice(xe),y=!!s;let P;e[10]!==y||e[11]!==s?.name||e[12]!==o?(P=D=>n.jsx(Re,{item:D,onSelect:o,isLoading:s?.name===D.prompt.name,isDisabled:y&&s?.name!==D.prompt.name},D.prompt.name),e[10]=y,e[11]=s?.name,e[12]=o,e[13]=P):P=e[13];const g=b.map(P);u=se,S=400,e[14]!==a?(d=H("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=d):d=e[15],f=g,m=C.length>0&&n.jsx("button",{type:"button",disabled:y,onClick:()=>c(!0),className:H(De,"hover:bg-muted/70 hover:text-foreground",y&&"opacity-50 cursor-not-allowed"),children:l("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=a,e[1]=r,e[2]=s,e[3]=o,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=m,e[9]=S}else u=e[5],d=e[6],f=e[7],m=e[8],S=e[9];let j;e[16]!==d||e[17]!==f||e[18]!==m?(j=n.jsxs("div",{className:d,children:[f,m]}),e[16]=d,e[17]=f,e[18]=m,e[19]=j):j=e[19];let E;e[20]!==r||e[21]!==s||e[22]!==i||e[23]!==o?(E=n.jsx(Ft,{items:r,open:i,onOpenChange:c,onSelect:o,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=i,e[23]=o,e[24]=E):E=e[24];let x;return e[25]!==u||e[26]!==S||e[27]!==j||e[28]!==E?(x=n.jsxs(u,{delayDuration:S,children:[j,E]}),e[25]=u,e[26]=S,e[27]=j,e[28]=E,e[29]=x):x=e[29],x}function zt(){return null}function Kt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function qt(t){const e=F.c(31),{connectionId:r}=t,o=Z(),{sendMessage:s}=Ne(),{org:a}=X();let l;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const i=ut(l);let c;e[4]!==i?(c={client:i,staleTime:6e4},e[4]=i,e[5]=c):c=e[5];const{data:u}=dt(c);let d;e[6]!==u?.prompts?(d=u?.prompts??[],e[6]=u?.prompts,e[7]=d):d=e[7];const f=d;let m;e[8]!==f?(m=f.map(Gt),e[8]=f,e[9]=m):m=e[9];const S=m;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j={stage:"idle"},e[10]=j):j=e[10];const[E,x]=k.useReducer(Kt,j),[b,C]=k.useState(null);let y;e[11]!==i||e[12]!==s||e[13]!==o?(y=async(h,v)=>{if(!i){ce.error(o("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const N=await ft(i,h.name,v);x({type:"RESET"});const $={type:"doc",content:[{type:"paragraph",content:[mt({id:h.name,name:Ze(h.name,Ce(h._meta)),metadata:N.messages,char:"/",kind:"prompt",args:v}),{type:"text",text:" "}]}]};await s($)}catch(N){console.error("[ice-breakers] Failed to fetch prompt:",N),ce.error(o("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=i,e[12]=s,e[13]=o,e[14]=y):y=e[14];const P=y;let g;e[15]!==P?(g=async h=>{if(h.arguments&&h.arguments.length>0){x({type:"SELECT_PROMPT",prompt:h}),C(h);return}x({type:"START_LOADING",prompt:h}),await P(h)},e[15]=P,e[16]=g):g=e[16];const D=g;let T;e[17]!==b||e[18]!==P?(T=async h=>{b&&(x({type:"START_LOADING",prompt:b,arguments:h}),C(null),await P(b,h))},e[17]=b,e[18]=P,e[19]=T):T=e[19];const B=T;if(S.length===0)return null;const M=E.stage==="loading"?E.prompt:null;let L;e[20]!==D||e[21]!==S||e[22]!==M?(L=n.jsx(Ht,{items:S,onSelect:D,loadingPrompt:M}),e[20]=D,e[21]=S,e[22]=M,e[23]=L):L=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{C(null),x({type:"RESET"})},e[24]=_):_=e[24];let p;e[25]!==b||e[26]!==B?(p=n.jsx(pt,{prompt:b,setPrompt:_,onSubmit:B}),e[25]=b,e[26]=B,e[27]=p):p=e[27];let w;return e[28]!==L||e[29]!==p?(w=n.jsxs(n.Fragment,{children:[L,p]}),e[28]=L,e[29]=p,e[30]=w):w=e[30],w}function Gt(t){return{prompt:t}}function Ut(t){const e=F.c(13),{className:r}=t,{selectedVirtualMcp:o}=$e(),{org:s}=X();let a;e[0]!==s.id?(a=Oe(s.id),e[0]=s.id,e[1]=a):a=e[1];const l=a.id,i=o?.id??l;let c;e[2]!==r?(c=H("w-full @container",r),e[2]=r,e[3]=c):c=e[3];const u=i??"default";let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(zt,{}),e[4]=d):d=e[4];let f;e[5]!==i?(f=n.jsx(qt,{connectionId:i}),e[5]=i,e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==f?(m=n.jsx(Ae,{fallback:null,children:n.jsx(k.Suspense,{fallback:d,children:f},u)}),e[7]=u,e[8]=f,e[9]=m):m=e[9];let S;return e[10]!==c||e[11]!==m?(S=n.jsx("div",{className:c,children:m}),e[10]=c,e[11]=m,e[12]=S):S=e[12],S}function Qt(t){let e=0;for(const r of t)for(const o of r.parts??[]){const s=o;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function Vt(){const t=F.c(8),{openPanel:e}=Et(),r=wt(),o=Fe()?.messages??[],s=we()?.taskId??null;let a;t[0]!==o?(a=Qt(o),t[0]=o,t[1]=a):a=t[1];const l=a,i=k.useRef(null),c=k.useRef(null);let u,d;t[2]!==l||t[3]!==r||t[4]!==e||t[5]!==s?(u=()=>{if(!l||!s)return;const f=`${s}:${l}`;c.current!==f&&(c.current=f,r?.refreshThreadMetadata(s)),i.current!==s&&(i.current=s,e("site-editor"))},d=[l,s,e,r],t[2]=l,t[3]=r,t[4]=e,t[5]=s,t[6]=u,t[7]=d):(u=t[6],d=t[7]),k.useEffect(u,d)}function _e(t){return`deco-credits-empty-dismissed:${t}`}function Ls(t){try{return localStorage.getItem(_e(t))==="1"}catch{return!1}}function Yt(){const t=F.c(56),e=Z(),{org:r}=X(),o=Tt("credits"),s=je(),{decoKeyId:a}=kt(),[l,i]=k.useState(!0);let c;t[0]!==r.id?(c=()=>{de("credits_empty_state_dismissed",{organization_id:r.id}),i(!1);try{localStorage.setItem(_e(r.id),"1")}catch{}},t[0]=r.id,t[1]=c):c=t[1];const u=c;let d,f;if(t[2]!==l||t[3]!==r.id?(d=()=>{l&&de("credits_empty_state_shown",{organization_id:r.id})},f=[l,r.id],t[2]=l,t[3]=r.id,t[4]=d,t[5]=f):(d=t[4],f=t[5]),k.useEffect(d,f),!l)return null;if(!o){let h;t[6]!==e?(h=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=h):h=t[7];let v;t[8]!==h?(v={title:h},t[8]=h,t[9]=v):v=t[9];let N;return t[10]!==u||t[11]!==v?(N=n.jsx(Pt,{feature:"chat",copy:v,onDismiss:u}),t[10]=u,t[11]=v,t[12]=N):N=t[12],N}let m;t[13]!==u?(m=h=>!h&&u(),t[13]=u,t[14]=m):m=t[14];let S;t[15]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=S):S=t[15];let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:n.jsx(Te,{size:20,className:"text-warning"})}),t[16]=j):j=t[16];let E;t[17]!==e?(E=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=E):E=t[18];let x;t[19]!==E?(x=n.jsx(ye,{className:"text-lg font-semibold",children:E}),t[19]=E,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let C;t[23]!==b?(C=n.jsx(Ie,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=C):C=t[24];let y;t[25]!==x||t[26]!==C?(y=n.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[S,n.jsxs(be,{className:"relative gap-3",children:[j,n.jsxs("div",{className:"text-center",children:[x,C]})]})]}),t[25]=x,t[26]=C,t[27]=y):y=t[27];let P;t[28]!==a||t[29]!==u?(P=a&&n.jsx("div",{className:"px-6 pb-5",children:n.jsx(ht,{source:"empty_state",onDone:u})}),t[28]=a,t[29]=u,t[30]=P):P=t[30];let g;t[31]!==u||t[32]!==s||t[33]!==r.slug?(g=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),u()},t[31]=u,t[32]=s,t[33]=r.slug,t[34]=g):g=t[34];let D;t[35]!==e?(D=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=D):D=t[36];let T;t[37]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(Ct,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=T):T=t[37];let B;t[38]!==g||t[39]!==D?(B=n.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:g,children:[D,T]}),t[38]=g,t[39]=D,t[40]=B):B=t[40];let M;t[41]!==e?(M=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=M):M=t[42];let L;t[43]!==u||t[44]!==M?(L=n.jsx(Ee,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:u,children:M}),t[43]=u,t[44]=M,t[45]=L):L=t[45];let _;t[46]!==B||t[47]!==L?(_=n.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[B,L]}),t[46]=B,t[47]=L,t[48]=_):_=t[48];let p;t[49]!==y||t[50]!==P||t[51]!==_?(p=n.jsxs(ve,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Jt,children:[y,P,_]}),t[49]=y,t[50]=P,t[51]=_,t[52]=p):p=t[52];let w;return t[53]!==p||t[54]!==m?(w=n.jsx(Se,{open:!0,onOpenChange:m,children:p}),t[53]=p,t[54]=m,t[55]=w):w=t[55],w}function Jt(t){return t.preventDefault()}function Wt(t){const e=F.c(6),{balanceDollars:r}=t;let o;e[0]!==r?(o=r.toFixed(2),e[0]=r,e[1]=o):o=e[1];const s=o;let a,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=H("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),l=n.jsx(Te,{size:13,className:"text-success"}),e[2]=a,e[3]=l):(a=e[2],l=e[3]);let i;return e[4]!==s?(i=n.jsxs("div",{className:a,children:[l,n.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=i):i=e[5],i}function Xt(){const t=F.c(8),{org:e}=X(),r=je();let o;t[0]!==r||t[1]!==e.slug?(o=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=o):o=t[2];let s,a,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=H("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=n.jsx(Dt,{size:13,className:"text-warning"}),l=n.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=l):(s=t[3],a=t[4],l=t[5]);let i;return t[6]!==o?(i=n.jsxs("button",{type:"button",onClick:o,className:s,children:[a,l]}),t[6]=o,t[7]=i):i=t[7],i}function Zt(t){const e=F.c(7),{scrollRef:r,sentinelRef:o,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:l}=t;let i,c;e[0]!==l||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==o?(i=()=>{const u=o.current,d=r.current;if(!u||!d||!s)return;const f=new IntersectionObserver(async m=>{if(!m[0]?.isIntersecting||a||!s)return;const j=d.scrollHeight,E=d.scrollTop;await l(),requestAnimationFrame(()=>{const x=d.scrollHeight;d.scrollTop=E+(x-j)})},{root:d,rootMargin:"200px 0px 0px 0px"});return f.observe(u),()=>f.disconnect()},c=[r,o,s,a,l],e[0]=l,e[1]=s,e[2]=a,e[3]=r,e[4]=o,e[5]=i,e[6]=c):(i=e[5],c=e[6]),k.useEffect(i,c)}function es(t){const e=F.c(5),{className:r,children:o}=t;let s;e[0]!==r?(s=H("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",r),e[0]=r,e[1]=s):s=e[1];let a;return e[2]!==o||e[3]!==s?(a=n.jsx("div",{className:s,children:o}),e[2]=o,e[3]=s,e[4]=a):a=e[4],a}function ts(t){const e=F.c(5),{children:r,className:o}=t;let s;e[0]!==o?(s=H("flex-1 min-h-0 overflow-y-auto isolate",o),e[0]=o,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=n.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}function ss(t){const e=F.c(2),{children:r}=t;let o;return e[0]!==r?(o=n.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:r}),e[0]=r,e[1]=o):o=e[1],o}function ns(){const t=Z(),{messages:e,status:r,hasMoreOlder:o,isFetchingOlder:s,fetchOlderMessages:a,isRunInProgress:l}=Ne(),{taskId:i}=qe();Vt();const c=Ge(i??""),u=Ue(c),d=u.size===0?e:e.filter(g=>!u.has(g.id)),f=Qe(d,r==="submitted"||r==="streaming"||l),m=f.visible,S=vt(m),j=S.at(-1),x=bt()*yt+16,b=k.useRef(null),C=k.useRef(null);Zt({scrollRef:b,sentinelRef:C,hasMoreOlder:o,isFetchingOlder:s,fetchOlderMessages:a});const y=St({initial:!1}),P=g=>{b.current=g,y.scrollRef(g)};return n.jsx(Ve.Provider,{value:f,children:n.jsx(jt,{messages:e,children:n.jsxs("div",{className:"relative h-full w-full min-w-0",children:[n.jsx("div",{ref:P,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:x},children:n.jsxs("div",{ref:y.contentRef,className:"overflow-x-clip",children:[n.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[n.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&n.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),S.slice(0,-1).map((g,D)=>n.jsx(fe,{pair:g,isLastPair:!1,status:D===S.length-1?r:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),j&&n.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:n.jsx(fe,{pair:j,isLastPair:!0,status:r},`pair-${j.user?.id??j.assistant?.id}`)})]})}),!y.isAtBottom&&n.jsx(Ee,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:x+8},onClick:()=>{y.scrollToBottom()},children:n.jsx(Xe,{size:14})})]})})})}function rs(t){const e=F.c(5),{children:r,className:o}=t;let s;e[0]!==o?(s=H("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",o),e[0]=o,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=n.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}const Ms=Object.assign(es,{Main:ts,Messages:ns,EmptyState:ss,Footer:rs,Input:xt,Provider:Ke,ActiveTaskProvider:ze,ThreadlessProvider:He,IceBreakers:Ut,NoAiProviderEmptyState:Nt,CreditsEmptyState:Yt,CreditsEyebrow:Wt,NoCreditsEyebrow:Xt,CreditsExhaustedBanner:gt});export{Ms as C,Ds as S,Rs as a,_s as b,me as i,Pe as u,Ls as w};
@@ -1 +1 @@
1
- import{c as P,at as Z,av as ee,b as Y,a2 as te,ab as ne,k as se,j as s,L as ae,n as J,r as M,d as oe,aK as W,H as q,P as _,a_ as ie,B as le}from"./index-9utrdjuC.js";import{u as re}from"./use-mobile-iljyEqdw.js";import{g as ce,u as ue,h as de,v as he}from"./use-app-takeover-BPHco5S8.js";import{a as Q,R as fe,b as me}from"./resizable-nPzQU7Gj.js";import{h as pe,i as ge,m as xe}from"./use-project-native-view-presence-D5_yzHhC.js";import{M as be,k as ye}from"./agent-icon-mVoV_Rm6.js";import{s as je}from"./XClose-DVNhmkHc.js";import{I as ve}from"./icon-button-DZGm8Il3.js";import{c as Se,T as Ce,a as Te}from"./tooltip-Csaklmt2.js";import{T as G}from"./toolbar-icon-button-yph4TT_t.js";import{a as Le}from"./use-project-scope-BNx_AZUx.js";import{c as Ne}from"./repository-binding-CQrhlIgt.js";function U(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function Pe(l,e){const a=P.c(8);let i;a[0]!==e?(i=r=>U(r,e),a[0]=e,a[1]=i):i=a[1];const[n,o]=Z(l,i);let t;a[2]!==e||a[3]!==n?(t=U(n,e),a[2]=e,a[3]=n,a[4]=t):t=a[4];let d;return a[5]!==o||a[6]!==t?(d=[t,o],a[5]=o,a[6]=t,a[7]=d):d=a[7],d}const ze=33;function _e(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=ee.sidePanelWidth(),l[0]=e):e=l[0],Pe(e,ze)}function we(l){const e=P.c(60),{actions:a,navigation:i}=l,n=Y(),{org:o}=te(),t=Le(),d=Ne(t),r=ce(),{toggleSidebar:c}=ue(),u=de(),h=X(),m=ne();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={select:Oe},e[0]=p):p=e[0];const y=se(p),b=y?.mainView==="overview";let j;e[1]!==d?.title||e[2]!==n?(j=d?.title??n("common.loading"),e[1]=d?.title,e[2]=n,e[3]=j):j=e[3];const x=j;let S;e[4]!==b||e[5]!==y?.pageTitle||e[6]!==x||e[7]!==t||e[8]!==n?(S=b?t?x:n("sidebar.navDestinations.home"):n(y?.pageTitle??"page.view"),e[4]=b,e[5]=y?.pageTitle,e[6]=x,e[7]=t,e[8]=n,e[9]=S):S=e[9];const v=S;let L;e[10]!==o.slug||e[11]!==m||e[12]!==t?(L=m?{to:"/$org/projects",params:{org:o.slug},search:{project:t??void 0}}:{to:"/$org/projects/$agentId",params:{org:o.slug,agentId:t??""}},e[10]=o.slug,e[11]=m,e[12]=t,e[13]=L):L=e[13];const f=L;let g;if(e[14]!==r||e[15]!==b||e[16]!==o.slug||e[17]!==f||e[18]!==x||e[19]!==t||e[20]!==n||e[21]!==v){if(g=[],r){let T;e[23]!==n?(T=n("sidebar.navDestinations.settings"),e[23]=n,e[24]=T):T=e[24];let E;e[25]!==o.slug?(E={to:"/$org/settings/general",params:{org:o.slug}},e[25]=o.slug,e[26]=E):E=e[26];let $;e[27]!==T||e[28]!==E?($={key:"settings",label:T,link:E},e[27]=T,e[28]=E,e[29]=$):$=e[29],g.push($)}else if(t&&!b){let T;e[30]!==f||e[31]!==x?(T={key:"project",label:x,link:f},e[30]=f,e[31]=x,e[32]=T):T=e[32],g.push(T)}let B;e[33]!==v?(B={key:"page",label:v},e[33]=v,e[34]=B):B=e[34],g.push(B),e[14]=r,e[15]=b,e[16]=o.slug,e[17]=f,e[18]=x,e[19]=t,e[20]=n,e[21]=v,e[22]=g}else g=e[22];let N;e[35]!==f||e[36]!==t||e[37]!==n||e[38]!==u?(N=u&&t&&s.jsx(ve,{label:n("projects.flat.close"),asChild:!0,children:s.jsx(ae,{...f,children:s.jsx(je,{size:16})})}),e[35]=f,e[36]=t,e[37]=n,e[38]=u,e[39]=N):N=e[39];const C=N;let z;e[40]!==h||e[41]!==n||e[42]!==u?(z=u&&h&&!h.threadless&&s.jsxs(Se,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(G,{"aria-label":n(h.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":h.threadOpen,active:h.threadOpen,onClick:h.toggleThread,children:s.jsx(be,{size:16})})}),s.jsx(Te,{side:"bottom",children:n(h.threadOpen?"page.closeThread":"page.openThread")})]}),e[40]=h,e[41]=n,e[42]=u,e[43]=z):z=e[43];const F=z;let w;e[44]!==n?(w=n("layouts.shellControls.toggleSidebar"),e[44]=n,e[45]=w):w=e[45];let A;e[46]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ye,{size:16}),e[46]=A):A=e[46];let O;e[47]!==w||e[48]!==c?(O=s.jsx(G,{className:"md:hidden",onClick:c,"aria-label":w,children:A}),e[47]=w,e[48]=c,e[49]=O):O=e[49];let k;e[50]!==F||e[51]!==O?(k=s.jsxs(s.Fragment,{children:[O,F]}),e[50]=F,e[51]=O,e[52]=k):k=e[52];let R;return e[53]!==a||e[54]!==g||e[55]!==C||e[56]!==i||e[57]!==o.name||e[58]!==k?(R=s.jsx(J.Header,{leading:k,breadcrumbs:g,scope:o.name,actions:a,trailingActions:C,navigation:i}),e[53]=a,e[54]=g,e[55]=C,e[56]=i,e[57]=o.name,e[58]=k,e[59]=R):R=e[59],R}function Oe(l){return l.matches.findLast(ke)?.staticData}function ke(l){return l.staticData.pageTitle}const I="chat-layout-thread",D="chat-layout-content",K=M.createContext(null);function Ee(){return H()}function X(){return M.use(K)}function H(){const l=M.use(K);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=P.c(23),{children:a,...i}=l,n=re(),o=oe(),t=M.useRef(null),[d,r]=_e(),{threadOpen:c,contentOpen:u}=i,h=pe(i),m=c&&u?d:h.side,p=100-m,y=f=>{const g=f.getLayout(),N=g[I],C=g[D];typeof N!="number"||typeof C!="number"||Math.abs(N-m)<.001&&Math.abs(C-p)<.001||f.setLayout({[I]:m,[D]:p})},b=ge({visibility:i,threadVisibilityExplicit:i.threadVisibilityExplicit});let j;e[0]!==n||e[1]!==i||e[2]!==b?(j={...i,isMobile:n,mobileSurface:b},e[0]=n,e[1]=i,e[2]=b,e[3]=j):j=e[3];const x=j;let S;e[4]!==n||e[5]!==i||e[6]!==o||e[7]!==c||e[8]!==x?(S=!i.threadless&&s.jsx(he,{open:n?x.mobileSurface==="chat":c,onToggle:()=>{n?o({to:".",search:f=>({...f,...xe(x.mobileSurface==="chat"?"main":"chat")}),replace:!0}):i.toggleThread()}}),e[4]=n,e[5]=i,e[6]=o,e[7]=c,e[8]=x,e[9]=S):S=e[9];let v;e[10]!==a||e[11]!==u||e[12]!==p||e[13]!==n||e[14]!==r||e[15]!==y||e[16]!==c||e[17]!==m?(v=n?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(fe,{ref:f=>{if(t.current=f,!f)return;let g=!0;return queueMicrotask(()=>{g&&y(f)}),()=>{g=!1,t.current===f&&(t.current=null)}},defaultLayout:{[I]:m,[D]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(f,g)=>{const{isUserInteraction:N}=g;if(!N){const z=t.current;z&&y(z);return}const C=f[I];c&&u&&typeof C=="number"&&C>0&&C<100&&r(C)},children:a}),e[10]=a,e[11]=u,e[12]=p,e[13]=n,e[14]=r,e[15]=y,e[16]=c,e[17]=m,e[18]=v):v=e[18];let L;return e[19]!==S||e[20]!==v||e[21]!==x?(L=s.jsxs(K,{value:x,children:[S,v]}),e[19]=S,e[20]=v,e[21]=x,e[22]=L):L=e[22],L}function Me(l){const e=P.c(16),{children:a,topbar:i}=l,n=H();if(n.isMobile){let h;return e[0]!==a||e[1]!==n.mobileSurface||e[2]!==i?(h=n.mobileSurface==="chat"?s.jsxs(_,{variant:"plain","data-slot":"chat-layout-thread",children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=n.mobileSurface,e[2]=i,e[3]=h):h=e[3],h}const o=n.threadOpen?"":void 0;let t;e[4]!==a||e[5]!==n.threadOpen||e[6]!==i?(t=n.threadOpen&&s.jsxs(s.Fragment,{children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=n.threadOpen,e[6]=i,e[7]=t):t=e[7];let d;e[8]!==t?(d=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(_,{"data-testid":"side-panel",children:t})}),e[8]=t,e[9]=d):d=e[9];let r;e[10]!==o||e[11]!==d?(r=s.jsx(Q,{id:I,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":o,className:"min-w-0 overflow-hidden bg-sidebar",children:d}),e[10]=o,e[11]=d,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(me,{className:"bg-sidebar"}),e[13]=c):c=e[13];let u;return e[14]!==r?(u=s.jsxs(s.Fragment,{children:[r,c]}),e[14]=r,e[15]=u):u=e[15],u}function Ae({children:l,routeId:e}){return l}function V(l){const e=P.c(26),{children:a,actions:i,drawer:n,aside:o}=l,t=H();if(t.isMobile&&t.mobileSurface!=="main")return null;const d=t.isMobile?"plain":"card";let r;e[0]!==i||e[1]!==t.contentActions?(r=s.jsxs(s.Fragment,{children:[t.contentActions,i]}),e[0]=i,e[1]=t.contentActions,e[2]=r):r=e[2];let c;e[3]!==t.contentNavigation||e[4]!==r?(c=s.jsx(we,{navigation:t.contentNavigation,actions:r}),e[3]=t.contentNavigation,e[4]=r,e[5]=c):c=e[5];let u;e[6]!==a||e[7]!==t.contentKey?(u=s.jsx(W,{children:s.jsx(Ae,{routeId:t.contentKey,children:a})}),e[6]=a,e[7]=t.contentKey,e[8]=u):u=e[8];let h;e[9]!==t.contentKey||e[10]!==u?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(q,{children:u},t.contentKey)}),e[9]=t.contentKey,e[10]=u,e[11]=h):h=e[11];let m;e[12]!==n||e[13]!==h?(m=s.jsxs(_.Content,{children:[h,n]}),e[12]=n,e[13]=h,e[14]=m):m=e[14];let p;e[15]!==c||e[16]!==m?(p=s.jsxs(J.Breadcrumbs.Provider,{children:[c,m]}),e[15]=c,e[16]=m,e[17]=p):p=e[17];let y;e[18]!==d||e[19]!==p?(y=s.jsx(_,{"data-testid":"main-panel",variant:d,children:p}),e[18]=d,e[19]=p,e[20]=y):y=e[20];const b=y;let j;return e[21]!==o||e[22]!==t.contentOpen||e[23]!==t.isMobile||e[24]!==b?(j=t.isMobile?b:s.jsx(Q,{id:D,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),o&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(_,{"data-testid":"aside-panel",children:s.jsx(q,{children:s.jsx(W,{children:o})},M.isValidElement(o)?o.key??void 0:void 0)})})]})}),e[21]=o,e[22]=t.contentOpen,e[23]=t.isMobile,e[24]=b,e[25]=j):j=e[25],j}function Re(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(ie,{})}),l[0]=e):e=l[0],e}function Be(l){const e=P.c(18),{error:a,reset:i}=l,n=Y();let o;e[0]!==n?(o=n("common.errorBoundary.somethingWentWrong"),e[0]=n,e[1]=o):o=e[1];let t;e[2]!==o?(t=s.jsx("h2",{className:"text-lg font-medium",children:o}),e[2]=o,e[3]=t):t=e[3];let d;e[4]!==a.message||e[5]!==n?(d=a.message||n("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=n,e[6]=d):d=e[6];let r;e[7]!==d?(r=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=r):r=e[8];let c;e[9]!==n?(c=n("common.errorBoundary.tryAgain"),e[9]=n,e[10]=c):c=e[10];let u;e[11]!==i||e[12]!==c?(u=s.jsx(le,{variant:"outline",onClick:i,children:c}),e[11]=i,e[12]=c,e[13]=u):u=e[13];let h;return e[14]!==t||e[15]!==r||e[16]!==u?(h=s.jsx(V,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[t,r,u]})}),e[14]=t,e[15]=r,e[16]=u,e[17]=h):h=e[17],h}const $e=Object.assign(Ie,{Thread:Me,Content:V}),Xe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:$e,ChatLayoutError:Be,ChatLayoutPending:Re,useChatLayout:Ee,useOptionalChatLayout:X},Symbol.toStringTag,{value:"Module"}));export{$e as C,we as R,Xe as i,Ee as u};
1
+ import{c as P,at as Z,av as ee,b as Y,a2 as te,ab as ne,k as se,j as s,L as ae,n as J,r as M,d as oe,aK as W,H as q,P as _,a_ as ie,B as le}from"./index-D_e1FjwV.js";import{u as re}from"./use-mobile-DAFwKM65.js";import{g as ce,u as ue,h as de,v as he}from"./use-app-takeover-zvHtuBka.js";import{a as Q,R as fe,b as me}from"./resizable-h5h9Y5oq.js";import{h as pe,i as ge,m as xe}from"./use-project-native-view-presence-C_S3HChZ.js";import{M as be,k as ye}from"./agent-icon-Czh6MNam.js";import{s as je}from"./XClose-DxE71MU7.js";import{I as ve}from"./icon-button-B0hKyHBr.js";import{c as Se,T as Ce,a as Te}from"./tooltip-Co4Z1kVi.js";import{T as G}from"./toolbar-icon-button-QlJA74MF.js";import{a as Le}from"./use-project-scope-CaxkCPVW.js";import{c as Ne}from"./repository-binding-Ck0_Tx8R.js";function U(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function Pe(l,e){const a=P.c(8);let i;a[0]!==e?(i=r=>U(r,e),a[0]=e,a[1]=i):i=a[1];const[n,o]=Z(l,i);let t;a[2]!==e||a[3]!==n?(t=U(n,e),a[2]=e,a[3]=n,a[4]=t):t=a[4];let d;return a[5]!==o||a[6]!==t?(d=[t,o],a[5]=o,a[6]=t,a[7]=d):d=a[7],d}const ze=33;function _e(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=ee.sidePanelWidth(),l[0]=e):e=l[0],Pe(e,ze)}function we(l){const e=P.c(60),{actions:a,navigation:i}=l,n=Y(),{org:o}=te(),t=Le(),d=Ne(t),r=ce(),{toggleSidebar:c}=ue(),u=de(),h=X(),m=ne();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={select:Oe},e[0]=p):p=e[0];const y=se(p),b=y?.mainView==="overview";let j;e[1]!==d?.title||e[2]!==n?(j=d?.title??n("common.loading"),e[1]=d?.title,e[2]=n,e[3]=j):j=e[3];const x=j;let S;e[4]!==b||e[5]!==y?.pageTitle||e[6]!==x||e[7]!==t||e[8]!==n?(S=b?t?x:n("sidebar.navDestinations.home"):n(y?.pageTitle??"page.view"),e[4]=b,e[5]=y?.pageTitle,e[6]=x,e[7]=t,e[8]=n,e[9]=S):S=e[9];const v=S;let L;e[10]!==o.slug||e[11]!==m||e[12]!==t?(L=m?{to:"/$org/projects",params:{org:o.slug},search:{project:t??void 0}}:{to:"/$org/projects/$agentId",params:{org:o.slug,agentId:t??""}},e[10]=o.slug,e[11]=m,e[12]=t,e[13]=L):L=e[13];const f=L;let g;if(e[14]!==r||e[15]!==b||e[16]!==o.slug||e[17]!==f||e[18]!==x||e[19]!==t||e[20]!==n||e[21]!==v){if(g=[],r){let T;e[23]!==n?(T=n("sidebar.navDestinations.settings"),e[23]=n,e[24]=T):T=e[24];let E;e[25]!==o.slug?(E={to:"/$org/settings/general",params:{org:o.slug}},e[25]=o.slug,e[26]=E):E=e[26];let $;e[27]!==T||e[28]!==E?($={key:"settings",label:T,link:E},e[27]=T,e[28]=E,e[29]=$):$=e[29],g.push($)}else if(t&&!b){let T;e[30]!==f||e[31]!==x?(T={key:"project",label:x,link:f},e[30]=f,e[31]=x,e[32]=T):T=e[32],g.push(T)}let B;e[33]!==v?(B={key:"page",label:v},e[33]=v,e[34]=B):B=e[34],g.push(B),e[14]=r,e[15]=b,e[16]=o.slug,e[17]=f,e[18]=x,e[19]=t,e[20]=n,e[21]=v,e[22]=g}else g=e[22];let N;e[35]!==f||e[36]!==t||e[37]!==n||e[38]!==u?(N=u&&t&&s.jsx(ve,{label:n("projects.flat.close"),asChild:!0,children:s.jsx(ae,{...f,children:s.jsx(je,{size:16})})}),e[35]=f,e[36]=t,e[37]=n,e[38]=u,e[39]=N):N=e[39];const C=N;let z;e[40]!==h||e[41]!==n||e[42]!==u?(z=u&&h&&!h.threadless&&s.jsxs(Se,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(G,{"aria-label":n(h.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":h.threadOpen,active:h.threadOpen,onClick:h.toggleThread,children:s.jsx(be,{size:16})})}),s.jsx(Te,{side:"bottom",children:n(h.threadOpen?"page.closeThread":"page.openThread")})]}),e[40]=h,e[41]=n,e[42]=u,e[43]=z):z=e[43];const F=z;let w;e[44]!==n?(w=n("layouts.shellControls.toggleSidebar"),e[44]=n,e[45]=w):w=e[45];let A;e[46]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ye,{size:16}),e[46]=A):A=e[46];let O;e[47]!==w||e[48]!==c?(O=s.jsx(G,{className:"md:hidden",onClick:c,"aria-label":w,children:A}),e[47]=w,e[48]=c,e[49]=O):O=e[49];let k;e[50]!==F||e[51]!==O?(k=s.jsxs(s.Fragment,{children:[O,F]}),e[50]=F,e[51]=O,e[52]=k):k=e[52];let R;return e[53]!==a||e[54]!==g||e[55]!==C||e[56]!==i||e[57]!==o.name||e[58]!==k?(R=s.jsx(J.Header,{leading:k,breadcrumbs:g,scope:o.name,actions:a,trailingActions:C,navigation:i}),e[53]=a,e[54]=g,e[55]=C,e[56]=i,e[57]=o.name,e[58]=k,e[59]=R):R=e[59],R}function Oe(l){return l.matches.findLast(ke)?.staticData}function ke(l){return l.staticData.pageTitle}const I="chat-layout-thread",D="chat-layout-content",K=M.createContext(null);function Ee(){return H()}function X(){return M.use(K)}function H(){const l=M.use(K);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=P.c(23),{children:a,...i}=l,n=re(),o=oe(),t=M.useRef(null),[d,r]=_e(),{threadOpen:c,contentOpen:u}=i,h=pe(i),m=c&&u?d:h.side,p=100-m,y=f=>{const g=f.getLayout(),N=g[I],C=g[D];typeof N!="number"||typeof C!="number"||Math.abs(N-m)<.001&&Math.abs(C-p)<.001||f.setLayout({[I]:m,[D]:p})},b=ge({visibility:i,threadVisibilityExplicit:i.threadVisibilityExplicit});let j;e[0]!==n||e[1]!==i||e[2]!==b?(j={...i,isMobile:n,mobileSurface:b},e[0]=n,e[1]=i,e[2]=b,e[3]=j):j=e[3];const x=j;let S;e[4]!==n||e[5]!==i||e[6]!==o||e[7]!==c||e[8]!==x?(S=!i.threadless&&s.jsx(he,{open:n?x.mobileSurface==="chat":c,onToggle:()=>{n?o({to:".",search:f=>({...f,...xe(x.mobileSurface==="chat"?"main":"chat")}),replace:!0}):i.toggleThread()}}),e[4]=n,e[5]=i,e[6]=o,e[7]=c,e[8]=x,e[9]=S):S=e[9];let v;e[10]!==a||e[11]!==u||e[12]!==p||e[13]!==n||e[14]!==r||e[15]!==y||e[16]!==c||e[17]!==m?(v=n?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(fe,{ref:f=>{if(t.current=f,!f)return;let g=!0;return queueMicrotask(()=>{g&&y(f)}),()=>{g=!1,t.current===f&&(t.current=null)}},defaultLayout:{[I]:m,[D]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(f,g)=>{const{isUserInteraction:N}=g;if(!N){const z=t.current;z&&y(z);return}const C=f[I];c&&u&&typeof C=="number"&&C>0&&C<100&&r(C)},children:a}),e[10]=a,e[11]=u,e[12]=p,e[13]=n,e[14]=r,e[15]=y,e[16]=c,e[17]=m,e[18]=v):v=e[18];let L;return e[19]!==S||e[20]!==v||e[21]!==x?(L=s.jsxs(K,{value:x,children:[S,v]}),e[19]=S,e[20]=v,e[21]=x,e[22]=L):L=e[22],L}function Me(l){const e=P.c(16),{children:a,topbar:i}=l,n=H();if(n.isMobile){let h;return e[0]!==a||e[1]!==n.mobileSurface||e[2]!==i?(h=n.mobileSurface==="chat"?s.jsxs(_,{variant:"plain","data-slot":"chat-layout-thread",children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=n.mobileSurface,e[2]=i,e[3]=h):h=e[3],h}const o=n.threadOpen?"":void 0;let t;e[4]!==a||e[5]!==n.threadOpen||e[6]!==i?(t=n.threadOpen&&s.jsxs(s.Fragment,{children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=n.threadOpen,e[6]=i,e[7]=t):t=e[7];let d;e[8]!==t?(d=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(_,{"data-testid":"side-panel",children:t})}),e[8]=t,e[9]=d):d=e[9];let r;e[10]!==o||e[11]!==d?(r=s.jsx(Q,{id:I,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":o,className:"min-w-0 overflow-hidden bg-sidebar",children:d}),e[10]=o,e[11]=d,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(me,{className:"bg-sidebar"}),e[13]=c):c=e[13];let u;return e[14]!==r?(u=s.jsxs(s.Fragment,{children:[r,c]}),e[14]=r,e[15]=u):u=e[15],u}function Ae({children:l,routeId:e}){return l}function V(l){const e=P.c(26),{children:a,actions:i,drawer:n,aside:o}=l,t=H();if(t.isMobile&&t.mobileSurface!=="main")return null;const d=t.isMobile?"plain":"card";let r;e[0]!==i||e[1]!==t.contentActions?(r=s.jsxs(s.Fragment,{children:[t.contentActions,i]}),e[0]=i,e[1]=t.contentActions,e[2]=r):r=e[2];let c;e[3]!==t.contentNavigation||e[4]!==r?(c=s.jsx(we,{navigation:t.contentNavigation,actions:r}),e[3]=t.contentNavigation,e[4]=r,e[5]=c):c=e[5];let u;e[6]!==a||e[7]!==t.contentKey?(u=s.jsx(W,{children:s.jsx(Ae,{routeId:t.contentKey,children:a})}),e[6]=a,e[7]=t.contentKey,e[8]=u):u=e[8];let h;e[9]!==t.contentKey||e[10]!==u?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(q,{children:u},t.contentKey)}),e[9]=t.contentKey,e[10]=u,e[11]=h):h=e[11];let m;e[12]!==n||e[13]!==h?(m=s.jsxs(_.Content,{children:[h,n]}),e[12]=n,e[13]=h,e[14]=m):m=e[14];let p;e[15]!==c||e[16]!==m?(p=s.jsxs(J.Breadcrumbs.Provider,{children:[c,m]}),e[15]=c,e[16]=m,e[17]=p):p=e[17];let y;e[18]!==d||e[19]!==p?(y=s.jsx(_,{"data-testid":"main-panel",variant:d,children:p}),e[18]=d,e[19]=p,e[20]=y):y=e[20];const b=y;let j;return e[21]!==o||e[22]!==t.contentOpen||e[23]!==t.isMobile||e[24]!==b?(j=t.isMobile?b:s.jsx(Q,{id:D,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),o&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(_,{"data-testid":"aside-panel",children:s.jsx(q,{children:s.jsx(W,{children:o})},M.isValidElement(o)?o.key??void 0:void 0)})})]})}),e[21]=o,e[22]=t.contentOpen,e[23]=t.isMobile,e[24]=b,e[25]=j):j=e[25],j}function Re(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(ie,{})}),l[0]=e):e=l[0],e}function Be(l){const e=P.c(18),{error:a,reset:i}=l,n=Y();let o;e[0]!==n?(o=n("common.errorBoundary.somethingWentWrong"),e[0]=n,e[1]=o):o=e[1];let t;e[2]!==o?(t=s.jsx("h2",{className:"text-lg font-medium",children:o}),e[2]=o,e[3]=t):t=e[3];let d;e[4]!==a.message||e[5]!==n?(d=a.message||n("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=n,e[6]=d):d=e[6];let r;e[7]!==d?(r=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=r):r=e[8];let c;e[9]!==n?(c=n("common.errorBoundary.tryAgain"),e[9]=n,e[10]=c):c=e[10];let u;e[11]!==i||e[12]!==c?(u=s.jsx(le,{variant:"outline",onClick:i,children:c}),e[11]=i,e[12]=c,e[13]=u):u=e[13];let h;return e[14]!==t||e[15]!==r||e[16]!==u?(h=s.jsx(V,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[t,r,u]})}),e[14]=t,e[15]=r,e[16]=u,e[17]=h):h=e[17],h}const $e=Object.assign(Ie,{Thread:Me,Content:V}),Xe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:$e,ChatLayoutError:Be,ChatLayoutPending:Re,useChatLayout:Ee,useOptionalChatLayout:X},Symbol.toStringTag,{value:"Module"}));export{$e as C,we as R,Xe as i,Ee as u};