@jxsuite/studio 6.1.2 → 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.
Files changed (522) hide show
  1. package/README.md +5 -5
  2. package/dist/chunks/2020-5wtzce5g.js +4 -0
  3. package/dist/chunks/adapter-5tphg7xe.js +4 -0
  4. package/dist/chunks/add-new-flow-psym14sn.js +4 -0
  5. package/dist/chunks/cf-account-picker-haqazq5r.js +4 -0
  6. package/dist/chunks/cf-settings-h2wrh6hq.js +4 -0
  7. package/dist/chunks/{color-area-0fj8a4ga.js → color-area-6rbra5dy.js} +2 -2
  8. package/dist/chunks/{color-field-xch8kx2g.js → color-field-gy56c94g.js} +3 -3
  9. package/dist/chunks/color-m7r1vk54.js +4 -0
  10. package/dist/chunks/{color-slider-jxd8v350.js → color-slider-sqqdyf6c.js} +2 -2
  11. package/dist/chunks/{combobox-p0efwjke.js → combobox-72h32ejk.js} +3 -3
  12. package/dist/chunks/components-r22xca09.js +4 -0
  13. package/dist/chunks/content-source-mmppmcyg.js +4 -0
  14. package/dist/chunks/convert-to-repeater-he70fc2b.js +4 -0
  15. package/dist/chunks/editor-ccd9jwsa.js +4 -0
  16. package/dist/chunks/entry-commands-6qxz9e8p.js +4 -0
  17. package/dist/chunks/extension-sections-0egb88dm.js +4 -0
  18. package/dist/chunks/file-ops-qnab36ek.js +4 -0
  19. package/dist/chunks/files-rcn56qvm.js +4 -0
  20. package/dist/chunks/format-host-yxz0kjjs.js +4 -0
  21. package/dist/chunks/fs-events-d1qxq4z4.js +4 -0
  22. package/dist/chunks/grid-open-4z1g062t.js +4 -0
  23. package/dist/chunks/{grid-view-d2wq9ezg.js → grid-view-qg1b5eqx.js} +25 -25
  24. package/dist/chunks/{icons-pnfz478q.js → icons-63bjtbs7.js} +2 -2
  25. package/dist/chunks/{iframe-entry-jdcktez8.js → iframe-entry-2zggzajv.js} +4 -4
  26. package/dist/chunks/{iframe-entry-zap785cw.js → iframe-entry-76j8vwwx.js} +4 -4
  27. package/dist/chunks/iframe-entry-99nr5zfb.js +5 -0
  28. package/dist/chunks/{iframe-entry-x0ygf2yr.js → iframe-entry-pkgmcgp0.js} +4 -4
  29. package/dist/chunks/iframe-host-ssv7kyj0.js +4 -0
  30. package/dist/chunks/{index-zpjmzqfk.js → index-32eqzv1k.js} +3 -3
  31. package/dist/chunks/index-f0jn7nnp.js +4 -0
  32. package/dist/chunks/{javascript-m54mnwp6.js → javascript-pjp734q4.js} +3 -3
  33. package/dist/chunks/jsonMode-njkvsa02.js +13 -0
  34. package/dist/chunks/jx-validate-ttasrbh7.js +4 -0
  35. package/dist/chunks/layers-bgyr11tr.js +4 -0
  36. package/dist/chunks/layers-panel-7ez66zeq.js +4 -0
  37. package/dist/chunks/{listbox-e74qjyq6.js → listbox-c421cf8c.js} +2 -2
  38. package/dist/chunks/lit-html-v9gh687x.js +4 -0
  39. package/dist/chunks/media-library-sq468wts.js +4 -0
  40. package/dist/chunks/media-picker-shfe59pt.js +4 -0
  41. package/dist/chunks/{menu-n6yzswmy.js → menu-bdpzbfvs.js} +2 -2
  42. package/dist/chunks/{monaco-binding-7gx83x3r.js → monaco-binding-vq1hgnn0.js} +3 -3
  43. package/dist/chunks/monaco-buffer-3afgwvbp.js +4 -0
  44. package/dist/chunks/monaco-setup-xrd2cbkp.js +4 -0
  45. package/dist/chunks/notify-kzrjr3fv.js +4 -0
  46. package/dist/chunks/parse-v77xtwv7.js +4 -0
  47. package/dist/chunks/platform-7v4rtd7m.js +4 -0
  48. package/dist/chunks/popover-b89sfej7.js +4 -0
  49. package/dist/chunks/publish-panel-2z9gw8ee.js +4 -0
  50. package/dist/chunks/publish-quick-qx2455cj.js +4 -0
  51. package/dist/chunks/publish-workspace-wrc1dgwx.js +4 -0
  52. package/dist/chunks/quick-search-n0t0eqxb.js +4 -0
  53. package/dist/chunks/references-9547rg5s.js +4 -0
  54. package/dist/chunks/right-panel-wsgnr9pn.js +4 -0
  55. package/dist/chunks/source-control-kwktr9y6.js +4 -0
  56. package/dist/chunks/{split-n2gfpm5m.js → split-c9zfdgxf.js} +2 -2
  57. package/dist/chunks/studio-03ct6yfv.js +9 -0
  58. package/dist/chunks/studio-07rcfje3.js +5 -0
  59. package/dist/chunks/studio-3e54qh39.js +7 -0
  60. package/dist/chunks/studio-3exxhz5g.js +5 -0
  61. package/dist/chunks/studio-3q40e3rj.js +5 -0
  62. package/dist/chunks/studio-3qeh9t0h.js +6 -0
  63. package/dist/chunks/studio-3qqjeep5.js +6 -0
  64. package/dist/chunks/studio-43sd2mam.js +4 -0
  65. package/dist/chunks/studio-4hp8pkyt.js +5 -0
  66. package/dist/chunks/studio-58xg6j2q.js +9 -0
  67. package/dist/chunks/studio-5g0rprdt.js +7 -0
  68. package/dist/chunks/{studio-2j1cb95x.js → studio-6m380wp7.js} +4 -4
  69. package/dist/chunks/studio-80jyh1xh.js +4 -0
  70. package/dist/chunks/studio-83mk4bgg.js +9 -0
  71. package/dist/chunks/{studio-v0jzqdjm.js → studio-881z1xrx.js} +4 -4
  72. package/dist/chunks/studio-8m0y2qe7.js +5 -0
  73. package/dist/chunks/{studio-d81xfh1g.js → studio-8tr6cfrc.js} +4 -4
  74. package/dist/chunks/studio-8vcvfs7r.js +6 -0
  75. package/dist/chunks/studio-9tmebf0s.js +5 -0
  76. package/dist/chunks/studio-a2bvaptz.js +5 -0
  77. package/dist/chunks/studio-b7y5mr30.js +5 -0
  78. package/dist/chunks/studio-bavb31r0.js +5 -0
  79. package/dist/chunks/{studio-dgz8d0c1.js → studio-bbe4c90a.js} +4 -4
  80. package/dist/chunks/studio-c05wdnt3.js +5 -0
  81. package/dist/chunks/studio-ccv2svc6.js +5 -0
  82. package/dist/chunks/studio-d5grtb9e.js +16 -0
  83. package/dist/chunks/studio-df0baea9.js +5 -0
  84. package/dist/chunks/studio-dgk4dqtx.js +7 -0
  85. package/dist/chunks/studio-e1g64q43.js +5 -0
  86. package/dist/chunks/studio-ed1hp6zf.js +6 -0
  87. package/dist/chunks/studio-ed3xx40h.js +7 -0
  88. package/dist/chunks/studio-f14e1zdj.js +5 -0
  89. package/dist/chunks/studio-fbhxxc5f.js +5 -0
  90. package/dist/chunks/studio-fyh0jc96.js +5 -0
  91. package/dist/chunks/studio-gcxk20n7.js +5 -0
  92. package/dist/chunks/studio-jaaz8ce9.js +5 -0
  93. package/dist/chunks/{studio-90pq9km1.js → studio-jcnsdaep.js} +4 -4
  94. package/dist/chunks/studio-jsgf2q5k.js +7 -0
  95. package/dist/chunks/{studio-0q988f9w.js → studio-k3xxbagr.js} +3 -3
  96. package/dist/chunks/{studio-5ve6bbep.js → studio-k7evxqh4.js} +4 -4
  97. package/dist/chunks/studio-kt3pjkwd.js +5 -0
  98. package/dist/chunks/studio-m8g16bgz.js +5 -0
  99. package/dist/chunks/studio-mn0476ag.js +5 -0
  100. package/dist/chunks/studio-mx1smyq0.js +5 -0
  101. package/dist/chunks/studio-n0c5h6mf.js +5 -0
  102. package/dist/chunks/{studio-485046te.js → studio-nh6d342n.js} +7 -7
  103. package/dist/chunks/studio-nqxqf8p2.js +4 -0
  104. package/dist/chunks/studio-p4nrkvqr.js +5 -0
  105. package/dist/chunks/{studio-1fxkaaea.js → studio-pbxa5fpc.js} +4 -4
  106. package/dist/chunks/studio-pgmvdv7z.js +7 -0
  107. package/dist/chunks/studio-ph84avkf.js +5 -0
  108. package/dist/chunks/{studio-tq0rtfwj.js → studio-q0mvbaq6.js} +4 -4
  109. package/dist/chunks/studio-q0tccd43.js +5 -0
  110. package/dist/chunks/studio-q7rtx6zq.js +14 -0
  111. package/dist/chunks/{studio-a3g98wjr.js → studio-qgh13jtz.js} +4 -4
  112. package/dist/chunks/studio-qmn1xc24.js +5 -0
  113. package/dist/chunks/studio-qwdqwkj0.js +5 -0
  114. package/dist/chunks/studio-r5qy30vx.js +5 -0
  115. package/dist/chunks/studio-rj9eamf8.js +5 -0
  116. package/dist/chunks/studio-rptgsk96.js +5 -0
  117. package/dist/chunks/studio-rthyg42z.js +928 -0
  118. package/dist/chunks/studio-s19tp1xr.js +5 -0
  119. package/dist/chunks/studio-s32578pn.js +5 -0
  120. package/dist/chunks/studio-svb7yyve.js +5 -0
  121. package/dist/chunks/studio-syreb644.js +5 -0
  122. package/dist/chunks/studio-tf9jryb1.js +10 -0
  123. package/dist/chunks/studio-tfkznv39.js +5 -0
  124. package/dist/chunks/studio-tft6r105.js +5 -0
  125. package/dist/chunks/studio-txf2kysx.js +5 -0
  126. package/dist/chunks/studio-v8867ddv.js +12 -0
  127. package/dist/chunks/studio-vxq7fcvv.js +5 -0
  128. package/dist/chunks/studio-w4rz9hdk.js +5 -0
  129. package/dist/chunks/studio-wbcjbhy1.js +9 -0
  130. package/dist/chunks/studio-wc649wss.js +5 -0
  131. package/dist/chunks/studio-wys23mxz.js +5 -0
  132. package/dist/chunks/studio-x1x167jh.js +5 -0
  133. package/dist/chunks/studio-x9hsze61.js +5 -0
  134. package/dist/chunks/studio-y0n7yxea.js +9 -0
  135. package/dist/chunks/studio-y3ahhdpx.js +5 -0
  136. package/dist/chunks/studio-z97c48fk.js +5 -0
  137. package/dist/chunks/studio-zat62m0c.js +5 -0
  138. package/dist/chunks/studio-zcd2e7yz.js +5 -0
  139. package/dist/chunks/studio-zz9qe3rw.js +64 -0
  140. package/dist/chunks/toast-1gv0h53h.js +4 -0
  141. package/dist/chunks/{toast-host-ke5z4ng7.js → toast-host-1yg5ar8d.js} +3 -3
  142. package/dist/chunks/{tooltip-5v8ngwj2.js → tooltip-yypz28gq.js} +3 -3
  143. package/dist/chunks/{tree-mdq3v5cw.js → tree-9xa4hm7n.js} +2 -2
  144. package/dist/chunks/tsMode-epyfz1hv.js +14 -0
  145. package/dist/chunks/workspace-dz7nxfhv.js +4 -0
  146. package/dist/chunks/workspace-home-xsd7hkjw.js +4 -0
  147. package/dist/chunks/{ws-client-nze0k6mv.js → ws-client-bv552sfx.js} +3 -3
  148. package/dist/iframe-entry.js +20 -16
  149. package/dist/manifest.json +77 -63
  150. package/dist/studio.js +103 -104
  151. package/dist/workers/ts.worker.js +3 -3
  152. package/package.json +12 -11
  153. package/src/browse/component-examples.ts +272 -0
  154. package/src/browse/library-commands.ts +64 -104
  155. package/src/browse/library-layouts.ts +263 -49
  156. package/src/browse/library-model.ts +181 -133
  157. package/src/browse/library-pane.ts +738 -446
  158. package/src/browse/library-preview.ts +149 -19
  159. package/src/browse/library-source.ts +308 -41
  160. package/src/browse/preview-root.ts +78 -0
  161. package/src/browse/preview-style.ts +155 -0
  162. package/src/canvas/asset-refs.ts +16 -1
  163. package/src/canvas/canvas-live-render.ts +222 -30
  164. package/src/canvas/canvas-origin.ts +37 -12
  165. package/src/canvas/canvas-page-context.ts +112 -0
  166. package/src/canvas/canvas-render.ts +113 -107
  167. package/src/canvas/canvas-utils.ts +57 -12
  168. package/src/canvas/iframe-drop.ts +107 -0
  169. package/src/canvas/iframe-entry.ts +24 -12
  170. package/src/canvas/iframe-host.ts +134 -62
  171. package/src/canvas/iframe-keys.ts +11 -0
  172. package/src/canvas/iframe-patch.ts +8 -7
  173. package/src/canvas/iframe-protocol.ts +24 -5
  174. package/src/canvas/iframe-render.ts +48 -1
  175. package/src/canvas/iframe-subtree.ts +5 -2
  176. package/src/canvas/npm-modules.ts +22 -0
  177. package/src/canvas/preview-navigate.ts +16 -0
  178. package/src/canvas/repeater-sources.ts +200 -0
  179. package/src/canvas/stage-scrollbar.ts +5 -1
  180. package/src/canvas/surface-registry.ts +6 -0
  181. package/src/commands/app-commands.ts +16 -6
  182. package/src/commands/budget.ts +10 -8
  183. package/src/commands/context.ts +35 -10
  184. package/src/commands/defaults.ts +69 -45
  185. package/src/commands/keymap.ts +9 -0
  186. package/src/commands/levels.ts +11 -5
  187. package/src/commands/live-context.ts +2 -0
  188. package/src/commands/registry.ts +10 -1
  189. package/src/content/collection-match.ts +6 -5
  190. package/src/content/collection-pages.ts +412 -0
  191. package/src/content/content-collections.ts +270 -0
  192. package/src/content/entry-commands.ts +51 -60
  193. package/src/content/entry-editor.ts +111 -18
  194. package/src/content/entry-fields.ts +13 -1
  195. package/src/content/entry-inspector.ts +225 -0
  196. package/src/content/entry-model.ts +17 -3
  197. package/src/content/entry-open.ts +80 -0
  198. package/src/content/entry-summaries.ts +440 -0
  199. package/src/content/file-record-ids.ts +80 -0
  200. package/src/content/file-records.ts +125 -0
  201. package/src/content/page-summaries.ts +129 -0
  202. package/src/content/record-entry.ts +201 -0
  203. package/src/content/writing-banner.ts +177 -0
  204. package/src/create/add-new-commands.ts +185 -0
  205. package/src/create/add-new-flow.ts +1116 -0
  206. package/src/create/add-new.ts +1014 -0
  207. package/src/create/element-name.ts +121 -0
  208. package/src/editor/convert-to-component.ts +67 -43
  209. package/src/editor/file-drop-action.ts +9 -1
  210. package/src/editor/inline-edit-apply.ts +44 -0
  211. package/src/editor/inline-edit.ts +10 -0
  212. package/src/editor/insert-component.ts +91 -0
  213. package/src/editor/insert-zone-action.ts +13 -4
  214. package/src/editor/shortcuts.ts +44 -22
  215. package/src/editor/slash-menu.ts +51 -8
  216. package/src/files/components.ts +74 -10
  217. package/src/files/file-ops.ts +15 -5
  218. package/src/files/files.ts +164 -150
  219. package/src/files/fs-events.ts +18 -7
  220. package/src/files/media-meta.ts +95 -1
  221. package/src/files/media-types.ts +55 -0
  222. package/src/files/media-upload.ts +209 -52
  223. package/src/files/new-file-name.ts +156 -0
  224. package/src/files/serialize-document.ts +13 -3
  225. package/src/format/format-host.ts +15 -0
  226. package/src/github/github-auth.ts +2 -2
  227. package/src/github/github-publish.ts +4 -3
  228. package/src/grid/grid-controller.ts +5 -1
  229. package/src/grid/grid-open.ts +0 -27
  230. package/src/grid/grid-panel.ts +54 -2
  231. package/src/grid/grid-reveal.ts +34 -0
  232. package/src/grid/grid-source.ts +3 -25
  233. package/src/grid/grid-view.ts +31 -6
  234. package/src/grid/sources/content-source.ts +75 -7
  235. package/src/grid/tabulator-tables.d.ts +6 -0
  236. package/src/hosting/document.ts +2 -2
  237. package/src/i18n/i18n-commands.ts +2 -1
  238. package/src/media/media-commands.ts +181 -0
  239. package/src/media/media-library-model.ts +232 -0
  240. package/src/media/media-library.ts +1283 -0
  241. package/src/media/media-pane.ts +47 -19
  242. package/src/packages/pull-package-sync.ts +1 -1
  243. package/src/panels/activity-panel.ts +21 -5
  244. package/src/panels/ai-chat/chat-markdown.ts +8 -8
  245. package/src/panels/block-action-bar.ts +11 -11
  246. package/src/panels/canvas-dnd-bridge.ts +5 -2
  247. package/src/panels/chat-panel.ts +6 -6
  248. package/src/panels/collections-panel.ts +306 -0
  249. package/src/panels/component-preview.ts +35 -13
  250. package/src/panels/data-explorer.ts +1 -1
  251. package/src/panels/data-grid.ts +4 -0
  252. package/src/panels/dnd.ts +17 -30
  253. package/src/panels/elements-panel.ts +9 -2
  254. package/src/panels/empty-state.ts +2 -2
  255. package/src/panels/formula-workspace.ts +2 -3
  256. package/src/panels/frontmatter-fields.ts +9 -9
  257. package/src/panels/git-diff-open.ts +9 -5
  258. package/src/panels/head-panel.ts +369 -103
  259. package/src/panels/i18n-panel.ts +11 -10
  260. package/src/panels/imports-panel.ts +2 -0
  261. package/src/panels/jump-bar.ts +27 -2
  262. package/src/panels/layers-panel.ts +36 -30
  263. package/src/panels/left-panel.ts +22 -8
  264. package/src/panels/navigator-panels.ts +23 -11
  265. package/src/panels/pane-context.ts +111 -29
  266. package/src/panels/pane-grid.ts +6 -6
  267. package/src/panels/panel-registry.ts +14 -9
  268. package/src/panels/properties-panel.ts +7 -3
  269. package/src/panels/right-panel.ts +199 -43
  270. package/src/panels/seo-modal.ts +41 -108
  271. package/src/panels/settings-menu.ts +52 -50
  272. package/src/panels/settings-pane.ts +268 -162
  273. package/src/panels/signals-panel.ts +3 -4
  274. package/src/panels/site-model.ts +367 -0
  275. package/src/panels/site-panel.ts +638 -0
  276. package/src/panels/style-panel.ts +37 -3
  277. package/src/panels/stylebook-doc.ts +142 -10
  278. package/src/panels/stylebook-layers-panel.ts +39 -80
  279. package/src/panels/stylebook-panel.ts +47 -10
  280. package/src/panels/styles-panel.ts +327 -0
  281. package/src/panels/tab-strip.ts +109 -25
  282. package/src/platform.ts +1 -1
  283. package/src/platforms/cloud.ts +28 -1
  284. package/src/platforms/default-platform.ts +4 -4
  285. package/src/platforms/devserver.ts +51 -25
  286. package/src/publish/deploy-checklist.ts +12 -7
  287. package/src/publish/pages-service.ts +38 -14
  288. package/src/publish/publish-changes.ts +491 -0
  289. package/src/publish/publish-commands.ts +83 -18
  290. package/src/publish/publish-ids.ts +49 -0
  291. package/src/publish/publish-quick.ts +148 -0
  292. package/src/publish/publish-workspace.ts +926 -0
  293. package/src/publish/source-control.ts +907 -0
  294. package/src/services/automation.ts +16 -20
  295. package/src/services/cf-settings.ts +4 -4
  296. package/src/services/connection.ts +2 -2
  297. package/src/services/directory-picker.ts +2 -2
  298. package/src/services/references.ts +0 -0
  299. package/src/services/render-critic.ts +21 -2
  300. package/src/services/settings/definitions.ts +25 -14
  301. package/src/settings/contributed-section.ts +49 -10
  302. package/src/settings/css-vars-editor.ts +93 -27
  303. package/src/settings/developer-panels.ts +43 -0
  304. package/src/settings/extension-sections.ts +20 -2
  305. package/src/settings/general-settings.ts +91 -21
  306. package/src/settings/preferences-dialog.ts +8 -1
  307. package/src/settings/project-sections.ts +27 -10
  308. package/src/settings/schema-field-ui.ts +3 -1
  309. package/src/settings/section-registry.ts +116 -11
  310. package/src/settings/settings-dialog.ts +192 -0
  311. package/src/settings/settings-document.ts +182 -162
  312. package/src/shell.ts +467 -431
  313. package/src/site-context.ts +64 -10
  314. package/src/state.ts +28 -9
  315. package/src/studio.ts +194 -41
  316. package/src/style/project-styles.ts +34 -0
  317. package/src/style/stylebook-specimens.ts +89 -0
  318. package/src/style/stylebook-target.ts +26 -0
  319. package/src/style/tag-inheritance.ts +105 -0
  320. package/src/style/variables-focus.ts +61 -0
  321. package/src/style/variables-view.ts +235 -0
  322. package/src/surfaces/add-new.json +1482 -0
  323. package/src/surfaces/add-new.ts +325 -0
  324. package/src/surfaces/ai-chat.ts +2 -2
  325. package/src/surfaces/boot-failure.json +4 -3
  326. package/src/surfaces/bottom-dock.json +1 -1
  327. package/src/surfaces/canvas-stage.json +30 -19
  328. package/src/surfaces/canvas-stage.ts +5 -5
  329. package/src/surfaces/collections-panel.json +615 -0
  330. package/src/surfaces/collections-panel.ts +168 -0
  331. package/src/surfaces/commandbar.json +241 -96
  332. package/src/surfaces/commandbar.ts +134 -99
  333. package/src/surfaces/empty-state.json +1 -1
  334. package/src/surfaces/entry-editor.json +136 -0
  335. package/src/surfaces/entry-editor.ts +21 -0
  336. package/src/surfaces/entry-inspector.json +371 -0
  337. package/src/surfaces/entry-inspector.ts +143 -0
  338. package/src/surfaces/inspector-dock.json +162 -14
  339. package/src/surfaces/inspector-dock.ts +46 -19
  340. package/src/surfaces/library-pane.json +670 -437
  341. package/src/surfaces/library-pane.ts +94 -59
  342. package/src/surfaces/media-browser.json +62 -6
  343. package/src/surfaces/media-browser.ts +15 -1
  344. package/src/surfaces/media-field.json +1 -1
  345. package/src/surfaces/media-library.json +1586 -0
  346. package/src/surfaces/media-library.ts +282 -0
  347. package/src/surfaces/media-pick-dialog.json +71 -0
  348. package/src/surfaces/media-pick-dialog.ts +132 -0
  349. package/src/surfaces/menu.ts +18 -0
  350. package/src/surfaces/pane-context.json +144 -77
  351. package/src/surfaces/pane-context.ts +24 -0
  352. package/src/surfaces/panel-deploy-checklist.json +12 -6
  353. package/src/surfaces/panel-deploy-checklist.ts +3 -1
  354. package/src/surfaces/panel-page.json +72 -2
  355. package/src/surfaces/panel-page.ts +38 -7
  356. package/src/surfaces/panel-signals.json +1 -1
  357. package/src/surfaces/panel-signals.ts +5 -5
  358. package/src/surfaces/panel-stylebook-layers.json +71 -204
  359. package/src/surfaces/panel-stylebook-layers.ts +0 -21
  360. package/src/surfaces/preferences.json +120 -48
  361. package/src/surfaces/preferences.ts +8 -0
  362. package/src/surfaces/publish-quick.json +428 -0
  363. package/src/surfaces/publish-quick.ts +165 -0
  364. package/src/surfaces/publish-workspace.json +2892 -0
  365. package/src/surfaces/publish-workspace.ts +391 -0
  366. package/src/surfaces/rail.json +1 -159
  367. package/src/surfaces/rail.ts +18 -75
  368. package/src/surfaces/schema-form.json +10 -2
  369. package/src/surfaces/schema-form.ts +2 -0
  370. package/src/surfaces/seo.json +1 -1
  371. package/src/surfaces/settings-contributed.json +5 -5
  372. package/src/surfaces/settings-contributed.ts +18 -2
  373. package/src/surfaces/settings-css-vars.json +44 -36
  374. package/src/surfaces/settings-css-vars.ts +77 -4
  375. package/src/surfaces/settings-deploy.json +2 -15
  376. package/src/surfaces/settings-deploy.ts +1 -1
  377. package/src/surfaces/settings-dialog.json +51 -0
  378. package/src/surfaces/settings-dialog.ts +169 -0
  379. package/src/surfaces/settings-overview.json +3 -3
  380. package/src/surfaces/settings-overview.ts +9 -2
  381. package/src/surfaces/settings-pane.json +269 -46
  382. package/src/surfaces/settings-pane.ts +85 -24
  383. package/src/surfaces/shell.json +2 -1
  384. package/src/surfaces/site-panel.json +1029 -0
  385. package/src/surfaces/site-panel.ts +233 -0
  386. package/src/surfaces/slash-menu.json +63 -21
  387. package/src/surfaces/slash-menu.ts +23 -0
  388. package/src/surfaces/statusbar.ts +39 -15
  389. package/src/surfaces/styles-panel.json +735 -0
  390. package/src/surfaces/styles-panel.ts +195 -0
  391. package/src/surfaces/styles-variables.json +149 -0
  392. package/src/surfaces/styles-variables.ts +145 -0
  393. package/src/surfaces/tab-strip.json +4 -4
  394. package/src/surfaces/welcome.ts +1 -1
  395. package/src/surfaces/writing-banner.json +94 -0
  396. package/src/surfaces/writing-banner.ts +80 -0
  397. package/src/tabs/bare-repeaters.ts +101 -0
  398. package/src/tabs/tab.ts +47 -7
  399. package/src/types.ts +21 -26
  400. package/src/ui/form-controls.ts +47 -8
  401. package/src/ui/layers.ts +13 -0
  402. package/src/ui/media-picker.ts +284 -40
  403. package/src/ui/regions.ts +7 -6
  404. package/src/ui/schema-form.ts +259 -27
  405. package/src/ui/virtual-window.ts +26 -1
  406. package/src/utils/base64.ts +3 -3
  407. package/src/utils/edit-display.ts +322 -67
  408. package/src/utils/local-day.ts +18 -0
  409. package/src/workspace/pane-derive.ts +4 -4
  410. package/src/workspace/session.ts +28 -7
  411. package/src/workspace/tab-workspace.ts +137 -0
  412. package/src/workspace/workspace-back.ts +189 -0
  413. package/src/workspace/workspace-home.ts +133 -0
  414. package/src/workspace/workspace-ids.ts +129 -0
  415. package/src/workspace/workspace-switch.ts +372 -0
  416. package/src/workspace/workspace.ts +125 -11
  417. package/styles/shell-frame.css +30 -7
  418. package/styles/shell-frame.json +15 -3
  419. package/dist/chunks/2020-f2gkpy8d.js +0 -4
  420. package/dist/chunks/adapter-4912g339.js +0 -4
  421. package/dist/chunks/cf-account-picker-wccaenh6.js +0 -4
  422. package/dist/chunks/cf-settings-br6105tr.js +0 -4
  423. package/dist/chunks/color-28ksk2qm.js +0 -4
  424. package/dist/chunks/components-db68vsn7.js +0 -4
  425. package/dist/chunks/content-source-1449qesq.js +0 -4
  426. package/dist/chunks/convert-to-repeater-5h457egj.js +0 -4
  427. package/dist/chunks/editor-x9jn86a7.js +0 -4
  428. package/dist/chunks/entry-commands-may24cpt.js +0 -4
  429. package/dist/chunks/extension-sections-pvr14vxr.js +0 -4
  430. package/dist/chunks/file-ops-x9v54pcj.js +0 -4
  431. package/dist/chunks/files-j3knqf0s.js +0 -4
  432. package/dist/chunks/format-host-tyre2trb.js +0 -4
  433. package/dist/chunks/fs-events-64ma9htc.js +0 -4
  434. package/dist/chunks/git-panel-84ps5dex.js +0 -4
  435. package/dist/chunks/iframe-entry-fvbk89gm.js +0 -5
  436. package/dist/chunks/iframe-host-ck6vejt5.js +0 -4
  437. package/dist/chunks/index-b8xw3vy9.js +0 -4
  438. package/dist/chunks/jsonMode-w15cmrcm.js +0 -13
  439. package/dist/chunks/jx-validate-at3zn8wa.js +0 -4
  440. package/dist/chunks/layers-h4xp1pss.js +0 -4
  441. package/dist/chunks/layers-panel-m5hw1d7g.js +0 -4
  442. package/dist/chunks/lit-html-8t8t3dnr.js +0 -4
  443. package/dist/chunks/media-picker-2cweexc5.js +0 -4
  444. package/dist/chunks/menu-ynw13y0s.js +0 -4
  445. package/dist/chunks/monaco-buffer-qzxn567r.js +0 -4
  446. package/dist/chunks/monaco-setup-gxf6656g.js +0 -4
  447. package/dist/chunks/notify-cj5zbrs2.js +0 -4
  448. package/dist/chunks/parse-b7ddhr8m.js +0 -4
  449. package/dist/chunks/platform-3dfws9js.js +0 -4
  450. package/dist/chunks/popover-jt2gxmzs.js +0 -4
  451. package/dist/chunks/publish-panel-1gvxbj21.js +0 -4
  452. package/dist/chunks/quick-search-0dajrwqg.js +0 -4
  453. package/dist/chunks/references-49qgt404.js +0 -4
  454. package/dist/chunks/right-panel-jm1bwe53.js +0 -4
  455. package/dist/chunks/section-registry-6kwc4fky.js +0 -4
  456. package/dist/chunks/studio-0rt52vpq.js +0 -5
  457. package/dist/chunks/studio-18vgbhs5.js +0 -5
  458. package/dist/chunks/studio-24mccdrj.js +0 -5
  459. package/dist/chunks/studio-2eh507zk.js +0 -9
  460. package/dist/chunks/studio-2hcbccfv.js +0 -5
  461. package/dist/chunks/studio-2jbs3rxv.js +0 -5
  462. package/dist/chunks/studio-4h8k4dw9.js +0 -5
  463. package/dist/chunks/studio-5f6n18kx.js +0 -5
  464. package/dist/chunks/studio-5gthpky6.js +0 -5
  465. package/dist/chunks/studio-6ep3js6b.js +0 -9
  466. package/dist/chunks/studio-6wkmf3wz.js +0 -9
  467. package/dist/chunks/studio-841rf3cg.js +0 -5
  468. package/dist/chunks/studio-8gmwgheg.js +0 -5
  469. package/dist/chunks/studio-8qm0ep50.js +0 -5
  470. package/dist/chunks/studio-924p1tm1.js +0 -6
  471. package/dist/chunks/studio-a3shpz9y.js +0 -5
  472. package/dist/chunks/studio-amsbaaar.js +0 -6
  473. package/dist/chunks/studio-at5spjbc.js +0 -7
  474. package/dist/chunks/studio-b2xv945e.js +0 -5
  475. package/dist/chunks/studio-bn5nkafw.js +0 -5
  476. package/dist/chunks/studio-bw6q5xjf.js +0 -9
  477. package/dist/chunks/studio-c7q0t9x1.js +0 -5
  478. package/dist/chunks/studio-camnhc96.js +0 -6
  479. package/dist/chunks/studio-cffqvnzd.js +0 -5
  480. package/dist/chunks/studio-efvfrsf8.js +0 -5
  481. package/dist/chunks/studio-er30bpcx.js +0 -5
  482. package/dist/chunks/studio-ezscgr64.js +0 -5
  483. package/dist/chunks/studio-ffrrncvz.js +0 -5
  484. package/dist/chunks/studio-fpphgn8y.js +0 -10
  485. package/dist/chunks/studio-j1kvhdjk.js +0 -4
  486. package/dist/chunks/studio-j430n16g.js +0 -7
  487. package/dist/chunks/studio-jjkg84nj.js +0 -5
  488. package/dist/chunks/studio-m0q32ars.js +0 -4
  489. package/dist/chunks/studio-m6bdst11.js +0 -5
  490. package/dist/chunks/studio-nv2cptd4.js +0 -64
  491. package/dist/chunks/studio-nwfrc98n.js +0 -5
  492. package/dist/chunks/studio-p1wgvp7r.js +0 -5
  493. package/dist/chunks/studio-pag2wncm.js +0 -5
  494. package/dist/chunks/studio-qvanvzfd.js +0 -5
  495. package/dist/chunks/studio-qwa64kt7.js +0 -5
  496. package/dist/chunks/studio-rk1zc4x3.js +0 -928
  497. package/dist/chunks/studio-se2r3ptc.js +0 -5
  498. package/dist/chunks/studio-sg2a0dh0.js +0 -5
  499. package/dist/chunks/studio-tjzjhe68.js +0 -5
  500. package/dist/chunks/studio-v2w7q8r1.js +0 -7
  501. package/dist/chunks/studio-v5vjq1h0.js +0 -4
  502. package/dist/chunks/studio-v8aga3vp.js +0 -14
  503. package/dist/chunks/studio-vfcdrfmv.js +0 -5
  504. package/dist/chunks/studio-vmfkgdjf.js +0 -5
  505. package/dist/chunks/studio-wt1816jj.js +0 -5
  506. package/dist/chunks/studio-wz73q5kq.js +0 -4
  507. package/dist/chunks/studio-y04qtxvp.js +0 -7
  508. package/dist/chunks/studio-y21g8zzg.js +0 -5
  509. package/dist/chunks/studio-y64hrt8p.js +0 -12
  510. package/dist/chunks/studio-ynn90f58.js +0 -16
  511. package/dist/chunks/studio-yxz682sx.js +0 -5
  512. package/dist/chunks/studio-zp7snvkq.js +0 -5
  513. package/dist/chunks/studio-zq4z6tm6.js +0 -5
  514. package/dist/chunks/toast-c9fn075p.js +0 -4
  515. package/dist/chunks/tsMode-sf49ee9x.js +0 -14
  516. package/dist/chunks/workspace-jtfahpee.js +0 -4
  517. package/src/panels/frontmatter-panel.ts +0 -711
  518. package/src/panels/git-panel.ts +0 -1108
  519. package/src/surfaces/doc-header.json +0 -776
  520. package/src/surfaces/doc-header.ts +0 -222
  521. package/src/surfaces/git-panel.json +0 -1880
  522. package/src/surfaces/git-panel.ts +0 -264
@@ -1,7 +0,0 @@
1
- import{ae}from"./studio-v8aga3vp.js";import{f}from"./studio-ffrrncvz.js";import{Dp}from"./studio-p1wgvp7r.js";import{xe,oe,v,vg}from"./studio-wz73q5kq.js";import{I,A}from"./studio-2jbs3rxv.js";import{Yi,x}from"./studio-ynn90f58.js";import{O}from"./studio-c7q0t9x1.js";import{te}from"./studio-cffqvnzd.js";function D(e){return JSON.parse(e)}function j(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function k(e){try{let t=D(e);return j(t)?t:void 0}catch{return}}function C({slug:e,adapter:t}){let o=new Date().toISOString().slice(0,10);return`${JSON.stringify(t==="cloudflare-workers"?{assets:{binding:"ASSETS",directory:"./dist"},compatibility_date:o,compatibility_flags:["nodejs_compat"],main:"./dist/worker.js",name:e}:{compatibility_date:o,compatibility_flags:["nodejs_compat"],name:e,pages_build_output_dir:"./dist"},null,"\t")}
2
- `}function u(e,{slug:t,adapter:o}){if(!e)return{content:C({adapter:o,slug:t}),patched:!0};let n=k(e);if(n===void 0)return{content:e,patched:!1};if(n.name=t,o==="cloudflare-workers")delete n.pages_build_output_dir,n.main="./dist/worker.js",n.assets={binding:"ASSETS",directory:"./dist"};else delete n.main,delete n.assets,n.pages_build_output_dir="./dist";return{content:`${JSON.stringify(n,null,"\t")}
3
- `,patched:!0}}function Ad(){try{return te(f().cfApi)}catch{return!1}}async function l(e,t){let o=f().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw Dp(n),n}}async function AT(){return l("/accounts")}async function P(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function N(e){let t={build_command:"bunx jx build",destination_dir:"dist"};if(e.rootDir)t.root_dir=e.rootDir;return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:t,source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}async function Lm(e){let t=await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`),[o]=t;if(!o)return null;return{id:o.id,url:o.url,environment:o.environment,stage:o.latest_stage?.name??"unknown",status:o.latest_stage?.status??"unknown",createdOn:o.created_on}}async function fC(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await Yi({build:o}),t!==null){let n=f(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let b=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:w,patched:S}=u(i,{adapter:b,slug:t.projectName});if(S)await n.writeFile("wrangler.jsonc",w)}}async function PT(e,t){let n=await P(t.accountId,t.projectName)??await N(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName};if(n.subdomain)i.productionUrl=`https://${n.subdomain}`;return await fC(e,i),i}var m={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible without reading the row. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};I("panel-deploy-checklist",m);var d=null,c=null,a=null,r=null;function T(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function J(e){if(d!==e)return!1;return r===null?a!==null:r.root.parentNode===e}function h(e,t){if(J(e))return;p(),d=e;let o=v({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=xe(),c.run(()=>{oe(()=>{T(o,t.project())})});let n=A("panel-deploy-checklist",o,e);a=n,n.then((i)=>{if(a===n)r=i;else i.dispose()})}function p(){c?.stop(),c=null;let e=a;if(a=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function V(){return O?.projectConfig??null}function $a(){return V()?.build?.deploy}var s=vg({asked:!1,observed:null});function $p(e){s.observed=e,s.asked=!0}function W(){let{status:e}=x.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function E(){let{status:e}=x.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function L(){let e=$a();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return Ad()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function R(){if(!$a())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!s.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(s.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=s;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function y(){return[W(),E(),L(),R()]}function g(){return y().find((e)=>e.state!=="done")??null}function MT(){if(!O)return null;let e=g();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:$a()?.productionUrl??"Everything this project needs to ship is in place."}}var B={done:"✓",todo:"·",unknown:"?"};function H(e){return{icon:B[e.state],id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function F(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ae(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function M(){if(!O)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=y(),t=e.find((o)=>o.state!=="done")??null;return{...F(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>H(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function U(){let e=g();if(!e)return;ae()?.run(e.command)}var z={project:M,runAction:U};function FT(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){p();return}h(t,z)}
4
- export{Ad,AT,Lm,fC,PT,$a,$p,MT,FT};
5
-
6
- //# debugId=F42F3178F788720364756E2164756E21
7
- //# sourceMappingURL=studio-at5spjbc.js.map
@@ -1,5 +0,0 @@
1
- import{i}from"./studio-cffqvnzd.js";function r(t,n=[]){if(t?.tagName==="slot"){let e=t.attributes?.name;n.push(i(e)?e.trim():"")}if(Array.isArray(t?.children))for(let e of t.children)r(i(e)?void 0:e,n);return n}function ny(t){let n=r(t),e=n.filter((s)=>s==="").length;if(e>1)return`Component has ${e} unnamed <slot> elements — only one default slot is allowed. Give extra slots a name attribute.`;let a=new Set;for(let s of n){if(s&&a.has(s))return`Duplicate slot name "${s}" — slot names must be unique within a component.`;a.add(s)}return null}
2
- export{ny};
3
-
4
- //# debugId=4E412F973445861F64756E2164756E21
5
- //# sourceMappingURL=studio-b2xv945e.js.map
@@ -1,5 +0,0 @@
1
- import{Me}from"./studio-m6bdst11.js";import{te}from"./studio-cffqvnzd.js";var f=3;function p(e,t,n){return Math.min(n,Math.max(t,e))}function Yw(e){let t=Math.max(0,Math.trunc(e.count)),n=Math.max(1,Math.trunc(e.columns??1)),o=Math.ceil(t/n);if(!(e.rowHeight>0)||!(e.viewportHeight>0))return{end:t,padBottom:0,padTop:0,start:0,totalRows:o};let r=Math.max(0,Math.trunc(e.overscanRows??f)),i=Math.max(0,e.scrollTop),m=Math.floor(i/e.rowHeight),w=Math.ceil(e.viewportHeight/e.rowHeight)+1,l=p(m-r,0,o),a=p(m+w+r,l,o);return{end:Math.min(t,a*n),padBottom:(o-a)*e.rowHeight,padTop:l*e.rowHeight,start:Math.min(t,l*n),totalRows:o}}function M(e,t){return e.start===t.start&&e.end===t.end&&e.totalRows===t.totalRows&&e.padTop===t.padTop&&e.padBottom===t.padBottom}function v(e){let{scroller:t,list:n,count:o,rowHeight:r,columns:i,onChange:m,overscanRows:w}=e,l={end:0,padBottom:0,padTop:0,start:0,totalRows:0},a=!1;function c(){if(a)return;let d=Yw({columns:i?.()??1,count:o(),overscanRows:w??f,rowHeight:r(),scrollTop:n?H(t,n):t.scrollTop,viewportHeight:t.clientHeight}),T=!M(l,d);if(l=d,T)m(d)}t.addEventListener("scroll",c,{passive:!0});let u=0,b=()=>{if(u!==0)return;u=requestAnimationFrame(()=>{u=0,c()})},s=null;if(te(globalThis.ResizeObserver)){if(s=new ResizeObserver(b),s.observe(t),n)s.observe(n)}return c(),{destroy(){if(a=!0,t.removeEventListener("scroll",c),s?.disconnect(),s=null,u!==0)cancelAnimationFrame(u),u=0},measure:c,range:()=>l}}function R(e){for(let t=e;t;t=t.parentElement){if(t.scrollHeight<=t.clientHeight)continue;let n=getComputedStyle(t).overflowY;if(n==="auto"||n==="scroll"||n==="overlay")return t}return null}function g(e){let t=h.get(e);if(t&&t.isConnected&&e.isConnected&&t.contains(e))return t;let n=R(e);if(n)h.set(e,n);else h.delete(e);return n}function H(e,t){if(e===t)return Math.max(0,e.scrollTop);return Math.max(0,Me(e).top-Me(t).top)}function Ab(e,t){let n=e?.isConnected===!0?g(e):null;if(!n||!e){let o=Math.max(0,Math.trunc(t.count));return{end:o,padBottom:0,padTop:0,start:0,totalRows:o}}return Yw({columns:t.columns??1,count:t.count,overscanRows:t.overscanRows??f,rowHeight:t.rowHeight,scrollTop:H(n,e),viewportHeight:n.clientHeight})}function x(e){let t=e.listOffset+e.index*e.rowHeight,n=t+e.rowHeight;if(t<e.scrollTop)return Math.max(0,t);if(n>e.scrollTop+e.viewportHeight)return Math.max(0,n-e.viewportHeight);return null}function Pb(e,t,n){let o=e?.isConnected===!0?g(e):null;if(!o||!e||t<0||!(n>0))return!1;let{scrollTop:r}=o,i=x({index:t,listOffset:r-H(o,e),rowHeight:n,scrollTop:r,viewportHeight:o.clientHeight});if(i===null)return!1;return o.scrollTop=i,!0}function JE(e,t,n){let o=e?.querySelector(t);return o&&o.offsetHeight>0?o.offsetHeight:n}var h=new WeakMap;function Mb(e,t,n){let o=g(t);if(e&&e.list===t&&e.scroller===o)return e;if(e?.window.destroy(),!o)return null;return{list:t,scroller:o,window:v({count:n.count,list:t,onChange:()=>n.onChange(),rowHeight:n.rowHeight,scroller:o})}}
2
- export{Yw,Ab,Pb,JE,Mb};
3
-
4
- //# debugId=0C757B4C21B6690964756E2164756E21
5
- //# sourceMappingURL=studio-bn5nkafw.js.map
@@ -1,9 +0,0 @@
1
- import{i,T}from"./studio-cffqvnzd.js";var U=()=>new Map,ue=(t)=>{let e=U();return t.forEach((n,r)=>{e.set(r,n)}),e},j=(t,e,n)=>{let r=t.get(e);if(r===void 0)t.set(e,r=n());return r},fr=(t,e)=>{let n=[];for(let[r,s]of t)n.push(e(s,r));return n},pr=(t,e)=>{for(let[n,r]of t)if(e(r,n))return!0;return!1};var G=()=>new Set;var de=(t)=>t[t.length-1];var gr=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},q=Array.from,fe=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},Vt=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1};var mr=(t,e)=>{let n=Array(t);for(let r=0;r<t;r++)n[r]=e(r,n);return n};var Z=Array.isArray;class pe{constructor(){this._observers=U()}on(t,e){return j(this._observers,t,G).add(e),e}once(t,e){let n=(...r)=>{this.off(t,n),e(...r)};this.on(t,n)}off(t,e){let n=this._observers.get(t);if(n!==void 0){if(n.delete(e),n.size===0)this._observers.delete(t)}}emit(t,e){return q((this._observers.get(t)||U()).values()).forEach((n)=>n(...e))}destroy(){this._observers=U()}}class X0{constructor(){this._observers=U()}on(t,e){j(this._observers,t,G).add(e)}once(t,e){let n=(...r)=>{this.off(t,n),e(...r)};this.on(t,n)}off(t,e){let n=this._observers.get(t);if(n!==void 0){if(n.delete(e),n.size===0)this._observers.delete(t)}}emit(t,e){return q((this._observers.get(t)||U()).values()).forEach((n)=>n(...e))}destroy(){this._observers=U()}}var jo=Math.floor;var nt=Math.abs;var ge=(t,e)=>t<e?t:e,X=(t,e)=>t>e?t:e;var me=(t)=>t!==0?t<0:1/t<0;var ln=1,an=2,we=4,xe=8;var dt=32,F=64,D=128;var Ft=31,jt=63,Q=127;var wr=2147483647;var{MAX_SAFE_INTEGER:ft,MIN_SAFE_INTEGER:un}=Number;var xr=Number.isInteger||((t)=>typeof t==="number"&&isFinite(t)&&jo(t)===t);var{fromCharCode:fn,fromCodePoint:xi}=String,Yc=fn(65535),yi=(t)=>t.toLowerCase(),bi=/^\s*/g,ki=(t)=>t.replace(bi,""),_i=/([A-Z])/g,pn=(t,e)=>ki(t.replace(_i,(n)=>`${e}${yi(n)}`));var Si=(t)=>{let e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let s=0;s<n;s++)r[s]=e.codePointAt(s);return r},gt=typeof TextEncoder<"u"?new TextEncoder:null,Ei=(t)=>gt.encode(t),yr=gt?Ei:Si;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)=>mr(e,()=>t).join("");class wt{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}var _a=()=>new wt;var Q0=(t)=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e};var no=(t)=>{let e=new Uint8Array(Q0(t)),n=0;for(let r=0;r<t.bufs.length;r++){let s=t.bufs[r];e.set(s,n),n+=s.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},Ii=(t,e)=>{let n=t.cbuf.length;if(n-t.cpos<e)t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(X(n,e)*2),t.cpos=0},A=(t,e)=>{let n=t.cbuf.length;if(t.cpos===n)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0;t.cbuf[t.cpos++]=e};var be=A;var vt=(t,e)=>{while(e>Q)A(t,D|Q&e),e=jo(e/128);A(t,Q&e)},ke=(t,e)=>{let n=me(e);if(n)e=-e;A(t,(e>jt?D:0)|(n?F:0)|jt&e),e=jo(e/64);while(e>0)A(t,(e>Q?D:0)|Q&e),e=jo(e/128)},gn=new Uint8Array(30000),Ui=gn.length/3,Ti=(t,e)=>{if(e.length<Ui){let n=gt.encodeInto(e,gn).written||0;vt(t,n);for(let r=0;r<n;r++)A(t,gn[r])}else Tr(t,yr(e))},Ai=(t,e)=>{let n=unescape(encodeURIComponent(e)),r=n.length;vt(t,r);for(let s=0;s<r;s++)A(t,n.codePointAt(s))},Sa=gt&&gt.encodeInto?Ti:Ai;var qt=(t,e)=>{let n=t.cbuf.length,r=t.cpos,s=ge(n-r,e.length),o=e.length-s;if(t.cbuf.set(e.subarray(0,s),r),t.cpos+=s,o>0)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(X(n*2,o)),t.cbuf.set(e.subarray(s)),t.cpos=o},Tr=(t,e)=>{vt(t,e.byteLength),qt(t,e)},mn=(t,e)=>{Ii(t,e);let n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},Ci=(t,e)=>mn(t,4).setFloat32(0,e,!1),Di=(t,e)=>mn(t,8).setFloat64(0,e,!1),Bi=(t,e)=>mn(t,8).setBigInt64(0,e,!1);var kr=new DataView(new ArrayBuffer(4)),Oi=(t)=>(kr.setFloat32(0,t),kr.getFloat32(0)===t),mt=(t,e)=>{switch(typeof e){case"string":A(t,119),Sa(t,e);break;case"number":if(xr(e)&&nt(e)<=wr)A(t,125),ke(t,e);else if(Oi(e))A(t,124),Ci(t,e);else A(t,123),Di(t,e);break;case"bigint":A(t,122),Bi(t,e);break;case"object":if(e===null)A(t,126);else if(Z(e)){A(t,117),vt(t,e.length);for(let n=0;n<e.length;n++)mt(t,e[n])}else if(e instanceof Uint8Array)A(t,116),Tr(t,e);else{A(t,118);let n=Object.keys(e);vt(t,n.length);for(let r=0;r<n.length;r++){let s=n[r];Sa(t,s),mt(t,e[s])}}break;case"boolean":A(t,e?120:121);break;default:A(t,127)}};class _e 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)vt(this,this.count-1);this.count=1,this.w(this,t),this.s=t}}}var _r=(t)=>{if(t.count>0){if(ke(t.encoder,t.count===1?t.s:-t.s),t.count>1)vt(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),no(this.encoder)}}var Sr=(t)=>{if(t.count>0){let e=t.diff*2+(t.count===1?0:1);if(ke(t.encoder,e),t.count>1)vt(t.encoder,t.count-2)}};class Gt{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),no(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="",Sa(t,this.sarr.join("")),qt(t,this.lensE.toUint8Array()),no(t)}}var R=(t)=>Error(t),L=()=>{throw R("Method unimplemented")},v=()=>{throw R("Unexpected case")};var Se=R("Unexpected end of array"),Ir=R("Integer out of Range"),vi=(t,e,n)=>{if(e<0||n<0||e+n>t.length)throw Se;return new Uint8Array(t.buffer,t.byteOffset+e,n)},Ni=(t,e,n)=>{if(e<0||n<0||e+n>t.length)throw Se;return new DataView(t.buffer,t.byteOffset+e,n)};class zt{constructor(t){this.arr=t,this.pos=0}}var Ca=(t)=>new zt(t),Ur=(t)=>t.pos!==t.arr.length;var Ri=(t,e)=>{let n=vi(t.arr,t.pos,e);return t.pos+=e,n},Mr=(t)=>Ri(t,Rt(t));var rt=(t)=>t.arr[t.pos++];var Rt=(t)=>{let e=0,n=1,r=t.arr.length;while(t.pos<r){let s=t.arr[t.pos++];if(e=e+(s&Q)*n,n*=128,s<D)return e;if(e>ft)throw Ir}throw Se},Ee=(t)=>{let e=t.arr[t.pos++],n=e&jt,r=64,s=(e&F)>0?-1:1;if((e&D)===0)return s*n;let o=t.arr.length;while(t.pos<o){if(e=t.arr[t.pos++],n=n+(e&Q)*r,r*=128,e<D)return s*n;if(n>ft)throw Ir}throw Se};var Li=(t)=>{let e=Rt(t);if(e===0)return"";else{let n=String.fromCodePoint(rt(t));if(--e<100)while(e--)n+=String.fromCodePoint(rt(t));else while(e>0){let r=e<1e4?e:1e4,s=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,s),e-=r}return decodeURIComponent(escape(n))}},Vi=(t)=>pt.decode(Mr(t)),ka=pt?Vi:Li;var yn=(t,e)=>{let n=Ni(t.arr,t.pos,e);return t.pos+=e,n},Mi=(t)=>yn(t,4).getFloat32(0,!1),$i=(t)=>yn(t,8).getFloat64(0,!1),Fi=(t)=>yn(t,8).getBigInt64(0,!1);var ji=[(t)=>{return},(t)=>null,Ee,Mi,$i,Fi,(t)=>!1,(t)=>!0,ka,(t)=>{let e=Rt(t),n={};for(let r=0;r<e;r++){let s=ka(t);n[s]=yt(t)}return n},(t)=>{let e=Rt(t),n=[];for(let r=0;r<e;r++)n.push(yt(t));return n},Mr],yt=(t)=>ji[127-rt(t)](t);class Ie extends zt{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=Rt(this)+1;else this.count=-1;return this.count--,this.s}}class bt extends zt{constructor(t){super(t);this.s=0,this.count=0}read(){if(this.count===0){this.s=Ee(this);let t=me(this.s);if(this.count=1,t)this.s=-this.s,this.count=Rt(this)+2}return this.count--,this.s}}class Ht extends zt{constructor(t){super(t);this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let t=Ee(this),e=t&1;if(this.diff=jo(t/2),this.count=1,e)this.count=Rt(this)+2}return this.s+=this.diff,this.count--,this.s}}class bn{constructor(t){this.decoder=new bt(t),this.str=ka(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 nl=crypto.subtle,Cr=crypto.getRandomValues.bind(crypto);var kn=()=>Cr(new Uint32Array(1))[0];var qi=[1e7]+-1000+-4000+-8000+-100000000000,Dr=()=>qi.replace(/[018]/g,(t)=>(t^kn()&15>>t/4).toString(16));var yd=Date.now;var _n=(t)=>new Promise(t);var il=Promise.all.bind(Promise);var Sn=(t)=>t===void 0?null:t;class Or{constructor(){this.map=new Map}setItem(t,e){this.map.set(t,e)}getItem(t){return this.map.get(t)}}var vr=new Or,Ji=!0;try{if(typeof localStorage<"u"&&localStorage)vr=localStorage,Ji=!1}catch(t){}var Nr=vr;var st=Symbol("Equality"),Ue=(t,e)=>t===e||!!t?.[st]?.(e)||!1;var Rr=(t)=>typeof t==="object",{assign:Lr,keys:Ki}=Object;var Vr=(t,e)=>{for(let n in t)e(t[n],n)};var Jt=(t)=>Ki(t).length;var $r=(t)=>{for(let e in t)return!1;return!0},kt=(t,e)=>{for(let n in t)if(!e(t[n],n))return!1;return!0},Pt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),In=(t,e)=>t===e||Jt(t)===Jt(e)&&kt(t,(n,r)=>(n!==void 0||Pt(e,r))&&Ue(e[r],n)),Wi=Object.freeze,Un=(t)=>{for(let e in t){let n=t[e];if(typeof n==="object"||typeof n==="function")Un(t[e])}return Wi(t)};var Kt=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{if(n<t.length)Kt(t,e,n+1)}};var Fr=(t)=>t;var Fu=(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 n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(let n of t.keys())if(!e.has(n)||!Fu(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(Jt(t)!==Jt(e))return!1;for(let n in t)if(!Pt(t,n)||!Fu(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Fu(t[n],e[n]))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 ol=typeof navigator<"u"?/Mac/.test(navigator.platform):!1,z,Zi=[],Xi=()=>{if(z===void 0)if(Wt){z=U();let t=process.argv,e=null;for(let n=0;n<t.length;n++){let r=t[n];if(r[0]==="-"){if(e!==null)z.set(e,"");e=r}else if(e!==null)z.set(e,r),e=null;else Zi.push(r)}if(e!==null)z.set(e,"")}else if(typeof location==="object")z=U(),(location.search||"?").slice(1).split("&").forEach((t)=>{if(t.length!==0){let[e,n]=t.split("=");z.set(`--${pn(e,"-")}`,n),z.set(`-${pn(e,"-")}`,n)}});else z=U();return z},Cn=(t)=>Xi().has(t);var Zt=(t)=>Wt?Sn(process.env[t.toUpperCase().replaceAll("-","_")]):Sn(Nr.getItem(t));var qr=(t)=>Cn("--"+t)||Zt(t)!==null,Gr=qr("production"),Qi=Wt&&jr(process.env.FORCE_COLOR,["true","1","2"]),zr=Qi||!Cn("--no-colors")&&!qr("no-color")&&(!Wt||process.stdout.isTTY)&&(!Wt||Cn("--color")||Zt("COLORTERM")!==null||(Zt("TERM")||"").includes("color"));var Yi=(t)=>new Uint8Array(t);var Hr=(t)=>{let e=Yi(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,n)=>jo(t.next()*(n+1-e)+e);var On=(t,e,n)=>jo(t.next()*(n+1-e)+e);var vn=(t,e,n)=>On(t,e,n);var ro=(t)=>fn(vn(t,97,122)),Pr=(t,e=0,n=20)=>{let r=vn(t,e,n),s="";for(let o=0;o<r;o++)s+=ro(t);return s};var Ae=(t,e)=>e[vn(t,0,e.length-1)];var io=Symbol("0schema");class Wr{constructor(){this._rerrs=[]}extend(t,e,n,r=null){this._rerrs.push({path:t,expected:e,has:n,message:r})}toString(){let t=[];for(let e=this._rerrs.length-1;e>0;e--){let n=this._rerrs[e];t.push(br(" ",(this._rerrs.length-e)*2)+`${n.path!=null?`[${n.path}] `:""}${n.has} doesn't match ${n.expected}. ${n.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(Z(t))return fe(t,(n)=>Vt(e,(r)=>Nn(n,r)));else if(Rr(t))return kt(t,(n,r)=>Nn(n,e[r]));return!1};class B{static _dilutes=!1;extends(t){let[e,n]=[this.shape,t.shape];if(this.constructor._dilutes)[n,e]=[e,n];return Nn(e,n)}equals(t){return this.constructor===t.constructor&&Fu(this.shape,t.shape)}[io](){return!0}[st](t){return this.equals(t)}validate(t){return this.check(t)}check(t,e){L()}get nullable(){return It(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 n=t?.constructor===this.shape&&(this._c==null||this._c(t));return!n&&e?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),n}}var _=(t,e=null)=>new Be(t,e),ll=_(Be);class Oe extends B{constructor(t){super();this.shape=t}check(t,e){let n=this.shape(t);return!n&&e?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),n}}var S=(t)=>new Oe(t),al=_(Oe);class Qt extends B{constructor(t){super();this.shape=t}check(t,e){let n=this.shape.some((r)=>r===t);return!n&&e?.extend(null,this.shape.join(" | "),t.toString()),n}}var ve=(...t)=>new Qt(t),Zr=_(Qt),oo=RegExp.escape||((t)=>t.replace(/[().|&,$^[\]]/g,(e)=>"\\"+e)),Xr=(t)=>{if(Et.check(t))return[oo(t)];if(Zr.check(t))return t.shape.map((e)=>e+"");if(is.check(t))return["[+-]?\\d+.?\\d*"];if(os.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 n=this._r.exec(t)!=null;return!n&&e?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),n}}var hl=_(Qr),co=Symbol("optional");class Rn extends B{constructor(t){super();this.shape=t}check(t,e){let n=t===void 0||this.shape.check(t);return!n&&e?.extend(null,"undefined (optional)","()"),n}get[co](){return!0}}var lo=_(Rn);class Ln extends B{check(t,e){return e?.extend(null,"never",typeof t),!1}}var ul=new Ln,dl=_(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,(n,r)=>{let s=this._isPartial&&!Pt(t,r)||n.check(t[r],e);return!s&&e?.extend(r.toString(),n.toString(),typeof t[r],"Object property does not match"),s})}}var ao=(t)=>new Ne(t),ho=_(Ne),uo=S((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,(n,r)=>{let s=this.shape.keys.check(r,e);return!s&&e?.extend(r+"","Record",typeof t,s?"Key doesn't match schema":"Value doesn't match value"),s&&this.shape.values.check(n,e)})}}var Yr=(t,e)=>new Vn(t,e),fo=_(Vn);class Mn extends B{constructor(t){super();this.shape=t}check(t,e){return t!=null&&kt(this.shape,(n,r)=>{let s=n.check(t[r],e);return!s&&e?.extend(r.toString(),"Tuple",typeof n),s})}}var po=(...t)=>new Mn(t),fl=_(Mn);class $n extends B{constructor(t){super();this.shape=t.length===1?t[0]:new Re(t)}check(t,e){let n=Z(t)&&fe(t,(r)=>this.shape.check(r));return!n&&e?.extend(null,"Array",""),n}}var ts=(...t)=>new $n(t),go=_($n),mo=S((t)=>Z(t));class Fn extends B{constructor(t,e){super();this.shape=t,this._c=e}check(t,e){let n=t instanceof this.shape&&(this._c==null||this._c(t));return!n&&e?.extend(null,this.shape.name,t?.constructor.name),n}}var wo=(t,e=null)=>new Fn(t,e),pl=_(Fn),xo=wo(B);class es extends B{constructor(t){super();this.len=t.length-1,this.args=po(...t.slice(-1)),this.res=t[this.len]}check(t,e){let n=t.constructor===Function&&t.length<=this.len;return!n&&e?.extend(null,"function",typeof t),n}}var yo=_(es),bo=S((t)=>typeof t==="function");class ns extends B{constructor(t){super();this.shape=t}check(t,e){let n=fe(this.shape,(r)=>r.check(t,e));return!n&&e?.extend(null,"Intersectinon",typeof t),n}}var gl=_(ns,(t)=>t.shape.length>0);class Re extends B{static _dilutes=!0;constructor(t){super();this.shape=t}check(t,e){let n=Vt(this.shape,(r)=>r.check(t,e));return e?.extend(null,"Union",typeof t),n}}var It=(...t)=>t.findIndex((e)=>Ce.check(e))>=0?It(...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),rs=()=>!0,De=S(rs),ko=_(Oe,(t)=>t.shape===rs),jn=S((t)=>typeof t==="bigint"),_o=S((t)=>t===jn),ss=S((t)=>typeof t==="symbol"),ml=S((t)=>t===ss),St=S((t)=>typeof t==="number"),is=S((t)=>t===St),Et=S((t)=>typeof t==="string"),os=S((t)=>t===Et),Le=S((t)=>typeof t==="boolean"),So=S((t)=>t===Le),cs=ve(void 0),wl=_(Qt,(t)=>t.shape.length===1&&t.shape[0]===void 0),xl=ve(void 0);var Ve=ve(null),Eo=_(Qt,(t)=>t.shape.length===1&&t.shape[0]===null),yl=_(Uint8Array),bl=_(Be,(t)=>t.shape===Uint8Array),Io=It(St,Et,Ve,cs,jn,Le,ss),kl=(()=>{let t=ts(De),e=Yr(Et,De),n=It(St,Et,Ve,Le,t,e);return t.shape=n,e.shape.values=n,n})(),Xt=(t)=>{if(xo.check(t))return t;else if(uo.check(t)){let e={};for(let n in t)e[n]=Xt(t[n]);return ao(e)}else if(mo.check(t))return It(...t.map(Xt));else if(Io.check(t))return ve(t);else if(bo.check(t))return _(t);v()},Kr=Gr?()=>{}:(t,e)=>{let n=new Wr;if(!e.check(t,n))throw R(`Expected value to be of type ${e.constructor.name}.
3
- ${n.toString()}`)};class ls{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 n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(t))return r.h(t,e)}throw R("Unhandled pattern")}}}var Uo=(t)=>new ls(t),as=Uo(De).if(is,(t,e)=>Te(e,un,ft)).if(os,(t,e)=>Pr(e)).if(So,(t,e)=>Bn(e)).if(_o,(t,e)=>BigInt(Te(e,un,ft))).if(Ce,(t,e)=>_t(e,Ae(e,t.shape))).if(ho,(t,e)=>{let n={};for(let r in t.shape){let s=t.shape[r];if(lo.check(s)){if(Bn(e))continue;s=s.shape}n[r]=as(s,e)}return n}).if(go,(t,e)=>{let n=[],r=On(e,0,42);for(let s=0;s<r;s++)n.push(_t(e,t.shape));return n}).if(Zr,(t,e)=>Ae(e,t.shape)).if(Eo,(t,e)=>null).if(yo,(t,e)=>{let n=_t(e,t.res);return()=>n}).if(ko,(t,e)=>_t(e,Ae(e,[St,Et,Ve,cs,jn,Le,ts(St),Yr(It("a","b","c"),St)]))).if(fo,(t,e)=>{let n={},r=Te(e,0,3);for(let s=0;s<r;s++){let o=_t(e,t.shape.keys),c=_t(e,t.shape.values);n[o]=c}return n}).done(),_t=(t,e)=>as(Xt(e),t);var it=typeof document<"u"?document:{};var _l=S((t)=>t.nodeType===Oo);var Sl=typeof DOMParser<"u"?new DOMParser:null;var El=S((t)=>t.nodeType===Ao);var Il=S((t)=>t.nodeType===Co);var hs=(t)=>fr(t,(e,n)=>`${n}:${e};`).join("");var{ELEMENT_NODE:Ao,TEXT_NODE:Co,CDATA_SECTION_NODE:Ul,COMMENT_NODE:Tl,DOCUMENT_NODE:Do,DOCUMENT_TYPE_NODE:Al,DOCUMENT_FRAGMENT_NODE:Oo}=it,Cl=S((t)=>t.nodeType===Do);var J=Symbol;var Yt=J(),te=J(),qn=J(),Gn=J(),zn=J(),ee=J(),Hn=J(),Ut=J(),Jn=J(),us=(t)=>{if(t.length===1&&t[0]?.constructor===Function)t=t[0]();let e=[],n=[],r=0;for(;r<t.length;r++){let s=t[r];if(s===void 0)break;else if(s.constructor===String||s.constructor===Number)e.push(s);else if(s.constructor===Object)break}if(r>0)n.push(e.join(""));for(;r<t.length;r++){let s=t[r];if(!(s instanceof Symbol))n.push(s)}return n};var Dl=yd();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"),[Ut]:H("color","orange"),[Jn]:H("color","black")},Vo=(t)=>{if(t.length===1&&t[0]?.constructor===Function)t=t[0]();let e=[],n=[],r=U(),s=[],o=0;for(;o<t.length;o++){let c=t[o],l=Lo[c];if(l!==void 0)r.set(l.left,l.right);else{if(c===void 0)break;if(c.constructor===String||c.constructor===Number){let h=hs(r);if(o>0||h.length>0)e.push("%c"+c),n.push(h);else e.push(c)}else break}}if(o>0)s=n,s.unshift(e.join(""));for(;o<t.length;o++){let c=t[o];if(!(c instanceof Symbol))s.push(c)}return s},ds=zr?Vo:us,fs=(...t)=>{console.log(...ds(t)),ps.forEach((e)=>e.print(t))},Pn=(...t)=>{console.warn(...ds(t)),t.unshift(Ut),ps.forEach((e)=>e.print(t))};var ps=G();var gs=(t)=>({[Symbol.iterator](){return this},next:t}),ms=(t,e)=>gs(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Me=(t,e)=>gs(()=>{let{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class oe{constructor(t,e){this.clock=t,this.len=e}}class ht{constructor(){this.clients=new Map}}var Ct=(t,e,n)=>e.clients.forEach((r,s)=>{let o=t.doc.store.clients.get(s);if(o!=null){let c=o[o.length-1],l=c.id.clock+c.length;for(let h=0,f=r[h];h<r.length&&f.clock<l;f=r[++h])zs(t,o,f.clock,f.len,n)}}),Fo=(t,e)=>{let n=0,r=t.length-1;while(n<=r){let s=jo((n+r)/2),o=t[s],c=o.clock;if(c<=e){if(e<c+o.len)return s;n=s+1}else r=s-1}return null},ce=(t,e)=>{let n=t.clients.get(e.client);return n!==void 0&&Fo(n,e.clock)!==null},Yn=(t)=>{t.clients.forEach((e)=>{e.sort((s,o)=>s.clock-o.clock);let n,r;for(n=1,r=1;n<e.length;n++){let s=e[r-1],o=e[n];if(s.clock+s.len>=o.clock)e[r-1]=new oe(s.clock,X(s.len,o.clock+o.len-s.clock));else{if(r<n)e[r]=o;r++}}e.length=r})},Wn=(t)=>{let e=new ht;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,s)=>{if(!e.clients.has(s)){let o=r.slice();for(let c=n+1;c<t.length;c++)gr(o,t[c].clients.get(s)||[]);e.clients.set(s,o)}});return Yn(e),e},ne=(t,e,n,r)=>{j(t.clients,e,()=>[]).push(new oe(n,r))},Bs=()=>new ht,qo=(t)=>{let e=Bs();return t.clients.forEach((n,r)=>{let s=[];for(let o=0;o<n.length;o++){let c=n[o];if(c.deleted){let l=c.id.clock,h=c.length;if(o+1<n.length)for(let f=n[o+1];o+1<n.length&&f.deleted;f=n[++o+1])h+=f.length;s.push(new oe(l,h))}}if(s.length>0)e.clients.set(r,s)}),e},Bt=(t,e)=>{vt(t.restEncoder,e.clients.size),q(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),vt(t.restEncoder,n);let s=r.length;vt(t.restEncoder,s);for(let o=0;o<s;o++){let c=r[o];t.writeDsClock(c.clock),t.writeDsLen(c.len)}})},tr=(t)=>{let e=new ht,n=Rt(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();let s=Rt(t.restDecoder),o=Rt(t.restDecoder);if(o>0){let c=j(e.clients,s,()=>[]);for(let l=0;l<o;l++)c.push(new oe(t.readDsClock(),t.readDsLen()))}}return e},ws=(t,e,n)=>{let r=new ht,s=Rt(t.restDecoder);for(let o=0;o<s;o++){t.resetDsCurVal();let c=Rt(t.restDecoder),l=Rt(t.restDecoder),h=n.clients.get(c)||[],f=b(n,c);for(let a=0;a<l;a++){let u=t.readDsClock(),d=u+t.readDsLen();if(u<f){if(f<d)ne(r,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(r,c,u,d-u)}}if(r.clients.size>0){let o=new et;return vt(o.restEncoder,0),Bt(o,r),o.toUint8Array()}return null};var Os=kn;class Lc extends pe{constructor({guid:t=Dr(),collectionid:e=null,gc:n=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:c=!0}={}){super();this.gc=n,this.gcFilter=r,this.clientID=Os(),this.guid=t,this.collectionid=e,this.share=new Map,this.store=new or,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=o,this.meta=s,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(q(this.subdocs).map((t)=>t.guid))}transact(t,e=null){return x(this,t,e)}get(t,e=E){let n=j(this.share,t,()=>{let s=new e;return s._integrate(this,null),s}),r=n.constructor;if(e!==E&&r!==e)if(r===E){let s=new e;s._map=n._map,n._map.forEach((o)=>{for(;o!==null;o=o.left)o.parent=s}),s._start=n._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=n._length,this.share.set(t,s),s._integrate(this,null),s}else throw Error(`Type with the name ${t} has already been defined with a different constructor`);return n}getArray(t=""){return this.get(t,Ys)}getText(t=""){return this.get(t,Bo)}getMap(t=""){return this.get(t,Ho)}getXmlElement(t=""){return this.get(t,Dt)}getXmlFragment(t=""){return this.get(t,lt)}toJSON(){let t={};return this.share.forEach((e,n)=>{t[n]=e.toJSON()}),t}destroy(){this.isDestroyed=!0,q(this.subdocs).forEach((e)=>e.destroy());let t=this._item;if(t!==null){this._item=null;let e=t.content;e.doc=new Lc({guid:this.guid,...e.opts,shouldLoad:!1}),e.doc._item=t,x(t.parent.doc,(n)=>{let r=e.doc;if(!t.deleted)n.subdocsAdded.add(r);n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class er{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return Rt(this.restDecoder)}readDsLen(){return Rt(this.restDecoder)}}class nr extends er{readLeftID(){return m(Rt(this.restDecoder),Rt(this.restDecoder))}readRightID(){return m(Rt(this.restDecoder),Rt(this.restDecoder))}readClient(){return Rt(this.restDecoder)}readInfo(){return rt(this.restDecoder)}readString(){return ka(this.restDecoder)}readParentInfo(){return Rt(this.restDecoder)===1}readTypeRef(){return Rt(this.restDecoder)}readLen(){return Rt(this.restDecoder)}readAny(){return yt(this.restDecoder)}readBuf(){return Hr(Mr(this.restDecoder))}readJSON(){return JSON.parse(ka(this.restDecoder))}readKey(){return ka(this.restDecoder)}}class vs{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Rt(this.restDecoder),this.dsCurrVal}readDsLen(){let t=Rt(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class ct extends vs{constructor(t){super(t);this.keys=[],Rt(t),this.keyClockDecoder=new Ht(Mr(t)),this.clientDecoder=new bt(Mr(t)),this.leftClockDecoder=new Ht(Mr(t)),this.rightClockDecoder=new Ht(Mr(t)),this.infoDecoder=new Ie(Mr(t),rt),this.stringDecoder=new bn(Mr(t)),this.parentInfoDecoder=new Ie(Mr(t),rt),this.typeRefDecoder=new bt(Mr(t)),this.lenDecoder=new bt(Mr(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 Mr(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 rr{constructor(){this.restEncoder=_a()}toUint8Array(){return no(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){vt(this.restEncoder,t)}writeDsLen(t){vt(this.restEncoder,t)}}class Ot extends rr{writeLeftID(t){vt(this.restEncoder,t.client),vt(this.restEncoder,t.clock)}writeRightID(t){vt(this.restEncoder,t.client),vt(this.restEncoder,t.clock)}writeClient(t){vt(this.restEncoder,t)}writeInfo(t){be(this.restEncoder,t)}writeString(t){Sa(this.restEncoder,t)}writeParentInfo(t){vt(this.restEncoder,t?1:0)}writeTypeRef(t){vt(this.restEncoder,t)}writeLen(t){vt(this.restEncoder,t)}writeAny(t){mt(this.restEncoder,t)}writeBuf(t){Tr(this.restEncoder,t)}writeJSON(t){Sa(this.restEncoder,JSON.stringify(t))}writeKey(t){Sa(this.restEncoder,t)}}class sr{constructor(){this.restEncoder=_a(),this.dsCurrVal=0}toUint8Array(){return no(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){let e=t-this.dsCurrVal;this.dsCurrVal=t,vt(this.restEncoder,e)}writeDsLen(t){if(t===0)v();vt(this.restEncoder,t-1),this.dsCurrVal+=t}}class et extends sr{constructor(){super();this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Gt,this.clientEncoder=new xt,this.leftClockEncoder=new Gt,this.rightClockEncoder=new Gt,this.infoEncoder=new _e(be),this.stringEncoder=new wn,this.parentInfoEncoder=new _e(be),this.typeRefEncoder=new xt,this.lenEncoder=new xt}toUint8Array(){let t=_a();return vt(t,0),Tr(t,this.keyClockEncoder.toUint8Array()),Tr(t,this.clientEncoder.toUint8Array()),Tr(t,this.leftClockEncoder.toUint8Array()),Tr(t,this.rightClockEncoder.toUint8Array()),Tr(t,no(this.infoEncoder)),Tr(t,this.stringEncoder.toUint8Array()),Tr(t,no(this.parentInfoEncoder)),Tr(t,this.typeRefEncoder.toUint8Array()),Tr(t,this.lenEncoder.toUint8Array()),qt(t,no(this.restEncoder)),no(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){Tr(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 Go=(t,e,n,r)=>{r=X(r,e[0].id.clock);let s=P(e,r);vt(t.restEncoder,e.length-s),t.writeClient(n),vt(t.restEncoder,r);let o=e[s];o.write(t,r-o.id.clock);for(let c=s+1;c<e.length;c++)e[c].write(t,0)},ir=(t,e,n)=>{let r=new Map;n.forEach((s,o)=>{if(b(e,o)>s)r.set(o,s)}),tn(e).forEach((s,o)=>{if(!n.has(o))r.set(o,0)}),vt(t.restEncoder,r.size),q(r.entries()).sort((s,o)=>o[0]-s[0]).forEach(([s,o])=>{Go(t,e.clients.get(s),s,o)})},zo=(t,e)=>{let n=U(),r=Rt(t.restDecoder);for(let s=0;s<r;s++){let o=Rt(t.restDecoder),c=Array(o),l=t.readClient(),h=Rt(t.restDecoder);n.set(l,{i:0,refs:c});for(let f=0;f<o;f++){let a=t.readInfo();switch(Ft&a){case 0:{let u=t.readLen();c[f]=new V(m(l,h),u),h+=u;break}case 10:{let u=Rt(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,gi(t,a));c[f]=d,h+=d.length}}}}return n},Jo=(t,e,n)=>{let r=[],s=q(n.keys()).sort((p,g)=>p-g);if(s.length===0)return null;let o=()=>{if(s.length===0)return null;let p=n.get(s[s.length-1]);while(p.refs.length===p.i)if(s.pop(),s.length>0)p=n.get(s[s.length-1]);else return null;return p},c=o();if(c===null)return null;let l=new or,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 r){let g=p.id.client,w=n.get(g);if(w)w.i--,l.clients.set(g,w.refs.slice(w.i)),n.delete(g),w.i=0,w.refs=[];else l.clients.set(g,[p]);s=s.filter((C)=>C!==g)}r.length=0};while(!0){if(a.constructor!==M){let g=j(u,a.id.client,()=>b(e,a.id.client))-a.id.clock;if(g<0)r.push(a),f(a.id.client,a.id.clock-1),d();else{let w=a.getMissing(t,e);if(w!==null){r.push(a);let C=n.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(r.length>0)a=r.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 ir(p,l,new Map),vt(p.restEncoder,0),{missing:h,update:p.toUint8Array()}}return null},Po=(t,e)=>ir(t,e.doc.store,e.beforeState),Ko=(t,e,n,r=new ct(t))=>x(e,(s)=>{s.local=!1;let o=!1,c=s.doc,l=c.store,h=zo(r,c),f=Jo(s,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=ws(r,s,l);if(l.pendingDs){let d=new ct(Ca(l.pendingDs));Rt(d.restDecoder);let p=ws(d,s,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,Ns(s.doc,d)}},n,!1);var Ns=(t,e,n,r=ct)=>{let s=Ca(e);Ko(s,t,n,new r(s))},Qk=(t,e,n)=>Ns(t,e,n,nr),Wo=(t,e,n=new Map)=>{ir(t,e.store,n),Bt(t,qo(e.store))},Zo=(t,e=new Uint8Array([0]),n=new et)=>{let r=Rs(e);Wo(n,t,r);let s=[n.toUint8Array()];if(t.store.pendingDs)s.push(t.store.pendingDs);if(t.store.pendingStructs)s.push(hc(t.store.pendingStructs.update,e));if(s.length>1){if(n.constructor===Ot)return lc(s.map((o,c)=>c===0?o:dc(o)));else if(n.constructor===et)return Je(s)}return s[0]},eE=(t,e)=>Zo(t,e,new Ot),Xo=(t)=>{let e=new Map,n=Rt(t.restDecoder);for(let r=0;r<n;r++){let s=Rt(t.restDecoder),o=Rt(t.restDecoder);e.set(s,o)}return e},Rs=(t)=>Xo(new er(Ca(t))),Ls=(t,e)=>(vt(t.restEncoder,e.size),q(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{vt(t.restEncoder,n),vt(t.restEncoder,r)}),t),Qo=(t,e)=>Ls(t,tn(e.store)),Yo=(t,e=new sr)=>{if(t instanceof Map)Ls(e,t);else Qo(e,t);return e.toUint8Array()},tE=(t)=>Yo(t,new rr);class Vs{constructor(){this.l=[]}}var xs=()=>new Vs,ys=(t,e)=>t.l.push(e),bs=(t,e)=>{let n=t.l,r=n.length;if(t.l=n.filter((s)=>e!==s),r===t.l.length)console.error("[yjs] Tried to remove event handler that doesn't exist.")},Ms=(t,e,n)=>Kt(t.l,[e,n]);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 $s=(t)=>{for(let[e,n]of t.doc.share.entries())if(n===t)return e;throw v()},He=(t,e)=>{while(e!==null){if(e.parent===t)return!0;e=e.parent._item}return!1};class Fs{constructor(t,e,n,r=0){this.type=t,this.tname=e,this.item=n,this.assoc=r}}class js{constructor(t,e,n=0){this.type=t,this.index=e,this.assoc=n}}var tc=(t,e,n=0)=>new js(t,e,n),Fe=(t,e,n)=>{let r=null,s=null;if(t._item===null)s=$s(t);else r=m(t._item.id.client,t._item.id.clock);return new Fs(r,s,e,n)},_w=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return Fe(t,null,n);e--}while(r!==null){if(!r.deleted&&r.countable){if(r.length>e)return Fe(t,m(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return Fe(t,r.lastId,n);r=r.right}return Fe(t,null,n)};var ec=(t,e)=>{let n=At(t,e),r=e.clock-n.id.clock;return{item:n,diff:r}},tm=(t,e,n=!0)=>{let r=e.store,{item:s,type:o,tname:c,assoc:l}=t,h=null,f=0;if(s!==null){if(b(r,s.client)<=s.clock)return null;let a=n?Qn(r,s):ec(r,s),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(r,o.client)<=o.clock)return null;let{item:a}=n?Qn(r,o):{item:At(r,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 tc(h,f,t.assoc)};class qs{constructor(t,e){this.ds=t,this.sv=e}}var nc=(t,e)=>new qs(t,e),jl=nc(Bs(),new Map);var Tt=(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 n=j(t.meta,Zn,G),r=t.doc.store;if(!n.has(e))e.sv.forEach((s,o)=>{if(s<b(r,o))N(t,m(o,s))}),Ct(t,e.ds,(s)=>{}),n.add(e)};class or{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}var tn=(t)=>{let e=new Map;return t.clients.forEach((n,r)=>{let s=n[n.length-1];e.set(r,s.id.clock+s.length)}),e},b=(t,e)=>{let n=t.clients.get(e);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},Gs=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{let r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw v()}n.push(e)},P=(t,e)=>{let n=0,r=t.length-1,s=t[r],o=s.id.clock;if(o===e)return r;let c=jo(e/(o+s.length-1)*r);while(n<=r){if(s=t[c],o=s.id.clock,o<=e){if(e<o+s.length)return c;n=c+1}else r=c-1;c=jo((n+r)/2)}throw v()},rc=(t,e)=>{let n=t.clients.get(e.client);return n[P(n,e.clock)]},At=rc,Xn=(t,e,n)=>{let r=P(e,n),s=e[r];if(s.id.clock<n&&s instanceof y)return e.splice(r+1,0,Ye(t,s,n-s.id.clock)),r+1;return r},N=(t,e)=>{let n=t.doc.store.clients.get(e.client);return n[Xn(t,n,e.clock)]},ks=(t,e,n)=>{let r=e.clients.get(n.client),s=P(r,n.clock),o=r[s];if(n.clock!==o.id.clock+o.length-1&&o.constructor!==V)r.splice(s+1,0,Ye(t,o,n.clock-o.id.clock+1));return o},sc=(t,e,n)=>{let r=t.clients.get(e.id.client);r[P(r,e.id.clock)]=n},zs=(t,e,n,r,s)=>{if(r===0)return;let o=n+r,c=Xn(t,e,n),l;do{if(l=e[c++],o<l.id.clock+l.length)Xn(t,e,o);s(l)}while(c<e.length&&e[c].id.clock<o)};class Hs{constructor(t,e,n){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=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}var _s=(t,e)=>{if(e.deleteSet.clients.size===0&&!pr(e.afterState,(n,r)=>e.beforeState.get(r)!==n))return!1;return Yn(e.deleteSet),Po(t,e),Bt(t,e.deleteSet),!0},Ss=(t,e,n)=>{let r=e._item;if(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)j(t.changed,e,G).add(n)},Ge=(t,e)=>{let n=t[e],r=t[e-1],s=e;for(;s>0;n=r,r=t[--s-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor){if(r.mergeWith(n)){if(n instanceof y&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n)n.parent._map.set(n.parentSub,r);continue}}break}let o=e-s;if(o)t.splice(e+1-o,o);return o},ic=(t,e,n)=>{for(let[r,s]of t.clients.entries()){let o=e.clients.get(r);for(let c=s.length-1;c>=0;c--){let l=s[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&&n(u))u.gc(e,!1)}}}},oc=(t,e)=>{t.clients.forEach((n,r)=>{let s=e.clients.get(r);for(let o=n.length-1;o>=0;o--){let c=n[o],l=ge(s.length-1,1+P(s,c.clock+c.len-1));for(let h=l,f=s[h];h>0&&f.id.clock>=c.clock;f=s[h])h-=1+Ge(s,h)}})};var Js=(t,e)=>{if(e<t.length){let n=t[e],r=n.doc,s=r.store,{deleteSet:o,_mergeStructs:c}=n;try{Yn(o),n.afterState=tn(n.doc.store),r.emit("beforeObserverCalls",[n,r]);let l=[];n.changed.forEach((h,f)=>l.push(()=>{if(f._item===null||!f._item.deleted)f._callObserver(n,h)})),l.push(()=>{n.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),Ms(f._dEH,h,n)})}),l.push(()=>r.emit("afterTransaction",[n,r])),l.push(()=>{if(n._needFormattingCleanup)Sc(n)})}),Kt(l,[])}finally{if(r.gc)ic(o,s,r.gcFilter);oc(o,s),n.afterState.forEach((a,u)=>{let d=n.beforeState.get(u)||0;if(d!==a){let p=s.clients.get(u),g=X(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=s.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(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID))fs(Ut,Yt,"[yjs] ",te,ee,"Changed the client-id because another client seems to be using it."),r.clientID=Os();if(r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){let a=new Ot;if(_s(a,n))r.emit("update",[a.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){let a=new et;if(_s(a,n))r.emit("updateV2",[a.toUint8Array(),n.origin,r,n])}let{subdocsAdded:l,subdocsLoaded:h,subdocsRemoved:f}=n;if(l.size>0||f.size>0||h.size>0)l.forEach((a)=>{if(a.clientID=r.clientID,a.collectionid==null)a.collectionid=r.collectionid;r.subdocs.add(a)}),f.forEach((a)=>r.subdocs.delete(a)),r.emit("subdocs",[{loaded:h,added:l,removed:f},r,n]),f.forEach((a)=>a.destroy());if(t.length<=e+1)r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t]);else Js(t,e+1)}}},x=(t,e,n=null,r=!0)=>{let s=t._transactionCleanups,o=!1,c=null;if(t._transaction===null){if(o=!0,t._transaction=new Hs(t,n,r),s.push(t._transaction),s.length===1)t.emit("beforeAllTransactions",[t]);t.emit("beforeTransaction",[t._transaction,t])}try{c=e(t._transaction)}finally{if(o){let l=t._transaction===s[0];if(t._transaction=null,l)Js(s,0)}}return c};class Ps{constructor(t,e){this.insertions=e,this.deletions=t,this.meta=new Map}}var Es=(t,e,n)=>{Ct(t,n.deletions,(r)=>{if(r instanceof y&&e.scope.some((s)=>s===t.doc||He(s,r)))ur(r,!1)})},Is=(t,e,n)=>{let r=null,{doc:s,scope:o}=t;x(s,(l)=>{while(e.length>0&&t.currStackItem===null){let h=s.store,f=e.pop(),a=new Set,u=[],d=!1;Ct(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)}}),Ct(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=pi(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}),r=l},t);let c=t.currStackItem;if(c!=null){let l=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:c,type:n,changedParentTypes:l,origin:t},t]),t.currStackItem=null}return c};class OI extends pe{constructor(t,{captureTimeout:e=500,captureTransaction:n=(l)=>!0,deleteFilter:r=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:c=Z(t)?t[0].doc:t instanceof Lc?t:t.doc}={}){super();this.scope=[],this.doc=c,this.addToScope(t),this.deleteFilter=r,s.add(this),this.trackedOrigins=s,this.captureTransaction=n,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,dr=w-k;if(dr>0)ne(u,C,k,dr)});let d=yd(),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 Ps(l.deleteSet,u)),p=!0;if(!h&&!f)this.lastChange=d;Ct(l,l.deleteSet,(w)=>{if(w instanceof y&&this.scope.some((C)=>C===l.doc||He(C,w)))ur(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=Z(t)?t:[t],t.forEach((n)=>{if(!e.has(n)){if(e.add(n),n instanceof E?n.doc!==this.doc:n!==this.doc)Pn("[yjs#509] Not same Y.Doc");this.scope.push(n)}})}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((n)=>{if(t)this.undoStack.forEach((r)=>Es(n,this,r)),this.undoStack=[];if(e)this.redoStack.forEach((r)=>Es(n,this,r)),this.redoStack=[];this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:e}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=Is(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=Is(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*cc(t){let e=Rt(t.restDecoder);for(let n=0;n<e;n++){let r=Rt(t.restDecoder),s=t.readClient(),o=Rt(t.restDecoder);for(let c=0;c<r;c++){let l=t.readInfo();if(l===10){let h=Rt(t.restDecoder);yield new M(m(s,o),h),o+=h}else if((Ft&l)!==0){let h=(l&(F|D))===0,f=new y(m(s,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,gi(t,l));yield f,o+=f.length}else{let h=t.readLen();yield new V(m(s,o),h),o+=h}}}}class en{constructor(t,e){this.gen=cc(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 lc=(t)=>Je(t,nr,Ot);var ac=(t,e)=>{if(t.constructor===V){let{client:n,clock:r}=t.id;return new V(m(n,r+e),t.length-e)}else if(t.constructor===M){let{client:n,clock:r}=t.id;return new M(m(n,r+e),t.length-e)}else{let n=t,{client:r,clock:s}=n.id;return new y(m(r,s+e),null,m(r,s+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Je=(t,e=ct,n=et)=>{if(t.length===1)return t[0];let r=t.map((a)=>new e(Ca(a))),s=r.map((a)=>new en(a,!0)),o=null,c=new n,l=new nn(c);while(!0){if(s=s.filter((d)=>d.curr!==null),s.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}),s.length===0)break;let a=s[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=ac(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;cr(l);let h=r.map((a)=>tr(a)),f=Wn(h);return Bt(c,f),c.toUint8Array()},hc=(t,e,n=ct,r=et)=>{let s=Rs(e),o=new r,c=new nn(o),l=new n(Ca(t)),h=new en(l,!1);while(h.curr){let a=h.curr,u=a.id.client,d=s.get(u)||0;if(h.curr.constructor===M){h.next();continue}if(a.id.clock+a.length>d){Y(c,a,X(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()}cr(c);let f=tr(l);return Bt(o,f),o.toUint8Array()};var Ks=(t)=>{if(t.written>0)t.clientStructs.push({written:t.written,restEncoder:no(t.encoder.restEncoder)}),t.encoder.restEncoder=_a(),t.written=0},Y=(t,e,n)=>{if(t.written>0&&t.currClient!==e.id.client)Ks(t);if(t.written===0)t.currClient=e.id.client,t.encoder.writeClient(e.id.client),vt(t.encoder.restEncoder,e.id.clock+n);e.write(t.encoder,n),t.written++},cr=(t)=>{Ks(t);let e=t.encoder.restEncoder;vt(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){let r=t.clientStructs[n];vt(e,r.written),qt(e,r.restEncoder)}},uc=(t,e,n,r)=>{let s=new n(Ca(t)),o=new en(s,!1),c=new r,l=new nn(c);for(let f=o.curr;f!==null;f=o.next())Y(l,e(f),0);cr(l);let h=tr(s);return Bt(c,h),c.toUint8Array()};var dc=(t)=>uc(t,Fr,ct,Ot),Us="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=fc(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(Us);let t=new Map,e=this.target;this.transaction.changed.get(e).forEach((r)=>{if(r!==null){let s=e._map.get(r),o,c;if(this.adds(s)){let l=s.left;while(l!==null&&this.adds(l))l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))o="delete",c=de(l.content.getContent());else return;else if(l!==null&&this.deletes(l))o="update",c=de(l.content.getContent());else o="add",c=void 0}else if(this.deletes(s))o="delete",c=de(s.content.getContent());else return;t.set(r,{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(Us);let e=this.target,n=G(),r=G(),s=[];if(t={added:n,deleted:r,delta:s,keys:this.keys},this.transaction.changed.get(e).has(null)){let c=null,l=()=>{if(c)s.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,r.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()),n.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 fc=(t,e)=>{let n=[];while(e._item!==null&&e!==t){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,s=e._item.parent._start;while(s!==e._item&&s!==null){if(!s.deleted&&s.countable)r+=s.length;s=s.right}n.unshift(r)}e=e._item.parent}return n},O=()=>{Pn("Invalid access: Add Yjs type to a document before reading data.")},Ws=80,lr=0;class Zs{constructor(t,e){t.marker=!0,this.p=t,this.index=e,this.timestamp=lr++}}var pc=(t)=>{t.timestamp=lr++},Xs=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=lr++},gc=(t,e,n)=>{if(t.length>=Ws){let r=t.reduce((s,o)=>s.timestamp<o.timestamp?s:o);return Xs(r,e,n),r}else{let r=new Zs(e,n);return t.push(r),r}},rn=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;let n=t._searchMarker.length===0?null:t._searchMarker.reduce((o,c)=>nt(e-o.index)<nt(e-c.index)?o:c),r=t._start,s=0;if(n!==null)r=n.p,s=n.index,pc(n);while(r.right!==null&&s<e){if(!r.deleted&&r.countable){if(e<s+r.length)break;s+=r.length}r=r.right}while(r.left!==null&&s>e)if(r=r.left,!r.deleted&&r.countable)s-=r.length;while(r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock)if(r=r.left,!r.deleted&&r.countable)s-=r.length;if(n!==null&&nt(n.index-s)<r.parent.length/Ws)return Xs(n,r,s),n;else return gc(t._searchMarker,r,s)},re=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){let s=t[r];if(n>0){let o=s.p;o.marker=!1;while(o&&(o.deleted||!o.countable))if(o=o.left,o&&!o.deleted&&o.countable)s.index-=o.length;if(o===null||o.marker===!0){t.splice(r,1);continue}s.p=o,o.marker=!0}if(e<s.index||n>0&&e===s.index)s.index=X(e,s.index+n)}};var sn=(t,e,n)=>{let r=t,s=e.changedParentTypes;while(!0){if(j(s,t,()=>[]).push(n),t._item===null)break;t=t._item.parent}Ms(r._eH,n,e)};class E{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=xs(),this._dEH=xs(),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){ys(this._eH,t)}observeDeep(t){ys(this._dEH,t)}unobserve(t){bs(this._eH,t)}unobserveDeep(t){bs(this._dEH,t)}toJSON(){}}var Qs=(t,e,n)=>{if(t.doc??O(),e<0)e=t._length+e;if(n<0)n=t._length+n;let r=n-e,s=[],o=t._start;while(o!==null&&r>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&&r>0;l++)s.push(c[l]),r--;e=0}}o=o.right}return s},ti=(t)=>{t.doc??O();let e=[],n=t._start;while(n!==null){if(n.countable&&!n.deleted){let r=n.content.getContent();for(let s=0;s<r.length;s++)e.push(r[s])}n=n.right}return e};var se=(t,e)=>{let n=0,r=t._start;t.doc??O();while(r!==null){if(r.countable&&!r.deleted){let s=r.content.getContent();for(let o=0;o<s.length;o++)e(s[o],n++,t)}r=r.right}},ei=(t,e)=>{let n=[];return se(t,(r,s)=>{n.push(e(r,s,t))}),n},mc=(t)=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){while(e!==null&&e.deleted)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}let s=n[r++];if(n.length<=r)n=null;return{done:!1,value:s}}}},ni=(t,e)=>{t.doc??O();let n=rn(t,e),r=t._start;if(n!==null)r=n.p,e-=n.index;for(;r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Pe=(t,e,n,r)=>{let s=n,o=t.doc,{clientID:c,store:l}=o,h=n===null?e._start:n.right,f=[],a=()=>{if(f.length>0)s=new y(m(c,b(l,c)),s,s&&s.lastId,h,h&&h.id,e,null,new at(f)),s.integrate(t,0),f=[]};r.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:s=new y(m(c,b(l,c)),s,s&&s.lastId,h,h&&h.id,e,null,new ae(new Uint8Array(u))),s.integrate(t,0);break;case Lc:s=new y(m(c,b(l,c)),s,s&&s.lastId,h,h&&h.id,e,null,new he(u)),s.integrate(t,0);break;default:if(u instanceof E)s=new y(m(c,b(l,c)),s,s&&s.lastId,h,h&&h.id,e,null,new W(u)),s.integrate(t,0);else throw Error("Unexpected content type in insert operation")}}}),a()},ri=()=>R("Length exceeded!"),si=(t,e,n,r)=>{if(n>e._length)throw ri();if(n===0){if(e._searchMarker)re(e._searchMarker,n,r.length);return Pe(t,e,null,r)}let s=n,o=rn(e,n),c=e._start;if(o!==null){if(c=o.p,n-=o.index,n===0)c=c.prev,n+=c&&c.countable&&!c.deleted?c.length:0}for(;c!==null;c=c.right)if(!c.deleted&&c.countable){if(n<=c.length){if(n<c.length)N(t,m(c.id.client,c.id.clock+n));break}n-=c.length}if(e._searchMarker)re(e._searchMarker,s,r.length);return Pe(t,e,c,r)},wc=(t,e,n)=>{let s=(e._searchMarker||[]).reduce((o,c)=>c.index>o.index?c:o,{index:0,p:e._start}).p;if(s)while(s.right)s=s.right;return Pe(t,e,s,n)},ii=(t,e,n,r)=>{if(r===0)return;let s=n,o=r,c=rn(e,n),l=e._start;if(c!==null)l=c.p,n-=c.index;for(;l!==null&&n>0;l=l.right)if(!l.deleted&&l.countable){if(n<l.length)N(t,m(l.id.client,l.id.clock+n));n-=l.length}while(r>0&&l!==null){if(!l.deleted){if(r<l.length)N(t,m(l.id.client,l.id.clock+r));l.delete(t),r-=l.length}l=l.right}if(r>0)throw ri();if(e._searchMarker)re(e._searchMarker,s,-o+r)},Ke=(t,e,n)=>{let r=e._map.get(n);if(r!==void 0)r.delete(t)},ar=(t,e,n,r)=>{let s=e._map.get(n)||null,o=t.doc,c=o.clientID,l;if(r==null)l=new at([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new at([r]);break;case Uint8Array:l=new ae(r);break;case Lc:l=new he(r);break;default:if(r instanceof E)l=new W(r);else throw Error("Unexpected content type")}new y(m(c,b(o.store,c)),s,s&&s.lastId,null,null,e,n,l).integrate(t,0)},hr=(t,e)=>{t.doc??O();let n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},oi=(t)=>{let e={};return t.doc??O(),t._map.forEach((n,r)=>{if(!n.deleted)e[r]=n.content.getContent()[n.length-1]}),e},ci=(t,e)=>{t.doc??O();let n=t._map.get(e);return n!==void 0&&!n.deleted};var xc=(t,e)=>{let n={};return t._map.forEach((r,s)=>{let o=r;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&&Tt(o,e))n[s]=o.content.getContent()[o.length-1]}),n},je=(t)=>(t.doc??O(),ms(t._map.entries(),(e)=>!e[1].deleted));class bb extends le{}class Ys extends E{constructor(){super();this._prelimContent=[],this._searchMarker=[]}static from(t){let e=new Ys;return e.push(t),e}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ys}clone(){let t=new Ys;return t.insert(0,this.toArray().map((e)=>e instanceof E?e.clone():e)),t}get length(){return this.doc??O(),this._length}_callObserver(t,e){super._callObserver(t,e),sn(this,t,new bb(this,t))}insert(t,e){if(this.doc!==null)x(this.doc,(n)=>{si(n,this,t,e)});else this._prelimContent.splice(t,0,...e)}push(t){if(this.doc!==null)x(this.doc,(e)=>{wc(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,(n)=>{ii(n,this,t,e)});else this._prelimContent.splice(t,e)}get(t){return ni(this,t)}toArray(){return ti(this)}slice(t=0,e=this.length){return Qs(this,t,e)}toJSON(){return this.map((t)=>t instanceof E?t.toJSON():t)}map(t){return ei(this,t)}forEach(t){se(this,t)}[Symbol.iterator](){return mc(this)}_write(t){t.writeTypeRef(jc)}}var yc=(t)=>new Ys;class Sw extends le{constructor(t,e,n){super(t,e);this.keysChanged=n}}class Ho extends E{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((n,r)=>{this.set(r,n)}),this._prelimContent=null}_copy(){return new Ho}clone(){let t=new Ho;return this.forEach((e,n)=>{t.set(n,e instanceof E?e.clone():e)}),t}_callObserver(t,e){sn(this,t,new Sw(this,t,e))}toJSON(){this.doc??O();let t={};return this._map.forEach((e,n)=>{if(!e.deleted){let r=e.content.getContent()[e.length-1];t[n]=r instanceof E?r.toJSON():r}}),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,n)=>{if(!e.deleted)t(e.content.getContent()[e.length-1],n,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,(n)=>{ar(n,this,t,e)});else this._prelimContent.set(t,e);return e}get(t){return hr(this,t)}has(t){return ci(this,t)}clear(){if(this.doc!==null)x(this.doc,(t)=>{this.forEach(function(e,n,r){Ke(t,r,n)})});else this._prelimContent.clear()}_write(t){t.writeTypeRef(qc)}}var bc=(t)=>new Ho,tt=(t,e)=>t===e||typeof t==="object"&&typeof e==="object"&&t&&e&&In(t,e);class We{constructor(t,e,n,r){this.left=t,this.right=e,this.index=n,this.currentAttributes=r}forward(){if(this.right===null)v();switch(this.right.content.constructor){case I:if(!this.right.deleted)Nt(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 Ts=(t,e,n)=>{while(e.right!==null&&n>0){switch(e.right.content.constructor){case I:if(!e.right.deleted)Nt(e.currentAttributes,e.right.content);break;default:if(!e.right.deleted){if(n<e.right.length)N(t,m(e.right.id.client,e.right.id.clock+n));e.index+=e.right.length,n-=e.right.length}break}e.left=e.right,e.right=e.right.right}return e},qe=(t,e,n,r)=>{let s=new Map,o=r?rn(e,n):null;if(o){let c=new We(o.p.left,o.p,o.index,s);return Ts(t,c,n-o.index)}else{let c=new We(null,e._start,0,s);return Ts(t,c,n)}},li=(t,e,n,r)=>{while(n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===I&&tt(r.get(n.right.content.key),n.right.content.value))){if(!n.right.deleted)r.delete(n.right.content.key);n.forward()}let s=t.doc,o=s.clientID;r.forEach((c,l)=>{let{left:h,right:f}=n,a=new y(m(o,b(s.store,o)),h,h&&h.lastId,f,f&&f.id,e,null,new I(l,c));a.integrate(t,0),n.right=a,n.forward()})},Nt=(t,e)=>{let{key:n,value:r}=e;if(r===null)t.delete(n);else t.set(n,r)},ai=(t,e)=>{while(!0){if(t.right===null)break;else if(t.right.deleted||t.right.content.constructor===I&&tt(e[t.right.content.key]??null,t.right.content.value));else break;t.forward()}},hi=(t,e,n,r)=>{let s=t.doc,o=s.clientID,c=new Map;for(let l in r){let h=r[l],f=n.currentAttributes.get(l)??null;if(!tt(f,h)){c.set(l,f);let{left:a,right:u}=n;n.right=new y(m(o,b(s.store,o)),a,a&&a.lastId,u,u&&u.id,e,null,new I(l,h)),n.right.integrate(t,0),n.forward()}}return c},Kn=(t,e,n,r,s)=>{n.currentAttributes.forEach((d,p)=>{if(s[p]===void 0)s[p]=null});let o=t.doc,c=o.clientID;ai(n,s);let l=hi(t,e,n,s),h=r.constructor===String?new K(r):r instanceof E?new W(r):new ut(r),{left:f,right:a,index:u}=n;if(e._searchMarker)re(e._searchMarker,n.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),n.right=a,n.index=u,n.forward(),li(t,e,n,l)},As=(t,e,n,r,s)=>{let o=t.doc,c=o.clientID;ai(n,s);let l=hi(t,e,n,s);t:while(n.right!==null&&(r>0||l.size>0&&(n.right.deleted||n.right.content.constructor===I))){if(!n.right.deleted)switch(n.right.content.constructor){case I:{let{key:h,value:f}=n.right.content,a=s[h];if(a!==void 0){if(tt(a,f))l.delete(h);else{if(r===0)break t;l.set(h,f)}n.right.delete(t)}else n.currentAttributes.set(h,f);break}default:if(r<n.right.length)N(t,m(n.right.id.client,n.right.id.clock+r));r-=n.right.length;break}n.forward()}if(r>0){let h="";for(;r>0;r--)h+=`
4
- `;n.right=new y(m(c,b(o.store,c)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new K(h)),n.right.integrate(t,0),n.forward()}li(t,e,n,l)},ui=(t,e,n,r,s)=>{let o=e,c=U();while(o&&(!o.countable||o.deleted)){if(!o.deleted&&o.content.constructor===I){let f=o.content;c.set(f.key,f)}o=o.right}let l=0,h=!1;while(e!==o){if(n===e)h=!0;if(!e.deleted){let f=e.content;switch(f.constructor){case I:{let{key:a,value:u}=f,d=r.get(a)??null;if(c.get(a)!==f||d===u){if(e.delete(t),l++,!h&&(s.get(a)??null)===u&&d!==u)if(d===null)s.delete(a);else s.set(a,d)}if(!h&&!e.deleted)Nt(s,f);break}}}e=e.right}return l},kc=(t,e)=>{while(e&&e.right&&(e.right.deleted||!e.right.countable))e=e.right;let n=new Set;while(e&&(e.deleted||!e.countable)){if(!e.deleted&&e.content.constructor===I){let r=e.content.key;if(n.has(r))e.delete(t);else n.add(r)}e=e.left}},_c=(t)=>{let e=0;return x(t.doc,(n)=>{let{_start:r,_start:s}=t,o=U(),c=ue(o);while(s){if(s.deleted===!1)switch(s.content.constructor){case I:Nt(c,s.content);break;default:e+=ui(n,r,s,o,c),o=ue(c),r=s;break}s=s.right}}),e},Sc=(t)=>{let e=new Set,n=t.doc;for(let[r,s]of t.afterState.entries()){let o=t.beforeState.get(r)||0;if(s===o)continue;zs(t,n.store.clients.get(r),o,s,(c)=>{if(!c.deleted&&c.content.constructor===I&&c.constructor!==V)e.add(c.parent)})}x(n,(r)=>{Ct(t,t.deleteSet,(s)=>{if(s instanceof V||!s.parent._hasFormatting||e.has(s.parent))return;let o=s.parent;if(s.content.constructor===I)e.add(o);else kc(r,s)});for(let s of e)_c(s)})},Cs=(t,e,n)=>{let r=n,s=ue(e.currentAttributes),o=e.right;while(n>0&&e.right!==null){if(e.right.deleted===!1)switch(e.right.content.constructor){case W:case ut:case K:if(n<e.right.length)N(t,m(e.right.id.client,e.right.id.clock+n));n-=e.right.length,e.right.delete(t);break}e.forward()}if(o)ui(t,o,e.right,s,e.currentAttributes);let c=(e.left||e.right).parent;if(c._searchMarker)re(c._searchMarker,e.index,-r+n);return e};class Cw extends le{constructor(t,e,n){super(t,e);this.childListChanged=!1,this.keysChanged=new Set,n.forEach((r)=>{if(r===null)this.childListChanged=!0;else this.keysChanged.add(r)})}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,(n)=>{let r=new Map,s=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},r.size>0)d.attributes={},r.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=Lr({},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 I:{let{key:d,value:p}=o.content;if(this.adds(o)){if(!this.deletes(o)){let g=r.get(d)??null;if(!tt(g,p)){if(c==="retain")u();if(tt(p,s.get(d)??null))delete l[d];else l[d]=p}else if(p!==null)o.delete(n)}}else if(this.deletes(o)){s.set(d,p);let g=r.get(d)??null;if(!tt(g,p)){if(c==="retain")u();l[d]=g}}else if(!o.deleted){s.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(n)}}if(!o.deleted){if(c==="insert")u();Nt(r,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 Bo extends E{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((n)=>n())}catch(n){console.error(n)}this._pending=null}_copy(){return new Bo}clone(){let t=new Bo;return t.applyDelta(this.toDelta()),t}_callObserver(t,e){super._callObserver(t,e);let n=new Cw(this,t,e);if(sn(this,t,n),!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,(n)=>{let r=new We(null,this._start,0,new Map);for(let s=0;s<t.length;s++){let o=t[s];if(o.insert!==void 0){let c=!e&&typeof o.insert==="string"&&s===t.length-1&&r.right===null&&o.insert.slice(-1)===`
5
- `?o.insert.slice(0,-1):o.insert;if(typeof c!=="string"||c.length>0)Kn(n,this,r,c,o.attributes||{})}else if(o.retain!==void 0)As(n,this,r,o.retain,o.attributes||{});else if(o.delete!==void 0)Cs(n,r,o.delete)}});else this._pending.push(()=>this.applyDelta(t))}toDelta(t,e,n){this.doc??O();let r=[],s=new Map,o=this.doc,c="",l=this._start;function h(){if(c.length>0){let a={},u=!1;s.forEach((p,g)=>{u=!0,a[g]=p});let d={insert:c};if(u)d.attributes=a;r.push(d),c=""}}let f=()=>{while(l!==null){if(Tt(l,t)||e!==void 0&&Tt(l,e))switch(l.content.constructor){case K:{let a=s.get("ychange");if(t!==void 0&&!Tt(l,t)){if(a===void 0||a.user!==l.id.client||a.type!=="removed")h(),s.set("ychange",n?n("removed",l.id):{type:"removed"})}else if(e!==void 0&&!Tt(l,e)){if(a===void 0||a.user!==l.id.client||a.type!=="added")h(),s.set("ychange",n?n("added",l.id):{type:"added"})}else if(a!==void 0)h(),s.delete("ychange");c+=l.content.str;break}case W:case ut:{h();let a={insert:l.content.getContent()[0]};if(s.size>0){let u={};a.attributes=u,s.forEach((d,p)=>{u[p]=d})}r.push(a);break}case I:if(Tt(l,t))h(),Nt(s,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 r}insert(t,e,n){if(e.length<=0)return;let r=this.doc;if(r!==null)x(r,(s)=>{let o=qe(s,this,t,!n);if(!n)n={},o.currentAttributes.forEach((c,l)=>{n[l]=c});Kn(s,this,o,e,n)});else this._pending.push(()=>this.insert(t,e,n))}insertEmbed(t,e,n){let r=this.doc;if(r!==null)x(r,(s)=>{let o=qe(s,this,t,!n);Kn(s,this,o,e,n||{})});else this._pending.push(()=>this.insertEmbed(t,e,n||{}))}delete(t,e){if(e===0)return;let n=this.doc;if(n!==null)x(n,(r)=>{Cs(r,qe(r,this,t,!0),e)});else this._pending.push(()=>this.delete(t,e))}format(t,e,n){if(e===0)return;let r=this.doc;if(r!==null)x(r,(s)=>{let o=qe(s,this,t,!1);if(o.right===null)return;As(s,this,o,e,n)});else this._pending.push(()=>this.format(t,e,n))}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,(n)=>{ar(n,this,t,e)});else this._pending.push(()=>this.setAttribute(t,e))}getAttribute(t){return hr(this,t)}getAttributes(){return oi(this)}_write(t){t.writeTypeRef(Gc)}}var Ec=(t)=>new Bo;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===Dt||e.constructor===lt)&&e._start!==null)t=e._start;else while(t!==null){let n=t.next;if(n!==null){t=n;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 E{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 E?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 n=new ze(this,(r)=>r.nodeName&&r.nodeName.toUpperCase()===t).next();if(n.done)return null;else return n.value}querySelectorAll(t){return t=t.toUpperCase(),q(new ze(this,(e)=>e.nodeName&&e.nodeName.toUpperCase()===t))}_callObserver(t,e){sn(this,t,new di(this,e,t))}toString(){return ei(this,(t)=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,e={},n){let r=t.createDocumentFragment();if(n!==void 0)n._createAssociation(r,this);return se(this,(s)=>{r.insertBefore(s.toDOM(t,e,n),null)}),r}insert(t,e){if(this.doc!==null)x(this.doc,(n)=>{si(n,this,t,e)});else this._prelimContent.splice(t,0,...e)}insertAfter(t,e){if(this.doc!==null)x(this.doc,(n)=>{let r=t&&t instanceof E?t._item:t;Pe(n,this,r,e)});else{let n=this._prelimContent,r=t===null?0:n.findIndex((s)=>s===t)+1;if(r===0&&t!==null)throw R("Reference item not found");n.splice(r,0,...e)}}delete(t,e=1){if(this.doc!==null)x(this.doc,(n)=>{ii(n,this,t,e)});else this._prelimContent.splice(t,e)}toArray(){return ti(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return ni(this,t)}slice(t=0,e=this.length){return Qs(this,t,e)}forEach(t){se(this,t)}_write(t){t.writeTypeRef(Hc)}}var Ic=(t)=>new lt;class Dt 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((n,r)=>{this.setAttribute(r,n)}),this._prelimAttrs=null}_copy(){return new Dt(this.nodeName)}clone(){let t=new Dt(this.nodeName),e=this.getAttributes();return Vr(e,(n,r)=>{t.setAttribute(r,n)}),t.insert(0,this.toArray().map((n)=>n instanceof E?n.clone():n)),t}toString(){let t=this.getAttributes(),e=[],n=[];for(let c in t)n.push(c);n.sort();let r=n.length;for(let c=0;c<r;c++){let l=n[c];e.push(l+'="'+t[l]+'"')}let s=this.nodeName.toLocaleLowerCase(),o=e.length>0?" "+e.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}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,(n)=>{ar(n,this,t,e)});else this._prelimAttrs.set(t,e)}getAttribute(t){return hr(this,t)}hasAttribute(t){return ci(this,t)}getAttributes(t){return t?xc(this,t):oi(this)}toDOM(t=document,e={},n){let r=t.createElement(this.nodeName),s=this.getAttributes();for(let o in s){let c=s[o];if(typeof c==="string")r.setAttribute(o,c)}if(se(this,(o)=>{r.appendChild(o.toDOM(t,e,n))}),n!==void 0)n._createAssociation(r,this);return r}_write(t){t.writeTypeRef(zc),t.writeKey(this.nodeName)}}var Uc=(t)=>new Dt(t.readKey());class di extends le{constructor(t,e,n){super(t,n);this.childListChanged=!1,this.attributesChanged=new Set,e.forEach((r)=>{if(r===null)this.childListChanged=!0;else this.attributesChanged.add(r)})}}class Ze extends Ho{constructor(t){super();this.hookName=t}_copy(){return new Ze(this.hookName)}clone(){let t=new Ze(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(t=document,e={},n){let r=e[this.hookName],s;if(r!==void 0)s=r.createDom(this);else s=document.createElement(this.hookName);if(s.setAttribute("data-yjs-hook",this.hookName),n!==void 0)n._createAssociation(s,this);return s}_write(t){t.writeTypeRef(Jc),t.writeKey(this.hookName)}}var Tc=(t)=>new Ze(t.readKey());class Xe extends Bo{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,n){let r=t.createTextNode(this.toString());if(n!==void 0)n._createAssociation(r,this);return r}toString(){return this.toDelta().map((t)=>{let e=[];for(let r in t.attributes){let s=[];for(let o in t.attributes[r])s.push({key:o,value:t.attributes[r][o]});s.sort((o,c)=>o.key<c.key?-1:1),e.push({nodeName:r,attrs:s})}e.sort((r,s)=>r.nodeName<s.nodeName?-1:1);let n="";for(let r=0;r<e.length;r++){let s=e[r];n+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){let c=s.attrs[o];n+=` ${c.key}="${c.value}"`}n+=">"}n+=t.insert;for(let r=e.length-1;r>=0;r--)n+=`</${e[r].nodeName}>`;return n}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(Pc)}}var Ac=(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,n){throw L()}integrate(t,e){throw L()}}var Cc=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;Gs(t.doc.store,this)}write(t,e){t.writeInfo(Cc),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 Dc=(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 Bc=(t)=>new ie(t.readLen()),fi=(t,e)=>new Lc({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(fi(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 Oc=(t)=>new he(fi(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 vc=(t)=>new ut(t.readJSON());class I{constructor(t,e){this.key=t,this.value=e}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new I(this.key,this.value)}splice(t){throw L()}mergeWith(t){return!1}integrate(t,e){let n=e.parent;n._searchMarker=null,n._hasFormatting=!0}delete(t){}gc(t){}write(t,e){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}var Nc=(t)=>new I(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 n=this.arr.length;t.writeLen(n-e);for(let r=e;r<n;r++){let s=this.arr[r];t.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}var Rc=(t)=>{let e=t.readLen(),n=[];for(let r=0;r<e;r++){let s=t.readString();if(s==="undefined")n.push(void 0);else n.push(JSON.parse(s))}return new Qe(n)},Vc=Zt("node_env")==="development";class at{constructor(t){this.arr=t,Vc&&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 n=this.arr.length;t.writeLen(n-e);for(let r=e;r<n;r++){let s=this.arr[r];t.writeAny(s)}}getRef(){return 8}}var Mc=(t)=>{let e=t.readLen(),n=[];for(let r=0;r<e;r++)n.push(t.readAny());return new at(n)};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 n=this.str.charCodeAt(t-1);if(n>=55296&&n<=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 $c=(t)=>new K(t.readString()),Fc=[yc,bc,Ec,Uc,Ic,Tc,Ac],jc=0,qc=1,Gc=2,zc=3,Hc=4,Jc=5,Pc=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((n)=>{if(!n.deleted)n.delete(t);else if(n.id.clock<(t.beforeState.get(n.id.client)||0))t._mergeStructs.push(n)}),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((n)=>{while(n!==null)n.gc(t,!0),n=n.left}),this.type._map=new Map}write(t,e){this.type._write(t)}getRef(){return 7}}var Kc=(t)=>new W(Fc[t.readTypeRef()](t)),Qn=(t,e)=>{let n=e,r=0,s;do{if(r>0)n=m(n.client,n.clock+r);s=At(t,n),r=n.clock-s.id.clock,n=s.redone}while(n!==null&&s instanceof y);return{item:s,diff:r}},ur=(t,e)=>{while(t!==null&&t.keep!==e)t.keep=e,t=t.parent._item},Ye=(t,e,n)=>{let{client:r,clock:s}=e.id,o=new y(m(r,s+n),e,m(r,s+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));if(e.deleted)o.markDeleted();if(e.keep)o.keep=!0;if(e.redone!==null)o.redone=m(e.redone.client,e.redone.clock+n);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=n,o},Ds=(t,e)=>Vt(t,(n)=>ce(n.deletions,e)),pi=(t,e,n,r,s,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&&(!n.has(a)||pi(t,a,n,r,s,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&&!s){u=e;while(u!==null&&u.right!==null&&(u.right.redone||ce(r,u.right.id)||Ds(o.undoStack,u.right.id)||Ds(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,ur(C,!0),C.integrate(t,0),C};class y extends on{constructor(t,e,n,r,s,o,c,l){super(t,l.getLength());this.origin=n,this.left=e,this.right=r,this.rightOrigin=s,this.parent=o,this.parentSub=c,this.redone=null,this.content=l,this.info=this.content.isCountable()?an:0}set marker(t){if((this.info&xe)>0!==t)this.info^=xe}get marker(){return(this.info&xe)>0}get keep(){return(this.info&ln)>0}set keep(t){if(this.keep!==t)this.info^=ln}get countable(){return(this.info&an)>0}get deleted(){return(this.info&we)>0}set deleted(t){if(this.deleted!==t)this.info^=we}markDeleted(){this.info|=we}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=ks(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 n=At(e,this.parent);if(n.constructor===V)this.parent=null;else this.parent=n.content.type}return null}integrate(t,e){if(e>0)this.id.clock+=e,this.left=ks(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 n=this.left,r;if(n!==null)r=n.right;else 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;let s=new Set,o=new Set;while(r!==null&&r!==this.right){if(o.add(r),s.add(r),$e(this.origin,r.origin)){if(r.id.client<this.id.client)n=r,s.clear();else if($e(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(At(t.doc.store,r.origin))){if(!s.has(At(t.doc.store,r.origin)))n=r,s.clear()}else break;r=r.right}this.left=n}if(this.left!==null){let n=this.left.right;this.right=n,this.left.right=this}else{let n;if(this.parentSub!==null){n=this.parent._map.get(this.parentSub)||null;while(n!==null&&n.left!==null)n=n.left}else n=this.parent._start,this.parent._start=this;this.right=n}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(Gs(t.doc.store,this),this.content.integrate(t,this),Ss(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((n)=>{if(n.p===t){if(n.p=this,!this.deleted&&this.countable)n.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),Ss(t,e,this.parentSub),this.content.delete(t)}}gc(t,e){if(!this.deleted)throw v();if(this.content.gc(t),e)sc(t,this,new V(this.id,this.length));else this.content=new ie(this.length)}write(t,e){let n=e>0?m(this.id.client,this.id.clock+e-1):this.origin,r=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&Ft|(n===null?0:D)|(r===null?0:F)|(s===null?0:dt);if(t.writeInfo(o),n!==null)t.writeLeftID(n);if(r!==null)t.writeRightID(r);if(n===null&&r===null){let c=this.parent;if(c._item!==void 0){let l=c._item;if(l===null){let h=$s(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(s!==null)t.writeString(s)}this.content.write(t,e)}}var gi=(t,e)=>Wc[e&Ft](t),Wc=[()=>{v()},Bc,Rc,Dc,$c,vc,Nc,Kc,Mc,Oc,()=>{v()}],Zc=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(Zc),vt(t.restEncoder,this.length-e)}getMissing(t,e){return null}}var mi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},wi="__ $YJS$ __";if(mi[wi]===!0)console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");mi[wi]=!0;var nE=0,iE=1,rE=2,oE=3;class nm extends Error{constructor(t){super(t);this.name="EnvelopeError"}}function Xc(t){return T(t)&&"type"in t&&i(t.type)}function eS(t){let e=_a(),{type:n}=t;switch(t.type){case"doc-sync":{vt(e,nE),Sa(e,t.path),vt(e,t.epoch),Tr(e,t.body);break}case"awareness":{vt(e,iE),Tr(e,t.body);break}case"doc-close":{vt(e,rE),Sa(e,t.path);break}case"control":{vt(e,oE),Sa(e,JSON.stringify(t.message));break}default:throw new nm(`unknown-frame:${n}`)}return no(e)}function tS(t){try{let e=Ca(t),n=Rt(e);switch(n){case nE:{let r=ka(e),s=Rt(e);return{body:Mr(e),epoch:s,path:r,type:"doc-sync"}}case iE:return{body:Mr(e),type:"awareness"};case rE:return{path:ka(e),type:"doc-close"};case oE:{let r=JSON.parse(ka(e));if(!Xc(r))throw new nm("malformed-control");return{message:r,type:"control"}}default:throw new nm(`unknown-frame-type:${n}`)}}catch(e){if(e instanceof nm)throw e;throw new nm(`malformed-frame: ${e instanceof Error?e.message:String(e)}`)}}
6
- export{X0,jo,_a,Q0,no,vt,Sa,Tr,Ca,Mr,Rt,ka,yd,Fu,Lc,Qk,eE,tE,_w,tm,OI,bb,Ys,Sw,Ho,Cw,Bo,nE,iE,rE,oE,nm,eS,tS};
7
-
8
- //# debugId=3B0521C81B7F7E4864756E2164756E21
9
- //# sourceMappingURL=studio-bw6q5xjf.js.map
@@ -1,5 +0,0 @@
1
- import{i,ee,at,te,T,w,He,Ro,Qn,Rh,Ze}from"./studio-cffqvnzd.js";var rg=400;var Kc=350,b_=300,B$=30000;function Ur(e){return Array.isArray(e?.children)?e.children:[]}function og(e){if(!T(e))return e;if(Array.isArray(e)){for(let n of e)og(n);return e}let t=e,{children:r}=t;if(Ro(r))t.children=[r];if(Array.isArray(t.children))for(let n of t.children)og(n);if(t.$prototype==="Array"&&T(t.map))og(t.map);if(T(t.cases))for(let n of Object.values(t.cases))og(n);return e}function Dt(e){return e.length>=2?e.slice(0,-2):null}function ai(e){return e.at(-1)}function V1(e){return e.join("/")}function ao(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;return e.every((r,n)=>r===t[n])}function ul(e,t){if(e.length>t.length)return!1;return e.every((r,n)=>r===t[n])}function eu(e,t=[],r=0){let n=[];return u(e,t,r,n,!1),n}function u(e,t,r,n,o){if(i(e)||ee(e)||at(e)){if(!o)n.push({depth:r,node:e,nodeType:"text",path:t});return}if(e.$prototype==="Array"){if(!o)n.push({depth:r,node:e,nodeType:"map",path:t});let s=e.map;if(T(s))u(s,[...t,"map"],r+1,n,!1);return}if(!o)n.push({depth:r,node:e,nodeType:"element",path:t});if(e.$props&&Ze(e.tagName).includes("-")&&!Array.isArray(e.children))return;let{children:l}=e;if(Array.isArray(l))for(let s=0;s<l.length;s++){let a=[...t,"children",s];u(l[s],a,r+1,n,!1)}else if(Ro(l))u(l,[...t,"children"],r+1,n,!1);if(e.$switch&&T(e.cases))for(let[s,a]of Object.entries(e.cases)){let p=[...t,"cases",s];if(T(a)&&a.$ref)n.push({depth:r+1,node:a,nodeType:"case-ref",path:p});else if(T(a))n.push({depth:r+1,node:a,nodeType:"case",path:p}),u(a,p,r+2,n,!0)}}function lo(e){if(!e)return"?";if(e.$prototype==="Array"){let{items:n}=e;return`Repeater → ${(He(n)?n.$ref:void 0)||"items"}`}if(e.$title)return e.$title;if(e.$id)return e.$id;if(e.tagName==="slot"){let n=e.attributes?.name;return i(n)&&n.trim()?`slot: ${n.trim()}`:"slot"}let t=Ze(e.tagName)||"div",r=e.$switch?" ⇆":"";if(i(e.textContent)&&e.textContent.length>0)return`${t} — ${e.textContent.slice(0,24)}${r}`;return t+r}var O=null;function oc(e){O=e}function dn(){return O}function vh(e){return T(e)}function wh(e){if(Array.isArray(e))return e.map((r)=>wh(r));if(!Qn(e))return e;let t={};for(let[r,n]of Object.entries(e)){if(r.startsWith("on")&&Rh(n))continue;if(r==="children")t.children=Array.isArray(n)?n.map((o)=>wh(o)):wh(n);else if(r==="cases"&&vh(n)){let o={};for(let[l,s]of Object.entries(n))o[l]=wh(s);t.cases=o}else if(r==="state"&&vh(n)){let o={};for(let[l,s]of Object.entries(n)){if(w(s)&&s.timing==="server")continue;o[l]=s}t.state=o}else t[r]=n}return t}var y_=null,xh=null,W1=null,z1=null,U1=null;function c(e){let t=document.querySelector(`#${e}`);return t instanceof HTMLElement?t:null}function V$(){y_=c("activity-bar"),xh=c("left-panel"),W1=c("right-panel"),z1=c("toolbar"),U1=c("statusbar")}function nf(e,t){if(!e)throw TypeError(`#${t} is not in the shell yet; initShellRefs() has not found it`);return e}var rf=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),q1=[":hover",":focus",":active",":focus-within",":focus-visible",":disabled",":first-child",":last-child","::before","::after","::placeholder"];function av(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}var f=new Map;function lv(e,t,r){let n=t??rg;return(...o)=>{clearTimeout(f.get(e)),f.set(e,setTimeout(()=>{f.delete(e),r(...o)},n))}}function W$(e){clearTimeout(f.get(e)),f.delete(e)}var x=new Map;function b(e){return(T(e)||te(e))&&"then"in e&&te(e.then)}var d=0;function z$(){return d}function m(e,t){d+=1;let r=()=>{d-=1},n=null;try{let o=t();if(b(o))n=o}catch(o){console.error(`Renderer "${e}" failed:`,o)}if(!n){r();return}n.then(r,(o)=>{console.error(`Renderer "${e}" failed:`,o),r()})}function _h(e,t){x.set(e,t)}function qr(){for(let[e,t]of x.entries())m(e,t)}function Bi(...e){for(let t of e){let r=x.get(t);if(!r)continue;m(t,r)}}function Gc(e,t){if(e){if(t.selection!==void 0)e.session.selection=t.selection;if(t.hover!==void 0)e.session.hover=t.hover;if(t.clipboard!==void 0)e.session.clipboard=t.clipboard;if(t.ui)Object.assign(e.session.ui,t.ui);if(t.canvas)Object.assign(e.session.canvas,t.canvas)}}function ls(e,t,r){if(e)e.session.ui[t]=r}function U$(e,t){if(e)Object.assign(e.session.canvas,t)}
2
- export{rg,Kc,b_,B$,Ur,og,Dt,ai,V1,ao,ul,eu,lo,O,oc,dn,vh,wh,y_,xh,W1,z1,U1,V$,nf,rf,q1,av,lv,W$,z$,_h,qr,Bi,Gc,ls,U$};
3
-
4
- //# debugId=E0622C814983C49364756E2164756E21
5
- //# sourceMappingURL=studio-c7q0t9x1.js.map