decocms 4.502.2 → 4.502.3

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 (376) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-BmpX0aJ4.js → ActiveShapeUtils-BSxdgR9C.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-BugQG9bV.js → AlertCircle-ezsenyDA.js} +1 -1
  3. package/dist/client/assets/{AreaChart-C2JGxQiA.js → AreaChart-ZKSUgQFl.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BsOtfvqw.js → ArrowLeft-XWagtiKt.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BM60-fZY.js → ArrowUp-1Pn6KcFo.js} +1 -1
  6. package/dist/client/assets/{BarChart-B7UShXEl.js → BarChart-DJ64O8MN.js} +1 -1
  7. package/dist/client/assets/{Building02-DqK4SREZ.js → Building02-DVmqpekj.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-B4irlNQB.js → CategoricalChart-CNSzufmI.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-DIUFnJQp.js → CheckCircle-CN4P8qA2.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-CRMiEVEY.js → ChevronSelectorVertical-t7oZTVYb.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-C9gm2RHA.js → ChevronUp-DgF_0akr.js} +1 -1
  12. package/dist/client/assets/{Copy01-BrqDGrTX.js → Copy01-DD7TBaxd.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-C7MhbtAI.js → CreditCard01-BqWXWcAN.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-DjBJNxxU.js → DotsVertical-D63daqR4.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-Duc4DanJ.js → ErrorBarContext-B4iJvc9K.js} +1 -1
  16. package/dist/client/assets/{Globe04-Bi1qDXFD.js → Globe04-CAZFyv9C.js} +1 -1
  17. package/dist/client/assets/{Image01-LmX-9DTg.js → Image01-BmLj4iEQ.js} +1 -1
  18. package/dist/client/assets/{Key01-D7fc2of0.js → Key01-BCoXSbsF.js} +1 -1
  19. package/dist/client/assets/{Link01-UOxGnkqg.js → Link01-DKrKZRUt.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-D4fcNp0y.js → LinkBroken01-DQvdTTgG.js} +1 -1
  21. package/dist/client/assets/{Monitor01-zCUpqs5C.js → Monitor01-BL49Kh8w.js} +1 -1
  22. package/dist/client/assets/{Play-BaMMHzUS.js → Play-3PdWOSem.js} +1 -1
  23. package/dist/client/assets/{Plus-DBwsZRbL.js → Plus-BGSMJ3F-.js} +1 -1
  24. package/dist/client/assets/{SearchMd-Cz9CjV4u.js → SearchMd-gvLMH1IR.js} +1 -1
  25. package/dist/client/assets/{Sector-DRzP1YgK.js → Sector-B3DAIw7y.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-FE4oAEwY.js → ShoppingBag01-4HryX9q-.js} +1 -1
  27. package/dist/client/assets/{Sun-lUDK8Dny.js → Sun-xJ1qtoxz.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BLoNOmQx.js → SwitchHorizontal01-CL7aXkdk.js} +1 -1
  29. package/dist/client/assets/{Tool01-BYtrXXg0.js → Tool01-DmCjPcwM.js} +1 -1
  30. package/dist/client/assets/{Trash01-DmGIq4LE.js → Trash01-B0MFAKuS.js} +1 -1
  31. package/dist/client/assets/{Upload01-B1KubIEG.js → Upload01-AYcSEbb9.js} +1 -1
  32. package/dist/client/assets/{User01-DxYW6D1x.js → User01-CvrqyM7d.js} +1 -1
  33. package/dist/client/assets/{UserSquare-B3hi5v4G.js → UserSquare-Bkrct5dy.js} +1 -1
  34. package/dist/client/assets/{Users01-Dg9yGM1q.js → Users01-DavPAvfh.js} +1 -1
  35. package/dist/client/assets/{XAxis-BriqOO10.js → XAxis-FlBA9n9J.js} +1 -1
  36. package/dist/client/assets/{XClose-D_NlSxSm.js → XClose-BIF2YR7O.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-BpMDqvoU.js → ZoomOut-C8fNa3eF.js} +1 -1
  38. package/dist/client/assets/{access-gate-DawpkWaC.js → access-gate-BZb7qW2_.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-lyugU_mj.js → add-connection-dialog-7u1gOtS6.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-DEQNBU8x.js → agent-analytics-VOh2JKx_.js} +1 -1
  41. package/dist/client/assets/agent-app-Cy-7mlbG.js +1 -0
  42. package/dist/client/assets/{agent-assets-DpD_FYPJ.js → agent-assets-DfhNQhte.js} +1 -1
  43. package/dist/client/assets/{agent-automation-y8Q_blPP.js → agent-automation-aOpYgFy7.js} +1 -1
  44. package/dist/client/assets/{agent-automations-G_wOHGxQ.js → agent-automations-x4khpOSq.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-0w-hFhuF.js → agent-connect-sources-CrF1lRWL.js} +1 -1
  46. package/dist/client/assets/agent-deck-u2JWs68G.js +1 -0
  47. package/dist/client/assets/{agent-e2e-DDS2OBYo.js → agent-e2e-CHwlZzp2.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-CDaNVjiN.js → agent-experiments-DX3CG9k0.js} +1 -1
  49. package/dist/client/assets/{agent-file-CZwBMDPX.js → agent-file-D1m_qTrV.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-CDM9c3HL.js → agent-hosting-Dcgfj4zI.js} +1 -1
  51. package/dist/client/assets/{agent-icon-Cwi3uRdu.js → agent-icon-D4A6sHBt.js} +1 -1
  52. package/dist/client/assets/agent-library-D67pzeYP.js +1 -0
  53. package/dist/client/assets/agent-library-file-CZJsu_ea.js +1 -0
  54. package/dist/client/assets/{agent-monitor-DgbGzFfm.js → agent-monitor-douBnctS.js} +1 -1
  55. package/dist/client/assets/{agent-overview-D7sXtedV.js → agent-overview-B5GH8Rkv.js} +1 -1
  56. package/dist/client/assets/{agent-releases-DBGhKiDv.js → agent-releases-BlVq1e_9.js} +1 -1
  57. package/dist/client/assets/agent-settings-5-SGNKaX.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-CPneBPX9.js → agent-site-editor-C8GxpVWe.js} +3 -3
  59. package/dist/client/assets/agent-site-editor-code-D4faSpmS.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-BmAOigay.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-DiMqUzkm.js +1 -0
  62. package/dist/client/assets/agent-view-CK7HM1il.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-B7DCW97m.js → agent-view-guard-BqFtgH83.js} +1 -1
  64. package/dist/client/assets/{agents-list-WKtrnsCY.js → agents-list-DRk1BKzK.js} +1 -1
  65. package/dist/client/assets/{ai-providers-gwsES712.js → ai-providers-C1NEDtlg.js} +1 -1
  66. package/dist/client/assets/{alert-DD0xrZ6s.js → alert-Jt-lWiyr.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-Cww2cCKj.js → alert-dialog-Bw24kVyb.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-fsDdSYtz.js → analytics-sections-CSGEHq6o.js} +1 -1
  69. package/dist/client/assets/{api-keys-C4RupExd.js → api-keys-Dl5THCry.js} +1 -1
  70. package/dist/client/assets/api-keys-rr9eHiX_.js +1 -0
  71. package/dist/client/assets/{app-editor-BunD9Cep.js → app-editor-CwYBhRA6.js} +1 -1
  72. package/dist/client/assets/{asset-utils-B7vSk_IG.js → asset-utils-DWQUDlWC.js} +1 -1
  73. package/dist/client/assets/{auth-d1Zn25hw.js → auth-CxFoeet-.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-DXOnI1Dn.js → auth-catchall-wTTbbvcB.js} +1 -1
  75. package/dist/client/assets/{auth-entry-QKE13w72.js → auth-entry-CHhgR4id.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-BOn9jzuY.js → auth-split-layout-DHbd5zbD.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-p8iXxMbw.js → authenticate-and-persist-oauth-D6-DRm7Z.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-aeiODfl-.js → automation-list-row-BVDOJL2t.js} +1 -1
  79. package/dist/client/assets/{automation-runs-gnGbUEYl.js → automation-runs-jswuOSPW.js} +1 -1
  80. package/dist/client/assets/{automations-D6uaxrsR.js → automations-BPz-wjFv.js} +1 -1
  81. package/dist/client/assets/{autosend-DkgNxXhw.js → autosend-BP7dIixd.js} +1 -1
  82. package/dist/client/assets/{avatar-Bp-EkB-V.js → avatar-BmEw6w6S.js} +1 -1
  83. package/dist/client/assets/{badge-BIePf0xK.js → badge-DEUubLaF.js} +1 -1
  84. package/dist/client/assets/{block-document-D9afNZe_.js → block-document-Bybf3vEH.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-CVDMxLIY.js → blocks-preview-workspace-context--3frzfSc.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-Dgf9O_BB.js → blocks-tab-states-naQuVzsL.js} +3 -3
  87. package/dist/client/assets/{blog-schema-D_8LQntk.js → blog-schema-Cp6WcU58.js} +1 -1
  88. package/dist/client/assets/{board-analytics-QsikkAwD.js → board-analytics-C8ltYk1N.js} +1 -1
  89. package/dist/client/assets/{buckets-CELYezv2.js → buckets-bUK4w-wv.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-d10qBCA_.js → build-improve-prompt-doc-BhyCVv20.js} +1 -1
  91. package/dist/client/assets/{calendar-BnpyhDmY.js → calendar-9j-mqApB.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-D8PnCnVx.js → capability-load-error-yDSS8G5I.js} +1 -1
  93. package/dist/client/assets/{category-editor-BosHSdme.js → category-editor-CsYCI60-.js} +1 -1
  94. package/dist/client/assets/{chart-Bv9NYntf.js → chart-DezRUEbd.js} +1 -1
  95. package/dist/client/assets/{chat-context-CKK4nwlA.js → chat-context-CkzpVzP2.js} +1 -1
  96. package/dist/client/assets/{chat-draft-BMAMpVi3.js → chat-draft-DWoo8adU.js} +1 -1
  97. package/dist/client/assets/{checkbox-Dwjm_TLd.js → checkbox-JNUYg61n.js} +1 -1
  98. package/dist/client/assets/{choose-editor-CZoejY4P.js → choose-editor-DOmwg3bb.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-B_GTleKO.js → cli-auth-success-CqsVLwAX.js} +1 -1
  100. package/dist/client/assets/{client-icons-rqhSDiCg.js → client-icons-Bwor7VIE.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-BQ-ZfMjM.js +1 -0
  102. package/dist/client/assets/{collapsible-BEHE2idT.js → collapsible-Dzdq3pSP.js} +1 -1
  103. package/dist/client/assets/{collection-detail-CEB1twCS.js → collection-detail-Cgelc8Mb.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-CZETvC3F.js → collection-display-button-ByLAV5dY.js} +1 -1
  105. package/dist/client/assets/{collection-search-mDMHjO22.js → collection-search-Bett-OVD.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-BTz_B-8u.js → collection-table-wrapper-BwA0TEGQ.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-C8f6Only.js → collection-tabs-DXjqVmA6.js} +1 -1
  108. package/dist/client/assets/{column-rules-CHHzpXer.js → column-rules-2b0FUhGT.js} +1 -1
  109. package/dist/client/assets/{combobox-DsvKNdY8.js → combobox-CTVgkErb.js} +1 -1
  110. package/dist/client/assets/{command-D2C8egnH.js → command-MB9q2Bfp.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-980W-E9y.js → companion-mcps-section-WvUH8gDg.js} +1 -1
  112. package/dist/client/assets/{config-Df4GVvvj.js → config-BAMpwNkJ.js} +1 -1
  113. package/dist/client/assets/{connect-BCz-doDt.js → connect-BiJ195BR.js} +1 -1
  114. package/dist/client/assets/{connect-layout-dj6lGUOP.js → connect-layout-D-p04rP3.js} +1 -1
  115. package/dist/client/assets/{connection-CXmYeQRu.js → connection-DBgzwh-b.js} +1 -1
  116. package/dist/client/assets/{connection-card-BnbrpDH3.js → connection-card-C7m_7jQA.js} +1 -1
  117. package/dist/client/assets/{connection-detail-DgPXb5ec.js → connection-detail-BSvB999D.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-a4JD1Ns8.js → connection-form-helpers-DJxQ1TYC.js} +1 -1
  119. package/dist/client/assets/{connections-Cywtpg_p.js → connections-BH5Tkpsh.js} +1 -1
  120. package/dist/client/assets/{content-tab-DJpFcjvc.js → content-tab-dqeIiRI4.js} +3 -3
  121. package/dist/client/assets/{context-D3qk5qiN.js → context-CtsgmNcA.js} +1 -1
  122. package/dist/client/assets/{context-menu-BAv_ihvH.js → context-menu-DMMg9CvV.js} +1 -1
  123. package/dist/client/assets/{core.esm-D0fLNP6n.js → core.esm-DEpuNZ-Z.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-Dz2w339w.js → create-organization-dialog-dwl05WWi.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-BvFEfYSA.js → daily-pulse-ZuOVF8uj.js} +1 -1
  126. package/dist/client/assets/{discover-LQfpS4xG.js → discover-BWl5fHPo.js} +1 -1
  127. package/dist/client/assets/{domain-settings-B0WV9_Uz.js → domain-settings-CPOfvf7F.js} +1 -1
  128. package/dist/client/assets/{drawer-C7TJoqXz.js → drawer-0WwoG1lv.js} +1 -1
  129. package/dist/client/assets/{editor-r9_MTJH5.js → editor-DMSnXQVS.js} +1 -1
  130. package/dist/client/assets/{editor-classes-B9HFPeRc.js → editor-classes-_D3aVIkt.js} +1 -1
  131. package/dist/client/assets/{empty-state-DXyqmsSi.js → empty-state-Ch_8FU-6.js} +1 -1
  132. package/dist/client/assets/{empty-state-ChkfcEnf.js → empty-state-D86dkAEs.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-B2gWRdBp.js → extract-connection-data-CienK9Kp.js} +1 -1
  134. package/dist/client/assets/{feature-gate-B6qb42zy.js → feature-gate-DxADFYEr.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-DXx7v-jJ.js → feature-paywall-Bl1dj-EJ.js} +1 -1
  136. package/dist/client/assets/{file-explorer-B67HF6Wo.js → file-explorer-CByrrLxR.js} +1 -1
  137. package/dist/client/assets/{file-preview-Baou4Z0N.js → file-preview-DTJTxkww.js} +1 -1
  138. package/dist/client/assets/{file-share-button-DtVBXYxU.js → file-share-button-DS4I5txo.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-C2mdy7vI.js → file-type-icon-CkYEjqoY.js} +1 -1
  140. package/dist/client/assets/flat-project-BwbxsLnc.js +1 -0
  141. package/dist/client/assets/{folder-icon-Bqx-rRTJ.js → folder-icon-CbWhX04z.js} +1 -1
  142. package/dist/client/assets/{form-DDdiF5DN.js → form-QiGH5N0B.js} +1 -1
  143. package/dist/client/assets/{general-JuFqcNqn.js → general-EGzzrvYz.js} +1 -1
  144. package/dist/client/assets/{home-UcHgTtiG.js → home-Bch3495O.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-5DTVDnQ-.js → hosted-publish-feedback-CkiqNKkc.js} +1 -1
  146. package/dist/client/assets/{icon-button-DfjCa6Mk.js → icon-button-D8YCRkH3.js} +1 -1
  147. package/dist/client/assets/{index-D5I6z1z8.js → index-2oVSUqBv.js} +1 -1
  148. package/dist/client/assets/{index-BHzdhQYD.js → index-BHsQFo2r.js} +1 -1
  149. package/dist/client/assets/{index-sLNiMwXT.js → index-BQmgF11e.js} +1 -1
  150. package/dist/client/assets/{index-DCg7x8H-.js → index-BhNYHVP1.js} +1 -1
  151. package/dist/client/assets/{index-BlWeDA0T.js → index-C4rtGZhj.js} +3 -3
  152. package/dist/client/assets/{index-CCq4aC_-.js → index-C7oyzWQm.js} +3 -3
  153. package/dist/client/assets/{index-DrHP_BcE.js → index-C9L_7jwF.js} +1 -1
  154. package/dist/client/assets/{index-2M41MwRq.js → index-CsA2bVbS.js} +1 -1
  155. package/dist/client/assets/{index-BuXV8w2T.js → index-CswhgI6v.js} +1 -1
  156. package/dist/client/assets/{index-BOey0PQ3.js → index-CuaYFVYi.js} +1 -1
  157. package/dist/client/assets/{index-D1I5UKBv.js → index-DMvNt2yg.js} +1 -1
  158. package/dist/client/assets/{index-Cb4Qh-54.js → index-DtX8u4h5.js} +1 -1
  159. package/dist/client/assets/{index-CYLF_RCH.js → index-NEsUnXIa.js} +1 -1
  160. package/dist/client/assets/{index-BVXKUS4M.js → index-i3pR_VKW.js} +1 -1
  161. package/dist/client/assets/{index-redirect-BL8ikpY8.js → index-redirect-Ced0s2QX.js} +1 -1
  162. package/dist/client/assets/{index-LPxqYo8X.js → index-x_aJQLvk.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-C9osZa8h.js → infiniteQueryObserver-DRgbaZZO.js} +1 -1
  164. package/dist/client/assets/{infra-billing-Cs3idU5N.js → infra-billing-DtIbIUN4.js} +1 -1
  165. package/dist/client/assets/{input-BSKhVE-B.js → input-Aj2kXTDz.js} +1 -1
  166. package/dist/client/assets/{input-3uLsKqBB.js → input-BXtqV7BY.js} +3 -3
  167. package/dist/client/assets/{integration-icon-BRfynNZ5.js → integration-icon-B-VuBONI.js} +1 -1
  168. package/dist/client/assets/{jira-icon-KByV_Mf3.js → jira-icon-hzyShKUY.js} +1 -1
  169. package/dist/client/assets/{label-CCf767lm.js → label-BjPw9Rfi.js} +1 -1
  170. package/dist/client/assets/{layout-COMw43Ge.js → layout-5pLw498Y.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-bTO0GYdo.js → legacy-agents-deep-CxZxvx2y.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-TCc947lk.js → legacy-main-redirect-C7tMt1xT.js} +1 -1
  173. package/dist/client/assets/library-iXbb4Z9h.js +1 -0
  174. package/dist/client/assets/{library-tab-BGwlABCU.js → library-tab-CMc2XXjq.js} +1 -1
  175. package/dist/client/assets/{login-Cs3tkGZ_.js → login-Jzazo7Mm.js} +1 -1
  176. package/dist/client/assets/{markdown-BRIlR7nZ.js → markdown-Fzwq5r4L.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-BdWVQtZT.js → mcp-app-renderer-CLrd0dRs.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-Wpa3RhmZ.js → mcp-oauth-Biav5sbQ.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-CbRV1ySf.js → mcp-oauth-xTPg9JeG.js} +1 -1
  180. package/dist/client/assets/{members-D2nKnBqd.js → members-CdvpgtKw.js} +1 -1
  181. package/dist/client/assets/{memory-BOidyMfA.js → memory-y9e4Ido5.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-Dvm9KZA4.js → mini-report-page-MTRv9XKL.js} +1 -1
  183. package/dist/client/assets/{mock-board-D7x3oR1J.js → mock-board-CMGHUOrw.js} +1 -1
  184. package/dist/client/assets/{monaco-editor-CGec7a_K.js → monaco-editor-BfdWIqSi.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-BBfe42aa.js → monitoring-stats-row-DxnqczB_.js} +1 -1
  186. package/dist/client/assets/{multi-select-CWeD2kOU.js → multi-select-BHYZFxI5.js} +1 -1
  187. package/dist/client/assets/{mustache-CwHM8aj-.js → mustache-DhZE0kvx.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-D9WaXvgl.js → new-project-dialog-D0Tv538i.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-CgO92uMO.js → oauth-callback-ai-provider-DrLQ8Q2N.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-BdiwSco0.js → oauth-callback-po8q6AyA.js} +1 -1
  191. package/dist/client/assets/{onboarding-C0FoRXam.js → onboarding-DrXh1YvN.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-DScTerkb.js → openai-conversation-BH8Fgesh.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views--iSxVboR.js → optimistic-project-sidebar-views-D__5Cr6g.js} +1 -1
  194. package/dist/client/assets/{organization-choice-BfKg9bh6.js → organization-choice-C0En1OpW.js} +1 -1
  195. package/dist/client/assets/{orgs-DuBdGAZM.js → orgs-CK_DfZKd.js} +1 -1
  196. package/dist/client/assets/{page-seo-form-DobjM56n.js → page-seo-form-D1btP2ap.js} +1 -1
  197. package/dist/client/assets/{pair-Boroas12.js → pair-xLeCyNWu.js} +1 -1
  198. package/dist/client/assets/{plan-ladder-DRlbA6Oe.js → plan-ladder-DzICO7G_.js} +1 -1
  199. package/dist/client/assets/{popover-C86-20Mm.js → popover-BpfU2ryl.js} +1 -1
  200. package/dist/client/assets/{post-calendar-BCVyphrd.js → post-calendar-KeJhSxdr.js} +1 -1
  201. package/dist/client/assets/{post-editor-BcCUjE05.js → post-editor-CwWzdA0E.js} +1 -1
  202. package/dist/client/assets/{preview-content-Dk4Scdb5.js → preview-content-CcwX4f0y.js} +1 -1
  203. package/dist/client/assets/{preview-dialog-BP2Zt8Py.js → preview-dialog-B4mPpBCx.js} +1 -1
  204. package/dist/client/assets/{preview-panel-BGjEJtqj.js → preview-panel-DBxZxCWH.js} +1 -1
  205. package/dist/client/assets/{preview-tab-DJ2raYQ6.js → preview-tab-aiSzbsJL.js} +3 -3
  206. package/dist/client/assets/{product-picker-dialog-g66EoJ_T.js → product-picker-dialog-BiyexHdY.js} +1 -1
  207. package/dist/client/assets/{profile-BT5VjyCv.js → profile-DQcWjPxa.js} +1 -1
  208. package/dist/client/assets/{project-app-view-DmFCm9cm.js → project-app-view-Cfg5pwFE.js} +1 -1
  209. package/dist/client/assets/{project-feed-B4yf-56T.js → project-feed-CGmAQDLM.js} +1 -1
  210. package/dist/client/assets/{project-icon-CJp8KUWK.js → project-icon-BLicVbcB.js} +1 -1
  211. package/dist/client/assets/project-reports-BT-5gixX.js +1 -0
  212. package/dist/client/assets/project-tasks-BVM_y4Ay.js +1 -0
  213. package/dist/client/assets/{projects-7LPBT4kF.js → projects-BuXCzkbr.js} +1 -1
  214. package/dist/client/assets/{projects-empty-state-Bwas41PR.js → projects-empty-state-CRQsU5Mq.js} +1 -1
  215. package/dist/client/assets/{prompts-BVvVWZvL.js → prompts-CyMiInu-.js} +1 -1
  216. package/dist/client/assets/record-editor-Bh24cg7u.js +1 -0
  217. package/dist/client/assets/{redirect-editor-CBUBt5If.js → redirect-editor-Cft_OJ74.js} +1 -1
  218. package/dist/client/assets/{reports-BEw3YAN9.js → reports-DINK48W4.js} +1 -1
  219. package/dist/client/assets/reports-EeF58y4M.js +1 -0
  220. package/dist/client/assets/{reports-onboarding-C2RC2ok9.js → reports-onboarding-BlMHj-cr.js} +1 -1
  221. package/dist/client/assets/{reports-tab-cAMVw7Rk.js → reports-tab-CSLImW5W.js} +2 -2
  222. package/dist/client/assets/{repositories-C9isGzNA.js → repositories-CSth04qV.js} +1 -1
  223. package/dist/client/assets/{repository-binding-Ds0zXEVH.js → repository-binding-C-QRBZ2o.js} +1 -1
  224. package/dist/client/assets/{repository-import-picker-CJrt2Qyf.js → repository-import-picker-Ck-W8Fet.js} +1 -1
  225. package/dist/client/assets/{repository-picker-DoUZKYGY.js → repository-picker-D0Kp2t1m.js} +1 -1
  226. package/dist/client/assets/{require-capability-Canamm7b.js → require-capability-vyLDKVOB.js} +1 -1
  227. package/dist/client/assets/{required-auth-layout-CoQlG-uh.js → required-auth-layout-BLCp7vSK.js} +1 -1
  228. package/dist/client/assets/{reset-password-BIKAyV8Z.js → reset-password-DXNPcDpp.js} +1 -1
  229. package/dist/client/assets/{resizable-Bu_8_8YG.js → resizable-DwozeJKF.js} +1 -1
  230. package/dist/client/assets/{resolve-tab-icon-BYZBv0qd.js → resolve-tab-icon-CEo8MQEa.js} +1 -1
  231. package/dist/client/assets/{review-settings-dkP8FuZW.js → review-settings-BebeoRFU.js} +1 -1
  232. package/dist/client/assets/{roles-B5cvsmrd.js → roles-D-CzNTdG.js} +1 -1
  233. package/dist/client/assets/{route-1w9x4x4x.js → route-BWjfp1kO.js} +1 -1
  234. package/dist/client/assets/{route-BhzRlDpl.js → route-D1sLLo_F.js} +1 -1
  235. package/dist/client/assets/route-nPXlAoyw.js +1 -0
  236. package/dist/client/assets/{sandbox-lifecycle-context-DHjDdwbp.js → sandbox-lifecycle-context-BS-O8VCE.js} +1 -1
  237. package/dist/client/assets/{schema-DO5D2eCO.js → schema-BfTWP2eM.js} +1 -1
  238. package/dist/client/assets/{schema-D-34ICTJ.js → schema-CaduOy_B.js} +1 -1
  239. package/dist/client/assets/{scroll-area-BjUjV0Z5.js → scroll-area-HU3PM_-R.js} +1 -1
  240. package/dist/client/assets/{search-input-BaljBVL8.js → search-input-gCUrqSdC.js} +1 -1
  241. package/dist/client/assets/{search-toggle-BagUH5ou.js → search-toggle-BT0XOqxY.js} +1 -1
  242. package/dist/client/assets/{secret-ciphertext-B8vjXVJK.js → secret-ciphertext-DZXGQ0YC.js} +1 -1
  243. package/dist/client/assets/{secret-picker-CNgtWTyP.js → secret-picker-B2mcOvDG.js} +1 -1
  244. package/dist/client/assets/{secrets-Bgw4Vhpc.js → secrets-De4gayfI.js} +1 -1
  245. package/dist/client/assets/{sections-editor-DrdT1MI7.js → sections-editor-ZFiUMhtI.js} +1 -1
  246. package/dist/client/assets/{select-B54nmexC.js → select-B08ML6hj.js} +1 -1
  247. package/dist/client/assets/{select-model-BoCP7Le0.js → select-model-DPot5KJo.js} +1 -1
  248. package/dist/client/assets/{seo-editor-CReMwULk.js → seo-editor-SsRbvjPL.js} +1 -1
  249. package/dist/client/assets/{separator-BeOkUBr0.js → separator-B8ZUCiwI.js} +1 -1
  250. package/dist/client/assets/{settings-tab-D75yr9EZ.js → settings-tab-BWigvuuU.js} +1 -1
  251. package/dist/client/assets/{sheet-2W5SODwA.js → sheet-BgQYccYB.js} +1 -1
  252. package/dist/client/assets/{shell-layout-xMF7zZJW.js → shell-layout-28JRcfGc.js} +1 -1
  253. package/dist/client/assets/site-editor-Dpbvs0CS.js +1 -0
  254. package/dist/client/assets/{site-editor-toast-B6rO5nP0.js → site-editor-toast-BKnWJ7cQ.js} +1 -1
  255. package/dist/client/assets/{skills-C1sp0eJN.js → skills-pJFxGkQF.js} +1 -1
  256. package/dist/client/assets/{slider-BpixRq8v.js → slider-DjnSjzoJ.js} +1 -1
  257. package/dist/client/assets/{sortable.esm-B1VIDqmY.js → sortable.esm-vimQurcR.js} +1 -1
  258. package/dist/client/assets/{sso-B50YHclH.js → sso-COuGQVy-.js} +1 -1
  259. package/dist/client/assets/{suggestion-DjstHMLc.js → suggestion-DCMEkjoc.js} +1 -1
  260. package/dist/client/assets/{switch-ZvhKKFCY.js → switch-D548fZxN.js} +1 -1
  261. package/dist/client/assets/{symbol-CRqLTukg.js → symbol-d_WIAIBz.js} +1 -1
  262. package/dist/client/assets/{synced-repos-D0e12nej.js → synced-repos-DXRVRdeV.js} +1 -1
  263. package/dist/client/assets/{tab-icon-glyph-By9Irlxn.js → tab-icon-glyph-Cn1hJWKm.js} +1 -1
  264. package/dist/client/assets/{table-iG31aWmE.js → table-CI1oZOKj.js} +1 -1
  265. package/dist/client/assets/{tabs-CtKgNHMr.js → tabs-D9YXIhLT.js} +1 -1
  266. package/dist/client/assets/{task-board-C00mxWAh.js → task-board-DVS-070d.js} +1 -1
  267. package/dist/client/assets/{task-route-BCPomVVQ.js → task-route-BTeUbfS2.js} +1 -1
  268. package/dist/client/assets/{task-status-BDiexprl.js → task-status-CtMWxsza.js} +1 -1
  269. package/dist/client/assets/taskboard-analytics-BluYo63O.js +1 -0
  270. package/dist/client/assets/{tasks-AIRARaPK.js → tasks-CoTUYQBN.js} +1 -1
  271. package/dist/client/assets/tasks-Da9LhO-m.js +1 -0
  272. package/dist/client/assets/{textarea-BLu1V32o.js → textarea-Cm9WuKCc.js} +1 -1
  273. package/dist/client/assets/{thread-analytics-BMKFoeky.js → thread-analytics-C8KbYKAA.js} +1 -1
  274. package/dist/client/assets/{thread-intent-9GHukD-s.js → thread-intent-DWGyzG2H.js} +1 -1
  275. package/dist/client/assets/{thread-route-B1NXGQXt.js → thread-route-B_o5Zjl2.js} +1 -1
  276. package/dist/client/assets/{thread-route-CW7xmu6G.js → thread-route-CHlbKw5S.js} +1 -1
  277. package/dist/client/assets/{thread-sheet-body-rJHE2tap.js → thread-sheet-body-BkMk6e3g.js} +1 -1
  278. package/dist/client/assets/{time-range-picker-CNeKIOXx.js → time-range-picker-GZrtbU09.js} +1 -1
  279. package/dist/client/assets/{toggle-group-BLxmrLuD.js → toggle-group-CVV3QgOq.js} +1 -1
  280. package/dist/client/assets/{tool-namespace-Cu-DNTic.js → tool-namespace-JguyqV9V.js} +1 -1
  281. package/dist/client/assets/{toolbar-icon-button-670IDOJM.js → toolbar-icon-button-DJJccvHi.js} +1 -1
  282. package/dist/client/assets/{tooltip-B6W7NpVz.js → tooltip-knB_BmiO.js} +1 -1
  283. package/dist/client/assets/{tooltipContext-BWgKo-Vc.js → tooltipContext-B1sYDOEv.js} +1 -1
  284. package/dist/client/assets/{track-j7cOVNc5.js → track-BChCsB4E.js} +1 -1
  285. package/dist/client/assets/{types-C4NGZqb0.js → types-Tl69lmSm.js} +1 -1
  286. package/dist/client/assets/{url-slug-CCgQongS.js → url-slug-CzQ7Mi0G.js} +1 -1
  287. package/dist/client/assets/{usage-stats-2c6yVTyC.js → usage-stats-D0e4-Doz.js} +1 -1
  288. package/dist/client/assets/{use-ai-providers-BWqKJRmf.js → use-ai-providers-BLLCJ82i.js} +1 -1
  289. package/dist/client/assets/{use-app-takeover-DUugSHjQ.js → use-app-takeover-rF8JMh38.js} +1 -1
  290. package/dist/client/assets/{use-automations-DOCjbfCs.js → use-automations-st590zyh.js} +1 -1
  291. package/dist/client/assets/{use-autosave-BpEFoeBr.js → use-autosave-go0omyd9.js} +1 -1
  292. package/dist/client/assets/{use-chat-navigation-CmNsxQBq.js → use-chat-navigation-DrhyLHlD.js} +1 -1
  293. package/dist/client/assets/{use-clock-tick-B2MqiplU.js → use-clock-tick-DissHE7g.js} +1 -1
  294. package/dist/client/assets/{use-connect-companion-DCgJdQ-W.js → use-connect-companion-z1pYEImn.js} +1 -1
  295. package/dist/client/assets/{use-connection-BDpvwZcn.js → use-connection-mfEI4HYb.js} +1 -1
  296. package/dist/client/assets/{use-copy-_ycKA-XN.js → use-copy-BCgrYqWn.js} +1 -1
  297. package/dist/client/assets/{use-create-virtual-mcp-CXKmymqn.js → use-create-virtual-mcp-vIbXVTWJ.js} +1 -1
  298. package/dist/client/assets/{use-date-fns-locale-fMKfOMsB.js → use-date-fns-locale-CykwPDZa.js} +1 -1
  299. package/dist/client/assets/{use-debounced-autosave-B9xt5l_2.js → use-debounced-autosave-Xfan-H8l.js} +1 -1
  300. package/dist/client/assets/{use-debounced-value-ByyoTH63.js → use-debounced-value-BQw-U7yI.js} +1 -1
  301. package/dist/client/assets/{use-deco-credits-CT_j_qxS.js → use-deco-credits-yhiLjBMs.js} +1 -1
  302. package/dist/client/assets/{use-decopilot-events-Bd-4vex6.js → use-decopilot-events--SDGmxUY.js} +1 -1
  303. package/dist/client/assets/{use-delete-connection-DJ4nDOEg.js → use-delete-connection-BL-nx9aS.js} +1 -1
  304. package/dist/client/assets/{use-deployment-admin-BoLt0KCx.js → use-deployment-admin-Bj--7auC.js} +1 -1
  305. package/dist/client/assets/{use-ensure-project-folder-Dd1Qlz-V.js → use-ensure-project-folder-pIwHCsD5.js} +1 -1
  306. package/dist/client/assets/{use-fast-preview-draft-url-DZRNnF9t.js → use-fast-preview-draft-url-CQyP80WK.js} +1 -1
  307. package/dist/client/assets/{use-file-configs-DgLGloNq.js → use-file-configs-4iMZ7Oja.js} +1 -1
  308. package/dist/client/assets/{use-infinite-scroll-F7T2FF-S.js → use-infinite-scroll-BfZrsHvo.js} +1 -1
  309. package/dist/client/assets/{use-join-requests-DqXVwXAp.js → use-join-requests-aVVPMK5j.js} +1 -1
  310. package/dist/client/assets/{use-main-panel-tabs-CAJkn_vg.js → use-main-panel-tabs-uwm6yOAh.js} +1 -1
  311. package/dist/client/assets/{use-mcp-auth-status-2eKyky0r.js → use-mcp-auth-status-BSsISA4U.js} +1 -1
  312. package/dist/client/assets/{use-mcp-client-B333X4fs.js → use-mcp-client-iEvULqcR.js} +1 -1
  313. package/dist/client/assets/{use-mcp-prompts-P2KMjN9W.js → use-mcp-prompts-aNIE_qf0.js} +1 -1
  314. package/dist/client/assets/{use-mcp-tools-56vayh3K.js → use-mcp-tools-v8AMxGBw.js} +1 -1
  315. package/dist/client/assets/{use-members-DfdZqgw8.js → use-members-B2pgOmcT.js} +1 -1
  316. package/dist/client/assets/{use-mobile-hkvDmO1w.js → use-mobile-DR0ou4Mg.js} +1 -1
  317. package/dist/client/assets/{use-navigate-to-agent-Dzg43OKn.js → use-navigate-to-agent-ChjWG67f.js} +1 -1
  318. package/dist/client/assets/{use-open-billing-url-DJYL8W0U.js → use-open-billing-url-B2DuyyPV.js} +1 -1
  319. package/dist/client/assets/{use-org-auth-client-DROvF2zH.js → use-org-auth-client-Cy1K9alo.js} +1 -1
  320. package/dist/client/assets/{use-org-fs-D6VAaLCr.js → use-org-fs-B0T2bC7C.js} +1 -1
  321. package/dist/client/assets/{use-org-repo-syncs-DlDJxigu.js → use-org-repo-syncs-CDhTlqqP.js} +1 -1
  322. package/dist/client/assets/{use-org-sso-CH28wOEA.js → use-org-sso-dcnzEZJT.js} +1 -1
  323. package/dist/client/assets/{use-organization-roles-BQ-3VnZ-.js → use-organization-roles-DjUZ-DE_.js} +1 -1
  324. package/dist/client/assets/{use-organization-settings-DxTssZLI.js → use-organization-settings-CHQPn47n.js} +1 -1
  325. package/dist/client/assets/{use-panel-navigate-C2cHRlDL.js → use-panel-navigate-CTGXxycL.js} +1 -1
  326. package/dist/client/assets/{use-project-native-view-presence-bO2szMt1.js → use-project-native-view-presence-CIKytFPd.js} +1 -1
  327. package/dist/client/assets/{use-project-scope-BROCSZWk.js → use-project-scope-Z7wAK5MJ.js} +1 -1
  328. package/dist/client/assets/{use-recent-apps-DhLr7_TT.js → use-recent-apps-oeEnkRiE.js} +1 -1
  329. package/dist/client/assets/{use-releases-D6ba4LWy.js → use-releases-BWxjuvCL.js} +1 -1
  330. package/dist/client/assets/{use-reports-diagnostic-BYrSJ1-D.js → use-reports-diagnostic-xbuM_E_0.js} +1 -1
  331. package/dist/client/assets/{use-secrets-znuJNv0F.js → use-secrets-qjgwykUa.js} +1 -1
  332. package/dist/client/assets/{use-section-preview-base-CDeugTlj.js → use-section-preview-base-B5MZ5VcF.js} +1 -1
  333. package/dist/client/assets/{use-tags-frFveynu.js → use-tags-BH3EMa60.js} +1 -1
  334. package/dist/client/assets/{use-task-board-analytics-BLvo5Ioy.js → use-task-board-analytics-Tx5Fx3q9.js} +1 -1
  335. package/dist/client/assets/{use-task-board-events-BNCUuZ7v.js → use-task-board-events-CFP9J6zo.js} +1 -1
  336. package/dist/client/assets/{use-task-board-item-prs-C03gSLLs.js → use-task-board-item-prs-iw8jFozb.js} +1 -1
  337. package/dist/client/assets/{use-task-board-items-gTQZEpDz.js → use-task-board-items-BgANW4xl.js} +1 -1
  338. package/dist/client/assets/{use-task-metadata-D3ZyQdu3.js → use-task-metadata-Byl1laHV.js} +1 -1
  339. package/dist/client/assets/{use-thread-analytics-pc4Cx2fq.js → use-thread-analytics-BMao9ena.js} +1 -1
  340. package/dist/client/assets/{use-thread-outputs-BwFYAN97.js → use-thread-outputs-CnXr-3J8.js} +1 -1
  341. package/dist/client/assets/useInfiniteQuery-CH2YwNOR.js +1 -0
  342. package/dist/client/assets/{useQueries-6AB3hL0G.js → useQueries-Cc_lhKs7.js} +1 -1
  343. package/dist/client/assets/useSuspenseInfiniteQuery-9FV3iOtp.js +1 -0
  344. package/dist/client/assets/{users-DsZm3Nkx.js → users-zpa5Z81C.js} +1 -1
  345. package/dist/client/assets/{utils-D-T02kS4.js → utils-DdBqTK5U.js} +1 -1
  346. package/dist/client/assets/{variant-calendar-DoUmbH6Q.js → variant-calendar-BVMnrVNl.js} +1 -1
  347. package/dist/client/assets/{variant-draft-pointer-CGTqYMj8.js → variant-draft-pointer-DXvQS9LN.js} +1 -1
  348. package/dist/client/assets/{view-mode-toggle-BM2WBWnv.js → view-mode-toggle-B-G_ZgpR.js} +1 -1
  349. package/dist/client/assets/{virtual-mcp-CM_cNcV_.js → virtual-mcp-B_ndt1aK.js} +1 -1
  350. package/dist/client/assets/{watch-sse-pool-C1f9T3Cq.js → watch-sse-pool-BGVIlM9_.js} +1 -1
  351. package/dist/client/index.html +1 -1
  352. package/dist/server/server.js +1 -1
  353. package/package.json +1 -1
  354. package/dist/client/assets/agent-app-B_p1zClu.js +0 -1
  355. package/dist/client/assets/agent-deck-Bv4Ea3n5.js +0 -1
  356. package/dist/client/assets/agent-library-B8Kx2dH6.js +0 -1
  357. package/dist/client/assets/agent-library-file-D6BfiqFR.js +0 -1
  358. package/dist/client/assets/agent-settings-CYtLsqfY.js +0 -1
  359. package/dist/client/assets/agent-site-editor-code-CoA0Y8Pm.js +0 -2
  360. package/dist/client/assets/agent-site-editor-content-B6s0vW0K.js +0 -1
  361. package/dist/client/assets/agent-site-editor-preview-Deycj8Hn.js +0 -1
  362. package/dist/client/assets/agent-view-DKBEZHZf.js +0 -1
  363. package/dist/client/assets/api-keys-DIX6Wq_J.js +0 -1
  364. package/dist/client/assets/cms-settings-editor-B950DCbJ.js +0 -1
  365. package/dist/client/assets/flat-project-CqneD8tb.js +0 -1
  366. package/dist/client/assets/library-D9_ShewK.js +0 -1
  367. package/dist/client/assets/project-reports-D8ocu1pR.js +0 -1
  368. package/dist/client/assets/project-tasks-DJVmaqrl.js +0 -1
  369. package/dist/client/assets/record-editor-DywGKfn_.js +0 -1
  370. package/dist/client/assets/reports-wAXvk8Rj.js +0 -1
  371. package/dist/client/assets/route-y_BiPuKo.js +0 -1
  372. package/dist/client/assets/site-editor-BpVflMAH.js +0 -1
  373. package/dist/client/assets/taskboard-analytics-dOoDSrcB.js +0 -1
  374. package/dist/client/assets/tasks-D17PyrkT.js +0 -1
  375. package/dist/client/assets/useInfiniteQuery-Z8R3F4Sd.js +0 -1
  376. package/dist/client/assets/useSuspenseInfiniteQuery-CccYtrDO.js +0 -1
@@ -1 +1 @@
1
- import{c as P,at as Z,av as ee,b as Y,a2 as te,ab as ne,k as se,j as s,L as ae,n as J,r as M,d as oe,aK as W,H as q,P as _,a_ as ie,B as le}from"./index-BlWeDA0T.js";import{u as re}from"./use-mobile-hkvDmO1w.js";import{g as ce,u as ue,h as de,v as he}from"./use-app-takeover-DUugSHjQ.js";import{a as Q,R as fe,b as me}from"./resizable-Bu_8_8YG.js";import{h as pe,i as ge,m as xe}from"./use-project-native-view-presence-bO2szMt1.js";import{M as be,k as ye}from"./agent-icon-Cwi3uRdu.js";import{s as je}from"./XClose-D_NlSxSm.js";import{I as ve}from"./icon-button-DfjCa6Mk.js";import{c as Se,T as Ce,a as Te}from"./tooltip-B6W7NpVz.js";import{T as G}from"./toolbar-icon-button-670IDOJM.js";import{a as Le}from"./use-project-scope-BROCSZWk.js";import{c as Ne}from"./repository-binding-Ds0zXEVH.js";function U(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function Pe(l,e){const a=P.c(8);let i;a[0]!==e?(i=r=>U(r,e),a[0]=e,a[1]=i):i=a[1];const[n,o]=Z(l,i);let t;a[2]!==e||a[3]!==n?(t=U(n,e),a[2]=e,a[3]=n,a[4]=t):t=a[4];let d;return a[5]!==o||a[6]!==t?(d=[t,o],a[5]=o,a[6]=t,a[7]=d):d=a[7],d}const ze=33;function _e(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=ee.sidePanelWidth(),l[0]=e):e=l[0],Pe(e,ze)}function we(l){const e=P.c(60),{actions:a,navigation:i}=l,n=Y(),{org:o}=te(),t=Le(),d=Ne(t),r=ce(),{toggleSidebar:c}=ue(),u=de(),h=X(),m=ne();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={select:Oe},e[0]=p):p=e[0];const y=se(p),b=y?.mainView==="overview";let j;e[1]!==d?.title||e[2]!==n?(j=d?.title??n("common.loading"),e[1]=d?.title,e[2]=n,e[3]=j):j=e[3];const x=j;let S;e[4]!==b||e[5]!==y?.pageTitle||e[6]!==x||e[7]!==t||e[8]!==n?(S=b?t?x:n("sidebar.navDestinations.home"):n(y?.pageTitle??"page.view"),e[4]=b,e[5]=y?.pageTitle,e[6]=x,e[7]=t,e[8]=n,e[9]=S):S=e[9];const v=S;let L;e[10]!==o.slug||e[11]!==m||e[12]!==t?(L=m?{to:"/$org/projects",params:{org:o.slug},search:{project:t??void 0}}:{to:"/$org/projects/$agentId",params:{org:o.slug,agentId:t??""}},e[10]=o.slug,e[11]=m,e[12]=t,e[13]=L):L=e[13];const f=L;let g;if(e[14]!==r||e[15]!==b||e[16]!==o.slug||e[17]!==f||e[18]!==x||e[19]!==t||e[20]!==n||e[21]!==v){if(g=[],r){let T;e[23]!==n?(T=n("sidebar.navDestinations.settings"),e[23]=n,e[24]=T):T=e[24];let E;e[25]!==o.slug?(E={to:"/$org/settings/general",params:{org:o.slug}},e[25]=o.slug,e[26]=E):E=e[26];let $;e[27]!==T||e[28]!==E?($={key:"settings",label:T,link:E},e[27]=T,e[28]=E,e[29]=$):$=e[29],g.push($)}else if(t&&!b){let T;e[30]!==f||e[31]!==x?(T={key:"project",label:x,link:f},e[30]=f,e[31]=x,e[32]=T):T=e[32],g.push(T)}let B;e[33]!==v?(B={key:"page",label:v},e[33]=v,e[34]=B):B=e[34],g.push(B),e[14]=r,e[15]=b,e[16]=o.slug,e[17]=f,e[18]=x,e[19]=t,e[20]=n,e[21]=v,e[22]=g}else g=e[22];let N;e[35]!==f||e[36]!==t||e[37]!==n||e[38]!==u?(N=u&&t&&s.jsx(ve,{label:n("projects.flat.close"),asChild:!0,children:s.jsx(ae,{...f,children:s.jsx(je,{size:16})})}),e[35]=f,e[36]=t,e[37]=n,e[38]=u,e[39]=N):N=e[39];const C=N;let z;e[40]!==h||e[41]!==n||e[42]!==u?(z=u&&h&&!h.threadless&&s.jsxs(Se,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(G,{"aria-label":n(h.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":h.threadOpen,active:h.threadOpen,onClick:h.toggleThread,children:s.jsx(be,{size:16})})}),s.jsx(Te,{side:"bottom",children:n(h.threadOpen?"page.closeThread":"page.openThread")})]}),e[40]=h,e[41]=n,e[42]=u,e[43]=z):z=e[43];const F=z;let w;e[44]!==n?(w=n("layouts.shellControls.toggleSidebar"),e[44]=n,e[45]=w):w=e[45];let A;e[46]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ye,{size:16}),e[46]=A):A=e[46];let O;e[47]!==w||e[48]!==c?(O=s.jsx(G,{className:"md:hidden",onClick:c,"aria-label":w,children:A}),e[47]=w,e[48]=c,e[49]=O):O=e[49];let k;e[50]!==F||e[51]!==O?(k=s.jsxs(s.Fragment,{children:[O,F]}),e[50]=F,e[51]=O,e[52]=k):k=e[52];let R;return e[53]!==a||e[54]!==g||e[55]!==C||e[56]!==i||e[57]!==o.name||e[58]!==k?(R=s.jsx(J.Header,{leading:k,breadcrumbs:g,scope:o.name,actions:a,trailingActions:C,navigation:i}),e[53]=a,e[54]=g,e[55]=C,e[56]=i,e[57]=o.name,e[58]=k,e[59]=R):R=e[59],R}function Oe(l){return l.matches.findLast(ke)?.staticData}function ke(l){return l.staticData.pageTitle}const I="chat-layout-thread",D="chat-layout-content",K=M.createContext(null);function Ee(){return H()}function X(){return M.use(K)}function H(){const l=M.use(K);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=P.c(23),{children:a,...i}=l,n=re(),o=oe(),t=M.useRef(null),[d,r]=_e(),{threadOpen:c,contentOpen:u}=i,h=pe(i),m=c&&u?d:h.side,p=100-m,y=f=>{const g=f.getLayout(),N=g[I],C=g[D];typeof N!="number"||typeof C!="number"||Math.abs(N-m)<.001&&Math.abs(C-p)<.001||f.setLayout({[I]:m,[D]:p})},b=ge({visibility:i,threadVisibilityExplicit:i.threadVisibilityExplicit});let j;e[0]!==n||e[1]!==i||e[2]!==b?(j={...i,isMobile:n,mobileSurface:b},e[0]=n,e[1]=i,e[2]=b,e[3]=j):j=e[3];const x=j;let S;e[4]!==n||e[5]!==i||e[6]!==o||e[7]!==c||e[8]!==x?(S=!i.threadless&&s.jsx(he,{open:n?x.mobileSurface==="chat":c,onToggle:()=>{n?o({to:".",search:f=>({...f,...xe(x.mobileSurface==="chat"?"main":"chat")}),replace:!0}):i.toggleThread()}}),e[4]=n,e[5]=i,e[6]=o,e[7]=c,e[8]=x,e[9]=S):S=e[9];let v;e[10]!==a||e[11]!==u||e[12]!==p||e[13]!==n||e[14]!==r||e[15]!==y||e[16]!==c||e[17]!==m?(v=n?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(fe,{ref:f=>{if(t.current=f,!f)return;let g=!0;return queueMicrotask(()=>{g&&y(f)}),()=>{g=!1,t.current===f&&(t.current=null)}},defaultLayout:{[I]:m,[D]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(f,g)=>{const{isUserInteraction:N}=g;if(!N){const z=t.current;z&&y(z);return}const C=f[I];c&&u&&typeof C=="number"&&C>0&&C<100&&r(C)},children:a}),e[10]=a,e[11]=u,e[12]=p,e[13]=n,e[14]=r,e[15]=y,e[16]=c,e[17]=m,e[18]=v):v=e[18];let L;return e[19]!==S||e[20]!==v||e[21]!==x?(L=s.jsxs(K,{value:x,children:[S,v]}),e[19]=S,e[20]=v,e[21]=x,e[22]=L):L=e[22],L}function Me(l){const e=P.c(16),{children:a,topbar:i}=l,n=H();if(n.isMobile){let h;return e[0]!==a||e[1]!==n.mobileSurface||e[2]!==i?(h=n.mobileSurface==="chat"?s.jsxs(_,{variant:"plain","data-slot":"chat-layout-thread",children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=n.mobileSurface,e[2]=i,e[3]=h):h=e[3],h}const o=n.threadOpen?"":void 0;let t;e[4]!==a||e[5]!==n.threadOpen||e[6]!==i?(t=n.threadOpen&&s.jsxs(s.Fragment,{children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=n.threadOpen,e[6]=i,e[7]=t):t=e[7];let d;e[8]!==t?(d=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(_,{"data-testid":"side-panel",children:t})}),e[8]=t,e[9]=d):d=e[9];let r;e[10]!==o||e[11]!==d?(r=s.jsx(Q,{id:I,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":o,className:"min-w-0 overflow-hidden bg-sidebar",children:d}),e[10]=o,e[11]=d,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(me,{className:"bg-sidebar"}),e[13]=c):c=e[13];let u;return e[14]!==r?(u=s.jsxs(s.Fragment,{children:[r,c]}),e[14]=r,e[15]=u):u=e[15],u}function Ae({children:l,routeId:e}){return l}function V(l){const e=P.c(26),{children:a,actions:i,drawer:n,aside:o}=l,t=H();if(t.isMobile&&t.mobileSurface!=="main")return null;const d=t.isMobile?"plain":"card";let r;e[0]!==i||e[1]!==t.contentActions?(r=s.jsxs(s.Fragment,{children:[t.contentActions,i]}),e[0]=i,e[1]=t.contentActions,e[2]=r):r=e[2];let c;e[3]!==t.contentNavigation||e[4]!==r?(c=s.jsx(we,{navigation:t.contentNavigation,actions:r}),e[3]=t.contentNavigation,e[4]=r,e[5]=c):c=e[5];let u;e[6]!==a||e[7]!==t.contentKey?(u=s.jsx(W,{children:s.jsx(Ae,{routeId:t.contentKey,children:a})}),e[6]=a,e[7]=t.contentKey,e[8]=u):u=e[8];let h;e[9]!==t.contentKey||e[10]!==u?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(q,{children:u},t.contentKey)}),e[9]=t.contentKey,e[10]=u,e[11]=h):h=e[11];let m;e[12]!==n||e[13]!==h?(m=s.jsxs(_.Content,{children:[h,n]}),e[12]=n,e[13]=h,e[14]=m):m=e[14];let p;e[15]!==c||e[16]!==m?(p=s.jsxs(J.Breadcrumbs.Provider,{children:[c,m]}),e[15]=c,e[16]=m,e[17]=p):p=e[17];let y;e[18]!==d||e[19]!==p?(y=s.jsx(_,{"data-testid":"main-panel",variant:d,children:p}),e[18]=d,e[19]=p,e[20]=y):y=e[20];const b=y;let j;return e[21]!==o||e[22]!==t.contentOpen||e[23]!==t.isMobile||e[24]!==b?(j=t.isMobile?b:s.jsx(Q,{id:D,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),o&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(_,{"data-testid":"aside-panel",children:s.jsx(q,{children:s.jsx(W,{children:o})},M.isValidElement(o)?o.key??void 0:void 0)})})]})}),e[21]=o,e[22]=t.contentOpen,e[23]=t.isMobile,e[24]=b,e[25]=j):j=e[25],j}function Re(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(ie,{})}),l[0]=e):e=l[0],e}function Be(l){const e=P.c(18),{error:a,reset:i}=l,n=Y();let o;e[0]!==n?(o=n("common.errorBoundary.somethingWentWrong"),e[0]=n,e[1]=o):o=e[1];let t;e[2]!==o?(t=s.jsx("h2",{className:"text-lg font-medium",children:o}),e[2]=o,e[3]=t):t=e[3];let d;e[4]!==a.message||e[5]!==n?(d=a.message||n("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=n,e[6]=d):d=e[6];let r;e[7]!==d?(r=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=r):r=e[8];let c;e[9]!==n?(c=n("common.errorBoundary.tryAgain"),e[9]=n,e[10]=c):c=e[10];let u;e[11]!==i||e[12]!==c?(u=s.jsx(le,{variant:"outline",onClick:i,children:c}),e[11]=i,e[12]=c,e[13]=u):u=e[13];let h;return e[14]!==t||e[15]!==r||e[16]!==u?(h=s.jsx(V,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[t,r,u]})}),e[14]=t,e[15]=r,e[16]=u,e[17]=h):h=e[17],h}const $e=Object.assign(Ie,{Thread:Me,Content:V}),Xe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:$e,ChatLayoutError:Be,ChatLayoutPending:Re,useChatLayout:Ee,useOptionalChatLayout:X},Symbol.toStringTag,{value:"Module"}));export{$e as C,we as R,Xe as i,Ee as u};
1
+ import{c as P,at as Z,av as ee,b as Y,a2 as te,ab as ne,k as se,j as s,L as ae,n as J,r as M,d as oe,aK as W,H as q,P as _,a_ as ie,B as le}from"./index-C4rtGZhj.js";import{u as re}from"./use-mobile-DR0ou4Mg.js";import{g as ce,u as ue,h as de,v as he}from"./use-app-takeover-rF8JMh38.js";import{a as Q,R as fe,b as me}from"./resizable-DwozeJKF.js";import{h as pe,i as ge,m as xe}from"./use-project-native-view-presence-CIKytFPd.js";import{M as be,k as ye}from"./agent-icon-D4A6sHBt.js";import{s as je}from"./XClose-BIF2YR7O.js";import{I as ve}from"./icon-button-D8YCRkH3.js";import{c as Se,T as Ce,a as Te}from"./tooltip-knB_BmiO.js";import{T as G}from"./toolbar-icon-button-DJJccvHi.js";import{a as Le}from"./use-project-scope-Z7wAK5MJ.js";import{c as Ne}from"./repository-binding-C-QRBZ2o.js";function U(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function Pe(l,e){const a=P.c(8);let i;a[0]!==e?(i=r=>U(r,e),a[0]=e,a[1]=i):i=a[1];const[n,o]=Z(l,i);let t;a[2]!==e||a[3]!==n?(t=U(n,e),a[2]=e,a[3]=n,a[4]=t):t=a[4];let d;return a[5]!==o||a[6]!==t?(d=[t,o],a[5]=o,a[6]=t,a[7]=d):d=a[7],d}const ze=33;function _e(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=ee.sidePanelWidth(),l[0]=e):e=l[0],Pe(e,ze)}function we(l){const e=P.c(60),{actions:a,navigation:i}=l,n=Y(),{org:o}=te(),t=Le(),d=Ne(t),r=ce(),{toggleSidebar:c}=ue(),u=de(),h=X(),m=ne();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={select:Oe},e[0]=p):p=e[0];const y=se(p),b=y?.mainView==="overview";let j;e[1]!==d?.title||e[2]!==n?(j=d?.title??n("common.loading"),e[1]=d?.title,e[2]=n,e[3]=j):j=e[3];const x=j;let S;e[4]!==b||e[5]!==y?.pageTitle||e[6]!==x||e[7]!==t||e[8]!==n?(S=b?t?x:n("sidebar.navDestinations.home"):n(y?.pageTitle??"page.view"),e[4]=b,e[5]=y?.pageTitle,e[6]=x,e[7]=t,e[8]=n,e[9]=S):S=e[9];const v=S;let L;e[10]!==o.slug||e[11]!==m||e[12]!==t?(L=m?{to:"/$org/projects",params:{org:o.slug},search:{project:t??void 0}}:{to:"/$org/projects/$agentId",params:{org:o.slug,agentId:t??""}},e[10]=o.slug,e[11]=m,e[12]=t,e[13]=L):L=e[13];const f=L;let g;if(e[14]!==r||e[15]!==b||e[16]!==o.slug||e[17]!==f||e[18]!==x||e[19]!==t||e[20]!==n||e[21]!==v){if(g=[],r){let T;e[23]!==n?(T=n("sidebar.navDestinations.settings"),e[23]=n,e[24]=T):T=e[24];let E;e[25]!==o.slug?(E={to:"/$org/settings/general",params:{org:o.slug}},e[25]=o.slug,e[26]=E):E=e[26];let $;e[27]!==T||e[28]!==E?($={key:"settings",label:T,link:E},e[27]=T,e[28]=E,e[29]=$):$=e[29],g.push($)}else if(t&&!b){let T;e[30]!==f||e[31]!==x?(T={key:"project",label:x,link:f},e[30]=f,e[31]=x,e[32]=T):T=e[32],g.push(T)}let B;e[33]!==v?(B={key:"page",label:v},e[33]=v,e[34]=B):B=e[34],g.push(B),e[14]=r,e[15]=b,e[16]=o.slug,e[17]=f,e[18]=x,e[19]=t,e[20]=n,e[21]=v,e[22]=g}else g=e[22];let N;e[35]!==f||e[36]!==t||e[37]!==n||e[38]!==u?(N=u&&t&&s.jsx(ve,{label:n("projects.flat.close"),asChild:!0,children:s.jsx(ae,{...f,children:s.jsx(je,{size:16})})}),e[35]=f,e[36]=t,e[37]=n,e[38]=u,e[39]=N):N=e[39];const C=N;let z;e[40]!==h||e[41]!==n||e[42]!==u?(z=u&&h&&!h.threadless&&s.jsxs(Se,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(G,{"aria-label":n(h.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":h.threadOpen,active:h.threadOpen,onClick:h.toggleThread,children:s.jsx(be,{size:16})})}),s.jsx(Te,{side:"bottom",children:n(h.threadOpen?"page.closeThread":"page.openThread")})]}),e[40]=h,e[41]=n,e[42]=u,e[43]=z):z=e[43];const F=z;let w;e[44]!==n?(w=n("layouts.shellControls.toggleSidebar"),e[44]=n,e[45]=w):w=e[45];let A;e[46]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ye,{size:16}),e[46]=A):A=e[46];let O;e[47]!==w||e[48]!==c?(O=s.jsx(G,{className:"md:hidden",onClick:c,"aria-label":w,children:A}),e[47]=w,e[48]=c,e[49]=O):O=e[49];let k;e[50]!==F||e[51]!==O?(k=s.jsxs(s.Fragment,{children:[O,F]}),e[50]=F,e[51]=O,e[52]=k):k=e[52];let R;return e[53]!==a||e[54]!==g||e[55]!==C||e[56]!==i||e[57]!==o.name||e[58]!==k?(R=s.jsx(J.Header,{leading:k,breadcrumbs:g,scope:o.name,actions:a,trailingActions:C,navigation:i}),e[53]=a,e[54]=g,e[55]=C,e[56]=i,e[57]=o.name,e[58]=k,e[59]=R):R=e[59],R}function Oe(l){return l.matches.findLast(ke)?.staticData}function ke(l){return l.staticData.pageTitle}const I="chat-layout-thread",D="chat-layout-content",K=M.createContext(null);function Ee(){return H()}function X(){return M.use(K)}function H(){const l=M.use(K);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=P.c(23),{children:a,...i}=l,n=re(),o=oe(),t=M.useRef(null),[d,r]=_e(),{threadOpen:c,contentOpen:u}=i,h=pe(i),m=c&&u?d:h.side,p=100-m,y=f=>{const g=f.getLayout(),N=g[I],C=g[D];typeof N!="number"||typeof C!="number"||Math.abs(N-m)<.001&&Math.abs(C-p)<.001||f.setLayout({[I]:m,[D]:p})},b=ge({visibility:i,threadVisibilityExplicit:i.threadVisibilityExplicit});let j;e[0]!==n||e[1]!==i||e[2]!==b?(j={...i,isMobile:n,mobileSurface:b},e[0]=n,e[1]=i,e[2]=b,e[3]=j):j=e[3];const x=j;let S;e[4]!==n||e[5]!==i||e[6]!==o||e[7]!==c||e[8]!==x?(S=!i.threadless&&s.jsx(he,{open:n?x.mobileSurface==="chat":c,onToggle:()=>{n?o({to:".",search:f=>({...f,...xe(x.mobileSurface==="chat"?"main":"chat")}),replace:!0}):i.toggleThread()}}),e[4]=n,e[5]=i,e[6]=o,e[7]=c,e[8]=x,e[9]=S):S=e[9];let v;e[10]!==a||e[11]!==u||e[12]!==p||e[13]!==n||e[14]!==r||e[15]!==y||e[16]!==c||e[17]!==m?(v=n?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(fe,{ref:f=>{if(t.current=f,!f)return;let g=!0;return queueMicrotask(()=>{g&&y(f)}),()=>{g=!1,t.current===f&&(t.current=null)}},defaultLayout:{[I]:m,[D]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(f,g)=>{const{isUserInteraction:N}=g;if(!N){const z=t.current;z&&y(z);return}const C=f[I];c&&u&&typeof C=="number"&&C>0&&C<100&&r(C)},children:a}),e[10]=a,e[11]=u,e[12]=p,e[13]=n,e[14]=r,e[15]=y,e[16]=c,e[17]=m,e[18]=v):v=e[18];let L;return e[19]!==S||e[20]!==v||e[21]!==x?(L=s.jsxs(K,{value:x,children:[S,v]}),e[19]=S,e[20]=v,e[21]=x,e[22]=L):L=e[22],L}function Me(l){const e=P.c(16),{children:a,topbar:i}=l,n=H();if(n.isMobile){let h;return e[0]!==a||e[1]!==n.mobileSurface||e[2]!==i?(h=n.mobileSurface==="chat"?s.jsxs(_,{variant:"plain","data-slot":"chat-layout-thread",children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=n.mobileSurface,e[2]=i,e[3]=h):h=e[3],h}const o=n.threadOpen?"":void 0;let t;e[4]!==a||e[5]!==n.threadOpen||e[6]!==i?(t=n.threadOpen&&s.jsxs(s.Fragment,{children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=n.threadOpen,e[6]=i,e[7]=t):t=e[7];let d;e[8]!==t?(d=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(_,{"data-testid":"side-panel",children:t})}),e[8]=t,e[9]=d):d=e[9];let r;e[10]!==o||e[11]!==d?(r=s.jsx(Q,{id:I,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":o,className:"min-w-0 overflow-hidden bg-sidebar",children:d}),e[10]=o,e[11]=d,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(me,{className:"bg-sidebar"}),e[13]=c):c=e[13];let u;return e[14]!==r?(u=s.jsxs(s.Fragment,{children:[r,c]}),e[14]=r,e[15]=u):u=e[15],u}function Ae({children:l,routeId:e}){return l}function V(l){const e=P.c(26),{children:a,actions:i,drawer:n,aside:o}=l,t=H();if(t.isMobile&&t.mobileSurface!=="main")return null;const d=t.isMobile?"plain":"card";let r;e[0]!==i||e[1]!==t.contentActions?(r=s.jsxs(s.Fragment,{children:[t.contentActions,i]}),e[0]=i,e[1]=t.contentActions,e[2]=r):r=e[2];let c;e[3]!==t.contentNavigation||e[4]!==r?(c=s.jsx(we,{navigation:t.contentNavigation,actions:r}),e[3]=t.contentNavigation,e[4]=r,e[5]=c):c=e[5];let u;e[6]!==a||e[7]!==t.contentKey?(u=s.jsx(W,{children:s.jsx(Ae,{routeId:t.contentKey,children:a})}),e[6]=a,e[7]=t.contentKey,e[8]=u):u=e[8];let h;e[9]!==t.contentKey||e[10]!==u?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(q,{children:u},t.contentKey)}),e[9]=t.contentKey,e[10]=u,e[11]=h):h=e[11];let m;e[12]!==n||e[13]!==h?(m=s.jsxs(_.Content,{children:[h,n]}),e[12]=n,e[13]=h,e[14]=m):m=e[14];let p;e[15]!==c||e[16]!==m?(p=s.jsxs(J.Breadcrumbs.Provider,{children:[c,m]}),e[15]=c,e[16]=m,e[17]=p):p=e[17];let y;e[18]!==d||e[19]!==p?(y=s.jsx(_,{"data-testid":"main-panel",variant:d,children:p}),e[18]=d,e[19]=p,e[20]=y):y=e[20];const b=y;let j;return e[21]!==o||e[22]!==t.contentOpen||e[23]!==t.isMobile||e[24]!==b?(j=t.isMobile?b:s.jsx(Q,{id:D,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":t.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),o&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(_,{"data-testid":"aside-panel",children:s.jsx(q,{children:s.jsx(W,{children:o})},M.isValidElement(o)?o.key??void 0:void 0)})})]})}),e[21]=o,e[22]=t.contentOpen,e[23]=t.isMobile,e[24]=b,e[25]=j):j=e[25],j}function Re(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(ie,{})}),l[0]=e):e=l[0],e}function Be(l){const e=P.c(18),{error:a,reset:i}=l,n=Y();let o;e[0]!==n?(o=n("common.errorBoundary.somethingWentWrong"),e[0]=n,e[1]=o):o=e[1];let t;e[2]!==o?(t=s.jsx("h2",{className:"text-lg font-medium",children:o}),e[2]=o,e[3]=t):t=e[3];let d;e[4]!==a.message||e[5]!==n?(d=a.message||n("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=n,e[6]=d):d=e[6];let r;e[7]!==d?(r=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=r):r=e[8];let c;e[9]!==n?(c=n("common.errorBoundary.tryAgain"),e[9]=n,e[10]=c):c=e[10];let u;e[11]!==i||e[12]!==c?(u=s.jsx(le,{variant:"outline",onClick:i,children:c}),e[11]=i,e[12]=c,e[13]=u):u=e[13];let h;return e[14]!==t||e[15]!==r||e[16]!==u?(h=s.jsx(V,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[t,r,u]})}),e[14]=t,e[15]=r,e[16]=u,e[17]=h):h=e[17],h}const $e=Object.assign(Ie,{Thread:Me,Content:V}),Xe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:$e,ChatLayoutError:Be,ChatLayoutPending:Re,useChatLayout:Ee,useOptionalChatLayout:X},Symbol.toStringTag,{value:"Module"}));export{$e as C,we as R,Xe as i,Ee as u};
@@ -1 +1 @@
1
- import{n as $,x as D,_ as We,T as H,$ as je,a0 as A,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,e as ve}from"./usage-stats-2c6yVTyC.js";import{eO as ye,fr as Ce,eN as Se,fs as Re,ft as Ee,fu as Te,fv as Oe,fw as Ie,eQ as Ae,d_ as Me,r as C,b4 as ze}from"./index-BlWeDA0T.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=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 Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(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 Ze(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(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.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 G.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(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.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:Ge(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 Gt(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 Jt(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 Zt(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),Zt(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)&&Jt(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(Gt(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{n as $,x as D,_ as We,T as H,$ as je,a0 as A,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,e as ve}from"./usage-stats-D0e4-Doz.js";import{eO as ye,fr as Ce,eN as Se,fs as Re,ft as Ee,fu as Te,fv as Oe,fw as Ie,eQ as Ae,d_ as Me,r as C,b4 as ze}from"./index-C4rtGZhj.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=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 Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(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 Ze(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(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.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 G.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(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.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:Ge(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 Gt(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 Jt(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 Zt(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),Zt(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)&&Jt(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(Gt(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,2 +1,2 @@
1
- import{a2 as X,o as Be,r as k,j as n,K as W,b8 as ie,c as F,aL as Oe,l as H,H as Ae,b as Z,t as ce,h as ue,s as be,v as ye,q as ve,D as Se,d as je,y as de,aM as Ie,B as Ee}from"./index-BlWeDA0T.js";import{u as we,d as $e,b as Ne,f as Fe,T as He,A as ze,i as Ke,c as qe,j as Ge,k as Ue,p as Qe,L as Ve}from"./chat-context-CKK4nwlA.js";import{b as Ye}from"./sandbox-url-D3mC8qhT.js";import{a as Je}from"./repository-binding-Ds0zXEVH.js";import{e as We}from"./backoff-CrEUbyZT.js";import{n as Xe}from"./ArrowUp-BM60-fZY.js";import{s as Ze,g as Ce,d as et}from"./tool-namespace-Cu-DNTic.js";import{b as se,T as tt,a as st,c as nt}from"./tooltip-B6W7NpVz.js";import{d as rt,b as at,a as ot,D as lt}from"./drawer-C7TJoqXz.js";import{C as it}from"./collection-search-mDMHjO22.js";import{u as ct}from"./use-mobile-hkvDmO1w.js";import{u as ut}from"./use-mcp-client-B333X4fs.js";import{u as dt,g as ft}from"./use-mcp-prompts-P2KMjN9W.js";import{c as mt,P as pt}from"./usage-stats-2c6yVTyC.js";import{T as ht,d as gt,c as xt,e as bt,H as yt}from"./input-3uLsKqBB.js";import{u as vt,a as St,S as jt,M as fe}from"./pair-Boroas12.js";import{a as Et}from"./use-panel-navigate-C2cHRlDL.js";import{u as wt}from"./thread-intent-9GHukD-s.js";import{N as Nt}from"./index-sLNiMwXT.js";import{i as Ct}from"./LinkBroken01-D4fcNp0y.js";import{e as Te}from"./agent-icon-Cwi3uRdu.js";import{e as Tt}from"./use-decopilot-events-Bd-4vex6.js";import{u as kt}from"./use-deco-credits-CT_j_qxS.js";import{F as Pt}from"./feature-paywall-DXx7v-jJ.js";import{i as Dt}from"./AlertCircle-BugQG9bV.js";function me(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const Rt={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ke=k.createContext(Rt),pe=16384;class _t{data="";append(e){this.data+=e,this.data.length>pe&&(this.data=this.data.slice(this.data.length-pe))}get(){return this.data}clear(){this.data=""}}const Lt=1e3,Mt=3e4,Bt=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],ge="log";function Ot(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function At(t){return t===404}async function It(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Bt)});return await e.body?.cancel().catch(()=>{}),At(e.status)}catch{return!1}}function Ds({virtualMcpId:t,branch:e,previewUrl:r=null,enabled:o=!0,children:s}){const{org:a}=X(),l=Be(),i=we()?.taskId??null,[c,u]=k.useState(null),[d,f]=k.useState({phase:"idle"}),[m,S]=k.useState({state:"running"}),[j,E]=k.useState({kind:"unknown"}),[x,b]=k.useState(!1),[C,y]=k.useState([]),[P,g]=k.useState([]),[,D]=k.useState(0),T=k.useRef(new Map),B=k.useRef(new Set),M=k.useRef(new Set),L=k.useRef(null),_=Ot(r),p=Je(t)?.metadata?.runtime?.selected==="deno",w=v=>{let N=T.current.get(v);return N||(N=new _t,T.current.set(v,N)),N};k.useEffect(()=>{if(u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),L.current=null,b(!1),y([]),g([]),T.current.clear(),!t||!e||!o)return;const v=Ye({orgSlug:a.slug,virtualMcpId:t,branch:e,threadId:i??null},"events");let N=!1,$=0,Y=null,q=null,G=null,K=null,z=null,J=null;const Le=R=>{try{const O=JSON.parse(R.data);u(O),O.kind!=="failed"&&(b(!1),$=0),O.kind==="ready"&&oe()}catch(O){console.warn("[vm-events] bad phase payload",O)}},ne=()=>{b(!0),u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),y([]),g([]),T.current.clear()},re=R=>{try{const O=JSON.parse(R.data);if(typeof O.data!="string")return;$=0;const I=O.data.replace(/\r?\n/g,`\r
1
+ import{a2 as X,o as Be,r as k,j as n,K as W,b8 as ie,c as F,aL as Oe,l as H,H as Ae,b as Z,t as ce,h as ue,s as be,v as ye,q as ve,D as Se,d as je,y as de,aM as Ie,B as Ee}from"./index-C4rtGZhj.js";import{u as we,d as $e,b as Ne,f as Fe,T as He,A as ze,i as Ke,c as qe,j as Ge,k as Ue,p as Qe,L as Ve}from"./chat-context-CkzpVzP2.js";import{b as Ye}from"./sandbox-url-D3mC8qhT.js";import{a as Je}from"./repository-binding-C-QRBZ2o.js";import{e as We}from"./backoff-CrEUbyZT.js";import{n as Xe}from"./ArrowUp-1Pn6KcFo.js";import{s as Ze,g as Ce,d as et}from"./tool-namespace-JguyqV9V.js";import{b as se,T as tt,a as st,c as nt}from"./tooltip-knB_BmiO.js";import{d as rt,b as at,a as ot,D as lt}from"./drawer-0WwoG1lv.js";import{C as it}from"./collection-search-Bett-OVD.js";import{u as ct}from"./use-mobile-DR0ou4Mg.js";import{u as ut}from"./use-mcp-client-iEvULqcR.js";import{u as dt,g as ft}from"./use-mcp-prompts-aNIE_qf0.js";import{c as mt,P as pt}from"./usage-stats-D0e4-Doz.js";import{T as ht,d as gt,c as xt,e as bt,H as yt}from"./input-BXtqV7BY.js";import{u as vt,a as St,S as jt,M as fe}from"./pair-xLeCyNWu.js";import{a as Et}from"./use-panel-navigate-CTGXxycL.js";import{u as wt}from"./thread-intent-DWGyzG2H.js";import{N as Nt}from"./index-BQmgF11e.js";import{i as Ct}from"./LinkBroken01-DQvdTTgG.js";import{e as Te}from"./agent-icon-D4A6sHBt.js";import{e as Tt}from"./use-decopilot-events--SDGmxUY.js";import{u as kt}from"./use-deco-credits-yhiLjBMs.js";import{F as Pt}from"./feature-paywall-Bl1dj-EJ.js";import{i as Dt}from"./AlertCircle-ezsenyDA.js";function me(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const Rt={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ke=k.createContext(Rt),pe=16384;class _t{data="";append(e){this.data+=e,this.data.length>pe&&(this.data=this.data.slice(this.data.length-pe))}get(){return this.data}clear(){this.data=""}}const Lt=1e3,Mt=3e4,Bt=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],ge="log";function Ot(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function At(t){return t===404}async function It(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Bt)});return await e.body?.cancel().catch(()=>{}),At(e.status)}catch{return!1}}function Ds({virtualMcpId:t,branch:e,previewUrl:r=null,enabled:o=!0,children:s}){const{org:a}=X(),l=Be(),i=we()?.taskId??null,[c,u]=k.useState(null),[d,f]=k.useState({phase:"idle"}),[m,S]=k.useState({state:"running"}),[j,E]=k.useState({kind:"unknown"}),[x,b]=k.useState(!1),[C,y]=k.useState([]),[P,g]=k.useState([]),[,D]=k.useState(0),T=k.useRef(new Map),B=k.useRef(new Set),M=k.useRef(new Set),L=k.useRef(null),_=Ot(r),p=Je(t)?.metadata?.runtime?.selected==="deno",w=v=>{let N=T.current.get(v);return N||(N=new _t,T.current.set(v,N)),N};k.useEffect(()=>{if(u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),L.current=null,b(!1),y([]),g([]),T.current.clear(),!t||!e||!o)return;const v=Ye({orgSlug:a.slug,virtualMcpId:t,branch:e,threadId:i??null},"events");let N=!1,$=0,Y=null,q=null,G=null,K=null,z=null,J=null;const Le=R=>{try{const O=JSON.parse(R.data);u(O),O.kind!=="failed"&&(b(!1),$=0),O.kind==="ready"&&oe()}catch(O){console.warn("[vm-events] bad phase payload",O)}},ne=()=>{b(!0),u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),y([]),g([]),T.current.clear()},re=R=>{try{const O=JSON.parse(R.data);if(typeof O.data!="string")return;$=0;const I=O.data.replace(/\r?\n/g,`\r
2
2
  `);w(O.source).append(I);for(const A of B.current)try{A(O.source,I)}catch{}D(A=>A+1)}catch{}},ae=R=>{const O=R.type;try{const I=JSON.parse(R.data);switch($=0,O){case"lifecycle":{const A=I;f(A.state);const U=`${a.slug}/${t}/${e}`;if(me(A.state.phase)&&!(J&&me(J))){ie(l,a.id);const V=W.decofile(U);l.getQueryData(V)===void 0&&l.invalidateQueries({queryKey:V})}A.state.phase==="running"&&J!=="running"&&(ie(l,a.id),l.invalidateQueries({queryKey:W.decofile(U)}),l.invalidateQueries({queryKey:W.liveMeta(a.slug,t,e)})),J=A.state.phase;const Q=A.state.phase==="running"?A.state.port:null,te=L.current;if(L.current=Q,te!==null&&Q!==null&&te!==Q)for(const V of M.current)try{V()}catch{}return}case"status":S(I);return;case"tasks":{const U=I.active.map(Q=>Q.logName??"").filter(Boolean);g(U);return}case"scripts":y(I.scripts);return;case"branch":{const A=I.meta;E(A);return}case"reload":for(const A of M.current)try{A()}catch{}return;case"file-changed":{const{path:A}=I,U=`${a.slug}/${t}/${e}`;if(A.startsWith(".deco/")||A.includes("/.deco/")){if(!(J==="running"))return;G&&clearTimeout(G),G=setTimeout(()=>{if(G=null,l.invalidateQueries({queryKey:W.decofile(U)}),p)for(const V of M.current)try{V()}catch{}},500)}else q&&clearTimeout(q),q=setTimeout(()=>{q=null,l.invalidateQueries({queryKey:W.liveMeta(a.slug,t,e)})},1e3);return}}}catch{}};function ee(){if(N)return;const R=new EventSource(v);K=R,R.onopen=()=>{},R.onerror=()=>{K===R&&R.readyState===EventSource.CLOSED&&le("studio")},R.addEventListener("phase",Le),R.addEventListener("gone",ne),R.addEventListener(ge,re);for(const O of he)R.addEventListener(O,ae)}function oe(){if(N||!_||z)return;const R=new EventSource(_);z=R;let O=!1;R.onopen=()=>{if(N||z!==R)return;O=!0,$=0;const I=K;K=null,I?.close()},R.onerror=()=>{z===R&&R.readyState===EventSource.CLOSED&&Me(R,O)},R.addEventListener(ge,re);for(const I of he)R.addEventListener(I,ae)}async function Me(R,O){const I=_?await It(_):!1;if(!(N||z!==R)){if(R.close(),z=null,I){ne(),K||ee();return}O&&le("direct")}}function le(R){if(N||Y)return;const O=We(Mt,Lt,$,2,0);$++,Y=setTimeout(()=>{if(Y=null,!N){if(R==="direct"){z?.close(),z=null,oe();return}K?.close(),K=null,ee()}},O)}return ee(),()=>{N=!0,K?.close(),z?.close(),Y&&clearTimeout(Y),q&&clearTimeout(q),G&&clearTimeout(G)}},[t,e,a.slug,a.id,o,i,_,l,p]);const h={phase:c,lifecycle:d,status:m,branch:j,notFound:x,scripts:C,activeProcesses:P,getBuffer:v=>T.current.get(v)?.get()??"",hasData:v=>(T.current.get(v)?.get().length??0)>0,subscribeChunks:v=>(B.current.add(v),()=>{B.current.delete(v)}),subscribeReload:v=>(M.current.add(v),()=>{M.current.delete(v)})};return n.jsx(ke,{value:h,children:s})}function Pe(){return k.use(ke)}function Rs(t){const{subscribeChunks:e}=Pe(),r=k.useRef(t);r.current=t,k.useEffect(()=>e((a,l)=>{r.current?.(a,l)}),[e])}function _s(t){const{subscribeReload:e}=Pe(),r=k.useRef(t);r.current=t,k.useEffect(()=>e(()=>{r.current?.()}),[e])}const xe=3,De="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",$t="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function Re(t){const e=F.c(46),{item:r,onSelect:o,isLoading:s,isDisabled:a,variant:l}=t,i=l===void 0?"pill":l,{prompt:c}=r;let u;if(e[0]!==c._meta||e[1]!==c.name||e[2]!==c.title){const T=Ce(c._meta);u=c.title??et(c.name,T),e[0]=c._meta,e[1]=c.name,e[2]=c.title,e[3]=u}else u=e[3];const d=u,f=c.description||null;if(i==="card"){let T;e[4]!==o||e[5]!==c?(T=()=>o(c),e[4]=o,e[5]=c,e[6]=T):T=e[6];const B=a||s,M=s&&"bg-accent/40",L=(a||s)&&"cursor-not-allowed opacity-50";let _;e[7]!==M||e[8]!==L?(_=H($t,"hover:bg-accent/60 text-foreground",M,L),e[7]=M,e[8]=L,e[9]=_):_=e[9];let p;e[10]!==d?(p=n.jsx("span",{className:"font-medium truncate capitalize",children:d}),e[10]=d,e[11]=p):p=e[11];let w;e[12]!==s?(w=s&&n.jsx(ue,{size:"xs"}),e[12]=s,e[13]=w):w=e[13];let h;e[14]!==p||e[15]!==w?(h=n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p,w]}),e[14]=p,e[15]=w,e[16]=h):h=e[16];let v;e[17]!==f?(v=f&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=v):v=e[18];let N;return e[19]!==h||e[20]!==v||e[21]!==T||e[22]!==B||e[23]!==_?(N=n.jsxs("button",{type:"button",onClick:T,disabled:B,className:_,children:[h,v]}),e[19]=h,e[20]=v,e[21]=T,e[22]=B,e[23]=_,e[24]=N):N=e[24],N}let m;e[25]!==o||e[26]!==c?(m=()=>o(c),e[25]=o,e[26]=c,e[27]=m):m=e[27];const S=a||s,j=s&&"bg-muted/50",E=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==j||e[29]!==E?(x=H(De,"hover:bg-muted/70 hover:text-foreground",j,E),e[28]=j,e[29]=E,e[30]=x):x=e[30];let b;e[31]!==d?(b=n.jsx("span",{className:"capitalize",children:d}),e[31]=d,e[32]=b):b=e[32];let C;e[33]!==s?(C=s&&n.jsx(ue,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let y;e[35]!==m||e[36]!==S||e[37]!==x||e[38]!==b||e[39]!==C?(y=n.jsx(tt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:m,disabled:S,className:x,children:[b,C]})}),e[35]=m,e[36]=S,e[37]=x,e[38]=b,e[39]=C,e[40]=y):y=e[40];const P=f??d;let g;e[41]!==P?(g=n.jsx(st,{side:"top",className:"max-w-xs",children:n.jsx("p",{className:"text-xs",children:P})}),e[41]=P,e[42]=g):g=e[42];let D;return e[43]!==y||e[44]!==g?(D=n.jsxs(nt,{delayDuration:400,children:[y,g]}),e[43]=y,e[44]=g,e[45]=D):D=e[45],D}function Ft(t){const e=F.c(61),{items:r,open:o,onOpenChange:s,onSelect:a,loadingPrompt:l}=t,i=Z(),[c,u]=k.useState(""),d=!!l;let f;e[0]!==r||e[1]!==c?(f=c.trim()?r.filter(p=>{const w=c.toLowerCase();return p.prompt.name.toLowerCase().includes(w)||(p.prompt.title??"").toLowerCase().includes(w)||(p.prompt.description??"").toLowerCase().includes(w)}):r,e[0]=r,e[1]=c,e[2]=f):f=e[2];const m=f,S=ct();let j;e[3]!==m.length||e[4]!==c||e[5]!==i?(j=m.length===0&&n.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:i("chat.iceBreakers.noPromptsMatch",{search:c})}),e[3]=m.length,e[4]=c,e[5]=i,e[6]=j):j=e[6];let E;if(e[7]!==m||e[8]!==d||e[9]!==l?.name||e[10]!==s||e[11]!==a){let p;e[13]!==d||e[14]!==l?.name||e[15]!==s||e[16]!==a?(p=w=>n.jsx(Re,{item:w,variant:"card",onSelect:h=>{s(!1),a(h)},isLoading:l?.name===w.prompt.name,isDisabled:d&&l?.name!==w.prompt.name},w.prompt.name),e[13]=d,e[14]=l?.name,e[15]=s,e[16]=a,e[17]=p):p=e[17],E=m.map(p),e[7]=m,e[8]=d,e[9]=l?.name,e[10]=s,e[11]=a,e[12]=E}else E=e[12];let x;e[18]!==j||e[19]!==E?(x=n.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[j,E]})}),e[18]=j,e[19]=E,e[20]=x):x=e[20];const b=x;let C;e[21]!==i?(C=i("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=i,e[22]=C):C=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=p=>{p.key==="Escape"&&u("")},e[23]=y):y=e[23];let P;e[24]!==c||e[25]!==C?(P=n.jsx(it,{value:c,onChange:u,placeholder:C,onKeyDown:y}),e[24]=c,e[25]=C,e[26]=P):P=e[26];const g=P;if(S){let p;e[27]!==i?(p=i("chat.iceBreakers.allPromptsTitle"),e[27]=i,e[28]=p):p=e[28];let w;e[29]!==p?(w=n.jsx(rt,{className:"sr-only",children:n.jsx(at,{children:p})}),e[29]=p,e[30]=w):w=e[30];let h;e[31]!==i?(h=i("chat.iceBreakers.promptsLabel"),e[31]=i,e[32]=h):h=e[32];let v;e[33]!==h?(v=n.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:n.jsx("span",{className:"text-sm font-medium text-foreground",children:h})}),e[33]=h,e[34]=v):v=e[34];let N;e[35]!==b||e[36]!==g||e[37]!==v||e[38]!==w?(N=n.jsxs(ot,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[w,v,g,b]}),e[35]=b,e[36]=g,e[37]=v,e[38]=w,e[39]=N):N=e[39];let $;return e[40]!==s||e[41]!==o||e[42]!==N?($=n.jsx(se,{delayDuration:400,children:n.jsx(lt,{open:o,onOpenChange:s,children:N})}),e[40]=s,e[41]=o,e[42]=N,e[43]=$):$=e[43],$}let D;e[44]!==i?(D=i("chat.iceBreakers.allPromptsTitle"),e[44]=i,e[45]=D):D=e[45];let T;e[46]!==D?(T=n.jsx(be,{className:"sr-only",children:n.jsx(ye,{children:D})}),e[46]=D,e[47]=T):T=e[47];let B;e[48]!==i?(B=i("chat.iceBreakers.promptsLabel"),e[48]=i,e[49]=B):B=e[49];let M;e[50]!==B?(M=n.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:n.jsx("span",{className:"text-sm font-medium text-foreground",children:B})}),e[50]=B,e[51]=M):M=e[51];let L;e[52]!==b||e[53]!==g||e[54]!==M||e[55]!==T?(L=n.jsxs(ve,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[T,M,g,b]}),e[52]=b,e[53]=g,e[54]=M,e[55]=T,e[56]=L):L=e[56];let _;return e[57]!==s||e[58]!==o||e[59]!==L?(_=n.jsx(se,{delayDuration:400,children:n.jsx(Se,{open:o,onOpenChange:s,children:L})}),e[57]=s,e[58]=o,e[59]=L,e[60]=_):_=e[60],_}function Ht(t){const e=F.c(30),{items:r,onSelect:o,loadingPrompt:s,className:a}=t,l=Z(),[i,c]=k.useState(!1);if(r.length===0)return null;let u,d,f,m,S;if(e[0]!==a||e[1]!==r||e[2]!==s||e[3]!==o||e[4]!==l){const b=r.slice(0,xe),C=r.slice(xe),y=!!s;let P;e[10]!==y||e[11]!==s?.name||e[12]!==o?(P=D=>n.jsx(Re,{item:D,onSelect:o,isLoading:s?.name===D.prompt.name,isDisabled:y&&s?.name!==D.prompt.name},D.prompt.name),e[10]=y,e[11]=s?.name,e[12]=o,e[13]=P):P=e[13];const g=b.map(P);u=se,S=400,e[14]!==a?(d=H("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=d):d=e[15],f=g,m=C.length>0&&n.jsx("button",{type:"button",disabled:y,onClick:()=>c(!0),className:H(De,"hover:bg-muted/70 hover:text-foreground",y&&"opacity-50 cursor-not-allowed"),children:l("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=a,e[1]=r,e[2]=s,e[3]=o,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=m,e[9]=S}else u=e[5],d=e[6],f=e[7],m=e[8],S=e[9];let j;e[16]!==d||e[17]!==f||e[18]!==m?(j=n.jsxs("div",{className:d,children:[f,m]}),e[16]=d,e[17]=f,e[18]=m,e[19]=j):j=e[19];let E;e[20]!==r||e[21]!==s||e[22]!==i||e[23]!==o?(E=n.jsx(Ft,{items:r,open:i,onOpenChange:c,onSelect:o,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=i,e[23]=o,e[24]=E):E=e[24];let x;return e[25]!==u||e[26]!==S||e[27]!==j||e[28]!==E?(x=n.jsxs(u,{delayDuration:S,children:[j,E]}),e[25]=u,e[26]=S,e[27]=j,e[28]=E,e[29]=x):x=e[29],x}function zt(){return null}function Kt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function qt(t){const e=F.c(31),{connectionId:r}=t,o=Z(),{sendMessage:s}=Ne(),{org:a}=X();let l;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const i=ut(l);let c;e[4]!==i?(c={client:i,staleTime:6e4},e[4]=i,e[5]=c):c=e[5];const{data:u}=dt(c);let d;e[6]!==u?.prompts?(d=u?.prompts??[],e[6]=u?.prompts,e[7]=d):d=e[7];const f=d;let m;e[8]!==f?(m=f.map(Gt),e[8]=f,e[9]=m):m=e[9];const S=m;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j={stage:"idle"},e[10]=j):j=e[10];const[E,x]=k.useReducer(Kt,j),[b,C]=k.useState(null);let y;e[11]!==i||e[12]!==s||e[13]!==o?(y=async(h,v)=>{if(!i){ce.error(o("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const N=await ft(i,h.name,v);x({type:"RESET"});const $={type:"doc",content:[{type:"paragraph",content:[mt({id:h.name,name:Ze(h.name,Ce(h._meta)),metadata:N.messages,char:"/",kind:"prompt",args:v}),{type:"text",text:" "}]}]};await s($)}catch(N){console.error("[ice-breakers] Failed to fetch prompt:",N),ce.error(o("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=i,e[12]=s,e[13]=o,e[14]=y):y=e[14];const P=y;let g;e[15]!==P?(g=async h=>{if(h.arguments&&h.arguments.length>0){x({type:"SELECT_PROMPT",prompt:h}),C(h);return}x({type:"START_LOADING",prompt:h}),await P(h)},e[15]=P,e[16]=g):g=e[16];const D=g;let T;e[17]!==b||e[18]!==P?(T=async h=>{b&&(x({type:"START_LOADING",prompt:b,arguments:h}),C(null),await P(b,h))},e[17]=b,e[18]=P,e[19]=T):T=e[19];const B=T;if(S.length===0)return null;const M=E.stage==="loading"?E.prompt:null;let L;e[20]!==D||e[21]!==S||e[22]!==M?(L=n.jsx(Ht,{items:S,onSelect:D,loadingPrompt:M}),e[20]=D,e[21]=S,e[22]=M,e[23]=L):L=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{C(null),x({type:"RESET"})},e[24]=_):_=e[24];let p;e[25]!==b||e[26]!==B?(p=n.jsx(pt,{prompt:b,setPrompt:_,onSubmit:B}),e[25]=b,e[26]=B,e[27]=p):p=e[27];let w;return e[28]!==L||e[29]!==p?(w=n.jsxs(n.Fragment,{children:[L,p]}),e[28]=L,e[29]=p,e[30]=w):w=e[30],w}function Gt(t){return{prompt:t}}function Ut(t){const e=F.c(13),{className:r}=t,{selectedVirtualMcp:o}=$e(),{org:s}=X();let a;e[0]!==s.id?(a=Oe(s.id),e[0]=s.id,e[1]=a):a=e[1];const l=a.id,i=o?.id??l;let c;e[2]!==r?(c=H("w-full @container",r),e[2]=r,e[3]=c):c=e[3];const u=i??"default";let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(zt,{}),e[4]=d):d=e[4];let f;e[5]!==i?(f=n.jsx(qt,{connectionId:i}),e[5]=i,e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==f?(m=n.jsx(Ae,{fallback:null,children:n.jsx(k.Suspense,{fallback:d,children:f},u)}),e[7]=u,e[8]=f,e[9]=m):m=e[9];let S;return e[10]!==c||e[11]!==m?(S=n.jsx("div",{className:c,children:m}),e[10]=c,e[11]=m,e[12]=S):S=e[12],S}function Qt(t){let e=0;for(const r of t)for(const o of r.parts??[]){const s=o;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function Vt(){const t=F.c(8),{openPanel:e}=Et(),r=wt(),o=Fe()?.messages??[],s=we()?.taskId??null;let a;t[0]!==o?(a=Qt(o),t[0]=o,t[1]=a):a=t[1];const l=a,i=k.useRef(null),c=k.useRef(null);let u,d;t[2]!==l||t[3]!==r||t[4]!==e||t[5]!==s?(u=()=>{if(!l||!s)return;const f=`${s}:${l}`;c.current!==f&&(c.current=f,r?.refreshThreadMetadata(s)),i.current!==s&&(i.current=s,e("site-editor"))},d=[l,s,e,r],t[2]=l,t[3]=r,t[4]=e,t[5]=s,t[6]=u,t[7]=d):(u=t[6],d=t[7]),k.useEffect(u,d)}function _e(t){return`deco-credits-empty-dismissed:${t}`}function Ls(t){try{return localStorage.getItem(_e(t))==="1"}catch{return!1}}function Yt(){const t=F.c(56),e=Z(),{org:r}=X(),o=Tt("credits"),s=je(),{decoKeyId:a}=kt(),[l,i]=k.useState(!0);let c;t[0]!==r.id?(c=()=>{de("credits_empty_state_dismissed",{organization_id:r.id}),i(!1);try{localStorage.setItem(_e(r.id),"1")}catch{}},t[0]=r.id,t[1]=c):c=t[1];const u=c;let d,f;if(t[2]!==l||t[3]!==r.id?(d=()=>{l&&de("credits_empty_state_shown",{organization_id:r.id})},f=[l,r.id],t[2]=l,t[3]=r.id,t[4]=d,t[5]=f):(d=t[4],f=t[5]),k.useEffect(d,f),!l)return null;if(!o){let h;t[6]!==e?(h=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=h):h=t[7];let v;t[8]!==h?(v={title:h},t[8]=h,t[9]=v):v=t[9];let N;return t[10]!==u||t[11]!==v?(N=n.jsx(Pt,{feature:"chat",copy:v,onDismiss:u}),t[10]=u,t[11]=v,t[12]=N):N=t[12],N}let m;t[13]!==u?(m=h=>!h&&u(),t[13]=u,t[14]=m):m=t[14];let S;t[15]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=S):S=t[15];let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:n.jsx(Te,{size:20,className:"text-warning"})}),t[16]=j):j=t[16];let E;t[17]!==e?(E=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=E):E=t[18];let x;t[19]!==E?(x=n.jsx(ye,{className:"text-lg font-semibold",children:E}),t[19]=E,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let C;t[23]!==b?(C=n.jsx(Ie,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=C):C=t[24];let y;t[25]!==x||t[26]!==C?(y=n.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[S,n.jsxs(be,{className:"relative gap-3",children:[j,n.jsxs("div",{className:"text-center",children:[x,C]})]})]}),t[25]=x,t[26]=C,t[27]=y):y=t[27];let P;t[28]!==a||t[29]!==u?(P=a&&n.jsx("div",{className:"px-6 pb-5",children:n.jsx(ht,{source:"empty_state",onDone:u})}),t[28]=a,t[29]=u,t[30]=P):P=t[30];let g;t[31]!==u||t[32]!==s||t[33]!==r.slug?(g=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),u()},t[31]=u,t[32]=s,t[33]=r.slug,t[34]=g):g=t[34];let D;t[35]!==e?(D=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=D):D=t[36];let T;t[37]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(Ct,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=T):T=t[37];let B;t[38]!==g||t[39]!==D?(B=n.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:g,children:[D,T]}),t[38]=g,t[39]=D,t[40]=B):B=t[40];let M;t[41]!==e?(M=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=M):M=t[42];let L;t[43]!==u||t[44]!==M?(L=n.jsx(Ee,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:u,children:M}),t[43]=u,t[44]=M,t[45]=L):L=t[45];let _;t[46]!==B||t[47]!==L?(_=n.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[B,L]}),t[46]=B,t[47]=L,t[48]=_):_=t[48];let p;t[49]!==y||t[50]!==P||t[51]!==_?(p=n.jsxs(ve,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Jt,children:[y,P,_]}),t[49]=y,t[50]=P,t[51]=_,t[52]=p):p=t[52];let w;return t[53]!==p||t[54]!==m?(w=n.jsx(Se,{open:!0,onOpenChange:m,children:p}),t[53]=p,t[54]=m,t[55]=w):w=t[55],w}function Jt(t){return t.preventDefault()}function Wt(t){const e=F.c(6),{balanceDollars:r}=t;let o;e[0]!==r?(o=r.toFixed(2),e[0]=r,e[1]=o):o=e[1];const s=o;let a,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=H("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),l=n.jsx(Te,{size:13,className:"text-success"}),e[2]=a,e[3]=l):(a=e[2],l=e[3]);let i;return e[4]!==s?(i=n.jsxs("div",{className:a,children:[l,n.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=i):i=e[5],i}function Xt(){const t=F.c(8),{org:e}=X(),r=je();let o;t[0]!==r||t[1]!==e.slug?(o=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=o):o=t[2];let s,a,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=H("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=n.jsx(Dt,{size:13,className:"text-warning"}),l=n.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=l):(s=t[3],a=t[4],l=t[5]);let i;return t[6]!==o?(i=n.jsxs("button",{type:"button",onClick:o,className:s,children:[a,l]}),t[6]=o,t[7]=i):i=t[7],i}function Zt(t){const e=F.c(7),{scrollRef:r,sentinelRef:o,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:l}=t;let i,c;e[0]!==l||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==o?(i=()=>{const u=o.current,d=r.current;if(!u||!d||!s)return;const f=new IntersectionObserver(async m=>{if(!m[0]?.isIntersecting||a||!s)return;const j=d.scrollHeight,E=d.scrollTop;await l(),requestAnimationFrame(()=>{const x=d.scrollHeight;d.scrollTop=E+(x-j)})},{root:d,rootMargin:"200px 0px 0px 0px"});return f.observe(u),()=>f.disconnect()},c=[r,o,s,a,l],e[0]=l,e[1]=s,e[2]=a,e[3]=r,e[4]=o,e[5]=i,e[6]=c):(i=e[5],c=e[6]),k.useEffect(i,c)}function es(t){const e=F.c(5),{className:r,children:o}=t;let s;e[0]!==r?(s=H("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",r),e[0]=r,e[1]=s):s=e[1];let a;return e[2]!==o||e[3]!==s?(a=n.jsx("div",{className:s,children:o}),e[2]=o,e[3]=s,e[4]=a):a=e[4],a}function ts(t){const e=F.c(5),{children:r,className:o}=t;let s;e[0]!==o?(s=H("flex-1 min-h-0 overflow-y-auto isolate",o),e[0]=o,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=n.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}function ss(t){const e=F.c(2),{children:r}=t;let o;return e[0]!==r?(o=n.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:r}),e[0]=r,e[1]=o):o=e[1],o}function ns(){const t=Z(),{messages:e,status:r,hasMoreOlder:o,isFetchingOlder:s,fetchOlderMessages:a,isRunInProgress:l}=Ne(),{taskId:i}=qe();Vt();const c=Ge(i??""),u=Ue(c),d=u.size===0?e:e.filter(g=>!u.has(g.id)),f=Qe(d,r==="submitted"||r==="streaming"||l),m=f.visible,S=vt(m),j=S.at(-1),x=bt()*yt+16,b=k.useRef(null),C=k.useRef(null);Zt({scrollRef:b,sentinelRef:C,hasMoreOlder:o,isFetchingOlder:s,fetchOlderMessages:a});const y=St({initial:!1}),P=g=>{b.current=g,y.scrollRef(g)};return n.jsx(Ve.Provider,{value:f,children:n.jsx(jt,{messages:e,children:n.jsxs("div",{className:"relative h-full w-full min-w-0",children:[n.jsx("div",{ref:P,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:x},children:n.jsxs("div",{ref:y.contentRef,className:"overflow-x-clip",children:[n.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[n.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&n.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),S.slice(0,-1).map((g,D)=>n.jsx(fe,{pair:g,isLastPair:!1,status:D===S.length-1?r:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),j&&n.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:n.jsx(fe,{pair:j,isLastPair:!0,status:r},`pair-${j.user?.id??j.assistant?.id}`)})]})}),!y.isAtBottom&&n.jsx(Ee,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:x+8},onClick:()=>{y.scrollToBottom()},children:n.jsx(Xe,{size:14})})]})})})}function rs(t){const e=F.c(5),{children:r,className:o}=t;let s;e[0]!==o?(s=H("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",o),e[0]=o,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=n.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}const Ms=Object.assign(es,{Main:ts,Messages:ns,EmptyState:ss,Footer:rs,Input:xt,Provider:Ke,ActiveTaskProvider:ze,ThreadlessProvider:He,IceBreakers:Ut,NoAiProviderEmptyState:Nt,CreditsEmptyState:Yt,CreditsEyebrow:Wt,NoCreditsEyebrow:Xt,CreditsExhaustedBanner:gt});export{Ms as C,Ds as S,Rs as a,_s as b,me as i,Pe as u,Ls as w};
@@ -1 +1 @@
1
- import{c as f,f as p,ax as u,j as s,a_ as x,N as a}from"./index-BlWeDA0T.js";import{C as j}from"./capability-load-error-D8PnCnVx.js";function d(){const t=f.c(19);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:c}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("monitoring:view")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("members:manage")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}let n;return t[17]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[17]=r,t[18]=n):n=t[18],n}export{d as default};
1
+ import{c as f,f as p,ax as u,j as s,a_ as x,N as a}from"./index-C4rtGZhj.js";import{C as j}from"./capability-load-error-yDSS8G5I.js";function d(){const t=f.c(19);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:c}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("monitoring:view")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("members:manage")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}let n;return t[17]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[17]=r,t[18]=n):n=t[18],n}export{d as default};
@@ -1,4 +1,4 @@
1
- import{c as xe,r as fe,d as es,a2 as gt,b as Ae,j as t,B as ve,t as ct,ah as Vt,a9 as ts,K as jt,m as Ot,a3 as Rs,l as nt,eU as Cs,h as Fs,u as Os,n as It,y as qt,H as zs,J as $s,W as As,I as Ht}from"./index-BlWeDA0T.js";import{S as Es}from"./search-input-BaljBVL8.js";import{E as Ut}from"./empty-state-ChkfcEnf.js";import{R as Us}from"./require-capability-Canamm7b.js";import{f as ps}from"./pair-Boroas12.js";import{u as Gt}from"./use-connection-BDpvwZcn.js";import{g as Is}from"./connection-slug-CITJ0kGN.js";import{B as _t}from"./badge-BIePf0xK.js";import{P as ss,a as ls,b as rs}from"./popover-C86-20Mm.js";import{c as kt,T as Tt,a as Mt,b as Ks}from"./tooltip-B6W7NpVz.js";import{a as $t}from"./Copy01-BrqDGrTX.js";import{n as gs}from"./ZoomOut-BpMDqvoU.js";import{E as is,bF as Vs,L as qs}from"./agent-icon-Cwi3uRdu.js";import{i as Hs}from"./Key01-D7fc2of0.js";import{i as Bs}from"./Play-BaMMHzUS.js";import{MonacoCodeEditor as hs}from"./monaco-editor-CGec7a_K.js";import{a as Js}from"./use-members-DfdZqgw8.js";import{u as Gs}from"./use-mcp-client-B333X4fs.js";import{b as Qs}from"./repository-binding-Ds0zXEVH.js";import{n as Pt}from"./LinkBroken01-D4fcNp0y.js";import{c as Ys}from"./SwitchHorizontal01-BLoNOmQx.js";import{s as Ws}from"./Plus-DBwsZRbL.js";import{s as Xs}from"./Trash01-DmGIq4LE.js";import{M as Ft}from"./multi-select-CWeD2kOU.js";import{b as Nt,a as bt,c as $e,d as yt,S as wt}from"./select-B54nmexC.js";import{e as vs,T as Zs}from"./time-range-picker-CNeKIOXx.js";import{T as el}from"./textarea-BLu1V32o.js";import{C as ks}from"./collection-tabs-C8f6Only.js";import{S as tl}from"./switch-ZvhKKFCY.js";import{L as sl}from"./label-CCf767lm.js";import{I as St}from"./integration-icon-BRfynNZ5.js";import{A as os}from"./avatar-Bp-EkB-V.js";import{A as ll,a as rl,b as il}from"./alert-DD0xrZ6s.js";import{K as pt}from"./monitoring-stats-row-BBfe42aa.js";import{c as Kt}from"./use-decopilot-events-Bd-4vex6.js";import{g as ol,b as js,f as vt,c as Bt,d as nl,e as Ns,a as ns,h as al,i as as,T as cl,j as dl,r as ml,k as ul}from"./thread-sheet-body-rJHE2tap.js";import{u as fl}from"./useSuspenseInfiniteQuery-CccYtrDO.js";import{c as xl,S as pl,b as Ts,a as Ms}from"./sheet-2W5SODwA.js";import{c as Ee,b as Dt,d as cs,e as ds,T as je,a as ms}from"./table-iG31aWmE.js";import{n as Qt,t as Yt}from"./ChevronUp-C9gm2RHA.js";import{u as _s,A as gl}from"./automation-runs-gnGbUEYl.js";import{u as Ps}from"./use-infinite-scroll-F7T2FF-S.js";import{u as hl}from"./useInfiniteQuery-Z8R3F4Sd.js";import{g as vl}from"./task-status-BDiexprl.js";import{u as jl,d as Nl}from"./use-automations-DOCjbfCs.js";import"./SearchMd-Cz9CjV4u.js";import"./access-gate-DawpkWaC.js";import"./capability-load-error-D8PnCnVx.js";import"./Tool01-BYtrXXg0.js";import"./format-time-CAj8AQXM.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BEHE2idT.js";import"./use-copy-_ycKA-XN.js";import"./usage-stats-2c6yVTyC.js";import"./tool-namespace-Cu-DNTic.js";import"./form-DDdiF5DN.js";import"./utils-CVEq3hMx.js";import"./markdown-BRIlR7nZ.js";import"./location-BjlyegC2.js";import"./use-mobile-hkvDmO1w.js";import"./use-panel-navigate-C2cHRlDL.js";import"./thread-route-CW7xmu6G.js";import"./use-project-scope-BROCSZWk.js";import"./chat-context-CKK4nwlA.js";import"./autosend-DkgNxXhw.js";import"./thread-intent-9GHukD-s.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C1f9T3Cq.js";import"./task-board-C00mxWAh.js";import"./schema-DO5D2eCO.js";import"./slugify-CEUa2lfQ.js";import"./use-ai-providers-BWqKJRmf.js";import"./use-chat-navigation-CmNsxQBq.js";import"./use-organization-settings-DxTssZLI.js";import"./use-clock-tick-B2MqiplU.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BdWVQtZT.js";import"./types-C4NGZqb0.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-BugQG9bV.js";import"./Image01-LmX-9DTg.js";import"./XClose-D_NlSxSm.js";import"./ShoppingBag01-FE4oAEwY.js";import"./shell-layout-xMF7zZJW.js";import"./Building02-DqK4SREZ.js";import"./UserSquare-B3hi5v4G.js";import"./CheckCircle-DIUFnJQp.js";import"./Monitor01-zCUpqs5C.js";import"./command-D2C8egnH.js";import"./index-BHzdhQYD.js";import"./project-icon-CJp8KUWK.js";import"./new-project-dialog-D9WaXvgl.js";import"./ArrowLeft-BsOtfvqw.js";import"./repository-import-picker-CJrt2Qyf.js";import"./use-navigate-to-agent-Dzg43OKn.js";import"./repository-picker-DoUZKYGY.js";import"./collection-search-mDMHjO22.js";import"./use-debounced-value-ByyoTH63.js";import"./required-auth-layout-CoQlG-uh.js";import"./use-org-sso-CH28wOEA.js";import"./Link01-UOxGnkqg.js";import"./use-mcp-prompts-P2KMjN9W.js";import"./use-thread-outputs-BwFYAN97.js";import"./file-type-icon-C2mdy7vI.js";import"./index-DrHP_BcE.js";import"./ArrowUp-BM60-fZY.js";import"./ChevronSelectorVertical-CRMiEVEY.js";import"./CreditCard01-C7MhbtAI.js";import"./DotsVertical-DjBJNxxU.js";import"./Globe04-Bi1qDXFD.js";import"./Sun-lUDK8Dny.js";import"./Upload01-B1KubIEG.js";import"./User01-DxYW6D1x.js";import"./Users01-Dg9yGM1q.js";import"./editor-r9_MTJH5.js";import"./use-org-auth-client-DROvF2zH.js";import"./auth-d1Zn25hw.js";import"./checkbox-Dwjm_TLd.js";import"./index-BdQq_4o_.js";import"./scroll-area-BjUjV0Z5.js";import"./calendar-BnpyhDmY.js";import"./chart-Bv9NYntf.js";import"./index-BOey0PQ3.js";import"./symbol-CRqLTukg.js";import"./CategoricalChart-B4irlNQB.js";import"./AreaChart-C2JGxQiA.js";import"./XAxis-BriqOO10.js";import"./tooltipContext-BWgKo-Vc.js";import"./BarChart-B7UShXEl.js";import"./ActiveShapeUtils-BmpX0aJ4.js";import"./Sector-DRzP1YgK.js";import"./ErrorBarContext-Duc4DanJ.js";import"./infiniteQueryObserver-C9osZa8h.js";const Wt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},bl=["eq","contains","exists","in"];function yl(s){return bl.includes(s)}function ht(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function wl(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...d]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&yl(i)?i:"eq",value:decodeURIComponent(d.join(":")||"")}}).filter(e=>e!==void 0)}function At(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{c as xe,r as fe,d as es,a2 as gt,b as Ae,j as t,B as ve,t as ct,ah as Vt,a9 as ts,K as jt,m as Ot,a3 as Rs,l as nt,eU as Cs,h as Fs,u as Os,n as It,y as qt,H as zs,J as $s,W as As,I as Ht}from"./index-C4rtGZhj.js";import{S as Es}from"./search-input-gCUrqSdC.js";import{E as Ut}from"./empty-state-D86dkAEs.js";import{R as Us}from"./require-capability-vyLDKVOB.js";import{f as ps}from"./pair-xLeCyNWu.js";import{u as Gt}from"./use-connection-mfEI4HYb.js";import{g as Is}from"./connection-slug-CITJ0kGN.js";import{B as _t}from"./badge-DEUubLaF.js";import{P as ss,a as ls,b as rs}from"./popover-BpfU2ryl.js";import{c as kt,T as Tt,a as Mt,b as Ks}from"./tooltip-knB_BmiO.js";import{a as $t}from"./Copy01-DD7TBaxd.js";import{n as gs}from"./ZoomOut-C8fNa3eF.js";import{E as is,bF as Vs,L as qs}from"./agent-icon-D4A6sHBt.js";import{i as Hs}from"./Key01-BCoXSbsF.js";import{i as Bs}from"./Play-3PdWOSem.js";import{MonacoCodeEditor as hs}from"./monaco-editor-BfdWIqSi.js";import{a as Js}from"./use-members-B2pgOmcT.js";import{u as Gs}from"./use-mcp-client-iEvULqcR.js";import{b as Qs}from"./repository-binding-C-QRBZ2o.js";import{n as Pt}from"./LinkBroken01-DQvdTTgG.js";import{c as Ys}from"./SwitchHorizontal01-CL7aXkdk.js";import{s as Ws}from"./Plus-BGSMJ3F-.js";import{s as Xs}from"./Trash01-B0MFAKuS.js";import{M as Ft}from"./multi-select-BHYZFxI5.js";import{b as Nt,a as bt,c as $e,d as yt,S as wt}from"./select-B08ML6hj.js";import{e as vs,T as Zs}from"./time-range-picker-GZrtbU09.js";import{T as el}from"./textarea-Cm9WuKCc.js";import{C as ks}from"./collection-tabs-DXjqVmA6.js";import{S as tl}from"./switch-D548fZxN.js";import{L as sl}from"./label-BjPw9Rfi.js";import{I as St}from"./integration-icon-B-VuBONI.js";import{A as os}from"./avatar-BmEw6w6S.js";import{A as ll,a as rl,b as il}from"./alert-Jt-lWiyr.js";import{K as pt}from"./monitoring-stats-row-DxnqczB_.js";import{c as Kt}from"./use-decopilot-events--SDGmxUY.js";import{g as ol,b as js,f as vt,c as Bt,d as nl,e as Ns,a as ns,h as al,i as as,T as cl,j as dl,r as ml,k as ul}from"./thread-sheet-body-BkMk6e3g.js";import{u as fl}from"./useSuspenseInfiniteQuery-9FV3iOtp.js";import{c as xl,S as pl,b as Ts,a as Ms}from"./sheet-BgQYccYB.js";import{c as Ee,b as Dt,d as cs,e as ds,T as je,a as ms}from"./table-CI1oZOKj.js";import{n as Qt,t as Yt}from"./ChevronUp-DgF_0akr.js";import{u as _s,A as gl}from"./automation-runs-jswuOSPW.js";import{u as Ps}from"./use-infinite-scroll-BfZrsHvo.js";import{u as hl}from"./useInfiniteQuery-CH2YwNOR.js";import{g as vl}from"./task-status-CtMWxsza.js";import{u as jl,d as Nl}from"./use-automations-st590zyh.js";import"./SearchMd-gvLMH1IR.js";import"./access-gate-BZb7qW2_.js";import"./capability-load-error-yDSS8G5I.js";import"./Tool01-DmCjPcwM.js";import"./format-time-CAj8AQXM.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-Dzdq3pSP.js";import"./use-copy-BCgrYqWn.js";import"./usage-stats-D0e4-Doz.js";import"./tool-namespace-JguyqV9V.js";import"./form-QiGH5N0B.js";import"./utils-CVEq3hMx.js";import"./markdown-Fzwq5r4L.js";import"./location-BjlyegC2.js";import"./use-mobile-DR0ou4Mg.js";import"./use-panel-navigate-CTGXxycL.js";import"./thread-route-CHlbKw5S.js";import"./use-project-scope-Z7wAK5MJ.js";import"./chat-context-CkzpVzP2.js";import"./autosend-BP7dIixd.js";import"./thread-intent-DWGyzG2H.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BGVIlM9_.js";import"./task-board-DVS-070d.js";import"./schema-BfTWP2eM.js";import"./slugify-CEUa2lfQ.js";import"./use-ai-providers-BLLCJ82i.js";import"./use-chat-navigation-DrhyLHlD.js";import"./use-organization-settings-CHQPn47n.js";import"./use-clock-tick-DissHE7g.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CLrd0dRs.js";import"./types-Tl69lmSm.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-ezsenyDA.js";import"./Image01-BmLj4iEQ.js";import"./XClose-BIF2YR7O.js";import"./ShoppingBag01-4HryX9q-.js";import"./shell-layout-28JRcfGc.js";import"./Building02-DVmqpekj.js";import"./UserSquare-Bkrct5dy.js";import"./CheckCircle-CN4P8qA2.js";import"./Monitor01-BL49Kh8w.js";import"./command-MB9q2Bfp.js";import"./index-BHsQFo2r.js";import"./project-icon-BLicVbcB.js";import"./new-project-dialog-D0Tv538i.js";import"./ArrowLeft-XWagtiKt.js";import"./repository-import-picker-Ck-W8Fet.js";import"./use-navigate-to-agent-ChjWG67f.js";import"./repository-picker-D0Kp2t1m.js";import"./collection-search-Bett-OVD.js";import"./use-debounced-value-BQw-U7yI.js";import"./required-auth-layout-BLCp7vSK.js";import"./use-org-sso-dcnzEZJT.js";import"./Link01-DKrKZRUt.js";import"./use-mcp-prompts-aNIE_qf0.js";import"./use-thread-outputs-CnXr-3J8.js";import"./file-type-icon-CkYEjqoY.js";import"./index-C9L_7jwF.js";import"./ArrowUp-1Pn6KcFo.js";import"./ChevronSelectorVertical-t7oZTVYb.js";import"./CreditCard01-BqWXWcAN.js";import"./DotsVertical-D63daqR4.js";import"./Globe04-CAZFyv9C.js";import"./Sun-xJ1qtoxz.js";import"./Upload01-AYcSEbb9.js";import"./User01-CvrqyM7d.js";import"./Users01-DavPAvfh.js";import"./editor-DMSnXQVS.js";import"./use-org-auth-client-Cy1K9alo.js";import"./auth-CxFoeet-.js";import"./checkbox-JNUYg61n.js";import"./index-BdQq_4o_.js";import"./scroll-area-HU3PM_-R.js";import"./calendar-9j-mqApB.js";import"./chart-DezRUEbd.js";import"./index-CuaYFVYi.js";import"./symbol-d_WIAIBz.js";import"./CategoricalChart-CNSzufmI.js";import"./AreaChart-ZKSUgQFl.js";import"./XAxis-FlBA9n9J.js";import"./tooltipContext-B1sYDOEv.js";import"./BarChart-DJ64O8MN.js";import"./ActiveShapeUtils-BSxdgR9C.js";import"./Sector-B3DAIw7y.js";import"./ErrorBarContext-B4iJvc9K.js";import"./infiniteQueryObserver-DRgbaZZO.js";const Wt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},bl=["eq","contains","exists","in"];function yl(s){return bl.includes(s)}function ht(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function wl(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...d]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&yl(i)?i:"eq",value:decodeURIComponent(d.join(":")||"")}}).filter(e=>e!==void 0)}function At(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function bs(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[l,...i]=e.split("=");return{key:l||"",operator:"eq",value:i.join("=")}}if(e.includes("~")){const[l,...i]=e.split("~");return{key:l||"",operator:"contains",value:i.join("~")}}if(e.includes("@")){const[l,...i]=e.split("@");return{key:l||"",operator:"in",value:i.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Sl(s){const e={},l={},i=[],d={};for(const n of s)if(n.key.trim())switch(n.operator){case"eq":n.value&&(e[n.key]=n.value);break;case"contains":n.value&&(l[n.key]=`%${n.value}%`);break;case"exists":i.push(n.key);break;case"in":n.value&&(d[n.key]=n.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(l).length>0?l:void 0,propertyKeys:i.length>0?i:void 0,propertyInValues:Object.keys(d).length>0?d:void 0}}function ys(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};const e=s._decocms_truncated;if(typeof e=="string"&&e.length>0)return{content:e,isTruncated:!0,originalSize:e.length};let l;try{l=JSON.stringify(s,null,2)}catch{return{content:"[Unable to serialize JSON]",isTruncated:!1,originalSize:0}}const i=l.length;return i<=Wt.maxJsonRenderSize?{content:l,isTruncated:!1,originalSize:i}:{content:l.slice(0,Wt.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{dq as g,dr as d,ds as v}from"./index-BlWeDA0T.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
1
+ import{dq as g,dr as d,ds as v}from"./index-C4rtGZhj.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};