@hiai-gg/docsmint 0.7.4 → 0.7.6
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.
- package/README.md +2 -2
- package/dist/backend/index.js +130026 -129609
- package/dist/backend-account-runtime-cleanup.js +2 -0
- package/dist/backend-api-key-facade.js +2 -0
- package/dist/backend-pipeline-cancellation.js +2 -0
- package/dist/frontend/CategoryDialog-D_xFSWGh.js +630 -0
- package/dist/frontend/ConfirmDialog-Cfq3D2Di.js +221 -0
- package/dist/frontend/{CreateSnapshotDialog-CojnWChs.js → CreateSnapshotDialog-BHODxZWK.js} +53 -52
- package/dist/frontend/{DatePicker-7FAbIOGg.js → DatePicker-CZyCnQ1q.js} +62 -64
- package/dist/frontend/{DeleteDialog-BIlqRb1u.js → DeleteDialog-DaJOO6SB.js} +17 -17
- package/dist/frontend/FolderNode-C_91NlEO.js +307 -0
- package/dist/frontend/{FolderTreeSelector-BMB1MS9N.js → FolderTreeSelector-DqO-f0nt.js} +7 -7
- package/dist/frontend/HiAiEditor-DtUGbQg6.js +3160 -0
- package/dist/frontend/{HiaiDocsExtensionProvider-OSn96BBw.js → HiaiDocsExtensionProvider-Cc3yzW5I.js} +5 -3
- package/dist/frontend/{Icon-Db-o32_E.js → Icon-y7xxAIC6.js} +1 -1
- package/dist/frontend/{SettingsDialog-DatuxOVX.js → SettingsDialog-BlIZqk2-.js} +169 -158
- package/dist/frontend/ShareDialog-CmX-VoJ9.js +273 -0
- package/dist/frontend/Sidebar-BVGm5BRR.js +2147 -0
- package/dist/frontend/{TagCreateDialog-Ch21yuWV.js → TagCreateDialog-BlGz4O9Z.js} +45 -36
- package/dist/frontend/action_cancel-Cuxsznzz.js +5 -0
- package/dist/frontend/action_close-BJm_52wm.js +5 -0
- package/dist/frontend/action_create-CtBQrRuj.js +5 -0
- package/dist/frontend/action_delete-BXBIzvn0.js +5 -0
- package/dist/frontend/action_go_to-VmK5jmEk.js +5 -0
- package/dist/frontend/action_loading-BLCGJVA9.js +5 -0
- package/dist/frontend/action_save-BRN2Z_GP.js +5 -0
- package/dist/frontend/api/attachments.js +1 -1
- package/dist/frontend/api/categories.js +1 -1
- package/dist/frontend/api/folders.js +1 -1
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/api/share.js +1 -1
- package/dist/frontend/api/tags.js +1 -1
- package/dist/frontend/app-shell.js +8 -8
- package/dist/frontend/{attachments-B2aH3hXF.js → attachments-C225gTA7.js} +2 -2
- package/dist/frontend/{auth-client-CnDZwPfp.js → auth-client-DCMne8vd.js} +630 -615
- package/dist/frontend/{bundle-mjs-DllmqUxV.js → bundle-mjs-CZ3g1Uzr.js} +35 -42
- package/dist/frontend/{camera-CzCxBOpc.js → camera-BI-BtnIm.js} +2 -2
- package/dist/frontend/{categories-X7gK8azc.js → categories-Bjcc41We.js} +1 -1
- package/dist/frontend/categories_update_error-4aSI8PTr.js +5 -0
- package/dist/frontend/{check-BIi-Ghti.js → check-sdTlLwi9.js} +2 -2
- package/dist/frontend/{chevron-down-C2ft7XUV.js → chevron-down-DlBnIE7Y.js} +2 -2
- package/dist/frontend/{circle-check-BrqfiQH1.js → circle-check-hWC-HeKu.js} +2 -2
- package/dist/frontend/{clock-Dz86E4Kz.js → clock-C4FHq-9q.js} +2 -2
- package/dist/frontend/collaboration.js +208 -103
- package/dist/frontend/components/category-dialog.js +1 -1
- package/dist/frontend/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend/components/delete-dialog.js +1 -1
- package/dist/frontend/components/editor/compact-editor.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +1 -1
- package/dist/frontend/components/editor/document-title.js +3 -2
- package/dist/frontend/components/editor/docx-serializer.js +140 -125
- package/dist/frontend/components/editor/extensions.js +1 -1
- package/dist/frontend/components/editor/markdown-toggle.js +9 -9
- package/dist/frontend/components/editor/markdown.js +1 -1
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/folder-tree-selector.js +1 -1
- package/dist/frontend/components/save-as-dialog.js +34 -25
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/components/tag-create-dialog.js +1 -1
- package/dist/frontend/components/version-history.js +181 -176
- package/dist/frontend/{confirm-dialog-8T6vsWL7.js → confirm-dialog-BFTxjLv-.js} +46 -37
- package/dist/frontend/{copy-CvCh4ZVt.js → copy-4H99lwAQ.js} +2 -2
- package/dist/frontend/dashboard.js +462 -456
- package/dist/frontend/{db-Bo1t_76T.js → db-CbFRFAm2.js} +40 -38
- package/dist/frontend/{dialog-CiSwD-_v.js → dialog-tHAH3-9M.js} +10 -10
- package/dist/frontend/dist-Cg1BpNS7.js +2262 -0
- package/dist/frontend/dndzone-BrakBHwm.js +1375 -0
- package/dist/frontend/doc_title_label-DS9jSIh2.js +5 -0
- package/dist/frontend/doc_title_placeholder-DBQpM1aH.js +5 -0
- package/dist/frontend/{document-drop-coordinator-C4xHMjwC.js → document-drop-coordinator-Da7HcXgv.js} +1 -1
- package/dist/frontend/document-drop-coordinator.js +1 -1
- package/dist/frontend/{dropdown-menu-Bi5Iipwf.js → dropdown-menu-AJYeFPHu.js} +145 -145
- package/dist/frontend/{editor-content-sanitizer-CC_A8aaI.js → editor-content-sanitizer-CWjqiz0T.js} +30 -30
- package/dist/frontend/{editorExtensions--HusV819.js → editorExtensions-B-mKiWqq.js} +5085 -6220
- package/dist/frontend/editor_markdown_placeholder-BIWDUF1E.js +5 -0
- package/dist/frontend/error_dismiss-Dx_JbRjs.js +5 -0
- package/dist/frontend/error_generic-CzNtmBT4.js +5 -0
- package/dist/frontend/extension.js +1 -1
- package/dist/frontend/{folder-Cx60MRpi.js → folder-BAX6qBYy.js} +3 -3
- package/dist/frontend/{folders-ONG03Dkv.js → folders-CC0UWkZH.js} +3 -3
- package/dist/frontend/folders_rename-BJo4Gipq.js +5 -0
- package/dist/frontend/i18n.js +1007 -6
- package/dist/frontend/{identity-Ynrglr5i.js → identity-O4lAuchv.js} +2 -2
- package/dist/frontend/{input-N9dNSOWF.js → input-CrlYAH2S.js} +2 -2
- package/dist/frontend/{label-CK72_fw8.js → label-B0syEfns.js} +2 -2
- package/dist/frontend/{markdown-H6QB53zu.js → markdown-CMij27Gg.js} +1 -1
- package/dist/frontend/offline/identity.js +1 -1
- package/dist/frontend/{floating-layer-anchor-BGIndLY-.js → popper-layer-force-mount-BAYjg6Pp.js} +2476 -2564
- package/dist/frontend/{rolldown-runtime-CWhphoD1.js → rolldown-runtime-DArdT4gl.js} +2 -2
- package/dist/frontend/{rotate-ccw-ta4NosZ0.js → rotate-ccw-DtZDfSK3.js} +2 -2
- package/dist/frontend/runtime-CwWSo6c9.js +128 -0
- package/dist/frontend/{schemas-DwtKylCJ.js → schemas-CdPhcuru.js} +6 -7
- package/dist/frontend/scroll_to_top_aria-CvkNF_Hu.js +5 -0
- package/dist/frontend/search.js +237 -265
- package/dist/frontend/search_title-DOC0cPlQ.js +5 -0
- package/dist/frontend/{select-value-BD1DToYs.js → select-value-D9VqY5n5.js} +575 -572
- package/dist/frontend/{settings-BR48ihB4.js → settings-DJW8JkdF.js} +1 -1
- package/dist/frontend/{share-D7JtkC85.js → share-D5yo0JOh.js} +2 -1
- package/dist/frontend/share_copied-DPxVzfWh.js +5 -0
- package/dist/frontend/share_toggle_password-DdxfIjj1.js +5 -0
- package/dist/frontend/shared-document.js +1 -1
- package/dist/frontend/sidebar_uncategorized-qJ2_Aonf.js +5 -0
- package/dist/frontend/sort_relevance-DwYX5MO9.js +5 -0
- package/dist/frontend/{tag-DhVFHMcV.js → tag-ChpMfbfa.js} +3 -3
- package/dist/frontend/{tags-BdCaMGfj.js → tags-CzPNUoFw.js} +1 -1
- package/dist/frontend/tags_load_error-BKjA1pI0.js +5 -0
- package/dist/frontend/tags_new-BiNAJ9Bx.js +5 -0
- package/dist/frontend/{textarea-pl_fDBre.js → textarea-l_gRXsrH.js} +2 -2
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/{theme.svelte-DG3RS7wv.js → theme.svelte-Bzitjfh9.js} +2 -2
- package/dist/frontend/theme_system-BBNUhYKh.js +5 -0
- package/dist/frontend/utils/dndzone.js +1 -1
- package/dist/frontend/utils-B4LKx7VS.js +7 -0
- package/dist/frontend/{utils-DrfHTcei.js → utils-BovMJHdA.js} +2 -2
- package/dist/frontend/utils.js +1 -1
- package/dist/frontend/version_create_snapshot-3bu-0qzH.js +5 -0
- package/dist/frontend/version_restored_from-dVRN3Zdk.js +5 -0
- package/dist/frontend/version_snapshot_label_placeholder-DrMikux0.js +5 -0
- package/dist/frontend/weekday_we-C5H_M-df.js +5 -0
- package/dist/frontend/{x-cfdlccjs.js → x-B2ifxSH7.js} +2 -2
- package/dist/frontend/{awareness-snQ3RD9f.js → yjs-VUcKqaKW.js} +835 -944
- package/dist/frontend-ssr/api/attachments.js +92 -1
- package/dist/frontend-ssr/api/categories.js +1 -1
- package/dist/frontend-ssr/api/documents.js +1 -1
- package/dist/frontend-ssr/api/folders.js +1 -1
- package/dist/frontend-ssr/api/settings.js +1 -1
- package/dist/frontend-ssr/api/share.js +30 -1
- package/dist/frontend-ssr/api/tags.js +1 -1
- package/dist/frontend-ssr/app-shell.js +25 -18
- package/dist/frontend-ssr/assets/{CategoryDialog-DsXe54EF.js → CategoryDialog-C41IBNWG.js} +26 -35
- package/dist/frontend-ssr/assets/ConfirmDialog-CWO0HBaS.js +424 -0
- package/dist/frontend-ssr/assets/{CreateSnapshotDialog-D3-PjXVr.js → CreateSnapshotDialog-CECCRK0d.js} +12 -18
- package/dist/frontend-ssr/assets/{DatePicker-C9suIA1S.js → DatePicker-TZVeMZ2S.js} +32 -20
- package/dist/frontend-ssr/assets/{DeleteDialog-DxtMrS1O.js → DeleteDialog-BVnmzR2e.js} +5 -7
- package/dist/frontend-ssr/assets/{FolderNode-ChD10Elp.js → FolderNode-CClgk8BL.js} +7 -7
- package/dist/frontend-ssr/assets/{FolderTreeSelector-Bxi8EqMm.js → FolderTreeSelector-DnrKCYtl.js} +17 -20
- package/dist/frontend-ssr/assets/{HiAiEditor-2X3Uyg1B.js → HiAiEditor-_-m7MJDd.js} +330 -254
- package/dist/frontend-ssr/assets/{Icon-QwirKi9Y.js → Icon-Clqe8D8X.js} +28 -16
- package/dist/frontend-ssr/assets/{SettingsDialog-DDy0hN8x.js → SettingsDialog-BdvHRAxF.js} +45 -49
- package/dist/frontend-ssr/assets/{ShareDialog-BwW_wF4G.js → ShareDialog-DHPbSHZg.js} +5 -6
- package/dist/frontend-ssr/assets/{Sidebar-Dy-5gXOf.js → Sidebar-B3Saqn0O.js} +90 -93
- package/dist/frontend-ssr/assets/{TagCreateDialog-BPzgOaX8.js → TagCreateDialog-CPg-nG0D.js} +14 -14
- package/dist/frontend-ssr/assets/action_cancel-OVgQDP5Q.js +22 -0
- package/dist/frontend-ssr/assets/action_close-DagDyMXk.js +22 -0
- package/dist/frontend-ssr/assets/action_create-hqJWjyqh.js +22 -0
- package/dist/frontend-ssr/assets/action_delete-B1-16jSo.js +22 -0
- package/dist/frontend-ssr/assets/action_go_to-DQScgw7P.js +22 -0
- package/dist/frontend-ssr/assets/action_save-Bx7vlLZI.js +22 -0
- package/dist/frontend-ssr/assets/{api-keys-DIbclwj5.js → api-keys-CHOrbU-Q.js} +1 -1
- package/dist/frontend-ssr/assets/{auth-client-CojKIzqy.js → auth-client-DzkZlSQ8.js} +295 -261
- package/dist/frontend-ssr/assets/{camera-D6s20LDi.js → camera-Dwwtgvfn.js} +10 -6
- package/dist/frontend-ssr/assets/{categories-av9xjeg5.js → categories-C_dxFoHi.js} +1 -1
- package/dist/frontend-ssr/assets/categories_update_error-DkKgsqdD.js +202 -0
- package/dist/frontend-ssr/assets/{chevron-down-CvqKATjM.js → chevron-down-C6BTPJFz.js} +10 -6
- package/dist/frontend-ssr/assets/{chevron-right-DKD7WXjz.js → chevron-right-CseGE1qd.js} +10 -6
- package/dist/frontend-ssr/assets/{circle-check-CPS9dKEo.js → circle-check-BRhWPZo1.js} +10 -6
- package/dist/frontend-ssr/assets/{client-DZMkDkDn.js → client-rfwQYYHY.js} +4 -2
- package/dist/frontend-ssr/assets/{clock-CzsE58TH.js → clock-DpP_Y7WP.js} +10 -6
- package/dist/frontend-ssr/assets/{confirm-dialog-wYC07DPx.js → confirm-dialog-DeOR0SnQ.js} +44 -31
- package/dist/frontend-ssr/assets/{copy-DkkCPkBL.js → copy-DRMKiRZ0.js} +10 -6
- package/dist/frontend-ssr/assets/{db-BhwJPEkn.js → db-CUkQe9AU.js} +1 -1
- package/dist/frontend-ssr/assets/{dialog-ClcuF7nD.js → dialog--tDgDGw9.js} +12 -15
- package/dist/frontend-ssr/assets/{dndzone-DMvTO_Jz.js → dndzone-WtNaDxoQ.js} +309 -77
- package/dist/frontend-ssr/assets/doc_title_label-Ev_ltlh3.js +22 -0
- package/dist/frontend-ssr/assets/doc_title_placeholder-DSHpUb7w.js +22 -0
- package/dist/frontend-ssr/assets/{documents-CZ-wQohy.js → documents-CEuA1V6N.js} +1 -1
- package/dist/frontend-ssr/assets/{dropdown-menu-BKMGVNLL.js → dropdown-menu-CdEpn_LT.js} +74 -75
- package/dist/frontend-ssr/assets/editor_markdown_placeholder-BpezdkOr.js +42 -0
- package/dist/frontend-ssr/assets/editor_toolbar_undo-CKJAOqv2.js +562 -0
- package/dist/frontend-ssr/assets/error_generic-DTK0kwxT.js +42 -0
- package/dist/frontend-ssr/assets/{folder-DYIE-XPP.js → folder-DszunwKc.js} +10 -6
- package/dist/frontend-ssr/assets/{folders-BX30gHv6.js → folders-BOXeb9hz.js} +3 -2
- package/dist/frontend-ssr/assets/folders_rename-DvciOb6K.js +122 -0
- package/dist/frontend-ssr/assets/{identity-DcMMBKWg.js → identity-veXobEfE.js} +2 -2
- package/dist/frontend-ssr/assets/{input-DcDR8L8M.js → input-BlAj7LzC.js} +2 -2
- package/dist/frontend-ssr/assets/{label-Cz0_svJx.js → label-BRToaMg9.js} +2 -2
- package/dist/frontend-ssr/assets/{loader-circle-CIEWGyfP.js → loader-circle-BpRVrMZg.js} +10 -6
- package/dist/frontend-ssr/assets/{floating-layer-anchor-BoiiIEiK.js → popper-layer-force-mount-Djnq7l7a.js} +3684 -3674
- package/dist/frontend-ssr/assets/{rotate-ccw-dJSqPyTd.js → rotate-ccw-1GOD_yt_.js} +10 -6
- package/dist/frontend-ssr/assets/runtime-O78RzRqx.js +559 -0
- package/dist/frontend-ssr/assets/scroll_to_top_aria-BN4ZfOnM.js +22 -0
- package/dist/frontend-ssr/assets/search_title-CKUsQDT0.js +22 -0
- package/dist/frontend-ssr/assets/search_toggle_filters-hS9rvQhC.js +282 -0
- package/dist/frontend-ssr/assets/{select-value-CaDktvDW.js → select-value-BCWSsoTd.js} +204 -218
- package/dist/frontend-ssr/assets/{settings-Mp8EuFSn.js → settings-DwAcLGM1.js} +2 -2
- package/dist/frontend-ssr/assets/share_copied-BxU9rjXG.js +602 -0
- package/dist/frontend-ssr/assets/share_toggle_password-C6OmroqR.js +202 -0
- package/dist/frontend-ssr/assets/sidebar_uncategorized-Dx-LTd5w.js +102 -0
- package/dist/frontend-ssr/assets/{tag-BmiVU_Ej.js → tag-DFh6nF9R.js} +19 -11
- package/dist/frontend-ssr/assets/{tag-store.svelte-BM1lUI_P.js → tag-store.svelte-QRysvGKe.js} +1 -1
- package/dist/frontend-ssr/assets/{tags-BQsI_6OW.js → tags-BBCoFYro.js} +1 -1
- package/dist/frontend-ssr/assets/tags_load_error-CPrc6Gzs.js +362 -0
- package/dist/frontend-ssr/assets/tags_new-VmMr9v2V.js +62 -0
- package/dist/frontend-ssr/assets/{textarea-BGrjPOgU.js → textarea-BuszTo9i.js} +2 -2
- package/dist/frontend-ssr/assets/{theme.svelte-CN3BUhJG.js → theme.svelte-shZrSxz8.js} +1 -1
- package/dist/frontend-ssr/assets/theme_system-BucaNntV.js +362 -0
- package/dist/frontend-ssr/assets/{utils-Cg_R05dR.js → utils-BK35BJKQ.js} +1 -1
- package/dist/frontend-ssr/assets/version_create_snapshot-COHzwjle.js +22 -0
- package/dist/frontend-ssr/assets/version_restored_from-CertjFDl.js +242 -0
- package/dist/frontend-ssr/assets/version_snapshot_label_placeholder-Cy_rMCij.js +222 -0
- package/dist/frontend-ssr/assets/weekday_we-DrI3U230.js +422 -0
- package/dist/frontend-ssr/components/category-dialog.js +1 -1
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend-ssr/components/delete-dialog.js +1 -1
- package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-title.js +2 -1
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +2 -2
- package/dist/frontend-ssr/components/folder-node.js +1 -1
- package/dist/frontend-ssr/components/folder-tree-selector.js +1 -1
- package/dist/frontend-ssr/components/save-as-dialog.js +12 -14
- package/dist/frontend-ssr/components/settings.js +1 -1
- package/dist/frontend-ssr/components/share-dialog.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
- package/dist/frontend-ssr/components/version-history.js +47 -51
- package/dist/frontend-ssr/dashboard.js +243 -232
- package/dist/frontend-ssr/i18n.js +6698 -1
- package/dist/frontend-ssr/offline/identity.js +1 -1
- package/dist/frontend-ssr/search.js +28 -31
- package/dist/frontend-ssr/shared-document.js +1 -2
- package/dist/frontend-ssr/theme.js +1 -1
- package/dist/frontend-ssr/utils/dndzone.js +1 -1
- package/dist/lifecycle-runtime.js +4437 -2019
- package/dist/mcp-cli.js +1 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +7 -7
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +2 -0
- package/server.json +2 -2
- package/dist/frontend/CategoryDialog-bQKMpVFD.js +0 -631
- package/dist/frontend/ConfirmDialog-DF7kgkyq.js +0 -139
- package/dist/frontend/FolderNode-Cf443LBa.js +0 -298
- package/dist/frontend/HiAiEditor-CMZ-eL8s.js +0 -2992
- package/dist/frontend/ShareDialog-Bwz2y3Le.js +0 -281
- package/dist/frontend/Sidebar-C_t5RrOJ.js +0 -2101
- package/dist/frontend/dist-DQa_OHOa.js +0 -268
- package/dist/frontend/dndzone-BzsOINtP.js +0 -1199
- package/dist/frontend/messages-DTRe4U2V.js +0 -1093
- package/dist/frontend/utils-CMQRlxbx.js +0 -7
- package/dist/frontend-ssr/assets/ConfirmDialog-DrH653ua.js +0 -136
- package/dist/frontend-ssr/assets/attachments-BdkOp8ha.js +0 -93
- package/dist/frontend-ssr/assets/messages-B1TjVIH8.js +0 -11147
- package/dist/frontend-ssr/assets/share-qTqvd6Lu.js +0 -30
|
@@ -74,255 +74,253 @@ var e = () => /* @__PURE__ */ new Map(), t = (t) => {
|
|
|
74
74
|
}
|
|
75
75
|
}, m = Math.floor, te = Math.abs, ne = (e, t) => e < t ? e : t, h = (e, t) => e > t ? e : t;
|
|
76
76
|
Number.isNaN;
|
|
77
|
-
var re = Math.pow, ie = (e) => e === 0 ? 1 / e < 0 : e < 0, ae = 1 <<
|
|
78
|
-
ae - 1, oe - 1, se - 1, ce - 1, le - 1, ue - 1, de - 1, fe - 1, pe - 1, me - 1, he - 1, ge - 1, _e - 1;
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/number.js
|
|
81
|
-
var ve = 2 ** 53 - 1, ye = -(2 ** 53 - 1), be = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && m(e) === e);
|
|
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);
|
|
82
78
|
Number.isNaN, Number.parseInt;
|
|
83
79
|
//#endregion
|
|
84
80
|
//#region ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/string.js
|
|
85
|
-
var
|
|
86
|
-
String.fromCodePoint,
|
|
87
|
-
var
|
|
81
|
+
var le = String.fromCharCode;
|
|
82
|
+
String.fromCodePoint, le(65535);
|
|
83
|
+
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) => {
|
|
88
84
|
let t = unescape(encodeURIComponent(e)), n = t.length, r = new Uint8Array(n);
|
|
89
85
|
for (let e = 0; e < n; e++) r[e] = t.codePointAt(e);
|
|
90
86
|
return r;
|
|
91
|
-
},
|
|
87
|
+
}, ge = typeof TextEncoder < "u" ? new TextEncoder() : null, _e = ge ? (e) => ge.encode(e) : he, ve = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", {
|
|
92
88
|
fatal: !0,
|
|
93
89
|
ignoreBOM: !0
|
|
94
90
|
});
|
|
95
91
|
/* c8 ignore start */
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
ve && ve.decode(/* @__PURE__ */ new Uint8Array()).length === 1 &&
|
|
93
|
+
/* c8 ignore next */
|
|
94
|
+
(ve = null);
|
|
95
|
+
var ye = (e, t) => d(t, () => e).join(""), be = class {
|
|
98
96
|
constructor() {
|
|
99
97
|
this.cpos = 0, this.cbuf = /* @__PURE__ */ new Uint8Array(100), this.bufs = [];
|
|
100
98
|
}
|
|
101
|
-
},
|
|
102
|
-
let t =
|
|
103
|
-
return e(t),
|
|
104
|
-
},
|
|
99
|
+
}, xe = () => new be(), Se = (e) => {
|
|
100
|
+
let t = xe();
|
|
101
|
+
return e(t), g(t);
|
|
102
|
+
}, Ce = (e) => {
|
|
105
103
|
let t = e.cpos;
|
|
106
104
|
for (let n = 0; n < e.bufs.length; n++) t += e.bufs[n].length;
|
|
107
105
|
return t;
|
|
108
|
-
},
|
|
109
|
-
let t = new Uint8Array(
|
|
106
|
+
}, g = (e) => {
|
|
107
|
+
let t = new Uint8Array(Ce(e)), n = 0;
|
|
110
108
|
for (let r = 0; r < e.bufs.length; r++) {
|
|
111
109
|
let i = e.bufs[r];
|
|
112
110
|
t.set(i, n), n += i.length;
|
|
113
111
|
}
|
|
114
112
|
return t.set(new Uint8Array(e.cbuf.buffer, 0, e.cpos), n), t;
|
|
115
|
-
},
|
|
113
|
+
}, we = (e, t) => {
|
|
116
114
|
let n = e.cbuf.length;
|
|
117
115
|
n - e.cpos < t && (e.bufs.push(new Uint8Array(e.cbuf.buffer, 0, e.cpos)), e.cbuf = new Uint8Array(h(n, t) * 2), e.cpos = 0);
|
|
118
|
-
},
|
|
116
|
+
}, _ = (e, t) => {
|
|
119
117
|
let n = e.cbuf.length;
|
|
120
118
|
e.cpos === n && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(n * 2), e.cpos = 0), e.cbuf[e.cpos++] = t;
|
|
121
|
-
},
|
|
122
|
-
for (; t > 127;)
|
|
123
|
-
|
|
124
|
-
},
|
|
119
|
+
}, Te = _, v = (e, t) => {
|
|
120
|
+
for (; t > 127;) _(e, 128 | 127 & t), t = m(t / 128);
|
|
121
|
+
_(e, 127 & t);
|
|
122
|
+
}, Ee = (e, t) => {
|
|
125
123
|
let n = ie(t);
|
|
126
|
-
for (n && (t = -t),
|
|
127
|
-
},
|
|
128
|
-
if (t.length <
|
|
124
|
+
for (n && (t = -t), _(e, (t > 63 ? 128 : 0) | (n ? 64 : 0) | 63 & t), t = m(t / 64); t > 0;) _(e, (t > 127 ? 128 : 0) | 127 & t), t = m(t / 128);
|
|
125
|
+
}, De = /* @__PURE__ */ new Uint8Array(3e4), Oe = De.length / 3, y = ge && ge.encodeInto ? (e, t) => {
|
|
126
|
+
if (t.length < Oe) {
|
|
129
127
|
/* c8 ignore next */
|
|
130
|
-
let n =
|
|
131
|
-
|
|
132
|
-
for (let t = 0; t < n; t++)
|
|
133
|
-
} else
|
|
128
|
+
let n = ge.encodeInto(t, De).written || 0;
|
|
129
|
+
v(e, n);
|
|
130
|
+
for (let t = 0; t < n; t++) _(e, De[t]);
|
|
131
|
+
} else b(e, _e(t));
|
|
134
132
|
} : (e, t) => {
|
|
135
133
|
let n = unescape(encodeURIComponent(t)), r = n.length;
|
|
136
|
-
|
|
137
|
-
for (let t = 0; t < r; t++)
|
|
138
|
-
},
|
|
134
|
+
v(e, r);
|
|
135
|
+
for (let t = 0; t < r; t++) _(e, n.codePointAt(t));
|
|
136
|
+
}, ke = (e, t) => {
|
|
139
137
|
let n = e.cbuf.length, r = e.cpos, i = ne(n - r, t.length), a = t.length - i;
|
|
140
138
|
e.cbuf.set(t.subarray(0, i), r), e.cpos += i, a > 0 && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(h(n * 2, a)), e.cbuf.set(t.subarray(i)), e.cpos = a);
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
|
|
139
|
+
}, b = (e, t) => {
|
|
140
|
+
v(e, t.byteLength), ke(e, t);
|
|
141
|
+
}, Ae = (e, t) => {
|
|
142
|
+
we(e, t);
|
|
145
143
|
let n = new DataView(e.cbuf.buffer, e.cpos, t);
|
|
146
144
|
return e.cpos += t, n;
|
|
147
|
-
},
|
|
145
|
+
}, je = (e, t) => Ae(e, 4).setFloat32(0, t, !1), Me = (e, t) => Ae(e, 8).setFloat64(0, t, !1), Ne = (e, t) => Ae(e, 8).setBigInt64(0, t, !1), Pe = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(4)), Fe = (e) => (Pe.setFloat32(0, e), Pe.getFloat32(0) === e), Ie = (e, t) => {
|
|
148
146
|
switch (typeof t) {
|
|
149
147
|
case "string":
|
|
150
|
-
|
|
148
|
+
_(e, 119), y(e, t);
|
|
151
149
|
break;
|
|
152
150
|
case "number":
|
|
153
|
-
|
|
151
|
+
ce(t) && te(t) <= 2147483647 ? (_(e, 125), Ee(e, t)) : Fe(t) ? (_(e, 124), je(e, t)) : (_(e, 123), Me(e, t));
|
|
154
152
|
break;
|
|
155
153
|
case "bigint":
|
|
156
|
-
|
|
154
|
+
_(e, 122), Ne(e, t);
|
|
157
155
|
break;
|
|
158
156
|
case "object":
|
|
159
|
-
if (t === null)
|
|
157
|
+
if (t === null) _(e, 126);
|
|
160
158
|
else if (f(t)) {
|
|
161
|
-
|
|
162
|
-
for (let n = 0; n < t.length; n++)
|
|
163
|
-
} else if (t instanceof Uint8Array)
|
|
159
|
+
_(e, 117), v(e, t.length);
|
|
160
|
+
for (let n = 0; n < t.length; n++) Ie(e, t[n]);
|
|
161
|
+
} else if (t instanceof Uint8Array) _(e, 116), b(e, t);
|
|
164
162
|
else {
|
|
165
|
-
|
|
163
|
+
_(e, 118);
|
|
166
164
|
let n = Object.keys(t);
|
|
167
|
-
|
|
165
|
+
v(e, n.length);
|
|
168
166
|
for (let r = 0; r < n.length; r++) {
|
|
169
167
|
let i = n[r];
|
|
170
|
-
|
|
168
|
+
y(e, i), Ie(e, t[i]);
|
|
171
169
|
}
|
|
172
170
|
}
|
|
173
171
|
break;
|
|
174
172
|
case "boolean":
|
|
175
|
-
|
|
173
|
+
_(e, t ? 120 : 121);
|
|
176
174
|
break;
|
|
177
|
-
default:
|
|
175
|
+
default: _(e, 127);
|
|
178
176
|
}
|
|
179
|
-
},
|
|
177
|
+
}, Le = class extends be {
|
|
180
178
|
constructor(e) {
|
|
181
179
|
super(), this.w = e, this.s = null, this.count = 0;
|
|
182
180
|
}
|
|
183
181
|
write(e) {
|
|
184
|
-
this.s === e ? this.count++ : (this.count > 0 &&
|
|
182
|
+
this.s === e ? this.count++ : (this.count > 0 && v(this, this.count - 1), this.count = 1, this.w(this, e), this.s = e);
|
|
185
183
|
}
|
|
186
|
-
},
|
|
187
|
-
e.count > 0 && (
|
|
188
|
-
},
|
|
184
|
+
}, Re = (e) => {
|
|
185
|
+
e.count > 0 && (Ee(e.encoder, e.count === 1 ? e.s : -e.s), e.count > 1 && v(e.encoder, e.count - 2));
|
|
186
|
+
}, ze = class {
|
|
189
187
|
constructor() {
|
|
190
|
-
this.encoder = new
|
|
188
|
+
this.encoder = new be(), this.s = 0, this.count = 0;
|
|
191
189
|
}
|
|
192
190
|
write(e) {
|
|
193
|
-
this.s === e ? this.count++ : (
|
|
191
|
+
this.s === e ? this.count++ : (Re(this), this.count = 1, this.s = e);
|
|
194
192
|
}
|
|
195
193
|
toUint8Array() {
|
|
196
|
-
return
|
|
194
|
+
return Re(this), g(this.encoder);
|
|
197
195
|
}
|
|
198
|
-
},
|
|
196
|
+
}, Be = (e) => {
|
|
199
197
|
if (e.count > 0) {
|
|
200
198
|
let t = e.diff * 2 + (e.count === 1 ? 0 : 1);
|
|
201
|
-
|
|
199
|
+
Ee(e.encoder, t), e.count > 1 && v(e.encoder, e.count - 2);
|
|
202
200
|
}
|
|
203
|
-
},
|
|
201
|
+
}, Ve = class {
|
|
204
202
|
constructor() {
|
|
205
|
-
this.encoder = new
|
|
203
|
+
this.encoder = new be(), this.s = 0, this.count = 0, this.diff = 0;
|
|
206
204
|
}
|
|
207
205
|
write(e) {
|
|
208
|
-
this.diff === e - this.s ? (this.s = e, this.count++) : (
|
|
206
|
+
this.diff === e - this.s ? (this.s = e, this.count++) : (Be(this), this.count = 1, this.diff = e - this.s, this.s = e);
|
|
209
207
|
}
|
|
210
208
|
toUint8Array() {
|
|
211
|
-
return
|
|
209
|
+
return Be(this), g(this.encoder);
|
|
212
210
|
}
|
|
213
|
-
},
|
|
211
|
+
}, He = class {
|
|
214
212
|
constructor() {
|
|
215
|
-
this.sarr = [], this.s = "", this.lensE = new
|
|
213
|
+
this.sarr = [], this.s = "", this.lensE = new ze();
|
|
216
214
|
}
|
|
217
215
|
write(e) {
|
|
218
216
|
this.s += e, this.s.length > 19 && (this.sarr.push(this.s), this.s = ""), this.lensE.write(e.length);
|
|
219
217
|
}
|
|
220
218
|
toUint8Array() {
|
|
221
|
-
let e = new
|
|
222
|
-
return this.sarr.push(this.s), this.s = "",
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
throw
|
|
226
|
-
},
|
|
227
|
-
throw
|
|
228
|
-
},
|
|
219
|
+
let e = new be();
|
|
220
|
+
return this.sarr.push(this.s), this.s = "", y(e, this.sarr.join("")), ke(e, this.lensE.toUint8Array()), g(e);
|
|
221
|
+
}
|
|
222
|
+
}, x = (e) => Error(e), S = () => {
|
|
223
|
+
throw x("Method unimplemented");
|
|
224
|
+
}, C = () => {
|
|
225
|
+
throw x("Unexpected case");
|
|
226
|
+
}, Ue = x("Unexpected end of array"), We = x("Integer out of Range"), Ge = class {
|
|
229
227
|
constructor(e) {
|
|
230
228
|
this.arr = e, this.pos = 0;
|
|
231
229
|
}
|
|
232
|
-
},
|
|
230
|
+
}, w = (e) => new Ge(e), Ke = (e) => e.pos !== e.arr.length, qe = (e, t) => {
|
|
233
231
|
let n = new Uint8Array(e.arr.buffer, e.pos + e.arr.byteOffset, t);
|
|
234
232
|
return e.pos += t, n;
|
|
235
|
-
},
|
|
233
|
+
}, T = (e) => qe(e, E(e)), Je = (e) => e.arr[e.pos++], E = (e) => {
|
|
236
234
|
let t = 0, n = 1, r = e.arr.length;
|
|
237
235
|
for (; e.pos < r;) {
|
|
238
236
|
let r = e.arr[e.pos++];
|
|
239
237
|
if (t += (r & 127) * n, n *= 128, r < 128) return t;
|
|
240
238
|
/* c8 ignore start */
|
|
241
|
-
if (t >
|
|
239
|
+
if (t > oe) throw We;
|
|
242
240
|
}
|
|
243
|
-
throw
|
|
244
|
-
},
|
|
241
|
+
throw Ue;
|
|
242
|
+
}, Ye = (e) => {
|
|
245
243
|
let t = e.arr[e.pos++], n = t & 63, r = 64, i = (t & 64) > 0 ? -1 : 1;
|
|
246
244
|
if (!(t & 128)) return i * n;
|
|
247
245
|
let a = e.arr.length;
|
|
248
246
|
for (; e.pos < a;) {
|
|
249
247
|
if (t = e.arr[e.pos++], n += (t & 127) * r, r *= 128, t < 128) return i * n;
|
|
250
248
|
/* c8 ignore start */
|
|
251
|
-
if (n >
|
|
249
|
+
if (n > oe) throw We;
|
|
252
250
|
}
|
|
253
|
-
throw
|
|
254
|
-
},
|
|
255
|
-
let t =
|
|
251
|
+
throw Ue;
|
|
252
|
+
}, D = ve ? (e) => ve.decode(T(e)) : (e) => {
|
|
253
|
+
let t = E(e);
|
|
256
254
|
if (t === 0) return "";
|
|
257
255
|
{
|
|
258
|
-
let n = String.fromCodePoint(
|
|
259
|
-
if (--t < 100) for (; t--;) n += String.fromCodePoint(
|
|
256
|
+
let n = String.fromCodePoint(Je(e));
|
|
257
|
+
if (--t < 100) for (; t--;) n += String.fromCodePoint(Je(e));
|
|
260
258
|
else for (; t > 0;) {
|
|
261
259
|
let r = t < 1e4 ? t : 1e4, i = e.arr.subarray(e.pos, e.pos + r);
|
|
262
260
|
e.pos += r, n += String.fromCodePoint.apply(null, i), t -= r;
|
|
263
261
|
}
|
|
264
262
|
return decodeURIComponent(escape(n));
|
|
265
263
|
}
|
|
266
|
-
},
|
|
264
|
+
}, Xe = (e, t) => {
|
|
267
265
|
let n = new DataView(e.arr.buffer, e.arr.byteOffset + e.pos, t);
|
|
268
266
|
return e.pos += t, n;
|
|
269
|
-
},
|
|
267
|
+
}, Ze = [
|
|
270
268
|
(e) => void 0,
|
|
271
269
|
(e) => null,
|
|
272
|
-
|
|
273
|
-
(e) =>
|
|
274
|
-
(e) =>
|
|
275
|
-
(e) =>
|
|
270
|
+
Ye,
|
|
271
|
+
(e) => Xe(e, 4).getFloat32(0, !1),
|
|
272
|
+
(e) => Xe(e, 8).getFloat64(0, !1),
|
|
273
|
+
(e) => Xe(e, 8).getBigInt64(0, !1),
|
|
276
274
|
(e) => !1,
|
|
277
275
|
(e) => !0,
|
|
278
|
-
|
|
276
|
+
D,
|
|
279
277
|
(e) => {
|
|
280
|
-
let t =
|
|
278
|
+
let t = E(e), n = {};
|
|
281
279
|
for (let r = 0; r < t; r++) {
|
|
282
|
-
let t =
|
|
283
|
-
n[t] =
|
|
280
|
+
let t = D(e);
|
|
281
|
+
n[t] = Qe(e);
|
|
284
282
|
}
|
|
285
283
|
return n;
|
|
286
284
|
},
|
|
287
285
|
(e) => {
|
|
288
|
-
let t =
|
|
289
|
-
for (let r = 0; r < t; r++) n.push(
|
|
286
|
+
let t = E(e), n = [];
|
|
287
|
+
for (let r = 0; r < t; r++) n.push(Qe(e));
|
|
290
288
|
return n;
|
|
291
289
|
},
|
|
292
|
-
|
|
293
|
-
],
|
|
290
|
+
T
|
|
291
|
+
], Qe = (e) => Ze[127 - Je(e)](e), $e = class extends Ge {
|
|
294
292
|
constructor(e, t) {
|
|
295
293
|
super(e), this.reader = t, this.s = null, this.count = 0;
|
|
296
294
|
}
|
|
297
295
|
read() {
|
|
298
|
-
return this.count === 0 && (this.s = this.reader(this),
|
|
296
|
+
return this.count === 0 && (this.s = this.reader(this), this.count = Ke(this) ? E(this) + 1 : -1), this.count--, this.s;
|
|
299
297
|
}
|
|
300
|
-
},
|
|
298
|
+
}, et = class extends Ge {
|
|
301
299
|
constructor(e) {
|
|
302
300
|
super(e), this.s = 0, this.count = 0;
|
|
303
301
|
}
|
|
304
302
|
read() {
|
|
305
303
|
if (this.count === 0) {
|
|
306
|
-
this.s =
|
|
304
|
+
this.s = Ye(this);
|
|
307
305
|
let e = ie(this.s);
|
|
308
|
-
this.count = 1, e && (this.s = -this.s, this.count =
|
|
306
|
+
this.count = 1, e && (this.s = -this.s, this.count = E(this) + 2);
|
|
309
307
|
}
|
|
310
308
|
return this.count--, this.s;
|
|
311
309
|
}
|
|
312
|
-
},
|
|
310
|
+
}, tt = class extends Ge {
|
|
313
311
|
constructor(e) {
|
|
314
312
|
super(e), this.s = 0, this.count = 0, this.diff = 0;
|
|
315
313
|
}
|
|
316
314
|
read() {
|
|
317
315
|
if (this.count === 0) {
|
|
318
|
-
let e =
|
|
319
|
-
this.diff = m(e / 2), this.count = 1, t && (this.count =
|
|
316
|
+
let e = Ye(this), t = e & 1;
|
|
317
|
+
this.diff = m(e / 2), this.count = 1, t && (this.count = E(this) + 2);
|
|
320
318
|
}
|
|
321
319
|
return this.s += this.diff, this.count--, this.s;
|
|
322
320
|
}
|
|
323
|
-
},
|
|
321
|
+
}, nt = class {
|
|
324
322
|
constructor(e) {
|
|
325
|
-
this.decoder = new
|
|
323
|
+
this.decoder = new et(e), this.str = D(this.decoder), this.spos = 0;
|
|
326
324
|
}
|
|
327
325
|
read() {
|
|
328
326
|
let e = this.spos + this.decoder.read(), t = this.str.slice(this.spos, e);
|
|
@@ -330,12 +328,12 @@ var je = (e, t) => d(t, () => e).join(""), Me = class {
|
|
|
330
328
|
}
|
|
331
329
|
};
|
|
332
330
|
crypto.subtle;
|
|
333
|
-
var
|
|
331
|
+
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);
|
|
334
332
|
Promise.all.bind(Promise);
|
|
335
333
|
//#endregion
|
|
336
334
|
//#region ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/conditions.js
|
|
337
335
|
/* c8 ignore next */
|
|
338
|
-
var
|
|
336
|
+
var dt = (e) => e === void 0 ? null : e, ft = new class {
|
|
339
337
|
constructor() {
|
|
340
338
|
this.map = /* @__PURE__ */ new Map();
|
|
341
339
|
}
|
|
@@ -345,41 +343,41 @@ var St = (e) => e === void 0 ? null : e, Ct = new class {
|
|
|
345
343
|
getItem(e) {
|
|
346
344
|
return this.map.get(e);
|
|
347
345
|
}
|
|
348
|
-
}(),
|
|
346
|
+
}(), pt = !0;
|
|
349
347
|
/* c8 ignore start */
|
|
350
348
|
try {
|
|
351
|
-
typeof localStorage < "u" && localStorage && (
|
|
349
|
+
typeof localStorage < "u" && localStorage && (ft = localStorage, pt = !1);
|
|
352
350
|
} catch {}
|
|
353
351
|
/* c8 ignore stop */
|
|
354
352
|
/* c8 ignore next */
|
|
355
|
-
var
|
|
353
|
+
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) => {
|
|
356
354
|
for (let n in e) t(e[n], n);
|
|
357
|
-
},
|
|
355
|
+
}, Ct = (e, t) => {
|
|
358
356
|
let n = [];
|
|
359
357
|
for (let r in e) n.push(t(e[r], r));
|
|
360
358
|
return n;
|
|
361
|
-
},
|
|
359
|
+
}, wt = (e) => xt(e).length, Tt = (e) => {
|
|
362
360
|
for (let t in e) return !1;
|
|
363
361
|
return !0;
|
|
364
|
-
},
|
|
362
|
+
}, Et = (e, t) => {
|
|
365
363
|
for (let n in e) if (!t(e[n], n)) return !1;
|
|
366
364
|
return !0;
|
|
367
|
-
},
|
|
365
|
+
}, 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) => {
|
|
368
366
|
for (let t in e) {
|
|
369
367
|
let n = e[t];
|
|
370
|
-
(typeof n == "object" || typeof n == "function") &&
|
|
368
|
+
(typeof n == "object" || typeof n == "function") && At(e[t]);
|
|
371
369
|
}
|
|
372
|
-
return
|
|
373
|
-
},
|
|
370
|
+
return kt(e);
|
|
371
|
+
}, jt = (e, t, n = 0) => {
|
|
374
372
|
try {
|
|
375
373
|
for (; n < e.length; n++) e[n](...t);
|
|
376
374
|
} finally {
|
|
377
|
-
n < e.length &&
|
|
375
|
+
n < e.length && jt(e, t, n + 1);
|
|
378
376
|
}
|
|
379
|
-
},
|
|
377
|
+
}, Mt = (e) => e, Nt = (e, t) => {
|
|
380
378
|
if (e === t) return !0;
|
|
381
379
|
if (e == null || t == null || e.constructor !== t.constructor && (e.constructor || Object) !== (t.constructor || Object)) return !1;
|
|
382
|
-
if (e[
|
|
380
|
+
if (e[_t] != null) return e[_t](t);
|
|
383
381
|
switch (e.constructor) {
|
|
384
382
|
case ArrayBuffer: e = new Uint8Array(e), t = new Uint8Array(t);
|
|
385
383
|
case Uint8Array:
|
|
@@ -392,65 +390,67 @@ var Tt = Ct, Et = (e) => wt || addEventListener("storage", e), Dt = (e) => wt ||
|
|
|
392
390
|
break;
|
|
393
391
|
case Map:
|
|
394
392
|
if (e.size !== t.size) return !1;
|
|
395
|
-
for (let n of e.keys()) if (!t.has(n) || !
|
|
393
|
+
for (let n of e.keys()) if (!t.has(n) || !Nt(e.get(n), t.get(n))) return !1;
|
|
396
394
|
break;
|
|
397
395
|
case void 0:
|
|
398
396
|
case Object:
|
|
399
|
-
if (
|
|
400
|
-
for (let n in e) if (!
|
|
397
|
+
if (wt(e) !== wt(t)) return !1;
|
|
398
|
+
for (let n in e) if (!Dt(e, n) || !Nt(e[n], t[n])) return !1;
|
|
401
399
|
break;
|
|
402
400
|
case Array:
|
|
403
401
|
if (e.length !== t.length) return !1;
|
|
404
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
402
|
+
for (let n = 0; n < e.length; n++) if (!Nt(e[n], t[n])) return !1;
|
|
405
403
|
break;
|
|
406
404
|
default: return !1;
|
|
407
405
|
}
|
|
408
406
|
return !0;
|
|
409
|
-
},
|
|
407
|
+
}, 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;
|
|
410
408
|
typeof navigator < "u" && /Mac/.test(navigator.platform);
|
|
411
|
-
var k,
|
|
412
|
-
if (k === void 0)
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
let
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
409
|
+
var k, It = [], Lt = () => {
|
|
410
|
+
if (k === void 0) {
|
|
411
|
+
if (O) {
|
|
412
|
+
k = e();
|
|
413
|
+
let t = process.argv, n = null;
|
|
414
|
+
for (let e = 0; e < t.length; e++) {
|
|
415
|
+
let r = t[e];
|
|
416
|
+
r[0] === "-" ? (n !== null && k.set(n, ""), n = r) : n === null ? It.push(r) : (k.set(n, r), n = null);
|
|
417
|
+
}
|
|
418
|
+
n !== null && k.set(n, "");
|
|
419
|
+
} else typeof location == "object" ? (k = e(), (location.search || "?").slice(1).split("&").forEach((e) => {
|
|
420
|
+
if (e.length !== 0) {
|
|
421
|
+
let [t, n] = e.split("=");
|
|
422
|
+
k.set(`--${me(t, "-")}`, n), k.set(`-${me(t, "-")}`, n);
|
|
423
|
+
}
|
|
424
|
+
})) : k = e();
|
|
425
|
+
}
|
|
426
426
|
return k;
|
|
427
|
-
},
|
|
427
|
+
}, 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, [
|
|
428
428
|
"true",
|
|
429
429
|
"1",
|
|
430
430
|
"2"
|
|
431
|
-
]) || !
|
|
431
|
+
]) || !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) => {
|
|
432
432
|
let t = "";
|
|
433
|
-
for (let n = 0; n < e.byteLength; n++) t +=
|
|
433
|
+
for (let n = 0; n < e.byteLength; n++) t += le(e[n]);
|
|
434
434
|
return btoa(t);
|
|
435
|
-
},
|
|
436
|
-
let t = atob(e), n =
|
|
435
|
+
}, qt = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), Jt = (e) => {
|
|
436
|
+
let t = atob(e), n = Ut(t.length);
|
|
437
437
|
for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
|
|
438
438
|
return n;
|
|
439
|
-
},
|
|
439
|
+
}, Yt = (e) => {
|
|
440
440
|
let t = Buffer.from(e, "base64");
|
|
441
|
-
return
|
|
442
|
-
},
|
|
443
|
-
let t =
|
|
441
|
+
return Wt(t.buffer, t.byteOffset, t.byteLength);
|
|
442
|
+
}, Xt = Ft ? Kt : qt, Zt = Ft ? Jt : Yt, Qt = (e) => {
|
|
443
|
+
let t = Ut(e.byteLength);
|
|
444
444
|
return t.set(e), t;
|
|
445
|
-
},
|
|
445
|
+
}, $t = (e) => Se((t) => Ie(t, e)), en = class {
|
|
446
446
|
constructor(e, t) {
|
|
447
447
|
this.left = e, this.right = t;
|
|
448
448
|
}
|
|
449
|
-
}, A = (e, t) => new
|
|
450
|
-
let r =
|
|
451
|
-
for (let t = 0; t < r; t++) i +=
|
|
449
|
+
}, 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) => {
|
|
450
|
+
let r = an(e, t, n), i = "";
|
|
451
|
+
for (let t = 0; t < r; t++) i += on(e);
|
|
452
452
|
return i;
|
|
453
|
-
},
|
|
453
|
+
}, cn = (e, t) => t[an(e, 0, t.length - 1)], ln = Symbol("0schema"), un = class {
|
|
454
454
|
constructor() {
|
|
455
455
|
this._rerrs = [];
|
|
456
456
|
}
|
|
@@ -467,23 +467,23 @@ var k, Jt = [], Yt = () => {
|
|
|
467
467
|
for (let t = this._rerrs.length - 1; t > 0; t--) {
|
|
468
468
|
let n = this._rerrs[t];
|
|
469
469
|
/* c8 ignore next */
|
|
470
|
-
e.push(
|
|
470
|
+
e.push(ye(" ", (this._rerrs.length - t) * 2) + `${n.path == null ? "" : `[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`);
|
|
471
471
|
}
|
|
472
472
|
return e.join("\n");
|
|
473
473
|
}
|
|
474
|
-
},
|
|
474
|
+
}, 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
475
|
static _dilutes = !1;
|
|
476
476
|
extends(e) {
|
|
477
477
|
let [t, n] = [this.shape, e.shape];
|
|
478
|
-
return this.constructor._dilutes && ([n, t] = [t, n]),
|
|
478
|
+
return this.constructor._dilutes && ([n, t] = [t, n]), dn(t, n);
|
|
479
479
|
}
|
|
480
480
|
equals(e) {
|
|
481
|
-
return this.constructor === e.constructor &&
|
|
481
|
+
return this.constructor === e.constructor && Nt(this.shape, e.shape);
|
|
482
482
|
}
|
|
483
|
-
[
|
|
483
|
+
[ln]() {
|
|
484
484
|
return !0;
|
|
485
485
|
}
|
|
486
|
-
[
|
|
486
|
+
[_t](e) {
|
|
487
487
|
return this.equals(e);
|
|
488
488
|
}
|
|
489
489
|
validate(e) {
|
|
@@ -491,22 +491,22 @@ var k, Jt = [], Yt = () => {
|
|
|
491
491
|
}
|
|
492
492
|
/* c8 ignore start */
|
|
493
493
|
check(e, t) {
|
|
494
|
-
|
|
494
|
+
S();
|
|
495
495
|
}
|
|
496
496
|
/* c8 ignore stop */
|
|
497
497
|
get nullable() {
|
|
498
|
-
return
|
|
498
|
+
return Hn(this, rr);
|
|
499
499
|
}
|
|
500
500
|
get optional() {
|
|
501
|
-
return new
|
|
501
|
+
return new bn(this);
|
|
502
502
|
}
|
|
503
503
|
cast(e) {
|
|
504
|
-
return
|
|
504
|
+
return sr(e, this), e;
|
|
505
505
|
}
|
|
506
506
|
expect(e) {
|
|
507
|
-
return
|
|
507
|
+
return sr(e, this), e;
|
|
508
508
|
}
|
|
509
|
-
},
|
|
509
|
+
}, fn = class extends j {
|
|
510
510
|
constructor(e, t) {
|
|
511
511
|
super(), this.shape = e, this._c = t;
|
|
512
512
|
}
|
|
@@ -514,9 +514,9 @@ var k, Jt = [], Yt = () => {
|
|
|
514
514
|
let n = e?.constructor === this.shape && (this._c == null || this._c(e));
|
|
515
515
|
return !n && t?.extend(null, this.shape.name, e?.constructor.name, e?.constructor === this.shape ? "Check failed" : "Constructor match failed"), n;
|
|
516
516
|
}
|
|
517
|
-
}, M = (e, t = null) => new
|
|
518
|
-
M(
|
|
519
|
-
var
|
|
517
|
+
}, M = (e, t = null) => new fn(e, t);
|
|
518
|
+
M(fn);
|
|
519
|
+
var pn = class extends j {
|
|
520
520
|
constructor(e) {
|
|
521
521
|
super(), this.shape = e;
|
|
522
522
|
}
|
|
@@ -524,9 +524,9 @@ var Tn = class extends j {
|
|
|
524
524
|
let n = this.shape(e);
|
|
525
525
|
return !n && t?.extend(null, "custom prop", e?.constructor.name, "failed to check custom prop"), n;
|
|
526
526
|
}
|
|
527
|
-
}, N = (e) => new
|
|
528
|
-
M(
|
|
529
|
-
var
|
|
527
|
+
}, N = (e) => new pn(e);
|
|
528
|
+
M(pn);
|
|
529
|
+
var mn = class extends j {
|
|
530
530
|
constructor(e) {
|
|
531
531
|
super(), this.shape = e;
|
|
532
532
|
}
|
|
@@ -534,25 +534,25 @@ var En = class extends j {
|
|
|
534
534
|
let n = this.shape.some((t) => t === e);
|
|
535
535
|
return !n && t?.extend(null, this.shape.join(" | "), e.toString()), n;
|
|
536
536
|
}
|
|
537
|
-
},
|
|
538
|
-
if (
|
|
539
|
-
if (
|
|
540
|
-
if (
|
|
541
|
-
if (
|
|
542
|
-
if (
|
|
537
|
+
}, hn = (...e) => new mn(e), gn = M(mn), _n = RegExp.escape || ((e) => e.replace(/[().|&,$^[\]]/g, (e) => "\\" + e)), vn = (e) => {
|
|
538
|
+
if (Qn.check(e)) return [_n(e)];
|
|
539
|
+
if (gn.check(e)) return e.shape.map((e) => e + "");
|
|
540
|
+
if (Zn.check(e)) return ["[+-]?\\d+.?\\d*"];
|
|
541
|
+
if ($n.check(e)) return [".*"];
|
|
542
|
+
if (Un.check(e)) return e.shape.map(vn).flat(1);
|
|
543
543
|
/* c8 ignore next 2 */
|
|
544
|
-
|
|
544
|
+
C();
|
|
545
545
|
};
|
|
546
546
|
M(class extends j {
|
|
547
547
|
constructor(e) {
|
|
548
|
-
super(), this.shape = e, this._r = RegExp("^" + e.map(
|
|
548
|
+
super(), this.shape = e, this._r = RegExp("^" + e.map(vn).map((e) => `(${e.join("|")})`).join("") + "$");
|
|
549
549
|
}
|
|
550
550
|
check(e, t) {
|
|
551
551
|
let n = this._r.exec(e) != null;
|
|
552
552
|
return !n && t?.extend(null, this._r.toString(), e.toString(), "String doesn't match string template."), n;
|
|
553
553
|
}
|
|
554
554
|
});
|
|
555
|
-
var
|
|
555
|
+
var yn = Symbol("optional"), bn = class extends j {
|
|
556
556
|
constructor(e) {
|
|
557
557
|
super(), this.shape = e;
|
|
558
558
|
}
|
|
@@ -560,16 +560,16 @@ var jn = Symbol("optional"), Mn = class extends j {
|
|
|
560
560
|
let n = e === void 0 || this.shape.check(e);
|
|
561
561
|
return !n && t?.extend(null, "undefined (optional)", "()"), n;
|
|
562
562
|
}
|
|
563
|
-
get [
|
|
563
|
+
get [yn]() {
|
|
564
564
|
return !0;
|
|
565
565
|
}
|
|
566
|
-
},
|
|
566
|
+
}, xn = M(bn), Sn = class extends j {
|
|
567
567
|
check(e, t) {
|
|
568
568
|
return t?.extend(null, "never", typeof e), !1;
|
|
569
569
|
}
|
|
570
570
|
};
|
|
571
|
-
new
|
|
572
|
-
var
|
|
571
|
+
new Sn(), M(Sn);
|
|
572
|
+
var Cn = class e extends j {
|
|
573
573
|
constructor(e, t = !1) {
|
|
574
574
|
super(), this.shape = e, this._isPartial = t;
|
|
575
575
|
}
|
|
@@ -578,12 +578,14 @@ var Fn = class e extends j {
|
|
|
578
578
|
return new e(this.shape, !0);
|
|
579
579
|
}
|
|
580
580
|
check(e, t) {
|
|
581
|
-
return e == null ?
|
|
582
|
-
|
|
581
|
+
return e == null ?
|
|
582
|
+
/* c8 ignore next */
|
|
583
|
+
(t?.extend(null, "object", "null"), !1) : Et(this.shape, (n, r) => {
|
|
584
|
+
let i = this._isPartial && !Dt(e, r) || n.check(e[r], t);
|
|
583
585
|
return !i && t?.extend(r.toString(), n.toString(), typeof e[r], "Object property does not match"), i;
|
|
584
586
|
});
|
|
585
587
|
}
|
|
586
|
-
},
|
|
588
|
+
}, wn = (e) => new Cn(e), Tn = M(Cn), En = N((e) => e != null && (e.constructor === Object || e.constructor == null)), Dn = class extends j {
|
|
587
589
|
constructor(e, t) {
|
|
588
590
|
super(), this.shape = {
|
|
589
591
|
keys: e,
|
|
@@ -591,32 +593,32 @@ var Fn = class e extends j {
|
|
|
591
593
|
};
|
|
592
594
|
}
|
|
593
595
|
check(e, t) {
|
|
594
|
-
return e != null &&
|
|
596
|
+
return e != null && Et(e, (n, r) => {
|
|
595
597
|
let i = this.shape.keys.check(r, t);
|
|
596
598
|
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
599
|
});
|
|
598
600
|
}
|
|
599
|
-
},
|
|
601
|
+
}, On = (e, t) => new Dn(e, t), kn = M(Dn), An = class extends j {
|
|
600
602
|
constructor(e) {
|
|
601
603
|
super(), this.shape = e;
|
|
602
604
|
}
|
|
603
605
|
check(e, t) {
|
|
604
|
-
return e != null &&
|
|
606
|
+
return e != null && Et(this.shape, (n, r) => {
|
|
605
607
|
let i = n.check(e[r], t);
|
|
606
608
|
return !i && t?.extend(r.toString(), "Tuple", typeof n), i;
|
|
607
609
|
});
|
|
608
610
|
}
|
|
609
|
-
},
|
|
610
|
-
M(
|
|
611
|
-
var
|
|
611
|
+
}, jn = (...e) => new An(e);
|
|
612
|
+
M(An);
|
|
613
|
+
var Mn = class extends j {
|
|
612
614
|
constructor(e) {
|
|
613
|
-
super(), this.shape = e.length === 1 ? e[0] : new
|
|
615
|
+
super(), this.shape = e.length === 1 ? e[0] : new Vn(e);
|
|
614
616
|
}
|
|
615
617
|
check(e, t) {
|
|
616
618
|
let n = f(e) && l(e, (e) => this.shape.check(e));
|
|
617
619
|
return !n && t?.extend(null, "Array", ""), n;
|
|
618
620
|
}
|
|
619
|
-
},
|
|
621
|
+
}, Nn = (...e) => new Mn(e), Pn = M(Mn), Fn = N((e) => f(e)), In = class extends j {
|
|
620
622
|
constructor(e, t) {
|
|
621
623
|
super(), this.shape = e, this._c = t;
|
|
622
624
|
}
|
|
@@ -624,17 +626,17 @@ var Wn = class extends j {
|
|
|
624
626
|
let n = e instanceof this.shape && (this._c == null || this._c(e));
|
|
625
627
|
return !n && t?.extend(null, this.shape.name, e?.constructor.name), n;
|
|
626
628
|
}
|
|
627
|
-
},
|
|
628
|
-
M(
|
|
629
|
-
var
|
|
629
|
+
}, Ln = (e, t = null) => new In(e, t);
|
|
630
|
+
M(In);
|
|
631
|
+
var Rn = Ln(j), zn = M(class extends j {
|
|
630
632
|
constructor(e) {
|
|
631
|
-
super(), this.len = e.length - 1, this.args =
|
|
633
|
+
super(), this.len = e.length - 1, this.args = jn(...e.slice(-1)), this.res = e[this.len];
|
|
632
634
|
}
|
|
633
635
|
check(e, t) {
|
|
634
636
|
let n = e.constructor === Function && e.length <= this.len;
|
|
635
637
|
return !n && t?.extend(null, "function", typeof e), n;
|
|
636
638
|
}
|
|
637
|
-
}),
|
|
639
|
+
}), Bn = N((e) => typeof e == "function");
|
|
638
640
|
M(class extends j {
|
|
639
641
|
constructor(e) {
|
|
640
642
|
super(), this.shape = e;
|
|
@@ -644,7 +646,7 @@ M(class extends j {
|
|
|
644
646
|
return !n && t?.extend(null, "Intersectinon", typeof e), n;
|
|
645
647
|
}
|
|
646
648
|
}, (e) => e.shape.length > 0);
|
|
647
|
-
var
|
|
649
|
+
var Vn = class extends j {
|
|
648
650
|
static _dilutes = !0;
|
|
649
651
|
constructor(e) {
|
|
650
652
|
super(), this.shape = e;
|
|
@@ -653,43 +655,44 @@ var $n = class extends j {
|
|
|
653
655
|
let n = u(this.shape, (n) => n.check(e, t));
|
|
654
656
|
return t?.extend(null, "Union", typeof e), n;
|
|
655
657
|
}
|
|
656
|
-
},
|
|
657
|
-
N((e) => e ===
|
|
658
|
-
var
|
|
659
|
-
M(
|
|
660
|
-
var
|
|
661
|
-
M(Uint8Array), M(
|
|
662
|
-
var
|
|
658
|
+
}, 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");
|
|
659
|
+
N((e) => e === Yn);
|
|
660
|
+
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);
|
|
661
|
+
M(mn, (e) => e.shape.length === 1 && e.shape[0] === void 0), hn(void 0);
|
|
662
|
+
var rr = hn(null), ir = M(mn, (e) => e.shape.length === 1 && e.shape[0] === null);
|
|
663
|
+
M(Uint8Array), M(fn, (e) => e.shape === Uint8Array);
|
|
664
|
+
var ar = Hn(Xn, Qn, rr, nr, qn, er, Yn);
|
|
663
665
|
(() => {
|
|
664
|
-
let e = Gn
|
|
666
|
+
let e = Nn(Gn), t = On(Qn, Gn), n = Hn(Xn, Qn, rr, er, e, t);
|
|
665
667
|
return e.shape = n, t.shape.values = n, n;
|
|
666
668
|
})();
|
|
667
|
-
var
|
|
668
|
-
if (
|
|
669
|
-
if (
|
|
669
|
+
var or = (e) => {
|
|
670
|
+
if (Rn.check(e)) return e;
|
|
671
|
+
if (En.check(e)) {
|
|
670
672
|
let t = {};
|
|
671
|
-
for (let n in e) t[n] =
|
|
672
|
-
return
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
|
|
673
|
+
for (let n in e) t[n] = or(e[n]);
|
|
674
|
+
return wn(t);
|
|
675
|
+
}
|
|
676
|
+
if (Fn.check(e)) return Hn(...e.map(or));
|
|
677
|
+
if (ar.check(e)) return hn(e);
|
|
678
|
+
if (Bn.check(e)) return M(e);
|
|
676
679
|
/* c8 ignore next */
|
|
677
|
-
|
|
678
|
-
},
|
|
679
|
-
let n = new
|
|
680
|
-
if (!t.check(e, n)) throw
|
|
681
|
-
},
|
|
680
|
+
C();
|
|
681
|
+
}, sr = Vt ? () => {} : (e, t) => {
|
|
682
|
+
let n = new un();
|
|
683
|
+
if (!t.check(e, n)) throw x(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`);
|
|
684
|
+
}, cr = class {
|
|
682
685
|
constructor(e) {
|
|
683
686
|
this.patterns = [], this.$state = e;
|
|
684
687
|
}
|
|
685
688
|
if(e, t) {
|
|
686
689
|
return this.patterns.push({
|
|
687
|
-
if:
|
|
690
|
+
if: or(e),
|
|
688
691
|
h: t
|
|
689
692
|
}), this;
|
|
690
693
|
}
|
|
691
694
|
else(e) {
|
|
692
|
-
return this.if(
|
|
695
|
+
return this.if(Gn, e);
|
|
693
696
|
}
|
|
694
697
|
done() {
|
|
695
698
|
return (e, t) => {
|
|
@@ -697,62 +700,55 @@ var vr = (e) => {
|
|
|
697
700
|
let r = this.patterns[n];
|
|
698
701
|
if (r.if.check(e)) return r.h(e, t);
|
|
699
702
|
}
|
|
700
|
-
throw
|
|
703
|
+
throw x("Unhandled pattern");
|
|
701
704
|
};
|
|
702
705
|
}
|
|
703
|
-
},
|
|
706
|
+
}, 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) => {
|
|
704
707
|
let n = {};
|
|
705
708
|
for (let r in e.shape) {
|
|
706
709
|
let i = e.shape[r];
|
|
707
|
-
if (
|
|
708
|
-
if (
|
|
710
|
+
if (xn.check(i)) {
|
|
711
|
+
if (tn(t)) continue;
|
|
709
712
|
i = i.shape;
|
|
710
713
|
}
|
|
711
|
-
n[r] =
|
|
714
|
+
n[r] = lr(i, t);
|
|
712
715
|
}
|
|
713
716
|
return n;
|
|
714
|
-
}).if(
|
|
715
|
-
let n = [], r =
|
|
716
|
-
for (let i = 0; i < r; i++) n.push(
|
|
717
|
+
}).if(Pn, (e, t) => {
|
|
718
|
+
let n = [], r = rn(t, 0, 42);
|
|
719
|
+
for (let i = 0; i < r; i++) n.push(ur(t, e.shape));
|
|
717
720
|
return n;
|
|
718
|
-
}).if(
|
|
719
|
-
let n =
|
|
721
|
+
}).if(gn, (e, t) => cn(t, e.shape)).if(ir, (e, t) => null).if(zn, (e, t) => {
|
|
722
|
+
let n = ur(t, e.res);
|
|
720
723
|
return () => n;
|
|
721
|
-
}).if(
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
]))).if(
|
|
731
|
-
let n = {}, r =
|
|
724
|
+
}).if(Kn, (e, t) => ur(t, cn(t, [
|
|
725
|
+
Xn,
|
|
726
|
+
Qn,
|
|
727
|
+
rr,
|
|
728
|
+
nr,
|
|
729
|
+
qn,
|
|
730
|
+
er,
|
|
731
|
+
Nn(Xn),
|
|
732
|
+
On(Hn("a", "b", "c"), Xn)
|
|
733
|
+
]))).if(kn, (e, t) => {
|
|
734
|
+
let n = {}, r = nn(t, 0, 3);
|
|
732
735
|
for (let i = 0; i < r; i++) {
|
|
733
|
-
let r =
|
|
734
|
-
n[r] =
|
|
736
|
+
let r = ur(t, e.shape.keys);
|
|
737
|
+
n[r] = ur(t, e.shape.values);
|
|
735
738
|
}
|
|
736
739
|
return n;
|
|
737
|
-
}).done(),
|
|
738
|
-
N((e) => e.nodeType ===
|
|
739
|
-
var
|
|
740
|
+
}).done(), ur = (e, t) => lr(or(t), e), P = typeof document < "u" ? document : {};
|
|
741
|
+
N((e) => e.nodeType === hr), typeof DOMParser < "u" && new DOMParser(), N((e) => e.nodeType === fr), N((e) => e.nodeType === pr);
|
|
742
|
+
var dr = (e) => r(e, (e, t) => `${t}:${e};`).join(""), fr = P.ELEMENT_NODE, pr = P.TEXT_NODE;
|
|
740
743
|
P.CDATA_SECTION_NODE, P.COMMENT_NODE;
|
|
741
|
-
var
|
|
744
|
+
var mr = P.DOCUMENT_NODE;
|
|
742
745
|
P.DOCUMENT_TYPE_NODE;
|
|
743
|
-
var
|
|
744
|
-
N((e) => e.nodeType ===
|
|
746
|
+
var hr = P.DOCUMENT_FRAGMENT_NODE;
|
|
747
|
+
N((e) => e.nodeType === mr);
|
|
745
748
|
/* c8 ignore stop */
|
|
746
749
|
//#endregion
|
|
747
|
-
//#region ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/
|
|
748
|
-
var
|
|
749
|
-
constructor(e) {
|
|
750
|
-
this._ = e;
|
|
751
|
-
}
|
|
752
|
-
destroy() {
|
|
753
|
-
e(this._);
|
|
754
|
-
}
|
|
755
|
-
})(clearTimeout), kr = (e, t) => new Or(setTimeout(t, e)), F = Symbol, Ar = F(), jr = F(), Mr = F(), Nr = F(), Pr = F(), Fr = F(), Ir = F(), Lr = F(), Rr = F(), zr = (e) => {
|
|
750
|
+
//#region ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/symbol.js
|
|
751
|
+
var F = Symbol, gr = F(), _r = F(), vr = F(), yr = F(), br = F(), xr = F(), Sr = F(), Cr = F(), wr = F(), Tr = (e) => {
|
|
756
752
|
e.length === 1 && e[0]?.constructor === Function && (e = e[0]());
|
|
757
753
|
let t = [], n = [], r = 0;
|
|
758
754
|
for (; r < e.length; r++) {
|
|
@@ -767,30 +763,30 @@ var Or = ((e) => class {
|
|
|
767
763
|
}
|
|
768
764
|
return n;
|
|
769
765
|
};
|
|
770
|
-
|
|
766
|
+
lt();
|
|
771
767
|
/* c8 ignore stop */
|
|
772
768
|
//#endregion
|
|
773
769
|
//#region ../node_modules/.bun/lib0@0.2.117/node_modules/lib0/logging.js
|
|
774
|
-
var
|
|
775
|
-
[
|
|
776
|
-
[
|
|
777
|
-
[
|
|
778
|
-
[
|
|
779
|
-
[
|
|
780
|
-
[
|
|
781
|
-
[
|
|
782
|
-
[
|
|
783
|
-
[
|
|
784
|
-
},
|
|
770
|
+
var Er = {
|
|
771
|
+
[gr]: A("font-weight", "bold"),
|
|
772
|
+
[_r]: A("font-weight", "normal"),
|
|
773
|
+
[vr]: A("color", "blue"),
|
|
774
|
+
[br]: A("color", "green"),
|
|
775
|
+
[yr]: A("color", "grey"),
|
|
776
|
+
[xr]: A("color", "red"),
|
|
777
|
+
[Sr]: A("color", "purple"),
|
|
778
|
+
[Cr]: A("color", "orange"),
|
|
779
|
+
[wr]: A("color", "black")
|
|
780
|
+
}, Dr = Ht ? (t) => {
|
|
785
781
|
t.length === 1 && t[0]?.constructor === Function && (t = t[0]());
|
|
786
782
|
let n = [], r = [], i = e(), a = [], o = 0;
|
|
787
783
|
for (; o < t.length; o++) {
|
|
788
|
-
let e = t[o], a =
|
|
784
|
+
let e = t[o], a = Er[e];
|
|
789
785
|
if (a !== void 0) i.set(a.left, a.right);
|
|
790
786
|
else {
|
|
791
787
|
if (e === void 0) break;
|
|
792
788
|
if (e.constructor === String || e.constructor === Number) {
|
|
793
|
-
let t =
|
|
789
|
+
let t = dr(i);
|
|
794
790
|
o > 0 || t.length > 0 ? (n.push("%c" + e), r.push(t)) : n.push(e);
|
|
795
791
|
} else break;
|
|
796
792
|
}
|
|
@@ -800,33 +796,33 @@ var Br = {
|
|
|
800
796
|
e instanceof Symbol || a.push(e);
|
|
801
797
|
}
|
|
802
798
|
return a;
|
|
803
|
-
} :
|
|
799
|
+
} : Tr, Or = (...e) => {
|
|
804
800
|
/* c8 ignore next */
|
|
805
|
-
console.log(...
|
|
806
|
-
},
|
|
807
|
-
console.warn(...
|
|
808
|
-
},
|
|
801
|
+
console.log(...Dr(e)), Ar.forEach((t) => t.print(e));
|
|
802
|
+
}, kr = (...e) => {
|
|
803
|
+
console.warn(...Dr(e)), e.unshift(Cr), Ar.forEach((t) => t.print(e));
|
|
804
|
+
}, Ar = a(), jr = (e) => ({
|
|
809
805
|
[Symbol.iterator]() {
|
|
810
806
|
return this;
|
|
811
807
|
},
|
|
812
808
|
next: e
|
|
813
|
-
}),
|
|
809
|
+
}), Mr = (e, t) => jr(() => {
|
|
814
810
|
let n;
|
|
815
811
|
do
|
|
816
812
|
n = e.next();
|
|
817
813
|
while (!n.done && !t(n.value));
|
|
818
814
|
return n;
|
|
819
|
-
}),
|
|
815
|
+
}), Nr = (e, t) => jr(() => {
|
|
820
816
|
let { done: n, value: r } = e.next();
|
|
821
817
|
return {
|
|
822
818
|
done: n,
|
|
823
819
|
value: n ? void 0 : t(r)
|
|
824
820
|
};
|
|
825
|
-
}),
|
|
821
|
+
}), Pr = class {
|
|
826
822
|
constructor(e, t) {
|
|
827
823
|
this.clock = e, this.len = t;
|
|
828
824
|
}
|
|
829
|
-
},
|
|
825
|
+
}, Fr = class {
|
|
830
826
|
constructor() {
|
|
831
827
|
this.clients = /* @__PURE__ */ new Map();
|
|
832
828
|
}
|
|
@@ -834,9 +830,9 @@ var Br = {
|
|
|
834
830
|
let i = e.doc.store.clients.get(r);
|
|
835
831
|
if (i != null) {
|
|
836
832
|
let r = i[i.length - 1], a = r.id.clock + r.length;
|
|
837
|
-
for (let r = 0, o = t[r]; r < t.length && o.clock < a; o = t[++r])
|
|
833
|
+
for (let r = 0, o = t[r]; r < t.length && o.clock < a; o = t[++r]) qi(e, i, o.clock, o.len, n);
|
|
838
834
|
}
|
|
839
|
-
}),
|
|
835
|
+
}), Ir = (e, t) => {
|
|
840
836
|
let n = 0, r = e.length - 1;
|
|
841
837
|
for (; n <= r;) {
|
|
842
838
|
let i = m((n + r) / 2), a = e[i], o = a.clock;
|
|
@@ -846,21 +842,21 @@ var Br = {
|
|
|
846
842
|
} else r = i - 1;
|
|
847
843
|
}
|
|
848
844
|
return null;
|
|
849
|
-
},
|
|
845
|
+
}, Lr = (e, t) => {
|
|
850
846
|
let n = e.clients.get(t.client);
|
|
851
|
-
return n !== void 0 &&
|
|
852
|
-
},
|
|
847
|
+
return n !== void 0 && Ir(n, t.clock) !== null;
|
|
848
|
+
}, Rr = (e) => {
|
|
853
849
|
e.clients.forEach((e) => {
|
|
854
850
|
e.sort((e, t) => e.clock - t.clock);
|
|
855
851
|
let t, n;
|
|
856
852
|
for (t = 1, n = 1; t < e.length; t++) {
|
|
857
853
|
let r = e[n - 1], i = e[t];
|
|
858
|
-
r.clock + r.len >= i.clock ? e[n - 1] = new
|
|
854
|
+
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++);
|
|
859
855
|
}
|
|
860
856
|
e.length = n;
|
|
861
857
|
});
|
|
862
|
-
},
|
|
863
|
-
let t = new
|
|
858
|
+
}, zr = (e) => {
|
|
859
|
+
let t = new Fr();
|
|
864
860
|
for (let n = 0; n < e.length; n++) e[n].clients.forEach((r, i) => {
|
|
865
861
|
if (!t.clients.has(i)) {
|
|
866
862
|
let a = r.slice();
|
|
@@ -868,11 +864,11 @@ var Br = {
|
|
|
868
864
|
t.clients.set(i, a);
|
|
869
865
|
}
|
|
870
866
|
});
|
|
871
|
-
return
|
|
872
|
-
},
|
|
873
|
-
n(e.clients, t, () => []).push(new
|
|
874
|
-
},
|
|
875
|
-
let t =
|
|
867
|
+
return Rr(t), t;
|
|
868
|
+
}, Br = (e, t, r, i) => {
|
|
869
|
+
n(e.clients, t, () => []).push(new Pr(r, i));
|
|
870
|
+
}, Vr = () => new Fr(), Hr = (e) => {
|
|
871
|
+
let t = Vr();
|
|
876
872
|
return e.clients.forEach((e, n) => {
|
|
877
873
|
let r = [];
|
|
878
874
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -880,59 +876,59 @@ var Br = {
|
|
|
880
876
|
if (n.deleted) {
|
|
881
877
|
let i = n.id.clock, a = n.length;
|
|
882
878
|
if (t + 1 < e.length) for (let n = e[t + 1]; t + 1 < e.length && n.deleted; n = e[++t + 1]) a += n.length;
|
|
883
|
-
r.push(new
|
|
879
|
+
r.push(new Pr(i, a));
|
|
884
880
|
}
|
|
885
881
|
}
|
|
886
882
|
r.length > 0 && t.clients.set(n, r);
|
|
887
883
|
}), t;
|
|
888
|
-
},
|
|
889
|
-
|
|
890
|
-
e.resetDsCurVal(),
|
|
884
|
+
}, Ur = (e, t) => {
|
|
885
|
+
v(e.restEncoder, t.clients.size), c(t.clients.entries()).sort((e, t) => t[0] - e[0]).forEach(([t, n]) => {
|
|
886
|
+
e.resetDsCurVal(), v(e.restEncoder, t);
|
|
891
887
|
let r = n.length;
|
|
892
|
-
|
|
888
|
+
v(e.restEncoder, r);
|
|
893
889
|
for (let t = 0; t < r; t++) {
|
|
894
890
|
let r = n[t];
|
|
895
891
|
e.writeDsClock(r.clock), e.writeDsLen(r.len);
|
|
896
892
|
}
|
|
897
893
|
});
|
|
898
|
-
},
|
|
899
|
-
let t = new
|
|
894
|
+
}, Wr = (e) => {
|
|
895
|
+
let t = new Fr(), r = E(e.restDecoder);
|
|
900
896
|
for (let i = 0; i < r; i++) {
|
|
901
897
|
e.resetDsCurVal();
|
|
902
|
-
let r =
|
|
898
|
+
let r = E(e.restDecoder), i = E(e.restDecoder);
|
|
903
899
|
if (i > 0) {
|
|
904
900
|
let a = n(t.clients, r, () => []);
|
|
905
|
-
for (let t = 0; t < i; t++) a.push(new
|
|
901
|
+
for (let t = 0; t < i; t++) a.push(new Pr(e.readDsClock(), e.readDsLen()));
|
|
906
902
|
}
|
|
907
903
|
}
|
|
908
904
|
return t;
|
|
909
|
-
},
|
|
910
|
-
let r = new
|
|
905
|
+
}, Gr = (e, t, n) => {
|
|
906
|
+
let r = new Fr(), i = E(e.restDecoder);
|
|
911
907
|
for (let a = 0; a < i; a++) {
|
|
912
908
|
e.resetDsCurVal();
|
|
913
|
-
let i =
|
|
909
|
+
let i = E(e.restDecoder), a = E(e.restDecoder), o = n.clients.get(i) || [], s = B(n, i);
|
|
914
910
|
for (let n = 0; n < a; n++) {
|
|
915
911
|
let n = e.readDsClock(), a = n + e.readDsLen();
|
|
916
912
|
if (n < s) {
|
|
917
|
-
s < a &&
|
|
913
|
+
s < a && Br(r, i, s, a - s);
|
|
918
914
|
let e = V(o, n), c = o[e];
|
|
919
|
-
for (!c.deleted && c.id.clock < n && (o.splice(e + 1, 0,
|
|
920
|
-
} else
|
|
915
|
+
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));
|
|
916
|
+
} else Br(r, i, n, a - n);
|
|
921
917
|
}
|
|
922
918
|
}
|
|
923
919
|
if (r.clients.size > 0) {
|
|
924
920
|
let e = new L();
|
|
925
|
-
return
|
|
921
|
+
return v(e.restEncoder, 0), Ur(e, r), e.toUint8Array();
|
|
926
922
|
}
|
|
927
923
|
return null;
|
|
928
|
-
},
|
|
929
|
-
constructor({ guid: e =
|
|
930
|
-
super(), this.gc = n, this.gcFilter = r, this.clientID =
|
|
924
|
+
}, Kr = at, qr = class e extends p {
|
|
925
|
+
constructor({ guid: e = ct(), collectionid: t = null, gc: n = !0, gcFilter: r = () => !0, meta: i = null, autoLoad: a = !1, shouldLoad: o = !0 } = {}) {
|
|
926
|
+
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) => {
|
|
931
927
|
this.on("load", () => {
|
|
932
928
|
this.isLoaded = !0, e(this);
|
|
933
929
|
});
|
|
934
930
|
});
|
|
935
|
-
let s = () =>
|
|
931
|
+
let s = () => ut((e) => {
|
|
936
932
|
let t = (n) => {
|
|
937
933
|
(n === void 0 || n === !0) && (this.off("sync", t), e());
|
|
938
934
|
};
|
|
@@ -962,30 +958,33 @@ var Br = {
|
|
|
962
958
|
let e = new t();
|
|
963
959
|
return e._integrate(this, null), e;
|
|
964
960
|
}), i = r.constructor;
|
|
965
|
-
if (t !== K && i !== t)
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
961
|
+
if (t !== K && i !== t) {
|
|
962
|
+
if (i === K) {
|
|
963
|
+
let n = new t();
|
|
964
|
+
n._map = r._map, r._map.forEach((e) => {
|
|
965
|
+
for (; e !== null; e = e.left) e.parent = n;
|
|
966
|
+
}), n._start = r._start;
|
|
967
|
+
for (let e = n._start; e !== null; e = e.right) e.parent = n;
|
|
968
|
+
return n._length = r._length, this.share.set(e, n), n._integrate(this, null), n;
|
|
969
|
+
}
|
|
970
|
+
throw Error(`Type with the name ${e} has already been defined with a different constructor`);
|
|
971
|
+
}
|
|
973
972
|
return r;
|
|
974
973
|
}
|
|
975
974
|
getArray(e = "") {
|
|
976
|
-
return this.get(e,
|
|
975
|
+
return this.get(e, Ja);
|
|
977
976
|
}
|
|
978
977
|
getText(e = "") {
|
|
979
|
-
return this.get(e,
|
|
978
|
+
return this.get(e, ho);
|
|
980
979
|
}
|
|
981
980
|
getMap(e = "") {
|
|
982
|
-
return this.get(e,
|
|
981
|
+
return this.get(e, Za);
|
|
983
982
|
}
|
|
984
983
|
getXmlElement(e = "") {
|
|
985
|
-
return this.get(e,
|
|
984
|
+
return this.get(e, bo);
|
|
986
985
|
}
|
|
987
986
|
getXmlFragment(e = "") {
|
|
988
|
-
return this.get(e,
|
|
987
|
+
return this.get(e, vo);
|
|
989
988
|
}
|
|
990
989
|
toJSON() {
|
|
991
990
|
let e = {};
|
|
@@ -1010,55 +1009,55 @@ var Br = {
|
|
|
1010
1009
|
}
|
|
1011
1010
|
this.emit("destroyed", [!0]), this.emit("destroy", [this]), super.destroy();
|
|
1012
1011
|
}
|
|
1013
|
-
},
|
|
1012
|
+
}, Jr = class {
|
|
1014
1013
|
constructor(e) {
|
|
1015
1014
|
this.restDecoder = e;
|
|
1016
1015
|
}
|
|
1017
1016
|
resetDsCurVal() {}
|
|
1018
1017
|
readDsClock() {
|
|
1019
|
-
return
|
|
1018
|
+
return E(this.restDecoder);
|
|
1020
1019
|
}
|
|
1021
1020
|
readDsLen() {
|
|
1022
|
-
return
|
|
1021
|
+
return E(this.restDecoder);
|
|
1023
1022
|
}
|
|
1024
|
-
},
|
|
1023
|
+
}, Yr = class extends Jr {
|
|
1025
1024
|
readLeftID() {
|
|
1026
|
-
return R(
|
|
1025
|
+
return R(E(this.restDecoder), E(this.restDecoder));
|
|
1027
1026
|
}
|
|
1028
1027
|
readRightID() {
|
|
1029
|
-
return R(
|
|
1028
|
+
return R(E(this.restDecoder), E(this.restDecoder));
|
|
1030
1029
|
}
|
|
1031
1030
|
readClient() {
|
|
1032
|
-
return
|
|
1031
|
+
return E(this.restDecoder);
|
|
1033
1032
|
}
|
|
1034
1033
|
readInfo() {
|
|
1035
|
-
return
|
|
1034
|
+
return Je(this.restDecoder);
|
|
1036
1035
|
}
|
|
1037
1036
|
readString() {
|
|
1038
|
-
return
|
|
1037
|
+
return D(this.restDecoder);
|
|
1039
1038
|
}
|
|
1040
1039
|
readParentInfo() {
|
|
1041
|
-
return
|
|
1040
|
+
return E(this.restDecoder) === 1;
|
|
1042
1041
|
}
|
|
1043
1042
|
readTypeRef() {
|
|
1044
|
-
return
|
|
1043
|
+
return E(this.restDecoder);
|
|
1045
1044
|
}
|
|
1046
1045
|
readLen() {
|
|
1047
|
-
return
|
|
1046
|
+
return E(this.restDecoder);
|
|
1048
1047
|
}
|
|
1049
1048
|
readAny() {
|
|
1050
|
-
return
|
|
1049
|
+
return Qe(this.restDecoder);
|
|
1051
1050
|
}
|
|
1052
1051
|
readBuf() {
|
|
1053
|
-
return
|
|
1052
|
+
return Qt(T(this.restDecoder));
|
|
1054
1053
|
}
|
|
1055
1054
|
readJSON() {
|
|
1056
|
-
return JSON.parse(
|
|
1055
|
+
return JSON.parse(D(this.restDecoder));
|
|
1057
1056
|
}
|
|
1058
1057
|
readKey() {
|
|
1059
|
-
return
|
|
1058
|
+
return D(this.restDecoder);
|
|
1060
1059
|
}
|
|
1061
|
-
},
|
|
1060
|
+
}, Xr = class {
|
|
1062
1061
|
constructor(e) {
|
|
1063
1062
|
this.dsCurrVal = 0, this.restDecoder = e;
|
|
1064
1063
|
}
|
|
@@ -1066,21 +1065,21 @@ var Br = {
|
|
|
1066
1065
|
this.dsCurrVal = 0;
|
|
1067
1066
|
}
|
|
1068
1067
|
readDsClock() {
|
|
1069
|
-
return this.dsCurrVal +=
|
|
1068
|
+
return this.dsCurrVal += E(this.restDecoder), this.dsCurrVal;
|
|
1070
1069
|
}
|
|
1071
1070
|
readDsLen() {
|
|
1072
|
-
let e =
|
|
1071
|
+
let e = E(this.restDecoder) + 1;
|
|
1073
1072
|
return this.dsCurrVal += e, e;
|
|
1074
1073
|
}
|
|
1075
|
-
},
|
|
1074
|
+
}, Zr = class extends Xr {
|
|
1076
1075
|
constructor(e) {
|
|
1077
|
-
super(e), this.keys = [],
|
|
1076
|
+
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));
|
|
1078
1077
|
}
|
|
1079
1078
|
readLeftID() {
|
|
1080
|
-
return new
|
|
1079
|
+
return new Ci(this.clientDecoder.read(), this.leftClockDecoder.read());
|
|
1081
1080
|
}
|
|
1082
1081
|
readRightID() {
|
|
1083
|
-
return new
|
|
1082
|
+
return new Ci(this.clientDecoder.read(), this.rightClockDecoder.read());
|
|
1084
1083
|
}
|
|
1085
1084
|
readClient() {
|
|
1086
1085
|
return this.clientDecoder.read();
|
|
@@ -1101,13 +1100,13 @@ var Br = {
|
|
|
1101
1100
|
return this.lenDecoder.read();
|
|
1102
1101
|
}
|
|
1103
1102
|
readAny() {
|
|
1104
|
-
return
|
|
1103
|
+
return Qe(this.restDecoder);
|
|
1105
1104
|
}
|
|
1106
1105
|
readBuf() {
|
|
1107
|
-
return
|
|
1106
|
+
return T(this.restDecoder);
|
|
1108
1107
|
}
|
|
1109
1108
|
readJSON() {
|
|
1110
|
-
return
|
|
1109
|
+
return Qe(this.restDecoder);
|
|
1111
1110
|
}
|
|
1112
1111
|
readKey() {
|
|
1113
1112
|
let e = this.keyClockDecoder.read();
|
|
@@ -1117,81 +1116,81 @@ var Br = {
|
|
|
1117
1116
|
return this.keys.push(e), e;
|
|
1118
1117
|
}
|
|
1119
1118
|
}
|
|
1120
|
-
},
|
|
1119
|
+
}, Qr = class {
|
|
1121
1120
|
constructor() {
|
|
1122
|
-
this.restEncoder =
|
|
1121
|
+
this.restEncoder = xe();
|
|
1123
1122
|
}
|
|
1124
1123
|
toUint8Array() {
|
|
1125
|
-
return
|
|
1124
|
+
return g(this.restEncoder);
|
|
1126
1125
|
}
|
|
1127
1126
|
resetDsCurVal() {}
|
|
1128
1127
|
writeDsClock(e) {
|
|
1129
|
-
|
|
1128
|
+
v(this.restEncoder, e);
|
|
1130
1129
|
}
|
|
1131
1130
|
writeDsLen(e) {
|
|
1132
|
-
|
|
1131
|
+
v(this.restEncoder, e);
|
|
1133
1132
|
}
|
|
1134
|
-
},
|
|
1133
|
+
}, $r = class extends Qr {
|
|
1135
1134
|
writeLeftID(e) {
|
|
1136
|
-
|
|
1135
|
+
v(this.restEncoder, e.client), v(this.restEncoder, e.clock);
|
|
1137
1136
|
}
|
|
1138
1137
|
writeRightID(e) {
|
|
1139
|
-
|
|
1138
|
+
v(this.restEncoder, e.client), v(this.restEncoder, e.clock);
|
|
1140
1139
|
}
|
|
1141
1140
|
writeClient(e) {
|
|
1142
|
-
|
|
1141
|
+
v(this.restEncoder, e);
|
|
1143
1142
|
}
|
|
1144
1143
|
writeInfo(e) {
|
|
1145
|
-
|
|
1144
|
+
Te(this.restEncoder, e);
|
|
1146
1145
|
}
|
|
1147
1146
|
writeString(e) {
|
|
1148
|
-
|
|
1147
|
+
y(this.restEncoder, e);
|
|
1149
1148
|
}
|
|
1150
1149
|
writeParentInfo(e) {
|
|
1151
|
-
|
|
1150
|
+
v(this.restEncoder, +!!e);
|
|
1152
1151
|
}
|
|
1153
1152
|
writeTypeRef(e) {
|
|
1154
|
-
|
|
1153
|
+
v(this.restEncoder, e);
|
|
1155
1154
|
}
|
|
1156
1155
|
writeLen(e) {
|
|
1157
|
-
|
|
1156
|
+
v(this.restEncoder, e);
|
|
1158
1157
|
}
|
|
1159
1158
|
writeAny(e) {
|
|
1160
|
-
|
|
1159
|
+
Ie(this.restEncoder, e);
|
|
1161
1160
|
}
|
|
1162
1161
|
writeBuf(e) {
|
|
1163
|
-
|
|
1162
|
+
b(this.restEncoder, e);
|
|
1164
1163
|
}
|
|
1165
1164
|
writeJSON(e) {
|
|
1166
|
-
|
|
1165
|
+
y(this.restEncoder, JSON.stringify(e));
|
|
1167
1166
|
}
|
|
1168
1167
|
writeKey(e) {
|
|
1169
|
-
|
|
1168
|
+
y(this.restEncoder, e);
|
|
1170
1169
|
}
|
|
1171
|
-
},
|
|
1170
|
+
}, ei = class {
|
|
1172
1171
|
constructor() {
|
|
1173
|
-
this.restEncoder =
|
|
1172
|
+
this.restEncoder = xe(), this.dsCurrVal = 0;
|
|
1174
1173
|
}
|
|
1175
1174
|
toUint8Array() {
|
|
1176
|
-
return
|
|
1175
|
+
return g(this.restEncoder);
|
|
1177
1176
|
}
|
|
1178
1177
|
resetDsCurVal() {
|
|
1179
1178
|
this.dsCurrVal = 0;
|
|
1180
1179
|
}
|
|
1181
1180
|
writeDsClock(e) {
|
|
1182
1181
|
let t = e - this.dsCurrVal;
|
|
1183
|
-
this.dsCurrVal = e,
|
|
1182
|
+
this.dsCurrVal = e, v(this.restEncoder, t);
|
|
1184
1183
|
}
|
|
1185
1184
|
writeDsLen(e) {
|
|
1186
|
-
e === 0 &&
|
|
1185
|
+
e === 0 && C(), v(this.restEncoder, e - 1), this.dsCurrVal += e;
|
|
1187
1186
|
}
|
|
1188
|
-
}, L = class extends
|
|
1187
|
+
}, L = class extends ei {
|
|
1189
1188
|
constructor() {
|
|
1190
|
-
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new
|
|
1189
|
+
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();
|
|
1191
1190
|
}
|
|
1192
1191
|
toUint8Array() {
|
|
1193
|
-
let e =
|
|
1194
|
-
return
|
|
1192
|
+
let e = xe();
|
|
1193
|
+
return v(e, 0), b(e, this.keyClockEncoder.toUint8Array()), b(e, this.clientEncoder.toUint8Array()), b(e, this.leftClockEncoder.toUint8Array()), b(e, this.rightClockEncoder.toUint8Array()), b(e, g(this.infoEncoder)), b(e, this.stringEncoder.toUint8Array()), b(e, g(this.parentInfoEncoder)), b(e, this.typeRefEncoder.toUint8Array()), b(e, this.lenEncoder.toUint8Array()), ke(e, g(this.restEncoder)), g(e);
|
|
1195
1194
|
}
|
|
1196
1195
|
writeLeftID(e) {
|
|
1197
1196
|
this.clientEncoder.write(e.client), this.leftClockEncoder.write(e.clock);
|
|
@@ -1218,38 +1217,38 @@ var Br = {
|
|
|
1218
1217
|
this.lenEncoder.write(e);
|
|
1219
1218
|
}
|
|
1220
1219
|
writeAny(e) {
|
|
1221
|
-
|
|
1220
|
+
Ie(this.restEncoder, e);
|
|
1222
1221
|
}
|
|
1223
1222
|
writeBuf(e) {
|
|
1224
|
-
|
|
1223
|
+
b(this.restEncoder, e);
|
|
1225
1224
|
}
|
|
1226
1225
|
writeJSON(e) {
|
|
1227
|
-
|
|
1226
|
+
Ie(this.restEncoder, e);
|
|
1228
1227
|
}
|
|
1229
1228
|
writeKey(e) {
|
|
1230
1229
|
let t = this.keyMap.get(e);
|
|
1231
1230
|
t === void 0 ? (this.keyClockEncoder.write(this.keyClock++), this.stringEncoder.write(e)) : this.keyClockEncoder.write(t);
|
|
1232
1231
|
}
|
|
1233
|
-
},
|
|
1232
|
+
}, ti = (e, t, n, r) => {
|
|
1234
1233
|
r = h(r, t[0].id.clock);
|
|
1235
1234
|
let i = V(t, r);
|
|
1236
|
-
|
|
1235
|
+
v(e.restEncoder, t.length - i), e.writeClient(n), v(e.restEncoder, r);
|
|
1237
1236
|
let a = t[i];
|
|
1238
1237
|
a.write(e, r - a.id.clock);
|
|
1239
1238
|
for (let n = i + 1; n < t.length; n++) t[n].write(e, 0);
|
|
1240
|
-
},
|
|
1239
|
+
}, ni = (e, t, n) => {
|
|
1241
1240
|
let r = /* @__PURE__ */ new Map();
|
|
1242
1241
|
n.forEach((e, n) => {
|
|
1243
1242
|
B(t, n) > e && r.set(n, e);
|
|
1244
|
-
}),
|
|
1243
|
+
}), Vi(t).forEach((e, t) => {
|
|
1245
1244
|
n.has(t) || r.set(t, 0);
|
|
1246
|
-
}),
|
|
1247
|
-
|
|
1245
|
+
}), v(e.restEncoder, r.size), c(r.entries()).sort((e, t) => t[0] - e[0]).forEach(([n, r]) => {
|
|
1246
|
+
ti(e, t.clients.get(n), n, r);
|
|
1248
1247
|
});
|
|
1249
|
-
},
|
|
1250
|
-
let r = e(), i =
|
|
1248
|
+
}, ri = (t, n) => {
|
|
1249
|
+
let r = e(), i = E(t.restDecoder);
|
|
1251
1250
|
for (let e = 0; e < i; e++) {
|
|
1252
|
-
let e =
|
|
1251
|
+
let e = E(t.restDecoder), i = Array(e), a = t.readClient(), o = E(t.restDecoder);
|
|
1253
1252
|
r.set(a, {
|
|
1254
1253
|
i: 0,
|
|
1255
1254
|
refs: i
|
|
@@ -1263,19 +1262,19 @@ var Br = {
|
|
|
1263
1262
|
break;
|
|
1264
1263
|
}
|
|
1265
1264
|
case 10: {
|
|
1266
|
-
let e =
|
|
1265
|
+
let e = E(t.restDecoder);
|
|
1267
1266
|
i[r] = new $(R(a, o), e), o += e;
|
|
1268
1267
|
break;
|
|
1269
1268
|
}
|
|
1270
1269
|
default: {
|
|
1271
|
-
let s = (e & 192)
|
|
1270
|
+
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));
|
|
1272
1271
|
i[r] = c, o += c.length;
|
|
1273
1272
|
}
|
|
1274
1273
|
}
|
|
1275
1274
|
}
|
|
1276
1275
|
}
|
|
1277
1276
|
return r;
|
|
1278
|
-
},
|
|
1277
|
+
}, ii = (e, t, r) => {
|
|
1279
1278
|
let i = [], a = c(r.keys()).sort((e, t) => e - t);
|
|
1280
1279
|
if (a.length === 0) return null;
|
|
1281
1280
|
let o = () => {
|
|
@@ -1286,7 +1285,7 @@ var Br = {
|
|
|
1286
1285
|
return e;
|
|
1287
1286
|
}, s = o();
|
|
1288
1287
|
if (s === null) return null;
|
|
1289
|
-
let l = new
|
|
1288
|
+
let l = new Bi(), u = /* @__PURE__ */ new Map(), d = (e, t) => {
|
|
1290
1289
|
let n = u.get(e);
|
|
1291
1290
|
(n == null || n > t) && u.set(e, t);
|
|
1292
1291
|
}, f = s.refs[s.i++], p = /* @__PURE__ */ new Map(), ee = () => {
|
|
@@ -1325,15 +1324,15 @@ var Br = {
|
|
|
1325
1324
|
}
|
|
1326
1325
|
if (l.clients.size > 0) {
|
|
1327
1326
|
let e = new L();
|
|
1328
|
-
return
|
|
1327
|
+
return ni(e, l, /* @__PURE__ */ new Map()), v(e.restEncoder, 0), {
|
|
1329
1328
|
missing: u,
|
|
1330
1329
|
update: e.toUint8Array()
|
|
1331
1330
|
};
|
|
1332
1331
|
}
|
|
1333
1332
|
return null;
|
|
1334
|
-
},
|
|
1333
|
+
}, ai = (e, t) => ni(e, t.doc.store, t.beforeState), oi = (e, t, n, r = new Zr(e)) => U(t, (e) => {
|
|
1335
1334
|
e.local = !1;
|
|
1336
|
-
let t = !1, n = e.doc, i = n.store, a =
|
|
1335
|
+
let t = !1, n = e.doc, i = n.store, a = ii(e, i, ri(r, n)), o = i.pendingStructs;
|
|
1337
1336
|
if (o) {
|
|
1338
1337
|
for (let [e, n] of o.missing) if (n < B(i, e)) {
|
|
1339
1338
|
t = !0;
|
|
@@ -1344,99 +1343,99 @@ var Br = {
|
|
|
1344
1343
|
let n = o.missing.get(e);
|
|
1345
1344
|
(n == null || n > t) && o.missing.set(e, t);
|
|
1346
1345
|
}
|
|
1347
|
-
o.update =
|
|
1346
|
+
o.update = ua([o.update, a.update]);
|
|
1348
1347
|
}
|
|
1349
1348
|
} else i.pendingStructs = a;
|
|
1350
|
-
let s =
|
|
1349
|
+
let s = Gr(r, e, i);
|
|
1351
1350
|
if (i.pendingDs) {
|
|
1352
|
-
let t = new
|
|
1353
|
-
|
|
1354
|
-
let n =
|
|
1355
|
-
s && n ?
|
|
1351
|
+
let t = new Zr(w(i.pendingDs));
|
|
1352
|
+
E(t.restDecoder);
|
|
1353
|
+
let n = Gr(t, e, i);
|
|
1354
|
+
i.pendingDs = s && n ? ua([s, n]) : s || n;
|
|
1356
1355
|
} else i.pendingDs = s;
|
|
1357
1356
|
if (t) {
|
|
1358
1357
|
let t = i.pendingStructs.update;
|
|
1359
|
-
i.pendingStructs = null,
|
|
1360
|
-
}
|
|
1361
|
-
}, n, !1),
|
|
1362
|
-
let i =
|
|
1363
|
-
|
|
1364
|
-
},
|
|
1365
|
-
|
|
1366
|
-
},
|
|
1367
|
-
|
|
1358
|
+
i.pendingStructs = null, si(e.doc, t);
|
|
1359
|
+
}
|
|
1360
|
+
}, n, !1), si = (e, t, n, r = Zr) => {
|
|
1361
|
+
let i = w(t);
|
|
1362
|
+
oi(i, e, n, new r(i));
|
|
1363
|
+
}, ci = (e, t, n) => si(e, t, n, Yr), li = (e, t, n = /* @__PURE__ */ new Map()) => {
|
|
1364
|
+
ni(e, t.store, n), Ur(e, Hr(t.store));
|
|
1365
|
+
}, ui = (e, t = new Uint8Array([0]), n = new L()) => {
|
|
1366
|
+
li(n, e, pi(t));
|
|
1368
1367
|
let r = [n.toUint8Array()];
|
|
1369
|
-
if (e.store.pendingDs && r.push(e.store.pendingDs), e.store.pendingStructs && r.push(
|
|
1370
|
-
if (n.constructor ===
|
|
1371
|
-
if (n.constructor === L) return
|
|
1368
|
+
if (e.store.pendingDs && r.push(e.store.pendingDs), e.store.pendingStructs && r.push(da(e.store.pendingStructs.update, t)), r.length > 1) {
|
|
1369
|
+
if (n.constructor === $r) return ca(r.map((e, t) => t === 0 ? e : ha(e)));
|
|
1370
|
+
if (n.constructor === L) return ua(r);
|
|
1372
1371
|
}
|
|
1373
1372
|
return r[0];
|
|
1374
|
-
},
|
|
1375
|
-
let t = /* @__PURE__ */ new Map(), n =
|
|
1373
|
+
}, di = (e, t) => ui(e, t, new $r()), fi = (e) => {
|
|
1374
|
+
let t = /* @__PURE__ */ new Map(), n = E(e.restDecoder);
|
|
1376
1375
|
for (let r = 0; r < n; r++) {
|
|
1377
|
-
let n =
|
|
1376
|
+
let n = E(e.restDecoder), r = E(e.restDecoder);
|
|
1378
1377
|
t.set(n, r);
|
|
1379
1378
|
}
|
|
1380
1379
|
return t;
|
|
1381
|
-
},
|
|
1382
|
-
|
|
1383
|
-
}), e),
|
|
1380
|
+
}, 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]) => {
|
|
1381
|
+
v(e.restEncoder, t), v(e.restEncoder, n);
|
|
1382
|
+
}), 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 {
|
|
1384
1383
|
constructor() {
|
|
1385
1384
|
this.l = [];
|
|
1386
1385
|
}
|
|
1387
|
-
},
|
|
1386
|
+
}, yi = () => new vi(), bi = (e, t) => e.l.push(t), xi = (e, t) => {
|
|
1388
1387
|
let n = e.l, r = n.length;
|
|
1389
1388
|
e.l = n.filter((e) => t !== e), r === e.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
|
|
1390
|
-
},
|
|
1389
|
+
}, Si = (e, t, n) => jt(e.l, [t, n]), Ci = class {
|
|
1391
1390
|
constructor(e, t) {
|
|
1392
1391
|
this.client = e, this.clock = t;
|
|
1393
1392
|
}
|
|
1394
|
-
},
|
|
1393
|
+
}, 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) => {
|
|
1395
1394
|
for (let [t, n] of e.doc.share.entries()) if (n === e) return t;
|
|
1396
|
-
throw
|
|
1397
|
-
},
|
|
1395
|
+
throw C();
|
|
1396
|
+
}, Ei = (e, t) => {
|
|
1398
1397
|
for (; t !== null;) {
|
|
1399
1398
|
if (t.parent === e) return !0;
|
|
1400
1399
|
t = t.parent._item;
|
|
1401
1400
|
}
|
|
1402
1401
|
return !1;
|
|
1403
|
-
},
|
|
1402
|
+
}, Di = class {
|
|
1404
1403
|
constructor(e, t, n, r = 0) {
|
|
1405
1404
|
this.type = e, this.tname = t, this.item = n, this.assoc = r;
|
|
1406
1405
|
}
|
|
1407
|
-
},
|
|
1406
|
+
}, 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 {
|
|
1408
1407
|
constructor(e, t, n = 0) {
|
|
1409
1408
|
this.type = e, this.index = t, this.assoc = n;
|
|
1410
1409
|
}
|
|
1411
|
-
},
|
|
1410
|
+
}, Ai = (e, t, n = 0) => new ki(e, t, n), ji = (e, t, n) => {
|
|
1412
1411
|
let r = null, i = null;
|
|
1413
|
-
return e._item === null ? i =
|
|
1414
|
-
},
|
|
1412
|
+
return e._item === null ? i = Ti(e) : r = R(e._item.id.client, e._item.id.clock), new Di(r, i, t, n);
|
|
1413
|
+
}, Mi = (e, t, n = 0) => {
|
|
1415
1414
|
let r = e._start;
|
|
1416
1415
|
if (n < 0) {
|
|
1417
|
-
if (t === 0) return
|
|
1416
|
+
if (t === 0) return ji(e, null, n);
|
|
1418
1417
|
t--;
|
|
1419
1418
|
}
|
|
1420
1419
|
for (; r !== null;) {
|
|
1421
1420
|
if (!r.deleted && r.countable) {
|
|
1422
|
-
if (r.length > t) return
|
|
1421
|
+
if (r.length > t) return ji(e, R(r.id.client, r.id.clock + t), n);
|
|
1423
1422
|
t -= r.length;
|
|
1424
1423
|
}
|
|
1425
|
-
if (r.right === null && n < 0) return
|
|
1424
|
+
if (r.right === null && n < 0) return ji(e, r.lastId, n);
|
|
1426
1425
|
r = r.right;
|
|
1427
1426
|
}
|
|
1428
|
-
return
|
|
1429
|
-
},
|
|
1430
|
-
let n =
|
|
1427
|
+
return ji(e, null, n);
|
|
1428
|
+
}, Ni = (e, t) => {
|
|
1429
|
+
let n = Ui(e, t);
|
|
1431
1430
|
return {
|
|
1432
1431
|
item: n,
|
|
1433
1432
|
diff: t.clock - n.id.clock
|
|
1434
1433
|
};
|
|
1435
|
-
},
|
|
1434
|
+
}, Pi = (e, t, n = !0) => {
|
|
1436
1435
|
let r = t.store, i = e.item, a = e.type, o = e.tname, s = e.assoc, c = null, l = 0;
|
|
1437
1436
|
if (i !== null) {
|
|
1438
1437
|
if (B(r, i.client) <= i.clock) return null;
|
|
1439
|
-
let e = n ?
|
|
1438
|
+
let e = n ? es(r, i) : Ni(r, i), t = e.item;
|
|
1440
1439
|
if (!(t instanceof Q)) return null;
|
|
1441
1440
|
if (c = t.parent, c._item === null || !c._item.deleted) {
|
|
1442
1441
|
l = t.deleted || !t.countable ? 0 : e.diff + (s >= 0 ? 0 : 1);
|
|
@@ -1447,29 +1446,29 @@ var Br = {
|
|
|
1447
1446
|
if (o !== null) c = t.get(o);
|
|
1448
1447
|
else if (a !== null) {
|
|
1449
1448
|
if (B(r, a.client) <= a.clock) return null;
|
|
1450
|
-
let { item: e } = n ?
|
|
1449
|
+
let { item: e } = n ? es(r, a) : { item: Ui(r, a) };
|
|
1451
1450
|
if (e instanceof Q && e.content instanceof Z) c = e.content.type;
|
|
1452
1451
|
else return null;
|
|
1453
|
-
} else throw
|
|
1452
|
+
} else throw C();
|
|
1454
1453
|
l = s >= 0 ? c._length : 0;
|
|
1455
1454
|
}
|
|
1456
|
-
return
|
|
1457
|
-
},
|
|
1455
|
+
return Ai(c, l, e.assoc);
|
|
1456
|
+
}, 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 {
|
|
1458
1457
|
constructor(e, t) {
|
|
1459
1458
|
this.ds = e, this.sv = t;
|
|
1460
1459
|
}
|
|
1461
|
-
},
|
|
1462
|
-
|
|
1463
|
-
var
|
|
1464
|
-
let r = n(e.meta,
|
|
1460
|
+
}, Li = (e, t) => new Ii(e, t);
|
|
1461
|
+
Li(Vr(), /* @__PURE__ */ new Map());
|
|
1462
|
+
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) => {
|
|
1463
|
+
let r = n(e.meta, zi, a), i = e.doc.store;
|
|
1465
1464
|
r.has(t) || (t.sv.forEach((t, n) => {
|
|
1466
1465
|
t < B(i, n) && H(e, R(n, t));
|
|
1467
1466
|
}), I(e, t.ds, (e) => {}), r.add(t));
|
|
1468
|
-
},
|
|
1467
|
+
}, Bi = class {
|
|
1469
1468
|
constructor() {
|
|
1470
1469
|
this.clients = /* @__PURE__ */ new Map(), this.pendingStructs = null, this.pendingDs = null;
|
|
1471
1470
|
}
|
|
1472
|
-
},
|
|
1471
|
+
}, Vi = (e) => {
|
|
1473
1472
|
let t = /* @__PURE__ */ new Map();
|
|
1474
1473
|
return e.clients.forEach((e, n) => {
|
|
1475
1474
|
let r = e[e.length - 1];
|
|
@@ -1480,12 +1479,12 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1480
1479
|
if (n === void 0) return 0;
|
|
1481
1480
|
let r = n[n.length - 1];
|
|
1482
1481
|
return r.id.clock + r.length;
|
|
1483
|
-
},
|
|
1482
|
+
}, Hi = (e, t) => {
|
|
1484
1483
|
let n = e.clients.get(t.id.client);
|
|
1485
1484
|
if (n === void 0) n = [], e.clients.set(t.id.client, n);
|
|
1486
1485
|
else {
|
|
1487
1486
|
let e = n[n.length - 1];
|
|
1488
|
-
if (e.id.clock + e.length !== t.id.clock) throw
|
|
1487
|
+
if (e.id.clock + e.length !== t.id.clock) throw C();
|
|
1489
1488
|
}
|
|
1490
1489
|
n.push(t);
|
|
1491
1490
|
}, V = (e, t) => {
|
|
@@ -1499,36 +1498,36 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1499
1498
|
} else r = o - 1;
|
|
1500
1499
|
o = m((n + r) / 2);
|
|
1501
1500
|
}
|
|
1502
|
-
throw
|
|
1503
|
-
},
|
|
1501
|
+
throw C();
|
|
1502
|
+
}, Ui = (e, t) => {
|
|
1504
1503
|
let n = e.clients.get(t.client);
|
|
1505
1504
|
return n[V(n, t.clock)];
|
|
1506
|
-
},
|
|
1505
|
+
}, Wi = (e, t, n) => {
|
|
1507
1506
|
let r = V(t, n), i = t[r];
|
|
1508
|
-
return i.id.clock < n && i instanceof Q ? (t.splice(r + 1, 0,
|
|
1507
|
+
return i.id.clock < n && i instanceof Q ? (t.splice(r + 1, 0, ns(e, i, n - i.id.clock)), r + 1) : r;
|
|
1509
1508
|
}, H = (e, t) => {
|
|
1510
1509
|
let n = e.doc.store.clients.get(t.client);
|
|
1511
|
-
return n[
|
|
1512
|
-
},
|
|
1510
|
+
return n[Wi(e, n, t.clock)];
|
|
1511
|
+
}, Gi = (e, t, n) => {
|
|
1513
1512
|
let r = t.clients.get(n.client), i = V(r, n.clock), a = r[i];
|
|
1514
|
-
return n.clock !== a.id.clock + a.length - 1 && a.constructor !== J && r.splice(i + 1, 0,
|
|
1515
|
-
},
|
|
1513
|
+
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;
|
|
1514
|
+
}, Ki = (e, t, n) => {
|
|
1516
1515
|
let r = e.clients.get(t.id.client);
|
|
1517
1516
|
r[V(r, t.id.clock)] = n;
|
|
1518
|
-
},
|
|
1517
|
+
}, qi = (e, t, n, r, i) => {
|
|
1519
1518
|
if (r === 0) return;
|
|
1520
|
-
let a = n + r, o =
|
|
1519
|
+
let a = n + r, o = Wi(e, t, n), s;
|
|
1521
1520
|
do
|
|
1522
|
-
s = t[o++], a < s.id.clock + s.length &&
|
|
1521
|
+
s = t[o++], a < s.id.clock + s.length && Wi(e, t, a), i(s);
|
|
1523
1522
|
while (o < t.length && t[o].id.clock < a);
|
|
1524
|
-
},
|
|
1523
|
+
}, Ji = class {
|
|
1525
1524
|
constructor(e, t, n) {
|
|
1526
|
-
this.doc = e, this.deleteSet = new
|
|
1525
|
+
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;
|
|
1527
1526
|
}
|
|
1528
|
-
},
|
|
1527
|
+
}, 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) => {
|
|
1529
1528
|
let i = t._item;
|
|
1530
1529
|
(i === null || i.id.clock < (e.beforeState.get(i.id.client) || 0) && !i.deleted) && n(e.changed, t, a).add(r);
|
|
1531
|
-
},
|
|
1530
|
+
}, Zi = (e, t) => {
|
|
1532
1531
|
let n = e[t], r = e[t - 1], i = t;
|
|
1533
1532
|
for (; i > 0; n = r, r = e[--i - 1]) {
|
|
1534
1533
|
if (r.deleted === n.deleted && r.constructor === n.constructor && r.mergeWith(n)) {
|
|
@@ -1539,7 +1538,7 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1539
1538
|
}
|
|
1540
1539
|
let a = t - i;
|
|
1541
1540
|
return a && e.splice(t + 1 - a, a), a;
|
|
1542
|
-
},
|
|
1541
|
+
}, Qi = (e, t, n) => {
|
|
1543
1542
|
for (let [r, i] of e.clients.entries()) {
|
|
1544
1543
|
let e = t.clients.get(r);
|
|
1545
1544
|
for (let r = i.length - 1; r >= 0; r--) {
|
|
@@ -1551,19 +1550,19 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1551
1550
|
}
|
|
1552
1551
|
}
|
|
1553
1552
|
}
|
|
1554
|
-
},
|
|
1553
|
+
}, $i = (e, t) => {
|
|
1555
1554
|
e.clients.forEach((e, n) => {
|
|
1556
1555
|
let r = t.clients.get(n);
|
|
1557
1556
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
1558
1557
|
let n = e[t], i = ne(r.length - 1, 1 + V(r, n.clock + n.len - 1));
|
|
1559
|
-
for (let e = i, t = r[e]; e > 0 && t.id.clock >= n.clock; t = r[e]) e -= 1 +
|
|
1558
|
+
for (let e = i, t = r[e]; e > 0 && t.id.clock >= n.clock; t = r[e]) e -= 1 + Zi(r, e);
|
|
1560
1559
|
}
|
|
1561
1560
|
});
|
|
1562
|
-
},
|
|
1561
|
+
}, ea = (e, t) => {
|
|
1563
1562
|
if (t < e.length) {
|
|
1564
1563
|
let n = e[t], r = n.doc, i = r.store, a = n.deleteSet, o = n._mergeStructs;
|
|
1565
1564
|
try {
|
|
1566
|
-
|
|
1565
|
+
Rr(a), n.afterState = Vi(n.doc.store), r.emit("beforeObserverCalls", [n, r]);
|
|
1567
1566
|
let e = [];
|
|
1568
1567
|
n.changed.forEach((t, r) => e.push(() => {
|
|
1569
1568
|
(r._item === null || !r._item.deleted) && r._callObserver(n, t);
|
|
@@ -1572,27 +1571,27 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1572
1571
|
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) => {
|
|
1573
1572
|
e.currentTarget = r, e._path = null;
|
|
1574
1573
|
}), t.sort((e, t) => e.path.length - t.path.length), e.push(() => {
|
|
1575
|
-
|
|
1574
|
+
Si(r._dEH, t, n);
|
|
1576
1575
|
}));
|
|
1577
1576
|
}), e.push(() => r.emit("afterTransaction", [n, r])), e.push(() => {
|
|
1578
|
-
n._needFormattingCleanup &&
|
|
1577
|
+
n._needFormattingCleanup && fo(n);
|
|
1579
1578
|
});
|
|
1580
|
-
}),
|
|
1579
|
+
}), jt(e, []);
|
|
1581
1580
|
} finally {
|
|
1582
|
-
r.gc &&
|
|
1581
|
+
r.gc && Qi(a, i, r.gcFilter), $i(a, i), n.afterState.forEach((e, t) => {
|
|
1583
1582
|
let r = n.beforeState.get(t) || 0;
|
|
1584
1583
|
if (r !== e) {
|
|
1585
1584
|
let e = i.clients.get(t), n = h(V(e, r), 1);
|
|
1586
|
-
for (let t = e.length - 1; t >= n;) t -= 1 +
|
|
1585
|
+
for (let t = e.length - 1; t >= n;) t -= 1 + Zi(e, t);
|
|
1587
1586
|
}
|
|
1588
1587
|
});
|
|
1589
1588
|
for (let e = o.length - 1; e >= 0; e--) {
|
|
1590
1589
|
let { client: t, clock: n } = o[e].id, r = i.clients.get(t), a = V(r, n);
|
|
1591
|
-
a + 1 < r.length &&
|
|
1590
|
+
a + 1 < r.length && Zi(r, a + 1) > 1 || a > 0 && Zi(r, a);
|
|
1592
1591
|
}
|
|
1593
|
-
if (!n.local && n.afterState.get(r.clientID) !== n.beforeState.get(r.clientID) && (
|
|
1594
|
-
let e = new
|
|
1595
|
-
|
|
1592
|
+
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")) {
|
|
1593
|
+
let e = new $r();
|
|
1594
|
+
Yi(e, n) && r.emit("update", [
|
|
1596
1595
|
e.toUint8Array(),
|
|
1597
1596
|
n.origin,
|
|
1598
1597
|
r,
|
|
@@ -1601,7 +1600,7 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1601
1600
|
}
|
|
1602
1601
|
if (r._observers.has("updateV2")) {
|
|
1603
1602
|
let e = new L();
|
|
1604
|
-
|
|
1603
|
+
Yi(e, n) && r.emit("updateV2", [
|
|
1605
1604
|
e.toUint8Array(),
|
|
1606
1605
|
n.origin,
|
|
1607
1606
|
r,
|
|
@@ -1619,30 +1618,30 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1619
1618
|
},
|
|
1620
1619
|
r,
|
|
1621
1620
|
n
|
|
1622
|
-
]), l.forEach((e) => e.destroy())), e.length <= t + 1 ? (r._transactionCleanups = [], r.emit("afterAllTransactions", [r, e])) :
|
|
1621
|
+
]), l.forEach((e) => e.destroy())), e.length <= t + 1 ? (r._transactionCleanups = [], r.emit("afterAllTransactions", [r, e])) : ea(e, t + 1);
|
|
1623
1622
|
}
|
|
1624
1623
|
}
|
|
1625
1624
|
}, U = (e, t, n = null, r = !0) => {
|
|
1626
1625
|
let i = e._transactionCleanups, a = !1, o = null;
|
|
1627
|
-
e._transaction === null && (a = !0, e._transaction = new
|
|
1626
|
+
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]));
|
|
1628
1627
|
try {
|
|
1629
1628
|
o = t(e._transaction);
|
|
1630
1629
|
} finally {
|
|
1631
1630
|
if (a) {
|
|
1632
1631
|
let t = e._transaction === i[0];
|
|
1633
|
-
e._transaction = null, t &&
|
|
1632
|
+
e._transaction = null, t && ea(i, 0);
|
|
1634
1633
|
}
|
|
1635
1634
|
}
|
|
1636
1635
|
return o;
|
|
1637
|
-
},
|
|
1636
|
+
}, ta = class {
|
|
1638
1637
|
constructor(e, t) {
|
|
1639
1638
|
this.insertions = t, this.deletions = e, this.meta = /* @__PURE__ */ new Map();
|
|
1640
1639
|
}
|
|
1641
|
-
},
|
|
1640
|
+
}, na = (e, t, n) => {
|
|
1642
1641
|
I(e, n.deletions, (n) => {
|
|
1643
|
-
n instanceof Q && t.scope.some((t) => t === e.doc ||
|
|
1642
|
+
n instanceof Q && t.scope.some((t) => t === e.doc || Ei(t, n)) && ts(n, !1);
|
|
1644
1643
|
});
|
|
1645
|
-
},
|
|
1644
|
+
}, ra = (e, t, n) => {
|
|
1646
1645
|
let r = null, i = e.doc, a = e.scope;
|
|
1647
1646
|
U(i, (n) => {
|
|
1648
1647
|
for (; t.length > 0 && e.currStackItem === null;) {
|
|
@@ -1650,15 +1649,15 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1650
1649
|
I(n, o.insertions, (e) => {
|
|
1651
1650
|
if (e instanceof Q) {
|
|
1652
1651
|
if (e.redone !== null) {
|
|
1653
|
-
let { item: t, diff: i } =
|
|
1652
|
+
let { item: t, diff: i } = es(r, e.id);
|
|
1654
1653
|
i > 0 && (t = H(n, R(t.id.client, t.id.clock + i))), e = t;
|
|
1655
1654
|
}
|
|
1656
|
-
!e.deleted && a.some((t) => t === n.doc ||
|
|
1655
|
+
!e.deleted && a.some((t) => t === n.doc || Ei(t, e)) && c.push(e);
|
|
1657
1656
|
}
|
|
1658
1657
|
}), I(n, o.deletions, (e) => {
|
|
1659
|
-
e instanceof Q && a.some((t) => t === n.doc ||
|
|
1658
|
+
e instanceof Q && a.some((t) => t === n.doc || Ei(t, e)) && !Lr(o.insertions, e.id) && s.add(e);
|
|
1660
1659
|
}), s.forEach((t) => {
|
|
1661
|
-
l =
|
|
1660
|
+
l = is(n, t, s, o.insertions, e.ignoreRemoteMapChanges, e) !== null || l;
|
|
1662
1661
|
});
|
|
1663
1662
|
for (let t = c.length - 1; t >= 0; t--) {
|
|
1664
1663
|
let r = c[t];
|
|
@@ -1681,24 +1680,24 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1681
1680
|
}, e]), e.currStackItem = null;
|
|
1682
1681
|
}
|
|
1683
1682
|
return o;
|
|
1684
|
-
},
|
|
1685
|
-
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
|
|
1683
|
+
}, ia = class extends p {
|
|
1684
|
+
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 } = {}) {
|
|
1686
1685
|
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) => {
|
|
1687
1686
|
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;
|
|
1688
1687
|
let t = this.undoing, n = this.redoing, r = t ? this.redoStack : this.undoStack;
|
|
1689
1688
|
t ? this.stopCapturing() : n || this.clear(!1, !0);
|
|
1690
|
-
let i = new
|
|
1689
|
+
let i = new Fr();
|
|
1691
1690
|
e.afterState.forEach((t, n) => {
|
|
1692
1691
|
let r = e.beforeState.get(n) || 0, a = t - r;
|
|
1693
|
-
a > 0 &&
|
|
1692
|
+
a > 0 && Br(i, n, r, a);
|
|
1694
1693
|
});
|
|
1695
|
-
let a =
|
|
1694
|
+
let a = lt(), o = !1;
|
|
1696
1695
|
if (this.lastChange > 0 && a - this.lastChange < this.captureTimeout && r.length > 0 && !t && !n) {
|
|
1697
1696
|
let t = r[r.length - 1];
|
|
1698
|
-
t.deletions =
|
|
1699
|
-
} else r.push(new
|
|
1697
|
+
t.deletions = zr([t.deletions, e.deleteSet]), t.insertions = zr([t.insertions, i]);
|
|
1698
|
+
} else r.push(new ta(e.deleteSet, i)), o = !0;
|
|
1700
1699
|
!t && !n && (this.lastChange = a), I(e, e.deleteSet, (t) => {
|
|
1701
|
-
t instanceof Q && this.scope.some((n) => n === e.doc ||
|
|
1700
|
+
t instanceof Q && this.scope.some((n) => n === e.doc || Ei(n, t)) && ts(t, !0);
|
|
1702
1701
|
});
|
|
1703
1702
|
let s = [{
|
|
1704
1703
|
stackItem: r[r.length - 1],
|
|
@@ -1707,14 +1706,12 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1707
1706
|
changedParentTypes: e.changedParentTypes
|
|
1708
1707
|
}, this];
|
|
1709
1708
|
o ? this.emit("stack-item-added", s) : this.emit("stack-item-updated", s);
|
|
1710
|
-
}, this.doc.on("afterTransaction", this.afterTransactionHandler), this.doc.on("destroy",
|
|
1711
|
-
this.destroy();
|
|
1712
|
-
});
|
|
1709
|
+
}, this.destroy = this.destroy.bind(this), this.doc.on("afterTransaction", this.afterTransactionHandler), this.doc.on("destroy", this.destroy);
|
|
1713
1710
|
}
|
|
1714
1711
|
addToScope(e) {
|
|
1715
1712
|
let t = new Set(this.scope);
|
|
1716
1713
|
e = f(e) ? e : [e], e.forEach((e) => {
|
|
1717
|
-
t.has(e) || (t.add(e), (e instanceof K ? e.doc !== this.doc : e !== this.doc) &&
|
|
1714
|
+
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));
|
|
1718
1715
|
});
|
|
1719
1716
|
}
|
|
1720
1717
|
addTrackedOrigin(e) {
|
|
@@ -1725,7 +1722,7 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1725
1722
|
}
|
|
1726
1723
|
clear(e = !0, t = !0) {
|
|
1727
1724
|
(e && this.canUndo() || t && this.canRedo()) && this.doc.transact((n) => {
|
|
1728
|
-
e && (this.undoStack.forEach((e) =>
|
|
1725
|
+
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", [{
|
|
1729
1726
|
undoStackCleared: e,
|
|
1730
1727
|
redoStackCleared: t
|
|
1731
1728
|
}]);
|
|
@@ -1738,7 +1735,7 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1738
1735
|
this.undoing = !0;
|
|
1739
1736
|
let e;
|
|
1740
1737
|
try {
|
|
1741
|
-
e =
|
|
1738
|
+
e = ra(this, this.undoStack, "undo");
|
|
1742
1739
|
} finally {
|
|
1743
1740
|
this.undoing = !1;
|
|
1744
1741
|
}
|
|
@@ -1748,7 +1745,7 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1748
1745
|
this.redoing = !0;
|
|
1749
1746
|
let e;
|
|
1750
1747
|
try {
|
|
1751
|
-
e =
|
|
1748
|
+
e = ra(this, this.redoStack, "redo");
|
|
1752
1749
|
} finally {
|
|
1753
1750
|
this.redoing = !1;
|
|
1754
1751
|
}
|
|
@@ -1761,20 +1758,20 @@ var Qi = (e) => Zi(ni(e.store), ta(e.store)), z = (e, t) => t === void 0 ? !e.de
|
|
|
1761
1758
|
return this.redoStack.length > 0;
|
|
1762
1759
|
}
|
|
1763
1760
|
destroy() {
|
|
1764
|
-
this.trackedOrigins.delete(this), this.doc.off("afterTransaction", this.afterTransactionHandler), super.destroy();
|
|
1761
|
+
this.trackedOrigins.delete(this), this.doc.off("afterTransaction", this.afterTransactionHandler), this.doc.off("destroy", this.destroy), super.destroy();
|
|
1765
1762
|
}
|
|
1766
1763
|
};
|
|
1767
|
-
function*
|
|
1768
|
-
let t =
|
|
1764
|
+
function* aa(e) {
|
|
1765
|
+
let t = E(e.restDecoder);
|
|
1769
1766
|
for (let n = 0; n < t; n++) {
|
|
1770
|
-
let t =
|
|
1767
|
+
let t = E(e.restDecoder), n = e.readClient(), r = E(e.restDecoder);
|
|
1771
1768
|
for (let i = 0; i < t; i++) {
|
|
1772
1769
|
let t = e.readInfo();
|
|
1773
1770
|
if (t === 10) {
|
|
1774
|
-
let t =
|
|
1771
|
+
let t = E(e.restDecoder);
|
|
1775
1772
|
yield new $(R(n, r), t), r += t;
|
|
1776
1773
|
} else if (31 & t) {
|
|
1777
|
-
let i = (t & 192)
|
|
1774
|
+
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));
|
|
1778
1775
|
yield a, r += a.length;
|
|
1779
1776
|
} else {
|
|
1780
1777
|
let t = e.readLen();
|
|
@@ -1783,9 +1780,9 @@ function* ya(e) {
|
|
|
1783
1780
|
}
|
|
1784
1781
|
}
|
|
1785
1782
|
}
|
|
1786
|
-
var
|
|
1783
|
+
var oa = class {
|
|
1787
1784
|
constructor(e, t) {
|
|
1788
|
-
this.gen =
|
|
1785
|
+
this.gen = aa(e), this.curr = null, this.done = !1, this.filterSkips = t, this.next();
|
|
1789
1786
|
}
|
|
1790
1787
|
next() {
|
|
1791
1788
|
do
|
|
@@ -1793,29 +1790,32 @@ var ba = class {
|
|
|
1793
1790
|
while (this.filterSkips && this.curr !== null && this.curr.constructor === $);
|
|
1794
1791
|
return this.curr;
|
|
1795
1792
|
}
|
|
1796
|
-
},
|
|
1793
|
+
}, sa = class {
|
|
1797
1794
|
constructor(e) {
|
|
1798
1795
|
this.currClient = 0, this.startClock = 0, this.written = 0, this.encoder = e, this.clientStructs = [];
|
|
1799
1796
|
}
|
|
1800
|
-
},
|
|
1797
|
+
}, ca = (e) => ua(e, Yr, $r), la = (e, t) => {
|
|
1801
1798
|
if (e.constructor === J) {
|
|
1802
1799
|
let { client: n, clock: r } = e.id;
|
|
1803
1800
|
return new J(R(n, r + t), e.length - t);
|
|
1804
|
-
}
|
|
1801
|
+
}
|
|
1802
|
+
if (e.constructor === $) {
|
|
1805
1803
|
let { client: n, clock: r } = e.id;
|
|
1806
1804
|
return new $(R(n, r + t), e.length - t);
|
|
1807
|
-
}
|
|
1805
|
+
}
|
|
1806
|
+
{
|
|
1808
1807
|
let n = e, { client: r, clock: i } = n.id;
|
|
1809
1808
|
return new Q(R(r, i + t), null, R(r, i + t - 1), null, n.rightOrigin, n.parent, n.parentSub, n.content.splice(t));
|
|
1810
1809
|
}
|
|
1811
|
-
},
|
|
1810
|
+
}, ua = (e, t = Zr, n = L) => {
|
|
1812
1811
|
if (e.length === 1) return e[0];
|
|
1813
|
-
let r = e.map((e) => new t(
|
|
1812
|
+
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);
|
|
1814
1813
|
for (; i = i.filter((e) => e.curr !== null), i.sort((e, t) => {
|
|
1815
1814
|
if (e.curr.id.client === t.curr.id.client) {
|
|
1816
1815
|
let n = e.curr.id.clock - t.curr.id.clock;
|
|
1817
1816
|
return n === 0 ? e.curr.constructor === t.curr.constructor ? 0 : e.curr.constructor === $ ? 1 : -1 : n;
|
|
1818
|
-
}
|
|
1817
|
+
}
|
|
1818
|
+
return t.curr.id.client - e.curr.id.client;
|
|
1819
1819
|
}), i.length !== 0;) {
|
|
1820
1820
|
let e = i[0], t = e.curr.id.client;
|
|
1821
1821
|
if (a !== null) {
|
|
@@ -1826,18 +1826,19 @@ var ba = class {
|
|
|
1826
1826
|
struct: n,
|
|
1827
1827
|
offset: 0
|
|
1828
1828
|
}, e.next();
|
|
1829
|
-
else if (a.struct.id.clock + a.struct.length < n.id.clock)
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1829
|
+
else if (a.struct.id.clock + a.struct.length < n.id.clock) {
|
|
1830
|
+
if (a.struct.constructor === $) a.struct.length = n.id.clock + n.length - a.struct.id.clock;
|
|
1831
|
+
else {
|
|
1832
|
+
W(s, a.struct, a.offset);
|
|
1833
|
+
let e = n.id.clock - a.struct.id.clock - a.struct.length;
|
|
1834
|
+
a = {
|
|
1835
|
+
struct: new $(R(t, a.struct.id.clock + a.struct.length), e),
|
|
1836
|
+
offset: 0
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
} else {
|
|
1839
1840
|
let t = a.struct.id.clock + a.struct.length - n.id.clock;
|
|
1840
|
-
t > 0 && (a.struct.constructor === $ ? a.struct.length -= t : n =
|
|
1841
|
+
t > 0 && (a.struct.constructor === $ ? a.struct.length -= t : n = la(n, t)), a.struct.mergeWith(n) || (W(s, a.struct, a.offset), a = {
|
|
1841
1842
|
struct: n,
|
|
1842
1843
|
offset: 0
|
|
1843
1844
|
}, e.next());
|
|
@@ -1851,9 +1852,9 @@ var ba = class {
|
|
|
1851
1852
|
offset: 0
|
|
1852
1853
|
};
|
|
1853
1854
|
}
|
|
1854
|
-
return a !== null && (W(s, a.struct, a.offset), a = null),
|
|
1855
|
-
},
|
|
1856
|
-
let i =
|
|
1855
|
+
return a !== null && (W(s, a.struct, a.offset), a = null), pa(s), Ur(o, zr(r.map((e) => Wr(e)))), o.toUint8Array();
|
|
1856
|
+
}, da = (e, t, n = Zr, r = L) => {
|
|
1857
|
+
let i = pi(t), a = new r(), o = new sa(a), s = new n(w(e)), c = new oa(s, !1);
|
|
1857
1858
|
for (; c.curr;) {
|
|
1858
1859
|
let e = c.curr, t = e.id.client, n = i.get(t) || 0;
|
|
1859
1860
|
if (c.curr.constructor === $) {
|
|
@@ -1863,39 +1864,39 @@ var ba = class {
|
|
|
1863
1864
|
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();
|
|
1864
1865
|
else for (; c.curr && c.curr.id.client === t && c.curr.id.clock + c.curr.length <= n;) c.next();
|
|
1865
1866
|
}
|
|
1866
|
-
return
|
|
1867
|
-
},
|
|
1867
|
+
return pa(o), Ur(a, Wr(s)), a.toUint8Array();
|
|
1868
|
+
}, fa = (e) => {
|
|
1868
1869
|
e.written > 0 && (e.clientStructs.push({
|
|
1869
1870
|
written: e.written,
|
|
1870
|
-
restEncoder:
|
|
1871
|
-
}), e.encoder.restEncoder =
|
|
1871
|
+
restEncoder: g(e.encoder.restEncoder)
|
|
1872
|
+
}), e.encoder.restEncoder = xe(), e.written = 0);
|
|
1872
1873
|
}, W = (e, t, n) => {
|
|
1873
|
-
e.written > 0 && e.currClient !== t.id.client &&
|
|
1874
|
-
},
|
|
1875
|
-
|
|
1874
|
+
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++;
|
|
1875
|
+
}, pa = (e) => {
|
|
1876
|
+
fa(e);
|
|
1876
1877
|
let t = e.encoder.restEncoder;
|
|
1877
|
-
|
|
1878
|
+
v(t, e.clientStructs.length);
|
|
1878
1879
|
for (let n = 0; n < e.clientStructs.length; n++) {
|
|
1879
1880
|
let r = e.clientStructs[n];
|
|
1880
|
-
|
|
1881
|
+
v(t, r.written), ke(t, r.restEncoder);
|
|
1881
1882
|
}
|
|
1882
|
-
},
|
|
1883
|
-
let i = new n(
|
|
1883
|
+
}, ma = (e, t, n, r) => {
|
|
1884
|
+
let i = new n(w(e)), a = new oa(i, !1), o = new r(), s = new sa(o);
|
|
1884
1885
|
for (let e = a.curr; e !== null; e = a.next()) W(s, t(e), 0);
|
|
1885
|
-
return
|
|
1886
|
-
},
|
|
1886
|
+
return pa(s), Ur(o, Wr(i)), o.toUint8Array();
|
|
1887
|
+
}, ha = (e) => ma(e, Mt, Zr, $r), ga = "You must not compute changes after the event-handler fired.", _a = class {
|
|
1887
1888
|
constructor(e, t) {
|
|
1888
1889
|
this.target = e, this.currentTarget = e, this.transaction = t, this._changes = null, this._keys = null, this._delta = null, this._path = null;
|
|
1889
1890
|
}
|
|
1890
1891
|
get path() {
|
|
1891
|
-
return this._path ||=
|
|
1892
|
+
return this._path ||= va(this.currentTarget, this.target);
|
|
1892
1893
|
}
|
|
1893
1894
|
deletes(e) {
|
|
1894
|
-
return
|
|
1895
|
+
return Lr(this.transaction.deleteSet, e.id);
|
|
1895
1896
|
}
|
|
1896
1897
|
get keys() {
|
|
1897
1898
|
if (this._keys === null) {
|
|
1898
|
-
if (this.transaction.doc._transactionCleanups.length === 0) throw
|
|
1899
|
+
if (this.transaction.doc._transactionCleanups.length === 0) throw x(ga);
|
|
1899
1900
|
let e = /* @__PURE__ */ new Map(), t = this.target;
|
|
1900
1901
|
this.transaction.changed.get(t).forEach((n) => {
|
|
1901
1902
|
if (n !== null) {
|
|
@@ -1903,9 +1904,10 @@ var ba = class {
|
|
|
1903
1904
|
if (this.adds(r)) {
|
|
1904
1905
|
let e = r.left;
|
|
1905
1906
|
for (; e !== null && this.adds(e);) e = e.left;
|
|
1906
|
-
if (this.deletes(r))
|
|
1907
|
-
|
|
1908
|
-
|
|
1907
|
+
if (this.deletes(r)) {
|
|
1908
|
+
if (e !== null && this.deletes(e)) i = "delete", a = o(e.content.getContent());
|
|
1909
|
+
else return;
|
|
1910
|
+
} else e !== null && this.deletes(e) ? (i = "update", a = o(e.content.getContent())) : (i = "add", a = void 0);
|
|
1909
1911
|
} else if (this.deletes(r)) i = "delete", a = o(r.content.getContent());
|
|
1910
1912
|
else return;
|
|
1911
1913
|
e.set(n, {
|
|
@@ -1926,7 +1928,7 @@ var ba = class {
|
|
|
1926
1928
|
get changes() {
|
|
1927
1929
|
let e = this._changes;
|
|
1928
1930
|
if (e === null) {
|
|
1929
|
-
if (this.transaction.doc._transactionCleanups.length === 0) throw
|
|
1931
|
+
if (this.transaction.doc._transactionCleanups.length === 0) throw x(ga);
|
|
1930
1932
|
let t = this.target, n = a(), r = a(), i = [];
|
|
1931
1933
|
if (e = {
|
|
1932
1934
|
added: n,
|
|
@@ -1944,7 +1946,7 @@ var ba = class {
|
|
|
1944
1946
|
}
|
|
1945
1947
|
return e;
|
|
1946
1948
|
}
|
|
1947
|
-
},
|
|
1949
|
+
}, va = (e, t) => {
|
|
1948
1950
|
let n = [];
|
|
1949
1951
|
for (; t._item !== null && t !== e;) {
|
|
1950
1952
|
if (t._item.parentSub !== null) n.unshift(t._item.parentSub);
|
|
@@ -1957,27 +1959,28 @@ var ba = class {
|
|
|
1957
1959
|
}
|
|
1958
1960
|
return n;
|
|
1959
1961
|
}, G = () => {
|
|
1960
|
-
|
|
1961
|
-
},
|
|
1962
|
+
kr("Invalid access: Add Yjs type to a document before reading data.");
|
|
1963
|
+
}, ya = 80, ba = 0, xa = class {
|
|
1962
1964
|
constructor(e, t) {
|
|
1963
|
-
e.marker = !0, this.p = e, this.index = t, this.timestamp =
|
|
1964
|
-
}
|
|
1965
|
-
},
|
|
1966
|
-
e.timestamp =
|
|
1967
|
-
},
|
|
1968
|
-
e.p.marker = !1, e.p = t, t.marker = !0, e.index = n, e.timestamp =
|
|
1969
|
-
},
|
|
1970
|
-
if (e.length >=
|
|
1965
|
+
e.marker = !0, this.p = e, this.index = t, this.timestamp = ba++;
|
|
1966
|
+
}
|
|
1967
|
+
}, Sa = (e) => {
|
|
1968
|
+
e.timestamp = ba++;
|
|
1969
|
+
}, Ca = (e, t, n) => {
|
|
1970
|
+
e.p.marker = !1, e.p = t, t.marker = !0, e.index = n, e.timestamp = ba++;
|
|
1971
|
+
}, wa = (e, t, n) => {
|
|
1972
|
+
if (e.length >= ya) {
|
|
1971
1973
|
let r = e.reduce((e, t) => e.timestamp < t.timestamp ? e : t);
|
|
1972
|
-
return
|
|
1973
|
-
}
|
|
1974
|
-
|
|
1974
|
+
return Ca(r, t, n), r;
|
|
1975
|
+
}
|
|
1976
|
+
{
|
|
1977
|
+
let r = new xa(t, n);
|
|
1975
1978
|
return e.push(r), r;
|
|
1976
1979
|
}
|
|
1977
|
-
},
|
|
1980
|
+
}, Ta = (e, t) => {
|
|
1978
1981
|
if (e._start === null || t === 0 || e._searchMarker === null) return null;
|
|
1979
1982
|
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;
|
|
1980
|
-
for (n !== null && (r = n.p, i = n.index,
|
|
1983
|
+
for (n !== null && (r = n.p, i = n.index, Sa(n)); r.right !== null && i < t;) {
|
|
1981
1984
|
if (!r.deleted && r.countable) {
|
|
1982
1985
|
if (t < i + r.length) break;
|
|
1983
1986
|
i += r.length;
|
|
@@ -1986,8 +1989,8 @@ var ba = class {
|
|
|
1986
1989
|
}
|
|
1987
1990
|
for (; r.left !== null && i > t;) r = r.left, !r.deleted && r.countable && (i -= r.length);
|
|
1988
1991
|
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);
|
|
1989
|
-
return n !== null && te(n.index - i) < r.parent.length /
|
|
1990
|
-
},
|
|
1992
|
+
return n !== null && te(n.index - i) < r.parent.length / ya ? (Ca(n, r, i), n) : wa(e._searchMarker, r, i);
|
|
1993
|
+
}, Ea = (e, t, n) => {
|
|
1991
1994
|
for (let r = e.length - 1; r >= 0; r--) {
|
|
1992
1995
|
let i = e[r];
|
|
1993
1996
|
if (n > 0) {
|
|
@@ -2001,13 +2004,13 @@ var ba = class {
|
|
|
2001
2004
|
}
|
|
2002
2005
|
(t < i.index || n > 0 && t === i.index) && (i.index = h(t, i.index + n));
|
|
2003
2006
|
}
|
|
2004
|
-
},
|
|
2007
|
+
}, Da = (e, t, r) => {
|
|
2005
2008
|
let i = e, a = t.changedParentTypes;
|
|
2006
2009
|
for (; n(a, e, () => []).push(r), e._item !== null;) e = e._item.parent;
|
|
2007
|
-
|
|
2010
|
+
Si(i._eH, r, t);
|
|
2008
2011
|
}, K = class {
|
|
2009
2012
|
constructor() {
|
|
2010
|
-
this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH =
|
|
2013
|
+
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;
|
|
2011
2014
|
}
|
|
2012
2015
|
get parent() {
|
|
2013
2016
|
return this._item ? this._item.parent : null;
|
|
@@ -2016,10 +2019,10 @@ var ba = class {
|
|
|
2016
2019
|
this.doc = e, this._item = t;
|
|
2017
2020
|
}
|
|
2018
2021
|
_copy() {
|
|
2019
|
-
throw
|
|
2022
|
+
throw S();
|
|
2020
2023
|
}
|
|
2021
2024
|
clone() {
|
|
2022
|
-
throw
|
|
2025
|
+
throw S();
|
|
2023
2026
|
}
|
|
2024
2027
|
_write(e) {}
|
|
2025
2028
|
get _first() {
|
|
@@ -2031,19 +2034,19 @@ var ba = class {
|
|
|
2031
2034
|
!e.local && this._searchMarker && (this._searchMarker.length = 0);
|
|
2032
2035
|
}
|
|
2033
2036
|
observe(e) {
|
|
2034
|
-
|
|
2037
|
+
bi(this._eH, e);
|
|
2035
2038
|
}
|
|
2036
2039
|
observeDeep(e) {
|
|
2037
|
-
|
|
2040
|
+
bi(this._dEH, e);
|
|
2038
2041
|
}
|
|
2039
2042
|
unobserve(e) {
|
|
2040
|
-
|
|
2043
|
+
xi(this._eH, e);
|
|
2041
2044
|
}
|
|
2042
2045
|
unobserveDeep(e) {
|
|
2043
|
-
|
|
2046
|
+
xi(this._dEH, e);
|
|
2044
2047
|
}
|
|
2045
2048
|
toJSON() {}
|
|
2046
|
-
},
|
|
2049
|
+
}, Oa = (e, t, n) => {
|
|
2047
2050
|
e.doc ?? G(), t < 0 && (t = e._length + t), n < 0 && (n = e._length + n);
|
|
2048
2051
|
let r = n - t, i = [], a = e._start;
|
|
2049
2052
|
for (; a !== null && r > 0;) {
|
|
@@ -2058,7 +2061,7 @@ var ba = class {
|
|
|
2058
2061
|
a = a.right;
|
|
2059
2062
|
}
|
|
2060
2063
|
return i;
|
|
2061
|
-
},
|
|
2064
|
+
}, ka = (e) => {
|
|
2062
2065
|
e.doc ?? G();
|
|
2063
2066
|
let t = [], n = e._start;
|
|
2064
2067
|
for (; n !== null;) {
|
|
@@ -2069,7 +2072,7 @@ var ba = class {
|
|
|
2069
2072
|
n = n.right;
|
|
2070
2073
|
}
|
|
2071
2074
|
return t;
|
|
2072
|
-
},
|
|
2075
|
+
}, Aa = (e, t) => {
|
|
2073
2076
|
let n = [], r = e._start;
|
|
2074
2077
|
for (; r !== null;) {
|
|
2075
2078
|
if (r.countable && z(r, t)) {
|
|
@@ -2079,7 +2082,7 @@ var ba = class {
|
|
|
2079
2082
|
r = r.right;
|
|
2080
2083
|
}
|
|
2081
2084
|
return n;
|
|
2082
|
-
},
|
|
2085
|
+
}, ja = (e, t) => {
|
|
2083
2086
|
let n = 0, r = e._start;
|
|
2084
2087
|
for (e.doc ?? G(); r !== null;) {
|
|
2085
2088
|
if (r.countable && !r.deleted) {
|
|
@@ -2088,12 +2091,12 @@ var ba = class {
|
|
|
2088
2091
|
}
|
|
2089
2092
|
r = r.right;
|
|
2090
2093
|
}
|
|
2091
|
-
},
|
|
2094
|
+
}, Ma = (e, t) => {
|
|
2092
2095
|
let n = [];
|
|
2093
|
-
return
|
|
2096
|
+
return ja(e, (r, i) => {
|
|
2094
2097
|
n.push(t(r, i, e));
|
|
2095
2098
|
}), n;
|
|
2096
|
-
},
|
|
2099
|
+
}, Na = (e) => {
|
|
2097
2100
|
let t = e._start, n = null, r = 0;
|
|
2098
2101
|
return {
|
|
2099
2102
|
[Symbol.iterator]() {
|
|
@@ -2115,16 +2118,16 @@ var ba = class {
|
|
|
2115
2118
|
};
|
|
2116
2119
|
}
|
|
2117
2120
|
};
|
|
2118
|
-
},
|
|
2121
|
+
}, Pa = (e, t) => {
|
|
2119
2122
|
e.doc ?? G();
|
|
2120
|
-
let n =
|
|
2123
|
+
let n = Ta(e, t), r = e._start;
|
|
2121
2124
|
for (n !== null && (r = n.p, t -= n.index); r !== null; r = r.right) if (!r.deleted && r.countable) {
|
|
2122
2125
|
if (t < r.length) return r.content.getContent()[t];
|
|
2123
2126
|
t -= r.length;
|
|
2124
2127
|
}
|
|
2125
|
-
},
|
|
2128
|
+
}, Fa = (e, t, n, r) => {
|
|
2126
2129
|
let i = n, a = e.doc, o = a.clientID, s = a.store, c = n === null ? t._start : n.right, l = [], u = () => {
|
|
2127
|
-
l.length > 0 && (i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new
|
|
2130
|
+
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 = []);
|
|
2128
2131
|
};
|
|
2129
2132
|
r.forEach((n) => {
|
|
2130
2133
|
if (n === null) l.push(n);
|
|
@@ -2139,20 +2142,20 @@ var ba = class {
|
|
|
2139
2142
|
default: switch (u(), n.constructor) {
|
|
2140
2143
|
case Uint8Array:
|
|
2141
2144
|
case ArrayBuffer:
|
|
2142
|
-
i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new
|
|
2145
|
+
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);
|
|
2143
2146
|
break;
|
|
2144
|
-
case
|
|
2145
|
-
i = new Q(R(o, B(s, o)), i, i && i.lastId, c, c && c.id, t, null, new
|
|
2147
|
+
case qr:
|
|
2148
|
+
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);
|
|
2146
2149
|
break;
|
|
2147
2150
|
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);
|
|
2148
2151
|
else throw Error("Unexpected content type in insert operation");
|
|
2149
2152
|
}
|
|
2150
2153
|
}
|
|
2151
2154
|
}), u();
|
|
2152
|
-
},
|
|
2153
|
-
if (n > t._length) throw
|
|
2154
|
-
if (n === 0) return t._searchMarker &&
|
|
2155
|
-
let i = n, a =
|
|
2155
|
+
}, Ia = () => x("Length exceeded!"), La = (e, t, n, r) => {
|
|
2156
|
+
if (n > t._length) throw Ia();
|
|
2157
|
+
if (n === 0) return t._searchMarker && Ea(t._searchMarker, n, r.length), Fa(e, t, null, r);
|
|
2158
|
+
let i = n, a = Ta(t, n), o = t._start;
|
|
2156
2159
|
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) {
|
|
2157
2160
|
if (n <= o.length) {
|
|
2158
2161
|
n < o.length && H(e, R(o.id.client, o.id.clock + n));
|
|
@@ -2160,27 +2163,27 @@ var ba = class {
|
|
|
2160
2163
|
}
|
|
2161
2164
|
n -= o.length;
|
|
2162
2165
|
}
|
|
2163
|
-
return t._searchMarker &&
|
|
2164
|
-
},
|
|
2166
|
+
return t._searchMarker && Ea(t._searchMarker, i, r.length), Fa(e, t, o, r);
|
|
2167
|
+
}, Ra = (e, t, n) => {
|
|
2165
2168
|
let r = (t._searchMarker || []).reduce((e, t) => t.index > e.index ? t : e, {
|
|
2166
2169
|
index: 0,
|
|
2167
2170
|
p: t._start
|
|
2168
2171
|
}).p;
|
|
2169
2172
|
if (r) for (; r.right;) r = r.right;
|
|
2170
|
-
return
|
|
2171
|
-
},
|
|
2173
|
+
return Fa(e, t, r, n);
|
|
2174
|
+
}, za = (e, t, n, r) => {
|
|
2172
2175
|
if (r === 0) return;
|
|
2173
|
-
let i = n, a = r, o =
|
|
2176
|
+
let i = n, a = r, o = Ta(t, n), s = t._start;
|
|
2174
2177
|
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);
|
|
2175
2178
|
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;
|
|
2176
|
-
if (r > 0) throw
|
|
2177
|
-
t._searchMarker &&
|
|
2178
|
-
},
|
|
2179
|
+
if (r > 0) throw Ia();
|
|
2180
|
+
t._searchMarker && Ea(t._searchMarker, i, -a + r);
|
|
2181
|
+
}, Ba = (e, t, n) => {
|
|
2179
2182
|
let r = t._map.get(n);
|
|
2180
2183
|
r !== void 0 && r.delete(e);
|
|
2181
|
-
},
|
|
2184
|
+
}, Va = (e, t, n, r) => {
|
|
2182
2185
|
let i = t._map.get(n) || null, a = e.doc, o = a.clientID, s;
|
|
2183
|
-
if (r == null) s = new
|
|
2186
|
+
if (r == null) s = new Ho([r]);
|
|
2184
2187
|
else switch (r.constructor) {
|
|
2185
2188
|
case Number:
|
|
2186
2189
|
case Object:
|
|
@@ -2189,39 +2192,39 @@ var ba = class {
|
|
|
2189
2192
|
case String:
|
|
2190
2193
|
case Date:
|
|
2191
2194
|
case BigInt:
|
|
2192
|
-
s = new
|
|
2195
|
+
s = new Ho([r]);
|
|
2193
2196
|
break;
|
|
2194
2197
|
case Uint8Array:
|
|
2195
|
-
s = new
|
|
2198
|
+
s = new ko(r);
|
|
2196
2199
|
break;
|
|
2197
|
-
case
|
|
2198
|
-
s = new
|
|
2200
|
+
case qr:
|
|
2201
|
+
s = new Po(r);
|
|
2199
2202
|
break;
|
|
2200
2203
|
default: if (r instanceof K) s = new Z(r);
|
|
2201
2204
|
else throw Error("Unexpected content type");
|
|
2202
2205
|
}
|
|
2203
2206
|
new Q(R(o, B(a.store, o)), i, i && i.lastId, null, null, t, n, s).integrate(e, 0);
|
|
2204
|
-
},
|
|
2207
|
+
}, Ha = (e, t) => {
|
|
2205
2208
|
e.doc ?? G();
|
|
2206
2209
|
let n = e._map.get(t);
|
|
2207
2210
|
return n !== void 0 && !n.deleted ? n.content.getContent()[n.length - 1] : void 0;
|
|
2208
|
-
},
|
|
2211
|
+
}, Ua = (e) => {
|
|
2209
2212
|
let t = {};
|
|
2210
2213
|
return e.doc ?? G(), e._map.forEach((e, n) => {
|
|
2211
2214
|
e.deleted || (t[n] = e.content.getContent()[e.length - 1]);
|
|
2212
2215
|
}), t;
|
|
2213
|
-
},
|
|
2216
|
+
}, Wa = (e, t) => {
|
|
2214
2217
|
e.doc ?? G();
|
|
2215
2218
|
let n = e._map.get(t);
|
|
2216
2219
|
return n !== void 0 && !n.deleted;
|
|
2217
|
-
},
|
|
2220
|
+
}, Ga = (e, t) => {
|
|
2218
2221
|
let n = {};
|
|
2219
2222
|
return e._map.forEach((e, r) => {
|
|
2220
2223
|
let i = e;
|
|
2221
2224
|
for (; i !== null && (!t.sv.has(i.id.client) || i.id.clock >= (t.sv.get(i.id.client) || 0));) i = i.left;
|
|
2222
2225
|
i !== null && z(i, t) && (n[r] = i.content.getContent()[i.length - 1]);
|
|
2223
2226
|
}), n;
|
|
2224
|
-
},
|
|
2227
|
+
}, Ka = (e) => (e.doc ?? G(), Mr(e._map.entries(), (e) => !e[1].deleted)), qa = class extends _a {}, Ja = class e extends K {
|
|
2225
2228
|
constructor() {
|
|
2226
2229
|
super(), this._prelimContent = [], this._searchMarker = [];
|
|
2227
2230
|
}
|
|
@@ -2243,16 +2246,16 @@ var ba = class {
|
|
|
2243
2246
|
return this.doc ?? G(), this._length;
|
|
2244
2247
|
}
|
|
2245
2248
|
_callObserver(e, t) {
|
|
2246
|
-
super._callObserver(e, t),
|
|
2249
|
+
super._callObserver(e, t), Da(this, e, new qa(this, e));
|
|
2247
2250
|
}
|
|
2248
2251
|
insert(e, t) {
|
|
2249
2252
|
this.doc === null ? this._prelimContent.splice(e, 0, ...t) : U(this.doc, (n) => {
|
|
2250
|
-
|
|
2253
|
+
La(n, this, e, t);
|
|
2251
2254
|
});
|
|
2252
2255
|
}
|
|
2253
2256
|
push(e) {
|
|
2254
2257
|
this.doc === null ? this._prelimContent.push(...e) : U(this.doc, (t) => {
|
|
2255
|
-
|
|
2258
|
+
Ra(t, this, e);
|
|
2256
2259
|
});
|
|
2257
2260
|
}
|
|
2258
2261
|
unshift(e) {
|
|
@@ -2260,40 +2263,40 @@ var ba = class {
|
|
|
2260
2263
|
}
|
|
2261
2264
|
delete(e, t = 1) {
|
|
2262
2265
|
this.doc === null ? this._prelimContent.splice(e, t) : U(this.doc, (n) => {
|
|
2263
|
-
|
|
2266
|
+
za(n, this, e, t);
|
|
2264
2267
|
});
|
|
2265
2268
|
}
|
|
2266
2269
|
get(e) {
|
|
2267
|
-
return
|
|
2270
|
+
return Pa(this, e);
|
|
2268
2271
|
}
|
|
2269
2272
|
toArray() {
|
|
2270
|
-
return
|
|
2273
|
+
return ka(this);
|
|
2271
2274
|
}
|
|
2272
2275
|
slice(e = 0, t = this.length) {
|
|
2273
|
-
return
|
|
2276
|
+
return Oa(this, e, t);
|
|
2274
2277
|
}
|
|
2275
2278
|
toJSON() {
|
|
2276
2279
|
return this.map((e) => e instanceof K ? e.toJSON() : e);
|
|
2277
2280
|
}
|
|
2278
2281
|
map(e) {
|
|
2279
|
-
return
|
|
2282
|
+
return Ma(this, e);
|
|
2280
2283
|
}
|
|
2281
2284
|
forEach(e) {
|
|
2282
|
-
|
|
2285
|
+
ja(this, e);
|
|
2283
2286
|
}
|
|
2284
2287
|
[Symbol.iterator]() {
|
|
2285
|
-
return
|
|
2288
|
+
return Na(this);
|
|
2286
2289
|
}
|
|
2287
2290
|
_write(e) {
|
|
2288
|
-
e.writeTypeRef(
|
|
2291
|
+
e.writeTypeRef(Ko);
|
|
2289
2292
|
}
|
|
2290
|
-
},
|
|
2293
|
+
}, Ya = (e) => new Ja(), Xa = class extends _a {
|
|
2291
2294
|
constructor(e, t, n) {
|
|
2292
2295
|
super(e, t), this.keysChanged = n;
|
|
2293
2296
|
}
|
|
2294
|
-
},
|
|
2297
|
+
}, Za = class e extends K {
|
|
2295
2298
|
constructor(e) {
|
|
2296
|
-
super(), this._prelimContent = null, e === void 0 ?
|
|
2299
|
+
super(), this._prelimContent = null, this._prelimContent = e === void 0 ? /* @__PURE__ */ new Map() : new Map(e);
|
|
2297
2300
|
}
|
|
2298
2301
|
_integrate(e, t) {
|
|
2299
2302
|
super._integrate(e, t), this._prelimContent.forEach((e, t) => {
|
|
@@ -2310,7 +2313,7 @@ var ba = class {
|
|
|
2310
2313
|
}), t;
|
|
2311
2314
|
}
|
|
2312
2315
|
_callObserver(e, t) {
|
|
2313
|
-
|
|
2316
|
+
Da(this, e, new Xa(this, e, t));
|
|
2314
2317
|
}
|
|
2315
2318
|
toJSON() {
|
|
2316
2319
|
this.doc ?? G();
|
|
@@ -2323,16 +2326,16 @@ var ba = class {
|
|
|
2323
2326
|
}), e;
|
|
2324
2327
|
}
|
|
2325
2328
|
get size() {
|
|
2326
|
-
return [...
|
|
2329
|
+
return [...Ka(this)].length;
|
|
2327
2330
|
}
|
|
2328
2331
|
keys() {
|
|
2329
|
-
return
|
|
2332
|
+
return Nr(Ka(this), (e) => e[0]);
|
|
2330
2333
|
}
|
|
2331
2334
|
values() {
|
|
2332
|
-
return
|
|
2335
|
+
return Nr(Ka(this), (e) => e[1].content.getContent()[e[1].length - 1]);
|
|
2333
2336
|
}
|
|
2334
2337
|
entries() {
|
|
2335
|
-
return
|
|
2338
|
+
return Nr(Ka(this), (e) => [e[0], e[1].content.getContent()[e[1].length - 1]]);
|
|
2336
2339
|
}
|
|
2337
2340
|
forEach(e) {
|
|
2338
2341
|
this.doc ?? G(), this._map.forEach((t, n) => {
|
|
@@ -2344,74 +2347,70 @@ var ba = class {
|
|
|
2344
2347
|
}
|
|
2345
2348
|
delete(e) {
|
|
2346
2349
|
this.doc === null ? this._prelimContent.delete(e) : U(this.doc, (t) => {
|
|
2347
|
-
|
|
2350
|
+
Ba(t, this, e);
|
|
2348
2351
|
});
|
|
2349
2352
|
}
|
|
2350
2353
|
set(e, t) {
|
|
2351
2354
|
return this.doc === null ? this._prelimContent.set(e, t) : U(this.doc, (n) => {
|
|
2352
|
-
|
|
2355
|
+
Va(n, this, e, t);
|
|
2353
2356
|
}), t;
|
|
2354
2357
|
}
|
|
2355
2358
|
get(e) {
|
|
2356
|
-
return
|
|
2359
|
+
return Ha(this, e);
|
|
2357
2360
|
}
|
|
2358
2361
|
has(e) {
|
|
2359
|
-
return
|
|
2362
|
+
return Wa(this, e);
|
|
2360
2363
|
}
|
|
2361
2364
|
clear() {
|
|
2362
2365
|
this.doc === null ? this._prelimContent.clear() : U(this.doc, (e) => {
|
|
2363
2366
|
this.forEach(function(t, n, r) {
|
|
2364
|
-
|
|
2367
|
+
Ba(e, r, n);
|
|
2365
2368
|
});
|
|
2366
2369
|
});
|
|
2367
2370
|
}
|
|
2368
2371
|
_write(e) {
|
|
2369
|
-
e.writeTypeRef(
|
|
2372
|
+
e.writeTypeRef(qo);
|
|
2370
2373
|
}
|
|
2371
|
-
},
|
|
2374
|
+
}, Qa = (e) => new Za(), q = (e, t) => e === t || typeof e == "object" && typeof t == "object" && e && t && Ot(e, t), $a = class {
|
|
2372
2375
|
constructor(e, t, n, r) {
|
|
2373
2376
|
this.left = e, this.right = t, this.index = n, this.currentAttributes = r;
|
|
2374
2377
|
}
|
|
2375
2378
|
forward() {
|
|
2376
|
-
switch (this.right === null &&
|
|
2379
|
+
switch (this.right === null && C(), this.right.content.constructor) {
|
|
2377
2380
|
case Y:
|
|
2378
|
-
this.right.deleted ||
|
|
2379
|
-
break;
|
|
2380
|
-
default:
|
|
2381
|
-
this.right.deleted || (this.index += this.right.length);
|
|
2381
|
+
this.right.deleted || ro(this.currentAttributes, this.right.content);
|
|
2382
2382
|
break;
|
|
2383
|
+
default: this.right.deleted || (this.index += this.right.length);
|
|
2383
2384
|
}
|
|
2384
2385
|
this.left = this.right, this.right = this.right.right;
|
|
2385
2386
|
}
|
|
2386
|
-
},
|
|
2387
|
+
}, eo = (e, t, n) => {
|
|
2387
2388
|
for (; t.right !== null && n > 0;) {
|
|
2388
2389
|
switch (t.right.content.constructor) {
|
|
2389
2390
|
case Y:
|
|
2390
|
-
t.right.deleted ||
|
|
2391
|
-
break;
|
|
2392
|
-
default:
|
|
2393
|
-
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);
|
|
2391
|
+
t.right.deleted || ro(t.currentAttributes, t.right.content);
|
|
2394
2392
|
break;
|
|
2393
|
+
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);
|
|
2395
2394
|
}
|
|
2396
2395
|
t.left = t.right, t.right = t.right.right;
|
|
2397
2396
|
}
|
|
2398
2397
|
return t;
|
|
2399
|
-
},
|
|
2400
|
-
let i = /* @__PURE__ */ new Map(), a = r ?
|
|
2401
|
-
return a ?
|
|
2402
|
-
},
|
|
2398
|
+
}, to = (e, t, n, r) => {
|
|
2399
|
+
let i = /* @__PURE__ */ new Map(), a = r ? Ta(t, n) : null;
|
|
2400
|
+
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);
|
|
2401
|
+
}, no = (e, t, n, r) => {
|
|
2403
2402
|
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();
|
|
2404
2403
|
let i = e.doc, a = i.clientID;
|
|
2405
2404
|
r.forEach((r, o) => {
|
|
2406
2405
|
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));
|
|
2407
2406
|
l.integrate(e, 0), n.right = l, n.forward();
|
|
2408
2407
|
});
|
|
2409
|
-
},
|
|
2408
|
+
}, ro = (e, t) => {
|
|
2410
2409
|
let { key: n, value: r } = t;
|
|
2411
2410
|
r === null ? e.delete(n) : e.set(n, r);
|
|
2412
|
-
},
|
|
2411
|
+
}, io = (e, t) => {
|
|
2413
2412
|
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();
|
|
2414
|
-
},
|
|
2413
|
+
}, ao = (e, t, n, r) => {
|
|
2415
2414
|
let i = e.doc, a = i.clientID, o = /* @__PURE__ */ new Map();
|
|
2416
2415
|
for (let s in r) {
|
|
2417
2416
|
let c = r[s], l = n.currentAttributes.get(s) ?? null;
|
|
@@ -2422,18 +2421,18 @@ var ba = class {
|
|
|
2422
2421
|
}
|
|
2423
2422
|
}
|
|
2424
2423
|
return o;
|
|
2425
|
-
},
|
|
2424
|
+
}, oo = (e, t, n, r, i) => {
|
|
2426
2425
|
n.currentAttributes.forEach((e, t) => {
|
|
2427
2426
|
i[t] === void 0 && (i[t] = null);
|
|
2428
2427
|
});
|
|
2429
2428
|
let a = e.doc, o = a.clientID;
|
|
2430
|
-
|
|
2431
|
-
let s =
|
|
2432
|
-
t._searchMarker &&
|
|
2433
|
-
},
|
|
2429
|
+
io(n, i);
|
|
2430
|
+
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;
|
|
2431
|
+
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);
|
|
2432
|
+
}, so = (e, t, n, r, i) => {
|
|
2434
2433
|
let a = e.doc, o = a.clientID;
|
|
2435
|
-
|
|
2436
|
-
let s =
|
|
2434
|
+
io(n, i);
|
|
2435
|
+
let s = ao(e, t, n, i);
|
|
2437
2436
|
iterationLoop: for (; n.right !== null && (r > 0 || s.size > 0 && (n.right.deleted || n.right.content.constructor === Y));) {
|
|
2438
2437
|
if (!n.right.deleted) switch (n.right.content.constructor) {
|
|
2439
2438
|
case Y: {
|
|
@@ -2448,9 +2447,7 @@ var ba = class {
|
|
|
2448
2447
|
} else n.currentAttributes.set(t, a);
|
|
2449
2448
|
break;
|
|
2450
2449
|
}
|
|
2451
|
-
default:
|
|
2452
|
-
r < n.right.length && H(e, R(n.right.id.client, n.right.id.clock + r)), r -= n.right.length;
|
|
2453
|
-
break;
|
|
2450
|
+
default: r < n.right.length && H(e, R(n.right.id.client, n.right.id.clock + r)), r -= n.right.length;
|
|
2454
2451
|
}
|
|
2455
2452
|
n.forward();
|
|
2456
2453
|
}
|
|
@@ -2459,8 +2456,8 @@ var ba = class {
|
|
|
2459
2456
|
for (; r > 0; r--) i += "\n";
|
|
2460
2457
|
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();
|
|
2461
2458
|
}
|
|
2462
|
-
|
|
2463
|
-
},
|
|
2459
|
+
no(e, t, n, s);
|
|
2460
|
+
}, co = (t, n, r, i, a) => {
|
|
2464
2461
|
let o = n, s = e();
|
|
2465
2462
|
for (; o && (!o.countable || o.deleted);) {
|
|
2466
2463
|
if (!o.deleted && o.content.constructor === Y) {
|
|
@@ -2476,7 +2473,7 @@ var ba = class {
|
|
|
2476
2473
|
switch (e.constructor) {
|
|
2477
2474
|
case Y: {
|
|
2478
2475
|
let { key: r, value: o } = e, u = i.get(r) ?? null;
|
|
2479
|
-
(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 &&
|
|
2476
|
+
(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);
|
|
2480
2477
|
break;
|
|
2481
2478
|
}
|
|
2482
2479
|
}
|
|
@@ -2484,7 +2481,7 @@ var ba = class {
|
|
|
2484
2481
|
n = n.right;
|
|
2485
2482
|
}
|
|
2486
2483
|
return c;
|
|
2487
|
-
},
|
|
2484
|
+
}, lo = (e, t) => {
|
|
2488
2485
|
for (; t && t.right && (t.right.deleted || !t.right.countable);) t = t.right;
|
|
2489
2486
|
let n = /* @__PURE__ */ new Set();
|
|
2490
2487
|
for (; t && (t.deleted || !t.countable);) {
|
|
@@ -2494,27 +2491,25 @@ var ba = class {
|
|
|
2494
2491
|
}
|
|
2495
2492
|
t = t.left;
|
|
2496
2493
|
}
|
|
2497
|
-
},
|
|
2494
|
+
}, uo = (n) => {
|
|
2498
2495
|
let r = 0;
|
|
2499
2496
|
return U(n.doc, (i) => {
|
|
2500
2497
|
let a = n._start, o = n._start, s = e(), c = t(s);
|
|
2501
2498
|
for (; o;) {
|
|
2502
2499
|
if (o.deleted === !1) switch (o.content.constructor) {
|
|
2503
2500
|
case Y:
|
|
2504
|
-
|
|
2505
|
-
break;
|
|
2506
|
-
default:
|
|
2507
|
-
r += Co(i, a, o, s, c), s = t(c), a = o;
|
|
2501
|
+
ro(c, o.content);
|
|
2508
2502
|
break;
|
|
2503
|
+
default: r += co(i, a, o, s, c), s = t(c), a = o;
|
|
2509
2504
|
}
|
|
2510
2505
|
o = o.right;
|
|
2511
2506
|
}
|
|
2512
2507
|
}), r;
|
|
2513
|
-
},
|
|
2508
|
+
}, fo = (e) => {
|
|
2514
2509
|
let t = /* @__PURE__ */ new Set(), n = e.doc;
|
|
2515
2510
|
for (let [r, i] of e.afterState.entries()) {
|
|
2516
2511
|
let a = e.beforeState.get(r) || 0;
|
|
2517
|
-
i !== a &&
|
|
2512
|
+
i !== a && qi(e, n.store.clients.get(r), a, i, (e) => {
|
|
2518
2513
|
!e.deleted && e.content.constructor === Y && e.constructor !== J && t.add(e.parent);
|
|
2519
2514
|
});
|
|
2520
2515
|
}
|
|
@@ -2522,26 +2517,24 @@ var ba = class {
|
|
|
2522
2517
|
I(e, e.deleteSet, (e) => {
|
|
2523
2518
|
if (e instanceof J || !e.parent._hasFormatting || t.has(e.parent)) return;
|
|
2524
2519
|
let r = e.parent;
|
|
2525
|
-
e.content.constructor === Y ? t.add(r) :
|
|
2520
|
+
e.content.constructor === Y ? t.add(r) : lo(n, e);
|
|
2526
2521
|
});
|
|
2527
|
-
for (let e of t)
|
|
2522
|
+
for (let e of t) uo(e);
|
|
2528
2523
|
});
|
|
2529
|
-
},
|
|
2524
|
+
}, po = (e, n, r) => {
|
|
2530
2525
|
let i = r, a = t(n.currentAttributes), o = n.right;
|
|
2531
2526
|
for (; r > 0 && n.right !== null;) {
|
|
2532
2527
|
if (n.right.deleted === !1) switch (n.right.content.constructor) {
|
|
2533
2528
|
case Z:
|
|
2534
|
-
case
|
|
2535
|
-
case X:
|
|
2536
|
-
r < n.right.length && H(e, R(n.right.id.client, n.right.id.clock + r)), r -= n.right.length, n.right.delete(e);
|
|
2537
|
-
break;
|
|
2529
|
+
case Io:
|
|
2530
|
+
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);
|
|
2538
2531
|
}
|
|
2539
2532
|
n.forward();
|
|
2540
2533
|
}
|
|
2541
|
-
o &&
|
|
2534
|
+
o && co(e, o, n.right, a, n.currentAttributes);
|
|
2542
2535
|
let s = (n.left || n.right).parent;
|
|
2543
|
-
return s._searchMarker &&
|
|
2544
|
-
},
|
|
2536
|
+
return s._searchMarker && Ea(s._searchMarker, n.index, -i + r), n;
|
|
2537
|
+
}, mo = class extends _a {
|
|
2545
2538
|
constructor(e, t, n) {
|
|
2546
2539
|
super(e, t), this.childListChanged = !1, this.keysChanged = /* @__PURE__ */ new Set(), n.forEach((e) => {
|
|
2547
2540
|
e === null ? this.childListChanged = !0 : this.keysChanged.add(e);
|
|
@@ -2575,9 +2568,7 @@ var ba = class {
|
|
|
2575
2568
|
t !== null && (e.attributes[n] = t);
|
|
2576
2569
|
}))), s = "";
|
|
2577
2570
|
break;
|
|
2578
|
-
case "retain":
|
|
2579
|
-
c > 0 && (e = { retain: c }, It(o) || (e.attributes = jt({}, o))), c = 0;
|
|
2580
|
-
break;
|
|
2571
|
+
case "retain": c > 0 && (e = { retain: c }, Tt(o) || (e.attributes = bt({}, o))), c = 0;
|
|
2581
2572
|
}
|
|
2582
2573
|
e && t.push(e), a = null;
|
|
2583
2574
|
}
|
|
@@ -2585,7 +2576,7 @@ var ba = class {
|
|
|
2585
2576
|
for (; i !== null;) {
|
|
2586
2577
|
switch (i.content.constructor) {
|
|
2587
2578
|
case Z:
|
|
2588
|
-
case
|
|
2579
|
+
case Io:
|
|
2589
2580
|
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);
|
|
2590
2581
|
break;
|
|
2591
2582
|
case X:
|
|
@@ -2603,7 +2594,7 @@ var ba = class {
|
|
|
2603
2594
|
let n = o[t];
|
|
2604
2595
|
n !== void 0 && (q(n, s) ? n !== null && i.delete(e) : (a === "retain" && u(), s === null ? delete o[t] : o[t] = s));
|
|
2605
2596
|
}
|
|
2606
|
-
i.deleted || (a === "insert" && u(),
|
|
2597
|
+
i.deleted || (a === "insert" && u(), ro(n, i.content));
|
|
2607
2598
|
break;
|
|
2608
2599
|
}
|
|
2609
2600
|
}
|
|
@@ -2618,7 +2609,7 @@ var ba = class {
|
|
|
2618
2609
|
}
|
|
2619
2610
|
return this._delta;
|
|
2620
2611
|
}
|
|
2621
|
-
},
|
|
2612
|
+
}, ho = class e extends K {
|
|
2622
2613
|
constructor(e) {
|
|
2623
2614
|
super(), this._pending = e === void 0 ? [] : [() => this.insert(0, e)], this._searchMarker = [], this._hasFormatting = !1;
|
|
2624
2615
|
}
|
|
@@ -2643,8 +2634,8 @@ var ba = class {
|
|
|
2643
2634
|
}
|
|
2644
2635
|
_callObserver(e, t) {
|
|
2645
2636
|
super._callObserver(e, t);
|
|
2646
|
-
let n = new
|
|
2647
|
-
|
|
2637
|
+
let n = new mo(this, e, t);
|
|
2638
|
+
Da(this, e, n), !e.local && this._hasFormatting && (e._needFormattingCleanup = !0);
|
|
2648
2639
|
}
|
|
2649
2640
|
toString() {
|
|
2650
2641
|
this.doc ?? G();
|
|
@@ -2657,13 +2648,13 @@ var ba = class {
|
|
|
2657
2648
|
}
|
|
2658
2649
|
applyDelta(e, { sanitize: t = !0 } = {}) {
|
|
2659
2650
|
this.doc === null ? this._pending.push(() => this.applyDelta(e)) : U(this.doc, (n) => {
|
|
2660
|
-
let r = new
|
|
2651
|
+
let r = new $a(null, this._start, 0, /* @__PURE__ */ new Map());
|
|
2661
2652
|
for (let i = 0; i < e.length; i++) {
|
|
2662
2653
|
let a = e[i];
|
|
2663
2654
|
if (a.insert !== void 0) {
|
|
2664
2655
|
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;
|
|
2665
|
-
(typeof o != "string" || o.length > 0) &&
|
|
2666
|
-
} else a.retain === void 0 ? a.delete !== void 0 &&
|
|
2656
|
+
(typeof o != "string" || o.length > 0) && oo(n, this, r, o, a.attributes || {});
|
|
2657
|
+
} else a.retain === void 0 ? a.delete !== void 0 && po(n, r, a.delete) : so(n, this, r, a.retain, a.attributes || {});
|
|
2667
2658
|
}
|
|
2668
2659
|
});
|
|
2669
2660
|
}
|
|
@@ -2689,7 +2680,7 @@ var ba = class {
|
|
|
2689
2680
|
break;
|
|
2690
2681
|
}
|
|
2691
2682
|
case Z:
|
|
2692
|
-
case
|
|
2683
|
+
case Io: {
|
|
2693
2684
|
c();
|
|
2694
2685
|
let e = { insert: s.content.getContent()[0] };
|
|
2695
2686
|
if (i.size > 0) {
|
|
@@ -2701,70 +2692,68 @@ var ba = class {
|
|
|
2701
2692
|
r.push(e);
|
|
2702
2693
|
break;
|
|
2703
2694
|
}
|
|
2704
|
-
case Y:
|
|
2705
|
-
z(s, e) && (c(), vo(i, s.content));
|
|
2706
|
-
break;
|
|
2695
|
+
case Y: z(s, e) && (c(), ro(i, s.content));
|
|
2707
2696
|
}
|
|
2708
2697
|
s = s.right;
|
|
2709
2698
|
}
|
|
2710
2699
|
c();
|
|
2711
2700
|
};
|
|
2712
2701
|
return e || t ? U(a, (n) => {
|
|
2713
|
-
e &&
|
|
2702
|
+
e && zi(n, e), t && zi(n, t), l();
|
|
2714
2703
|
}, "cleanup") : l(), r;
|
|
2715
2704
|
}
|
|
2716
2705
|
insert(e, t, n) {
|
|
2717
2706
|
if (t.length <= 0) return;
|
|
2718
2707
|
let r = this.doc;
|
|
2719
2708
|
r === null ? this._pending.push(() => this.insert(e, t, n)) : U(r, (r) => {
|
|
2720
|
-
let i =
|
|
2709
|
+
let i = to(r, this, e, !n);
|
|
2721
2710
|
n || (n = {}, i.currentAttributes.forEach((e, t) => {
|
|
2722
2711
|
n[t] = e;
|
|
2723
|
-
})),
|
|
2712
|
+
})), oo(r, this, i, t, n);
|
|
2724
2713
|
});
|
|
2725
2714
|
}
|
|
2726
2715
|
insertEmbed(e, t, n) {
|
|
2727
2716
|
let r = this.doc;
|
|
2728
2717
|
r === null ? this._pending.push(() => this.insertEmbed(e, t, n || {})) : U(r, (r) => {
|
|
2729
|
-
let i =
|
|
2730
|
-
|
|
2718
|
+
let i = to(r, this, e, !n);
|
|
2719
|
+
oo(r, this, i, t, n || {});
|
|
2731
2720
|
});
|
|
2732
2721
|
}
|
|
2733
2722
|
delete(e, t) {
|
|
2734
2723
|
if (t === 0) return;
|
|
2735
2724
|
let n = this.doc;
|
|
2736
2725
|
n === null ? this._pending.push(() => this.delete(e, t)) : U(n, (n) => {
|
|
2737
|
-
|
|
2726
|
+
po(n, to(n, this, e, !0), t);
|
|
2738
2727
|
});
|
|
2739
2728
|
}
|
|
2740
2729
|
format(e, t, n) {
|
|
2741
2730
|
if (t === 0) return;
|
|
2742
2731
|
let r = this.doc;
|
|
2743
2732
|
r === null ? this._pending.push(() => this.format(e, t, n)) : U(r, (r) => {
|
|
2744
|
-
let i =
|
|
2745
|
-
i.right !== null &&
|
|
2733
|
+
let i = to(r, this, e, !1);
|
|
2734
|
+
i.right !== null && so(r, this, i, t, n);
|
|
2746
2735
|
});
|
|
2747
2736
|
}
|
|
2748
2737
|
removeAttribute(e) {
|
|
2749
2738
|
this.doc === null ? this._pending.push(() => this.removeAttribute(e)) : U(this.doc, (t) => {
|
|
2750
|
-
|
|
2739
|
+
Ba(t, this, e);
|
|
2751
2740
|
});
|
|
2752
2741
|
}
|
|
2753
2742
|
setAttribute(e, t) {
|
|
2754
2743
|
this.doc === null ? this._pending.push(() => this.setAttribute(e, t)) : U(this.doc, (n) => {
|
|
2755
|
-
|
|
2744
|
+
Va(n, this, e, t);
|
|
2756
2745
|
});
|
|
2757
2746
|
}
|
|
2758
2747
|
getAttribute(e) {
|
|
2759
|
-
return
|
|
2748
|
+
return Ha(this, e);
|
|
2760
2749
|
}
|
|
2761
2750
|
getAttributes() {
|
|
2762
|
-
return
|
|
2751
|
+
return Ua(this);
|
|
2763
2752
|
}
|
|
2764
2753
|
_write(e) {
|
|
2765
|
-
e.writeTypeRef(
|
|
2754
|
+
e.writeTypeRef(Jo);
|
|
2766
2755
|
}
|
|
2767
|
-
},
|
|
2756
|
+
}, go = (e) => new ho(), _o = class {
|
|
2768
2757
|
constructor(e, t = () => !0) {
|
|
2769
2758
|
this._filter = t, this._root = e, this._currentNode = e._start, this._firstCall = !0, e.doc ?? G();
|
|
2770
2759
|
}
|
|
@@ -2774,13 +2763,14 @@ var ba = class {
|
|
|
2774
2763
|
next() {
|
|
2775
2764
|
let e = this._currentNode, t = e && e.content && e.content.type;
|
|
2776
2765
|
if (e !== null && (!this._firstCall || e.deleted || !this._filter(t))) do
|
|
2777
|
-
if (t = e.content.type, !e.deleted && (t.constructor ===
|
|
2766
|
+
if (t = e.content.type, !e.deleted && (t.constructor === bo || t.constructor === vo) && t._start !== null) e = t._start;
|
|
2778
2767
|
else for (; e !== null;) {
|
|
2779
2768
|
let t = e.next;
|
|
2780
2769
|
if (t !== null) {
|
|
2781
2770
|
e = t;
|
|
2782
2771
|
break;
|
|
2783
|
-
}
|
|
2772
|
+
}
|
|
2773
|
+
e = e.parent === this._root ? null : e.parent._item;
|
|
2784
2774
|
}
|
|
2785
2775
|
while (e !== null && (e.deleted || !this._filter(e.content.type)));
|
|
2786
2776
|
return this._firstCall = !1, e === null ? {
|
|
@@ -2791,7 +2781,7 @@ var ba = class {
|
|
|
2791
2781
|
done: !1
|
|
2792
2782
|
});
|
|
2793
2783
|
}
|
|
2794
|
-
},
|
|
2784
|
+
}, vo = class e extends K {
|
|
2795
2785
|
constructor() {
|
|
2796
2786
|
super(), this._prelimContent = [];
|
|
2797
2787
|
}
|
|
@@ -2813,54 +2803,54 @@ var ba = class {
|
|
|
2813
2803
|
return this.doc ?? G(), this._prelimContent === null ? this._length : this._prelimContent.length;
|
|
2814
2804
|
}
|
|
2815
2805
|
createTreeWalker(e) {
|
|
2816
|
-
return new
|
|
2806
|
+
return new _o(this, e);
|
|
2817
2807
|
}
|
|
2818
2808
|
querySelector(e) {
|
|
2819
2809
|
e = e.toUpperCase();
|
|
2820
|
-
let t = new
|
|
2810
|
+
let t = new _o(this, (t) => t.nodeName && t.nodeName.toUpperCase() === e).next();
|
|
2821
2811
|
return t.done ? null : t.value;
|
|
2822
2812
|
}
|
|
2823
2813
|
querySelectorAll(e) {
|
|
2824
|
-
return e = e.toUpperCase(), c(new
|
|
2814
|
+
return e = e.toUpperCase(), c(new _o(this, (t) => t.nodeName && t.nodeName.toUpperCase() === e));
|
|
2825
2815
|
}
|
|
2826
2816
|
_callObserver(e, t) {
|
|
2827
|
-
|
|
2817
|
+
Da(this, e, new So(this, t, e));
|
|
2828
2818
|
}
|
|
2829
2819
|
toString() {
|
|
2830
|
-
return
|
|
2820
|
+
return Ma(this, (e) => e.toString()).join("");
|
|
2831
2821
|
}
|
|
2832
2822
|
toJSON() {
|
|
2833
2823
|
return this.toString();
|
|
2834
2824
|
}
|
|
2835
2825
|
toDOM(e = document, t = {}, n) {
|
|
2836
2826
|
let r = e.createDocumentFragment();
|
|
2837
|
-
return n !== void 0 && n._createAssociation(r, this),
|
|
2827
|
+
return n !== void 0 && n._createAssociation(r, this), ja(this, (i) => {
|
|
2838
2828
|
r.insertBefore(i.toDOM(e, t, n), null);
|
|
2839
2829
|
}), r;
|
|
2840
2830
|
}
|
|
2841
2831
|
insert(e, t) {
|
|
2842
2832
|
this.doc === null ? this._prelimContent.splice(e, 0, ...t) : U(this.doc, (n) => {
|
|
2843
|
-
|
|
2833
|
+
La(n, this, e, t);
|
|
2844
2834
|
});
|
|
2845
2835
|
}
|
|
2846
2836
|
insertAfter(e, t) {
|
|
2847
2837
|
if (this.doc !== null) U(this.doc, (n) => {
|
|
2848
2838
|
let r = e && e instanceof K ? e._item : e;
|
|
2849
|
-
|
|
2839
|
+
Fa(n, this, r, t);
|
|
2850
2840
|
});
|
|
2851
2841
|
else {
|
|
2852
2842
|
let n = this._prelimContent, r = e === null ? 0 : n.findIndex((t) => t === e) + 1;
|
|
2853
|
-
if (r === 0 && e !== null) throw
|
|
2843
|
+
if (r === 0 && e !== null) throw x("Reference item not found");
|
|
2854
2844
|
n.splice(r, 0, ...t);
|
|
2855
2845
|
}
|
|
2856
2846
|
}
|
|
2857
2847
|
delete(e, t = 1) {
|
|
2858
2848
|
this.doc === null ? this._prelimContent.splice(e, t) : U(this.doc, (n) => {
|
|
2859
|
-
|
|
2849
|
+
za(n, this, e, t);
|
|
2860
2850
|
});
|
|
2861
2851
|
}
|
|
2862
2852
|
toArray() {
|
|
2863
|
-
return
|
|
2853
|
+
return ka(this);
|
|
2864
2854
|
}
|
|
2865
2855
|
push(e) {
|
|
2866
2856
|
this.insert(this.length, e);
|
|
@@ -2869,18 +2859,18 @@ var ba = class {
|
|
|
2869
2859
|
this.insert(0, e);
|
|
2870
2860
|
}
|
|
2871
2861
|
get(e) {
|
|
2872
|
-
return
|
|
2862
|
+
return Pa(this, e);
|
|
2873
2863
|
}
|
|
2874
2864
|
slice(e = 0, t = this.length) {
|
|
2875
|
-
return
|
|
2865
|
+
return Oa(this, e, t);
|
|
2876
2866
|
}
|
|
2877
2867
|
forEach(e) {
|
|
2878
|
-
|
|
2868
|
+
ja(this, e);
|
|
2879
2869
|
}
|
|
2880
2870
|
_write(e) {
|
|
2881
|
-
e.writeTypeRef(
|
|
2871
|
+
e.writeTypeRef(Xo);
|
|
2882
2872
|
}
|
|
2883
|
-
},
|
|
2873
|
+
}, yo = (e) => new vo(), bo = class e extends vo {
|
|
2884
2874
|
constructor(e = "UNDEFINED") {
|
|
2885
2875
|
super(), this.nodeName = e, this._prelimAttrs = /* @__PURE__ */ new Map();
|
|
2886
2876
|
}
|
|
@@ -2902,7 +2892,7 @@ var ba = class {
|
|
|
2902
2892
|
}
|
|
2903
2893
|
clone() {
|
|
2904
2894
|
let t = new e(this.nodeName);
|
|
2905
|
-
return
|
|
2895
|
+
return St(this.getAttributes(), (e, n) => {
|
|
2906
2896
|
t.setAttribute(n, e);
|
|
2907
2897
|
}), t.insert(0, this.toArray().map((e) => e instanceof K ? e.clone() : e)), t;
|
|
2908
2898
|
}
|
|
@@ -2920,22 +2910,22 @@ var ba = class {
|
|
|
2920
2910
|
}
|
|
2921
2911
|
removeAttribute(e) {
|
|
2922
2912
|
this.doc === null ? this._prelimAttrs.delete(e) : U(this.doc, (t) => {
|
|
2923
|
-
|
|
2913
|
+
Ba(t, this, e);
|
|
2924
2914
|
});
|
|
2925
2915
|
}
|
|
2926
2916
|
setAttribute(e, t) {
|
|
2927
2917
|
this.doc === null ? this._prelimAttrs.set(e, t) : U(this.doc, (n) => {
|
|
2928
|
-
|
|
2918
|
+
Va(n, this, e, t);
|
|
2929
2919
|
});
|
|
2930
2920
|
}
|
|
2931
2921
|
getAttribute(e) {
|
|
2932
|
-
return
|
|
2922
|
+
return Ha(this, e);
|
|
2933
2923
|
}
|
|
2934
2924
|
hasAttribute(e) {
|
|
2935
|
-
return
|
|
2925
|
+
return Wa(this, e);
|
|
2936
2926
|
}
|
|
2937
2927
|
getAttributes(e) {
|
|
2938
|
-
return e ?
|
|
2928
|
+
return e ? Ga(this, e) : Ua(this);
|
|
2939
2929
|
}
|
|
2940
2930
|
toDOM(e = document, t = {}, n) {
|
|
2941
2931
|
let r = e.createElement(this.nodeName), i = this.getAttributes();
|
|
@@ -2943,20 +2933,20 @@ var ba = class {
|
|
|
2943
2933
|
let t = i[e];
|
|
2944
2934
|
typeof t == "string" && r.setAttribute(e, t);
|
|
2945
2935
|
}
|
|
2946
|
-
return
|
|
2936
|
+
return ja(this, (i) => {
|
|
2947
2937
|
r.appendChild(i.toDOM(e, t, n));
|
|
2948
2938
|
}), n !== void 0 && n._createAssociation(r, this), r;
|
|
2949
2939
|
}
|
|
2950
2940
|
_write(e) {
|
|
2951
|
-
e.writeTypeRef(
|
|
2941
|
+
e.writeTypeRef(Yo), e.writeKey(this.nodeName);
|
|
2952
2942
|
}
|
|
2953
|
-
},
|
|
2943
|
+
}, xo = (e) => new bo(e.readKey()), So = class extends _a {
|
|
2954
2944
|
constructor(e, t, n) {
|
|
2955
2945
|
super(e, n), this.childListChanged = !1, this.attributesChanged = /* @__PURE__ */ new Set(), t.forEach((e) => {
|
|
2956
2946
|
e === null ? this.childListChanged = !0 : this.attributesChanged.add(e);
|
|
2957
2947
|
});
|
|
2958
2948
|
}
|
|
2959
|
-
},
|
|
2949
|
+
}, Co = class e extends Za {
|
|
2960
2950
|
constructor(e) {
|
|
2961
2951
|
super(), this.hookName = e;
|
|
2962
2952
|
}
|
|
@@ -2974,9 +2964,9 @@ var ba = class {
|
|
|
2974
2964
|
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;
|
|
2975
2965
|
}
|
|
2976
2966
|
_write(e) {
|
|
2977
|
-
e.writeTypeRef(
|
|
2967
|
+
e.writeTypeRef(Zo), e.writeKey(this.hookName);
|
|
2978
2968
|
}
|
|
2979
|
-
},
|
|
2969
|
+
}, wo = (e) => new Co(e.readKey()), To = class e extends ho {
|
|
2980
2970
|
get nextSibling() {
|
|
2981
2971
|
let e = this._item ? this._item.next : null;
|
|
2982
2972
|
return e ? e.content.type : null;
|
|
@@ -3030,42 +3020,42 @@ var ba = class {
|
|
|
3030
3020
|
return this.toString();
|
|
3031
3021
|
}
|
|
3032
3022
|
_write(e) {
|
|
3033
|
-
e.writeTypeRef(
|
|
3023
|
+
e.writeTypeRef(Qo);
|
|
3034
3024
|
}
|
|
3035
|
-
},
|
|
3025
|
+
}, Eo = (e) => new To(), Do = class {
|
|
3036
3026
|
constructor(e, t) {
|
|
3037
3027
|
this.id = e, this.length = t;
|
|
3038
3028
|
}
|
|
3039
3029
|
get deleted() {
|
|
3040
|
-
throw
|
|
3030
|
+
throw S();
|
|
3041
3031
|
}
|
|
3042
3032
|
mergeWith(e) {
|
|
3043
3033
|
return !1;
|
|
3044
3034
|
}
|
|
3045
3035
|
write(e, t, n) {
|
|
3046
|
-
throw
|
|
3036
|
+
throw S();
|
|
3047
3037
|
}
|
|
3048
3038
|
integrate(e, t) {
|
|
3049
|
-
throw
|
|
3039
|
+
throw S();
|
|
3050
3040
|
}
|
|
3051
|
-
},
|
|
3041
|
+
}, Oo = 0, J = class extends Do {
|
|
3052
3042
|
get deleted() {
|
|
3053
3043
|
return !0;
|
|
3054
3044
|
}
|
|
3055
3045
|
delete() {}
|
|
3056
3046
|
mergeWith(e) {
|
|
3057
|
-
return this.constructor === e.constructor
|
|
3047
|
+
return this.constructor === e.constructor && (this.length += e.length, !0);
|
|
3058
3048
|
}
|
|
3059
3049
|
integrate(e, t) {
|
|
3060
|
-
t > 0 && (this.id.clock += t, this.length -= t),
|
|
3050
|
+
t > 0 && (this.id.clock += t, this.length -= t), Hi(e.doc.store, this);
|
|
3061
3051
|
}
|
|
3062
3052
|
write(e, t) {
|
|
3063
|
-
e.writeInfo(
|
|
3053
|
+
e.writeInfo(Oo), e.writeLen(this.length - t);
|
|
3064
3054
|
}
|
|
3065
3055
|
getMissing(e, t) {
|
|
3066
3056
|
return null;
|
|
3067
3057
|
}
|
|
3068
|
-
},
|
|
3058
|
+
}, ko = class e {
|
|
3069
3059
|
constructor(e) {
|
|
3070
3060
|
this.content = e;
|
|
3071
3061
|
}
|
|
@@ -3082,7 +3072,7 @@ var ba = class {
|
|
|
3082
3072
|
return new e(this.content);
|
|
3083
3073
|
}
|
|
3084
3074
|
splice(e) {
|
|
3085
|
-
throw
|
|
3075
|
+
throw S();
|
|
3086
3076
|
}
|
|
3087
3077
|
mergeWith(e) {
|
|
3088
3078
|
return !1;
|
|
@@ -3096,7 +3086,7 @@ var ba = class {
|
|
|
3096
3086
|
getRef() {
|
|
3097
3087
|
return 3;
|
|
3098
3088
|
}
|
|
3099
|
-
},
|
|
3089
|
+
}, Ao = (e) => new ko(e.readBuf()), jo = class e {
|
|
3100
3090
|
constructor(e) {
|
|
3101
3091
|
this.len = e;
|
|
3102
3092
|
}
|
|
@@ -3120,7 +3110,7 @@ var ba = class {
|
|
|
3120
3110
|
return this.len += e.len, !0;
|
|
3121
3111
|
}
|
|
3122
3112
|
integrate(e, t) {
|
|
3123
|
-
|
|
3113
|
+
Br(e.deleteSet, t.id.client, t.id.clock, this.len), t.markDeleted();
|
|
3124
3114
|
}
|
|
3125
3115
|
delete(e) {}
|
|
3126
3116
|
gc(e) {}
|
|
@@ -3130,11 +3120,11 @@ var ba = class {
|
|
|
3130
3120
|
getRef() {
|
|
3131
3121
|
return 1;
|
|
3132
3122
|
}
|
|
3133
|
-
},
|
|
3123
|
+
}, Mo = (e) => new jo(e.readLen()), No = (e, t) => new qr({
|
|
3134
3124
|
guid: e,
|
|
3135
3125
|
...t,
|
|
3136
3126
|
shouldLoad: t.shouldLoad || t.autoLoad || !1
|
|
3137
|
-
}),
|
|
3127
|
+
}), Po = class e {
|
|
3138
3128
|
constructor(e) {
|
|
3139
3129
|
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;
|
|
3140
3130
|
let t = {};
|
|
@@ -3150,10 +3140,10 @@ var ba = class {
|
|
|
3150
3140
|
return !0;
|
|
3151
3141
|
}
|
|
3152
3142
|
copy() {
|
|
3153
|
-
return new e(
|
|
3143
|
+
return new e(No(this.doc.guid, this.opts));
|
|
3154
3144
|
}
|
|
3155
3145
|
splice(e) {
|
|
3156
|
-
throw
|
|
3146
|
+
throw S();
|
|
3157
3147
|
}
|
|
3158
3148
|
mergeWith(e) {
|
|
3159
3149
|
return !1;
|
|
@@ -3171,7 +3161,7 @@ var ba = class {
|
|
|
3171
3161
|
getRef() {
|
|
3172
3162
|
return 9;
|
|
3173
3163
|
}
|
|
3174
|
-
},
|
|
3164
|
+
}, Fo = (e) => new Po(No(e.readString(), e.readAny())), Io = class e {
|
|
3175
3165
|
constructor(e) {
|
|
3176
3166
|
this.embed = e;
|
|
3177
3167
|
}
|
|
@@ -3188,7 +3178,7 @@ var ba = class {
|
|
|
3188
3178
|
return new e(this.embed);
|
|
3189
3179
|
}
|
|
3190
3180
|
splice(e) {
|
|
3191
|
-
throw
|
|
3181
|
+
throw S();
|
|
3192
3182
|
}
|
|
3193
3183
|
mergeWith(e) {
|
|
3194
3184
|
return !1;
|
|
@@ -3202,7 +3192,7 @@ var ba = class {
|
|
|
3202
3192
|
getRef() {
|
|
3203
3193
|
return 5;
|
|
3204
3194
|
}
|
|
3205
|
-
},
|
|
3195
|
+
}, Lo = (e) => new Io(e.readJSON()), Y = class e {
|
|
3206
3196
|
constructor(e, t) {
|
|
3207
3197
|
this.key = e, this.value = t;
|
|
3208
3198
|
}
|
|
@@ -3219,7 +3209,7 @@ var ba = class {
|
|
|
3219
3209
|
return new e(this.key, this.value);
|
|
3220
3210
|
}
|
|
3221
3211
|
splice(e) {
|
|
3222
|
-
throw
|
|
3212
|
+
throw S();
|
|
3223
3213
|
}
|
|
3224
3214
|
mergeWith(e) {
|
|
3225
3215
|
return !1;
|
|
@@ -3236,7 +3226,7 @@ var ba = class {
|
|
|
3236
3226
|
getRef() {
|
|
3237
3227
|
return 6;
|
|
3238
3228
|
}
|
|
3239
|
-
},
|
|
3229
|
+
}, Ro = (e) => new Y(e.readKey(), e.readJSON()), zo = class e {
|
|
3240
3230
|
constructor(e) {
|
|
3241
3231
|
this.arr = e;
|
|
3242
3232
|
}
|
|
@@ -3273,16 +3263,16 @@ var ba = class {
|
|
|
3273
3263
|
getRef() {
|
|
3274
3264
|
return 2;
|
|
3275
3265
|
}
|
|
3276
|
-
},
|
|
3266
|
+
}, Bo = (e) => {
|
|
3277
3267
|
let t = e.readLen(), n = [];
|
|
3278
3268
|
for (let r = 0; r < t; r++) {
|
|
3279
3269
|
let t = e.readString();
|
|
3280
3270
|
t === "undefined" ? n.push(void 0) : n.push(JSON.parse(t));
|
|
3281
3271
|
}
|
|
3282
|
-
return new
|
|
3283
|
-
},
|
|
3272
|
+
return new zo(n);
|
|
3273
|
+
}, Vo = zt("node_env") === "development", Ho = class e {
|
|
3284
3274
|
constructor(e) {
|
|
3285
|
-
this.arr = e,
|
|
3275
|
+
this.arr = e, Vo && At(e);
|
|
3286
3276
|
}
|
|
3287
3277
|
getLength() {
|
|
3288
3278
|
return this.arr.length;
|
|
@@ -3317,10 +3307,10 @@ var ba = class {
|
|
|
3317
3307
|
getRef() {
|
|
3318
3308
|
return 8;
|
|
3319
3309
|
}
|
|
3320
|
-
},
|
|
3310
|
+
}, Uo = (e) => {
|
|
3321
3311
|
let t = e.readLen(), n = [];
|
|
3322
3312
|
for (let r = 0; r < t; r++) n.push(e.readAny());
|
|
3323
|
-
return new
|
|
3313
|
+
return new Ho(n);
|
|
3324
3314
|
}, X = class e {
|
|
3325
3315
|
constructor(e) {
|
|
3326
3316
|
this.str = e;
|
|
@@ -3355,15 +3345,15 @@ var ba = class {
|
|
|
3355
3345
|
getRef() {
|
|
3356
3346
|
return 4;
|
|
3357
3347
|
}
|
|
3358
|
-
},
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
],
|
|
3348
|
+
}, Wo = (e) => new X(e.readString()), Go = [
|
|
3349
|
+
Ya,
|
|
3350
|
+
Qa,
|
|
3351
|
+
go,
|
|
3352
|
+
xo,
|
|
3353
|
+
yo,
|
|
3354
|
+
wo,
|
|
3355
|
+
Eo
|
|
3356
|
+
], Ko = 0, qo = 1, Jo = 2, Yo = 3, Xo = 4, Zo = 5, Qo = 6, Z = class e {
|
|
3367
3357
|
constructor(e) {
|
|
3368
3358
|
this.type = e;
|
|
3369
3359
|
}
|
|
@@ -3380,7 +3370,7 @@ var ba = class {
|
|
|
3380
3370
|
return new e(this.type._copy());
|
|
3381
3371
|
}
|
|
3382
3372
|
splice(e) {
|
|
3383
|
-
throw
|
|
3373
|
+
throw S();
|
|
3384
3374
|
}
|
|
3385
3375
|
mergeWith(e) {
|
|
3386
3376
|
return !1;
|
|
@@ -3408,26 +3398,26 @@ var ba = class {
|
|
|
3408
3398
|
getRef() {
|
|
3409
3399
|
return 7;
|
|
3410
3400
|
}
|
|
3411
|
-
},
|
|
3401
|
+
}, $o = (e) => new Z(Go[e.readTypeRef()](e)), es = (e, t) => {
|
|
3412
3402
|
let n = t, r = 0, i;
|
|
3413
3403
|
do
|
|
3414
|
-
r > 0 && (n = R(n.client, n.clock + r)), i =
|
|
3404
|
+
r > 0 && (n = R(n.client, n.clock + r)), i = Ui(e, n), r = n.clock - i.id.clock, n = i.redone;
|
|
3415
3405
|
while (n !== null && i instanceof Q);
|
|
3416
3406
|
return {
|
|
3417
3407
|
item: i,
|
|
3418
3408
|
diff: r
|
|
3419
3409
|
};
|
|
3420
|
-
},
|
|
3410
|
+
}, ts = (e, t) => {
|
|
3421
3411
|
for (; e !== null && e.keep !== t;) e.keep = t, e = e.parent._item;
|
|
3422
|
-
},
|
|
3412
|
+
}, ns = (e, t, n) => {
|
|
3423
3413
|
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));
|
|
3424
3414
|
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;
|
|
3425
|
-
},
|
|
3415
|
+
}, rs = (e, t) => u(e, (e) => Lr(e.deletions, t)), is = (e, t, n, r, i, a) => {
|
|
3426
3416
|
let o = e.doc, s = o.store, c = o.clientID, l = t.redone;
|
|
3427
3417
|
if (l !== null) return H(e, l);
|
|
3428
3418
|
let u = t.parent._item, d = null, f;
|
|
3429
3419
|
if (u !== null && u.deleted === !0) {
|
|
3430
|
-
if (u.redone === null && (!n.has(u) ||
|
|
3420
|
+
if (u.redone === null && (!n.has(u) || is(e, u, n, r, i, a) === null)) return null;
|
|
3431
3421
|
for (; u.redone !== null;) u = H(e, u.redone);
|
|
3432
3422
|
}
|
|
3433
3423
|
let p = u === null ? t.parent : u.content.type;
|
|
@@ -3452,14 +3442,14 @@ var ba = class {
|
|
|
3452
3442
|
}
|
|
3453
3443
|
} else {
|
|
3454
3444
|
if (f = null, t.right && !i) {
|
|
3455
|
-
for (d = t; d !== null && d.right !== null && (d.right.redone ||
|
|
3445
|
+
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);
|
|
3456
3446
|
if (d && d.right !== null) return null;
|
|
3457
3447
|
} else d = p._map.get(t.parentSub) || null;
|
|
3458
3448
|
d !== null && d.parent._item !== u && (d = p._map.get(t.parentSub) || null);
|
|
3459
3449
|
}
|
|
3460
3450
|
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());
|
|
3461
|
-
return t.redone = ee,
|
|
3462
|
-
}, Q = class e extends
|
|
3451
|
+
return t.redone = ee, ts(m, !0), m.integrate(e, 0), m;
|
|
3452
|
+
}, Q = class e extends Do {
|
|
3463
3453
|
constructor(e, t, n, r, i, a, o, s) {
|
|
3464
3454
|
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;
|
|
3465
3455
|
}
|
|
@@ -3490,17 +3480,17 @@ var ba = class {
|
|
|
3490
3480
|
getMissing(t, n) {
|
|
3491
3481
|
if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= B(n, this.origin.client)) return this.origin.client;
|
|
3492
3482
|
if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= B(n, this.rightOrigin.client)) return this.rightOrigin.client;
|
|
3493
|
-
if (this.parent && this.parent.constructor ===
|
|
3494
|
-
if (this.origin &&= (this.left =
|
|
3483
|
+
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;
|
|
3484
|
+
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;
|
|
3495
3485
|
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);
|
|
3496
|
-
else if (this.parent.constructor ===
|
|
3497
|
-
let e =
|
|
3498
|
-
e.constructor === J ?
|
|
3486
|
+
else if (this.parent.constructor === Ci) {
|
|
3487
|
+
let e = Ui(n, this.parent);
|
|
3488
|
+
this.parent = e.constructor === J ? null : e.content.type;
|
|
3499
3489
|
}
|
|
3500
3490
|
return null;
|
|
3501
3491
|
}
|
|
3502
3492
|
integrate(e, t) {
|
|
3503
|
-
if (t > 0 && (this.id.clock += t, this.left =
|
|
3493
|
+
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) {
|
|
3504
3494
|
if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) {
|
|
3505
3495
|
let t = this.left, n;
|
|
3506
3496
|
if (t !== null) n = t.right;
|
|
@@ -3508,10 +3498,10 @@ var ba = class {
|
|
|
3508
3498
|
else n = this.parent._start;
|
|
3509
3499
|
let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
3510
3500
|
for (; n !== null && n !== this.right;) {
|
|
3511
|
-
if (i.add(n), r.add(n),
|
|
3501
|
+
if (i.add(n), r.add(n), wi(this.origin, n.origin)) {
|
|
3512
3502
|
if (n.id.client < this.id.client) t = n, r.clear();
|
|
3513
|
-
else if (
|
|
3514
|
-
} else if (n.origin !== null && i.has(
|
|
3503
|
+
else if (wi(this.rightOrigin, n.rightOrigin)) break;
|
|
3504
|
+
} 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());
|
|
3515
3505
|
else break;
|
|
3516
3506
|
n = n.right;
|
|
3517
3507
|
}
|
|
@@ -3526,7 +3516,7 @@ var ba = class {
|
|
|
3526
3516
|
else e = this.parent._start, this.parent._start = this;
|
|
3527
3517
|
this.right = e;
|
|
3528
3518
|
}
|
|
3529
|
-
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),
|
|
3519
|
+
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);
|
|
3530
3520
|
} else new J(this.id, this.length).integrate(e, 0);
|
|
3531
3521
|
}
|
|
3532
3522
|
get next() {
|
|
@@ -3543,7 +3533,7 @@ var ba = class {
|
|
|
3543
3533
|
return this.length === 1 ? this.id : R(this.id.client, this.id.clock + this.length - 1);
|
|
3544
3534
|
}
|
|
3545
3535
|
mergeWith(e) {
|
|
3546
|
-
if (this.constructor === e.constructor &&
|
|
3536
|
+
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)) {
|
|
3547
3537
|
let t = this.parent._searchMarker;
|
|
3548
3538
|
return t && t.forEach((t) => {
|
|
3549
3539
|
t.p === e && (t.p = this, !this.deleted && this.countable && (t.index -= this.length));
|
|
@@ -3554,12 +3544,12 @@ var ba = class {
|
|
|
3554
3544
|
delete(e) {
|
|
3555
3545
|
if (!this.deleted) {
|
|
3556
3546
|
let t = this.parent;
|
|
3557
|
-
this.countable && this.parentSub === null && (t._length -= this.length), this.markDeleted(),
|
|
3547
|
+
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);
|
|
3558
3548
|
}
|
|
3559
3549
|
}
|
|
3560
3550
|
gc(e, t) {
|
|
3561
|
-
if (!this.deleted) throw
|
|
3562
|
-
this.content.gc(e), t ?
|
|
3551
|
+
if (!this.deleted) throw C();
|
|
3552
|
+
this.content.gc(e), t ? Ki(e, this, new J(this.id, this.length)) : this.content = new jo(this.length);
|
|
3563
3553
|
}
|
|
3564
3554
|
write(e, t) {
|
|
3565
3555
|
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);
|
|
@@ -3568,147 +3558,48 @@ var ba = class {
|
|
|
3568
3558
|
if (t._item !== void 0) {
|
|
3569
3559
|
let n = t._item;
|
|
3570
3560
|
if (n === null) {
|
|
3571
|
-
let n =
|
|
3561
|
+
let n = Ti(t);
|
|
3572
3562
|
e.writeParentInfo(!0), e.writeString(n);
|
|
3573
3563
|
} else e.writeParentInfo(!1), e.writeLeftID(n.id);
|
|
3574
|
-
} else t.constructor === String ? (e.writeParentInfo(!0), e.writeString(t)) : t.constructor ===
|
|
3564
|
+
} else t.constructor === String ? (e.writeParentInfo(!0), e.writeString(t)) : t.constructor === Ci ? (e.writeParentInfo(!1), e.writeLeftID(t)) : C();
|
|
3575
3565
|
i !== null && e.writeString(i);
|
|
3576
3566
|
}
|
|
3577
3567
|
this.content.write(e, t);
|
|
3578
3568
|
}
|
|
3579
|
-
},
|
|
3569
|
+
}, as = (e, t) => os[t & 31](e), os = [
|
|
3580
3570
|
() => {
|
|
3581
|
-
|
|
3571
|
+
C();
|
|
3582
3572
|
},
|
|
3583
|
-
|
|
3584
|
-
|
|
3573
|
+
Mo,
|
|
3574
|
+
Bo,
|
|
3575
|
+
Ao,
|
|
3585
3576
|
Wo,
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
Yo,
|
|
3577
|
+
Lo,
|
|
3578
|
+
Ro,
|
|
3579
|
+
$o,
|
|
3580
|
+
Uo,
|
|
3581
|
+
Fo,
|
|
3592
3582
|
() => {
|
|
3593
|
-
|
|
3583
|
+
C();
|
|
3594
3584
|
}
|
|
3595
|
-
],
|
|
3585
|
+
], ss = 10, $ = class extends Do {
|
|
3596
3586
|
get deleted() {
|
|
3597
3587
|
return !0;
|
|
3598
3588
|
}
|
|
3599
3589
|
delete() {}
|
|
3600
3590
|
mergeWith(e) {
|
|
3601
|
-
return this.constructor === e.constructor
|
|
3591
|
+
return this.constructor === e.constructor && (this.length += e.length, !0);
|
|
3602
3592
|
}
|
|
3603
3593
|
integrate(e, t) {
|
|
3604
|
-
|
|
3594
|
+
C();
|
|
3605
3595
|
}
|
|
3606
3596
|
write(e, t) {
|
|
3607
|
-
e.writeInfo(
|
|
3597
|
+
e.writeInfo(ss), v(e.restEncoder, this.length - t);
|
|
3608
3598
|
}
|
|
3609
3599
|
getMissing(e, t) {
|
|
3610
3600
|
return null;
|
|
3611
3601
|
}
|
|
3612
|
-
},
|
|
3613
|
-
|
|
3614
|
-
//#endregion
|
|
3615
|
-
//#region ../node_modules/.bun/y-protocols@1.0.7+253afa400b9c0a30/node_modules/y-protocols/awareness.js
|
|
3616
|
-
var ws = 3e4, Ts = class extends ee {
|
|
3617
|
-
constructor(e) {
|
|
3618
|
-
super(), this.doc = e, this.clientID = e.clientID, this.states = /* @__PURE__ */ new Map(), this.meta = /* @__PURE__ */ new Map(), this._checkInterval = setInterval(() => {
|
|
3619
|
-
let e = bt();
|
|
3620
|
-
this.getLocalState() !== null && 3e4 / 2 <= e - this.meta.get(this.clientID).lastUpdated && this.setLocalState(this.getLocalState());
|
|
3621
|
-
let t = [];
|
|
3622
|
-
this.meta.forEach((n, r) => {
|
|
3623
|
-
r !== this.clientID && 3e4 <= e - n.lastUpdated && this.states.has(r) && t.push(r);
|
|
3624
|
-
}), t.length > 0 && Es(this, t, "timeout");
|
|
3625
|
-
}, m(ws / 10)), e.on("destroy", () => {
|
|
3626
|
-
this.destroy();
|
|
3627
|
-
}), this.setLocalState({});
|
|
3628
|
-
}
|
|
3629
|
-
destroy() {
|
|
3630
|
-
this.emit("destroy", [this]), this.setLocalState(null), super.destroy(), clearInterval(this._checkInterval);
|
|
3631
|
-
}
|
|
3632
|
-
getLocalState() {
|
|
3633
|
-
return this.states.get(this.clientID) || null;
|
|
3634
|
-
}
|
|
3635
|
-
setLocalState(e) {
|
|
3636
|
-
let t = this.clientID, n = this.meta.get(t), r = n === void 0 ? 0 : n.clock + 1, i = this.states.get(t);
|
|
3637
|
-
e === null ? this.states.delete(t) : this.states.set(t, e), this.meta.set(t, {
|
|
3638
|
-
clock: r,
|
|
3639
|
-
lastUpdated: bt()
|
|
3640
|
-
});
|
|
3641
|
-
let a = [], o = [], s = [], c = [];
|
|
3642
|
-
e === null ? c.push(t) : i == null ? e != null && a.push(t) : (o.push(t), Wt(i, e) || s.push(t)), (a.length > 0 || s.length > 0 || c.length > 0) && this.emit("change", [{
|
|
3643
|
-
added: a,
|
|
3644
|
-
updated: s,
|
|
3645
|
-
removed: c
|
|
3646
|
-
}, "local"]), this.emit("update", [{
|
|
3647
|
-
added: a,
|
|
3648
|
-
updated: o,
|
|
3649
|
-
removed: c
|
|
3650
|
-
}, "local"]);
|
|
3651
|
-
}
|
|
3652
|
-
setLocalStateField(e, t) {
|
|
3653
|
-
let n = this.getLocalState();
|
|
3654
|
-
n !== null && this.setLocalState({
|
|
3655
|
-
...n,
|
|
3656
|
-
[e]: t
|
|
3657
|
-
});
|
|
3658
|
-
}
|
|
3659
|
-
getStates() {
|
|
3660
|
-
return this.states;
|
|
3661
|
-
}
|
|
3662
|
-
}, Es = (e, t, n) => {
|
|
3663
|
-
let r = [];
|
|
3664
|
-
for (let n = 0; n < t.length; n++) {
|
|
3665
|
-
let i = t[n];
|
|
3666
|
-
if (e.states.has(i)) {
|
|
3667
|
-
if (e.states.delete(i), i === e.clientID) {
|
|
3668
|
-
let t = e.meta.get(i);
|
|
3669
|
-
e.meta.set(i, {
|
|
3670
|
-
clock: t.clock + 1,
|
|
3671
|
-
lastUpdated: bt()
|
|
3672
|
-
});
|
|
3673
|
-
}
|
|
3674
|
-
r.push(i);
|
|
3675
|
-
}
|
|
3676
|
-
}
|
|
3677
|
-
r.length > 0 && (e.emit("change", [{
|
|
3678
|
-
added: [],
|
|
3679
|
-
updated: [],
|
|
3680
|
-
removed: r
|
|
3681
|
-
}, n]), e.emit("update", [{
|
|
3682
|
-
added: [],
|
|
3683
|
-
updated: [],
|
|
3684
|
-
removed: r
|
|
3685
|
-
}, n]));
|
|
3686
|
-
}, Ds = (e, t, n = e.states) => {
|
|
3687
|
-
let r = t.length, i = g();
|
|
3688
|
-
y(i, r);
|
|
3689
|
-
for (let a = 0; a < r; a++) {
|
|
3690
|
-
let r = t[a], o = n.get(r) || null, s = e.meta.get(r).clock;
|
|
3691
|
-
y(i, r), y(i, s), b(i, JSON.stringify(o));
|
|
3692
|
-
}
|
|
3693
|
-
return _(i);
|
|
3694
|
-
}, Os = (e, t, n) => {
|
|
3695
|
-
let r = T(t), i = bt(), a = [], o = [], s = [], c = [], l = D(r);
|
|
3696
|
-
for (let t = 0; t < l; t++) {
|
|
3697
|
-
let t = D(r), n = D(r), l = JSON.parse(O(r)), u = e.meta.get(t), d = e.states.get(t), f = u === void 0 ? 0 : u.clock;
|
|
3698
|
-
(f < n || f === n && l === null && e.states.has(t)) && (l === null ? t === e.clientID && e.getLocalState() != null ? n++ : e.states.delete(t) : e.states.set(t, l), e.meta.set(t, {
|
|
3699
|
-
clock: n,
|
|
3700
|
-
lastUpdated: i
|
|
3701
|
-
}), u === void 0 && l !== null ? a.push(t) : u !== void 0 && l === null ? c.push(t) : l !== null && (Wt(l, d) || s.push(t), o.push(t)));
|
|
3702
|
-
}
|
|
3703
|
-
(a.length > 0 || s.length > 0 || c.length > 0) && e.emit("change", [{
|
|
3704
|
-
added: a,
|
|
3705
|
-
updated: s,
|
|
3706
|
-
removed: c
|
|
3707
|
-
}, n]), (a.length > 0 || o.length > 0 || c.length > 0) && e.emit("update", [{
|
|
3708
|
-
added: a,
|
|
3709
|
-
updated: o,
|
|
3710
|
-
removed: c
|
|
3711
|
-
}, n]);
|
|
3712
|
-
};
|
|
3602
|
+
}, cs = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, ls = "__ $YJS$ __";
|
|
3603
|
+
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;
|
|
3713
3604
|
//#endregion
|
|
3714
|
-
export {
|
|
3605
|
+
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 };
|