@vellumai/web 0.11.4 → 0.11.5-staging.2

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 (591) hide show
  1. package/dist/assets/{AnimatePresence-CxaKvfs9.js → AnimatePresence-DkZYJl3q.js} +1 -1
  2. package/dist/assets/{Trans-FBE1EuwL.js → Trans-CM5UUgDt.js} +1 -1
  3. package/dist/assets/{a2a-invite-lHsf93YX.js → a2a-invite-CduLLtki.js} +1 -1
  4. package/dist/assets/{about-page-ByfiFQot.js → about-page-c1mqdjOr.js} +1 -1
  5. package/dist/assets/{account-page-Df1VB34_.js → account-page-CSJOSKzD.js} +1 -1
  6. package/dist/assets/{account-shell-Dk4m-iaE.js → account-shell-WRaiE1O8.js} +1 -1
  7. package/dist/assets/{acp-run-actions-FLArlHEs.js → acp-run-actions-DNNBiPfr.js} +1 -1
  8. package/dist/assets/{acp-run-detail-panel-DsqMAPE4.js → acp-run-detail-panel-gR77X6Xm.js} +1 -1
  9. package/dist/assets/{acp-run-store-De5GuSFn.js → acp-run-store-BUcMP80V.js} +1 -1
  10. package/dist/assets/activity-steps-panel-BglLu7wx.js +1 -0
  11. package/dist/assets/{add-credential-modal-vRe51ERD.js → add-credential-modal-DgoBqgwB.js} +1 -1
  12. package/dist/assets/add-credits-modal-BNab_7H9.js +1 -0
  13. package/dist/assets/ai-page-CLAFnWl5.js +1 -0
  14. package/dist/assets/{animate-BhosXxi-.js → animate-1rkqw0bf.js} +1 -1
  15. package/dist/assets/{animated-avatar-DsEiCrtA.js → animated-avatar-Bk5J30oP.js} +1 -1
  16. package/dist/assets/api-ByKY0Cbt.js +1 -0
  17. package/dist/assets/api-DBKgmyno.js +1 -0
  18. package/dist/assets/{api-errors-CASENJGT.js → api-errors-DYGVb-Sh.js} +1 -1
  19. package/dist/assets/api-key-screen-CS0KZgP6.js +1 -0
  20. package/dist/assets/{app-card-CjRGDYCX.js → app-card-C7c3c4l4.js} +1 -1
  21. package/dist/assets/{app-info-CvBesesf.js → app-info-CEe_jK5S.js} +1 -1
  22. package/dist/assets/{archive-redirect-page-LFqfq3Zx.js → archive-redirect-page-DZkHnLmA.js} +1 -1
  23. package/dist/assets/{assistant-feature-flag-store-CNWz-RMv.js → assistant-feature-flag-store-CdXRp9pV.js} +1 -1
  24. package/dist/assets/{assistant-status-panel-BkLYzQAL.js → assistant-status-panel-BogBdYLj.js} +1 -1
  25. package/dist/assets/auth-store-iNnDaLgR.js +2 -0
  26. package/dist/assets/auth-welcome-screen-BoiE47Sg.js +1 -0
  27. package/dist/assets/{avatar-random-B5F8Cp2E.js → avatar-random-C7t2cN3Y.js} +1 -1
  28. package/dist/assets/{avatar-renderer-DSa5eaH2.js → avatar-renderer-DvM-sFyU.js} +1 -1
  29. package/dist/assets/{background-task-actions-rGTNVeqo.js → background-task-actions-D-C9wSSf.js} +1 -1
  30. package/dist/assets/{background-task-detail-panel-DtJ1ZolD.js → background-task-detail-panel-BeXbhHLZ.js} +1 -1
  31. package/dist/assets/{background-task-store-svLgwmNn.js → background-task-store-D3W6TX_2.js} +1 -1
  32. package/dist/assets/billing-page-PuFxEptl.js +3 -0
  33. package/dist/assets/{billing-redirect-page-B6zuKMxb.js → billing-redirect-page-BFDitQeE.js} +1 -1
  34. package/dist/assets/bookmarks-page-DY_CJ4I3.js +1 -0
  35. package/dist/assets/{browser-Ca2R8csw.js → browser--x9YKXWo.js} +2 -2
  36. package/dist/assets/{build-state-laR44jYU.js → build-state-Dtia1Hnq.js} +1 -1
  37. package/dist/assets/{bundle-confirm-page-D7_j_7v3.js → bundle-confirm-page-9Jl2oXni.js} +1 -1
  38. package/dist/assets/{button-VkxVX0DM.js → button-C8CGr0T0.js} +1 -1
  39. package/dist/assets/{capture-error-DiNp24s6.js → capture-error-VBsIaC5d.js} +1 -1
  40. package/dist/assets/{channels-page-route-sLLh-p2k.js → channels-page-route-WZWPUfRo.js} +1 -1
  41. package/dist/assets/chat-QLQLsbFK.js +3 -0
  42. package/dist/assets/{chat-avatar-D7ZBWcZy.js → chat-avatar-DInCdP5z.js} +1 -1
  43. package/dist/assets/chat-markdown-message-JeYI9m3i.js +1 -0
  44. package/dist/assets/chat-z1gK656n.js +1 -0
  45. package/dist/assets/{checkbox-CyG1nZhR.js → checkbox-BWX_Dnge.js} +1 -1
  46. package/dist/assets/checkout-continuation-B-A9SoHt.js +1 -0
  47. package/dist/assets/checkout-page-BYHPD7UJ.js +1 -0
  48. package/dist/assets/checkout-return-target-DnT91-Y_.js +1 -0
  49. package/dist/assets/{client-feature-flag-store-CT2T_Fg7.js → client-feature-flag-store-DuVzcD-V.js} +1 -1
  50. package/dist/assets/{client-perf-BZu5XQCP.js → client-perf-Bg-CBIVj.js} +1 -1
  51. package/dist/assets/{command-palette-B6PZe9A0.js → command-palette-C8JWMyiC.js} +1 -1
  52. package/dist/assets/{command-palette-window-page-BYkkAV88.js → command-palette-window-page-C8vw0yIO.js} +1 -1
  53. package/dist/assets/common-gaw6OefS.js +1 -0
  54. package/dist/assets/community-page-DvR4X6k9.js +1 -0
  55. package/dist/assets/{companion-surface-CZHv2avR.js → companion-surface-Cnmjk-6O.js} +1 -1
  56. package/dist/assets/companion-surface-page-iknPQRTu.js +1 -0
  57. package/dist/assets/composer-settings-B84-FOM1.js +1 -0
  58. package/dist/assets/{confirm-dialog-Drw1adml.js → confirm-dialog-DYmL6FRe.js} +1 -1
  59. package/dist/assets/{connect-page-DiO1EqEC.js → connect-page-CKAizrWr.js} +1 -1
  60. package/dist/assets/{consent-controls-B_zCicqo.js → consent-controls-V9Wca6TV.js} +1 -1
  61. package/dist/assets/{contacts-gateway-CZNNXLeD.js → contacts-gateway-CoPOXTzi.js} +1 -1
  62. package/dist/assets/{contacts-page-route-fUfbhwZ5.js → contacts-page-route-BceswcoE.js} +1 -1
  63. package/dist/assets/conversation-cache-CuEQRyqi.js +1 -0
  64. package/dist/assets/conversation-navigation-CfOyMc6W.js +1 -0
  65. package/dist/assets/conversation-queries-CtAFZgFP.js +1 -0
  66. package/dist/assets/{conversation-selection-4ubh2ui-.js → conversation-selection-ZuF7NVBR.js} +1 -1
  67. package/dist/assets/{copy-to-clipboard-D76_3Coc.js → copy-to-clipboard-yufQqRBL.js} +1 -1
  68. package/dist/assets/{credential-entry-page--HYBfvoW.js → credential-entry-page-B0NYTomQ.js} +1 -1
  69. package/dist/assets/credentials-page-DfOet7SI.js +1 -0
  70. package/dist/assets/{use-avatar-accent-var-DN_cfh4V.js → credit-tiers-Bc9xxLBK.js} +1 -1
  71. package/dist/assets/{csv-preview-T_KT_vef.js → csv-preview-QUU-h2MX.js} +1 -1
  72. package/dist/assets/{danger-zone-redirect-page-BuIG9f9S.js → danger-zone-redirect-page-B_ZMX7ns.js} +1 -1
  73. package/dist/assets/debug-page-DXvFlnqh.js +4 -0
  74. package/dist/assets/{deploy-dialogs-CgicOESj.js → deploy-dialogs-ilUtMpvf.js} +1 -1
  75. package/dist/assets/{deploy-store-dyN183E8.js → deploy-store-C_y0BvwK.js} +1 -1
  76. package/dist/assets/{desktop-voice-activity-D1BSf0I-.js → desktop-voice-activity-B0dHlUep.js} +1 -1
  77. package/dist/assets/{detail-card-Bqnvs6YE.js → detail-card-DwBporBs.js} +1 -1
  78. package/dist/assets/{detail-drawer-j2jaITAL.js → detail-drawer-Di5V_iLf.js} +1 -1
  79. package/dist/assets/{detail-shell-D1UEZCzz.js → detail-shell-CcrQic9y.js} +1 -1
  80. package/dist/assets/developer-page-B_LQmpH7.js +1 -0
  81. package/dist/assets/{devices-redirect-page-BoKYF1E9.js → devices-redirect-page-BD0VY17t.js} +1 -1
  82. package/dist/assets/{diagnostics-CwFqcLv_.js → diagnostics-BcQgahbk.js} +1 -1
  83. package/dist/assets/{dictation-overlay-xS8BRhPs.js → dictation-overlay-BrXujvAw.js} +1 -1
  84. package/dist/assets/dictation-overlay-page-CfGmex7E.js +1 -0
  85. package/dist/assets/dist-BFOJNO7w.js +1 -0
  86. package/dist/assets/{dist-D94ZMew1.js → dist-BsGO-mS7.js} +1 -1
  87. package/dist/assets/{dist-CzN28mbE.js → dist-DN2Wju98.js} +1 -1
  88. package/dist/assets/{dist--4Bbb2u3.js → dist-eCSUXDGk.js} +1 -1
  89. package/dist/assets/{doctor-handoff-store-Cy96Na-O.js → doctor-handoff-store-B_RlFFKC.js} +1 -1
  90. package/dist/assets/{document-viewer-container-BMmSidmj.js → document-viewer-container-D3aPjnj8.js} +2 -2
  91. package/dist/assets/document-viewer-page-CvQXX7Mp.js +1 -0
  92. package/dist/assets/effective-timezone-CrnImpLf.js +1 -0
  93. package/dist/assets/{emails-page-CJM4OS94.js → emails-page-DbAVQ_jC.js} +1 -1
  94. package/dist/assets/{esm-BD6nxr-q.js → esm-4Bnaz5rU.js} +2 -2
  95. package/dist/assets/esm-C4VoH46A.js +1 -0
  96. package/dist/assets/{esm-nl105Ya0.js → esm-CrXbhSov.js} +2 -2
  97. package/dist/assets/{esm-BaEdQNCe.js → esm-DXPZZih3.js} +2 -2
  98. package/dist/assets/esm-DcJxSeV0.js +2 -0
  99. package/dist/assets/{esm-kYXyJ2zw.js → esm-Ddv_MyHw.js} +2 -2
  100. package/dist/assets/{esm-DTIJZw37.js → esm-Do2zrCWJ.js} +2 -2
  101. package/dist/assets/{esm-FpGTFn5W.js → esm-DrXV9mo-.js} +2 -2
  102. package/dist/assets/{external-anchor-CLy6d_za.js → external-anchor-owoORewf.js} +1 -1
  103. package/dist/assets/{eye-bbox-DoGcAx4c.js → eye-bbox-BpNolORP.js} +1 -1
  104. package/dist/assets/feature-flag-catalog-C1y2RUth.js +1 -0
  105. package/dist/assets/feed-item-status-actions-C3JfFvZc.js +1 -0
  106. package/dist/assets/{file-editor-BwdObVSu.js → file-editor-CeYfWNBz.js} +1 -1
  107. package/dist/assets/{file-markdown-C1rEGVrN.js → file-markdown-B9G_TXX-.js} +1 -1
  108. package/dist/assets/{first-run-scope-DdSaiULx.js → first-run-scope-MD-rEgje.js} +1 -1
  109. package/dist/assets/format-usd-BYzA1eMJ.js +1 -0
  110. package/dist/assets/{funnel-events-BP3XPaB5.js → funnel-events-ClGpFDNM.js} +1 -1
  111. package/dist/assets/general-page-CzDlVoNx.js +1 -0
  112. package/dist/assets/{get-memory-stats-SquVhZnd.js → get-memory-stats-U9zVanzc.js} +1 -1
  113. package/dist/assets/{haptics-D3hzTCtH.js → haptics-F-nvqKYf.js} +2 -2
  114. package/dist/assets/hatching-screen-FgNbjXOt.js +1 -0
  115. package/dist/assets/{home-page-route-BSoWksW0.js → home-page-route-C7Aeo-Mg.js} +1 -1
  116. package/dist/assets/hosting-screen-CLVRdDiX.js +1 -0
  117. package/dist/assets/{i18n-C9hRT4Lf.js → i18n-C3bX3mTs.js} +4 -4
  118. package/dist/assets/identity-DyjQj_xm.js +1 -0
  119. package/dist/assets/identity-page-route-CHncFua2.js +7 -0
  120. package/dist/assets/index-C7hCfQpd.css +2 -0
  121. package/dist/assets/index-DS0PEdhO.js +11 -0
  122. package/dist/assets/{ingest-DXklElaR.js → ingest-C1wiUm1l.js} +1 -1
  123. package/dist/assets/{input-DkgpMeG9.js → input-DlkBtbxm.js} +1 -1
  124. package/dist/assets/{inspect-page-naqIziez.js → inspect-page-CNLiZXRt.js} +3 -3
  125. package/dist/assets/{installed-plugins-query-CZLdpwnL.js → installed-plugins-query-DQKwv-Iz.js} +1 -1
  126. package/dist/assets/{integration-icon-DbmKvxqf.js → integration-icon-BxfDs-Ud.js} +1 -1
  127. package/dist/assets/integrations-page-B9SHiomg.js +1 -0
  128. package/dist/assets/intelligence-C7DYXerF.js +5 -0
  129. package/dist/assets/{intelligence-layout-CXzIl0Vl.js → intelligence-layout-BoW8JbDc.js} +1 -1
  130. package/dist/assets/internal-thread-actions-C0S_b7cx.js +1 -0
  131. package/dist/assets/{invalidate-memory-queries-C4-KSsdB.js → invalidate-memory-queries-uk2gV1m0.js} +1 -1
  132. package/dist/assets/{invalidate-plugin-queries-DxagFqKP.js → invalidate-plugin-queries-CI1Cseau.js} +1 -1
  133. package/dist/assets/keyboard-shortcuts-redirect-page-BY3Va4w9.js +1 -0
  134. package/dist/assets/{latest-assistant-text-JCjtByys.js → latest-assistant-text-fXT5Jkt8.js} +2 -2
  135. package/dist/assets/library-Da5KVeDF.js +1 -0
  136. package/dist/assets/{library-detail-page-CyWiXwb9.js → library-detail-page-CX92FKAK.js} +1 -1
  137. package/dist/assets/{library-page-CzcvMljL.js → library-page-D2v2j-WU.js} +1 -1
  138. package/dist/assets/{list-row-CDwzGT9g.js → list-row-6uedKE84.js} +1 -1
  139. package/dist/assets/llm-model-catalog-BxTXG4Cg.js +1 -0
  140. package/dist/assets/local-mode-DzIUFjhf.js +1 -0
  141. package/dist/assets/{local-runtime-upgrade-BkoG5uVr.js → local-runtime-upgrade-BpvLk3HN.js} +1 -1
  142. package/dist/assets/{login-flow-D6ivg6PM.js → login-flow-BYBqjDap.js} +1 -1
  143. package/dist/assets/{login-page-Dmpz0GgT.js → login-page-fl8rgXFq.js} +1 -1
  144. package/dist/assets/{logout-page-CI3LDcqG.js → logout-page-DLjLy7Hp.js} +1 -1
  145. package/dist/assets/{logs-layout-BHP-ADUq.js → logs-layout-Du4o-HeH.js} +1 -1
  146. package/dist/assets/{markdown-preview-Dx8E021p.js → markdown-preview-ukYPAksc.js} +1 -1
  147. package/dist/assets/media-preview-Ds0Jo4hk.js +1 -0
  148. package/dist/assets/{memory-page-route-qvBEERTa.js → memory-page-route-CvKjQ2FE.js} +1 -1
  149. package/dist/assets/memory-router-playground-page-Dh8zVze9.js +1 -0
  150. package/dist/assets/{menu-ubIBmfUh.js → menu-Ci8JeI2H.js} +1 -1
  151. package/dist/assets/message-content-C1CZhGIc.js +1 -0
  152. package/dist/assets/{message-files-panel-ZPa7eZHc.js → message-files-panel-DEAC2iCY.js} +1 -1
  153. package/dist/assets/messages-D5oI1yRV.js +13 -0
  154. package/dist/assets/{metric-card-bXd-f58c.js → metric-card-YqtdN5uX.js} +1 -1
  155. package/dist/assets/mime-sniff-BeXhZEXw.js +1 -0
  156. package/dist/assets/{modal-UYNawsIu.js → modal-DN_Uwwkg.js} +1 -1
  157. package/dist/assets/native-anchor-C13W_dF5.js +1 -0
  158. package/dist/assets/native-biometric-DzQYY-Z2.js +6 -0
  159. package/dist/assets/{native-file-BpFW1c_c.js → native-file-qM32rSz7.js} +2 -2
  160. package/dist/assets/navigation-resolver-B6QxHAa5.js +1 -0
  161. package/dist/assets/{not-found-ui-gcXqK.js → not-found-DXwfp4Yf.js} +1 -1
  162. package/dist/assets/{notice-BlYF-xU3.js → notice-C_AsX_o9.js} +1 -1
  163. package/dist/assets/{notifications-DK6b8YVI.js → notifications-DMNpr3pt.js} +1 -1
  164. package/dist/assets/notifications-page-DD-175gq.js +1 -0
  165. package/dist/assets/{oauth-complete-page-7NZZRVcj.js → oauth-complete-page-DBDWL3aD.js} +1 -1
  166. package/dist/assets/{oauth-popup-complete-page-Ci39YXpe.js → oauth-popup-complete-page-Dv0482xp.js} +1 -1
  167. package/dist/assets/onboarding-DwRWKhM_.js +1 -0
  168. package/dist/assets/onboarding-layout-CYgAi-S1.js +1 -0
  169. package/dist/assets/open-workspace-file-Ca9gUjoQ.js +2 -0
  170. package/dist/assets/{operational-status-CMN32PL8.js → operational-status-DVK3_kD_.js} +1 -1
  171. package/dist/assets/{page-shell-C3ZmdIop.js → page-shell-nVp2ogSk.js} +1 -1
  172. package/dist/assets/{pairing-page-YPN7ISIr.js → pairing-page-CLNSXQ7A.js} +1 -1
  173. package/dist/assets/{password-reset-page-D8ONrPU-.js → password-reset-page-BNw-K6vZ.js} +1 -1
  174. package/dist/assets/pdf-file-preview-DvhlIAI5.js +1 -0
  175. package/dist/assets/pdf-preview-BpUxb6wy.js +2 -0
  176. package/dist/assets/{personality-page-CLsRq5L2.js → personality-page-axIG9Tu_.js} +1 -1
  177. package/dist/assets/plans-page-DQu9C86N.js +1 -0
  178. package/dist/assets/{platform-detection-zth6eCY8.js → platform-detection-C-a_Mru0.js} +1 -1
  179. package/dist/assets/{platform-login-notice-CvFpWLJY.js → platform-login-notice-Dmq_2Akt.js} +1 -1
  180. package/dist/assets/{platform-loopback-page-B8cGk07e.js → platform-loopback-page-B0UOR3ct.js} +1 -1
  181. package/dist/assets/{plugin-detail-page--CvX0OXv.js → plugin-detail-page-2ySPND3h.js} +1 -1
  182. package/dist/assets/{plugins-page-CZ16U_6n.js → plugins-page-D7jLWtXv.js} +1 -1
  183. package/dist/assets/plugins-surface-CLatmeTO.js +1 -0
  184. package/dist/assets/pointer-Cxac45y6.js +1 -0
  185. package/dist/assets/popover-B_nY8VYI.js +1 -0
  186. package/dist/assets/{prefs-BLTugIFN.js → prefs-BFDWWNwd.js} +1 -1
  187. package/dist/assets/{preview-error-gCViZZRw.js → preview-error-B7qHC1Y4.js} +1 -1
  188. package/dist/assets/privacy-page-B-FaZv9p.js +1 -0
  189. package/dist/assets/privacy-screen-Ng4c4whW.js +1 -0
  190. package/dist/assets/profile-pickers-BE4eyfmO.js +1 -0
  191. package/dist/assets/{provider-callback-page-BPp1TM7J.js → provider-callback-page-CwYFxjk3.js} +1 -1
  192. package/dist/assets/{provider-key-DpdSx5gG.js → provider-key-D0kB_zjf.js} +1 -1
  193. package/dist/assets/{provider-signup-page-Cv9_b_58.js → provider-signup-page-BORU3SZe.js} +1 -1
  194. package/dist/assets/{provisioning-targets-DDUZDQ_a.js → provisioning-targets-D1mqFL8i.js} +1 -1
  195. package/dist/assets/{proxy-CT_qJI1K.js → proxy-C_GXGfwL.js} +1 -1
  196. package/dist/assets/{push-registration-CH_t0mI8.js → push-registration-CyLSsbG5.js} +2 -2
  197. package/dist/assets/{quick-input-page-LqfQdZFU.js → quick-input-page-D7nJMXNi.js} +1 -1
  198. package/dist/assets/react-query.gen-CYP-Tn4K.js +1 -0
  199. package/dist/assets/react-query.gen-D3r2fwXH.js +1 -0
  200. package/dist/assets/remote-gateway-session-B4C6b4Sx.js +1 -0
  201. package/dist/assets/remove-from-device-dialog-Bpy0yOG4.js +1 -0
  202. package/dist/assets/{research-facts-C2cY_gU2.js → research-facts-DzELMLzK.js} +1 -1
  203. package/dist/assets/{research-mock-page-CB1_bEoa.js → research-mock-page-BkcbRMpS.js} +1 -1
  204. package/dist/assets/{research-onboarding-persistence-Bx5cdkas.js → research-onboarding-persistence-BFdNebXL.js} +1 -1
  205. package/dist/assets/research-onboarding-route-BlBSSOiI.js +50 -0
  206. package/dist/assets/{research-results-view-BcQs2Zh9.js → research-results-view-D1hOhfTP.js} +1 -1
  207. package/dist/assets/{resolved-assistants-store-BNadgXqb.js → resolved-assistants-store-D57qRwKv.js} +1 -1
  208. package/dist/assets/retire-confirm-dialog-Zwo-Sjrc.js +1 -0
  209. package/dist/assets/{review-terms-screen-CI_29cnc.js → review-terms-screen-DmNdg_zJ.js} +1 -1
  210. package/dist/assets/routes-BaPyKuTq.js +24 -0
  211. package/dist/assets/routes-yNhBxUSb.js +1 -0
  212. package/dist/assets/runtime-upgrade-banner-bHSGkzwB.js +2 -0
  213. package/dist/assets/{sandbox-bridge-Dj1pIOXJ.js → sandbox-bridge-BcJiBmUR.js} +1 -1
  214. package/dist/assets/{schedules-C2Tr1zNV.js → schedules-CgwiGq3x.js} +1 -1
  215. package/dist/assets/schedules-DaGS9wMX.js +1 -0
  216. package/dist/assets/{schedules-page-0V6ECw0t.js → schedules-page-Ca_u2KkZ.js} +1 -1
  217. package/dist/assets/schemas-CwBN1MUL.js +39 -0
  218. package/dist/assets/{sdk.gen-DWvuzSBW.js → sdk.gen-DXPJc8Xk.js} +1 -1
  219. package/dist/assets/{sdk.gen-CiE6cMi0.js → sdk.gen-hZs6YBR0.js} +1 -1
  220. package/dist/assets/section-membership-CJlFrKoM.js +1 -0
  221. package/dist/assets/{security-redirect-page-D6x3MANY.js → security-redirect-page-eZ_C_Wf0.js} +1 -1
  222. package/dist/assets/{select-BKyejRky.js → select-DJDG9pwU.js} +1 -1
  223. package/dist/assets/select-assistant-screen-DSLQRer8.js +1 -0
  224. package/dist/assets/{self-hosted-servers-BviPyNnl.js → self-hosted-servers-DJIKPu90.js} +1 -1
  225. package/dist/assets/settings-BY8t4asx.js +1 -0
  226. package/dist/assets/{settings-divider-C0NZsB-L.js → settings-divider-BCyO1zmM.js} +1 -1
  227. package/dist/assets/settings-layout-Cv8u2dv7.js +1 -0
  228. package/dist/assets/settings-navigation-R6E3Weed.js +1 -0
  229. package/dist/assets/{share-feedback-modal-PlN6X3Pm.js → share-feedback-modal-COH8zwku.js} +2 -2
  230. package/dist/assets/{sidebar-tree-Bp0eeKf2.js → sidebar-tree-Bfvk_uAR.js} +1 -1
  231. package/dist/assets/{signup-page-gqz5_wG1.js → signup-page-BsMK6h9P.js} +1 -1
  232. package/dist/assets/{signup-shell-DW976E_0.js → signup-shell-OkpQCRuO.js} +1 -1
  233. package/dist/assets/{site-favicon-Cu07pwc9.js → site-favicon-Bu9L02gb.js} +1 -1
  234. package/dist/assets/{skill-detail-page-c0s3w3K3.js → skill-detail-page-D9WBRKuf.js} +1 -1
  235. package/dist/assets/{skill-detail-panel-NYXq557_.js → skill-detail-panel-kCMadngl.js} +1 -1
  236. package/dist/assets/{skills-5MnTu98B.js → skills-C3-ibGUo.js} +1 -1
  237. package/dist/assets/{skills-page-B_VTCiN2.js → skills-page-BMYP4Xi0.js} +1 -1
  238. package/dist/assets/sound-manager-CCbiDOQN.js +1 -0
  239. package/dist/assets/sounds-page-Du1t_S8A.js +1 -0
  240. package/dist/assets/{src-CImIAPTd.js → src-DMnnfLrU.js} +2 -2
  241. package/dist/assets/start-screen-I5HBKHT6.js +1 -0
  242. package/dist/assets/{status-badge-pill-D8m98tJa.js → status-badge-pill-w-ULYfRy.js} +1 -1
  243. package/dist/assets/{stt-language-picker-modal-BXLEBM7b.js → stt-language-picker-modal-Cq76JJex.js} +1 -1
  244. package/dist/assets/{subagent-detail-panel-CrbpQRzW.js → subagent-detail-panel-DP4dB-Dz.js} +1 -1
  245. package/dist/assets/{subagent-store-DqKEBlAM.js → subagent-store-Bn8k7JMr.js} +2 -2
  246. package/dist/assets/{superpowers-page-B5WGXphq.js → superpowers-page-COTkr31c.js} +1 -1
  247. package/dist/assets/{swipe-action-reveal-Ai9lRgUU.js → swipe-action-reveal-CQY9DSup.js} +1 -1
  248. package/dist/assets/{system-events-page-_aap_0av.js → system-events-page-CvoSQs7q.js} +1 -1
  249. package/dist/assets/{system-events-redirect-page-DbyqOqe_.js → system-events-redirect-page-BjnwAn9h.js} +1 -1
  250. package/dist/assets/{tag-Ddzwz3ij.js → tag-D2QYCm1p.js} +1 -1
  251. package/dist/assets/{telegram-setup-wizard-BENKNAuh.js → telegram-setup-wizard-6UP2MTrh.js} +1 -1
  252. package/dist/assets/{text-preview-DUlKYC4u.js → text-preview-BG__pDe7.js} +1 -1
  253. package/dist/assets/{theme-stage-page-CbGuxQ23.js → theme-stage-page-YfsM529J.js} +1 -1
  254. package/dist/assets/{threshold-presets-DN0_JIJQ.js → threshold-presets-BJubRlKn.js} +1 -1
  255. package/dist/assets/{tiptap-document-editor-0vqw7hch.js → tiptap-document-editor-BM6zL6R7.js} +2 -2
  256. package/dist/assets/{toast-DqqWkjsh.js → toast-CHtrY-GO.js} +1 -1
  257. package/dist/assets/{tool-detail-panel-C2wUYsf2.js → tool-detail-panel-_LC-zFuo.js} +3 -3
  258. package/dist/assets/transcript-message-body-shared-D8cmJP1C.js +1 -0
  259. package/dist/assets/{trust-rules-api-DRJ1qP-y.js → trust-rules-api-CE_KJOp2.js} +1 -1
  260. package/dist/assets/upgrade-cancel-page-DyLSvLsm.js +1 -0
  261. package/dist/assets/upgrade-success-page-BRPyFCq4.js +1 -0
  262. package/dist/assets/upload-Bilfs1g8.js +1 -0
  263. package/dist/assets/{usage-redirect-page-DyTnwv4x.js → usage-redirect-page-C4O5a5QM.js} +1 -1
  264. package/dist/assets/{use-active-assistant-id-BADYKVyx.js → use-active-assistant-id-BFE4r9Rp.js} +1 -1
  265. package/dist/assets/use-app-theme-BMyUWfBR.js +1 -0
  266. package/dist/assets/use-assistant-avatar-adekIS8v.js +1 -0
  267. package/dist/assets/{use-assistant-capability-C-yHcMH4.js → use-assistant-capability-Cjd57j4I.js} +1 -1
  268. package/dist/assets/{use-assistant-identity-details-u9sG9ip2.js → use-assistant-identity-details-C3sH1daz.js} +1 -1
  269. package/dist/assets/{use-attachment-preview-Cq_IWTdT.js → use-attachment-preview-BUJ9CHqr.js} +2 -2
  270. package/dist/assets/{use-attachment-squares-BKi30wmg.js → use-attachment-squares-CFAezuph.js} +1 -1
  271. package/dist/assets/use-bookmarks--Hn0Ty3s.js +1 -0
  272. package/dist/assets/{use-bundled-avatar-components-C_6xUsW1.js → use-bundled-avatar-components-Bhvvz-bQ.js} +2 -2
  273. package/dist/assets/{use-bus-subscription-BuhDYgS1.js → use-bus-subscription-BmtCG3i6.js} +1 -1
  274. package/dist/assets/use-checkout-dismiss-refresh-CTdb-p9h.js +1 -0
  275. package/dist/assets/{use-command-palette-sections-CvNjev8s.js → use-command-palette-sections-_F3pQkoi.js} +1 -1
  276. package/dist/assets/{use-copy-to-clipboard-B7Yrgm0s.js → use-copy-to-clipboard-BPX7B4SE.js} +1 -1
  277. package/dist/assets/use-edge-swipe-CJYjm94h.js +1 -0
  278. package/dist/assets/use-edge-swipe-back-L6kJ84LI.js +2 -0
  279. package/dist/assets/use-edit-app-C0wNLJT8.js +1 -0
  280. package/dist/assets/{use-effective-timezone-vox0__xI.js → use-effective-timezone-DaNOF607.js} +1 -1
  281. package/dist/assets/use-hotkey-recorder-BgB8ju9u.js +1 -0
  282. package/dist/assets/{use-invite-link-dialog-Chhnymz9.js → use-invite-link-dialog-B1oz9iwD.js} +1 -1
  283. package/dist/assets/use-is-mobile-BwSS15lq.js +1 -0
  284. package/dist/assets/{use-is-org-ready-GDBxqujc.js → use-is-org-ready-CEB5IRpO.js} +1 -1
  285. package/dist/assets/use-local-file-info-y_wvTOqp.js +1 -0
  286. package/dist/assets/{use-onboarding-login-BdVTfZ3o.js → use-onboarding-login-DSP8WCFe.js} +1 -1
  287. package/dist/assets/{use-platform-assistant-id-B7TrEBmf.js → use-platform-assistant-id-n0Yl5uUG.js} +1 -1
  288. package/dist/assets/{use-platform-gate-DG9Xg3Hs.js → use-platform-gate-DNfLk9Xd.js} +1 -1
  289. package/dist/assets/{use-reduced-motion-CU3dPXKf.js → use-reduced-motion-DzXyVFAi.js} +1 -1
  290. package/dist/assets/{use-return-to-short-circuit-EtY8cSC7.js → use-return-to-short-circuit-CY3AuCF9.js} +1 -1
  291. package/dist/assets/use-save-twilio-credentials-BWaLXE4J.js +1 -0
  292. package/dist/assets/use-side-list-room-CO7nxluQ.js +1 -0
  293. package/dist/assets/{use-skill-actions-CdbZjq6a.js → use-skill-actions-D7CK9Jhy.js} +1 -1
  294. package/dist/assets/{use-skill-detail-files-Bg4G44J3.js → use-skill-detail-files-Cop9LnVd.js} +1 -1
  295. package/dist/assets/use-sticky-profiles-D3ybBRfX.js +1 -0
  296. package/dist/assets/{use-stt-language-selection-CK6bUfVS.js → use-stt-language-selection-Dkm4Uq69.js} +1 -1
  297. package/dist/assets/{use-subagent-card-data-DlVOBxXw.js → use-subagent-card-data-DbKFX1Jc.js} +1 -1
  298. package/dist/assets/{use-supports-bookmarks-B4cgbKXV.js → use-supports-bookmarks-stTgDlyW.js} +1 -1
  299. package/dist/assets/use-supports-credentials-settings-DK8TsliJ.js +1 -0
  300. package/dist/assets/use-supports-inference-profiles-C0dU3VLS.js +1 -0
  301. package/dist/assets/use-swipe-horizontal-BwZ0yvoM.js +1 -0
  302. package/dist/assets/use-touch-mobile-CaIiM-us.js +1 -0
  303. package/dist/assets/use-transcript-message-by-id-BbJqGOYZ.js +1 -0
  304. package/dist/assets/use-transcript-messages-Bp4Jsfks.js +3 -0
  305. package/dist/assets/{use-voice-sample-preview-CZoWWEeH.js → use-voice-sample-preview-4vpwPGNW.js} +1 -1
  306. package/dist/assets/{useTranslation-D9pPv-bA.js → useTranslation-CCDbxnME.js} +1 -1
  307. package/dist/assets/{utils-BEkyAhbA.js → utils-wDLoxcBZ.js} +1 -1
  308. package/dist/assets/viewer-store-BbaMH35y.js +1 -0
  309. package/dist/assets/voice-page--99ik4mV.js +1 -0
  310. package/dist/assets/voice-providers-note-7m0LvxmN.js +1 -0
  311. package/dist/assets/{weather-forecast-display-D3IBgGHv.js → weather-forecast-display-BbD0N8C0.js} +1 -1
  312. package/dist/assets/{web-CxX3pST-.js → web-Do_X9zWq.js} +1 -1
  313. package/dist/assets/{web-D1mJSG8v.js → web-UN0kX9ic.js} +1 -1
  314. package/dist/assets/welcome-screen-Drdb1oS6.js +1 -0
  315. package/dist/assets/{workflow-detail-panel-C0kN-iH3.js → workflow-detail-panel-DS9_MRNg.js} +1 -1
  316. package/dist/assets/{workflow-store-BXqyb8CL.js → workflow-store-BYbfirJj.js} +1 -1
  317. package/dist/assets/workspace-page-CPDwYVlW.js +1 -0
  318. package/dist/assets/{workspace-tree-query-Dyls8wmV.js → workspace-tree-query-DzYz0-QE.js} +1 -1
  319. package/dist/index.html +284 -280
  320. package/package.json +1 -1
  321. package/dist/assets/access-D0krXly2.js +0 -1
  322. package/dist/assets/activity-steps-panel-C9z9FMmK.js +0 -1
  323. package/dist/assets/add-credits-modal-RIAYgbOT.js +0 -1
  324. package/dist/assets/ai-page-CI4LZXTY.js +0 -1
  325. package/dist/assets/api-BjYAXdCk.js +0 -1
  326. package/dist/assets/api-Cx3i50oG.js +0 -1
  327. package/dist/assets/api-key-screen-BKFAcyqU.js +0 -1
  328. package/dist/assets/auth-store-CVtcHK0b.js +0 -2
  329. package/dist/assets/auth-welcome-screen-Pw3qXxi5.js +0 -1
  330. package/dist/assets/billing-page-CmVjD4bw.js +0 -3
  331. package/dist/assets/bookmarks-page-DUbnEAgS.js +0 -1
  332. package/dist/assets/chat-1xy90pMn.js +0 -3
  333. package/dist/assets/chat-CHVUM3s0.js +0 -1
  334. package/dist/assets/chat-markdown-message-CtLdsT2K.js +0 -1
  335. package/dist/assets/checkout-continuation-BvY4Kjz7.js +0 -1
  336. package/dist/assets/checkout-page-CWRkiEj1.js +0 -1
  337. package/dist/assets/checkout-return-target-_Y86sfo0.js +0 -1
  338. package/dist/assets/common-EmSgsWNa.js +0 -1
  339. package/dist/assets/community-page-Dd84pjdI.js +0 -1
  340. package/dist/assets/companion-surface-page-BvDSOFVH.js +0 -1
  341. package/dist/assets/composer-settings-DBAb6W2i.js +0 -1
  342. package/dist/assets/conversation-cache-qk0nNm6Q.js +0 -1
  343. package/dist/assets/conversation-navigation-B_4jZ9Z2.js +0 -1
  344. package/dist/assets/conversation-queries-M4Inozp_.js +0 -1
  345. package/dist/assets/credentials-page-C-e4DqWt.js +0 -1
  346. package/dist/assets/debug-page-Be5Y5TVM.js +0 -4
  347. package/dist/assets/developer-page-DD8xa8mQ.js +0 -1
  348. package/dist/assets/dictation-overlay-page-DZiwww1V.js +0 -1
  349. package/dist/assets/dist-DMYOKN8y.js +0 -1
  350. package/dist/assets/document-viewer-page-tTTco75r.js +0 -1
  351. package/dist/assets/effective-timezone-CHJnU8kZ.js +0 -1
  352. package/dist/assets/esm-CtKndoc9.js +0 -2
  353. package/dist/assets/feature-flag-catalog-Cyqf6Ns7.js +0 -1
  354. package/dist/assets/feed-item-status-actions--CCeCtuw.js +0 -1
  355. package/dist/assets/format-usd-tespTIex.js +0 -1
  356. package/dist/assets/general-page-Bi87XguF.js +0 -1
  357. package/dist/assets/hatching-screen-DA0yyXD1.js +0 -1
  358. package/dist/assets/hosting-screen-cfhZ-ct7.js +0 -1
  359. package/dist/assets/identity-CqCxB9QW.js +0 -1
  360. package/dist/assets/identity-page-route-BjSsi8PM.js +0 -7
  361. package/dist/assets/index-BmDctEOW.css +0 -2
  362. package/dist/assets/index-I9kwAKzY.js +0 -11
  363. package/dist/assets/integrations-page-zrUmh2xn.js +0 -1
  364. package/dist/assets/intelligence-DXpXyKbw.js +0 -5
  365. package/dist/assets/keyboard-shortcuts-redirect-page-DSnux9sJ.js +0 -1
  366. package/dist/assets/library-CuKVNDEp.js +0 -1
  367. package/dist/assets/local-mode-BNr2MrWI.js +0 -39
  368. package/dist/assets/media-preview-HgLvcAQ9.js +0 -1
  369. package/dist/assets/memory-router-playground-page-Bnxf4hzQ.js +0 -1
  370. package/dist/assets/message-content-weXJNNKO.js +0 -1
  371. package/dist/assets/messages-CPTfRZA4.js +0 -13
  372. package/dist/assets/multi-activity-group-AECQlBbV.js +0 -1
  373. package/dist/assets/native-anchor-Bn22ZLay.js +0 -1
  374. package/dist/assets/native-biometric-D9IxNvJM.js +0 -6
  375. package/dist/assets/navigation-resolver-jIQ5B6JB.js +0 -1
  376. package/dist/assets/notifications-page-GRXZE_lL.js +0 -1
  377. package/dist/assets/onboarding-DK0I_g8T.js +0 -1
  378. package/dist/assets/onboarding-layout-GTzgLPSo.js +0 -1
  379. package/dist/assets/open-workspace-file-CYf_Tqw3.js +0 -2
  380. package/dist/assets/pdf-file-preview-udA0Apx_.js +0 -1
  381. package/dist/assets/pdf-preview-6Xfl1tO1.js +0 -2
  382. package/dist/assets/plans-page-DkVXE0Jv.js +0 -1
  383. package/dist/assets/plugins-surface-C4Cvus3n.js +0 -1
  384. package/dist/assets/pointer-BMK9brNn.js +0 -1
  385. package/dist/assets/popover-D3A6cIyW.js +0 -1
  386. package/dist/assets/privacy-page-BxJ2Cuev.js +0 -1
  387. package/dist/assets/privacy-screen-DlSj_9FT.js +0 -1
  388. package/dist/assets/profile-pickers-B0hfDNt-.js +0 -1
  389. package/dist/assets/react-query.gen-Bbh5MII3.js +0 -1
  390. package/dist/assets/react-query.gen-CwRPAiHT.js +0 -1
  391. package/dist/assets/remote-gateway-session-CzPLaXuT.js +0 -1
  392. package/dist/assets/remove-from-device-dialog-DeJ_gAmf.js +0 -1
  393. package/dist/assets/research-onboarding-route-BY3X_d2-.js +0 -50
  394. package/dist/assets/retire-confirm-dialog-f-A5OVYj.js +0 -1
  395. package/dist/assets/routes-B7wRw3UT.js +0 -1
  396. package/dist/assets/routes-OwGjl0BS.js +0 -24
  397. package/dist/assets/runtime-upgrade-banner-Cj9E7kWP.js +0 -2
  398. package/dist/assets/schedules-C3wE8OML.js +0 -1
  399. package/dist/assets/section-membership-vg-XaMPS.js +0 -1
  400. package/dist/assets/select-assistant-screen-BZxPQqe4.js +0 -1
  401. package/dist/assets/settings-CEQzAg2m.js +0 -1
  402. package/dist/assets/settings-layout-DgNBNUT7.js +0 -1
  403. package/dist/assets/settings-navigation-CVw10LL_.js +0 -1
  404. package/dist/assets/sound-manager-lHaiHTCh.js +0 -1
  405. package/dist/assets/sounds-page-BdSO1UIf.js +0 -1
  406. package/dist/assets/start-screen-CHO19RCi.js +0 -1
  407. package/dist/assets/upgrade-cancel-page-Dbd3VJdm.js +0 -1
  408. package/dist/assets/upgrade-success-page-CHbEmpjg.js +0 -1
  409. package/dist/assets/upload-DwkuEWSz.js +0 -1
  410. package/dist/assets/use-app-theme-Z0l8oiAF.js +0 -1
  411. package/dist/assets/use-assistant-avatar-rPqMHOma.js +0 -1
  412. package/dist/assets/use-bookmarks-Bl4tx8xK.js +0 -1
  413. package/dist/assets/use-checkout-dismiss-refresh-BHuxVDUc.js +0 -1
  414. package/dist/assets/use-edge-swipe-C4IrskOL.js +0 -1
  415. package/dist/assets/use-edge-swipe-back-CiO9raEw.js +0 -2
  416. package/dist/assets/use-edit-app-ByAfCYIL.js +0 -1
  417. package/dist/assets/use-is-mobile-q9Lr7beO.js +0 -1
  418. package/dist/assets/use-local-file-info-DxY8jZ8F.js +0 -1
  419. package/dist/assets/use-save-twilio-credentials-Bs9sThtb.js +0 -1
  420. package/dist/assets/use-side-list-room-CUXPQyjw.js +0 -1
  421. package/dist/assets/use-sticky-profiles-vQLFyEh0.js +0 -1
  422. package/dist/assets/use-supports-credentials-settings-Cj-Py42f.js +0 -1
  423. package/dist/assets/use-swipe-engine-b1fkDAV8.js +0 -1
  424. package/dist/assets/use-touch-mobile-CnqGLpCj.js +0 -1
  425. package/dist/assets/use-transcript-message-by-id-FmIIrRsf.js +0 -1
  426. package/dist/assets/use-transcript-messages-Q1PBxvSF.js +0 -3
  427. package/dist/assets/viewer-store-CwlLnf-k.js +0 -1
  428. package/dist/assets/voice-page-B1mJ2hkc.js +0 -1
  429. package/dist/assets/voice-providers-note-TDQxSwUj.js +0 -1
  430. package/dist/assets/welcome-screen-DPXQU47t.js +0 -1
  431. package/dist/assets/workspace-page-Mj_A1eeR.js +0 -1
  432. /package/dist/assets/{account-DEWe1CJv.js → account-BuiU7DuB.js} +0 -0
  433. /package/dist/assets/{android-consumption-only-4ku7vpy4.js → android-consumption-only-DDbN5hxd.js} +0 -0
  434. /package/dist/assets/{app-types-DET4dder.js → app-types-Dslgu6TG.js} +0 -0
  435. /package/dist/assets/{apple-logo-C_J-Nv61.js → apple-logo-DE1DXFS4.js} +0 -0
  436. /package/dist/assets/{assistant-identity-store-DhAqaifK.js → assistant-identity-store-DrQJhZh3.js} +0 -0
  437. /package/dist/assets/{avatar-bundled-components-C8vOxkFj.js → avatar-bundled-components-CAE0CJ9e.js} +0 -0
  438. /package/dist/assets/{avatar-subagent-BnaYyPQQ.js → avatar-subagent-pDrk_xWL.js} +0 -0
  439. /package/dist/assets/{avatar-svg-compositor-e_lhkR9P.js → avatar-svg-compositor-tf4h3-SV.js} +0 -0
  440. /package/dist/assets/{avatar-tone-BVUtTeGn.js → avatar-tone-Dp4coAkE.js} +0 -0
  441. /package/dist/assets/{browser-timezone-BOrwtFs2.js → browser-timezone-DYYSCLn2.js} +0 -0
  442. /package/dist/assets/{build.umd-CwkQd6wk.js → build.umd-CpV9Yjhm.js} +0 -0
  443. /package/dist/assets/{by-tool-use-id-index-C1T3QA5-.js → by-tool-use-id-index-BP1pAJzI.js} +0 -0
  444. /package/dist/assets/{calendar-5ZUL5438.js → calendar-DUfSq9XY.js} +0 -0
  445. /package/dist/assets/{channels-CXuBInAc.js → channels-DFBLDFWh.js} +0 -0
  446. /package/dist/assets/{chart-column-Bd2tG_o1.js → chart-column-nt6xAz18.js} +0 -0
  447. /package/dist/assets/{chat-layout-slots-store-CE2p0OE9.js → chat-layout-slots-store-c4ig5vXx.js} +0 -0
  448. /package/dist/assets/{check-pgeLaeXx.js → check-NGUguBHp.js} +0 -0
  449. /package/dist/assets/{chevron-down-CmQCCo_x.js → chevron-down-D1ho6wFA.js} +0 -0
  450. /package/dist/assets/{chevron-left-02Er54z-.js → chevron-left-D29BeQ4x.js} +0 -0
  451. /package/dist/assets/{chevron-right-Dwr_Sx98.js → chevron-right-DTpkwA4e.js} +0 -0
  452. /package/dist/assets/{chevron-up-DHhqG14M.js → chevron-up-bJ8SGTC_.js} +0 -0
  453. /package/dist/assets/{circle-alert-DvkPmyIg.js → circle-alert-B-Zu9T9V.js} +0 -0
  454. /package/dist/assets/{circle-check-BlOeCme9.js → circle-check-BQyrCkaB.js} +0 -0
  455. /package/dist/assets/{circle-check-big-BDMPSnMn.js → circle-check-big-C9sLhbGa.js} +0 -0
  456. /package/dist/assets/{circle-minus-B5yKBO54.js → circle-minus-DgUiTTwX.js} +0 -0
  457. /package/dist/assets/{circle-x-CEXUbdoO.js → circle-x-qsWcnNwx.js} +0 -0
  458. /package/dist/assets/{client.gen-CxTOBLiH.js → client.gen-C1nf2AIs.js} +0 -0
  459. /package/dist/assets/{clipboard-copy-CEczonMF.js → clipboard-copy-D6VpELQ4.js} +0 -0
  460. /package/dist/assets/{clock-1REtpnlM.js → clock-CNSYP9nm.js} +0 -0
  461. /package/dist/assets/{cloud-dqL-JBKK.js → cloud-ByHaCF-x.js} +0 -0
  462. /package/dist/assets/{cloud-off-CB9uhEDu.js → cloud-off-DioliYf9.js} +0 -0
  463. /package/dist/assets/{code-u4Wi5zSA.js → code-B7TA1KYq.js} +0 -0
  464. /package/dist/assets/{coins-CveNnhLe.js → coins-WH-N-3B8.js} +0 -0
  465. /package/dist/assets/{consent-mbj_kMXO.js → consent-DgQeejGe.js} +0 -0
  466. /package/dist/assets/{contacts-BRU7ohw2.js → contacts-BQcl-1XL.js} +0 -0
  467. /package/dist/assets/{conversation-store-DKBwV4bc.js → conversation-store-DdBAApt6.js} +0 -0
  468. /package/dist/assets/{cpu-BG0rQrMj.js → cpu-CNmn352B.js} +0 -0
  469. /package/dist/assets/{credential-requests-BbBZKJHx.js → credential-requests-CpHxMIMS.js} +0 -0
  470. /package/dist/assets/{definitions-Co0yLSy_.js → definitions-BRiVhEtI.js} +0 -0
  471. /package/dist/assets/{definitions-Yz8Uao4u.js → definitions-I6-Jh5-j.js} +0 -0
  472. /package/dist/assets/{diff-rows-BrFK496i.js → diff-rows-BVvdLrrS.js} +0 -0
  473. /package/dist/assets/{download-DnnvWjPo.js → download-C7_XK23s.js} +0 -0
  474. /package/dist/assets/{edge-swipe-arbiter-store-BGBvaPTd.js → edge-swipe-arbiter-store-Cgt2wsOY.js} +0 -0
  475. /package/dist/assets/{edit-chat-session-CiXnUJPh.js → edit-chat-session-BUx2LvCf.js} +0 -0
  476. /package/dist/assets/{ellipsis-4L6z7PhT.js → ellipsis-DLgXzWgN.js} +0 -0
  477. /package/dist/assets/{ellipsis-vertical-CJX4FZlb.js → ellipsis-vertical-D3SJdQ4P.js} +0 -0
  478. /package/dist/assets/{emoji-catalog-data-BIIBfSqk.js → emoji-catalog-data-DXFYOvKt.js} +0 -0
  479. /package/dist/assets/{environment-store-C4So_j-o.js → environment-store-rZ0hkMHt.js} +0 -0
  480. /package/dist/assets/{esm-CPFvOH-c.js → esm-Cz8_Dotd.js} +0 -0
  481. /package/dist/assets/{esm-BJhqsukI.js → esm-DBGqhIh5.js} +0 -0
  482. /package/dist/assets/{event-bus-B-wwSVzo.js → event-bus-QJe_MFOc.js} +0 -0
  483. /package/dist/assets/{external-link-B-pfCiUo.js → external-link-DCA91uI6.js} +0 -0
  484. /package/dist/assets/{external-urls-Bg18AU4S.js → external-urls-DWYQKJEq.js} +0 -0
  485. /package/dist/assets/{eye-CHlTF_ct.js → eye-C5DUd2Vd.js} +0 -0
  486. /package/dist/assets/{eye-off-0lRvXR9p.js → eye-off-8cYeidA6.js} +0 -0
  487. /package/dist/assets/{file-DVQXh8CW.js → file-BgKbUJNS.js} +0 -0
  488. /package/dist/assets/{file-code-A080HCxh.js → file-code-CS8NbZbG.js} +0 -0
  489. /package/dist/assets/{file-plus-C_Iw4p49.js → file-plus-DLtgfqcS.js} +0 -0
  490. /package/dist/assets/{file-text-DpdlyCly.js → file-text-BEpL7wIA.js} +0 -0
  491. /package/dist/assets/{folder-B0UQA6jd.js → folder-6DGJLMuE.js} +0 -0
  492. /package/dist/assets/{folder-open-BU6EPS8G.js → folder-open-Cz-3FN-E.js} +0 -0
  493. /package/dist/assets/{format-date-B_oQDqU9.js → format-date-DEIFj6w3.js} +0 -0
  494. /package/dist/assets/{format-file-size-ByNX0dQR.js → format-file-size-CaQu4Lyo.js} +0 -0
  495. /package/dist/assets/{globe-COrlg99x.js → globe-BJuNFSn-.js} +0 -0
  496. /package/dist/assets/{hard-drive-BV9-fN_J.js → hard-drive-zWkzTs9d.js} +0 -0
  497. /package/dist/assets/{hard-navigate-CNxvVrtC.js → hard-navigate-D1rxKLPg.js} +0 -0
  498. /package/dist/assets/{heart-Bd-pnn1X.js → heart-DBsRPrRH.js} +0 -0
  499. /package/dist/assets/{home-BwSxL4rM.js → home-ySv5rBLy.js} +0 -0
  500. /package/dist/assets/{image-DsrjUDQh.js → image-DntHMHHo.js} +0 -0
  501. /package/dist/assets/{inbox-BcZU66Rf.js → inbox-Qye1DBie.js} +0 -0
  502. /package/dist/assets/{info-Bn2hbIVl.js → info-D0qquAkS.js} +0 -0
  503. /package/dist/assets/{interactive-target-CXv5tgJB.js → interactive-target-DT1VQruY.js} +0 -0
  504. /package/dist/assets/{is-electron-wgAC5Mzb.js → is-electron-C9-jl_HE.js} +0 -0
  505. /package/dist/assets/{key-round-C51ZTEMu.js → key-round-DcfNNfNG.js} +0 -0
  506. /package/dist/assets/{laptop-DoAUvmjX.js → laptop-C9BtnRjX.js} +0 -0
  507. /package/dist/assets/{layout-grid-lHmG2izK.js → layout-grid-CBeP_IMO.js} +0 -0
  508. /package/dist/assets/{lightbulb-moe9FubK.js → lightbulb-DIV0FA-e.js} +0 -0
  509. /package/dist/assets/{link-2-BBS4SmE3.js → link-2-CTrfUFQw.js} +0 -0
  510. /package/dist/assets/{link-V2w-GAhr.js → link-Dpgek1RH.js} +0 -0
  511. /package/dist/assets/{link-click-BsxbQxDe.js → link-click-DxspyBl6.js} +0 -0
  512. /package/dist/assets/{list-6yken9qv.js → list-Dn1NSBlc.js} +0 -0
  513. /package/dist/assets/{loader-circle-DYe85z3g.js → loader-circle-C9QjVTuc.js} +0 -0
  514. /package/dist/assets/{log-in-BsEhSW6v.js → log-in-DQ2oMzUv.js} +0 -0
  515. /package/dist/assets/{log-out-Dvz6dWwJ.js → log-out-nq6T7R9r.js} +0 -0
  516. /package/dist/assets/{logs-Blq4k473.js → logs-BsCB67bq.js} +0 -0
  517. /package/dist/assets/{machine-sizes-DzJ0TVYS.js → machine-sizes-Wnvi4rGR.js} +0 -0
  518. /package/dist/assets/{mail-9qQtaWSe.js → mail-BFnJM9hP.js} +0 -0
  519. /package/dist/assets/{message-circle-CQpMnPIR.js → message-circle-Cbwq_S7o.js} +0 -0
  520. /package/dist/assets/{message-square-ameAY_Gq.js → message-square-CENNR7tf.js} +0 -0
  521. /package/dist/assets/{message-square-text-C0iNfHuJ.js → message-square-text-Cnv84xQi.js} +0 -0
  522. /package/dist/assets/{mic-yJxjqdDR.js → mic-W9IfxqWv.js} +0 -0
  523. /package/dist/assets/{minimize-2-dhLse52Y.js → minimize-2-CcBLJXor.js} +0 -0
  524. /package/dist/assets/{misc-B24X-saO.js → misc-giJA2hbh.js} +0 -0
  525. /package/dist/assets/{monitor-BHYV5XBf.js → monitor-C7Po319a.js} +0 -0
  526. /package/dist/assets/{moon-CZZGDGLY.js → moon-D2HTb8zV.js} +0 -0
  527. /package/dist/assets/{oauth-connection-utils-19Tfw-lp.js → oauth-connection-utils-dPIUOXze.js} +0 -0
  528. /package/dist/assets/{oauth-popup-CrXEFWPi.js → oauth-popup-DIeDxfkO.js} +0 -0
  529. /package/dist/assets/{onboarding-navigation-C-Kk3_ll.js → onboarding-navigation-CUL0t0Am.js} +0 -0
  530. /package/dist/assets/{onboarding-step-layout-2G2ptxpI.js → onboarding-step-layout-00YhfBar.js} +0 -0
  531. /package/dist/assets/{optimistic-lifecycle-D1yMW3VK.js → optimistic-lifecycle-gXn1rGfw.js} +0 -0
  532. /package/dist/assets/{page-empty-state-CzHxZkBR.js → page-empty-state-CpkB0rZ_.js} +0 -0
  533. /package/dist/assets/{page-surface-store-DJLLsNFC.js → page-surface-store-BvbPgWRr.js} +0 -0
  534. /package/dist/assets/{paperclip-T-MRlqdF.js → paperclip-CF2Q8ys8.js} +0 -0
  535. /package/dist/assets/{pdf-UON6A_nT.js → pdf-BdZA1URW.js} +0 -0
  536. /package/dist/assets/{pencil-Ba0D7tjH.js → pencil-RFB2IyLT.js} +0 -0
  537. /package/dist/assets/{play-dZ2h3AT7.js → play-DTmq7Qfg.js} +0 -0
  538. /package/dist/assets/{plug-sTs_y01k.js → plug-CVzxWCFR.js} +0 -0
  539. /package/dist/assets/{plugin-attribution-C0u-eDRH.js → plugin-attribution-rEWhA-PP.js} +0 -0
  540. /package/dist/assets/{plus-CWkbiq1y.js → plus-BDSluxb4.js} +0 -0
  541. /package/dist/assets/{prechat-CHD2UKHx.js → prechat-CGdKFXs3.js} +0 -0
  542. /package/dist/assets/{preview-skeleton-Be9eHMn9.js → preview-skeleton-BStSegQN.js} +0 -0
  543. /package/dist/assets/{profile-metadata-D9zzZn4_.js → profile-metadata-B1fA1_W5.js} +0 -0
  544. /package/dist/assets/{public-asset-CNgVJ7i4.js → public-asset-Du947SLt.js} +0 -0
  545. /package/dist/assets/{puzzle-DHy-ePUL.js → puzzle-C5CgkzuA.js} +0 -0
  546. /package/dist/assets/{radio-card-nav-CrM7VJUk.js → radio-card-nav-hVd-im6E.js} +0 -0
  547. /package/dist/assets/{reduced-motion-D8oweJF_.js → reduced-motion-Cste44pe.js} +0 -0
  548. /package/dist/assets/{refresh-cw-p138DTtp.js → refresh-cw-DwfKxRXV.js} +0 -0
  549. /package/dist/assets/{remote-web-DBCYTF2P.js → remote-web-BX-aNmAz.js} +0 -0
  550. /package/dist/assets/{repeat-BL0WDPMw.js → repeat-ORyt0N0E.js} +0 -0
  551. /package/dist/assets/{rotate-ccw-Cs7aCSL9.js → rotate-ccw-Cc2yZNdm.js} +0 -0
  552. /package/dist/assets/{schedules-Co4-ymK5.js → schedules-BXXSRQs5.js} +0 -0
  553. /package/dist/assets/{sdk.gen-CoXhzo__.js → sdk.gen-bruWelSm.js} +0 -0
  554. /package/dist/assets/{search-D_t5oHhF.js → search-FGnzWjRX.js} +0 -0
  555. /package/dist/assets/{semver-C2-EZfiR.js → semver-D1eVfLWz.js} +0 -0
  556. /package/dist/assets/{send-Dwk9mFMC.js → send-CnqSHaqf.js} +0 -0
  557. /package/dist/assets/{setting-row-BvQpFvtr.js → setting-row-CqyX0EBz.js} +0 -0
  558. /package/dist/assets/{settings-B-74NxzZ.js → settings-CyYRtP_K.js} +0 -0
  559. /package/dist/assets/{shield-Sw65VSPa.js → shield-CKMzW_Un.js} +0 -0
  560. /package/dist/assets/{shield-check-B-3lr0Uj.js → shield-check-B5eUPC8R.js} +0 -0
  561. /package/dist/assets/{shim-CcP58yVZ.js → shim-BE9ID8Pw.js} +0 -0
  562. /package/dist/assets/{skill-icon-yVnZg-J1.js → skill-icon-CSLUbHBD.js} +0 -0
  563. /package/dist/assets/{sliders-horizontal-CQIT2VGH.js → sliders-horizontal-GQpDB0wo.js} +0 -0
  564. /package/dist/assets/{smartphone-AcA2Q0mQ.js → smartphone-CWnipfJ7.js} +0 -0
  565. /package/dist/assets/{sparkles-Bhr0JiLM.js → sparkles-DvB22tVW.js} +0 -0
  566. /package/dist/assets/{square-rBIWdRdF.js → square-CLyLyc89.js} +0 -0
  567. /package/dist/assets/{sun-BzqYfTxT.js → sun-sLCgv7zn.js} +0 -0
  568. /package/dist/assets/{surface-parse-helpers-X2hFvbHP.js → surface-parse-helpers-DrfM4_wl.js} +0 -0
  569. /package/dist/assets/{terminal-CttH6-2_.js → terminal-CIR8bWcg.js} +0 -0
  570. /package/dist/assets/{terminal-_tzbWcM4.js → terminal-Dily8RM4.js} +0 -0
  571. /package/dist/assets/{three-dot-indicator-CYYJ1RDJ.js → three-dot-indicator-BUucQBI1.js} +0 -0
  572. /package/dist/assets/{trash-2-V2WT_DbX.js → trash-2-DnajdgJS.js} +0 -0
  573. /package/dist/assets/{triangle-alert-43gIbLca.js → triangle-alert-B-18Pims.js} +0 -0
  574. /package/dist/assets/{use-body-scroll-lock-DmT5-Tka.js → use-body-scroll-lock-CMCNMYPC.js} +0 -0
  575. /package/dist/assets/{use-discord-nudge-C5OzjNEk.js → use-discord-nudge-B-qg81ow.js} +0 -0
  576. /package/dist/assets/{use-element-size-B_jzGsxt.js → use-element-size-Cgo4THI9.js} +0 -0
  577. /package/dist/assets/{use-media-query-oO6k9fDB.js → use-media-query-DSngkas0.js} +0 -0
  578. /package/dist/assets/{use-truncated-blob-text-BYAPiP8I.js → use-truncated-blob-text-DYvFk3Fv.js} +0 -0
  579. /package/dist/assets/{web-Cpz2h_dP.js → web-0-rqi4je.js} +0 -0
  580. /package/dist/assets/{web-CXad-fWd.js → web-8fcyoNsL.js} +0 -0
  581. /package/dist/assets/{web-B60tNeyj.js → web-DCamMnI1.js} +0 -0
  582. /package/dist/assets/{web-Nd-L7NoL.js → web-DIlEhBsT.js} +0 -0
  583. /package/dist/assets/{web-W2HEHjFb.js → web-DsVO-tkH.js} +0 -0
  584. /package/dist/assets/{web-Cr238HhI.js → web-aW1scjmM.js} +0 -0
  585. /package/dist/assets/{web-BSizndvP.js → web-eVpCzMlE.js} +0 -0
  586. /package/dist/assets/{workflow-status-CGIYm2p7.js → workflow-status-notSUy4k.js} +0 -0
  587. /package/dist/assets/{workspace-BFa6JWKe.js → workspace-Ch5zHBn1.js} +0 -0
  588. /package/dist/assets/{workspace-path-links-CWERAV56.js → workspace-path-links-BVdQi6RQ.js} +0 -0
  589. /package/dist/assets/{workspace-theme-tokens-CJpxBUQ3.js → workspace-theme-tokens-Dae42Dzg.js} +0 -0
  590. /package/dist/assets/{xterm-DFQikp5h.js → xterm-Ds08b1dp.js} +0 -0
  591. /package/dist/assets/{xterm-addon-fit-B04vX_IV.js → xterm-addon-fit-DAq2qzya.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{o as e,r as t,t as n}from"./chunk-jRWAZmH_.js";import{t as r}from"./react-BFJW0bSv.js";import{A as i,C as a,D as o,E as s,M as c,O as l,W as u,j as d,k as f,w as p}from"./button-VkxVX0DM.js";import{t as m}from"./jsx-runtime-BJ8jcmzB.js";import{t as h}from"./cn-Cf8SmgbR.js";import{t as g}from"./createLucideIcon-B-ZPaMbU.js";import{t as _}from"./code-u4Wi5zSA.js";import{t as v}from"./link-V2w-GAhr.js";import{t as y}from"./message-square-text-C0iNfHuJ.js";import"./src-CImIAPTd.js";import{t as b}from"./shim-CcP58yVZ.js";var ee=g(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),te=g(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),ne=g(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),x=e(r(),1),re=e(u(),1),S=m(),ie=b();function C(e){this.content=e}C.prototype={constructor:C,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new C(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new C(n)},addToStart:function(e,t){return new C([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new C(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new C(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=C.from(e),e.size?new C(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=C.from(e),e.size?new C(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=C.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},C.from=function(e){if(e instanceof C)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new C(t)};function ae(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&ce(e.charCodeAt(r-1))&&se(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=ae(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function oe(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&ce(e.charCodeAt(i-1))&&se(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=oe(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function se(e){return e>=56320&&e<57344}function ce(e){return e>=55296&&e<56320}var w=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ae(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return oe(this,e,t,n)}findIndex(e){if(e==0)return ue(0,e);if(e==this.size)return ue(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?ue(t+1,i):ue(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};w.empty=new w([],0);var le={index:0,offset:0};function ue(e,t){return le.index=e,le.offset=t,le}function de(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!de(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!de(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var T=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&de(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};T.none=[];var fe=class extends Error{},E=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=me(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(pe(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(w.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};E.empty=new E(w.empty,0,0);function pe(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(pe(a.content,t-i-1,n-i-1)))}function me(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=me(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function he(e,t,n){if(n.openStart>e.depth)throw new fe(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new fe(`Inconsistent open depths`);return ge(e,t,n,0)}function ge(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=ge(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return xe(a,Ce(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return xe(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=we(n,e);return xe(a,Se(e,i,o,t,r))}}function _e(e,t){if(!t.type.compatibleContent(e.type))throw new fe(`Cannot join `+t.type.name+` onto `+e.type.name)}function ve(e,t,n){let r=e.node(n);return _e(r,t.node(n)),r}function ye(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function be(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(ye(e.nodeAfter,r),a++));for(let e=a;e<o;e++)ye(i.child(e),r);t&&t.depth==n&&t.textOffset&&ye(t.nodeBefore,r)}function xe(e,t){if(!e.type.validContent(t))throw new fe(`Invalid content for node `+e.type.name);return e.copy(t)}function Se(e,t,n,r,i){let a=e.depth>i&&ve(e,t,i+1),o=r.depth>i&&ve(n,r,i+1),s=[];return be(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(_e(a,o),ye(xe(a,Se(e,t,n,r,i+1)),s)):(a&&ye(xe(a,Ce(e,t,i+1)),s),be(t,n,i,s),o&&ye(xe(o,Ce(n,r,i+1)),s)),be(r,null,i,s),new w(s)}function Ce(e,t,n){let r=[];return be(null,e,n,r),e.depth>n&&ye(xe(ve(e,t,n+1),Ce(e,t,n+1)),r),be(t,null,n,r),new w(r)}function we(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(w.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Te=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return T.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ke(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Oe.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Oe.set(t,r=new Ee);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%De,i}},Ee=class{constructor(){this.elts=[],this.i=0}},De=12,Oe=new WeakMap,ke=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Ae=Object.create(null),je=class e{constructor(e,t,n,r=T.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||w.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&de(this.attrs,t||e.defaultAttrs||Ae)&&T.sameSet(this.marks,n||T.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return E.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new E(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return he(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Te.resolveCached(this,e)}resolveNoCache(e){return Te.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ne(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=w.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=T.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!T.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=w.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};je.prototype.text=void 0;var Me=class e extends je{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ne(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ne(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Pe=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Fe(t,n);if(r.next==null)return e.empty;let i=Ie(r);r.next&&r.err(`Unexpected trailing text`);let a=Ke(Ue(i));return qe(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return w.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1
+ import{o as e,r as t,t as n}from"./chunk-jRWAZmH_.js";import{t as r}from"./react-BFJW0bSv.js";import{A as i,D as a,G as o,M as s,N as c,O as l,T as u,j as d,k as f,w as p}from"./button-C8CGr0T0.js";import{t as m}from"./jsx-runtime-BJ8jcmzB.js";import{t as h}from"./cn-Cf8SmgbR.js";import{t as g}from"./createLucideIcon-B-ZPaMbU.js";import{t as _}from"./code-B7TA1KYq.js";import{t as v}from"./link-Dpgek1RH.js";import{t as y}from"./message-square-text-Cnv84xQi.js";import"./src-DMnnfLrU.js";import{t as b}from"./shim-BE9ID8Pw.js";var ee=g(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),te=g(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),ne=g(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),x=e(r(),1),re=e(o(),1),S=m(),ie=b();function C(e){this.content=e}C.prototype={constructor:C,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new C(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new C(n)},addToStart:function(e,t){return new C([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new C(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new C(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=C.from(e),e.size?new C(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=C.from(e),e.size?new C(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=C.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},C.from=function(e){if(e instanceof C)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new C(t)};function ae(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&ce(e.charCodeAt(r-1))&&se(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=ae(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function oe(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&ce(e.charCodeAt(i-1))&&se(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=oe(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function se(e){return e>=56320&&e<57344}function ce(e){return e>=55296&&e<56320}var w=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ae(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return oe(this,e,t,n)}findIndex(e){if(e==0)return ue(0,e);if(e==this.size)return ue(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?ue(t+1,i):ue(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};w.empty=new w([],0);var le={index:0,offset:0};function ue(e,t){return le.index=e,le.offset=t,le}function de(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!de(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!de(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var T=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&de(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};T.none=[];var fe=class extends Error{},E=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=me(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(pe(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(w.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};E.empty=new E(w.empty,0,0);function pe(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(pe(a.content,t-i-1,n-i-1)))}function me(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=me(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function he(e,t,n){if(n.openStart>e.depth)throw new fe(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new fe(`Inconsistent open depths`);return ge(e,t,n,0)}function ge(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=ge(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return xe(a,Ce(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return xe(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=we(n,e);return xe(a,Se(e,i,o,t,r))}}function _e(e,t){if(!t.type.compatibleContent(e.type))throw new fe(`Cannot join `+t.type.name+` onto `+e.type.name)}function ve(e,t,n){let r=e.node(n);return _e(r,t.node(n)),r}function ye(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function be(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(ye(e.nodeAfter,r),a++));for(let e=a;e<o;e++)ye(i.child(e),r);t&&t.depth==n&&t.textOffset&&ye(t.nodeBefore,r)}function xe(e,t){if(!e.type.validContent(t))throw new fe(`Invalid content for node `+e.type.name);return e.copy(t)}function Se(e,t,n,r,i){let a=e.depth>i&&ve(e,t,i+1),o=r.depth>i&&ve(n,r,i+1),s=[];return be(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(_e(a,o),ye(xe(a,Se(e,t,n,r,i+1)),s)):(a&&ye(xe(a,Ce(e,t,i+1)),s),be(t,n,i,s),o&&ye(xe(o,Ce(n,r,i+1)),s)),be(r,null,i,s),new w(s)}function Ce(e,t,n){let r=[];return be(null,e,n,r),e.depth>n&&ye(xe(ve(e,t,n+1),Ce(e,t,n+1)),r),be(t,null,n,r),new w(r)}function we(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(w.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Te=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return T.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ke(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Oe.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Oe.set(t,r=new Ee);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%De,i}},Ee=class{constructor(){this.elts=[],this.i=0}},De=12,Oe=new WeakMap,ke=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Ae=Object.create(null),je=class e{constructor(e,t,n,r=T.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||w.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&de(this.attrs,t||e.defaultAttrs||Ae)&&T.sameSet(this.marks,n||T.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return E.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new E(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return he(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Te.resolveCached(this,e)}resolveNoCache(e){return Te.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ne(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=w.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=T.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!T.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=w.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};je.prototype.text=void 0;var Me=class e extends je{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ne(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ne(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Pe=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Fe(t,n);if(r.next==null)return e.empty;let i=Ie(r);r.next&&r.err(`Unexpected trailing text`);let a=Ke(Ue(i));return qe(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return w.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
2
  `)}};Pe.empty=new Pe(!0);var Fe=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Ie(e){let t=[];do t.push(Le(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Le(e){let t=[];do t.push(Re(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Re(e){let t=He(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Be(e,t);else break;return t}function ze(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Be(e,t){let n=ze(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:ze(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Ve(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function He(e){if(e.eat(`(`)){let t=Ie(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Ve(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Ue(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function We(e,t){return t-e}function Ge(e,t){let n=[];return r(t),n.sort(We);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Ke(e){let t=Object.create(null);return n(Ge(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Ge(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Pe(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(We);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function qe(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Je(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Ye(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Xe(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function Ze(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new et(e,r,t[r]);return n}var Qe=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Ze(e,n.attrs),this.defaultAttrs=Je(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Pe.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ye(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new je(this,this.computeAttrs(e),w.from(t),T.setFrom(n))}createChecked(e=null,t,n){return t=w.from(t),this.checkContent(t),new je(this,this.computeAttrs(e),t,T.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=w.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(w.empty,!0);return i?new je(this,e,t.append(i),T.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Xe(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:T.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function $e(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var et=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?$e(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},tt=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ze(e,r.attrs),this.excluded=null;let i=Je(this.attrs);this.instance=i?new T(this,i):null}create(e=null){return!e&&this.instance?this.instance:new T(this,Ye(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Xe(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},nt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=C.from(e.nodes),t.marks=C.from(e.marks||{}),this.nodes=Qe.compile(this.spec.nodes,this),this.marks=tt.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Pe.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?rt(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:rt(this,n.split(` `))}this.nodeFromJSON=e=>je.fromJSON(this,e),this.markFromJSON=e=>T.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Qe))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Me(n,n.defaultAttrs,e,T.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function rt(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function it(e){return e.tag!=null}function at(e){return e.style!=null}var ot=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(it(e))this.tags.push(e);else if(at(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ht(this,t,!1);return n.addAll(e,T.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ht(this,t,!0);return n.addAll(e,T.none,t.from,t.to),E.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(_t(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=vt(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=vt(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},st={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ct={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},lt={ol:!0,ul:!0},ut=1,dt=2,ft=4;function pt(e,t,n){return t==null?e&&e.whitespace==`pre`?ut|dt:n&~ft:(t?ut:0)|(t===`full`?dt:0)}var mt=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=T.none,this.match=i||(a&ft?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(w.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ut)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=w.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!st.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ht=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=pt(null,t.preserveWhitespace,0)|(n?ft:0);i=r?new mt(r.type,r.attrs,T.none,!0,t.topMatch||r.type.contentMatch,a):n?new mt(null,null,T.none,!0,null,a):new mt(e.schema.topNodeType,null,T.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&dt?`full`:this.localPreserveWS||(r.options&ut)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
3
3
  `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;lt.hasOwnProperty(a)&&this.parser.normalizeLists&&gt(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:ct.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(st.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=T.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):yt(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=pt(e,i,a.options);a.options&ft&&a.content.length==0&&(o|=ft);let s=T.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):yt(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new mt(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=ut);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function gt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&lt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function _t(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function vt(e){let t={};for(let n in e)t[n]=e[n];return t}function yt(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var bt=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=St(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return St(t).createTextNode(e.text);let{dom:n,contentDOM:r}=Et(St(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Et(St(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:Et(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=xt(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return xt(e.marks)}};function xt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function St(e){return e.document||window.document}var Ct=new WeakMap;function wt(e){let t=Ct.get(e);return t===void 0&&Ct.set(e,t=Tt(e)),t}function Tt(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function Et(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=wt(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=Et(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Dt=65535,Ot=2**16;function kt(e,t){return e+t*Ot}function At(e){return e&Dt}function jt(e){return(e-(e&Dt))/Ot}var Mt=1,Nt=2,Pt=4,Ft=8,It=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Ft)>0}get deletedBefore(){return(this.delInfo&(Mt|Pt))>0}get deletedAfter(){return(this.delInfo&(Nt|Pt))>0}get deletedAcross(){return(this.delInfo&Pt)>0}},Lt=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=At(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+jt(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:kt(o/3,e-s),f=e==s?Nt:e==u?Mt:Pt;return(t<0?e!=s:e!=u)&&(f|=Ft),new It(a,f,d)}r+=l-c}return n?e+r:new It(e+r,0,null)}touches(e,t){let n=0,r=At(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Lt.empty=new Lt([]);var Rt=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new It(e,r,null)}},zt=Object.create(null),Bt=class{getMap(){return Lt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=zt[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in zt)throw RangeError(`Duplicate use of step JSON ID `+e);return zt[e]=t,t.prototype.jsonID=e,t}},Vt=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof fe)return e.fail(t.message);throw t}}};function Ht(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ht(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return w.fromArray(r)}var Ut=class e extends Bt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new E(Ht(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Vt.fromReplace(e,this.from,this.to,i)}invert(){return new Wt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Bt.jsonID(`addMark`,Ut);var Wt=class e extends Bt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new E(Ht(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Vt.fromReplace(e,this.from,this.to,n)}invert(){return new Ut(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Bt.jsonID(`removeMark`,Wt);var Gt=class e extends Bt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Vt.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new E(w.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Kt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Bt.jsonID(`addNodeMark`,Gt);var Kt=class e extends Bt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Vt.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new E(w.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Gt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Bt.jsonID(`removeNodeMark`,Kt);var qt=class e extends Bt{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Yt(e,this.from,this.to)?Vt.fail(`Structure replace would overwrite content`):Vt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Lt([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?E.empty:new E(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?E.empty:new E(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,E.fromJSON(t,n.slice),!!n.structure)}};qt.MAP_BIAS=1,Bt.jsonID(`replace`,qt);var Jt=class e extends Bt{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Yt(e,this.from,this.gapFrom)||Yt(e,this.gapTo,this.to)))return Vt.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Vt.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Vt.fromReplace(e,this.from,this.to,n):Vt.fail(`Content does not fit in gap`)}getMap(){return new Lt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,E.fromJSON(t,n.slice),n.insert,!!n.structure)}};Bt.jsonID(`replaceAround`,Jt);function Yt(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Xt(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Wt(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Ut(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Zt(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof tt){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Wt(t.from,t.to,t.style)))}function Qt(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new qt(s,l,E.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Wt(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new E(w.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new qt(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(w.empty,!0);e.replace(s,s,new E(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function $t(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function en(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!$t(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function tn(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=w.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=w.from(r.node(e).copy(u)),d++):c--;let f=w.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=w.from(i.node(e).copy(f)),p++):l++;e.step(new Jt(c,l,o,s,new E(u.append(f),d,p),u.size-d,!0))}function nn(e,t,n=null,r=e){let i=an(e,t),a=i&&on(r,t);return a?i.map(rn).concat({type:t,attrs:n}).concat(a.map(rn)):null}function rn(e){return{type:e,attrs:null}}function an(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function on(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function sn(e,t,n){let r=w.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=w.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Jt(i,a,i,a,new E(r,0,0),n.length,!0))}function cn(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&dn(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&un(e,t,n,a),Qt(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Jt(c,l,c+1,l-1,new E(w.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&ln(e,t,n,a),!1}})}function ln(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function un(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
@@ -99,7 +99,7 @@ ${t.renderChildren(e.content||[],`
99
99
  `);s+=e.type===`paragraph`?`
100
100
 
101
101
  ${n}`:`
102
- ${n}`}}),s}function cf(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var V=class e extends xd{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function lf(e){return new wd({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=R(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Tu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:uf,getOwnPropertySymbols:df}=Object,{hasOwnProperty:ff}=Object.prototype;function pf(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function mf(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function hf(e){return e?.[Symbol.toStringTag]}function gf(e){return uf(e).concat(df(e))}var _f=Object.hasOwn||((e,t)=>ff.call(e,t));function vf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var yf=`__v`,bf=`__o`,xf=`_owner`,{getOwnPropertyDescriptor:Sf,keys:Cf}=Object;function wf(e,t){return e.byteLength===t.byteLength&&Lf(new Uint8Array(e),new Uint8Array(t))}function Tf(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Ef(e,t){return e.byteLength===t.byteLength&&Lf(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Df(e,t){return vf(e.getTime(),t.getTime())}function Of(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function kf(e,t){return e===t}function Af(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var jf=vf;function Mf(e,t,n){let r=Cf(e),i=r.length;if(Cf(t).length!==i)return!1;for(;i-- >0;)if(!zf(e,t,n,r[i]))return!1;return!0}function Nf(e,t,n){let r=gf(e),i=r.length;if(gf(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!zf(e,t,n,a)||(o=Sf(e,a),s=Sf(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Pf(e,t){return vf(e.valueOf(),t.valueOf())}function Ff(e,t){return e.source===t.source&&e.flags===t.flags}function If(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function Lf(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Rf(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function zf(e,t,n,r){return(r===xf||r===bf||r===yf)&&(e.$$typeof||t.$$typeof)?!0:_f(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Bf=`[object ArrayBuffer]`,Vf=`[object Arguments]`,Hf=`[object Boolean]`,Uf=`[object DataView]`,Wf=`[object Date]`,Gf=`[object Error]`,Kf=`[object Map]`,qf=`[object Number]`,Jf=`[object Object]`,Yf=`[object RegExp]`,Xf=`[object Set]`,Zf=`[object String]`,Qf={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},$f=`[object URL]`,ep=Object.prototype.toString;function tp({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=ep.call(h);if(b===Wf)return r(h,g,_);if(b===Yf)return u(h,g,_);if(b===Kf)return o(h,g,_);if(b===Xf)return d(h,g,_);if(b===Jf)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===$f)return p(h,g,_);if(b===Gf)return i(h,g,_);if(b===Vf)return c(h,g,_);if(Qf[b])return f(h,g,_);if(b===Bf)return e(h,g,_);if(b===Uf)return n(h,g,_);if(b===Hf||b===qf||b===Zf)return l(h,g,_);if(m){let e=m[b];if(!e){let t=hf(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function np({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:wf,areArraysEqual:n?Nf:Tf,areDataViewsEqual:Ef,areDatesEqual:Df,areErrorsEqual:Of,areFunctionsEqual:kf,areMapsEqual:n?pf(Af,Nf):Af,areNumbersEqual:jf,areObjectsEqual:n?Nf:Mf,arePrimitiveWrappersEqual:Pf,areRegExpsEqual:Ff,areSetsEqual:n?pf(If,Nf):If,areTypedArraysEqual:n?pf(Lf,Nf):Lf,areUrlsEqual:Rf,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=mf(r.areArraysEqual),t=mf(r.areMapsEqual),n=mf(r.areObjectsEqual),i=mf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function rp(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function ip({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var ap=op();op({strict:!0}),op({circular:!0}),op({circular:!0,strict:!0}),op({createInternalComparator:()=>vf}),op({strict:!0,createInternalComparator:()=>vf}),op({circular:!0,createInternalComparator:()=>vf}),op({circular:!0,createInternalComparator:()=>vf,strict:!0});function op(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=tp(np(e));return ip({circular:t,comparator:a,createState:r,equals:n?n(a):rp(a),strict:i})}var sp=n((e=>{var t=r(),n=b();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),cp=n(((e,t)=>{t.exports=sp()}))(),lp=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},up=({contentComponent:e})=>{let t=(0,ie.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,S.jsx)(S.Fragment,{children:Object.values(t)})};function dp(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:re.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var fp=class extends x.Component{constructor(e){super(e),this.editorContentRef=x.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=dp(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{ref:lp(t,this.editorContentRef),...n}),e?.contentComponent&&(0,S.jsx)(up,{contentComponent:e.contentComponent})]})}},pp=(0,x.forwardRef)((e,t)=>{let n=x.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return x.createElement(fp,{key:n,innerRef:t,...e})}),mp=x.memo(pp),hp=typeof window<`u`?x.useLayoutEffect:x.useEffect,gp=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function _p(e){let[t]=(0,x.useState)(()=>new gp(e.editor)),n=(0,cp.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??ap);return hp(()=>t.watch(e.editor),[e.editor,t]),(0,x.useDebugValue)(n),n}var vp=!1,yp=typeof window>`u`,bp=yp||!!(typeof window<`u`&&window.next),xp=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return yp?(t&&vp&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):bp&&e===void 0&&(t=!1,vp&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),t?this.createEditor():null}createEditor(){return new Kd({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Sp(e={},t=[]){let n=(0,x.useRef)(e);n.current=e;let[r]=(0,x.useState)(()=>new xp(n)),i=(0,ie.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,x.useDebugValue)(i),(0,x.useEffect)(r.onRender(t)),_p({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Cp=(0,x.createContext)({editor:null});Cp.Consumer;var wp=()=>(0,x.useContext)(Cp),Tp=(0,x.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ep=()=>(0,x.useContext)(Tp);x.forwardRef((e,t)=>{let{onDragStart:n}=Ep();return(0,S.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),x.createContext({markViewContentRef:()=>{}});var Dp=(0,x.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Dp.displayName=`TiptapContext`;var Op=()=>(0,x.useContext)(Dp);function kp({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,x.useMemo)(()=>({editor:r}),[r]),a=(0,x.useMemo)(()=>({editor:r}),[r]);return(0,S.jsx)(Cp.Provider,{value:a,children:(0,S.jsx)(Dp.Provider,{value:i,children:n})})}kp.displayName=`Tiptap`;function Ap({...e}){let{editor:t}=Op();return(0,S.jsx)(mp,{editor:t,...e})}Ap.displayName=`Tiptap.Content`,Object.assign(kp,{Content:Ap});var jp,Mp;if(typeof WeakMap<`u`){let e=new WeakMap;jp=t=>e.get(t),Mp=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;jp=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Mp=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var H=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw 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 RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return jp(e)||Mp(e,Np(e))}};function Np(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=Pp(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new H(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&Fp(s,o,e),s}function Pp(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function Fp(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=Ip(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function Ip(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Lp(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var Rp=new j(`selectingCells`);function zp(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 Bp(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function Vp(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function Hp(e){let 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;let n=zp(t.$head)||Up(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Up(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Wp(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Gp(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Kp(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function qp(e,t,n){let r=e.node(-1),i=H.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function Jp(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Yp(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Xp(e,t,n){let r=Lp(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var U=class e extends D{constructor(e,t=e){let n=e.node(-1),r=H.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Hn(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Wp(r)&&Wp(i)&&Kp(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return O.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=H.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=Jp(e,0,l)),u>0&&(e=Jp(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(w.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new E(w.from(o),1,1)}replace(e,t=E.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?E.empty:t)}let i=D.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new E(w.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=H.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=H.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=H.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=H.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Zp(this.$anchorCell.pos,this.$headCell.pos)}};U.prototype.visible=!1,D.jsonID(`cell`,U);var Zp=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Kp(t,n)?new U(t,n):D.near(n,1)}};function Qp(e){if(!(e.selection instanceof U))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(js.node(n,n+e.nodeSize,{class:`selectedCell`}))}),F.create(e.doc,t)}function $p({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function em({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function tm(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof k&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=U.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=U.rowSelection(e,e)}else if(!n){let e=H.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=U.create(i,t+1,n)}}else r instanceof O&&$p(r)?a=O.create(i,r.from):r instanceof O&&em(r)&&(a=O.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var nm=new j(`fix-tables`);function rm(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?rm(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function im(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=am(e,t,r,n))};return t?t.doc!=e.doc&&rm(t.doc,e.doc,0,r):e.doc.descendants(r),n}function am(e,t,n,r){let i=H.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,Jp(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=Lp(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(nm,{fixTables:!0})}function om(e){let t=e.selection,n=Hp(e),r=n.node(-1),i=n.start(-1),a=H.get(r);return{...t instanceof U?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function sm(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Xp(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Yp(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?Lp(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function cm(e,t){if(!Vp(e))return!1;if(t){let n=om(e);t(sm(e.tr,n,n.left))}return!0}function lm(e,t){if(!Vp(e))return!1;if(t){let n=om(e);t(sm(e.tr,n,n.right))}return!0}function um(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,Jp(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function dm(e,t){if(!Vp(e))return!1;if(t){let n=om(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;um(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=H.get(e)}t(r)}return!0}function fm(e,t,n){let r=Lp(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function pm(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;fm(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?Lp(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,Lp(r.type.schema).row.create(null,o)),e}function mm(e,t){if(!Vp(e))return!1;if(t){let n=om(e);t(pm(e.tr,n,n.top))}return!0}function hm(e,t){if(!Vp(e))return!1;if(t){let n=om(e);t(pm(e.tr,n,n.bottom))}return!0}function gm(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function _m(e,t){if(!Vp(e))return!1;if(t){let n=om(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;gm(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=H.get(n.table)}t(r)}return!0}function vm(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function ym({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function bm(e,t){let n=e.selection;if(!(n instanceof U)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=om(e),{map:i}=r;if(ym(i,r))return!1;if(t){let n=e.tr,a={},o=w.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{vm(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Yp(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=vm(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new U(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function xm(e,t){let n=Lp(e.schema);return Sm(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Sm(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof U){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Bp(r.$from),!i)return!1;a=zp(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=om(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof U&&u.setSelection(new U(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Cm(e,t){return function(n,r){if(!Vp(n))return!1;let i=Hp(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof U?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function wm(e){return function(t,n){if(!Vp(t))return!1;if(n){let r=Lp(t.schema),i=om(t),a=t.tr,o=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),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Tm(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function Em(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?wm(e):function(t,n){if(!Vp(t))return!1;if(n){let r=Lp(t.schema),i=om(t),a=t.tr,o=Tm(`row`,i,r),s=Tm(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}Em(`row`,{useDeprecatedLogic:!0}),Em(`column`,{useDeprecatedLogic:!0});var Dm=Em(`cell`,{useDeprecatedLogic:!0});function Om(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function km(e){return function(t,n){if(!Vp(t))return!1;let r=Om(Hp(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(O.between(e,Gp(e))).scrollIntoView())}return!0}}function Am(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function jm(e,t){let n=e.selection;if(!(n instanceof U))return!1;if(t){let r=e.tr,i=Lp(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new E(i,0,0))}),r.docChanged&&t(r)}return!0}function Mm(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=Pm(Lp(o).row,new E(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?Pm(Lp(o).row,new E(t,n,r)).content:t);else return null;return Nm(o,s)}function Nm(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(w.empty),n[i]<r){let a=Lp(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(w.from(o))}return{height:t.length,width:r,rows:t}}function Pm(e,t){let n=e.createAndFill();return new Bn(n).replace(0,n.content.size,t).doc}function Fm({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Jp(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(w.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(w.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Im(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=Lp(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,w.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function Lm(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function Rm(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,Jp(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Jp(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function zm(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=H.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=H.get(a),f=d.mapping.maps.length}Im(d,o,a,n,l,u,f)&&p(),Lm(d,o,a,n,c,l,s,f)&&p(),Lm(d,o,a,n,c,l,u,f)&&p(),Rm(d,o,a,n,s,u,c,f)&&p(),Rm(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new E(i.rows[e-s],0,0))}p(),d.setSelection(new U(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Bm=Nc({ArrowLeft:Hm(`horiz`,-1),ArrowRight:Hm(`horiz`,1),ArrowUp:Hm(`vert`,-1),ArrowDown:Hm(`vert`,1),"Shift-ArrowLeft":Um(`horiz`,-1),"Shift-ArrowRight":Um(`horiz`,1),"Shift-ArrowUp":Um(`vert`,-1),"Shift-ArrowDown":Um(`vert`,1),Backspace:jm,"Mod-Backspace":jm,Delete:jm,"Mod-Delete":jm});function Vm(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Hm(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof U)return Vm(n,r,D.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=qm(i,e,t);if(o==null)return!1;if(e==`horiz`)return Vm(n,r,D.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=qp(i,e,t),s;return s=a?D.near(a,1):t<0?D.near(n.doc.resolve(i.before(-1)),-1):D.near(n.doc.resolve(i.after(-1)),1),Vm(n,r,s)}}}function Um(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof U)o=a;else{let r=qm(i,e,t);if(r==null)return!1;o=new U(n.doc.resolve(r))}let s=qp(o.$headCell,e,t);return s?Vm(n,r,new U(o.$anchorCell,s)):!1}}function Wm(e,t){let n=e.state.doc,r=zp(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new U(r))),!0):!1}function Gm(e,t,n){if(!Vp(e.state))return!1;let r=Mm(n),i=e.state.selection;if(i instanceof U){r||={width:1,height:1,rows:[w.from(Pm(Lp(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=H.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Fm(r,o.right-o.left,o.bottom-o.top),zm(e.state,e.dispatch,a,o,r),!0}else if(r){let t=Hp(e.state),n=t.start(-1);return zm(e.state,e.dispatch,n,H.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function Km(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Jm(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof U)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=zp(e.state.selection.$anchor))!=null&&Ym(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=Ym(e,n),i=Rp.getState(e.state)==null;if(!r||!Kp(t,r))if(i)r=t;else return;let a=new U(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(Rp,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),Rp.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Rp,-1))}function o(r){let o=r,s=Rp.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Jm(e,o.target)!=n&&(c=Ym(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function qm(e,t,n){if(!(e.state.selection instanceof O))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function Jm(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function Ym(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&zp(e.state.doc.resolve(r))||zp(e.state.doc.resolve(i))}var Xm=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`)),Zm(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,Zm(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function Zm(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var Qm=new j(`tableColumnResizing`);function $m({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Xm,lastColumnResizable:i=!0}={}){let a=new A({key:Qm,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=Lp(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new eh(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=Qm.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{th(t,n,e,i)},mouseleave:e=>{nh(e)},mousedown:(e,r)=>{rh(e,r,t,n)}},decorations:e=>{let t=Qm.getState(e);if(t&&t.activeHandle>-1)return fh(e,t.activeHandle)},nodeViews:{}}});return a}var eh=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(Qm);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Wp(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function th(e,t,n,r){if(!e.editable)return;let i=Qm.getState(e.state);if(i&&!i.dragging){let a=ah(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=oh(e,t,`left`,n):i-t.clientX<=n&&(o=oh(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=H.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}ch(e,o)}}}function nh(e){if(!e.editable)return;let t=Qm.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&ch(e,-1)}function rh(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=Qm.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=ih(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(Qm,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=Qm.getState(e.state);r?.dragging&&(lh(e,r.activeHandle,sh(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Qm,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=Qm.getState(e.state);if(i&&i.dragging){let a=sh(i.dragging,t,n);uh(e,i.activeHandle,a,r)}}return uh(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function ih(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function ah(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function oh(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=zp(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=H.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function sh(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function ch(e,t){e.dispatch(e.state.tr.setMeta(Qm,{setHandle:t}))}function lh(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=H.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():dh(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function uh(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=H.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&Zm(a,c.firstChild,c,r,s,n)}function dh(e){return Array(e).fill(0)}function fh(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return F.empty;let a=H.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,Qm.getState(e)?.dragging&&n.push(js.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(js.widget(s,c))}}return F.create(e.doc,n)}function ph({allowTableNodeSelection:e=!1}={}){return new A({key:Rp,state:{init(){return null},apply(e,t){let n=e.getMeta(Rp);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Qp,handleDOMEvents:{mousedown:Km},createSelectionBetween(e){return Rp.getState(e.state)==null?null:e.state.selection},handleTripleClick:Wm,handleKeyDown:Bm,handlePaste:Gm},appendTransaction(t,n,r){return tm(r,im(r,n),e)}})}function mh(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var hh=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){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:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&al(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!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:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),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())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(o(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(d(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(i(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(a(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(c(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(p(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(l(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(f(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=Vu(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof k){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof U){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():mh(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&s(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||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(),!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){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,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()}},gh=e=>new A({key:typeof e.pluginKey==`string`?new j(e.pluginKey):e.pluginKey,view:t=>new hh({view:t,...e})});B.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[gh({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 _h=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!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=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`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=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),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())}getTextContent(e){return vu(e,{textSerializers:yu(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(o(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(d(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(i(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(a(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(c(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(p(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(l(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(f(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}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){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){if(!this.view?.dom?.parentNode)return;let{selection:e}=this.editor.state,t=Vu(this.view,e.from,e.to);s({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||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(),!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()}},vh=e=>new A({key:typeof e.pluginKey==`string`?new j(e.pluginKey):e.pluginKey,view:t=>new _h({view:t,...e})});B.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?[vh({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 yh(e,t){return e??new j(t)}var bh=typeof window<`u`?x.useLayoutEffect:x.useEffect,xh=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),Sh=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`.split(`.`)),Ch=new Set([`children`,`className`,`style`]),wh=new Set([`tabIndex`]),Th=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),Eh={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function Dh(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function Oh(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function kh(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||Th.has(e)}function Ah(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function jh(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:Eh[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function Mh(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function Nh(e){return wh.has(e)}function Ph(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function Fh(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function Ih(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||Sh.has(e)?String(t):`${t}px`}function Lh(e,t){xh.has(t)||e.style.removeProperty(Ah(t))}function Rh(e,t,n){xh.has(t)||e.style.setProperty(Ah(t),Ih(t,n))}function zh(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(Ch.has(r)||!kh(r)||Dh(r,t[r])||Dh(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=Oh(r);if(a==null||a===!1){Nh(r)&&Fh(e,r),e.removeAttribute(o);return}if(a===!0){Nh(r)&&Ph(e,r,!0),e.setAttribute(o,``);return}if(Nh(r)){Ph(e,r,a);return}e.setAttribute(o,String(a))})}function Bh(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function Vh(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){Lh(e,t);return}Rh(e,t,a)}})}function Hh(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!Dh(t,n))return;let{eventName:i,options:a}=jh(t),o=t=>{n(Mh(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function Uh(e,t){let n=(0,x.useRef)({}),r=(0,x.useRef)([]);bh(()=>{let i=n.current;return Bh(e,i.className,t.className),Vh(e,i.style,t.style),zh(e,i,t),r.current=Hh(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var Wh=x.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,x.useRef)(document.createElement(`div`)),f=(0,x.useRef)(yh(e,`bubbleMenu`)).current;Uh(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=wp(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,x.useRef)(h);g.current=h;let[_,v]=(0,x.useState)(!1),y=(0,x.useRef)(!0);return(0,x.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=gh({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,x.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,re.createPortal)(c,d.current)});x.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,x.useRef)(document.createElement(`div`)),d=(0,x.useRef)(yh(e,`floatingMenu`)).current;Uh(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=wp(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,x.useRef)(m);h.current=m;let[g,_]=(0,x.useState)(!1),v=(0,x.useRef)(!0);return(0,x.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=vh({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,x.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,re.createPortal)(s,u.current)});var Gh=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Kh=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,qh=`numeric`,Jh=`ascii`,Yh=`alpha`,Xh=`asciinumeric`,Zh=`alphanumeric`,Qh=`domain`,$h=`emoji`,eg=`scheme`,tg=`slashscheme`,ng=`whitespace`;function rg(e,t){return e in t||(t[e]=[]),t[e]}function ig(e,t,n){t[qh]&&(t[Xh]=!0,t[Zh]=!0),t[Jh]&&(t[Xh]=!0,t[Yh]=!0),t[Xh]&&(t[Zh]=!0),t[Yh]&&(t[Zh]=!0),t[Zh]&&(t[Qh]=!0),t[$h]&&(t[Qh]=!0);for(let r in t){let t=rg(r,n);t.indexOf(e)<0&&t.push(e)}}function ag(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function og(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}og.groups={},og.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=og.groups;let i;return t&&t.j?i=t:(i=new og(t),n&&r&&ig(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=og.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new og,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new og,a&&(r&&(o.t&&typeof o.t==`string`?ig(a,Object.assign(ag(o.t,r),n),r):n&&ig(a,n,r)),o.t=a),i.j[e]=o,o}};var W=(e,t,n,r,i)=>e.ta(t,n,r,i),G=(e,t,n,r,i)=>e.tr(t,n,r,i),sg=(e,t,n,r,i)=>e.ts(t,n,r,i),K=(e,t,n,r,i)=>e.tt(t,n,r,i),cg=`WORD`,lg=`UWORD`,ug=`ASCIINUMERICAL`,dg=`ALPHANUMERICAL`,fg=`LOCALHOST`,pg=`TLD`,mg=`UTLD`,hg=`SCHEME`,gg=`SLASH_SCHEME`,_g=`NUM`,vg=`WS`,yg=`NL`,bg=`OPENBRACE`,xg=`CLOSEBRACE`,Sg=`OPENBRACKET`,Cg=`CLOSEBRACKET`,wg=`OPENPAREN`,Tg=`CLOSEPAREN`,Eg=`OPENANGLEBRACKET`,Dg=`CLOSEANGLEBRACKET`,Og=`FULLWIDTHLEFTPAREN`,kg=`FULLWIDTHRIGHTPAREN`,Ag=`LEFTCORNERBRACKET`,jg=`RIGHTCORNERBRACKET`,Mg=`LEFTWHITECORNERBRACKET`,Ng=`RIGHTWHITECORNERBRACKET`,Pg=`FULLWIDTHLESSTHAN`,Fg=`FULLWIDTHGREATERTHAN`,Ig=`AMPERSAND`,Lg=`APOSTROPHE`,Rg=`ASTERISK`,zg=`AT`,Bg=`BACKSLASH`,Vg=`BACKTICK`,Hg=`CARET`,Ug=`COLON`,Wg=`COMMA`,Gg=`DOLLAR`,Kg=`DOT`,qg=`EQUALS`,Jg=`EXCLAMATION`,Yg=`HYPHEN`,Xg=`PERCENT`,Zg=`PIPE`,Qg=`PLUS`,$g=`POUND`,e_=`QUERY`,t_=`QUOTE`,n_=`FULLWIDTHMIDDLEDOT`,r_=`SEMI`,i_=`SLASH`,a_=`TILDE`,o_=`UNDERSCORE`,s_=`EMOJI`,c_=`SYM`,l_=Object.freeze({__proto__:null,ALPHANUMERICAL:dg,AMPERSAND:Ig,APOSTROPHE:Lg,ASCIINUMERICAL:ug,ASTERISK:Rg,AT:zg,BACKSLASH:Bg,BACKTICK:Vg,CARET:Hg,CLOSEANGLEBRACKET:Dg,CLOSEBRACE:xg,CLOSEBRACKET:Cg,CLOSEPAREN:Tg,COLON:Ug,COMMA:Wg,DOLLAR:Gg,DOT:Kg,EMOJI:s_,EQUALS:qg,EXCLAMATION:Jg,FULLWIDTHGREATERTHAN:Fg,FULLWIDTHLEFTPAREN:Og,FULLWIDTHLESSTHAN:Pg,FULLWIDTHMIDDLEDOT:n_,FULLWIDTHRIGHTPAREN:kg,HYPHEN:Yg,LEFTCORNERBRACKET:Ag,LEFTWHITECORNERBRACKET:Mg,LOCALHOST:fg,NL:yg,NUM:_g,OPENANGLEBRACKET:Eg,OPENBRACE:bg,OPENBRACKET:Sg,OPENPAREN:wg,PERCENT:Xg,PIPE:Zg,PLUS:Qg,POUND:$g,QUERY:e_,QUOTE:t_,RIGHTCORNERBRACKET:jg,RIGHTWHITECORNERBRACKET:Ng,SCHEME:hg,SEMI:r_,SLASH:i_,SLASH_SCHEME:gg,SYM:c_,TILDE:a_,TLD:pg,UNDERSCORE:o_,UTLD:mg,UWORD:lg,WORD:cg,WS:vg}),u_=/[a-z]/,d_=/\p{L}/u,f_=/\p{Emoji}/u,p_=/\d/,m_=/\s/,h_=`\r`,g_=`
102
+ ${n}`}}),s}function cf(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var V=class e extends xd{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function lf(e){return new wd({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=R(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Tu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:uf,getOwnPropertySymbols:df}=Object,{hasOwnProperty:ff}=Object.prototype;function pf(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function mf(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function hf(e){return e?.[Symbol.toStringTag]}function gf(e){return uf(e).concat(df(e))}var _f=Object.hasOwn||((e,t)=>ff.call(e,t));function vf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var yf=`__v`,bf=`__o`,xf=`_owner`,{getOwnPropertyDescriptor:Sf,keys:Cf}=Object;function wf(e,t){return e.byteLength===t.byteLength&&Lf(new Uint8Array(e),new Uint8Array(t))}function Tf(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Ef(e,t){return e.byteLength===t.byteLength&&Lf(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Df(e,t){return vf(e.getTime(),t.getTime())}function Of(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function kf(e,t){return e===t}function Af(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var jf=vf;function Mf(e,t,n){let r=Cf(e),i=r.length;if(Cf(t).length!==i)return!1;for(;i-- >0;)if(!zf(e,t,n,r[i]))return!1;return!0}function Nf(e,t,n){let r=gf(e),i=r.length;if(gf(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!zf(e,t,n,a)||(o=Sf(e,a),s=Sf(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Pf(e,t){return vf(e.valueOf(),t.valueOf())}function Ff(e,t){return e.source===t.source&&e.flags===t.flags}function If(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function Lf(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Rf(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function zf(e,t,n,r){return(r===xf||r===bf||r===yf)&&(e.$$typeof||t.$$typeof)?!0:_f(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Bf=`[object ArrayBuffer]`,Vf=`[object Arguments]`,Hf=`[object Boolean]`,Uf=`[object DataView]`,Wf=`[object Date]`,Gf=`[object Error]`,Kf=`[object Map]`,qf=`[object Number]`,Jf=`[object Object]`,Yf=`[object RegExp]`,Xf=`[object Set]`,Zf=`[object String]`,Qf={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},$f=`[object URL]`,ep=Object.prototype.toString;function tp({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=ep.call(h);if(b===Wf)return r(h,g,_);if(b===Yf)return u(h,g,_);if(b===Kf)return o(h,g,_);if(b===Xf)return d(h,g,_);if(b===Jf)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===$f)return p(h,g,_);if(b===Gf)return i(h,g,_);if(b===Vf)return c(h,g,_);if(Qf[b])return f(h,g,_);if(b===Bf)return e(h,g,_);if(b===Uf)return n(h,g,_);if(b===Hf||b===qf||b===Zf)return l(h,g,_);if(m){let e=m[b];if(!e){let t=hf(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function np({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:wf,areArraysEqual:n?Nf:Tf,areDataViewsEqual:Ef,areDatesEqual:Df,areErrorsEqual:Of,areFunctionsEqual:kf,areMapsEqual:n?pf(Af,Nf):Af,areNumbersEqual:jf,areObjectsEqual:n?Nf:Mf,arePrimitiveWrappersEqual:Pf,areRegExpsEqual:Ff,areSetsEqual:n?pf(If,Nf):If,areTypedArraysEqual:n?pf(Lf,Nf):Lf,areUrlsEqual:Rf,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=mf(r.areArraysEqual),t=mf(r.areMapsEqual),n=mf(r.areObjectsEqual),i=mf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function rp(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function ip({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var ap=op();op({strict:!0}),op({circular:!0}),op({circular:!0,strict:!0}),op({createInternalComparator:()=>vf}),op({strict:!0,createInternalComparator:()=>vf}),op({circular:!0,createInternalComparator:()=>vf}),op({circular:!0,createInternalComparator:()=>vf,strict:!0});function op(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=tp(np(e));return ip({circular:t,comparator:a,createState:r,equals:n?n(a):rp(a),strict:i})}var sp=n((e=>{var t=r(),n=b();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),cp=n(((e,t)=>{t.exports=sp()}))(),lp=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},up=({contentComponent:e})=>{let t=(0,ie.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,S.jsx)(S.Fragment,{children:Object.values(t)})};function dp(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:re.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var fp=class extends x.Component{constructor(e){super(e),this.editorContentRef=x.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=dp(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{ref:lp(t,this.editorContentRef),...n}),e?.contentComponent&&(0,S.jsx)(up,{contentComponent:e.contentComponent})]})}},pp=(0,x.forwardRef)((e,t)=>{let n=x.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return x.createElement(fp,{key:n,innerRef:t,...e})}),mp=x.memo(pp),hp=typeof window<`u`?x.useLayoutEffect:x.useEffect,gp=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function _p(e){let[t]=(0,x.useState)(()=>new gp(e.editor)),n=(0,cp.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??ap);return hp(()=>t.watch(e.editor),[e.editor,t]),(0,x.useDebugValue)(n),n}var vp=!1,yp=typeof window>`u`,bp=yp||!!(typeof window<`u`&&window.next),xp=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return yp?(t&&vp&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):bp&&e===void 0&&(t=!1,vp&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),t?this.createEditor():null}createEditor(){return new Kd({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Sp(e={},t=[]){let n=(0,x.useRef)(e);n.current=e;let[r]=(0,x.useState)(()=>new xp(n)),i=(0,ie.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,x.useDebugValue)(i),(0,x.useEffect)(r.onRender(t)),_p({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Cp=(0,x.createContext)({editor:null});Cp.Consumer;var wp=()=>(0,x.useContext)(Cp),Tp=(0,x.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ep=()=>(0,x.useContext)(Tp);x.forwardRef((e,t)=>{let{onDragStart:n}=Ep();return(0,S.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),x.createContext({markViewContentRef:()=>{}});var Dp=(0,x.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Dp.displayName=`TiptapContext`;var Op=()=>(0,x.useContext)(Dp);function kp({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,x.useMemo)(()=>({editor:r}),[r]),a=(0,x.useMemo)(()=>({editor:r}),[r]);return(0,S.jsx)(Cp.Provider,{value:a,children:(0,S.jsx)(Dp.Provider,{value:i,children:n})})}kp.displayName=`Tiptap`;function Ap({...e}){let{editor:t}=Op();return(0,S.jsx)(mp,{editor:t,...e})}Ap.displayName=`Tiptap.Content`,Object.assign(kp,{Content:Ap});var jp,Mp;if(typeof WeakMap<`u`){let e=new WeakMap;jp=t=>e.get(t),Mp=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;jp=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Mp=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var H=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw 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 RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return jp(e)||Mp(e,Np(e))}};function Np(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=Pp(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new H(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&Fp(s,o,e),s}function Pp(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function Fp(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=Ip(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function Ip(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Lp(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var Rp=new j(`selectingCells`);function zp(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 Bp(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function Vp(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function Hp(e){let 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;let n=zp(t.$head)||Up(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Up(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Wp(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Gp(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Kp(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function qp(e,t,n){let r=e.node(-1),i=H.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function Jp(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Yp(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Xp(e,t,n){let r=Lp(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var U=class e extends D{constructor(e,t=e){let n=e.node(-1),r=H.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Hn(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Wp(r)&&Wp(i)&&Kp(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return O.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=H.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=Jp(e,0,l)),u>0&&(e=Jp(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(w.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new E(w.from(o),1,1)}replace(e,t=E.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?E.empty:t)}let i=D.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new E(w.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=H.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=H.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=H.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=H.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Zp(this.$anchorCell.pos,this.$headCell.pos)}};U.prototype.visible=!1,D.jsonID(`cell`,U);var Zp=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Kp(t,n)?new U(t,n):D.near(n,1)}};function Qp(e){if(!(e.selection instanceof U))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(js.node(n,n+e.nodeSize,{class:`selectedCell`}))}),F.create(e.doc,t)}function $p({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function em({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function tm(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof k&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=U.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=U.rowSelection(e,e)}else if(!n){let e=H.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=U.create(i,t+1,n)}}else r instanceof O&&$p(r)?a=O.create(i,r.from):r instanceof O&&em(r)&&(a=O.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var nm=new j(`fix-tables`);function rm(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?rm(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function im(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=am(e,t,r,n))};return t?t.doc!=e.doc&&rm(t.doc,e.doc,0,r):e.doc.descendants(r),n}function am(e,t,n,r){let i=H.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,Jp(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=Lp(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(nm,{fixTables:!0})}function om(e){let t=e.selection,n=Hp(e),r=n.node(-1),i=n.start(-1),a=H.get(r);return{...t instanceof U?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function sm(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Xp(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Yp(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?Lp(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function cm(e,t){if(!Vp(e))return!1;if(t){let n=om(e);t(sm(e.tr,n,n.left))}return!0}function lm(e,t){if(!Vp(e))return!1;if(t){let n=om(e);t(sm(e.tr,n,n.right))}return!0}function um(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,Jp(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function dm(e,t){if(!Vp(e))return!1;if(t){let n=om(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;um(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=H.get(e)}t(r)}return!0}function fm(e,t,n){let r=Lp(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function pm(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;fm(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?Lp(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,Lp(r.type.schema).row.create(null,o)),e}function mm(e,t){if(!Vp(e))return!1;if(t){let n=om(e);t(pm(e.tr,n,n.top))}return!0}function hm(e,t){if(!Vp(e))return!1;if(t){let n=om(e);t(pm(e.tr,n,n.bottom))}return!0}function gm(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function _m(e,t){if(!Vp(e))return!1;if(t){let n=om(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;gm(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=H.get(n.table)}t(r)}return!0}function vm(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function ym({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function bm(e,t){let n=e.selection;if(!(n instanceof U)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=om(e),{map:i}=r;if(ym(i,r))return!1;if(t){let n=e.tr,a={},o=w.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{vm(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Yp(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=vm(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new U(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function xm(e,t){let n=Lp(e.schema);return Sm(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Sm(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof U){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Bp(r.$from),!i)return!1;a=zp(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=om(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof U&&u.setSelection(new U(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Cm(e,t){return function(n,r){if(!Vp(n))return!1;let i=Hp(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof U?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function wm(e){return function(t,n){if(!Vp(t))return!1;if(n){let r=Lp(t.schema),i=om(t),a=t.tr,o=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),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Tm(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function Em(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?wm(e):function(t,n){if(!Vp(t))return!1;if(n){let r=Lp(t.schema),i=om(t),a=t.tr,o=Tm(`row`,i,r),s=Tm(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}Em(`row`,{useDeprecatedLogic:!0}),Em(`column`,{useDeprecatedLogic:!0});var Dm=Em(`cell`,{useDeprecatedLogic:!0});function Om(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function km(e){return function(t,n){if(!Vp(t))return!1;let r=Om(Hp(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(O.between(e,Gp(e))).scrollIntoView())}return!0}}function Am(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function jm(e,t){let n=e.selection;if(!(n instanceof U))return!1;if(t){let r=e.tr,i=Lp(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new E(i,0,0))}),r.docChanged&&t(r)}return!0}function Mm(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=Pm(Lp(o).row,new E(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?Pm(Lp(o).row,new E(t,n,r)).content:t);else return null;return Nm(o,s)}function Nm(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(w.empty),n[i]<r){let a=Lp(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(w.from(o))}return{height:t.length,width:r,rows:t}}function Pm(e,t){let n=e.createAndFill();return new Bn(n).replace(0,n.content.size,t).doc}function Fm({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Jp(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(w.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(w.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Im(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=Lp(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,w.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function Lm(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function Rm(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,Jp(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Jp(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function zm(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=H.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=H.get(a),f=d.mapping.maps.length}Im(d,o,a,n,l,u,f)&&p(),Lm(d,o,a,n,c,l,s,f)&&p(),Lm(d,o,a,n,c,l,u,f)&&p(),Rm(d,o,a,n,s,u,c,f)&&p(),Rm(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new E(i.rows[e-s],0,0))}p(),d.setSelection(new U(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Bm=Nc({ArrowLeft:Hm(`horiz`,-1),ArrowRight:Hm(`horiz`,1),ArrowUp:Hm(`vert`,-1),ArrowDown:Hm(`vert`,1),"Shift-ArrowLeft":Um(`horiz`,-1),"Shift-ArrowRight":Um(`horiz`,1),"Shift-ArrowUp":Um(`vert`,-1),"Shift-ArrowDown":Um(`vert`,1),Backspace:jm,"Mod-Backspace":jm,Delete:jm,"Mod-Delete":jm});function Vm(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Hm(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof U)return Vm(n,r,D.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=qm(i,e,t);if(o==null)return!1;if(e==`horiz`)return Vm(n,r,D.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=qp(i,e,t),s;return s=a?D.near(a,1):t<0?D.near(n.doc.resolve(i.before(-1)),-1):D.near(n.doc.resolve(i.after(-1)),1),Vm(n,r,s)}}}function Um(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof U)o=a;else{let r=qm(i,e,t);if(r==null)return!1;o=new U(n.doc.resolve(r))}let s=qp(o.$headCell,e,t);return s?Vm(n,r,new U(o.$anchorCell,s)):!1}}function Wm(e,t){let n=e.state.doc,r=zp(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new U(r))),!0):!1}function Gm(e,t,n){if(!Vp(e.state))return!1;let r=Mm(n),i=e.state.selection;if(i instanceof U){r||={width:1,height:1,rows:[w.from(Pm(Lp(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=H.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Fm(r,o.right-o.left,o.bottom-o.top),zm(e.state,e.dispatch,a,o,r),!0}else if(r){let t=Hp(e.state),n=t.start(-1);return zm(e.state,e.dispatch,n,H.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function Km(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Jm(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof U)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=zp(e.state.selection.$anchor))!=null&&Ym(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=Ym(e,n),i=Rp.getState(e.state)==null;if(!r||!Kp(t,r))if(i)r=t;else return;let a=new U(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(Rp,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),Rp.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Rp,-1))}function o(r){let o=r,s=Rp.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Jm(e,o.target)!=n&&(c=Ym(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function qm(e,t,n){if(!(e.state.selection instanceof O))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function Jm(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function Ym(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&zp(e.state.doc.resolve(r))||zp(e.state.doc.resolve(i))}var Xm=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`)),Zm(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,Zm(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function Zm(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var Qm=new j(`tableColumnResizing`);function $m({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Xm,lastColumnResizable:i=!0}={}){let a=new A({key:Qm,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=Lp(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new eh(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=Qm.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{th(t,n,e,i)},mouseleave:e=>{nh(e)},mousedown:(e,r)=>{rh(e,r,t,n)}},decorations:e=>{let t=Qm.getState(e);if(t&&t.activeHandle>-1)return fh(e,t.activeHandle)},nodeViews:{}}});return a}var eh=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(Qm);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Wp(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function th(e,t,n,r){if(!e.editable)return;let i=Qm.getState(e.state);if(i&&!i.dragging){let a=ah(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=oh(e,t,`left`,n):i-t.clientX<=n&&(o=oh(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=H.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}ch(e,o)}}}function nh(e){if(!e.editable)return;let t=Qm.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&ch(e,-1)}function rh(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=Qm.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=ih(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(Qm,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=Qm.getState(e.state);r?.dragging&&(lh(e,r.activeHandle,sh(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Qm,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=Qm.getState(e.state);if(i&&i.dragging){let a=sh(i.dragging,t,n);uh(e,i.activeHandle,a,r)}}return uh(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function ih(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function ah(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function oh(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=zp(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=H.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function sh(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function ch(e,t){e.dispatch(e.state.tr.setMeta(Qm,{setHandle:t}))}function lh(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=H.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():dh(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function uh(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=H.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&Zm(a,c.firstChild,c,r,s,n)}function dh(e){return Array(e).fill(0)}function fh(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return F.empty;let a=H.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,Qm.getState(e)?.dragging&&n.push(js.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(js.widget(s,c))}}return F.create(e.doc,n)}function ph({allowTableNodeSelection:e=!1}={}){return new A({key:Rp,state:{init(){return null},apply(e,t){let n=e.getMeta(Rp);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Qp,handleDOMEvents:{mousedown:Km},createSelectionBetween(e){return Rp.getState(e.state)==null?null:e.state.selection},handleTripleClick:Wm,handleKeyDown:Bm,handlePaste:Gm},appendTransaction(t,n,r){return tm(r,im(r,n),e)}})}function mh(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var hh=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){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:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&al(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!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:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),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())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(l(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(s(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(d(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(p(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(c(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(u(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(f(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(i(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=Vu(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof k){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof U){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():mh(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&a(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||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(),!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){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,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()}},gh=e=>new A({key:typeof e.pluginKey==`string`?new j(e.pluginKey):e.pluginKey,view:t=>new hh({view:t,...e})});B.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[gh({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 _h=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!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=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`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=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),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())}getTextContent(e){return vu(e,{textSerializers:yu(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(l(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(s(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(d(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(p(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(c(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(u(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(f(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(i(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}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){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){if(!this.view?.dom?.parentNode)return;let{selection:e}=this.editor.state,t=Vu(this.view,e.from,e.to);a({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||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(),!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()}},vh=e=>new A({key:typeof e.pluginKey==`string`?new j(e.pluginKey):e.pluginKey,view:t=>new _h({view:t,...e})});B.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?[vh({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 yh(e,t){return e??new j(t)}var bh=typeof window<`u`?x.useLayoutEffect:x.useEffect,xh=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),Sh=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`.split(`.`)),Ch=new Set([`children`,`className`,`style`]),wh=new Set([`tabIndex`]),Th=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),Eh={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function Dh(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function Oh(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function kh(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||Th.has(e)}function Ah(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function jh(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:Eh[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function Mh(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function Nh(e){return wh.has(e)}function Ph(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function Fh(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function Ih(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||Sh.has(e)?String(t):`${t}px`}function Lh(e,t){xh.has(t)||e.style.removeProperty(Ah(t))}function Rh(e,t,n){xh.has(t)||e.style.setProperty(Ah(t),Ih(t,n))}function zh(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(Ch.has(r)||!kh(r)||Dh(r,t[r])||Dh(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=Oh(r);if(a==null||a===!1){Nh(r)&&Fh(e,r),e.removeAttribute(o);return}if(a===!0){Nh(r)&&Ph(e,r,!0),e.setAttribute(o,``);return}if(Nh(r)){Ph(e,r,a);return}e.setAttribute(o,String(a))})}function Bh(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function Vh(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){Lh(e,t);return}Rh(e,t,a)}})}function Hh(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!Dh(t,n))return;let{eventName:i,options:a}=jh(t),o=t=>{n(Mh(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function Uh(e,t){let n=(0,x.useRef)({}),r=(0,x.useRef)([]);bh(()=>{let i=n.current;return Bh(e,i.className,t.className),Vh(e,i.style,t.style),zh(e,i,t),r.current=Hh(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var Wh=x.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,x.useRef)(document.createElement(`div`)),f=(0,x.useRef)(yh(e,`bubbleMenu`)).current;Uh(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=wp(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,x.useRef)(h);g.current=h;let[_,v]=(0,x.useState)(!1),y=(0,x.useRef)(!0);return(0,x.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=gh({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,x.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,re.createPortal)(c,d.current)});x.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,x.useRef)(document.createElement(`div`)),d=(0,x.useRef)(yh(e,`floatingMenu`)).current;Uh(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=wp(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,x.useRef)(m);h.current=m;let[g,_]=(0,x.useState)(!1),v=(0,x.useRef)(!0);return(0,x.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=vh({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,x.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,re.createPortal)(s,u.current)});var Gh=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Kh=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,qh=`numeric`,Jh=`ascii`,Yh=`alpha`,Xh=`asciinumeric`,Zh=`alphanumeric`,Qh=`domain`,$h=`emoji`,eg=`scheme`,tg=`slashscheme`,ng=`whitespace`;function rg(e,t){return e in t||(t[e]=[]),t[e]}function ig(e,t,n){t[qh]&&(t[Xh]=!0,t[Zh]=!0),t[Jh]&&(t[Xh]=!0,t[Yh]=!0),t[Xh]&&(t[Zh]=!0),t[Yh]&&(t[Zh]=!0),t[Zh]&&(t[Qh]=!0),t[$h]&&(t[Qh]=!0);for(let r in t){let t=rg(r,n);t.indexOf(e)<0&&t.push(e)}}function ag(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function og(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}og.groups={},og.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=og.groups;let i;return t&&t.j?i=t:(i=new og(t),n&&r&&ig(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=og.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new og,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new og,a&&(r&&(o.t&&typeof o.t==`string`?ig(a,Object.assign(ag(o.t,r),n),r):n&&ig(a,n,r)),o.t=a),i.j[e]=o,o}};var W=(e,t,n,r,i)=>e.ta(t,n,r,i),G=(e,t,n,r,i)=>e.tr(t,n,r,i),sg=(e,t,n,r,i)=>e.ts(t,n,r,i),K=(e,t,n,r,i)=>e.tt(t,n,r,i),cg=`WORD`,lg=`UWORD`,ug=`ASCIINUMERICAL`,dg=`ALPHANUMERICAL`,fg=`LOCALHOST`,pg=`TLD`,mg=`UTLD`,hg=`SCHEME`,gg=`SLASH_SCHEME`,_g=`NUM`,vg=`WS`,yg=`NL`,bg=`OPENBRACE`,xg=`CLOSEBRACE`,Sg=`OPENBRACKET`,Cg=`CLOSEBRACKET`,wg=`OPENPAREN`,Tg=`CLOSEPAREN`,Eg=`OPENANGLEBRACKET`,Dg=`CLOSEANGLEBRACKET`,Og=`FULLWIDTHLEFTPAREN`,kg=`FULLWIDTHRIGHTPAREN`,Ag=`LEFTCORNERBRACKET`,jg=`RIGHTCORNERBRACKET`,Mg=`LEFTWHITECORNERBRACKET`,Ng=`RIGHTWHITECORNERBRACKET`,Pg=`FULLWIDTHLESSTHAN`,Fg=`FULLWIDTHGREATERTHAN`,Ig=`AMPERSAND`,Lg=`APOSTROPHE`,Rg=`ASTERISK`,zg=`AT`,Bg=`BACKSLASH`,Vg=`BACKTICK`,Hg=`CARET`,Ug=`COLON`,Wg=`COMMA`,Gg=`DOLLAR`,Kg=`DOT`,qg=`EQUALS`,Jg=`EXCLAMATION`,Yg=`HYPHEN`,Xg=`PERCENT`,Zg=`PIPE`,Qg=`PLUS`,$g=`POUND`,e_=`QUERY`,t_=`QUOTE`,n_=`FULLWIDTHMIDDLEDOT`,r_=`SEMI`,i_=`SLASH`,a_=`TILDE`,o_=`UNDERSCORE`,s_=`EMOJI`,c_=`SYM`,l_=Object.freeze({__proto__:null,ALPHANUMERICAL:dg,AMPERSAND:Ig,APOSTROPHE:Lg,ASCIINUMERICAL:ug,ASTERISK:Rg,AT:zg,BACKSLASH:Bg,BACKTICK:Vg,CARET:Hg,CLOSEANGLEBRACKET:Dg,CLOSEBRACE:xg,CLOSEBRACKET:Cg,CLOSEPAREN:Tg,COLON:Ug,COMMA:Wg,DOLLAR:Gg,DOT:Kg,EMOJI:s_,EQUALS:qg,EXCLAMATION:Jg,FULLWIDTHGREATERTHAN:Fg,FULLWIDTHLEFTPAREN:Og,FULLWIDTHLESSTHAN:Pg,FULLWIDTHMIDDLEDOT:n_,FULLWIDTHRIGHTPAREN:kg,HYPHEN:Yg,LEFTCORNERBRACKET:Ag,LEFTWHITECORNERBRACKET:Mg,LOCALHOST:fg,NL:yg,NUM:_g,OPENANGLEBRACKET:Eg,OPENBRACE:bg,OPENBRACKET:Sg,OPENPAREN:wg,PERCENT:Xg,PIPE:Zg,PLUS:Qg,POUND:$g,QUERY:e_,QUOTE:t_,RIGHTCORNERBRACKET:jg,RIGHTWHITECORNERBRACKET:Ng,SCHEME:hg,SEMI:r_,SLASH:i_,SLASH_SCHEME:gg,SYM:c_,TILDE:a_,TLD:pg,UNDERSCORE:o_,UTLD:mg,UWORD:lg,WORD:cg,WS:vg}),u_=/[a-z]/,d_=/\p{L}/u,f_=/\p{Emoji}/u,p_=/\d/,m_=/\s/,h_=`\r`,g_=`
103
103
  `,__=`️`,v_=`‍`,y_=``,b_=null,x_=null;function S_(e=[]){let t={};og.groups=t;let n=new og;b_??=E_(Gh),x_??=E_(Kh),K(n,`'`,Lg),K(n,`{`,bg),K(n,`}`,xg),K(n,`[`,Sg),K(n,`]`,Cg),K(n,`(`,wg),K(n,`)`,Tg),K(n,`<`,Eg),K(n,`>`,Dg),K(n,`(`,Og),K(n,`)`,kg),K(n,`「`,Ag),K(n,`」`,jg),K(n,`『`,Mg),K(n,`』`,Ng),K(n,`<`,Pg),K(n,`>`,Fg),K(n,`&`,Ig),K(n,`*`,Rg),K(n,`@`,zg),K(n,"`",Vg),K(n,`^`,Hg),K(n,`:`,Ug),K(n,`,`,Wg),K(n,`$`,Gg),K(n,`.`,Kg),K(n,`=`,qg),K(n,`!`,Jg),K(n,`-`,Yg),K(n,`%`,Xg),K(n,`|`,Zg),K(n,`+`,Qg),K(n,`#`,$g),K(n,`?`,e_),K(n,`"`,t_),K(n,`/`,i_),K(n,`;`,r_),K(n,`~`,a_),K(n,`_`,o_),K(n,`\\`,Bg),K(n,`・`,n_);let r=G(n,p_,_g,{[qh]:!0});G(r,p_,r);let i=G(r,u_,ug,{[Xh]:!0}),a=G(r,d_,dg,{[Zh]:!0}),o=G(n,u_,cg,{[Jh]:!0});G(o,p_,i),G(o,u_,o),G(i,p_,i),G(i,u_,i);let s=G(n,d_,lg,{[Yh]:!0});G(s,u_),G(s,p_,a),G(s,d_,s),G(a,p_,a),G(a,u_),G(a,d_,a);let c=K(n,g_,yg,{[ng]:!0}),l=K(n,h_,vg,{[ng]:!0}),u=G(n,m_,vg,{[ng]:!0});K(n,y_,u),K(l,g_,c),K(l,y_,u),G(l,m_,u),K(u,h_),K(u,g_),G(u,m_,u),K(u,y_,u);let d=G(n,f_,s_,{[$h]:!0});K(d,`#`),G(d,f_,d),K(d,__,d);let f=K(d,v_);K(f,`#`),G(f,f_,d);let p=[[u_,o],[p_,i]],m=[[u_,null],[d_,s],[p_,a]];for(let e=0;e<b_.length;e++)T_(n,b_[e],pg,cg,p);for(let e=0;e<x_.length;e++)T_(n,x_[e],mg,lg,m);ig(pg,{tld:!0,ascii:!0},t),ig(mg,{utld:!0,alpha:!0},t),T_(n,`file`,hg,cg,p),T_(n,`mailto`,hg,cg,p),T_(n,`http`,gg,cg,p),T_(n,`https`,gg,cg,p),T_(n,`ftp`,gg,cg,p),T_(n,`ftps`,gg,cg,p),ig(hg,{scheme:!0,ascii:!0},t),ig(gg,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[eg]:!0}:{[tg]:!0};r.indexOf(`-`)>=0?i[Qh]=!0:u_.test(r)?p_.test(r)?i[Xh]=!0:i[Jh]=!0:i[qh]=!0,sg(n,r,r,i)}return sg(n,`localhost`,fg,{ascii:!0}),n.jd=new og(c_),{start:n,tokens:Object.assign({groups:t},l_)}}function C_(e,t){let n=w_(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function w_(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function T_(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new og(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new og(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function E_(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var D_={defaultProtocol:`http`,events:null,format:k_,formatHref:k_,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function O_(e,t=null){let n=Object.assign({},D_);e&&(n=Object.assign(n,e instanceof O_?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}O_.prototype={o:D_,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:D_[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function k_(e){return e}function A_(e,t){this.t=`token`,this.v=e,this.tk=t}A_.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=D_.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function j_(e,t){class n extends A_{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var M_=j_(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),N_=j_(`text`),P_=j_(`nl`),F_=j_(`url`,{isLink:!0,toHref(e=D_.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==fg&&e[1].t===Ug}}),I_=e=>new og(e);function L_({groups:e}){let t=e.domain.concat([Ig,Rg,zg,Bg,Vg,Hg,Gg,qg,Yg,_g,Xg,Zg,Qg,$g,i_,c_,a_,o_]),n=[Lg,Ug,Wg,Kg,Jg,Xg,e_,t_,r_,Eg,Dg,bg,xg,Cg,Sg,wg,Tg,Og,kg,Ag,jg,Mg,Ng,Pg,Fg],r=[Ig,Lg,Rg,Bg,Vg,Hg,Gg,qg,Yg,bg,xg,Xg,Zg,Qg,$g,e_,i_,c_,a_,o_],i=I_(),a=K(i,a_);W(a,r,a),W(a,e.domain,a);let o=I_(),s=I_(),c=I_();W(i,e.domain,o),W(i,e.scheme,s),W(i,e.slashscheme,c),W(o,r,a),W(o,e.domain,o);let l=K(o,zg);K(a,zg,l),K(s,zg,l),K(c,zg,l);let u=K(a,Kg);W(u,r,a),W(u,e.domain,a);let d=I_();W(l,e.domain,d),W(d,e.domain,d);let f=K(d,Kg);W(f,e.domain,d);let p=I_(M_);W(f,e.tld,p),W(f,e.utld,p),K(l,fg,p);let m=K(d,Yg);K(m,Yg,m),W(m,e.domain,d),W(p,e.domain,d),K(p,Kg,f),K(p,Yg,m);let h=K(o,Yg),g=K(o,Kg);K(h,Yg,h),W(h,e.domain,o),W(g,r,a),W(g,e.domain,o);let _=I_(F_);W(g,e.tld,_),W(g,e.utld,_),W(_,e.domain,o),W(_,r,a),K(_,Kg,g),K(_,Yg,h),K(_,zg,l);let v=K(_,Ug),y=I_(F_);W(v,e.numeric,y);let b=I_(F_),ee=I_();W(b,t,b),W(b,n,ee),W(ee,t,b),W(ee,n,ee),K(_,i_,b),K(y,i_,b);let te=K(s,Ug),ne=K(K(K(c,Ug),i_),i_);W(s,e.domain,o),K(s,Kg,g),K(s,Yg,h),W(c,e.domain,o),K(c,Kg,g),K(c,Yg,h),W(te,e.domain,b),K(te,i_,b),K(te,e_,b),W(ne,e.domain,b),W(ne,t,b),K(ne,i_,b);let x=[[bg,xg],[Sg,Cg],[wg,Tg],[Eg,Dg],[Og,kg],[Ag,jg],[Mg,Ng],[Pg,Fg]];for(let e=0;e<x.length;e++){let[r,i]=x[e],a=K(b,r);K(ee,r,a);let o=I_(F_);W(a,t,o);let s=I_();W(a,n,s),K(a,i,b),W(o,t,o),W(o,n,s),W(s,t,o),W(s,n,s),K(o,i,b),K(s,i,b)}return K(i,fg,_),K(i,yg,P_),{start:i,tokens:l_}}function R_(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(z_(N_,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(z_(e,t,r))}}return o.length>0&&a.push(z_(N_,t,o)),a}function z_(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var B_=typeof console<`u`&&console&&console.warn||(()=>{}),V_=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,q={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function H_(){return og.groups={},q.scanner=null,q.parser=null,q.tokenQueue=[],q.pluginQueue=[],q.customSchemes=[],q.initialized=!1,q}function U_(e,t=!1){if(q.initialized&&B_(`linkifyjs: already initialized - will not register custom scheme "${e}" ${V_}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
104
104
  1. Must only contain digits, lowercase ASCII letters or "-"
105
105
  2. Cannot start or end with "-"