decocms 4.586.0 → 4.587.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 (428) hide show
  1. package/dist/client/assets/{AlertCircle-CGZfuvxJ.js → AlertCircle-gyZP8TIO.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DXqVsicd.js → AreaChart-BmP0ImmP.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-XURGfwpG.js → ArrowLeft-BSzt3fBA.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-ZoKxZa45.js → ArrowRight-BF8V67fk.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DJZ55cl-.js → ArrowUp-DYnF34lU.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-gO5hgFUK.js → BookOpen01-CpYcxx0H.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-B0LNjIyx.js → CartesianChart-Cflx4Yj4.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CmAKQrAh.js → CategoricalChart-CIY6jBUR.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-CmN8U1V5.js → CheckCircle-CyybvOiK.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-ClblfTVV.js → ChevronDown-DldgAfZA.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-YxAp9GGa.js → ChevronSelectorVertical-BbGwltuJ.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-0ZCAxpBW.js → ChevronUp-Bt9-G08q.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-CcTQ1h3_.js → CreditCard01-vIJuQM5M.js} +1 -1
  14. package/dist/client/assets/{Eye-D5j_svLn.js → Eye-BLpLvSpN.js} +1 -1
  15. package/dist/client/assets/{File02-Cs751Kds.js → File02-EV4Uhu5z.js} +1 -1
  16. package/dist/client/assets/{Globe04-DO1uUwfE.js → Globe04-DzGa73Hy.js} +1 -1
  17. package/dist/client/assets/{Image01-CJL4B_rR.js → Image01-BqCHFUEp.js} +1 -1
  18. package/dist/client/assets/{Key01-fuHivqLl.js → Key01-KTk95wIy.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CCeum9wV.js → LayoutLeft-_2SG51dD.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-cq4srxHs.js → LinkBroken01-Br9NMWkB.js} +1 -1
  21. package/dist/client/assets/{MessageCircle01-Bf6dD94_.js → MessageCircle01-D170V1-p.js} +1 -1
  22. package/dist/client/assets/{Minus-Cc21R1KY.js → Minus-D88-u0DO.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DGdgEYxG.js → Monitor01-Df3mZyNU.js} +1 -1
  24. package/dist/client/assets/{Play-zYFs_vGL.js → Play-PdUxpWZE.js} +1 -1
  25. package/dist/client/assets/{Plus--DcN-eh1.js → Plus-BYodv7tE.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-D6M1JZR1.js → ReferenceLine-DrwOzdWE.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BwYuN52e.js → SearchMd-Cuy8VOOG.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-D-gmqcz7.js → ShoppingBag01-pCIsQ-Jb.js} +1 -1
  29. package/dist/client/assets/{Sun-D9ql5ZlI.js → Sun-BABGQWS8.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BQF84Li3.js → SwitchHorizontal01-Daz2EgW0.js} +1 -1
  31. package/dist/client/assets/{Tool01-BeDQSGiN.js → Tool01-D6InpKaj.js} +1 -1
  32. package/dist/client/assets/{Tooltip-C_RHysFo.js → Tooltip-CP1IpP66.js} +1 -1
  33. package/dist/client/assets/{Trash01-BmQrADz0.js → Trash01-LecfbxTv.js} +1 -1
  34. package/dist/client/assets/{TrendUp01-_SFSHjzO.js → TrendUp01-C_SySyBC.js} +1 -1
  35. package/dist/client/assets/{Upload01-DOfZqxci.js → Upload01-CABY93nl.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-BMoOFYIZ.js → UserCheck01-Dqn7toBe.js} +1 -1
  37. package/dist/client/assets/{UserSquare-Dn1UPzSD.js → UserSquare-e0qIxN1Q.js} +1 -1
  38. package/dist/client/assets/{Users01-B_yoWxPn.js → Users01-UF7lWU9g.js} +1 -1
  39. package/dist/client/assets/{XClose-C4MsAn9v.js → XClose-C9ONGfkv.js} +1 -1
  40. package/dist/client/assets/{Zap-DoxB0q6B.js → Zap-D-fE_V4E.js} +1 -1
  41. package/dist/client/assets/{access-gate-DQ55JjgP.js → access-gate-EJXICSzm.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-D0PlxcOk.js → add-connection-dialog-CEukHWSz.js} +1 -1
  43. package/dist/client/assets/agent-app-CPNngTIj.js +1 -0
  44. package/dist/client/assets/{agent-assets-COp9WevM.js → agent-assets-IEsYbqYf.js} +1 -1
  45. package/dist/client/assets/{agent-automation-DRfIHgf4.js → agent-automation-iOzcLbza.js} +1 -1
  46. package/dist/client/assets/{agent-automations-C02SU72h.js → agent-automations-COHiMRwL.js} +1 -1
  47. package/dist/client/assets/{agent-blog-yxvdX-jE.js → agent-blog-ClTYnrpA.js} +2 -2
  48. package/dist/client/assets/{agent-blog-post-BOz0k9l4.js → agent-blog-post-BieKo5sU.js} +2 -2
  49. package/dist/client/assets/{agent-calendar-BrjcVSaH.js → agent-calendar-DrN9hKs4.js} +1 -1
  50. package/dist/client/assets/{agent-capabilities-Dh06TMfs.js → agent-capabilities-g1Ym1ZNZ.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-DhRc2-S_.js → agent-connect-sources-CZgCtVaH.js} +1 -1
  52. package/dist/client/assets/agent-deck-C63CWfE0.js +1 -0
  53. package/dist/client/assets/{agent-e2e-w331hEXE.js → agent-e2e-OCkFxgz-.js} +1 -1
  54. package/dist/client/assets/agent-experiments-BZeZuSr2.js +1 -0
  55. package/dist/client/assets/agent-file-BS83qFDk.js +1 -0
  56. package/dist/client/assets/{agent-hosting-Cf_5DVCs.js → agent-hosting-DnFnd1YM.js} +1 -1
  57. package/dist/client/assets/{agent-icon-DwJHakBB.js → agent-icon-CfdcYUE7.js} +1 -1
  58. package/dist/client/assets/agent-library-B6Vv6L3Y.js +1 -0
  59. package/dist/client/assets/agent-library-file-CVP6ClM5.js +1 -0
  60. package/dist/client/assets/agent-overview-C3EtX-Ab.js +1 -0
  61. package/dist/client/assets/{agent-releases-CQDLHf-9.js → agent-releases-AtVL__p1.js} +1 -1
  62. package/dist/client/assets/agent-settings-CEIvC9PJ.js +1 -0
  63. package/dist/client/assets/agent-site-editor-code-CP-GqZR-.js +2 -0
  64. package/dist/client/assets/agent-site-editor-content-BmdLBDYW.js +1 -0
  65. package/dist/client/assets/agent-site-editor-preview-_kq8Kx6K.js +1 -0
  66. package/dist/client/assets/{agent-site-editor-Bn_zysVp.js → agent-site-editor-x-mpZE5Q.js} +1 -1
  67. package/dist/client/assets/agent-view-Ch4mKCK3.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-_UB25wdA.js → agent-view-guard-DLjVinhc.js} +1 -1
  69. package/dist/client/assets/{ai-providers-BZmTFJ6J.js → ai-providers-DVYif0Pc.js} +1 -1
  70. package/dist/client/assets/{alert-Dl9RecsO.js → alert-CvRyYnph.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-ChR-yKgZ.js → analytics-sections-DLx5rbIc.js} +1 -1
  72. package/dist/client/assets/{api-keys-BAKKjcCM.js → api-keys-CC3fBiOG.js} +1 -1
  73. package/dist/client/assets/api-keys-DW5FUpRL.js +1 -0
  74. package/dist/client/assets/{app-editor-aGjbireC.js → app-editor-D_fd99pv.js} +1 -1
  75. package/dist/client/assets/{asset-utils-C40qdOgS.js → asset-utils-CTFQl8QO.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-CwzGmsez.js → auth-catchall-n3aaYtq8.js} +1 -1
  77. package/dist/client/assets/{auth-entry-QpiCG8Kt.js → auth-entry-DIN9lopt.js} +1 -1
  78. package/dist/client/assets/{auth-split-layout-D0SngsR5.js → auth-split-layout-C3JVxF8x.js} +1 -1
  79. package/dist/client/assets/{auth-DuSLyK-k.js → auth-vqpzzu5D.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-BrPxKw11.js → authenticate-and-persist-oauth-Bblph2Da.js} +1 -1
  81. package/dist/client/assets/{automation-list-row-C_0woHJW.js → automation-list-row-Bz8m8BYO.js} +1 -1
  82. package/dist/client/assets/{automation-runs-DwwK7nJ3.js → automation-runs-osLD86WP.js} +1 -1
  83. package/dist/client/assets/{automations-Dc36NZHt.js → automations-BVdNqAsv.js} +1 -1
  84. package/dist/client/assets/{badge-BvHOfdxU.js → badge-DCIHIkLr.js} +1 -1
  85. package/dist/client/assets/{block-document-CGK32I9G.js → block-document-Dbx69UMn.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-CN-ldvuU.js → blocks-preview-workspace-context-CK2OXCcd.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-DxLq1BL5.js → blocks-tab-states-DeaA94XX.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-cX5z_9aO.js → blog-preview-url-58BZuQLd.js} +1 -1
  89. package/dist/client/assets/{blog-schema-CTE9utzf.js → blog-schema-DfhHwBev.js} +1 -1
  90. package/dist/client/assets/{blog-source-gate-DWHD3Df5.js → blog-source-gate-CCV8MP-i.js} +1 -1
  91. package/dist/client/assets/{blog-view-gate-DT-8hHxE.js → blog-view-gate-o9mn9sNx.js} +1 -1
  92. package/dist/client/assets/{buckets-DMt9Xchk.js → buckets-RrYuA5vR.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-D0Nbi1s7.js → build-improve-prompt-doc-fsuyBe8R.js} +1 -1
  94. package/dist/client/assets/{calendar-BUgmhSfk.js → calendar-BbIAhjX6.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-DCoklIp8.js → capability-load-error-C937GiKP.js} +1 -1
  96. package/dist/client/assets/{category-editor-B7D8BVkO.js → category-editor-BgCEgg9r.js} +1 -1
  97. package/dist/client/assets/{category-tree-BeXLYa5S.js → category-tree-yoWo8LKT.js} +1 -1
  98. package/dist/client/assets/{chart-DfTUTOGH.js → chart-R5Gu29E6.js} +1 -1
  99. package/dist/client/assets/{chat-context-DG5tQFfU.js → chat-context-DSu9o-d-.js} +1 -1
  100. package/dist/client/assets/{chat-draft-Bv2iw9Fr.js → chat-draft-BHCxr31Y.js} +1 -1
  101. package/dist/client/assets/{checkbox-DAnVkT6Q.js → checkbox-D4P_L8j1.js} +1 -1
  102. package/dist/client/assets/{choose-editor-DX9vd71s.js → choose-editor-DFX28kMs.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-CY4cK7Ok.js → cli-auth-success-DGIBfDO7.js} +1 -1
  104. package/dist/client/assets/{cms-settings-editor-Cj7WfazE.js → cms-settings-editor-1icUX_7B.js} +1 -1
  105. package/dist/client/assets/{cms-store-drafts-BDhAH5vV.js → cms-store-drafts-pPAksstG.js} +1 -1
  106. package/dist/client/assets/{collapsible-DifRD2Ww.js → collapsible-BJX4Hk9k.js} +1 -1
  107. package/dist/client/assets/{collection-detail-Bq38QGfT.js → collection-detail-Cnr4TuBK.js} +1 -1
  108. package/dist/client/assets/{collection-display-button-nfEDIRuH.js → collection-display-button-C2JNt8jM.js} +1 -1
  109. package/dist/client/assets/{collection-search-RWM-9f07.js → collection-search-DIaYviRG.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-DVjGjn7R.js → collection-table-wrapper-DisSN_Gv.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-BkmY1xp_.js → collection-tabs-CxgBigfA.js} +1 -1
  112. package/dist/client/assets/{combobox-D7DiHBHL.js → combobox-BCPDPSll.js} +1 -1
  113. package/dist/client/assets/{command-DHGFzOhP.js → command-DsEpQe7b.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-D7d32LFm.js → companion-mcps-section-CVk0MHqs.js} +1 -1
  115. package/dist/client/assets/{config-dB-x76iz.js → config-iR6MS3mx.js} +1 -1
  116. package/dist/client/assets/{connect-D-G-5Mck.js → connect-BJ6zbvIe.js} +1 -1
  117. package/dist/client/assets/{connect-key-DYxzA5cq.js → connect-key-R6CnqQKc.js} +1 -1
  118. package/dist/client/assets/{connect-layout-vX9TenPs.js → connect-layout-CWTX0XxP.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-hJXgVRU-.js → connect-source-dialog-DS1_5d5l.js} +1 -1
  120. package/dist/client/assets/{connection-CeuJqjaI.js → connection-Daz_MJgN.js} +1 -1
  121. package/dist/client/assets/{connection-card-bC9jkQR3.js → connection-card-BEkW2Rzt.js} +1 -1
  122. package/dist/client/assets/{connection-detail-BZxu1Il4.js → connection-detail-WE10lVgN.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-BVK3iXej.js → connection-form-helpers-BZyz8LC0.js} +1 -1
  124. package/dist/client/assets/{connection-slug-BofuMVWL.js → connection-slug-CvvLfpvw.js} +1 -1
  125. package/dist/client/assets/{connections-_2oGT26C.js → connections-8XSaqT9l.js} +1 -1
  126. package/dist/client/assets/{content-tab-B2YwxmJz.js → content-tab-C66XjEbc.js} +3 -3
  127. package/dist/client/assets/{context-RVZVsnak.js → context-DW5quhGR.js} +1 -1
  128. package/dist/client/assets/{context-menu-BgKzmvfA.js → context-menu-Dc1eMRQk.js} +1 -1
  129. package/dist/client/assets/{context-shell-Bnnp_FlP.js → context-shell-CnWm8Iac.js} +3 -3
  130. package/dist/client/assets/{create-organization-dialog-BeGGdtfc.js → create-organization-dialog-BditzGYJ.js} +1 -1
  131. package/dist/client/assets/{daily-pulse-D8S4f077.js → daily-pulse-CCUis9lD.js} +1 -1
  132. package/dist/client/assets/{delete-copy-C7-0DCkQ.js → delete-copy-B8O2OJ6R.js} +1 -1
  133. package/dist/client/assets/{device-hint-B6fw2qhI.js → device-hint-C-aumrOZ.js} +1 -1
  134. package/dist/client/assets/{discover-BhyJuEKB.js → discover-Dbo6G7J-.js} +1 -1
  135. package/dist/client/assets/{domain-settings-DWaq5CPi.js → domain-settings-D_KZc6yt.js} +1 -1
  136. package/dist/client/assets/{drawer-BXd80xtd.js → drawer-Ckz_nyBH.js} +1 -1
  137. package/dist/client/assets/{editor-DNZ-WgCS.js → editor-Dv1qkRGx.js} +1 -1
  138. package/dist/client/assets/{editor-classes-CzejjvgI.js → editor-classes-Bm1swfOR.js} +1 -1
  139. package/dist/client/assets/{empty-message-DVICFi26.js → empty-message-Cs32P_FY.js} +1 -1
  140. package/dist/client/assets/{empty-state-BK8GboWz.js → empty-state-DGaA5_7F.js} +1 -1
  141. package/dist/client/assets/{empty-state-LbEOn0Mj.js → empty-state-DvK349M1.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-DYGF6IS1.js → experiments-tab-choice-pZXd8Qq7.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-B1FMXoXK.js → extract-connection-data-DyZVXRSl.js} +1 -1
  144. package/dist/client/assets/{feature-gate-XyzkzO9l.js → feature-gate-Q3XqEiLe.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-DQF2iJDP.js → feature-paywall-DLrDt0zj.js} +1 -1
  146. package/dist/client/assets/{file-explorer-DbKxpql5.js → file-explorer-DTnrhmiM.js} +1 -1
  147. package/dist/client/assets/{file-preview-A0GfMNED.js → file-preview-C3aAzbl2.js} +1 -1
  148. package/dist/client/assets/{file-share-button-pVEpOvSY.js → file-share-button-DchUqnxv.js} +1 -1
  149. package/dist/client/assets/{file-type-icon-CSrE_noX.js → file-type-icon-C1PmpIi5.js} +1 -1
  150. package/dist/client/assets/{folder-icon-CA298KqN.js → folder-icon-GDlGVc-z.js} +1 -1
  151. package/dist/client/assets/{form-Cxhh0mxt.js → form-B3cubXs5.js} +1 -1
  152. package/dist/client/assets/{frame-navigation--4kFXAAS.js → frame-navigation-CZuPAR0A.js} +1 -1
  153. package/dist/client/assets/{gateway-client-PdaGLWBA.js → gateway-client-DDICMs0d.js} +1 -1
  154. package/dist/client/assets/{general-CuKnI3HJ.js → general-Dm23uhl2.js} +1 -1
  155. package/dist/client/assets/{github-icon-h_xg-qFR.js → github-icon-lV5tv6c5.js} +1 -1
  156. package/dist/client/assets/{held-block-view-zi4CM-KX.js → held-block-view-KOyRMpy4.js} +1 -1
  157. package/dist/client/assets/{home-w1KhoL46.js → home-Bdn-v4eM.js} +1 -1
  158. package/dist/client/assets/{home-overview-DrWyW-2I.js → home-overview-_jWE4zXs.js} +1 -1
  159. package/dist/client/assets/{hosted-reconcile-uX15ZUhb.js → hosted-reconcile-CxvdumkL.js} +1 -1
  160. package/dist/client/assets/{icon-button-DzpdeaSs.js → icon-button-trmtAOaJ.js} +1 -1
  161. package/dist/client/assets/{index-BK93qS26.js → index-2abaLvjI.js} +1 -1
  162. package/dist/client/assets/{index-ba5Vf9vt.js → index-3YHObF9S.js} +1 -1
  163. package/dist/client/assets/{index-BpNyzjaQ.js → index-BBeGVRdq.js} +1 -1
  164. package/dist/client/assets/{index-SPj0mL-J.js → index-BBpZPks2.js} +1 -1
  165. package/dist/client/assets/{index-3e8V4Do_.js → index-C7CSN06D.js} +1 -1
  166. package/dist/client/assets/{index-SIZschZt.js → index-D7q4YJXJ.js} +1 -1
  167. package/dist/client/assets/{index-CZTrNcsP.js → index-DAKnsBwp.js} +1 -1
  168. package/dist/client/assets/{index-BYaF8G7R.js → index-DaFEqiTp.js} +1 -1
  169. package/dist/client/assets/{index-C_n-5x2E.js → index-DuvX09S7.js} +1 -1
  170. package/dist/client/assets/{index-rt88hTRg.js → index-NWJ7p_1D.js} +1 -1
  171. package/dist/client/assets/{index-DNuvhcDO.js → index-PcrdQb7V.js} +1 -1
  172. package/dist/client/assets/{index-Bld02Tnb.js → index-QCTvcBUO.js} +1 -1
  173. package/dist/client/assets/{index-BuZqAz74.js → index-_VeebRNE.js} +3 -3
  174. package/dist/client/assets/{index-DUn-LHzT.js → index-_m0OQ-gU.js} +1 -1
  175. package/dist/client/assets/{index-BwBEUlXI.js → index-j-nHo57s.js} +1 -1
  176. package/dist/client/assets/{index-redirect-DlIbuGOg.js → index-redirect-qshgZoiU.js} +1 -1
  177. package/dist/client/assets/{index-5KkkYmJi.js → index-wdSinBQm.js} +1 -1
  178. package/dist/client/assets/{index-DsWqYG3w.js → index-ykH_xCiZ.js} +1 -1
  179. package/dist/client/assets/{infiniteQueryObserver-CHN_AvWa.js → infiniteQueryObserver-D7rUvD7y.js} +1 -1
  180. package/dist/client/assets/{infra-billing-DHY4EnRE.js → infra-billing-2jNYgPJB.js} +1 -1
  181. package/dist/client/assets/{input--XeG2v6T.js → input-CdG_yBtw.js} +1 -1
  182. package/dist/client/assets/{input-c6Cx2liY.js → input-DAVLPdNO.js} +3 -3
  183. package/dist/client/assets/{integration-icon-D7fga3kk.js → integration-icon-D8pA0JHG.js} +1 -1
  184. package/dist/client/assets/{item-actions-Dld5lBtQ.js → item-actions-0UZvaX_W.js} +1 -1
  185. package/dist/client/assets/{jira-icon-_W0tffOR.js → jira-icon-B6n8YNiL.js} +1 -1
  186. package/dist/client/assets/{label-Dm_T3WyF.js → label-DZkEI5Ke.js} +1 -1
  187. package/dist/client/assets/{layout-DhN3YXX3.js → layout-B_eV9tIt.js} +1 -1
  188. package/dist/client/assets/{legacy-admin-welcome-dialog-C0w-pw6s.js → legacy-admin-welcome-dialog-ZZ1Gngd8.js} +1 -1
  189. package/dist/client/assets/{legacy-agents-deep-ab_jOs-e.js → legacy-agents-deep-DIO9RwdG.js} +1 -1
  190. package/dist/client/assets/{legacy-main-redirect-ByIcJoSw.js → legacy-main-redirect-MYDZoBC6.js} +1 -1
  191. package/dist/client/assets/library-BGNgyVkv.js +1 -0
  192. package/dist/client/assets/{library-tab-Cui4e0pM.js → library-tab-1VGCJxXK.js} +1 -1
  193. package/dist/client/assets/{login-COwI3GAk.js → login-D1CbtJGZ.js} +1 -1
  194. package/dist/client/assets/{markdown-CwYBGb1B.js → markdown-CBoNEgkf.js} +1 -1
  195. package/dist/client/assets/{mcp-app-renderer-CLuYD3rD.js → mcp-app-renderer-DtOO8I9w.js} +1 -1
  196. package/dist/client/assets/{mcp-oauth-i1ZYjV6U.js → mcp-oauth-BHOMUKtj.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-DZ8B5A_7.js → mcp-oauth-DGxlh_95.js} +1 -1
  198. package/dist/client/assets/{members-CvbIQPwh.js → members-DHWvHq5T.js} +1 -1
  199. package/dist/client/assets/{memory-BhMXHewc.js → memory-C6q4guqS.js} +1 -1
  200. package/dist/client/assets/{mock-board-DN7OLcTA.js → mock-board-ltUmj9_y.js} +3 -3
  201. package/dist/client/assets/{monaco-editor-CTONBla7.js → monaco-editor-D-AA2j7y.js} +1 -1
  202. package/dist/client/assets/{monitoring-DPSQDGbL.js → monitoring-DaONVMuI.js} +1 -1
  203. package/dist/client/assets/{monitoring-stats-row-BUZplGDl.js → monitoring-stats-row-DeZi5P6B.js} +1 -1
  204. package/dist/client/assets/{multi-select-BSuPEET4.js → multi-select-DUQRYjic.js} +1 -1
  205. package/dist/client/assets/{mustache-C50JF2sQ.js → mustache-uZ8plADR.js} +1 -1
  206. package/dist/client/assets/{named-rule-step-D8j_NuRK.js → named-rule-step-DreL1Pcr.js} +1 -1
  207. package/dist/client/assets/{named-rule-view-D9U19iHq.js → named-rule-view-DfnvZmuY.js} +1 -1
  208. package/dist/client/assets/{new-project-dialog-Bq2YhVDS.js → new-project-dialog-B9UZLlxE.js} +1 -1
  209. package/dist/client/assets/{new-project-store-C82itd6a.js → new-project-store-BzLAZn_u.js} +1 -1
  210. package/dist/client/assets/{oauth-callback-xH1_0Q9p.js → oauth-callback-DeF7HKPm.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-ai-provider-Dph1UX9E.js → oauth-callback-ai-provider-B-Qmx59a.js} +1 -1
  212. package/dist/client/assets/{oauth-consent-BJ9Jn7G7.js → oauth-consent-CwjN9gES.js} +1 -1
  213. package/dist/client/assets/{onboarding-tM_LYdg0.js → onboarding-vgMy4F5g.js} +1 -1
  214. package/dist/client/assets/{openai-conversation-DoQ_2Seq.js → openai-conversation-NvZqYcCK.js} +1 -1
  215. package/dist/client/assets/{optimistic-project-sidebar-views-TOzwQjCp.js → optimistic-project-sidebar-views-CBHDKL26.js} +1 -1
  216. package/dist/client/assets/{order-monitor-day-BqegE0N0.js → order-monitor-day-Txb2sZ3L.js} +1 -1
  217. package/dist/client/assets/{organization-choice-BzjQ0aL1.js → organization-choice-CP3Mtgeb.js} +1 -1
  218. package/dist/client/assets/{orgs-WruSV9A-.js → orgs-QZqcYIh_.js} +1 -1
  219. package/dist/client/assets/{own-accounts-section-TMVLN8mQ.js → own-accounts-section-B-xTQ1qC.js} +1 -1
  220. package/dist/client/assets/{pair-BYbJa99U.js → pair-CHh11R95.js} +1 -1
  221. package/dist/client/assets/{parse-sections-CVDx-uBN.js → parse-sections-BX1x8Bjk.js} +2 -2
  222. package/dist/client/assets/{plan-ladder-Ce2vSjaL.js → plan-ladder-Boo36Lf_.js} +1 -1
  223. package/dist/client/assets/{plan-DDx2VxJ0.js → plan-qEpUYs_C.js} +1 -1
  224. package/dist/client/assets/{plan-usage-card-CvxOK5ad.js → plan-usage-card-XvorW2R2.js} +1 -1
  225. package/dist/client/assets/{popover-D6EIL5sL.js → popover-CsisCWO2.js} +1 -1
  226. package/dist/client/assets/{post-calendar-J6Cs6vQ8.js → post-calendar-halP83kx.js} +1 -1
  227. package/dist/client/assets/{post-editor-v1jKXm9-.js → post-editor-S0aVTLKj.js} +1 -1
  228. package/dist/client/assets/{preview-content-9gQGJiFY.js → preview-content-5ttXljO9.js} +1 -1
  229. package/dist/client/assets/{preview-dialog-J4DJmy9P.js → preview-dialog-BclA8lM_.js} +1 -1
  230. package/dist/client/assets/{preview-panel-DLe0RaXg.js → preview-panel-DwKqGg2b.js} +1 -1
  231. package/dist/client/assets/{preview-tab-BxZksZBr.js → preview-tab-DY0X1Y__.js} +3 -3
  232. package/dist/client/assets/{product-picker-dialog-DCC_2JmD.js → product-picker-dialog-BYy8uc5-.js} +1 -1
  233. package/dist/client/assets/{profile-CU5pOHcx.js → profile-Bd_H-bJ-.js} +1 -1
  234. package/dist/client/assets/{project-app-view-Chii7rIX.js → project-app-view-C5QreDU8.js} +1 -1
  235. package/dist/client/assets/{project-apps-Dezyz6_N.js → project-apps-Qpq3Yqgk.js} +1 -1
  236. package/dist/client/assets/{project-icon-BHn6Xq54.js → project-icon-CoHnihPF.js} +1 -1
  237. package/dist/client/assets/{project-index-5c8GGatg.js → project-index-QHWJWseM.js} +1 -1
  238. package/dist/client/assets/project-reports-WCcwA84Y.js +1 -0
  239. package/dist/client/assets/project-tasks-DKIcBGE8.js +1 -0
  240. package/dist/client/assets/{projects-C19Wu8MK.js → projects-BH3mZwKm.js} +1 -1
  241. package/dist/client/assets/{projects-empty-state-Dh0sHuPd.js → projects-empty-state-DUNpLlKl.js} +1 -1
  242. package/dist/client/assets/{prompts-CYFmsiS6.js → prompts-DYNo1NOe.js} +1 -1
  243. package/dist/client/assets/record-editor-ruw8hHLO.js +1 -0
  244. package/dist/client/assets/{redirect-editor-D9WJKRVv.js → redirect-editor-9KKRUJjb.js} +1 -1
  245. package/dist/client/assets/reports-C98Nopj0.js +1 -0
  246. package/dist/client/assets/{reports-Cj91Mylc.js → reports-CIVLWAKU.js} +1 -1
  247. package/dist/client/assets/{reports-onboarding-gB4My80z.js → reports-onboarding-BvleSDU0.js} +1 -1
  248. package/dist/client/assets/{reports-tab-CsHbv07d.js → reports-tab-Cpactxak.js} +2 -2
  249. package/dist/client/assets/repositories-BUVT6KWE.js +1 -0
  250. package/dist/client/assets/{repositories-C_7l-hzO.js → repositories-D3sB2pcK.js} +1 -1
  251. package/dist/client/assets/{repository-binding-VVfcdUiy.js → repository-binding-Ct6tvS6k.js} +1 -1
  252. package/dist/client/assets/{repository-picker-By75IHJa.js → repository-picker-D7wgGSh_.js} +1 -1
  253. package/dist/client/assets/{require-capability-DEShAaY8.js → require-capability-psnJqvDd.js} +1 -1
  254. package/dist/client/assets/{required-auth-layout-GSSn-bTA.js → required-auth-layout-5KQLVPyY.js} +1 -1
  255. package/dist/client/assets/{reset-password-eGGPXuZQ.js → reset-password-CMUJSwol.js} +1 -1
  256. package/dist/client/assets/{resizable-XeFzd9pk.js → resizable-TldGXL10.js} +1 -1
  257. package/dist/client/assets/{resolve-tab-icon-DQMxOocF.js → resolve-tab-icon-Dx984IYY.js} +1 -1
  258. package/dist/client/assets/{review-settings-BOoUlwEx.js → review-settings-EAZgwqP6.js} +1 -1
  259. package/dist/client/assets/{role-color-D-S7Ra1A.js → role-color-Az77j5-3.js} +1 -1
  260. package/dist/client/assets/{roles-C8YQ1Aw2.js → roles-KaJOIApg.js} +1 -1
  261. package/dist/client/assets/route-CLOMEKRN.js +1 -0
  262. package/dist/client/assets/{route-ojZJTNbW.js → route-CsFahJR-.js} +1 -1
  263. package/dist/client/assets/{route-lr7i-nM3.js → route-DwgCQsMA.js} +1 -1
  264. package/dist/client/assets/{route-page-header-BqA32d57.js → route-page-header-B8Mmh-Yn.js} +1 -1
  265. package/dist/client/assets/{sandbox-git-api-CkSQDoxX.js → sandbox-git-api-DN6h_KqP.js} +1 -1
  266. package/dist/client/assets/{sandbox-lifecycle-context-BBz4IKVo.js → sandbox-lifecycle-context-Ptllc8xw.js} +1 -1
  267. package/dist/client/assets/{save-status-CmYiPWXE.js → save-status-DI5XwwX3.js} +1 -1
  268. package/dist/client/assets/{schema-CCpL_LVZ.js → schema-Bawh3LAf.js} +1 -1
  269. package/dist/client/assets/{schema-B0biNpls.js → schema-Cp9WUmjR.js} +1 -1
  270. package/dist/client/assets/{scroll-area-bkCFS0v8.js → scroll-area-EnKfGRfx.js} +1 -1
  271. package/dist/client/assets/{search-input-C4sd-kKh.js → search-input-JNlnu1vU.js} +1 -1
  272. package/dist/client/assets/{search-toggle-rjC0c-Iy.js → search-toggle-Gczjy-6q.js} +1 -1
  273. package/dist/client/assets/{secret-picker-ujhqmuU6.js → secret-picker-DpLLS_i2.js} +1 -1
  274. package/dist/client/assets/{secrets-CUx_W408.js → secrets-BkICoFYK.js} +1 -1
  275. package/dist/client/assets/{section-array-field-DOngDm8U.js → section-array-field-DeIFn5hU.js} +1 -1
  276. package/dist/client/assets/{sections-DmtYqnPM.js → sections-DsIUB3iD.js} +1 -1
  277. package/dist/client/assets/{sections-editor-DsX6y72K.js → sections-editor-DQjh_kFR.js} +1 -1
  278. package/dist/client/assets/{select-BkYZ4NYA.js → select-QgdI1Rfc.js} +1 -1
  279. package/dist/client/assets/{select-model-BNVZsPuq.js → select-model-CRyWxfNm.js} +1 -1
  280. package/dist/client/assets/{seo-editor-D-DOTzeP.js → seo-editor-bIUZHc8M.js} +1 -1
  281. package/dist/client/assets/{separator-DTKXzVmt.js → separator-BEzt-XQG.js} +1 -1
  282. package/dist/client/assets/{session-runtime-HHtypsTM.js → session-runtime-DLIbUSWD.js} +1 -1
  283. package/dist/client/assets/settings-tab-DdQCVDpj.js +1 -0
  284. package/dist/client/assets/{sheet-Lq2qXLx8.js → sheet-8iInbf9D.js} +1 -1
  285. package/dist/client/assets/{shell-layout-rYoN4RTk.js → shell-layout-D8UbY9n5.js} +1 -1
  286. package/dist/client/assets/{site-draft-actions-D72ZWrGI.js → site-draft-actions-BVBEL1BN.js} +1 -1
  287. package/dist/client/assets/{site-draft-view-DdS4HrBp.js → site-draft-view-CU45gg4m.js} +1 -1
  288. package/dist/client/assets/site-editor-CyPykGup.js +1 -0
  289. package/dist/client/assets/{site-editor-toast-aupfR4Aq.js → site-editor-toast-Cjans_Z7.js} +1 -1
  290. package/dist/client/assets/{skills-Cyx-LBzb.js → skills-CznUJdJq.js} +1 -1
  291. package/dist/client/assets/{slider-B4bXP1H_.js → slider-CnikFjRE.js} +1 -1
  292. package/dist/client/assets/{sortable.esm-n9zdQXyB.js → sortable.esm-CW9y-Z65.js} +1 -1
  293. package/dist/client/assets/{sso-DIU8j1zk.js → sso-BUdWqS9w.js} +1 -1
  294. package/dist/client/assets/{suggestion-Nntdxi5T.js → suggestion-gEn2gqrr.js} +1 -1
  295. package/dist/client/assets/{super-agent-icon-DHSnZQuw.js → super-agent-icon-Dx5Acgbw.js} +1 -1
  296. package/dist/client/assets/{switch-COjzxQ39.js → switch-7uXAaerp.js} +1 -1
  297. package/dist/client/assets/{synced-repos-s5ovH7Qr.js → synced-repos-C29_oiY7.js} +1 -1
  298. package/dist/client/assets/{tab-icon-glyph-CvvfUXQl.js → tab-icon-glyph-CgM03OpD.js} +1 -1
  299. package/dist/client/assets/{table-DQIAY6r-.js → table-drGady29.js} +1 -1
  300. package/dist/client/assets/{tabs-CbfCGlFS.js → tabs-C9s0KY6N.js} +1 -1
  301. package/dist/client/assets/{task-board-DEUSGytR.js → task-board-CHctJwrW.js} +1 -1
  302. package/dist/client/assets/{task-key-DaPOId6s.js → task-key-B6H-3XJr.js} +1 -1
  303. package/dist/client/assets/{task-route-BJj40Yza.js → task-route-CBxVmSL7.js} +1 -1
  304. package/dist/client/assets/{task-status-B6WfZxUN.js → task-status-CRPxL8gs.js} +1 -1
  305. package/dist/client/assets/{taskboard-analytics-UnAzvxoh.js → taskboard-analytics-DMGsXigW.js} +1 -1
  306. package/dist/client/assets/tasks-Cey8OfRa.js +1 -0
  307. package/dist/client/assets/{tasks-vny6IFm0.js → tasks-Dmvi9b_Y.js} +1 -1
  308. package/dist/client/assets/{textarea-CcO-rfag.js → textarea-Cimn1xhl.js} +1 -1
  309. package/dist/client/assets/{thread-analytics-BUAtXNjP.js → thread-analytics-BhURcKi_.js} +1 -1
  310. package/dist/client/assets/{thread-button-DbVaWztE.js → thread-button-DCHp9tO9.js} +1 -1
  311. package/dist/client/assets/{thread-intent-CyH0Z8_7.js → thread-intent-pC76uPwU.js} +1 -1
  312. package/dist/client/assets/{thread-route-BjDCYf6b.js → thread-route-BrFKkVcF.js} +1 -1
  313. package/dist/client/assets/{thread-route-Dw1cQjON.js → thread-route-D_C8d7xK.js} +1 -1
  314. package/dist/client/assets/{thread-sheet-body-C6XCaB8H.js → thread-sheet-body-DAosbhoz.js} +1 -1
  315. package/dist/client/assets/{time-range-picker-C45MZ0gR.js → time-range-picker-9BtbKkzB.js} +1 -1
  316. package/dist/client/assets/{toggle-group-DFyE84bx.js → toggle-group-n8suP90I.js} +1 -1
  317. package/dist/client/assets/{tool-set-selector-BgHdncVU.js → tool-set-selector-DP0UayXg.js} +1 -1
  318. package/dist/client/assets/{toolbar-icon-button-BroRQfDx.js → toolbar-icon-button-BAHC2wln.js} +1 -1
  319. package/dist/client/assets/{tooltip-DnGqcvtu.js → tooltip-BYnWhoO-.js} +1 -1
  320. package/dist/client/assets/{tooltipContext-BVc6eTu_.js → tooltipContext-DqZT6jLi.js} +1 -1
  321. package/dist/client/assets/{track-ENeykFhY.js → track-BXFPt0jP.js} +1 -1
  322. package/dist/client/assets/{types-B4ln4I1a.js → types-CdP485rd.js} +1 -1
  323. package/dist/client/assets/{url-slug-BCxEu7m_.js → url-slug-BkKOqwJh.js} +1 -1
  324. package/dist/client/assets/{usage-stats-C5Wj6kIy.js → usage-stats-CCyq9Zgo.js} +1 -1
  325. package/dist/client/assets/{use-ai-providers-BG5EDM0R.js → use-ai-providers-D6peTC8u.js} +1 -1
  326. package/dist/client/assets/{use-api-keys-CjwRm6n8.js → use-api-keys-DUVyFEfc.js} +1 -1
  327. package/dist/client/assets/{use-apply-named-rule-BH9tV1RN.js → use-apply-named-rule-D9dIZN02.js} +1 -1
  328. package/dist/client/assets/use-ask-in-chat-DINxvsUX.js +1 -0
  329. package/dist/client/assets/{use-automations-D4bJmUmE.js → use-automations-qL4OMGNt.js} +1 -1
  330. package/dist/client/assets/{use-autosave-Dq8gUNzN.js → use-autosave-DGPPxEGb.js} +1 -1
  331. package/dist/client/assets/use-blocks-v8-project-JOmELUJ6.js +1 -0
  332. package/dist/client/assets/use-blog-view-DQBrFMuV.js +1 -0
  333. package/dist/client/assets/{use-chat-layout-state-D38zRykR.js → use-chat-layout-state-DMWJLUZv.js} +1 -1
  334. package/dist/client/assets/{use-cms-publish-actions-Bf5Y1rJL.js → use-cms-publish-actions-DuI-swrZ.js} +1 -1
  335. package/dist/client/assets/{use-connect-companion-leNqQRzW.js → use-connect-companion-C9LfjXNg.js} +1 -1
  336. package/dist/client/assets/{use-connection-C4G0ZMoe.js → use-connection-cSaq7_i7.js} +1 -1
  337. package/dist/client/assets/{use-content-sync-CeYI53r8.js → use-content-sync-DElceZSb.js} +1 -1
  338. package/dist/client/assets/{use-copy-BFeXylk9.js → use-copy-DKfw8n-3.js} +1 -1
  339. package/dist/client/assets/{use-current-view-swKX6Bc6.js → use-current-view-a6HKOM5X.js} +1 -1
  340. package/dist/client/assets/{use-date-fns-locale-DX45EO9I.js → use-date-fns-locale-B_xn4WWe.js} +1 -1
  341. package/dist/client/assets/{use-debounced-autosave-BVXsg1Of.js → use-debounced-autosave-Dtb8gA2L.js} +1 -1
  342. package/dist/client/assets/{use-debounced-value-CPl0Wyl6.js → use-debounced-value-BAma3ogA.js} +1 -1
  343. package/dist/client/assets/{use-deco-credits-C4mVYU5r.js → use-deco-credits-BeQtkXPR.js} +1 -1
  344. package/dist/client/assets/{use-decopilot-events-SRdggwTs.js → use-decopilot-events-B0JW1Gtz.js} +1 -1
  345. package/dist/client/assets/{use-delete-block-CRyG6Do-.js → use-delete-block-CUXsAbin.js} +1 -1
  346. package/dist/client/assets/{use-delete-connection-C-kXdkQA.js → use-delete-connection-DNw4luEn.js} +1 -1
  347. package/dist/client/assets/{use-deployment-admin-Dwt-RYsg.js → use-deployment-admin-BENsmKZ2.js} +1 -1
  348. package/dist/client/assets/{use-entitlements-DgXhk8I6.js → use-entitlements-B6kax2f9.js} +1 -1
  349. package/dist/client/assets/{use-fast-preview-draft-url-DtikvUh-.js → use-fast-preview-draft-url-fo8VZAME.js} +1 -1
  350. package/dist/client/assets/{use-file-configs-BlRaUlfc.js → use-file-configs-aENtp_va.js} +1 -1
  351. package/dist/client/assets/{use-id-selection-CJdNm4ZY.js → use-id-selection-DZH3hNJe.js} +1 -1
  352. package/dist/client/assets/{use-in-settings-cNZb_oio.js → use-in-settings-jNNDWh86.js} +1 -1
  353. package/dist/client/assets/{use-inbox-feed-BKl_0o2v.js → use-inbox-feed-Axr6Wlqz.js} +1 -1
  354. package/dist/client/assets/{use-infinite-scroll-DgSz0aNh.js → use-infinite-scroll-DjPaD0kN.js} +1 -1
  355. package/dist/client/assets/{use-join-requests-pUhubFwu.js → use-join-requests-WKQMf9yH.js} +1 -1
  356. package/dist/client/assets/{use-main-panel-tabs-B0lMlgyK.js → use-main-panel-tabs-DFx6VsI6.js} +1 -1
  357. package/dist/client/assets/{use-mcp-auth-status-BLLNsVrE.js → use-mcp-auth-status-CCXu_Vmb.js} +1 -1
  358. package/dist/client/assets/{use-mcp-client-UWOU8UbZ.js → use-mcp-client-UP8_tZ9p.js} +1 -1
  359. package/dist/client/assets/{use-mcp-prompts-CjwiiUTx.js → use-mcp-prompts-BM9uSers.js} +1 -1
  360. package/dist/client/assets/{use-mcp-tools-C7Kg2Nto.js → use-mcp-tools-mA41mojn.js} +1 -1
  361. package/dist/client/assets/{use-mobile-Cq1k3-Gk.js → use-mobile-FS1bh43h.js} +1 -1
  362. package/dist/client/assets/{use-move-blocks-DH3gSdil.js → use-move-blocks-DAGy4lk4.js} +1 -1
  363. package/dist/client/assets/{use-navigate-to-agent-vJOwimSb.js → use-navigate-to-agent-Dg2qYHJi.js} +1 -1
  364. package/dist/client/assets/{use-never-published-BB5kYeS3.js → use-never-published-DDbQ0Vt8.js} +1 -1
  365. package/dist/client/assets/{use-org-fs-CAHuTLc_.js → use-org-fs-DbTl86_J.js} +1 -1
  366. package/dist/client/assets/{use-org-notice-D_lLzWXp.js → use-org-notice-D5zuQ4m5.js} +1 -1
  367. package/dist/client/assets/{use-org-repo-syncs-BxGs1Gi_.js → use-org-repo-syncs-C8jG5KSy.js} +1 -1
  368. package/dist/client/assets/{use-org-sso-fZ2uDAIp.js → use-org-sso-QMFtipA-.js} +1 -1
  369. package/dist/client/assets/{use-organization-settings-D8JbZGlQ.js → use-organization-settings-ByKdFGhE.js} +1 -1
  370. package/dist/client/assets/{use-panel-navigate-B3thngCs.js → use-panel-navigate-D4GuHOu1.js} +1 -1
  371. package/dist/client/assets/{use-project-native-view-presence-BKZJ0lpX.js → use-project-native-view-presence-BEytngua.js} +1 -1
  372. package/dist/client/assets/{use-project-scope-CD-cb4-V.js → use-project-scope-CpfOkL8I.js} +1 -1
  373. package/dist/client/assets/{use-recent-apps-Co5DoIGT.js → use-recent-apps-Dt_ZPA-N.js} +1 -1
  374. package/dist/client/assets/{use-reports-diagnostic-lGxrsSfr.js → use-reports-diagnostic-MEHXC7RY.js} +1 -1
  375. package/dist/client/assets/{use-sandbox-events-BcrE-YTF.js → use-sandbox-events-CPKES4Ee.js} +1 -1
  376. package/dist/client/assets/{use-secrets-yIZbpwIn.js → use-secrets-BGup3PHO.js} +1 -1
  377. package/dist/client/assets/{use-section-preview-base-C2vE3o4z.js → use-section-preview-base-CErD4C9a.js} +1 -1
  378. package/dist/client/assets/{use-sidebar-collapsed-Bo3tE9bK.js → use-sidebar-collapsed-9Vi_PrVo.js} +1 -1
  379. package/dist/client/assets/{use-tags-BQcMuDty.js → use-tags-CL2wnmn0.js} +1 -1
  380. package/dist/client/assets/{use-task-board-analytics-CIahrWuX.js → use-task-board-analytics-CGiNWJEU.js} +1 -1
  381. package/dist/client/assets/{use-task-board-item-prs-W9kboyPg.js → use-task-board-item-prs-Mcp2690_.js} +1 -1
  382. package/dist/client/assets/{use-task-board-items-DP6ZFnrN.js → use-task-board-items-DxcJSuMX.js} +1 -1
  383. package/dist/client/assets/{use-task-board-prompts-qQB1KZ8p.js → use-task-board-prompts-CeUQeuL1.js} +1 -1
  384. package/dist/client/assets/{use-task-metadata-C2UpEUk-.js → use-task-metadata-CG-mCqhD.js} +1 -1
  385. package/dist/client/assets/{use-thread-outputs-A3ms5KEO.js → use-thread-outputs-BRvk_pZG.js} +1 -1
  386. package/dist/client/assets/{use-view-draft-kind-CXMOqIBD.js → use-view-draft-kind-BLkqtU-Q.js} +1 -1
  387. package/dist/client/assets/{use-voice-input-poVZeRVs.js → use-voice-input-Dv1QYOod.js} +1 -1
  388. package/dist/client/assets/useInfiniteQuery-CuAeAzcr.js +1 -0
  389. package/dist/client/assets/{useQueries-DhONZGBj.js → useQueries-X3Wj3mkG.js} +1 -1
  390. package/dist/client/assets/useSuspenseInfiniteQuery-QLEux5C_.js +1 -0
  391. package/dist/client/assets/{users-B_cNHXhu.js → users-SsaEf6Es.js} +1 -1
  392. package/dist/client/assets/{utils-BdAsQahL.js → utils-Dovv0grx.js} +1 -1
  393. package/dist/client/assets/{variant-calendar-DkWaMyhm.js → variant-calendar-CtOZf_f5.js} +1 -1
  394. package/dist/client/assets/{variant-matcher-override-CxSxAvsY.js → variant-matcher-override-CdFxQaGp.js} +1 -1
  395. package/dist/client/assets/{view-header-CZchRX7c.js → view-header-ByNTN-so.js} +1 -1
  396. package/dist/client/assets/{virtual-mcp-4VHtoaO4.js → virtual-mcp-BjSK3sGG.js} +1 -1
  397. package/dist/client/assets/{watch-sse-pool-C7kLS2GY.js → watch-sse-pool-_tvuBMId.js} +1 -1
  398. package/dist/client/index.html +1 -1
  399. package/dist/server/server.js +1 -1
  400. package/package.json +1 -1
  401. package/dist/client/assets/agent-app-Ch0m8w-u.js +0 -1
  402. package/dist/client/assets/agent-deck-BEYLEOzY.js +0 -1
  403. package/dist/client/assets/agent-experiments-CIRveYjB.js +0 -1
  404. package/dist/client/assets/agent-file-CRD-Yf8v.js +0 -1
  405. package/dist/client/assets/agent-library-BDbVLVqf.js +0 -1
  406. package/dist/client/assets/agent-library-file-FdEtCyvQ.js +0 -1
  407. package/dist/client/assets/agent-overview-90jCAnhT.js +0 -1
  408. package/dist/client/assets/agent-settings-DazJIQdd.js +0 -1
  409. package/dist/client/assets/agent-site-editor-code-AxRnYsCW.js +0 -2
  410. package/dist/client/assets/agent-site-editor-content-Css28lBT.js +0 -1
  411. package/dist/client/assets/agent-site-editor-preview-rUOwwi2z.js +0 -1
  412. package/dist/client/assets/agent-view-BwA2SWmb.js +0 -1
  413. package/dist/client/assets/api-keys-7ijHuhZV.js +0 -1
  414. package/dist/client/assets/library-LpeL-fNK.js +0 -1
  415. package/dist/client/assets/project-reports-BhJG82JT.js +0 -1
  416. package/dist/client/assets/project-tasks-AXDig_Zb.js +0 -1
  417. package/dist/client/assets/record-editor-D2NFDCNZ.js +0 -1
  418. package/dist/client/assets/reports-C-kEainI.js +0 -1
  419. package/dist/client/assets/repositories-L_Jm13il.js +0 -1
  420. package/dist/client/assets/route-DjlZ9cbf.js +0 -1
  421. package/dist/client/assets/settings-tab-B50Sia1R.js +0 -1
  422. package/dist/client/assets/site-editor-B6Bvzk4_.js +0 -1
  423. package/dist/client/assets/tasks-BtIOVSMQ.js +0 -1
  424. package/dist/client/assets/use-ask-in-chat-C6eCNqgR.js +0 -1
  425. package/dist/client/assets/use-blocks-v8-project-Dh0QtV4J.js +0 -1
  426. package/dist/client/assets/use-blog-view-w4rEUATy.js +0 -1
  427. package/dist/client/assets/useInfiniteQuery-CNxlkxws.js +0 -1
  428. package/dist/client/assets/useSuspenseInfiniteQuery-FHN2hj19.js +0 -1
@@ -1 +1 @@
1
- import{c as f,a6 as h,h2 as d,j as g,N as m,ag as p,a2 as j}from"./index-BuZqAz74.js";import{L as v}from"./legacy-main-redirect-ByIcJoSw.js";import"./thread-route-Dw1cQjON.js";const x=j("/shell/$org/org-shell/");function L(){const t=f.c(19),{org:a}=h(),l=x.useSearch(),{main:i,virtualmcpid:o}=l;if(i!==void 0){let e;t[0]!==i||t[1]!==a.slug||t[2]!==l||t[3]!==o?(e=d({org:a.slug,agentId:o,main:i,search:l}),t[0]=i,t[1]=a.slug,t[2]=l,t[3]=o,t[4]=e):e=t[4];const s=e;if(s?.kind==="canonical"){let r;return t[5]!==s?(r=g.jsx(v,{target:s}),t[5]=s,t[6]=r):r=t[6],r}}let n;t[7]!==o?(n=o?.trim()||null,t[7]=o,t[8]=n):n=t[8];const u=n;if(u){let e;t[9]!==a.slug||t[10]!==u?(e={org:a.slug,agentId:u},t[9]=a.slug,t[10]=u,t[11]=e):e=t[11];let s;t[12]!==l?(s={...l,virtualmcpid:void 0},t[12]=l,t[13]=s):s=t[13];let r;return t[14]!==e||t[15]!==s?(r=g.jsx(m,{to:p.projects,params:e,search:s,hash:!0,replace:!0}),t[14]=e,t[15]=s,t[16]=r):r=t[16],r}let c;return t[17]!==a.slug?(c=g.jsx(m,{to:p.home,params:{org:a.slug},search:N,hash:!0,replace:!0}),t[17]=a.slug,t[18]=c):c=t[18],c}function N(t){return{...t,virtualmcpid:void 0}}export{L as default};
1
+ import{c as f,a6 as h,h2 as d,j as g,N as m,ag as p,a2 as j}from"./index-_VeebRNE.js";import{L as v}from"./legacy-main-redirect-MYDZoBC6.js";import"./thread-route-D_C8d7xK.js";const x=j("/shell/$org/org-shell/");function L(){const t=f.c(19),{org:a}=h(),l=x.useSearch(),{main:i,virtualmcpid:o}=l;if(i!==void 0){let e;t[0]!==i||t[1]!==a.slug||t[2]!==l||t[3]!==o?(e=d({org:a.slug,agentId:o,main:i,search:l}),t[0]=i,t[1]=a.slug,t[2]=l,t[3]=o,t[4]=e):e=t[4];const s=e;if(s?.kind==="canonical"){let r;return t[5]!==s?(r=g.jsx(v,{target:s}),t[5]=s,t[6]=r):r=t[6],r}}let n;t[7]!==o?(n=o?.trim()||null,t[7]=o,t[8]=n):n=t[8];const u=n;if(u){let e;t[9]!==a.slug||t[10]!==u?(e={org:a.slug,agentId:u},t[9]=a.slug,t[10]=u,t[11]=e):e=t[11];let s;t[12]!==l?(s={...l,virtualmcpid:void 0},t[12]=l,t[13]=s):s=t[13];let r;return t[14]!==e||t[15]!==s?(r=g.jsx(m,{to:p.projects,params:e,search:s,hash:!0,replace:!0}),t[14]=e,t[15]=s,t[16]=r):r=t[16],r}let c;return t[17]!==a.slug?(c=g.jsx(m,{to:p.home,params:{org:a.slug},search:N,hash:!0,replace:!0}),t[17]=a.slug,t[18]=c):c=t[18],c}function N(t){return{...t,virtualmcpid:void 0}}export{L as default};
@@ -1 +1 @@
1
- import{c as v,a6 as z,K as W,i as Y,m as $,j as l,b as M,B,L as V,r as w,d as K,E as L,x as X,aU as Z,w as J,v as ee,D as te}from"./index-BuZqAz74.js";import{n as se}from"./ArrowUp-DJZ55cl-.js";import{u as H,f as G,T as ne,A as ae,n as re,o as ie,b as oe,c as le,p as ce,q as ue,t as de,L as fe}from"./chat-context-DG5tQFfU.js";import{T as me,c as ge,b as xe,d as pe,H as he}from"./input-c6Cx2liY.js";import{u as je,a as ve,S as be,M as A}from"./pair-BYbJa99U.js";import{A as ye,f as Q}from"./agent-icon-DwJHakBB.js";import{n as Ne}from"./use-sandbox-events-BcrE-YTF.js";import{a as Ce}from"./agent-capabilities-Dh06TMfs.js";import{a as we}from"./repository-binding-VVfcdUiy.js";import{c as Se,i as ke}from"./thread-intent-CyH0Z8_7.js";import{a as Te}from"./use-panel-navigate-B3thngCs.js";import{N as $e}from"./index-Bld02Tnb.js";import{i as Ee}from"./ArrowRight-ZoKxZa45.js";import{d as De}from"./use-entitlements-DgXhk8I6.js";import{u as Pe}from"./use-deco-credits-C4mVYU5r.js";import{F as _e}from"./feature-paywall-DQF2iJDP.js";import{i as Ie}from"./AlertCircle-CGZfuvxJ.js";const Oe=15e3;function Me(e,t,n){const s=v.c(20),r=n===void 0?{}:n,{org:a}=z(),i=we(e);let c;s[0]!==t||s[1]!==i?.metadata||s[2]!==e?(c=!!e&&!!t&&Ce(i?.metadata),s[0]=t,s[1]=i?.metadata,s[2]=e,s[3]=c):c=s[3];const u=c;let o;s[4]!==t||s[5]!==a.slug||s[6]!==e?(o=W.chatDraftChanges(a.slug,e??"",t??""),s[4]=t,s[5]=a.slug,s[6]=e,s[7]=o):o=s[7];let d;s[8]!==t||s[9]!==a.slug||s[10]!==e?(d=()=>Ne(a.slug,e,t),s[8]=t,s[9]=a.slug,s[10]=e,s[11]=d):d=s[11];const p=r.poll===!1?!1:Oe;let g;s[12]!==u||s[13]!==o||s[14]!==d||s[15]!==p?(g={queryKey:o,queryFn:d,enabled:u,refetchInterval:p,retry:!1},s[12]=u,s[13]=o,s[14]=d,s[15]=p,s[16]=g):g=s[16];const{data:m}=Y(g),f=m===void 0?0:m,x=u?i:null;let h;return s[17]!==f||s[18]!==x?(h={project:x,changeCount:f},s[17]=f,s[18]=x,s[19]=h):h=s[19],h}function Fe(){const e=v.c(7),t=H(),n=G(),s=t?.virtualMcpId??null,r=t?.currentBranch??null,{project:a,changeCount:i}=Me(s,r);if(!a||!s||!r||i===0)return null;const c=a.icon??null,u=!!n&&(n.isRunInProgress||n.status==="streaming"||n.status==="submitted");let o;return e[0]!==r||e[1]!==i||e[2]!==a.title||e[3]!==c||e[4]!==u||e[5]!==s?(o={virtualMcpId:s,projectTitle:a.title,projectIcon:c,branch:r,changeCount:i,editing:u},e[0]=r,e[1]=i,e[2]=a.title,e[3]=c,e[4]=u,e[5]=s,e[6]=o):o=e[6],o}function Re(e){const t=v.c(24),{icon:n,title:s,subtitle:r,status:a,detail:i,action:c,className:u}=e;let o;t[0]!==u?(o=$("rounded-xl border border-border bg-card p-3",u),t[0]=u,t[1]=o):o=t[1];let d;t[2]!==n?(d=l.jsx("div",{className:"shrink-0",children:n}),t[2]=n,t[3]=d):d=t[3];let p;t[4]!==s?(p=l.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:s}),t[4]=s,t[5]=p):p=t[5];let g;t[6]!==r?(g=r&&l.jsx("p",{className:"truncate text-xs text-muted-foreground",children:r}),t[6]=r,t[7]=g):g=t[7];let m;t[8]!==p||t[9]!==g?(m=l.jsxs("div",{className:"min-w-0 flex-1",children:[p,g]}),t[8]=p,t[9]=g,t[10]=m):m=t[10];let f;t[11]!==a?(f=a&&l.jsx("span",{className:"flex shrink-0 items-center gap-1.5 text-sm text-muted-foreground",children:a}),t[11]=a,t[12]=f):f=t[12];let x;t[13]!==d||t[14]!==m||t[15]!==f?(x=l.jsxs("div",{className:"flex items-center gap-2.5",children:[d,m,f]}),t[13]=d,t[14]=m,t[15]=f,t[16]=x):x=t[16];let h;t[17]!==c||t[18]!==i?(h=(i||c)&&l.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:i}),c]}),t[17]=c,t[18]=i,t[19]=h):h=t[19];let b;return t[20]!==o||t[21]!==x||t[22]!==h?(b=l.jsxs("div",{className:o,children:[x,h]}),t[20]=o,t[21]=x,t[22]=h,t[23]=b):b=t[23],b}function ze(e){const t=v.c(10),{draft:n}=e,s=M(),r=n.editing?"animate-pulse bg-warning":"bg-success";let a;t[0]!==r?(a=$("size-1.5 rounded-full",r),t[0]=r,t[1]=a):a=t[1];let i;t[2]!==a?(i=l.jsx("span",{"aria-hidden":!0,className:a}),t[2]=a,t[3]=i):i=t[3];const c=n.editing?"chat.draft.editing":"chat.draft.ready";let u;t[4]!==s||t[5]!==c?(u=s(c),t[4]=s,t[5]=c,t[6]=u):u=t[6];let o;return t[7]!==i||t[8]!==u?(o=l.jsxs(l.Fragment,{children:[i,u]}),t[7]=i,t[8]=u,t[9]=o):o=t[9],o}function Be(e){const t=v.c(11),{draft:n}=e,s=M(),{org:r}=z(),a=H()?.taskId??null;let i;t[0]!==n.virtualMcpId||t[1]!==r.slug?(i={org:r.slug,agentId:n.virtualMcpId},t[0]=n.virtualMcpId,t[1]=r.slug,t[2]=i):i=t[2];let c;t[3]!==a?(c=a?{thread:a}:{},t[3]=a,t[4]=c):c=t[4];let u;t[5]!==s?(u=s("chat.draft.open"),t[5]=s,t[6]=u):u=t[6];let o;return t[7]!==i||t[8]!==c||t[9]!==u?(o=l.jsx(B,{variant:"outline",size:"sm",asChild:!0,children:l.jsx(V,{to:"/$org/projects/$agentId/site-editor",params:i,search:c,children:u})}),t[7]=i,t[8]=c,t[9]=u,t[10]=o):o=t[10],o}function q(){const e=v.c(20),t=M(),n=Fe();if(!n)return null;let s;e[0]!==n.projectIcon||e[1]!==n.projectTitle?(s=l.jsx(ye,{icon:n.projectIcon,name:n.projectTitle,size:"sm"}),e[0]=n.projectIcon,e[1]=n.projectTitle,e[2]=s):s=e[2];const r=n.projectTitle;let a;e[3]!==n.branch?(a=l.jsx("span",{className:"font-mono",children:n.branch}),e[3]=n.branch,e[4]=a):a=e[4];let i;e[5]!==n?(i=l.jsx(ze,{draft:n}),e[5]=n,e[6]=i):i=e[6];const c=n.changeCount===1?"chat.draft.change":"chat.draft.changes";let u;e[7]!==n.changeCount||e[8]!==t||e[9]!==c?(u=t(c,{count:n.changeCount}),e[7]=n.changeCount,e[8]=t,e[9]=c,e[10]=u):u=e[10];let o;e[11]!==n?(o=l.jsx(Be,{draft:n}),e[11]=n,e[12]=o):o=e[12];let d;return e[13]!==n.projectTitle||e[14]!==s||e[15]!==a||e[16]!==i||e[17]!==u||e[18]!==o?(d=l.jsx(Re,{className:"mx-2.5 mb-6",icon:s,title:r,subtitle:a,status:i,detail:u,action:o}),e[13]=n.projectTitle,e[14]=s,e[15]=a,e[16]=i,e[17]=u,e[18]=o,e[19]=d):d=e[19],d}function He(e){return e.parts.some(t=>t.type==="dynamic-tool"||t.type.startsWith("tool-"))}function Le(e){let t=0;for(const n of e)for(const s of n.parts??[]){const r=s;r.type==="tool-load_repo"&&r.state==="output-available"&&r.output?.success===!0&&t++}return t}function Ae(){const e=v.c(11),{openPanel:t}=Te(),n=Se(),s=G()?.messages??[],r=H(),a=r?.taskId??null,i=r?.currentBranch;let c;e[0]!==i?(c=ke(i),e[0]=i,e[1]=c):c=e[1];const u=c;let o;e[2]!==s?(o=Le(s),e[2]=s,e[3]=o):o=e[3];const d=o,p=w.useRef(null),g=w.useRef(null);let m,f;e[4]!==u||e[5]!==d||e[6]!==n||e[7]!==t||e[8]!==a?(m=()=>{if(!d||!a)return;const x=`${a}:${d}`;g.current!==x&&(g.current=x,n?.refreshThreadMetadata(a)),p.current!==a&&(p.current=a,u||t("site-editor"))},f=[d,a,t,n,u],e[4]=u,e[5]=d,e[6]=n,e[7]=t,e[8]=a,e[9]=m,e[10]=f):(m=e[9],f=e[10]),w.useEffect(m,f)}function U(e){return`deco-credits-empty-dismissed:${e}`}function pt(e){try{return localStorage.getItem(U(e))==="1"}catch{return!1}}function qe(){const e=v.c(56),t=M(),{org:n}=z(),s=De("credits"),r=K(),{decoKeyId:a}=Pe(),[i,c]=w.useState(!0);let u;e[0]!==n.id?(u=()=>{L("credits_empty_state_dismissed",{organization_id:n.id}),c(!1);try{localStorage.setItem(U(n.id),"1")}catch{}},e[0]=n.id,e[1]=u):u=e[1];const o=u;let d,p;if(e[2]!==i||e[3]!==n.id?(d=()=>{i&&L("credits_empty_state_shown",{organization_id:n.id})},p=[i,n.id],e[2]=i,e[3]=n.id,e[4]=d,e[5]=p):(d=e[4],p=e[5]),w.useEffect(d,p),!i)return null;if(!s){let k;e[6]!==t?(k=t("chat.input.allowanceExhaustedTitle"),e[6]=t,e[7]=k):k=e[7];let O;e[8]!==k?(O={title:k},e[8]=k,e[9]=O):O=e[9];let R;return e[10]!==o||e[11]!==O?(R=l.jsx(_e,{feature:"chat",copy:O,onDismiss:o}),e[10]=o,e[11]=O,e[12]=R):R=e[12],R}let g;e[13]!==o?(g=k=>!k&&o(),e[13]=o,e[14]=g):g=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=l.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"}),e[15]=m):m=e[15];let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:l.jsx(Q,{size:20,className:"text-warning"})}),e[16]=f):f=e[16];let x;e[17]!==t?(x=t("chat.creditsEmptyState.title"),e[17]=t,e[18]=x):x=e[18];let h;e[19]!==x?(h=l.jsx(X,{className:"text-lg font-semibold",children:x}),e[19]=x,e[20]=h):h=e[20];let b;e[21]!==t?(b=t("chat.creditsEmptyState.description"),e[21]=t,e[22]=b):b=e[22];let N;e[23]!==b?(N=l.jsx(Z,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:b}),e[23]=b,e[24]=N):N=e[24];let C;e[25]!==h||e[26]!==N?(C=l.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[m,l.jsxs(J,{className:"relative gap-3",children:[f,l.jsxs("div",{className:"text-center",children:[h,N]})]})]}),e[25]=h,e[26]=N,e[27]=C):C=e[27];let y;e[28]!==a||e[29]!==o?(y=a&&l.jsx("div",{className:"px-6 pb-5",children:l.jsx(me,{source:"empty_state",onDone:o})}),e[28]=a,e[29]=o,e[30]=y):y=e[30];let S;e[31]!==o||e[32]!==r||e[33]!==n.slug?(S=()=>{r({to:"/$org/settings/ai-providers",params:{org:n.slug}}),o()},e[31]=o,e[32]=r,e[33]=n.slug,e[34]=S):S=e[34];let j;e[35]!==t?(j=t("chat.creditsEmptyState.useYourOwnProvider"),e[35]=t,e[36]=j):j=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsx(Ee,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),e[37]=T):T=e[37];let E;e[38]!==S||e[39]!==j?(E=l.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:S,children:[j,T]}),e[38]=S,e[39]=j,e[40]=E):E=e[40];let D;e[41]!==t?(D=t("chat.creditsEmptyState.skipForNow"),e[41]=t,e[42]=D):D=e[42];let P;e[43]!==o||e[44]!==D?(P=l.jsx(B,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:o,children:D}),e[43]=o,e[44]=D,e[45]=P):P=e[45];let _;e[46]!==E||e[47]!==P?(_=l.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[E,P]}),e[46]=E,e[47]=P,e[48]=_):_=e[48];let I;e[49]!==C||e[50]!==y||e[51]!==_?(I=l.jsxs(ee,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ke,children:[C,y,_]}),e[49]=C,e[50]=y,e[51]=_,e[52]=I):I=e[52];let F;return e[53]!==I||e[54]!==g?(F=l.jsx(te,{open:!0,onOpenChange:g,children:I}),e[53]=I,e[54]=g,e[55]=F):F=e[55],F}function Ke(e){return e.preventDefault()}function Ge(e){const t=v.c(6),{balanceDollars:n}=e;let s;t[0]!==n?(s=n.toFixed(2),t[0]=n,t[1]=s):s=t[1];const r=s;let a,i;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=$("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"),i=l.jsx(Q,{size:13,className:"text-success"}),t[2]=a,t[3]=i):(a=t[2],i=t[3]);let c;return t[4]!==r?(c=l.jsxs("div",{className:a,children:[i,l.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",r," in credits to get started"]})]}),t[4]=r,t[5]=c):c=t[5],c}function Qe(){const e=v.c(8),{org:t}=z(),n=K();let s;e[0]!==n||e[1]!==t.slug?(s=()=>n({to:"/$org/settings/ai-providers",params:{org:t.slug}}),e[0]=n,e[1]=t.slug,e[2]=s):s=e[2];let r,a,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=$("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=l.jsx(Ie,{size:13,className:"text-warning"}),i=l.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),e[3]=r,e[4]=a,e[5]=i):(r=e[3],a=e[4],i=e[5]);let c;return e[6]!==s?(c=l.jsxs("button",{type:"button",onClick:s,className:r,children:[a,i]}),e[6]=s,e[7]=c):c=e[7],c}function Ue(e){const t=v.c(7),{scrollRef:n,sentinelRef:s,hasMoreOlder:r,isFetchingOlder:a,fetchOlderMessages:i}=e;let c,u;t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==s?(c=()=>{const o=s.current,d=n.current;if(!o||!d||!r)return;const p=new IntersectionObserver(async g=>{if(!g[0]?.isIntersecting||a||!r)return;const f=d.scrollHeight,x=d.scrollTop;await i(),requestAnimationFrame(()=>{const h=d.scrollHeight;d.scrollTop=x+(h-f)})},{root:d,rootMargin:"200px 0px 0px 0px"});return p.observe(o),()=>p.disconnect()},u=[n,s,r,a,i],t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=s,t[5]=c,t[6]=u):(c=t[5],u=t[6]),w.useEffect(c,u)}function We(e){const t=v.c(5),{className:n,children:s}=e;let r;t[0]!==n?(r=$("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",n),t[0]=n,t[1]=r):r=t[1];let a;return t[2]!==s||t[3]!==r?(a=l.jsx("div",{className:r,children:s}),t[2]=s,t[3]=r,t[4]=a):a=t[4],a}function Ye(e){const t=v.c(5),{children:n,className:s}=e;let r;t[0]!==s?(r=$("flex-1 min-h-0 overflow-y-auto isolate",s),t[0]=s,t[1]=r):r=t[1];let a;return t[2]!==n||t[3]!==r?(a=l.jsx("div",{className:r,children:n}),t[2]=n,t[3]=r,t[4]=a):a=t[4],a}function Ve(e){const t=v.c(2),{children:n}=e;let s;return t[0]!==n?(s=l.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:n}),t[0]=n,t[1]=s):s=t[1],s}function Xe(){const e=M(),{messages:t,status:n,hasMoreOlder:s,isFetchingOlder:r,fetchOlderMessages:a,isRunInProgress:i}=oe(),{taskId:c}=le();Ae();const u=ce(c??""),o=ue(u),d=o.size===0?t:t.filter(j=>!o.has(j.id)),p=de(d,n==="submitted"||n==="streaming"||i),g=p.visible,m=je(g),f=m.at(-1),x=m.findIndex(j=>!!j.assistant&&He(j.assistant)),b=pe()*he+16,N=w.useRef(null),C=w.useRef(null);Ue({scrollRef:N,sentinelRef:C,hasMoreOlder:s,isFetchingOlder:r,fetchOlderMessages:a});const y=ve({initial:!1}),S=j=>{N.current=j,y.scrollRef(j)};return l.jsx(fe.Provider,{value:p,children:l.jsx(be,{messages:t,children:l.jsxs("div",{className:"relative h-full w-full min-w-0",children:[l.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:l.jsxs("div",{ref:y.contentRef,className:"overflow-x-clip",children:[l.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),r&&l.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:e("chat.chat.loadingOlderMessages")}),m.slice(0,-1).map((j,T)=>l.jsxs(w.Fragment,{children:[l.jsx(A,{pair:j,isLastPair:!1,status:T===m.length-1?n:void 0}),T===x&&l.jsx(q,{})]},`pair-${j.user?.id??j.assistant?.id}`))]}),f&&l.jsxs("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx(A,{pair:f,isLastPair:!0,status:n},`pair-${f.user?.id??f.assistant?.id}`),x===m.length-1&&l.jsx(q,{})]})]})}),!y.isAtBottom&&l.jsx(B,{type:"button",variant:"outline",size:"icon-sm","aria-label":e("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{y.scrollToBottom()},children:l.jsx(se,{size:14})})]})})})}function Ze(e){const t=v.c(5),{children:n,className:s}=e;let r;t[0]!==s?(r=$("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",s),t[0]=s,t[1]=r):r=t[1];let a;return t[2]!==n||t[3]!==r?(a=l.jsx("div",{className:r,children:n}),t[2]=n,t[3]=r,t[4]=a):a=t[4],a}const ht=Object.assign(We,{Main:Ye,Messages:Xe,EmptyState:Ve,Footer:Ze,Input:xe,Provider:ie,StreamHost:re,ActiveTaskStreamSource:ae,ThreadlessStreamSource:ne,NoAiProviderEmptyState:$e,CreditsEmptyState:qe,CreditsEyebrow:Ge,NoCreditsEyebrow:Qe,CreditsExhaustedBanner:ge});export{ht as C,Me as u,pt as w};
1
+ import{c as v,a6 as z,K as W,i as Y,m as $,j as l,b as M,B,L as V,r as w,d as K,E as L,x as X,aU as Z,w as J,v as ee,D as te}from"./index-_VeebRNE.js";import{n as se}from"./ArrowUp-DYnF34lU.js";import{u as H,f as G,T as ne,A as ae,n as re,o as ie,b as oe,c as le,p as ce,q as ue,t as de,L as fe}from"./chat-context-DSu9o-d-.js";import{T as me,c as ge,b as xe,d as pe,H as he}from"./input-DAVLPdNO.js";import{u as je,a as ve,S as be,M as A}from"./pair-CHh11R95.js";import{A as ye,f as Q}from"./agent-icon-CfdcYUE7.js";import{n as Ne}from"./use-sandbox-events-CPKES4Ee.js";import{a as Ce}from"./agent-capabilities-g1Ym1ZNZ.js";import{a as we}from"./repository-binding-Ct6tvS6k.js";import{c as Se,i as ke}from"./thread-intent-pC76uPwU.js";import{a as Te}from"./use-panel-navigate-D4GuHOu1.js";import{N as $e}from"./index-QCTvcBUO.js";import{i as Ee}from"./ArrowRight-BF8V67fk.js";import{d as De}from"./use-entitlements-B6kax2f9.js";import{u as Pe}from"./use-deco-credits-BeQtkXPR.js";import{F as _e}from"./feature-paywall-DLrDt0zj.js";import{i as Ie}from"./AlertCircle-gyZP8TIO.js";const Oe=15e3;function Me(e,t,n){const s=v.c(20),r=n===void 0?{}:n,{org:a}=z(),i=we(e);let c;s[0]!==t||s[1]!==i?.metadata||s[2]!==e?(c=!!e&&!!t&&Ce(i?.metadata),s[0]=t,s[1]=i?.metadata,s[2]=e,s[3]=c):c=s[3];const u=c;let o;s[4]!==t||s[5]!==a.slug||s[6]!==e?(o=W.chatDraftChanges(a.slug,e??"",t??""),s[4]=t,s[5]=a.slug,s[6]=e,s[7]=o):o=s[7];let d;s[8]!==t||s[9]!==a.slug||s[10]!==e?(d=()=>Ne(a.slug,e,t),s[8]=t,s[9]=a.slug,s[10]=e,s[11]=d):d=s[11];const p=r.poll===!1?!1:Oe;let g;s[12]!==u||s[13]!==o||s[14]!==d||s[15]!==p?(g={queryKey:o,queryFn:d,enabled:u,refetchInterval:p,retry:!1},s[12]=u,s[13]=o,s[14]=d,s[15]=p,s[16]=g):g=s[16];const{data:m}=Y(g),f=m===void 0?0:m,x=u?i:null;let h;return s[17]!==f||s[18]!==x?(h={project:x,changeCount:f},s[17]=f,s[18]=x,s[19]=h):h=s[19],h}function Fe(){const e=v.c(7),t=H(),n=G(),s=t?.virtualMcpId??null,r=t?.currentBranch??null,{project:a,changeCount:i}=Me(s,r);if(!a||!s||!r||i===0)return null;const c=a.icon??null,u=!!n&&(n.isRunInProgress||n.status==="streaming"||n.status==="submitted");let o;return e[0]!==r||e[1]!==i||e[2]!==a.title||e[3]!==c||e[4]!==u||e[5]!==s?(o={virtualMcpId:s,projectTitle:a.title,projectIcon:c,branch:r,changeCount:i,editing:u},e[0]=r,e[1]=i,e[2]=a.title,e[3]=c,e[4]=u,e[5]=s,e[6]=o):o=e[6],o}function Re(e){const t=v.c(24),{icon:n,title:s,subtitle:r,status:a,detail:i,action:c,className:u}=e;let o;t[0]!==u?(o=$("rounded-xl border border-border bg-card p-3",u),t[0]=u,t[1]=o):o=t[1];let d;t[2]!==n?(d=l.jsx("div",{className:"shrink-0",children:n}),t[2]=n,t[3]=d):d=t[3];let p;t[4]!==s?(p=l.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:s}),t[4]=s,t[5]=p):p=t[5];let g;t[6]!==r?(g=r&&l.jsx("p",{className:"truncate text-xs text-muted-foreground",children:r}),t[6]=r,t[7]=g):g=t[7];let m;t[8]!==p||t[9]!==g?(m=l.jsxs("div",{className:"min-w-0 flex-1",children:[p,g]}),t[8]=p,t[9]=g,t[10]=m):m=t[10];let f;t[11]!==a?(f=a&&l.jsx("span",{className:"flex shrink-0 items-center gap-1.5 text-sm text-muted-foreground",children:a}),t[11]=a,t[12]=f):f=t[12];let x;t[13]!==d||t[14]!==m||t[15]!==f?(x=l.jsxs("div",{className:"flex items-center gap-2.5",children:[d,m,f]}),t[13]=d,t[14]=m,t[15]=f,t[16]=x):x=t[16];let h;t[17]!==c||t[18]!==i?(h=(i||c)&&l.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:i}),c]}),t[17]=c,t[18]=i,t[19]=h):h=t[19];let b;return t[20]!==o||t[21]!==x||t[22]!==h?(b=l.jsxs("div",{className:o,children:[x,h]}),t[20]=o,t[21]=x,t[22]=h,t[23]=b):b=t[23],b}function ze(e){const t=v.c(10),{draft:n}=e,s=M(),r=n.editing?"animate-pulse bg-warning":"bg-success";let a;t[0]!==r?(a=$("size-1.5 rounded-full",r),t[0]=r,t[1]=a):a=t[1];let i;t[2]!==a?(i=l.jsx("span",{"aria-hidden":!0,className:a}),t[2]=a,t[3]=i):i=t[3];const c=n.editing?"chat.draft.editing":"chat.draft.ready";let u;t[4]!==s||t[5]!==c?(u=s(c),t[4]=s,t[5]=c,t[6]=u):u=t[6];let o;return t[7]!==i||t[8]!==u?(o=l.jsxs(l.Fragment,{children:[i,u]}),t[7]=i,t[8]=u,t[9]=o):o=t[9],o}function Be(e){const t=v.c(11),{draft:n}=e,s=M(),{org:r}=z(),a=H()?.taskId??null;let i;t[0]!==n.virtualMcpId||t[1]!==r.slug?(i={org:r.slug,agentId:n.virtualMcpId},t[0]=n.virtualMcpId,t[1]=r.slug,t[2]=i):i=t[2];let c;t[3]!==a?(c=a?{thread:a}:{},t[3]=a,t[4]=c):c=t[4];let u;t[5]!==s?(u=s("chat.draft.open"),t[5]=s,t[6]=u):u=t[6];let o;return t[7]!==i||t[8]!==c||t[9]!==u?(o=l.jsx(B,{variant:"outline",size:"sm",asChild:!0,children:l.jsx(V,{to:"/$org/projects/$agentId/site-editor",params:i,search:c,children:u})}),t[7]=i,t[8]=c,t[9]=u,t[10]=o):o=t[10],o}function q(){const e=v.c(20),t=M(),n=Fe();if(!n)return null;let s;e[0]!==n.projectIcon||e[1]!==n.projectTitle?(s=l.jsx(ye,{icon:n.projectIcon,name:n.projectTitle,size:"sm"}),e[0]=n.projectIcon,e[1]=n.projectTitle,e[2]=s):s=e[2];const r=n.projectTitle;let a;e[3]!==n.branch?(a=l.jsx("span",{className:"font-mono",children:n.branch}),e[3]=n.branch,e[4]=a):a=e[4];let i;e[5]!==n?(i=l.jsx(ze,{draft:n}),e[5]=n,e[6]=i):i=e[6];const c=n.changeCount===1?"chat.draft.change":"chat.draft.changes";let u;e[7]!==n.changeCount||e[8]!==t||e[9]!==c?(u=t(c,{count:n.changeCount}),e[7]=n.changeCount,e[8]=t,e[9]=c,e[10]=u):u=e[10];let o;e[11]!==n?(o=l.jsx(Be,{draft:n}),e[11]=n,e[12]=o):o=e[12];let d;return e[13]!==n.projectTitle||e[14]!==s||e[15]!==a||e[16]!==i||e[17]!==u||e[18]!==o?(d=l.jsx(Re,{className:"mx-2.5 mb-6",icon:s,title:r,subtitle:a,status:i,detail:u,action:o}),e[13]=n.projectTitle,e[14]=s,e[15]=a,e[16]=i,e[17]=u,e[18]=o,e[19]=d):d=e[19],d}function He(e){return e.parts.some(t=>t.type==="dynamic-tool"||t.type.startsWith("tool-"))}function Le(e){let t=0;for(const n of e)for(const s of n.parts??[]){const r=s;r.type==="tool-load_repo"&&r.state==="output-available"&&r.output?.success===!0&&t++}return t}function Ae(){const e=v.c(11),{openPanel:t}=Te(),n=Se(),s=G()?.messages??[],r=H(),a=r?.taskId??null,i=r?.currentBranch;let c;e[0]!==i?(c=ke(i),e[0]=i,e[1]=c):c=e[1];const u=c;let o;e[2]!==s?(o=Le(s),e[2]=s,e[3]=o):o=e[3];const d=o,p=w.useRef(null),g=w.useRef(null);let m,f;e[4]!==u||e[5]!==d||e[6]!==n||e[7]!==t||e[8]!==a?(m=()=>{if(!d||!a)return;const x=`${a}:${d}`;g.current!==x&&(g.current=x,n?.refreshThreadMetadata(a)),p.current!==a&&(p.current=a,u||t("site-editor"))},f=[d,a,t,n,u],e[4]=u,e[5]=d,e[6]=n,e[7]=t,e[8]=a,e[9]=m,e[10]=f):(m=e[9],f=e[10]),w.useEffect(m,f)}function U(e){return`deco-credits-empty-dismissed:${e}`}function pt(e){try{return localStorage.getItem(U(e))==="1"}catch{return!1}}function qe(){const e=v.c(56),t=M(),{org:n}=z(),s=De("credits"),r=K(),{decoKeyId:a}=Pe(),[i,c]=w.useState(!0);let u;e[0]!==n.id?(u=()=>{L("credits_empty_state_dismissed",{organization_id:n.id}),c(!1);try{localStorage.setItem(U(n.id),"1")}catch{}},e[0]=n.id,e[1]=u):u=e[1];const o=u;let d,p;if(e[2]!==i||e[3]!==n.id?(d=()=>{i&&L("credits_empty_state_shown",{organization_id:n.id})},p=[i,n.id],e[2]=i,e[3]=n.id,e[4]=d,e[5]=p):(d=e[4],p=e[5]),w.useEffect(d,p),!i)return null;if(!s){let k;e[6]!==t?(k=t("chat.input.allowanceExhaustedTitle"),e[6]=t,e[7]=k):k=e[7];let O;e[8]!==k?(O={title:k},e[8]=k,e[9]=O):O=e[9];let R;return e[10]!==o||e[11]!==O?(R=l.jsx(_e,{feature:"chat",copy:O,onDismiss:o}),e[10]=o,e[11]=O,e[12]=R):R=e[12],R}let g;e[13]!==o?(g=k=>!k&&o(),e[13]=o,e[14]=g):g=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=l.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"}),e[15]=m):m=e[15];let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:l.jsx(Q,{size:20,className:"text-warning"})}),e[16]=f):f=e[16];let x;e[17]!==t?(x=t("chat.creditsEmptyState.title"),e[17]=t,e[18]=x):x=e[18];let h;e[19]!==x?(h=l.jsx(X,{className:"text-lg font-semibold",children:x}),e[19]=x,e[20]=h):h=e[20];let b;e[21]!==t?(b=t("chat.creditsEmptyState.description"),e[21]=t,e[22]=b):b=e[22];let N;e[23]!==b?(N=l.jsx(Z,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:b}),e[23]=b,e[24]=N):N=e[24];let C;e[25]!==h||e[26]!==N?(C=l.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[m,l.jsxs(J,{className:"relative gap-3",children:[f,l.jsxs("div",{className:"text-center",children:[h,N]})]})]}),e[25]=h,e[26]=N,e[27]=C):C=e[27];let y;e[28]!==a||e[29]!==o?(y=a&&l.jsx("div",{className:"px-6 pb-5",children:l.jsx(me,{source:"empty_state",onDone:o})}),e[28]=a,e[29]=o,e[30]=y):y=e[30];let S;e[31]!==o||e[32]!==r||e[33]!==n.slug?(S=()=>{r({to:"/$org/settings/ai-providers",params:{org:n.slug}}),o()},e[31]=o,e[32]=r,e[33]=n.slug,e[34]=S):S=e[34];let j;e[35]!==t?(j=t("chat.creditsEmptyState.useYourOwnProvider"),e[35]=t,e[36]=j):j=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsx(Ee,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),e[37]=T):T=e[37];let E;e[38]!==S||e[39]!==j?(E=l.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:S,children:[j,T]}),e[38]=S,e[39]=j,e[40]=E):E=e[40];let D;e[41]!==t?(D=t("chat.creditsEmptyState.skipForNow"),e[41]=t,e[42]=D):D=e[42];let P;e[43]!==o||e[44]!==D?(P=l.jsx(B,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:o,children:D}),e[43]=o,e[44]=D,e[45]=P):P=e[45];let _;e[46]!==E||e[47]!==P?(_=l.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[E,P]}),e[46]=E,e[47]=P,e[48]=_):_=e[48];let I;e[49]!==C||e[50]!==y||e[51]!==_?(I=l.jsxs(ee,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ke,children:[C,y,_]}),e[49]=C,e[50]=y,e[51]=_,e[52]=I):I=e[52];let F;return e[53]!==I||e[54]!==g?(F=l.jsx(te,{open:!0,onOpenChange:g,children:I}),e[53]=I,e[54]=g,e[55]=F):F=e[55],F}function Ke(e){return e.preventDefault()}function Ge(e){const t=v.c(6),{balanceDollars:n}=e;let s;t[0]!==n?(s=n.toFixed(2),t[0]=n,t[1]=s):s=t[1];const r=s;let a,i;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=$("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"),i=l.jsx(Q,{size:13,className:"text-success"}),t[2]=a,t[3]=i):(a=t[2],i=t[3]);let c;return t[4]!==r?(c=l.jsxs("div",{className:a,children:[i,l.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",r," in credits to get started"]})]}),t[4]=r,t[5]=c):c=t[5],c}function Qe(){const e=v.c(8),{org:t}=z(),n=K();let s;e[0]!==n||e[1]!==t.slug?(s=()=>n({to:"/$org/settings/ai-providers",params:{org:t.slug}}),e[0]=n,e[1]=t.slug,e[2]=s):s=e[2];let r,a,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=$("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=l.jsx(Ie,{size:13,className:"text-warning"}),i=l.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),e[3]=r,e[4]=a,e[5]=i):(r=e[3],a=e[4],i=e[5]);let c;return e[6]!==s?(c=l.jsxs("button",{type:"button",onClick:s,className:r,children:[a,i]}),e[6]=s,e[7]=c):c=e[7],c}function Ue(e){const t=v.c(7),{scrollRef:n,sentinelRef:s,hasMoreOlder:r,isFetchingOlder:a,fetchOlderMessages:i}=e;let c,u;t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==s?(c=()=>{const o=s.current,d=n.current;if(!o||!d||!r)return;const p=new IntersectionObserver(async g=>{if(!g[0]?.isIntersecting||a||!r)return;const f=d.scrollHeight,x=d.scrollTop;await i(),requestAnimationFrame(()=>{const h=d.scrollHeight;d.scrollTop=x+(h-f)})},{root:d,rootMargin:"200px 0px 0px 0px"});return p.observe(o),()=>p.disconnect()},u=[n,s,r,a,i],t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=s,t[5]=c,t[6]=u):(c=t[5],u=t[6]),w.useEffect(c,u)}function We(e){const t=v.c(5),{className:n,children:s}=e;let r;t[0]!==n?(r=$("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",n),t[0]=n,t[1]=r):r=t[1];let a;return t[2]!==s||t[3]!==r?(a=l.jsx("div",{className:r,children:s}),t[2]=s,t[3]=r,t[4]=a):a=t[4],a}function Ye(e){const t=v.c(5),{children:n,className:s}=e;let r;t[0]!==s?(r=$("flex-1 min-h-0 overflow-y-auto isolate",s),t[0]=s,t[1]=r):r=t[1];let a;return t[2]!==n||t[3]!==r?(a=l.jsx("div",{className:r,children:n}),t[2]=n,t[3]=r,t[4]=a):a=t[4],a}function Ve(e){const t=v.c(2),{children:n}=e;let s;return t[0]!==n?(s=l.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:n}),t[0]=n,t[1]=s):s=t[1],s}function Xe(){const e=M(),{messages:t,status:n,hasMoreOlder:s,isFetchingOlder:r,fetchOlderMessages:a,isRunInProgress:i}=oe(),{taskId:c}=le();Ae();const u=ce(c??""),o=ue(u),d=o.size===0?t:t.filter(j=>!o.has(j.id)),p=de(d,n==="submitted"||n==="streaming"||i),g=p.visible,m=je(g),f=m.at(-1),x=m.findIndex(j=>!!j.assistant&&He(j.assistant)),b=pe()*he+16,N=w.useRef(null),C=w.useRef(null);Ue({scrollRef:N,sentinelRef:C,hasMoreOlder:s,isFetchingOlder:r,fetchOlderMessages:a});const y=ve({initial:!1}),S=j=>{N.current=j,y.scrollRef(j)};return l.jsx(fe.Provider,{value:p,children:l.jsx(be,{messages:t,children:l.jsxs("div",{className:"relative h-full w-full min-w-0",children:[l.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:l.jsxs("div",{ref:y.contentRef,className:"overflow-x-clip",children:[l.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),r&&l.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:e("chat.chat.loadingOlderMessages")}),m.slice(0,-1).map((j,T)=>l.jsxs(w.Fragment,{children:[l.jsx(A,{pair:j,isLastPair:!1,status:T===m.length-1?n:void 0}),T===x&&l.jsx(q,{})]},`pair-${j.user?.id??j.assistant?.id}`))]}),f&&l.jsxs("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:[l.jsx(A,{pair:f,isLastPair:!0,status:n},`pair-${f.user?.id??f.assistant?.id}`),x===m.length-1&&l.jsx(q,{})]})]})}),!y.isAtBottom&&l.jsx(B,{type:"button",variant:"outline",size:"icon-sm","aria-label":e("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{y.scrollToBottom()},children:l.jsx(se,{size:14})})]})})})}function Ze(e){const t=v.c(5),{children:n,className:s}=e;let r;t[0]!==s?(r=$("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",s),t[0]=s,t[1]=r):r=t[1];let a;return t[2]!==n||t[3]!==r?(a=l.jsx("div",{className:r,children:n}),t[2]=n,t[3]=r,t[4]=a):a=t[4],a}const ht=Object.assign(We,{Main:Ye,Messages:Xe,EmptyState:Ve,Footer:Ze,Input:xe,Provider:ie,StreamHost:re,ActiveTaskStreamSource:ae,ThreadlessStreamSource:ne,NoAiProviderEmptyState:$e,CreditsEmptyState:qe,CreditsEyebrow:Ge,NoCreditsEyebrow:Qe,CreditsExhaustedBanner:ge});export{ht as C,Me as u,pt as w};
@@ -1 +1 @@
1
- import{c as I,b as X,r as $,m as B,j as s,a6 as Ee,e as nt,t as je,D as it,v as lt,w as ot,x as at,y as ct,B as Fe,aw as dt,Y as ke,a7 as ut,E as H,X as ft,Z as mt,_ as ht,d as pt,aD as gt,l as bt,H as xt,at as $e,L as Ye,$ as jt,av as Ge,aE as vt,P as yt}from"./index-BuZqAz74.js";import{u as Ie,c as Ze,g as St,h as wt,i as Ct}from"./use-sidebar-collapsed-Bo3tE9bK.js";import{S as _t,a as kt,b as Ot}from"./sheet-Lq2qXLx8.js";import{u as Et}from"./use-mobile-Cq1k3-Gk.js";import{u as Rt,a as zt,D as Dt,c as Nt,C as Tt,P as Lt}from"./task-key-DaPOId6s.js";import{S as Pt,v as At,u as Mt}from"./sortable.esm-n9zdQXyB.js";import{i as $t}from"./Tool01-BeDQSGiN.js";import{t as It,r as Kt,u as Ft,v as Ut,A as Wt,w as Ue}from"./agent-icon-DwJHakBB.js";import{s as Bt}from"./Plus--DcN-eh1.js";import{i as Ht}from"./UserSquare-Dn1UPzSD.js";import{a as Xt}from"./UserCheck01-BMoOFYIZ.js";import{s as qe}from"./XClose-C4MsAn9v.js";import{T as ge,a as be,c as xe}from"./tooltip-DnGqcvtu.js";import{C as Pe,f as Yt,g as Gt,e as Zt}from"./context-menu-BgKzmvfA.js";import{a as qt,O as Ve,w as Vt,b as Jt,c as Qt,E as es,r as Oe,d as ts,e as ss,h as rs,t as ns,f as Je,m as is,o as ls}from"./use-org-notice-D_lLzWXp.js";import{C as os}from"./create-organization-dialog-BeGGdtfc.js";import{P as as}from"./project-apps-Dezyz6_N.js";import{u as cs,a as ds}from"./use-recent-apps-Co5DoIGT.js";import{a as us}from"./use-navigate-to-agent-vJOwimSb.js";import{a as fs,u as ms}from"./use-project-scope-CD-cb4-V.js";import{C as We,a as hs,b as ps,c as gs,d as bs}from"./command-DHGFzOhP.js";import{u as xs}from"./use-debounced-value-CPl0Wyl6.js";import{n as js}from"./BookOpen01-gO5hgFUK.js";import{F as vs,a as Ae,b as ys,c as Qe}from"./feedback-BqoIMOg7.js";import{T as Ss}from"./textarea-CcO-rfag.js";import{a as ws}from"./thread-button-DbVaWztE.js";function Cs(t){const e=I.c(48),{open:n,onOpenChange:r,orgs:i,currentSlug:c,onSelect:l}=t,d=X(),[o,f]=$.useState("");let b;e[0]!==o?(b=o.trim(),e[0]=o,e[1]=b):b=e[1];const h=b,p=xs(h,150),m=h.length>0,u=p===h,{hits:v,isSearching:j,isStale:C,isError:w}=qt(m?p:""),a=m?v:i;let x;e[2]!==r?(x=L=>{r(L),L||f("")},e[2]=r,e[3]=x):x=e[3];const g=x;let y;e[4]!==d?(y=d("sidebar.rail.searchOrganizations"),e[4]=d,e[5]=y):y=e[5];let S;e[6]!==d?(S=d("sidebar.rail.searchPlaceholder"),e[6]=d,e[7]=S):S=e[7];let k;e[8]!==d?(k=d("sidebar.rail.searchPlaceholder"),e[8]=d,e[9]=k):k=e[9];let _;e[10]!==o||e[11]!==k?(_=s.jsx(hs,{value:o,onValueChange:f,placeholder:k}),e[10]=o,e[11]=k,e[12]=_):_=e[12];const T=m&&(C||!u)&&"opacity-50";let R;e[13]!==T?(R=B(T),e[13]=T,e[14]=R):R=e[14];let O;e[15]!==w||e[16]!==m||e[17]!==d?(O=m&&w&&s.jsx(We,{children:d("sidebar.rail.searchFailed")}),e[15]=w,e[16]=m,e[17]=d,e[18]=O):O=e[18];let z;e[19]!==w||e[20]!==j||e[21]!==a.length||e[22]!==u||e[23]!==d?(z=!w&&u&&!j&&a.length===0&&s.jsx(We,{children:d("sidebar.rail.searchEmpty")}),e[19]=w,e[20]=j,e[21]=a.length,e[22]=u,e[23]=d,e[24]=z):z=e[24];let D;if(e[25]!==c||e[26]!==l||e[27]!==g||e[28]!==a||e[29]!==d){let L;e[31]!==c||e[32]!==l||e[33]!==g||e[34]!==d?(L=P=>s.jsxs(ps,{value:P.slug,onSelect:()=>{g(!1),P.slug!==c&&l(P.slug)},className:"gap-2.5",children:[s.jsx(Ve,{org:P,size:"sm"}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.name}),P.slug===c&&s.jsx("span",{className:"text-meta shrink-0",children:d("sidebar.rail.currentOrganization")})]},P.id),e[31]=c,e[32]=l,e[33]=g,e[34]=d,e[35]=L):L=e[35],D=a.map(L),e[25]=c,e[26]=l,e[27]=g,e[28]=a,e[29]=d,e[30]=D}else D=e[30];let E;e[36]!==z||e[37]!==D||e[38]!==R||e[39]!==O?(E=s.jsxs(gs,{className:R,children:[O,z,D]}),e[36]=z,e[37]=D,e[38]=R,e[39]=O,e[40]=E):E=e[40];let A;return e[41]!==n||e[42]!==g||e[43]!==E||e[44]!==y||e[45]!==S||e[46]!==_?(A=s.jsxs(bs,{open:n,onOpenChange:g,title:y,description:S,shouldFilter:!1,children:[_,E]}),e[41]=n,e[42]=g,e[43]=E,e[44]=y,e[45]=S,e[46]=_,e[47]=A):A=e[47],A}function _s(t){const e=I.c(4),{size:n,className:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{d:"M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.028C.533 9.046-.32 13.58.099 18.058a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.042-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .078-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .079.009c.12.099.246.198.373.292a.077.077 0 0 1-.007.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.029 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.055c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.029ZM8.02 15.331c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.956 2.418-2.157 2.418Zm7.975 0c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.946 2.418-2.157 2.418Z"}),e[0]=i):i=e[0];let c;return e[1]!==r||e[2]!==n?(c=s.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:r,children:i}),e[1]=r,e[2]=n,e[3]=c):c=e[3],c}const ks=250;function Os(){return typeof navigator<"u"&&!!navigator.mediaDevices?.getDisplayMedia}function Be(t,e,n){return new Promise(r=>t.toBlob(r,e,n))}async function Es(){const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include"});try{const e=document.createElement("video");e.muted=!0,e.srcObject=t,await e.play(),await new Promise(c=>setTimeout(c,ks));const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight,n.getContext("2d")?.drawImage(e,0,0),e.srcObject=null;let r=await Be(n,"image/png");if((!r||r.size>Qe)&&(r=await Be(n,"image/jpeg",.85)),!r)throw new Error("Could not encode the screenshot");const i=r.type==="image/png"?"png":"jpg";return new File([r],`screenshot.${i}`,{type:r.type})}finally{for(const e of t.getTracks())e.stop()}}function He({kind:t,open:e,onOpenChange:n}){const r=X(),i=t==="problem"?{title:r("sidebar.problem.title"),placeholder:r("sidebar.problem.placeholder"),sent:r("sidebar.problem.sent"),failed:r("sidebar.problem.failed")}:{title:r("sidebar.feedback.title"),placeholder:r("sidebar.feedback.placeholder"),sent:r("sidebar.feedback.sent"),failed:r("sidebar.feedback.failed")},{org:c}=Ee(),[l,d]=$.useState(""),[o,f]=$.useState([]),[b,h]=$.useState(!1),p=()=>{for(const a of o)URL.revokeObjectURL(a.previewUrl);f([]),d("")},m=a=>{const x=a.filter(S=>ys.includes(S.type)?S.size>Qe?(je.error(r("sidebar.feedback.screenshotTooLarge")),!1):!0:!1),g=Ae-o.length;x.length>g&&je.error(r("sidebar.feedback.tooManyScreenshots",{max:String(Ae)}));const y=x.slice(0,Math.max(g,0)).map(S=>({file:S,previewUrl:URL.createObjectURL(S)}));y.length>0&&f(S=>[...S,...y])},u=a=>{URL.revokeObjectURL(a.previewUrl),f(x=>x.filter(g=>g!==a))},v=async()=>{h(!0);try{m([await Es()])}catch(a){a instanceof DOMException&&a.name==="NotAllowedError"||(console.error("[feedback] screenshot failed",a),je.error(r("sidebar.feedback.screenshotFailed")))}finally{h(!1)}},j=a=>{const x=Array.from(a.clipboardData.files).filter(g=>g.type.startsWith("image/"));x.length!==0&&(a.preventDefault(),m(x))},C=nt({mutationFn:async()=>{const a=new FormData;a.set("kind",t),a.set("message",l.trim()),a.set("pageUrl",window.location.href);for(const g of o)a.append("screenshot",g.file);const x=await fetch(`/api/${encodeURIComponent(c.slug)}/feedback`,{method:"POST",body:a});if(!x.ok)throw new Error(`Feedback failed: ${x.status}`)},onSuccess:()=>{je.success(i.sent),p(),n(!1)},onError:()=>je.error(i.failed)}),w=l.trim().length>0&&!C.isPending;return s.jsx(it,{open:e&&!b,onOpenChange:n,children:s.jsxs(lt,{className:"sm:max-w-lg","aria-describedby":void 0,children:[s.jsx(ot,{children:s.jsx(at,{children:i.title})}),s.jsx(Ss,{autoFocus:!0,value:l,onChange:a=>d(a.target.value),onPaste:j,onKeyDown:a=>{a.key==="Enter"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),w&&C.mutate())},placeholder:i.placeholder,className:"min-h-32 max-h-80",maxLength:vs}),o.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:o.map((a,x)=>s.jsxs("div",{className:"group relative size-20 overflow-hidden rounded-lg shadow-edge",children:[s.jsx("a",{href:a.previewUrl,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:a.previewUrl,alt:r("sidebar.feedback.screenshotAlt",{n:String(x+1)}),className:"size-full object-cover"})}),s.jsx("button",{type:"button",onClick:()=>u(a),"aria-label":r("sidebar.feedback.removeScreenshot"),className:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground opacity-0 shadow-edge transition-opacity group-hover:opacity-100 focus-visible:opacity-100",children:s.jsx(qe,{size:12})})]},a.previewUrl))}),s.jsxs(ct,{className:"sm:justify-between",children:[Os()?s.jsxs(Fe,{type:"button",variant:"outline",onClick:v,disabled:o.length>=Ae,children:[s.jsx(It,{size:14}),r("sidebar.feedback.takeScreenshot")]}):s.jsx("span",{}),s.jsx(Fe,{type:"button",onClick:()=>C.mutate(),disabled:!w,children:C.isPending?r("sidebar.feedback.sending"):r("sidebar.feedback.send")})]})]})})}function ve(t){const e=I.c(11),{active:n,label:r,children:i}=t,c=n?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let l;e[0]!==c?(l=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",c),e[0]=c,e[1]=l):l=e[1];let d;e[2]!==l?(d=s.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:s.jsx("span",{className:l})}),e[2]=l,e[3]=d):d=e[3];let o;e[4]!==n||e[5]!==r?(o=r&&s.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",n?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=n,e[5]=r,e[6]=o):o=e[6];let f;return e[7]!==i||e[8]!==d||e[9]!==o?(f=s.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[d,i,o]}),e[7]=i,e[8]=d,e[9]=o,e[10]=f):f=e[10],f}const Rs="https://docs.decocms.com/",zs="https://discord.gg/EQkX7CymV";function Ds(){const t=I.c(39),e=X(),{org:n}=Ee(),[r,i]=$.useState(null),c=!!n.id;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=_=>{H("help_menu_dialog_opened",{kind:_}),i(_)},t[0]=l):l=t[0];const d=l;let o;t[1]!==e?(o=e("sidebar.help.button"),t[1]=e,t[2]=o):o=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ft,{size:18}),t[3]=f):f=t[3];let b;t[4]!==o?(b=s.jsx(ge,{asChild:!0,children:s.jsx(ft,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":o,onClick:Ls,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-ring data-[state=open]:bg-sidebar-accent data-[state=open]:text-foreground",children:f})})}),t[4]=o,t[5]=b):b=t[5];let h;t[6]!==e?(h=e("sidebar.help.button"),t[6]=e,t[7]=h):h=t[7];let p;t[8]!==h?(p=s.jsx(be,{side:"right",children:h}),t[8]=h,t[9]=p):p=t[9];let m;t[10]!==b||t[11]!==p?(m=s.jsxs(xe,{children:[b,p]}),t[10]=b,t[11]=p,t[12]=m):m=t[12];let u;t[13]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(js,{}),t[13]=u):u=t[13];let v;t[14]!==e?(v=e("sidebar.help.guides"),t[14]=e,t[15]=v):v=t[15];let j;t[16]!==v?(j=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Rs,target:"_blank",rel:"noopener noreferrer",onClick:Ts,children:[u,v]})}),t[16]=v,t[17]=j):j=t[17];let C;t[18]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_s,{}),t[18]=C):C=t[18];let w;t[19]!==e?(w=e("sidebar.help.discord"),t[19]=e,t[20]=w):w=t[20];let a;t[21]!==w?(a=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:zs,target:"_blank",rel:"noopener noreferrer",onClick:Ns,children:[C,w]})}),t[21]=w,t[22]=a):a=t[22];let x;t[23]!==c||t[24]!==e?(x=c&&s.jsxs(s.Fragment,{children:[s.jsx(dt,{}),s.jsxs(ke,{onSelect:()=>d("problem"),children:[s.jsx(ut,{}),e("sidebar.help.reportProblem")]}),s.jsxs(ke,{onSelect:()=>d("feedback"),children:[s.jsx(Kt,{}),e("sidebar.feedback.button")]})]}),t[23]=c,t[24]=e,t[25]=x):x=t[25];let g;t[26]!==a||t[27]!==x||t[28]!==j?(g=s.jsxs(mt,{side:"right",align:"end",className:"w-56",children:[j,a,x]}),t[26]=a,t[27]=x,t[28]=j,t[29]=g):g=t[29];let y;t[30]!==g||t[31]!==m?(y=s.jsx(ve,{active:!1,children:s.jsxs(ht,{children:[m,g]})}),t[30]=g,t[31]=m,t[32]=y):y=t[32];let S;t[33]!==c||t[34]!==r?(S=c&&s.jsxs(s.Fragment,{children:[s.jsx(He,{kind:"problem",open:r==="problem",onOpenChange:_=>i(_?"problem":null)}),s.jsx(He,{kind:"feedback",open:r==="feedback",onOpenChange:_=>i(_?"feedback":null)})]}),t[33]=c,t[34]=r,t[35]=S):S=t[35];let k;return t[36]!==y||t[37]!==S?(k=s.jsxs(s.Fragment,{children:[y,S]}),t[36]=y,t[37]=S,t[38]=k):k=t[38],k}function Ns(){return H("help_menu_discord_opened")}function Ts(){return H("help_menu_guides_opened")}function Ls(){return H("help_menu_opened")}function Ps(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const As=()=>Je(globalThis.innerHeight),Ms=()=>Je(0);function $s(t){const e=I.c(59),{org:n,active:r,onSelect:i,pinned:c,onOpenSettings:l,onTogglePin:d,onHide:o}=t,f=X();let b;e[0]!==n.slug?(b={id:n.slug},e[0]=n.slug,e[1]=b):b=e[1];const{setNodeRef:h,listeners:p,transform:m,transition:u,isDragging:v}=Mt(b);let j;e[2]!==m?(j=Tt.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=j):j=e[3];const C=v?1:void 0,w=`rail-org-${n.slug}`;let a;e[4]!==j||e[5]!==C||e[6]!==w||e[7]!==u?(a={transform:j,transition:u,zIndex:C,viewTransitionName:w},e[4]=j,e[5]=C,e[6]=w,e[7]=u,e[8]=a):a=e[8];const x=n.name,g=r||void 0,y=r?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=i&&"cursor-pointer";let k;e[9]!==y||e[10]!==S?(k=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",y,S),e[9]=y,e[10]=S,e[11]=k):k=e[11];let _;e[12]!==n?(_=s.jsx(Ve,{org:n,size:"lg"}),e[12]=n,e[13]=_):_=e[13];let T;e[14]!==c?(T=c&&s.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:s.jsx(Ue,{size:9})}),e[14]=c,e[15]=T):T=e[15];let R;e[16]!==i||e[17]!==n.name||e[18]!==k||e[19]!==_||e[20]!==T||e[21]!==g?(R=s.jsx(ge,{asChild:!0,children:s.jsx(Yt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":x,"aria-current":g,onClick:i,className:k,children:[_,T]})})}),e[16]=i,e[17]=n.name,e[18]=k,e[19]=_,e[20]=T,e[21]=g,e[22]=R):R=e[22];let O;e[23]!==n.name?(O=s.jsx(be,{side:"right",children:n.name}),e[23]=n.name,e[24]=O):O=e[24];let z;e[25]!==R||e[26]!==O?(z=s.jsxs(xe,{children:[R,O]}),e[25]=R,e[26]=O,e[27]=z):z=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Xt,{}),e[28]=D):D=e[28];let E;e[29]!==f?(E=f("sidebar.rail.organizationSettings"),e[29]=f,e[30]=E):E=e[30];let A;e[31]!==l||e[32]!==E?(A=s.jsxs(Pe,{onSelect:l,children:[D,E]}),e[31]=l,e[32]=E,e[33]=A):A=e[33];let L;e[34]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Ue,{}),e[34]=L):L=e[34];let P;e[35]!==c||e[36]!==f?(P=f(c?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=c,e[36]=f,e[37]=P):P=e[37];let F;e[38]!==d||e[39]!==P?(F=s.jsxs(Pe,{onSelect:d,children:[L,P]}),e[38]=d,e[39]=P,e[40]=F):F=e[40];let U;e[41]!==o||e[42]!==f?(U=o&&s.jsxs(Pe,{onSelect:o,children:[s.jsx($t,{}),f("sidebar.rail.hideOrganization")]}),e[41]=o,e[42]=f,e[43]=U):U=e[43];let Y;e[44]!==A||e[45]!==F||e[46]!==U?(Y=s.jsxs(Gt,{children:[A,F,U]}),e[44]=A,e[45]=F,e[46]=U,e[47]=Y):Y=e[47];let K;e[48]!==z||e[49]!==Y?(K=s.jsxs(Zt,{children:[z,Y]}),e[48]=z,e[49]=Y,e[50]=K):K=e[50];let W;e[51]!==r||e[52]!==K?(W=s.jsx(ve,{active:r,children:K}),e[51]=r,e[52]=K,e[53]=W):W=e[53];let G;return e[54]!==p||e[55]!==h||e[56]!==W||e[57]!==a?(G=s.jsx("div",{ref:h,...p,style:a,className:"w-full shrink-0 touch-none",children:W}),e[54]=p,e[55]=h,e[56]=W,e[57]=a,e[58]=G):G=e[58],G}function Is(t){const e=I.c(64),{project:n,orgSlug:r,active:i,onClose:c,onNavigate:l}=t,d=X();let o,f,b,h,p,m,u,v,j,C,w;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==n.icon||e[4]!==n.id||e[5]!==n.title){const L=Ut(n.icon,n.title);w="group/rail relative flex w-full flex-col items-center gap-1",b=xe,f=ge,C=!0,o=Ye,h=jt.root,e[17]!==r||e[18]!==n.id?(p={org:r,agentId:n.id},e[17]=r,e[18]=n.id,e[19]=p):p=e[19],m=n.title,u=i||void 0,e[20]!==l?(v=()=>{H("org_rail_recent_project_opened"),l?.()},e[20]=l,e[21]=v):v=e[21],j=B("flex shrink-0 rounded-lg focus-ring",L.text,i&&"ring-[1.5px] ring-current"),e[0]=i,e[1]=l,e[2]=r,e[3]=n.icon,e[4]=n.id,e[5]=n.title,e[6]=o,e[7]=f,e[8]=b,e[9]=h,e[10]=p,e[11]=m,e[12]=u,e[13]=v,e[14]=j,e[15]=C,e[16]=w}else o=e[6],f=e[7],b=e[8],h=e[9],p=e[10],m=e[11],u=e[12],v=e[13],j=e[14],C=e[15],w=e[16];let a;e[22]!==n.icon||e[23]!==n.title?(a=s.jsx(Wt,{icon:n.icon,name:n.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=n.icon,e[23]=n.title,e[24]=a):a=e[24];let x;e[25]!==o||e[26]!==h||e[27]!==p||e[28]!==m||e[29]!==u||e[30]!==v||e[31]!==j||e[32]!==a?(x=s.jsx(o,{to:h,params:p,"aria-label":m,"aria-current":u,onClick:v,className:j,children:a}),e[25]=o,e[26]=h,e[27]=p,e[28]=m,e[29]=u,e[30]=v,e[31]=j,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==f||e[35]!==x||e[36]!==C?(g=s.jsx(f,{asChild:C,children:x}),e[34]=f,e[35]=x,e[36]=C,e[37]=g):g=e[37];let y;e[38]!==n.title?(y=s.jsx(be,{side:"right",children:n.title}),e[38]=n.title,e[39]=y):y=e[39];let S;e[40]!==b||e[41]!==g||e[42]!==y?(S=s.jsxs(b,{children:[g,y]}),e[40]=b,e[41]=g,e[42]=y,e[43]=S):S=e[43];const k=i?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let _;e[44]!==k?(_=B("line-clamp-2 w-full text-center text-2xs break-words transition-colors",k),e[44]=k,e[45]=_):_=e[45];let T;e[46]!==n.title||e[47]!==_?(T=s.jsx("span",{"aria-hidden":!0,className:_,children:n.title}),e[46]=n.title,e[47]=_,e[48]=T):T=e[48];let R;e[49]!==n.title||e[50]!==d?(R=d("sidebar.rail.closeApp",{name:n.title}),e[49]=n.title,e[50]=d,e[51]=R):R=e[51];let O;e[52]!==c?(O=()=>{H("org_rail_recent_project_closed"),c()},e[52]=c,e[53]=O):O=e[53];let z,D;e[54]===Symbol.for("react.memo_cache_sentinel")?(z=B("absolute -top-1.5 right-[calc(50%-1.25rem)] 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"),D=s.jsx(qe,{size:10}),e[54]=z,e[55]=D):(z=e[54],D=e[55]);let E;e[56]!==R||e[57]!==O?(E=s.jsx("button",{type:"button","aria-label":R,onClick:O,className:z,children:D}),e[56]=R,e[57]=O,e[58]=E):E=e[58];let A;return e[59]!==S||e[60]!==T||e[61]!==E||e[62]!==w?(A=s.jsxs("div",{className:w,children:[S,T,E]}),e[59]=S,e[60]=T,e[61]=E,e[62]=w,e[63]=A):A=e[63],A}const Ks={"site-editor":"/site-editor"};function Fs(t){const e=I.c(26),{app:n}=t,r=X(),i=as[n],c=Ks[n];if(!i||!c)return null;let l;e[0]!==i.labelKey||e[1]!==r?(l=r(i.labelKey),e[0]=i.labelKey,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==i.labelKey||e[4]!==r?(d=r(i.labelKey),e[3]=i.labelKey,e[4]=r,e[5]=d):d=e[5];let o;e[6]!==i.tone?(o=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",i.tone),e[6]=i.tone,e[7]=o):o=e[7];let f;e[8]!==i.Icon?(f=s.jsx(i.Icon,{size:18}),e[8]=i.Icon,e[9]=f):f=e[9];let b;e[10]!==d||e[11]!==o||e[12]!==f||e[13]!==c?(b=s.jsx(ge,{asChild:!0,children:s.jsx(Ye,{to:c,"aria-label":d,"aria-current":"page","data-testid":"org-rail-local-app",className:o,children:f})}),e[10]=d,e[11]=o,e[12]=f,e[13]=c,e[14]=b):b=e[14];let h;e[15]!==i.labelKey||e[16]!==r?(h=r(i.labelKey),e[15]=i.labelKey,e[16]=r,e[17]=h):h=e[17];let p;e[18]!==h?(p=s.jsx(be,{side:"right",children:h}),e[18]=h,e[19]=p):p=e[19];let m;e[20]!==b||e[21]!==p?(m=s.jsxs(xe,{children:[b,p]}),e[20]=b,e[21]=p,e[22]=m):m=e[22];let u;return e[23]!==l||e[24]!==m?(u=s.jsx(ve,{active:!0,label:l,children:m}),e[23]=l,e[24]=m,e[25]=u):u=e[25],u}function Us(){const{org:t}=Ee();return cs(t.slug),null}function et(t){const e=I.c(77),{onNavigate:n}=t===void 0?{}:t,r=X(),i=pt(),{org:c}=Ee(),l=gt();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={select:Xs},e[0]=d):d=e[0];const o=bt(d);let f;e[1]!==o||e[2]!==l?(f=o?l({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=o,e[2]=l,e[3]=f):f=e[3];const b=f,h=b?b.org:c.slug,{data:p}=xt(),[m,u]=$.useState(!1),[v,j]=$.useState(!1),C=Ie(),{recent:w,forget:a}=us(c.slug),{projects:x}=fs(),g=ms(),y=ds(),S=y&&y.projectId===null?y.app:null,k=S?[]:w.flatMap(N=>x.filter(M=>M.id===N)),_=Vt(p??[],c),{recent:T}=Jt(),R=Qt();let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O=Ge.railOrgPrefs(),e[4]=O):O=e[4];const[z,D]=$e(O,es),E=Oe(z),A=$.useSyncExternalStore(Ps,As,Ms),{shown:L}=ts(ss(_,E,c.slug),T,c.slug,A,E.pinned);let P;e[5]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[5]=P):P=e[5];const F=Rt(zt(Lt,P)),U=N=>{const{active:M,over:Ke}=N;Ke&&(H("org_rail_reordered"),D(rt=>is(Oe(rt),L.map(Hs),String(M.id),String(Ke.id))))},Y=N=>{n?.(),i({to:"/$org/home",params:{org:N},viewTransition:!0})},K=N=>{H("org_rail_travel"),n?.(),R(N,L.map(Bs))},W=()=>{if(H("org_rail_search_opened"),!c.id){j(!0);return}n?.(),ls()},G=!C&&"border-r border-sidebar-border";let Z;e[6]!==G?(Z=B("flex w-[68px] shrink-0 flex-col bg-sidebar",G),e[6]=G,e[7]=Z):Z=e[7];const st="flex min-h-0 flex-1 flex-col items-center gap-2.5 overflow-y-auto px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";let q;e[8]!==r?(q=r("sidebar.rail.ariaLabel"),e[8]=r,e[9]=q):q=e[9];const Re=Dt,ze=Nt,De=Pt,Ne=L.map(Ws),Te=At,Le=L.map(N=>s.jsxs($.Fragment,{children:[s.jsx($s,{org:N,active:N.slug===h,pinned:E.pinned.includes(N.slug),onSelect:N.slug!==c.slug?()=>K(N.slug):g?()=>Y(N.slug):void 0,onOpenSettings:()=>{n?.(),i({to:"/$org/settings",params:{org:N.slug},search:{thread:void 0}})},onTogglePin:()=>D(M=>ns(Oe(M),N.slug)),onHide:N.slug===c.slug?void 0:()=>D(M=>rs(Oe(M),N.slug))}),N.slug===c.slug&&k.length>0&&s.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:k.map(M=>s.jsx(Is,{project:M,orgSlug:c.slug,active:g===M.id,onClose:()=>a(M.id),onNavigate:n},M.id))})]},N.id));let V;e[10]!==De||e[11]!==Ne||e[12]!==Te||e[13]!==Le?(V=s.jsx(De,{items:Ne,strategy:Te,children:Le}),e[10]=De,e[11]=Ne,e[12]=Te,e[13]=Le,e[14]=V):V=e[14];let J;e[15]!==Re||e[16]!==U||e[17]!==F||e[18]!==ze||e[19]!==V?(J=s.jsx(Re,{sensors:F,collisionDetection:ze,onDragEnd:U,children:V}),e[15]=Re,e[16]=U,e[17]=F,e[18]=ze,e[19]=V,e[20]=J):J=e[20];let Q;e[21]!==S?(Q=S&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),s.jsx(Fs,{app:S})]}),e[21]=S,e[22]=Q):Q=e[22];let ee;e[23]!==J||e[24]!==Q||e[25]!==q?(ee=s.jsxs("div",{className:st,"aria-label":q,children:[J,Q]}),e[23]=J,e[24]=Q,e[25]=q,e[26]=ee):ee=e[26];let te;e[27]!==r?(te=r("sidebar.rail.search"),e[27]=r,e[28]=te):te=e[28];let ye;e[29]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(Ht,{size:18}),e[29]=ye):ye=e[29];let se;e[30]!==W||e[31]!==te?(se=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":te,"aria-keyshortcuts":"Meta+K Control+K",onClick:W,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-ring",children:ye})}),e[30]=W,e[31]=te,e[32]=se):se=e[32];let re;e[33]!==r?(re=r("sidebar.rail.search"),e[33]=r,e[34]=re):re=e[34];let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx("span",{className:"ml-2 text-muted-foreground",children:vt.commandPalette.keys.join("")}),e[35]=Se):Se=e[35];let ne;e[36]!==re?(ne=s.jsxs(be,{side:"right",children:[re,Se]}),e[36]=re,e[37]=ne):ne=e[37];let ie;e[38]!==se||e[39]!==ne?(ie=s.jsx(ve,{active:!1,children:s.jsxs(xe,{children:[se,ne]})}),e[38]=se,e[39]=ne,e[40]=ie):ie=e[40];let le;e[41]!==r?(le=r("sidebar.picker.newOrganization"),e[41]=r,e[42]=le):le=e[42];let oe;e[43]!==u?(oe=()=>u(!0),e[43]=u,e[44]=oe):oe=e[44];let we;e[45]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Bt,{size:18}),e[45]=we):we=e[45];let ae;e[46]!==le||e[47]!==oe?(ae=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":le,onClick:oe,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-ring",children:we})}),e[46]=le,e[47]=oe,e[48]=ae):ae=e[48];let ce;e[49]!==r?(ce=r("sidebar.picker.newOrganization"),e[49]=r,e[50]=ce):ce=e[50];let de;e[51]!==ce?(de=s.jsx(be,{side:"right",children:ce}),e[51]=ce,e[52]=de):de=e[52];let ue;e[53]!==ae||e[54]!==de?(ue=s.jsx(ve,{active:!1,children:s.jsxs(xe,{children:[ae,de]})}),e[53]=ae,e[54]=de,e[55]=ue):ue=e[55];let Ce;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Ds,{}),e[56]=Ce):Ce=e[56];let fe;e[57]!==ie||e[58]!==ue?(fe=s.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1 px-2.5 pt-2 pb-3",children:[ie,ue,Ce]}),e[57]=ie,e[58]=ue,e[59]=fe):fe=e[59];let me;e[60]!==ee||e[61]!==fe||e[62]!==Z?(me=s.jsxs("div",{className:Z,children:[ee,fe]}),e[60]=ee,e[61]=fe,e[62]=Z,e[63]=me):me=e[63];let he;e[64]!==c.slug||e[65]!==_||e[66]!==v||e[67]!==j||e[68]!==K?(he=s.jsx(Cs,{open:v,onOpenChange:j,orgs:_,currentSlug:c.slug,onSelect:K}),e[64]=c.slug,e[65]=_,e[66]=v,e[67]=j,e[68]=K,e[69]=he):he=e[69];let pe;e[70]!==m||e[71]!==u?(pe=s.jsx(os,{open:m,onOpenChange:u}),e[70]=m,e[71]=u,e[72]=pe):pe=e[72];let _e;return e[73]!==me||e[74]!==he||e[75]!==pe?(_e=s.jsxs(s.Fragment,{children:[me,he,pe]}),e[73]=me,e[74]=he,e[75]=pe,e[76]=_e):_e=e[76],_e}function Ws(t){return t.slug}function Bs(t){return t.slug}function Hs(t){return t.slug}function Xs(t){return t.isLoading}function Ys(t){const e=I.c(15),{width:n,minWidth:r,maxWidth:i,onPointerDown:c,onKeyDown:l,onDoubleClick:d}=t,o=X(),{isMobile:f}=Ze(),b=Ie();if(f||b)return null;let h;e[0]!==o?(h=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=h):h=e[1];let p;e[2]!==o?(p=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=p):p=e[3];let m,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},u=s.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]=u):(m=e[4],u=e[5]);let v;return e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==l||e[10]!==c||e[11]!==h||e[12]!==p||e[13]!==n?(v=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":h,"aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":i,title:p,tabIndex:0,onPointerDown:c,onKeyDown:l,onDoubleClick:d,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:u}),e[6]=i,e[7]=r,e[8]=d,e[9]=l,e[10]=c,e[11]=h,e[12]=p,e[13]=n,e[14]=v):v=e[14],v}const Me=400,Xe=16,Gs="sidebar.width.v2";function Zs(){const t=I.c(14),e=qs;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u=>typeof u=="number"?e(u):192,t[0]=n):n=t[0];const[r,i]=$e(Gs,n),c=$.useRef(null);let l;t[1]!==i||t[2]!==r?(l=u=>{u.preventDefault();const v=u.clientX,j=e(r),C=c.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),w=C?Array.from(C.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const g of w)g.style.transition="none";const a=g=>{const y=e(j+(g.clientX-v));C?.style.setProperty("--sidebar-width",`${y}px`)},x=g=>{const y=e(j+(g.clientX-v));i(y);for(const S of w)S.style.transition="";window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",a),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},t[1]=i,t[2]=r,t[3]=l):l=t[3];const d=l;let o;t[4]!==i?(o=()=>{i(192)},t[4]=i,t[5]=o):o=t[5];const f=o;let b;t[6]!==i||t[7]!==r?(b=u=>{if(u.key==="ArrowLeft")i(e(r-Xe));else if(u.key==="ArrowRight")i(e(r+Xe));else if(u.key==="Home")i(192);else if(u.key==="End")i(Me);else return;u.preventDefault()},t[6]=i,t[7]=r,t[8]=b):b=t[8];const h=b,p=e(r);let m;return t[9]!==h||t[10]!==d||t[11]!==f||t[12]!==p?(m={width:p,minWidth:192,maxWidth:Me,wrapperRef:c,onStartResize:d,onKeyDownResize:h,resetWidth:f},t[9]=h,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function qs(t){return Math.max(192,Math.min(Me,t))}const tt=$.createContext(null);function Vs(){const t=$.use(tt);if(!t)throw new Error("Layout regions require a Layout");return t}function Js({children:t,notice:e,outsideOrg:n}){const r=Et(),[i,c]=$e(Ge.sidebarOpen(),!0),l=Zs();return s.jsx(tt,{value:{isMobile:r,resize:l},children:s.jsx(St,{open:i,onOpenChange:c,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,s.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[!n&&s.jsx(Us,{}),!r&&(n?.rail??!0)&&s.jsx(et,{}),s.jsx(wt,{ref:l.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${l.width}px`,"--sidebar-width-icon":"0px"},children:s.jsx(ws,{children:t})})]})]})})})}function Qs(t){const e=I.c(36),{children:n,renderMobile:r}=t,i=X(),{isMobile:c,resize:l}=Vs(),{openMobile:d,setOpenMobile:o}=Ze(),f=Ie();let b;e[0]!==o?(b=()=>o(!1),e[0]=o,e[1]=b):b=e[1];const h=b;if(!c){let x;e[2]!==n||e[3]!==f?(x=s.jsx("div",{className:"contents",inert:f,children:n}),e[2]=n,e[3]=f,e[4]=x):x=e[4];let g;e[5]!==l.maxWidth||e[6]!==l.minWidth||e[7]!==l.onKeyDownResize||e[8]!==l.onStartResize||e[9]!==l.resetWidth||e[10]!==l.width?(g=s.jsx(Ys,{width:l.width,minWidth:l.minWidth,maxWidth:l.maxWidth,onPointerDown:l.onStartResize,onKeyDown:l.onKeyDownResize,onDoubleClick:l.resetWidth}),e[5]=l.maxWidth,e[6]=l.minWidth,e[7]=l.onKeyDownResize,e[8]=l.onStartResize,e[9]=l.resetWidth,e[10]=l.width,e[11]=g):g=e[11];let y;return e[12]!==x||e[13]!==g?(y=s.jsxs(s.Fragment,{children:[x,g]}),e[12]=x,e[13]=g,e[14]=y):y=e[14],y}let p;e[15]!==i?(p=i("layouts.shellControls.navigationTitle"),e[15]=i,e[16]=p):p=e[16];let m;e[17]!==p?(m=s.jsx(_t,{className:"sr-only",children:p}),e[17]=p,e[18]=m):m=e[18];let u;e[19]!==h?(u=s.jsx(et,{onNavigate:h}),e[19]=h,e[20]=u):u=e[20];let v;e[21]!==h||e[22]!==r?(v=r({onClose:h}),e[21]=h,e[22]=r,e[23]=v):v=e[23];let j;e[24]!==v?(j=s.jsx("div",{className:"min-w-0 flex-1",children:v}),e[24]=v,e[25]=j):j=e[25];let C;e[26]!==u||e[27]!==j?(C=s.jsxs("div",{className:"flex h-full min-h-0",children:[u,j]}),e[26]=u,e[27]=j,e[28]=C):C=e[28];let w;e[29]!==m||e[30]!==C?(w=s.jsxs(kt,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:er,children:[m,C]}),e[29]=m,e[30]=C,e[31]=w):w=e[31];let a;return e[32]!==d||e[33]!==o||e[34]!==w?(a=s.jsx(Ot,{open:d,onOpenChange:o,children:w}),e[32]=d,e[33]=o,e[34]=w,e[35]=a):a=e[35],a}function er(t){return t.preventDefault()}function tr(t){const e=I.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsx(Ct,{className:"flex flex-col min-h-0",style:r,children:s.jsx(yt,{variant:"plain",className:"bg-sidebar",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:n})})}),e[1]=n,e[2]=i):i=e[2],i}const Er=Object.assign(Js,{Sidebar:Qs,Content:tr});export{Er as L};
1
+ import{c as I,b as X,r as $,m as B,j as s,a6 as Ee,e as nt,t as je,D as it,v as lt,w as ot,x as at,y as ct,B as Fe,aw as dt,Y as ke,a7 as ut,E as H,X as ft,Z as mt,_ as ht,d as pt,aD as gt,l as bt,H as xt,at as $e,L as Ye,$ as jt,av as Ge,aE as vt,P as yt}from"./index-_VeebRNE.js";import{u as Ie,c as Ze,g as St,h as wt,i as Ct}from"./use-sidebar-collapsed-9Vi_PrVo.js";import{S as _t,a as kt,b as Ot}from"./sheet-8iInbf9D.js";import{u as Et}from"./use-mobile-FS1bh43h.js";import{u as Rt,a as zt,D as Dt,c as Nt,C as Tt,P as Lt}from"./task-key-B6H-3XJr.js";import{S as Pt,v as At,u as Mt}from"./sortable.esm-CW9y-Z65.js";import{i as $t}from"./Tool01-D6InpKaj.js";import{t as It,r as Kt,u as Ft,v as Ut,A as Wt,w as Ue}from"./agent-icon-CfdcYUE7.js";import{s as Bt}from"./Plus-BYodv7tE.js";import{i as Ht}from"./UserSquare-e0qIxN1Q.js";import{a as Xt}from"./UserCheck01-Dqn7toBe.js";import{s as qe}from"./XClose-C9ONGfkv.js";import{T as ge,a as be,c as xe}from"./tooltip-BYnWhoO-.js";import{C as Pe,f as Yt,g as Gt,e as Zt}from"./context-menu-Dc1eMRQk.js";import{a as qt,O as Ve,w as Vt,b as Jt,c as Qt,E as es,r as Oe,d as ts,e as ss,h as rs,t as ns,f as Je,m as is,o as ls}from"./use-org-notice-D5zuQ4m5.js";import{C as os}from"./create-organization-dialog-BditzGYJ.js";import{P as as}from"./project-apps-Qpq3Yqgk.js";import{u as cs,a as ds}from"./use-recent-apps-Dt_ZPA-N.js";import{a as us}from"./use-navigate-to-agent-Dg2qYHJi.js";import{a as fs,u as ms}from"./use-project-scope-CpfOkL8I.js";import{C as We,a as hs,b as ps,c as gs,d as bs}from"./command-DsEpQe7b.js";import{u as xs}from"./use-debounced-value-BAma3ogA.js";import{n as js}from"./BookOpen01-CpYcxx0H.js";import{F as vs,a as Ae,b as ys,c as Qe}from"./feedback-BqoIMOg7.js";import{T as Ss}from"./textarea-Cimn1xhl.js";import{a as ws}from"./thread-button-DCHp9tO9.js";function Cs(t){const e=I.c(48),{open:n,onOpenChange:r,orgs:i,currentSlug:c,onSelect:l}=t,d=X(),[o,f]=$.useState("");let b;e[0]!==o?(b=o.trim(),e[0]=o,e[1]=b):b=e[1];const h=b,p=xs(h,150),m=h.length>0,u=p===h,{hits:v,isSearching:j,isStale:C,isError:w}=qt(m?p:""),a=m?v:i;let x;e[2]!==r?(x=L=>{r(L),L||f("")},e[2]=r,e[3]=x):x=e[3];const g=x;let y;e[4]!==d?(y=d("sidebar.rail.searchOrganizations"),e[4]=d,e[5]=y):y=e[5];let S;e[6]!==d?(S=d("sidebar.rail.searchPlaceholder"),e[6]=d,e[7]=S):S=e[7];let k;e[8]!==d?(k=d("sidebar.rail.searchPlaceholder"),e[8]=d,e[9]=k):k=e[9];let _;e[10]!==o||e[11]!==k?(_=s.jsx(hs,{value:o,onValueChange:f,placeholder:k}),e[10]=o,e[11]=k,e[12]=_):_=e[12];const T=m&&(C||!u)&&"opacity-50";let R;e[13]!==T?(R=B(T),e[13]=T,e[14]=R):R=e[14];let O;e[15]!==w||e[16]!==m||e[17]!==d?(O=m&&w&&s.jsx(We,{children:d("sidebar.rail.searchFailed")}),e[15]=w,e[16]=m,e[17]=d,e[18]=O):O=e[18];let z;e[19]!==w||e[20]!==j||e[21]!==a.length||e[22]!==u||e[23]!==d?(z=!w&&u&&!j&&a.length===0&&s.jsx(We,{children:d("sidebar.rail.searchEmpty")}),e[19]=w,e[20]=j,e[21]=a.length,e[22]=u,e[23]=d,e[24]=z):z=e[24];let D;if(e[25]!==c||e[26]!==l||e[27]!==g||e[28]!==a||e[29]!==d){let L;e[31]!==c||e[32]!==l||e[33]!==g||e[34]!==d?(L=P=>s.jsxs(ps,{value:P.slug,onSelect:()=>{g(!1),P.slug!==c&&l(P.slug)},className:"gap-2.5",children:[s.jsx(Ve,{org:P,size:"sm"}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.name}),P.slug===c&&s.jsx("span",{className:"text-meta shrink-0",children:d("sidebar.rail.currentOrganization")})]},P.id),e[31]=c,e[32]=l,e[33]=g,e[34]=d,e[35]=L):L=e[35],D=a.map(L),e[25]=c,e[26]=l,e[27]=g,e[28]=a,e[29]=d,e[30]=D}else D=e[30];let E;e[36]!==z||e[37]!==D||e[38]!==R||e[39]!==O?(E=s.jsxs(gs,{className:R,children:[O,z,D]}),e[36]=z,e[37]=D,e[38]=R,e[39]=O,e[40]=E):E=e[40];let A;return e[41]!==n||e[42]!==g||e[43]!==E||e[44]!==y||e[45]!==S||e[46]!==_?(A=s.jsxs(bs,{open:n,onOpenChange:g,title:y,description:S,shouldFilter:!1,children:[_,E]}),e[41]=n,e[42]=g,e[43]=E,e[44]=y,e[45]=S,e[46]=_,e[47]=A):A=e[47],A}function _s(t){const e=I.c(4),{size:n,className:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{d:"M20.317 4.37a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.028C.533 9.046-.32 13.58.099 18.058a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.042-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .078-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .079.009c.12.099.246.198.373.292a.077.077 0 0 1-.007.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.029 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.055c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.029ZM8.02 15.331c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.956 2.418-2.157 2.418Zm7.975 0c-1.183 0-2.157-1.086-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.332-.946 2.418-2.157 2.418Z"}),e[0]=i):i=e[0];let c;return e[1]!==r||e[2]!==n?(c=s.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:r,children:i}),e[1]=r,e[2]=n,e[3]=c):c=e[3],c}const ks=250;function Os(){return typeof navigator<"u"&&!!navigator.mediaDevices?.getDisplayMedia}function Be(t,e,n){return new Promise(r=>t.toBlob(r,e,n))}async function Es(){const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include"});try{const e=document.createElement("video");e.muted=!0,e.srcObject=t,await e.play(),await new Promise(c=>setTimeout(c,ks));const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight,n.getContext("2d")?.drawImage(e,0,0),e.srcObject=null;let r=await Be(n,"image/png");if((!r||r.size>Qe)&&(r=await Be(n,"image/jpeg",.85)),!r)throw new Error("Could not encode the screenshot");const i=r.type==="image/png"?"png":"jpg";return new File([r],`screenshot.${i}`,{type:r.type})}finally{for(const e of t.getTracks())e.stop()}}function He({kind:t,open:e,onOpenChange:n}){const r=X(),i=t==="problem"?{title:r("sidebar.problem.title"),placeholder:r("sidebar.problem.placeholder"),sent:r("sidebar.problem.sent"),failed:r("sidebar.problem.failed")}:{title:r("sidebar.feedback.title"),placeholder:r("sidebar.feedback.placeholder"),sent:r("sidebar.feedback.sent"),failed:r("sidebar.feedback.failed")},{org:c}=Ee(),[l,d]=$.useState(""),[o,f]=$.useState([]),[b,h]=$.useState(!1),p=()=>{for(const a of o)URL.revokeObjectURL(a.previewUrl);f([]),d("")},m=a=>{const x=a.filter(S=>ys.includes(S.type)?S.size>Qe?(je.error(r("sidebar.feedback.screenshotTooLarge")),!1):!0:!1),g=Ae-o.length;x.length>g&&je.error(r("sidebar.feedback.tooManyScreenshots",{max:String(Ae)}));const y=x.slice(0,Math.max(g,0)).map(S=>({file:S,previewUrl:URL.createObjectURL(S)}));y.length>0&&f(S=>[...S,...y])},u=a=>{URL.revokeObjectURL(a.previewUrl),f(x=>x.filter(g=>g!==a))},v=async()=>{h(!0);try{m([await Es()])}catch(a){a instanceof DOMException&&a.name==="NotAllowedError"||(console.error("[feedback] screenshot failed",a),je.error(r("sidebar.feedback.screenshotFailed")))}finally{h(!1)}},j=a=>{const x=Array.from(a.clipboardData.files).filter(g=>g.type.startsWith("image/"));x.length!==0&&(a.preventDefault(),m(x))},C=nt({mutationFn:async()=>{const a=new FormData;a.set("kind",t),a.set("message",l.trim()),a.set("pageUrl",window.location.href);for(const g of o)a.append("screenshot",g.file);const x=await fetch(`/api/${encodeURIComponent(c.slug)}/feedback`,{method:"POST",body:a});if(!x.ok)throw new Error(`Feedback failed: ${x.status}`)},onSuccess:()=>{je.success(i.sent),p(),n(!1)},onError:()=>je.error(i.failed)}),w=l.trim().length>0&&!C.isPending;return s.jsx(it,{open:e&&!b,onOpenChange:n,children:s.jsxs(lt,{className:"sm:max-w-lg","aria-describedby":void 0,children:[s.jsx(ot,{children:s.jsx(at,{children:i.title})}),s.jsx(Ss,{autoFocus:!0,value:l,onChange:a=>d(a.target.value),onPaste:j,onKeyDown:a=>{a.key==="Enter"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),w&&C.mutate())},placeholder:i.placeholder,className:"min-h-32 max-h-80",maxLength:vs}),o.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:o.map((a,x)=>s.jsxs("div",{className:"group relative size-20 overflow-hidden rounded-lg shadow-edge",children:[s.jsx("a",{href:a.previewUrl,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:a.previewUrl,alt:r("sidebar.feedback.screenshotAlt",{n:String(x+1)}),className:"size-full object-cover"})}),s.jsx("button",{type:"button",onClick:()=>u(a),"aria-label":r("sidebar.feedback.removeScreenshot"),className:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground opacity-0 shadow-edge transition-opacity group-hover:opacity-100 focus-visible:opacity-100",children:s.jsx(qe,{size:12})})]},a.previewUrl))}),s.jsxs(ct,{className:"sm:justify-between",children:[Os()?s.jsxs(Fe,{type:"button",variant:"outline",onClick:v,disabled:o.length>=Ae,children:[s.jsx(It,{size:14}),r("sidebar.feedback.takeScreenshot")]}):s.jsx("span",{}),s.jsx(Fe,{type:"button",onClick:()=>C.mutate(),disabled:!w,children:C.isPending?r("sidebar.feedback.sending"):r("sidebar.feedback.send")})]})]})})}function ve(t){const e=I.c(11),{active:n,label:r,children:i}=t,c=n?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let l;e[0]!==c?(l=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",c),e[0]=c,e[1]=l):l=e[1];let d;e[2]!==l?(d=s.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:s.jsx("span",{className:l})}),e[2]=l,e[3]=d):d=e[3];let o;e[4]!==n||e[5]!==r?(o=r&&s.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",n?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=n,e[5]=r,e[6]=o):o=e[6];let f;return e[7]!==i||e[8]!==d||e[9]!==o?(f=s.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[d,i,o]}),e[7]=i,e[8]=d,e[9]=o,e[10]=f):f=e[10],f}const Rs="https://docs.decocms.com/",zs="https://discord.gg/EQkX7CymV";function Ds(){const t=I.c(39),e=X(),{org:n}=Ee(),[r,i]=$.useState(null),c=!!n.id;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=_=>{H("help_menu_dialog_opened",{kind:_}),i(_)},t[0]=l):l=t[0];const d=l;let o;t[1]!==e?(o=e("sidebar.help.button"),t[1]=e,t[2]=o):o=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ft,{size:18}),t[3]=f):f=t[3];let b;t[4]!==o?(b=s.jsx(ge,{asChild:!0,children:s.jsx(ft,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":o,onClick:Ls,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-ring data-[state=open]:bg-sidebar-accent data-[state=open]:text-foreground",children:f})})}),t[4]=o,t[5]=b):b=t[5];let h;t[6]!==e?(h=e("sidebar.help.button"),t[6]=e,t[7]=h):h=t[7];let p;t[8]!==h?(p=s.jsx(be,{side:"right",children:h}),t[8]=h,t[9]=p):p=t[9];let m;t[10]!==b||t[11]!==p?(m=s.jsxs(xe,{children:[b,p]}),t[10]=b,t[11]=p,t[12]=m):m=t[12];let u;t[13]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(js,{}),t[13]=u):u=t[13];let v;t[14]!==e?(v=e("sidebar.help.guides"),t[14]=e,t[15]=v):v=t[15];let j;t[16]!==v?(j=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:Rs,target:"_blank",rel:"noopener noreferrer",onClick:Ts,children:[u,v]})}),t[16]=v,t[17]=j):j=t[17];let C;t[18]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_s,{}),t[18]=C):C=t[18];let w;t[19]!==e?(w=e("sidebar.help.discord"),t[19]=e,t[20]=w):w=t[20];let a;t[21]!==w?(a=s.jsx(ke,{asChild:!0,children:s.jsxs("a",{href:zs,target:"_blank",rel:"noopener noreferrer",onClick:Ns,children:[C,w]})}),t[21]=w,t[22]=a):a=t[22];let x;t[23]!==c||t[24]!==e?(x=c&&s.jsxs(s.Fragment,{children:[s.jsx(dt,{}),s.jsxs(ke,{onSelect:()=>d("problem"),children:[s.jsx(ut,{}),e("sidebar.help.reportProblem")]}),s.jsxs(ke,{onSelect:()=>d("feedback"),children:[s.jsx(Kt,{}),e("sidebar.feedback.button")]})]}),t[23]=c,t[24]=e,t[25]=x):x=t[25];let g;t[26]!==a||t[27]!==x||t[28]!==j?(g=s.jsxs(mt,{side:"right",align:"end",className:"w-56",children:[j,a,x]}),t[26]=a,t[27]=x,t[28]=j,t[29]=g):g=t[29];let y;t[30]!==g||t[31]!==m?(y=s.jsx(ve,{active:!1,children:s.jsxs(ht,{children:[m,g]})}),t[30]=g,t[31]=m,t[32]=y):y=t[32];let S;t[33]!==c||t[34]!==r?(S=c&&s.jsxs(s.Fragment,{children:[s.jsx(He,{kind:"problem",open:r==="problem",onOpenChange:_=>i(_?"problem":null)}),s.jsx(He,{kind:"feedback",open:r==="feedback",onOpenChange:_=>i(_?"feedback":null)})]}),t[33]=c,t[34]=r,t[35]=S):S=t[35];let k;return t[36]!==y||t[37]!==S?(k=s.jsxs(s.Fragment,{children:[y,S]}),t[36]=y,t[37]=S,t[38]=k):k=t[38],k}function Ns(){return H("help_menu_discord_opened")}function Ts(){return H("help_menu_guides_opened")}function Ls(){return H("help_menu_opened")}function Ps(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const As=()=>Je(globalThis.innerHeight),Ms=()=>Je(0);function $s(t){const e=I.c(59),{org:n,active:r,onSelect:i,pinned:c,onOpenSettings:l,onTogglePin:d,onHide:o}=t,f=X();let b;e[0]!==n.slug?(b={id:n.slug},e[0]=n.slug,e[1]=b):b=e[1];const{setNodeRef:h,listeners:p,transform:m,transition:u,isDragging:v}=Mt(b);let j;e[2]!==m?(j=Tt.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=j):j=e[3];const C=v?1:void 0,w=`rail-org-${n.slug}`;let a;e[4]!==j||e[5]!==C||e[6]!==w||e[7]!==u?(a={transform:j,transition:u,zIndex:C,viewTransitionName:w},e[4]=j,e[5]=C,e[6]=w,e[7]=u,e[8]=a):a=e[8];const x=n.name,g=r||void 0,y=r?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=i&&"cursor-pointer";let k;e[9]!==y||e[10]!==S?(k=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",y,S),e[9]=y,e[10]=S,e[11]=k):k=e[11];let _;e[12]!==n?(_=s.jsx(Ve,{org:n,size:"lg"}),e[12]=n,e[13]=_):_=e[13];let T;e[14]!==c?(T=c&&s.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:s.jsx(Ue,{size:9})}),e[14]=c,e[15]=T):T=e[15];let R;e[16]!==i||e[17]!==n.name||e[18]!==k||e[19]!==_||e[20]!==T||e[21]!==g?(R=s.jsx(ge,{asChild:!0,children:s.jsx(Yt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":x,"aria-current":g,onClick:i,className:k,children:[_,T]})})}),e[16]=i,e[17]=n.name,e[18]=k,e[19]=_,e[20]=T,e[21]=g,e[22]=R):R=e[22];let O;e[23]!==n.name?(O=s.jsx(be,{side:"right",children:n.name}),e[23]=n.name,e[24]=O):O=e[24];let z;e[25]!==R||e[26]!==O?(z=s.jsxs(xe,{children:[R,O]}),e[25]=R,e[26]=O,e[27]=z):z=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Xt,{}),e[28]=D):D=e[28];let E;e[29]!==f?(E=f("sidebar.rail.organizationSettings"),e[29]=f,e[30]=E):E=e[30];let A;e[31]!==l||e[32]!==E?(A=s.jsxs(Pe,{onSelect:l,children:[D,E]}),e[31]=l,e[32]=E,e[33]=A):A=e[33];let L;e[34]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Ue,{}),e[34]=L):L=e[34];let P;e[35]!==c||e[36]!==f?(P=f(c?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=c,e[36]=f,e[37]=P):P=e[37];let F;e[38]!==d||e[39]!==P?(F=s.jsxs(Pe,{onSelect:d,children:[L,P]}),e[38]=d,e[39]=P,e[40]=F):F=e[40];let U;e[41]!==o||e[42]!==f?(U=o&&s.jsxs(Pe,{onSelect:o,children:[s.jsx($t,{}),f("sidebar.rail.hideOrganization")]}),e[41]=o,e[42]=f,e[43]=U):U=e[43];let Y;e[44]!==A||e[45]!==F||e[46]!==U?(Y=s.jsxs(Gt,{children:[A,F,U]}),e[44]=A,e[45]=F,e[46]=U,e[47]=Y):Y=e[47];let K;e[48]!==z||e[49]!==Y?(K=s.jsxs(Zt,{children:[z,Y]}),e[48]=z,e[49]=Y,e[50]=K):K=e[50];let W;e[51]!==r||e[52]!==K?(W=s.jsx(ve,{active:r,children:K}),e[51]=r,e[52]=K,e[53]=W):W=e[53];let G;return e[54]!==p||e[55]!==h||e[56]!==W||e[57]!==a?(G=s.jsx("div",{ref:h,...p,style:a,className:"w-full shrink-0 touch-none",children:W}),e[54]=p,e[55]=h,e[56]=W,e[57]=a,e[58]=G):G=e[58],G}function Is(t){const e=I.c(64),{project:n,orgSlug:r,active:i,onClose:c,onNavigate:l}=t,d=X();let o,f,b,h,p,m,u,v,j,C,w;if(e[0]!==i||e[1]!==l||e[2]!==r||e[3]!==n.icon||e[4]!==n.id||e[5]!==n.title){const L=Ut(n.icon,n.title);w="group/rail relative flex w-full flex-col items-center gap-1",b=xe,f=ge,C=!0,o=Ye,h=jt.root,e[17]!==r||e[18]!==n.id?(p={org:r,agentId:n.id},e[17]=r,e[18]=n.id,e[19]=p):p=e[19],m=n.title,u=i||void 0,e[20]!==l?(v=()=>{H("org_rail_recent_project_opened"),l?.()},e[20]=l,e[21]=v):v=e[21],j=B("flex shrink-0 rounded-lg focus-ring",L.text,i&&"ring-[1.5px] ring-current"),e[0]=i,e[1]=l,e[2]=r,e[3]=n.icon,e[4]=n.id,e[5]=n.title,e[6]=o,e[7]=f,e[8]=b,e[9]=h,e[10]=p,e[11]=m,e[12]=u,e[13]=v,e[14]=j,e[15]=C,e[16]=w}else o=e[6],f=e[7],b=e[8],h=e[9],p=e[10],m=e[11],u=e[12],v=e[13],j=e[14],C=e[15],w=e[16];let a;e[22]!==n.icon||e[23]!==n.title?(a=s.jsx(Wt,{icon:n.icon,name:n.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=n.icon,e[23]=n.title,e[24]=a):a=e[24];let x;e[25]!==o||e[26]!==h||e[27]!==p||e[28]!==m||e[29]!==u||e[30]!==v||e[31]!==j||e[32]!==a?(x=s.jsx(o,{to:h,params:p,"aria-label":m,"aria-current":u,onClick:v,className:j,children:a}),e[25]=o,e[26]=h,e[27]=p,e[28]=m,e[29]=u,e[30]=v,e[31]=j,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==f||e[35]!==x||e[36]!==C?(g=s.jsx(f,{asChild:C,children:x}),e[34]=f,e[35]=x,e[36]=C,e[37]=g):g=e[37];let y;e[38]!==n.title?(y=s.jsx(be,{side:"right",children:n.title}),e[38]=n.title,e[39]=y):y=e[39];let S;e[40]!==b||e[41]!==g||e[42]!==y?(S=s.jsxs(b,{children:[g,y]}),e[40]=b,e[41]=g,e[42]=y,e[43]=S):S=e[43];const k=i?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let _;e[44]!==k?(_=B("line-clamp-2 w-full text-center text-2xs break-words transition-colors",k),e[44]=k,e[45]=_):_=e[45];let T;e[46]!==n.title||e[47]!==_?(T=s.jsx("span",{"aria-hidden":!0,className:_,children:n.title}),e[46]=n.title,e[47]=_,e[48]=T):T=e[48];let R;e[49]!==n.title||e[50]!==d?(R=d("sidebar.rail.closeApp",{name:n.title}),e[49]=n.title,e[50]=d,e[51]=R):R=e[51];let O;e[52]!==c?(O=()=>{H("org_rail_recent_project_closed"),c()},e[52]=c,e[53]=O):O=e[53];let z,D;e[54]===Symbol.for("react.memo_cache_sentinel")?(z=B("absolute -top-1.5 right-[calc(50%-1.25rem)] 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"),D=s.jsx(qe,{size:10}),e[54]=z,e[55]=D):(z=e[54],D=e[55]);let E;e[56]!==R||e[57]!==O?(E=s.jsx("button",{type:"button","aria-label":R,onClick:O,className:z,children:D}),e[56]=R,e[57]=O,e[58]=E):E=e[58];let A;return e[59]!==S||e[60]!==T||e[61]!==E||e[62]!==w?(A=s.jsxs("div",{className:w,children:[S,T,E]}),e[59]=S,e[60]=T,e[61]=E,e[62]=w,e[63]=A):A=e[63],A}const Ks={"site-editor":"/site-editor"};function Fs(t){const e=I.c(26),{app:n}=t,r=X(),i=as[n],c=Ks[n];if(!i||!c)return null;let l;e[0]!==i.labelKey||e[1]!==r?(l=r(i.labelKey),e[0]=i.labelKey,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==i.labelKey||e[4]!==r?(d=r(i.labelKey),e[3]=i.labelKey,e[4]=r,e[5]=d):d=e[5];let o;e[6]!==i.tone?(o=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",i.tone),e[6]=i.tone,e[7]=o):o=e[7];let f;e[8]!==i.Icon?(f=s.jsx(i.Icon,{size:18}),e[8]=i.Icon,e[9]=f):f=e[9];let b;e[10]!==d||e[11]!==o||e[12]!==f||e[13]!==c?(b=s.jsx(ge,{asChild:!0,children:s.jsx(Ye,{to:c,"aria-label":d,"aria-current":"page","data-testid":"org-rail-local-app",className:o,children:f})}),e[10]=d,e[11]=o,e[12]=f,e[13]=c,e[14]=b):b=e[14];let h;e[15]!==i.labelKey||e[16]!==r?(h=r(i.labelKey),e[15]=i.labelKey,e[16]=r,e[17]=h):h=e[17];let p;e[18]!==h?(p=s.jsx(be,{side:"right",children:h}),e[18]=h,e[19]=p):p=e[19];let m;e[20]!==b||e[21]!==p?(m=s.jsxs(xe,{children:[b,p]}),e[20]=b,e[21]=p,e[22]=m):m=e[22];let u;return e[23]!==l||e[24]!==m?(u=s.jsx(ve,{active:!0,label:l,children:m}),e[23]=l,e[24]=m,e[25]=u):u=e[25],u}function Us(){const{org:t}=Ee();return cs(t.slug),null}function et(t){const e=I.c(77),{onNavigate:n}=t===void 0?{}:t,r=X(),i=pt(),{org:c}=Ee(),l=gt();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={select:Xs},e[0]=d):d=e[0];const o=bt(d);let f;e[1]!==o||e[2]!==l?(f=o?l({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=o,e[2]=l,e[3]=f):f=e[3];const b=f,h=b?b.org:c.slug,{data:p}=xt(),[m,u]=$.useState(!1),[v,j]=$.useState(!1),C=Ie(),{recent:w,forget:a}=us(c.slug),{projects:x}=fs(),g=ms(),y=ds(),S=y&&y.projectId===null?y.app:null,k=S?[]:w.flatMap(N=>x.filter(M=>M.id===N)),_=Vt(p??[],c),{recent:T}=Jt(),R=Qt();let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O=Ge.railOrgPrefs(),e[4]=O):O=e[4];const[z,D]=$e(O,es),E=Oe(z),A=$.useSyncExternalStore(Ps,As,Ms),{shown:L}=ts(ss(_,E,c.slug),T,c.slug,A,E.pinned);let P;e[5]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[5]=P):P=e[5];const F=Rt(zt(Lt,P)),U=N=>{const{active:M,over:Ke}=N;Ke&&(H("org_rail_reordered"),D(rt=>is(Oe(rt),L.map(Hs),String(M.id),String(Ke.id))))},Y=N=>{n?.(),i({to:"/$org/home",params:{org:N},viewTransition:!0})},K=N=>{H("org_rail_travel"),n?.(),R(N,L.map(Bs))},W=()=>{if(H("org_rail_search_opened"),!c.id){j(!0);return}n?.(),ls()},G=!C&&"border-r border-sidebar-border";let Z;e[6]!==G?(Z=B("flex w-[68px] shrink-0 flex-col bg-sidebar",G),e[6]=G,e[7]=Z):Z=e[7];const st="flex min-h-0 flex-1 flex-col items-center gap-2.5 overflow-y-auto px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";let q;e[8]!==r?(q=r("sidebar.rail.ariaLabel"),e[8]=r,e[9]=q):q=e[9];const Re=Dt,ze=Nt,De=Pt,Ne=L.map(Ws),Te=At,Le=L.map(N=>s.jsxs($.Fragment,{children:[s.jsx($s,{org:N,active:N.slug===h,pinned:E.pinned.includes(N.slug),onSelect:N.slug!==c.slug?()=>K(N.slug):g?()=>Y(N.slug):void 0,onOpenSettings:()=>{n?.(),i({to:"/$org/settings",params:{org:N.slug},search:{thread:void 0}})},onTogglePin:()=>D(M=>ns(Oe(M),N.slug)),onHide:N.slug===c.slug?void 0:()=>D(M=>rs(Oe(M),N.slug))}),N.slug===c.slug&&k.length>0&&s.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:k.map(M=>s.jsx(Is,{project:M,orgSlug:c.slug,active:g===M.id,onClose:()=>a(M.id),onNavigate:n},M.id))})]},N.id));let V;e[10]!==De||e[11]!==Ne||e[12]!==Te||e[13]!==Le?(V=s.jsx(De,{items:Ne,strategy:Te,children:Le}),e[10]=De,e[11]=Ne,e[12]=Te,e[13]=Le,e[14]=V):V=e[14];let J;e[15]!==Re||e[16]!==U||e[17]!==F||e[18]!==ze||e[19]!==V?(J=s.jsx(Re,{sensors:F,collisionDetection:ze,onDragEnd:U,children:V}),e[15]=Re,e[16]=U,e[17]=F,e[18]=ze,e[19]=V,e[20]=J):J=e[20];let Q;e[21]!==S?(Q=S&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),s.jsx(Fs,{app:S})]}),e[21]=S,e[22]=Q):Q=e[22];let ee;e[23]!==J||e[24]!==Q||e[25]!==q?(ee=s.jsxs("div",{className:st,"aria-label":q,children:[J,Q]}),e[23]=J,e[24]=Q,e[25]=q,e[26]=ee):ee=e[26];let te;e[27]!==r?(te=r("sidebar.rail.search"),e[27]=r,e[28]=te):te=e[28];let ye;e[29]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(Ht,{size:18}),e[29]=ye):ye=e[29];let se;e[30]!==W||e[31]!==te?(se=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":te,"aria-keyshortcuts":"Meta+K Control+K",onClick:W,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-ring",children:ye})}),e[30]=W,e[31]=te,e[32]=se):se=e[32];let re;e[33]!==r?(re=r("sidebar.rail.search"),e[33]=r,e[34]=re):re=e[34];let Se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx("span",{className:"ml-2 text-muted-foreground",children:vt.commandPalette.keys.join("")}),e[35]=Se):Se=e[35];let ne;e[36]!==re?(ne=s.jsxs(be,{side:"right",children:[re,Se]}),e[36]=re,e[37]=ne):ne=e[37];let ie;e[38]!==se||e[39]!==ne?(ie=s.jsx(ve,{active:!1,children:s.jsxs(xe,{children:[se,ne]})}),e[38]=se,e[39]=ne,e[40]=ie):ie=e[40];let le;e[41]!==r?(le=r("sidebar.picker.newOrganization"),e[41]=r,e[42]=le):le=e[42];let oe;e[43]!==u?(oe=()=>u(!0),e[43]=u,e[44]=oe):oe=e[44];let we;e[45]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Bt,{size:18}),e[45]=we):we=e[45];let ae;e[46]!==le||e[47]!==oe?(ae=s.jsx(ge,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":le,onClick:oe,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-ring",children:we})}),e[46]=le,e[47]=oe,e[48]=ae):ae=e[48];let ce;e[49]!==r?(ce=r("sidebar.picker.newOrganization"),e[49]=r,e[50]=ce):ce=e[50];let de;e[51]!==ce?(de=s.jsx(be,{side:"right",children:ce}),e[51]=ce,e[52]=de):de=e[52];let ue;e[53]!==ae||e[54]!==de?(ue=s.jsx(ve,{active:!1,children:s.jsxs(xe,{children:[ae,de]})}),e[53]=ae,e[54]=de,e[55]=ue):ue=e[55];let Ce;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Ds,{}),e[56]=Ce):Ce=e[56];let fe;e[57]!==ie||e[58]!==ue?(fe=s.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1 px-2.5 pt-2 pb-3",children:[ie,ue,Ce]}),e[57]=ie,e[58]=ue,e[59]=fe):fe=e[59];let me;e[60]!==ee||e[61]!==fe||e[62]!==Z?(me=s.jsxs("div",{className:Z,children:[ee,fe]}),e[60]=ee,e[61]=fe,e[62]=Z,e[63]=me):me=e[63];let he;e[64]!==c.slug||e[65]!==_||e[66]!==v||e[67]!==j||e[68]!==K?(he=s.jsx(Cs,{open:v,onOpenChange:j,orgs:_,currentSlug:c.slug,onSelect:K}),e[64]=c.slug,e[65]=_,e[66]=v,e[67]=j,e[68]=K,e[69]=he):he=e[69];let pe;e[70]!==m||e[71]!==u?(pe=s.jsx(os,{open:m,onOpenChange:u}),e[70]=m,e[71]=u,e[72]=pe):pe=e[72];let _e;return e[73]!==me||e[74]!==he||e[75]!==pe?(_e=s.jsxs(s.Fragment,{children:[me,he,pe]}),e[73]=me,e[74]=he,e[75]=pe,e[76]=_e):_e=e[76],_e}function Ws(t){return t.slug}function Bs(t){return t.slug}function Hs(t){return t.slug}function Xs(t){return t.isLoading}function Ys(t){const e=I.c(15),{width:n,minWidth:r,maxWidth:i,onPointerDown:c,onKeyDown:l,onDoubleClick:d}=t,o=X(),{isMobile:f}=Ze(),b=Ie();if(f||b)return null;let h;e[0]!==o?(h=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=h):h=e[1];let p;e[2]!==o?(p=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=p):p=e[3];let m,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},u=s.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]=u):(m=e[4],u=e[5]);let v;return e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==l||e[10]!==c||e[11]!==h||e[12]!==p||e[13]!==n?(v=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":h,"aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":i,title:p,tabIndex:0,onPointerDown:c,onKeyDown:l,onDoubleClick:d,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:u}),e[6]=i,e[7]=r,e[8]=d,e[9]=l,e[10]=c,e[11]=h,e[12]=p,e[13]=n,e[14]=v):v=e[14],v}const Me=400,Xe=16,Gs="sidebar.width.v2";function Zs(){const t=I.c(14),e=qs;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=u=>typeof u=="number"?e(u):192,t[0]=n):n=t[0];const[r,i]=$e(Gs,n),c=$.useRef(null);let l;t[1]!==i||t[2]!==r?(l=u=>{u.preventDefault();const v=u.clientX,j=e(r),C=c.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),w=C?Array.from(C.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const g of w)g.style.transition="none";const a=g=>{const y=e(j+(g.clientX-v));C?.style.setProperty("--sidebar-width",`${y}px`)},x=g=>{const y=e(j+(g.clientX-v));i(y);for(const S of w)S.style.transition="";window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",a),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x)},t[1]=i,t[2]=r,t[3]=l):l=t[3];const d=l;let o;t[4]!==i?(o=()=>{i(192)},t[4]=i,t[5]=o):o=t[5];const f=o;let b;t[6]!==i||t[7]!==r?(b=u=>{if(u.key==="ArrowLeft")i(e(r-Xe));else if(u.key==="ArrowRight")i(e(r+Xe));else if(u.key==="Home")i(192);else if(u.key==="End")i(Me);else return;u.preventDefault()},t[6]=i,t[7]=r,t[8]=b):b=t[8];const h=b,p=e(r);let m;return t[9]!==h||t[10]!==d||t[11]!==f||t[12]!==p?(m={width:p,minWidth:192,maxWidth:Me,wrapperRef:c,onStartResize:d,onKeyDownResize:h,resetWidth:f},t[9]=h,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function qs(t){return Math.max(192,Math.min(Me,t))}const tt=$.createContext(null);function Vs(){const t=$.use(tt);if(!t)throw new Error("Layout regions require a Layout");return t}function Js({children:t,notice:e,outsideOrg:n}){const r=Et(),[i,c]=$e(Ge.sidebarOpen(),!0),l=Zs();return s.jsx(tt,{value:{isMobile:r,resize:l},children:s.jsx(St,{open:i,onOpenChange:c,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,s.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[!n&&s.jsx(Us,{}),!r&&(n?.rail??!0)&&s.jsx(et,{}),s.jsx(wt,{ref:l.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${l.width}px`,"--sidebar-width-icon":"0px"},children:s.jsx(ws,{children:t})})]})]})})})}function Qs(t){const e=I.c(36),{children:n,renderMobile:r}=t,i=X(),{isMobile:c,resize:l}=Vs(),{openMobile:d,setOpenMobile:o}=Ze(),f=Ie();let b;e[0]!==o?(b=()=>o(!1),e[0]=o,e[1]=b):b=e[1];const h=b;if(!c){let x;e[2]!==n||e[3]!==f?(x=s.jsx("div",{className:"contents",inert:f,children:n}),e[2]=n,e[3]=f,e[4]=x):x=e[4];let g;e[5]!==l.maxWidth||e[6]!==l.minWidth||e[7]!==l.onKeyDownResize||e[8]!==l.onStartResize||e[9]!==l.resetWidth||e[10]!==l.width?(g=s.jsx(Ys,{width:l.width,minWidth:l.minWidth,maxWidth:l.maxWidth,onPointerDown:l.onStartResize,onKeyDown:l.onKeyDownResize,onDoubleClick:l.resetWidth}),e[5]=l.maxWidth,e[6]=l.minWidth,e[7]=l.onKeyDownResize,e[8]=l.onStartResize,e[9]=l.resetWidth,e[10]=l.width,e[11]=g):g=e[11];let y;return e[12]!==x||e[13]!==g?(y=s.jsxs(s.Fragment,{children:[x,g]}),e[12]=x,e[13]=g,e[14]=y):y=e[14],y}let p;e[15]!==i?(p=i("layouts.shellControls.navigationTitle"),e[15]=i,e[16]=p):p=e[16];let m;e[17]!==p?(m=s.jsx(_t,{className:"sr-only",children:p}),e[17]=p,e[18]=m):m=e[18];let u;e[19]!==h?(u=s.jsx(et,{onNavigate:h}),e[19]=h,e[20]=u):u=e[20];let v;e[21]!==h||e[22]!==r?(v=r({onClose:h}),e[21]=h,e[22]=r,e[23]=v):v=e[23];let j;e[24]!==v?(j=s.jsx("div",{className:"min-w-0 flex-1",children:v}),e[24]=v,e[25]=j):j=e[25];let C;e[26]!==u||e[27]!==j?(C=s.jsxs("div",{className:"flex h-full min-h-0",children:[u,j]}),e[26]=u,e[27]=j,e[28]=C):C=e[28];let w;e[29]!==m||e[30]!==C?(w=s.jsxs(kt,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:er,children:[m,C]}),e[29]=m,e[30]=C,e[31]=w):w=e[31];let a;return e[32]!==d||e[33]!==o||e[34]!==w?(a=s.jsx(Ot,{open:d,onOpenChange:o,children:w}),e[32]=d,e[33]=o,e[34]=w,e[35]=a):a=e[35],a}function er(t){return t.preventDefault()}function tr(t){const e=I.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsx(Ct,{className:"flex flex-col min-h-0",style:r,children:s.jsx(yt,{variant:"plain",className:"bg-sidebar",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:n})})}),e[1]=n,e[2]=i):i=e[2],i}const Er=Object.assign(Js,{Sidebar:Qs,Content:tr});export{Er as L};
@@ -1,4 +1,4 @@
1
- import{c as $,b as j,r as _,j as f,m as B,aY as at,t as se,b5 as Oe,a6 as ot,hj as lt,i as ct,K as ut,ca as ht,h as De,o as pt}from"./index-BuZqAz74.js";import{u as dt,t as Be,f as ue,A as ft,v as gt,Y as P,Z as mt,_ as kt,H as xt,I as D,$ as ve,a0 as bt,e as wt,a1 as Se,a2 as yt,a3 as G,N as Fe,a4 as he,c as qe,a5 as pe,a6 as Tt,a7 as vt,s as St,a8 as Mt,a as Et,E as At}from"./usage-stats-C5Wj6kIy.js";import{T as C,n as Rt,i as _t,E as $t}from"./editor-classes-CzejjvgI.js";import{a as Ct,e as Ue,s as It,S as Lt}from"./suggestion-Nntdxi5T.js";import{B as zt}from"./index-SIZschZt.js";import{aF as Pt,aj as jt,ak as Nt,am as Ht,K as Ot,aZ as Dt,aK as Bt}from"./agent-icon-DwJHakBB.js";import{i as Ft}from"./SwitchHorizontal01-BQF84Li3.js";import{s as qt}from"./Trash01-BmQrADz0.js";import{k as Ut,a as Zt}from"./use-org-fs-CAHuTLc_.js";import{E as Me,i as Ze,b as Gt,c as Kt,d as Ge,A as Wt,e as Qt,f as Xt,g as Vt,j as Yt}from"./markdown-CwYBGb1B.js";import{s as Jt,T as en}from"./index-CZTrNcsP.js";import{f as tn,a as nn,c as rn,C as sn,b as Ee}from"./command-DHGFzOhP.js";import{I as an}from"./icon-button-DzpdeaSs.js";function on(t){const e=$.c(30),{editor:n}=t,s=j(),[r,a]=_.useState(!1),[i,l]=_.useState(""),[o,h]=_.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const u=c;let p;e[2]!==n||e[3]!==r?(p=()=>{if(r){a(!1);return}const T=n.getAttributes("link").href;l(typeof T=="string"?T:""),h(!1),a(!0)},e[2]=n,e[3]=r,e[4]=p):p=e[4];const d=p;let g;e[5]!==n?(g=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=g):g=e[6];const x=g;let w;e[7]!==i||e[8]!==n||e[9]!==x?(w=()=>{const T=Rt(i);if(T===""){x();return}if(!_t(T)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:T}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=x,e[10]=w):w=e[10];const b=w;let y;e[11]!==s?(y=s("markdownEditor.link"),e[11]=s,e[12]=y):y=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=f.jsx(Pt,{size:14}),e[13]=v):v=e[13];let M;e[14]!==u||e[15]!==y||e[16]!==d?(M=f.jsx(C,{active:u,label:y,onClick:d,children:v}),e[14]=u,e[15]=y,e[16]=d,e[17]=M):M=e[17];let m;e[18]!==u||e[19]!==b||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==x||e[25]!==s?(m=r&&f.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||a(!1)},children:[f.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:T=>{l(T.target.value),h(!1)},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),b()):T.key==="Escape"&&(T.preventDefault(),a(!1),n.chain().focus().run())},className:B("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")}),f.jsx(C,{active:!1,label:s("markdownEditor.linkApply"),onClick:b,children:f.jsx(at,{size:14})}),u&&f.jsx(C,{active:!1,label:s("markdownEditor.linkRemove"),onClick:x,children:f.jsx(qt,{size:14})})]}),e[18]=u,e[19]=b,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=x,e[25]=s,e[26]=m):m=e[26];let k;return e[27]!==M||e[28]!==m?(k=f.jsxs("div",{className:"relative",children:[M,m]}),e[27]=M,e[28]=m,e[29]=k):k=e[29],k}const ne=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=f.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},Ae=t=>{const e=$.c(2),{children:n}=t;let s;return e[0]!==n?(s=f.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},Ke=[1,2,3],ln=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function cn(t){const e=$.c(20),{editor:n}=t,s=j(),[r,a]=_.useState(null);let i;e[0]!==n?(i={editor:n,selector:un},e[0]=n,e[1]=i):i=e[1];const l=dt(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let h;e[4]!==s?(h=s("markdownEditor.heading2"),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==s?(c=s("markdownEditor.heading3"),e[6]=s,e[7]=c):c=e[7];let u;e[8]!==o||e[9]!==h||e[10]!==c?(u={1:o,2:h,3:c},e[8]=o,e[9]=h,e[10]=c,e[11]=u):u=e[11];const p=u;let d;e[12]!==n||e[13]!==p||e[14]!==r||e[15]!==l||e[16]!==s?(d=r&&f.jsxs(zt,{editor:n,shouldShow:ln,appendTo:r,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[f.jsx(C,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:f.jsx(jt,{size:14})}),f.jsx(C,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:f.jsx(Nt,{size:14})}),f.jsx(C,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:f.jsx(Ht,{size:14})}),f.jsx(C,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:f.jsx(Ot,{size:14})}),f.jsx(ne,{}),Ke.map((x,w)=>f.jsx(C,{active:l.headings[w]??!1,label:p[x],onClick:()=>n.chain().focus().toggleHeading({level:x}).run(),children:f.jsx(Ae,{children:`H${x}`})},x)),f.jsx(ne,{}),f.jsx(C,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:f.jsx(Ft,{size:14})}),f.jsx(C,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:f.jsx(Ae,{children:"1."})}),f.jsx(C,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:f.jsx(Dt,{size:14})}),f.jsx(ne,{}),f.jsx(on,{editor:n})]}),e[12]=n,e[13]=p,e[14]=r,e[15]=l,e[16]=s,e[17]=d):d=e[17];let g;return e[18]!==d?(g=f.jsx("div",{ref:a,className:"relative z-20",children:d}),e[18]=d,e[19]=g):g=e[19],g}function un(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Ke.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const hn=10,pn=25,dn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function fn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dn[t.type]??""}function gn(){const t=$.c(4),e=j(),{upload:n}=Ut(Me),s=Zt(Me);let r;return t[0]!==s||t[1]!==e||t[2]!==n?(r={uploadFile:async i=>{const l=Ze(i),o=l?hn:pn;if(i.size>o*1024*1024)return se.error(e("markdownEditor.fileTooLarge",{name:i.name,max:String(o)})),null;const h=l?Gt:Kt,c=`${crypto.randomUUID()}${fn(i)}`;try{return await n.mutateAsync({dir:h,files:[new File([i],c,{type:i.type})]}),s(`${h}/${c}`)}catch{return se.error(e("markdownEditor.uploadFailed",{name:i.name})),null}}},t[0]=s,t[1]=e,t[2]=n,t[3]=r):r=t[3],r}const X=new Be("uploadSlots"),mn=ue.create({name:"uploadSlots",addProseMirrorPlugins(){return[new ft({key:X,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(X);if(!t.docChanged&&!n)return e;const s=new Map;for(const[r,a]of e)s.set(r,t.mapping.map(a));if(n){const[r,a]=n;a===null?s.delete(r):s.set(r,a)}return s}}})]}});function ie(t,e,n){return t.setMeta(X,[e,n])}function kn(t,e){return X.getState(t)?.get(e)}function xn(t,e,n,s,r){const{schema:a}=t.state,i=a.nodes[n];if(!i)return;const l=i.create(s),o=t.state.selection.to===e,h=t.state.doc.resolve(e),c=h.parent.textBetween(Math.max(0,h.parentOffset-1),h.parentOffset,void 0,""),u=()=>a.text(" "),p=l.isInline?[...c&&!/\s/.test(c)?[u()]:[],l,u()]:l,d=t.state.tr.replaceWith(e,e,p);let g=e,x=e;d.mapping.maps.at(-1)?.forEach((M,m,k,T)=>{g=k,x=T});let w;d.doc.nodesBetween(g,x,(M,m)=>{M===l&&(w=m+M.nodeSize)});let b=w??x;w!==void 0&&l.isInline&&(b+=1);const y=a.nodes.paragraph;w!==void 0&&l.isBlock&&y&&(d.doc.resolve(w).nodeAfter?.isTextblock||d.insert(w,y.create()),b=w+1);const v=gt.near(d.doc.resolve(b));o&&d.setSelection(v),r&&ie(d,r,v.to),t.dispatch(d)}function bn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function wn(t=!0){const e=j(),{uploadFile:n}=gn(),s=_.useRef(n);s.current=n;const[r,a]=_.useState(0),i=_.useRef(0),l=u=>{i.current+=u,a(i.current)},o=(u,p,d)=>{if(!t||p.length===0)return!1;l(p.length);const g=Symbol("upload");return u.dispatch(ie(u.state.tr,g,d)),(async()=>{for(const x of p)try{const w=await s.current(x);if(!w||u.isDestroyed)continue;const b=Ze(x);xn(u,kn(u.state,g)??u.state.selection.to,b?"image":"attachment",b?{src:w,alt:x.name}:{href:w,name:x.name},g)}catch{se.error(e("markdownEditor.uploadFailed",{name:x.name}))}finally{l(-1)}u.isDestroyed||u.dispatch(ie(u.state.tr,g,null))})(),!0};return{pending:r,uploading:()=>i.current>0,uploadInto:o,handlePaste:(u,p)=>{const d=bn(p.clipboardData);return d.length===0?!1:(p.stopPropagation(),o(u,d,u.state.selection.to))},handleDrop:(u,p,d,g)=>{if(g)return!1;const x=Array.from(p.dataTransfer?.files??[]);if(x.length===0)return!1;const w=u.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return w===void 0?!1:(p.stopPropagation(),o(u,x,w))}}}function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O=de();function We(t){O=t}var N={exec:()=>null};function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var yn=(()=>{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)}}>`)},Tn=/^(?:[ \t]*(?:\n|$))+/,vn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Sn=/^ {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+|$)/,Mn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,fe).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(),En=S(Qe).replace(/bull/g,fe).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(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,An=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rn=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_n=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fe).getRegex(),ee="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",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$n=S("^ {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",ke).replace("tag",ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ve=S(ge).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",ee).getRegex(),Cn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ve).getRegex(),xe={blockquote:Cn,code:vn,def:Rn,fences:Sn,heading:Mn,hr:K,html:$n,lheading:Xe,list:_n,newline:Tn,paragraph:Ve,table:N,text:An},Re=S("^ *([^\\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",ee).getRegex(),In={...xe,lheading:En,table:Re,paragraph:S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Re).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",ee).getRegex()},Ln={...xe,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).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:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(ge).replace("hr",K).replace("heading",` *#{1,6} *[^
1
+ import{c as $,b as j,r as _,j as f,m as B,aY as at,t as se,b5 as Oe,a6 as ot,hj as lt,i as ct,K as ut,ca as ht,h as De,o as pt}from"./index-_VeebRNE.js";import{u as dt,t as Be,f as ue,A as ft,v as gt,Y as P,Z as mt,_ as kt,H as xt,I as D,$ as ve,a0 as bt,e as wt,a1 as Se,a2 as yt,a3 as G,N as Fe,a4 as he,c as qe,a5 as pe,a6 as Tt,a7 as vt,s as St,a8 as Mt,a as Et,E as At}from"./usage-stats-CCyq9Zgo.js";import{T as C,n as Rt,i as _t,E as $t}from"./editor-classes-Bm1swfOR.js";import{a as Ct,e as Ue,s as It,S as Lt}from"./suggestion-gEn2gqrr.js";import{B as zt}from"./index-D7q4YJXJ.js";import{aF as Pt,aj as jt,ak as Nt,am as Ht,K as Ot,aZ as Dt,aK as Bt}from"./agent-icon-CfdcYUE7.js";import{i as Ft}from"./SwitchHorizontal01-Daz2EgW0.js";import{s as qt}from"./Trash01-LecfbxTv.js";import{k as Ut,a as Zt}from"./use-org-fs-DbTl86_J.js";import{E as Me,i as Ze,b as Gt,c as Kt,d as Ge,A as Wt,e as Qt,f as Xt,g as Vt,j as Yt}from"./markdown-CBoNEgkf.js";import{s as Jt,T as en}from"./index-DAKnsBwp.js";import{f as tn,a as nn,c as rn,C as sn,b as Ee}from"./command-DsEpQe7b.js";import{I as an}from"./icon-button-trmtAOaJ.js";function on(t){const e=$.c(30),{editor:n}=t,s=j(),[r,a]=_.useState(!1),[i,l]=_.useState(""),[o,h]=_.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const u=c;let p;e[2]!==n||e[3]!==r?(p=()=>{if(r){a(!1);return}const T=n.getAttributes("link").href;l(typeof T=="string"?T:""),h(!1),a(!0)},e[2]=n,e[3]=r,e[4]=p):p=e[4];const d=p;let g;e[5]!==n?(g=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=g):g=e[6];const x=g;let w;e[7]!==i||e[8]!==n||e[9]!==x?(w=()=>{const T=Rt(i);if(T===""){x();return}if(!_t(T)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:T}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=x,e[10]=w):w=e[10];const b=w;let y;e[11]!==s?(y=s("markdownEditor.link"),e[11]=s,e[12]=y):y=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=f.jsx(Pt,{size:14}),e[13]=v):v=e[13];let M;e[14]!==u||e[15]!==y||e[16]!==d?(M=f.jsx(C,{active:u,label:y,onClick:d,children:v}),e[14]=u,e[15]=y,e[16]=d,e[17]=M):M=e[17];let m;e[18]!==u||e[19]!==b||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==x||e[25]!==s?(m=r&&f.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||a(!1)},children:[f.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:T=>{l(T.target.value),h(!1)},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),b()):T.key==="Escape"&&(T.preventDefault(),a(!1),n.chain().focus().run())},className:B("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")}),f.jsx(C,{active:!1,label:s("markdownEditor.linkApply"),onClick:b,children:f.jsx(at,{size:14})}),u&&f.jsx(C,{active:!1,label:s("markdownEditor.linkRemove"),onClick:x,children:f.jsx(qt,{size:14})})]}),e[18]=u,e[19]=b,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=x,e[25]=s,e[26]=m):m=e[26];let k;return e[27]!==M||e[28]!==m?(k=f.jsxs("div",{className:"relative",children:[M,m]}),e[27]=M,e[28]=m,e[29]=k):k=e[29],k}const ne=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=f.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},Ae=t=>{const e=$.c(2),{children:n}=t;let s;return e[0]!==n?(s=f.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},Ke=[1,2,3],ln=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function cn(t){const e=$.c(20),{editor:n}=t,s=j(),[r,a]=_.useState(null);let i;e[0]!==n?(i={editor:n,selector:un},e[0]=n,e[1]=i):i=e[1];const l=dt(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let h;e[4]!==s?(h=s("markdownEditor.heading2"),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==s?(c=s("markdownEditor.heading3"),e[6]=s,e[7]=c):c=e[7];let u;e[8]!==o||e[9]!==h||e[10]!==c?(u={1:o,2:h,3:c},e[8]=o,e[9]=h,e[10]=c,e[11]=u):u=e[11];const p=u;let d;e[12]!==n||e[13]!==p||e[14]!==r||e[15]!==l||e[16]!==s?(d=r&&f.jsxs(zt,{editor:n,shouldShow:ln,appendTo:r,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[f.jsx(C,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:f.jsx(jt,{size:14})}),f.jsx(C,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:f.jsx(Nt,{size:14})}),f.jsx(C,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:f.jsx(Ht,{size:14})}),f.jsx(C,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:f.jsx(Ot,{size:14})}),f.jsx(ne,{}),Ke.map((x,w)=>f.jsx(C,{active:l.headings[w]??!1,label:p[x],onClick:()=>n.chain().focus().toggleHeading({level:x}).run(),children:f.jsx(Ae,{children:`H${x}`})},x)),f.jsx(ne,{}),f.jsx(C,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:f.jsx(Ft,{size:14})}),f.jsx(C,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:f.jsx(Ae,{children:"1."})}),f.jsx(C,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:f.jsx(Dt,{size:14})}),f.jsx(ne,{}),f.jsx(on,{editor:n})]}),e[12]=n,e[13]=p,e[14]=r,e[15]=l,e[16]=s,e[17]=d):d=e[17];let g;return e[18]!==d?(g=f.jsx("div",{ref:a,className:"relative z-20",children:d}),e[18]=d,e[19]=g):g=e[19],g}function un(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Ke.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const hn=10,pn=25,dn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function fn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dn[t.type]??""}function gn(){const t=$.c(4),e=j(),{upload:n}=Ut(Me),s=Zt(Me);let r;return t[0]!==s||t[1]!==e||t[2]!==n?(r={uploadFile:async i=>{const l=Ze(i),o=l?hn:pn;if(i.size>o*1024*1024)return se.error(e("markdownEditor.fileTooLarge",{name:i.name,max:String(o)})),null;const h=l?Gt:Kt,c=`${crypto.randomUUID()}${fn(i)}`;try{return await n.mutateAsync({dir:h,files:[new File([i],c,{type:i.type})]}),s(`${h}/${c}`)}catch{return se.error(e("markdownEditor.uploadFailed",{name:i.name})),null}}},t[0]=s,t[1]=e,t[2]=n,t[3]=r):r=t[3],r}const X=new Be("uploadSlots"),mn=ue.create({name:"uploadSlots",addProseMirrorPlugins(){return[new ft({key:X,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(X);if(!t.docChanged&&!n)return e;const s=new Map;for(const[r,a]of e)s.set(r,t.mapping.map(a));if(n){const[r,a]=n;a===null?s.delete(r):s.set(r,a)}return s}}})]}});function ie(t,e,n){return t.setMeta(X,[e,n])}function kn(t,e){return X.getState(t)?.get(e)}function xn(t,e,n,s,r){const{schema:a}=t.state,i=a.nodes[n];if(!i)return;const l=i.create(s),o=t.state.selection.to===e,h=t.state.doc.resolve(e),c=h.parent.textBetween(Math.max(0,h.parentOffset-1),h.parentOffset,void 0,""),u=()=>a.text(" "),p=l.isInline?[...c&&!/\s/.test(c)?[u()]:[],l,u()]:l,d=t.state.tr.replaceWith(e,e,p);let g=e,x=e;d.mapping.maps.at(-1)?.forEach((M,m,k,T)=>{g=k,x=T});let w;d.doc.nodesBetween(g,x,(M,m)=>{M===l&&(w=m+M.nodeSize)});let b=w??x;w!==void 0&&l.isInline&&(b+=1);const y=a.nodes.paragraph;w!==void 0&&l.isBlock&&y&&(d.doc.resolve(w).nodeAfter?.isTextblock||d.insert(w,y.create()),b=w+1);const v=gt.near(d.doc.resolve(b));o&&d.setSelection(v),r&&ie(d,r,v.to),t.dispatch(d)}function bn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function wn(t=!0){const e=j(),{uploadFile:n}=gn(),s=_.useRef(n);s.current=n;const[r,a]=_.useState(0),i=_.useRef(0),l=u=>{i.current+=u,a(i.current)},o=(u,p,d)=>{if(!t||p.length===0)return!1;l(p.length);const g=Symbol("upload");return u.dispatch(ie(u.state.tr,g,d)),(async()=>{for(const x of p)try{const w=await s.current(x);if(!w||u.isDestroyed)continue;const b=Ze(x);xn(u,kn(u.state,g)??u.state.selection.to,b?"image":"attachment",b?{src:w,alt:x.name}:{href:w,name:x.name},g)}catch{se.error(e("markdownEditor.uploadFailed",{name:x.name}))}finally{l(-1)}u.isDestroyed||u.dispatch(ie(u.state.tr,g,null))})(),!0};return{pending:r,uploading:()=>i.current>0,uploadInto:o,handlePaste:(u,p)=>{const d=bn(p.clipboardData);return d.length===0?!1:(p.stopPropagation(),o(u,d,u.state.selection.to))},handleDrop:(u,p,d,g)=>{if(g)return!1;const x=Array.from(p.dataTransfer?.files??[]);if(x.length===0)return!1;const w=u.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return w===void 0?!1:(p.stopPropagation(),o(u,x,w))}}}function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O=de();function We(t){O=t}var N={exec:()=>null};function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var yn=(()=>{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)}}>`)},Tn=/^(?:[ \t]*(?:\n|$))+/,vn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Sn=/^ {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+|$)/,Mn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,fe).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(),En=S(Qe).replace(/bull/g,fe).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(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,An=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rn=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_n=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fe).getRegex(),ee="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",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$n=S("^ {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",ke).replace("tag",ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ve=S(ge).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",ee).getRegex(),Cn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ve).getRegex(),xe={blockquote:Cn,code:vn,def:Rn,fences:Sn,heading:Mn,hr:K,html:$n,lheading:Xe,list:_n,newline:Tn,paragraph:Ve,table:N,text:An},Re=S("^ *([^\\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",ee).getRegex(),In={...xe,lheading:En,table:Re,paragraph:S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Re).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",ee).getRegex()},Ln={...xe,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).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:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(ge).replace("hr",K).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ye=/^( {2,}|\\)\n(?!\s*$)/,jn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,te=/[\s\p{P}\p{S}]/u,be=/[^\s\p{P}\p{S}]/u,Nn=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,te).getRegex(),Je=/(?!~)[\p{P}\p{S}]/u,Hn=/(?!~)[\s\p{P}\p{S}]/u,On=/(?:[^\s\p{P}\p{S}]|~)/u,Dn=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",yn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),et=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bn=S(et,"u").replace(/punct/g,F).getRegex(),Fn=S(et,"u").replace(/punct/g,Je).getRegex(),tt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",qn=S(tt,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Un=S(tt,"gu").replace(/notPunctSpace/g,On).replace(/punctSpace/g,Hn).replace(/punct/g,Je).getRegex(),Zn=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Gn=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,F).getRegex(),Kn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Wn=S(Kn,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Qn=S(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),Xn=S(/^<(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(),Vn=S(ke).replace("(?:-->|$)","-->").getRegex(),Yn=S("^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",Vn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),V=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Jn=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",V).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nt=S(/^!?\[(label)\]\[(ref)\]/).replace("label",V).replace("ref",me).getRegex(),rt=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),er=S("reflink|nolink(?!\\()","g").replace("reflink",nt).replace("nolink",rt).getRegex(),_e=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,we={_backpedal:N,anyPunctuation:Qn,autolink:Xn,blockSkip:Dn,br:Ye,code:Pn,del:N,delLDelim:N,delRDelim:N,emStrongLDelim:Bn,emStrongRDelimAst:qn,emStrongRDelimUnd:Zn,escape:zn,link:Jn,nolink:rt,punctuation:Nn,reflink:nt,reflinkSearch:er,tag:Yn,text:jn,url:N},tr={...we,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",V).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V).getRegex()},ae={...we,emStrongRDelimAst:Un,emStrongLDelim:Fn,delLDelim:Gn,delRDelim:Wn,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_e).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:S(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",_e).getRegex()},nr={...ae,br:S(Ye).replace("{2,}","*").getRegex(),text:S(ae.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},W={normal:xe,gfm:In,pedantic:Ln},q={normal:we,gfm:ae,breaks:nr,pedantic:tr},rr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$e=t=>rr[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,$e)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,$e);return t}function Ce(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function Ie(t,e){let n=t.replace(R.findPipe,(a,i,l)=>{let o=!1,h=i;for(;--h>=0&&l[h]==="\\";)o=!o;return o?"|":" |"}),s=n.split(R.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(R.slashPipe,"|");return s}function U(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function sr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function ir(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let a=4-n%4;s+=" ".repeat(a),n+=a}else s+=r,n++;return s}function Le(t,e,n,s,r){let a=e.href,i=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}function ar(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
3
3
  `).map(a=>{let i=a.match(n.other.beginningSpace);if(i===null)return a;let[l]=i;return l.length>=r.length?a.slice(r.length):a}).join(`
4
4
  `)}var Y=class{options;rules;lexer;constructor(t){this.options=t||O}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:U(n,`
@@ -1 +1 @@
1
- import{A as H,t as U,a9 as S,C as Z,aa as X,f as R,ab as J,ac as Q,o as z}from"./usage-stats-C5Wj6kIy.js";import{gA as C,hk as M,gz as P,hl as x,hm as L,hn as V,ho as K,hp as _,gC as A,eT as N,r as p,ca as $}from"./index-BuZqAz74.js";import{C as k}from"./index-CZTrNcsP.js";function tt(t,e){const i=Math.min(t.top,e.top),s=Math.max(t.bottom,e.bottom),l=Math.min(t.left,e.left),r=Math.max(t.right,e.right)-l,n=s-i;return new DOMRect(l,i,r,n)}var et=class{get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(C(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(M(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(P(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(x(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(L(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(V(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(K(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e;const{selection:i}=this.editor.state,s=(t=this.getReferencedVirtualElement)===null||t===void 0?void 0:t.call(this);if(s)return s;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const l=S(this.view,i.from,i.to);let r={getBoundingClientRect:()=>l,getClientRects:()=>[l]};if(i instanceof Z){let n=this.view.nodeDOM(i.from);const d=n.dataset.nodeViewWrapper?n:n.querySelector("[data-node-view-wrapper]");d&&(n=d),n&&(r={getBoundingClientRect:()=>n.getBoundingClientRect(),getClientRects:()=>[n.getBoundingClientRect()]})}if(i instanceof k){const{$anchorCell:n,$headCell:d}=i,g=n?n.pos:d.pos,f=d?d.pos:n.pos,u=this.view.nodeDOM(g),o=this.view.nodeDOM(f);if(!u||!o)return;const a=u===o?u.getBoundingClientRect():tt(u.getBoundingClientRect(),o.getBoundingClientRect());r={getBoundingClientRect:()=>a,getClientRects:()=>[a]}}return r}constructor({editor:t,element:e,view:i,pluginKey:s="bubbleMenu",updateDelay:l=250,resizeDelay:r=60,shouldShow:n,appendTo:d,getReferencedVirtualElement:g,options:f}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:o,state:a,from:h,to:c})=>{const{doc:m,selection:y}=a,{empty:O}=y,b=!m.textBetween(h,c).length&&X(a.selection),v=this.element.contains(document.activeElement);return!(!(o.hasFocus()||v)||O||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(o,a)=>{const h=!a?.selection.eq(o.state.selection),c=!a?.doc.eq(o.state.doc);!h&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(o,h,c,a)},this.updateDelay))},this.updateHandler=(o,a,h,c)=>{const{composing:m}=o;if(!(m||!a&&!h)){if(!this.getShouldShow(c)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:o})=>{const a=o.getMeta(this.pluginKey);a==="updatePosition"?this.updatePosition():a&&typeof a=="object"&&a.type==="updateOptions"?this.updateOptions(a.options):a==="hide"?this.hide():a==="show"&&(this.updatePosition(),this.show())},this.editor=t,this.element=e,this.view=i,this.pluginKey=s,this.updateDelay=l,this.resizeDelay=r,this.appendTo=d,this.scrollTarget=(u=f?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=g,this.floatingUIOptions={...this.floatingUIOptions,...f},this.element.tabIndex=0,n&&(this.shouldShow=n),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&A(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:i,strategy:s,middlewareData:l})=>{var r,n;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((n=l.hide)===null||n===void 0)&&n.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${e}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:i}=t,s=i.selection.from!==i.selection.to;if(this.updateDelay>0&&s){this.handleDebouncedUpdate(t,e);return}const l=!e?.selection.eq(t.state.selection),r=!e?.doc.eq(t.state.doc);this.updateHandler(t,l,r,e)}getShouldShow(t){var e;const{state:i}=this.view,{selection:s}=i,{ranges:l}=s,r=Math.min(...l.map(d=>d.$from.pos)),n=Math.max(...l.map(d=>d.$to.pos));return((e=this.shouldShow)===null||e===void 0?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:i,oldState:t,from:r,to:n}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)===null||t===void 0||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){var e;const i=(e=t.options.scrollTarget)!==null&&e!==void 0?e:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const B=t=>new H({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:e=>new et({view:e,...t})});R.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[B({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var it=class{getTextContent(t){return J(t,{textSerializers:Q(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(C(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(M(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(P(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(x(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(L(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(V(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(K(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}constructor({editor:t,element:e,view:i,pluginKey:s="floatingMenu",updateDelay:l=250,resizeDelay:r=60,options:n,appendTo:d,shouldShow:g}){var f;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:o})=>{const{selection:a}=o,{$anchor:h,empty:c}=a,m=h.depth===1,y=h.parent.isTextblock&&!h.parent.type.spec.code&&!h.parent.textContent&&h.parent.childCount===0&&!this.getTextContent(h.parent);return!(!u.hasFocus()||!c||!m||!y||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,o,a,h)=>{const{composing:c}=u;if(!(c||!o&&!a)){if(!this.getShouldShow(h)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var o;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((o=this.element.parentNode)===null||o===void 0)&&o.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const o=u.getMeta(this.pluginKey);o==="updatePosition"?this.updatePosition():o&&typeof o=="object"&&o.type==="updateOptions"?this.updateOptions(o.options):o==="hide"?this.hide():o==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=t,this.element=e,this.view=i,this.pluginKey=s,this.updateDelay=l,this.resizeDelay=r,this.appendTo=d,this.scrollTarget=(f=n?.scrollTarget)!==null&&f!==void 0?f:window,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,g&&(this.shouldShow=g),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(t){var e;const{state:i}=this.view,{selection:s}=i,{ranges:l}=s,r=Math.min(...l.map(d=>d.$from.pos)),n=Math.max(...l.map(d=>d.$to.pos));return(e=this.shouldShow)===null||e===void 0?void 0:e.call(this,{editor:this.editor,view:this.view,state:i,oldState:t,from:r,to:n})}updateOptions(t){if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){var e;const i=(e=t.options.scrollTarget)!==null&&e!==void 0?e:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){var t;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const{selection:e}=this.editor.state,i=S(this.view,e.from,e.to);A({getBoundingClientRect:()=>i,getClientRects:()=>[i]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:s,y:l,strategy:r,middlewareData:n})=>{var d,g;if(!((d=n.hide)===null||d===void 0)&&d.referenceHidden||!((g=n.hide)===null||g===void 0)&&g.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${s}px`,this.element.style.top=`${l}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const i=!e?.selection.eq(t.state.selection),s=!e?.doc.eq(t.state.doc);this.updateHandler(t,i,s,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)===null||t===void 0||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const F=t=>new H({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:e=>new it({view:e,...t})});R.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[F({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function W(t,e){return t??new U(e)}const st=typeof window<"u"?p.useLayoutEffect:p.useEffect,j=new Set(["left","opacity","position","top","visibility","width"]),nt=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),ot=new Set(["children","className","style"]),rt=new Set(["tabIndex"]),lt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),at={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function T(t,e){return/^on[A-Z]/.test(t)&&typeof e=="function"}function dt(t){return t.startsWith("aria-")||t.startsWith("data-"),t}function ut(t){return t.startsWith("aria-")||t.startsWith("data-")||lt.has(t)}function q(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function ht(t){var e;const i=t.endsWith("Capture"),s=(i?t.slice(0,-7):t).slice(2);return{eventName:(e=at[s])!==null&&e!==void 0?e:s.toLowerCase(),options:i?{capture:!0}:void 0}}function ct(t,e){let i=e.defaultPrevented,s=!1;const l=Object.create(e);return Object.defineProperties(l,{nativeEvent:{value:e},currentTarget:{value:t},target:{value:e.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>i},isPropagationStopped:{value:()=>s},preventDefault:{value:()=>{i=!0,e.preventDefault()}},stopPropagation:{value:()=>{s=!0,e.stopPropagation()}}}),l}function E(t){return rt.has(t)}function D(t,e,i){if(e==="tabIndex"){t.tabIndex=Number(i);return}t[e]=i}function ft(t,e){if(e==="tabIndex"){t.removeAttribute("tabindex");return}const i=t[e];if(typeof i=="boolean"){t[e]=!1;return}if(typeof i=="number"){t[e]=0;return}t[e]=""}function pt(t,e){return typeof e!="number"||e===0||t.startsWith("--")||nt.has(t)?String(e):`${e}px`}function gt(t,e){j.has(e)||t.style.removeProperty(q(e))}function mt(t,e,i){j.has(e)||t.style.setProperty(q(e),pt(e,i))}function vt(t,e,i){new Set([...Object.keys(e),...Object.keys(i)]).forEach(s=>{if(ot.has(s)||!ut(s)||T(s,e[s])||T(s,i[s]))return;const l=e[s],r=i[s];if(l===r)return;const n=dt(s);if(r==null||r===!1){E(s)&&ft(t,s),t.removeAttribute(n);return}if(r===!0){E(s)&&D(t,s,!0),t.setAttribute(n,"");return}if(E(s)){D(t,s,r);return}t.setAttribute(n,String(r))})}function yt(t,e,i){if(e!==i){if(i){t.className=i;return}t.removeAttribute("class")}}function bt(t,e,i){const s=e??{},l=i??{};new Set([...Object.keys(s),...Object.keys(l)]).forEach(r=>{const n=s[r],d=l[r];if(n!==d){if(d==null){gt(t,r);return}mt(t,r,d)}})}function wt(t,e,i){e.forEach(({eventName:l,listener:r,options:n})=>{t.removeEventListener(l,r,n)});const s=[];return Object.entries(i).forEach(([l,r])=>{if(!T(l,r))return;const{eventName:n,options:d}=ht(l),g=f=>{r(ct(t,f))};t.addEventListener(n,g,d),s.push({eventName:n,listener:g,options:d})}),s}function Y(t,e){const i=p.useRef({}),s=p.useRef([]);st(()=>{const l=i.current;return yt(t,l.className,e.className),bt(t,l.style,e.style),vt(t,l,e),s.current=wt(t,s.current,e),i.current=e,()=>{s.current.forEach(({eventName:r,listener:n,options:d})=>{t.removeEventListener(r,n,d)}),s.current=[]}},[t,e])}const Tt=N.forwardRef(({pluginKey:t,editor:e,updateDelay:i,resizeDelay:s,appendTo:l,shouldShow:r=null,getReferencedVirtualElement:n,options:d,children:g,...f},u)=>{const o=p.useRef(document.createElement("div")),a=p.useRef(W(t,"bubbleMenu")).current;Y(o.current,f),typeof u=="function"?u(o.current):u&&(u.current=o.current);const{editor:h}=z(),c=e||h,m={updateDelay:i,resizeDelay:s,appendTo:l,pluginKey:a,shouldShow:r,getReferencedVirtualElement:n,options:d},y=p.useRef(m);y.current=m;const[O,b]=p.useState(!1),v=p.useRef(!0);return p.useEffect(()=>{if(c?.isDestroyed)return;if(!c){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const w=o.current;w.style.visibility="hidden",w.style.position="absolute";const I=B({...y.current,editor:c,element:w});c.registerPlugin(I);const G=y.current.pluginKey;return v.current=!0,b(!0),()=>{b(!1),c.unregisterPlugin(G),window.requestAnimationFrame(()=>{w.parentNode&&w.parentNode.removeChild(w)})}},[c]),p.useEffect(()=>{if(!(!O||!c||c.isDestroyed)){if(v.current){v.current=!1;return}c.view.dispatch(c.state.tr.setMeta(a,{type:"updateOptions",options:y.current}))}},[O,c,i,s,r,d,l,n,a]),$.createPortal(g,o.current)});N.forwardRef(({pluginKey:t,editor:e,updateDelay:i,resizeDelay:s,appendTo:l,shouldShow:r=null,options:n,children:d,...g},f)=>{const u=p.useRef(document.createElement("div")),o=p.useRef(W(t,"floatingMenu")).current;Y(u.current,g),typeof f=="function"?f(u.current):f&&(f.current=u.current);const{editor:a}=z(),h=e||a,c={updateDelay:i,resizeDelay:s,appendTo:l,pluginKey:o,shouldShow:r,options:n},m=p.useRef(c);m.current=c;const[y,O]=p.useState(!1),b=p.useRef(!0);return p.useEffect(()=>{if(h?.isDestroyed)return;if(!h){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const v=u.current;v.style.visibility="hidden",v.style.position="absolute";const w=F({...m.current,editor:h,element:v});h.registerPlugin(w);const I=m.current.pluginKey;return b.current=!0,O(!0),()=>{O(!1),h.unregisterPlugin(I),window.requestAnimationFrame(()=>{v.parentNode&&v.parentNode.removeChild(v)})}},[h]),p.useEffect(()=>{if(!(!y||!h||h.isDestroyed)){if(b.current){b.current=!1;return}h.view.dispatch(h.state.tr.setMeta(o,{type:"updateOptions",options:m.current}))}},[y,h,i,s,r,n,l,o]),$.createPortal(d,u.current)});export{Tt as B};
1
+ import{A as H,t as U,a9 as S,C as Z,aa as X,f as R,ab as J,ac as Q,o as z}from"./usage-stats-CCyq9Zgo.js";import{gA as C,hk as M,gz as P,hl as x,hm as L,hn as V,ho as K,hp as _,gC as A,eT as N,r as p,ca as $}from"./index-_VeebRNE.js";import{C as k}from"./index-DAKnsBwp.js";function tt(t,e){const i=Math.min(t.top,e.top),s=Math.max(t.bottom,e.bottom),l=Math.min(t.left,e.left),r=Math.max(t.right,e.right)-l,n=s-i;return new DOMRect(l,i,r,n)}var et=class{get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(C(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(M(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(P(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(x(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(L(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(V(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(K(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e;const{selection:i}=this.editor.state,s=(t=this.getReferencedVirtualElement)===null||t===void 0?void 0:t.call(this);if(s)return s;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const l=S(this.view,i.from,i.to);let r={getBoundingClientRect:()=>l,getClientRects:()=>[l]};if(i instanceof Z){let n=this.view.nodeDOM(i.from);const d=n.dataset.nodeViewWrapper?n:n.querySelector("[data-node-view-wrapper]");d&&(n=d),n&&(r={getBoundingClientRect:()=>n.getBoundingClientRect(),getClientRects:()=>[n.getBoundingClientRect()]})}if(i instanceof k){const{$anchorCell:n,$headCell:d}=i,g=n?n.pos:d.pos,f=d?d.pos:n.pos,u=this.view.nodeDOM(g),o=this.view.nodeDOM(f);if(!u||!o)return;const a=u===o?u.getBoundingClientRect():tt(u.getBoundingClientRect(),o.getBoundingClientRect());r={getBoundingClientRect:()=>a,getClientRects:()=>[a]}}return r}constructor({editor:t,element:e,view:i,pluginKey:s="bubbleMenu",updateDelay:l=250,resizeDelay:r=60,shouldShow:n,appendTo:d,getReferencedVirtualElement:g,options:f}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:o,state:a,from:h,to:c})=>{const{doc:m,selection:y}=a,{empty:O}=y,b=!m.textBetween(h,c).length&&X(a.selection),v=this.element.contains(document.activeElement);return!(!(o.hasFocus()||v)||O||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(o,a)=>{const h=!a?.selection.eq(o.state.selection),c=!a?.doc.eq(o.state.doc);!h&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(o,h,c,a)},this.updateDelay))},this.updateHandler=(o,a,h,c)=>{const{composing:m}=o;if(!(m||!a&&!h)){if(!this.getShouldShow(c)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:o})=>{const a=o.getMeta(this.pluginKey);a==="updatePosition"?this.updatePosition():a&&typeof a=="object"&&a.type==="updateOptions"?this.updateOptions(a.options):a==="hide"?this.hide():a==="show"&&(this.updatePosition(),this.show())},this.editor=t,this.element=e,this.view=i,this.pluginKey=s,this.updateDelay=l,this.resizeDelay=r,this.appendTo=d,this.scrollTarget=(u=f?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=g,this.floatingUIOptions={...this.floatingUIOptions,...f},this.element.tabIndex=0,n&&(this.shouldShow=n),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&A(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:i,strategy:s,middlewareData:l})=>{var r,n;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((n=l.hide)===null||n===void 0)&&n.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${e}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:i}=t,s=i.selection.from!==i.selection.to;if(this.updateDelay>0&&s){this.handleDebouncedUpdate(t,e);return}const l=!e?.selection.eq(t.state.selection),r=!e?.doc.eq(t.state.doc);this.updateHandler(t,l,r,e)}getShouldShow(t){var e;const{state:i}=this.view,{selection:s}=i,{ranges:l}=s,r=Math.min(...l.map(d=>d.$from.pos)),n=Math.max(...l.map(d=>d.$to.pos));return((e=this.shouldShow)===null||e===void 0?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:i,oldState:t,from:r,to:n}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)===null||t===void 0||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){var e;const i=(e=t.options.scrollTarget)!==null&&e!==void 0?e:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const B=t=>new H({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:e=>new et({view:e,...t})});R.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[B({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var it=class{getTextContent(t){return J(t,{textSerializers:Q(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(C(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(M(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(P(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(x(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(L(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(V(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(K(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}constructor({editor:t,element:e,view:i,pluginKey:s="floatingMenu",updateDelay:l=250,resizeDelay:r=60,options:n,appendTo:d,shouldShow:g}){var f;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:o})=>{const{selection:a}=o,{$anchor:h,empty:c}=a,m=h.depth===1,y=h.parent.isTextblock&&!h.parent.type.spec.code&&!h.parent.textContent&&h.parent.childCount===0&&!this.getTextContent(h.parent);return!(!u.hasFocus()||!c||!m||!y||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,o,a,h)=>{const{composing:c}=u;if(!(c||!o&&!a)){if(!this.getShouldShow(h)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var o;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((o=this.element.parentNode)===null||o===void 0)&&o.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const o=u.getMeta(this.pluginKey);o==="updatePosition"?this.updatePosition():o&&typeof o=="object"&&o.type==="updateOptions"?this.updateOptions(o.options):o==="hide"?this.hide():o==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=t,this.element=e,this.view=i,this.pluginKey=s,this.updateDelay=l,this.resizeDelay=r,this.appendTo=d,this.scrollTarget=(f=n?.scrollTarget)!==null&&f!==void 0?f:window,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,g&&(this.shouldShow=g),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(t){var e;const{state:i}=this.view,{selection:s}=i,{ranges:l}=s,r=Math.min(...l.map(d=>d.$from.pos)),n=Math.max(...l.map(d=>d.$to.pos));return(e=this.shouldShow)===null||e===void 0?void 0:e.call(this,{editor:this.editor,view:this.view,state:i,oldState:t,from:r,to:n})}updateOptions(t){if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){var e;const i=(e=t.options.scrollTarget)!==null&&e!==void 0?e:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){var t;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const{selection:e}=this.editor.state,i=S(this.view,e.from,e.to);A({getBoundingClientRect:()=>i,getClientRects:()=>[i]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:s,y:l,strategy:r,middlewareData:n})=>{var d,g;if(!((d=n.hide)===null||d===void 0)&&d.referenceHidden||!((g=n.hide)===null||g===void 0)&&g.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${s}px`,this.element.style.top=`${l}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const i=!e?.selection.eq(t.state.selection),s=!e?.doc.eq(t.state.doc);this.updateHandler(t,i,s,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)===null||t===void 0||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const F=t=>new H({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:e=>new it({view:e,...t})});R.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[F({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function W(t,e){return t??new U(e)}const st=typeof window<"u"?p.useLayoutEffect:p.useEffect,j=new Set(["left","opacity","position","top","visibility","width"]),nt=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),ot=new Set(["children","className","style"]),rt=new Set(["tabIndex"]),lt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),at={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function T(t,e){return/^on[A-Z]/.test(t)&&typeof e=="function"}function dt(t){return t.startsWith("aria-")||t.startsWith("data-"),t}function ut(t){return t.startsWith("aria-")||t.startsWith("data-")||lt.has(t)}function q(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function ht(t){var e;const i=t.endsWith("Capture"),s=(i?t.slice(0,-7):t).slice(2);return{eventName:(e=at[s])!==null&&e!==void 0?e:s.toLowerCase(),options:i?{capture:!0}:void 0}}function ct(t,e){let i=e.defaultPrevented,s=!1;const l=Object.create(e);return Object.defineProperties(l,{nativeEvent:{value:e},currentTarget:{value:t},target:{value:e.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>i},isPropagationStopped:{value:()=>s},preventDefault:{value:()=>{i=!0,e.preventDefault()}},stopPropagation:{value:()=>{s=!0,e.stopPropagation()}}}),l}function E(t){return rt.has(t)}function D(t,e,i){if(e==="tabIndex"){t.tabIndex=Number(i);return}t[e]=i}function ft(t,e){if(e==="tabIndex"){t.removeAttribute("tabindex");return}const i=t[e];if(typeof i=="boolean"){t[e]=!1;return}if(typeof i=="number"){t[e]=0;return}t[e]=""}function pt(t,e){return typeof e!="number"||e===0||t.startsWith("--")||nt.has(t)?String(e):`${e}px`}function gt(t,e){j.has(e)||t.style.removeProperty(q(e))}function mt(t,e,i){j.has(e)||t.style.setProperty(q(e),pt(e,i))}function vt(t,e,i){new Set([...Object.keys(e),...Object.keys(i)]).forEach(s=>{if(ot.has(s)||!ut(s)||T(s,e[s])||T(s,i[s]))return;const l=e[s],r=i[s];if(l===r)return;const n=dt(s);if(r==null||r===!1){E(s)&&ft(t,s),t.removeAttribute(n);return}if(r===!0){E(s)&&D(t,s,!0),t.setAttribute(n,"");return}if(E(s)){D(t,s,r);return}t.setAttribute(n,String(r))})}function yt(t,e,i){if(e!==i){if(i){t.className=i;return}t.removeAttribute("class")}}function bt(t,e,i){const s=e??{},l=i??{};new Set([...Object.keys(s),...Object.keys(l)]).forEach(r=>{const n=s[r],d=l[r];if(n!==d){if(d==null){gt(t,r);return}mt(t,r,d)}})}function wt(t,e,i){e.forEach(({eventName:l,listener:r,options:n})=>{t.removeEventListener(l,r,n)});const s=[];return Object.entries(i).forEach(([l,r])=>{if(!T(l,r))return;const{eventName:n,options:d}=ht(l),g=f=>{r(ct(t,f))};t.addEventListener(n,g,d),s.push({eventName:n,listener:g,options:d})}),s}function Y(t,e){const i=p.useRef({}),s=p.useRef([]);st(()=>{const l=i.current;return yt(t,l.className,e.className),bt(t,l.style,e.style),vt(t,l,e),s.current=wt(t,s.current,e),i.current=e,()=>{s.current.forEach(({eventName:r,listener:n,options:d})=>{t.removeEventListener(r,n,d)}),s.current=[]}},[t,e])}const Tt=N.forwardRef(({pluginKey:t,editor:e,updateDelay:i,resizeDelay:s,appendTo:l,shouldShow:r=null,getReferencedVirtualElement:n,options:d,children:g,...f},u)=>{const o=p.useRef(document.createElement("div")),a=p.useRef(W(t,"bubbleMenu")).current;Y(o.current,f),typeof u=="function"?u(o.current):u&&(u.current=o.current);const{editor:h}=z(),c=e||h,m={updateDelay:i,resizeDelay:s,appendTo:l,pluginKey:a,shouldShow:r,getReferencedVirtualElement:n,options:d},y=p.useRef(m);y.current=m;const[O,b]=p.useState(!1),v=p.useRef(!0);return p.useEffect(()=>{if(c?.isDestroyed)return;if(!c){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const w=o.current;w.style.visibility="hidden",w.style.position="absolute";const I=B({...y.current,editor:c,element:w});c.registerPlugin(I);const G=y.current.pluginKey;return v.current=!0,b(!0),()=>{b(!1),c.unregisterPlugin(G),window.requestAnimationFrame(()=>{w.parentNode&&w.parentNode.removeChild(w)})}},[c]),p.useEffect(()=>{if(!(!O||!c||c.isDestroyed)){if(v.current){v.current=!1;return}c.view.dispatch(c.state.tr.setMeta(a,{type:"updateOptions",options:y.current}))}},[O,c,i,s,r,d,l,n,a]),$.createPortal(g,o.current)});N.forwardRef(({pluginKey:t,editor:e,updateDelay:i,resizeDelay:s,appendTo:l,shouldShow:r=null,options:n,children:d,...g},f)=>{const u=p.useRef(document.createElement("div")),o=p.useRef(W(t,"floatingMenu")).current;Y(u.current,g),typeof f=="function"?f(u.current):f&&(f.current=u.current);const{editor:a}=z(),h=e||a,c={updateDelay:i,resizeDelay:s,appendTo:l,pluginKey:o,shouldShow:r,options:n},m=p.useRef(c);m.current=c;const[y,O]=p.useState(!1),b=p.useRef(!0);return p.useEffect(()=>{if(h?.isDestroyed)return;if(!h){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const v=u.current;v.style.visibility="hidden",v.style.position="absolute";const w=F({...m.current,editor:h,element:v});h.registerPlugin(w);const I=m.current.pluginKey;return b.current=!0,O(!0),()=>{O(!1),h.unregisterPlugin(I),window.requestAnimationFrame(()=>{v.parentNode&&v.parentNode.removeChild(v)})}},[h]),p.useEffect(()=>{if(!(!y||!h||h.isDestroyed)){if(b.current){b.current=!1;return}h.view.dispatch(h.state.tr.setMeta(o,{type:"updateOptions",options:m.current}))}},[y,h,i,s,r,n,l,o]),$.createPortal(d,u.current)});export{Tt as B};