@jxsuite/studio 6.1.1 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/chunks/2020-5wtzce5g.js +4 -0
- package/dist/chunks/{action-group-2mqby73c.js → action-group-4aan7g6g.js} +3 -3
- package/dist/chunks/adapter-5tphg7xe.js +4 -0
- package/dist/chunks/add-new-flow-psym14sn.js +4 -0
- package/dist/chunks/cf-account-picker-haqazq5r.js +4 -0
- package/dist/chunks/cf-settings-h2wrh6hq.js +4 -0
- package/dist/chunks/color-area-6rbra5dy.js +4 -0
- package/dist/chunks/color-field-gy56c94g.js +4 -0
- package/dist/chunks/color-m7r1vk54.js +4 -0
- package/dist/chunks/color-slider-sqqdyf6c.js +4 -0
- package/dist/chunks/combobox-72h32ejk.js +4 -0
- package/dist/chunks/components-r22xca09.js +4 -0
- package/dist/chunks/content-source-mmppmcyg.js +4 -0
- package/dist/chunks/convert-to-repeater-he70fc2b.js +4 -0
- package/dist/chunks/dialog-c4x05vyx.js +4 -0
- package/dist/chunks/editor-ccd9jwsa.js +4 -0
- package/dist/chunks/entry-commands-6qxz9e8p.js +4 -0
- package/dist/chunks/extension-sections-0egb88dm.js +4 -0
- package/dist/chunks/file-ops-qnab36ek.js +4 -0
- package/dist/chunks/files-rcn56qvm.js +4 -0
- package/dist/chunks/format-host-yxz0kjjs.js +4 -0
- package/dist/chunks/fs-events-d1qxq4z4.js +4 -0
- package/dist/chunks/grid-open-4z1g062t.js +4 -0
- package/dist/chunks/grid-view-qg1b5eqx.js +51 -0
- package/dist/chunks/icons-63bjtbs7.js +4 -0
- package/dist/chunks/iframe-entry-2zggzajv.js +5 -0
- package/dist/chunks/iframe-entry-76j8vwwx.js +5 -0
- package/dist/chunks/iframe-entry-99nr5zfb.js +5 -0
- package/dist/chunks/iframe-entry-pkgmcgp0.js +5 -0
- package/dist/chunks/iframe-host-ssv7kyj0.js +4 -0
- package/dist/chunks/{index-2veqmnhr.js → index-32eqzv1k.js} +3 -3
- package/dist/chunks/index-f0jn7nnp.js +4 -0
- package/dist/chunks/{javascript-8nbvs12s.js → javascript-pjp734q4.js} +3 -3
- package/dist/chunks/jsonMode-njkvsa02.js +13 -0
- package/dist/chunks/jx-validate-ttasrbh7.js +4 -0
- package/dist/chunks/layers-bgyr11tr.js +4 -0
- package/dist/chunks/layers-panel-7ez66zeq.js +4 -0
- package/dist/chunks/listbox-c421cf8c.js +4 -0
- package/dist/chunks/lit-html-v9gh687x.js +4 -0
- package/dist/chunks/media-library-sq468wts.js +4 -0
- package/dist/chunks/media-picker-shfe59pt.js +4 -0
- package/dist/chunks/menu-bdpzbfvs.js +4 -0
- package/dist/chunks/monaco-binding-vq1hgnn0.js +4 -0
- package/dist/chunks/monaco-buffer-3afgwvbp.js +4 -0
- package/dist/chunks/monaco-setup-xrd2cbkp.js +4 -0
- package/dist/chunks/notify-kzrjr3fv.js +4 -0
- package/dist/chunks/number-field-y62xq0ty.js +4 -0
- package/dist/chunks/parse-v77xtwv7.js +4 -0
- package/dist/chunks/platform-7v4rtd7m.js +4 -0
- package/dist/chunks/popover-b89sfej7.js +4 -0
- package/dist/chunks/publish-panel-2z9gw8ee.js +4 -0
- package/dist/chunks/publish-quick-qx2455cj.js +4 -0
- package/dist/chunks/publish-workspace-wrc1dgwx.js +4 -0
- package/dist/chunks/quick-search-n0t0eqxb.js +4 -0
- package/dist/chunks/references-9547rg5s.js +4 -0
- package/dist/chunks/right-panel-wsgnr9pn.js +4 -0
- package/dist/chunks/select-rzds841e.js +4 -0
- package/dist/chunks/source-control-kwktr9y6.js +4 -0
- package/dist/chunks/split-c9zfdgxf.js +4 -0
- package/dist/chunks/studio-03ct6yfv.js +9 -0
- package/dist/chunks/studio-07rcfje3.js +5 -0
- package/dist/chunks/studio-3e54qh39.js +7 -0
- package/dist/chunks/studio-3exxhz5g.js +5 -0
- package/dist/chunks/studio-3q40e3rj.js +5 -0
- package/dist/chunks/studio-3qeh9t0h.js +6 -0
- package/dist/chunks/studio-3qqjeep5.js +6 -0
- package/dist/chunks/studio-43sd2mam.js +4 -0
- package/dist/chunks/studio-4hp8pkyt.js +5 -0
- package/dist/chunks/studio-58xg6j2q.js +9 -0
- package/dist/chunks/studio-5g0rprdt.js +7 -0
- package/dist/chunks/studio-6m380wp7.js +5 -0
- package/dist/chunks/studio-80jyh1xh.js +4 -0
- package/dist/chunks/studio-83mk4bgg.js +9 -0
- package/dist/chunks/{studio-kggey1jt.js → studio-881z1xrx.js} +4 -4
- package/dist/chunks/studio-8m0y2qe7.js +5 -0
- package/dist/chunks/studio-8tr6cfrc.js +5 -0
- package/dist/chunks/studio-8vcvfs7r.js +6 -0
- package/dist/chunks/studio-9tmebf0s.js +5 -0
- package/dist/chunks/studio-a2bvaptz.js +5 -0
- package/dist/chunks/studio-b7y5mr30.js +5 -0
- package/dist/chunks/studio-bavb31r0.js +5 -0
- package/dist/chunks/studio-bbe4c90a.js +5 -0
- package/dist/chunks/studio-c05wdnt3.js +5 -0
- package/dist/chunks/studio-ccv2svc6.js +5 -0
- package/dist/chunks/studio-d5grtb9e.js +16 -0
- package/dist/chunks/studio-df0baea9.js +5 -0
- package/dist/chunks/studio-dgk4dqtx.js +7 -0
- package/dist/chunks/studio-e1g64q43.js +5 -0
- package/dist/chunks/studio-ed1hp6zf.js +6 -0
- package/dist/chunks/studio-ed3xx40h.js +7 -0
- package/dist/chunks/studio-f14e1zdj.js +5 -0
- package/dist/chunks/studio-fbhxxc5f.js +5 -0
- package/dist/chunks/studio-fyh0jc96.js +5 -0
- package/dist/chunks/studio-gcxk20n7.js +5 -0
- package/dist/chunks/studio-jaaz8ce9.js +5 -0
- package/dist/chunks/{studio-8grwxtqk.js → studio-jcnsdaep.js} +4 -4
- package/dist/chunks/studio-jsgf2q5k.js +7 -0
- package/dist/chunks/{studio-1q1sh2ax.js → studio-k3xxbagr.js} +3 -3
- package/dist/chunks/studio-k7evxqh4.js +5 -0
- package/dist/chunks/studio-kt3pjkwd.js +5 -0
- package/dist/chunks/studio-m8g16bgz.js +5 -0
- package/dist/chunks/studio-mn0476ag.js +5 -0
- package/dist/chunks/studio-mx1smyq0.js +5 -0
- package/dist/chunks/studio-n0c5h6mf.js +5 -0
- package/dist/chunks/{studio-rv11kfwa.js → studio-nh6d342n.js} +7 -7
- package/dist/chunks/studio-nqxqf8p2.js +4 -0
- package/dist/chunks/studio-p4nrkvqr.js +5 -0
- package/dist/chunks/{studio-h46vtzk8.js → studio-pbxa5fpc.js} +4 -4
- package/dist/chunks/studio-pgmvdv7z.js +7 -0
- package/dist/chunks/studio-ph84avkf.js +5 -0
- package/dist/chunks/{studio-wszjyh0j.js → studio-q0mvbaq6.js} +4 -4
- package/dist/chunks/studio-q0tccd43.js +5 -0
- package/dist/chunks/studio-q7rtx6zq.js +14 -0
- package/dist/chunks/{studio-pre0skq6.js → studio-qgh13jtz.js} +4 -4
- package/dist/chunks/studio-qmn1xc24.js +5 -0
- package/dist/chunks/studio-qwdqwkj0.js +5 -0
- package/dist/chunks/{studio-t6b6qe31.js → studio-r5qy30vx.js} +4 -4
- package/dist/chunks/studio-rj9eamf8.js +5 -0
- package/dist/chunks/studio-rptgsk96.js +5 -0
- package/dist/chunks/studio-rthyg42z.js +928 -0
- package/dist/chunks/studio-s19tp1xr.js +5 -0
- package/dist/chunks/studio-s32578pn.js +5 -0
- package/dist/chunks/studio-svb7yyve.js +5 -0
- package/dist/chunks/studio-syreb644.js +5 -0
- package/dist/chunks/studio-tf9jryb1.js +10 -0
- package/dist/chunks/studio-tfkznv39.js +5 -0
- package/dist/chunks/studio-tft6r105.js +5 -0
- package/dist/chunks/studio-txf2kysx.js +5 -0
- package/dist/chunks/studio-v8867ddv.js +12 -0
- package/dist/chunks/studio-vxq7fcvv.js +5 -0
- package/dist/chunks/studio-w4rz9hdk.js +5 -0
- package/dist/chunks/studio-wbcjbhy1.js +9 -0
- package/dist/chunks/studio-wc649wss.js +5 -0
- package/dist/chunks/studio-wys23mxz.js +5 -0
- package/dist/chunks/studio-x1x167jh.js +5 -0
- package/dist/chunks/studio-x9hsze61.js +5 -0
- package/dist/chunks/studio-y0n7yxea.js +9 -0
- package/dist/chunks/studio-y3ahhdpx.js +5 -0
- package/dist/chunks/studio-z97c48fk.js +5 -0
- package/dist/chunks/studio-zat62m0c.js +5 -0
- package/dist/chunks/studio-zcd2e7yz.js +5 -0
- package/dist/chunks/studio-zz9qe3rw.js +64 -0
- package/dist/chunks/swatch-group-ewh24n1f.js +4 -0
- package/dist/chunks/tabs-f5cw3tgp.js +4 -0
- package/dist/chunks/textfield-wewc8rq2.js +4 -0
- package/dist/chunks/toast-1gv0h53h.js +4 -0
- package/dist/chunks/toast-host-1yg5ar8d.js +4 -0
- package/dist/chunks/{toolbar-2nnzqhrj.js → toolbar-44cm5cta.js} +3 -3
- package/dist/chunks/tooltip-yypz28gq.js +4 -0
- package/dist/chunks/tree-9xa4hm7n.js +4 -0
- package/dist/chunks/tsMode-epyfz1hv.js +14 -0
- package/dist/chunks/workspace-dz7nxfhv.js +4 -0
- package/dist/chunks/workspace-home-xsd7hkjw.js +4 -0
- package/dist/chunks/ws-client-bv552sfx.js +4 -0
- package/dist/iframe-entry.js +20 -16
- package/dist/manifest.json +77 -63
- package/dist/studio.js +106 -107
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +17 -16
- package/src/about/about-modal.ts +4 -3
- package/src/account/action-flow.ts +45 -38
- package/src/account-status.ts +7 -2
- package/src/browse/component-examples.ts +272 -0
- package/src/browse/library-commands.ts +64 -104
- package/src/browse/library-layouts.ts +270 -53
- package/src/browse/library-model.ts +194 -134
- package/src/browse/library-pane.ts +748 -440
- package/src/browse/library-preview.ts +161 -26
- package/src/browse/library-source.ts +308 -41
- package/src/browse/preview-root.ts +78 -0
- package/src/browse/preview-style.ts +155 -0
- package/src/canvas/asset-refs.ts +40 -10
- package/src/canvas/asset-resolve.ts +19 -23
- package/src/canvas/canvas-helpers.ts +7 -6
- package/src/canvas/canvas-live-render.ts +260 -77
- package/src/canvas/canvas-origin.ts +37 -12
- package/src/canvas/canvas-page-context.ts +112 -0
- package/src/canvas/canvas-patcher.ts +30 -30
- package/src/canvas/canvas-perf.ts +11 -5
- package/src/canvas/canvas-render.ts +175 -148
- package/src/canvas/canvas-surface.ts +5 -3
- package/src/canvas/canvas-utils.ts +147 -61
- package/src/canvas/dialog-path.ts +9 -4
- package/src/canvas/dialog-state.ts +1 -2
- package/src/canvas/diff-marks.ts +9 -16
- package/src/canvas/diff-toolbar.ts +8 -7
- package/src/canvas/edit-width-drag.ts +4 -1
- package/src/canvas/edit-width.ts +1 -3
- package/src/canvas/iframe-channel.ts +27 -13
- package/src/canvas/iframe-drop.ts +120 -12
- package/src/canvas/iframe-editable-root.ts +29 -16
- package/src/canvas/iframe-entry.ts +104 -75
- package/src/canvas/iframe-eval.ts +73 -49
- package/src/canvas/iframe-host.ts +269 -158
- package/src/canvas/iframe-inline-edit.ts +49 -30
- package/src/canvas/iframe-insert.ts +5 -4
- package/src/canvas/iframe-interaction.ts +30 -25
- package/src/canvas/iframe-keys.ts +11 -0
- package/src/canvas/iframe-overlay.ts +1 -1
- package/src/canvas/iframe-patch.ts +25 -21
- package/src/canvas/iframe-position.ts +12 -6
- package/src/canvas/iframe-protocol.ts +36 -21
- package/src/canvas/iframe-render.ts +84 -35
- package/src/canvas/iframe-slash.ts +24 -11
- package/src/canvas/iframe-subtree.ts +10 -3
- package/src/canvas/npm-modules.ts +22 -0
- package/src/canvas/path-mapping.ts +19 -12
- package/src/canvas/popover-path.ts +7 -3
- package/src/canvas/popover-state.ts +1 -2
- package/src/canvas/preview-navigate.ts +16 -0
- package/src/canvas/repeater-sources.ts +200 -0
- package/src/canvas/serialize-scope.ts +13 -5
- package/src/canvas/stage-scrollbar.ts +7 -2
- package/src/canvas/surface-registry.ts +27 -3
- package/src/collab/collab-commands.ts +7 -2
- package/src/collab/collab-session.ts +84 -45
- package/src/collab/collab-state.ts +4 -3
- package/src/collab/monaco-binding.ts +16 -13
- package/src/collab/monaco-cursors.ts +5 -2
- package/src/commands/app-commands.ts +16 -6
- package/src/commands/budget.ts +13 -11
- package/src/commands/command-args.ts +103 -71
- package/src/commands/context.ts +55 -28
- package/src/commands/defaults.ts +69 -45
- package/src/commands/keymap.ts +56 -43
- package/src/commands/levels.ts +14 -8
- package/src/commands/live-context.ts +9 -7
- package/src/commands/reference.ts +2 -1
- package/src/commands/registry.ts +22 -11
- package/src/commands/run-reported.ts +15 -10
- package/src/component-props.ts +46 -30
- package/src/content/collection-match.ts +11 -9
- package/src/content/collection-pages.ts +412 -0
- package/src/content/content-collections.ts +270 -0
- package/src/content/draft-state.ts +4 -3
- package/src/content/entry-commands.ts +54 -62
- package/src/content/entry-editor.ts +137 -32
- package/src/content/entry-fields.ts +25 -8
- package/src/content/entry-inspector.ts +225 -0
- package/src/content/entry-model.ts +38 -15
- package/src/content/entry-open.ts +80 -0
- package/src/content/entry-summaries.ts +440 -0
- package/src/content/file-record-ids.ts +80 -0
- package/src/content/file-records.ts +125 -0
- package/src/content/page-summaries.ts +129 -0
- package/src/content/record-entry.ts +201 -0
- package/src/content/writing-banner.ts +177 -0
- package/src/create/add-new-commands.ts +185 -0
- package/src/create/add-new-flow.ts +1116 -0
- package/src/create/add-new.ts +1014 -0
- package/src/create/element-name.ts +121 -0
- package/src/editor/canvas-context-menu.ts +1 -2
- package/src/editor/canvas-slash-bridge.ts +3 -6
- package/src/editor/content-slice.ts +16 -14
- package/src/editor/context-menu.ts +35 -22
- package/src/editor/convert-targets.ts +30 -35
- package/src/editor/convert-to-component.ts +78 -48
- package/src/editor/convert-to-repeater.ts +34 -22
- package/src/editor/editable-tags.ts +17 -2
- package/src/editor/file-drop-action.ts +29 -22
- package/src/editor/inline-edit-apply.ts +79 -17
- package/src/editor/inline-edit.ts +76 -50
- package/src/editor/inline-format.ts +59 -56
- package/src/editor/inline-link.ts +40 -15
- package/src/editor/insert-component.ts +91 -0
- package/src/editor/insert-zone-action.ts +14 -5
- package/src/editor/merge-tags.ts +58 -19
- package/src/editor/repeater-scope.ts +39 -28
- package/src/editor/shortcuts.ts +76 -42
- package/src/editor/slash-menu.ts +52 -14
- package/src/files/asset-versions.ts +4 -4
- package/src/files/components.ts +89 -20
- package/src/files/elements.ts +5 -6
- package/src/files/file-ops.ts +92 -41
- package/src/files/files.ts +248 -239
- package/src/files/fs-events.ts +18 -7
- package/src/files/media-meta.ts +97 -2
- package/src/files/media-paths.ts +3 -0
- package/src/files/media-types.ts +55 -0
- package/src/files/media-upload.ts +209 -52
- package/src/files/new-file-name.ts +156 -0
- package/src/files/serialize-document.ts +15 -5
- package/src/format/constraints.ts +1 -1
- package/src/format/convert-file.ts +27 -13
- package/src/format/format-choices.ts +2 -1
- package/src/format/format-host.ts +91 -50
- package/src/github/github-auth-status.ts +27 -3
- package/src/github/github-auth.ts +21 -11
- package/src/github/github-publish.ts +28 -23
- package/src/grid/cell-editors.ts +46 -31
- package/src/grid/cell-popovers.ts +5 -3
- package/src/grid/edit-buffer.ts +10 -9
- package/src/grid/grid-controller.ts +25 -23
- package/src/grid/grid-layout.ts +21 -5
- package/src/grid/grid-open.ts +3 -33
- package/src/grid/grid-panel.ts +65 -6
- package/src/grid/grid-reveal.ts +34 -0
- package/src/grid/grid-source.ts +9 -31
- package/src/grid/grid-view.ts +45 -23
- package/src/grid/redirects-grid.ts +14 -5
- package/src/grid/redirects.ts +16 -14
- package/src/grid/schema-columns.ts +25 -19
- package/src/grid/sources/connector-source.ts +47 -20
- package/src/grid/sources/content-source.ts +100 -31
- package/src/grid/sources/csv-file-source.ts +2 -2
- package/src/grid/tabulator-tables.d.ts +61 -34
- package/src/hosting/document.ts +2 -2
- package/src/hosting/stage.ts +7 -7
- package/src/i18n/i18n-commands.ts +3 -3
- package/src/media/media-commands.ts +181 -0
- package/src/media/media-library-model.ts +232 -0
- package/src/media/media-library.ts +1283 -0
- package/src/media/media-pane.ts +51 -20
- package/src/new-project/add-repo-modal.ts +20 -19
- package/src/new-project/import-tab.ts +10 -14
- package/src/new-project/location-fields.ts +2 -1
- package/src/new-project/new-project-modal.ts +12 -9
- package/src/packages/jxsuite-update.ts +4 -3
- package/src/packages/pull-package-sync.ts +26 -25
- package/src/page-params.ts +97 -68
- package/src/panels/activity-panel.ts +38 -14
- package/src/panels/ai-chat/attached-context.ts +13 -7
- package/src/panels/ai-chat/chat-markdown.ts +8 -8
- package/src/panels/ai-chat/chat-view.ts +80 -73
- package/src/panels/ai-chat/composer.ts +30 -33
- package/src/panels/ai-chat/sessions-view.ts +1 -2
- package/src/panels/ai-panel.ts +23 -20
- package/src/panels/block-action-bar.ts +57 -46
- package/src/panels/bottom-dock.ts +5 -3
- package/src/panels/canvas-dnd-bridge.ts +36 -26
- package/src/panels/chat-panel.ts +6 -6
- package/src/panels/collections-panel.ts +306 -0
- package/src/panels/component-preview.ts +35 -13
- package/src/panels/data-explorer.ts +63 -26
- package/src/panels/data-grid.ts +18 -11
- package/src/panels/dnd.ts +115 -138
- package/src/panels/editors.ts +52 -21
- package/src/panels/elements-panel.ts +19 -5
- package/src/panels/empty-state.ts +2 -2
- package/src/panels/events-panel.ts +84 -69
- package/src/panels/formula-workspace.ts +78 -54
- package/src/panels/frontmatter-fields.ts +33 -28
- package/src/panels/git-diff-open.ts +10 -6
- package/src/panels/head-panel.ts +488 -202
- package/src/panels/i18n-panel.ts +20 -12
- package/src/panels/imports-panel.ts +25 -47
- package/src/panels/jump-bar.ts +75 -31
- package/src/panels/layers-panel.ts +130 -101
- package/src/panels/left-panel.ts +25 -11
- package/src/panels/navigator-panels.ts +23 -11
- package/src/panels/pane-context.ts +140 -49
- package/src/panels/pane-grid.ts +55 -26
- package/src/panels/panel-registry.ts +36 -46
- package/src/panels/properties-panel.ts +182 -124
- package/src/panels/quick-search.ts +53 -31
- package/src/panels/right-panel.ts +201 -45
- package/src/panels/seo-modal.ts +54 -125
- package/src/panels/settings-menu.ts +63 -61
- package/src/panels/settings-pane.ts +268 -162
- package/src/panels/signals-panel.ts +156 -135
- package/src/panels/site-model.ts +367 -0
- package/src/panels/site-panel.ts +638 -0
- package/src/panels/statement-editor.ts +230 -140
- package/src/panels/style-panel.ts +253 -206
- package/src/panels/style-utils.ts +114 -51
- package/src/panels/stylebook-doc.ts +195 -60
- package/src/panels/stylebook-layers-panel.ts +48 -89
- package/src/panels/stylebook-panel.ts +60 -27
- package/src/panels/styles-panel.ts +327 -0
- package/src/panels/tab-drop.ts +27 -11
- package/src/panels/tab-strip.ts +143 -49
- package/src/platform-errors.ts +57 -43
- package/src/platform.ts +59 -31
- package/src/platforms/cloud.ts +373 -176
- package/src/platforms/default-platform.ts +14 -8
- package/src/platforms/devserver.ts +180 -142
- package/src/platforms/read-batcher.ts +16 -8
- package/src/project-list.ts +2 -1
- package/src/publish/deploy-checklist.ts +20 -9
- package/src/publish/pages-service.ts +66 -27
- package/src/publish/publish-changes.ts +491 -0
- package/src/publish/publish-commands.ts +88 -22
- package/src/publish/publish-ids.ts +49 -0
- package/src/publish/publish-panel.ts +10 -6
- package/src/publish/publish-quick.ts +148 -0
- package/src/publish/publish-workspace.ts +926 -0
- package/src/publish/source-control.ts +907 -0
- package/src/recent-projects.ts +15 -8
- package/src/resize-edges.ts +26 -36
- package/src/services/a11y-report.ts +26 -19
- package/src/services/agent-seed.ts +23 -11
- package/src/services/ai-ask.ts +9 -12
- package/src/services/ai-command-tools.ts +68 -62
- package/src/services/ai-import-tools.ts +80 -67
- package/src/services/ai-models.ts +17 -13
- package/src/services/ai-project-tools.ts +68 -32
- package/src/services/ai-session-store.ts +19 -10
- package/src/services/ai-system-prompt.ts +46 -20
- package/src/services/ai-tools.ts +71 -27
- package/src/services/ai-write-report.ts +20 -12
- package/src/services/ai-writes.ts +4 -4
- package/src/services/automation.ts +74 -51
- package/src/services/cem-export.ts +149 -58
- package/src/services/cf-settings.ts +4 -4
- package/src/services/clock.ts +6 -1
- package/src/services/code-services.ts +37 -31
- package/src/services/connection.ts +2 -2
- package/src/services/context-manager.ts +14 -10
- package/src/services/context-resolver.ts +20 -8
- package/src/services/data-service.ts +19 -15
- package/src/services/directory-picker.ts +20 -14
- package/src/services/document-assistant.ts +39 -19
- package/src/services/gated-registry.ts +10 -6
- package/src/services/harness/chat-reducer.ts +23 -1
- package/src/services/import-client.ts +91 -38
- package/src/services/import-seed.ts +8 -2
- package/src/services/jx-validate.ts +28 -31
- package/src/services/live-preview.ts +0 -0
- package/src/services/live-surfaces.ts +6 -3
- package/src/services/model-uri.ts +10 -2
- package/src/services/module-preloads.ts +12 -8
- package/src/services/monaco-buffer.ts +43 -24
- package/src/services/monaco-lazy.ts +7 -8
- package/src/services/monaco-setup.ts +23 -16
- package/src/services/notify.ts +44 -17
- package/src/services/popover-report.ts +25 -10
- package/src/services/preview-eval.ts +20 -8
- package/src/services/profile.ts +13 -6
- package/src/services/project-path.ts +13 -10
- package/src/services/references.ts +0 -0
- package/src/services/render-critic.ts +29 -9
- package/src/services/settings/definitions.ts +25 -14
- package/src/services/settings/kernel.ts +13 -4
- package/src/services/settings/write-queue.ts +9 -9
- package/src/services/token-lint.ts +12 -10
- package/src/services/tool-executor.ts +17 -5
- package/src/services/tool-outcomes.ts +44 -24
- package/src/services/trusted-types.ts +24 -7
- package/src/settings/contexts-section.ts +11 -8
- package/src/settings/contributed-section.ts +128 -70
- package/src/settings/css-vars-editor.ts +119 -32
- package/src/settings/defs-editor.ts +38 -35
- package/src/settings/developer-panels.ts +43 -0
- package/src/settings/extension-rows.ts +16 -8
- package/src/settings/extension-sections.ts +42 -14
- package/src/settings/extensions-section.ts +4 -1
- package/src/settings/general-settings.ts +101 -28
- package/src/settings/locales-section.ts +20 -12
- package/src/settings/preferences-dialog.ts +17 -7
- package/src/settings/preferences-keymap.ts +7 -5
- package/src/settings/preferences-sections.ts +11 -5
- package/src/settings/project-sections.ts +28 -11
- package/src/settings/schema-field-ui.ts +12 -1
- package/src/settings/section-registry.ts +116 -11
- package/src/settings/settings-dialog.ts +192 -0
- package/src/settings/settings-document.ts +186 -166
- package/src/shell/tree.ts +6 -5
- package/src/shell.ts +536 -477
- package/src/site-context.ts +101 -32
- package/src/state.ts +68 -57
- package/src/store.ts +54 -34
- package/src/studio.ts +219 -116
- package/src/style/live-preview.ts +1 -1
- package/src/style/project-styles.ts +40 -7
- package/src/style/stylebook-specimens.ts +89 -0
- package/src/style/stylebook-target.ts +26 -0
- package/src/style/tag-inheritance.ts +105 -0
- package/src/style/token-ref.ts +5 -4
- package/src/style/variables-focus.ts +61 -0
- package/src/style/variables-view.ts +235 -0
- package/src/surfaces/about.ts +18 -19
- package/src/surfaces/add-new.json +1482 -0
- package/src/surfaces/add-new.ts +325 -0
- package/src/surfaces/add-repo.ts +17 -19
- package/src/surfaces/ai-chat.ts +33 -38
- package/src/surfaces/ai-credentials-form.ts +6 -16
- package/src/surfaces/ai-managed-connect.ts +3 -4
- package/src/surfaces/ai-model-picker.ts +3 -5
- package/src/surfaces/block-action-bar.ts +22 -11
- package/src/surfaces/boot-failure.json +4 -3
- package/src/surfaces/boot-failure.ts +4 -5
- package/src/surfaces/bottom-dock.json +1 -1
- package/src/surfaces/bottom-dock.ts +9 -18
- package/src/surfaces/canvas-stage.json +30 -19
- package/src/surfaces/canvas-stage.ts +17 -16
- package/src/surfaces/cf-account-picker.ts +17 -18
- package/src/surfaces/collections-panel.json +615 -0
- package/src/surfaces/collections-panel.ts +168 -0
- package/src/surfaces/commandbar.json +241 -96
- package/src/surfaces/commandbar.ts +145 -105
- package/src/surfaces/convert-repeater.ts +17 -19
- package/src/surfaces/data-actions.ts +9 -7
- package/src/surfaces/dialog.ts +26 -28
- package/src/surfaces/diff-toolbar.ts +9 -7
- package/src/surfaces/empty-state.json +1 -1
- package/src/surfaces/empty-state.ts +7 -10
- package/src/surfaces/entry-editor.json +136 -0
- package/src/surfaces/entry-editor.ts +35 -11
- package/src/surfaces/entry-inspector.json +371 -0
- package/src/surfaces/entry-inspector.ts +143 -0
- package/src/surfaces/expression-editor.ts +11 -25
- package/src/surfaces/files-panel.ts +27 -14
- package/src/surfaces/formula-palette.ts +4 -5
- package/src/surfaces/github-auth.ts +16 -20
- package/src/surfaces/github-publish.ts +17 -22
- package/src/surfaces/grid-cell.ts +30 -31
- package/src/surfaces/grid-open.ts +10 -14
- package/src/surfaces/grid-panel.ts +13 -9
- package/src/surfaces/grid-replace.ts +13 -13
- package/src/surfaces/grid-views.ts +15 -18
- package/src/surfaces/inspector-dock.json +162 -14
- package/src/surfaces/inspector-dock.ts +59 -31
- package/src/surfaces/jump-bar.ts +5 -6
- package/src/surfaces/jxsuite-update.ts +16 -22
- package/src/surfaces/library-pane.json +670 -437
- package/src/surfaces/library-pane.ts +111 -77
- package/src/surfaces/logic-panel.ts +17 -30
- package/src/surfaces/logic-workspace.ts +13 -15
- package/src/surfaces/media-browser.json +62 -6
- package/src/surfaces/media-browser.ts +26 -11
- package/src/surfaces/media-field.json +1 -1
- package/src/surfaces/media-field.ts +4 -5
- package/src/surfaces/media-library.json +1586 -0
- package/src/surfaces/media-library.ts +282 -0
- package/src/surfaces/media-pane.ts +8 -7
- package/src/surfaces/media-pick-dialog.json +71 -0
- package/src/surfaces/media-pick-dialog.ts +132 -0
- package/src/surfaces/menu.ts +47 -23
- package/src/surfaces/navigator-dock.ts +11 -12
- package/src/surfaces/new-project.ts +27 -26
- package/src/surfaces/pane-context.json +144 -77
- package/src/surfaces/pane-context.ts +44 -25
- package/src/surfaces/pane-grid.ts +15 -10
- package/src/surfaces/panel-activity.ts +5 -6
- package/src/surfaces/panel-data.ts +3 -4
- package/src/surfaces/panel-deploy-checklist.json +12 -6
- package/src/surfaces/panel-deploy-checklist.ts +8 -7
- package/src/surfaces/panel-elements.ts +5 -7
- package/src/surfaces/panel-i18n.ts +5 -7
- package/src/surfaces/panel-imports.ts +6 -13
- package/src/surfaces/panel-outline.ts +25 -19
- package/src/surfaces/panel-page.json +72 -2
- package/src/surfaces/panel-page.ts +49 -25
- package/src/surfaces/panel-problems.ts +5 -7
- package/src/surfaces/panel-signals.json +1 -1
- package/src/surfaces/panel-signals.ts +25 -39
- package/src/surfaces/panel-stylebook-layers.json +71 -204
- package/src/surfaces/panel-stylebook-layers.ts +5 -29
- package/src/surfaces/preferences.json +120 -48
- package/src/surfaces/preferences.ts +29 -11
- package/src/surfaces/progress-modal.ts +15 -9
- package/src/surfaces/properties-panel.json +1 -1
- package/src/surfaces/properties-panel.ts +20 -42
- package/src/surfaces/publish-quick.json +428 -0
- package/src/surfaces/publish-quick.ts +165 -0
- package/src/surfaces/publish-workspace.json +2892 -0
- package/src/surfaces/publish-workspace.ts +391 -0
- package/src/surfaces/publish.ts +18 -18
- package/src/surfaces/push-plan.ts +7 -8
- package/src/surfaces/rail.json +1 -159
- package/src/surfaces/rail.ts +22 -79
- package/src/surfaces/reference-field.ts +11 -15
- package/src/surfaces/schema-builder.ts +16 -22
- package/src/surfaces/schema-form.json +10 -2
- package/src/surfaces/schema-form.ts +17 -25
- package/src/surfaces/secret-field.ts +9 -6
- package/src/surfaces/seo.json +1 -1
- package/src/surfaces/seo.ts +21 -15
- package/src/surfaces/settings-contexts.ts +9 -7
- package/src/surfaces/settings-contributed.json +5 -5
- package/src/surfaces/settings-contributed.ts +32 -12
- package/src/surfaces/settings-css-vars.json +44 -36
- package/src/surfaces/settings-css-vars.ts +82 -16
- package/src/surfaces/settings-defs.json +2 -2
- package/src/surfaces/settings-defs.ts +17 -21
- package/src/surfaces/settings-deploy.json +2 -15
- package/src/surfaces/settings-deploy.ts +9 -16
- package/src/surfaces/settings-dialog.json +51 -0
- package/src/surfaces/settings-dialog.ts +169 -0
- package/src/surfaces/settings-extensions.ts +5 -6
- package/src/surfaces/settings-head.ts +33 -39
- package/src/surfaces/settings-locales.ts +8 -20
- package/src/surfaces/settings-overview.json +3 -3
- package/src/surfaces/settings-overview.ts +14 -8
- package/src/surfaces/settings-packages.ts +8 -7
- package/src/surfaces/settings-pane.json +269 -46
- package/src/surfaces/settings-pane.ts +88 -36
- package/src/surfaces/settings-rawjson.ts +5 -6
- package/src/surfaces/shell.json +2 -1
- package/src/surfaces/shell.ts +1 -2
- package/src/surfaces/site-panel.json +1029 -0
- package/src/surfaces/site-panel.ts +233 -0
- package/src/surfaces/slash-menu.json +63 -21
- package/src/surfaces/slash-menu.ts +42 -9
- package/src/surfaces/statements.ts +13 -18
- package/src/surfaces/statusbar.ts +56 -29
- package/src/surfaces/style-panel.ts +18 -31
- package/src/surfaces/stylebook-chrome.ts +3 -5
- package/src/surfaces/styles-panel.json +735 -0
- package/src/surfaces/styles-panel.ts +195 -0
- package/src/surfaces/styles-variables.json +149 -0
- package/src/surfaces/styles-variables.ts +145 -0
- package/src/surfaces/tab-strip.json +4 -4
- package/src/surfaces/tab-strip.ts +14 -13
- package/src/surfaces/target-line.ts +6 -7
- package/src/surfaces/welcome.ts +6 -8
- package/src/surfaces/writing-banner.json +94 -0
- package/src/surfaces/writing-banner.ts +80 -0
- package/src/tabs/bare-repeaters.ts +101 -0
- package/src/tabs/patch-ops.ts +4 -3
- package/src/tabs/project-config.ts +32 -21
- package/src/tabs/selection.ts +36 -8
- package/src/tabs/tab.ts +99 -48
- package/src/tabs/transact.ts +98 -53
- package/src/types.ts +53 -43
- package/src/ui/ai-credentials-form.ts +10 -13
- package/src/ui/ai-model-picker.ts +3 -3
- package/src/ui/cf-account-picker.ts +7 -9
- package/src/ui/color-selector.ts +9 -5
- package/src/ui/dynamic-slot.ts +7 -8
- package/src/ui/expression-editor.ts +112 -105
- package/src/ui/form-controls.ts +104 -56
- package/src/ui/formula-catalog.ts +239 -230
- package/src/ui/formula-chips.ts +33 -18
- package/src/ui/layers.ts +57 -31
- package/src/ui/media-picker.ts +300 -47
- package/src/ui/popover-surface.ts +20 -12
- package/src/ui/progress-modal.ts +13 -8
- package/src/ui/regions.ts +14 -12
- package/src/ui/schema-form.ts +372 -97
- package/src/ui/surface.ts +71 -8
- package/src/ui/timing.ts +9 -0
- package/src/ui/value-source.ts +44 -31
- package/src/ui/virtual-window.ts +29 -3
- package/src/utils/base64.ts +6 -4
- package/src/utils/edit-display.ts +366 -111
- package/src/utils/element-selectors.ts +3 -2
- package/src/utils/google-fonts.ts +15 -14
- package/src/utils/inherited-style.ts +18 -20
- package/src/utils/link-target.ts +1 -1
- package/src/utils/local-day.ts +18 -0
- package/src/utils/preview-format.ts +25 -3
- package/src/utils/strip-events.ts +49 -22
- package/src/utils/studio-utils.ts +29 -14
- package/src/view.ts +2 -3
- package/src/workspace/pane-derive.ts +14 -16
- package/src/workspace/session.ts +81 -50
- package/src/workspace/tab-workspace.ts +137 -0
- package/src/workspace/workspace-back.ts +189 -0
- package/src/workspace/workspace-home.ts +133 -0
- package/src/workspace/workspace-ids.ts +129 -0
- package/src/workspace/workspace-switch.ts +372 -0
- package/src/workspace/workspace.ts +165 -47
- package/styles/shell-frame.css +30 -7
- package/styles/shell-frame.json +15 -3
- package/dist/chunks/2020-va2wwra4.js +0 -4
- package/dist/chunks/adapter-f93pafd7.js +0 -4
- package/dist/chunks/cf-account-picker-af1h381v.js +0 -4
- package/dist/chunks/cf-settings-125tdm0w.js +0 -4
- package/dist/chunks/color-area-jqhna8zy.js +0 -4
- package/dist/chunks/color-field-embq5ctg.js +0 -4
- package/dist/chunks/color-fpezvnkt.js +0 -4
- package/dist/chunks/color-slider-1qmw7wqy.js +0 -4
- package/dist/chunks/combobox-773hdzyj.js +0 -4
- package/dist/chunks/components-ax2f1fnn.js +0 -4
- package/dist/chunks/content-source-108aqtk1.js +0 -4
- package/dist/chunks/convert-to-repeater-ry5rmppr.js +0 -4
- package/dist/chunks/dialog-mtm9fq5t.js +0 -4
- package/dist/chunks/editor-pfgdmkb0.js +0 -4
- package/dist/chunks/entry-commands-t0k1q0kx.js +0 -4
- package/dist/chunks/extension-sections-6mwh2hf8.js +0 -4
- package/dist/chunks/file-ops-meej5mqf.js +0 -4
- package/dist/chunks/files-44vp8a2s.js +0 -4
- package/dist/chunks/format-host-7q1petb9.js +0 -4
- package/dist/chunks/fs-events-h2mwnxaz.js +0 -4
- package/dist/chunks/git-panel-zngbymvd.js +0 -4
- package/dist/chunks/grid-view-sx9vynsp.js +0 -51
- package/dist/chunks/icons-p44xhjf0.js +0 -4
- package/dist/chunks/iframe-entry-f7mqjwpm.js +0 -5
- package/dist/chunks/iframe-entry-haw7jkvz.js +0 -5
- package/dist/chunks/iframe-entry-z6qrytv3.js +0 -5
- package/dist/chunks/iframe-host-qk3ycq87.js +0 -4
- package/dist/chunks/index-wkyfjeqz.js +0 -4
- package/dist/chunks/jsonMode-s8kt9dsj.js +0 -13
- package/dist/chunks/jx-validate-psgd7vsx.js +0 -4
- package/dist/chunks/layers-panel-1kq2jyfk.js +0 -4
- package/dist/chunks/layers-xd92fg8d.js +0 -4
- package/dist/chunks/listbox-s8fkmnq8.js +0 -4
- package/dist/chunks/lit-html-ac4cwwr4.js +0 -4
- package/dist/chunks/media-picker-0svzkdyb.js +0 -4
- package/dist/chunks/menu-37d07z9m.js +0 -4
- package/dist/chunks/menu-5c55ea3d.js +0 -4
- package/dist/chunks/monaco-binding-z6r70pdt.js +0 -4
- package/dist/chunks/monaco-buffer-fz6gq5y7.js +0 -4
- package/dist/chunks/monaco-setup-q4axkgj7.js +0 -4
- package/dist/chunks/notify-0xgtn8q1.js +0 -4
- package/dist/chunks/number-field-gw7sq8rn.js +0 -4
- package/dist/chunks/parse-897fvqah.js +0 -4
- package/dist/chunks/platform-v1qctbe6.js +0 -4
- package/dist/chunks/popover-8htra4er.js +0 -4
- package/dist/chunks/publish-panel-ym1fmgq5.js +0 -4
- package/dist/chunks/quick-search-a54e6t5n.js +0 -4
- package/dist/chunks/references-gmqp82fs.js +0 -4
- package/dist/chunks/right-panel-v7t9awbk.js +0 -4
- package/dist/chunks/section-registry-vhyf3zsr.js +0 -4
- package/dist/chunks/select-n3v7gwas.js +0 -4
- package/dist/chunks/split-pff8f3ze.js +0 -4
- package/dist/chunks/studio-0bhx5hz6.js +0 -5
- package/dist/chunks/studio-0k1ddnyy.js +0 -6
- package/dist/chunks/studio-1b04pd0j.js +0 -64
- package/dist/chunks/studio-4dwbj6gb.js +0 -5
- package/dist/chunks/studio-4tanh828.js +0 -5
- package/dist/chunks/studio-55h4mstj.js +0 -4
- package/dist/chunks/studio-5tnvjkz4.js +0 -5
- package/dist/chunks/studio-60dqgb0c.js +0 -5
- package/dist/chunks/studio-61dp09qg.js +0 -9
- package/dist/chunks/studio-63epcrj2.js +0 -5
- package/dist/chunks/studio-74k29dy9.js +0 -5
- package/dist/chunks/studio-7vg6jcd3.js +0 -5
- package/dist/chunks/studio-7zx31knw.js +0 -9
- package/dist/chunks/studio-8bxk97km.js +0 -5
- package/dist/chunks/studio-933e30n4.js +0 -5
- package/dist/chunks/studio-98wnwhbg.js +0 -5
- package/dist/chunks/studio-9mccjwjh.js +0 -14
- package/dist/chunks/studio-a2ke1e4t.js +0 -5
- package/dist/chunks/studio-e3a2a6v3.js +0 -4
- package/dist/chunks/studio-e81q1vb9.js +0 -5
- package/dist/chunks/studio-epgrmqqm.js +0 -5
- package/dist/chunks/studio-ery42sqr.js +0 -4
- package/dist/chunks/studio-g1shz58g.js +0 -5
- package/dist/chunks/studio-gf0fz03c.js +0 -5
- package/dist/chunks/studio-gjtpe62q.js +0 -6
- package/dist/chunks/studio-gkskhg7m.js +0 -5
- package/dist/chunks/studio-gx4dnjzd.js +0 -5
- package/dist/chunks/studio-j03zga3y.js +0 -9
- package/dist/chunks/studio-jhpxeckz.js +0 -5
- package/dist/chunks/studio-k01r7ykp.js +0 -5
- package/dist/chunks/studio-kk7h30ne.js +0 -7
- package/dist/chunks/studio-kt1zqney.js +0 -5
- package/dist/chunks/studio-m3cwhvye.js +0 -5
- package/dist/chunks/studio-mcayt6hz.js +0 -5
- package/dist/chunks/studio-myjcghv3.js +0 -5
- package/dist/chunks/studio-n8bxwc3y.js +0 -4
- package/dist/chunks/studio-ngm8gvpb.js +0 -5
- package/dist/chunks/studio-nj5a01jy.js +0 -928
- package/dist/chunks/studio-pcgz8heb.js +0 -5
- package/dist/chunks/studio-qcsq0t15.js +0 -5
- package/dist/chunks/studio-qkstvve9.js +0 -5
- package/dist/chunks/studio-qv1pwd3c.js +0 -5
- package/dist/chunks/studio-rc6dvxjb.js +0 -7
- package/dist/chunks/studio-s8dmmz66.js +0 -5
- package/dist/chunks/studio-sp5xzbj4.js +0 -6
- package/dist/chunks/studio-szsjbj0g.js +0 -5
- package/dist/chunks/studio-t1xzawhr.js +0 -16
- package/dist/chunks/studio-tdcprbqb.js +0 -5
- package/dist/chunks/studio-vrmcjf9g.js +0 -7
- package/dist/chunks/studio-vyc0b4he.js +0 -10
- package/dist/chunks/studio-w0cgf6jg.js +0 -5
- package/dist/chunks/studio-w3hskzqk.js +0 -5
- package/dist/chunks/studio-xgrgcdyh.js +0 -9
- package/dist/chunks/studio-xz2yxfcb.js +0 -5
- package/dist/chunks/studio-y6n42tgs.js +0 -5
- package/dist/chunks/studio-yb560vxr.js +0 -5
- package/dist/chunks/studio-yn9f8vtx.js +0 -5
- package/dist/chunks/studio-yw05w8f0.js +0 -7
- package/dist/chunks/studio-z16sgavc.js +0 -5
- package/dist/chunks/studio-zey7zsdw.js +0 -12
- package/dist/chunks/studio-zyqn40w4.js +0 -5
- package/dist/chunks/swatch-group-8qh9a3bm.js +0 -4
- package/dist/chunks/tabs-jwthg40w.js +0 -4
- package/dist/chunks/textfield-spy3hc77.js +0 -4
- package/dist/chunks/toast-4d35zd64.js +0 -4
- package/dist/chunks/toast-host-8sjmfed3.js +0 -4
- package/dist/chunks/tooltip-fd6g9xy3.js +0 -4
- package/dist/chunks/tree-h19v1jfz.js +0 -4
- package/dist/chunks/tsMode-2frah6h1.js +0 -14
- package/dist/chunks/workspace-zt81g1ms.js +0 -4
- package/dist/chunks/ws-client-n2bh4hkf.js +0 -4
- package/src/panels/frontmatter-panel.ts +0 -701
- package/src/panels/git-panel.ts +0 -1120
- package/src/surfaces/doc-header.json +0 -776
- package/src/surfaces/doc-header.ts +0 -231
- package/src/surfaces/git-panel.json +0 -1880
- package/src/surfaces/git-panel.ts +0 -272
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Z}from"./studio-vxq7fcvv.js";function q(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var F=Object.assign;var Ke=Object.prototype.hasOwnProperty,j=(e,t)=>Ke.call(e,t),A=Array.isArray,k=(e)=>me(e)==="[object Map]";var de=(e)=>typeof e==="function",ze=(e)=>typeof e==="string",O=(e)=>typeof e==="symbol",R=(e)=>e!==null&&typeof e==="object";var We=Object.prototype.toString,me=(e)=>We.call(e),_e=(e)=>me(e).slice(8,-1);var H=(e)=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var U=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},Ge=/-\w/g,_t=U((e)=>e.replace(Ge,(t)=>t.slice(1).toUpperCase())),$e=/\B([A-Z])/g,yt=U((e)=>e.replace($e,"-$1").toLowerCase()),ye=U((e)=>e.charAt(0).toUpperCase()+e.slice(1)),vt=U((e)=>e?`on${ye(e)}`:""),E=(e,t)=>!Object.is(e,t);var Ye="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var Et=q(Ye+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var d;class Se{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&d)if(d.active)this.parent=d,this.index=(d.scopes||(d.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=d;try{return d=this,e()}finally{d=t}}}on(){if(++this._on===1)this.prevScope=d,d=this}off(){if(this._on>0&&--this._on===0){if(d===this)d=this.prevScope;else{let e=d;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function ge(e){return new Se(e)}function ta(e,t=!1){if(d)d.cleanups.push(e)}var f;var X=new WeakSet;class W{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,d)if(d.active)d.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,X.has(this))X.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Te(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ve(this),Ne(this);let e=f,t=_;f=this,_=!0;try{return this.fn()}finally{xe(this),f=e,_=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ae(e);this.deps=this.depsTail=void 0,ve(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)X.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(ee(this))this.run()}get dirty(){return ee(this)}}var we=0,M,L;function Te(e,t=!1){if(e.flags|=8,t){e.next=L,L=e;return}e.next=M,M=e}function se(){we++}function oe(){if(--we>0)return;if(L){let t=L;L=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(M){let t=M;M=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function Ne(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xe(e){let t,n=e.depsTail,r=n;while(r){let i=r.prevDep;if(r.version===-1){if(r===n)n=i;ae(r),Be(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ee(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ae(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Ae(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===P)return;if(e.globalVersion=P,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ee(e)))return;e.flags|=2;let t=e.dep,n=f,r=_;f=e,_=!0;try{Ne(e);let i=e.fn(e._value);if(t.version===0||E(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{f=n,_=r,xe(e),e.flags&=-3}}function ae(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r)r.nextSub=i,e.prevSub=void 0;if(i)i.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ae(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function Be(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function ne(e,t){if(e.effect instanceof W)e=e.effect.fn;let n=new W(e);if(t)F(n,t);try{n.run()}catch(i){throw n.stop(),i}let r=n.run.bind(n);return r.effect=n,r}var _=!0,Oe=[];function Jr(){Oe.push(_),_=!1}function Yr(){let e=Oe.pop();_=e===void 0?!0:e}function WC(e,t=!1){if(f instanceof W)f.cleanup=e}function ve(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=f;f=void 0;try{t()}finally{f=n}}}var P=0;class Re{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Y{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!f||!_||f===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==f){if(t=this.activeLink=new Re(f,this),!f.deps)f.deps=f.depsTail=t;else t.prevDep=f.depsTail,f.depsTail.nextDep=t,f.depsTail=t;De(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=f.depsTail,t.nextDep=void 0,f.depsTail.nextDep=t,f.depsTail=t,f.deps===t)f.deps=n}}return t}trigger(e){this.version++,P++,this.notify(e)}notify(e){se();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{oe()}}}function De(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)De(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var te=new WeakMap,N=Symbol(""),ie=Symbol(""),V=Symbol("");function h(e,t,n){if(_&&f){let r=te.get(e);if(!r)te.set(e,r=new Map);let i=r.get(n);if(!i)r.set(n,i=new Y),i.map=r,i.key=n;i.track()}}function w(e,t,n,r,i,s){let o=te.get(e);if(!o){P++;return}let a=(c)=>{if(c)c.trigger()};if(se(),t==="clear")o.forEach(a);else{let c=A(e),l=c&&H(n);if(c&&n==="length"){let u=Number(r);o.forEach((p,m)=>{if(m==="length"||m===V||!O(m)&&m>=u)a(p)})}else{if(n!==void 0||o.has(void 0))a(o.get(n));if(l)a(o.get(V));switch(t){case"add":if(!c){if(a(o.get(N)),k(e))a(o.get(ie))}else if(l)a(o.get("length"));break;case"delete":if(!c){if(a(o.get(N)),k(e))a(o.get(ie))}break;case"set":if(k(e))a(o.get(N));break}}}oe()}function D(e){let t=he(e);if(t===e)return t;if(h(t,"iterate",V),T(e))return t;if(!S(e))return t.map(v);return _v(e)?t.map((n)=>x(v(n))):t.map(x)}function ce(e){return h(e=he(e),"iterate",V),e}function y(e,t){if(S(e))return _v(e)?x(v(t)):x(t);return v(t)}var qe={__proto__:null,[Symbol.iterator](){return J(this,Symbol.iterator,(e)=>y(this,e))},concat(...e){return D(this).concat(...e.map((t)=>A(t)?D(t):t))},entries(){return J(this,"entries",(e)=>(e[1]=y(this,e[1]),e))},every(e,t){return b(this,"every",e,t,void 0,arguments)},filter(e,t){return b(this,"filter",e,t,(n)=>n.map((r)=>y(this,r)),arguments)},find(e,t){return b(this,"find",e,t,(n)=>y(this,n),arguments)},findIndex(e,t){return b(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return b(this,"findLast",e,t,(n)=>y(this,n),arguments)},findLastIndex(e,t){return b(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return b(this,"forEach",e,t,void 0,arguments)},includes(...e){return Q(this,"includes",e)},indexOf(...e){return Q(this,"indexOf",e)},join(e){return D(this).join(e)},lastIndexOf(...e){return Q(this,"lastIndexOf",e)},map(e,t){return b(this,"map",e,t,void 0,arguments)},pop(){return I(this,"pop")},push(...e){return I(this,"push",e)},reduce(e,...t){return be(this,"reduce",e,t)},reduceRight(e,...t){return be(this,"reduceRight",e,t)},shift(){return I(this,"shift")},some(e,t){return b(this,"some",e,t,void 0,arguments)},splice(...e){return I(this,"splice",e)},toReversed(){return D(this).toReversed()},toSorted(e){return D(this).toSorted(e)},toSpliced(...e){return D(this).toSpliced(...e)},unshift(...e){return I(this,"unshift",e)},values(){return J(this,"values",(e)=>y(this,e))}};function J(e,t,n){let r=ce(e),i=r[t],s=i.call(r);if(r!==e&&!T(e)){if(s[Symbol.toStringTag]==="Array Iterator"){let o=Object.create(Object.getPrototypeOf(s));if(o.next=()=>Ee(s.next(),n),i!==ke[t])Object.defineProperties(o,{return:{get(){let a=s.return;return typeof a==="function"?a.bind(s):a}},throw:{get(){let a=s.throw;return typeof a==="function"?a.bind(s):a}}});return o}s._next=s.next,s.next=()=>Ee(s._next(),n)}return s}function Ee(e,t){if(!e.done)e.value=t(e.value);return e}var ke=Array.prototype;function b(e,t,n,r,i,s){let o=ce(e),a=o!==e&&!T(e),c=o[t];if(c!==ke[t]){let p=c.apply(e,s);return a?v(p):p}let l=n;if(o!==e){if(a)l=function(p,m){return n.call(this,y(e,p),m,e)};else if(n.length>2)l=function(p,m){return n.call(this,p,m,e)}}let u=c.call(o,l,r);return a&&i?i(u):u}function be(e,t,n,r){let i=ce(e),s=i!==e&&!T(e),o=n,a=!1;if(i!==e){if(s)a=r.length===0,o=function(l,u,p){if(a)a=!1,l=y(e,l);return n.call(this,l,y(e,u),p,e)};else if(n.length>3)o=function(l,u,p){return n.call(this,l,u,p,e)}}let c=i[t](o,...r);return a?y(e,c):c}function Q(e,t,n){let r=he(e);h(r,"iterate",V);let i=r[t](...n);if((i===-1||i===!1)&&ct(n[0]))return n[0]=he(n[0]),r[t](...n);return i}function I(e,t,n=[]){Jr(),se();let r=he(e)[t].apply(e,n);return oe(),Yr(),r}var Xe=q("__proto__,__v_isRef,__isVue"),Ce=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(O));function Je(e){if(!O(e))e=String(e);let t=he(this);return h(t,"has",e),t.hasOwnProperty(e)}class le{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return i;else if(t==="__v_raw"){if(n===(r?i?ot:Pe:i?Le:Me).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=A(e);if(!r){let a;if(s&&(a=qe[t]))return a;if(t==="hasOwnProperty")return Je}let o=Reflect.get(e,t,kh(e)?e:n);if(O(t)?Ce.has(t):Xe(t))return o;if(!r)h(e,"get",t);if(i)return o;if(kh(o)){let a=s&&H(t)?o:o.value;return r&&R(a)?G(a):a}if(R(o))return r?G(o):g(o);return o}}class fe extends le{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],s=A(e)&&H(t);if(!this._isShallow){let c=S(i);if(!T(n)&&!S(n))i=he(i),n=he(n);if(!s&&kh(i)&&!kh(n))if(c)return!0;else return i.value=n,!0}let o=s?Number(t)<e.length:j(e,t),a=Reflect.set(e,t,n,kh(e)?e:r);if(e===he(r)&&a){if(!o)w(e,"add",t,n);else if(E(n,i))w(e,"set",t,n,i)}return a}deleteProperty(e,t){let n=j(e,t),r=e[t],i=Reflect.deleteProperty(e,t);if(i&&n)w(e,"delete",t,void 0,r);return i}has(e,t){let n=Reflect.has(e,t);if(!O(t)||!Ce.has(t))h(e,"has",t);return n}ownKeys(e){return h(e,"iterate",A(e)?"length":N),Reflect.ownKeys(e)}}class Ie extends le{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Ze=new fe,Qe=new Ie,et=new fe(!0);var re=(e)=>e,K=(e)=>Reflect.getPrototypeOf(e);function tt(e,t,n){return function(...r){let i=this.__v_raw,s=he(i),o=k(s),a=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...r),u=n?re:t?x:v;return!t&&h(s,"iterate",c?ie:N),F(Object.create(l),{next(){let{value:p,done:m}=l.next();return m?{value:p,done:m}:{value:a?[u(p[0]),u(p[1])]:u(p),done:m}}})}}function z(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function nt(e,t){let n={get(i){let s=this.__v_raw,o=he(s),a=he(i);if(!e){if(E(i,a))h(o,"get",i);h(o,"get",a)}let{has:c}=K(o),l=t?re:e?x:v;if(c.call(o,i))return l(s.get(i));else if(c.call(o,a))return l(s.get(a));else if(s!==o)s.get(i)},get size(){let i=this.__v_raw;return!e&&h(he(i),"iterate",N),i.size},has(i){let s=this.__v_raw,o=he(s),a=he(i);if(!e){if(E(i,a))h(o,"has",i);h(o,"has",a)}return i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){let o=this,a=o.__v_raw,c=he(a),l=t?re:e?x:v;return!e&&h(c,"iterate",N),a.forEach((u,p)=>i.call(s,l(u),l(p),o))}};return F(n,e?{add:z("add"),set:z("set"),delete:z("delete"),clear:z("clear")}:{add(i){let s=he(this),o=K(s),a=he(i),c=!t&&!T(i)&&!S(i)?a:i;if(!(o.has.call(s,c)||E(i,c)&&o.has.call(s,i)||E(a,c)&&o.has.call(s,a)))s.add(c),w(s,"add",c,c);return this},set(i,s){if(!t&&!T(s)&&!S(s))s=he(s);let o=he(this),{has:a,get:c}=K(o),l=a.call(o,i);if(!l)i=he(i),l=a.call(o,i);let u=c.call(o,i);if(o.set(i,s),!l)w(o,"add",i,s);else if(E(s,u))w(o,"set",i,s,u);return this},delete(i){let s=he(this),{has:o,get:a}=K(s),c=o.call(s,i);if(!c)i=he(i),c=o.call(s,i);let l=a?a.call(s,i):void 0,u=s.delete(i);if(c)w(s,"delete",i,void 0,l);return u},clear(){let i=he(this),s=i.size!==0,o=void 0,a=i.clear();if(s)w(i,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{n[i]=tt(i,e,t)}),n}function ue(e,t){let n=nt(e,t);return(r,i,s)=>{if(i==="__v_isReactive")return!e;else if(i==="__v_isReadonly")return e;else if(i==="__v_isShallow")return t;else if(i==="__v_raw")return r;return Reflect.get(j(n,i)&&i in r?n:r,i,s)}}var it={get:ue(!1,!1)},rt={get:ue(!1,!0)},st={get:ue(!0,!1)};var Me=new WeakMap,Le=new WeakMap,Pe=new WeakMap,ot=new WeakMap;function at(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function g(e){if(S(e))return e;return pe(e,!1,Ze,it,Me)}function xv(e){return pe(e,!1,et,rt,Le)}function G(e){return pe(e,!0,Qe,st,Pe)}function pe(e,t,n,r,i){if(!R(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=i.get(e);if(s)return s;let o=at(_e(e));if(o===0)return e;let a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function _v(e){if(S(e))return _v(e.__v_raw);return!!(e&&e.__v_isReactive)}function S(e){return!!(e&&e.__v_isReadonly)}function T(e){return!!(e&&e.__v_isShallow)}function ct(e){return e?!!e.__v_raw:!1}function he(e){let t=e&&e.__v_raw;return t?he(t):e}var v=(e)=>R(e)?g(e):e,x=(e)=>R(e)?G(e):e;function kh(e){return e?e.__v_isRef===!0:!1}function Eh(e){return Ve(e,!1)}function Na(e){return Ve(e,!0)}function Ve(e,t){if(kh(e))return e;return new Fe(e,t)}class Fe{constructor(e,t){this.dep=new Y,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:he(e),this._value=t?e:v(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||T(e)||S(e);if(e=n?e:he(e),E(e,t))this._rawValue=e,this._value=n?e:v(e),this.dep.trigger()}}class je{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Y(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=P-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&f!==this)return Te(this,!0),!0}get value(){let e=this.dep.track();if(Ae(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function Th(e,t,n=!1){let r,i;if(de(e))r=e;else r=e.get,i=e.set;return new je(r,i,n)}var lt={assertive:"jx-live-assertive",polite:"jx-live-polite"};function ft(e){if(typeof document>"u")return null;let t=lt[e],n=document.querySelector(`#${t}`);if(n)return n;let r=document.createElement("div");return r.id=t,r.setAttribute("aria-live",e),r.setAttribute("role",e==="assertive"?"alert":"status"),r.setAttribute("aria-atomic","true"),r.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0",document.body.append(r),r}function qx(e,t="polite"){if(e==="")return;let n=ft(t);if(!n)return;n.textContent="",setTimeout(()=>{n.textContent=e},0)}var Qp=60000,He=null;function dr(){return He??Date.now()}function tM(e){let t=e instanceof Date?e.getTime():Z(e)?e:Date.parse(e);if(!Number.isFinite(t))throw TypeError(`clock: cannot pin to ${JSON.stringify(e)}`);return He=t,t}var ut={error:"problem",info:"toast",success:"toast",warn:"toast"},pt={error:8000,info:4000,success:4000,warn:8000},Ue=0;function dt(){return Ue+=1,`n${Ue}`}var eu=g([]),na=g([]),ht=4;function gt(e){return e==="problem"?na:eu}function mt(e,t,n,r){let i={at:dr(),id:dt(),message:t,severity:e,tier:n};if(r.action!==void 0)i.action=r.action;if(r.actionArgs!==void 0)i.actionArgs=r.actionArgs;if(r.detail!==void 0)i.detail=r.detail;if(r.source!==void 0)i.source=r.source;if(r.path!==void 0)i.path=r.path;if(r.key!==void 0)i.key=r.key;if(n==="toast")i.timeoutMs=r.timeoutMs??pt[e];return i}function C(e,t,n={}){let r=n.tier??ut[e],i=mt(e,t,r,n),s=gt(r);if(i.key!==void 0){let o=s.findIndex((a)=>a.key===i.key);if(o!==-1)s.splice(o,1)}if(s.push(i),r==="toast")while(eu.length>ht)eu.shift();return qx(i.source===void 0?i.message:`${i.source}: ${i.message}`,e==="error"?"assertive":"polite"),i}function B(e){return(t,n={})=>C(e,t,n)}C.success=B("success");C.info=B("info");C.warn=B("warn");C.error=B("error");function Lh(e){for(let t of[eu,na]){let n=t.findIndex((r)=>r.id===e);if(n!==-1)return t.splice(n,1),!0}return!1}function ul(e){let t=e?na.filter((r)=>!e(r)):[],n=na.length-t.length;return na.splice(0,na.length,...t),n}function ef(e){let t=[];for(let n of na){if(n.source!==e)continue;let r={message:n.message,severity:n.severity};if(n.detail!==void 0)r.detail=n.detail;if(n.path!==void 0)r.path=n.path;if(n.key!==void 0)r.key=n.key;if(n.action!==void 0)r.action=n.action;if(n.actionArgs!==void 0)r.actionArgs=n.actionArgs;t.push(r)}return t}function Sv(e){return e===void 0?na.length:na.filter((t)=>t.severity===e).length}export{ge,ta,ne,Jr,Yr,WC,g,xv,_v,he,kh,Eh,Na,Th,qx,Qp,dr,tM,eu,na,C,Lh,ul,ef,Sv};
|
|
2
|
+
|
|
3
|
+
//# debugId=5D546D094A64B68464756E2164756E21
|
|
4
|
+
//# sourceMappingURL=studio-43sd2mam.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{p,_e}from"./studio-w4rz9hdk.js";import{pt,Go,RA,Ap,px,Cr,NA,Op}from"./studio-s32578pn.js";import{C}from"./studio-43sd2mam.js";import{Zs,tt}from"./studio-x9hsze61.js";import{n,Z,Xe,te,v}from"./studio-vxq7fcvv.js";var l=null;async function Bd(){if(!_e()||!te(p().getAccountStatus)){l=null;return}try{l=await p().getAccountStatus?.()??null}catch{l=null}}function lC(){return l}function cC(){return l!==null&&l.installations.length===0&&Boolean(l.appInstallUrl)}function bA(){if(l===null)return null;let e=l.installations.flatMap((r)=>r.manageUrl?[{account:r.account??`Installation ${r.id}`,url:r.manageUrl}]:[]);if(e.length===0&&!l.appInstallUrl)return null;let t={manage:e};if(l.appInstallUrl)t.installUrl=l.appInstallUrl;return t}function vA(){return l?.entries??[]}function a$(){return(l?.notices??[]).filter((e)=>e.display!=="toast")}var L=new Set;function N(){let e=(l?.notices??[]).filter((t)=>t.display==="toast"&&!L.has(t.id));for(let t of e)L.add(t.id);return e}var G="https://jxsuite.com/problems/";function k(e){return typeof e==="string"}function X(e){return typeof e==="object"&&e!==null}function Bb(e){if(!k(e)||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function sr(e){if(k(e))return e.trim()===""?null:e;if(!X(e))return null;for(let t of[e.detail,e.error,e.title])if(k(t)&&t.trim()!=="")return t;return null}function ka(e,t){return sr(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var d=(e,t,r,i)=>{let s={status:t,title:r,type:`${G}${e}`};if(i!==void 0)s.extensions=i;return s},me={invalidRequest:d("invalid-request",400,"The request was malformed or incomplete"),notFound:d("not-found",404,"The requested resource does not exist"),methodNotAllowed:d("method-not-allowed",405,"That method is not allowed on this route"),conflict:d("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:d("payload-too-large",413,"The request body is too large"),unauthorized:d("unauthorized",401,"Credentials are missing or not accepted"),forbidden:d("forbidden",403,"The request was refused"),needsInstallationAccess:d("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:d("path-outside-project",403,"The path resolves outside the active project"),actionRequired:d("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:d("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:d("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:d("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:d("internal-error",500,"The backend failed to complete the request")};var dC=".jx-loc-id",o=(e,t,r,i)=>{let s={method:e,path:t,optional:i!==void 0,summary:r};if(i!==void 0)s.degradation=i;return s},he={activate:o("POST","/__studio/activate","Bind the backend to a project root"),project:o("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:o("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:o("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:o("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),findProject:o("GET","/__studio/find-project","Locate a project directory by name outside the root","openProject falls back to config-matching only."),locateDirectory:o("GET","/__studio/locate-directory","Resolve the absolute path of a showDirectoryPicker() folder by the id in its .jx-loc-id","Browse… reports that the folder could not be placed; the Location is typed by hand."),createProject:o("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:o("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:o("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:o("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:o("GET","/__studio/file","Read a file's text content"),filesRead:o("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:o("PUT","/__studio/file","Write a file's text content"),fileDelete:o("DELETE","/__studio/file","Delete a file"),fileUpload:o("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:o("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:o("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:o("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:o("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:o("POST","/__studio/locate","Find a file by name → {path | null}"),collab:o("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:o("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:o("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:o("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:o("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:o("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:o("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:o("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:o("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:o("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:o("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:o("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:o("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:o("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:o("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:o("POST","/__studio/packages/add","Add a dependency"),packagesRemove:o("POST","/__studio/packages/remove","Remove a dependency"),packagesInstall:o("POST","/__studio/packages/install","Run the package manager install","Install/reinstall affordances are hidden; manifest-only edits still work."),packagesNeedsInstall:o("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:o("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:o("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install","Bulk version updates are hidden."),gitStatus:o("GET","/__studio/git/status","Working-tree status (GitStatusResult)"),gitBranches:o("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:o("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:o("POST","/__studio/git/stage","Stage files"),gitUnstage:o("POST","/__studio/git/unstage","Unstage files"),gitCommit:o("POST","/__studio/git/commit","Commit staged (else all dirty) files"),gitPush:o("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:o("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:o("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:o("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:o("POST","/__studio/git/create-branch","Create a branch"),gitDiff:o("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:o("GET","/__studio/git/show","File content at a ref"),gitDiscard:o("POST","/__studio/git/discard","Discard working changes"),gitInit:o("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:o("POST","/__studio/git/add-remote","Add a remote"),gitClone:o("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:o("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:o("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:o("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:o("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:o("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:o("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:o("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:o("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:o("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:o("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:o("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:o("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:o("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var l$=200,c$=100,d$=12;var Y=new Set(["reload","repeat","none"]);function Np(e){if(!Array.isArray(e))return[];return e.flatMap((r)=>{if(!v(r))return[];let{href:i,id:s,label:f,primary:m}=r;if(!n(s)||!s||!n(f)||!f)return[];let c={id:s,label:f};if(n(i)&&i)c.href=i;if(m===!0)c.primary=!0;return[c]})}function F(e){return n(e)&&Y.has(e)}function u$(e){return F(e)?e:void 0}function Q(e){return e.replaceAll("_","-")}function _(e){if(!v(e))return{};let{actions:t,code:r,heading:i,installUrl:s,retry:f,type:m}=e,c={},a=Bb(m)??(n(r)?Q(r):null);if(a!==null)c.code=a;if(n(s))c.installUrl=s;if(t!==void 0)c.actions=Np(t);if(n(i)&&i)c.heading=i;if(F(f))c.retry=f;return c}function yA(e){let t=_(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function wA(e){return _(e).code==="action-required"}function zd(){return Go(pt.aiOpenAiKey)}function xA(e){Cr(pt.aiOpenAiKey,e||"")}function cx(){return RA(pt.aiOpenAiKey)}function sl(){return Go(pt.aiBaseUrl)}function dx(){return Go(pt.aiModel)}function _A(e){Cr(pt.aiModel,e||"")}function SA(e){NA([[pt.aiOpenAiKey,e.apiKey],[pt.aiBaseUrl,e.baseUrl],[pt.aiModel,e.model]])}function CA(e){return!Cm(pt.aiOpenAiKey,e.apiKey,zd())||!Cm(pt.aiBaseUrl,e.baseUrl,sl())||!Cm(pt.aiModel,e.model,dx())}function Cm(e,t,r){return px(e,t)===px(e,r)}function kA(){Op([pt.aiOpenAiKey,pt.aiBaseUrl,pt.aiModel])}function uC(){return{apiKey:zd(),baseUrl:sl()}}function V(e){return`${e.apiKey}\x00${e.baseUrl}`}var g=null,P="",j=!1,A=!1,D="",I,M="",R=null,U=null,q=new Set,ee=600000,S=0,J=!1;function us(){g=null,P="",j=!1,A=!1,D="",I=void 0,M="",R=null,U=null,S=0}var oe=new Set([pt.aiOpenAiKey.key,pt.aiBaseUrl.key,pt.cfToken.key,pt.cfAccountId.key]);Ap((e)=>{if(e.some((t)=>oe.has(t)))us()});function h$(e){return g&&P===V(e)?g:null}function K(e){return g?.find((t)=>t.id===e)}function p$(e){return K(e)?.toolSupport}function EA(e){return K(e)?.contextWindow}function ux(e){if(e)q.add(e);U??=lh({force:!0}).catch(()=>{}).then(()=>{S=Date.now();for(let t of q)t()})}function ne(){if(!A||S===0||Date.now()-S<ee)return!1;return U=null,S=0,ux(),!0}function re(){if(typeof window>"u"||J)return;J=!0,window.addEventListener("focus",()=>{ne()})}re();function zb(){return cx()||hC()}function hC(){return j}function TA(){return A}function km(){return I}function LA(){return M}function pC(){return R}function ie(){return D}function Yl(){return dx()||ie()||pt.aiModel.default}function se(e,t){let r;try{r=new URL(e,"http://jx.invalid")}catch{return e}return r.pathname=r.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?r.href:`${r.pathname}${r.search}`}async function lh(e={}){let t=e.credentials??uC(),r=V(t);if(g&&P===r&&!e.force)return g;let i=p(),s=await Promise.resolve(i.aiChatUrl()),f=se(s,"models"),m={};if(t.apiKey)m["X-Api-Key"]=t.apiKey;if(t.baseUrl)m["X-Api-Base-URL"]=t.baseUrl;let c=await fetch(f,{headers:m});if(!c.ok)throw Error(`HTTP ${c.status}`);let a=await c.json();if(j=a.configured===!0,A=a.managed===!0,D=a.defaultModel??"",I=a.code,M=a.upstreamError!==void 0?a.upstreamMessage??"":"",R=null,a.code==="action_required"){let u={actions:Np(a.actions)};if(n(a.detail)&&a.detail)u.detail=a.detail;R=u}return g=(a.models||[]).map((u)=>{let h={id:u.id,name:u.name||u.id};if(Z(u.contextWindow))h.contextWindow=u.contextWindow;if(Xe(u.toolSupport))h.toolSupport=u.toolSupport;return h}),P=r,g}var T=new Set,B=null;function $A(e){if(T.size===0){B=e;return}for(let t of T)t(e)}function H(e){T.add(e);let t=B;if(B=null,t)e(t);return()=>{T.delete(e)}}function fC(){return _e()&&te(p().performAction)}function f$(e){let t=e.find((i)=>i.primary)??e[0];if(!t)return null;let r=e.find((i)=>i!==t);return r?{lead:t,other:r}:{lead:t}}var w=null,W=!1;function mC(e){let t=f$(e.actions);if(!fC()||!t)return Promise.resolve(!1);return w??=ae(e,t).finally(()=>{w=null}),w}async function Em(e){let t=_(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return mC({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function z(){us(),await Bd(),m$()}function ae(e,t){let r=e.detail??"This needs one more step first.";return new Promise((i)=>{let s="offer",f=(y)=>{if(s==="done")return;s="done",E.close(),i(y)},m=(y)=>{s="offer",E.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:y,secondaryLabel:t.other?.label??""})},c=async(y)=>{let b;try{b=await y}catch(x){if(s==="waiting")m(x instanceof Error?x.message:String(x));return}if(b?.status==="done"){await z(),f(!0);return}if(s!=="waiting"||!b||b.status==="redirect")return;Bd(),m(r)},a=(y)=>{if(s!=="offer")return;s="waiting";let b;try{b=p().performAction(y)}catch(x){m(x instanceof Error?x.message:String(x));return}E.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),c(b)},{lead:u,other:h}=t,O={cancelLabel:"Not now",confirmLabel:u.label,headline:e.heading??"One more step",layer:tt("dialog"),message:r,onCancel:()=>{W=!0,f(!1)},onClosed:()=>{f(!1)},onConfirm:()=>{a(u)},region:"account/action"};if(h)O.onSecondary=()=>{a(h)},O.secondaryLabel=h.label;let E=Zs(O)})}function ce(e){if(e==="reload")location.reload();else if(e==="repeat")C.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function IA(){return H((e)=>{if(W||w)return;mC(e).then((t)=>{if(t)ce(e.retry)})})}async function hx(e){if(!fC())return!1;let t=p().performAction(e),r;try{r=await t}catch(i){return C.error(i instanceof Error?i.message:String(i),{key:"account.action",source:"Account",tier:"toast"}),!1}if(r?.status==="done")return await z(),!0;if(r?.status!=="redirect")await Bd();return!1}function m$(){for(let e of N()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")C.warn(e.message,t);else C.info(e.message,t)}}
|
|
2
|
+
export{Bd,lC,cC,bA,vA,a$,Bb,sr,ka,dC,l$,c$,d$,Np,u$,yA,wA,zd,xA,cx,sl,dx,_A,SA,CA,Cm,kA,uC,us,h$,p$,EA,ux,zb,hC,TA,km,LA,pC,Yl,lh,$A,fC,f$,mC,Em,IA,hx,m$};
|
|
3
|
+
|
|
4
|
+
//# debugId=D99709F683E98F4E64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-4hp8pkyt.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{Pp}from"./studio-q7rtx6zq.js";import{Mm,Hx,u}from"./studio-c05wdnt3.js";import{g}from"./studio-43sd2mam.js";import{to,Sr,Xw,h}from"./studio-d5grtb9e.js";import{Ae}from"./studio-fbhxxc5f.js";import{T,R}from"./studio-x9hsze61.js";import{vt,nl,Di,Hc,Tp,Wr,Lb,OL,HL}from"./studio-rj9eamf8.js";import{fS,mS,RT,Sw}from"./studio-8vcvfs7r.js";import{x,dl}from"./studio-gcxk20n7.js";import{n,Z,S,Ie,Ni,rd}from"./studio-vxq7fcvv.js";import{le}from"./studio-qgh13jtz.js";var Dy="Project Styles",Ru="stylebook",Gf="tokens",K="source",Bg={elements:Ru,variables:Gf,code:K},h_=["elements","variables","code"],ER=h_.map((e)=>Bg[e]),p_=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function f_(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function Q(e){let o=f_(e);if(o==="other")return e;let{prefix:t}=p_.find((r)=>r.id===o);return Hx(e,t)}function X(e){if(!e)return[];let o=[];for(let[t,r]of Object.entries(e)){if(!t.startsWith("--"))continue;if(!n(r)&&!Z(r))continue;o.push({group:f_(t),label:Q(t),name:t,value:r})}return o}function m_(e){let o=X(e);return p_.map((t)=>({group:t,tokens:o.filter((r)=>r.group===t.id)}))}function g_(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=Wr(e),r=[],a=[];for(let{name:s,query:c}of o){let y=Tp(c);if(y)r.push({key:`@${s}`,kind:"scheme",label:y==="dark"?"Dark":"Light",name:s,scheme:y});else a.push({key:`@${s}`,kind:"feature",label:`@${s}`,name:s})}let i=t.map(({name:s})=>({key:`@${s}`,kind:"size",label:`@${s}`,name:s}));return[...r,...i,...a]}function _(e,o){return Ni(e,o.key)}function Ny(e,o,t){let r=_(e,o)?.[t];return n(r)||Z(r)?r:void 0}function Pk(e,o,t,r){if(r){rd(e,o.key)[t]=r;return}let a=_(e,o);if(!a)return;if(delete a[t],Object.keys(a).length===0)delete e[o.key]}function TR(e,o,t,r=[]){let a=new Set(r.map((i)=>i.name));return o.filter((i)=>!a.has(i.name)&&Ny(e,i,t)===void 0)}var cp={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
|
|
2
|
+
// to describe units of markup that
|
|
3
|
+
// when composed together, form the
|
|
4
|
+
// content or layout of a page.
|
|
5
|
+
registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var A={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",A);function W(e,o){let t=document.createElement("div");t.style.display="contents";let r=g({...e,...o}),a=null,i=!1;function s(){i=!0,R("stylebook-chrome",r,t).then((c)=>{i=!1,a=c})}return s(),{host:t,update(c){if(Object.assign(r,c),i||a!==null&&t.contains(a.root))return;a?.dispose(),a=null,t.textContent="",s()}}}function L(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function O(e){return S(e)&&!Array.isArray(e)}var B="& .element-card-preview";function Ay(e){let o={},t=(r)=>{let a={};for(let[i,s]of Object.entries(r))if(i!=="@--")a[i]=s;return a};for(let[r,a]of Object.entries(e)){if(!O(a)){o[r]=a;continue}if(r==="@--")continue;if(Pp(r)){o[r]=a;continue}if(r.startsWith("@")){let i={};for(let[s,c]of Object.entries(a))if(O(c)&&L(s))i[`${B} ${s}`]=t(c);else i[s]=c;o[r]=i;continue}if(L(r)){o[`${B} ${r}`]=t(a);continue}o[r]=a}return o}function H(e,o){let t=o.split(" "),r=e;for(let a of t){if(!O(r))return null;r=r[a]}return O(r)?r:null}function Oy(e,o){let t=H(e,o);if(t&&Object.keys(t).length>0)return!0;for(let[r,a]of Object.entries(e)){if(!r.startsWith("@")||!O(a))continue;let i=H(a,o);if(i&&Object.keys(i).length>0)return!0}return!1}function oe(e){if(!e)return null;return e.split(" ").pop()??null}function My(e,o){let t=oe(o),r=[],a=(i,s,c)=>{let y=c?`${c} ${i.tag}`:i.tag;r.push({depth:s,entry:i,path:y,selected:i.tag===t,tag:i.tag});let C=i.children?[...new Map(i.children.map((w)=>[w.tag,w])).values()]:[];for(let w of C)a(w,s+1,y)};for(let i of e)a(i,0,"");return r}function ne(e,o,t){let[r]=Array.isArray(e.children)?e.children:[];if(!S(r)||Array.isArray(r)||!Ie(r.items))return null;let{$ref:a}=r.items,i=a.startsWith("#/state/")?a.slice(8):"",s=e.state?.[i];if(!Array.isArray(s))return null;t[o]=s;for(let[y,C]of Object.entries(e.state??{}))if(y!==i&&!(y in t))t[y]=C;return{children:[{...r,items:{$ref:`#/state/${o}`}}],tagName:"div"}}function V(e){let o=new Map,t=new Map,r=e.filter.toLowerCase(),a=(l,d,f)=>{let p=l.tag===f?f:`${f} ${l.tag}`;o.set(Hc(d),p);let b=l.children??[];for(let[v,I]of b.entries())a(I,[...d,"children",v],f)},i=(l)=>{let d={...l.attributes};if(l.style)d.style=l.style;let f={tagName:l.tag};if(l.text)f.textContent=l.text;if(Object.keys(d).length>0)f.attributes=d;if(l.children)f.children=l.children.map(i);return f},s=(l,d,f,p,b)=>{o.set(Hc(p),l),o.set(Hc([...p,"children",0]),l);let v=[...p,"children",0,"children",0];if(b)a(b,v,l);else o.set(Hc(v),l);if(!t.has(l))t.set(l,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[f],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:d}],tagName:"div"}},c=[],y=(l,d)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:l},{attributes:{class:"sb-body"},children:d,tagName:"div"}],tagName:"div"}),C=()=>["children",c.length,"children",1];for(let l of e.meta.$sections){let d=l.elements;if(r)d=d.filter((b)=>b.tag.includes(r)||l.label.toLowerCase().includes(r));if(e.customizedOnly)d=d.filter((b)=>Oy(e.effectiveStyle,b.tag));if(d.length===0)continue;let f=C(),p=d.map((b,v)=>s(b.tag,`<${b.tag}>`,i(b),[...f,"children",v],b));c.push(y(l.label,p))}let w=[],E={};{let l=e.components;if(r)l=l.filter((d)=>d.tagName.toLowerCase().includes(r));if(e.customizedOnly)l=l.filter((d)=>Oy(e.effectiveStyle,d.tagName));if(l.length>0){let d=C(),f=l.map((p,b)=>{let v=[...d,"children",b];if(p.source!=="npm"&&p.path?.endsWith(".json")){w.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let m=e.specimens?.get(p.tagName);if(m?.kind==="props"){let P={$props:m.props,tagName:p.tagName};return s(p.tagName,`<${p.tagName}>`,P,v,null)}if(m?.kind==="row"){let P=ne(m.sample.doc,`stylebookRow${b}`,E);if(P)return s(p.tagName,`<${p.tagName}>`,P,v,null)}if(m?.kind!=="none"){let P={};for(let N of p.props??[])if(N.default!==void 0&&N.default!=="false"&&N.default!=="''")P[N.name]=String(N.default).replaceAll(/^'|'$/g,"");let D={tagName:p.tagName};if(Object.keys(P).length>0)D.attributes=P;return s(p.tagName,`<${p.tagName}>`,D,v,null)}}let M={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return s(p.tagName,`<${p.tagName}>`,M,v,null)});c.push(y("Components",f))}}if(c.length===0)c.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});let k={};if(w.length>0)k.$elements=w;if(e.effectiveHead&&e.effectiveHead.length>0)k.$head=e.effectiveHead;if(k.$media=e.effectiveMedia,Object.keys(E).length>0)k.state=E;return k.attributes={class:"sb-root"},k.children=c,k.style=Ay(e.effectiveStyle),k.tagName="div",{doc:k,pathToTag:o,tagToCardPath:t}}var q=new WeakMap;async function re(e){let{path:o}=e;if(e.source==="npm"||!o?.endsWith(".json"))return{kind:"bare"};let t=await RT(o);if(!t)return{kind:"bare"};let r=await fS(t,o);if(r.size>0&&await Sw(t,o,r))return{kind:"props",props:Object.fromEntries(r)};let a=await mS(t,o);if(a&&await Lb(e))return{kind:"row",sample:a};return await Sw(t,o,new Map)?{kind:"bare"}:{kind:"none"}}async function F(e,o=re){let t=q.get(e);if(!t)t=new Map,q.set(e,t);let r=t,a=await Promise.all(e.map(async(i)=>{let s=i.path??i.tagName,c=r.get(s);if(!c)c=o(i).catch(()=>({kind:"bare"})),r.set(s,c);return[i.tagName,await c]}));return new Map(a)}var G=new WeakMap;function ae(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:h.stylebook.customizedOnly,filter:h.stylebook.filter,filterLabel:`Filter the ${Dy} catalogue`,title:Dy},t=G.get(e);if(t)return t.update(o),t.host;let r=W(o,{setFilter:(a)=>{h.stylebook.filter=a},toggleCustomized:()=>{h.stylebook.customizedOnly=!h.stylebook.customizedOnly}});return G.set(e,r),r.host}function ie(e,o){let t=e.filter((r)=>r.name===(o??"base"));return t.length>0?t:e.slice(0,1)}async function LR(e,o){let t=e.wrap,r=vt(e.paneId),a=h.stylebook.filter.toLowerCase(),{customizedOnly:i}=h.stylebook,s=e.renderGeneration,c=Ae,y=F(c),C=to(r?.doc.document?.$media),{sizeBreakpoints:w,baseWidth:E}=Wr(C),k=w.length>0,l=ae(e);t.style.overflow="hidden";let d=[];if(k){d.push({displayName:Di("--"),name:"base",width:E});for(let m of w)d.push({displayName:Di(m.name),name:m.name,width:m.width})}let f;if(!k){let m=C["--"],P=m?`${Di("--")} (${E}px)`:null;f=[o.canvasPanelEntry(m?"base":null,P,!m,m?E:void 0)]}else f=ie(d,nl(e.paneId)).map((m)=>o.canvasPanelEntry(m.name,`${m.displayName} (${m.width}px)`,!1,m.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:f.map((m)=>m.item)},f))return;let b=o.stageHost(e,"chrome-host");if(b&&b.firstChild!==l)b.replaceChildren(l);let v=await y;if(e.renderGeneration!==s)return;let I=V({components:c,specimens:v,customizedOnly:Boolean(i),effectiveHead:Xw(r?.doc.document?.$head),effectiveMedia:C,effectiveStyle:Sr(r?.doc.document?.style),filter:a,meta:cp,projectRoot:x?.projectRoot??null}),{panels:M}=e;for(let{panel:m}of f)M.push(m),OL(e.renderGeneration,I,m.canvas,m._width);if(k)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function Cd(e,o,{panCanvas:t=!1}={}){let r={activeSelector:e,rightTab:"style"};if(o!==void 0)r.activeMedia=o;if(dl(u.value,{selection:[],ui:r}),h.stylebook.selection=e,e&&t)HL(e)}var b_=[{id:"page",strip:"page",title:"Page"},{id:"properties",strip:"element",title:"Content"},{id:"style",strip:"element",title:"Style"},{id:"events",strip:"element",title:"Logic"},{id:"assistant",strip:"assistant",title:"Assistant"}],Fk=[{id:"page",title:"Page"},{id:"element",title:"Element"},{id:"assistant",title:"Assistant"}];function v_(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var j=(e)=>e.document.open,J=(e)=>e.selection.count>0&&e.editor.kind==="canvas",z=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Mm(o)),U="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",Y=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Kf(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:j,enablement:(t)=>t.document.dirty,requires:"unsaved changes",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:j,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:j,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",order:1,when:j,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",order:2,when:j,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:J,enablement:z,requires:U,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let r=t.selection.paths.length;return`Duplicated ${r} element${r===1?"":"s"}; the ${r===1?"copy is":"copies are"} selected at ${Y(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:J,enablement:(t)=>z(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(le("he70fc2b"),import("./convert-to-repeater-he70fc2b.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:J,enablement:z,requires:U,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:r})=>{let a=t.selection.paths.length;return`Deleted ${a} element${a===1?"":"s"} at ${Y(t.selection.paths)} in one undo step; the selection is now ${r.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:J,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:j,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...se(e),...ce(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function se(e){return e.panelRoster.map((o)=>({id:`panel.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(t)=>t.project.open&&(o.when?.(t)??!0),run:()=>e.focusPanel(o.id)}))}function ce(e){return b_.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(a)=>a.document.open,run:()=>e.focusInspectorTab(o.id)}))}
|
|
6
|
+
export{Dy,Ru,Gf,Bg,h_,ER,p_,f_,m_,g_,Ny,Pk,TR,Ay,Oy,My,cp,LR,Cd,b_,Fk,v_,Kf};
|
|
7
|
+
|
|
8
|
+
//# debugId=96E67B117E07535A64756E2164756E21
|
|
9
|
+
//# sourceMappingURL=studio-58xg6j2q.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{pt,Go,Ap,Cr}from"./studio-s32578pn.js";import{g}from"./studio-43sd2mam.js";import{h}from"./studio-d5grtb9e.js";import{Qt,ov,u}from"./studio-c05wdnt3.js";import{x}from"./studio-gcxk20n7.js";var xb=["application","project","document","selection"],fN=["global","canvas","caret","grid","code","dock","palette"],mN=["File","Edit","Selection","Insert","View","Document","Project","Source Control","Publish","Assistant","Collaborate","Help"],v=["commandbar/primary","commandbar/overflow","statusbar/project","statusbar/document","statusbar/selection","context/element","context/file","context/layer","context/tab","context/pane","blockbar","blockbar/format","outline/row","settings/menu","palette","never"],P={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}},b=["rail/project","rail/document","navigator","inspector","dock.bottom"],y={"rail/project":{admits:["project"],note:"the rail's upper group — Site, and Files with the developer panels on"},"rail/document":{admits:["document"],note:"the rail's lower group — Outline, Data, and Packages with the developer panels on"},navigator:{admits:["project","document"],note:"whichever level the hosted panel declares; the panel header prints it"},inspector:{admits:["document","selection"],note:"Page is the open document's tab, Element the selection's (§6)"},"dock.bottom":{admits:["project","document"],note:"the panel header states which"}};function w(e){return e==="bottom"?"dock.bottom":e}function E(e){let t=[w(e.dock)];if(e.rail!==!1)t.push(`rail/${e.level}`);return t}function C(e){return b.some((t)=>t===e)}function c(e){let t=[];if(!d(e.level))return t.push({panelId:e.id,placement:"—",level:String(e.level),message:`declares unknown level "${String(e.level)}" (expected one of: ${xb.join(", ")})`}),t;for(let n of E(e)){if(!C(n)){t.push({panelId:e.id,placement:n,level:e.level,message:`is level "${e.level}" and would render in "${n}", which is not a panel `+"placement — the rail has a group for project and one for document, and nothing else"});continue}let o=y[n];if(!o.admits.includes(e.level))t.push({panelId:e.id,placement:n,level:e.level,message:`is level "${e.level}" but "${n}" admits only ${o.admits.join(", ")} — ${o.note}`})}return t}function S(e){return v.some((t)=>t===e)}function d(e){return xb.some((t)=>t===e)}function gN(e){let t=[];if(!d(e.level))return t.push({commandId:e.id,placement:"—",level:String(e.level),message:`declares unknown level "${String(e.level)}" (expected one of: ${xb.join(", ")})`}),t;for(let n of e.menus??[]){if(!S(n)){t.push({commandId:e.id,placement:String(n),level:e.level,message:`declares unknown placement "${String(n)}"`});continue}let o=P[n];if(!o.admits.includes(e.level))t.push({commandId:e.id,placement:n,level:e.level,message:`is level "${e.level}" but "${n}" admits only ${o.admits.join(", ")} — ${o.note}`})}return t}var l="true",i=g({on:Go(pt.developerPanels)===l});Ap((e)=>{if(e.includes(pt.developerPanels.key))i.on=Go(pt.developerPanels)===l});function CS(){return i.on}function bN(e){i.on=e,Cr(pt.developerPanels,e?l:"")}function Yu(){let e=ov();return e.project.open=x!==null,e.project.isMultilingual=(Qt(x?.projectConfig??{}).i18n?.locales.length??0)>1,e.git.dirtyCount=h.git.status?.files.length??0,e.workspace.id=h.workspace,e.document.open=u.value!==null,e}var L=/^[a-z][\w-]*$/,a=new Map;function Zn(e){if(!L.test(e.id))throw Error(`Panel id "${e.id}" is malformed — expected /^[a-z][\\w-]*$/, because the id is also `+`the region "navigator/panel:${e.id}" and the value view.setActivity accepts.`);if(a.has(e.id))throw Error(`Panel "${e.id}" is already registered — a second definition site is the defect this `+"registry exists to prevent.");let t=c({id:e.id,level:e.level,dock:e.dock,rail:e.rail});if(t.length>0){let n=t.map((o)=>` ✗ ${e.id} ${o.message}`).join(`
|
|
2
|
+
`);throw Error(`Panel "${e.id}" violates the level × placement matrix:
|
|
3
|
+
${n}`)}if(e.railLabel!==void 0&&(e.railLabel.trim()===""||!e.title.startsWith(e.railLabel)))throw Error(`Panel "${e.id}" declares railLabel "${e.railLabel}", which is not a leading part of its title "${e.title}": the rail button's accessible name is the title, and the words on screen must be inside it (WCAG 2.5.3, Label in Name).`);a.set(e.id,e)}function Cp(e){return a.get(e)}function Mw(e){let t=[...a.values()];return e?t.filter((n)=>n.dock===e):t}function Pw(e,t){return e.when?e.when(t):!0}var m=[{level:"project",label:"Project"},{level:"document",label:"Document"}];function p(){return Mw().filter((e)=>e.rail!==!1)}function QT(e){let t=CS(),n=p().filter((o)=>o.rail!=="developer"||t);return m.flatMap(({level:o,label:f})=>{let r=n.filter((s)=>s.level===o&&Pw(s,e));return r.length>0?[{level:o,label:f,panels:r}]:[]})}function vN(){let e=p();return m.flatMap(({level:t})=>e.filter((n)=>n.level===t))}
|
|
4
|
+
export{xb,fN,mN,gN,CS,bN,Yu,Zn,Cp,Mw,Pw,QT,vN};
|
|
5
|
+
|
|
6
|
+
//# debugId=99CE6A3EFEFBA45E64756E2164756E21
|
|
7
|
+
//# sourceMappingURL=studio-5g0rprdt.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Pt,Nt,ae}from"./studio-q7rtx6zq.js";import{p}from"./studio-w4rz9hdk.js";import{us}from"./studio-4hp8pkyt.js";import{g}from"./studio-43sd2mam.js";import{qe,ft,T,R,Jt,tt}from"./studio-x9hsze61.js";import{Wl,dN,wb,YT,uN,Ri,Pd}from"./studio-3e54qh39.js";import{sb,ME}from"./studio-zcd2e7yz.js";import{x}from"./studio-gcxk20n7.js";import{te}from"./studio-vxq7fcvv.js";import{le}from"./studio-qgh13jtz.js";function Dl(e){let t=e.trim().replaceAll("\\","/").split("/").filter((n)=>n!=="");return t.some((n)=>n==="."||n==="..")?null:t.join("/")}var w={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",w);var D="https://github.com/apps/cloudflare-pages/installations/new";function I(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function j(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:I(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:D,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function k(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let n="",m=!1,P=()=>{if(m)return;m=!0,e.onClosed()},C=()=>m,d=g({...j(e.view),closed:P,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{n="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{n=o},submit:()=>{e.onSubmit()},verify:()=>{let o=n;n="",e.onSaveToken(o)}}),y=null,A=R("publish",d,t).then(async(o)=>{y=o;let u=o.root;if(C())return o.dispose(),u;if(await Jt(u),C())return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(qe,ft("modal","publish")),Pt(u),u});return{close(){let o=y?.root;if(o instanceof HTMLElement)Nt(o);y?.dispose(),y=null,n="",t.remove(),P()},host:t,ready:A,update(o){Object.assign(d,j(o))}}}var f=null,i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function N(){return x?.projectConfig??null}function O(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=/^[\w.-]+\/[\w.-]+@[^:]+:(.+)$/.exec(p().projectRoot)?.[1]??"";return Dl(e)??""}function U(){let e=Ri();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function S(){let e=Wl(),t=i==="loading"?null:i;return{accounts:h.map((n)=>({label:n.name,value:n.id})),busy:c,connected:t?.connected===!0,deploy:U(),deployment:l?{environment:l.environment,stage:l.stage,status:l.status,url:l.url}:null,error:r,form:{...a},hosted:e&&te(p().cfConnect),lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:i==="loading",replacing:b,supported:e,tokenStored:sb()!==""}}function s(){if(f){f.update(S());return}f=k({layer:tt("modal"),onClosed:B,onConnect:()=>{M()},onDisconnect:()=>{z()},onField:(e,t)=>{a={...a,[e]:t}},onOpenAccounts:_,onRefresh:()=>{v()},onReplaceToken:()=>{b=!0,r="",s()},onSaveToken:(e)=>{E(e)},onSubmit:()=>{V()},view:S()})}async function v(){i="loading",s();try{if(i=await p().cfConnection?.()??null,i?.connected&&!i.needsReconnect){h=await dN(),a={...a,accountId:i.accountId??h[0]?.id??""};let e=Ri();if(e)l=await wb(e),Pd(l)}}catch(e){i=null,r=e instanceof Error?e.message:String(e)}s()}async function E(e){let t=e.trim();if(!t){r="Paste a token, or use Preferences › Accounts to forget the stored one.",s();return}ME(t),b=!1,r="",await v()}function _(){ae()?.run("app.preferences",{section:"accounts"})}async function M(){c=!0,r="",s();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")r="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (le("haqazq5r"),import("./cf-account-picker-haqazq5r.js"));await t()}}catch(e){r=e instanceof Error?e.message:String(e)}c=!1,us(),await v()}async function V(){let e=N();if(!e)return;if(!a.projectName||!a.owner||!a.repo||!a.accountId){r="Account, project name, and the GitHub owner/repo are all required.",s();return}c=!0,r="",s();try{let t=L(),n={accountId:a.accountId,owner:a.owner,productionBranch:a.branch||"main",projectName:a.projectName,repo:a.repo};if(t)n.rootDir=t;let m=await uN(e,n);l=await wb(m).catch(()=>null)}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}async function z(){let e=N();if(!e)return;c=!0,s();try{await YT(e,null),l=null}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}function B(){let e=f;f=null,e?.close()}function Ck(e){i={accountId:e.accountId??"demo-account",connected:!0},h=[],l=e.deployment,Pd(e.deployment),r="",c=!1,b=!1,s()}function q2(){let e=N(),{owner:t,repo:n}=H();i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:t,projectName:Ri()?.projectName??O(e?.name??""),repo:n},s(),v()}
|
|
2
|
+
export{Dl,Ck,q2};
|
|
3
|
+
|
|
4
|
+
//# debugId=7F93180A599560B064756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-6m380wp7.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Sy,va,e_,ss,t_,as}from"./studio-83mk4bgg.js";import{$e}from"./studio-p4nrkvqr.js";import{n,Z,v}from"./studio-vxq7fcvv.js";var zI="meta",WI="frontmatter",VI="structure",UI="source",qI=2;function m(e){return v(e)}function _u(e){return e.getMap(zI)}function GI(e){return e.getMap(WI)}function Dg(e){return e.getMap(VI)}function KI(e){return e.getText(UI)}var Y=new Set(["textContent"]),h=new Set(["style","attributes","$props"]);function y(e,t){let o=e.toString();if(o===t)return!1;let r=0,s=Math.min(o.length,t.length);while(r<s&&o[r]===t[r])r+=1;let a=o.length,i=t.length;while(a>r&&i>r&&o[a-1]===t[i-1])a-=1,i-=1;if(a>r)e.delete(r,a-r);if(i>r)e.insert(r,t.slice(r,i));return!0}function f(e){let t=new ss;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;t.set(o,m(r)?f(r):$e(r))}return t}function g(e,t){for(let o of[...e.keys()])if(!(o in t)||t[o]===void 0)e.delete(o);for(let[o,r]of Object.entries(t)){if(r===void 0)continue;let s=e.get(o);if(m(r))if(s instanceof ss)g(s,r);else e.set(o,f(r));else if(!b(s,r))e.set(o,$e(r))}}function b(e,t){if(e===t)return!0;if(e instanceof ss||e instanceof va||e instanceof as)return!1;return JSON.stringify(e??null)===JSON.stringify(t??null)}function d(e){return n(e)?new as(e):JI(e)}function Hf(e){let t=new va;return t.insert(0,e.map((o)=>d(o))),t}function JI(e){if(!m(e))throw TypeError("collab-schema: a document node must be a plain object");let t=new ss;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;if(o==="children"&&Array.isArray(r))t.set(o,Hf(r));else if(Y.has(o)&&n(r))t.set(o,new as(r));else if(h.has(o)&&m(r))t.set(o,f(r));else t.set(o,$e(r))}return t}function S(e){return Object.fromEntries(Array.from(e.entries(),([t,o])=>[t,Bf(o)]))}function E(e){if(n(e))return e;return e instanceof as?e.toString():S(e)}function Bf(e){if(e instanceof ss)return S(e);if(e instanceof va)return e.toArray().map((t)=>Bf(t));if(e instanceof as)return e.toString();return e}function l2(e){return S(Dg(e))}function X0(e,t){let o=Dg(e);for(let r of t)if(o instanceof ss)o=o.get(String(r));else if(o instanceof va){let s=Number(r);if(!Number.isInteger(s)||s<0||s>=o.length)return;o=o.get(s)}else return;return o}function pk(e,t,o){let r=KI(e);if(r.toString()===t)return!1;return e.transact(()=>{y(r,t)},o),!0}function c2(e,t,o={}){let r=_u(e);if(r.get("structureSeeded")===!0)return!1;return e.transact(()=>{let s=Dg(e);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))s.set(i,Hf(c));else s.set(i,$e(c))}let a=GI(e);for(let[i,c]of Object.entries(o.frontmatter??{}))if(c!==void 0)a.set(i,$e(c));r.set("schemaVersion",qI),r.set("canonical","structure"),r.set("canonicalRev",0),r.set("sourceFormat",o.sourceFormat??null),r.set("structureSeeded",!0)},o.origin),!0}var d2="jx-local",u2="jx-mirror",h2="jx-seed";class Su extends Error{constructor(e){super(`collab-path-unresolved:${e.join("/")}`);this.name="CollabPathError"}}function O(e,t){let o=X0(e,t);if(!(o instanceof ss))throw new Su(t);return o}function p(e,t,o){let r=O(e,t),s=r.get("children");if(s instanceof va)return s;if(o&&s===void 0){let a=new va;return r.set("children",a),a}throw new Su([...t,"children"])}function J(e,t,o){let r=e.get(t);if(t==="children"&&Array.isArray(o)){e.set(t,Hf(o));return}if(Y.has(t)&&n(o)){if(r instanceof as)y(r,o);else e.set(t,new as(o));return}if(h.has(t)&&v(o)){if(r instanceof ss)g(r,o);else e.set(t,f(o));return}e.set(t,$e(o))}function V(e,t){let{op:o}=t;switch(t.op){case"set-key":{let r=O(e,t.path);if(t.value===void 0)r.delete(t.key);else J(r,t.key,t.value);return}case"insert-child":{let r=p(e,t.parentPath,!0);if(t.index<0||t.index>r.length)throw new Su([...t.parentPath,"children",t.index]);r.insert(t.index,[d(t.node)]);return}case"remove-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new Su([...t.parentPath,"children",t.index]);r.delete(t.index,1);return}case"set-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new Su([...t.parentPath,"children",t.index]);let s=r.get(t.index);if(s instanceof as&&n(t.node)){y(s,t.node);return}r.delete(t.index,1),r.insert(t.index,[d(t.node)]);return}case"move-child":{let r=p(e,t.fromParentPath,!1),s=p(e,t.toParentPath,!0);if(t.fromIndex<0||t.fromIndex>=r.length)throw new Su([...t.fromParentPath,"children",t.fromIndex]);let a=Bf(r.get(t.fromIndex));if(r.delete(t.fromIndex,1),t.toIndex<0||t.toIndex>s.length)throw new Su([...t.toParentPath,"children",t.toIndex]);s.insert(t.toIndex,[d(a)]);return}default:throw Error(`unknown-doc-op:${o}`)}}function p2(e,t,o){e.transact(()=>{for(let r of t)V(e,r)},o)}function w(e){for(let t=0;t<e.length;t++){let o=e[t];if(!n(o))continue;if(h.has(o))return{key:o,nodePath:e.slice(0,t)};if(Y.has(o))return{key:o,nodePath:e.slice(0,t)}}return null}function P(e){return e instanceof as||e instanceof ss||n(e)}function C(e){return e.every((t)=>n(t)||Z(t))}function f2(e){if(e.length===0)return[];let t=e.map((s)=>s.path);if(!t.every((s)=>C(s)))return null;for(let s=0;s<t.length;s++)for(let a=0;a<t.length;a++){if(s===a)continue;let i=t[s],c=t[a];if(i.length<=c.length&&i.every((u,l)=>u===c[l]))return null}if(e.filter((s)=>s instanceof Sy).length>1)return null;let r=[];for(let s of e){let{path:a}=s,i=w(a);if(i){let{doc:c}=s.target;if(!c)return null;let u=X0(c,[...i.nodePath,i.key]);if(u===void 0)return null;r.push({key:i.key,op:"set-key",path:i.nodePath,value:Bf(u)});continue}if(s instanceof t_){let c=a.at(-1);if(a.at(-2)==="children"&&Z(c)){r.push({index:c,node:s.target.toString(),op:"set-child",parentPath:a.slice(0,-2)});continue}return null}if(s instanceof e_){let c=s.target;for(let[u,l]of s.changes.keys)if(l.action==="delete")r.push({key:u,op:"set-key",path:a});else r.push({key:u,op:"set-key",path:a,value:Bf(c.get(u))})}else if(s instanceof Sy){if(a.at(-1)!=="children")return null;let c=a.slice(0,-1),u=0;for(let l of s.changes.delta)if(l.retain!==void 0)u+=l.retain;else if(l.delete!==void 0)for(let x=0;x<l.delete;x++)r.push({index:u,op:"remove-child",parentPath:c});else if(l.insert!==void 0){let x=Array.isArray(l.insert)?l.insert:[l.insert];for(let D of x){if(!P(D))return null;r.push({index:u,node:E(D),op:"insert-child",parentPath:c}),u+=1}}}else return null}return r}function m2(e,t,o){e.transact(()=>{let r=Dg(e),s=[...r.keys()];for(let i of s)if(!(i in t)||t[i]===void 0)r.delete(i);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))r.set(i,Hf(c));else r.set(i,$e(c))}let a=_u(e);a.set("canonicalRev",Number(a.get("canonicalRev")??0)+1)},o)}function fk(e){return _u(e).get("canonical")==="source"?"source":"structure"}function mk(e){return Number(_u(e).get("canonicalRev")??0)}function g2(e,t,o){if(fk(e)==="source")return!1;return e.transact(()=>{pk(e,t,o);let r=_u(e);r.set("canonical","source"),r.set("canonicalRev",mk(e)+1)},o),!0}function b2(e,t){if(fk(e)!=="source")return!1;return e.transact(()=>{let o=_u(e);o.set("canonical","structure"),o.set("canonicalRev",mk(e)+1)},t),!0}function v2(e,t,o){let r=[];for(let[s,a]of e.getStates()){let i=a;if(s!==o&&i.mode==="source"&&i.focusedPath===t)r.push(s)}return r}function y2(e,t){let o=e.clientID,r=e.getStates().get(o);if(r?.mode!=="source"||r.focusedPath!==t)return!1;let s=o;for(let[a,i]of e.getStates()){let c=i;if(c.mode==="source"&&c.focusedPath===t&&c.canWrite!==!1&&a<s)s=a}return s===o}var gk=["#4f9cf9","#e5484d","#30a46c","#f5a524","#8e4ec6","#00a2c7","#e93d82","#a8845c"];function w2(e){let t=5381;for(let r=0;r<e.length;r++)t=Math.imul(t,33)+(e.codePointAt(r)??0);let o=Math.abs(t)%gk.length;return gk[o]}export{zI,WI,VI,UI,qI,_u,GI,Dg,KI,Hf,JI,Bf,l2,X0,pk,c2,d2,u2,h2,Su,p2,f2,m2,fk,mk,g2,b2,v2,y2,gk,w2};
|
|
2
|
+
|
|
3
|
+
//# debugId=927469AD1BAD395664756E2164756E21
|
|
4
|
+
//# sourceMappingURL=studio-80jyh1xh.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{n,S}from"./studio-vxq7fcvv.js";var rs=Math.floor;var nt=Math.abs;var ue=(t,e)=>t<e?t:e,Z=(t,e)=>t>e?t:e;var de=(t)=>t!==0?t<0:1/t<0;var cn=1,ln=2,fe=4,pe=8;var dt=32,F=64,D=128;var Vt=31,Mt=63,X=127;var pr=2147483647;var{MAX_SAFE_INTEGER:ft,MIN_SAFE_INTEGER:hn}=Number;var gr=Number.isInteger||((t)=>typeof t==="number"&&isFinite(t)&&rs(t)===t);var G=()=>new Set;var ge=(t)=>t[t.length-1];var mr=(t,e)=>{for(let r=0;r<e.length;r++)t.push(e[r])},j=Array.from,me=(t,e)=>{for(let r=0;r<t.length;r++)if(!e(t[r],r,t))return!1;return!0},$t=(t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r],r,t))return!0;return!1};var xr=(t,e)=>{let r=Array(t);for(let s=0;s<t;s++)r[s]=e(s,r);return r};var Q=Array.isArray;var{fromCharCode:fn,fromCodePoint:bi}=String,Zc=fn(65535),ki=(t)=>t.toLowerCase(),_i=/^\s*/g,Si=(t)=>t.replace(_i,""),Ei=/([A-Z])/g,pn=(t,e)=>Si(t.replace(Ei,(r)=>`${e}${ki(r)}`));var Ii=(t)=>{let e=unescape(encodeURIComponent(t)),r=e.length,s=new Uint8Array(r);for(let i=0;i<r;i++)s[i]=e.codePointAt(i);return s},gt=typeof TextEncoder<"u"?new TextEncoder:null,Ui=(t)=>gt.encode(t),yr=gt?Ui:Ii;var pt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});if(pt&&pt.decode(new Uint8Array).length===1)pt=null;var br=(t,e)=>xr(e,()=>t).join("");class wt{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}var Ja=()=>new wt;var vk=(t)=>{let e=t.cpos;for(let r=0;r<t.bufs.length;r++)e+=t.bufs[r].length;return e};var wr=(t)=>{let e=new Uint8Array(vk(t)),r=0;for(let s=0;s<t.bufs.length;s++){let i=t.bufs[s];e.set(i,r),r+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),r),e},Ti=(t,e)=>{let r=t.cbuf.length;if(r-t.cpos<e)t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(Z(r,e)*2),t.cpos=0},T=(t,e)=>{let r=t.cbuf.length;if(t.cpos===r)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(r*2),t.cpos=0;t.cbuf[t.cpos++]=e};var xe=T;var _t=(t,e)=>{while(e>X)T(t,D|X&e),e=rs(e/128);T(t,X&e)},ye=(t,e)=>{let r=de(e);if(r)e=-e;T(t,(e>Mt?D:0)|(r?F:0)|Mt&e),e=rs(e/64);while(e>0)T(t,(e>X?D:0)|X&e),e=rs(e/128)},gn=new Uint8Array(30000),Ai=gn.length/3,Ci=(t,e)=>{if(e.length<Ai){let r=gt.encodeInto(e,gn).written||0;_t(t,r);for(let s=0;s<r;s++)T(t,gn[s])}else Wo(t,yr(e))},Di=(t,e)=>{let r=unescape(encodeURIComponent(e)),s=r.length;_t(t,s);for(let i=0;i<s;i++)T(t,r.codePointAt(i))},Ya=gt&>.encodeInto?Ci:Di;var jt=(t,e)=>{let r=t.cbuf.length,s=t.cpos,i=ue(r-s,e.length),o=e.length-i;if(t.cbuf.set(e.subarray(0,i),s),t.cpos+=i,o>0)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Z(r*2,o)),t.cbuf.set(e.subarray(i)),t.cpos=o},Wo=(t,e)=>{_t(t,e.byteLength),jt(t,e)},mn=(t,e)=>{Ti(t,e);let r=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,r},Bi=(t,e)=>mn(t,4).setFloat32(0,e,!1),Oi=(t,e)=>mn(t,8).setFloat64(0,e,!1),vi=(t,e)=>mn(t,8).setBigInt64(0,e,!1);var kr=new DataView(new ArrayBuffer(4)),Ni=(t)=>(kr.setFloat32(0,t),kr.getFloat32(0)===t),mt=(t,e)=>{switch(typeof e){case"string":T(t,119),Ya(t,e);break;case"number":if(gr(e)&&nt(e)<=pr)T(t,125),ye(t,e);else if(Ni(e))T(t,124),Bi(t,e);else T(t,123),Oi(t,e);break;case"bigint":T(t,122),vi(t,e);break;case"object":if(e===null)T(t,126);else if(Q(e)){T(t,117),_t(t,e.length);for(let r=0;r<e.length;r++)mt(t,e[r])}else if(e instanceof Uint8Array)T(t,116),Wo(t,e);else{T(t,118);let r=Object.keys(e);_t(t,r.length);for(let s=0;s<r.length;s++){let i=r[s];Ya(t,i),mt(t,e[i])}}break;case"boolean":T(t,e?120:121);break;default:T(t,127)}};class be extends wt{constructor(t){super();this.w=t,this.s=null,this.count=0}write(t){if(this.s===t)this.count++;else{if(this.count>0)_t(this,this.count-1);this.count=1,this.w(this,t),this.s=t}}}var _r=(t)=>{if(t.count>0){if(ye(t.encoder,t.count===1?t.s:-t.s),t.count>1)_t(t.encoder,t.count-2)}};class xt{constructor(){this.encoder=new wt,this.s=0,this.count=0}write(t){if(this.s===t)this.count++;else _r(this),this.count=1,this.s=t}toUint8Array(){return _r(this),wr(this.encoder)}}var Sr=(t)=>{if(t.count>0){let e=t.diff*2+(t.count===1?0:1);if(ye(t.encoder,e),t.count>1)_t(t.encoder,t.count-2)}};class qt{constructor(){this.encoder=new wt,this.s=0,this.count=0,this.diff=0}write(t){if(this.diff===t-this.s)this.s=t,this.count++;else Sr(this),this.count=1,this.diff=t-this.s,this.s=t}toUint8Array(){return Sr(this),wr(this.encoder)}}class wn{constructor(){this.sarr=[],this.s="",this.lensE=new xt}write(t){if(this.s+=t,this.s.length>19)this.sarr.push(this.s),this.s="";this.lensE.write(t.length)}toUint8Array(){let t=new wt;return this.sarr.push(this.s),this.s="",Ya(t,this.sarr.join("")),jt(t,this.lensE.toUint8Array()),wr(t)}}var R=(t)=>Error(t),L=()=>{throw R("Method unimplemented")},v=()=>{throw R("Unexpected case")};var ke=R("Unexpected end of array"),Ir=R("Integer out of Range"),Ri=(t,e,r)=>{if(e<0||r<0||e+r>t.length)throw ke;return new Uint8Array(t.buffer,t.byteOffset+e,r)},Li=(t,e,r)=>{if(e<0||r<0||e+r>t.length)throw ke;return new DataView(t.buffer,t.byteOffset+e,r)};class Gt{constructor(t){this.arr=t,this.pos=0}}var Za=(t)=>new Gt(t),Ur=(t)=>t.pos!==t.arr.length;var Vi=(t,e)=>{let r=Ri(t.arr,t.pos,e);return t.pos+=e,r},tr=(t)=>Vi(t,Dt(t));var rt=(t)=>t.arr[t.pos++];var Dt=(t)=>{let e=0,r=1,s=t.arr.length;while(t.pos<s){let i=t.arr[t.pos++];if(e=e+(i&X)*r,r*=128,i<D)return e;if(e>ft)throw Ir}throw ke},_e=(t)=>{let e=t.arr[t.pos++],r=e&Mt,s=64,i=(e&F)>0?-1:1;if((e&D)===0)return i*r;let o=t.arr.length;while(t.pos<o){if(e=t.arr[t.pos++],r=r+(e&X)*s,s*=128,e<D)return i*r;if(r>ft)throw Ir}throw ke};var Mi=(t)=>{let e=Dt(t);if(e===0)return"";else{let r=String.fromCodePoint(rt(t));if(--e<100)while(e--)r+=String.fromCodePoint(rt(t));else while(e>0){let s=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+s);t.pos+=s,r+=String.fromCodePoint.apply(null,i),e-=s}return decodeURIComponent(escape(r))}},$i=(t)=>pt.decode(tr(t)),Xa=pt?$i:Mi;var yn=(t,e)=>{let r=Li(t.arr,t.pos,e);return t.pos+=e,r},Fi=(t)=>yn(t,4).getFloat32(0,!1),ji=(t)=>yn(t,8).getFloat64(0,!1),qi=(t)=>yn(t,8).getBigInt64(0,!1);var Gi=[(t)=>{return},(t)=>null,_e,Fi,ji,qi,(t)=>!1,(t)=>!0,Xa,(t)=>{let e=Dt(t),r={};for(let s=0;s<e;s++){let i=Xa(t);r[i]=yt(t)}return r},(t)=>{let e=Dt(t),r=[];for(let s=0;s<e;s++)r.push(yt(t));return r},tr],yt=(t)=>Gi[127-rt(t)](t);class Se extends Gt{constructor(t,e){super(t);this.reader=e,this.s=null,this.count=0}read(){if(this.count===0)if(this.s=this.reader(this),Ur(this))this.count=Dt(this)+1;else this.count=-1;return this.count--,this.s}}class bt extends Gt{constructor(t){super(t);this.s=0,this.count=0}read(){if(this.count===0){this.s=_e(this);let t=de(this.s);if(this.count=1,t)this.s=-this.s,this.count=Dt(this)+2}return this.count--,this.s}}class zt extends Gt{constructor(t){super(t);this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let t=_e(this),e=t&1;if(this.diff=rs(t/2),this.count=1,e)this.count=Dt(this)+2}return this.s+=this.diff,this.count--,this.s}}class bn{constructor(t){this.decoder=new bt(t),this.str=Xa(this.decoder),this.spos=0}read(){let t=this.spos+this.decoder.read(),e=this.str.slice(this.spos,t);return this.spos=t,e}}var A=()=>new Map,Ee=(t)=>{let e=A();return t.forEach((r,s)=>{e.set(s,r)}),e},q=(t,e,r)=>{let s=t.get(e);if(s===void 0)t.set(e,s=r());return s},Ar=(t,e)=>{let r=[];for(let[s,i]of t)r.push(e(i,s));return r},Cr=(t,e)=>{for(let[r,s]of t)if(e(s,r))return!0;return!1};class Ie{constructor(){this._observers=A()}on(t,e){return q(this._observers,t,G).add(e),e}once(t,e){let r=(...s)=>{this.off(t,r),e(...s)};this.on(t,r)}off(t,e){let r=this._observers.get(t);if(r!==void 0){if(r.delete(e),r.size===0)this._observers.delete(t)}}emit(t,e){return j((this._observers.get(t)||A()).values()).forEach((r)=>r(...e))}destroy(){this._observers=A()}}class bk{constructor(){this._observers=A()}on(t,e){q(this._observers,t,G).add(e)}once(t,e){let r=(...s)=>{this.off(t,r),e(...s)};this.on(t,r)}off(t,e){let r=this._observers.get(t);if(r!==void 0){if(r.delete(e),r.size===0)this._observers.delete(t)}}emit(t,e){return j((this._observers.get(t)||A()).values()).forEach((r)=>r(...e))}destroy(){this._observers=A()}}var tl=crypto.subtle,Dr=crypto.getRandomValues.bind(crypto);var kn=()=>Dr(new Uint32Array(1))[0];var zi=[1e7]+-1000+-4000+-8000+-100000000000,Br=()=>zi.replace(/[018]/g,(t)=>(t^kn()&15>>t/4).toString(16));var Cu=Date.now;var _n=(t)=>new Promise(t);var rl=Promise.all.bind(Promise);var Sn=(t)=>t===void 0?null:t;class vr{constructor(){this.map=new Map}setItem(t,e){this.map.set(t,e)}getItem(t){return this.map.get(t)}}var Nr=new vr,Ki=!0;try{if(typeof localStorage<"u"&&localStorage)Nr=localStorage,Ki=!1}catch(t){}var Rr=Nr;var st=Symbol("Equality"),Ue=(t,e)=>t===e||!!t?.[st]?.(e)||!1;var Lr=(t)=>typeof t==="object",{assign:Vr,keys:Zi}=Object;var Mr=(t,e)=>{for(let r in t)e(t[r],r)};var Jt=(t)=>Zi(t).length;var $r=(t)=>{for(let e in t)return!1;return!0},kt=(t,e)=>{for(let r in t)if(!e(t[r],r))return!1;return!0},Pt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),In=(t,e)=>t===e||Jt(t)===Jt(e)&&kt(t,(r,s)=>(r!==void 0||Pt(e,s))&&Ue(e[s],r)),Xi=Object.freeze,Un=(t)=>{for(let e in t){let r=t[e];if(typeof r==="object"||typeof r==="function")Un(t[e])}return Xi(t)};var Kt=(t,e,r=0)=>{try{for(;r<t.length;r++)t[r](...e)}finally{if(r<t.length)Kt(t,e,r+1)}};var Fr=(t)=>t;var rp=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[st]!=null)return t[st](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;break}case Set:{if(t.size!==e.size)return!1;for(let r of t)if(!e.has(r))return!1;break}case Map:{if(t.size!==e.size)return!1;for(let r of t.keys())if(!e.has(r)||!rp(t.get(r),e.get(r)))return!1;break}case void 0:case Object:if(Jt(t)!==Jt(e))return!1;for(let r in t)if(!Pt(t,r)||!rp(t[r],e[r]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!rp(t[r],e[r]))return!1;break;default:return!1}return!0},jr=(t,e)=>e.includes(t);var Wt=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";var sl=typeof navigator<"u"?/Mac/.test(navigator.platform):!1,z,Qi=[],Yi=()=>{if(z===void 0)if(Wt){z=A();let t=process.argv,e=null;for(let r=0;r<t.length;r++){let s=t[r];if(s[0]==="-"){if(e!==null)z.set(e,"");e=s}else if(e!==null)z.set(e,s),e=null;else Qi.push(s)}if(e!==null)z.set(e,"")}else if(typeof location==="object")z=A(),(location.search||"?").slice(1).split("&").forEach((t)=>{if(t.length!==0){let[e,r]=t.split("=");z.set(`--${pn(e,"-")}`,r),z.set(`-${pn(e,"-")}`,r)}});else z=A();return z},Cn=(t)=>Yi().has(t);var Zt=(t)=>Wt?Sn(process.env[t.toUpperCase().replaceAll("-","_")]):Sn(Rr.getItem(t));var qr=(t)=>Cn("--"+t)||Zt(t)!==null,Gr=qr("production"),to=Wt&&jr(process.env.FORCE_COLOR,["true","1","2"]),zr=to||!Cn("--no-colors")&&!qr("no-color")&&(!Wt||process.stdout.isTTY)&&(!Wt||Cn("--color")||Zt("COLORTERM")!==null||(Zt("TERM")||"").includes("color"));var eo=(t)=>new Uint8Array(t);var Hr=(t)=>{let e=eo(t.byteLength);return e.set(t),e};class Jr{constructor(t,e){this.left=t,this.right=e}}var H=(t,e)=>new Jr(t,e);var Bn=(t)=>t.next()>=0.5,Te=(t,e,r)=>rs(t.next()*(r+1-e)+e);var On=(t,e,r)=>rs(t.next()*(r+1-e)+e);var vn=(t,e,r)=>On(t,e,r);var so=(t)=>fn(vn(t,97,122)),Pr=(t,e=0,r=20)=>{let s=vn(t,e,r),i="";for(let o=0;o<s;o++)i+=so(t);return i};var Ae=(t,e)=>e[vn(t,0,e.length-1)];var oo=Symbol("0schema");class Wr{constructor(){this._rerrs=[]}extend(t,e,r,s=null){this._rerrs.push({path:t,expected:e,has:r,message:s})}toString(){let t=[];for(let e=this._rerrs.length-1;e>0;e--){let r=this._rerrs[e];t.push(br(" ",(this._rerrs.length-e)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return t.join(`
|
|
2
|
+
`)}}var Nn=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor)return!1;if(t[st])return Ue(t,e);if(Q(t))return me(t,(r)=>$t(e,(s)=>Nn(r,s)));else if(Lr(t))return kt(t,(r,s)=>Nn(r,e[s]));return!1};class B{static _dilutes=!1;extends(t){let[e,r]=[this.shape,t.shape];if(this.constructor._dilutes)[r,e]=[e,r];return Nn(e,r)}equals(t){return this.constructor===t.constructor&&rp(this.shape,t.shape)}[oo](){return!0}[st](t){return this.equals(t)}validate(t){return this.check(t)}check(t,e){L()}get nullable(){return Ut(this,Ve)}get optional(){return new Rn(this)}cast(t){return Kr(t,this),t}expect(t){return Kr(t,this),t}}class Be extends B{constructor(t,e){super();this.shape=t,this._c=e}check(t,e=void 0){let r=t?.constructor===this.shape&&(this._c==null||this._c(t));return!r&&e?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),r}}var _=(t,e=null)=>new Be(t,e),ol=_(Be);class Oe extends B{constructor(t){super();this.shape=t}check(t,e){let r=this.shape(t);return!r&&e?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),r}}var E=(t)=>new Oe(t),cl=_(Oe);class Qt extends B{constructor(t){super();this.shape=t}check(t,e){let r=this.shape.some((s)=>s===t);return!r&&e?.extend(null,this.shape.join(" | "),t.toString()),r}}var ve=(...t)=>new Qt(t),Zr=_(Qt),co=RegExp.escape||((t)=>t.replace(/[().|&,$^[\]]/g,(e)=>"\\"+e)),Xr=(t)=>{if(It.check(t))return[co(t)];if(Zr.check(t))return t.shape.map((e)=>e+"");if(cs.check(t))return["[+-]?\\d+.?\\d*"];if(ls.check(t))return[".*"];if(Ce.check(t))return t.shape.map(Xr).flat(1);v()};class Qr extends B{constructor(t){super();this.shape=t,this._r=new RegExp("^"+t.map(Xr).map((e)=>`(${e.join("|")})`).join("")+"$")}check(t,e){let r=this._r.exec(t)!=null;return!r&&e?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),r}}var ll=_(Qr),lo=Symbol("optional");class Rn extends B{constructor(t){super();this.shape=t}check(t,e){let r=t===void 0||this.shape.check(t);return!r&&e?.extend(null,"undefined (optional)","()"),r}get[lo](){return!0}}var ao=_(Rn);class Ln extends B{check(t,e){return e?.extend(null,"never",typeof t),!1}}var al=new Ln,hl=_(Ln);class Ne extends B{constructor(t,e=!1){super();this.shape=t,this._isPartial=e}static _dilutes=!0;get partial(){return new Ne(this.shape,!0)}check(t,e){if(t==null)return e?.extend(null,"object","null"),!1;return kt(this.shape,(r,s)=>{let i=this._isPartial&&!Pt(t,s)||r.check(t[s],e);return!i&&e?.extend(s.toString(),r.toString(),typeof t[s],"Object property does not match"),i})}}var ho=(t)=>new Ne(t),uo=_(Ne),fo=E((t)=>t!=null&&(t.constructor===Object||t.constructor==null));class Vn extends B{constructor(t,e){super();this.shape={keys:t,values:e}}check(t,e){return t!=null&&kt(t,(r,s)=>{let i=this.shape.keys.check(s,e);return!i&&e?.extend(s+"","Record",typeof t,i?"Key doesn't match schema":"Value doesn't match value"),i&&this.shape.values.check(r,e)})}}var Yr=(t,e)=>new Vn(t,e),po=_(Vn);class Mn extends B{constructor(t){super();this.shape=t}check(t,e){return t!=null&&kt(this.shape,(r,s)=>{let i=r.check(t[s],e);return!i&&e?.extend(s.toString(),"Tuple",typeof r),i})}}var go=(...t)=>new Mn(t),ul=_(Mn);class $n extends B{constructor(t){super();this.shape=t.length===1?t[0]:new Re(t)}check(t,e){let r=Q(t)&&me(t,(s)=>this.shape.check(s));return!r&&e?.extend(null,"Array",""),r}}var ts=(...t)=>new $n(t),mo=_($n),wo=E((t)=>Q(t));class Fn extends B{constructor(t,e){super();this.shape=t,this._c=e}check(t,e){let r=t instanceof this.shape&&(this._c==null||this._c(t));return!r&&e?.extend(null,this.shape.name,t?.constructor.name),r}}var xo=(t,e=null)=>new Fn(t,e),dl=_(Fn),yo=xo(B);class es extends B{constructor(t){super();this.len=t.length-1,this.args=go(...t.slice(-1)),this.res=t[this.len]}check(t,e){let r=t.constructor===Function&&t.length<=this.len;return!r&&e?.extend(null,"function",typeof t),r}}var bo=_(es),ko=E((t)=>typeof t==="function");class ns extends B{constructor(t){super();this.shape=t}check(t,e){let r=me(this.shape,(s)=>s.check(t,e));return!r&&e?.extend(null,"Intersectinon",typeof t),r}}var fl=_(ns,(t)=>t.shape.length>0);class Re extends B{static _dilutes=!0;constructor(t){super();this.shape=t}check(t,e){let r=$t(this.shape,(s)=>s.check(t,e));return e?.extend(null,"Union",typeof t),r}}var Ut=(...t)=>t.findIndex((e)=>Ce.check(e))>=0?Ut(...t.map((e)=>Xt(e)).map((e)=>Ce.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new Re(t),Ce=_(Re),is=()=>!0,De=E(is),_o=_(Oe,(t)=>t.shape===is),jn=E((t)=>typeof t==="bigint"),So=E((t)=>t===jn),os=E((t)=>typeof t==="symbol"),pl=E((t)=>t===os),Et=E((t)=>typeof t==="number"),cs=E((t)=>t===Et),It=E((t)=>typeof t==="string"),ls=E((t)=>t===It),Le=E((t)=>typeof t==="boolean"),Eo=E((t)=>t===Le),hs=ve(void 0),gl=_(Qt,(t)=>t.shape.length===1&&t.shape[0]===void 0),ml=ve(void 0);var Ve=ve(null),Io=_(Qt,(t)=>t.shape.length===1&&t.shape[0]===null),wl=_(Uint8Array),xl=_(Be,(t)=>t.shape===Uint8Array),Uo=Ut(Et,It,Ve,hs,jn,Le,os),yl=(()=>{let t=ts(De),e=Yr(It,De),r=Ut(Et,It,Ve,Le,t,e);return t.shape=r,e.shape.values=r,r})(),Xt=(t)=>{if(yo.check(t))return t;else if(fo.check(t)){let e={};for(let r in t)e[r]=Xt(t[r]);return ho(e)}else if(wo.check(t))return Ut(...t.map(Xt));else if(Uo.check(t))return ve(t);else if(ko.check(t))return _(t);v()},Kr=Gr?()=>{}:(t,e)=>{let r=new Wr;if(!e.check(t,r))throw R(`Expected value to be of type ${e.constructor.name}.
|
|
3
|
+
${r.toString()}`)};class us{constructor(t){this.patterns=[],this.$state=t}if(t,e){return this.patterns.push({if:Xt(t),h:e}),this}else(t){return this.if(De,t)}done(){return(t,e)=>{for(let r=0;r<this.patterns.length;r++){let s=this.patterns[r];if(s.if.check(t))return s.h(t,e)}throw R("Unhandled pattern")}}}var To=(t)=>new us(t),ds=To(De).if(cs,(t,e)=>Te(e,hn,ft)).if(ls,(t,e)=>Pr(e)).if(Eo,(t,e)=>Bn(e)).if(So,(t,e)=>BigInt(Te(e,hn,ft))).if(Ce,(t,e)=>St(e,Ae(e,t.shape))).if(uo,(t,e)=>{let r={};for(let s in t.shape){let i=t.shape[s];if(ao.check(i)){if(Bn(e))continue;i=i.shape}r[s]=ds(i,e)}return r}).if(mo,(t,e)=>{let r=[],s=On(e,0,42);for(let i=0;i<s;i++)r.push(St(e,t.shape));return r}).if(Zr,(t,e)=>Ae(e,t.shape)).if(Io,(t,e)=>null).if(bo,(t,e)=>{let r=St(e,t.res);return()=>r}).if(_o,(t,e)=>St(e,Ae(e,[Et,It,Ve,hs,jn,Le,ts(Et),Yr(Ut("a","b","c"),Et)]))).if(po,(t,e)=>{let r={},s=Te(e,0,3);for(let i=0;i<s;i++){let o=St(e,t.shape.keys),c=St(e,t.shape.values);r[o]=c}return r}).done(),St=(t,e)=>ds(Xt(e),t);var it=typeof document<"u"?document:{};var bl=E((t)=>t.nodeType===Oo);var kl=typeof DOMParser<"u"?new DOMParser:null;var _l=E((t)=>t.nodeType===Co);var Sl=E((t)=>t.nodeType===Do);var fs=(t)=>Ar(t,(e,r)=>`${r}:${e};`).join("");var{ELEMENT_NODE:Co,TEXT_NODE:Do,CDATA_SECTION_NODE:El,COMMENT_NODE:Il,DOCUMENT_NODE:Bo,DOCUMENT_TYPE_NODE:Ul,DOCUMENT_FRAGMENT_NODE:Oo}=it,Tl=E((t)=>t.nodeType===Bo);var J=Symbol;var Yt=J(),te=J(),qn=J(),Gn=J(),zn=J(),ee=J(),Hn=J(),Tt=J(),Jn=J(),ps=(t)=>{if(t.length===1&&t[0]?.constructor===Function)t=t[0]();let e=[],r=[],s=0;for(;s<t.length;s++){let i=t[s];if(i===void 0)break;else if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}if(s>0)r.push(e.join(""));for(;s<t.length;s++){let i=t[s];if(!(i instanceof Symbol))r.push(i)}return r};var Al=Cu();var Lo={[Yt]:H("font-weight","bold"),[te]:H("font-weight","normal"),[qn]:H("color","blue"),[zn]:H("color","green"),[Gn]:H("color","grey"),[ee]:H("color","red"),[Hn]:H("color","purple"),[Tt]:H("color","orange"),[Jn]:H("color","black")},Vo=(t)=>{if(t.length===1&&t[0]?.constructor===Function)t=t[0]();let e=[],r=[],s=A(),i=[],o=0;for(;o<t.length;o++){let c=t[o],l=Lo[c];if(l!==void 0)s.set(l.left,l.right);else{if(c===void 0)break;if(c.constructor===String||c.constructor===Number){let h=fs(s);if(o>0||h.length>0)e.push("%c"+c),r.push(h);else e.push(c)}else break}}if(o>0)i=r,i.unshift(e.join(""));for(;o<t.length;o++){let c=t[o];if(!(c instanceof Symbol))i.push(c)}return i},gs=zr?Vo:ps,ms=(...t)=>{console.log(...gs(t)),ws.forEach((e)=>e.print(t))},Pn=(...t)=>{console.warn(...gs(t)),t.unshift(Tt),ws.forEach((e)=>e.print(t))};var ws=G();var xs=(t)=>({[Symbol.iterator](){return this},next:t}),ys=(t,e)=>xs(()=>{let r;do r=t.next();while(!r.done&&!e(r.value));return r}),Me=(t,e)=>xs(()=>{let{done:r,value:s}=t.next();return{done:r,value:r?void 0:e(s)}});class oe{constructor(t,e){this.clock=t,this.len=e}}class ht{constructor(){this.clients=new Map}}var Bt=(t,e,r)=>e.clients.forEach((s,i)=>{let o=t.doc.store.clients.get(i);if(o!=null){let c=o[o.length-1],l=c.id.clock+c.length;for(let h=0,f=s[h];h<s.length&&f.clock<l;f=s[++h])Ps(t,o,f.clock,f.len,r)}}),Fo=(t,e)=>{let r=0,s=t.length-1;while(r<=s){let i=rs((r+s)/2),o=t[i],c=o.clock;if(c<=e){if(e<c+o.len)return i;r=i+1}else s=i-1}return null},ce=(t,e)=>{let r=t.clients.get(e.client);return r!==void 0&&Fo(r,e.clock)!==null},Yn=(t)=>{t.clients.forEach((e)=>{e.sort((i,o)=>i.clock-o.clock);let r,s;for(r=1,s=1;r<e.length;r++){let i=e[s-1],o=e[r];if(i.clock+i.len>=o.clock)e[s-1]=new oe(i.clock,Z(i.len,o.clock+o.len-i.clock));else{if(s<r)e[s]=o;s++}}e.length=s})},Wn=(t)=>{let e=new ht;for(let r=0;r<t.length;r++)t[r].clients.forEach((s,i)=>{if(!e.clients.has(i)){let o=s.slice();for(let c=r+1;c<t.length;c++)mr(o,t[c].clients.get(i)||[]);e.clients.set(i,o)}});return Yn(e),e},ne=(t,e,r,s)=>{q(t.clients,e,()=>[]).push(new oe(r,s))},Ns=()=>new ht,jo=(t)=>{let e=Ns();return t.clients.forEach((r,s)=>{let i=[];for(let o=0;o<r.length;o++){let c=r[o];if(c.deleted){let l=c.id.clock,h=c.length;if(o+1<r.length)for(let f=r[o+1];o+1<r.length&&f.deleted;f=r[++o+1])h+=f.length;i.push(new oe(l,h))}}if(i.length>0)e.clients.set(s,i)}),e},vt=(t,e)=>{_t(t.restEncoder,e.clients.size),j(e.clients.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{t.resetDsCurVal(),_t(t.restEncoder,r);let i=s.length;_t(t.restEncoder,i);for(let o=0;o<i;o++){let c=s[o];t.writeDsClock(c.clock),t.writeDsLen(c.len)}})},er=(t)=>{let e=new ht,r=Dt(t.restDecoder);for(let s=0;s<r;s++){t.resetDsCurVal();let i=Dt(t.restDecoder),o=Dt(t.restDecoder);if(o>0){let c=q(e.clients,i,()=>[]);for(let l=0;l<o;l++)c.push(new oe(t.readDsClock(),t.readDsLen()))}}return e},bs=(t,e,r)=>{let s=new ht,i=Dt(t.restDecoder);for(let o=0;o<i;o++){t.resetDsCurVal();let c=Dt(t.restDecoder),l=Dt(t.restDecoder),h=r.clients.get(c)||[],f=b(r,c);for(let a=0;a<l;a++){let u=t.readDsClock(),d=u+t.readDsLen();if(u<f){if(f<d)ne(s,c,f,d-f);let p=P(h,u),g=h[p];if(!g.deleted&&g.id.clock<u)h.splice(p+1,0,Ye(e,g,u-g.id.clock)),p++;while(p<h.length)if(g=h[p++],g.id.clock<d){if(!g.deleted){if(d<g.id.clock+g.length)h.splice(p,0,Ye(e,g,d-g.id.clock));g.delete(e)}}else break}else ne(s,c,u,d-u)}}if(s.clients.size>0){let o=new et;return _t(o.restEncoder,0),vt(o,s),o.toUint8Array()}return null};var Rs=kn;class Sd extends Ie{constructor({guid:t=Br(),collectionid:e=null,gc:r=!0,gcFilter:s=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:c=!0}={}){super();this.gc=r,this.gcFilter=s,this.clientID=Rs(),this.guid=t,this.collectionid=e,this.share=new Map,this.store=new cr,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=_n((h)=>{this.on("load",()=>{this.isLoaded=!0,h(this)})});let l=()=>_n((h)=>{let f=(a)=>{if(a===void 0||a===!0)this.off("sync",f),h()};this.on("sync",f)});this.on("sync",(h)=>{if(h===!1&&this.isSynced)this.whenSynced=l();if(this.isSynced=h===void 0||h===!0,this.isSynced&&!this.isLoaded)this.emit("load",[this])}),this.whenSynced=l()}load(){let t=this._item;if(t!==null&&!this.shouldLoad)x(t.parent.doc,(e)=>{e.subdocsLoaded.add(this)},null,!0);this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(j(this.subdocs).map((t)=>t.guid))}transact(t,e=null){return x(this,t,e)}get(t,e=I){let r=q(this.share,t,()=>{let i=new e;return i._integrate(this,null),i}),s=r.constructor;if(e!==I&&s!==e)if(s===I){let i=new e;i._map=r._map,r._map.forEach((o)=>{for(;o!==null;o=o.left)o.parent=i}),i._start=r._start;for(let o=i._start;o!==null;o=o.right)o.parent=i;return i._length=r._length,this.share.set(t,i),i._integrate(this,null),i}else throw Error(`Type with the name ${t} has already been defined with a different constructor`);return r}getArray(t=""){return this.get(t,va)}getText(t=""){return this.get(t,as)}getMap(t=""){return this.get(t,ss)}getXmlElement(t=""){return this.get(t,Ot)}getXmlFragment(t=""){return this.get(t,lt)}toJSON(){let t={};return this.share.forEach((e,r)=>{t[r]=e.toJSON()}),t}destroy(){this.isDestroyed=!0,j(this.subdocs).forEach((e)=>e.destroy());let t=this._item;if(t!==null){this._item=null;let e=t.content;e.doc=new Sd({guid:this.guid,...e.opts,shouldLoad:!1}),e.doc._item=t,x(t.parent.doc,(r)=>{let s=e.doc;if(!t.deleted)r.subdocsAdded.add(s);r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class nr{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return Dt(this.restDecoder)}readDsLen(){return Dt(this.restDecoder)}}class rr extends nr{readLeftID(){return m(Dt(this.restDecoder),Dt(this.restDecoder))}readRightID(){return m(Dt(this.restDecoder),Dt(this.restDecoder))}readClient(){return Dt(this.restDecoder)}readInfo(){return rt(this.restDecoder)}readString(){return Xa(this.restDecoder)}readParentInfo(){return Dt(this.restDecoder)===1}readTypeRef(){return Dt(this.restDecoder)}readLen(){return Dt(this.restDecoder)}readAny(){return yt(this.restDecoder)}readBuf(){return Hr(tr(this.restDecoder))}readJSON(){return JSON.parse(Xa(this.restDecoder))}readKey(){return Xa(this.restDecoder)}}class Ls{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Dt(this.restDecoder),this.dsCurrVal}readDsLen(){let t=Dt(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class ct extends Ls{constructor(t){super(t);this.keys=[],Dt(t),this.keyClockDecoder=new zt(tr(t)),this.clientDecoder=new bt(tr(t)),this.leftClockDecoder=new zt(tr(t)),this.rightClockDecoder=new zt(tr(t)),this.infoDecoder=new Se(tr(t),rt),this.stringDecoder=new bn(tr(t)),this.parentInfoDecoder=new Se(tr(t),rt),this.typeRefDecoder=new bt(tr(t)),this.lenDecoder=new bt(tr(t))}readLeftID(){return new ot(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new ot(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return yt(this.restDecoder)}readBuf(){return tr(this.restDecoder)}readJSON(){return yt(this.restDecoder)}readKey(){let t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];else{let e=this.stringDecoder.read();return this.keys.push(e),e}}}class sr{constructor(){this.restEncoder=Ja()}toUint8Array(){return wr(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){_t(this.restEncoder,t)}writeDsLen(t){_t(this.restEncoder,t)}}class Nt extends sr{writeLeftID(t){_t(this.restEncoder,t.client),_t(this.restEncoder,t.clock)}writeRightID(t){_t(this.restEncoder,t.client),_t(this.restEncoder,t.clock)}writeClient(t){_t(this.restEncoder,t)}writeInfo(t){xe(this.restEncoder,t)}writeString(t){Ya(this.restEncoder,t)}writeParentInfo(t){_t(this.restEncoder,t?1:0)}writeTypeRef(t){_t(this.restEncoder,t)}writeLen(t){_t(this.restEncoder,t)}writeAny(t){mt(this.restEncoder,t)}writeBuf(t){Wo(this.restEncoder,t)}writeJSON(t){Ya(this.restEncoder,JSON.stringify(t))}writeKey(t){Ya(this.restEncoder,t)}}class ir{constructor(){this.restEncoder=Ja(),this.dsCurrVal=0}toUint8Array(){return wr(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){let e=t-this.dsCurrVal;this.dsCurrVal=t,_t(this.restEncoder,e)}writeDsLen(t){if(t===0)v();_t(this.restEncoder,t-1),this.dsCurrVal+=t}}class et extends ir{constructor(){super();this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new qt,this.clientEncoder=new xt,this.leftClockEncoder=new qt,this.rightClockEncoder=new qt,this.infoEncoder=new be(xe),this.stringEncoder=new wn,this.parentInfoEncoder=new be(xe),this.typeRefEncoder=new xt,this.lenEncoder=new xt}toUint8Array(){let t=Ja();return _t(t,0),Wo(t,this.keyClockEncoder.toUint8Array()),Wo(t,this.clientEncoder.toUint8Array()),Wo(t,this.leftClockEncoder.toUint8Array()),Wo(t,this.rightClockEncoder.toUint8Array()),Wo(t,wr(this.infoEncoder)),Wo(t,this.stringEncoder.toUint8Array()),Wo(t,wr(this.parentInfoEncoder)),Wo(t,this.typeRefEncoder.toUint8Array()),Wo(t,this.lenEncoder.toUint8Array()),jt(t,wr(this.restEncoder)),wr(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){mt(this.restEncoder,t)}writeBuf(t){Wo(this.restEncoder,t)}writeJSON(t){mt(this.restEncoder,t)}writeKey(t){let e=this.keyMap.get(t);if(e===void 0)this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t);else this.keyClockEncoder.write(e)}}var qo=(t,e,r,s)=>{s=Z(s,e[0].id.clock);let i=P(e,s);_t(t.restEncoder,e.length-i),t.writeClient(r),_t(t.restEncoder,s);let o=e[i];o.write(t,s-o.id.clock);for(let c=i+1;c<e.length;c++)e[c].write(t,0)},or=(t,e,r)=>{let s=new Map;r.forEach((i,o)=>{if(b(e,o)>i)s.set(o,i)}),tn(e).forEach((i,o)=>{if(!r.has(o))s.set(o,0)}),_t(t.restEncoder,s.size),j(s.entries()).sort((i,o)=>o[0]-i[0]).forEach(([i,o])=>{qo(t,e.clients.get(i),i,o)})},Go=(t,e)=>{let r=A(),s=Dt(t.restDecoder);for(let i=0;i<s;i++){let o=Dt(t.restDecoder),c=Array(o),l=t.readClient(),h=Dt(t.restDecoder);r.set(l,{i:0,refs:c});for(let f=0;f<o;f++){let a=t.readInfo();switch(Vt&a){case 0:{let u=t.readLen();c[f]=new V(m(l,h),u),h+=u;break}case 10:{let u=Dt(t.restDecoder);c[f]=new M(m(l,h),u),h+=u;break}default:{let u=(a&(F|D))===0,d=new y(m(l,h),null,(a&D)===D?t.readLeftID():null,null,(a&F)===F?t.readRightID():null,u?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,u&&(a&dt)===dt?t.readString():null,wi(t,a));c[f]=d,h+=d.length}}}}return r},zo=(t,e,r)=>{let s=[],i=j(r.keys()).sort((p,g)=>p-g);if(i.length===0)return null;let o=()=>{if(i.length===0)return null;let p=r.get(i[i.length-1]);while(p.refs.length===p.i)if(i.pop(),i.length>0)p=r.get(i[i.length-1]);else return null;return p},c=o();if(c===null)return null;let l=new cr,h=new Map,f=(p,g)=>{let w=h.get(p);if(w==null||w>g)h.set(p,g)},a=c.refs[c.i++],u=new Map,d=()=>{for(let p of s){let g=p.id.client,w=r.get(g);if(w)w.i--,l.clients.set(g,w.refs.slice(w.i)),r.delete(g),w.i=0,w.refs=[];else l.clients.set(g,[p]);i=i.filter((C)=>C!==g)}s.length=0};while(!0){if(a.constructor!==M){let g=q(u,a.id.client,()=>b(e,a.id.client))-a.id.clock;if(g<0)s.push(a),f(a.id.client,a.id.clock-1),d();else{let w=a.getMissing(t,e);if(w!==null){s.push(a);let C=r.get(w)||{refs:[],i:0};if(C.refs.length===C.i)f(w,b(e,w)),d();else{a=C.refs[C.i++];continue}}else if(g===0||g<a.length)a.integrate(t,g),u.set(a.id.client,a.id.clock+a.length)}}if(s.length>0)a=s.pop();else if(c!==null&&c.i<c.refs.length)a=c.refs[c.i++];else if(c=o(),c===null)break;else a=c.refs[c.i++]}if(l.clients.size>0){let p=new et;return or(p,l,new Map),_t(p.restEncoder,0),{missing:h,update:p.toUint8Array()}}return null},Ho=(t,e)=>or(t,e.doc.store,e.beforeState),Jo=(t,e,r,s=new ct(t))=>x(e,(i)=>{i.local=!1;let o=!1,c=i.doc,l=c.store,h=Go(s,c),f=zo(i,l,h),a=l.pendingStructs;if(a){for(let[d,p]of a.missing)if(p<b(l,d)){o=!0;break}if(f){for(let[d,p]of f.missing){let g=a.missing.get(d);if(g==null||g>p)a.missing.set(d,p)}a.update=Je([a.update,f.update])}}else l.pendingStructs=f;let u=bs(s,i,l);if(l.pendingDs){let d=new ct(Za(l.pendingDs));Dt(d.restDecoder);let p=bs(d,i,l);if(u&&p)l.pendingDs=Je([u,p]);else l.pendingDs=u||p}else l.pendingDs=u;if(o){let d=l.pendingStructs.update;l.pendingStructs=null,Vs(i.doc,d)}},r,!1);var Vs=(t,e,r,s=ct)=>{let i=Za(e);Jo(i,t,r,new s(i))},YI=(t,e,r)=>Vs(t,e,r,rr),Po=(t,e,r=new Map)=>{or(t,e.store,r),vt(t,jo(e.store))},Ko=(t,e=new Uint8Array([0]),r=new et)=>{let s=Ms(e);Po(r,t,s);let i=[r.toUint8Array()];if(t.store.pendingDs)i.push(t.store.pendingDs);if(t.store.pendingStructs)i.push(ac(t.store.pendingStructs.update,e));if(i.length>1){if(r.constructor===Nt)return cc(i.map((o,c)=>c===0?o:uc(o)));else if(r.constructor===et)return Je(i)}return i[0]},ZI=(t,e)=>Ko(t,e,new Nt),Zo=(t)=>{let e=new Map,r=Dt(t.restDecoder);for(let s=0;s<r;s++){let i=Dt(t.restDecoder),o=Dt(t.restDecoder);e.set(i,o)}return e},Ms=(t)=>Zo(new nr(Za(t))),$s=(t,e)=>(_t(t.restEncoder,e.size),j(e.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{_t(t.restEncoder,r),_t(t.restEncoder,s)}),t),Xo=(t,e)=>$s(t,tn(e.store)),Qo=(t,e=new ir)=>{if(t instanceof Map)$s(e,t);else Xo(e,t);return e.toUint8Array()},XI=(t)=>Qo(t,new sr);class Fs{constructor(){this.l=[]}}var ks=()=>new Fs,_s=(t,e)=>t.l.push(e),Ss=(t,e)=>{let r=t.l,s=r.length;if(t.l=r.filter((i)=>e!==i),s===t.l.length)console.error("[yjs] Tried to remove event handler that doesn't exist.")},js=(t,e,r)=>Kt(t.l,[e,r]);class ot{constructor(t,e){this.client=t,this.clock=e}}var $e=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,m=(t,e)=>new ot(t,e);var qs=(t)=>{for(let[e,r]of t.doc.share.entries())if(r===t)return e;throw v()},He=(t,e)=>{while(e!==null){if(e.parent===t)return!0;e=e.parent._item}return!1};class Gs{constructor(t,e,r,s=0){this.type=t,this.tname=e,this.item=r,this.assoc=s}}class zs{constructor(t,e,r=0){this.type=t,this.index=e,this.assoc=r}}var Yo=(t,e,r=0)=>new zs(t,e,r),Fe=(t,e,r)=>{let s=null,i=null;if(t._item===null)i=qs(t);else s=m(t._item.id.client,t._item.id.clock);return new Gs(s,i,e,r)},Q0=(t,e,r=0)=>{let s=t._start;if(r<0){if(e===0)return Fe(t,null,r);e--}while(s!==null){if(!s.deleted&&s.countable){if(s.length>e)return Fe(t,m(s.id.client,s.id.clock+e),r);e-=s.length}if(s.right===null&&r<0)return Fe(t,s.lastId,r);s=s.right}return Fe(t,null,r)};var tc=(t,e)=>{let r=Ct(t,e),s=e.clock-r.id.clock;return{item:r,diff:s}},Ng=(t,e,r=!0)=>{let s=e.store,{item:i,type:o,tname:c,assoc:l}=t,h=null,f=0;if(i!==null){if(b(s,i.client)<=i.clock)return null;let a=r?Qn(s,i):tc(s,i),u=a.item;if(!(u instanceof y))return null;if(h=u.parent,h._item===null||!h._item.deleted){f=u.deleted||!u.countable?0:a.diff+(l>=0?0:1);let d=u.left;while(d!==null){if(!d.deleted&&d.countable)f+=d.length;d=d.left}}}else{if(c!==null)h=e.get(c);else if(o!==null){if(b(s,o.client)<=o.clock)return null;let{item:a}=r?Qn(s,o):{item:Ct(s,o)};if(a instanceof y&&a.content instanceof W)h=a.content.type;else return null}else throw v();if(l>=0)f=h._length;else f=0}return Yo(h,f,t.assoc)};class Hs{constructor(t,e){this.ds=t,this.sv=e}}var ec=(t,e)=>new Hs(t,e),$l=ec(Ns(),new Map);var At=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!ce(e.ds,t.id),Zn=(t,e)=>{let r=q(t.meta,Zn,G),s=t.doc.store;if(!r.has(e))e.sv.forEach((i,o)=>{if(i<b(s,o))N(t,m(o,i))}),Bt(t,e.ds,(i)=>{}),r.add(e)};class cr{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}var tn=(t)=>{let e=new Map;return t.clients.forEach((r,s)=>{let i=r[r.length-1];e.set(s,i.id.clock+i.length)}),e},b=(t,e)=>{let r=t.clients.get(e);if(r===void 0)return 0;let s=r[r.length-1];return s.id.clock+s.length},Js=(t,e)=>{let r=t.clients.get(e.id.client);if(r===void 0)r=[],t.clients.set(e.id.client,r);else{let s=r[r.length-1];if(s.id.clock+s.length!==e.id.clock)throw v()}r.push(e)},P=(t,e)=>{let r=0,s=t.length-1,i=t[s],o=i.id.clock;if(o===e)return s;let c=rs(e/(o+i.length-1)*s);while(r<=s){if(i=t[c],o=i.id.clock,o<=e){if(e<o+i.length)return c;r=c+1}else s=c-1;c=rs((r+s)/2)}throw v()},nc=(t,e)=>{let r=t.clients.get(e.client);return r[P(r,e.clock)]},Ct=nc,Xn=(t,e,r)=>{let s=P(e,r),i=e[s];if(i.id.clock<r&&i instanceof y)return e.splice(s+1,0,Ye(t,i,r-i.id.clock)),s+1;return s},N=(t,e)=>{let r=t.doc.store.clients.get(e.client);return r[Xn(t,r,e.clock)]},Es=(t,e,r)=>{let s=e.clients.get(r.client),i=P(s,r.clock),o=s[i];if(r.clock!==o.id.clock+o.length-1&&o.constructor!==V)s.splice(i+1,0,Ye(t,o,r.clock-o.id.clock+1));return o},rc=(t,e,r)=>{let s=t.clients.get(e.id.client);s[P(s,e.id.clock)]=r},Ps=(t,e,r,s,i)=>{if(s===0)return;let o=r+s,c=Xn(t,e,r),l;do{if(l=e[c++],o<l.id.clock+l.length)Xn(t,e,o);i(l)}while(c<e.length&&e[c].id.clock<o)};class Ks{constructor(t,e,r){this.doc=t,this.deleteSet=new ht,this.beforeState=tn(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=e,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}var Is=(t,e)=>{if(e.deleteSet.clients.size===0&&!Cr(e.afterState,(r,s)=>e.beforeState.get(s)!==r))return!1;return Yn(e.deleteSet),Ho(t,e),vt(t,e.deleteSet),!0},Us=(t,e,r)=>{let s=e._item;if(s===null||s.id.clock<(t.beforeState.get(s.id.client)||0)&&!s.deleted)q(t.changed,e,G).add(r)},Ge=(t,e)=>{let r=t[e],s=t[e-1],i=e;for(;i>0;r=s,s=t[--i-1]){if(s.deleted===r.deleted&&s.constructor===r.constructor){if(s.mergeWith(r)){if(r instanceof y&&r.parentSub!==null&&r.parent._map.get(r.parentSub)===r)r.parent._map.set(r.parentSub,s);continue}}break}let o=e-i;if(o)t.splice(e+1-o,o);return o},sc=(t,e,r)=>{for(let[s,i]of t.clients.entries()){let o=e.clients.get(s);for(let c=i.length-1;c>=0;c--){let l=i[c],h=l.clock+l.len;for(let f=P(o,l.clock),a=o[f];f<o.length&&a.id.clock<h;a=o[++f]){let u=o[f];if(l.clock+l.len<=u.id.clock)break;if(u instanceof y&&u.deleted&&!u.keep&&r(u))u.gc(e,!1)}}}},ic=(t,e)=>{t.clients.forEach((r,s)=>{let i=e.clients.get(s);for(let o=r.length-1;o>=0;o--){let c=r[o],l=ue(i.length-1,1+P(i,c.clock+c.len-1));for(let h=l,f=i[h];h>0&&f.id.clock>=c.clock;f=i[h])h-=1+Ge(i,h)}})};var Ws=(t,e)=>{if(e<t.length){let r=t[e],s=r.doc,i=s.store,{deleteSet:o,_mergeStructs:c}=r;try{Yn(o),r.afterState=tn(r.doc.store),s.emit("beforeObserverCalls",[r,s]);let l=[];r.changed.forEach((h,f)=>l.push(()=>{if(f._item===null||!f._item.deleted)f._callObserver(r,h)})),l.push(()=>{r.changedParentTypes.forEach((h,f)=>{if(f._dEH.l.length>0&&(f._item===null||!f._item.deleted))l.push(()=>{h=h.filter((a)=>a.target._item===null||!a.target._item.deleted),h.forEach((a)=>{a.currentTarget=f,a._path=null}),h.sort((a,u)=>a.path.length-u.path.length),js(f._dEH,h,r)})}),l.push(()=>s.emit("afterTransaction",[r,s])),l.push(()=>{if(r._needFormattingCleanup)_c(r)})}),Kt(l,[])}finally{if(s.gc)sc(o,i,s.gcFilter);ic(o,i),r.afterState.forEach((a,u)=>{let d=r.beforeState.get(u)||0;if(d!==a){let p=i.clients.get(u),g=Z(P(p,d),1);for(let w=p.length-1;w>=g;)w-=1+Ge(p,w)}});for(let a=c.length-1;a>=0;a--){let{client:u,clock:d}=c[a].id,p=i.clients.get(u),g=P(p,d);if(g+1<p.length){if(Ge(p,g+1)>1)continue}if(g>0)Ge(p,g)}if(!r.local&&r.afterState.get(s.clientID)!==r.beforeState.get(s.clientID))ms(Tt,Yt,"[yjs] ",te,ee,"Changed the client-id because another client seems to be using it."),s.clientID=Rs();if(s.emit("afterTransactionCleanup",[r,s]),s._observers.has("update")){let a=new Nt;if(Is(a,r))s.emit("update",[a.toUint8Array(),r.origin,s,r])}if(s._observers.has("updateV2")){let a=new et;if(Is(a,r))s.emit("updateV2",[a.toUint8Array(),r.origin,s,r])}let{subdocsAdded:l,subdocsLoaded:h,subdocsRemoved:f}=r;if(l.size>0||f.size>0||h.size>0)l.forEach((a)=>{if(a.clientID=s.clientID,a.collectionid==null)a.collectionid=s.collectionid;s.subdocs.add(a)}),f.forEach((a)=>s.subdocs.delete(a)),s.emit("subdocs",[{loaded:h,added:l,removed:f},s,r]),f.forEach((a)=>a.destroy());if(t.length<=e+1)s._transactionCleanups=[],s.emit("afterAllTransactions",[s,t]);else Ws(t,e+1)}}},x=(t,e,r=null,s=!0)=>{let i=t._transactionCleanups,o=!1,c=null;if(t._transaction===null){if(o=!0,t._transaction=new Ks(t,r,s),i.push(t._transaction),i.length===1)t.emit("beforeAllTransactions",[t]);t.emit("beforeTransaction",[t._transaction,t])}try{c=e(t._transaction)}finally{if(o){let l=t._transaction===i[0];if(t._transaction=null,l)Ws(i,0)}}return c};class Zs{constructor(t,e){this.insertions=e,this.deletions=t,this.meta=new Map}}var Ts=(t,e,r)=>{Bt(t,r.deletions,(s)=>{if(s instanceof y&&e.scope.some((i)=>i===t.doc||He(i,s)))dr(s,!1)})},As=(t,e,r)=>{let s=null,{doc:i,scope:o}=t;x(i,(l)=>{while(e.length>0&&t.currStackItem===null){let h=i.store,f=e.pop(),a=new Set,u=[],d=!1;Bt(l,f.insertions,(p)=>{if(p instanceof y){if(p.redone!==null){let{item:g,diff:w}=Qn(h,p.id);if(w>0)g=N(l,m(g.id.client,g.id.clock+w));p=g}if(!p.deleted&&o.some((g)=>g===l.doc||He(g,p)))u.push(p)}}),Bt(l,f.deletions,(p)=>{if(p instanceof y&&o.some((g)=>g===l.doc||He(g,p))&&!ce(f.insertions,p.id))a.add(p)}),a.forEach((p)=>{d=mi(l,p,a,f.insertions,t.ignoreRemoteMapChanges,t)!==null||d});for(let p=u.length-1;p>=0;p--){let g=u[p];if(t.deleteFilter(g))g.delete(l),d=!0}t.currStackItem=d?f:null}l.changed.forEach((h,f)=>{if(h.has(null)&&f._searchMarker)f._searchMarker.length=0}),s=l},t);let c=t.currStackItem;if(c!=null){let l=s.changedParentTypes;t.emit("stack-item-popped",[{stackItem:c,type:r,changedParentTypes:l,origin:t},t]),t.currStackItem=null}return c};class x2 extends Ie{constructor(t,{captureTimeout:e=500,captureTransaction:r=(l)=>!0,deleteFilter:s=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:c=Q(t)?t[0].doc:t instanceof Sd?t:t.doc}={}){super();this.scope=[],this.doc=c,this.addToScope(t),this.deleteFilter=s,i.add(this),this.trackedOrigins=i,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=e,this.afterTransactionHandler=(l)=>{if(!this.captureTransaction(l)||!this.scope.some((w)=>l.changedParentTypes.has(w)||w===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;let h=this.undoing,f=this.redoing,a=h?this.redoStack:this.undoStack;if(h)this.stopCapturing();else if(!f)this.clear(!1,!0);let u=new ht;l.afterState.forEach((w,C)=>{let k=l.beforeState.get(C)||0,fr=w-k;if(fr>0)ne(u,C,k,fr)});let d=Cu(),p=!1;if(this.lastChange>0&&d-this.lastChange<this.captureTimeout&&a.length>0&&!h&&!f){let w=a[a.length-1];w.deletions=Wn([w.deletions,l.deleteSet]),w.insertions=Wn([w.insertions,u])}else a.push(new Zs(l.deleteSet,u)),p=!0;if(!h&&!f)this.lastChange=d;Bt(l,l.deleteSet,(w)=>{if(w instanceof y&&this.scope.some((C)=>C===l.doc||He(C,w)))dr(w,!0)});let g=[{stackItem:a[a.length-1],origin:l.origin,type:h?"redo":"undo",changedParentTypes:l.changedParentTypes},this];if(p)this.emit("stack-item-added",g);else this.emit("stack-item-updated",g)},this.destroy=this.destroy.bind(this),this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",this.destroy)}addToScope(t){let e=new Set(this.scope);t=Q(t)?t:[t],t.forEach((r)=>{if(!e.has(r)){if(e.add(r),r instanceof I?r.doc!==this.doc:r!==this.doc)Pn("[yjs#509] Not same Y.Doc");this.scope.push(r)}})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,e=!0){if(t&&this.canUndo()||e&&this.canRedo())this.doc.transact((r)=>{if(t)this.undoStack.forEach((s)=>Ts(r,this,s)),this.undoStack=[];if(e)this.redoStack.forEach((s)=>Ts(r,this,s)),this.redoStack=[];this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:e}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=As(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=As(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),this.doc.off("destroy",this.destroy),super.destroy()}}function*oc(t){let e=Dt(t.restDecoder);for(let r=0;r<e;r++){let s=Dt(t.restDecoder),i=t.readClient(),o=Dt(t.restDecoder);for(let c=0;c<s;c++){let l=t.readInfo();if(l===10){let h=Dt(t.restDecoder);yield new M(m(i,o),h),o+=h}else if((Vt&l)!==0){let h=(l&(F|D))===0,f=new y(m(i,o),null,(l&D)===D?t.readLeftID():null,null,(l&F)===F?t.readRightID():null,h?t.readParentInfo()?t.readString():t.readLeftID():null,h&&(l&dt)===dt?t.readString():null,wi(t,l));yield f,o+=f.length}else{let h=t.readLen();yield new V(m(i,o),h),o+=h}}}}class en{constructor(t,e){this.gen=oc(t),this.curr=null,this.done=!1,this.filterSkips=e,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===M);return this.curr}}class nn{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}}var cc=(t)=>Je(t,rr,Nt);var lc=(t,e)=>{if(t.constructor===V){let{client:r,clock:s}=t.id;return new V(m(r,s+e),t.length-e)}else if(t.constructor===M){let{client:r,clock:s}=t.id;return new M(m(r,s+e),t.length-e)}else{let r=t,{client:s,clock:i}=r.id;return new y(m(s,i+e),null,m(s,i+e-1),null,r.rightOrigin,r.parent,r.parentSub,r.content.splice(e))}},Je=(t,e=ct,r=et)=>{if(t.length===1)return t[0];let s=t.map((a)=>new e(Za(a))),i=s.map((a)=>new en(a,!0)),o=null,c=new r,l=new nn(c);while(!0){if(i=i.filter((d)=>d.curr!==null),i.sort((d,p)=>{if(d.curr.id.client===p.curr.id.client){let g=d.curr.id.clock-p.curr.id.clock;if(g===0)return d.curr.constructor===p.curr.constructor?0:d.curr.constructor===M?1:-1;else return g}else return p.curr.id.client-d.curr.id.client}),i.length===0)break;let a=i[0],u=a.curr.id.client;if(o!==null){let d=a.curr,p=!1;while(d!==null&&d.id.clock+d.length<=o.struct.id.clock+o.struct.length&&d.id.client>=o.struct.id.client)d=a.next(),p=!0;if(d===null||d.id.client!==u||p&&d.id.clock>o.struct.id.clock+o.struct.length)continue;if(u!==o.struct.id.client)Y(l,o.struct,o.offset),o={struct:d,offset:0},a.next();else if(o.struct.id.clock+o.struct.length<d.id.clock)if(o.struct.constructor===M)o.struct.length=d.id.clock+d.length-o.struct.id.clock;else{Y(l,o.struct,o.offset);let g=d.id.clock-o.struct.id.clock-o.struct.length;o={struct:new M(m(u,o.struct.id.clock+o.struct.length),g),offset:0}}else{let g=o.struct.id.clock+o.struct.length-d.id.clock;if(g>0)if(o.struct.constructor===M)o.struct.length-=g;else d=lc(d,g);if(!o.struct.mergeWith(d))Y(l,o.struct,o.offset),o={struct:d,offset:0},a.next()}}else o={struct:a.curr,offset:0},a.next();for(let d=a.curr;d!==null&&d.id.client===u&&d.id.clock===o.struct.id.clock+o.struct.length&&d.constructor!==M;d=a.next())Y(l,o.struct,o.offset),o={struct:d,offset:0}}if(o!==null)Y(l,o.struct,o.offset),o=null;lr(l);let h=s.map((a)=>er(a)),f=Wn(h);return vt(c,f),c.toUint8Array()},ac=(t,e,r=ct,s=et)=>{let i=Ms(e),o=new s,c=new nn(o),l=new r(Za(t)),h=new en(l,!1);while(h.curr){let a=h.curr,u=a.id.client,d=i.get(u)||0;if(h.curr.constructor===M){h.next();continue}if(a.id.clock+a.length>d){Y(c,a,Z(d-a.id.clock,0)),h.next();while(h.curr&&h.curr.id.client===u)Y(c,h.curr,0),h.next()}else while(h.curr&&h.curr.id.client===u&&h.curr.id.clock+h.curr.length<=d)h.next()}lr(c);let f=er(l);return vt(o,f),o.toUint8Array()};var Xs=(t)=>{if(t.written>0)t.clientStructs.push({written:t.written,restEncoder:wr(t.encoder.restEncoder)}),t.encoder.restEncoder=Ja(),t.written=0},Y=(t,e,r)=>{if(t.written>0&&t.currClient!==e.id.client)Xs(t);if(t.written===0)t.currClient=e.id.client,t.encoder.writeClient(e.id.client),_t(t.encoder.restEncoder,e.id.clock+r);e.write(t.encoder,r),t.written++},lr=(t)=>{Xs(t);let e=t.encoder.restEncoder;_t(e,t.clientStructs.length);for(let r=0;r<t.clientStructs.length;r++){let s=t.clientStructs[r];_t(e,s.written),jt(e,s.restEncoder)}},hc=(t,e,r,s)=>{let i=new r(Za(t)),o=new en(i,!1),c=new s,l=new nn(c);for(let f=o.curr;f!==null;f=o.next())Y(l,e(f),0);lr(l);let h=er(i);return vt(c,h),c.toUint8Array()};var uc=(t)=>hc(t,Fr,ct,Nt),Cs="You must not compute changes after the event-handler fired.";class le{constructor(t,e){this.target=t,this.currentTarget=t,this.transaction=e,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=dc(this.currentTarget,this.target))}deletes(t){return ce(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw R(Cs);let t=new Map,e=this.target;this.transaction.changed.get(e).forEach((s)=>{if(s!==null){let i=e._map.get(s),o,c;if(this.adds(i)){let l=i.left;while(l!==null&&this.adds(l))l=l.left;if(this.deletes(i))if(l!==null&&this.deletes(l))o="delete",c=ge(l.content.getContent());else return;else if(l!==null&&this.deletes(l))o="update",c=ge(l.content.getContent());else o="add",c=void 0}else if(this.deletes(i))o="delete",c=ge(i.content.getContent());else return;t.set(s,{action:o,oldValue:c})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw R(Cs);let e=this.target,r=G(),s=G(),i=[];if(t={added:r,deleted:s,delta:i,keys:this.keys},this.transaction.changed.get(e).has(null)){let c=null,l=()=>{if(c)i.push(c)};for(let h=e._start;h!==null;h=h.right)if(h.deleted){if(this.deletes(h)&&!this.adds(h)){if(c===null||c.delete===void 0)l(),c={delete:0};c.delete+=h.length,s.add(h)}}else if(this.adds(h)){if(c===null||c.insert===void 0)l(),c={insert:[]};c.insert=c.insert.concat(h.content.getContent()),r.add(h)}else{if(c===null||c.retain===void 0)l(),c={retain:0};c.retain+=h.length}if(c!==null&&c.retain===void 0)l()}this._changes=t}return t}}var dc=(t,e)=>{let r=[];while(e._item!==null&&e!==t){if(e._item.parentSub!==null)r.unshift(e._item.parentSub);else{let s=0,i=e._item.parent._start;while(i!==e._item&&i!==null){if(!i.deleted&&i.countable)s+=i.length;i=i.right}r.unshift(s)}e=e._item.parent}return r},O=()=>{Pn("Invalid access: Add Yjs type to a document before reading data.")},Qs=80,ar=0;class Ys{constructor(t,e){t.marker=!0,this.p=t,this.index=e,this.timestamp=ar++}}var fc=(t)=>{t.timestamp=ar++},ti=(t,e,r)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=r,t.timestamp=ar++},pc=(t,e,r)=>{if(t.length>=Qs){let s=t.reduce((i,o)=>i.timestamp<o.timestamp?i:o);return ti(s,e,r),s}else{let s=new Ys(e,r);return t.push(s),s}},rn=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;let r=t._searchMarker.length===0?null:t._searchMarker.reduce((o,c)=>nt(e-o.index)<nt(e-c.index)?o:c),s=t._start,i=0;if(r!==null)s=r.p,i=r.index,fc(r);while(s.right!==null&&i<e){if(!s.deleted&&s.countable){if(e<i+s.length)break;i+=s.length}s=s.right}while(s.left!==null&&i>e)if(s=s.left,!s.deleted&&s.countable)i-=s.length;while(s.left!==null&&s.left.id.client===s.id.client&&s.left.id.clock+s.left.length===s.id.clock)if(s=s.left,!s.deleted&&s.countable)i-=s.length;if(r!==null&&nt(r.index-i)<s.parent.length/Qs)return ti(r,s,i),r;else return pc(t._searchMarker,s,i)},re=(t,e,r)=>{for(let s=t.length-1;s>=0;s--){let i=t[s];if(r>0){let o=i.p;o.marker=!1;while(o&&(o.deleted||!o.countable))if(o=o.left,o&&!o.deleted&&o.countable)i.index-=o.length;if(o===null||o.marker===!0){t.splice(s,1);continue}i.p=o,o.marker=!0}if(e<i.index||r>0&&e===i.index)i.index=Z(e,i.index+r)}};var sn=(t,e,r)=>{let s=t,i=e.changedParentTypes;while(!0){if(q(i,t,()=>[]).push(r),t._item===null)break;t=t._item.parent}js(s._eH,r,e)};class I{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=ks(),this._dEH=ks(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,e){this.doc=t,this._item=e}_copy(){throw L()}clone(){throw L()}_write(t){}get _first(){let t=this._start;while(t!==null&&t.deleted)t=t.right;return t}_callObserver(t,e){if(!t.local&&this._searchMarker)this._searchMarker.length=0}observe(t){_s(this._eH,t)}observeDeep(t){_s(this._dEH,t)}unobserve(t){Ss(this._eH,t)}unobserveDeep(t){Ss(this._dEH,t)}toJSON(){}}var ei=(t,e,r)=>{if(t.doc??O(),e<0)e=t._length+e;if(r<0)r=t._length+r;let s=r-e,i=[],o=t._start;while(o!==null&&s>0){if(o.countable&&!o.deleted){let c=o.content.getContent();if(c.length<=e)e-=c.length;else{for(let l=e;l<c.length&&s>0;l++)i.push(c[l]),s--;e=0}}o=o.right}return i},ni=(t)=>{t.doc??O();let e=[],r=t._start;while(r!==null){if(r.countable&&!r.deleted){let s=r.content.getContent();for(let i=0;i<s.length;i++)e.push(s[i])}r=r.right}return e};var se=(t,e)=>{let r=0,s=t._start;t.doc??O();while(s!==null){if(s.countable&&!s.deleted){let i=s.content.getContent();for(let o=0;o<i.length;o++)e(i[o],r++,t)}s=s.right}},ri=(t,e)=>{let r=[];return se(t,(s,i)=>{r.push(e(s,i,t))}),r},gc=(t)=>{let e=t._start,r=null,s=0;return{[Symbol.iterator](){return this},next:()=>{if(r===null){while(e!==null&&e.deleted)e=e.right;if(e===null)return{done:!0,value:void 0};r=e.content.getContent(),s=0,e=e.right}let i=r[s++];if(r.length<=s)r=null;return{done:!1,value:i}}}},si=(t,e)=>{t.doc??O();let r=rn(t,e),s=t._start;if(r!==null)s=r.p,e-=r.index;for(;s!==null;s=s.right)if(!s.deleted&&s.countable){if(e<s.length)return s.content.getContent()[e];e-=s.length}},Pe=(t,e,r,s)=>{let i=r,o=t.doc,{clientID:c,store:l}=o,h=r===null?e._start:r.right,f=[],a=()=>{if(f.length>0)i=new y(m(c,b(l,c)),i,i&&i.lastId,h,h&&h.id,e,null,new at(f)),i.integrate(t,0),f=[]};s.forEach((u)=>{if(u===null)f.push(u);else switch(u.constructor){case Number:case Object:case Boolean:case Array:case String:f.push(u);break;default:switch(a(),u.constructor){case Uint8Array:case ArrayBuffer:i=new y(m(c,b(l,c)),i,i&&i.lastId,h,h&&h.id,e,null,new ae(new Uint8Array(u))),i.integrate(t,0);break;case Sd:i=new y(m(c,b(l,c)),i,i&&i.lastId,h,h&&h.id,e,null,new he(u)),i.integrate(t,0);break;default:if(u instanceof I)i=new y(m(c,b(l,c)),i,i&&i.lastId,h,h&&h.id,e,null,new W(u)),i.integrate(t,0);else throw Error("Unexpected content type in insert operation")}}}),a()},ii=()=>R("Length exceeded!"),oi=(t,e,r,s)=>{if(r>e._length)throw ii();if(r===0){if(e._searchMarker)re(e._searchMarker,r,s.length);return Pe(t,e,null,s)}let i=r,o=rn(e,r),c=e._start;if(o!==null){if(c=o.p,r-=o.index,r===0)c=c.prev,r+=c&&c.countable&&!c.deleted?c.length:0}for(;c!==null;c=c.right)if(!c.deleted&&c.countable){if(r<=c.length){if(r<c.length)N(t,m(c.id.client,c.id.clock+r));break}r-=c.length}if(e._searchMarker)re(e._searchMarker,i,s.length);return Pe(t,e,c,s)},mc=(t,e,r)=>{let i=(e._searchMarker||[]).reduce((o,c)=>c.index>o.index?c:o,{index:0,p:e._start}).p;if(i)while(i.right)i=i.right;return Pe(t,e,i,r)},ci=(t,e,r,s)=>{if(s===0)return;let i=r,o=s,c=rn(e,r),l=e._start;if(c!==null)l=c.p,r-=c.index;for(;l!==null&&r>0;l=l.right)if(!l.deleted&&l.countable){if(r<l.length)N(t,m(l.id.client,l.id.clock+r));r-=l.length}while(s>0&&l!==null){if(!l.deleted){if(s<l.length)N(t,m(l.id.client,l.id.clock+s));l.delete(t),s-=l.length}l=l.right}if(s>0)throw ii();if(e._searchMarker)re(e._searchMarker,i,-o+s)},Ke=(t,e,r)=>{let s=e._map.get(r);if(s!==void 0)s.delete(t)},hr=(t,e,r,s)=>{let i=e._map.get(r)||null,o=t.doc,c=o.clientID,l;if(s==null)l=new at([s]);else switch(s.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new at([s]);break;case Uint8Array:l=new ae(s);break;case Sd:l=new he(s);break;default:if(s instanceof I)l=new W(s);else throw Error("Unexpected content type")}new y(m(c,b(o.store,c)),i,i&&i.lastId,null,null,e,r,l).integrate(t,0)},ur=(t,e)=>{t.doc??O();let r=t._map.get(e);return r!==void 0&&!r.deleted?r.content.getContent()[r.length-1]:void 0},li=(t)=>{let e={};return t.doc??O(),t._map.forEach((r,s)=>{if(!r.deleted)e[s]=r.content.getContent()[r.length-1]}),e},ai=(t,e)=>{t.doc??O();let r=t._map.get(e);return r!==void 0&&!r.deleted};var wc=(t,e)=>{let r={};return t._map.forEach((s,i)=>{let o=s;while(o!==null&&(!e.sv.has(o.id.client)||o.id.clock>=(e.sv.get(o.id.client)||0)))o=o.left;if(o!==null&&At(o,e))r[i]=o.content.getContent()[o.length-1]}),r},je=(t)=>(t.doc??O(),ys(t._map.entries(),(e)=>!e[1].deleted));class Sy extends le{}class va extends I{constructor(){super();this._prelimContent=[],this._searchMarker=[]}static from(t){let e=new va;return e.push(t),e}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new va}clone(){let t=new va;return t.insert(0,this.toArray().map((e)=>e instanceof I?e.clone():e)),t}get length(){return this.doc??O(),this._length}_callObserver(t,e){super._callObserver(t,e),sn(this,t,new Sy(this,t))}insert(t,e){if(this.doc!==null)x(this.doc,(r)=>{oi(r,this,t,e)});else this._prelimContent.splice(t,0,...e)}push(t){if(this.doc!==null)x(this.doc,(e)=>{mc(e,this,t)});else this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,e=1){if(this.doc!==null)x(this.doc,(r)=>{ci(r,this,t,e)});else this._prelimContent.splice(t,e)}get(t){return si(this,t)}toArray(){return ni(this)}slice(t=0,e=this.length){return ei(this,t,e)}toJSON(){return this.map((t)=>t instanceof I?t.toJSON():t)}map(t){return ri(this,t)}forEach(t){se(this,t)}[Symbol.iterator](){return gc(this)}_write(t){t.writeTypeRef($c)}}var xc=(t)=>new va;class e_ extends le{constructor(t,e,r){super(t,e);this.keysChanged=r}}class ss extends I{constructor(t){super();if(this._prelimContent=null,t===void 0)this._prelimContent=new Map;else this._prelimContent=new Map(t)}_integrate(t,e){super._integrate(t,e),this._prelimContent.forEach((r,s)=>{this.set(s,r)}),this._prelimContent=null}_copy(){return new ss}clone(){let t=new ss;return this.forEach((e,r)=>{t.set(r,e instanceof I?e.clone():e)}),t}_callObserver(t,e){sn(this,t,new e_(this,t,e))}toJSON(){this.doc??O();let t={};return this._map.forEach((e,r)=>{if(!e.deleted){let s=e.content.getContent()[e.length-1];t[r]=s instanceof I?s.toJSON():s}}),t}get size(){return[...je(this)].length}keys(){return Me(je(this),(t)=>t[0])}values(){return Me(je(this),(t)=>t[1].content.getContent()[t[1].length-1])}entries(){return Me(je(this),(t)=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??O(),this._map.forEach((e,r)=>{if(!e.deleted)t(e.content.getContent()[e.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(t){if(this.doc!==null)x(this.doc,(e)=>{Ke(e,this,t)});else this._prelimContent.delete(t)}set(t,e){if(this.doc!==null)x(this.doc,(r)=>{hr(r,this,t,e)});else this._prelimContent.set(t,e);return e}get(t){return ur(this,t)}has(t){return ai(this,t)}clear(){if(this.doc!==null)x(this.doc,(t)=>{this.forEach(function(e,r,s){Ke(t,s,r)})});else this._prelimContent.clear()}_write(t){t.writeTypeRef(Fc)}}var yc=(t)=>new ss,tt=(t,e)=>t===e||typeof t==="object"&&typeof e==="object"&&t&&e&&In(t,e);class We{constructor(t,e,r,s){this.left=t,this.right=e,this.index=r,this.currentAttributes=s}forward(){if(this.right===null)v();switch(this.right.content.constructor){case U:if(!this.right.deleted)Rt(this.currentAttributes,this.right.content);break;default:if(!this.right.deleted)this.index+=this.right.length;break}this.left=this.right,this.right=this.right.right}}var Ds=(t,e,r)=>{while(e.right!==null&&r>0){switch(e.right.content.constructor){case U:if(!e.right.deleted)Rt(e.currentAttributes,e.right.content);break;default:if(!e.right.deleted){if(r<e.right.length)N(t,m(e.right.id.client,e.right.id.clock+r));e.index+=e.right.length,r-=e.right.length}break}e.left=e.right,e.right=e.right.right}return e},qe=(t,e,r,s)=>{let i=new Map,o=s?rn(e,r):null;if(o){let c=new We(o.p.left,o.p,o.index,i);return Ds(t,c,r-o.index)}else{let c=new We(null,e._start,0,i);return Ds(t,c,r)}},hi=(t,e,r,s)=>{while(r.right!==null&&(r.right.deleted===!0||r.right.content.constructor===U&&tt(s.get(r.right.content.key),r.right.content.value))){if(!r.right.deleted)s.delete(r.right.content.key);r.forward()}let i=t.doc,o=i.clientID;s.forEach((c,l)=>{let{left:h,right:f}=r,a=new y(m(o,b(i.store,o)),h,h&&h.lastId,f,f&&f.id,e,null,new U(l,c));a.integrate(t,0),r.right=a,r.forward()})},Rt=(t,e)=>{let{key:r,value:s}=e;if(s===null)t.delete(r);else t.set(r,s)},ui=(t,e)=>{while(!0){if(t.right===null)break;else if(t.right.deleted||t.right.content.constructor===U&&tt(e[t.right.content.key]??null,t.right.content.value));else break;t.forward()}},di=(t,e,r,s)=>{let i=t.doc,o=i.clientID,c=new Map;for(let l in s){let h=s[l],f=r.currentAttributes.get(l)??null;if(!tt(f,h)){c.set(l,f);let{left:a,right:u}=r;r.right=new y(m(o,b(i.store,o)),a,a&&a.lastId,u,u&&u.id,e,null,new U(l,h)),r.right.integrate(t,0),r.forward()}}return c},Kn=(t,e,r,s,i)=>{r.currentAttributes.forEach((d,p)=>{if(i[p]===void 0)i[p]=null});let o=t.doc,c=o.clientID;ui(r,i);let l=di(t,e,r,i),h=s.constructor===String?new K(s):s instanceof I?new W(s):new ut(s),{left:f,right:a,index:u}=r;if(e._searchMarker)re(e._searchMarker,r.index,h.getLength());a=new y(m(c,b(o.store,c)),f,f&&f.lastId,a,a&&a.id,e,null,h),a.integrate(t,0),r.right=a,r.index=u,r.forward(),hi(t,e,r,l)},Bs=(t,e,r,s,i)=>{let o=t.doc,c=o.clientID;ui(r,i);let l=di(t,e,r,i);t:while(r.right!==null&&(s>0||l.size>0&&(r.right.deleted||r.right.content.constructor===U))){if(!r.right.deleted)switch(r.right.content.constructor){case U:{let{key:h,value:f}=r.right.content,a=i[h];if(a!==void 0){if(tt(a,f))l.delete(h);else{if(s===0)break t;l.set(h,f)}r.right.delete(t)}else r.currentAttributes.set(h,f);break}default:if(s<r.right.length)N(t,m(r.right.id.client,r.right.id.clock+s));s-=r.right.length;break}r.forward()}if(s>0){let h="";for(;s>0;s--)h+=`
|
|
4
|
+
`;r.right=new y(m(c,b(o.store,c)),r.left,r.left&&r.left.lastId,r.right,r.right&&r.right.id,e,null,new K(h)),r.right.integrate(t,0),r.forward()}hi(t,e,r,l)},fi=(t,e,r,s,i)=>{let o=e,c=A();while(o&&(!o.countable||o.deleted)){if(!o.deleted&&o.content.constructor===U){let f=o.content;c.set(f.key,f)}o=o.right}let l=0,h=!1;while(e!==o){if(r===e)h=!0;if(!e.deleted){let f=e.content;switch(f.constructor){case U:{let{key:a,value:u}=f,d=s.get(a)??null;if(c.get(a)!==f||d===u){if(e.delete(t),l++,!h&&(i.get(a)??null)===u&&d!==u)if(d===null)i.delete(a);else i.set(a,d)}if(!h&&!e.deleted)Rt(i,f);break}}}e=e.right}return l},bc=(t,e)=>{while(e&&e.right&&(e.right.deleted||!e.right.countable))e=e.right;let r=new Set;while(e&&(e.deleted||!e.countable)){if(!e.deleted&&e.content.constructor===U){let s=e.content.key;if(r.has(s))e.delete(t);else r.add(s)}e=e.left}},kc=(t)=>{let e=0;return x(t.doc,(r)=>{let{_start:s,_start:i}=t,o=A(),c=Ee(o);while(i){if(i.deleted===!1)switch(i.content.constructor){case U:Rt(c,i.content);break;default:e+=fi(r,s,i,o,c),o=Ee(c),s=i;break}i=i.right}}),e},_c=(t)=>{let e=new Set,r=t.doc;for(let[s,i]of t.afterState.entries()){let o=t.beforeState.get(s)||0;if(i===o)continue;Ps(t,r.store.clients.get(s),o,i,(c)=>{if(!c.deleted&&c.content.constructor===U&&c.constructor!==V)e.add(c.parent)})}x(r,(s)=>{Bt(t,t.deleteSet,(i)=>{if(i instanceof V||!i.parent._hasFormatting||e.has(i.parent))return;let o=i.parent;if(i.content.constructor===U)e.add(o);else bc(s,i)});for(let i of e)kc(i)})},Os=(t,e,r)=>{let s=r,i=Ee(e.currentAttributes),o=e.right;while(r>0&&e.right!==null){if(e.right.deleted===!1)switch(e.right.content.constructor){case W:case ut:case K:if(r<e.right.length)N(t,m(e.right.id.client,e.right.id.clock+r));r-=e.right.length,e.right.delete(t);break}e.forward()}if(o)fi(t,o,e.right,i,e.currentAttributes);let c=(e.left||e.right).parent;if(c._searchMarker)re(c._searchMarker,e.index,-s+r);return e};class t_ extends le{constructor(t,e,r){super(t,e);this.childListChanged=!1,this.keysChanged=new Set,r.forEach((s)=>{if(s===null)this.childListChanged=!0;else this.keysChanged.add(s)})}get changes(){if(this._changes===null){let t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){let t=this.target.doc,e=[];x(t,(r)=>{let s=new Map,i=new Map,o=this.target._start,c=null,l={},h="",f=0,a=0,u=()=>{if(c!==null){let d=null;switch(c){case"delete":if(a>0)d={delete:a};a=0;break;case"insert":if(typeof h==="object"||h.length>0){if(d={insert:h},s.size>0)d.attributes={},s.forEach((p,g)=>{if(p!==null)d.attributes[g]=p})}h="";break;case"retain":if(f>0){if(d={retain:f},!$r(l))d.attributes=Vr({},l)}f=0;break}if(d)e.push(d);c=null}};while(o!==null){switch(o.content.constructor){case W:case ut:if(this.adds(o)){if(!this.deletes(o))u(),c="insert",h=o.content.getContent()[0],u()}else if(this.deletes(o)){if(c!=="delete")u(),c="delete";a+=1}else if(!o.deleted){if(c!=="retain")u(),c="retain";f+=1}break;case K:if(this.adds(o)){if(!this.deletes(o)){if(c!=="insert")u(),c="insert";h+=o.content.str}}else if(this.deletes(o)){if(c!=="delete")u(),c="delete";a+=o.length}else if(!o.deleted){if(c!=="retain")u(),c="retain";f+=o.length}break;case U:{let{key:d,value:p}=o.content;if(this.adds(o)){if(!this.deletes(o)){let g=s.get(d)??null;if(!tt(g,p)){if(c==="retain")u();if(tt(p,i.get(d)??null))delete l[d];else l[d]=p}else if(p!==null)o.delete(r)}}else if(this.deletes(o)){i.set(d,p);let g=s.get(d)??null;if(!tt(g,p)){if(c==="retain")u();l[d]=g}}else if(!o.deleted){i.set(d,p);let g=l[d];if(g!==void 0){if(!tt(g,p)){if(c==="retain")u();if(p===null)delete l[d];else l[d]=p}else if(g!==null)o.delete(r)}}if(!o.deleted){if(c==="insert")u();Rt(s,o.content)}break}}o=o.right}u();while(e.length>0){let d=e[e.length-1];if(d.retain!==void 0&&d.attributes===void 0)e.pop();else break}}),this._delta=e}return this._delta}}class as extends I{constructor(t){super();this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??O(),this._length}_integrate(t,e){super._integrate(t,e);try{this._pending.forEach((r)=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new as}clone(){let t=new as;return t.applyDelta(this.toDelta()),t}_callObserver(t,e){super._callObserver(t,e);let r=new t_(this,t,e);if(sn(this,t,r),!t.local&&this._hasFormatting)t._needFormattingCleanup=!0}toString(){this.doc??O();let t="",e=this._start;while(e!==null){if(!e.deleted&&e.countable&&e.content.constructor===K)t+=e.content.str;e=e.right}return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:e=!0}={}){if(this.doc!==null)x(this.doc,(r)=>{let s=new We(null,this._start,0,new Map);for(let i=0;i<t.length;i++){let o=t[i];if(o.insert!==void 0){let c=!e&&typeof o.insert==="string"&&i===t.length-1&&s.right===null&&o.insert.slice(-1)===`
|
|
5
|
+
`?o.insert.slice(0,-1):o.insert;if(typeof c!=="string"||c.length>0)Kn(r,this,s,c,o.attributes||{})}else if(o.retain!==void 0)Bs(r,this,s,o.retain,o.attributes||{});else if(o.delete!==void 0)Os(r,s,o.delete)}});else this._pending.push(()=>this.applyDelta(t))}toDelta(t,e,r){this.doc??O();let s=[],i=new Map,o=this.doc,c="",l=this._start;function h(){if(c.length>0){let a={},u=!1;i.forEach((p,g)=>{u=!0,a[g]=p});let d={insert:c};if(u)d.attributes=a;s.push(d),c=""}}let f=()=>{while(l!==null){if(At(l,t)||e!==void 0&&At(l,e))switch(l.content.constructor){case K:{let a=i.get("ychange");if(t!==void 0&&!At(l,t)){if(a===void 0||a.user!==l.id.client||a.type!=="removed")h(),i.set("ychange",r?r("removed",l.id):{type:"removed"})}else if(e!==void 0&&!At(l,e)){if(a===void 0||a.user!==l.id.client||a.type!=="added")h(),i.set("ychange",r?r("added",l.id):{type:"added"})}else if(a!==void 0)h(),i.delete("ychange");c+=l.content.str;break}case W:case ut:{h();let a={insert:l.content.getContent()[0]};if(i.size>0){let u={};a.attributes=u,i.forEach((d,p)=>{u[p]=d})}s.push(a);break}case U:if(At(l,t))h(),Rt(i,l.content);break}l=l.right}h()};if(t||e)x(o,(a)=>{if(t)Zn(a,t);if(e)Zn(a,e);f()},"cleanup");else f();return s}insert(t,e,r){if(e.length<=0)return;let s=this.doc;if(s!==null)x(s,(i)=>{let o=qe(i,this,t,!r);if(!r)r={},o.currentAttributes.forEach((c,l)=>{r[l]=c});Kn(i,this,o,e,r)});else this._pending.push(()=>this.insert(t,e,r))}insertEmbed(t,e,r){let s=this.doc;if(s!==null)x(s,(i)=>{let o=qe(i,this,t,!r);Kn(i,this,o,e,r||{})});else this._pending.push(()=>this.insertEmbed(t,e,r||{}))}delete(t,e){if(e===0)return;let r=this.doc;if(r!==null)x(r,(s)=>{Os(s,qe(s,this,t,!0),e)});else this._pending.push(()=>this.delete(t,e))}format(t,e,r){if(e===0)return;let s=this.doc;if(s!==null)x(s,(i)=>{let o=qe(i,this,t,!1);if(o.right===null)return;Bs(i,this,o,e,r)});else this._pending.push(()=>this.format(t,e,r))}removeAttribute(t){if(this.doc!==null)x(this.doc,(e)=>{Ke(e,this,t)});else this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,e){if(this.doc!==null)x(this.doc,(r)=>{hr(r,this,t,e)});else this._pending.push(()=>this.setAttribute(t,e))}getAttribute(t){return ur(this,t)}getAttributes(){return li(this)}_write(t){t.writeTypeRef(jc)}}var Sc=(t)=>new as;class ze{constructor(t,e=()=>!0){this._filter=e,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??O()}[Symbol.iterator](){return this}next(){let t=this._currentNode,e=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(e)))do if(e=t.content.type,!t.deleted&&(e.constructor===Ot||e.constructor===lt)&&e._start!==null)t=e._start;else while(t!==null){let r=t.next;if(r!==null){t=r;break}else if(t.parent===this._root)t=null;else t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));if(this._firstCall=!1,t===null)return{value:void 0,done:!0};return this._currentNode=t,{value:t.content.type,done:!1}}}class lt extends I{constructor(){super();this._prelimContent=[]}get firstChild(){let t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new lt}clone(){let t=new lt;return t.insert(0,this.toArray().map((e)=>e instanceof I?e.clone():e)),t}get length(){return this.doc??O(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new ze(this,t)}querySelector(t){t=t.toUpperCase();let r=new ze(this,(s)=>s.nodeName&&s.nodeName.toUpperCase()===t).next();if(r.done)return null;else return r.value}querySelectorAll(t){return t=t.toUpperCase(),j(new ze(this,(e)=>e.nodeName&&e.nodeName.toUpperCase()===t))}_callObserver(t,e){sn(this,t,new pi(this,e,t))}toString(){return ri(this,(t)=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,e={},r){let s=t.createDocumentFragment();if(r!==void 0)r._createAssociation(s,this);return se(this,(i)=>{s.insertBefore(i.toDOM(t,e,r),null)}),s}insert(t,e){if(this.doc!==null)x(this.doc,(r)=>{oi(r,this,t,e)});else this._prelimContent.splice(t,0,...e)}insertAfter(t,e){if(this.doc!==null)x(this.doc,(r)=>{let s=t&&t instanceof I?t._item:t;Pe(r,this,s,e)});else{let r=this._prelimContent,s=t===null?0:r.findIndex((i)=>i===t)+1;if(s===0&&t!==null)throw R("Reference item not found");r.splice(s,0,...e)}}delete(t,e=1){if(this.doc!==null)x(this.doc,(r)=>{ci(r,this,t,e)});else this._prelimContent.splice(t,e)}toArray(){return ni(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return si(this,t)}slice(t=0,e=this.length){return ei(this,t,e)}forEach(t){se(this,t)}_write(t){t.writeTypeRef(Gc)}}var Ec=(t)=>new lt;class Ot extends lt{constructor(t="UNDEFINED"){super();this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){let t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){let t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,e){super._integrate(t,e),this._prelimAttrs.forEach((r,s)=>{this.setAttribute(s,r)}),this._prelimAttrs=null}_copy(){return new Ot(this.nodeName)}clone(){let t=new Ot(this.nodeName),e=this.getAttributes();return Mr(e,(r,s)=>{t.setAttribute(s,r)}),t.insert(0,this.toArray().map((r)=>r instanceof I?r.clone():r)),t}toString(){let t=this.getAttributes(),e=[],r=[];for(let c in t)r.push(c);r.sort();let s=r.length;for(let c=0;c<s;c++){let l=r[c];e.push(l+'="'+t[l]+'"')}let i=this.nodeName.toLocaleLowerCase(),o=e.length>0?" "+e.join(" "):"";return`<${i}${o}>${super.toString()}</${i}>`}removeAttribute(t){if(this.doc!==null)x(this.doc,(e)=>{Ke(e,this,t)});else this._prelimAttrs.delete(t)}setAttribute(t,e){if(this.doc!==null)x(this.doc,(r)=>{hr(r,this,t,e)});else this._prelimAttrs.set(t,e)}getAttribute(t){return ur(this,t)}hasAttribute(t){return ai(this,t)}getAttributes(t){return t?wc(this,t):li(this)}toDOM(t=document,e={},r){let s=t.createElement(this.nodeName),i=this.getAttributes();for(let o in i){let c=i[o];if(typeof c==="string")s.setAttribute(o,c)}if(se(this,(o)=>{s.appendChild(o.toDOM(t,e,r))}),r!==void 0)r._createAssociation(s,this);return s}_write(t){t.writeTypeRef(qc),t.writeKey(this.nodeName)}}var Ic=(t)=>new Ot(t.readKey());class pi extends le{constructor(t,e,r){super(t,r);this.childListChanged=!1,this.attributesChanged=new Set,e.forEach((s)=>{if(s===null)this.childListChanged=!0;else this.attributesChanged.add(s)})}}class Ze extends ss{constructor(t){super();this.hookName=t}_copy(){return new Ze(this.hookName)}clone(){let t=new Ze(this.hookName);return this.forEach((e,r)=>{t.set(r,e)}),t}toDOM(t=document,e={},r){let s=e[this.hookName],i;if(s!==void 0)i=s.createDom(this);else i=document.createElement(this.hookName);if(i.setAttribute("data-yjs-hook",this.hookName),r!==void 0)r._createAssociation(i,this);return i}_write(t){t.writeTypeRef(zc),t.writeKey(this.hookName)}}var Uc=(t)=>new Ze(t.readKey());class Xe extends as{get nextSibling(){let t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){let t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new Xe}clone(){let t=new Xe;return t.applyDelta(this.toDelta()),t}toDOM(t=document,e,r){let s=t.createTextNode(this.toString());if(r!==void 0)r._createAssociation(s,this);return s}toString(){return this.toDelta().map((t)=>{let e=[];for(let s in t.attributes){let i=[];for(let o in t.attributes[s])i.push({key:o,value:t.attributes[s][o]});i.sort((o,c)=>o.key<c.key?-1:1),e.push({nodeName:s,attrs:i})}e.sort((s,i)=>s.nodeName<i.nodeName?-1:1);let r="";for(let s=0;s<e.length;s++){let i=e[s];r+=`<${i.nodeName}`;for(let o=0;o<i.attrs.length;o++){let c=i.attrs[o];r+=` ${c.key}="${c.value}"`}r+=">"}r+=t.insert;for(let s=e.length-1;s>=0;s--)r+=`</${e[s].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(Hc)}}var Tc=(t)=>new Xe;class on{constructor(t,e){this.id=t,this.length=e}get deleted(){throw L()}mergeWith(t){return!1}write(t,e,r){throw L()}integrate(t,e){throw L()}}var Ac=0;class V extends on{get deleted(){return!0}delete(){}mergeWith(t){if(this.constructor!==t.constructor)return!1;return this.length+=t.length,!0}integrate(t,e){if(e>0)this.id.clock+=e,this.length-=e;Js(t.doc.store,this)}write(t,e){t.writeInfo(Ac),t.writeLen(this.length-e)}getMissing(t,e){return null}}class ae{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new ae(this.content)}splice(t){throw L()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeBuf(this.content)}getRef(){return 3}}var Cc=(t)=>new ae(t.readBuf());class ie{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new ie(this.len)}splice(t){let e=new ie(this.len-t);return this.len=t,e}mergeWith(t){return this.len+=t.len,!0}integrate(t,e){ne(t.deleteSet,e.id.client,e.id.clock,this.len),e.markDeleted()}delete(t){}gc(t){}write(t,e){t.writeLen(this.len-e)}getRef(){return 1}}var Dc=(t)=>new ie(t.readLen()),gi=(t,e)=>new Sd({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class he{constructor(t){if(t._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=t;let e={};if(this.opts=e,!t.gc)e.gc=!1;if(t.autoLoad)e.autoLoad=!0;if(t.meta!==null)e.meta=t.meta}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new he(gi(this.doc.guid,this.opts))}splice(t){throw L()}mergeWith(t){return!1}integrate(t,e){if(this.doc._item=e,t.subdocsAdded.add(this.doc),this.doc.shouldLoad)t.subdocsLoaded.add(this.doc)}delete(t){if(t.subdocsAdded.has(this.doc))t.subdocsAdded.delete(this.doc);else t.subdocsRemoved.add(this.doc)}gc(t){}write(t,e){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}var Bc=(t)=>new he(gi(t.readString(),t.readAny()));class ut{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ut(this.embed)}splice(t){throw L()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeJSON(this.embed)}getRef(){return 5}}var Oc=(t)=>new ut(t.readJSON());class U{constructor(t,e){this.key=t,this.value=e}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new U(this.key,this.value)}splice(t){throw L()}mergeWith(t){return!1}integrate(t,e){let r=e.parent;r._searchMarker=null,r._hasFormatting=!0}delete(t){}gc(t){}write(t,e){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}var vc=(t)=>new U(t.readKey(),t.readJSON());class Qe{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Qe(this.arr)}splice(t){let e=new Qe(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){let r=this.arr.length;t.writeLen(r-e);for(let s=e;s<r;s++){let i=this.arr[s];t.writeString(i===void 0?"undefined":JSON.stringify(i))}}getRef(){return 2}}var Nc=(t)=>{let e=t.readLen(),r=[];for(let s=0;s<e;s++){let i=t.readString();if(i==="undefined")r.push(void 0);else r.push(JSON.parse(i))}return new Qe(r)},Rc=Zt("node_env")==="development";class at{constructor(t){this.arr=t,Rc&&Un(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new at(this.arr)}splice(t){let e=new at(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){let r=this.arr.length;t.writeLen(r-e);for(let s=e;s<r;s++){let i=this.arr[s];t.writeAny(i)}}getRef(){return 8}}var Lc=(t)=>{let e=t.readLen(),r=[];for(let s=0;s<e;s++)r.push(t.readAny());return new at(r)};class K{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new K(this.str)}splice(t){let e=new K(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);if(r>=55296&&r<=56319)this.str=this.str.slice(0,t-1)+"�",e.str="�"+e.str.slice(1);return e}mergeWith(t){return this.str+=t.str,!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeString(e===0?this.str:this.str.slice(e))}getRef(){return 4}}var Vc=(t)=>new K(t.readString()),Mc=[xc,yc,Sc,Ic,Ec,Uc,Tc],$c=0,Fc=1,jc=2,qc=3,Gc=4,zc=5,Hc=6;class W{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new W(this.type._copy())}splice(t){throw L()}mergeWith(t){return!1}integrate(t,e){this.type._integrate(t.doc,e)}delete(t){let e=this.type._start;while(e!==null){if(!e.deleted)e.delete(t);else if(e.id.clock<(t.beforeState.get(e.id.client)||0))t._mergeStructs.push(e);e=e.right}this.type._map.forEach((r)=>{if(!r.deleted)r.delete(t);else if(r.id.clock<(t.beforeState.get(r.id.client)||0))t._mergeStructs.push(r)}),t.changed.delete(this.type)}gc(t){let e=this.type._start;while(e!==null)e.gc(t,!0),e=e.right;this.type._start=null,this.type._map.forEach((r)=>{while(r!==null)r.gc(t,!0),r=r.left}),this.type._map=new Map}write(t,e){this.type._write(t)}getRef(){return 7}}var Jc=(t)=>new W(Mc[t.readTypeRef()](t)),Qn=(t,e)=>{let r=e,s=0,i;do{if(s>0)r=m(r.client,r.clock+s);i=Ct(t,r),s=r.clock-i.id.clock,r=i.redone}while(r!==null&&i instanceof y);return{item:i,diff:s}},dr=(t,e)=>{while(t!==null&&t.keep!==e)t.keep=e,t=t.parent._item},Ye=(t,e,r)=>{let{client:s,clock:i}=e.id,o=new y(m(s,i+r),e,m(s,i+r-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(r));if(e.deleted)o.markDeleted();if(e.keep)o.keep=!0;if(e.redone!==null)o.redone=m(e.redone.client,e.redone.clock+r);if(e.right=o,o.right!==null)o.right.left=o;if(t._mergeStructs.push(o),o.parentSub!==null&&o.right===null)o.parent._map.set(o.parentSub,o);return e.length=r,o},vs=(t,e)=>$t(t,(r)=>ce(r.deletions,e)),mi=(t,e,r,s,i,o)=>{let c=t.doc,{store:l,clientID:h}=c,f=e.redone;if(f!==null)return N(t,f);let a=e.parent._item,u=null,d;if(a!==null&&a.deleted===!0){if(a.redone===null&&(!r.has(a)||mi(t,a,r,s,i,o)===null))return null;while(a.redone!==null)a=N(t,a.redone)}let p=a===null?e.parent:a.content.type;if(e.parentSub===null){u=e.left,d=e;while(u!==null){let k=u;while(k!==null&&k.parent._item!==a)k=k.redone===null?null:N(t,k.redone);if(k!==null&&k.parent._item===a){u=k;break}u=u.left}while(d!==null){let k=d;while(k!==null&&k.parent._item!==a)k=k.redone===null?null:N(t,k.redone);if(k!==null&&k.parent._item===a){d=k;break}d=d.right}}else{if(d=null,e.right&&!i){u=e;while(u!==null&&u.right!==null&&(u.right.redone||ce(s,u.right.id)||vs(o.undoStack,u.right.id)||vs(o.redoStack,u.right.id))){u=u.right;while(u.redone)u=N(t,u.redone)}if(u&&u.right!==null)return null}else u=p._map.get(e.parentSub)||null;if(u!==null&&u.parent._item!==a)u=p._map.get(e.parentSub)||null}let g=b(l,h),w=m(h,g),C=new y(w,u,u&&u.lastId,d,d&&d.id,p,e.parentSub,e.content.copy());return e.redone=w,dr(C,!0),C.integrate(t,0),C};class y extends on{constructor(t,e,r,s,i,o,c,l){super(t,l.getLength());this.origin=r,this.left=e,this.right=s,this.rightOrigin=i,this.parent=o,this.parentSub=c,this.redone=null,this.content=l,this.info=this.content.isCountable()?ln:0}set marker(t){if((this.info&pe)>0!==t)this.info^=pe}get marker(){return(this.info&pe)>0}get keep(){return(this.info&cn)>0}set keep(t){if(this.keep!==t)this.info^=cn}get countable(){return(this.info&ln)>0}get deleted(){return(this.info&fe)>0}set deleted(t){if(this.deleted!==t)this.info^=fe}markDeleted(){this.info|=fe}getMissing(t,e){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=b(e,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=b(e,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===ot&&this.id.client!==this.parent.client&&this.parent.clock>=b(e,this.parent.client))return this.parent.client;if(this.origin)this.left=Es(t,e,this.origin),this.origin=this.left.lastId;if(this.rightOrigin)this.right=N(t,this.rightOrigin),this.rightOrigin=this.right.id;if(this.left&&this.left.constructor===V||this.right&&this.right.constructor===V)this.parent=null;else if(!this.parent){if(this.left&&this.left.constructor===y)this.parent=this.left.parent,this.parentSub=this.left.parentSub;else if(this.right&&this.right.constructor===y)this.parent=this.right.parent,this.parentSub=this.right.parentSub}else if(this.parent.constructor===ot){let r=Ct(e,this.parent);if(r.constructor===V)this.parent=null;else this.parent=r.content.type}return null}integrate(t,e){if(e>0)this.id.clock+=e,this.left=Es(t,t.doc.store,m(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(e),this.length-=e;if(this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,s;if(r!==null)s=r.right;else if(this.parentSub!==null){s=this.parent._map.get(this.parentSub)||null;while(s!==null&&s.left!==null)s=s.left}else s=this.parent._start;let i=new Set,o=new Set;while(s!==null&&s!==this.right){if(o.add(s),i.add(s),$e(this.origin,s.origin)){if(s.id.client<this.id.client)r=s,i.clear();else if($e(this.rightOrigin,s.rightOrigin))break}else if(s.origin!==null&&o.has(Ct(t.doc.store,s.origin))){if(!i.has(Ct(t.doc.store,s.origin)))r=s,i.clear()}else break;s=s.right}this.left=r}if(this.left!==null){let r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null){r=this.parent._map.get(this.parentSub)||null;while(r!==null&&r.left!==null)r=r.left}else r=this.parent._start,this.parent._start=this;this.right=r}if(this.right!==null)this.right.left=this;else if(this.parentSub!==null){if(this.parent._map.set(this.parentSub,this),this.left!==null)this.left.delete(t)}if(this.parentSub===null&&this.countable&&!this.deleted)this.parent._length+=this.length;if(Js(t.doc.store,this),this.content.integrate(t,this),Us(t,this.parent,this.parentSub),this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)this.delete(t)}else new V(this.id,this.length).integrate(t,0)}get next(){let t=this.right;while(t!==null&&t.deleted)t=t.right;return t}get prev(){let t=this.left;while(t!==null&&t.deleted)t=t.left;return t}get lastId(){return this.length===1?this.id:m(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&$e(t.origin,this.lastId)&&this.right===t&&$e(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){let e=this.parent._searchMarker;if(e)e.forEach((r)=>{if(r.p===t){if(r.p=this,!this.deleted&&this.countable)r.index-=this.length}});if(t.keep)this.keep=!0;if(this.right=t.right,this.right!==null)this.right.left=this;return this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){let e=this.parent;if(this.countable&&this.parentSub===null)e._length-=this.length;this.markDeleted(),ne(t.deleteSet,this.id.client,this.id.clock,this.length),Us(t,e,this.parentSub),this.content.delete(t)}}gc(t,e){if(!this.deleted)throw v();if(this.content.gc(t),e)rc(t,this,new V(this.id,this.length));else this.content=new ie(this.length)}write(t,e){let r=e>0?m(this.id.client,this.id.clock+e-1):this.origin,s=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&Vt|(r===null?0:D)|(s===null?0:F)|(i===null?0:dt);if(t.writeInfo(o),r!==null)t.writeLeftID(r);if(s!==null)t.writeRightID(s);if(r===null&&s===null){let c=this.parent;if(c._item!==void 0){let l=c._item;if(l===null){let h=qs(c);t.writeParentInfo(!0),t.writeString(h)}else t.writeParentInfo(!1),t.writeLeftID(l.id)}else if(c.constructor===String)t.writeParentInfo(!0),t.writeString(c);else if(c.constructor===ot)t.writeParentInfo(!1),t.writeLeftID(c);else v();if(i!==null)t.writeString(i)}this.content.write(t,e)}}var wi=(t,e)=>Pc[e&Vt](t),Pc=[()=>{v()},Dc,Nc,Cc,Vc,Oc,vc,Jc,Lc,Bc,()=>{v()}],Kc=10;class M extends on{get deleted(){return!0}delete(){}mergeWith(t){if(this.constructor!==t.constructor)return!1;return this.length+=t.length,!0}integrate(t,e){v()}write(t,e){t.writeInfo(Kc),_t(t.restEncoder,this.length-e)}getMissing(t,e){return null}}var xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},yi="__ $YJS$ __";if(xi[yi]===!0)console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");xi[yi]=!0;var QI=0,eR=1,tR=2,nR=3;class Ag extends Error{constructor(t){super(t);this.name="EnvelopeError"}}function Wc(t){return S(t)&&"type"in t&&n(t.type)}function yk(t){let e=Ja(),{type:r}=t;switch(t.type){case"doc-sync":{_t(e,QI),Ya(e,t.path),_t(e,t.epoch),Wo(e,t.body);break}case"awareness":{_t(e,eR),Wo(e,t.body);break}case"doc-close":{_t(e,tR),Ya(e,t.path);break}case"control":{_t(e,nR),Ya(e,JSON.stringify(t.message));break}default:throw new Ag(`unknown-frame:${r}`)}return wr(e)}function wk(t){try{let e=Za(t),r=Dt(e);switch(r){case QI:{let s=Xa(e),i=Dt(e);return{body:tr(e),epoch:i,path:s,type:"doc-sync"}}case eR:return{body:tr(e),type:"awareness"};case tR:return{path:Xa(e),type:"doc-close"};case nR:{let s=JSON.parse(Xa(e));if(!Wc(s))throw new Ag("malformed-control");return{message:s,type:"control"}}default:throw new Ag(`unknown-frame-type:${r}`)}}catch(e){if(e instanceof Ag)throw e;throw new Ag(`malformed-frame: ${e instanceof Error?e.message:String(e)}`)}}
|
|
6
|
+
export{bk,rs,Ja,vk,wr,_t,Ya,Wo,Za,tr,Dt,Xa,Cu,rp,Sd,YI,ZI,XI,Q0,Ng,x2,Sy,va,e_,ss,t_,as,QI,eR,tR,nR,Ag,yk,wk};
|
|
7
|
+
|
|
8
|
+
//# debugId=C804814C8E509F8A64756E2164756E21
|
|
9
|
+
//# sourceMappingURL=studio-83mk4bgg.js.map
|