decocms 4.388.4 → 4.389.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/dist/client/assets/{AlertCircle-Cat-Fy2i.js → AlertCircle-CVkVxygv.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CSNer7sZ.js → AreaChart-lVePxdbV.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DuxVUo5_.js → ArrowLeft-CN6aZBvX.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CsoDgnUj.js → ArrowRight-FqJnNh3f.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CbPBDOpZ.js → ArrowUp-bOLRJZuX.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-DgQehil3.js → CartesianChart-C3Zko_Et.js} +1 -1
  7. package/dist/client/assets/{Check-BZXRTDaX.js → Check-DL_AGZMy.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-Cj4PQGuv.js → CheckCircle-DtMp-qqq.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DGt31MPD.js → ChevronUp-B6mY-MC1.js} +1 -1
  10. package/dist/client/assets/{Copy01-B6hr4CBg.js → Copy01-6lOOhJcp.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CiYLi_pR.js → CreditCard01-DdYfDHIS.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BITRq5d-.js → DotsVertical-CAjUqtRp.js} +1 -1
  13. package/dist/client/assets/{Download01-CsYfHghd.js → Download01-Dq8Pn8XY.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-zVAOL4kJ.js → ErrorBarContext-B26KvZ3G.js} +1 -1
  15. package/dist/client/assets/{Eye-rQUtSbk6.js → Eye-B5e-ilzV.js} +1 -1
  16. package/dist/client/assets/{Globe04-C_9DD9oO.js → Globe04-_nV993le.js} +1 -1
  17. package/dist/client/assets/{Image01-BLIf6uY9.js → Image01-CkJtDP-I.js} +1 -1
  18. package/dist/client/assets/{Key01-SGIR_QrT.js → Key01-BCuGindq.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-GBQ0rQxQ.js → LayoutLeft-U0F-Da_p.js} +1 -1
  20. package/dist/client/assets/{Line-y7nkMb-C.js → Line-BA6i0Sln.js} +1 -1
  21. package/dist/client/assets/{Link01-BnVQGp2l.js → Link01-BjTxU_bP.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-Dh0AABP8.js → LinkExternal01-DSUCZUJp.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CxisI5ut.js → Monitor01-r707obGd.js} +1 -1
  24. package/dist/client/assets/{Package-DsU1cU6S.js → Package-D2jMN__x.js} +1 -1
  25. package/dist/client/assets/{Palette-CzoNEzRs.js → Palette-DebiHmrq.js} +1 -1
  26. package/dist/client/assets/{Plus-qASEo4cN.js → Plus-BbELO07z.js} +1 -1
  27. package/dist/client/assets/{SearchLg-qmi8uaeX.js → SearchLg-C9MObDBB.js} +1 -1
  28. package/dist/client/assets/{SearchMd-B6NDUgzQ.js → SearchMd-B1Foybfh.js} +1 -1
  29. package/dist/client/assets/{Sector-DK9KwpRN.js → Sector-OiAocllE.js} +1 -1
  30. package/dist/client/assets/{Share07-CMPYQYHk.js → Share07-B2WnpDWD.js} +1 -1
  31. package/dist/client/assets/{Stars01-cdnol_cb.js → Stars01-DUL2jKUJ.js} +1 -1
  32. package/dist/client/assets/{Sun-BSFyLDhg.js → Sun-BKxdX8hu.js} +1 -1
  33. package/dist/client/assets/{Tool01-H9OcfGdq.js → Tool01-BvNT4KDI.js} +1 -1
  34. package/dist/client/assets/{Trash01-mB4s-hrv.js → Trash01-BLoRPhD3.js} +1 -1
  35. package/dist/client/assets/{Upload01-Uv_jtHIk.js → Upload01-CNb1qfRO.js} +1 -1
  36. package/dist/client/assets/{User01-DHGCVvV3.js → User01-U5CIC-GP.js} +1 -1
  37. package/dist/client/assets/{UserSquare-BfT6tB5U.js → UserSquare-CZakdYWe.js} +1 -1
  38. package/dist/client/assets/{Users01-C_qUmfZB.js → Users01-C6BprSkC.js} +1 -1
  39. package/dist/client/assets/{X-vKTIsgL1.js → X-BNszojyh.js} +1 -1
  40. package/dist/client/assets/{XCircle-Cu2Sy8Aw.js → XCircle-BuDwhQqF.js} +1 -1
  41. package/dist/client/assets/{XClose-DFUqDOc8.js → XClose-D_JLFZFT.js} +1 -1
  42. package/dist/client/assets/{Zap-CSRFlEXK.js → Zap-BCwjglMw.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-Burao8Eg.js → ZoomOut-q6Y0RhlM.js} +1 -1
  44. package/dist/client/assets/{access-gate-Bbnx_Qh-.js → access-gate-Clo8Jex8.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-DzNaYAxM.js → add-connection-dialog-C5SXdxkT.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-C0sV-7Xb.js → agent-analytics-es8O9CL0.js} +2 -2
  47. package/dist/client/assets/agent-app-CGYFJjq5.js +1 -0
  48. package/dist/client/assets/{agent-assets-OnbttXnX.js → agent-assets-Dy169ySy.js} +1 -1
  49. package/dist/client/assets/{agent-automation-BSmqRx9Q.js → agent-automation-D1R1huVt.js} +6 -6
  50. package/dist/client/assets/{agent-automations-D7yiwZb3.js → agent-automations-BVBbNAeW.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-CTElBaoM.js → agent-connect-sources-BYoUrpVF.js} +1 -1
  52. package/dist/client/assets/agent-deck-sqReTFoM.js +1 -0
  53. package/dist/client/assets/{agent-e2e-36-yunOr.js → agent-e2e-DxRXY84q.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-B5DGYFrd.js → agent-experiments-_dQ2BC_Q.js} +1 -1
  55. package/dist/client/assets/agent-file-CGmxIBgM.js +1 -0
  56. package/dist/client/assets/{agent-git-BYVAaPsW.js → agent-git-B2s_zuHj.js} +2 -2
  57. package/dist/client/assets/{agent-hosting-BbmS530x.js → agent-hosting-BGGSrQLd.js} +1 -1
  58. package/dist/client/assets/{agent-icon-CzsnrYjD.js → agent-icon-CSebdE0g.js} +1 -1
  59. package/dist/client/assets/agent-library-file-CK_Y2Pye.js +1 -0
  60. package/dist/client/assets/{agent-monitor-C27DYrEB.js → agent-monitor-Dd5ty7vm.js} +1 -1
  61. package/dist/client/assets/{agent-overview-DsQze4i5.js → agent-overview-Cm3ny-qk.js} +1 -1
  62. package/dist/client/assets/agent-settings-B-c4VHd9.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-BNuBiz19.js → agent-site-editor-CDYe7KMp.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-C2ptd6Is.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-B7A6sQQt.js +2 -0
  66. package/dist/client/assets/agent-site-editor-preview-sULLmso9.js +518 -0
  67. package/dist/client/assets/agent-view-C2yjGU43.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-C4pdkmKc.js → agent-view-guard-a8AZfEO9.js} +1 -1
  69. package/dist/client/assets/{agents-list-B3F1REj8.js → agents-list-oZyF4Ii3.js} +1 -1
  70. package/dist/client/assets/{ai-providers-BYHAVCy5.js → ai-providers-BlScv4nl.js} +2 -2
  71. package/dist/client/assets/{alert-DsW1KUvt.js → alert-DsihHj7h.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-Dg6YJ6PP.js → alert-dialog-DeRt3vSN.js} +1 -1
  73. package/dist/client/assets/{api-keys-DDd9VBHu.js → api-keys-C9NfUH35.js} +1 -1
  74. package/dist/client/assets/api-keys-D3tjigFv.js +1 -0
  75. package/dist/client/assets/app-editor-D_REDtDg.js +1 -0
  76. package/dist/client/assets/{asset-utils-DOWh4JzZ.js → asset-utils-BS06OXCA.js} +1 -1
  77. package/dist/client/assets/{auth-D3Q2r2cz.js → auth-B-OXMWGw.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-M53zUwPP.js → auth-catchall-CLBv3q5z.js} +1 -1
  79. package/dist/client/assets/{auth-entry-CQhZUGUz.js → auth-entry-uRCGi0qy.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-Cp7zhn_p.js → auth-split-layout-C9jB6J1h.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-DG9xWGRs.js → authenticate-and-persist-oauth-B71_ZhsC.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DuetYP8A.js → automation-list-row-BX3OvbcZ.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DrVjV_Uv.js → automation-runs-CUFGFLxs.js} +1 -1
  84. package/dist/client/assets/automations-DGcV2mJq.js +1 -0
  85. package/dist/client/assets/{autosend-C5knIVwo.js → autosend-pQ9pD2-2.js} +1 -1
  86. package/dist/client/assets/{avatar-CLf3yQhN.js → avatar-GIuLZx2C.js} +1 -1
  87. package/dist/client/assets/{badge-DuB4cqrw.js → badge-DS3KIYvS.js} +1 -1
  88. package/dist/client/assets/{block-document-DZ3zGn-U.js → block-document-WF9-dn_8.js} +3 -3
  89. package/dist/client/assets/blocks-preview-workspace-context-BlZqg5yu.js +1 -0
  90. package/dist/client/assets/{breadcrumb-SXbKtw7u.js → breadcrumb-D6xZIsj2.js} +1 -1
  91. package/dist/client/assets/{buckets-D7jxbA8X.js → buckets-CNixgGHU.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-DKo7W0US.js → build-improve-prompt-doc-DeGFReow.js} +1 -1
  93. package/dist/client/assets/{bulk-category-panel-CS9EslBN.js → bulk-category-panel-BS5_T4uL.js} +1 -1
  94. package/dist/client/assets/{calendar-D41RMBsP.js → calendar-D4hMMrVq.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-CYpF4fm6.js → capability-load-error-BjI2iK0-.js} +1 -1
  96. package/dist/client/assets/category-editor-BFX9U9Yh.js +1 -0
  97. package/dist/client/assets/{chart-CdmZzz30.js → chart-CdPsiu6K.js} +1 -1
  98. package/dist/client/assets/{chat-context-D1GbDSrr.js → chat-context-HOmU0YHH.js} +6 -6
  99. package/dist/client/assets/{chat-draft-VYqGGS3B.js → chat-draft-BdxqYU8-.js} +1 -1
  100. package/dist/client/assets/{checkbox-BKGUJJNh.js → checkbox-DBYfq56y.js} +1 -1
  101. package/dist/client/assets/{choose-editor-Dkb9gjmg.js → choose-editor-DSxVv7hu.js} +1 -1
  102. package/dist/client/assets/{claim-phase-copy-0btUuJoC.js → claim-phase-copy-njXeDF0h.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-BFRzX7yY.js → cli-auth-success-uK8yk1Sb.js} +1 -1
  104. package/dist/client/assets/{client-icons-CIit2qYG.js → client-icons-CaoDPAaa.js} +1 -1
  105. package/dist/client/assets/{collapsible-eiDLfZY7.js → collapsible-BpIxv8-d.js} +1 -1
  106. package/dist/client/assets/{collection-detail-D6aw3A-V.js → collection-detail-vK2X038F.js} +1 -1
  107. package/dist/client/assets/{collection-display-button-D9O76Rnp.js → collection-display-button-ChjN1roR.js} +1 -1
  108. package/dist/client/assets/{collection-search-BQXOJg8a.js → collection-search-DyuqjLWs.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-zKpdBBAO.js → collection-table-wrapper-CNNpAz5Y.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-BWQrYrdS.js → collection-tabs-3_QvnkN-.js} +1 -1
  111. package/dist/client/assets/combobox-OP-CbRFf.js +1 -0
  112. package/dist/client/assets/command-ByUEKQB9.js +1 -0
  113. package/dist/client/assets/{companion-mcps-section-8c0rXQex.js → companion-mcps-section-6HKE7JJ2.js} +1 -1
  114. package/dist/client/assets/{connect-B9ZzFP7o.js → connect-CsNBKbv0.js} +2 -2
  115. package/dist/client/assets/{connect-layout-CSTvrhGM.js → connect-layout-DVtCwqcX.js} +1 -1
  116. package/dist/client/assets/{connection-DzM2SOZ6.js → connection-DR9gf0au.js} +1 -1
  117. package/dist/client/assets/{connection-card-DF11WhqU.js → connection-card-BOo8yulu.js} +1 -1
  118. package/dist/client/assets/{connection-detail-Dimacfl3.js → connection-detail-BqzECTqG.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-CyBATU5Y.js → connection-form-helpers-D5P5OxyV.js} +1 -1
  120. package/dist/client/assets/{connections-C_1m4t4b.js → connections-DH9JM6iR.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-Cy1fVEro.js → create-organization-dialog-S8LtKHhd.js} +1 -1
  122. package/dist/client/assets/{decofile-api-DkM3ZQFM.js → decofile-api-CWaaGMA2.js} +1 -1
  123. package/dist/client/assets/{decopilot-YckYKTsg.js → decopilot-B7-O9fZC.js} +2 -2
  124. package/dist/client/assets/{dialog-C36x61_J.js → dialog-BG6kEGFR.js} +1 -1
  125. package/dist/client/assets/{discover-CqgNMlsp.js → discover-OS0btTyd.js} +1 -1
  126. package/dist/client/assets/{domain-settings-D6TBWbch.js → domain-settings-BrbTzYfK.js} +1 -1
  127. package/dist/client/assets/{download-app-dialog-7J000m-o.js → download-app-dialog-NqW4PLAx.js} +1 -1
  128. package/dist/client/assets/{drawer-CsJzOKcM.js → drawer-Bl-PPIzX.js} +1 -1
  129. package/dist/client/assets/{editor-BQuCFEpz.js → editor-BiwQpn1s.js} +1 -1
  130. package/dist/client/assets/{empty-state-ClBiZqLf.js → empty-state-BpI78UAU.js} +1 -1
  131. package/dist/client/assets/{empty-state-gVTYQvW1.js → empty-state-DzReaOau.js} +1 -1
  132. package/dist/client/assets/{extract-connection-data-BIqslos8.js → extract-connection-data-BimwPioU.js} +1 -1
  133. package/dist/client/assets/{feature-gate-DLeaUXYN.js → feature-gate-B63BZEdG.js} +1 -1
  134. package/dist/client/assets/{feature-paywall-lhh7GOr7.js → feature-paywall-DwNmZ-M9.js} +1 -1
  135. package/dist/client/assets/{file-explorer-BRRFAgbe.js → file-explorer-DLzYcbz9.js} +1 -1
  136. package/dist/client/assets/{file-preview-DobzjEc2.js → file-preview-DCBxvWAy.js} +1 -1
  137. package/dist/client/assets/{file-share-button-6XYGV6w8.js → file-share-button-Cz0mgdAm.js} +1 -1
  138. package/dist/client/assets/{file-type-icon-CFRsMAQ4.js → file-type-icon-Cbv1Det1.js} +1 -1
  139. package/dist/client/assets/{folder-icon-CxyYiSJb.js → folder-icon-DltflRpD.js} +1 -1
  140. package/dist/client/assets/{form-CXSt7_li.js → form-Bx8qGby0.js} +1 -1
  141. package/dist/client/assets/{gateway-client-BF14HPqj.js → gateway-client-DiyAsoDf.js} +1 -1
  142. package/dist/client/assets/{general-0kms2_Mb.js → general-DTp5FT8F.js} +1 -1
  143. package/dist/client/assets/{github-icon-CIx0jkrL.js → github-icon-Bx6tzbBb.js} +1 -1
  144. package/dist/client/assets/{home-CyQJcQvg.js → home-tpS1TH6x.js} +1 -1
  145. package/dist/client/assets/{hooks-enzgIMXj.js → hooks-ZOtfl4oi.js} +2 -2
  146. package/dist/client/assets/{hooks-C8t7cMQJ.js → hooks-lZSCdRwc.js} +1 -1
  147. package/dist/client/assets/{icon-button-Df-IeDHT.js → icon-button-BudvJWM8.js} +1 -1
  148. package/dist/client/assets/{index-Ci3v6d1n.js → index-B7pMCohP.js} +1 -1
  149. package/dist/client/assets/index-B88q0man.css +1 -0
  150. package/dist/client/assets/{index-B7z_63F4.js → index-B8ZawsDP.js} +1 -1
  151. package/dist/client/assets/{index-DC9_5qIh.js → index-B9lZAmmH.js} +1 -1
  152. package/dist/client/assets/{index-DowxFM-Z.js → index-Bzch_Lwn.js} +1 -1
  153. package/dist/client/assets/{index-ClQyNrgO.js → index-C-u7JO1Y.js} +1 -1
  154. package/dist/client/assets/{index-Doi07Y6T.js → index-C0e8Nw2i.js} +1 -1
  155. package/dist/client/assets/{index-Byz-UaqT.js → index-CR8U3UFH.js} +1 -1
  156. package/dist/client/assets/{index-doEaURqC.js → index-CyBVTyGa.js} +7 -7
  157. package/dist/client/assets/{index-DV9UJZA2.js → index-CzuzrcF3.js} +1 -1
  158. package/dist/client/assets/{index-BoSUEB27.js → index-DeVdNW-7.js} +1 -1
  159. package/dist/client/assets/{index-CDAG9yf3.js → index-DmF8NlWI.js} +1 -1
  160. package/dist/client/assets/{index-BODjkOG4.js → index-DmsjOEhK.js} +1 -1
  161. package/dist/client/assets/{index-C4LzZ3-O.js → index-DtBnPwzh.js} +1 -1
  162. package/dist/client/assets/{index-D9padtMD.js → index-nJTy1ykh.js} +1 -1
  163. package/dist/client/assets/{index-redirect-XY4L95T5.js → index-redirect-lSGpveHC.js} +1 -1
  164. package/dist/client/assets/{infiniteQueryObserver-CxJm0T6_.js → infiniteQueryObserver-COZ-9XSO.js} +1 -1
  165. package/dist/client/assets/{infra-billing-zdKJ_MUK.js → infra-billing-ZSvY9y-Y.js} +1 -1
  166. package/dist/client/assets/input-D5Zi_pUc.js +1 -0
  167. package/dist/client/assets/{input-BT236l5B.js → input-DMG-B3VZ.js} +2 -2
  168. package/dist/client/assets/{input-CLIoB1hh.js → input-DOIUaBAK.js} +1 -1
  169. package/dist/client/assets/{integration-icon-Crk6WRxP.js → integration-icon-mTqkOE6y.js} +1 -1
  170. package/dist/client/assets/{label-tAsQMZ2G.js → label-DVhvlWqs.js} +1 -1
  171. package/dist/client/assets/{last-preview-page-002026Ee.js → last-preview-page-Cc9l6ICr.js} +1 -1
  172. package/dist/client/assets/{layout-CCpqo3zm.js → layout-0DaHUY7Z.js} +1 -1
  173. package/dist/client/assets/{legacy-agents-deep-Cj78AYzA.js → legacy-agents-deep-O9zXW4qh.js} +1 -1
  174. package/dist/client/assets/{legacy-main-redirect-Dn96iLn4.js → legacy-main-redirect-MeePJHje.js} +1 -1
  175. package/dist/client/assets/{library-BuoDGyY9.js → library-DHdWNZX-.js} +1 -1
  176. package/dist/client/assets/{login-DqL9YZRz.js → login-CXyISdG5.js} +1 -1
  177. package/dist/client/assets/{markdown-D0jNOMCX.js → markdown-DCPDulUN.js} +1 -1
  178. package/dist/client/assets/{mcp-app-renderer-BvLPqeD1.js → mcp-app-renderer-DBdofBbE.js} +2 -2
  179. package/dist/client/assets/{mcp-oauth-61IHYJoj.js → mcp-oauth-DdNMjTqu.js} +1 -1
  180. package/dist/client/assets/{members-BcXF5gIl.js → members-YBQ4CS4C.js} +1 -1
  181. package/dist/client/assets/{message-templates-CUQwBtaa.js → message-templates-B-vmK4Xp.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-DbALNxiX.js → mini-report-page-DekMuoTa.js} +1 -1
  183. package/dist/client/assets/{mock-board-D9-PmaL9.js → mock-board-D9NUZPwb.js} +9 -9
  184. package/dist/client/assets/{monaco-editor-xB6SdWXy.js → monaco-editor-tpWF7AL5.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CTbrFT2U.js → monitoring-stats-row-D_bvL4CA.js} +1 -1
  186. package/dist/client/assets/{multi-select-BPlBOZll.js → multi-select-C3lQgqH3.js} +1 -1
  187. package/dist/client/assets/{mustache-Btjjkmrx.js → mustache-BU3hKYND.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-D8-Vh_4C.js → oauth-callback-BiuyznT3.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-Dpai0ql-.js → oauth-callback-ai-provider-DqtXAIB8.js} +1 -1
  190. package/dist/client/assets/{onboarding-uOVvp-Mg.js → onboarding-BS368ORS.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-BQt56FI4.js → optimistic-project-sidebar-views-BfkTIuSj.js} +1 -1
  192. package/dist/client/assets/org-file-open-context-Bh_zBQ2O.js +1 -0
  193. package/dist/client/assets/{organization-choice-9DpczJ4c.js → organization-choice-GuO7qGDl.js} +1 -1
  194. package/dist/client/assets/{orgs-B6tWlX0C.js → orgs-DhHpNlvn.js} +1 -1
  195. package/dist/client/assets/page-seo-form-BML1eDhR.js +1 -0
  196. package/dist/client/assets/{pair-BIUMok9W.js → pair-CIltybgP.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-DjuDG4EH.js → plan-ladder-BEYdYGx8.js} +1 -1
  198. package/dist/client/assets/{popover-GUR8piky.js → popover-CUdTfYte.js} +1 -1
  199. package/dist/client/assets/post-calendar-BVrfveN8.js +1 -0
  200. package/dist/client/assets/post-editor-LBOMfHyI.js +1 -0
  201. package/dist/client/assets/{preview-content-CkHbAlf-.js → preview-content-D7H_AlKU.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-DUI33rZ8.js → preview-dialog-CUz95NoQ.js} +1 -1
  203. package/dist/client/assets/{primitives-CHkTFFF-.js → primitives-CyfO2GN8.js} +1 -1
  204. package/dist/client/assets/{profile-BIFbXoSW.js → profile-BNPVU14n.js} +1 -1
  205. package/dist/client/assets/{project-app-view-ZkgOByQo.js → project-app-view-Dm6c4g3t.js} +1 -1
  206. package/dist/client/assets/{project-feed-DGoAUO34.js → project-feed-orYCz9U3.js} +1 -1
  207. package/dist/client/assets/{project-icon-mjklzNJs.js → project-icon-DWnsLAeJ.js} +1 -1
  208. package/dist/client/assets/project-reports-DhaLYRaZ.js +1 -0
  209. package/dist/client/assets/project-tasks-Dzzzm0ET.js +1 -0
  210. package/dist/client/assets/{prompts-BwsVrHFI.js → prompts-Dpv9Ex1_.js} +1 -1
  211. package/dist/client/assets/record-editor-BQ-gbw4b.js +1 -0
  212. package/dist/client/assets/redirect-editor-eLzPdMVZ.js +1 -0
  213. package/dist/client/assets/reports-8U4sSr1z.js +1 -0
  214. package/dist/client/assets/{reports-ChF6GDQz.js → reports-CUfYm0DC.js} +1 -1
  215. package/dist/client/assets/{reports-onboarding-ukyewr1e.js → reports-onboarding-V3a9FHx8.js} +1 -1
  216. package/dist/client/assets/{reports-tab-Cxq1-mux.js → reports-tab-Bx7-g2HC.js} +2 -2
  217. package/dist/client/assets/{repositories-D7d8VzOE.js → repositories-Bbw6GL37.js} +1 -1
  218. package/dist/client/assets/{repository-import-picker-B6ijLkOL.js → repository-import-picker-74Y3ta69.js} +1 -1
  219. package/dist/client/assets/{repository-picker-Ca5oB9j5.js → repository-picker-dKTE5PS5.js} +1 -1
  220. package/dist/client/assets/{require-capability-vhXMBpff.js → require-capability-QoYjHav_.js} +1 -1
  221. package/dist/client/assets/{required-auth-layout-DbGCmQgx.js → required-auth-layout-BgLvQHTP.js} +1 -1
  222. package/dist/client/assets/{reset-password-DrRaSkr-.js → reset-password-ateNgI6E.js} +1 -1
  223. package/dist/client/assets/{resizable-WgWAPECX.js → resizable-D6HLmII4.js} +1 -1
  224. package/dist/client/assets/{review-settings-BzcjRJO0.js → review-settings-jZZT0JG1.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-i_tw_Jd2.js → rich-text-link-control-0ZhNexVb.js} +2 -2
  226. package/dist/client/assets/{roles-DTbcvvsD.js → roles-ERYsouVf.js} +1 -1
  227. package/dist/client/assets/{route-BRh6VH3Q.js → route-D5DT7lzH.js} +1 -1
  228. package/dist/client/assets/{route-B8hLxHmX.js → route-DW_oVxtq.js} +1 -1
  229. package/dist/client/assets/{route-DsWfLZyf.js → route-HgZwHfFA.js} +1 -1
  230. package/dist/client/assets/{route-page-header-tbVW9ntg.js → route-page-header-BHdnDvfR.js} +1 -1
  231. package/dist/client/assets/runnable-block-editor-DrtKYS1k.js +17 -0
  232. package/dist/client/assets/{sandbox-lifecycle-context-CvyFr09R.js → sandbox-lifecycle-context-LNZL2c0K.js} +2 -2
  233. package/dist/client/assets/{schema-BVqtjcyJ.js → schema-DSsDEA1v.js} +1 -1
  234. package/dist/client/assets/{scroll-area-Cve7MqyA.js → scroll-area-CmvmQLS1.js} +1 -1
  235. package/dist/client/assets/{search-input-CCUlZDzf.js → search-input-0hd-PWUF.js} +1 -1
  236. package/dist/client/assets/{search-toggle-BtmGTpxl.js → search-toggle-Bp6o4xvm.js} +1 -1
  237. package/dist/client/assets/{secret-picker-DVWtSCXk.js → secret-picker--QwK1qR-.js} +1 -1
  238. package/dist/client/assets/{secrets-dQAYGJYM.js → secrets-ODT01eOm.js} +1 -1
  239. package/dist/client/assets/sections-editor-DwSDIcRs.js +1 -0
  240. package/dist/client/assets/select-CDhEibGy.js +1 -0
  241. package/dist/client/assets/{select-model-Bnz73VTx.js → select-model-Dd7JcBMF.js} +1 -1
  242. package/dist/client/assets/seo-editor-BMnaZ5KR.js +1 -0
  243. package/dist/client/assets/{separator-JATiwE_2.js → separator-D-_LXjFg.js} +1 -1
  244. package/dist/client/assets/{settings-tab-CE0tP2vq.js → settings-tab-CKxa2O9d.js} +4 -4
  245. package/dist/client/assets/{sheet-ZoEgH6s-.js → sheet-DH_REC9j.js} +1 -1
  246. package/dist/client/assets/shell-layout-B3x_9fo1.js +1 -0
  247. package/dist/client/assets/{sidebar-Cz1S2PSM.js → sidebar-CxoDmdm4.js} +1 -1
  248. package/dist/client/assets/{skill-preview-BP5xxsO4.js → skill-preview-D4GrMJU0.js} +1 -1
  249. package/dist/client/assets/{skills-D52kTkau.js → skills-BYtnT-vq.js} +1 -1
  250. package/dist/client/assets/{sso-DAgB-pSG.js → sso-C8v2EdhJ.js} +1 -1
  251. package/dist/client/assets/{switch-BNLiV_oA.js → switch-C7dIR4UF.js} +1 -1
  252. package/dist/client/assets/{synced-repos-BzaJ7fNm.js → synced-repos-BNAaKJnR.js} +1 -1
  253. package/dist/client/assets/{table-D7l9brRh.js → table-B9OXzOjU.js} +1 -1
  254. package/dist/client/assets/{tabs-Gq0qvZI4.js → tabs-D6s_HA-y.js} +1 -1
  255. package/dist/client/assets/{task-board-BXLBBo-B.js → task-board-Qj-6Ctqf.js} +1 -1
  256. package/dist/client/assets/{task-route-BpYPpL3v.js → task-route-9wqWimw6.js} +1 -1
  257. package/dist/client/assets/{task-status-C7fhyr8_.js → task-status-D5cWLC8O.js} +1 -1
  258. package/dist/client/assets/{taskboard-analytics-Bhbjv4p8.js → taskboard-analytics-BtiQkIih.js} +1 -1
  259. package/dist/client/assets/{tasks-C2avg53f.js → tasks-BF0fu0p2.js} +2 -2
  260. package/dist/client/assets/tasks-D4PEOEIP.js +1 -0
  261. package/dist/client/assets/textarea-TE2JJa-B.js +1 -0
  262. package/dist/client/assets/{thread-button-CzoAkKWi.js → thread-button-DUOTtsFE.js} +1 -1
  263. package/dist/client/assets/{thread-intent-DuCE7MYG.js → thread-intent-jq9HKW3p.js} +1 -1
  264. package/dist/client/assets/{thread-route-C5QqTXOt.js → thread-route-C47YRRAe.js} +1 -1
  265. package/dist/client/assets/{thread-route-BBKn0p1b.js → thread-route-JcpQ-ikA.js} +1 -1
  266. package/dist/client/assets/{thread-sheet-body-C52UGBXx.js → thread-sheet-body-DvAYJwTc.js} +1 -1
  267. package/dist/client/assets/{toggle-group-DHrftnUg.js → toggle-group-Dv_lnjT7.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-iy_uLVVB.js → toolbar-icon-button-Cq75cloK.js} +1 -1
  269. package/dist/client/assets/{tooltip-C91IS2ON.js → tooltip-BjUMPvkB.js} +1 -1
  270. package/dist/client/assets/{track-CpCOxAsM.js → track-CNE2_M0H.js} +1 -1
  271. package/dist/client/assets/{types-BCbJ4Eml.js → types-Bxr6Ak0g.js} +3 -3
  272. package/dist/client/assets/{usage-stats-P7Ebxq4V.js → usage-stats-Bug-9_EL.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-CJ2ga4nx.js → use-ai-providers-ShRDl02e.js} +1 -1
  274. package/dist/client/assets/{use-automations-V0dkF89H.js → use-automations-qnBbEhgN.js} +1 -1
  275. package/dist/client/assets/{use-autosave-ClFMVO3A.js → use-autosave-exq2JPmQ.js} +1 -1
  276. package/dist/client/assets/{use-connect-companion-CXK99yF4.js → use-connect-companion-DQoSkSuB.js} +1 -1
  277. package/dist/client/assets/{use-connection-PgTQPnAp.js → use-connection-WQuJ5yl_.js} +1 -1
  278. package/dist/client/assets/{use-copy-CGJ-16i-.js → use-copy-CPOYPvBF.js} +1 -1
  279. package/dist/client/assets/{use-create-virtual-mcp-D4lB4pbk.js → use-create-virtual-mcp-Da7cL0aL.js} +1 -1
  280. package/dist/client/assets/{use-date-fns-locale-VjB0j61V.js → use-date-fns-locale-BcOQz_O6.js} +1 -1
  281. package/dist/client/assets/{use-debounced-autosave-Du2G3qf3.js → use-debounced-autosave-BnbZSVdn.js} +1 -1
  282. package/dist/client/assets/{use-debounced-value-CG2jgHBI.js → use-debounced-value-DHN-wkc6.js} +1 -1
  283. package/dist/client/assets/{use-deco-credits-DU8sJrax.js → use-deco-credits-Fltfd2iB.js} +1 -1
  284. package/dist/client/assets/{use-decopilot-events-x0K7Zb7m.js → use-decopilot-events-DF_mJ7FX.js} +1 -1
  285. package/dist/client/assets/{use-delete-connection-Pe3fW9Dc.js → use-delete-connection-Di7K1zHS.js} +1 -1
  286. package/dist/client/assets/{use-deployment-admin-CWwZo7oV.js → use-deployment-admin-Ney-Hrk_.js} +1 -1
  287. package/dist/client/assets/{use-entitlements-pN-YIa6T.js → use-entitlements-D6f3xZaU.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-CCQm80wV.js → use-fast-preview-draft-url-B6rIt3gA.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-CzJCjBKX.js → use-file-configs-Cd7oj9Fw.js} +1 -1
  290. package/dist/client/assets/{use-in-settings-DplznXN9.js → use-in-settings-8fsBM1xN.js} +1 -1
  291. package/dist/client/assets/{use-infinite-scroll-Bm905rys.js → use-infinite-scroll-BCiTqxTQ.js} +1 -1
  292. package/dist/client/assets/{use-join-requests-D4wrlTl5.js → use-join-requests-BFN9i-Es.js} +1 -1
  293. package/dist/client/assets/use-main-panel-tabs-Wh3mzXf2.js +1 -0
  294. package/dist/client/assets/{use-mcp-auth-status-BnAPI8Zf.js → use-mcp-auth-status-B1aTfNe_.js} +1 -1
  295. package/dist/client/assets/{use-mcp-client-D2DgMGL-.js → use-mcp-client-CqKNXJW7.js} +1 -1
  296. package/dist/client/assets/{use-mcp-prompts-UNzUvECH.js → use-mcp-prompts-DpED8Vrg.js} +1 -1
  297. package/dist/client/assets/{use-mcp-tools-CtMvHJK9.js → use-mcp-tools-BgkfMsvS.js} +1 -1
  298. package/dist/client/assets/{use-members-C_tB-qI-.js → use-members-CeW4sAKm.js} +1 -1
  299. package/dist/client/assets/{use-mobile-DYpKQ1eP.js → use-mobile-CUQu4L8c.js} +1 -1
  300. package/dist/client/assets/{use-navigate-to-agent-TwlhlbmB.js → use-navigate-to-agent-W6hb3mqs.js} +1 -1
  301. package/dist/client/assets/{use-open-billing-url-BrlDdS6U.js → use-open-billing-url-KLMgEPxW.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-BkVvw_9f.js → use-org-auth-client-zTkj17z7.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-Bbl2QQqg.js → use-org-fs-B1IHOZ9S.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-Ds4sFbSY.js → use-org-repo-syncs-CksqUgv6.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-BnqcEd47.js → use-org-sso-CI1_4UQM.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-3K_wbMHo.js → use-organization-roles-DeV7SnLa.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-Wh36EN0I.js → use-organization-settings-4gJ9Tp49.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-xYH0iX8e.js → use-panel-navigate-Bg-MVKv6.js} +1 -1
  309. package/dist/client/assets/{use-project-native-view-presence-U59DT0hQ.js → use-project-native-view-presence-C3jxCCXQ.js} +1 -1
  310. package/dist/client/assets/{use-project-scope-CENQvfVc.js → use-project-scope-CRdwBUT7.js} +1 -1
  311. package/dist/client/assets/{use-releases-_xbQ8yPk.js → use-releases-nsAtxjuW.js} +1 -1
  312. package/dist/client/assets/{use-reports-diagnostic-Cz_g9Pum.js → use-reports-diagnostic-CtuJZ5jH.js} +1 -1
  313. package/dist/client/assets/{use-route-default-main-evb2BAGs.js → use-route-default-main-DA5X9xDG.js} +1 -1
  314. package/dist/client/assets/{use-secrets-44zj-3N9.js → use-secrets-BfDHS5Uq.js} +1 -1
  315. package/dist/client/assets/use-section-preview-base-DW4RpMx9.js +1 -0
  316. package/dist/client/assets/{use-session-runtime-COugfsOm.js → use-session-runtime-DiG_Qt8i.js} +1 -1
  317. package/dist/client/assets/{use-tags-BqebMAjW.js → use-tags-BloUFB1L.js} +1 -1
  318. package/dist/client/assets/{use-task-board-analytics-CElip-Jh.js → use-task-board-analytics-C7hgblhm.js} +1 -1
  319. package/dist/client/assets/{use-task-metadata-Dhub_XGT.js → use-task-metadata-ehugU85S.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-DldRsY9l.js → use-thread-outputs-C9_GjCjS.js} +1 -1
  321. package/dist/client/assets/{use-virtual-mcp-B-mdsJbn.js → use-virtual-mcp-Vg_Ogz61.js} +1 -1
  322. package/dist/client/assets/useInfiniteQuery-DebjMHv1.js +1 -0
  323. package/dist/client/assets/{useQueries-CrUxqve0.js → useQueries-CDvJYO-m.js} +1 -1
  324. package/dist/client/assets/useSuspenseInfiniteQuery-CqRV1dKR.js +1 -0
  325. package/dist/client/assets/{users-XpLTDG6s.js → users-BC2i5HSG.js} +1 -1
  326. package/dist/client/assets/{utils-BcFrUaDf.js → utils-Bf0RpmgB.js} +1 -1
  327. package/dist/client/assets/variant-calendar-BWeWEpfR.js +1 -0
  328. package/dist/client/assets/{variant-matcher-override-DWffsqol.js → variant-matcher-override-fLxntWss.js} +1 -1
  329. package/dist/client/assets/{view-mode-toggle-Bsk0Q0dk.js → view-mode-toggle-DQkw8yuh.js} +1 -1
  330. package/dist/client/assets/{virtual-mcp-Bj7Y16hO.js → virtual-mcp-S8IoUqby.js} +1 -1
  331. package/dist/client/index.html +2 -2
  332. package/dist/server/cli.js +1 -1
  333. package/dist/server/server.js +1 -1
  334. package/package.json +1 -1
  335. package/dist/client/assets/agent-app-D8aCkILQ.js +0 -1
  336. package/dist/client/assets/agent-deck-JfSkYOo0.js +0 -1
  337. package/dist/client/assets/agent-file-BQkNRXR6.js +0 -1
  338. package/dist/client/assets/agent-library-file-B_9ZfsqS.js +0 -1
  339. package/dist/client/assets/agent-settings-Dlb-w-aW.js +0 -1
  340. package/dist/client/assets/agent-site-editor-code-Cg74frt9.js +0 -2
  341. package/dist/client/assets/agent-site-editor-content-BMF_TO-O.js +0 -2
  342. package/dist/client/assets/agent-site-editor-preview-DfUEy_mW.js +0 -518
  343. package/dist/client/assets/agent-view-9ku1NYkG.js +0 -1
  344. package/dist/client/assets/api-keys-CB0BbOJK.js +0 -1
  345. package/dist/client/assets/app-editor-6ntO4YLY.js +0 -1
  346. package/dist/client/assets/automations-CflFKE1S.js +0 -1
  347. package/dist/client/assets/blocks-preview-workspace-context-CGrONP0s.js +0 -1
  348. package/dist/client/assets/category-editor-CMewSARd.js +0 -1
  349. package/dist/client/assets/combobox-B1IXE26_.js +0 -1
  350. package/dist/client/assets/command-CDaLB2Ox.js +0 -1
  351. package/dist/client/assets/index-xA_kfo6T.css +0 -1
  352. package/dist/client/assets/input-BK5Sp8hZ.js +0 -1
  353. package/dist/client/assets/org-file-open-context-DodrnIMR.js +0 -1
  354. package/dist/client/assets/page-seo-form-Dbz3eu1p.js +0 -1
  355. package/dist/client/assets/post-calendar-FfQIYQQi.js +0 -1
  356. package/dist/client/assets/post-editor-YU4-WfQ7.js +0 -1
  357. package/dist/client/assets/project-reports-DVMPWWFi.js +0 -1
  358. package/dist/client/assets/project-tasks-Jy5UvQy6.js +0 -1
  359. package/dist/client/assets/record-editor-CXOCBCZ1.js +0 -1
  360. package/dist/client/assets/redirect-editor-MDe3fibH.js +0 -1
  361. package/dist/client/assets/reports-DwYY1RWm.js +0 -1
  362. package/dist/client/assets/runnable-block-editor-CdEmnBad.js +0 -16
  363. package/dist/client/assets/sections-editor-C6cdGUNk.js +0 -2
  364. package/dist/client/assets/select-oEHCSTZi.js +0 -1
  365. package/dist/client/assets/seo-editor-BD39YQzP.js +0 -1
  366. package/dist/client/assets/shell-layout-BNVBlKMe.js +0 -1
  367. package/dist/client/assets/tasks-aGbeVyrS.js +0 -1
  368. package/dist/client/assets/textarea-B9cyNs7j.js +0 -1
  369. package/dist/client/assets/use-main-panel-tabs-BcprnHpG.js +0 -1
  370. package/dist/client/assets/use-section-preview-base-BbxztEDH.js +0 -1
  371. package/dist/client/assets/useInfiniteQuery-DCZL7BN4.js +0 -1
  372. package/dist/client/assets/useSuspenseInfiniteQuery-C0KSbZH8.js +0 -1
  373. package/dist/client/assets/variant-calendar-BPWkuyHy.js +0 -1
@@ -1 +1 @@
1
- import{c as n,j as o}from"./index-doEaURqC.js";function a(r){const e=n.c(4),{size:t,className:c}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=s):s=e[0];let i;return e[1]!==c||e[2]!==t?(i=o.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:c,children:s}),e[1]=c,e[2]=t,e[3]=i):i=e[3],i}export{a as G};
1
+ import{c as n,j as o}from"./index-CyBVTyGa.js";function a(r){const e=n.c(4),{size:t,className:c}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=s):s=e[0];let i;return e[1]!==c||e[2]!==t?(i=o.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:c,children:s}),e[1]=c,e[2]=t,e[3]=i):i=e[3],i}export{a as G};
@@ -1 +1 @@
1
- import{c as S,b as $,a0 as B,j as o,L as Y,q as z,B as q,af as U,a6 as V,K as W,m as X,Z,a as ee,r as F,ae as te,n as R,ai as oe,h as re}from"./index-doEaURqC.js";import{C as ie}from"./index-D9padtMD.js";import{s as se}from"./Plus-qASEo4cN.js";import{i as ne}from"./SearchLg-qmi8uaeX.js";import{C as le}from"./input-BT236l5B.js";import{D as me,C as ae}from"./chat-context-D1GbDSrr.js";import{a as ce}from"./use-organization-settings-Wh36EN0I.js";import{E as pe}from"./empty-state-ClBiZqLf.js";import{R as fe}from"./repository-import-picker-B6ijLkOL.js";import{o as de}from"./shell-layout-BNVBlKMe.js";import{i as J}from"./ArrowRight-CsoDgnUj.js";import{C as ue,a as ge,b as xe}from"./client-icons-CIit2qYG.js";import{u as he,b as je,P as be}from"./project-feed-DGoAUO34.js";import{A as _e}from"./agent-icon-CzsnrYjD.js";import{u as ye}from"./use-navigate-to-agent-TwlhlbmB.js";import{b as Ce}from"./task-route-BpYPpL3v.js";import{s as Ne}from"./use-project-scope-CENQvfVc.js";import{b as Se}from"./use-virtual-mcp-B-mdsJbn.js";import"./use-mobile-DYpKQ1eP.js";import"./thread-button-CzoAkKWi.js";import"./sidebar-Cz1S2PSM.js";import"./LayoutLeft-GBQ0rQxQ.js";import"./sheet-ZoEgH6s-.js";import"./X-vKTIsgL1.js";import"./tooltip-C91IS2ON.js";import"./index-C4LzZ3-O.js";import"./thread-route-BBKn0p1b.js";import"./use-panel-navigate-xYH0iX8e.js";import"./use-route-default-main-evb2BAGs.js";import"./hooks-C8t7cMQJ.js";import"./use-mcp-client-D2DgMGL-.js";import"./auth-D3Q2r2cz.js";import"./backoff-8mStPHYB.js";import"./task-board-BXLBBo-B.js";import"./schema-BVqtjcyJ.js";import"./toolbar-icon-button-iy_uLVVB.js";import"./use-in-settings-DplznXN9.js";import"./resizable-WgWAPECX.js";import"./route-page-header-tbVW9ntg.js";import"./index-CDAG9yf3.js";import"./gateway-client-BF14HPqj.js";import"./dialog-C36x61_J.js";import"./form-CXSt7_li.js";import"./label-tAsQMZ2G.js";import"./input-BK5Sp8hZ.js";import"./utils-CVEq3hMx.js";import"./org-file-open-context-DodrnIMR.js";import"./autosend-C5knIVwo.js";import"./chat-draft-VYqGGS3B.js";import"./use-session-runtime-COugfsOm.js";import"./thread-intent-DuCE7MYG.js";import"./slugify-CEUa2lfQ.js";import"./ArrowUp-CbPBDOpZ.js";import"./Check-BZXRTDaX.js";import"./Image01-BLIf6uY9.js";import"./Upload01-Uv_jtHIk.js";import"./AlertCircle-Cat-Fy2i.js";import"./Copy01-B6hr4CBg.js";import"./select-oEHCSTZi.js";import"./ChevronUp-DGt31MPD.js";import"./ArrowLeft-DuxVUo5_.js";import"./usage-stats-P7Ebxq4V.js";import"./use-copy-CGJ-16i-.js";import"./markdown-D0jNOMCX.js";import"./Download01-CsYfHghd.js";import"./ZoomOut-Burao8Eg.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-entitlements-pN-YIa6T.js";import"./tabs-Gq0qvZI4.js";import"./use-deco-credits-DU8sJrax.js";import"./use-ai-providers-CJ2ga4nx.js";import"./toggle-group-DHrftnUg.js";import"./tool-namespace-DmnQIdtF.js";import"./use-open-billing-url-BrlDdS6U.js";import"./XClose-DFUqDOc8.js";import"./decopilot-YckYKTsg.js";import"./checkbox-BKGUJJNh.js";import"./Tool01-H9OcfGdq.js";import"./Key01-SGIR_QrT.js";import"./SearchMd-B6NDUgzQ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-CxisI5ut.js";import"./avatar-CLf3yQhN.js";import"./User01-DHGCVvV3.js";import"./Eye-rQUtSbk6.js";import"./download-app-dialog-7J000m-o.js";import"./use-is-desktop-app-BNujXJc_.js";import"./Stars01-cdnol_cb.js";import"./popover-GUR8piky.js";import"./drawer-CsJzOKcM.js";import"./index-B7z_63F4.js";import"./input-CLIoB1hh.js";import"./hooks-enzgIMXj.js";import"./use-mcp-prompts-UNzUvECH.js";import"./use-org-fs-Bbl2QQqg.js";import"./Link01-BnVQGp2l.js";import"./question-004-sINsf4GQ.js";import"./use-members-C_tB-qI-.js";import"./use-org-auth-client-BkVvw_9f.js";import"./feature-paywall-lhh7GOr7.js";import"./plan-ladder-DjuDG4EH.js";import"./add-connection-dialog-DzNaYAxM.js";import"./collection-search-BQXOJg8a.js";import"./extract-connection-data-BIqslos8.js";import"./metadata-D72DunRR.js";import"./connection-DzM2SOZ6.js";import"./connection-card-DF11WhqU.js";import"./useInfiniteQuery-DCZL7BN4.js";import"./infiniteQueryObserver-CxJm0T6_.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-Crk6WRxP.js";import"./textarea-B9cyNs7j.js";import"./use-connection-PgTQPnAp.js";import"./UserSquare-BfT6tB5U.js";import"./connection-form-helpers-CyBATU5Y.js";import"./Trash01-mB4s-hrv.js";import"./authenticate-and-persist-oauth-DG9xWGRs.js";import"./mcp-oauth-61IHYJoj.js";import"./collection-tabs-BWQrYrdS.js";import"./badge-DuB4cqrw.js";import"./use-infinite-scroll-Bm905rys.js";import"./useSuspenseInfiniteQuery-C0KSbZH8.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-x0K7Zb7m.js";import"./repository-picker-Ca5oB9j5.js";import"./LinkExternal01-Dh0AABP8.js";import"./github-icon-CIx0jkrL.js";import"./use-debounced-value-CG2jgHBI.js";import"./Globe04-C_9DD9oO.js";import"./CheckCircle-Cj4PQGuv.js";import"./Zap-CSRFlEXK.js";import"./Share07-CMPYQYHk.js";import"./command-CDaLB2Ox.js";import"./index-Byz-UaqT.js";import"./project-icon-mjklzNJs.js";import"./required-auth-layout-DbGCmQgx.js";import"./use-org-sso-BnqcEd47.js";import"./get-initials-D-f_fDFw.js";import"./XCircle-Cu2Sy8Aw.js";import"./CreditCard01-CiYLi_pR.js";import"./DotsVertical-BITRq5d-.js";import"./Sun-BSFyLDhg.js";import"./Package-DsU1cU6S.js";import"./Palette-CzoNEzRs.js";import"./Users01-C_qUmfZB.js";import"./github-repo-BknN0SVI.js";const ke=[{name:"Claude",Icon:ue,size:14,bg:"#D97757",fg:"#fff"},{name:"Cursor",Icon:ge,size:12,bg:"#000",fg:"#fff"},{name:"Codex",Icon:xe,size:12,bg:"#4F46E5",fg:"#fff"}];function ve(){const e=S.c(11),t=$(),{org:s}=B();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let i;e[2]!==t?(i=t("home.orgHome.connectPill"),e[2]=t,e[3]=i):i=e[3];let n;e[4]!==i?(n=o.jsx("span",{className:"font-medium text-foreground",children:i}),e[4]=i,e[5]=n):n=e[5];let l,a;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("span",{"aria-hidden":"true",className:"flex items-center gap-1",children:ke.map(Te)}),a=o.jsx(J,{className:"size-3.5 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),e[6]=l,e[7]=a):(l=e[6],a=e[7]);let m;return e[8]!==r||e[9]!==n?(m=o.jsxs(Y,{to:"/$org/settings/connect",params:r,onClick:Ae,className:"group hidden max-w-full md:inline-flex flex-wrap items-center justify-center gap-x-3 gap-y-2 rounded-full border border-border bg-card py-1.5 pl-4 pr-2.5 text-sm transition-colors hover:bg-accent/60",children:[n,l,a]}),e[8]=r,e[9]=n,e[10]=m):m=e[10],m}function Te(e){const{name:t,Icon:s,size:r,bg:i,fg:n}=e;return o.jsx("span",{title:t,className:"flex size-6 items-center justify-center rounded-full",style:{backgroundColor:i,color:n},children:o.jsx(s,{size:r})},t)}function Ae(){return z("connect_clients_opened",{source:"org_home"})}function He(e){return e<12?"morning":e<18?"afternoon":"evening"}function Pe(e){const t=(e??"").trim().split(/\s+/)[0];return t||null}const D=6;function we(e){const t=S.c(13),{project:s}=e,r=ye();let i;t[0]!==r||t[1]!==s.id||t[2]!==s.metadata?.ui?.layout?(i=()=>{z("org_home_project_clicked"),r(s.id,{panel:U(s.metadata?.ui?.layout)})},t[0]=r,t[1]=s.id,t[2]=s.metadata?.ui?.layout,t[3]=i):i=t[3];let n;t[4]!==s.icon||t[5]!==s.title?(n=o.jsx(_e,{icon:s.icon,name:s.title,size:"sm+"}),t[4]=s.icon,t[5]=s.title,t[6]=n):n=t[6];let l;t[7]!==s.title?(l=o.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.title}),t[7]=s.title,t[8]=l):l=t[8];let a;return t[9]!==i||t[10]!==n||t[11]!==l?(a=o.jsxs("button",{type:"button",onClick:i,className:"flex min-w-0 items-center gap-3 rounded-lg p-2 text-left transition-colors hover:bg-accent/60",children:[n,l]}),t[9]=i,t[10]=n,t[11]=l,t[12]=a):a=t[12],a}function Ie(e){const t=S.c(31),{projects:s,action:r}=e,i=$(),{org:n}=B();let l,a,m,c,p,f;if(t[0]!==r||t[1]!==s||t[2]!==i){const _=[...s].sort(ze).slice(0,D);l=s.length>D,p="flex flex-col gap-4";let j;t[9]!==i?(j=i("home.projects.heading"),t[9]=i,t[10]=j):j=t[10];let h;t[11]!==j?(h=o.jsx("h2",{className:"text-lg font-medium text-foreground",children:j}),t[11]=j,t[12]=h):h=t[12],t[13]!==r||t[14]!==h?(f=o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h,r]}),t[13]=r,t[14]=h,t[15]=f):f=t[15],c="@container",a="grid grid-cols-1 gap-1 @lg:grid-cols-2",m=_.map($e),t[0]=r,t[1]=s,t[2]=i,t[3]=l,t[4]=a,t[5]=m,t[6]=c,t[7]=p,t[8]=f}else l=t[3],a=t[4],m=t[5],c=t[6],p=t[7],f=t[8];let d;t[16]!==a||t[17]!==m?(d=o.jsx("div",{className:a,children:m}),t[16]=a,t[17]=m,t[18]=d):d=t[18];let u;t[19]!==c||t[20]!==d?(u=o.jsx("div",{className:c,children:d}),t[19]=c,t[20]=d,t[21]=u):u=t[21];let g;t[22]!==l||t[23]!==n||t[24]!==i?(g=l&&o.jsx("div",{children:o.jsx(q,{asChild:!0,variant:"ghost",size:"sm",children:o.jsx(Y,{to:"/$org/settings/agents",params:{org:n.slug},children:i("home.projects.seeAll")})})}),t[22]=l,t[23]=n,t[24]=i,t[25]=g):g=t[25];let x;return t[26]!==p||t[27]!==f||t[28]!==u||t[29]!==g?(x=o.jsxs("section",{className:p,children:[f,u,g]}),t[26]=p,t[27]=f,t[28]=u,t[29]=g,t[30]=x):x=t[30],x}function $e(e){return o.jsx(we,{project:e},e.id)}function ze(e,t){return(t.updated_at??"").localeCompare(e.updated_at??"")}function Ee(){const e=S.c(10),{org:t}=B(),s=V();let r;e[0]!==t.id?(r=W.orgHasSite(t.id),e[0]=t.id,e[1]=r):r=e[1];const i=!!t.id;let n;e[2]!==s?(n=()=>s.call("ORGANIZATION_HAS_SITE",{}),e[2]=s,e[3]=n):n=e[3];let l;e[4]!==r||e[5]!==i||e[6]!==n?(l={queryKey:r,staleTime:3e5,enabled:i,queryFn:n},e[4]=r,e[5]=i,e[6]=n,e[7]=l):l=e[7];const{data:a}=X(l),m=a?.hasSite??!1;let c;return e[8]!==m?(c={hasSite:m},e[8]=m,e[9]=c):c=e[9],c}const Le="https://www.youtube.com/playlist?list=PLZ4WtTgnJfBw";function Oe(e){const t=S.c(4),{className:s}=e;let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("path",{fill:"#FF0000",d:"M27.4 3.1c-.3-1.2-1.3-2.2-2.5-2.5C22.7 0 14 0 14 0S5.3 0 3.1.6C1.9.9.9 1.9.6 3.1.1 5.3 0 8 0 10s.1 4.7.6 6.9c.3 1.2 1.3 2.2 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6c1.2-.3 2.2-1.3 2.5-2.5.5-2.2.6-4.9.6-6.9s-.1-4.7-.6-6.9z"}),i=o.jsx("path",{fill:"#fff",d:"M11.2 14.3l7.3-4.3-7.3-4.3z"}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let n;return t[2]!==s?(n=o.jsxs("svg",{viewBox:"0 0 28 20",className:s,"aria-hidden":"true",focusable:"false",children:[r,i]}),t[2]=s,t[3]=n):n=t[3],n}function Re(){const e=S.c(27),t=$(),{hasSite:s}=Ee();if(!s)return null;let r;e[0]!==t?(r=t("home.orgHome.trainingThumbnailAlt"),e[0]=t,e[1]=r):r=e[1];let i;e[2]!==r?(i=o.jsx("img",{src:"/cms-training.jpg",alt:r,className:"size-full object-cover"}),e[2]=r,e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20",children:o.jsx(Oe,{className:"w-9"})}),e[4]=n):n=e[4];let l;e[5]!==i?(l=o.jsxs("div",{className:"relative aspect-video w-40 shrink-0 overflow-hidden rounded-lg",children:[i,n]}),e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t?(a=t("home.orgHome.trainingEyebrow"),e[7]=t,e[8]=a):a=e[8];let m;e[9]!==a?(m=o.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e[9]=a,e[10]=m):m=e[10];let c;e[11]!==t?(c=t("home.orgHome.trainingTitle"),e[11]=t,e[12]=c):c=e[12];let p;e[13]!==c?(p=o.jsx("h3",{className:"text-sm font-medium text-foreground",children:c}),e[13]=c,e[14]=p):p=e[14];let f;e[15]!==t?(f=t("home.orgHome.trainingDescription"),e[15]=t,e[16]=f):f=e[16];let d;e[17]!==f?(d=o.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:f}),e[17]=f,e[18]=d):d=e[18];let u;e[19]!==m||e[20]!==p||e[21]!==d?(u=o.jsxs("div",{className:"min-w-0 flex-1",children:[m,p,d]}),e[19]=m,e[20]=p,e[21]=d,e[22]=u):u=e[22];let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(J,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),e[23]=g):g=e[23];let x;return e[24]!==u||e[25]!==l?(x=o.jsxs("a",{href:Le,target:"_blank",rel:"noreferrer",onClick:Be,className:"group card-shadow flex w-full items-center gap-4 rounded-xl bg-card p-3 text-left transition-colors hover:bg-accent/60",children:[l,u,g]}),e[24]=u,e[25]=l,e[26]=x):x=e[26],x}function Be(){return z("cms_training_opened",{source:"org_home"})}const Fe={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function Me(){const e=S.c(8),t=$();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(ne,{className:"size-4 shrink-0 text-muted-foreground"}),e[0]=s):s=e[0];let r;e[1]!==t?(r=t("home.orgHome.searchPlaceholder"),e[1]=t,e[2]=r):r=e[2];let i;e[3]!==r?(i=o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:r}),e[3]=r,e[4]=i):i=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("kbd",{className:"shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:"⌘K"}),e[5]=n):n=e[5];let l;return e[6]!==i?(l=o.jsxs("button",{type:"button","data-testid":"org-home-search",onClick:Ge,className:"card-shadow flex w-full items-center gap-2 rounded-xl bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent/60",children:[s,i,n]}),e[6]=i,e[7]=l):l=e[7],l}function Ge(){z("command_palette_opened",{source:"org_home_search"}),de()}function K(){const e=S.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx("div",{className:"flex min-h-64 items-center justify-center",children:o.jsx(re,{className:"size-5 text-muted-foreground"})}),e[0]=t):t=e[0],t}function De(e){const t=S.c(40),{canManageAgents:s,importButton:r}=e,i=Z(),n=$(),{org:l}=B();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={pageSize:1e3},t[0]=a):a=t[0];const m=Se(a),c=he();let p,f,d;if(t[1]!==m||t[2]!==s||t[3]!==i||t[4]!==r||t[5]!==l||t[6]!==n||t[7]!==c){d=Symbol.for("react.early_return_sentinel");e:{let h;if(t[11]!==l?(h=b=>b.id!==l.id,t[11]=l,t[12]=h):h=t[12],p=Ne(m).filter(h),p.length===0){let b;t[13]!==s||t[14]!==i||t[15]!==r?(b=!i&&s&&r("org_home_empty"),t[13]=s,t[14]=i,t[15]=r,t[16]=b):b=t[16];let y;t[17]!==n?(y=n("routes.agentsList.noAgentsYet"),t[17]=n,t[18]=y):y=t[18];let C;t[19]!==s||t[20]!==n?(C=n(s?"home.orgAgents.importToGetStarted":"routes.agentsList.askAdminToCreate"),t[19]=s,t[20]=n,t[21]=C):C=t[21];let N;t[22]!==b||t[23]!==y||t[24]!==C?(N=o.jsx("div",{className:"flex items-center justify-center py-10",children:o.jsx(pe,{actions:b,image:null,title:y,description:C})}),t[22]=b,t[23]=y,t[24]=C,t[25]=N):N=t[25],d=N;break e}f=je(Ce(p),c,null)}t[1]=m,t[2]=s,t[3]=i,t[4]=r,t[5]=l,t[6]=n,t[7]=c,t[8]=p,t[9]=f,t[10]=d}else p=t[8],f=t[9],d=t[10];if(d!==Symbol.for("react.early_return_sentinel"))return d;const u=f.length>0;let g;t[26]!==s||t[27]!==i||t[28]!==r?(g=!i&&s&&r("org_home"),t[26]=s,t[27]=i,t[28]=r,t[29]=g):g=t[29];let x;t[30]!==p||t[31]!==g?(x=o.jsx(Ie,{projects:p,action:g}),t[30]=p,t[31]=g,t[32]=x):x=t[32];let _;t[33]!==p||t[34]!==u||t[35]!==c?(_=u&&o.jsx(be,{projects:p,tasks:c}),t[33]=p,t[34]=u,t[35]=c,t[36]=_):_=t[36];let j;return t[37]!==x||t[38]!==_?(j=o.jsxs("div",{className:"flex flex-col gap-12",children:[x,_]}),t[37]=x,t[38]=_,t[39]=j):j=t[39],j}function Ke(){const e=S.c(63),t=Z(),s=t?"h2":"h1",r=$(),i=ce("home_task_intake_enabled"),{data:n}=ee.useSession(),[l,a]=F.useState(!1),{granted:m}=te("agents:manage");let c,p,f,d,u,g,x,_,j,h,b,y,C,N;if(e[0]!==s||e[1]!==m||e[2]!==t||e[3]!==n?.user?.name||e[4]!==r){const M=Pe(n?.user?.name),G=Fe[He(new Date().getHours())];let O;e[19]!==t||e[20]!==r?(O=Q=>o.jsxs(q,{size:"sm",variant:t?"default":"outline",onClick:()=>{z("agent_create_clicked",{source:Q,method:"github"}),a(!0)},children:[t?o.jsx(se,{size:14}):o.jsx(oe,{size:14}),r(t?"home.orgAgents.importFromGitHub":"common.githubRepoPicker.importFromGitHub")]}),e[19]=t,e[20]=r,e[21]=O):O=e[21],u=O,d=R,e[22]!==m||e[23]!==t||e[24]!==u?(N=t&&m&&o.jsx(R.Actions,{children:u("org_home")}),e[22]=m,e[23]=t,e[24]=u,e[25]=N):N=e[25],f=R.Content,p=R.Container,y="reading",C="flex flex-col gap-12 classic:pt-0 classic:md:pt-0",j="flex flex-col items-center gap-12 text-center",e[26]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ve,{}),b=o.jsx(Re,{}),e[26]=h,e[27]=b):(h=e[26],b=e[27]),_="flex w-full flex-col items-center gap-5",c=s,g="text-3xl font-medium tracking-tight text-foreground",x=M?r(G.named,{name:M}):r(G.bare),e[0]=s,e[1]=m,e[2]=t,e[3]=n?.user?.name,e[4]=r,e[5]=c,e[6]=p,e[7]=f,e[8]=d,e[9]=u,e[10]=g,e[11]=x,e[12]=_,e[13]=j,e[14]=h,e[15]=b,e[16]=y,e[17]=C,e[18]=N}else c=e[5],p=e[6],f=e[7],d=e[8],u=e[9],g=e[10],x=e[11],_=e[12],j=e[13],h=e[14],b=e[15],y=e[16],C=e[17],N=e[18];let k;e[28]!==c||e[29]!==g||e[30]!==x?(k=o.jsx(c,{className:g,children:x}),e[28]=c,e[29]=g,e[30]=x,e[31]=k):k=e[31];let v;e[32]!==i?(v=i?o.jsx(F.Suspense,{fallback:o.jsx(K,{}),children:o.jsx(me,{children:o.jsx(ae,{children:o.jsx(le,{homeTaskComposer:!0})})})}):o.jsx(Me,{}),e[32]=i,e[33]=v):v=e[33];let T;e[34]!==v||e[35]!==_||e[36]!==k?(T=o.jsxs("div",{className:_,children:[k,v]}),e[34]=v,e[35]=_,e[36]=k,e[37]=T):T=e[37];let A;e[38]!==T||e[39]!==j||e[40]!==h||e[41]!==b?(A=o.jsxs("div",{className:j,children:[h,b,T]}),e[38]=T,e[39]=j,e[40]=h,e[41]=b,e[42]=A):A=e[42];let E;e[43]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsx(K,{}),e[43]=E):E=e[43];let H;e[44]!==m||e[45]!==u?(H=o.jsx(F.Suspense,{fallback:E,children:o.jsx(De,{canManageAgents:m,importButton:u})}),e[44]=m,e[45]=u,e[46]=H):H=e[46];let P;e[47]!==p||e[48]!==A||e[49]!==H||e[50]!==y||e[51]!==C?(P=o.jsxs(p,{width:y,className:C,children:[A,H]}),e[47]=p,e[48]=A,e[49]=H,e[50]=y,e[51]=C,e[52]=P):P=e[52];let w;e[53]!==f||e[54]!==P?(w=o.jsx(f,{children:P}),e[53]=f,e[54]=P,e[55]=w):w=e[55];let I;e[56]!==l?(I=o.jsx(fe,{open:l,onOpenChange:a}),e[56]=l,e[57]=I):I=e[57];let L;return e[58]!==d||e[59]!==w||e[60]!==I||e[61]!==N?(L=o.jsxs(d,{children:[N,w,I]}),e[58]=d,e[59]=w,e[60]=I,e[61]=N,e[62]=L):L=e[62],L}function wr(){const e=S.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(ie.Content,{children:o.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{wr as default};
1
+ import{c as S,b as $,a0 as B,j as o,L as Y,q as z,B as q,af as U,a6 as V,K as W,m as X,Z,a as ee,r as F,ae as te,n as R,ai as oe,h as re}from"./index-CyBVTyGa.js";import{C as ie}from"./index-nJTy1ykh.js";import{s as se}from"./Plus-BbELO07z.js";import{i as ne}from"./SearchLg-C9MObDBB.js";import{C as le}from"./input-DMG-B3VZ.js";import{D as me,C as ae}from"./chat-context-HOmU0YHH.js";import{a as ce}from"./use-organization-settings-4gJ9Tp49.js";import{E as pe}from"./empty-state-BpI78UAU.js";import{R as fe}from"./repository-import-picker-74Y3ta69.js";import{o as de}from"./shell-layout-B3x_9fo1.js";import{i as J}from"./ArrowRight-FqJnNh3f.js";import{C as ue,a as ge,b as xe}from"./client-icons-CaoDPAaa.js";import{u as he,b as je,P as be}from"./project-feed-orYCz9U3.js";import{A as _e}from"./agent-icon-CSebdE0g.js";import{u as ye}from"./use-navigate-to-agent-W6hb3mqs.js";import{b as Ce}from"./task-route-9wqWimw6.js";import{s as Ne}from"./use-project-scope-CRdwBUT7.js";import{b as Se}from"./use-virtual-mcp-Vg_Ogz61.js";import"./use-mobile-CUQu4L8c.js";import"./thread-button-DUOTtsFE.js";import"./sidebar-CxoDmdm4.js";import"./LayoutLeft-U0F-Da_p.js";import"./sheet-DH_REC9j.js";import"./X-BNszojyh.js";import"./tooltip-BjUMPvkB.js";import"./index-DtBnPwzh.js";import"./thread-route-JcpQ-ikA.js";import"./use-panel-navigate-Bg-MVKv6.js";import"./use-route-default-main-DA5X9xDG.js";import"./hooks-lZSCdRwc.js";import"./use-mcp-client-CqKNXJW7.js";import"./auth-B-OXMWGw.js";import"./backoff-8mStPHYB.js";import"./task-board-Qj-6Ctqf.js";import"./schema-DSsDEA1v.js";import"./toolbar-icon-button-Cq75cloK.js";import"./use-in-settings-8fsBM1xN.js";import"./resizable-D6HLmII4.js";import"./route-page-header-BHdnDvfR.js";import"./index-DmF8NlWI.js";import"./gateway-client-DiyAsoDf.js";import"./dialog-BG6kEGFR.js";import"./form-Bx8qGby0.js";import"./label-DVhvlWqs.js";import"./input-D5Zi_pUc.js";import"./utils-CVEq3hMx.js";import"./org-file-open-context-Bh_zBQ2O.js";import"./autosend-pQ9pD2-2.js";import"./chat-draft-BdxqYU8-.js";import"./use-session-runtime-DiG_Qt8i.js";import"./thread-intent-jq9HKW3p.js";import"./slugify-CEUa2lfQ.js";import"./ArrowUp-bOLRJZuX.js";import"./Check-DL_AGZMy.js";import"./Image01-CkJtDP-I.js";import"./Upload01-CNb1qfRO.js";import"./AlertCircle-CVkVxygv.js";import"./Copy01-6lOOhJcp.js";import"./select-CDhEibGy.js";import"./ChevronUp-B6mY-MC1.js";import"./ArrowLeft-CN6aZBvX.js";import"./usage-stats-Bug-9_EL.js";import"./use-copy-CPOYPvBF.js";import"./markdown-DCPDulUN.js";import"./Download01-Dq8Pn8XY.js";import"./ZoomOut-q6Y0RhlM.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-entitlements-D6f3xZaU.js";import"./tabs-D6s_HA-y.js";import"./use-deco-credits-Fltfd2iB.js";import"./use-ai-providers-ShRDl02e.js";import"./toggle-group-Dv_lnjT7.js";import"./tool-namespace-DmnQIdtF.js";import"./use-open-billing-url-KLMgEPxW.js";import"./XClose-D_JLFZFT.js";import"./decopilot-B7-O9fZC.js";import"./checkbox-DBYfq56y.js";import"./Tool01-BvNT4KDI.js";import"./Key01-BCuGindq.js";import"./SearchMd-B1Foybfh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-r707obGd.js";import"./avatar-GIuLZx2C.js";import"./User01-U5CIC-GP.js";import"./Eye-B5e-ilzV.js";import"./download-app-dialog-NqW4PLAx.js";import"./use-is-desktop-app-BNujXJc_.js";import"./Stars01-DUL2jKUJ.js";import"./popover-CUdTfYte.js";import"./drawer-Bl-PPIzX.js";import"./index-B8ZawsDP.js";import"./input-DOIUaBAK.js";import"./hooks-ZOtfl4oi.js";import"./use-mcp-prompts-DpED8Vrg.js";import"./use-org-fs-B1IHOZ9S.js";import"./Link01-BjTxU_bP.js";import"./question-004-sINsf4GQ.js";import"./use-members-CeW4sAKm.js";import"./use-org-auth-client-zTkj17z7.js";import"./feature-paywall-DwNmZ-M9.js";import"./plan-ladder-BEYdYGx8.js";import"./add-connection-dialog-C5SXdxkT.js";import"./collection-search-DyuqjLWs.js";import"./extract-connection-data-BimwPioU.js";import"./metadata-D72DunRR.js";import"./connection-DR9gf0au.js";import"./connection-card-BOo8yulu.js";import"./useInfiniteQuery-DebjMHv1.js";import"./infiniteQueryObserver-COZ-9XSO.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-mTqkOE6y.js";import"./textarea-TE2JJa-B.js";import"./use-connection-WQuJ5yl_.js";import"./UserSquare-CZakdYWe.js";import"./connection-form-helpers-D5P5OxyV.js";import"./Trash01-BLoRPhD3.js";import"./authenticate-and-persist-oauth-B71_ZhsC.js";import"./mcp-oauth-DdNMjTqu.js";import"./collection-tabs-3_QvnkN-.js";import"./badge-DS3KIYvS.js";import"./use-infinite-scroll-BCiTqxTQ.js";import"./useSuspenseInfiniteQuery-CqRV1dKR.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DF_mJ7FX.js";import"./repository-picker-dKTE5PS5.js";import"./LinkExternal01-DSUCZUJp.js";import"./github-icon-Bx6tzbBb.js";import"./use-debounced-value-DHN-wkc6.js";import"./Globe04-_nV993le.js";import"./CheckCircle-DtMp-qqq.js";import"./Zap-BCwjglMw.js";import"./Share07-B2WnpDWD.js";import"./command-ByUEKQB9.js";import"./index-CR8U3UFH.js";import"./project-icon-DWnsLAeJ.js";import"./required-auth-layout-BgLvQHTP.js";import"./use-org-sso-CI1_4UQM.js";import"./get-initials-D-f_fDFw.js";import"./XCircle-BuDwhQqF.js";import"./CreditCard01-DdYfDHIS.js";import"./DotsVertical-CAjUqtRp.js";import"./Sun-BKxdX8hu.js";import"./Package-D2jMN__x.js";import"./Palette-DebiHmrq.js";import"./Users01-C6BprSkC.js";import"./github-repo-BknN0SVI.js";const ke=[{name:"Claude",Icon:ue,size:14,bg:"#D97757",fg:"#fff"},{name:"Cursor",Icon:ge,size:12,bg:"#000",fg:"#fff"},{name:"Codex",Icon:xe,size:12,bg:"#4F46E5",fg:"#fff"}];function ve(){const e=S.c(11),t=$(),{org:s}=B();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let i;e[2]!==t?(i=t("home.orgHome.connectPill"),e[2]=t,e[3]=i):i=e[3];let n;e[4]!==i?(n=o.jsx("span",{className:"font-medium text-foreground",children:i}),e[4]=i,e[5]=n):n=e[5];let l,a;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("span",{"aria-hidden":"true",className:"flex items-center gap-1",children:ke.map(Te)}),a=o.jsx(J,{className:"size-3.5 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),e[6]=l,e[7]=a):(l=e[6],a=e[7]);let m;return e[8]!==r||e[9]!==n?(m=o.jsxs(Y,{to:"/$org/settings/connect",params:r,onClick:Ae,className:"group hidden max-w-full md:inline-flex flex-wrap items-center justify-center gap-x-3 gap-y-2 rounded-full border border-border bg-card py-1.5 pl-4 pr-2.5 text-sm transition-colors hover:bg-accent/60",children:[n,l,a]}),e[8]=r,e[9]=n,e[10]=m):m=e[10],m}function Te(e){const{name:t,Icon:s,size:r,bg:i,fg:n}=e;return o.jsx("span",{title:t,className:"flex size-6 items-center justify-center rounded-full",style:{backgroundColor:i,color:n},children:o.jsx(s,{size:r})},t)}function Ae(){return z("connect_clients_opened",{source:"org_home"})}function He(e){return e<12?"morning":e<18?"afternoon":"evening"}function Pe(e){const t=(e??"").trim().split(/\s+/)[0];return t||null}const D=6;function we(e){const t=S.c(13),{project:s}=e,r=ye();let i;t[0]!==r||t[1]!==s.id||t[2]!==s.metadata?.ui?.layout?(i=()=>{z("org_home_project_clicked"),r(s.id,{panel:U(s.metadata?.ui?.layout)})},t[0]=r,t[1]=s.id,t[2]=s.metadata?.ui?.layout,t[3]=i):i=t[3];let n;t[4]!==s.icon||t[5]!==s.title?(n=o.jsx(_e,{icon:s.icon,name:s.title,size:"sm+"}),t[4]=s.icon,t[5]=s.title,t[6]=n):n=t[6];let l;t[7]!==s.title?(l=o.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.title}),t[7]=s.title,t[8]=l):l=t[8];let a;return t[9]!==i||t[10]!==n||t[11]!==l?(a=o.jsxs("button",{type:"button",onClick:i,className:"flex min-w-0 items-center gap-3 rounded-lg p-2 text-left transition-colors hover:bg-accent/60",children:[n,l]}),t[9]=i,t[10]=n,t[11]=l,t[12]=a):a=t[12],a}function Ie(e){const t=S.c(31),{projects:s,action:r}=e,i=$(),{org:n}=B();let l,a,m,c,p,f;if(t[0]!==r||t[1]!==s||t[2]!==i){const _=[...s].sort(ze).slice(0,D);l=s.length>D,p="flex flex-col gap-4";let j;t[9]!==i?(j=i("home.projects.heading"),t[9]=i,t[10]=j):j=t[10];let h;t[11]!==j?(h=o.jsx("h2",{className:"text-lg font-medium text-foreground",children:j}),t[11]=j,t[12]=h):h=t[12],t[13]!==r||t[14]!==h?(f=o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h,r]}),t[13]=r,t[14]=h,t[15]=f):f=t[15],c="@container",a="grid grid-cols-1 gap-1 @lg:grid-cols-2",m=_.map($e),t[0]=r,t[1]=s,t[2]=i,t[3]=l,t[4]=a,t[5]=m,t[6]=c,t[7]=p,t[8]=f}else l=t[3],a=t[4],m=t[5],c=t[6],p=t[7],f=t[8];let d;t[16]!==a||t[17]!==m?(d=o.jsx("div",{className:a,children:m}),t[16]=a,t[17]=m,t[18]=d):d=t[18];let u;t[19]!==c||t[20]!==d?(u=o.jsx("div",{className:c,children:d}),t[19]=c,t[20]=d,t[21]=u):u=t[21];let g;t[22]!==l||t[23]!==n||t[24]!==i?(g=l&&o.jsx("div",{children:o.jsx(q,{asChild:!0,variant:"ghost",size:"sm",children:o.jsx(Y,{to:"/$org/settings/agents",params:{org:n.slug},children:i("home.projects.seeAll")})})}),t[22]=l,t[23]=n,t[24]=i,t[25]=g):g=t[25];let x;return t[26]!==p||t[27]!==f||t[28]!==u||t[29]!==g?(x=o.jsxs("section",{className:p,children:[f,u,g]}),t[26]=p,t[27]=f,t[28]=u,t[29]=g,t[30]=x):x=t[30],x}function $e(e){return o.jsx(we,{project:e},e.id)}function ze(e,t){return(t.updated_at??"").localeCompare(e.updated_at??"")}function Ee(){const e=S.c(10),{org:t}=B(),s=V();let r;e[0]!==t.id?(r=W.orgHasSite(t.id),e[0]=t.id,e[1]=r):r=e[1];const i=!!t.id;let n;e[2]!==s?(n=()=>s.call("ORGANIZATION_HAS_SITE",{}),e[2]=s,e[3]=n):n=e[3];let l;e[4]!==r||e[5]!==i||e[6]!==n?(l={queryKey:r,staleTime:3e5,enabled:i,queryFn:n},e[4]=r,e[5]=i,e[6]=n,e[7]=l):l=e[7];const{data:a}=X(l),m=a?.hasSite??!1;let c;return e[8]!==m?(c={hasSite:m},e[8]=m,e[9]=c):c=e[9],c}const Le="https://www.youtube.com/playlist?list=PLZ4WtTgnJfBw";function Oe(e){const t=S.c(4),{className:s}=e;let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("path",{fill:"#FF0000",d:"M27.4 3.1c-.3-1.2-1.3-2.2-2.5-2.5C22.7 0 14 0 14 0S5.3 0 3.1.6C1.9.9.9 1.9.6 3.1.1 5.3 0 8 0 10s.1 4.7.6 6.9c.3 1.2 1.3 2.2 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6c1.2-.3 2.2-1.3 2.5-2.5.5-2.2.6-4.9.6-6.9s-.1-4.7-.6-6.9z"}),i=o.jsx("path",{fill:"#fff",d:"M11.2 14.3l7.3-4.3-7.3-4.3z"}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let n;return t[2]!==s?(n=o.jsxs("svg",{viewBox:"0 0 28 20",className:s,"aria-hidden":"true",focusable:"false",children:[r,i]}),t[2]=s,t[3]=n):n=t[3],n}function Re(){const e=S.c(27),t=$(),{hasSite:s}=Ee();if(!s)return null;let r;e[0]!==t?(r=t("home.orgHome.trainingThumbnailAlt"),e[0]=t,e[1]=r):r=e[1];let i;e[2]!==r?(i=o.jsx("img",{src:"/cms-training.jpg",alt:r,className:"size-full object-cover"}),e[2]=r,e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20",children:o.jsx(Oe,{className:"w-9"})}),e[4]=n):n=e[4];let l;e[5]!==i?(l=o.jsxs("div",{className:"relative aspect-video w-40 shrink-0 overflow-hidden rounded-lg",children:[i,n]}),e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t?(a=t("home.orgHome.trainingEyebrow"),e[7]=t,e[8]=a):a=e[8];let m;e[9]!==a?(m=o.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e[9]=a,e[10]=m):m=e[10];let c;e[11]!==t?(c=t("home.orgHome.trainingTitle"),e[11]=t,e[12]=c):c=e[12];let p;e[13]!==c?(p=o.jsx("h3",{className:"text-sm font-medium text-foreground",children:c}),e[13]=c,e[14]=p):p=e[14];let f;e[15]!==t?(f=t("home.orgHome.trainingDescription"),e[15]=t,e[16]=f):f=e[16];let d;e[17]!==f?(d=o.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:f}),e[17]=f,e[18]=d):d=e[18];let u;e[19]!==m||e[20]!==p||e[21]!==d?(u=o.jsxs("div",{className:"min-w-0 flex-1",children:[m,p,d]}),e[19]=m,e[20]=p,e[21]=d,e[22]=u):u=e[22];let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(J,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),e[23]=g):g=e[23];let x;return e[24]!==u||e[25]!==l?(x=o.jsxs("a",{href:Le,target:"_blank",rel:"noreferrer",onClick:Be,className:"group card-shadow flex w-full items-center gap-4 rounded-xl bg-card p-3 text-left transition-colors hover:bg-accent/60",children:[l,u,g]}),e[24]=u,e[25]=l,e[26]=x):x=e[26],x}function Be(){return z("cms_training_opened",{source:"org_home"})}const Fe={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function Me(){const e=S.c(8),t=$();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(ne,{className:"size-4 shrink-0 text-muted-foreground"}),e[0]=s):s=e[0];let r;e[1]!==t?(r=t("home.orgHome.searchPlaceholder"),e[1]=t,e[2]=r):r=e[2];let i;e[3]!==r?(i=o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:r}),e[3]=r,e[4]=i):i=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("kbd",{className:"shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:"⌘K"}),e[5]=n):n=e[5];let l;return e[6]!==i?(l=o.jsxs("button",{type:"button","data-testid":"org-home-search",onClick:Ge,className:"card-shadow flex w-full items-center gap-2 rounded-xl bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent/60",children:[s,i,n]}),e[6]=i,e[7]=l):l=e[7],l}function Ge(){z("command_palette_opened",{source:"org_home_search"}),de()}function K(){const e=S.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx("div",{className:"flex min-h-64 items-center justify-center",children:o.jsx(re,{className:"size-5 text-muted-foreground"})}),e[0]=t):t=e[0],t}function De(e){const t=S.c(40),{canManageAgents:s,importButton:r}=e,i=Z(),n=$(),{org:l}=B();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={pageSize:1e3},t[0]=a):a=t[0];const m=Se(a),c=he();let p,f,d;if(t[1]!==m||t[2]!==s||t[3]!==i||t[4]!==r||t[5]!==l||t[6]!==n||t[7]!==c){d=Symbol.for("react.early_return_sentinel");e:{let h;if(t[11]!==l?(h=b=>b.id!==l.id,t[11]=l,t[12]=h):h=t[12],p=Ne(m).filter(h),p.length===0){let b;t[13]!==s||t[14]!==i||t[15]!==r?(b=!i&&s&&r("org_home_empty"),t[13]=s,t[14]=i,t[15]=r,t[16]=b):b=t[16];let y;t[17]!==n?(y=n("routes.agentsList.noAgentsYet"),t[17]=n,t[18]=y):y=t[18];let C;t[19]!==s||t[20]!==n?(C=n(s?"home.orgAgents.importToGetStarted":"routes.agentsList.askAdminToCreate"),t[19]=s,t[20]=n,t[21]=C):C=t[21];let N;t[22]!==b||t[23]!==y||t[24]!==C?(N=o.jsx("div",{className:"flex items-center justify-center py-10",children:o.jsx(pe,{actions:b,image:null,title:y,description:C})}),t[22]=b,t[23]=y,t[24]=C,t[25]=N):N=t[25],d=N;break e}f=je(Ce(p),c,null)}t[1]=m,t[2]=s,t[3]=i,t[4]=r,t[5]=l,t[6]=n,t[7]=c,t[8]=p,t[9]=f,t[10]=d}else p=t[8],f=t[9],d=t[10];if(d!==Symbol.for("react.early_return_sentinel"))return d;const u=f.length>0;let g;t[26]!==s||t[27]!==i||t[28]!==r?(g=!i&&s&&r("org_home"),t[26]=s,t[27]=i,t[28]=r,t[29]=g):g=t[29];let x;t[30]!==p||t[31]!==g?(x=o.jsx(Ie,{projects:p,action:g}),t[30]=p,t[31]=g,t[32]=x):x=t[32];let _;t[33]!==p||t[34]!==u||t[35]!==c?(_=u&&o.jsx(be,{projects:p,tasks:c}),t[33]=p,t[34]=u,t[35]=c,t[36]=_):_=t[36];let j;return t[37]!==x||t[38]!==_?(j=o.jsxs("div",{className:"flex flex-col gap-12",children:[x,_]}),t[37]=x,t[38]=_,t[39]=j):j=t[39],j}function Ke(){const e=S.c(63),t=Z(),s=t?"h2":"h1",r=$(),i=ce("home_task_intake_enabled"),{data:n}=ee.useSession(),[l,a]=F.useState(!1),{granted:m}=te("agents:manage");let c,p,f,d,u,g,x,_,j,h,b,y,C,N;if(e[0]!==s||e[1]!==m||e[2]!==t||e[3]!==n?.user?.name||e[4]!==r){const M=Pe(n?.user?.name),G=Fe[He(new Date().getHours())];let O;e[19]!==t||e[20]!==r?(O=Q=>o.jsxs(q,{size:"sm",variant:t?"default":"outline",onClick:()=>{z("agent_create_clicked",{source:Q,method:"github"}),a(!0)},children:[t?o.jsx(se,{size:14}):o.jsx(oe,{size:14}),r(t?"home.orgAgents.importFromGitHub":"common.githubRepoPicker.importFromGitHub")]}),e[19]=t,e[20]=r,e[21]=O):O=e[21],u=O,d=R,e[22]!==m||e[23]!==t||e[24]!==u?(N=t&&m&&o.jsx(R.Actions,{children:u("org_home")}),e[22]=m,e[23]=t,e[24]=u,e[25]=N):N=e[25],f=R.Content,p=R.Container,y="reading",C="flex flex-col gap-12 classic:pt-0 classic:md:pt-0",j="flex flex-col items-center gap-12 text-center",e[26]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ve,{}),b=o.jsx(Re,{}),e[26]=h,e[27]=b):(h=e[26],b=e[27]),_="flex w-full flex-col items-center gap-5",c=s,g="text-3xl font-medium tracking-tight text-foreground",x=M?r(G.named,{name:M}):r(G.bare),e[0]=s,e[1]=m,e[2]=t,e[3]=n?.user?.name,e[4]=r,e[5]=c,e[6]=p,e[7]=f,e[8]=d,e[9]=u,e[10]=g,e[11]=x,e[12]=_,e[13]=j,e[14]=h,e[15]=b,e[16]=y,e[17]=C,e[18]=N}else c=e[5],p=e[6],f=e[7],d=e[8],u=e[9],g=e[10],x=e[11],_=e[12],j=e[13],h=e[14],b=e[15],y=e[16],C=e[17],N=e[18];let k;e[28]!==c||e[29]!==g||e[30]!==x?(k=o.jsx(c,{className:g,children:x}),e[28]=c,e[29]=g,e[30]=x,e[31]=k):k=e[31];let v;e[32]!==i?(v=i?o.jsx(F.Suspense,{fallback:o.jsx(K,{}),children:o.jsx(me,{children:o.jsx(ae,{children:o.jsx(le,{homeTaskComposer:!0})})})}):o.jsx(Me,{}),e[32]=i,e[33]=v):v=e[33];let T;e[34]!==v||e[35]!==_||e[36]!==k?(T=o.jsxs("div",{className:_,children:[k,v]}),e[34]=v,e[35]=_,e[36]=k,e[37]=T):T=e[37];let A;e[38]!==T||e[39]!==j||e[40]!==h||e[41]!==b?(A=o.jsxs("div",{className:j,children:[h,b,T]}),e[38]=T,e[39]=j,e[40]=h,e[41]=b,e[42]=A):A=e[42];let E;e[43]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsx(K,{}),e[43]=E):E=e[43];let H;e[44]!==m||e[45]!==u?(H=o.jsx(F.Suspense,{fallback:E,children:o.jsx(De,{canManageAgents:m,importButton:u})}),e[44]=m,e[45]=u,e[46]=H):H=e[46];let P;e[47]!==p||e[48]!==A||e[49]!==H||e[50]!==y||e[51]!==C?(P=o.jsxs(p,{width:y,className:C,children:[A,H]}),e[47]=p,e[48]=A,e[49]=H,e[50]=y,e[51]=C,e[52]=P):P=e[52];let w;e[53]!==f||e[54]!==P?(w=o.jsx(f,{children:P}),e[53]=f,e[54]=P,e[55]=w):w=e[55];let I;e[56]!==l?(I=o.jsx(fe,{open:l,onOpenChange:a}),e[56]=l,e[57]=I):I=e[57];let L;return e[58]!==d||e[59]!==w||e[60]!==I||e[61]!==N?(L=o.jsxs(d,{children:[N,w,I]}),e[58]=d,e[59]=w,e[60]=I,e[61]=N,e[62]=L):L=e[62],L}function wr(){const e=S.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(ie.Content,{children:o.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{wr as default};
@@ -1,2 +1,2 @@
1
- import{o as X,h as U,j as V,D as H,p as W,q as z}from"./index-CDAG9yf3.js";import{eI as J,eJ as Y,eo as G,eK as Z,r as b,c as Q,D as ee,K as te}from"./index-doEaURqC.js";var we=X;function ne(n){var e;const{char:o,allowSpaces:t,allowToIncludeChar:s,allowedPrefixes:r,startOfLine:l,$position:i}=n,d=t&&!s,f=z(o),g=new RegExp(`\\s${f}$`),u=l?"^":"",p=s?"":f,x=d?new RegExp(`${u}${f}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${u}(?:^)?${f}[^\\s${p}]*`,"gm"),m=((e=i.nodeBefore)===null||e===void 0?void 0:e.isText)&&i.nodeBefore.text;if(!m)return null;const h=i.pos-m.length,c=Array.from(m.matchAll(x)).pop();if(!c||c.input===void 0||c.index===void 0)return null;const w=c.input.slice(Math.max(0,c.index-1),c.index),y=new RegExp(`^[${r?.join("")}\0]?$`).test(w);if(r!==null&&!y)return null;const R=h+c.index;let a=R+c[0].length;return d&&g.test(m.slice(a-1,a+1))&&(c[0]+=" ",a+=1),R<i.pos&&a>=i.pos?{range:{from:R,to:a},query:c[0].slice(o.length),text:c[0]}:null}function oe(n){return n.docChanged?n.steps.some(e=>{const o=e.slice;if(!o?.content)return!1;const t=o.content.textBetween(0,o.content.size,`
2
- `);return/\s/.test(t)}):!1}function se(n){return()=>{const e=n.state.selection.$anchor.pos,{top:o,right:t,bottom:s,left:r}=n.view.coordsAtPos(e);try{return new DOMRect(r,o,t-r,s-o)}catch{return null}}}function ae(n,e,o,t){return o?()=>{const s=t.getState(n.state),r=s?.decorationId,l=e.dom.querySelector(`[data-decoration-id="${r}"]`);return l?.getBoundingClientRect()||null}:se(n)}function le({match:n,dismissedRange:e,state:o,transaction:t,editor:s,shouldResetDismissed:r,effectiveAllowSpaces:l}){return r?.({editor:s,state:o,range:e,match:n,transaction:t,allowSpaces:l})?!1:l?n.range.from===e.from:n.range.from===e.from&&!oe(t)}function re({view:n,pluginKeyRef:e}){const o=n.state.tr.setMeta(e,{exit:!0});n.dispatch(o)}function ie({pluginKey:n,decorationTag:e,decorationClass:o,decorationContent:t,decorationEmptyClass:s,renderer:r,dispatchExit:l}){return{handleKeyDown(i,d){var f;const g=n.getState(i.state);if(!g.active)return!1;if(d.key==="Escape"||d.key==="Esc"){var u;return r==null||(u=r.onKeyDown)===null||u===void 0||u.call(r,{view:i,event:d,range:g.range}),l(i),!0}return(r==null||(f=r.onKeyDown)===null||f===void 0?void 0:f.call(r,{view:i,event:d,range:g.range}))||!1},decorations(i){const{active:d,range:f,decorationId:g,query:u}=n.getState(i);if(!d)return null;const p=!u?.length,x=[o];return p&&x.push(s),H.create(i.doc,[W.inline(f.from,f.to,{nodeName:e,class:x.join(" "),"data-decoration-id":g||void 0,"data-decoration-content":t})])}}}function ue({editor:n,char:e,effectiveAllowSpaces:o,allowToIncludeChar:t,allowedPrefixes:s,startOfLine:r,findSuggestionMatch:l,allow:i,shouldShow:d,shouldKeepDismissed:f,pluginKey:g}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,p,x,m){const{isEditable:h}=n,{composing:c}=n.view,{selection:w}=u,{empty:y,from:R}=w,a={...p},T=u.getMeta(g);if(T&&T.exit)return a.active=!1,a.decorationId=null,a.range={from:0,to:0},a.query=null,a.text=null,a.dismissedRange=p.active?{...p.range}:p.dismissedRange,a;if(a.composing=c,u.docChanged&&a.dismissedRange!==null&&(a.dismissedRange={from:u.mapping.map(a.dismissedRange.from),to:u.mapping.map(a.dismissedRange.to)}),h&&(y||n.view.composing)){(R<p.range.from||R>p.range.to)&&!c&&!p.composing&&(a.active=!1);const v=l({char:e,allowSpaces:o,allowToIncludeChar:t,allowedPrefixes:s,startOfLine:r,$position:w.$from}),C=`id_${Math.floor(Math.random()*4294967295)}`;v&&i({editor:n,state:m,range:v.range,isActive:p.active})&&(!d||d({editor:n,range:v.range,query:v.query,text:v.text,transaction:u}))?(a.dismissedRange!==null&&!f({match:v,dismissedRange:a.dismissedRange,state:m,transaction:u})&&(a.dismissedRange=null),a.dismissedRange===null?(a.active=!0,a.decorationId=p.decorationId||C,a.range=v.range,a.query=v.query,a.text=v.text):a.active=!1):(v||(a.dismissedRange=null),a.active=!1)}else a.active=!1;return a.active||(a.decorationId=null,a.range={from:0,to:0},a.query=null,a.text=null),a}}}function ce({editor:n,items:e}){let o=null,t=null,s=null;const r=()=>{t!==null&&(clearTimeout(t),t=null),s?.(),s=null},l=f=>new Promise(g=>{s=g,t=setTimeout(()=>{t=null;const u=s;s=null,u?.()},f)}),i=()=>{o?.abort(),r(),o=null};return{abort:i,fetch:async(f,g)=>{i(),o=new AbortController;const u=o;if(g>0&&await l(g),o!==u||u.signal.aborted)return{status:"aborted"};try{const p=await e({editor:n,query:f,signal:u.signal});return o!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:p}}catch{return o!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function de({placement:n,offset:e,flip:o,floatingUi:t}){var s,r,l,i;const d=[J({mainAxis:(s=e.mainAxis)!==null&&s!==void 0?s:4,crossAxis:(r=e.crossAxis)!==null&&r!==void 0?r:0})];return o&&d.push(Y()),!(t==null||(l=t.middleware)===null||l===void 0)&&l.length&&d.push(...t.middleware),{placement:n,strategy:(i=t?.strategy)!==null&&i!==void 0?i:"absolute",middleware:d}}function fe(n){if(n instanceof HTMLElement)return n;if(typeof n=="string")try{const e=document.querySelector(n);if(e)return e}catch{return document.body}return document.body}function ge({getReferenceRect:n,contextElement:e,config:o,container:t,dismissOnOutsideClick:s,dismiss:r}){return(l,i={})=>{const d={getBoundingClientRect:()=>{var m;return(m=n())!==null&&m!==void 0?m:new DOMRect},contextElement:e};let f=!1;const g=!l.isConnected;g&&fe(t).appendChild(l),i.onPosition||(l.style.visibility="hidden",l.style.width="max-content");const p=G(d,l,()=>{Z(d,l,{placement:o.placement,strategy:o.strategy,middleware:o.middleware}).then(({x:m,y:h,placement:c,strategy:w})=>{if(i.onPosition){i.onPosition({x:m,y:h,placement:c,strategy:w});return}Object.assign(l.style,{position:w,left:`${m}px`,top:`${h}px`}),f||(f=!0,l.style.visibility="")})},i.autoUpdate);let x;return s&&(x=m=>{const h=m.target;!(h instanceof Node)||l.contains(h)||e.contains(h)||r()},document.addEventListener("pointerdown",x,!0)),()=>{p(),x&&document.removeEventListener("pointerdown",x,!0),g&&l.remove()}}}function pe({editor:n,pluginKey:e,items:o,renderer:t,minQueryLength:s,debounce:r,initialItems:l,placement:i,offset:d,container:f,flip:g,floatingUi:u,dismissOnOutsideClick:p,command:x,clientRectFor:m,dispatchExit:h}){let c;const w=ce({editor:n,items:o}),y=de({placement:i,offset:d,flip:g,floatingUi:u});function R(a,T){switch(a){case"started":var v;t==null||(v=t.onStart)===null||v===void 0||v.call(t,T);break;case"updated":var C;t==null||(C=t.onUpdate)===null||C===void 0||C.call(t,T);break;case"stopped":var q;t==null||(q=t.onExit)===null||q===void 0||q.call(t,T)}}return{update:async(a,T)=>{var v,C;const q=e.getState(T),D=e.getState(a.state);if(!q||!D)return;let E=null;const $=q.query!==D.query,P=q.text!==D.text,O=q.range.from!==D.range.from||q.range.to!==D.range.to,N=$||P||O;if(!q.active&&D.active)E="started";else if(q.active&&!D.active)E="stopped";else if(D.active&&N)E="updated";else return;const S=E==="stopped"?q:D,A=a.dom.querySelector(`[data-decoration-id="${S.decorationId}"]`),M=m(a,A),k=s===0||(S.query?S.query.length>=s:!1),I=(E==="started"||E==="updated")&&k;if(c={editor:n,range:S.range,query:S.query||"",text:S.text||"",items:l??[],command:_=>x({editor:n,range:S.range,props:_}),decorationNode:A,clientRect:M,loading:I,placement:i,offset:{mainAxis:(v=d.mainAxis)!==null&&v!==void 0?v:4,crossAxis:(C=d.crossAxis)!==null&&C!==void 0?C:0},container:f,flip:g,floatingUi:y,mount:ge({getReferenceRect:M,contextElement:a.dom,config:y,container:f,dismissOnOutsideClick:p,dismiss:()=>h(n.view)})},E==="started"){var F;t==null||(F=t.onBeforeStart)===null||F===void 0||F.call(t,c)}if(E==="updated"){var K;t==null||(K=t.onBeforeUpdate)===null||K===void 0||K.call(t,c)}if(E==="started"&&R(E,c),E==="started"||E==="updated")if(!I)w.abort(),c={...c,items:l??[],loading:!1};else{c={...c,items:l??[],loading:!0},E="updated",R(E,c);const _=await w.fetch(S.query||"",r);if(_.status==="aborted")return;const L=e.getState(a.state);if(!L?.active){w.abort();return}c=_.status==="resolved"?{...c,items:_.items,loading:!1}:{...c,loading:!1}}if(E==="stopped"){w.abort(),R(E,c),c=void 0;return}E==="updated"&&R(E,c)},destroy:()=>{var a;w.abort(),c&&(t==null||(a=t.onExit)===null||a===void 0||a.call(t,c))}}}const B=new U("suggestion");function j({pluginKey:n=B,editor:e,char:o="@",allowSpaces:t=!1,allowToIncludeChar:s=!1,allowedPrefixes:r=[" "],startOfLine:l=!1,decorationTag:i="span",decorationClass:d="suggestion",decorationContent:f="",decorationEmptyClass:g="is-empty",command:u=()=>null,items:p=()=>[],minQueryLength:x=0,debounce:m=0,initialItems:h,placement:c="bottom-start",offset:w={},container:y,flip:R=!0,floatingUi:a,dismissOnOutsideClick:T=!0,render:v=()=>({}),allow:C=()=>!0,findSuggestionMatch:q=ne,shouldShow:D,shouldResetDismissed:E}){const $=v?.(),P=t&&!s,O=(A,M)=>ae(e,A,M,n);function N(A){return le({...A,editor:e,shouldResetDismissed:E,effectiveAllowSpaces:P})}const S=A=>re({view:A,pluginKeyRef:n});return new V({key:n,view:()=>pe({editor:e,pluginKey:n,items:p,renderer:$,minQueryLength:x,debounce:m,initialItems:h,placement:c,offset:w,container:y,flip:R,floatingUi:a,dismissOnOutsideClick:T,command:u,clientRectFor:O,dispatchExit:S}),state:ue({editor:e,char:o,effectiveAllowSpaces:P,allowToIncludeChar:s,allowedPrefixes:r,startOfLine:l,findSuggestionMatch:q,allow:C,shouldShow:D,shouldKeepDismissed:N,pluginKey:n}),props:ie({pluginKey:n,decorationTag:i,decorationClass:d,decorationContent:f,decorationEmptyClass:g,renderer:$,dispatchExit:S})})}function Re(n,e=B){const o=n.state.tr.setMeta(e,{exit:!0});n.dispatch(o)}var qe=j;function me(n){const e=Q.c(17),{editor:o,query:t,items:s,onSelect:r,onClose:l}=n,[i,d]=b.useState(0),f=b.useRef(s),g=b.useRef(i),u=b.useRef(r),p=b.useRef(l),x=b.useDeferredValue(t),[m,h]=b.useState(x);m!==x&&(h(x),d(0)),i>=s.length&&s.length>0&&d(0);let c,w;e[0]!==s?(c=()=>{f.current=s},w=[s],e[0]=s,e[1]=c,e[2]=w):(c=e[1],w=e[2]),b.useEffect(c,w);let y,R;e[3]!==i?(y=()=>{g.current=i},R=[i],e[3]=i,e[4]=y,e[5]=R):(y=e[4],R=e[5]),b.useEffect(y,R);let a,T;e[6]!==r?(a=()=>{u.current=r},T=[r],e[6]=r,e[7]=a,e[8]=T):(a=e[7],T=e[8]),b.useEffect(a,T);let v,C;e[9]!==l?(v=()=>{p.current=l},C=[l],e[9]=l,e[10]=v,e[11]=C):(v=e[10],C=e[11]),b.useEffect(v,C);let q,D;e[12]!==o?(D=()=>{if(o?.isDestroyed)return;let P;try{P=o.view.dom}catch{return}if(!P)return;const O=S=>{const A=f.current;if(!A.length)return!1;const M=()=>d(I=>(I+1)%A.length),k=()=>d(I=>(I-1+A.length)%A.length);switch(S.key){case"ArrowUp":return S.preventDefault(),k(),!0;case"ArrowDown":return S.preventDefault(),M(),!0;case"Tab":return S.preventDefault(),S.shiftKey?k():M(),!0;case"Home":return S.preventDefault(),d(0),!0;case"End":return S.preventDefault(),d(A.length-1),!0;case"Enter":{if(S.isComposing)return!1;S.preventDefault();const I=g.current;return I!==-1&&A[I]&&u.current?.(A[I],I),!0}case"Escape":return S.preventDefault(),p.current?.(),!0;default:return!1}},N=S=>{O(S)};return P.addEventListener("keydown",N,!0),()=>{P?.removeEventListener("keydown",N,!0)}},q=[o],e[12]=o,e[13]=q,e[14]=D):(q=e[13],D=e[14]),b.useEffect(D,q);const E=s.length?i:void 0;let $;return e[15]!==E?($={selectedIndex:E,setSelectedIndex:d},e[15]=E,e[16]=$):$=e[16],$}function ye(n,e){switch(e.type){case"SET_SELECTED_ITEM":return{...n,selectedItem:e.payload};case"ON_START":return{...n,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...n,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return n}}const ve=b.createContext(void 0);function xe(){const n=b.useContext(ve);if(!n)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return n}function be(n){const e=Q.c(16),{editor:o,char:t,pluginKey:s,allow:r,onOpenChange:l}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=i):i=e[0];const[d,f]=b.useReducer(ye,i);let g;e[1]!==l?(g=h=>{l?.(h)},e[1]=l,e[2]=g):g=e[2];const u=b.useEffectEvent(g);let p;e[3]!==t||e[4]!==r||e[5]!==o||e[6]!==u||e[7]!==s?(p=()=>{if(o?.isDestroyed)return;const h=s instanceof U?s:new U(s);o.state.plugins.find(y=>y.spec.key===h)&&o.unregisterPlugin(h);const w=j({pluginKey:h,editor:o,char:t,allow(y){const R=o.state.doc.resolve(y.range.from);for(let a=R.depth;a>0;a--)if(R.node(a).type.name==="image")return!1;return!(r&&!r(y))},command(){},render:()=>({onStart:y=>{f({type:"ON_START",payload:{element:y.decorationNode??null,query:y.query,range:y.range}}),u(!0)},onUpdate:y=>{f({type:"ON_UPDATE",payload:{element:y.decorationNode??null,query:y.query,range:y.range}})},onKeyDown:y=>y.event.key==="Escape"?(f({type:"ON_EXIT"}),!0):!1,onExit:()=>{f({type:"ON_EXIT"}),u(!1)}}),items:he});return o.registerPlugin(w),()=>{o?.isDestroyed||o.unregisterPlugin(h)}},e[3]=t,e[4]=r,e[5]=o,e[6]=u,e[7]=s,e[8]=p):p=e[8];let x;e[9]!==t||e[10]!==r||e[11]!==o||e[12]!==s?(x=[o,s,t,f,r],e[9]=t,e[10]=r,e[11]=o,e[12]=s,e[13]=x):x=e[13],b.useEffect(p,x);let m;return e[14]!==d?(m={state:d,dispatch:f},e[14]=d,e[15]=m):m=e[15],m}function he(){return[]}function Ce({editor:n,queryKey:e,queryFn:o,onSelect:t}){const{state:s,dispatch:r}=xe(),l=b.useDeferredValue(s.query),{data:i}=ee({queryKey:te.suggestionItems(e,s.open,l),queryFn:()=>s.open?o({query:l}):[]}),d=()=>{r({type:"ON_EXIT"})},f=async(u,p)=>{if(!(s.selectedItem!==null||!s.range)){r({type:"SET_SELECTED_ITEM",payload:u});try{const{view:x}=n,h=x.state.selection.$to.nodeAfter?.text?.startsWith(" "),c=s.range?{...s.range}:{from:0,to:0};h&&s.range&&(c.to+=1),await t({range:c,item:u})===!1?r({type:"SET_SELECTED_ITEM",payload:null}):d()}catch{d()}}},{selectedIndex:g}=me({editor:n,query:l,items:i,onSelect:f,onClose:d});return{selectedItem:s.selectedItem,items:i,selectedIndex:g,close:d,onSelect:f}}export{ve as S,xe as a,Ce as b,qe as c,Re as e,we as s,be as u};
1
+ import{o as X,h as U,j as V,D as H,p as W,q as z}from"./index-DmF8NlWI.js";import{eJ as J,eK as Y,ep as G,eL as Z,r as b,c as Q,D as ee,K as te}from"./index-CyBVTyGa.js";var we=X;function ne(n){var e;const{char:o,allowSpaces:t,allowToIncludeChar:s,allowedPrefixes:r,startOfLine:l,$position:i}=n,d=t&&!s,f=z(o),g=new RegExp(`\\s${f}$`),u=l?"^":"",p=s?"":f,x=d?new RegExp(`${u}${f}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${u}(?:^)?${f}[^\\s${p}]*`,"gm"),m=((e=i.nodeBefore)===null||e===void 0?void 0:e.isText)&&i.nodeBefore.text;if(!m)return null;const h=i.pos-m.length,c=Array.from(m.matchAll(x)).pop();if(!c||c.input===void 0||c.index===void 0)return null;const w=c.input.slice(Math.max(0,c.index-1),c.index),y=new RegExp(`^[${r?.join("")}\0]?$`).test(w);if(r!==null&&!y)return null;const R=h+c.index;let a=R+c[0].length;return d&&g.test(m.slice(a-1,a+1))&&(c[0]+=" ",a+=1),R<i.pos&&a>=i.pos?{range:{from:R,to:a},query:c[0].slice(o.length),text:c[0]}:null}function oe(n){return n.docChanged?n.steps.some(e=>{const o=e.slice;if(!o?.content)return!1;const t=o.content.textBetween(0,o.content.size,`
2
+ `);return/\s/.test(t)}):!1}function se(n){return()=>{const e=n.state.selection.$anchor.pos,{top:o,right:t,bottom:s,left:r}=n.view.coordsAtPos(e);try{return new DOMRect(r,o,t-r,s-o)}catch{return null}}}function ae(n,e,o,t){return o?()=>{const s=t.getState(n.state),r=s?.decorationId,l=e.dom.querySelector(`[data-decoration-id="${r}"]`);return l?.getBoundingClientRect()||null}:se(n)}function le({match:n,dismissedRange:e,state:o,transaction:t,editor:s,shouldResetDismissed:r,effectiveAllowSpaces:l}){return r?.({editor:s,state:o,range:e,match:n,transaction:t,allowSpaces:l})?!1:l?n.range.from===e.from:n.range.from===e.from&&!oe(t)}function re({view:n,pluginKeyRef:e}){const o=n.state.tr.setMeta(e,{exit:!0});n.dispatch(o)}function ie({pluginKey:n,decorationTag:e,decorationClass:o,decorationContent:t,decorationEmptyClass:s,renderer:r,dispatchExit:l}){return{handleKeyDown(i,d){var f;const g=n.getState(i.state);if(!g.active)return!1;if(d.key==="Escape"||d.key==="Esc"){var u;return r==null||(u=r.onKeyDown)===null||u===void 0||u.call(r,{view:i,event:d,range:g.range}),l(i),!0}return(r==null||(f=r.onKeyDown)===null||f===void 0?void 0:f.call(r,{view:i,event:d,range:g.range}))||!1},decorations(i){const{active:d,range:f,decorationId:g,query:u}=n.getState(i);if(!d)return null;const p=!u?.length,x=[o];return p&&x.push(s),H.create(i.doc,[W.inline(f.from,f.to,{nodeName:e,class:x.join(" "),"data-decoration-id":g||void 0,"data-decoration-content":t})])}}}function ue({editor:n,char:e,effectiveAllowSpaces:o,allowToIncludeChar:t,allowedPrefixes:s,startOfLine:r,findSuggestionMatch:l,allow:i,shouldShow:d,shouldKeepDismissed:f,pluginKey:g}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,p,x,m){const{isEditable:h}=n,{composing:c}=n.view,{selection:w}=u,{empty:y,from:R}=w,a={...p},T=u.getMeta(g);if(T&&T.exit)return a.active=!1,a.decorationId=null,a.range={from:0,to:0},a.query=null,a.text=null,a.dismissedRange=p.active?{...p.range}:p.dismissedRange,a;if(a.composing=c,u.docChanged&&a.dismissedRange!==null&&(a.dismissedRange={from:u.mapping.map(a.dismissedRange.from),to:u.mapping.map(a.dismissedRange.to)}),h&&(y||n.view.composing)){(R<p.range.from||R>p.range.to)&&!c&&!p.composing&&(a.active=!1);const v=l({char:e,allowSpaces:o,allowToIncludeChar:t,allowedPrefixes:s,startOfLine:r,$position:w.$from}),C=`id_${Math.floor(Math.random()*4294967295)}`;v&&i({editor:n,state:m,range:v.range,isActive:p.active})&&(!d||d({editor:n,range:v.range,query:v.query,text:v.text,transaction:u}))?(a.dismissedRange!==null&&!f({match:v,dismissedRange:a.dismissedRange,state:m,transaction:u})&&(a.dismissedRange=null),a.dismissedRange===null?(a.active=!0,a.decorationId=p.decorationId||C,a.range=v.range,a.query=v.query,a.text=v.text):a.active=!1):(v||(a.dismissedRange=null),a.active=!1)}else a.active=!1;return a.active||(a.decorationId=null,a.range={from:0,to:0},a.query=null,a.text=null),a}}}function ce({editor:n,items:e}){let o=null,t=null,s=null;const r=()=>{t!==null&&(clearTimeout(t),t=null),s?.(),s=null},l=f=>new Promise(g=>{s=g,t=setTimeout(()=>{t=null;const u=s;s=null,u?.()},f)}),i=()=>{o?.abort(),r(),o=null};return{abort:i,fetch:async(f,g)=>{i(),o=new AbortController;const u=o;if(g>0&&await l(g),o!==u||u.signal.aborted)return{status:"aborted"};try{const p=await e({editor:n,query:f,signal:u.signal});return o!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:p}}catch{return o!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function de({placement:n,offset:e,flip:o,floatingUi:t}){var s,r,l,i;const d=[J({mainAxis:(s=e.mainAxis)!==null&&s!==void 0?s:4,crossAxis:(r=e.crossAxis)!==null&&r!==void 0?r:0})];return o&&d.push(Y()),!(t==null||(l=t.middleware)===null||l===void 0)&&l.length&&d.push(...t.middleware),{placement:n,strategy:(i=t?.strategy)!==null&&i!==void 0?i:"absolute",middleware:d}}function fe(n){if(n instanceof HTMLElement)return n;if(typeof n=="string")try{const e=document.querySelector(n);if(e)return e}catch{return document.body}return document.body}function ge({getReferenceRect:n,contextElement:e,config:o,container:t,dismissOnOutsideClick:s,dismiss:r}){return(l,i={})=>{const d={getBoundingClientRect:()=>{var m;return(m=n())!==null&&m!==void 0?m:new DOMRect},contextElement:e};let f=!1;const g=!l.isConnected;g&&fe(t).appendChild(l),i.onPosition||(l.style.visibility="hidden",l.style.width="max-content");const p=G(d,l,()=>{Z(d,l,{placement:o.placement,strategy:o.strategy,middleware:o.middleware}).then(({x:m,y:h,placement:c,strategy:w})=>{if(i.onPosition){i.onPosition({x:m,y:h,placement:c,strategy:w});return}Object.assign(l.style,{position:w,left:`${m}px`,top:`${h}px`}),f||(f=!0,l.style.visibility="")})},i.autoUpdate);let x;return s&&(x=m=>{const h=m.target;!(h instanceof Node)||l.contains(h)||e.contains(h)||r()},document.addEventListener("pointerdown",x,!0)),()=>{p(),x&&document.removeEventListener("pointerdown",x,!0),g&&l.remove()}}}function pe({editor:n,pluginKey:e,items:o,renderer:t,minQueryLength:s,debounce:r,initialItems:l,placement:i,offset:d,container:f,flip:g,floatingUi:u,dismissOnOutsideClick:p,command:x,clientRectFor:m,dispatchExit:h}){let c;const w=ce({editor:n,items:o}),y=de({placement:i,offset:d,flip:g,floatingUi:u});function R(a,T){switch(a){case"started":var v;t==null||(v=t.onStart)===null||v===void 0||v.call(t,T);break;case"updated":var C;t==null||(C=t.onUpdate)===null||C===void 0||C.call(t,T);break;case"stopped":var q;t==null||(q=t.onExit)===null||q===void 0||q.call(t,T)}}return{update:async(a,T)=>{var v,C;const q=e.getState(T),D=e.getState(a.state);if(!q||!D)return;let E=null;const $=q.query!==D.query,P=q.text!==D.text,O=q.range.from!==D.range.from||q.range.to!==D.range.to,N=$||P||O;if(!q.active&&D.active)E="started";else if(q.active&&!D.active)E="stopped";else if(D.active&&N)E="updated";else return;const S=E==="stopped"?q:D,A=a.dom.querySelector(`[data-decoration-id="${S.decorationId}"]`),M=m(a,A),k=s===0||(S.query?S.query.length>=s:!1),I=(E==="started"||E==="updated")&&k;if(c={editor:n,range:S.range,query:S.query||"",text:S.text||"",items:l??[],command:_=>x({editor:n,range:S.range,props:_}),decorationNode:A,clientRect:M,loading:I,placement:i,offset:{mainAxis:(v=d.mainAxis)!==null&&v!==void 0?v:4,crossAxis:(C=d.crossAxis)!==null&&C!==void 0?C:0},container:f,flip:g,floatingUi:y,mount:ge({getReferenceRect:M,contextElement:a.dom,config:y,container:f,dismissOnOutsideClick:p,dismiss:()=>h(n.view)})},E==="started"){var F;t==null||(F=t.onBeforeStart)===null||F===void 0||F.call(t,c)}if(E==="updated"){var L;t==null||(L=t.onBeforeUpdate)===null||L===void 0||L.call(t,c)}if(E==="started"&&R(E,c),E==="started"||E==="updated")if(!I)w.abort(),c={...c,items:l??[],loading:!1};else{c={...c,items:l??[],loading:!0},E="updated",R(E,c);const _=await w.fetch(S.query||"",r);if(_.status==="aborted")return;const K=e.getState(a.state);if(!K?.active){w.abort();return}c=_.status==="resolved"?{...c,items:_.items,loading:!1}:{...c,loading:!1}}if(E==="stopped"){w.abort(),R(E,c),c=void 0;return}E==="updated"&&R(E,c)},destroy:()=>{var a;w.abort(),c&&(t==null||(a=t.onExit)===null||a===void 0||a.call(t,c))}}}const B=new U("suggestion");function j({pluginKey:n=B,editor:e,char:o="@",allowSpaces:t=!1,allowToIncludeChar:s=!1,allowedPrefixes:r=[" "],startOfLine:l=!1,decorationTag:i="span",decorationClass:d="suggestion",decorationContent:f="",decorationEmptyClass:g="is-empty",command:u=()=>null,items:p=()=>[],minQueryLength:x=0,debounce:m=0,initialItems:h,placement:c="bottom-start",offset:w={},container:y,flip:R=!0,floatingUi:a,dismissOnOutsideClick:T=!0,render:v=()=>({}),allow:C=()=>!0,findSuggestionMatch:q=ne,shouldShow:D,shouldResetDismissed:E}){const $=v?.(),P=t&&!s,O=(A,M)=>ae(e,A,M,n);function N(A){return le({...A,editor:e,shouldResetDismissed:E,effectiveAllowSpaces:P})}const S=A=>re({view:A,pluginKeyRef:n});return new V({key:n,view:()=>pe({editor:e,pluginKey:n,items:p,renderer:$,minQueryLength:x,debounce:m,initialItems:h,placement:c,offset:w,container:y,flip:R,floatingUi:a,dismissOnOutsideClick:T,command:u,clientRectFor:O,dispatchExit:S}),state:ue({editor:e,char:o,effectiveAllowSpaces:P,allowToIncludeChar:s,allowedPrefixes:r,startOfLine:l,findSuggestionMatch:q,allow:C,shouldShow:D,shouldKeepDismissed:N,pluginKey:n}),props:ie({pluginKey:n,decorationTag:i,decorationClass:d,decorationContent:f,decorationEmptyClass:g,renderer:$,dispatchExit:S})})}function Re(n,e=B){const o=n.state.tr.setMeta(e,{exit:!0});n.dispatch(o)}var qe=j;function me(n){const e=Q.c(17),{editor:o,query:t,items:s,onSelect:r,onClose:l}=n,[i,d]=b.useState(0),f=b.useRef(s),g=b.useRef(i),u=b.useRef(r),p=b.useRef(l),x=b.useDeferredValue(t),[m,h]=b.useState(x);m!==x&&(h(x),d(0)),i>=s.length&&s.length>0&&d(0);let c,w;e[0]!==s?(c=()=>{f.current=s},w=[s],e[0]=s,e[1]=c,e[2]=w):(c=e[1],w=e[2]),b.useEffect(c,w);let y,R;e[3]!==i?(y=()=>{g.current=i},R=[i],e[3]=i,e[4]=y,e[5]=R):(y=e[4],R=e[5]),b.useEffect(y,R);let a,T;e[6]!==r?(a=()=>{u.current=r},T=[r],e[6]=r,e[7]=a,e[8]=T):(a=e[7],T=e[8]),b.useEffect(a,T);let v,C;e[9]!==l?(v=()=>{p.current=l},C=[l],e[9]=l,e[10]=v,e[11]=C):(v=e[10],C=e[11]),b.useEffect(v,C);let q,D;e[12]!==o?(D=()=>{if(o?.isDestroyed)return;let P;try{P=o.view.dom}catch{return}if(!P)return;const O=S=>{const A=f.current;if(!A.length)return!1;const M=()=>d(I=>(I+1)%A.length),k=()=>d(I=>(I-1+A.length)%A.length);switch(S.key){case"ArrowUp":return S.preventDefault(),k(),!0;case"ArrowDown":return S.preventDefault(),M(),!0;case"Tab":return S.preventDefault(),S.shiftKey?k():M(),!0;case"Home":return S.preventDefault(),d(0),!0;case"End":return S.preventDefault(),d(A.length-1),!0;case"Enter":{if(S.isComposing)return!1;S.preventDefault();const I=g.current;return I!==-1&&A[I]&&u.current?.(A[I],I),!0}case"Escape":return S.preventDefault(),p.current?.(),!0;default:return!1}},N=S=>{O(S)};return P.addEventListener("keydown",N,!0),()=>{P?.removeEventListener("keydown",N,!0)}},q=[o],e[12]=o,e[13]=q,e[14]=D):(q=e[13],D=e[14]),b.useEffect(D,q);const E=s.length?i:void 0;let $;return e[15]!==E?($={selectedIndex:E,setSelectedIndex:d},e[15]=E,e[16]=$):$=e[16],$}function ye(n,e){switch(e.type){case"SET_SELECTED_ITEM":return{...n,selectedItem:e.payload};case"ON_START":return{...n,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...n,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return n}}const ve=b.createContext(void 0);function xe(){const n=b.useContext(ve);if(!n)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return n}function be(n){const e=Q.c(16),{editor:o,char:t,pluginKey:s,allow:r,onOpenChange:l}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=i):i=e[0];const[d,f]=b.useReducer(ye,i);let g;e[1]!==l?(g=h=>{l?.(h)},e[1]=l,e[2]=g):g=e[2];const u=b.useEffectEvent(g);let p;e[3]!==t||e[4]!==r||e[5]!==o||e[6]!==u||e[7]!==s?(p=()=>{if(o?.isDestroyed)return;const h=s instanceof U?s:new U(s);o.state.plugins.find(y=>y.spec.key===h)&&o.unregisterPlugin(h);const w=j({pluginKey:h,editor:o,char:t,allow(y){const R=o.state.doc.resolve(y.range.from);for(let a=R.depth;a>0;a--)if(R.node(a).type.name==="image")return!1;return!(r&&!r(y))},command(){},render:()=>({onStart:y=>{f({type:"ON_START",payload:{element:y.decorationNode??null,query:y.query,range:y.range}}),u(!0)},onUpdate:y=>{f({type:"ON_UPDATE",payload:{element:y.decorationNode??null,query:y.query,range:y.range}})},onKeyDown:y=>y.event.key==="Escape"?(f({type:"ON_EXIT"}),!0):!1,onExit:()=>{f({type:"ON_EXIT"}),u(!1)}}),items:he});return o.registerPlugin(w),()=>{o?.isDestroyed||o.unregisterPlugin(h)}},e[3]=t,e[4]=r,e[5]=o,e[6]=u,e[7]=s,e[8]=p):p=e[8];let x;e[9]!==t||e[10]!==r||e[11]!==o||e[12]!==s?(x=[o,s,t,f,r],e[9]=t,e[10]=r,e[11]=o,e[12]=s,e[13]=x):x=e[13],b.useEffect(p,x);let m;return e[14]!==d?(m={state:d,dispatch:f},e[14]=d,e[15]=m):m=e[15],m}function he(){return[]}function Ce({editor:n,queryKey:e,queryFn:o,onSelect:t}){const{state:s,dispatch:r}=xe(),l=b.useDeferredValue(s.query),{data:i}=ee({queryKey:te.suggestionItems(e,s.open,l),queryFn:()=>s.open?o({query:l}):[]}),d=()=>{r({type:"ON_EXIT"})},f=async(u,p)=>{if(!(s.selectedItem!==null||!s.range)){r({type:"SET_SELECTED_ITEM",payload:u});try{const{view:x}=n,h=x.state.selection.$to.nodeAfter?.text?.startsWith(" "),c=s.range?{...s.range}:{from:0,to:0};h&&s.range&&(c.to+=1),await t({range:c,item:u})===!1?r({type:"SET_SELECTED_ITEM",payload:null}):d()}catch{d()}}},{selectedIndex:g}=me({editor:n,query:l,items:i,onSelect:f,onClose:d});return{selectedItem:s.selectedItem,items:i,selectedIndex:g,close:d,onSelect:f}}export{ve as S,xe as a,Ce as b,qe as c,Re as e,we as s,be as u};
@@ -1,4 +1,4 @@
1
- import{cO as jt,cP as Lt,cQ as $t,bP as kt,cR as Ft,ao as Ut,bO as Bt,an as Zt,aH as Vt,cS as zt,cT as Wt,cU as Jt,cV as Gt,cW as Ht,bM as Yt,cX as qt,cY as Kt,bL as Xt,bN as Qt,t as de,r as W,c as be,a0 as ea,z as ta,j as aa}from"./index-doEaURqC.js";import{u as ra}from"./use-mcp-client-D2DgMGL-.js";import{d as na,e as qe}from"./backoff-8mStPHYB.js";import{T as Ke,a as Xe,b as Qe}from"./task-board-BXLBBo-B.js";const et={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},tt=Object.values(et);class ${constructor(e){this.value=e}value;subs=new Set;get=()=>this.value;set=e=>{Object.is(e,this.value)||(this.value=e,this.subs.forEach(a=>a()))};update=e=>{this.set(e(this.value))};subscribe=e=>(this.subs.add(e),()=>{this.subs.delete(e)})}var at="vercel.ai.error",sa=Symbol.for(at),Te,we,x=class rt extends(we=Error,Te=sa,we){constructor({name:e,message:a,cause:r}){super(a),this[Te]=!0,this.name=e,this.cause=r}static isInstance(e){return rt.hasMarker(e,at)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function nt(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.toString():JSON.stringify(t)}var st="AI_InvalidArgumentError",ot=`vercel.ai.error.${st}`,oa=Symbol.for(ot),Ae,Oe,ia=class extends(Oe=x,Ae=oa,Oe){constructor({message:e,cause:a,argument:r}){super({name:st,message:e,cause:a}),this[Ae]=!0,this.argument=r}static isInstance(e){return x.hasMarker(e,ot)}},it="AI_JSONParseError",lt=`vercel.ai.error.${it}`,la=Symbol.for(lt),Me,Ce,Re=class extends(Ce=x,Me=la,Ce){constructor({text:t,cause:e}){super({name:it,message:`JSON parsing failed: Text: ${t}.
1
+ import{cQ as jt,cR as Lt,cS as $t,bR as kt,cT as Ft,ao as Ut,bQ as Bt,an as Zt,aH as Vt,cU as zt,cV as Wt,cW as Jt,cX as Gt,cY as Ht,bO as Yt,cZ as qt,c_ as Kt,bN as Xt,bP as Qt,t as de,r as W,c as be,a0 as ea,z as ta,j as aa}from"./index-CyBVTyGa.js";import{u as ra}from"./use-mcp-client-CqKNXJW7.js";import{d as na,e as qe}from"./backoff-8mStPHYB.js";import{T as Ke,a as Xe,b as Qe}from"./task-board-Qj-6Ctqf.js";const et={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},tt=Object.values(et);class ${constructor(e){this.value=e}value;subs=new Set;get=()=>this.value;set=e=>{Object.is(e,this.value)||(this.value=e,this.subs.forEach(a=>a()))};update=e=>{this.set(e(this.value))};subscribe=e=>(this.subs.add(e),()=>{this.subs.delete(e)})}var at="vercel.ai.error",sa=Symbol.for(at),Te,we,x=class rt extends(we=Error,Te=sa,we){constructor({name:e,message:a,cause:r}){super(a),this[Te]=!0,this.name=e,this.cause=r}static isInstance(e){return rt.hasMarker(e,at)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function nt(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.toString():JSON.stringify(t)}var st="AI_InvalidArgumentError",ot=`vercel.ai.error.${st}`,oa=Symbol.for(ot),Ae,Oe,ia=class extends(Oe=x,Ae=oa,Oe){constructor({message:e,cause:a,argument:r}){super({name:st,message:e,cause:a}),this[Ae]=!0,this.argument=r}static isInstance(e){return x.hasMarker(e,ot)}},it="AI_JSONParseError",lt=`vercel.ai.error.${it}`,la=Symbol.for(lt),Me,Ce,Re=class extends(Ce=x,Me=la,Ce){constructor({text:t,cause:e}){super({name:it,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${nt(e)}`,cause:e}),this[Me]=!0,this.text=t}static isInstance(t){return x.hasMarker(t,lt)}},ut="AI_TypeValidationError",ct=`vercel.ai.error.${ut}`,ua=Symbol.for(ct),Ne,Pe,Z=class pe extends(Pe=x,Ne=ua,Pe){constructor({value:e,cause:a,context:r}){let n="Type validation failed";if(r?.field&&(n+=` for ${r.field}`),r?.entityName||r?.entityId){n+=" (";const i=[];r.entityName&&i.push(r.entityName),r.entityId&&i.push(`id: "${r.entityId}"`),n+=i.join(", "),n+=")"}super({name:ut,message:`${n}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${nt(a)}`,cause:a}),this[Ne]=!0,this.value=e,this.context=r}static isInstance(e){return x.hasMarker(e,ct)}static wrap({value:e,cause:a,context:r}){var n,i,l;return pe.isInstance(a)&&a.value===e&&((n=a.context)==null?void 0:n.field)===r?.field&&((i=a.context)==null?void 0:i.entityName)===r?.entityName&&((l=a.context)==null?void 0:l.entityId)===r?.entityId?a:new pe({value:e,cause:a,context:r})}};new TextDecoder;var D=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const n=()=>{const i=a.length,l=new Array(e);for(let o=0;o<e;o++)l[o]=a[Math.random()*i|0];return l.join("")};if(t==null)return n;if(a.includes(r))throw new ia({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${n()}`};D();function ca(t){var e,a;return(a=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?a:!1}var da=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,pa=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function xe(t){const e=JSON.parse(t);return e===null||typeof e!="object"||da.test(t)===!1&&pa.test(t)===!1?e:fa(e)}function fa(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const n in r){const i=r[n];i&&typeof i=="object"&&e.push(i)}}}return t}function ma(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return xe(t)}try{return xe(t)}finally{Error.stackTraceLimit=e}}function Se(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){const{additionalProperties:a}=t;t.additionalProperties=a!=null&&typeof a!="boolean"?B(a):!1;const{properties:r}=t;if(r!=null)for(const n of Object.keys(r))r[n]=B(r[n])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(B):B(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(B)),t.allOf!=null&&(t.allOf=t.allOf.map(B)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(B));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=B(e[a]);return t}function B(t){return typeof t=="boolean"?t:Se(t)}var ha=Symbol("Let zodToJsonSchema decide on which parser to use"),De={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},ga=t=>typeof t=="string"?{...De,name:t}:{...De,...t};function P(){return{}}function va(t,e){var a,r,n;const i={type:"array"};return(a=t.type)!=null&&a._def&&((n=(r=t.type)==null?void 0:r._def)==null?void 0:n.typeName)!=="ZodAny"&&(i.items=S(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(i.minItems=t.minLength.value),t.maxLength&&(i.maxItems=t.maxLength.value),t.exactLength&&(i.minItems=t.exactLength.value,i.maxItems=t.exactLength.value),i}function ya(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function ba(){return{type:"boolean"}}function dt(t,e){return S(t.type._def,e)}var Sa=(t,e)=>S(t.innerType._def,e);function pt(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(n=>pt(t,e,n))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return _a(t)}}var _a=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Ea(t,e){return{...S(t.innerType._def,e),default:t.defaultValue()}}function Ia(t,e){return e.effectStrategy==="input"?S(t.schema._def,e):P()}function Ta(t){return{type:"string",enum:Array.from(t.values)}}var wa=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Aa(t,e){const a=[S(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),S(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(n=>!!n),r=[];return a.forEach(n=>{if(wa(n))r.push(...n.allOf);else{let i=n;if("additionalProperties"in n&&n.additionalProperties===!1){const{additionalProperties:l,...o}=n;i=o}r.push(i)}}),r.length?{allOf:r}:void 0}function Oa(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var ue=void 0,j={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ue===void 0&&(ue=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ue),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function ft(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":L(a,"email",r.message,e);break;case"format:idn-email":L(a,"idn-email",r.message,e);break;case"pattern:zod":N(a,j.email,r.message,e);break}break;case"url":L(a,"uri",r.message,e);break;case"uuid":L(a,"uuid",r.message,e);break;case"regex":N(a,r.regex,r.message,e);break;case"cuid":N(a,j.cuid,r.message,e);break;case"cuid2":N(a,j.cuid2,r.message,e);break;case"startsWith":N(a,RegExp(`^${ce(r.value,e)}`),r.message,e);break;case"endsWith":N(a,RegExp(`${ce(r.value,e)}$`),r.message,e);break;case"datetime":L(a,"date-time",r.message,e);break;case"date":L(a,"date",r.message,e);break;case"time":L(a,"time",r.message,e);break;case"duration":L(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{N(a,RegExp(ce(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&L(a,"ipv4",r.message,e),r.version!=="v4"&&L(a,"ipv6",r.message,e);break}case"base64url":N(a,j.base64url,r.message,e);break;case"jwt":N(a,j.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&N(a,j.ipv4Cidr,r.message,e),r.version!=="v4"&&N(a,j.ipv6Cidr,r.message,e);break}case"emoji":N(a,j.emoji(),r.message,e);break;case"ulid":{N(a,j.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{L(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{N(a,j.base64,r.message,e);break}}break}case"nanoid":N(a,j.nanoid,r.message,e)}return a}function ce(t,e){return e.patternStrategy==="escape"?Ca(t):t}var Ma=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ca(t){let e="";for(let a=0;a<t.length;a++)Ma.has(t[a])||(e+="\\"),e+=t[a];return e}function L(t,e,a,r){var n;t.format||(n=t.anyOf)!=null&&n.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function N(t,e,a,r){var n;t.pattern||(n=t.allOf)!=null&&n.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:je(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=je(e,r)}function je(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source;let i="",l=!1,o=!1,p=!1;for(let c=0;c<n.length;c++){if(l){i+=n[c],l=!1;continue}if(r.i){if(o){if(n[c].match(/[a-z]/)){p?(i+=n[c],i+=`${n[c-2]}-${n[c]}`.toUpperCase(),p=!1):n[c+1]==="-"&&((a=n[c+2])!=null&&a.match(/[a-z]/))?(i+=n[c],p=!0):i+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){i+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){i+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(n[c]==="$"){i+=`($|(?=[\r
@@ -1 +1 @@
1
- import{c as f,j as p,B as h}from"./index-doEaURqC.js";import{T as j,a as v,c as T}from"./tooltip-C91IS2ON.js";function B(d){const t=f.c(19);let e,o,i,n,r,a;t[0]!==d?({label:o,tooltipSide:n,variant:r,size:a,children:e,...i}=d,t[0]=d,t[1]=e,t[2]=o,t[3]=i,t[4]=n,t[5]=r,t[6]=a):(e=t[1],o=t[2],i=t[3],n=t[4],r=t[5],a=t[6]);const m=n===void 0?"top":n,u=r===void 0?"ghost":r,x=a===void 0?"icon-sm":a;let s;t[7]!==e||t[8]!==o||t[9]!==i||t[10]!==x||t[11]!==u?(s=p.jsx(j,{asChild:!0,children:p.jsx(h,{"data-slot":"icon-button","aria-label":o,variant:u,size:x,...i,children:e})}),t[7]=e,t[8]=o,t[9]=i,t[10]=x,t[11]=u,t[12]=s):s=t[12];let l;t[13]!==o||t[14]!==m?(l=p.jsx(v,{side:m,children:o}),t[13]=o,t[14]=m,t[15]=l):l=t[15];let c;return t[16]!==s||t[17]!==l?(c=p.jsxs(T,{children:[s,l]}),t[16]=s,t[17]=l,t[18]=c):c=t[18],c}export{B as I};
1
+ import{c as f,j as p,B as h}from"./index-CyBVTyGa.js";import{T as j,a as v,c as T}from"./tooltip-BjUMPvkB.js";function B(d){const t=f.c(19);let e,o,i,n,r,a;t[0]!==d?({label:o,tooltipSide:n,variant:r,size:a,children:e,...i}=d,t[0]=d,t[1]=e,t[2]=o,t[3]=i,t[4]=n,t[5]=r,t[6]=a):(e=t[1],o=t[2],i=t[3],n=t[4],r=t[5],a=t[6]);const m=n===void 0?"top":n,u=r===void 0?"ghost":r,x=a===void 0?"icon-sm":a;let s;t[7]!==e||t[8]!==o||t[9]!==i||t[10]!==x||t[11]!==u?(s=p.jsx(j,{asChild:!0,children:p.jsx(h,{"data-slot":"icon-button","aria-label":o,variant:u,size:x,...i,children:e})}),t[7]=e,t[8]=o,t[9]=i,t[10]=x,t[11]=u,t[12]=s):s=t[12];let l;t[13]!==o||t[14]!==m?(l=p.jsx(v,{side:m,children:o}),t[13]=o,t[14]=m,t[15]=l):l=t[15];let c;return t[16]!==s||t[17]!==l?(c=p.jsxs(T,{children:[s,l]}),t[16]=s,t[17]=l,t[18]=c):c=t[18],c}export{B as I};
@@ -1 +1 @@
1
- import{h as $,U as D,V as We,T as H,W as je,X as A,Y as U,j as W,Z as J,_ as Z,$ as me,a0 as qe,a1 as we,a2 as Xe,E as be,a3 as Ye,a4 as Je,d as ve}from"./index-CDAG9yf3.js";import{eJ as ye,eU as Ce,eI as Se,eV as Re,eW as Ee,eX as Te,eY as Oe,eZ as Ie,eK as Ae,e8 as Me,r as C,aN as ze}from"./index-doEaURqC.js";let G,Q;if(typeof WeakMap<"u"){let e=new WeakMap;G=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;G=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return G(e)||Q(e,Ze(e))}};function Ze(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),J.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return J.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(Z.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(h,f))}}return J.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){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:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!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:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),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(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.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 Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({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 Vt=class{getTextContent(e){return Ye(e,{textSerializers:Je(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!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,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){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 d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),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(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.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=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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 Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.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:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({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 Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=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"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Jt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Zt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Gt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Gt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Zt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Jt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
1
+ import{h as $,U as D,V as We,T as H,W as je,X as A,Y as U,j as W,Z as J,_ as Z,$ as me,a0 as qe,a1 as we,a2 as Xe,E as be,a3 as Ye,a4 as Je,d as ve}from"./index-DmF8NlWI.js";import{eK as ye,eV as Ce,eJ as Se,eW as Re,eX as Ee,eY as Te,eZ as Oe,e_ as Ie,eL as Ae,e9 as Me,r as C,aQ as ze}from"./index-CyBVTyGa.js";let G,Q;if(typeof WeakMap<"u"){let e=new WeakMap;G=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;G=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return G(e)||Q(e,Ze(e))}};function Ze(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),J.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return J.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(Z.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(h,f))}}return J.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){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:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!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:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),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(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.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 Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({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 Vt=class{getTextContent(e){return Ye(e,{textSerializers:Je(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!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,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){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 d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),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(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.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=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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 Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.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:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({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 Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=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"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Jt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Zt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Gt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Gt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Zt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Jt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};