@hiai-gg/docsmint 2.2.4 → 2.2.5

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 (259) hide show
  1. package/README.md +10 -8
  2. package/dist/backend/index.js +59962 -40726
  3. package/dist/frontend/CategoryDialog-CtBDBrmR.js +603 -0
  4. package/dist/frontend/ConfirmDialog-B7rUgX7M.js +219 -0
  5. package/dist/frontend/CreateSnapshotDialog-bUKdc0Zb.js +219 -0
  6. package/dist/frontend/DatePicker-CKTDDpVx.js +291 -0
  7. package/dist/frontend/DeleteDialog-D28HGxN7.js +175 -0
  8. package/dist/frontend/FolderNode-CVd22MJS.js +291 -0
  9. package/dist/frontend/FolderTreeSelector-DObSptCD.js +102 -0
  10. package/dist/frontend/HiAiEditor--V0-gKwv.js +3266 -0
  11. package/dist/frontend/HiaiDocsExtensionProvider-B1bCAtpa.js +13 -0
  12. package/dist/frontend/{Icon-CiHcxcpv.js → Icon-DNapb_KY.js} +3 -2
  13. package/dist/frontend/SettingsDialog-CN-PrNpM.js +979 -0
  14. package/dist/frontend/ShareDialog-UO_6vvoT.js +272 -0
  15. package/dist/frontend/Sidebar-CAxrqTAQ.js +2169 -0
  16. package/dist/frontend/TagCreateDialog-BdWu4bPX.js +268 -0
  17. package/dist/frontend/{action_cancel-BdsWzQKU.js → action_cancel-DxbRD-bG.js} +1 -1
  18. package/dist/frontend/{action_close-CVhfLPRQ.js → action_close-Ct6lVumm.js} +1 -1
  19. package/dist/frontend/{action_create-ByaroO1_.js → action_create-DKOlnVyX.js} +1 -1
  20. package/dist/frontend/{action_delete-SRloglWY.js → action_delete-DRb7fBnB.js} +1 -1
  21. package/dist/frontend/{action_go_to-DO1bicF-.js → action_go_to-D0fF5t1d.js} +1 -1
  22. package/dist/frontend/{action_loading-iQ0KsN6i.js → action_loading-YGvDyzYG.js} +1 -1
  23. package/dist/frontend/{action_save-DeqrZQwV.js → action_save-BHYTeFmm.js} +1 -1
  24. package/dist/frontend/api/categories.js +1 -1
  25. package/dist/frontend/api/settings.js +1 -1
  26. package/dist/frontend/api/tags.js +1 -1
  27. package/dist/frontend/app-shell.js +177 -176
  28. package/dist/frontend/{auth-client-Dx7d9Tzo.js → auth-client-DahfoSYo.js} +297 -277
  29. package/dist/frontend/{bundle-mjs-clTO1WW-.js → bundle-mjs-654jE5XN.js} +397 -300
  30. package/dist/frontend/{camera-DsdOPOcD.js → camera-C6JuKKhr.js} +9 -8
  31. package/dist/frontend/{categories-CusvHb5Y.js → categories-CUfKlgrs.js} +1 -1
  32. package/dist/frontend/{categories_update_error-Cn8DBBHv.js → categories_update_error-BrLD-j9s.js} +1 -1
  33. package/dist/frontend/check-B_e1XqT2.js +25 -0
  34. package/dist/frontend/chevron-down-BsnN2mp2.js +25 -0
  35. package/dist/frontend/circle-check-CJH5zxd9.js +29 -0
  36. package/dist/frontend/clock-CU0gCiiM.js +29 -0
  37. package/dist/frontend/collaboration.js +113 -113
  38. package/dist/frontend/components/category-dialog.js +1 -1
  39. package/dist/frontend/components/create-snapshot-dialog.js +1 -1
  40. package/dist/frontend/components/delete-dialog.js +1 -1
  41. package/dist/frontend/components/editor/compact-editor.js +5 -4
  42. package/dist/frontend/components/editor/document-editor.js +1 -1
  43. package/dist/frontend/components/editor/document-title.js +3 -2
  44. package/dist/frontend/components/editor/docx-serializer.js +8359 -12358
  45. package/dist/frontend/components/editor/extensions.js +1 -1
  46. package/dist/frontend/components/editor/markdown-toggle.js +33 -32
  47. package/dist/frontend/components/editor/markdown.js +1 -1
  48. package/dist/frontend/components/folder-node.js +1 -1
  49. package/dist/frontend/components/folder-tree-selector.js +1 -1
  50. package/dist/frontend/components/save-as-dialog.js +168 -167
  51. package/dist/frontend/components/settings.js +1 -1
  52. package/dist/frontend/components/share-dialog.js +1 -1
  53. package/dist/frontend/components/sidebar.js +1 -1
  54. package/dist/frontend/components/tag-create-dialog.js +1 -1
  55. package/dist/frontend/components/version-history.js +252 -251
  56. package/dist/frontend/{copy-Bag46YaR.js → copy-DYNRCHgk.js} +9 -8
  57. package/dist/frontend/dashboard.js +1301 -1300
  58. package/dist/frontend/db-yN0Vve_2.js +4296 -0
  59. package/dist/frontend/{dialog-C0Bpok1d.js → dialog-Dqp04jso.js} +11 -10
  60. package/dist/frontend/dist-4xBCgXNT.js +40 -0
  61. package/dist/frontend/{dist-DjId3RKL.js → dist-BaAULhmK.js} +3 -9
  62. package/dist/frontend/dist-C1oIyJLI.js +302 -0
  63. package/dist/frontend/dndzone-CWg1kmdZ.js +1483 -0
  64. package/dist/frontend/{doc_title_label-BOuZzvqv.js → doc_title_label-BPlghiRM.js} +1 -1
  65. package/dist/frontend/{doc_title_placeholder-ZxpdWWEn.js → doc_title_placeholder-D-LfSoC5.js} +1 -1
  66. package/dist/frontend/dropdown-menu-HePwCxoQ.js +1429 -0
  67. package/dist/frontend/{editorExtensions-DbiFj4tn.js → editorExtensions-QKIFSqEG.js} +9 -9
  68. package/dist/frontend/{editor_markdown_placeholder-BztIY9Ci.js → editor_markdown_placeholder-BXRPm7JG.js} +1 -1
  69. package/dist/frontend/{ellipsis-vertical-Oymsv1R4.js → ellipsis-vertical-CR25MyeP.js} +9 -8
  70. package/dist/frontend/{error_dismiss-C651ZdWI.js → error_dismiss-Ckia7GQe.js} +1 -1
  71. package/dist/frontend/{error_generic-BlWqOE-a.js → error_generic-gyQMdET_.js} +1 -1
  72. package/dist/frontend/extension.js +1 -1
  73. package/dist/frontend/{folder-BpmB_sAy.js → folder-BpA690ie.js} +4 -3
  74. package/dist/frontend/{folders_rename-Cxbg5GIw.js → folders_rename-BHa_gSXw.js} +1 -1
  75. package/dist/frontend/frontend.css +1 -1
  76. package/dist/frontend/i18n.js +29 -29
  77. package/dist/frontend/{identity-B7HeOzDJ.js → identity-ndFYB8Nt.js} +1 -1
  78. package/dist/frontend/{input-CbeB9220.js → input-Cv3qF4J3.js} +9 -8
  79. package/dist/frontend/label-DXjefKfF.js +30 -0
  80. package/dist/frontend/{lib-CITdCbKa.js → lib-DJthN0w9.js} +7108 -5196
  81. package/dist/frontend/loader-circle-CvWX1HHL.js +25 -0
  82. package/dist/frontend/{markdown-6E9TWC6V.js → markdown-CksQVQ6a.js} +2 -2
  83. package/dist/frontend/offline/identity.js +1 -1
  84. package/dist/frontend/popper-layer-force-mount-DS--Cvfo.js +3493 -0
  85. package/dist/frontend/rolldown-runtime-DKYsOz5J.js +19 -0
  86. package/dist/frontend/{rotate-ccw-DAUX7np7.js → rotate-ccw-Box7QP5X.js} +9 -8
  87. package/dist/frontend/{runtime-CGUiMzK6.js → runtime-CJv8UGYl.js} +1 -4
  88. package/dist/frontend/{schemas-YXxhj5o8.js → schemas-BYbeR0Ky.js} +11 -11
  89. package/dist/frontend/{scroll_to_top_aria-lJc2RSx_.js → scroll_to_top_aria-CP7_oyCo.js} +1 -1
  90. package/dist/frontend/search.js +650 -649
  91. package/dist/frontend/{search_title-BETwQYJq.js → search_title-C2aOzN_J.js} +1 -1
  92. package/dist/frontend/select-value-DAMTi0zc.js +1473 -0
  93. package/dist/frontend/{settings-DyePuqjp.js → settings-DTsCVJEi.js} +1 -1
  94. package/dist/frontend/{share-context-C2xyVP9M.js → share-context-CtRMIIhL.js} +15 -14
  95. package/dist/frontend/{share_copied-BuAnmpbz.js → share_copied-BHb_9sOo.js} +1 -1
  96. package/dist/frontend/{share_toggle_password-LEYUeHWr.js → share_toggle_password-DjCMq4Eq.js} +1 -1
  97. package/dist/frontend/shared-document.js +49 -48
  98. package/dist/frontend/{sidebar_uncategorized-C5PGOflV.js → sidebar_uncategorized-BJSB_sc9.js} +1 -1
  99. package/dist/frontend/{sort_relevance-DpCVLby_.js → sort_relevance-CXuNTq6L.js} +1 -1
  100. package/dist/frontend/{tag-Wdfe0rKU.js → tag-BPOFgBQw.js} +4 -3
  101. package/dist/frontend/tag-store.svelte-DyqQNx7H.js +28 -0
  102. package/dist/frontend/{tags-DlDVothf.js → tags-DwilrkrM.js} +1 -1
  103. package/dist/frontend/{tags_load_error-BINNpPPV.js → tags_load_error-BOyuQEGc.js} +1 -1
  104. package/dist/frontend/{tags_new-Dw0Uy43-.js → tags_new-CGF3Hi1j.js} +1 -1
  105. package/dist/frontend/textarea-DDdgNvnf.js +23 -0
  106. package/dist/frontend/theme.js +1 -1
  107. package/dist/frontend/{theme.svelte-BiXvrqwh.js → theme.svelte-Dx01qWc3.js} +2 -2
  108. package/dist/frontend/{theme_system-YIfa_2Xt.js → theme_system-Bt9ItDgj.js} +1 -1
  109. package/dist/frontend/utils/dndzone.js +1 -1
  110. package/dist/frontend/{utils-CnAmIMwr.js → utils-BQMesoNf.js} +1 -1
  111. package/dist/frontend/utils-BavN35Bw.js +6 -0
  112. package/dist/frontend/utils.js +1 -1
  113. package/dist/frontend/{version_create_snapshot-D8xjbuCq.js → version_create_snapshot-BvoOuUeh.js} +1 -1
  114. package/dist/frontend/{version_restored_from-DYFFSuQj.js → version_restored_from-BIEEKFbx.js} +1 -1
  115. package/dist/frontend/{version_snapshot_label_placeholder-BhKq1NQ7.js → version_snapshot_label_placeholder-h9r2_0u3.js} +1 -1
  116. package/dist/frontend/{weekday_we-BxbzNVWR.js → weekday_we-DsuVW6rh.js} +1 -1
  117. package/dist/frontend/x-hIpDH7DU.js +25 -0
  118. package/dist/frontend/{yjs-BbwnvxgY.js → yjs--VgxqIlB.js} +607 -628
  119. package/dist/frontend-ssr/api/categories.js +1 -1
  120. package/dist/frontend-ssr/api/settings.js +1 -1
  121. package/dist/frontend-ssr/api/tags.js +1 -1
  122. package/dist/frontend-ssr/app-shell.js +11 -11
  123. package/dist/frontend-ssr/assets/{CategoryDialog-2CCX508O.js → CategoryDialog-DRItbO_9.js} +13 -13
  124. package/dist/frontend-ssr/assets/{ConfirmDialog-Cc6lcY1N.js → ConfirmDialog-B0NXRrel.js} +8 -8
  125. package/dist/frontend-ssr/assets/{CreateSnapshotDialog-BB8fXF9W.js → CreateSnapshotDialog-nj8PjuON.js} +7 -7
  126. package/dist/frontend-ssr/assets/{DatePicker-CfzKzipR.js → DatePicker-CdUKLPtP.js} +8 -8
  127. package/dist/frontend-ssr/assets/{DeleteDialog-DRU4UgOW.js → DeleteDialog-B83NoxAg.js} +3 -3
  128. package/dist/frontend-ssr/assets/{FolderNode-CyOrLJ2Y.js → FolderNode-CSeC3051.js} +10 -10
  129. package/dist/frontend-ssr/assets/{FolderTreeSelector-D0reTdFS.js → FolderTreeSelector-Dh-ViJPU.js} +4 -4
  130. package/dist/frontend-ssr/assets/{HiAiEditor-BQGlGd3z.js → HiAiEditor-DB2PjHm9.js} +41 -41
  131. package/dist/frontend-ssr/assets/{Icon-CrIRbT5O.js → Icon-CBEeswQ2.js} +4 -4
  132. package/dist/frontend-ssr/assets/{SettingsDialog-BpHY3IMb.js → SettingsDialog-kc3O9PXG.js} +21 -21
  133. package/dist/frontend-ssr/assets/{ShareDialog-CY40nWZJ.js → ShareDialog-Dmrj55QP.js} +4 -4
  134. package/dist/frontend-ssr/assets/{Sidebar-dTp4DyW4.js → Sidebar-CDQcIuyv.js} +45 -45
  135. package/dist/frontend-ssr/assets/{TagCreateDialog-C2tpdEuj.js → TagCreateDialog-CP-yYfpQ.js} +11 -11
  136. package/dist/frontend-ssr/assets/{action_cancel-CsBbxW0m.js → action_cancel-B8i5P3wt.js} +1 -1
  137. package/dist/frontend-ssr/assets/{action_close-lFKBqBwg.js → action_close-DPgIB-cY.js} +1 -1
  138. package/dist/frontend-ssr/assets/{action_create-BV4ZOcQW.js → action_create-DAlNPFeN.js} +1 -1
  139. package/dist/frontend-ssr/assets/{action_delete-CNmRhKQP.js → action_delete-C6lsQCtY.js} +1 -1
  140. package/dist/frontend-ssr/assets/{action_go_to-tN5I26xM.js → action_go_to-C6tegi-k.js} +1 -1
  141. package/dist/frontend-ssr/assets/{action_save-YCfMiKb4.js → action_save-BQCej1sh.js} +1 -1
  142. package/dist/frontend-ssr/assets/{auth-client-BnnnJDAb.js → auth-client-CwXGsJIQ.js} +44 -38
  143. package/dist/frontend-ssr/assets/{camera-OYNSMvMd.js → camera-kjjsHmQu.js} +2 -2
  144. package/dist/frontend-ssr/assets/{categories_update_error-Bfx5vtvt.js → categories_update_error-Kq8q_FJp.js} +1 -1
  145. package/dist/frontend-ssr/assets/{chevron-down-DB6YsSbQ.js → chevron-down-DPc-Owbl.js} +2 -2
  146. package/dist/frontend-ssr/assets/{chevron-right-DOt2uY6b.js → chevron-right-C-jY4mqk.js} +2 -2
  147. package/dist/frontend-ssr/assets/{circle-check-DQhTm9YR.js → circle-check-CnueRXrc.js} +2 -2
  148. package/dist/frontend-ssr/assets/{clock-B08dVWtf.js → clock-CoRtIDhT.js} +2 -2
  149. package/dist/frontend-ssr/assets/{copy-2jsznHar.js → copy-CDNZIGVg.js} +2 -2
  150. package/dist/frontend-ssr/assets/{db-BEKLU5Fc.js → db-NhMsSg1f.js} +1 -1
  151. package/dist/frontend-ssr/assets/{dialog-C6U-DqLr.js → dialog-B09MN2S-.js} +9 -9
  152. package/dist/frontend-ssr/assets/{dist-DqXTz_zE.js → dist-D4MAfF0i.js} +13 -13
  153. package/dist/frontend-ssr/assets/{dist-ip9bPdma.js → dist-cDG_u5EF.js} +8 -8
  154. package/dist/frontend-ssr/assets/{dndzone-C7KnICM0.js → dndzone-DyM8UtoT.js} +378 -216
  155. package/dist/frontend-ssr/assets/{doc_title_label-CE_l-Gum.js → doc_title_label-BqCuH3eY.js} +1 -1
  156. package/dist/frontend-ssr/assets/{doc_title_placeholder-7_i7PtG6.js → doc_title_placeholder-C3tGSpRB.js} +1 -1
  157. package/dist/frontend-ssr/assets/dropdown-menu-C9H45F9X.js +1721 -0
  158. package/dist/frontend-ssr/assets/{editor_markdown_placeholder-CAeLJjFT.js → editor_markdown_placeholder-Cxa5uq87.js} +1 -1
  159. package/dist/frontend-ssr/assets/{editor_toolbar_undo-CVCfQIS1.js → editor_toolbar_undo-D-gLz88j.js} +1 -1
  160. package/dist/frontend-ssr/assets/{ellipsis-vertical-IFHt2NM1.js → ellipsis-vertical-oBvMj3Jm.js} +2 -2
  161. package/dist/frontend-ssr/assets/{error_generic-BB80i0Vk.js → error_generic-BSoVZ_4p.js} +1 -1
  162. package/dist/frontend-ssr/assets/{folder-CXa1_bm5.js → folder-Ptjeaody.js} +2 -2
  163. package/dist/frontend-ssr/assets/{folders_rename-ydbfwQlj.js → folders_rename-DBtQcf2R.js} +1 -1
  164. package/dist/frontend-ssr/assets/{identity-DTz1SQwC.js → identity-CigCqYEA.js} +1 -1
  165. package/dist/frontend-ssr/assets/{input-Bxw9sFF0.js → input-Cc45dG_S.js} +2 -2
  166. package/dist/frontend-ssr/assets/{label-CMWedjs6.js → label-C1_J2397.js} +2 -2
  167. package/dist/frontend-ssr/assets/{loader-circle-zbKj9Qb-.js → loader-circle-CK3McH5n.js} +2 -2
  168. package/dist/frontend-ssr/assets/{markdown-BmIhDQp7.js → markdown-WQsa_gay.js} +1 -1
  169. package/dist/frontend-ssr/assets/{popper-layer-force-mount-CSHZsG2E.js → popper-layer-force-mount-CGKwdZaZ.js} +1448 -2402
  170. package/dist/frontend-ssr/assets/{rotate-ccw-B7SaTFWf.js → rotate-ccw-B1lCxJ5d.js} +2 -2
  171. package/dist/frontend-ssr/assets/{runtime-BX6-jTn_.js → runtime-CoxALrm1.js} +2 -28
  172. package/dist/frontend-ssr/assets/{scroll_to_top_aria-CAYSiGHO.js → scroll_to_top_aria-CmLwsPln.js} +1 -1
  173. package/dist/frontend-ssr/assets/{search_title-C7NVXXq3.js → search_title-CZIl0wkq.js} +1 -1
  174. package/dist/frontend-ssr/assets/{search_toggle_filters-Bq_YVD8s.js → search_toggle_filters-BG-CRM9G.js} +1 -1
  175. package/dist/frontend-ssr/assets/{select-value-TgslfiUB.js → select-value-BeUHHkLq.js} +157 -66
  176. package/dist/frontend-ssr/assets/{settings-B1MA_FjO.js → settings-BqyemuQv.js} +1 -1
  177. package/dist/frontend-ssr/assets/{share-context-RVh8AExX.js → share-context-BM1sUnlP.js} +15 -15
  178. package/dist/frontend-ssr/assets/{share_copied-CrwEwkb3.js → share_copied-BVGtm9Ud.js} +1 -1
  179. package/dist/frontend-ssr/assets/{share_toggle_password-Co56z0Ha.js → share_toggle_password-z0gwy0TG.js} +1 -1
  180. package/dist/frontend-ssr/assets/{sidebar_uncategorized-COWdmZ3d.js → sidebar_uncategorized-rpbsgLVr.js} +1 -1
  181. package/dist/frontend-ssr/assets/{tag-BGhtDKpP.js → tag-D_ZqINN3.js} +3 -3
  182. package/dist/frontend-ssr/assets/{tags_load_error-DW4FbHvr.js → tags_load_error-DvhlyMMY.js} +1 -1
  183. package/dist/frontend-ssr/assets/{tags_new-Dr3ByMPZ.js → tags_new-DStxzBII.js} +1 -1
  184. package/dist/frontend-ssr/assets/{textarea-Bz5Tz4rw.js → textarea-S9uzw6je.js} +2 -2
  185. package/dist/frontend-ssr/assets/{theme.svelte-CdHah46l.js → theme.svelte-CqAzqvik.js} +2 -2
  186. package/dist/frontend-ssr/assets/{theme_system-E97FASeq.js → theme_system-DjbsL0RQ.js} +1 -1
  187. package/dist/frontend-ssr/assets/{utils-DF6CmRDX.js → utils-DF93j6z-.js} +1 -1
  188. package/dist/frontend-ssr/assets/{version_create_snapshot-DeeYB7bb.js → version_create_snapshot-SwYsTZ56.js} +1 -1
  189. package/dist/frontend-ssr/assets/{version_restored_from-CTt2LM4A.js → version_restored_from-pYBnudye.js} +1 -1
  190. package/dist/frontend-ssr/assets/{version_snapshot_label_placeholder-BbGD9YuN.js → version_snapshot_label_placeholder-DtDnHip8.js} +1 -1
  191. package/dist/frontend-ssr/assets/{weekday_we-BzGQ-iFc.js → weekday_we-CV1TMROW.js} +1 -1
  192. package/dist/frontend-ssr/components/category-dialog.js +1 -1
  193. package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
  194. package/dist/frontend-ssr/components/delete-dialog.js +1 -1
  195. package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
  196. package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
  197. package/dist/frontend-ssr/components/editor/document-title.js +2 -2
  198. package/dist/frontend-ssr/components/editor/extensions.js +1 -1
  199. package/dist/frontend-ssr/components/editor/markdown-toggle.js +3 -3
  200. package/dist/frontend-ssr/components/editor/markdown.js +1 -1
  201. package/dist/frontend-ssr/components/folder-node.js +1 -1
  202. package/dist/frontend-ssr/components/folder-tree-selector.js +1 -1
  203. package/dist/frontend-ssr/components/save-as-dialog.js +10 -10
  204. package/dist/frontend-ssr/components/settings.js +1 -1
  205. package/dist/frontend-ssr/components/share-dialog.js +1 -1
  206. package/dist/frontend-ssr/components/sidebar.js +1 -1
  207. package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
  208. package/dist/frontend-ssr/components/version-history.js +17 -17
  209. package/dist/frontend-ssr/dashboard.js +61 -158
  210. package/dist/frontend-ssr/extension.js +1 -1
  211. package/dist/frontend-ssr/i18n.js +31 -31
  212. package/dist/frontend-ssr/offline/identity.js +1 -1
  213. package/dist/frontend-ssr/search.js +13 -13
  214. package/dist/frontend-ssr/shared-document.js +1 -1
  215. package/dist/frontend-ssr/theme.js +1 -1
  216. package/dist/frontend-ssr/utils/dndzone.js +1 -1
  217. package/dist/lifecycle-runtime.js +17768 -11203
  218. package/dist/mcp-cli.js +1 -1
  219. package/dist/mcp-server.js +1 -1
  220. package/package.json +13 -13
  221. package/packages/cli/src/index.ts +1 -1
  222. package/server.json +2 -2
  223. package/dist/frontend/CategoryDialog-CVJi5PJu.js +0 -602
  224. package/dist/frontend/ConfirmDialog-0JwB8mKN.js +0 -218
  225. package/dist/frontend/CreateSnapshotDialog-BLrtuYs5.js +0 -218
  226. package/dist/frontend/DatePicker-BwSb8TRv.js +0 -326
  227. package/dist/frontend/DeleteDialog-s7Dr6bXg.js +0 -174
  228. package/dist/frontend/FolderNode-Ds0LDfK3.js +0 -290
  229. package/dist/frontend/FolderTreeSelector-BR3lYmPU.js +0 -101
  230. package/dist/frontend/HiAiEditor-BHz46Iqd.js +0 -3078
  231. package/dist/frontend/HiaiDocsExtensionProvider-A2nGddUR.js +0 -12
  232. package/dist/frontend/SettingsDialog-BvS74JZu.js +0 -978
  233. package/dist/frontend/ShareDialog-Bo50h_Oe.js +0 -271
  234. package/dist/frontend/Sidebar-DerKtpWB.js +0 -2168
  235. package/dist/frontend/TagCreateDialog-DhKfsfv3.js +0 -267
  236. package/dist/frontend/check-DiMZRkKS.js +0 -24
  237. package/dist/frontend/chevron-down-CxFrMFDJ.js +0 -24
  238. package/dist/frontend/circle-check-B4F_qgPx.js +0 -28
  239. package/dist/frontend/clock-dcpueRk-.js +0 -28
  240. package/dist/frontend/db-B1ZV452J.js +0 -3792
  241. package/dist/frontend/dist-BlcV_BOY.js +0 -39
  242. package/dist/frontend/dist-Dl9qg10h.js +0 -301
  243. package/dist/frontend/dndzone-B9jA0yIS.js +0 -1372
  244. package/dist/frontend/dropdown-menu-B3nk2aM-.js +0 -482
  245. package/dist/frontend/label-CfBWf3gI.js +0 -29
  246. package/dist/frontend/loader-circle-skKwfRCB.js +0 -24
  247. package/dist/frontend/popper-layer-force-mount-BG0eyrCk.js +0 -4255
  248. package/dist/frontend/rolldown-runtime-CwxnZyOB.js +0 -22
  249. package/dist/frontend/select-value-BY5Hw6Rl.js +0 -1412
  250. package/dist/frontend/tag-store.svelte-C9VYWqLQ.js +0 -28
  251. package/dist/frontend/textarea-D6emvAwM.js +0 -22
  252. package/dist/frontend/utils-DH0uqK40.js +0 -6
  253. package/dist/frontend/x-CBUgPygC.js +0 -24
  254. package/dist/frontend-ssr/assets/dropdown-menu-BS5fcN9l.js +0 -446
  255. package/dist/frontend-ssr/assets/{HiaiDocsExtensionProvider-D6cGL-9s.js → HiaiDocsExtensionProvider-BdfQP817.js} +1 -1
  256. package/dist/frontend-ssr/assets/{categories-bBPviKjl.js → categories-CMmudpEk.js} +1 -1
  257. package/dist/frontend-ssr/assets/{editorExtensions-2O7O2Nhv.js → editorExtensions-DOPTTKUS.js} +2 -2
  258. package/dist/frontend-ssr/assets/{tag-store.svelte-CUUgAaDD.js → tag-store.svelte-Djpf1W0n.js} +1 -1
  259. package/dist/frontend-ssr/assets/{tags-C7u-LBsl.js → tags-GQOEtqET.js} +1 -1
@@ -1,4 +1,4 @@
1
- // ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/map.js
1
+ // ../node_modules/.bun/lib0@0.2.120/node_modules/lib0/map.js
2
2
  var e = () => /* @__PURE__ */ new Map(), t = (t) => {
3
3
  let n = e();
4
4
  return t.forEach((e, t) => {
@@ -76,7 +76,7 @@ var e = () => /* @__PURE__ */ new Map(), t = (t) => {
76
76
  Number.isNaN;
77
77
  var re = Math.pow, ie = (e) => e === 0 ? 1 / e < 0 : e < 0, ae = 1 << 29, oe = 2 ** 53 - 1, se = -(2 ** 53 - 1), ce = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && m(e) === e);
78
78
  Number.isNaN, Number.parseInt;
79
- // ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/string.js
79
+ // ../node_modules/.bun/lib0@0.2.120/node_modules/lib0/string.js
80
80
  var le = String.fromCharCode;
81
81
  String.fromCodePoint, le(65535);
82
82
  var ue = (e) => e.toLowerCase(), de = /^\s*/g, fe = (e) => e.replace(de, ""), pe = /([A-Z])/g, me = (e, t) => fe(e.replace(pe, (e) => `${t}${ue(e)}`)), he = (e) => {
@@ -147,7 +147,7 @@ var ye = (e, t) => d(t, () => e).join(""), be = class {
147
147
  _(e, 119), y(e, t);
148
148
  break;
149
149
  case "number":
150
- ce(t) && te(t) <= 2147483647 ? (_(e, 125), Ee(e, t)) : Fe(t) ? (_(e, 124), je(e, t)) : (_(e, 123), Me(e, t));
150
+ ce(t) && te(t) <= 0x7fffffff ? (_(e, 125), Ee(e, t)) : Fe(t) ? (_(e, 124), je(e, t)) : (_(e, 123), Me(e, t));
151
151
  break;
152
152
  case "bigint":
153
153
  _(e, 122), Ne(e, t);
@@ -222,14 +222,20 @@ var ye = (e, t) => d(t, () => e).join(""), be = class {
222
222
  throw x("Method unimplemented");
223
223
  }, C = () => {
224
224
  throw x("Unexpected case");
225
- }, Ue = x("Unexpected end of array"), We = x("Integer out of Range"), Ge = class {
225
+ }, Ue = x("Unexpected end of array"), We = x("Integer out of Range"), Ge = (e, t, n) => {
226
+ if (t < 0 || n < 0 || t + n > e.length) throw Ue;
227
+ return new Uint8Array(e.buffer, e.byteOffset + t, n);
228
+ }, Ke = (e, t, n) => {
229
+ if (t < 0 || n < 0 || t + n > e.length) throw Ue;
230
+ return new DataView(e.buffer, e.byteOffset + t, n);
231
+ }, qe = class {
226
232
  constructor(e) {
227
233
  this.arr = e, this.pos = 0;
228
234
  }
229
- }, w = (e) => new Ge(e), Ke = (e) => e.pos !== e.arr.length, qe = (e, t) => {
230
- let n = new Uint8Array(e.arr.buffer, e.pos + e.arr.byteOffset, t);
235
+ }, w = (e) => new qe(e), Je = (e) => e.pos !== e.arr.length, Ye = (e, t) => {
236
+ let n = Ge(e.arr, e.pos, t);
231
237
  return e.pos += t, n;
232
- }, T = (e) => qe(e, E(e)), Je = (e) => e.arr[e.pos++], E = (e) => {
238
+ }, T = (e) => Ye(e, E(e)), Xe = (e) => e.arr[e.pos++], E = (e) => {
233
239
  let t = 0, n = 1, r = e.arr.length;
234
240
  for (; e.pos < r;) {
235
241
  let r = e.arr[e.pos++];
@@ -238,7 +244,7 @@ var ye = (e, t) => d(t, () => e).join(""), be = class {
238
244
  if (t > oe) throw We;
239
245
  }
240
246
  throw Ue;
241
- }, Ye = (e) => {
247
+ }, Ze = (e) => {
242
248
  let t = e.arr[e.pos++], n = t & 63, r = 64, i = (t & 64) > 0 ? -1 : 1;
243
249
  if (!(t & 128)) return i * n;
244
250
  let a = e.arr.length;
@@ -252,24 +258,24 @@ var ye = (e, t) => d(t, () => e).join(""), be = class {
252
258
  let t = E(e);
253
259
  if (t === 0) return "";
254
260
  {
255
- let n = String.fromCodePoint(Je(e));
256
- if (--t < 100) for (; t--;) n += String.fromCodePoint(Je(e));
261
+ let n = String.fromCodePoint(Xe(e));
262
+ if (--t < 100) for (; t--;) n += String.fromCodePoint(Xe(e));
257
263
  else for (; t > 0;) {
258
264
  let r = t < 1e4 ? t : 1e4, i = e.arr.subarray(e.pos, e.pos + r);
259
265
  e.pos += r, n += String.fromCodePoint.apply(null, i), t -= r;
260
266
  }
261
267
  return decodeURIComponent(escape(n));
262
268
  }
263
- }, Xe = (e, t) => {
264
- let n = new DataView(e.arr.buffer, e.arr.byteOffset + e.pos, t);
269
+ }, Qe = (e, t) => {
270
+ let n = Ke(e.arr, e.pos, t);
265
271
  return e.pos += t, n;
266
- }, Ze = [
272
+ }, $e = [
267
273
  (e) => void 0,
268
274
  (e) => null,
269
- Ye,
270
- (e) => Xe(e, 4).getFloat32(0, !1),
271
- (e) => Xe(e, 8).getFloat64(0, !1),
272
- (e) => Xe(e, 8).getBigInt64(0, !1),
275
+ Ze,
276
+ (e) => Qe(e, 4).getFloat32(0, !1),
277
+ (e) => Qe(e, 8).getFloat64(0, !1),
278
+ (e) => Qe(e, 8).getBigInt64(0, !1),
273
279
  (e) => !1,
274
280
  (e) => !0,
275
281
  D,
@@ -277,49 +283,49 @@ var ye = (e, t) => d(t, () => e).join(""), be = class {
277
283
  let t = E(e), n = {};
278
284
  for (let r = 0; r < t; r++) {
279
285
  let t = D(e);
280
- n[t] = Qe(e);
286
+ n[t] = et(e);
281
287
  }
282
288
  return n;
283
289
  },
284
290
  (e) => {
285
291
  let t = E(e), n = [];
286
- for (let r = 0; r < t; r++) n.push(Qe(e));
292
+ for (let r = 0; r < t; r++) n.push(et(e));
287
293
  return n;
288
294
  },
289
295
  T
290
- ], Qe = (e) => Ze[127 - Je(e)](e), $e = class extends Ge {
296
+ ], et = (e) => $e[127 - Xe(e)](e), tt = class extends qe {
291
297
  constructor(e, t) {
292
298
  super(e), this.reader = t, this.s = null, this.count = 0;
293
299
  }
294
300
  read() {
295
- return this.count === 0 && (this.s = this.reader(this), this.count = Ke(this) ? E(this) + 1 : -1), this.count--, this.s;
301
+ return this.count === 0 && (this.s = this.reader(this), this.count = Je(this) ? E(this) + 1 : -1), this.count--, this.s;
296
302
  }
297
- }, et = class extends Ge {
303
+ }, nt = class extends qe {
298
304
  constructor(e) {
299
305
  super(e), this.s = 0, this.count = 0;
300
306
  }
301
307
  read() {
302
308
  if (this.count === 0) {
303
- this.s = Ye(this);
309
+ this.s = Ze(this);
304
310
  let e = ie(this.s);
305
311
  this.count = 1, e && (this.s = -this.s, this.count = E(this) + 2);
306
312
  }
307
313
  return this.count--, this.s;
308
314
  }
309
- }, tt = class extends Ge {
315
+ }, rt = class extends qe {
310
316
  constructor(e) {
311
317
  super(e), this.s = 0, this.count = 0, this.diff = 0;
312
318
  }
313
319
  read() {
314
320
  if (this.count === 0) {
315
- let e = Ye(this), t = e & 1;
321
+ let e = Ze(this), t = e & 1;
316
322
  this.diff = m(e / 2), this.count = 1, t && (this.count = E(this) + 2);
317
323
  }
318
324
  return this.s += this.diff, this.count--, this.s;
319
325
  }
320
- }, nt = class {
326
+ }, it = class {
321
327
  constructor(e) {
322
- this.decoder = new et(e), this.str = D(this.decoder), this.spos = 0;
328
+ this.decoder = new nt(e), this.str = D(this.decoder), this.spos = 0;
323
329
  }
324
330
  read() {
325
331
  let e = this.spos + this.decoder.read(), t = this.str.slice(this.spos, e);
@@ -327,11 +333,11 @@ var ye = (e, t) => d(t, () => e).join(""), be = class {
327
333
  }
328
334
  };
329
335
  crypto.subtle;
330
- var rt = crypto.getRandomValues.bind(crypto), it = Math.random, at = () => rt(/* @__PURE__ */ new Uint32Array(1))[0], ot = (e) => e[m(it() * e.length)], st = "10000000-1000-4000-8000-100000000000", ct = () => st.replace(/[018]/g, (e) => (e ^ at() & 15 >> e / 4).toString(16)), lt = Date.now, ut = (e) => new Promise(e);
336
+ var at = crypto.getRandomValues.bind(crypto), ot = Math.random, st = () => at(/* @__PURE__ */ new Uint32Array(1))[0], ct = (e) => e[m(ot() * e.length)], lt = "10000000-1000-4000-8000-100000000000", ut = () => lt.replace(/[018]/g, (e) => (e ^ st() & 15 >> e / 4).toString(16)), dt = Date.now, ft = (e) => new Promise(e);
331
337
  Promise.all.bind(Promise);
332
- // ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/conditions.js
338
+ // ../node_modules/.bun/lib0@0.2.120/node_modules/lib0/conditions.js
333
339
  /* c8 ignore next */
334
- var dt = (e) => e === void 0 ? null : e, ft = new class {
340
+ var pt = (e) => e === void 0 ? null : e, mt = new class {
335
341
  constructor() {
336
342
  this.map = /* @__PURE__ */ new Map();
337
343
  }
@@ -341,41 +347,41 @@ var dt = (e) => e === void 0 ? null : e, ft = new class {
341
347
  getItem(e) {
342
348
  return this.map.get(e);
343
349
  }
344
- }(), pt = !0;
350
+ }(), ht = !0;
345
351
  /* c8 ignore start */
346
352
  try {
347
- typeof localStorage < "u" && localStorage && (ft = localStorage, pt = !1);
353
+ typeof window < "u" && typeof localStorage < "u" && localStorage && (mt = localStorage, ht = !1);
348
354
  } catch {}
349
355
  /* c8 ignore stop */
350
356
  /* c8 ignore next */
351
- var mt = ft, ht = (e) => pt || addEventListener("storage", e), gt = (e) => pt || removeEventListener("storage", e), _t = Symbol("Equality"), vt = (e, t) => e === t || !!e?.[_t]?.(t) || !1, yt = (e) => typeof e == "object", bt = Object.assign, xt = Object.keys, St = (e, t) => {
357
+ var gt = mt, _t = (e) => ht || addEventListener("storage", e), vt = (e) => ht || removeEventListener("storage", e), yt = Symbol("Equality"), bt = (e, t) => e === t || !!e?.[yt]?.(t) || !1, xt = (e) => typeof e == "object", St = Object.assign, Ct = Object.keys, wt = (e, t) => {
352
358
  for (let n in e) t(e[n], n);
353
- }, Ct = (e, t) => {
359
+ }, Tt = (e, t) => {
354
360
  let n = [];
355
361
  for (let r in e) n.push(t(e[r], r));
356
362
  return n;
357
- }, wt = (e) => xt(e).length, Tt = (e) => {
363
+ }, Et = (e) => Ct(e).length, Dt = (e) => {
358
364
  for (let t in e) return !1;
359
365
  return !0;
360
- }, Et = (e, t) => {
366
+ }, Ot = (e, t) => {
361
367
  for (let n in e) if (!t(e[n], n)) return !1;
362
368
  return !0;
363
- }, Dt = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Ot = (e, t) => e === t || wt(e) === wt(t) && Et(e, (e, n) => (e !== void 0 || Dt(t, n)) && vt(t[n], e)), kt = Object.freeze, At = (e) => {
369
+ }, kt = (e, t) => Object.prototype.hasOwnProperty.call(e, t), At = (e, t) => e === t || Et(e) === Et(t) && Ot(e, (e, n) => (e !== void 0 || kt(t, n)) && bt(t[n], e)), jt = Object.freeze, Mt = (e) => {
364
370
  for (let t in e) {
365
371
  let n = e[t];
366
- (typeof n == "object" || typeof n == "function") && At(e[t]);
372
+ (typeof n == "object" || typeof n == "function") && Mt(e[t]);
367
373
  }
368
- return kt(e);
369
- }, jt = (e, t, n = 0) => {
374
+ return jt(e);
375
+ }, Nt = (e, t, n = 0) => {
370
376
  try {
371
377
  for (; n < e.length; n++) e[n](...t);
372
378
  } finally {
373
- n < e.length && jt(e, t, n + 1);
379
+ n < e.length && Nt(e, t, n + 1);
374
380
  }
375
- }, Mt = (e) => e, Nt = (e, t) => {
381
+ }, Pt = (e) => e, Ft = (e, t) => {
376
382
  if (e === t) return !0;
377
383
  if (e == null || t == null || e.constructor !== t.constructor && (e.constructor || Object) !== (t.constructor || Object)) return !1;
378
- if (e[_t] != null) return e[_t](t);
384
+ if (e[yt] != null) return e[yt](t);
379
385
  switch (e.constructor) {
380
386
  case ArrayBuffer: e = new Uint8Array(e), t = new Uint8Array(t);
381
387
  case Uint8Array:
@@ -388,30 +394,30 @@ var mt = ft, ht = (e) => pt || addEventListener("storage", e), gt = (e) => pt ||
388
394
  break;
389
395
  case Map:
390
396
  if (e.size !== t.size) return !1;
391
- for (let n of e.keys()) if (!t.has(n) || !Nt(e.get(n), t.get(n))) return !1;
397
+ for (let n of e.keys()) if (!t.has(n) || !Ft(e.get(n), t.get(n))) return !1;
392
398
  break;
393
399
  case void 0:
394
400
  case Object:
395
- if (wt(e) !== wt(t)) return !1;
396
- for (let n in e) if (!Dt(e, n) || !Nt(e[n], t[n])) return !1;
401
+ if (Et(e) !== Et(t)) return !1;
402
+ for (let n in e) if (!kt(e, n) || !Ft(e[n], t[n])) return !1;
397
403
  break;
398
404
  case Array:
399
405
  if (e.length !== t.length) return !1;
400
- for (let n = 0; n < e.length; n++) if (!Nt(e[n], t[n])) return !1;
406
+ for (let n = 0; n < e.length; n++) if (!Ft(e[n], t[n])) return !1;
401
407
  break;
402
408
  default: return !1;
403
409
  }
404
410
  return !0;
405
- }, Pt = (e, t) => t.includes(e), O = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", Ft = typeof window < "u" && typeof document < "u" && !O;
411
+ }, It = (e, t) => t.includes(e), O = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", Lt = typeof window < "u" && typeof document < "u" && !O;
406
412
  typeof navigator < "u" && /Mac/.test(navigator.platform);
407
- var k, It = [], Lt = () => {
413
+ var k, Rt = [], zt = () => {
408
414
  if (k === void 0) {
409
415
  if (O) {
410
416
  k = e();
411
417
  let t = process.argv, n = null;
412
418
  for (let e = 0; e < t.length; e++) {
413
419
  let r = t[e];
414
- r[0] === "-" ? (n !== null && k.set(n, ""), n = r) : n === null ? It.push(r) : (k.set(n, r), n = null);
420
+ r[0] === "-" ? (n !== null && k.set(n, ""), n = r) : n === null ? Rt.push(r) : (k.set(n, r), n = null);
415
421
  }
416
422
  n !== null && k.set(n, "");
417
423
  } else typeof location == "object" ? (k = e(), (location.search || "?").slice(1).split("&").forEach((e) => {
@@ -422,33 +428,30 @@ var k, It = [], Lt = () => {
422
428
  })) : k = e();
423
429
  }
424
430
  return k;
425
- }, Rt = (e) => Lt().has(e), zt = (e) => dt(O ? process.env[e.toUpperCase().replaceAll("-", "_")] : mt.getItem(e)), Bt = (e) => Rt("--" + e) || zt(e) !== null, Vt = Bt("production"), Ht = O && Pt(process.env.FORCE_COLOR, [
431
+ }, Bt = (e) => zt().has(e), Vt = (e) => pt(O ? process.env[e.toUpperCase().replaceAll("-", "_")] : gt.getItem(e)), Ht = (e) => Bt("--" + e) || Vt(e) !== null, Ut = Ht("production"), Wt = O && It(process.env.FORCE_COLOR, [
426
432
  "true",
427
433
  "1",
428
434
  "2"
429
- ]) || !Rt("--no-colors") && !Bt("no-color") && (!O || process.stdout.isTTY) && (!O || Rt("--color") || zt("COLORTERM") !== null || (zt("TERM") || "").includes("color")), Ut = (e) => new Uint8Array(e), Wt = (e, t, n) => new Uint8Array(e, t, n), Gt = (e) => new Uint8Array(e), Kt = (e) => {
435
+ ]) || !Bt("--no-colors") && !Ht("no-color") && (!O || process.stdout.isTTY) && (!O || Bt("--color") || Vt("COLORTERM") !== null || (Vt("TERM") || "").includes("color")), Gt = (e) => new Uint8Array(e), Kt = (e) => new Uint8Array(e), qt = (e) => {
430
436
  let t = "";
431
437
  for (let n = 0; n < e.byteLength; n++) t += le(e[n]);
432
438
  return btoa(t);
433
- }, qt = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), Jt = (e) => {
434
- let t = atob(e), n = Ut(t.length);
439
+ }, Jt = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), Yt = (e) => {
440
+ let t = atob(e), n = Gt(t.length);
435
441
  for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
436
442
  return n;
437
- }, Yt = (e) => {
438
- let t = Buffer.from(e, "base64");
439
- return Wt(t.buffer, t.byteOffset, t.byteLength);
440
- }, Xt = Ft ? Kt : qt, Zt = Ft ? Jt : Yt, Qt = (e) => {
441
- let t = Ut(e.byteLength);
443
+ }, Xt = (e) => new Uint8Array(Buffer.from(e, "base64")), Zt = Lt ? qt : Jt, Qt = Lt ? Yt : Xt, $t = (e) => {
444
+ let t = Gt(e.byteLength);
442
445
  return t.set(e), t;
443
- }, $t = (e) => Se((t) => Ie(t, e)), en = class {
446
+ }, en = (e) => Se((t) => Ie(t, e)), tn = class {
444
447
  constructor(e, t) {
445
448
  this.left = e, this.right = t;
446
449
  }
447
- }, A = (e, t) => new en(e, t), tn = (e) => e.next() >= .5, nn = (e, t, n) => m(e.next() * (n + 1 - t) + t), rn = (e, t, n) => m(e.next() * (n + 1 - t) + t), an = (e, t, n) => rn(e, t, n), on = (e) => le(an(e, 97, 122)), sn = (e, t = 0, n = 20) => {
448
- let r = an(e, t, n), i = "";
449
- for (let t = 0; t < r; t++) i += on(e);
450
+ }, A = (e, t) => new tn(e, t), nn = (e) => e.next() >= .5, rn = (e, t, n) => m(e.next() * (n + 1 - t) + t), an = (e, t, n) => m(e.next() * (n + 1 - t) + t), on = (e, t, n) => an(e, t, n), sn = (e) => le(on(e, 97, 122)), cn = (e, t = 0, n = 20) => {
451
+ let r = on(e, t, n), i = "";
452
+ for (let t = 0; t < r; t++) i += sn(e);
450
453
  return i;
451
- }, cn = (e, t) => t[an(e, 0, t.length - 1)], ln = Symbol("0schema"), un = class {
454
+ }, ln = (e, t) => t[on(e, 0, t.length - 1)], un = Symbol("0schema"), dn = class {
452
455
  constructor() {
453
456
  this._rerrs = [];
454
457
  }
@@ -469,19 +472,19 @@ var k, It = [], Lt = () => {
469
472
  }
470
473
  return e.join("\n");
471
474
  }
472
- }, dn = (e, t) => e === t ? !0 : e == null || t == null || e.constructor !== t.constructor ? !1 : e[_t] ? vt(e, t) : f(e) ? l(e, (e) => u(t, (t) => dn(e, t))) : yt(e) ? Et(e, (e, n) => dn(e, t[n])) : !1, j = class {
475
+ }, fn = (e, t) => e === t ? !0 : e == null || t == null || e.constructor !== t.constructor ? !1 : e[yt] ? bt(e, t) : f(e) ? l(e, (e) => u(t, (t) => fn(e, t))) : xt(e) ? Ot(e, (e, n) => fn(e, t[n])) : !1, j = class {
473
476
  static _dilutes = !1;
474
477
  extends(e) {
475
478
  let [t, n] = [this.shape, e.shape];
476
- return this.constructor._dilutes && ([n, t] = [t, n]), dn(t, n);
479
+ return this.constructor._dilutes && ([n, t] = [t, n]), fn(t, n);
477
480
  }
478
481
  equals(e) {
479
- return this.constructor === e.constructor && Nt(this.shape, e.shape);
482
+ return this.constructor === e.constructor && Ft(this.shape, e.shape);
480
483
  }
481
- [ln]() {
484
+ [un]() {
482
485
  return !0;
483
486
  }
484
- [_t](e) {
487
+ [yt](e) {
485
488
  return this.equals(e);
486
489
  }
487
490
  validate(e) {
@@ -493,18 +496,18 @@ var k, It = [], Lt = () => {
493
496
  }
494
497
  /* c8 ignore stop */
495
498
  get nullable() {
496
- return Hn(this, rr);
499
+ return Un(this, ir);
497
500
  }
498
501
  get optional() {
499
- return new bn(this);
502
+ return new xn(this);
500
503
  }
501
504
  cast(e) {
502
- return sr(e, this), e;
505
+ return cr(e, this), e;
503
506
  }
504
507
  expect(e) {
505
- return sr(e, this), e;
508
+ return cr(e, this), e;
506
509
  }
507
- }, fn = class extends j {
510
+ }, pn = class extends j {
508
511
  constructor(e, t) {
509
512
  super(), this.shape = e, this._c = t;
510
513
  }
@@ -512,9 +515,9 @@ var k, It = [], Lt = () => {
512
515
  let n = e?.constructor === this.shape && (this._c == null || this._c(e));
513
516
  return !n && t?.extend(null, this.shape.name, e?.constructor.name, e?.constructor === this.shape ? "Check failed" : "Constructor match failed"), n;
514
517
  }
515
- }, M = (e, t = null) => new fn(e, t);
516
- M(fn);
517
- var pn = class extends j {
518
+ }, M = (e, t = null) => new pn(e, t);
519
+ M(pn);
520
+ var mn = class extends j {
518
521
  constructor(e) {
519
522
  super(), this.shape = e;
520
523
  }
@@ -522,9 +525,9 @@ var pn = class extends j {
522
525
  let n = this.shape(e);
523
526
  return !n && t?.extend(null, "custom prop", e?.constructor.name, "failed to check custom prop"), n;
524
527
  }
525
- }, N = (e) => new pn(e);
526
- M(pn);
527
- var mn = class extends j {
528
+ }, N = (e) => new mn(e);
529
+ M(mn);
530
+ var hn = class extends j {
528
531
  constructor(e) {
529
532
  super(), this.shape = e;
530
533
  }
@@ -532,25 +535,25 @@ var mn = class extends j {
532
535
  let n = this.shape.some((t) => t === e);
533
536
  return !n && t?.extend(null, this.shape.join(" | "), e.toString()), n;
534
537
  }
535
- }, hn = (...e) => new mn(e), gn = M(mn), _n = RegExp.escape || ((e) => e.replace(/[().|&,$^[\]]/g, (e) => "\\" + e)), vn = (e) => {
536
- if (Qn.check(e)) return [_n(e)];
537
- if (gn.check(e)) return e.shape.map((e) => e + "");
538
- if (Zn.check(e)) return ["[+-]?\\d+.?\\d*"];
539
- if ($n.check(e)) return [".*"];
540
- if (Un.check(e)) return e.shape.map(vn).flat(1);
538
+ }, gn = (...e) => new hn(e), _n = M(hn), vn = RegExp.escape || ((e) => e.replace(/[().|&,$^[\]]/g, (e) => "\\" + e)), yn = (e) => {
539
+ if ($n.check(e)) return [vn(e)];
540
+ if (_n.check(e)) return e.shape.map((e) => e + "");
541
+ if (Qn.check(e)) return ["[+-]?\\d+.?\\d*"];
542
+ if (er.check(e)) return [".*"];
543
+ if (Wn.check(e)) return e.shape.map(yn).flat(1);
541
544
  /* c8 ignore next 2 */
542
545
  C();
543
546
  };
544
547
  M(class extends j {
545
548
  constructor(e) {
546
- super(), this.shape = e, this._r = RegExp("^" + e.map(vn).map((e) => `(${e.join("|")})`).join("") + "$");
549
+ super(), this.shape = e, this._r = RegExp("^" + e.map(yn).map((e) => `(${e.join("|")})`).join("") + "$");
547
550
  }
548
551
  check(e, t) {
549
552
  let n = this._r.exec(e) != null;
550
553
  return !n && t?.extend(null, this._r.toString(), e.toString(), "String doesn't match string template."), n;
551
554
  }
552
555
  });
553
- var yn = Symbol("optional"), bn = class extends j {
556
+ var bn = Symbol("optional"), xn = class extends j {
554
557
  constructor(e) {
555
558
  super(), this.shape = e;
556
559
  }
@@ -558,16 +561,16 @@ var yn = Symbol("optional"), bn = class extends j {
558
561
  let n = e === void 0 || this.shape.check(e);
559
562
  return !n && t?.extend(null, "undefined (optional)", "()"), n;
560
563
  }
561
- get [yn]() {
564
+ get [bn]() {
562
565
  return !0;
563
566
  }
564
- }, xn = M(bn), Sn = class extends j {
567
+ }, Sn = M(xn), Cn = class extends j {
565
568
  check(e, t) {
566
569
  return t?.extend(null, "never", typeof e), !1;
567
570
  }
568
571
  };
569
- new Sn(), M(Sn);
570
- var Cn = class e extends j {
572
+ new Cn(), M(Cn);
573
+ var wn = class e extends j {
571
574
  constructor(e, t = !1) {
572
575
  super(), this.shape = e, this._isPartial = t;
573
576
  }
@@ -578,12 +581,12 @@ var Cn = class e extends j {
578
581
  check(e, t) {
579
582
  return e == null ?
580
583
  /* c8 ignore next */
581
- (t?.extend(null, "object", "null"), !1) : Et(this.shape, (n, r) => {
582
- let i = this._isPartial && !Dt(e, r) || n.check(e[r], t);
584
+ (t?.extend(null, "object", "null"), !1) : Ot(this.shape, (n, r) => {
585
+ let i = this._isPartial && !kt(e, r) || n.check(e[r], t);
583
586
  return !i && t?.extend(r.toString(), n.toString(), typeof e[r], "Object property does not match"), i;
584
587
  });
585
588
  }
586
- }, wn = (e) => new Cn(e), Tn = M(Cn), En = N((e) => e != null && (e.constructor === Object || e.constructor == null)), Dn = class extends j {
589
+ }, Tn = (e) => new wn(e), En = M(wn), Dn = N((e) => e != null && (e.constructor === Object || e.constructor == null)), On = class extends j {
587
590
  constructor(e, t) {
588
591
  super(), this.shape = {
589
592
  keys: e,
@@ -591,32 +594,32 @@ var Cn = class e extends j {
591
594
  };
592
595
  }
593
596
  check(e, t) {
594
- return e != null && Et(e, (n, r) => {
597
+ return e != null && Ot(e, (n, r) => {
595
598
  let i = this.shape.keys.check(r, t);
596
599
  return !i && t?.extend(r + "", "Record", typeof e, i ? "Key doesn't match schema" : "Value doesn't match value"), i && this.shape.values.check(n, t);
597
600
  });
598
601
  }
599
- }, On = (e, t) => new Dn(e, t), kn = M(Dn), An = class extends j {
602
+ }, kn = (e, t) => new On(e, t), An = M(On), jn = class extends j {
600
603
  constructor(e) {
601
604
  super(), this.shape = e;
602
605
  }
603
606
  check(e, t) {
604
- return e != null && Et(this.shape, (n, r) => {
607
+ return e != null && Ot(this.shape, (n, r) => {
605
608
  let i = n.check(e[r], t);
606
609
  return !i && t?.extend(r.toString(), "Tuple", typeof n), i;
607
610
  });
608
611
  }
609
- }, jn = (...e) => new An(e);
610
- M(An);
611
- var Mn = class extends j {
612
+ }, Mn = (...e) => new jn(e);
613
+ M(jn);
614
+ var Nn = class extends j {
612
615
  constructor(e) {
613
- super(), this.shape = e.length === 1 ? e[0] : new Vn(e);
616
+ super(), this.shape = e.length === 1 ? e[0] : new Hn(e);
614
617
  }
615
618
  check(e, t) {
616
619
  let n = f(e) && l(e, (e) => this.shape.check(e));
617
620
  return !n && t?.extend(null, "Array", ""), n;
618
621
  }
619
- }, Nn = (...e) => new Mn(e), Pn = M(Mn), Fn = N((e) => f(e)), In = class extends j {
622
+ }, Pn = (...e) => new Nn(e), Fn = M(Nn), In = N((e) => f(e)), Ln = class extends j {
620
623
  constructor(e, t) {
621
624
  super(), this.shape = e, this._c = t;
622
625
  }
@@ -624,17 +627,17 @@ var Mn = class extends j {
624
627
  let n = e instanceof this.shape && (this._c == null || this._c(e));
625
628
  return !n && t?.extend(null, this.shape.name, e?.constructor.name), n;
626
629
  }
627
- }, Ln = (e, t = null) => new In(e, t);
628
- M(In);
629
- var Rn = Ln(j), zn = M(class extends j {
630
+ }, Rn = (e, t = null) => new Ln(e, t);
631
+ M(Ln);
632
+ var zn = Rn(j), Bn = M(class extends j {
630
633
  constructor(e) {
631
- super(), this.len = e.length - 1, this.args = jn(...e.slice(-1)), this.res = e[this.len];
634
+ super(), this.len = e.length - 1, this.args = Mn(...e.slice(-1)), this.res = e[this.len];
632
635
  }
633
636
  check(e, t) {
634
637
  let n = e.constructor === Function && e.length <= this.len;
635
638
  return !n && t?.extend(null, "function", typeof e), n;
636
639
  }
637
- }), Bn = N((e) => typeof e == "function");
640
+ }), Vn = N((e) => typeof e == "function");
638
641
  M(class extends j {
639
642
  constructor(e) {
640
643
  super(), this.shape = e;
@@ -644,7 +647,7 @@ M(class extends j {
644
647
  return !n && t?.extend(null, "Intersectinon", typeof e), n;
645
648
  }
646
649
  }, (e) => e.shape.length > 0);
647
- var Vn = class extends j {
650
+ var Hn = class extends j {
648
651
  static _dilutes = !0;
649
652
  constructor(e) {
650
653
  super(), this.shape = e;
@@ -653,44 +656,44 @@ var Vn = class extends j {
653
656
  let n = u(this.shape, (n) => n.check(e, t));
654
657
  return t?.extend(null, "Union", typeof e), n;
655
658
  }
656
- }, Hn = (...e) => e.findIndex((e) => Un.check(e)) >= 0 ? Hn(...e.map((e) => or(e)).map((e) => Un.check(e) ? e.shape : [e]).flat(1)) : e.length === 1 ? e[0] : new Vn(e), Un = M(Vn), Wn = () => !0, Gn = N(Wn), Kn = M(pn, (e) => e.shape === Wn), qn = N((e) => typeof e == "bigint"), Jn = N((e) => e === qn), Yn = N((e) => typeof e == "symbol");
657
- N((e) => e === Yn);
658
- var Xn = N((e) => typeof e == "number"), Zn = N((e) => e === Xn), Qn = N((e) => typeof e == "string"), $n = N((e) => e === Qn), er = N((e) => typeof e == "boolean"), tr = N((e) => e === er), nr = hn(void 0);
659
- M(mn, (e) => e.shape.length === 1 && e.shape[0] === void 0), hn(void 0);
660
- var rr = hn(null), ir = M(mn, (e) => e.shape.length === 1 && e.shape[0] === null);
661
- M(Uint8Array), M(fn, (e) => e.shape === Uint8Array);
662
- var ar = Hn(Xn, Qn, rr, nr, qn, er, Yn);
659
+ }, Un = (...e) => e.findIndex((e) => Wn.check(e)) >= 0 ? Un(...e.map((e) => sr(e)).map((e) => Wn.check(e) ? e.shape : [e]).flat(1)) : e.length === 1 ? e[0] : new Hn(e), Wn = M(Hn), Gn = () => !0, Kn = N(Gn), qn = M(mn, (e) => e.shape === Gn), Jn = N((e) => typeof e == "bigint"), Yn = N((e) => e === Jn), Xn = N((e) => typeof e == "symbol");
660
+ N((e) => e === Xn);
661
+ var Zn = N((e) => typeof e == "number"), Qn = N((e) => e === Zn), $n = N((e) => typeof e == "string"), er = N((e) => e === $n), tr = N((e) => typeof e == "boolean"), nr = N((e) => e === tr), rr = gn(void 0);
662
+ M(hn, (e) => e.shape.length === 1 && e.shape[0] === void 0), gn(void 0);
663
+ var ir = gn(null), ar = M(hn, (e) => e.shape.length === 1 && e.shape[0] === null);
664
+ M(Uint8Array), M(pn, (e) => e.shape === Uint8Array);
665
+ var or = Un(Zn, $n, ir, rr, Jn, tr, Xn);
663
666
  (() => {
664
- let e = Nn(Gn), t = On(Qn, Gn), n = Hn(Xn, Qn, rr, er, e, t);
667
+ let e = Pn(Kn), t = kn($n, Kn), n = Un(Zn, $n, ir, tr, e, t);
665
668
  return e.shape = n, t.shape.values = n, n;
666
669
  })();
667
- var or = (e) => {
668
- if (Rn.check(e)) return e;
669
- if (En.check(e)) {
670
+ var sr = (e) => {
671
+ if (zn.check(e)) return e;
672
+ if (Dn.check(e)) {
670
673
  let t = {};
671
- for (let n in e) t[n] = or(e[n]);
672
- return wn(t);
674
+ for (let n in e) t[n] = sr(e[n]);
675
+ return Tn(t);
673
676
  }
674
- if (Fn.check(e)) return Hn(...e.map(or));
675
- if (ar.check(e)) return hn(e);
676
- if (Bn.check(e)) return M(e);
677
+ if (In.check(e)) return Un(...e.map(sr));
678
+ if (or.check(e)) return gn(e);
679
+ if (Vn.check(e)) return M(e);
677
680
  /* c8 ignore next */
678
681
  C();
679
- }, sr = Vt ? () => {} : (e, t) => {
680
- let n = new un();
682
+ }, cr = Ut ? () => {} : (e, t) => {
683
+ let n = new dn();
681
684
  if (!t.check(e, n)) throw x(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`);
682
- }, cr = class {
685
+ }, lr = class {
683
686
  constructor(e) {
684
687
  this.patterns = [], this.$state = e;
685
688
  }
686
689
  if(e, t) {
687
690
  return this.patterns.push({
688
- if: or(e),
691
+ if: sr(e),
689
692
  h: t
690
693
  }), this;
691
694
  }
692
695
  else(e) {
693
- return this.if(Gn, e);
696
+ return this.if(Kn, e);
694
697
  }
695
698
  done() {
696
699
  return (e, t) => {
@@ -701,51 +704,51 @@ var or = (e) => {
701
704
  throw x("Unhandled pattern");
702
705
  };
703
706
  }
704
- }, lr = ((e) => new cr(e))(Gn).if(Zn, (e, t) => nn(t, se, oe)).if($n, (e, t) => sn(t)).if(tr, (e, t) => tn(t)).if(Jn, (e, t) => BigInt(nn(t, se, oe))).if(Un, (e, t) => ur(t, cn(t, e.shape))).if(Tn, (e, t) => {
707
+ }, ur = ((e) => new lr(e))(Kn).if(Qn, (e, t) => rn(t, se, oe)).if(er, (e, t) => cn(t)).if(nr, (e, t) => nn(t)).if(Yn, (e, t) => BigInt(rn(t, se, oe))).if(Wn, (e, t) => dr(t, ln(t, e.shape))).if(En, (e, t) => {
705
708
  let n = {};
706
709
  for (let r in e.shape) {
707
710
  let i = e.shape[r];
708
- if (xn.check(i)) {
709
- if (tn(t)) continue;
711
+ if (Sn.check(i)) {
712
+ if (nn(t)) continue;
710
713
  i = i.shape;
711
714
  }
712
- n[r] = lr(i, t);
715
+ n[r] = ur(i, t);
713
716
  }
714
717
  return n;
715
- }).if(Pn, (e, t) => {
716
- let n = [], r = rn(t, 0, 42);
717
- for (let i = 0; i < r; i++) n.push(ur(t, e.shape));
718
+ }).if(Fn, (e, t) => {
719
+ let n = [], r = an(t, 0, 42);
720
+ for (let i = 0; i < r; i++) n.push(dr(t, e.shape));
718
721
  return n;
719
- }).if(gn, (e, t) => cn(t, e.shape)).if(ir, (e, t) => null).if(zn, (e, t) => {
720
- let n = ur(t, e.res);
722
+ }).if(_n, (e, t) => ln(t, e.shape)).if(ar, (e, t) => null).if(Bn, (e, t) => {
723
+ let n = dr(t, e.res);
721
724
  return () => n;
722
- }).if(Kn, (e, t) => ur(t, cn(t, [
723
- Xn,
724
- Qn,
725
+ }).if(qn, (e, t) => dr(t, ln(t, [
726
+ Zn,
727
+ $n,
728
+ ir,
725
729
  rr,
726
- nr,
727
- qn,
728
- er,
729
- Nn(Xn),
730
- On(Hn("a", "b", "c"), Xn)
731
- ]))).if(kn, (e, t) => {
732
- let n = {}, r = nn(t, 0, 3);
730
+ Jn,
731
+ tr,
732
+ Pn(Zn),
733
+ kn(Un("a", "b", "c"), Zn)
734
+ ]))).if(An, (e, t) => {
735
+ let n = {}, r = rn(t, 0, 3);
733
736
  for (let i = 0; i < r; i++) {
734
- let r = ur(t, e.shape.keys);
735
- n[r] = ur(t, e.shape.values);
737
+ let r = dr(t, e.shape.keys);
738
+ n[r] = dr(t, e.shape.values);
736
739
  }
737
740
  return n;
738
- }).done(), ur = (e, t) => lr(or(t), e), P = typeof document < "u" ? document : {};
739
- N((e) => e.nodeType === hr), typeof DOMParser < "u" && new DOMParser(), N((e) => e.nodeType === fr), N((e) => e.nodeType === pr);
740
- var dr = (e) => r(e, (e, t) => `${t}:${e};`).join(""), fr = P.ELEMENT_NODE, pr = P.TEXT_NODE;
741
+ }).done(), dr = (e, t) => ur(sr(t), e), P = typeof document < "u" ? document : {};
742
+ N((e) => e.nodeType === gr), typeof DOMParser < "u" && new DOMParser(), N((e) => e.nodeType === pr), N((e) => e.nodeType === mr);
743
+ var fr = (e) => r(e, (e, t) => `${t}:${e};`).join(""), pr = P.ELEMENT_NODE, mr = P.TEXT_NODE;
741
744
  P.CDATA_SECTION_NODE, P.COMMENT_NODE;
742
- var mr = P.DOCUMENT_NODE;
745
+ var hr = P.DOCUMENT_NODE;
743
746
  P.DOCUMENT_TYPE_NODE;
744
- var hr = P.DOCUMENT_FRAGMENT_NODE;
745
- N((e) => e.nodeType === mr);
747
+ var gr = P.DOCUMENT_FRAGMENT_NODE;
748
+ N((e) => e.nodeType === hr);
746
749
  /* c8 ignore stop */
747
- // ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/symbol.js
748
- var F = Symbol, gr = F(), _r = F(), vr = F(), yr = F(), br = F(), xr = F(), Sr = F(), Cr = F(), wr = F(), Tr = (e) => {
750
+ // ../node_modules/.bun/lib0@0.2.120/node_modules/lib0/symbol.js
751
+ var F = Symbol, _r = F(), vr = F(), yr = F(), br = F(), xr = F(), Sr = F(), Cr = F(), wr = F(), Tr = F(), Er = (e) => {
749
752
  e.length === 1 && e[0]?.constructor === Function && (e = e[0]());
750
753
  let t = [], n = [], r = 0;
751
754
  for (; r < e.length; r++) {
@@ -760,29 +763,29 @@ var F = Symbol, gr = F(), _r = F(), vr = F(), yr = F(), br = F(), xr = F(), Sr =
760
763
  }
761
764
  return n;
762
765
  };
763
- lt();
766
+ dt();
764
767
  /* c8 ignore stop */
765
- // ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/logging.js
766
- var Er = {
767
- [gr]: A("font-weight", "bold"),
768
- [_r]: A("font-weight", "normal"),
769
- [vr]: A("color", "blue"),
770
- [br]: A("color", "green"),
771
- [yr]: A("color", "grey"),
772
- [xr]: A("color", "red"),
773
- [Sr]: A("color", "purple"),
774
- [Cr]: A("color", "orange"),
775
- [wr]: A("color", "black")
776
- }, Dr = Ht ? (t) => {
768
+ // ../node_modules/.bun/lib0@0.2.120/node_modules/lib0/logging.js
769
+ var Dr = {
770
+ [_r]: A("font-weight", "bold"),
771
+ [vr]: A("font-weight", "normal"),
772
+ [yr]: A("color", "blue"),
773
+ [xr]: A("color", "green"),
774
+ [br]: A("color", "grey"),
775
+ [Sr]: A("color", "red"),
776
+ [Cr]: A("color", "purple"),
777
+ [wr]: A("color", "orange"),
778
+ [Tr]: A("color", "black")
779
+ }, Or = Wt ? (t) => {
777
780
  t.length === 1 && t[0]?.constructor === Function && (t = t[0]());
778
781
  let n = [], r = [], i = e(), a = [], o = 0;
779
782
  for (; o < t.length; o++) {
780
- let e = t[o], a = Er[e];
783
+ let e = t[o], a = Dr[e];
781
784
  if (a !== void 0) i.set(a.left, a.right);
782
785
  else {
783
786
  if (e === void 0) break;
784
787
  if (e.constructor === String || e.constructor === Number) {
785
- let t = dr(i);
788
+ let t = fr(i);
786
789
  o > 0 || t.length > 0 ? (n.push("%c" + e), r.push(t)) : n.push(e);
787
790
  } else break;
788
791
  }
@@ -792,33 +795,33 @@ var Er = {
792
795
  e instanceof Symbol || a.push(e);
793
796
  }
794
797
  return a;
795
- } : Tr, Or = (...e) => {
798
+ } : Er, kr = (...e) => {
796
799
  /* c8 ignore next */
797
- console.log(...Dr(e)), Ar.forEach((t) => t.print(e));
798
- }, kr = (...e) => {
799
- console.warn(...Dr(e)), e.unshift(Cr), Ar.forEach((t) => t.print(e));
800
- }, Ar = a(), jr = (e) => ({
800
+ console.log(...Or(e)), jr.forEach((t) => t.print(e));
801
+ }, Ar = (...e) => {
802
+ console.warn(...Or(e)), e.unshift(wr), jr.forEach((t) => t.print(e));
803
+ }, jr = a(), Mr = (e) => ({
801
804
  [Symbol.iterator]() {
802
805
  return this;
803
806
  },
804
807
  next: e
805
- }), Mr = (e, t) => jr(() => {
808
+ }), Nr = (e, t) => Mr(() => {
806
809
  let n;
807
810
  do
808
811
  n = e.next();
809
812
  while (!n.done && !t(n.value));
810
813
  return n;
811
- }), Nr = (e, t) => jr(() => {
814
+ }), Pr = (e, t) => Mr(() => {
812
815
  let { done: n, value: r } = e.next();
813
816
  return {
814
817
  done: n,
815
818
  value: n ? void 0 : t(r)
816
819
  };
817
- }), Pr = class {
820
+ }), Fr = class {
818
821
  constructor(e, t) {
819
822
  this.clock = e, this.len = t;
820
823
  }
821
- }, Fr = class {
824
+ }, Ir = class {
822
825
  constructor() {
823
826
  this.clients = /* @__PURE__ */ new Map();
824
827
  }
@@ -826,9 +829,9 @@ var Er = {
826
829
  let i = e.doc.store.clients.get(r);
827
830
  if (i != null) {
828
831
  let r = i[i.length - 1], a = r.id.clock + r.length;
829
- for (let r = 0, o = t[r]; r < t.length && o.clock < a; o = t[++r]) qi(e, i, o.clock, o.len, n);
832
+ for (let r = 0, o = t[r]; r < t.length && o.clock < a; o = t[++r]) Yi(e, i, o.clock, o.len, n);
830
833
  }
831
- }), Ir = (e, t) => {
834
+ }), Lr = (e, t) => {
832
835
  let n = 0, r = e.length - 1;
833
836
  for (; n <= r;) {
834
837
  let i = m((n + r) / 2), a = e[i], o = a.clock;
@@ -838,21 +841,21 @@ var Er = {
838
841
  } else r = i - 1;
839
842
  }
840
843
  return null;
841
- }, Lr = (e, t) => {
844
+ }, Rr = (e, t) => {
842
845
  let n = e.clients.get(t.client);
843
- return n !== void 0 && Ir(n, t.clock) !== null;
844
- }, Rr = (e) => {
846
+ return n !== void 0 && Lr(n, t.clock) !== null;
847
+ }, zr = (e) => {
845
848
  e.clients.forEach((e) => {
846
849
  e.sort((e, t) => e.clock - t.clock);
847
850
  let t, n;
848
851
  for (t = 1, n = 1; t < e.length; t++) {
849
852
  let r = e[n - 1], i = e[t];
850
- r.clock + r.len >= i.clock ? e[n - 1] = new Pr(r.clock, h(r.len, i.clock + i.len - r.clock)) : (n < t && (e[n] = i), n++);
853
+ r.clock + r.len >= i.clock ? e[n - 1] = new Fr(r.clock, h(r.len, i.clock + i.len - r.clock)) : (n < t && (e[n] = i), n++);
851
854
  }
852
855
  e.length = n;
853
856
  });
854
- }, zr = (e) => {
855
- let t = new Fr();
857
+ }, Br = (e) => {
858
+ let t = new Ir();
856
859
  for (let n = 0; n < e.length; n++) e[n].clients.forEach((r, i) => {
857
860
  if (!t.clients.has(i)) {
858
861
  let a = r.slice();
@@ -860,11 +863,11 @@ var Er = {
860
863
  t.clients.set(i, a);
861
864
  }
862
865
  });
863
- return Rr(t), t;
864
- }, Br = (e, t, r, i) => {
865
- n(e.clients, t, () => []).push(new Pr(r, i));
866
- }, Vr = () => new Fr(), Hr = (e) => {
867
- let t = Vr();
866
+ return zr(t), t;
867
+ }, Vr = (e, t, r, i) => {
868
+ n(e.clients, t, () => []).push(new Fr(r, i));
869
+ }, Hr = () => new Ir(), Ur = (e) => {
870
+ let t = Hr();
868
871
  return e.clients.forEach((e, n) => {
869
872
  let r = [];
870
873
  for (let t = 0; t < e.length; t++) {
@@ -872,12 +875,12 @@ var Er = {
872
875
  if (n.deleted) {
873
876
  let i = n.id.clock, a = n.length;
874
877
  if (t + 1 < e.length) for (let n = e[t + 1]; t + 1 < e.length && n.deleted; n = e[++t + 1]) a += n.length;
875
- r.push(new Pr(i, a));
878
+ r.push(new Fr(i, a));
876
879
  }
877
880
  }
878
881
  r.length > 0 && t.clients.set(n, r);
879
882
  }), t;
880
- }, Ur = (e, t) => {
883
+ }, Wr = (e, t) => {
881
884
  v(e.restEncoder, t.clients.size), c(t.clients.entries()).sort((e, t) => t[0] - e[0]).forEach(([t, n]) => {
882
885
  e.resetDsCurVal(), v(e.restEncoder, t);
883
886
  let r = n.length;
@@ -887,44 +890,44 @@ var Er = {
887
890
  e.writeDsClock(r.clock), e.writeDsLen(r.len);
888
891
  }
889
892
  });
890
- }, Wr = (e) => {
891
- let t = new Fr(), r = E(e.restDecoder);
893
+ }, Gr = (e) => {
894
+ let t = new Ir(), r = E(e.restDecoder);
892
895
  for (let i = 0; i < r; i++) {
893
896
  e.resetDsCurVal();
894
897
  let r = E(e.restDecoder), i = E(e.restDecoder);
895
898
  if (i > 0) {
896
899
  let a = n(t.clients, r, () => []);
897
- for (let t = 0; t < i; t++) a.push(new Pr(e.readDsClock(), e.readDsLen()));
900
+ for (let t = 0; t < i; t++) a.push(new Fr(e.readDsClock(), e.readDsLen()));
898
901
  }
899
902
  }
900
903
  return t;
901
- }, Gr = (e, t, n) => {
902
- let r = new Fr(), i = E(e.restDecoder);
904
+ }, Kr = (e, t, n) => {
905
+ let r = new Ir(), i = E(e.restDecoder);
903
906
  for (let a = 0; a < i; a++) {
904
907
  e.resetDsCurVal();
905
908
  let i = E(e.restDecoder), a = E(e.restDecoder), o = n.clients.get(i) || [], s = B(n, i);
906
909
  for (let n = 0; n < a; n++) {
907
910
  let n = e.readDsClock(), a = n + e.readDsLen();
908
911
  if (n < s) {
909
- s < a && Br(r, i, s, a - s);
912
+ s < a && Vr(r, i, s, a - s);
910
913
  let e = V(o, n), c = o[e];
911
- for (!c.deleted && c.id.clock < n && (o.splice(e + 1, 0, ns(t, c, n - c.id.clock)), e++); e < o.length && (c = o[e++], c.id.clock < a);) c.deleted || (a < c.id.clock + c.length && o.splice(e, 0, ns(t, c, a - c.id.clock)), c.delete(t));
912
- } else Br(r, i, n, a - n);
914
+ for (!c.deleted && c.id.clock < n && (o.splice(e + 1, 0, is(t, c, n - c.id.clock)), e++); e < o.length && (c = o[e++], c.id.clock < a);) c.deleted || (a < c.id.clock + c.length && o.splice(e, 0, is(t, c, a - c.id.clock)), c.delete(t));
915
+ } else Vr(r, i, n, a - n);
913
916
  }
914
917
  }
915
918
  if (r.clients.size > 0) {
916
919
  let e = new L();
917
- return v(e.restEncoder, 0), Ur(e, r), e.toUint8Array();
920
+ return v(e.restEncoder, 0), Wr(e, r), e.toUint8Array();
918
921
  }
919
922
  return null;
920
- }, Kr = at, qr = class e extends p {
921
- constructor({ guid: e = ct(), collectionid: t = null, gc: n = !0, gcFilter: r = () => !0, meta: i = null, autoLoad: a = !1, shouldLoad: o = !0 } = {}) {
922
- super(), this.gc = n, this.gcFilter = r, this.clientID = Kr(), this.guid = e, this.collectionid = t, this.share = /* @__PURE__ */ new Map(), this.store = new Bi(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = o, this.autoLoad = a, this.meta = i, this.isLoaded = !1, this.isSynced = !1, this.isDestroyed = !1, this.whenLoaded = ut((e) => {
923
+ }, qr = st, Jr = class e extends p {
924
+ constructor({ guid: e = ut(), collectionid: t = null, gc: n = !0, gcFilter: r = () => !0, meta: i = null, autoLoad: a = !1, shouldLoad: o = !0 } = {}) {
925
+ super(), this.gc = n, this.gcFilter = r, this.clientID = qr(), this.guid = e, this.collectionid = t, this.share = /* @__PURE__ */ new Map(), this.store = new Hi(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = o, this.autoLoad = a, this.meta = i, this.isLoaded = !1, this.isSynced = !1, this.isDestroyed = !1, this.whenLoaded = ft((e) => {
923
926
  this.on("load", () => {
924
927
  this.isLoaded = !0, e(this);
925
928
  });
926
929
  });
927
- let s = () => ut((e) => {
930
+ let s = () => ft((e) => {
928
931
  let t = (n) => {
929
932
  (n === void 0 || n === !0) && (this.off("sync", t), e());
930
933
  };
@@ -968,19 +971,19 @@ var Er = {
968
971
  return r;
969
972
  }
970
973
  getArray(e = "") {
971
- return this.get(e, Ja);
974
+ return this.get(e, Xa);
972
975
  }
973
976
  getText(e = "") {
974
- return this.get(e, ho);
977
+ return this.get(e, _o);
975
978
  }
976
979
  getMap(e = "") {
977
- return this.get(e, Za);
980
+ return this.get(e, $a);
978
981
  }
979
982
  getXmlElement(e = "") {
980
- return this.get(e, bo);
983
+ return this.get(e, So);
981
984
  }
982
985
  getXmlFragment(e = "") {
983
- return this.get(e, vo);
986
+ return this.get(e, bo);
984
987
  }
985
988
  toJSON() {
986
989
  let e = {};
@@ -1005,7 +1008,7 @@ var Er = {
1005
1008
  }
1006
1009
  this.emit("destroyed", [!0]), this.emit("destroy", [this]), super.destroy();
1007
1010
  }
1008
- }, Jr = class {
1011
+ }, Yr = class {
1009
1012
  constructor(e) {
1010
1013
  this.restDecoder = e;
1011
1014
  }
@@ -1016,7 +1019,7 @@ var Er = {
1016
1019
  readDsLen() {
1017
1020
  return E(this.restDecoder);
1018
1021
  }
1019
- }, Yr = class extends Jr {
1022
+ }, Xr = class extends Yr {
1020
1023
  readLeftID() {
1021
1024
  return R(E(this.restDecoder), E(this.restDecoder));
1022
1025
  }
@@ -1027,7 +1030,7 @@ var Er = {
1027
1030
  return E(this.restDecoder);
1028
1031
  }
1029
1032
  readInfo() {
1030
- return Je(this.restDecoder);
1033
+ return Xe(this.restDecoder);
1031
1034
  }
1032
1035
  readString() {
1033
1036
  return D(this.restDecoder);
@@ -1042,10 +1045,10 @@ var Er = {
1042
1045
  return E(this.restDecoder);
1043
1046
  }
1044
1047
  readAny() {
1045
- return Qe(this.restDecoder);
1048
+ return et(this.restDecoder);
1046
1049
  }
1047
1050
  readBuf() {
1048
- return Qt(T(this.restDecoder));
1051
+ return $t(T(this.restDecoder));
1049
1052
  }
1050
1053
  readJSON() {
1051
1054
  return JSON.parse(D(this.restDecoder));
@@ -1053,7 +1056,7 @@ var Er = {
1053
1056
  readKey() {
1054
1057
  return D(this.restDecoder);
1055
1058
  }
1056
- }, Xr = class {
1059
+ }, Zr = class {
1057
1060
  constructor(e) {
1058
1061
  this.dsCurrVal = 0, this.restDecoder = e;
1059
1062
  }
@@ -1067,15 +1070,15 @@ var Er = {
1067
1070
  let e = E(this.restDecoder) + 1;
1068
1071
  return this.dsCurrVal += e, e;
1069
1072
  }
1070
- }, Zr = class extends Xr {
1073
+ }, Qr = class extends Zr {
1071
1074
  constructor(e) {
1072
- super(e), this.keys = [], E(e), this.keyClockDecoder = new tt(T(e)), this.clientDecoder = new et(T(e)), this.leftClockDecoder = new tt(T(e)), this.rightClockDecoder = new tt(T(e)), this.infoDecoder = new $e(T(e), Je), this.stringDecoder = new nt(T(e)), this.parentInfoDecoder = new $e(T(e), Je), this.typeRefDecoder = new et(T(e)), this.lenDecoder = new et(T(e));
1075
+ super(e), this.keys = [], E(e), this.keyClockDecoder = new rt(T(e)), this.clientDecoder = new nt(T(e)), this.leftClockDecoder = new rt(T(e)), this.rightClockDecoder = new rt(T(e)), this.infoDecoder = new tt(T(e), Xe), this.stringDecoder = new it(T(e)), this.parentInfoDecoder = new tt(T(e), Xe), this.typeRefDecoder = new nt(T(e)), this.lenDecoder = new nt(T(e));
1073
1076
  }
1074
1077
  readLeftID() {
1075
- return new Ci(this.clientDecoder.read(), this.leftClockDecoder.read());
1078
+ return new wi(this.clientDecoder.read(), this.leftClockDecoder.read());
1076
1079
  }
1077
1080
  readRightID() {
1078
- return new Ci(this.clientDecoder.read(), this.rightClockDecoder.read());
1081
+ return new wi(this.clientDecoder.read(), this.rightClockDecoder.read());
1079
1082
  }
1080
1083
  readClient() {
1081
1084
  return this.clientDecoder.read();
@@ -1096,13 +1099,13 @@ var Er = {
1096
1099
  return this.lenDecoder.read();
1097
1100
  }
1098
1101
  readAny() {
1099
- return Qe(this.restDecoder);
1102
+ return et(this.restDecoder);
1100
1103
  }
1101
1104
  readBuf() {
1102
1105
  return T(this.restDecoder);
1103
1106
  }
1104
1107
  readJSON() {
1105
- return Qe(this.restDecoder);
1108
+ return et(this.restDecoder);
1106
1109
  }
1107
1110
  readKey() {
1108
1111
  let e = this.keyClockDecoder.read();
@@ -1112,7 +1115,7 @@ var Er = {
1112
1115
  return this.keys.push(e), e;
1113
1116
  }
1114
1117
  }
1115
- }, Qr = class {
1118
+ }, $r = class {
1116
1119
  constructor() {
1117
1120
  this.restEncoder = xe();
1118
1121
  }
@@ -1126,7 +1129,7 @@ var Er = {
1126
1129
  writeDsLen(e) {
1127
1130
  v(this.restEncoder, e);
1128
1131
  }
1129
- }, $r = class extends Qr {
1132
+ }, ei = class extends $r {
1130
1133
  writeLeftID(e) {
1131
1134
  v(this.restEncoder, e.client), v(this.restEncoder, e.clock);
1132
1135
  }
@@ -1163,7 +1166,7 @@ var Er = {
1163
1166
  writeKey(e) {
1164
1167
  y(this.restEncoder, e);
1165
1168
  }
1166
- }, ei = class {
1169
+ }, ti = class {
1167
1170
  constructor() {
1168
1171
  this.restEncoder = xe(), this.dsCurrVal = 0;
1169
1172
  }
@@ -1180,7 +1183,7 @@ var Er = {
1180
1183
  writeDsLen(e) {
1181
1184
  e === 0 && C(), v(this.restEncoder, e - 1), this.dsCurrVal += e;
1182
1185
  }
1183
- }, L = class extends ei {
1186
+ }, L = class extends ti {
1184
1187
  constructor() {
1185
1188
  super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new Ve(), this.clientEncoder = new ze(), this.leftClockEncoder = new Ve(), this.rightClockEncoder = new Ve(), this.infoEncoder = new Le(Te), this.stringEncoder = new He(), this.parentInfoEncoder = new Le(Te), this.typeRefEncoder = new ze(), this.lenEncoder = new ze();
1186
1189
  }
@@ -1225,23 +1228,23 @@ var Er = {
1225
1228
  let t = this.keyMap.get(e);
1226
1229
  t === void 0 ? (this.keyClockEncoder.write(this.keyClock++), this.stringEncoder.write(e)) : this.keyClockEncoder.write(t);
1227
1230
  }
1228
- }, ti = (e, t, n, r) => {
1231
+ }, ni = (e, t, n, r) => {
1229
1232
  r = h(r, t[0].id.clock);
1230
1233
  let i = V(t, r);
1231
1234
  v(e.restEncoder, t.length - i), e.writeClient(n), v(e.restEncoder, r);
1232
1235
  let a = t[i];
1233
1236
  a.write(e, r - a.id.clock);
1234
1237
  for (let n = i + 1; n < t.length; n++) t[n].write(e, 0);
1235
- }, ni = (e, t, n) => {
1238
+ }, ri = (e, t, n) => {
1236
1239
  let r = /* @__PURE__ */ new Map();
1237
1240
  n.forEach((e, n) => {
1238
1241
  B(t, n) > e && r.set(n, e);
1239
- }), Vi(t).forEach((e, t) => {
1242
+ }), Ui(t).forEach((e, t) => {
1240
1243
  n.has(t) || r.set(t, 0);
1241
1244
  }), v(e.restEncoder, r.size), c(r.entries()).sort((e, t) => t[0] - e[0]).forEach(([n, r]) => {
1242
- ti(e, t.clients.get(n), n, r);
1245
+ ni(e, t.clients.get(n), n, r);
1243
1246
  });
1244
- }, ri = (t, n) => {
1247
+ }, ii = (t, n) => {
1245
1248
  let r = e(), i = E(t.restDecoder);
1246
1249
  for (let e = 0; e < i; e++) {
1247
1250
  let e = E(t.restDecoder), i = Array(e), a = t.readClient(), o = E(t.restDecoder);
@@ -1263,14 +1266,14 @@ var Er = {
1263
1266
  break;
1264
1267
  }
1265
1268
  default: {
1266
- let s = !(e & 192), c = new Q(R(a, o), null, (e & 128) == 128 ? t.readLeftID() : null, null, (e & 64) == 64 ? t.readRightID() : null, s ? t.readParentInfo() ? n.get(t.readString()) : t.readLeftID() : null, s && (e & 32) == 32 ? t.readString() : null, as(t, e));
1269
+ let s = !(e & 192), c = new Q(R(a, o), null, (e & 128) == 128 ? t.readLeftID() : null, null, (e & 64) == 64 ? t.readRightID() : null, s ? t.readParentInfo() ? n.get(t.readString()) : t.readLeftID() : null, s && (e & 32) == 32 ? t.readString() : null, ss(t, e));
1267
1270
  i[r] = c, o += c.length;
1268
1271
  }
1269
1272
  }
1270
1273
  }
1271
1274
  }
1272
1275
  return r;
1273
- }, ii = (e, t, r) => {
1276
+ }, ai = (e, t, r) => {
1274
1277
  let i = [], a = c(r.keys()).sort((e, t) => e - t);
1275
1278
  if (a.length === 0) return null;
1276
1279
  let o = () => {
@@ -1281,7 +1284,7 @@ var Er = {
1281
1284
  return e;
1282
1285
  }, s = o();
1283
1286
  if (s === null) return null;
1284
- let l = new Bi(), u = /* @__PURE__ */ new Map(), d = (e, t) => {
1287
+ let l = new Hi(), u = /* @__PURE__ */ new Map(), d = (e, t) => {
1285
1288
  let n = u.get(e);
1286
1289
  (n == null || n > t) && u.set(e, t);
1287
1290
  }, f = s.refs[s.i++], p = /* @__PURE__ */ new Map(), ee = () => {
@@ -1320,15 +1323,15 @@ var Er = {
1320
1323
  }
1321
1324
  if (l.clients.size > 0) {
1322
1325
  let e = new L();
1323
- return ni(e, l, /* @__PURE__ */ new Map()), v(e.restEncoder, 0), {
1326
+ return ri(e, l, /* @__PURE__ */ new Map()), v(e.restEncoder, 0), {
1324
1327
  missing: u,
1325
1328
  update: e.toUint8Array()
1326
1329
  };
1327
1330
  }
1328
1331
  return null;
1329
- }, ai = (e, t) => ni(e, t.doc.store, t.beforeState), oi = (e, t, n, r = new Zr(e)) => U(t, (e) => {
1332
+ }, oi = (e, t) => ri(e, t.doc.store, t.beforeState), si = (e, t, n, r = new Qr(e)) => U(t, (e) => {
1330
1333
  e.local = !1;
1331
- let t = !1, n = e.doc, i = n.store, a = ii(e, i, ri(r, n)), o = i.pendingStructs;
1334
+ let t = !1, n = e.doc, i = n.store, a = ai(e, i, ii(r, n)), o = i.pendingStructs;
1332
1335
  if (o) {
1333
1336
  for (let [e, n] of o.missing) if (n < B(i, e)) {
1334
1337
  t = !0;
@@ -1339,99 +1342,99 @@ var Er = {
1339
1342
  let n = o.missing.get(e);
1340
1343
  (n == null || n > t) && o.missing.set(e, t);
1341
1344
  }
1342
- o.update = ua([o.update, a.update]);
1345
+ o.update = fa([o.update, a.update]);
1343
1346
  }
1344
1347
  } else i.pendingStructs = a;
1345
- let s = Gr(r, e, i);
1348
+ let s = Kr(r, e, i);
1346
1349
  if (i.pendingDs) {
1347
- let t = new Zr(w(i.pendingDs));
1350
+ let t = new Qr(w(i.pendingDs));
1348
1351
  E(t.restDecoder);
1349
- let n = Gr(t, e, i);
1350
- i.pendingDs = s && n ? ua([s, n]) : s || n;
1352
+ let n = Kr(t, e, i);
1353
+ i.pendingDs = s && n ? fa([s, n]) : s || n;
1351
1354
  } else i.pendingDs = s;
1352
1355
  if (t) {
1353
1356
  let t = i.pendingStructs.update;
1354
- i.pendingStructs = null, si(e.doc, t);
1357
+ i.pendingStructs = null, ci(e.doc, t);
1355
1358
  }
1356
- }, n, !1), si = (e, t, n, r = Zr) => {
1359
+ }, n, !1), ci = (e, t, n, r = Qr) => {
1357
1360
  let i = w(t);
1358
- oi(i, e, n, new r(i));
1359
- }, ci = (e, t, n) => si(e, t, n, Yr), li = (e, t, n = /* @__PURE__ */ new Map()) => {
1360
- ni(e, t.store, n), Ur(e, Hr(t.store));
1361
- }, ui = (e, t = new Uint8Array([0]), n = new L()) => {
1362
- li(n, e, pi(t));
1361
+ si(i, e, n, new r(i));
1362
+ }, li = (e, t, n) => ci(e, t, n, Xr), ui = (e, t, n = /* @__PURE__ */ new Map()) => {
1363
+ ri(e, t.store, n), Wr(e, Ur(t.store));
1364
+ }, di = (e, t = new Uint8Array([0]), n = new L()) => {
1365
+ ui(n, e, mi(t));
1363
1366
  let r = [n.toUint8Array()];
1364
- if (e.store.pendingDs && r.push(e.store.pendingDs), e.store.pendingStructs && r.push(da(e.store.pendingStructs.update, t)), r.length > 1) {
1365
- if (n.constructor === $r) return ca(r.map((e, t) => t === 0 ? e : ha(e)));
1366
- if (n.constructor === L) return ua(r);
1367
+ if (e.store.pendingDs && r.push(e.store.pendingDs), e.store.pendingStructs && r.push(pa(e.store.pendingStructs.update, t)), r.length > 1) {
1368
+ if (n.constructor === ei) return ua(r.map((e, t) => t === 0 ? e : _a(e)));
1369
+ if (n.constructor === L) return fa(r);
1367
1370
  }
1368
1371
  return r[0];
1369
- }, di = (e, t) => ui(e, t, new $r()), fi = (e) => {
1372
+ }, fi = (e, t) => di(e, t, new ei()), pi = (e) => {
1370
1373
  let t = /* @__PURE__ */ new Map(), n = E(e.restDecoder);
1371
1374
  for (let r = 0; r < n; r++) {
1372
1375
  let n = E(e.restDecoder), r = E(e.restDecoder);
1373
1376
  t.set(n, r);
1374
1377
  }
1375
1378
  return t;
1376
- }, pi = (e) => fi(new Jr(w(e))), mi = (e, t) => (v(e.restEncoder, t.size), c(t.entries()).sort((e, t) => t[0] - e[0]).forEach(([t, n]) => {
1379
+ }, mi = (e) => pi(new Yr(w(e))), hi = (e, t) => (v(e.restEncoder, t.size), c(t.entries()).sort((e, t) => t[0] - e[0]).forEach(([t, n]) => {
1377
1380
  v(e.restEncoder, t), v(e.restEncoder, n);
1378
- }), e), hi = (e, t) => mi(e, Vi(t.store)), gi = (e, t = new ei()) => (e instanceof Map ? mi(t, e) : hi(t, e), t.toUint8Array()), _i = (e) => gi(e, new Qr()), vi = class {
1381
+ }), e), gi = (e, t) => hi(e, Ui(t.store)), _i = (e, t = new ti()) => (e instanceof Map ? hi(t, e) : gi(t, e), t.toUint8Array()), vi = (e) => _i(e, new $r()), yi = class {
1379
1382
  constructor() {
1380
1383
  this.l = [];
1381
1384
  }
1382
- }, yi = () => new vi(), bi = (e, t) => e.l.push(t), xi = (e, t) => {
1385
+ }, bi = () => new yi(), xi = (e, t) => e.l.push(t), Si = (e, t) => {
1383
1386
  let n = e.l, r = n.length;
1384
1387
  e.l = n.filter((e) => t !== e), r === e.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
1385
- }, Si = (e, t, n) => jt(e.l, [t, n]), Ci = class {
1388
+ }, Ci = (e, t, n) => Nt(e.l, [t, n]), wi = class {
1386
1389
  constructor(e, t) {
1387
1390
  this.client = e, this.clock = t;
1388
1391
  }
1389
- }, wi = (e, t) => e === t || e !== null && t !== null && e.client === t.client && e.clock === t.clock, R = (e, t) => new Ci(e, t), Ti = (e) => {
1392
+ }, Ti = (e, t) => e === t || e !== null && t !== null && e.client === t.client && e.clock === t.clock, R = (e, t) => new wi(e, t), Ei = (e) => {
1390
1393
  for (let [t, n] of e.doc.share.entries()) if (n === e) return t;
1391
1394
  throw C();
1392
- }, Ei = (e, t) => {
1395
+ }, Di = (e, t) => {
1393
1396
  for (; t !== null;) {
1394
1397
  if (t.parent === e) return !0;
1395
1398
  t = t.parent._item;
1396
1399
  }
1397
1400
  return !1;
1398
- }, Di = class {
1401
+ }, Oi = class {
1399
1402
  constructor(e, t, n, r = 0) {
1400
1403
  this.type = e, this.tname = t, this.item = n, this.assoc = r;
1401
1404
  }
1402
- }, Oi = (e) => new Di(e.type == null ? null : R(e.type.client, e.type.clock), e.tname ?? null, e.item == null ? null : R(e.item.client, e.item.clock), e.assoc == null ? 0 : e.assoc), ki = class {
1405
+ }, ki = (e) => new Oi(e.type == null ? null : R(e.type.client, e.type.clock), e.tname ?? null, e.item == null ? null : R(e.item.client, e.item.clock), e.assoc == null ? 0 : e.assoc), Ai = class {
1403
1406
  constructor(e, t, n = 0) {
1404
1407
  this.type = e, this.index = t, this.assoc = n;
1405
1408
  }
1406
- }, Ai = (e, t, n = 0) => new ki(e, t, n), ji = (e, t, n) => {
1409
+ }, ji = (e, t, n = 0) => new Ai(e, t, n), Mi = (e, t, n) => {
1407
1410
  let r = null, i = null;
1408
- return e._item === null ? i = Ti(e) : r = R(e._item.id.client, e._item.id.clock), new Di(r, i, t, n);
1409
- }, Mi = (e, t, n = 0) => {
1411
+ return e._item === null ? i = Ei(e) : r = R(e._item.id.client, e._item.id.clock), new Oi(r, i, t, n);
1412
+ }, Ni = (e, t, n = 0) => {
1410
1413
  let r = e._start;
1411
1414
  if (n < 0) {
1412
- if (t === 0) return ji(e, null, n);
1415
+ if (t === 0) return Mi(e, null, n);
1413
1416
  t--;
1414
1417
  }
1415
1418
  for (; r !== null;) {
1416
1419
  if (!r.deleted && r.countable) {
1417
- if (r.length > t) return ji(e, R(r.id.client, r.id.clock + t), n);
1420
+ if (r.length > t) return Mi(e, R(r.id.client, r.id.clock + t), n);
1418
1421
  t -= r.length;
1419
1422
  }
1420
- if (r.right === null && n < 0) return ji(e, r.lastId, n);
1423
+ if (r.right === null && n < 0) return Mi(e, r.lastId, n);
1421
1424
  r = r.right;
1422
1425
  }
1423
- return ji(e, null, n);
1424
- }, Ni = (e, t) => {
1425
- let n = Ui(e, t);
1426
+ return Mi(e, null, n);
1427
+ }, Pi = (e, t) => {
1428
+ let n = Gi(e, t);
1426
1429
  return {
1427
1430
  item: n,
1428
1431
  diff: t.clock - n.id.clock
1429
1432
  };
1430
- }, Pi = (e, t, n = !0) => {
1433
+ }, Fi = (e, t, n = !0) => {
1431
1434
  let r = t.store, i = e.item, a = e.type, o = e.tname, s = e.assoc, c = null, l = 0;
1432
1435
  if (i !== null) {
1433
1436
  if (B(r, i.client) <= i.clock) return null;
1434
- let e = n ? es(r, i) : Ni(r, i), t = e.item;
1437
+ let e = n ? ns(r, i) : Pi(r, i), t = e.item;
1435
1438
  if (!(t instanceof Q)) return null;
1436
1439
  if (c = t.parent, c._item === null || !c._item.deleted) {
1437
1440
  l = t.deleted || !t.countable ? 0 : e.diff + (s >= 0 ? 0 : 1);
@@ -1442,29 +1445,27 @@ var Er = {
1442
1445
  if (o !== null) c = t.get(o);
1443
1446
  else if (a !== null) {
1444
1447
  if (B(r, a.client) <= a.clock) return null;
1445
- let { item: e } = n ? es(r, a) : { item: Ui(r, a) };
1448
+ let { item: e } = n ? ns(r, a) : { item: Gi(r, a) };
1446
1449
  if (e instanceof Q && e.content instanceof Z) c = e.content.type;
1447
1450
  else return null;
1448
1451
  } else throw C();
1449
1452
  l = s >= 0 ? c._length : 0;
1450
1453
  }
1451
- return Ai(c, l, e.assoc);
1452
- }, Fi = (e, t) => e === t || e !== null && t !== null && e.tname === t.tname && wi(e.item, t.item) && wi(e.type, t.type) && e.assoc === t.assoc, Ii = class {
1454
+ return ji(c, l, e.assoc);
1455
+ }, Ii = (e, t) => e === t || e !== null && t !== null && e.tname === t.tname && Ti(e.item, t.item) && Ti(e.type, t.type) && e.assoc === t.assoc, Li = class {
1453
1456
  constructor(e, t) {
1454
1457
  this.ds = e, this.sv = t;
1455
1458
  }
1456
- }, Li = (e, t) => new Ii(e, t);
1457
- Li(Vr(), /* @__PURE__ */ new Map());
1458
- var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !Lr(t.ds, e.id), zi = (e, t) => {
1459
- let r = n(e.meta, zi, a), i = e.doc.store;
1459
+ }, Ri = (e, t) => new Li(e, t), zi = Ri(Hr(), /* @__PURE__ */ new Map()), Bi = (e) => Ri(Ur(e.store), Ui(e.store)), z = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !Rr(t.ds, e.id), Vi = (e, t) => {
1460
+ let r = n(e.meta, Vi, a), i = e.doc.store;
1460
1461
  r.has(t) || (t.sv.forEach((t, n) => {
1461
1462
  t < B(i, n) && H(e, R(n, t));
1462
1463
  }), I(e, t.ds, (e) => {}), r.add(t));
1463
- }, Bi = class {
1464
+ }, Hi = class {
1464
1465
  constructor() {
1465
1466
  this.clients = /* @__PURE__ */ new Map(), this.pendingStructs = null, this.pendingDs = null;
1466
1467
  }
1467
- }, Vi = (e) => {
1468
+ }, Ui = (e) => {
1468
1469
  let t = /* @__PURE__ */ new Map();
1469
1470
  return e.clients.forEach((e, n) => {
1470
1471
  let r = e[e.length - 1];
@@ -1475,7 +1476,7 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1475
1476
  if (n === void 0) return 0;
1476
1477
  let r = n[n.length - 1];
1477
1478
  return r.id.clock + r.length;
1478
- }, Hi = (e, t) => {
1479
+ }, Wi = (e, t) => {
1479
1480
  let n = e.clients.get(t.id.client);
1480
1481
  if (n === void 0) n = [], e.clients.set(t.id.client, n);
1481
1482
  else {
@@ -1495,40 +1496,40 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1495
1496
  o = m((n + r) / 2);
1496
1497
  }
1497
1498
  throw C();
1498
- }, Ui = (e, t) => {
1499
+ }, Gi = (e, t) => {
1499
1500
  let n = e.clients.get(t.client);
1500
1501
  return n[V(n, t.clock)];
1501
- }, Wi = (e, t, n) => {
1502
+ }, Ki = (e, t, n) => {
1502
1503
  let r = V(t, n), i = t[r];
1503
- return i.id.clock < n && i instanceof Q ? (t.splice(r + 1, 0, ns(e, i, n - i.id.clock)), r + 1) : r;
1504
+ return i.id.clock < n && i instanceof Q ? (t.splice(r + 1, 0, is(e, i, n - i.id.clock)), r + 1) : r;
1504
1505
  }, H = (e, t) => {
1505
1506
  let n = e.doc.store.clients.get(t.client);
1506
- return n[Wi(e, n, t.clock)];
1507
- }, Gi = (e, t, n) => {
1507
+ return n[Ki(e, n, t.clock)];
1508
+ }, qi = (e, t, n) => {
1508
1509
  let r = t.clients.get(n.client), i = V(r, n.clock), a = r[i];
1509
- return n.clock !== a.id.clock + a.length - 1 && a.constructor !== J && r.splice(i + 1, 0, ns(e, a, n.clock - a.id.clock + 1)), a;
1510
- }, Ki = (e, t, n) => {
1510
+ return n.clock !== a.id.clock + a.length - 1 && a.constructor !== J && r.splice(i + 1, 0, is(e, a, n.clock - a.id.clock + 1)), a;
1511
+ }, Ji = (e, t, n) => {
1511
1512
  let r = e.clients.get(t.id.client);
1512
1513
  r[V(r, t.id.clock)] = n;
1513
- }, qi = (e, t, n, r, i) => {
1514
+ }, Yi = (e, t, n, r, i) => {
1514
1515
  if (r === 0) return;
1515
- let a = n + r, o = Wi(e, t, n), s;
1516
+ let a = n + r, o = Ki(e, t, n), s;
1516
1517
  do
1517
- s = t[o++], a < s.id.clock + s.length && Wi(e, t, a), i(s);
1518
+ s = t[o++], a < s.id.clock + s.length && Ki(e, t, a), i(s);
1518
1519
  while (o < t.length && t[o].id.clock < a);
1519
- }, Ji = class {
1520
+ }, Xi = class {
1520
1521
  constructor(e, t, n) {
1521
- this.doc = e, this.deleteSet = new Fr(), this.beforeState = Vi(e.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = t, this.meta = /* @__PURE__ */ new Map(), this.local = n, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
1522
+ this.doc = e, this.deleteSet = new Ir(), this.beforeState = Ui(e.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = t, this.meta = /* @__PURE__ */ new Map(), this.local = n, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
1522
1523
  }
1523
- }, Yi = (e, t) => t.deleteSet.clients.size === 0 && !i(t.afterState, (e, n) => t.beforeState.get(n) !== e) ? !1 : (Rr(t.deleteSet), ai(e, t), Ur(e, t.deleteSet), !0), Xi = (e, t, r) => {
1524
+ }, Zi = (e, t) => t.deleteSet.clients.size === 0 && !i(t.afterState, (e, n) => t.beforeState.get(n) !== e) ? !1 : (zr(t.deleteSet), oi(e, t), Wr(e, t.deleteSet), !0), Qi = (e, t, r) => {
1524
1525
  let i = t._item;
1525
1526
  (i === null || i.id.clock < (e.beforeState.get(i.id.client) || 0) && !i.deleted) && n(e.changed, t, a).add(r);
1526
- }, Zi = (e, t) => {
1527
+ }, $i = (e, t) => {
1527
1528
  let n = e[t], r = e[t - 1], i = t;
1528
1529
  for (; i > 0 && r.deleted === n.deleted && r.constructor === n.constructor && r.mergeWith(n); n = r, r = e[--i - 1]) n instanceof Q && n.parentSub !== null && n.parent._map.get(n.parentSub) === n && n.parent._map.set(n.parentSub, r);
1529
1530
  let a = t - i;
1530
1531
  return a && e.splice(t + 1 - a, a), a;
1531
- }, Qi = (e, t, n) => {
1532
+ }, ea = (e, t, n) => {
1532
1533
  for (let [r, i] of e.clients.entries()) {
1533
1534
  let e = t.clients.get(r);
1534
1535
  for (let r = i.length - 1; r >= 0; r--) {
@@ -1540,48 +1541,48 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1540
1541
  }
1541
1542
  }
1542
1543
  }
1543
- }, $i = (e, t) => {
1544
+ }, ta = (e, t) => {
1544
1545
  e.clients.forEach((e, n) => {
1545
1546
  let r = t.clients.get(n);
1546
1547
  for (let t = e.length - 1; t >= 0; t--) {
1547
1548
  let n = e[t], i = ne(r.length - 1, 1 + V(r, n.clock + n.len - 1));
1548
- for (let e = i, t = r[e]; e > 0 && t.id.clock >= n.clock; t = r[e]) e -= 1 + Zi(r, e);
1549
+ for (let e = i, t = r[e]; e > 0 && t.id.clock >= n.clock; t = r[e]) e -= 1 + $i(r, e);
1549
1550
  }
1550
1551
  });
1551
- }, ea = (e, t) => {
1552
+ }, na = (e, t) => {
1552
1553
  if (t < e.length) {
1553
1554
  let n = e[t], r = n.doc, i = r.store, a = n.deleteSet, o = n._mergeStructs;
1554
1555
  try {
1555
- Rr(a), n.afterState = Vi(n.doc.store), r.emit("beforeObserverCalls", [n, r]);
1556
+ zr(a), n.afterState = Ui(n.doc.store), r.emit("beforeObserverCalls", [n, r]);
1556
1557
  let e = [];
1557
1558
  n.changed.forEach((t, r) => e.push(() => {
1558
1559
  r._item !== null && r._item.deleted || r._callObserver(n, t);
1559
1560
  })), e.push(() => {
1560
1561
  n.changedParentTypes.forEach((t, r) => {
1561
- r._dEH.l.length > 0 && (r._item === null || !r._item.deleted) && (t = t.filter((e) => e.target._item === null || !e.target._item.deleted), t.forEach((e) => {
1562
- e.currentTarget = r, e._path = null;
1563
- }), t.sort((e, t) => e.path.length - t.path.length), e.push(() => {
1564
- Si(r._dEH, t, n);
1565
- }));
1562
+ r._dEH.l.length > 0 && (r._item === null || !r._item.deleted) && e.push(() => {
1563
+ t = t.filter((e) => e.target._item === null || !e.target._item.deleted), t.forEach((e) => {
1564
+ e.currentTarget = r, e._path = null;
1565
+ }), t.sort((e, t) => e.path.length - t.path.length), Ci(r._dEH, t, n);
1566
+ });
1566
1567
  }), e.push(() => r.emit("afterTransaction", [n, r])), e.push(() => {
1567
- n._needFormattingCleanup && fo(n);
1568
+ n._needFormattingCleanup && mo(n);
1568
1569
  });
1569
- }), jt(e, []);
1570
+ }), Nt(e, []);
1570
1571
  } finally {
1571
- r.gc && Qi(a, i, r.gcFilter), $i(a, i), n.afterState.forEach((e, t) => {
1572
+ r.gc && ea(a, i, r.gcFilter), ta(a, i), n.afterState.forEach((e, t) => {
1572
1573
  let r = n.beforeState.get(t) || 0;
1573
1574
  if (r !== e) {
1574
1575
  let e = i.clients.get(t), n = h(V(e, r), 1);
1575
- for (let t = e.length - 1; t >= n;) t -= 1 + Zi(e, t);
1576
+ for (let t = e.length - 1; t >= n;) t -= 1 + $i(e, t);
1576
1577
  }
1577
1578
  });
1578
1579
  for (let e = o.length - 1; e >= 0; e--) {
1579
1580
  let { client: t, clock: n } = o[e].id, r = i.clients.get(t), a = V(r, n);
1580
- a + 1 < r.length && Zi(r, a + 1) > 1 || a > 0 && Zi(r, a);
1581
+ a + 1 < r.length && $i(r, a + 1) > 1 || a > 0 && $i(r, a);
1581
1582
  }
1582
- if (!n.local && n.afterState.get(r.clientID) !== n.beforeState.get(r.clientID) && (Or(Cr, gr, "[yjs] ", _r, xr, "Changed the client-id because another client seems to be using it."), r.clientID = Kr()), r.emit("afterTransactionCleanup", [n, r]), r._observers.has("update")) {
1583
- let e = new $r();
1584
- Yi(e, n) && r.emit("update", [
1583
+ if (!n.local && n.afterState.get(r.clientID) !== n.beforeState.get(r.clientID) && (kr(wr, _r, "[yjs] ", vr, Sr, "Changed the client-id because another client seems to be using it."), r.clientID = qr()), r.emit("afterTransactionCleanup", [n, r]), r._observers.has("update")) {
1584
+ let e = new ei();
1585
+ Zi(e, n) && r.emit("update", [
1585
1586
  e.toUint8Array(),
1586
1587
  n.origin,
1587
1588
  r,
@@ -1590,7 +1591,7 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1590
1591
  }
1591
1592
  if (r._observers.has("updateV2")) {
1592
1593
  let e = new L();
1593
- Yi(e, n) && r.emit("updateV2", [
1594
+ Zi(e, n) && r.emit("updateV2", [
1594
1595
  e.toUint8Array(),
1595
1596
  n.origin,
1596
1597
  r,
@@ -1608,30 +1609,30 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1608
1609
  },
1609
1610
  r,
1610
1611
  n
1611
- ]), l.forEach((e) => e.destroy())), e.length <= t + 1 ? (r._transactionCleanups = [], r.emit("afterAllTransactions", [r, e])) : ea(e, t + 1);
1612
+ ]), l.forEach((e) => e.destroy())), e.length <= t + 1 ? (r._transactionCleanups = [], r.emit("afterAllTransactions", [r, e])) : na(e, t + 1);
1612
1613
  }
1613
1614
  }
1614
1615
  }, U = (e, t, n = null, r = !0) => {
1615
1616
  let i = e._transactionCleanups, a = !1, o = null;
1616
- e._transaction === null && (a = !0, e._transaction = new Ji(e, n, r), i.push(e._transaction), i.length === 1 && e.emit("beforeAllTransactions", [e]), e.emit("beforeTransaction", [e._transaction, e]));
1617
+ e._transaction === null && (a = !0, e._transaction = new Xi(e, n, r), i.push(e._transaction), i.length === 1 && e.emit("beforeAllTransactions", [e]), e.emit("beforeTransaction", [e._transaction, e]));
1617
1618
  try {
1618
1619
  o = t(e._transaction);
1619
1620
  } finally {
1620
1621
  if (a) {
1621
1622
  let t = e._transaction === i[0];
1622
- e._transaction = null, t && ea(i, 0);
1623
+ e._transaction = null, t && na(i, 0);
1623
1624
  }
1624
1625
  }
1625
1626
  return o;
1626
- }, ta = class {
1627
+ }, ra = class {
1627
1628
  constructor(e, t) {
1628
1629
  this.insertions = t, this.deletions = e, this.meta = /* @__PURE__ */ new Map();
1629
1630
  }
1630
- }, na = (e, t, n) => {
1631
+ }, ia = (e, t, n) => {
1631
1632
  I(e, n.deletions, (n) => {
1632
- n instanceof Q && t.scope.some((t) => t === e.doc || Ei(t, n)) && ts(n, !1);
1633
+ n instanceof Q && t.scope.some((t) => t === e.doc || Di(t, n)) && rs(n, !1);
1633
1634
  });
1634
- }, ra = (e, t, n) => {
1635
+ }, aa = (e, t, n) => {
1635
1636
  let r = null, i = e.doc, a = e.scope;
1636
1637
  U(i, (n) => {
1637
1638
  for (; t.length > 0 && e.currStackItem === null;) {
@@ -1639,15 +1640,15 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1639
1640
  I(n, o.insertions, (e) => {
1640
1641
  if (e instanceof Q) {
1641
1642
  if (e.redone !== null) {
1642
- let { item: t, diff: i } = es(r, e.id);
1643
+ let { item: t, diff: i } = ns(r, e.id);
1643
1644
  i > 0 && (t = H(n, R(t.id.client, t.id.clock + i))), e = t;
1644
1645
  }
1645
- !e.deleted && a.some((t) => t === n.doc || Ei(t, e)) && c.push(e);
1646
+ !e.deleted && a.some((t) => t === n.doc || Di(t, e)) && c.push(e);
1646
1647
  }
1647
1648
  }), I(n, o.deletions, (e) => {
1648
- e instanceof Q && a.some((t) => t === n.doc || Ei(t, e)) && !Lr(o.insertions, e.id) && s.add(e);
1649
+ e instanceof Q && a.some((t) => t === n.doc || Di(t, e)) && !Rr(o.insertions, e.id) && s.add(e);
1649
1650
  }), s.forEach((t) => {
1650
- l = is(n, t, s, o.insertions, e.ignoreRemoteMapChanges, e) !== null || l;
1651
+ l = os(n, t, s, o.insertions, e.ignoreRemoteMapChanges, e) !== null || l;
1651
1652
  });
1652
1653
  for (let t = c.length - 1; t >= 0; t--) {
1653
1654
  let r = c[t];
@@ -1670,24 +1671,24 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1670
1671
  }, e]), e.currStackItem = null;
1671
1672
  }
1672
1673
  return o;
1673
- }, ia = class extends p {
1674
- constructor(e, { captureTimeout: t = 500, captureTransaction: n = (e) => !0, deleteFilter: r = () => !0, trackedOrigins: i = /* @__PURE__ */ new Set([null]), ignoreRemoteMapChanges: a = !1, doc: o = f(e) ? e[0].doc : e instanceof qr ? e : e.doc } = {}) {
1674
+ }, oa = class extends p {
1675
+ constructor(e, { captureTimeout: t = 500, captureTransaction: n = (e) => !0, deleteFilter: r = () => !0, trackedOrigins: i = /* @__PURE__ */ new Set([null]), ignoreRemoteMapChanges: a = !1, doc: o = f(e) ? e[0].doc : e instanceof Jr ? e : e.doc } = {}) {
1675
1676
  super(), this.scope = [], this.doc = o, this.addToScope(e), this.deleteFilter = r, i.add(this), this.trackedOrigins = i, this.captureTransaction = n, this.undoStack = [], this.redoStack = [], this.undoing = !1, this.redoing = !1, this.currStackItem = null, this.lastChange = 0, this.ignoreRemoteMapChanges = a, this.captureTimeout = t, this.afterTransactionHandler = (e) => {
1676
1677
  if (!this.captureTransaction(e) || !this.scope.some((t) => e.changedParentTypes.has(t) || t === this.doc) || !this.trackedOrigins.has(e.origin) && (!e.origin || !this.trackedOrigins.has(e.origin.constructor))) return;
1677
1678
  let t = this.undoing, n = this.redoing, r = t ? this.redoStack : this.undoStack;
1678
1679
  t ? this.stopCapturing() : n || this.clear(!1, !0);
1679
- let i = new Fr();
1680
+ let i = new Ir();
1680
1681
  e.afterState.forEach((t, n) => {
1681
1682
  let r = e.beforeState.get(n) || 0, a = t - r;
1682
- a > 0 && Br(i, n, r, a);
1683
+ a > 0 && Vr(i, n, r, a);
1683
1684
  });
1684
- let a = lt(), o = !1;
1685
+ let a = dt(), o = !1;
1685
1686
  if (this.lastChange > 0 && a - this.lastChange < this.captureTimeout && r.length > 0 && !t && !n) {
1686
1687
  let t = r[r.length - 1];
1687
- t.deletions = zr([t.deletions, e.deleteSet]), t.insertions = zr([t.insertions, i]);
1688
- } else r.push(new ta(e.deleteSet, i)), o = !0;
1688
+ t.deletions = Br([t.deletions, e.deleteSet]), t.insertions = Br([t.insertions, i]);
1689
+ } else r.push(new ra(e.deleteSet, i)), o = !0;
1689
1690
  !t && !n && (this.lastChange = a), I(e, e.deleteSet, (t) => {
1690
- t instanceof Q && this.scope.some((n) => n === e.doc || Ei(n, t)) && ts(t, !0);
1691
+ t instanceof Q && this.scope.some((n) => n === e.doc || Di(n, t)) && rs(t, !0);
1691
1692
  });
1692
1693
  let s = [{
1693
1694
  stackItem: r[r.length - 1],
@@ -1701,7 +1702,7 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1701
1702
  addToScope(e) {
1702
1703
  let t = new Set(this.scope);
1703
1704
  e = f(e) ? e : [e], e.forEach((e) => {
1704
- t.has(e) || (t.add(e), (e instanceof K ? e.doc !== this.doc : e !== this.doc) && kr("[yjs#509] Not same Y.Doc"), this.scope.push(e));
1705
+ t.has(e) || (t.add(e), (e instanceof K ? e.doc !== this.doc : e !== this.doc) && Ar("[yjs#509] Not same Y.Doc"), this.scope.push(e));
1705
1706
  });
1706
1707
  }
1707
1708
  addTrackedOrigin(e) {
@@ -1712,7 +1713,7 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1712
1713
  }
1713
1714
  clear(e = !0, t = !0) {
1714
1715
  (e && this.canUndo() || t && this.canRedo()) && this.doc.transact((n) => {
1715
- e && (this.undoStack.forEach((e) => na(n, this, e)), this.undoStack = []), t && (this.redoStack.forEach((e) => na(n, this, e)), this.redoStack = []), this.emit("stack-cleared", [{
1716
+ e && (this.undoStack.forEach((e) => ia(n, this, e)), this.undoStack = []), t && (this.redoStack.forEach((e) => ia(n, this, e)), this.redoStack = []), this.emit("stack-cleared", [{
1716
1717
  undoStackCleared: e,
1717
1718
  redoStackCleared: t
1718
1719
  }]);
@@ -1725,7 +1726,7 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1725
1726
  this.undoing = !0;
1726
1727
  let e;
1727
1728
  try {
1728
- e = ra(this, this.undoStack, "undo");
1729
+ e = aa(this, this.undoStack, "undo");
1729
1730
  } finally {
1730
1731
  this.undoing = !1;
1731
1732
  }
@@ -1735,7 +1736,7 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1735
1736
  this.redoing = !0;
1736
1737
  let e;
1737
1738
  try {
1738
- e = ra(this, this.redoStack, "redo");
1739
+ e = aa(this, this.redoStack, "redo");
1739
1740
  } finally {
1740
1741
  this.redoing = !1;
1741
1742
  }
@@ -1751,7 +1752,7 @@ var Ri = (e) => Li(Hr(e.store), Vi(e.store)), z = (e, t) => t === void 0 ? !e.de
1751
1752
  this.trackedOrigins.delete(this), this.doc.off("afterTransaction", this.afterTransactionHandler), this.doc.off("destroy", this.destroy), super.destroy();
1752
1753
  }
1753
1754
  };
1754
- function* aa(e) {
1755
+ function* sa(e) {
1755
1756
  let t = E(e.restDecoder);
1756
1757
  for (let n = 0; n < t; n++) {
1757
1758
  let t = E(e.restDecoder), n = e.readClient(), r = E(e.restDecoder);
@@ -1761,7 +1762,7 @@ function* aa(e) {
1761
1762
  let t = E(e.restDecoder);
1762
1763
  yield new $(R(n, r), t), r += t;
1763
1764
  } else if (31 & t) {
1764
- let i = !(t & 192), a = new Q(R(n, r), null, (t & 128) == 128 ? e.readLeftID() : null, null, (t & 64) == 64 ? e.readRightID() : null, i ? e.readParentInfo() ? e.readString() : e.readLeftID() : null, i && (t & 32) == 32 ? e.readString() : null, as(e, t));
1765
+ let i = !(t & 192), a = new Q(R(n, r), null, (t & 128) == 128 ? e.readLeftID() : null, null, (t & 64) == 64 ? e.readRightID() : null, i ? e.readParentInfo() ? e.readString() : e.readLeftID() : null, i && (t & 32) == 32 ? e.readString() : null, ss(e, t));
1765
1766
  yield a, r += a.length;
1766
1767
  } else {
1767
1768
  let t = e.readLen();
@@ -1770,9 +1771,9 @@ function* aa(e) {
1770
1771
  }
1771
1772
  }
1772
1773
  }
1773
- var oa = class {
1774
+ var ca = class {
1774
1775
  constructor(e, t) {
1775
- this.gen = aa(e), this.curr = null, this.done = !1, this.filterSkips = t, this.next();
1776
+ this.gen = sa(e), this.curr = null, this.done = !1, this.filterSkips = t, this.next();
1776
1777
  }
1777
1778
  next() {
1778
1779
  do
@@ -1780,11 +1781,11 @@ var oa = class {
1780
1781
  while (this.filterSkips && this.curr !== null && this.curr.constructor === $);
1781
1782
  return this.curr;
1782
1783
  }
1783
- }, sa = class {
1784
+ }, la = class {
1784
1785
  constructor(e) {
1785
1786
  this.currClient = 0, this.startClock = 0, this.written = 0, this.encoder = e, this.clientStructs = [];
1786
1787
  }
1787
- }, ca = (e) => ua(e, Yr, $r), la = (e, t) => {
1788
+ }, ua = (e) => fa(e, Xr, ei), da = (e, t) => {
1788
1789
  if (e.constructor === J) {
1789
1790
  let { client: n, clock: r } = e.id;
1790
1791
  return new J(R(n, r + t), e.length - t);
@@ -1797,9 +1798,9 @@ var oa = class {
1797
1798
  let n = e, { client: r, clock: i } = n.id;
1798
1799
  return new Q(R(r, i + t), null, R(r, i + t - 1), null, n.rightOrigin, n.parent, n.parentSub, n.content.splice(t));
1799
1800
  }
1800
- }, ua = (e, t = Zr, n = L) => {
1801
+ }, fa = (e, t = Qr, n = L) => {
1801
1802
  if (e.length === 1) return e[0];
1802
- let r = e.map((e) => new t(w(e))), i = r.map((e) => new oa(e, !0)), a = null, o = new n(), s = new sa(o);
1803
+ let r = e.map((e) => new t(w(e))), i = r.map((e) => new ca(e, !0)), a = null, o = new n(), s = new la(o);
1803
1804
  for (; i = i.filter((e) => e.curr !== null), i.sort((e, t) => {
1804
1805
  if (e.curr.id.client === t.curr.id.client) {
1805
1806
  let n = e.curr.id.clock - t.curr.id.clock;
@@ -1828,7 +1829,7 @@ var oa = class {
1828
1829
  }
1829
1830
  } else {
1830
1831
  let t = a.struct.id.clock + a.struct.length - n.id.clock;
1831
- t > 0 && (a.struct.constructor === $ ? a.struct.length -= t : n = la(n, t)), a.struct.mergeWith(n) || (W(s, a.struct, a.offset), a = {
1832
+ t > 0 && (a.struct.constructor === $ ? a.struct.length -= t : n = da(n, t)), a.struct.mergeWith(n) || (W(s, a.struct, a.offset), a = {
1832
1833
  struct: n,
1833
1834
  offset: 0
1834
1835
  }, e.next());
@@ -1842,48 +1843,48 @@ var oa = class {
1842
1843
  offset: 0
1843
1844
  };
1844
1845
  }
1845
- return a !== null && (W(s, a.struct, a.offset), a = null), pa(s), Ur(o, zr(r.map((e) => Wr(e)))), o.toUint8Array();
1846
- }, da = (e, t, n = Zr, r = L) => {
1847
- let i = pi(t), a = new r(), o = new sa(a), s = new n(w(e)), c = new oa(s, !1);
1846
+ return a !== null && (W(s, a.struct, a.offset), a = null), ha(s), Wr(o, Br(r.map((e) => Gr(e)))), o.toUint8Array();
1847
+ }, pa = (e, t, n = Qr, r = L) => {
1848
+ let i = mi(t), a = new r(), o = new la(a), s = new n(w(e)), c = new ca(s, !1);
1848
1849
  for (; c.curr;) {
1849
1850
  let e = c.curr, t = e.id.client, n = i.get(t) || 0;
1850
1851
  if (c.curr.constructor === $) c.next();
1851
1852
  else if (e.id.clock + e.length > n) for (W(o, e, h(n - e.id.clock, 0)), c.next(); c.curr && c.curr.id.client === t;) W(o, c.curr, 0), c.next();
1852
1853
  else for (; c.curr && c.curr.id.client === t && c.curr.id.clock + c.curr.length <= n;) c.next();
1853
1854
  }
1854
- return pa(o), Ur(a, Wr(s)), a.toUint8Array();
1855
- }, fa = (e) => {
1855
+ return ha(o), Wr(a, Gr(s)), a.toUint8Array();
1856
+ }, ma = (e) => {
1856
1857
  e.written > 0 && (e.clientStructs.push({
1857
1858
  written: e.written,
1858
1859
  restEncoder: g(e.encoder.restEncoder)
1859
1860
  }), e.encoder.restEncoder = xe(), e.written = 0);
1860
1861
  }, W = (e, t, n) => {
1861
- e.written > 0 && e.currClient !== t.id.client && fa(e), e.written === 0 && (e.currClient = t.id.client, e.encoder.writeClient(t.id.client), v(e.encoder.restEncoder, t.id.clock + n)), t.write(e.encoder, n), e.written++;
1862
- }, pa = (e) => {
1863
- fa(e);
1862
+ e.written > 0 && e.currClient !== t.id.client && ma(e), e.written === 0 && (e.currClient = t.id.client, e.encoder.writeClient(t.id.client), v(e.encoder.restEncoder, t.id.clock + n)), t.write(e.encoder, n), e.written++;
1863
+ }, ha = (e) => {
1864
+ ma(e);
1864
1865
  let t = e.encoder.restEncoder;
1865
1866
  v(t, e.clientStructs.length);
1866
1867
  for (let n = 0; n < e.clientStructs.length; n++) {
1867
1868
  let r = e.clientStructs[n];
1868
1869
  v(t, r.written), ke(t, r.restEncoder);
1869
1870
  }
1870
- }, ma = (e, t, n, r) => {
1871
- let i = new n(w(e)), a = new oa(i, !1), o = new r(), s = new sa(o);
1871
+ }, ga = (e, t, n, r) => {
1872
+ let i = new n(w(e)), a = new ca(i, !1), o = new r(), s = new la(o);
1872
1873
  for (let e = a.curr; e !== null; e = a.next()) W(s, t(e), 0);
1873
- return pa(s), Ur(o, Wr(i)), o.toUint8Array();
1874
- }, ha = (e) => ma(e, Mt, Zr, $r), ga = "You must not compute changes after the event-handler fired.", _a = class {
1874
+ return ha(s), Wr(o, Gr(i)), o.toUint8Array();
1875
+ }, _a = (e) => ga(e, Pt, Qr, ei), va = "You must not compute changes after the event-handler fired.", ya = class {
1875
1876
  constructor(e, t) {
1876
1877
  this.target = e, this.currentTarget = e, this.transaction = t, this._changes = null, this._keys = null, this._delta = null, this._path = null;
1877
1878
  }
1878
1879
  get path() {
1879
- return this._path ||= va(this.currentTarget, this.target);
1880
+ return this._path ||= ba(this.currentTarget, this.target);
1880
1881
  }
1881
1882
  deletes(e) {
1882
- return Lr(this.transaction.deleteSet, e.id);
1883
+ return Rr(this.transaction.deleteSet, e.id);
1883
1884
  }
1884
1885
  get keys() {
1885
1886
  if (this._keys === null) {
1886
- if (this.transaction.doc._transactionCleanups.length === 0) throw x(ga);
1887
+ if (this.transaction.doc._transactionCleanups.length === 0) throw x(va);
1887
1888
  let e = /* @__PURE__ */ new Map(), t = this.target;
1888
1889
  this.transaction.changed.get(t).forEach((n) => {
1889
1890
  if (n !== null) {
@@ -1915,7 +1916,7 @@ var oa = class {
1915
1916
  get changes() {
1916
1917
  let e = this._changes;
1917
1918
  if (e === null) {
1918
- if (this.transaction.doc._transactionCleanups.length === 0) throw x(ga);
1919
+ if (this.transaction.doc._transactionCleanups.length === 0) throw x(va);
1919
1920
  let t = this.target, n = a(), r = a(), i = [];
1920
1921
  if (e = {
1921
1922
  added: n,
@@ -1933,7 +1934,7 @@ var oa = class {
1933
1934
  }
1934
1935
  return e;
1935
1936
  }
1936
- }, va = (e, t) => {
1937
+ }, ba = (e, t) => {
1937
1938
  let n = [];
1938
1939
  for (; t._item !== null && t !== e;) {
1939
1940
  if (t._item.parentSub !== null) n.unshift(t._item.parentSub);
@@ -1946,28 +1947,28 @@ var oa = class {
1946
1947
  }
1947
1948
  return n;
1948
1949
  }, G = () => {
1949
- kr("Invalid access: Add Yjs type to a document before reading data.");
1950
- }, ya = 80, ba = 0, xa = class {
1950
+ Ar("Invalid access: Add Yjs type to a document before reading data.");
1951
+ }, xa = 80, Sa = 0, Ca = class {
1951
1952
  constructor(e, t) {
1952
- e.marker = !0, this.p = e, this.index = t, this.timestamp = ba++;
1953
- }
1954
- }, Sa = (e) => {
1955
- e.timestamp = ba++;
1956
- }, Ca = (e, t, n) => {
1957
- e.p.marker = !1, e.p = t, t.marker = !0, e.index = n, e.timestamp = ba++;
1958
- }, wa = (e, t, n) => {
1959
- if (e.length >= ya) {
1953
+ e.marker = !0, this.p = e, this.index = t, this.timestamp = Sa++;
1954
+ }
1955
+ }, wa = (e) => {
1956
+ e.timestamp = Sa++;
1957
+ }, Ta = (e, t, n) => {
1958
+ e.p.marker = !1, e.p = t, t.marker = !0, e.index = n, e.timestamp = Sa++;
1959
+ }, Ea = (e, t, n) => {
1960
+ if (e.length >= xa) {
1960
1961
  let r = e.reduce((e, t) => e.timestamp < t.timestamp ? e : t);
1961
- return Ca(r, t, n), r;
1962
+ return Ta(r, t, n), r;
1962
1963
  }
1963
1964
  {
1964
- let r = new xa(t, n);
1965
+ let r = new Ca(t, n);
1965
1966
  return e.push(r), r;
1966
1967
  }
1967
- }, Ta = (e, t) => {
1968
+ }, Da = (e, t) => {
1968
1969
  if (e._start === null || t === 0 || e._searchMarker === null) return null;
1969
1970
  let n = e._searchMarker.length === 0 ? null : e._searchMarker.reduce((e, n) => te(t - e.index) < te(t - n.index) ? e : n), r = e._start, i = 0;
1970
- for (n !== null && (r = n.p, i = n.index, Sa(n)); r.right !== null && i < t;) {
1971
+ for (n !== null && (r = n.p, i = n.index, wa(n)); r.right !== null && i < t;) {
1971
1972
  if (!r.deleted && r.countable) {
1972
1973
  if (t < i + r.length) break;
1973
1974
  i += r.length;
@@ -1976,8 +1977,8 @@ var oa = class {
1976
1977
  }
1977
1978
  for (; r.left !== null && i > t;) r = r.left, !r.deleted && r.countable && (i -= r.length);
1978
1979
  for (; r.left !== null && r.left.id.client === r.id.client && r.left.id.clock + r.left.length === r.id.clock;) r = r.left, !r.deleted && r.countable && (i -= r.length);
1979
- return n !== null && te(n.index - i) < r.parent.length / ya ? (Ca(n, r, i), n) : wa(e._searchMarker, r, i);
1980
- }, Ea = (e, t, n) => {
1980
+ return n !== null && te(n.index - i) < r.parent.length / xa ? (Ta(n, r, i), n) : Ea(e._searchMarker, r, i);
1981
+ }, Oa = (e, t, n) => {
1981
1982
  for (let r = e.length - 1; r >= 0; r--) {
1982
1983
  let i = e[r];
1983
1984
  if (n > 0) {
@@ -1991,13 +1992,13 @@ var oa = class {
1991
1992
  }
1992
1993
  (t < i.index || n > 0 && t === i.index) && (i.index = h(t, i.index + n));
1993
1994
  }
1994
- }, Da = (e, t, r) => {
1995
+ }, ka = (e, t, r) => {
1995
1996
  let i = e, a = t.changedParentTypes;
1996
1997
  for (; n(a, e, () => []).push(r), e._item !== null;) e = e._item.parent;
1997
- Si(i._eH, r, t);
1998
+ Ci(i._eH, r, t);
1998
1999
  }, K = class {
1999
2000
  constructor() {
2000
- this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = yi(), this._dEH = yi(), this._searchMarker = null;
2001
+ this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = bi(), this._dEH = bi(), this._searchMarker = null;
2001
2002
  }
2002
2003
  get parent() {
2003
2004
  return this._item ? this._item.parent : null;
@@ -2021,19 +2022,19 @@ var oa = class {
2021
2022
  !e.local && this._searchMarker && (this._searchMarker.length = 0);
2022
2023
  }
2023
2024
  observe(e) {
2024
- bi(this._eH, e);
2025
+ xi(this._eH, e);
2025
2026
  }
2026
2027
  observeDeep(e) {
2027
- bi(this._dEH, e);
2028
+ xi(this._dEH, e);
2028
2029
  }
2029
2030
  unobserve(e) {
2030
- xi(this._eH, e);
2031
+ Si(this._eH, e);
2031
2032
  }
2032
2033
  unobserveDeep(e) {
2033
- xi(this._dEH, e);
2034
+ Si(this._dEH, e);
2034
2035
  }
2035
2036
  toJSON() {}
2036
- }, Oa = (e, t, n) => {
2037
+ }, Aa = (e, t, n) => {
2037
2038
  e.doc ?? G(), t < 0 && (t = e._length + t), n < 0 && (n = e._length + n);
2038
2039
  let r = n - t, i = [], a = e._start;
2039
2040
  for (; a !== null && r > 0;) {
@@ -2048,7 +2049,7 @@ var oa = class {
2048
2049
  a = a.right;
2049
2050
  }
2050
2051
  return i;
2051
- }, ka = (e) => {
2052
+ }, ja = (e) => {
2052
2053
  e.doc ?? G();
2053
2054
  let t = [], n = e._start;
2054
2055
  for (; n !== null;) {
@@ -2059,7 +2060,7 @@ var oa = class {
2059
2060
  n = n.right;
2060
2061
  }
2061
2062
  return t;
2062
- }, Aa = (e, t) => {
2063
+ }, Ma = (e, t) => {
2063
2064
  let n = [], r = e._start;
2064
2065
  for (; r !== null;) {
2065
2066
  if (r.countable && z(r, t)) {
@@ -2069,7 +2070,7 @@ var oa = class {
2069
2070
  r = r.right;
2070
2071
  }
2071
2072
  return n;
2072
- }, ja = (e, t) => {
2073
+ }, Na = (e, t) => {
2073
2074
  let n = 0, r = e._start;
2074
2075
  for (e.doc ?? G(); r !== null;) {
2075
2076
  if (r.countable && !r.deleted) {
@@ -2078,12 +2079,12 @@ var oa = class {
2078
2079
  }
2079
2080
  r = r.right;
2080
2081
  }
2081
- }, Ma = (e, t) => {
2082
+ }, Pa = (e, t) => {
2082
2083
  let n = [];
2083
- return ja(e, (r, i) => {
2084
+ return Na(e, (r, i) => {
2084
2085
  n.push(t(r, i, e));
2085
2086
  }), n;
2086
- }, Na = (e) => {
2087
+ }, Fa = (e) => {
2087
2088
  let t = e._start, n = null, r = 0;
2088
2089
  return {
2089
2090
  [Symbol.iterator]() {
@@ -2105,16 +2106,16 @@ var oa = class {
2105
2106
  };
2106
2107
  }
2107
2108
  };
2108
- }, Pa = (e, t) => {
2109
+ }, Ia = (e, t) => {
2109
2110
  e.doc ?? G();
2110
- let n = Ta(e, t), r = e._start;
2111
+ let n = Da(e, t), r = e._start;
2111
2112
  for (n !== null && (r = n.p, t -= n.index); r !== null; r = r.right) if (!r.deleted && r.countable) {
2112
2113
  if (t < r.length) return r.content.getContent()[t];
2113
2114
  t -= r.length;
2114
2115
  }
2115
- }, Fa = (e, t, n, r) => {
2116
+ }, La = (e, t, n, r) => {
2116
2117
  let i = n, a = e.doc, o = a.clientID, s = a.store, c = n === null ? t._start : n.right, l = [], u = () => {
2117
- l.length > 0 && (i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new Ho(l)), i.integrate(e, 0), l = []);
2118
+ l.length > 0 && (i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new Wo(l)), i.integrate(e, 0), l = []);
2118
2119
  };
2119
2120
  r.forEach((n) => {
2120
2121
  if (n === null) l.push(n);
@@ -2129,20 +2130,20 @@ var oa = class {
2129
2130
  default: switch (u(), n.constructor) {
2130
2131
  case Uint8Array:
2131
2132
  case ArrayBuffer:
2132
- i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new ko(new Uint8Array(n))), i.integrate(e, 0);
2133
+ i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new jo(new Uint8Array(n))), i.integrate(e, 0);
2133
2134
  break;
2134
- case qr:
2135
- i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new Po(n)), i.integrate(e, 0);
2135
+ case Jr:
2136
+ i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new Io(n)), i.integrate(e, 0);
2136
2137
  break;
2137
2138
  default: if (n instanceof K) i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new Z(n)), i.integrate(e, 0);
2138
2139
  else throw Error("Unexpected content type in insert operation");
2139
2140
  }
2140
2141
  }
2141
2142
  }), u();
2142
- }, Ia = () => x("Length exceeded!"), La = (e, t, n, r) => {
2143
- if (n > t._length) throw Ia();
2144
- if (n === 0) return t._searchMarker && Ea(t._searchMarker, n, r.length), Fa(e, t, null, r);
2145
- let i = n, a = Ta(t, n), o = t._start;
2143
+ }, Ra = () => x("Length exceeded!"), za = (e, t, n, r) => {
2144
+ if (n > t._length) throw Ra();
2145
+ if (n === 0) return t._searchMarker && Oa(t._searchMarker, n, r.length), La(e, t, null, r);
2146
+ let i = n, a = Da(t, n), o = t._start;
2146
2147
  for (a !== null && (o = a.p, n -= a.index, n === 0 && (o = o.prev, n += o && o.countable && !o.deleted ? o.length : 0)); o !== null; o = o.right) if (!o.deleted && o.countable) {
2147
2148
  if (n <= o.length) {
2148
2149
  n < o.length && H(e, R(o.id.client, o.id.clock + n));
@@ -2150,27 +2151,27 @@ var oa = class {
2150
2151
  }
2151
2152
  n -= o.length;
2152
2153
  }
2153
- return t._searchMarker && Ea(t._searchMarker, i, r.length), Fa(e, t, o, r);
2154
- }, Ra = (e, t, n) => {
2154
+ return t._searchMarker && Oa(t._searchMarker, i, r.length), La(e, t, o, r);
2155
+ }, Ba = (e, t, n) => {
2155
2156
  let r = (t._searchMarker || []).reduce((e, t) => t.index > e.index ? t : e, {
2156
2157
  index: 0,
2157
2158
  p: t._start
2158
2159
  }).p;
2159
2160
  if (r) for (; r.right;) r = r.right;
2160
- return Fa(e, t, r, n);
2161
- }, za = (e, t, n, r) => {
2161
+ return La(e, t, r, n);
2162
+ }, Va = (e, t, n, r) => {
2162
2163
  if (r === 0) return;
2163
- let i = n, a = r, o = Ta(t, n), s = t._start;
2164
+ let i = n, a = r, o = Da(t, n), s = t._start;
2164
2165
  for (o !== null && (s = o.p, n -= o.index); s !== null && n > 0; s = s.right) !s.deleted && s.countable && (n < s.length && H(e, R(s.id.client, s.id.clock + n)), n -= s.length);
2165
2166
  for (; r > 0 && s !== null;) s.deleted || (r < s.length && H(e, R(s.id.client, s.id.clock + r)), s.delete(e), r -= s.length), s = s.right;
2166
- if (r > 0) throw Ia();
2167
- t._searchMarker && Ea(t._searchMarker, i, -a + r);
2168
- }, Ba = (e, t, n) => {
2167
+ if (r > 0) throw Ra();
2168
+ t._searchMarker && Oa(t._searchMarker, i, -a + r);
2169
+ }, Ha = (e, t, n) => {
2169
2170
  let r = t._map.get(n);
2170
2171
  r !== void 0 && r.delete(e);
2171
- }, Va = (e, t, n, r) => {
2172
+ }, Ua = (e, t, n, r) => {
2172
2173
  let i = t._map.get(n) || null, a = e.doc, o = a.clientID, s;
2173
- if (r == null) s = new Ho([r]);
2174
+ if (r == null) s = new Wo([r]);
2174
2175
  else switch (r.constructor) {
2175
2176
  case Number:
2176
2177
  case Object:
@@ -2179,39 +2180,39 @@ var oa = class {
2179
2180
  case String:
2180
2181
  case Date:
2181
2182
  case BigInt:
2182
- s = new Ho([r]);
2183
+ s = new Wo([r]);
2183
2184
  break;
2184
2185
  case Uint8Array:
2185
- s = new ko(r);
2186
+ s = new jo(r);
2186
2187
  break;
2187
- case qr:
2188
- s = new Po(r);
2188
+ case Jr:
2189
+ s = new Io(r);
2189
2190
  break;
2190
2191
  default: if (r instanceof K) s = new Z(r);
2191
2192
  else throw Error("Unexpected content type");
2192
2193
  }
2193
2194
  new Q(R(o, B(a.store, o)), i, i && i.lastId, null, null, t, n, s).integrate(e, 0);
2194
- }, Ha = (e, t) => {
2195
+ }, Wa = (e, t) => {
2195
2196
  e.doc ?? G();
2196
2197
  let n = e._map.get(t);
2197
2198
  return n !== void 0 && !n.deleted ? n.content.getContent()[n.length - 1] : void 0;
2198
- }, Ua = (e) => {
2199
+ }, Ga = (e) => {
2199
2200
  let t = {};
2200
2201
  return e.doc ?? G(), e._map.forEach((e, n) => {
2201
2202
  e.deleted || (t[n] = e.content.getContent()[e.length - 1]);
2202
2203
  }), t;
2203
- }, Wa = (e, t) => {
2204
+ }, Ka = (e, t) => {
2204
2205
  e.doc ?? G();
2205
2206
  let n = e._map.get(t);
2206
2207
  return n !== void 0 && !n.deleted;
2207
- }, Ga = (e, t) => {
2208
+ }, qa = (e, t) => {
2208
2209
  let n = {};
2209
2210
  return e._map.forEach((e, r) => {
2210
2211
  let i = e;
2211
2212
  for (; i !== null && (!t.sv.has(i.id.client) || i.id.clock >= (t.sv.get(i.id.client) || 0));) i = i.left;
2212
2213
  i !== null && z(i, t) && (n[r] = i.content.getContent()[i.length - 1]);
2213
2214
  }), n;
2214
- }, Ka = (e) => (e.doc ?? G(), Mr(e._map.entries(), (e) => !e[1].deleted)), qa = class extends _a {}, Ja = class e extends K {
2215
+ }, Ja = (e) => (e.doc ?? G(), Nr(e._map.entries(), (e) => !e[1].deleted)), Ya = class extends ya {}, Xa = class e extends K {
2215
2216
  constructor() {
2216
2217
  super(), this._prelimContent = [], this._searchMarker = [];
2217
2218
  }
@@ -2233,16 +2234,16 @@ var oa = class {
2233
2234
  return this.doc ?? G(), this._length;
2234
2235
  }
2235
2236
  _callObserver(e, t) {
2236
- super._callObserver(e, t), Da(this, e, new qa(this, e));
2237
+ super._callObserver(e, t), ka(this, e, new Ya(this, e));
2237
2238
  }
2238
2239
  insert(e, t) {
2239
2240
  this.doc === null ? this._prelimContent.splice(e, 0, ...t) : U(this.doc, (n) => {
2240
- La(n, this, e, t);
2241
+ za(n, this, e, t);
2241
2242
  });
2242
2243
  }
2243
2244
  push(e) {
2244
2245
  this.doc === null ? this._prelimContent.push(...e) : U(this.doc, (t) => {
2245
- Ra(t, this, e);
2246
+ Ba(t, this, e);
2246
2247
  });
2247
2248
  }
2248
2249
  unshift(e) {
@@ -2250,38 +2251,38 @@ var oa = class {
2250
2251
  }
2251
2252
  delete(e, t = 1) {
2252
2253
  this.doc === null ? this._prelimContent.splice(e, t) : U(this.doc, (n) => {
2253
- za(n, this, e, t);
2254
+ Va(n, this, e, t);
2254
2255
  });
2255
2256
  }
2256
2257
  get(e) {
2257
- return Pa(this, e);
2258
+ return Ia(this, e);
2258
2259
  }
2259
2260
  toArray() {
2260
- return ka(this);
2261
+ return ja(this);
2261
2262
  }
2262
2263
  slice(e = 0, t = this.length) {
2263
- return Oa(this, e, t);
2264
+ return Aa(this, e, t);
2264
2265
  }
2265
2266
  toJSON() {
2266
2267
  return this.map((e) => e instanceof K ? e.toJSON() : e);
2267
2268
  }
2268
2269
  map(e) {
2269
- return Ma(this, e);
2270
+ return Pa(this, e);
2270
2271
  }
2271
2272
  forEach(e) {
2272
- ja(this, e);
2273
+ Na(this, e);
2273
2274
  }
2274
2275
  [Symbol.iterator]() {
2275
- return Na(this);
2276
+ return Fa(this);
2276
2277
  }
2277
2278
  _write(e) {
2278
- e.writeTypeRef(Ko);
2279
+ e.writeTypeRef(Jo);
2279
2280
  }
2280
- }, Ya = (e) => new Ja(), Xa = class extends _a {
2281
+ }, Za = (e) => new Xa(), Qa = class extends ya {
2281
2282
  constructor(e, t, n) {
2282
2283
  super(e, t), this.keysChanged = n;
2283
2284
  }
2284
- }, Za = class e extends K {
2285
+ }, $a = class e extends K {
2285
2286
  constructor(e) {
2286
2287
  super(), this._prelimContent = null, this._prelimContent = e === void 0 ? /* @__PURE__ */ new Map() : new Map(e);
2287
2288
  }
@@ -2300,7 +2301,7 @@ var oa = class {
2300
2301
  }), t;
2301
2302
  }
2302
2303
  _callObserver(e, t) {
2303
- Da(this, e, new Xa(this, e, t));
2304
+ ka(this, e, new Qa(this, e, t));
2304
2305
  }
2305
2306
  toJSON() {
2306
2307
  this.doc ?? G();
@@ -2313,16 +2314,16 @@ var oa = class {
2313
2314
  }), e;
2314
2315
  }
2315
2316
  get size() {
2316
- return [...Ka(this)].length;
2317
+ return [...Ja(this)].length;
2317
2318
  }
2318
2319
  keys() {
2319
- return Nr(Ka(this), (e) => e[0]);
2320
+ return Pr(Ja(this), (e) => e[0]);
2320
2321
  }
2321
2322
  values() {
2322
- return Nr(Ka(this), (e) => e[1].content.getContent()[e[1].length - 1]);
2323
+ return Pr(Ja(this), (e) => e[1].content.getContent()[e[1].length - 1]);
2323
2324
  }
2324
2325
  entries() {
2325
- return Nr(Ka(this), (e) => [e[0], e[1].content.getContent()[e[1].length - 1]]);
2326
+ return Pr(Ja(this), (e) => [e[0], e[1].content.getContent()[e[1].length - 1]]);
2326
2327
  }
2327
2328
  forEach(e) {
2328
2329
  this.doc ?? G(), this._map.forEach((t, n) => {
@@ -2334,70 +2335,56 @@ var oa = class {
2334
2335
  }
2335
2336
  delete(e) {
2336
2337
  this.doc === null ? this._prelimContent.delete(e) : U(this.doc, (t) => {
2337
- Ba(t, this, e);
2338
+ Ha(t, this, e);
2338
2339
  });
2339
2340
  }
2340
2341
  set(e, t) {
2341
2342
  return this.doc === null ? this._prelimContent.set(e, t) : U(this.doc, (n) => {
2342
- Va(n, this, e, t);
2343
+ Ua(n, this, e, t);
2343
2344
  }), t;
2344
2345
  }
2345
2346
  get(e) {
2346
- return Ha(this, e);
2347
+ return Wa(this, e);
2347
2348
  }
2348
2349
  has(e) {
2349
- return Wa(this, e);
2350
+ return Ka(this, e);
2350
2351
  }
2351
2352
  clear() {
2352
2353
  this.doc === null ? this._prelimContent.clear() : U(this.doc, (e) => {
2353
2354
  this.forEach(function(t, n, r) {
2354
- Ba(e, r, n);
2355
+ Ha(e, r, n);
2355
2356
  });
2356
2357
  });
2357
2358
  }
2358
2359
  _write(e) {
2359
- e.writeTypeRef(qo);
2360
+ e.writeTypeRef(Yo);
2360
2361
  }
2361
- }, Qa = (e) => new Za(), q = (e, t) => e === t || typeof e == "object" && typeof t == "object" && e && t && Ot(e, t), $a = class {
2362
+ }, eo = (e) => new $a(), q = (e, t) => e === t || typeof e == "object" && typeof t == "object" && e && t && At(e, t), to = class {
2362
2363
  constructor(e, t, n, r) {
2363
2364
  this.left = e, this.right = t, this.index = n, this.currentAttributes = r;
2364
2365
  }
2365
2366
  forward() {
2366
- switch (this.right === null && C(), this.right.content.constructor) {
2367
- case Y:
2368
- this.right.deleted || ro(this.currentAttributes, this.right.content);
2369
- break;
2370
- default: this.right.deleted || (this.index += this.right.length);
2371
- }
2372
- this.left = this.right, this.right = this.right.right;
2373
- }
2374
- }, eo = (e, t, n) => {
2375
- for (; t.right !== null && n > 0;) {
2376
- switch (t.right.content.constructor) {
2377
- case Y:
2378
- t.right.deleted || ro(t.currentAttributes, t.right.content);
2379
- break;
2380
- default: t.right.deleted || (n < t.right.length && H(e, R(t.right.id.client, t.right.id.clock + n)), t.index += t.right.length, n -= t.right.length);
2381
- }
2382
- t.left = t.right, t.right = t.right.right;
2367
+ this.right === null && C(), this.right.content.constructor === Y ? this.right.deleted || ao(this.currentAttributes, this.right.content) : this.right.deleted || (this.index += this.right.length), this.left = this.right, this.right = this.right.right;
2383
2368
  }
2369
+ }, no = (e, t, n) => {
2370
+ for (; t.right !== null && n > 0;) t.right.content.constructor === Y ? t.right.deleted || ao(t.currentAttributes, t.right.content) : t.right.deleted || (n < t.right.length && H(e, R(t.right.id.client, t.right.id.clock + n)), t.index += t.right.length, n -= t.right.length), t.left = t.right, t.right = t.right.right;
2384
2371
  return t;
2385
- }, to = (e, t, n, r) => {
2386
- let i = /* @__PURE__ */ new Map(), a = r ? Ta(t, n) : null;
2387
- return a ? eo(e, new $a(a.p.left, a.p, a.index, i), n - a.index) : eo(e, new $a(null, t._start, 0, i), n);
2388
- }, no = (e, t, n, r) => {
2372
+ }, ro = (e, t, n, r) => {
2373
+ let i = /* @__PURE__ */ new Map(), a = r ? Da(t, n) : null;
2374
+ return a ? no(e, new to(a.p.left, a.p, a.index, i), n - a.index) : no(e, new to(null, t._start, 0, i), n);
2375
+ }, io = (e, t, n, r) => {
2389
2376
  for (; n.right !== null && (n.right.deleted === !0 || n.right.content.constructor === Y && q(r.get(n.right.content.key), n.right.content.value));) n.right.deleted || r.delete(n.right.content.key), n.forward();
2390
2377
  let i = e.doc, a = i.clientID;
2391
2378
  r.forEach((r, o) => {
2392
2379
  let s = n.left, c = n.right, l = new Q(R(a, B(i.store, a)), s, s && s.lastId, c, c && c.id, t, null, new Y(o, r));
2393
2380
  l.integrate(e, 0), n.right = l, n.forward();
2394
2381
  });
2395
- }, ro = (e, t) => {
2382
+ }, ao = (e, t) => {
2396
2383
  let { key: n, value: r } = t;
2397
2384
  r === null ? e.delete(n) : e.set(n, r);
2398
- }, io = (e, t) => {
2385
+ }, oo = (e, t) => {
2399
2386
  for (; e.right !== null && (e.right.deleted || e.right.content.constructor === Y && q(t[e.right.content.key] ?? null, e.right.content.value));) e.forward();
2400
- }, ao = (e, t, n, r) => {
2387
+ }, so = (e, t, n, r) => {
2401
2388
  let i = e.doc, a = i.clientID, o = /* @__PURE__ */ new Map();
2402
2389
  for (let s in r) {
2403
2390
  let c = r[s], l = n.currentAttributes.get(s) ?? null;
@@ -2408,26 +2395,26 @@ var oa = class {
2408
2395
  }
2409
2396
  }
2410
2397
  return o;
2411
- }, oo = (e, t, n, r, i) => {
2398
+ }, co = (e, t, n, r, i) => {
2412
2399
  n.currentAttributes.forEach((e, t) => {
2413
2400
  i[t] === void 0 && (i[t] = null);
2414
2401
  });
2415
2402
  let a = e.doc, o = a.clientID;
2416
- io(n, i);
2417
- let s = ao(e, t, n, i), c = r.constructor === String ? new X(r) : r instanceof K ? new Z(r) : new Io(r), { left: l, right: u, index: d } = n;
2418
- t._searchMarker && Ea(t._searchMarker, n.index, c.getLength()), u = new Q(R(o, B(a.store, o)), l, l && l.lastId, u, u && u.id, t, null, c), u.integrate(e, 0), n.right = u, n.index = d, n.forward(), no(e, t, n, s);
2419
- }, so = (e, t, n, r, i) => {
2403
+ oo(n, i);
2404
+ let s = so(e, t, n, i), c = r.constructor === String ? new X(r) : r instanceof K ? new Z(r) : new Ro(r), { left: l, right: u, index: d } = n;
2405
+ t._searchMarker && Oa(t._searchMarker, n.index, c.getLength()), u = new Q(R(o, B(a.store, o)), l, l && l.lastId, u, u && u.id, t, null, c), u.integrate(e, 0), n.right = u, n.index = d, n.forward(), io(e, t, n, s);
2406
+ }, lo = (e, t, n, r, i) => {
2420
2407
  let a = e.doc, o = a.clientID;
2421
- io(n, i);
2422
- let s = ao(e, t, n, i);
2423
- iterationLoop: for (; n.right !== null && (r > 0 || s.size > 0 && (n.right.deleted || n.right.content.constructor === Y));) {
2408
+ oo(n, i);
2409
+ let s = so(e, t, n, i);
2410
+ e: for (; n.right !== null && (r > 0 || s.size > 0 && (n.right.deleted || n.right.content.constructor === Y));) {
2424
2411
  if (!n.right.deleted) switch (n.right.content.constructor) {
2425
2412
  case Y: {
2426
2413
  let { key: t, value: a } = n.right.content, o = i[t];
2427
2414
  if (o !== void 0) {
2428
2415
  if (q(o, a)) s.delete(t);
2429
2416
  else {
2430
- if (r === 0) break iterationLoop;
2417
+ if (r === 0) break e;
2431
2418
  s.set(t, a);
2432
2419
  }
2433
2420
  n.right.delete(e);
@@ -2443,8 +2430,8 @@ var oa = class {
2443
2430
  for (; r > 0; r--) i += "\n";
2444
2431
  n.right = new Q(R(o, B(a.store, o)), n.left, n.left && n.left.lastId, n.right, n.right && n.right.id, t, null, new X(i)), n.right.integrate(e, 0), n.forward();
2445
2432
  }
2446
- no(e, t, n, s);
2447
- }, co = (t, n, r, i, a) => {
2433
+ io(e, t, n, s);
2434
+ }, uo = (t, n, r, i, a) => {
2448
2435
  let o = n, s = e();
2449
2436
  for (; o && (!o.countable || o.deleted);) {
2450
2437
  if (!o.deleted && o.content.constructor === Y) {
@@ -2460,7 +2447,7 @@ var oa = class {
2460
2447
  switch (e.constructor) {
2461
2448
  case Y: {
2462
2449
  let { key: r, value: o } = e, u = i.get(r) ?? null;
2463
- (s.get(r) !== e || u === o) && (n.delete(t), c++, !l && (a.get(r) ?? null) === o && u !== o && (u === null ? a.delete(r) : a.set(r, u))), !l && !n.deleted && ro(a, e);
2450
+ (s.get(r) !== e || u === o) && (n.delete(t), c++, !l && (a.get(r) ?? null) === o && u !== o && (u === null ? a.delete(r) : a.set(r, u))), !l && !n.deleted && ao(a, e);
2464
2451
  break;
2465
2452
  }
2466
2453
  }
@@ -2468,7 +2455,7 @@ var oa = class {
2468
2455
  n = n.right;
2469
2456
  }
2470
2457
  return c;
2471
- }, lo = (e, t) => {
2458
+ }, fo = (e, t) => {
2472
2459
  for (; t && t.right && (t.right.deleted || !t.right.countable);) t = t.right;
2473
2460
  let n = /* @__PURE__ */ new Set();
2474
2461
  for (; t && (t.deleted || !t.countable);) {
@@ -2478,25 +2465,17 @@ var oa = class {
2478
2465
  }
2479
2466
  t = t.left;
2480
2467
  }
2481
- }, uo = (n) => {
2468
+ }, po = (n) => {
2482
2469
  let r = 0;
2483
2470
  return U(n.doc, (i) => {
2484
2471
  let a = n._start, o = n._start, s = e(), c = t(s);
2485
- for (; o;) {
2486
- if (o.deleted === !1) switch (o.content.constructor) {
2487
- case Y:
2488
- ro(c, o.content);
2489
- break;
2490
- default: r += co(i, a, o, s, c), s = t(c), a = o;
2491
- }
2492
- o = o.right;
2493
- }
2472
+ for (; o;) o.deleted === !1 && (o.content.constructor === Y ? ao(c, o.content) : (r += uo(i, a, o, s, c), s = t(c), a = o)), o = o.right;
2494
2473
  }), r;
2495
- }, fo = (e) => {
2474
+ }, mo = (e) => {
2496
2475
  let t = /* @__PURE__ */ new Set(), n = e.doc;
2497
2476
  for (let [r, i] of e.afterState.entries()) {
2498
2477
  let a = e.beforeState.get(r) || 0;
2499
- i !== a && qi(e, n.store.clients.get(r), a, i, (e) => {
2478
+ i !== a && Yi(e, n.store.clients.get(r), a, i, (e) => {
2500
2479
  !e.deleted && e.content.constructor === Y && e.constructor !== J && t.add(e.parent);
2501
2480
  });
2502
2481
  }
@@ -2504,24 +2483,24 @@ var oa = class {
2504
2483
  I(e, e.deleteSet, (e) => {
2505
2484
  if (e instanceof J || !e.parent._hasFormatting || t.has(e.parent)) return;
2506
2485
  let r = e.parent;
2507
- e.content.constructor === Y ? t.add(r) : lo(n, e);
2486
+ e.content.constructor === Y ? t.add(r) : fo(n, e);
2508
2487
  });
2509
- for (let e of t) uo(e);
2488
+ for (let e of t) po(e);
2510
2489
  });
2511
- }, po = (e, n, r) => {
2490
+ }, ho = (e, n, r) => {
2512
2491
  let i = r, a = t(n.currentAttributes), o = n.right;
2513
2492
  for (; r > 0 && n.right !== null;) {
2514
2493
  if (n.right.deleted === !1) switch (n.right.content.constructor) {
2515
2494
  case Z:
2516
- case Io:
2495
+ case Ro:
2517
2496
  case X: r < n.right.length && H(e, R(n.right.id.client, n.right.id.clock + r)), r -= n.right.length, n.right.delete(e);
2518
2497
  }
2519
2498
  n.forward();
2520
2499
  }
2521
- o && co(e, o, n.right, a, n.currentAttributes);
2500
+ o && uo(e, o, n.right, a, n.currentAttributes);
2522
2501
  let s = (n.left || n.right).parent;
2523
- return s._searchMarker && Ea(s._searchMarker, n.index, -i + r), n;
2524
- }, mo = class extends _a {
2502
+ return s._searchMarker && Oa(s._searchMarker, n.index, -i + r), n;
2503
+ }, go = class extends ya {
2525
2504
  constructor(e, t, n) {
2526
2505
  super(e, t), this.childListChanged = !1, this.keysChanged = /* @__PURE__ */ new Set(), n.forEach((e) => {
2527
2506
  e === null ? this.childListChanged = !0 : this.keysChanged.add(e);
@@ -2555,7 +2534,7 @@ var oa = class {
2555
2534
  t !== null && (e.attributes[n] = t);
2556
2535
  }))), s = "";
2557
2536
  break;
2558
- case "retain": c > 0 && (e = { retain: c }, Tt(o) || (e.attributes = bt({}, o))), c = 0;
2537
+ case "retain": c > 0 && (e = { retain: c }, Dt(o) || (e.attributes = St({}, o))), c = 0;
2559
2538
  }
2560
2539
  e && t.push(e), a = null;
2561
2540
  }
@@ -2563,7 +2542,7 @@ var oa = class {
2563
2542
  for (; i !== null;) {
2564
2543
  switch (i.content.constructor) {
2565
2544
  case Z:
2566
- case Io:
2545
+ case Ro:
2567
2546
  this.adds(i) ? this.deletes(i) || (u(), a = "insert", s = i.content.getContent()[0], u()) : this.deletes(i) ? (a !== "delete" && (u(), a = "delete"), l += 1) : i.deleted || (a !== "retain" && (u(), a = "retain"), c += 1);
2568
2547
  break;
2569
2548
  case X:
@@ -2581,7 +2560,7 @@ var oa = class {
2581
2560
  let n = o[t];
2582
2561
  n !== void 0 && (q(n, s) ? n !== null && i.delete(e) : (a === "retain" && u(), s === null ? delete o[t] : o[t] = s));
2583
2562
  }
2584
- i.deleted || (a === "insert" && u(), ro(n, i.content));
2563
+ i.deleted || (a === "insert" && u(), ao(n, i.content));
2585
2564
  break;
2586
2565
  }
2587
2566
  }
@@ -2596,7 +2575,7 @@ var oa = class {
2596
2575
  }
2597
2576
  return this._delta;
2598
2577
  }
2599
- }, ho = class e extends K {
2578
+ }, _o = class e extends K {
2600
2579
  constructor(e) {
2601
2580
  super(), this._pending = e === void 0 ? [] : [() => this.insert(0, e)], this._searchMarker = [], this._hasFormatting = !1;
2602
2581
  }
@@ -2621,8 +2600,8 @@ var oa = class {
2621
2600
  }
2622
2601
  _callObserver(e, t) {
2623
2602
  super._callObserver(e, t);
2624
- let n = new mo(this, e, t);
2625
- Da(this, e, n), !e.local && this._hasFormatting && (e._needFormattingCleanup = !0);
2603
+ let n = new go(this, e, t);
2604
+ ka(this, e, n), !e.local && this._hasFormatting && (e._needFormattingCleanup = !0);
2626
2605
  }
2627
2606
  toString() {
2628
2607
  this.doc ?? G();
@@ -2635,13 +2614,13 @@ var oa = class {
2635
2614
  }
2636
2615
  applyDelta(e, { sanitize: t = !0 } = {}) {
2637
2616
  this.doc === null ? this._pending.push(() => this.applyDelta(e)) : U(this.doc, (n) => {
2638
- let r = new $a(null, this._start, 0, /* @__PURE__ */ new Map());
2617
+ let r = new to(null, this._start, 0, /* @__PURE__ */ new Map());
2639
2618
  for (let i = 0; i < e.length; i++) {
2640
2619
  let a = e[i];
2641
2620
  if (a.insert !== void 0) {
2642
2621
  let o = !t && typeof a.insert == "string" && i === e.length - 1 && r.right === null && a.insert.slice(-1) === "\n" ? a.insert.slice(0, -1) : a.insert;
2643
- (typeof o != "string" || o.length > 0) && oo(n, this, r, o, a.attributes || {});
2644
- } else a.retain === void 0 ? a.delete !== void 0 && po(n, r, a.delete) : so(n, this, r, a.retain, a.attributes || {});
2622
+ (typeof o != "string" || o.length > 0) && co(n, this, r, o, a.attributes || {});
2623
+ } else a.retain === void 0 ? a.delete !== void 0 && ho(n, r, a.delete) : lo(n, this, r, a.retain, a.attributes || {});
2645
2624
  }
2646
2625
  });
2647
2626
  }
@@ -2667,7 +2646,7 @@ var oa = class {
2667
2646
  break;
2668
2647
  }
2669
2648
  case Z:
2670
- case Io: {
2649
+ case Ro: {
2671
2650
  c();
2672
2651
  let e = { insert: s.content.getContent()[0] };
2673
2652
  if (i.size > 0) {
@@ -2679,68 +2658,68 @@ var oa = class {
2679
2658
  r.push(e);
2680
2659
  break;
2681
2660
  }
2682
- case Y: z(s, e) && (c(), ro(i, s.content));
2661
+ case Y: z(s, e) && (c(), ao(i, s.content));
2683
2662
  }
2684
2663
  s = s.right;
2685
2664
  }
2686
2665
  c();
2687
2666
  };
2688
2667
  return e || t ? U(a, (n) => {
2689
- e && zi(n, e), t && zi(n, t), l();
2668
+ e && Vi(n, e), t && Vi(n, t), l();
2690
2669
  }, "cleanup") : l(), r;
2691
2670
  }
2692
2671
  insert(e, t, n) {
2693
2672
  if (t.length <= 0) return;
2694
2673
  let r = this.doc;
2695
2674
  r === null ? this._pending.push(() => this.insert(e, t, n)) : U(r, (r) => {
2696
- let i = to(r, this, e, !n);
2675
+ let i = ro(r, this, e, !n);
2697
2676
  n || (n = {}, i.currentAttributes.forEach((e, t) => {
2698
2677
  n[t] = e;
2699
- })), oo(r, this, i, t, n);
2678
+ })), co(r, this, i, t, n);
2700
2679
  });
2701
2680
  }
2702
2681
  insertEmbed(e, t, n) {
2703
2682
  let r = this.doc;
2704
2683
  r === null ? this._pending.push(() => this.insertEmbed(e, t, n || {})) : U(r, (r) => {
2705
- let i = to(r, this, e, !n);
2706
- oo(r, this, i, t, n || {});
2684
+ let i = ro(r, this, e, !n);
2685
+ co(r, this, i, t, n || {});
2707
2686
  });
2708
2687
  }
2709
2688
  delete(e, t) {
2710
2689
  if (t === 0) return;
2711
2690
  let n = this.doc;
2712
2691
  n === null ? this._pending.push(() => this.delete(e, t)) : U(n, (n) => {
2713
- po(n, to(n, this, e, !0), t);
2692
+ ho(n, ro(n, this, e, !0), t);
2714
2693
  });
2715
2694
  }
2716
2695
  format(e, t, n) {
2717
2696
  if (t === 0) return;
2718
2697
  let r = this.doc;
2719
2698
  r === null ? this._pending.push(() => this.format(e, t, n)) : U(r, (r) => {
2720
- let i = to(r, this, e, !1);
2721
- i.right !== null && so(r, this, i, t, n);
2699
+ let i = ro(r, this, e, !1);
2700
+ i.right !== null && lo(r, this, i, t, n);
2722
2701
  });
2723
2702
  }
2724
2703
  removeAttribute(e) {
2725
2704
  this.doc === null ? this._pending.push(() => this.removeAttribute(e)) : U(this.doc, (t) => {
2726
- Ba(t, this, e);
2705
+ Ha(t, this, e);
2727
2706
  });
2728
2707
  }
2729
2708
  setAttribute(e, t) {
2730
2709
  this.doc === null ? this._pending.push(() => this.setAttribute(e, t)) : U(this.doc, (n) => {
2731
- Va(n, this, e, t);
2710
+ Ua(n, this, e, t);
2732
2711
  });
2733
2712
  }
2734
2713
  getAttribute(e) {
2735
- return Ha(this, e);
2714
+ return Wa(this, e);
2736
2715
  }
2737
2716
  getAttributes() {
2738
- return Ua(this);
2717
+ return Ga(this);
2739
2718
  }
2740
2719
  _write(e) {
2741
- e.writeTypeRef(Jo);
2720
+ e.writeTypeRef(Xo);
2742
2721
  }
2743
- }, go = (e) => new ho(), _o = class {
2722
+ }, vo = (e) => new _o(), yo = class {
2744
2723
  constructor(e, t = () => !0) {
2745
2724
  this._filter = t, this._root = e, this._currentNode = e._start, this._firstCall = !0, e.doc ?? G();
2746
2725
  }
@@ -2750,7 +2729,7 @@ var oa = class {
2750
2729
  next() {
2751
2730
  let e = this._currentNode, t = e && e.content && e.content.type;
2752
2731
  if (e !== null && (!this._firstCall || e.deleted || !this._filter(t))) do
2753
- if (t = e.content.type, !e.deleted && (t.constructor === bo || t.constructor === vo) && t._start !== null) e = t._start;
2732
+ if (t = e.content.type, !e.deleted && (t.constructor === So || t.constructor === bo) && t._start !== null) e = t._start;
2754
2733
  else for (; e !== null;) {
2755
2734
  let t = e.next;
2756
2735
  if (t !== null) {
@@ -2768,7 +2747,7 @@ var oa = class {
2768
2747
  done: !1
2769
2748
  });
2770
2749
  }
2771
- }, vo = class e extends K {
2750
+ }, bo = class e extends K {
2772
2751
  constructor() {
2773
2752
  super(), this._prelimContent = [];
2774
2753
  }
@@ -2790,40 +2769,40 @@ var oa = class {
2790
2769
  return this.doc ?? G(), this._prelimContent === null ? this._length : this._prelimContent.length;
2791
2770
  }
2792
2771
  createTreeWalker(e) {
2793
- return new _o(this, e);
2772
+ return new yo(this, e);
2794
2773
  }
2795
2774
  querySelector(e) {
2796
2775
  e = e.toUpperCase();
2797
- let t = new _o(this, (t) => t.nodeName && t.nodeName.toUpperCase() === e).next();
2776
+ let t = new yo(this, (t) => t.nodeName && t.nodeName.toUpperCase() === e).next();
2798
2777
  return t.done ? null : t.value;
2799
2778
  }
2800
2779
  querySelectorAll(e) {
2801
- return e = e.toUpperCase(), c(new _o(this, (t) => t.nodeName && t.nodeName.toUpperCase() === e));
2780
+ return e = e.toUpperCase(), c(new yo(this, (t) => t.nodeName && t.nodeName.toUpperCase() === e));
2802
2781
  }
2803
2782
  _callObserver(e, t) {
2804
- Da(this, e, new So(this, t, e));
2783
+ ka(this, e, new wo(this, t, e));
2805
2784
  }
2806
2785
  toString() {
2807
- return Ma(this, (e) => e.toString()).join("");
2786
+ return Pa(this, (e) => e.toString()).join("");
2808
2787
  }
2809
2788
  toJSON() {
2810
2789
  return this.toString();
2811
2790
  }
2812
2791
  toDOM(e = document, t = {}, n) {
2813
2792
  let r = e.createDocumentFragment();
2814
- return n !== void 0 && n._createAssociation(r, this), ja(this, (i) => {
2793
+ return n !== void 0 && n._createAssociation(r, this), Na(this, (i) => {
2815
2794
  r.insertBefore(i.toDOM(e, t, n), null);
2816
2795
  }), r;
2817
2796
  }
2818
2797
  insert(e, t) {
2819
2798
  this.doc === null ? this._prelimContent.splice(e, 0, ...t) : U(this.doc, (n) => {
2820
- La(n, this, e, t);
2799
+ za(n, this, e, t);
2821
2800
  });
2822
2801
  }
2823
2802
  insertAfter(e, t) {
2824
2803
  if (this.doc !== null) U(this.doc, (n) => {
2825
2804
  let r = e && e instanceof K ? e._item : e;
2826
- Fa(n, this, r, t);
2805
+ La(n, this, r, t);
2827
2806
  });
2828
2807
  else {
2829
2808
  let n = this._prelimContent, r = e === null ? 0 : n.findIndex((t) => t === e) + 1;
@@ -2833,11 +2812,11 @@ var oa = class {
2833
2812
  }
2834
2813
  delete(e, t = 1) {
2835
2814
  this.doc === null ? this._prelimContent.splice(e, t) : U(this.doc, (n) => {
2836
- za(n, this, e, t);
2815
+ Va(n, this, e, t);
2837
2816
  });
2838
2817
  }
2839
2818
  toArray() {
2840
- return ka(this);
2819
+ return ja(this);
2841
2820
  }
2842
2821
  push(e) {
2843
2822
  this.insert(this.length, e);
@@ -2846,18 +2825,18 @@ var oa = class {
2846
2825
  this.insert(0, e);
2847
2826
  }
2848
2827
  get(e) {
2849
- return Pa(this, e);
2828
+ return Ia(this, e);
2850
2829
  }
2851
2830
  slice(e = 0, t = this.length) {
2852
- return Oa(this, e, t);
2831
+ return Aa(this, e, t);
2853
2832
  }
2854
2833
  forEach(e) {
2855
- ja(this, e);
2834
+ Na(this, e);
2856
2835
  }
2857
2836
  _write(e) {
2858
- e.writeTypeRef(Xo);
2837
+ e.writeTypeRef(Qo);
2859
2838
  }
2860
- }, yo = (e) => new vo(), bo = class e extends vo {
2839
+ }, xo = (e) => new bo(), So = class e extends bo {
2861
2840
  constructor(e = "UNDEFINED") {
2862
2841
  super(), this.nodeName = e, this._prelimAttrs = /* @__PURE__ */ new Map();
2863
2842
  }
@@ -2879,7 +2858,7 @@ var oa = class {
2879
2858
  }
2880
2859
  clone() {
2881
2860
  let t = new e(this.nodeName);
2882
- return St(this.getAttributes(), (e, n) => {
2861
+ return wt(this.getAttributes(), (e, n) => {
2883
2862
  t.setAttribute(n, e);
2884
2863
  }), t.insert(0, this.toArray().map((e) => e instanceof K ? e.clone() : e)), t;
2885
2864
  }
@@ -2897,22 +2876,22 @@ var oa = class {
2897
2876
  }
2898
2877
  removeAttribute(e) {
2899
2878
  this.doc === null ? this._prelimAttrs.delete(e) : U(this.doc, (t) => {
2900
- Ba(t, this, e);
2879
+ Ha(t, this, e);
2901
2880
  });
2902
2881
  }
2903
2882
  setAttribute(e, t) {
2904
2883
  this.doc === null ? this._prelimAttrs.set(e, t) : U(this.doc, (n) => {
2905
- Va(n, this, e, t);
2884
+ Ua(n, this, e, t);
2906
2885
  });
2907
2886
  }
2908
2887
  getAttribute(e) {
2909
- return Ha(this, e);
2888
+ return Wa(this, e);
2910
2889
  }
2911
2890
  hasAttribute(e) {
2912
- return Wa(this, e);
2891
+ return Ka(this, e);
2913
2892
  }
2914
2893
  getAttributes(e) {
2915
- return e ? Ga(this, e) : Ua(this);
2894
+ return e ? qa(this, e) : Ga(this);
2916
2895
  }
2917
2896
  toDOM(e = document, t = {}, n) {
2918
2897
  let r = e.createElement(this.nodeName), i = this.getAttributes();
@@ -2920,20 +2899,20 @@ var oa = class {
2920
2899
  let t = i[e];
2921
2900
  typeof t == "string" && r.setAttribute(e, t);
2922
2901
  }
2923
- return ja(this, (i) => {
2902
+ return Na(this, (i) => {
2924
2903
  r.appendChild(i.toDOM(e, t, n));
2925
2904
  }), n !== void 0 && n._createAssociation(r, this), r;
2926
2905
  }
2927
2906
  _write(e) {
2928
- e.writeTypeRef(Yo), e.writeKey(this.nodeName);
2907
+ e.writeTypeRef(Zo), e.writeKey(this.nodeName);
2929
2908
  }
2930
- }, xo = (e) => new bo(e.readKey()), So = class extends _a {
2909
+ }, Co = (e) => new So(e.readKey()), wo = class extends ya {
2931
2910
  constructor(e, t, n) {
2932
2911
  super(e, n), this.childListChanged = !1, this.attributesChanged = /* @__PURE__ */ new Set(), t.forEach((e) => {
2933
2912
  e === null ? this.childListChanged = !0 : this.attributesChanged.add(e);
2934
2913
  });
2935
2914
  }
2936
- }, Co = class e extends Za {
2915
+ }, To = class e extends $a {
2937
2916
  constructor(e) {
2938
2917
  super(), this.hookName = e;
2939
2918
  }
@@ -2951,9 +2930,9 @@ var oa = class {
2951
2930
  return i = r === void 0 ? document.createElement(this.hookName) : r.createDom(this), i.setAttribute("data-yjs-hook", this.hookName), n !== void 0 && n._createAssociation(i, this), i;
2952
2931
  }
2953
2932
  _write(e) {
2954
- e.writeTypeRef(Zo), e.writeKey(this.hookName);
2933
+ e.writeTypeRef($o), e.writeKey(this.hookName);
2955
2934
  }
2956
- }, wo = (e) => new Co(e.readKey()), To = class e extends ho {
2935
+ }, Eo = (e) => new To(e.readKey()), Do = class e extends _o {
2957
2936
  get nextSibling() {
2958
2937
  let e = this._item ? this._item.next : null;
2959
2938
  return e ? e.content.type : null;
@@ -3007,9 +2986,9 @@ var oa = class {
3007
2986
  return this.toString();
3008
2987
  }
3009
2988
  _write(e) {
3010
- e.writeTypeRef(Qo);
2989
+ e.writeTypeRef(es);
3011
2990
  }
3012
- }, Eo = (e) => new To(), Do = class {
2991
+ }, Oo = (e) => new Do(), ko = class {
3013
2992
  constructor(e, t) {
3014
2993
  this.id = e, this.length = t;
3015
2994
  }
@@ -3025,7 +3004,7 @@ var oa = class {
3025
3004
  integrate(e, t) {
3026
3005
  throw S();
3027
3006
  }
3028
- }, Oo = 0, J = class extends Do {
3007
+ }, Ao = 0, J = class extends ko {
3029
3008
  get deleted() {
3030
3009
  return !0;
3031
3010
  }
@@ -3034,15 +3013,15 @@ var oa = class {
3034
3013
  return this.constructor === e.constructor && (this.length += e.length, !0);
3035
3014
  }
3036
3015
  integrate(e, t) {
3037
- t > 0 && (this.id.clock += t, this.length -= t), Hi(e.doc.store, this);
3016
+ t > 0 && (this.id.clock += t, this.length -= t), Wi(e.doc.store, this);
3038
3017
  }
3039
3018
  write(e, t) {
3040
- e.writeInfo(Oo), e.writeLen(this.length - t);
3019
+ e.writeInfo(Ao), e.writeLen(this.length - t);
3041
3020
  }
3042
3021
  getMissing(e, t) {
3043
3022
  return null;
3044
3023
  }
3045
- }, ko = class e {
3024
+ }, jo = class e {
3046
3025
  constructor(e) {
3047
3026
  this.content = e;
3048
3027
  }
@@ -3073,7 +3052,7 @@ var oa = class {
3073
3052
  getRef() {
3074
3053
  return 3;
3075
3054
  }
3076
- }, Ao = (e) => new ko(e.readBuf()), jo = class e {
3055
+ }, Mo = (e) => new jo(e.readBuf()), No = class e {
3077
3056
  constructor(e) {
3078
3057
  this.len = e;
3079
3058
  }
@@ -3097,7 +3076,7 @@ var oa = class {
3097
3076
  return this.len += e.len, !0;
3098
3077
  }
3099
3078
  integrate(e, t) {
3100
- Br(e.deleteSet, t.id.client, t.id.clock, this.len), t.markDeleted();
3079
+ Vr(e.deleteSet, t.id.client, t.id.clock, this.len), t.markDeleted();
3101
3080
  }
3102
3081
  delete(e) {}
3103
3082
  gc(e) {}
@@ -3107,11 +3086,11 @@ var oa = class {
3107
3086
  getRef() {
3108
3087
  return 1;
3109
3088
  }
3110
- }, Mo = (e) => new jo(e.readLen()), No = (e, t) => new qr({
3089
+ }, Po = (e) => new No(e.readLen()), Fo = (e, t) => new Jr({
3111
3090
  guid: e,
3112
3091
  ...t,
3113
3092
  shouldLoad: t.shouldLoad || t.autoLoad || !1
3114
- }), Po = class e {
3093
+ }), Io = class e {
3115
3094
  constructor(e) {
3116
3095
  e._item && console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."), this.doc = e;
3117
3096
  let t = {};
@@ -3127,7 +3106,7 @@ var oa = class {
3127
3106
  return !0;
3128
3107
  }
3129
3108
  copy() {
3130
- return new e(No(this.doc.guid, this.opts));
3109
+ return new e(Fo(this.doc.guid, this.opts));
3131
3110
  }
3132
3111
  splice(e) {
3133
3112
  throw S();
@@ -3148,7 +3127,7 @@ var oa = class {
3148
3127
  getRef() {
3149
3128
  return 9;
3150
3129
  }
3151
- }, Fo = (e) => new Po(No(e.readString(), e.readAny())), Io = class e {
3130
+ }, Lo = (e) => new Io(Fo(e.readString(), e.readAny())), Ro = class e {
3152
3131
  constructor(e) {
3153
3132
  this.embed = e;
3154
3133
  }
@@ -3179,7 +3158,7 @@ var oa = class {
3179
3158
  getRef() {
3180
3159
  return 5;
3181
3160
  }
3182
- }, Lo = (e) => new Io(e.readJSON()), Y = class e {
3161
+ }, zo = (e) => new Ro(e.readJSON()), Y = class e {
3183
3162
  constructor(e, t) {
3184
3163
  this.key = e, this.value = t;
3185
3164
  }
@@ -3213,7 +3192,7 @@ var oa = class {
3213
3192
  getRef() {
3214
3193
  return 6;
3215
3194
  }
3216
- }, Ro = (e) => new Y(e.readKey(), e.readJSON()), zo = class e {
3195
+ }, Bo = (e) => new Y(e.readKey(), e.readJSON()), Vo = class e {
3217
3196
  constructor(e) {
3218
3197
  this.arr = e;
3219
3198
  }
@@ -3250,16 +3229,16 @@ var oa = class {
3250
3229
  getRef() {
3251
3230
  return 2;
3252
3231
  }
3253
- }, Bo = (e) => {
3232
+ }, Ho = (e) => {
3254
3233
  let t = e.readLen(), n = [];
3255
3234
  for (let r = 0; r < t; r++) {
3256
3235
  let t = e.readString();
3257
3236
  t === "undefined" ? n.push(void 0) : n.push(JSON.parse(t));
3258
3237
  }
3259
- return new zo(n);
3260
- }, Vo = zt("node_env") === "development", Ho = class e {
3238
+ return new Vo(n);
3239
+ }, Uo = Vt("node_env") === "development", Wo = class e {
3261
3240
  constructor(e) {
3262
- this.arr = e, Vo && At(e);
3241
+ this.arr = e, Uo && Mt(e);
3263
3242
  }
3264
3243
  getLength() {
3265
3244
  return this.arr.length;
@@ -3294,10 +3273,10 @@ var oa = class {
3294
3273
  getRef() {
3295
3274
  return 8;
3296
3275
  }
3297
- }, Uo = (e) => {
3276
+ }, Go = (e) => {
3298
3277
  let t = e.readLen(), n = [];
3299
3278
  for (let r = 0; r < t; r++) n.push(e.readAny());
3300
- return new Ho(n);
3279
+ return new Wo(n);
3301
3280
  }, X = class e {
3302
3281
  constructor(e) {
3303
3282
  this.str = e;
@@ -3332,15 +3311,15 @@ var oa = class {
3332
3311
  getRef() {
3333
3312
  return 4;
3334
3313
  }
3335
- }, Wo = (e) => new X(e.readString()), Go = [
3336
- Ya,
3337
- Qa,
3338
- go,
3314
+ }, Ko = (e) => new X(e.readString()), qo = [
3315
+ Za,
3316
+ eo,
3317
+ vo,
3318
+ Co,
3339
3319
  xo,
3340
- yo,
3341
- wo,
3342
- Eo
3343
- ], Ko = 0, qo = 1, Jo = 2, Yo = 3, Xo = 4, Zo = 5, Qo = 6, Z = class e {
3320
+ Eo,
3321
+ Oo
3322
+ ], Jo = 0, Yo = 1, Xo = 2, Zo = 3, Qo = 4, $o = 5, es = 6, Z = class e {
3344
3323
  constructor(e) {
3345
3324
  this.type = e;
3346
3325
  }
@@ -3385,26 +3364,26 @@ var oa = class {
3385
3364
  getRef() {
3386
3365
  return 7;
3387
3366
  }
3388
- }, $o = (e) => new Z(Go[e.readTypeRef()](e)), es = (e, t) => {
3367
+ }, ts = (e) => new Z(qo[e.readTypeRef()](e)), ns = (e, t) => {
3389
3368
  let n = t, r = 0, i;
3390
3369
  do
3391
- r > 0 && (n = R(n.client, n.clock + r)), i = Ui(e, n), r = n.clock - i.id.clock, n = i.redone;
3370
+ r > 0 && (n = R(n.client, n.clock + r)), i = Gi(e, n), r = n.clock - i.id.clock, n = i.redone;
3392
3371
  while (n !== null && i instanceof Q);
3393
3372
  return {
3394
3373
  item: i,
3395
3374
  diff: r
3396
3375
  };
3397
- }, ts = (e, t) => {
3376
+ }, rs = (e, t) => {
3398
3377
  for (; e !== null && e.keep !== t;) e.keep = t, e = e.parent._item;
3399
- }, ns = (e, t, n) => {
3378
+ }, is = (e, t, n) => {
3400
3379
  let { client: r, clock: i } = t.id, a = new Q(R(r, i + n), t, R(r, i + n - 1), t.right, t.rightOrigin, t.parent, t.parentSub, t.content.splice(n));
3401
3380
  return t.deleted && a.markDeleted(), t.keep && (a.keep = !0), t.redone !== null && (a.redone = R(t.redone.client, t.redone.clock + n)), t.right = a, a.right !== null && (a.right.left = a), e._mergeStructs.push(a), a.parentSub !== null && a.right === null && a.parent._map.set(a.parentSub, a), t.length = n, a;
3402
- }, rs = (e, t) => u(e, (e) => Lr(e.deletions, t)), is = (e, t, n, r, i, a) => {
3381
+ }, as = (e, t) => u(e, (e) => Rr(e.deletions, t)), os = (e, t, n, r, i, a) => {
3403
3382
  let o = e.doc, s = o.store, c = o.clientID, l = t.redone;
3404
3383
  if (l !== null) return H(e, l);
3405
3384
  let u = t.parent._item, d = null, f;
3406
3385
  if (u !== null && u.deleted === !0) {
3407
- if (u.redone === null && (!n.has(u) || is(e, u, n, r, i, a) === null)) return null;
3386
+ if (u.redone === null && (!n.has(u) || os(e, u, n, r, i, a) === null)) return null;
3408
3387
  for (; u.redone !== null;) u = H(e, u.redone);
3409
3388
  }
3410
3389
  let p = u === null ? t.parent : u.content.type;
@@ -3429,14 +3408,14 @@ var oa = class {
3429
3408
  }
3430
3409
  } else {
3431
3410
  if (f = null, t.right && !i) {
3432
- for (d = t; d !== null && d.right !== null && (d.right.redone || Lr(r, d.right.id) || rs(a.undoStack, d.right.id) || rs(a.redoStack, d.right.id));) for (d = d.right; d.redone;) d = H(e, d.redone);
3411
+ for (d = t; d !== null && d.right !== null && (d.right.redone || Rr(r, d.right.id) || as(a.undoStack, d.right.id) || as(a.redoStack, d.right.id));) for (d = d.right; d.redone;) d = H(e, d.redone);
3433
3412
  if (d && d.right !== null) return null;
3434
3413
  } else d = p._map.get(t.parentSub) || null;
3435
3414
  d !== null && d.parent._item !== u && (d = p._map.get(t.parentSub) || null);
3436
3415
  }
3437
3416
  let ee = R(c, B(s, c)), m = new Q(ee, d, d && d.lastId, f, f && f.id, p, t.parentSub, t.content.copy());
3438
- return t.redone = ee, ts(m, !0), m.integrate(e, 0), m;
3439
- }, Q = class e extends Do {
3417
+ return t.redone = ee, rs(m, !0), m.integrate(e, 0), m;
3418
+ }, Q = class e extends ko {
3440
3419
  constructor(e, t, n, r, i, a, o, s) {
3441
3420
  super(e, s.getLength()), this.origin = n, this.left = t, this.right = r, this.rightOrigin = i, this.parent = a, this.parentSub = o, this.redone = null, this.content = s, this.info = this.content.isCountable() ? 2 : 0;
3442
3421
  }
@@ -3467,17 +3446,17 @@ var oa = class {
3467
3446
  getMissing(t, n) {
3468
3447
  if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= B(n, this.origin.client)) return this.origin.client;
3469
3448
  if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= B(n, this.rightOrigin.client)) return this.rightOrigin.client;
3470
- if (this.parent && this.parent.constructor === Ci && this.id.client !== this.parent.client && this.parent.clock >= B(n, this.parent.client)) return this.parent.client;
3471
- if (this.origin &&= (this.left = Gi(t, n, this.origin), this.left.lastId), this.rightOrigin &&= (this.right = H(t, this.rightOrigin), this.right.id), this.left && this.left.constructor === J || this.right && this.right.constructor === J) this.parent = null;
3449
+ if (this.parent && this.parent.constructor === wi && this.id.client !== this.parent.client && this.parent.clock >= B(n, this.parent.client)) return this.parent.client;
3450
+ if (this.origin &&= (this.left = qi(t, n, this.origin), this.left.lastId), this.rightOrigin &&= (this.right = H(t, this.rightOrigin), this.right.id), this.left && this.left.constructor === J || this.right && this.right.constructor === J) this.parent = null;
3472
3451
  else if (!this.parent) this.left && this.left.constructor === e ? (this.parent = this.left.parent, this.parentSub = this.left.parentSub) : this.right && this.right.constructor === e && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
3473
- else if (this.parent.constructor === Ci) {
3474
- let e = Ui(n, this.parent);
3452
+ else if (this.parent.constructor === wi) {
3453
+ let e = Gi(n, this.parent);
3475
3454
  this.parent = e.constructor === J ? null : e.content.type;
3476
3455
  }
3477
3456
  return null;
3478
3457
  }
3479
3458
  integrate(e, t) {
3480
- if (t > 0 && (this.id.clock += t, this.left = Gi(e, e.doc.store, R(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(t), this.length -= t), this.parent) {
3459
+ if (t > 0 && (this.id.clock += t, this.left = qi(e, e.doc.store, R(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(t), this.length -= t), this.parent) {
3481
3460
  if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) {
3482
3461
  let t = this.left, n;
3483
3462
  if (t !== null) n = t.right;
@@ -3485,10 +3464,10 @@ var oa = class {
3485
3464
  else n = this.parent._start;
3486
3465
  let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
3487
3466
  for (; n !== null && n !== this.right;) {
3488
- if (i.add(n), r.add(n), wi(this.origin, n.origin)) {
3467
+ if (i.add(n), r.add(n), Ti(this.origin, n.origin)) {
3489
3468
  if (n.id.client < this.id.client) t = n, r.clear();
3490
- else if (wi(this.rightOrigin, n.rightOrigin)) break;
3491
- } else if (n.origin !== null && i.has(Ui(e.doc.store, n.origin))) r.has(Ui(e.doc.store, n.origin)) || (t = n, r.clear());
3469
+ else if (Ti(this.rightOrigin, n.rightOrigin)) break;
3470
+ } else if (n.origin !== null && i.has(Gi(e.doc.store, n.origin))) r.has(Gi(e.doc.store, n.origin)) || (t = n, r.clear());
3492
3471
  else break;
3493
3472
  n = n.right;
3494
3473
  }
@@ -3503,7 +3482,7 @@ var oa = class {
3503
3482
  else e = this.parent._start, this.parent._start = this;
3504
3483
  this.right = e;
3505
3484
  }
3506
- this.right === null ? this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(e)) : this.right.left = this, this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length), Hi(e.doc.store, this), this.content.integrate(e, this), Xi(e, this.parent, this.parentSub), (this.parent._item !== null && this.parent._item.deleted || this.parentSub !== null && this.right !== null) && this.delete(e);
3485
+ this.right === null ? this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(e)) : this.right.left = this, this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length), Wi(e.doc.store, this), this.content.integrate(e, this), Qi(e, this.parent, this.parentSub), (this.parent._item !== null && this.parent._item.deleted || this.parentSub !== null && this.right !== null) && this.delete(e);
3507
3486
  } else new J(this.id, this.length).integrate(e, 0);
3508
3487
  }
3509
3488
  get next() {
@@ -3520,7 +3499,7 @@ var oa = class {
3520
3499
  return this.length === 1 ? this.id : R(this.id.client, this.id.clock + this.length - 1);
3521
3500
  }
3522
3501
  mergeWith(e) {
3523
- if (this.constructor === e.constructor && wi(e.origin, this.lastId) && this.right === e && wi(this.rightOrigin, e.rightOrigin) && this.id.client === e.id.client && this.id.clock + this.length === e.id.clock && this.deleted === e.deleted && this.redone === null && e.redone === null && this.content.constructor === e.content.constructor && this.content.mergeWith(e.content)) {
3502
+ if (this.constructor === e.constructor && Ti(e.origin, this.lastId) && this.right === e && Ti(this.rightOrigin, e.rightOrigin) && this.id.client === e.id.client && this.id.clock + this.length === e.id.clock && this.deleted === e.deleted && this.redone === null && e.redone === null && this.content.constructor === e.content.constructor && this.content.mergeWith(e.content)) {
3524
3503
  let t = this.parent._searchMarker;
3525
3504
  return t && t.forEach((t) => {
3526
3505
  t.p === e && (t.p = this, !this.deleted && this.countable && (t.index -= this.length));
@@ -3531,12 +3510,12 @@ var oa = class {
3531
3510
  delete(e) {
3532
3511
  if (!this.deleted) {
3533
3512
  let t = this.parent;
3534
- this.countable && this.parentSub === null && (t._length -= this.length), this.markDeleted(), Br(e.deleteSet, this.id.client, this.id.clock, this.length), Xi(e, t, this.parentSub), this.content.delete(e);
3513
+ this.countable && this.parentSub === null && (t._length -= this.length), this.markDeleted(), Vr(e.deleteSet, this.id.client, this.id.clock, this.length), Qi(e, t, this.parentSub), this.content.delete(e);
3535
3514
  }
3536
3515
  }
3537
3516
  gc(e, t) {
3538
3517
  if (!this.deleted) throw C();
3539
- this.content.gc(e), t ? Ki(e, this, new J(this.id, this.length)) : this.content = new jo(this.length);
3518
+ this.content.gc(e), t ? Ji(e, this, new J(this.id, this.length)) : this.content = new No(this.length);
3540
3519
  }
3541
3520
  write(e, t) {
3542
3521
  let n = t > 0 ? R(this.id.client, this.id.clock + t - 1) : this.origin, r = this.rightOrigin, i = this.parentSub, a = this.content.getRef() & 31 | (n === null ? 0 : 128) | (r === null ? 0 : 64) | (i === null ? 0 : 32);
@@ -3545,31 +3524,31 @@ var oa = class {
3545
3524
  if (t._item !== void 0) {
3546
3525
  let n = t._item;
3547
3526
  if (n === null) {
3548
- let n = Ti(t);
3527
+ let n = Ei(t);
3549
3528
  e.writeParentInfo(!0), e.writeString(n);
3550
3529
  } else e.writeParentInfo(!1), e.writeLeftID(n.id);
3551
- } else t.constructor === String ? (e.writeParentInfo(!0), e.writeString(t)) : t.constructor === Ci ? (e.writeParentInfo(!1), e.writeLeftID(t)) : C();
3530
+ } else t.constructor === String ? (e.writeParentInfo(!0), e.writeString(t)) : t.constructor === wi ? (e.writeParentInfo(!1), e.writeLeftID(t)) : C();
3552
3531
  i !== null && e.writeString(i);
3553
3532
  }
3554
3533
  this.content.write(e, t);
3555
3534
  }
3556
- }, as = (e, t) => os[t & 31](e), os = [
3535
+ }, ss = (e, t) => cs[t & 31](e), cs = [
3557
3536
  () => {
3558
3537
  C();
3559
3538
  },
3539
+ Po,
3540
+ Ho,
3560
3541
  Mo,
3542
+ Ko,
3543
+ zo,
3561
3544
  Bo,
3562
- Ao,
3563
- Wo,
3545
+ ts,
3546
+ Go,
3564
3547
  Lo,
3565
- Ro,
3566
- $o,
3567
- Uo,
3568
- Fo,
3569
3548
  () => {
3570
3549
  C();
3571
3550
  }
3572
- ], ss = 10, $ = class extends Do {
3551
+ ], ls = 10, $ = class extends ko {
3573
3552
  get deleted() {
3574
3553
  return !0;
3575
3554
  }
@@ -3581,11 +3560,11 @@ var oa = class {
3581
3560
  C();
3582
3561
  }
3583
3562
  write(e, t) {
3584
- e.writeInfo(ss), v(e.restEncoder, this.length - t);
3563
+ e.writeInfo(ls), v(e.restEncoder, this.length - t);
3585
3564
  }
3586
3565
  getMissing(e, t) {
3587
3566
  return null;
3588
3567
  }
3589
- }, cs = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, ls = "__ $YJS$ __";
3590
- cs[ls] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"), cs[ls] = !0;
3591
- export { Ce as $, P as A, Ct as B, V as C, I as D, Ei as E, Ft as F, ot as G, ht as H, O as I, E as J, w as K, Nt as L, $t as M, Zt as N, Ri as O, Xt as P, xe as Q, Et as R, _i as S, Lr as T, mt as U, gt as V, lt as W, S as X, T as Y, C as Z, R as _, Q as a, m as at, Li as b, ia as c, re as ct, To as d, a as dt, g as et, ci as f, e as ft, Vr as g, Pi as h, qr as i, ae as it, Gt as j, Aa as k, ho as l, ee as lt, Fi as m, X as n, v as nt, Di as o, h as ot, si as p, n as pt, D as q, Z as r, b as rt, Ii as s, ne as st, Y as t, y as tt, bo as u, p as ut, Oi as v, Ti as w, di as x, Mi as y, xt as z };
3568
+ }, us = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, ds = "__ $YJS$ __";
3569
+ us[ds] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"), us[ds] = !0;
3570
+ export { S as $, Di as A, O as B, Ri as C, V as D, vi as E, Kt as F, _t as G, Ct as H, en as I, ct as J, gt as K, Qt as L, Bi as M, Ma as N, Ei as O, P, T as Q, Zt as R, Ni as S, fi as T, Tt as U, Ft as V, vt as W, D as X, w as Y, E as Z, Ii as _, Jr as a, v as at, R as b, Li as c, m as ct, So as d, re as dt, C as et, bo as f, ee as ft, ci as g, li as h, n as ht, Z as i, y as it, I as j, Rr as k, oa as l, h as lt, Do as m, a as mt, Y as n, Ce as nt, Q as o, b as ot, To as p, p as pt, dt as q, X as r, g as rt, Oi as s, ae as st, K as t, xe as tt, _o as u, ne as ut, Fi as v, zi as w, ki as x, Hr as y, Lt as z };