@jxsuite/studio 4.0.0 → 5.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 (613) hide show
  1. package/README.md +1 -1
  2. package/data/elements-meta.json +5 -15
  3. package/data/html-meta.json +51 -6
  4. package/dist/chunks/{2020-xp8vnwma.js → 2020-g79n01v9.js} +14 -14
  5. package/dist/chunks/action-group-sp6tna8v.js +118 -0
  6. package/dist/chunks/adapter-nj7tnjfn.js +13 -0
  7. package/dist/chunks/cf-account-picker-fyf63pmy.js +495 -0
  8. package/dist/chunks/cf-settings-71bv5zn9.js +20 -0
  9. package/dist/chunks/color-area-v17df7b8.js +154 -0
  10. package/dist/chunks/color-field-anwybnkn.js +208 -0
  11. package/dist/chunks/color-slider-44ez96fc.js +79 -0
  12. package/dist/chunks/color-xgg3kfw7.js +35 -0
  13. package/dist/chunks/combobox-5e7jev23.js +236 -0
  14. package/dist/chunks/components-2w1f35qs.js +18 -0
  15. package/dist/chunks/content-source-3wqeas45.js +46 -0
  16. package/dist/chunks/convert-to-repeater-d0cgnb6d.js +639 -0
  17. package/dist/chunks/dialog-s890b918.js +85 -0
  18. package/dist/chunks/editor-3qhbg51x.js +35 -0
  19. package/dist/chunks/entry-commands-d6g50j7s.js +42 -0
  20. package/dist/chunks/extension-sections-fy7q4fe9.js +651 -0
  21. package/dist/chunks/file-ops-3btj6st0.js +47 -0
  22. package/dist/chunks/files-ef8fgs3w.js +72 -0
  23. package/dist/chunks/format-host-3c33nwr8.js +40 -0
  24. package/dist/chunks/fs-events-13tj6sex.js +18 -0
  25. package/dist/chunks/git-panel-4wp2rn9b.js +49 -0
  26. package/dist/chunks/icons-yy10wk9r.js +402 -0
  27. package/dist/chunks/iframe-entry-15g3n6xv.js +114 -0
  28. package/dist/chunks/iframe-entry-b27vq81n.js +203 -0
  29. package/dist/chunks/iframe-entry-nbyxee1y.js +154 -0
  30. package/dist/chunks/iframe-host-jgesd924.js +115 -0
  31. package/dist/chunks/{index-nj44jpzj.js → index-mdmyx6s2.js} +11 -11
  32. package/dist/chunks/index-n4j7qxyr.js +109 -0
  33. package/dist/chunks/{javascript-q8kpmfah.js → javascript-xvrfrpkb.js} +8 -9
  34. package/dist/chunks/{jsonMode-dkr040ga.js → jsonMode-tyx2kj6p.js} +526 -527
  35. package/dist/chunks/jx-validate-j0wxk72w.js +15 -0
  36. package/dist/chunks/layers-1nq5evsh.js +29 -0
  37. package/dist/chunks/layers-panel-ar2gh90g.js +40 -0
  38. package/dist/chunks/listbox-6v2ac08j.js +44 -0
  39. package/dist/chunks/lit-html-m244w9nh.js +17 -0
  40. package/dist/chunks/media-picker-2qbetq73.js +33 -0
  41. package/dist/chunks/menu-q99sy9rf.js +285 -0
  42. package/dist/chunks/menu-rf7n72mf.js +14 -0
  43. package/dist/chunks/{monaco-binding-rj6xpx9y.js → monaco-binding-sw6en4dw.js} +12 -15
  44. package/dist/chunks/monaco-buffer-bhy3hb6m.js +24 -0
  45. package/dist/chunks/{monaco-setup-rws7k4br.js → monaco-setup-8r62fj6y.js} +27 -37
  46. package/dist/chunks/notify-628t0anh.js +21 -0
  47. package/dist/chunks/number-field-5cndyft8.js +72 -0
  48. package/dist/chunks/parse-0zx14y15.js +10 -0
  49. package/dist/chunks/platform-ts9cg1a4.js +15 -0
  50. package/dist/chunks/popover-47z3ytva.js +25 -0
  51. package/dist/chunks/publish-panel-98f7sr3g.js +27 -0
  52. package/dist/chunks/quick-search-srzz83k2.js +45 -0
  53. package/dist/chunks/references-n553f0e1.js +26 -0
  54. package/dist/chunks/right-panel-rrgx2dn3.js +45 -0
  55. package/dist/chunks/section-registry-5pq32t0q.js +25 -0
  56. package/dist/chunks/select-2r16ez41.js +49 -0
  57. package/dist/chunks/split-g7nm1rgb.js +191 -0
  58. package/dist/chunks/studio-0hqbpbd0.js +62 -0
  59. package/dist/chunks/studio-18avnhjp.js +2430 -0
  60. package/dist/chunks/{studio-kryvsw6j.js → studio-1k325pwf.js} +48 -48
  61. package/dist/chunks/{studio-hbtp0eh1.js → studio-25hkdrkw.js} +356 -85
  62. package/dist/chunks/studio-26d7myd1.js +258 -0
  63. package/dist/chunks/{studio-p8j86wag.js → studio-38emantv.js} +22 -5
  64. package/dist/chunks/studio-3gxv60tn.js +422 -0
  65. package/dist/chunks/{studio-8swrjbny.js → studio-3hxkd92t.js} +275 -163
  66. package/dist/chunks/studio-4m0haseg.js +185 -0
  67. package/dist/chunks/{studio-ynxwkrzd.js → studio-4wbb9ct0.js} +1953 -1785
  68. package/dist/chunks/{studio-gv8vvshc.js → studio-5523bpzt.js} +11 -11
  69. package/dist/chunks/{studio-5q69gfag.js → studio-57mf66w2.js} +1753 -2484
  70. package/dist/chunks/studio-5jy81t3s.js +17463 -0
  71. package/dist/chunks/studio-5rt7sqa0.js +1168 -0
  72. package/dist/chunks/studio-5te5tqng.js +81 -0
  73. package/dist/chunks/{studio-p4ngc046.js → studio-6ewqv390.js} +9 -9
  74. package/dist/chunks/{studio-9ab8gqsm.js → studio-6nzaktvy.js} +7 -7
  75. package/dist/chunks/studio-6xa21ej9.js +28 -0
  76. package/dist/chunks/{studio-5ehhackm.js → studio-727xh0e3.js} +19 -19
  77. package/dist/chunks/{studio-eenfkt4e.js → studio-79y5sz51.js} +52 -38
  78. package/dist/chunks/{studio-4q0wznzf.js → studio-7e11jpa9.js} +461 -145
  79. package/dist/chunks/{studio-q7v10cg2.js → studio-7r42c6ca.js} +17 -7
  80. package/dist/chunks/studio-7xptrg0j.js +954 -0
  81. package/dist/chunks/{studio-cft9r4r7.js → studio-81390n6f.js} +22 -22
  82. package/dist/chunks/{studio-q43a5y9h.js → studio-8jn5yhyn.js} +16 -16
  83. package/dist/chunks/studio-8qtrpzr3.js +839 -0
  84. package/dist/chunks/{studio-dg7zyt5x.js → studio-98b3z07n.js} +1 -1
  85. package/dist/chunks/studio-9xxz1q69.js +1356 -0
  86. package/dist/chunks/studio-akbww0j5.js +13615 -0
  87. package/dist/chunks/studio-arfpe389.js +195 -0
  88. package/dist/chunks/{studio-2zkz8evn.js → studio-az3zd49t.js} +473 -281
  89. package/dist/chunks/studio-cpvb2ed1.js +1171 -0
  90. package/dist/chunks/{studio-9r6j5ev1.js → studio-d0300636.js} +5078 -19
  91. package/dist/chunks/{studio-bgxt93ga.js → studio-d055c37e.js} +13 -13
  92. package/dist/chunks/studio-d1ja2x9r.js +362 -0
  93. package/dist/chunks/{studio-b9b6t1dg.js → studio-e1f24eff.js} +5664 -5666
  94. package/dist/chunks/{studio-4pqqxbrt.js → studio-em9nw8eh.js} +301 -112
  95. package/dist/chunks/studio-erdatzvp.js +1190 -0
  96. package/dist/chunks/{studio-g1wdche0.js → studio-esrxgwh6.js} +80 -80
  97. package/dist/chunks/studio-fabxk6r9.js +2811 -0
  98. package/dist/chunks/{studio-3n4ndrzh.js → studio-h4nvnjvz.js} +303 -303
  99. package/dist/chunks/studio-hhvs4sdg.js +195 -0
  100. package/dist/chunks/{studio-68n67094.js → studio-kcgff4r0.js} +15 -18
  101. package/dist/chunks/{studio-685s0ytq.js → studio-nqgawfks.js} +572 -572
  102. package/dist/chunks/{studio-xrapxwwc.js → studio-p1dw8wfw.js} +55 -29
  103. package/dist/chunks/studio-pm6hgy7r.js +4763 -0
  104. package/dist/chunks/studio-q0a3yk4n.js +33 -0
  105. package/dist/chunks/{studio-wcy8trfx.js → studio-q3x06vmj.js} +23 -22
  106. package/dist/chunks/studio-qahxvnan.js +111 -0
  107. package/dist/chunks/{studio-53n8bp04.js → studio-r6xmmtfh.js} +1 -1
  108. package/dist/chunks/{studio-kjjsjak4.js → studio-rkstz940.js} +3661 -6136
  109. package/dist/chunks/{studio-tvgyw9xw.js → studio-rnyf3f8e.js} +83 -250
  110. package/dist/chunks/studio-rpyah2ew.js +2805 -0
  111. package/dist/chunks/studio-rs76k67r.js +12 -0
  112. package/dist/chunks/{studio-yxrkyv8a.js → studio-s6z853aq.js} +12108 -11766
  113. package/dist/chunks/{studio-sf7zjgv1.js → studio-sgdc5pfc.js} +8 -8
  114. package/dist/chunks/studio-tb3ev01j.js +763 -0
  115. package/dist/chunks/{studio-t5wqwzdh.js → studio-tjjk7jvk.js} +1 -1
  116. package/dist/chunks/studio-vhv5tgxm.js +51 -0
  117. package/dist/chunks/{studio-htsf0w6m.js → studio-vz68yn9e.js} +31 -154
  118. package/dist/chunks/studio-wqpngpsk.js +174 -0
  119. package/dist/chunks/{studio-eesa1myv.js → studio-x3rty6tr.js} +58 -58
  120. package/dist/chunks/studio-xsykpvsh.js +8448 -0
  121. package/dist/chunks/{studio-92ab2jqe.js → studio-y9zedyjn.js} +14 -14
  122. package/dist/chunks/studio-yxa81f45.js +12 -0
  123. package/dist/chunks/swatch-group-t0n6h2rn.js +139 -0
  124. package/dist/chunks/tabs-wbp1cdws.js +156 -0
  125. package/dist/chunks/textfield-abk6qyee.js +73 -0
  126. package/dist/chunks/toast-780pvfbv.js +27 -0
  127. package/dist/chunks/toast-host-3sqv46sn.js +116 -0
  128. package/dist/chunks/toolbar-xbh5bhtr.js +194 -0
  129. package/dist/chunks/tooltip-eptb614w.js +369 -0
  130. package/dist/chunks/tree-a73p0pqm.js +367 -0
  131. package/dist/chunks/{tsMode-76kr53q0.js → tsMode-jy4m86rv.js} +83 -85
  132. package/dist/chunks/workspace-wrew8zk4.js +69 -0
  133. package/dist/chunks/{ws-client-6shc5rze.js → ws-client-ny4zc51r.js} +20 -22
  134. package/dist/iframe-entry.js +1812 -698
  135. package/dist/manifest.json +7 -0
  136. package/dist/studio.js +52900 -36573
  137. package/dist/workers/editor.worker.js +1040 -1085
  138. package/dist/workers/json.worker.js +1946 -1991
  139. package/dist/workers/ts.worker.js +4960 -5005
  140. package/favicon.ico +0 -0
  141. package/index.html +2 -0
  142. package/package.json +22 -55
  143. package/src/about/about-modal.ts +73 -123
  144. package/src/browse/library-commands.ts +20 -49
  145. package/src/browse/library-layouts.ts +87 -218
  146. package/src/browse/library-pane.ts +406 -438
  147. package/src/canvas/canvas-helpers.ts +0 -49
  148. package/src/canvas/canvas-live-render.ts +25 -2
  149. package/src/canvas/canvas-render.ts +666 -231
  150. package/src/canvas/canvas-surface.ts +0 -1
  151. package/src/canvas/canvas-utils.ts +310 -117
  152. package/src/canvas/dialog-path.ts +76 -0
  153. package/src/canvas/dialog-state.ts +67 -0
  154. package/src/canvas/diff-marks.ts +252 -0
  155. package/src/canvas/diff-toolbar.ts +349 -0
  156. package/src/canvas/diff-view.ts +123 -0
  157. package/src/canvas/edit-width-drag.ts +187 -0
  158. package/src/canvas/edit-width.ts +150 -0
  159. package/src/canvas/iframe-entry.ts +125 -8
  160. package/src/canvas/iframe-host.ts +271 -15
  161. package/src/canvas/iframe-interaction.ts +133 -13
  162. package/src/canvas/iframe-patch.ts +7 -1
  163. package/src/canvas/iframe-position.ts +5 -6
  164. package/src/canvas/iframe-protocol.ts +106 -5
  165. package/src/canvas/iframe-render.ts +373 -5
  166. package/src/canvas/iframe-slash.ts +2 -2
  167. package/src/canvas/iframe-subtree.ts +5 -8
  168. package/src/canvas/path-mapping.ts +25 -3
  169. package/src/canvas/popover-path.ts +106 -0
  170. package/src/canvas/popover-state.ts +155 -0
  171. package/src/canvas/surface-registry.ts +21 -10
  172. package/src/collab/presence-chips.ts +51 -73
  173. package/src/commands/app-commands.ts +10 -0
  174. package/src/commands/budget.ts +12 -0
  175. package/src/commands/command-args.ts +369 -6
  176. package/src/commands/defaults.ts +44 -14
  177. package/src/commands/live-context.ts +11 -5
  178. package/src/commands/reference.ts +12 -2
  179. package/src/commands/registry.ts +165 -8
  180. package/src/content/entry-commands.ts +16 -23
  181. package/src/content/entry-editor.ts +144 -101
  182. package/src/editor/canvas-slash-bridge.ts +2 -2
  183. package/src/editor/context-menu.ts +49 -200
  184. package/src/editor/convert-to-component.ts +42 -82
  185. package/src/editor/convert-to-repeater.ts +132 -173
  186. package/src/editor/inline-edit.ts +11 -0
  187. package/src/editor/shortcuts.ts +65 -26
  188. package/src/editor/slash-menu.ts +150 -157
  189. package/src/files/file-ops.ts +117 -11
  190. package/src/files/files.ts +949 -664
  191. package/src/files/json-layout.ts +474 -0
  192. package/src/files/media-paths.ts +13 -42
  193. package/src/files/media-usage.ts +41 -131
  194. package/src/files/serialize-document.ts +8 -1
  195. package/src/format/convert-file.ts +16 -10
  196. package/src/format/format-host.ts +50 -1
  197. package/src/github/github-auth.ts +71 -29
  198. package/src/github/github-publish.ts +57 -65
  199. package/src/grid/cell-editors.ts +46 -4
  200. package/src/grid/cell-popovers.ts +65 -62
  201. package/src/grid/grid-open.ts +86 -64
  202. package/src/grid/grid-panel.ts +390 -469
  203. package/src/grid/redirects-grid.ts +40 -44
  204. package/src/hosting/document.ts +2 -0
  205. package/src/hosting/layout.ts +10 -0
  206. package/src/i18n/i18n-commands.ts +127 -62
  207. package/src/media/media-pane.ts +83 -133
  208. package/src/new-project/add-repo-modal.ts +125 -176
  209. package/src/new-project/import-tab.ts +201 -250
  210. package/src/new-project/location-fields.ts +101 -165
  211. package/src/new-project/new-project-modal.ts +376 -367
  212. package/src/packages/jxsuite-update.ts +76 -18
  213. package/src/panels/activity-panel.ts +137 -104
  214. package/src/panels/ai-chat/chat-markdown.ts +15 -13
  215. package/src/panels/ai-chat/chat-view.ts +307 -472
  216. package/src/panels/ai-chat/composer.ts +175 -153
  217. package/src/panels/ai-chat/sessions-view.ts +31 -62
  218. package/src/panels/ai-panel.ts +210 -185
  219. package/src/panels/block-action-bar.ts +437 -643
  220. package/src/panels/bottom-dock.ts +112 -47
  221. package/src/panels/chat-panel.ts +19 -14
  222. package/src/panels/data-explorer.ts +141 -102
  223. package/src/panels/data-grid.ts +183 -150
  224. package/src/panels/dnd.ts +75 -20
  225. package/src/panels/editors.ts +26 -19
  226. package/src/panels/elements-panel.ts +243 -186
  227. package/src/panels/empty-state.ts +26 -42
  228. package/src/panels/events-panel.ts +950 -729
  229. package/src/panels/formula-workspace.ts +434 -207
  230. package/src/panels/frontmatter-fields.ts +185 -153
  231. package/src/panels/frontmatter-panel.ts +411 -187
  232. package/src/panels/git-diff-open.ts +148 -0
  233. package/src/panels/git-panel.ts +679 -605
  234. package/src/panels/head-panel.ts +617 -435
  235. package/src/panels/i18n-panel.ts +153 -133
  236. package/src/panels/imports-panel.ts +388 -414
  237. package/src/panels/jump-bar.ts +174 -147
  238. package/src/panels/layers-panel.ts +785 -671
  239. package/src/panels/left-panel.ts +166 -94
  240. package/src/panels/navigator-panels.ts +1 -1
  241. package/src/panels/pane-context.ts +529 -677
  242. package/src/panels/pane-grid.ts +265 -241
  243. package/src/panels/panel-registry.ts +15 -4
  244. package/src/panels/problems-panel.ts +177 -99
  245. package/src/panels/properties-panel.ts +1525 -966
  246. package/src/panels/provenance.ts +31 -113
  247. package/src/panels/quick-search.ts +217 -172
  248. package/src/panels/right-panel.ts +135 -169
  249. package/src/panels/seo-modal.ts +346 -167
  250. package/src/panels/settings-menu.ts +109 -646
  251. package/src/panels/settings-pane.ts +102 -86
  252. package/src/panels/signals-panel.ts +1318 -1172
  253. package/src/panels/statement-editor.ts +556 -428
  254. package/src/panels/style-panel.ts +1367 -630
  255. package/src/panels/style-utils.ts +36 -32
  256. package/src/panels/stylebook-doc.ts +30 -73
  257. package/src/panels/stylebook-layers-panel.ts +202 -109
  258. package/src/panels/stylebook-panel.ts +124 -88
  259. package/src/panels/tab-strip.ts +385 -287
  260. package/src/platforms/cloud.ts +347 -86
  261. package/src/platforms/devserver.ts +13 -0
  262. package/src/publish/deploy-checklist.ts +124 -78
  263. package/src/publish/publish-commands.ts +4 -12
  264. package/src/publish/publish-panel.ts +165 -299
  265. package/src/services/a11y-report.ts +100 -43
  266. package/src/services/ai-command-tools.ts +468 -0
  267. package/src/services/ai-import-tools.ts +50 -12
  268. package/src/services/ai-models.ts +108 -1
  269. package/src/services/ai-session-store.ts +6 -0
  270. package/src/services/ai-system-prompt.ts +110 -18
  271. package/src/services/ai-tools.ts +28 -143
  272. package/src/services/ai-write-report.ts +174 -0
  273. package/src/services/context-manager.ts +12 -1
  274. package/src/services/document-assistant.ts +50 -2
  275. package/src/services/idle.ts +16 -14
  276. package/src/services/live-surfaces.ts +237 -0
  277. package/src/services/model-uri.ts +75 -0
  278. package/src/services/notify.ts +63 -6
  279. package/src/services/popover-report.ts +325 -0
  280. package/src/services/surface-registry.ts +56 -0
  281. package/src/services/tool-executor.ts +17 -0
  282. package/src/settings/contexts-section.ts +301 -299
  283. package/src/settings/contributed-section.ts +361 -222
  284. package/src/settings/css-vars-editor.ts +320 -325
  285. package/src/settings/defs-editor.ts +572 -535
  286. package/src/settings/dependencies-editor.ts +79 -107
  287. package/src/settings/extension-commands.ts +379 -0
  288. package/src/settings/extension-rows.ts +113 -0
  289. package/src/settings/extensions-section.ts +287 -0
  290. package/src/settings/general-settings.ts +130 -181
  291. package/src/settings/head-editor.ts +10 -305
  292. package/src/settings/locales-section.ts +146 -196
  293. package/src/settings/preferences-accounts.ts +193 -12
  294. package/src/settings/preferences-dialog.ts +384 -307
  295. package/src/settings/project-sections.ts +108 -181
  296. package/src/settings/schema-field-ui.ts +11 -399
  297. package/src/settings/section-registry.ts +8 -1
  298. package/src/settings/settings-document.ts +31 -29
  299. package/src/shell/tree.ts +42 -87
  300. package/src/shell.ts +48 -36
  301. package/src/studio.ts +90 -67
  302. package/src/style/token-ref.ts +0 -39
  303. package/src/surfaces/about.json +263 -0
  304. package/src/surfaces/about.ts +163 -0
  305. package/src/surfaces/add-repo.json +486 -0
  306. package/src/surfaces/add-repo.ts +236 -0
  307. package/src/surfaces/ai-chat.json +2185 -0
  308. package/src/surfaces/ai-chat.ts +549 -0
  309. package/src/surfaces/ai-credentials-form.json +332 -0
  310. package/src/surfaces/ai-credentials-form.ts +151 -0
  311. package/src/surfaces/ai-managed-connect.json +108 -0
  312. package/src/surfaces/ai-managed-connect.ts +123 -0
  313. package/src/surfaces/ai-model-picker.json +114 -0
  314. package/src/surfaces/ai-model-picker.ts +139 -0
  315. package/src/surfaces/block-action-bar.json +640 -0
  316. package/src/surfaces/block-action-bar.ts +368 -0
  317. package/src/surfaces/bottom-dock.json +154 -0
  318. package/src/surfaces/bottom-dock.ts +125 -0
  319. package/src/surfaces/canvas-stage.json +444 -0
  320. package/src/surfaces/canvas-stage.ts +253 -0
  321. package/src/surfaces/cf-account-picker.json +300 -0
  322. package/src/surfaces/cf-account-picker.ts +214 -0
  323. package/src/surfaces/commandbar.json +984 -0
  324. package/src/{panels/toolbar.ts → surfaces/commandbar.ts} +414 -389
  325. package/src/surfaces/convert-repeater.json +309 -0
  326. package/src/surfaces/convert-repeater.ts +276 -0
  327. package/src/surfaces/data-actions.json +157 -0
  328. package/src/surfaces/data-actions.ts +115 -0
  329. package/src/surfaces/dialog.json +289 -0
  330. package/src/surfaces/dialog.ts +343 -0
  331. package/src/surfaces/diff-toolbar.json +266 -0
  332. package/src/surfaces/diff-toolbar.ts +139 -0
  333. package/src/surfaces/doc-header.json +739 -0
  334. package/src/surfaces/doc-header.ts +223 -0
  335. package/src/surfaces/empty-state.json +152 -0
  336. package/src/surfaces/empty-state.ts +173 -0
  337. package/src/surfaces/entry-editor.json +281 -0
  338. package/src/surfaces/entry-editor.ts +191 -0
  339. package/src/surfaces/expression-editor.json +977 -0
  340. package/src/surfaces/expression-editor.ts +266 -0
  341. package/src/surfaces/files-panel.json +592 -0
  342. package/src/surfaces/files-panel.ts +301 -0
  343. package/src/surfaces/formula-palette.json +364 -0
  344. package/src/surfaces/formula-palette.ts +340 -0
  345. package/src/surfaces/git-panel.json +1822 -0
  346. package/src/surfaces/git-panel.ts +272 -0
  347. package/src/surfaces/github-auth.json +112 -0
  348. package/src/surfaces/github-auth.ts +139 -0
  349. package/src/surfaces/github-publish.json +206 -0
  350. package/src/surfaces/github-publish.ts +169 -0
  351. package/src/surfaces/grid-cell.json +218 -0
  352. package/src/surfaces/grid-cell.ts +120 -0
  353. package/src/surfaces/grid-open.json +147 -0
  354. package/src/surfaces/grid-open.ts +87 -0
  355. package/src/surfaces/grid-panel.json +706 -0
  356. package/src/surfaces/grid-panel.ts +206 -0
  357. package/src/surfaces/grid-replace.json +179 -0
  358. package/src/surfaces/grid-replace.ts +89 -0
  359. package/src/surfaces/grid-views.json +446 -0
  360. package/src/surfaces/grid-views.ts +172 -0
  361. package/src/surfaces/inspector-dock.json +187 -0
  362. package/src/surfaces/inspector-dock.ts +161 -0
  363. package/src/surfaces/jump-bar.json +243 -0
  364. package/src/surfaces/jump-bar.ts +129 -0
  365. package/src/surfaces/jxsuite-update.json +146 -0
  366. package/src/surfaces/jxsuite-update.ts +149 -0
  367. package/src/surfaces/library-pane.json +1509 -0
  368. package/src/surfaces/library-pane.ts +363 -0
  369. package/src/surfaces/logic-panel.json +1949 -0
  370. package/src/surfaces/logic-panel.ts +369 -0
  371. package/src/surfaces/logic-workspace.json +685 -0
  372. package/src/surfaces/logic-workspace.ts +238 -0
  373. package/src/surfaces/media-browser.json +303 -0
  374. package/src/surfaces/media-browser.ts +145 -0
  375. package/src/surfaces/media-field.json +163 -0
  376. package/src/surfaces/media-field.ts +116 -0
  377. package/src/surfaces/media-pane.json +513 -0
  378. package/src/surfaces/media-pane.ts +197 -0
  379. package/src/surfaces/menu.json +232 -0
  380. package/src/surfaces/menu.ts +375 -0
  381. package/src/surfaces/navigator-dock.json +113 -0
  382. package/src/surfaces/navigator-dock.ts +130 -0
  383. package/src/surfaces/new-project.json +1654 -0
  384. package/src/surfaces/new-project.ts +411 -0
  385. package/src/surfaces/palette.json +535 -0
  386. package/src/surfaces/pane-context.json +1497 -0
  387. package/src/surfaces/pane-context.ts +513 -0
  388. package/src/surfaces/pane-grid.json +188 -0
  389. package/src/surfaces/pane-grid.ts +250 -0
  390. package/src/surfaces/panel-activity.json +563 -0
  391. package/src/surfaces/panel-activity.ts +187 -0
  392. package/src/surfaces/panel-data.json +141 -0
  393. package/src/surfaces/panel-data.ts +156 -0
  394. package/src/surfaces/panel-deploy-checklist.json +283 -0
  395. package/src/surfaces/panel-deploy-checklist.ts +175 -0
  396. package/src/surfaces/panel-elements.json +367 -0
  397. package/src/surfaces/panel-elements.ts +175 -0
  398. package/src/surfaces/panel-i18n.json +569 -0
  399. package/src/surfaces/panel-i18n.ts +212 -0
  400. package/src/surfaces/panel-imports.json +780 -0
  401. package/src/surfaces/panel-imports.ts +209 -0
  402. package/src/surfaces/panel-outline.json +734 -0
  403. package/src/surfaces/panel-outline.ts +326 -0
  404. package/src/surfaces/panel-page.json +1017 -0
  405. package/src/surfaces/panel-page.ts +240 -0
  406. package/src/surfaces/panel-problems.json +497 -0
  407. package/src/surfaces/panel-problems.ts +157 -0
  408. package/src/surfaces/panel-signals.json +1973 -0
  409. package/src/surfaces/panel-signals.ts +436 -0
  410. package/src/surfaces/panel-stylebook-layers.json +317 -0
  411. package/src/surfaces/panel-stylebook-layers.ts +155 -0
  412. package/src/surfaces/preferences.json +850 -0
  413. package/src/surfaces/preferences.ts +332 -0
  414. package/src/surfaces/progress-modal.json +110 -0
  415. package/src/surfaces/progress-modal.ts +150 -0
  416. package/src/surfaces/properties-panel.json +1578 -0
  417. package/src/surfaces/properties-panel.ts +337 -0
  418. package/src/surfaces/publish.json +945 -0
  419. package/src/surfaces/publish.ts +392 -0
  420. package/src/surfaces/push-plan.json +110 -0
  421. package/src/surfaces/push-plan.ts +87 -0
  422. package/src/surfaces/rail.json +255 -0
  423. package/src/surfaces/rail.ts +206 -0
  424. package/src/surfaces/reference-field.json +191 -0
  425. package/src/surfaces/reference-field.ts +168 -0
  426. package/src/surfaces/schema-builder.json +1011 -0
  427. package/src/surfaces/schema-builder.ts +181 -0
  428. package/src/surfaces/schema-form.json +1013 -0
  429. package/src/surfaces/schema-form.ts +287 -0
  430. package/src/surfaces/secret-field.json +60 -0
  431. package/src/surfaces/secret-field.ts +146 -0
  432. package/src/surfaces/seo.json +932 -0
  433. package/src/surfaces/seo.ts +334 -0
  434. package/src/surfaces/settings-contexts.json +538 -0
  435. package/src/surfaces/settings-contexts.ts +196 -0
  436. package/src/surfaces/settings-contributed.json +489 -0
  437. package/src/surfaces/settings-contributed.ts +199 -0
  438. package/src/surfaces/settings-css-vars.json +820 -0
  439. package/src/surfaces/settings-css-vars.ts +199 -0
  440. package/src/surfaces/settings-defs.json +1363 -0
  441. package/src/surfaces/settings-defs.ts +232 -0
  442. package/src/surfaces/settings-deploy.json +108 -0
  443. package/src/surfaces/settings-deploy.ts +135 -0
  444. package/src/surfaces/settings-extensions.json +486 -0
  445. package/src/surfaces/settings-extensions.ts +201 -0
  446. package/src/surfaces/settings-head.json +779 -0
  447. package/src/surfaces/settings-head.ts +397 -0
  448. package/src/surfaces/settings-locales.json +420 -0
  449. package/src/surfaces/settings-locales.ts +137 -0
  450. package/src/surfaces/settings-overview.json +423 -0
  451. package/src/surfaces/settings-overview.ts +218 -0
  452. package/src/surfaces/settings-packages.json +549 -0
  453. package/src/surfaces/settings-packages.ts +158 -0
  454. package/src/surfaces/settings-pane.json +147 -0
  455. package/src/surfaces/settings-pane.ts +150 -0
  456. package/src/surfaces/settings-rawjson.json +104 -0
  457. package/src/surfaces/settings-rawjson.ts +107 -0
  458. package/src/surfaces/shell.json +99 -0
  459. package/src/surfaces/shell.ts +30 -0
  460. package/src/surfaces/slash-menu.json +180 -0
  461. package/src/surfaces/slash-menu.ts +272 -0
  462. package/src/surfaces/statements.json +607 -0
  463. package/src/surfaces/statements.ts +238 -0
  464. package/src/surfaces/statusbar.json +94 -0
  465. package/src/{panels → surfaces}/statusbar.ts +163 -90
  466. package/src/surfaces/style-panel.json +1643 -0
  467. package/src/surfaces/style-panel.ts +338 -0
  468. package/src/surfaces/stylebook-chrome.json +122 -0
  469. package/src/surfaces/stylebook-chrome.ts +122 -0
  470. package/src/surfaces/tab-strip.json +448 -0
  471. package/src/surfaces/tab-strip.ts +200 -0
  472. package/src/surfaces/target-line.json +419 -0
  473. package/src/surfaces/target-line.ts +349 -0
  474. package/src/surfaces/toasts.json +189 -0
  475. package/src/surfaces/welcome.json +571 -0
  476. package/src/surfaces/welcome.ts +338 -0
  477. package/src/tabs/project-config.ts +71 -15
  478. package/src/tabs/tab.ts +52 -1
  479. package/src/types.ts +49 -3
  480. package/src/ui/ai-credentials-form.ts +104 -100
  481. package/src/ui/ai-managed-connect.ts +116 -49
  482. package/src/ui/ai-model-picker.ts +102 -47
  483. package/src/ui/cf-account-picker.ts +135 -0
  484. package/src/ui/color-selector.ts +80 -301
  485. package/src/ui/dynamic-slot.ts +43 -283
  486. package/src/ui/expression-editor.ts +797 -576
  487. package/src/ui/field-input.ts +8 -181
  488. package/src/ui/form-controls.ts +838 -366
  489. package/src/ui/formula-chips.ts +80 -85
  490. package/src/ui/kit.ts +33 -0
  491. package/src/ui/layers.ts +293 -593
  492. package/src/ui/media-picker.ts +203 -284
  493. package/src/ui/panel-resize.ts +251 -64
  494. package/src/ui/popover-surface.ts +153 -0
  495. package/src/ui/progress-modal.ts +22 -60
  496. package/src/ui/regions.ts +13 -7
  497. package/src/ui/schema-form.ts +906 -440
  498. package/src/ui/surface.ts +122 -0
  499. package/src/ui/unit-selector.ts +15 -131
  500. package/src/ui/value-source.ts +14 -0
  501. package/src/ui/virtual-window.ts +88 -9
  502. package/src/utils/canvas-media.ts +72 -0
  503. package/src/utils/edit-display.ts +7 -2
  504. package/src/utils/element-selectors.ts +69 -0
  505. package/src/utils/link-target.ts +2 -2
  506. package/src/utils/studio-utils.ts +0 -10
  507. package/src/view.ts +15 -0
  508. package/src/workspace/pane-derive.ts +36 -14
  509. package/src/workspace/workspace.ts +15 -6
  510. package/styles/canvas.css +72 -467
  511. package/styles/forced-colors.css +48 -82
  512. package/styles/forced-colors.json +41 -0
  513. package/styles/inspector.css +2 -1301
  514. package/styles/overlays.css +96 -2823
  515. package/styles/panels.css +6 -1423
  516. package/styles/shell-frame.css +272 -0
  517. package/styles/shell-frame.json +227 -0
  518. package/styles/shell.css +0 -1532
  519. package/styles/tokens.css +65 -136
  520. package/styles/tokens.json +84 -0
  521. package/dist/chunks/Overlay.dev-723bv0df.js +0 -23
  522. package/dist/chunks/adapter-jkcyhgtr.js +0 -14
  523. package/dist/chunks/cf-settings-45fgyx8y.js +0 -21
  524. package/dist/chunks/components-zmx10t62.js +0 -21
  525. package/dist/chunks/content-source-t88vb2dr.js +0 -49
  526. package/dist/chunks/convert-to-repeater-dhw1nrz9.js +0 -268
  527. package/dist/chunks/editor-cptq5jp1.js +0 -37
  528. package/dist/chunks/entry-commands-6z6bhxg0.js +0 -46
  529. package/dist/chunks/extension-sections-3ydgjbdy.js +0 -311
  530. package/dist/chunks/file-ops-rskmhxyq.js +0 -48
  531. package/dist/chunks/files-0cratsr0.js +0 -92
  532. package/dist/chunks/flow-qbfgrpeh.js +0 -634
  533. package/dist/chunks/focus-trap.esm-ggawf1hy.js +0 -1024
  534. package/dist/chunks/focus-visible-6eg70z18.js +0 -167
  535. package/dist/chunks/format-host-tgcmfs4p.js +0 -43
  536. package/dist/chunks/fs-events-hrrg328g.js +0 -21
  537. package/dist/chunks/git-panel-0yywyk76.js +0 -58
  538. package/dist/chunks/index-zqxmqxmh.js +0 -109
  539. package/dist/chunks/jx-validate-8q2g05x1.js +0 -19
  540. package/dist/chunks/layers-panel-z3tqe5cd.js +0 -67
  541. package/dist/chunks/layers-q75tj2mf.js +0 -45
  542. package/dist/chunks/lit-html-j055mkh8.js +0 -22
  543. package/dist/chunks/monaco-buffer-dqw0xxpx.js +0 -25
  544. package/dist/chunks/notify-yjm79n4s.js +0 -30
  545. package/dist/chunks/parse-24d0gay3.js +0 -19
  546. package/dist/chunks/platform-ba1j1gbh.js +0 -16
  547. package/dist/chunks/publish-panel-54jvhskq.js +0 -28
  548. package/dist/chunks/quick-search-cgfmjwq5.js +0 -65
  549. package/dist/chunks/references-3qx8fkyp.js +0 -29
  550. package/dist/chunks/right-panel-cqp8bc4v.js +0 -46
  551. package/dist/chunks/section-registry-sx1ykvkw.js +0 -30
  552. package/dist/chunks/sp-overlay.dev-yztmtrs1.js +0 -18
  553. package/dist/chunks/sp-popover.dev-n2etmqdp.js +0 -9
  554. package/dist/chunks/sp-progress-circle.dev-hryhj0es.js +0 -15
  555. package/dist/chunks/sp-tooltip.dev-xcvpnqr0.js +0 -15
  556. package/dist/chunks/sp-tray.dev-tkbscm06.js +0 -199
  557. package/dist/chunks/studio-0a5qrh01.js +0 -3
  558. package/dist/chunks/studio-18j3bmcz.js +0 -14
  559. package/dist/chunks/studio-1hbqnt19.js +0 -1823
  560. package/dist/chunks/studio-4rzyrtjz.js +0 -426
  561. package/dist/chunks/studio-5rywrkxz.js +0 -1903
  562. package/dist/chunks/studio-7afd21nw.js +0 -67
  563. package/dist/chunks/studio-7nte2hj4.js +0 -613
  564. package/dist/chunks/studio-8jpzqk5s.js +0 -128
  565. package/dist/chunks/studio-8q517dfr.js +0 -24
  566. package/dist/chunks/studio-9c4k4vhv.js +0 -357
  567. package/dist/chunks/studio-9n4mrmnb.js +0 -184
  568. package/dist/chunks/studio-a0tswy0w.js +0 -58
  569. package/dist/chunks/studio-ahjfdy6e.js +0 -387
  570. package/dist/chunks/studio-ahnzd9rg.js +0 -23
  571. package/dist/chunks/studio-bw5dz6km.js +0 -608
  572. package/dist/chunks/studio-cb12yz9w.js +0 -15055
  573. package/dist/chunks/studio-d1ks410h.js +0 -175
  574. package/dist/chunks/studio-eqq1w638.js +0 -113
  575. package/dist/chunks/studio-ex8zyp98.js +0 -1813
  576. package/dist/chunks/studio-h4rxscfc.js +0 -10
  577. package/dist/chunks/studio-kyh9avvv.js +0 -28
  578. package/dist/chunks/studio-kyk2v92a.js +0 -659
  579. package/dist/chunks/studio-m3hwn7y1.js +0 -120
  580. package/dist/chunks/studio-mmv72a27.js +0 -4344
  581. package/dist/chunks/studio-n8b9wqwy.js +0 -291
  582. package/dist/chunks/studio-pdfjntbk.js +0 -6939
  583. package/dist/chunks/studio-qq6jym04.js +0 -53
  584. package/dist/chunks/studio-r1r7afxx.js +0 -1066
  585. package/dist/chunks/studio-rdx8jcxy.js +0 -83
  586. package/dist/chunks/studio-rn9ta2mz.js +0 -111
  587. package/dist/chunks/studio-t7qb9db8.js +0 -665
  588. package/dist/chunks/studio-tmc5emrw.js +0 -8
  589. package/dist/chunks/studio-txwkm6p9.js +0 -12
  590. package/dist/chunks/studio-v38hmvx1.js +0 -390
  591. package/dist/chunks/studio-vadzgkrz.js +0 -318
  592. package/dist/chunks/studio-wx5609xd.js +0 -341
  593. package/dist/chunks/studio-z6nw2ek2.js +0 -18
  594. package/dist/chunks/studio-zczps70q.js +0 -378
  595. package/dist/chunks/workspace-xpres40v.js +0 -89
  596. package/src/panels/activity-bar.ts +0 -251
  597. package/src/panels/panel-scheduler.ts +0 -219
  598. package/src/panels/style-inputs.ts +0 -237
  599. package/src/panels/target-line.ts +0 -274
  600. package/src/panels/welcome-screen.ts +0 -346
  601. package/src/ui/button-group.ts +0 -102
  602. package/src/ui/choice-field.ts +0 -72
  603. package/src/ui/field-row.ts +0 -249
  604. package/src/ui/formula-palette.ts +0 -213
  605. package/src/ui/icons.ts +0 -52
  606. package/src/ui/jx-theme.ts +0 -130
  607. package/src/ui/spectrum.ts +0 -340
  608. package/src/ui/value-selector.ts +0 -174
  609. package/src/ui/widgets.ts +0 -172
  610. /package/dist/chunks/{javascript-s56a8dpk.css → javascript-4abzjcy9.css} +0 -0
  611. /package/dist/chunks/{jsonMode-zr9sw0c7.css → jsonMode-vvmpmk34.css} +0 -0
  612. /package/dist/chunks/{monaco-setup-pav68602.css → monaco-setup-8vbyqnhr.css} +0 -0
  613. /package/dist/chunks/{tsMode-ef187txx.css → tsMode-hnxxb73h.css} +0 -0
@@ -940,9 +940,9 @@ var create5 = (left, right) => new Pair(left, right);
940
940
 
941
941
  // ../../node_modules/lib0/prng.js
942
942
  var bool = (gen) => gen.next() >= 0.5;
943
- var int53 = (gen, min2, max2) => floor(gen.next() * (max2 + 1 - min2) + min2);
944
- var int32 = (gen, min2, max2) => floor(gen.next() * (max2 + 1 - min2) + min2);
945
- var int31 = (gen, min2, max2) => int32(gen, min2, max2);
943
+ var int53 = (gen, min, max) => floor(gen.next() * (max + 1 - min) + min);
944
+ var int32 = (gen, min, max) => floor(gen.next() * (max + 1 - min) + min);
945
+ var int31 = (gen, min, max) => int32(gen, min, max);
946
946
  var letter = (gen) => fromCharCode(int31(gen, 97, 122));
947
947
  var word = (gen, minLen = 0, maxLen = 20) => {
948
948
  const len = int31(gen, minLen, maxLen);
@@ -1157,10 +1157,10 @@ var $$object = $constructedBy($Object);
1157
1157
  var $objectAny = $custom((o) => o != null && (o.constructor === Object || o.constructor == null));
1158
1158
 
1159
1159
  class $Record extends Schema {
1160
- constructor(keys2, values) {
1160
+ constructor(keys, values) {
1161
1161
  super();
1162
1162
  this.shape = {
1163
- keys: keys2,
1163
+ keys,
1164
1164
  values
1165
1165
  };
1166
1166
  }
@@ -1172,7 +1172,7 @@ class $Record extends Schema {
1172
1172
  });
1173
1173
  }
1174
1174
  }
1175
- var $record = (keys2, values) => new $Record(keys2, values);
1175
+ var $record = (keys, values) => new $Record(keys, values);
1176
1176
  var $$record = $constructedBy($Record);
1177
1177
 
1178
1178
  class $Tuple extends Schema {
@@ -1223,11 +1223,11 @@ var $$instanceOf = $constructedBy($InstanceOf);
1223
1223
  var $$schema = $instanceOf(Schema);
1224
1224
 
1225
1225
  class $Lambda extends Schema {
1226
- constructor(args2) {
1226
+ constructor(args) {
1227
1227
  super();
1228
- this.len = args2.length - 1;
1229
- this.args = $tuple(...args2.slice(-1));
1230
- this.res = args2[this.len];
1228
+ this.len = args.length - 1;
1229
+ this.args = $tuple(...args.slice(-1));
1230
+ this.res = args[this.len];
1231
1231
  }
1232
1232
  check(f, err) {
1233
1233
  const c = f.constructor === Function && f.length <= this.len;
@@ -1289,10 +1289,10 @@ var $primitive = $union($number, $string, $null, $undefined, $bigint, $boolean,
1289
1289
  var $json = (() => {
1290
1290
  const $jsonArr = $array($any);
1291
1291
  const $jsonRecord = $record($string, $any);
1292
- const $json2 = $union($number, $string, $null, $boolean, $jsonArr, $jsonRecord);
1293
- $jsonArr.shape = $json2;
1294
- $jsonRecord.shape.values = $json2;
1295
- return $json2;
1292
+ const $json = $union($number, $string, $null, $boolean, $jsonArr, $jsonRecord);
1293
+ $jsonArr.shape = $json;
1294
+ $jsonRecord.shape.values = $json;
1295
+ return $json;
1296
1296
  })();
1297
1297
  var $ = (o) => {
1298
1298
  if ($$schema.check(o)) {
@@ -1422,15 +1422,15 @@ var RED = create6();
1422
1422
  var PURPLE = create6();
1423
1423
  var ORANGE = create6();
1424
1424
  var UNCOLOR = create6();
1425
- var computeNoColorLoggingArgs = (args2) => {
1426
- if (args2.length === 1 && args2[0]?.constructor === Function) {
1427
- args2 = args2[0]();
1425
+ var computeNoColorLoggingArgs = (args) => {
1426
+ if (args.length === 1 && args[0]?.constructor === Function) {
1427
+ args = args[0]();
1428
1428
  }
1429
1429
  const strBuilder = [];
1430
1430
  const logArgs = [];
1431
1431
  let i = 0;
1432
- for (;i < args2.length; i++) {
1433
- const arg = args2[i];
1432
+ for (;i < args.length; i++) {
1433
+ const arg = args[i];
1434
1434
  if (arg === undefined) {
1435
1435
  break;
1436
1436
  } else if (arg.constructor === String || arg.constructor === Number) {
@@ -1442,8 +1442,8 @@ var computeNoColorLoggingArgs = (args2) => {
1442
1442
  if (i > 0) {
1443
1443
  logArgs.push(strBuilder.join(""));
1444
1444
  }
1445
- for (;i < args2.length; i++) {
1446
- const arg = args2[i];
1445
+ for (;i < args.length; i++) {
1446
+ const arg = args[i];
1447
1447
  if (!(arg instanceof Symbol)) {
1448
1448
  logArgs.push(arg);
1449
1449
  }
@@ -1464,17 +1464,17 @@ var _browserStyleMap = {
1464
1464
  [ORANGE]: create5("color", "orange"),
1465
1465
  [UNCOLOR]: create5("color", "black")
1466
1466
  };
1467
- var computeBrowserLoggingArgs = (args2) => {
1468
- if (args2.length === 1 && args2[0]?.constructor === Function) {
1469
- args2 = args2[0]();
1467
+ var computeBrowserLoggingArgs = (args) => {
1468
+ if (args.length === 1 && args[0]?.constructor === Function) {
1469
+ args = args[0]();
1470
1470
  }
1471
1471
  const strBuilder = [];
1472
1472
  const styles = [];
1473
1473
  const currentStyle = create3();
1474
1474
  let logArgs = [];
1475
1475
  let i = 0;
1476
- for (;i < args2.length; i++) {
1477
- const arg = args2[i];
1476
+ for (;i < args.length; i++) {
1477
+ const arg = args[i];
1478
1478
  const style = _browserStyleMap[arg];
1479
1479
  if (style !== undefined) {
1480
1480
  currentStyle.set(style.left, style.right);
@@ -1483,10 +1483,10 @@ var computeBrowserLoggingArgs = (args2) => {
1483
1483
  break;
1484
1484
  }
1485
1485
  if (arg.constructor === String || arg.constructor === Number) {
1486
- const style2 = mapToStyleString(currentStyle);
1487
- if (i > 0 || style2.length > 0) {
1486
+ const style = mapToStyleString(currentStyle);
1487
+ if (i > 0 || style.length > 0) {
1488
1488
  strBuilder.push("%c" + arg);
1489
- styles.push(style2);
1489
+ styles.push(style);
1490
1490
  } else {
1491
1491
  strBuilder.push(arg);
1492
1492
  }
@@ -1499,8 +1499,8 @@ var computeBrowserLoggingArgs = (args2) => {
1499
1499
  logArgs = styles;
1500
1500
  logArgs.unshift(strBuilder.join(""));
1501
1501
  }
1502
- for (;i < args2.length; i++) {
1503
- const arg = args2[i];
1502
+ for (;i < args.length; i++) {
1503
+ const arg = args[i];
1504
1504
  if (!(arg instanceof Symbol)) {
1505
1505
  logArgs.push(arg);
1506
1506
  }
@@ -1508,14 +1508,14 @@ var computeBrowserLoggingArgs = (args2) => {
1508
1508
  return logArgs;
1509
1509
  };
1510
1510
  var computeLoggingArgs = supportsColor ? computeBrowserLoggingArgs : computeNoColorLoggingArgs;
1511
- var print = (...args2) => {
1512
- console.log(...computeLoggingArgs(args2));
1513
- vconsoles.forEach((vc) => vc.print(args2));
1511
+ var print = (...args) => {
1512
+ console.log(...computeLoggingArgs(args));
1513
+ vconsoles.forEach((vc) => vc.print(args));
1514
1514
  };
1515
- var warn = (...args2) => {
1516
- console.warn(...computeLoggingArgs(args2));
1517
- args2.unshift(ORANGE);
1518
- vconsoles.forEach((vc) => vc.print(args2));
1515
+ var warn = (...args) => {
1516
+ console.warn(...computeLoggingArgs(args));
1517
+ args.unshift(ORANGE);
1518
+ vconsoles.forEach((vc) => vc.print(args));
1519
1519
  };
1520
1520
  var vconsoles = create();
1521
1521
 
@@ -1579,9 +1579,9 @@ var findIndexDS = (dis, clock) => {
1579
1579
  }
1580
1580
  return null;
1581
1581
  };
1582
- var isDeleted = (ds, id2) => {
1583
- const dis = ds.clients.get(id2.client);
1584
- return dis !== undefined && findIndexDS(dis, id2.clock) !== null;
1582
+ var isDeleted = (ds, id) => {
1583
+ const dis = ds.clients.get(id.client);
1584
+ return dis !== undefined && findIndexDS(dis, id.clock) !== null;
1585
1585
  };
1586
1586
  var sortAndMergeDeleteSet = (ds) => {
1587
1587
  ds.clients.forEach((dels) => {
@@ -1618,8 +1618,8 @@ var mergeDeleteSets = (dss) => {
1618
1618
  sortAndMergeDeleteSet(merged);
1619
1619
  return merged;
1620
1620
  };
1621
- var addToDeleteSet = (ds, client, clock, length2) => {
1622
- setIfUndefined(ds.clients, client, () => []).push(new DeleteItem(clock, length2));
1621
+ var addToDeleteSet = (ds, client, clock, length) => {
1622
+ setIfUndefined(ds.clients, client, () => []).push(new DeleteItem(clock, length));
1623
1623
  };
1624
1624
  var createDeleteSet = () => new DeleteSet;
1625
1625
  var createDeleteSetFromStructStore = (ss) => {
@@ -1668,7 +1668,7 @@ var readDeleteSet = (decoder) => {
1668
1668
  const numberOfDeletes = readVarUint(decoder.restDecoder);
1669
1669
  if (numberOfDeletes > 0) {
1670
1670
  const dsField = setIfUndefined(ds.clients, client, () => []);
1671
- for (let i2 = 0;i2 < numberOfDeletes; i2++) {
1671
+ for (let i = 0;i < numberOfDeletes; i++) {
1672
1672
  dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen()));
1673
1673
  }
1674
1674
  }
@@ -1684,7 +1684,7 @@ var readAndApplyDeleteSet = (decoder, transaction, store) => {
1684
1684
  const numberOfDeletes = readVarUint(decoder.restDecoder);
1685
1685
  const structs = store.clients.get(client) || [];
1686
1686
  const state = getState(store, client);
1687
- for (let i2 = 0;i2 < numberOfDeletes; i2++) {
1687
+ for (let i = 0;i < numberOfDeletes; i++) {
1688
1688
  const clock = decoder.readDsClock();
1689
1689
  const clockEnd = clock + decoder.readDsLen();
1690
1690
  if (clock < state) {
@@ -1784,7 +1784,7 @@ class Doc extends ObservableV2 {
1784
1784
  return this.subdocs;
1785
1785
  }
1786
1786
  getSubdocGuids() {
1787
- return new Set(from(this.subdocs).map((doc2) => doc2.guid));
1787
+ return new Set(from(this.subdocs).map((doc) => doc.guid));
1788
1788
  }
1789
1789
  transact(f, origin = null) {
1790
1790
  return transact(this, f, origin);
@@ -1835,11 +1835,11 @@ class Doc extends ObservableV2 {
1835
1835
  return this.get(name, YXmlFragment);
1836
1836
  }
1837
1837
  toJSON() {
1838
- const doc2 = {};
1838
+ const doc = {};
1839
1839
  this.share.forEach((value, key) => {
1840
- doc2[key] = value.toJSON();
1840
+ doc[key] = value.toJSON();
1841
1841
  });
1842
- return doc2;
1842
+ return doc;
1843
1843
  }
1844
1844
  destroy() {
1845
1845
  this.isDestroyed = true;
@@ -1851,9 +1851,9 @@ class Doc extends ObservableV2 {
1851
1851
  content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false });
1852
1852
  content.doc._item = item;
1853
1853
  transact(item.parent.doc, (transaction) => {
1854
- const doc2 = content.doc;
1854
+ const doc = content.doc;
1855
1855
  if (!item.deleted) {
1856
- transaction.subdocsAdded.add(doc2);
1856
+ transaction.subdocsAdded.add(doc);
1857
1857
  }
1858
1858
  transaction.subdocsRemoved.add(this);
1859
1859
  }, null, true);
@@ -2012,13 +2012,13 @@ class DSEncoderV1 {
2012
2012
  }
2013
2013
 
2014
2014
  class UpdateEncoderV1 extends DSEncoderV1 {
2015
- writeLeftID(id2) {
2016
- writeVarUint(this.restEncoder, id2.client);
2017
- writeVarUint(this.restEncoder, id2.clock);
2015
+ writeLeftID(id) {
2016
+ writeVarUint(this.restEncoder, id.client);
2017
+ writeVarUint(this.restEncoder, id.clock);
2018
2018
  }
2019
- writeRightID(id2) {
2020
- writeVarUint(this.restEncoder, id2.client);
2021
- writeVarUint(this.restEncoder, id2.clock);
2019
+ writeRightID(id) {
2020
+ writeVarUint(this.restEncoder, id.client);
2021
+ writeVarUint(this.restEncoder, id.clock);
2022
2022
  }
2023
2023
  writeClient(client) {
2024
2024
  writeVarUint(this.restEncoder, client);
@@ -2038,8 +2038,8 @@ class UpdateEncoderV1 extends DSEncoderV1 {
2038
2038
  writeLen(len) {
2039
2039
  writeVarUint(this.restEncoder, len);
2040
2040
  }
2041
- writeAny(any2) {
2042
- writeAny(this.restEncoder, any2);
2041
+ writeAny(any) {
2042
+ writeAny(this.restEncoder, any);
2043
2043
  }
2044
2044
  writeBuf(buf) {
2045
2045
  writeVarUint8Array(this.restEncoder, buf);
@@ -2107,13 +2107,13 @@ class UpdateEncoderV2 extends DSEncoderV2 {
2107
2107
  writeUint8Array(encoder, toUint8Array(this.restEncoder));
2108
2108
  return toUint8Array(encoder);
2109
2109
  }
2110
- writeLeftID(id2) {
2111
- this.clientEncoder.write(id2.client);
2112
- this.leftClockEncoder.write(id2.clock);
2110
+ writeLeftID(id) {
2111
+ this.clientEncoder.write(id.client);
2112
+ this.leftClockEncoder.write(id.clock);
2113
2113
  }
2114
- writeRightID(id2) {
2115
- this.clientEncoder.write(id2.client);
2116
- this.rightClockEncoder.write(id2.clock);
2114
+ writeRightID(id) {
2115
+ this.clientEncoder.write(id.client);
2116
+ this.rightClockEncoder.write(id.clock);
2117
2117
  }
2118
2118
  writeClient(client) {
2119
2119
  this.clientEncoder.write(client);
@@ -2133,8 +2133,8 @@ class UpdateEncoderV2 extends DSEncoderV2 {
2133
2133
  writeLen(len) {
2134
2134
  this.lenEncoder.write(len);
2135
2135
  }
2136
- writeAny(any2) {
2137
- writeAny(this.restEncoder, any2);
2136
+ writeAny(any) {
2137
+ writeAny(this.restEncoder, any);
2138
2138
  }
2139
2139
  writeBuf(buf) {
2140
2140
  writeVarUint8Array(this.restEncoder, buf);
@@ -2181,7 +2181,7 @@ var writeClientsStructs = (encoder, store, _sm) => {
2181
2181
  writeStructs(encoder, store.clients.get(client), client, clock);
2182
2182
  });
2183
2183
  };
2184
- var readClientsStructRefs = (decoder, doc2) => {
2184
+ var readClientsStructRefs = (decoder, doc) => {
2185
2185
  const clientRefs = create3();
2186
2186
  const numOfStateUpdates = readVarUint(decoder.restDecoder);
2187
2187
  for (let i = 0;i < numOfStateUpdates; i++) {
@@ -2190,25 +2190,25 @@ var readClientsStructRefs = (decoder, doc2) => {
2190
2190
  const client = decoder.readClient();
2191
2191
  let clock = readVarUint(decoder.restDecoder);
2192
2192
  clientRefs.set(client, { i: 0, refs });
2193
- for (let i2 = 0;i2 < numberOfStructs; i2++) {
2193
+ for (let i = 0;i < numberOfStructs; i++) {
2194
2194
  const info = decoder.readInfo();
2195
2195
  switch (BITS5 & info) {
2196
2196
  case 0: {
2197
2197
  const len = decoder.readLen();
2198
- refs[i2] = new GC(createID(client, clock), len);
2198
+ refs[i] = new GC(createID(client, clock), len);
2199
2199
  clock += len;
2200
2200
  break;
2201
2201
  }
2202
2202
  case 10: {
2203
2203
  const len = readVarUint(decoder.restDecoder);
2204
- refs[i2] = new Skip(createID(client, clock), len);
2204
+ refs[i] = new Skip(createID(client, clock), len);
2205
2205
  clock += len;
2206
2206
  break;
2207
2207
  }
2208
2208
  default: {
2209
2209
  const cantCopyParentInfo = (info & (BIT7 | BIT8)) === 0;
2210
- const struct = new Item(createID(client, clock), null, (info & BIT8) === BIT8 ? decoder.readLeftID() : null, null, (info & BIT7) === BIT7 ? decoder.readRightID() : null, cantCopyParentInfo ? decoder.readParentInfo() ? doc2.get(decoder.readString()) : decoder.readLeftID() : null, cantCopyParentInfo && (info & BIT6) === BIT6 ? decoder.readString() : null, readItemContent(decoder, info));
2211
- refs[i2] = struct;
2210
+ const struct = new Item(createID(client, clock), null, (info & BIT8) === BIT8 ? decoder.readLeftID() : null, null, (info & BIT7) === BIT7 ? decoder.readRightID() : null, cantCopyParentInfo ? decoder.readParentInfo() ? doc.get(decoder.readString()) : decoder.readLeftID() : null, cantCopyParentInfo && (info & BIT6) === BIT6 ? decoder.readString() : null, readItemContent(decoder, info));
2211
+ refs[i] = struct;
2212
2212
  clock += struct.length;
2213
2213
  }
2214
2214
  }
@@ -2319,9 +2319,9 @@ var writeStructsFromTransaction = (encoder, transaction) => writeClientsStructs(
2319
2319
  var readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = new UpdateDecoderV2(decoder)) => transact(ydoc, (transaction) => {
2320
2320
  transaction.local = false;
2321
2321
  let retry = false;
2322
- const doc2 = transaction.doc;
2323
- const store = doc2.store;
2324
- const ss = readClientsStructRefs(structDecoder, doc2);
2322
+ const doc = transaction.doc;
2323
+ const store = doc.store;
2324
+ const ss = readClientsStructRefs(structDecoder, doc);
2325
2325
  const restStructs = integrateStructs(transaction, store, ss);
2326
2326
  const pending = store.pendingStructs;
2327
2327
  if (pending) {
@@ -2367,19 +2367,19 @@ var applyUpdateV2 = (ydoc, update, transactionOrigin, YDecoder = UpdateDecoderV2
2367
2367
  readUpdateV2(decoder, ydoc, transactionOrigin, new YDecoder(decoder));
2368
2368
  };
2369
2369
  var applyUpdate = (ydoc, update, transactionOrigin) => applyUpdateV2(ydoc, update, transactionOrigin, UpdateDecoderV1);
2370
- var writeStateAsUpdate = (encoder, doc2, targetStateVector = new Map) => {
2371
- writeClientsStructs(encoder, doc2.store, targetStateVector);
2372
- writeDeleteSet(encoder, createDeleteSetFromStructStore(doc2.store));
2370
+ var writeStateAsUpdate = (encoder, doc, targetStateVector = new Map) => {
2371
+ writeClientsStructs(encoder, doc.store, targetStateVector);
2372
+ writeDeleteSet(encoder, createDeleteSetFromStructStore(doc.store));
2373
2373
  };
2374
- var encodeStateAsUpdateV2 = (doc2, encodedTargetStateVector = new Uint8Array([0]), encoder = new UpdateEncoderV2) => {
2374
+ var encodeStateAsUpdateV2 = (doc, encodedTargetStateVector = new Uint8Array([0]), encoder = new UpdateEncoderV2) => {
2375
2375
  const targetStateVector = decodeStateVector(encodedTargetStateVector);
2376
- writeStateAsUpdate(encoder, doc2, targetStateVector);
2376
+ writeStateAsUpdate(encoder, doc, targetStateVector);
2377
2377
  const updates = [encoder.toUint8Array()];
2378
- if (doc2.store.pendingDs) {
2379
- updates.push(doc2.store.pendingDs);
2378
+ if (doc.store.pendingDs) {
2379
+ updates.push(doc.store.pendingDs);
2380
2380
  }
2381
- if (doc2.store.pendingStructs) {
2382
- updates.push(diffUpdateV2(doc2.store.pendingStructs.update, encodedTargetStateVector));
2381
+ if (doc.store.pendingStructs) {
2382
+ updates.push(diffUpdateV2(doc.store.pendingStructs.update, encodedTargetStateVector));
2383
2383
  }
2384
2384
  if (updates.length > 1) {
2385
2385
  if (encoder.constructor === UpdateEncoderV1) {
@@ -2390,7 +2390,7 @@ var encodeStateAsUpdateV2 = (doc2, encodedTargetStateVector = new Uint8Array([0]
2390
2390
  }
2391
2391
  return updates[0];
2392
2392
  };
2393
- var encodeStateAsUpdate = (doc2, encodedTargetStateVector) => encodeStateAsUpdateV2(doc2, encodedTargetStateVector, new UpdateEncoderV1);
2393
+ var encodeStateAsUpdate = (doc, encodedTargetStateVector) => encodeStateAsUpdateV2(doc, encodedTargetStateVector, new UpdateEncoderV1);
2394
2394
  var readStateVector = (decoder) => {
2395
2395
  const ss = new Map;
2396
2396
  const ssLength = readVarUint(decoder.restDecoder);
@@ -2410,16 +2410,16 @@ var writeStateVector = (encoder, sv) => {
2410
2410
  });
2411
2411
  return encoder;
2412
2412
  };
2413
- var writeDocumentStateVector = (encoder, doc2) => writeStateVector(encoder, getStateVector(doc2.store));
2414
- var encodeStateVectorV2 = (doc2, encoder = new DSEncoderV2) => {
2415
- if (doc2 instanceof Map) {
2416
- writeStateVector(encoder, doc2);
2413
+ var writeDocumentStateVector = (encoder, doc) => writeStateVector(encoder, getStateVector(doc.store));
2414
+ var encodeStateVectorV2 = (doc, encoder = new DSEncoderV2) => {
2415
+ if (doc instanceof Map) {
2416
+ writeStateVector(encoder, doc);
2417
2417
  } else {
2418
- writeDocumentStateVector(encoder, doc2);
2418
+ writeDocumentStateVector(encoder, doc);
2419
2419
  }
2420
2420
  return encoder.toUint8Array();
2421
2421
  };
2422
- var encodeStateVector = (doc2) => encodeStateVectorV2(doc2, new DSEncoderV1);
2422
+ var encodeStateVector = (doc) => encodeStateVectorV2(doc, new DSEncoderV1);
2423
2423
 
2424
2424
  class EventHandler {
2425
2425
  constructor() {
@@ -2489,7 +2489,7 @@ var createRelativePosition = (type, item, assoc) => {
2489
2489
  }
2490
2490
  return new RelativePosition(typeid, tname, item, assoc);
2491
2491
  };
2492
- var createRelativePositionFromTypeIndex = (type, index, assoc = 0) => {
2492
+ var createRelativePositionFromTypeIndex2 = (type, index, assoc = 0) => {
2493
2493
  let t = type._start;
2494
2494
  if (assoc < 0) {
2495
2495
  if (index === 0) {
@@ -2511,16 +2511,16 @@ var createRelativePositionFromTypeIndex = (type, index, assoc = 0) => {
2511
2511
  }
2512
2512
  return createRelativePosition(type, null, assoc);
2513
2513
  };
2514
- var getItemWithOffset = (store, id2) => {
2515
- const item = getItem(store, id2);
2516
- const diff = id2.clock - item.id.clock;
2514
+ var getItemWithOffset = (store, id) => {
2515
+ const item = getItem(store, id);
2516
+ const diff = id.clock - item.id.clock;
2517
2517
  return {
2518
2518
  item,
2519
2519
  diff
2520
2520
  };
2521
2521
  };
2522
- var createAbsolutePositionFromRelativePosition = (rpos, doc2, followUndoneDeletions = true) => {
2523
- const store = doc2.store;
2522
+ var createAbsolutePositionFromRelativePosition2 = (rpos, doc, followUndoneDeletions = true) => {
2523
+ const store = doc.store;
2524
2524
  const rightID = rpos.item;
2525
2525
  const typeID = rpos.type;
2526
2526
  const tname = rpos.tname;
@@ -2549,7 +2549,7 @@ var createAbsolutePositionFromRelativePosition = (rpos, doc2, followUndoneDeleti
2549
2549
  }
2550
2550
  } else {
2551
2551
  if (tname !== null) {
2552
- type = doc2.get(tname);
2552
+ type = doc.get(tname);
2553
2553
  } else if (typeID !== null) {
2554
2554
  if (getState(store, typeID.client) <= typeID.clock) {
2555
2555
  return null;
@@ -2653,9 +2653,9 @@ var findIndexSS = (structs, clock) => {
2653
2653
  }
2654
2654
  throw unexpectedCase();
2655
2655
  };
2656
- var find = (store, id2) => {
2657
- const structs = store.clients.get(id2.client);
2658
- return structs[findIndexSS(structs, id2.clock)];
2656
+ var find = (store, id) => {
2657
+ const structs = store.clients.get(id.client);
2658
+ return structs[findIndexSS(structs, id.clock)];
2659
2659
  };
2660
2660
  var getItem = find;
2661
2661
  var findIndexCleanStart = (transaction, structs, clock) => {
@@ -2667,16 +2667,16 @@ var findIndexCleanStart = (transaction, structs, clock) => {
2667
2667
  }
2668
2668
  return index;
2669
2669
  };
2670
- var getItemCleanStart = (transaction, id2) => {
2671
- const structs = transaction.doc.store.clients.get(id2.client);
2672
- return structs[findIndexCleanStart(transaction, structs, id2.clock)];
2670
+ var getItemCleanStart = (transaction, id) => {
2671
+ const structs = transaction.doc.store.clients.get(id.client);
2672
+ return structs[findIndexCleanStart(transaction, structs, id.clock)];
2673
2673
  };
2674
- var getItemCleanEnd = (transaction, store, id2) => {
2675
- const structs = store.clients.get(id2.client);
2676
- const index = findIndexSS(structs, id2.clock);
2674
+ var getItemCleanEnd = (transaction, store, id) => {
2675
+ const structs = store.clients.get(id.client);
2676
+ const index = findIndexSS(structs, id.clock);
2677
2677
  const struct = structs[index];
2678
- if (id2.clock !== struct.id.clock + struct.length - 1 && struct.constructor !== GC) {
2679
- structs.splice(index + 1, 0, splitItem(transaction, struct, id2.clock - struct.id.clock + 1));
2678
+ if (id.clock !== struct.id.clock + struct.length - 1 && struct.constructor !== GC) {
2679
+ structs.splice(index + 1, 0, splitItem(transaction, struct, id.clock - struct.id.clock + 1));
2680
2680
  }
2681
2681
  return struct;
2682
2682
  };
@@ -2701,10 +2701,10 @@ var iterateStructs = (transaction, structs, clockStart, len, f) => {
2701
2701
  };
2702
2702
 
2703
2703
  class Transaction {
2704
- constructor(doc2, origin, local) {
2705
- this.doc = doc2;
2704
+ constructor(doc, origin, local) {
2705
+ this.doc = doc;
2706
2706
  this.deleteSet = new DeleteSet;
2707
- this.beforeState = getStateVector(doc2.store);
2707
+ this.beforeState = getStateVector(doc.store);
2708
2708
  this.afterState = new Map;
2709
2709
  this.changed = new Map;
2710
2710
  this.changedParentTypes = new Map;
@@ -2761,12 +2761,12 @@ var tryGcDeleteSet = (ds, store, gcFilter) => {
2761
2761
  const deleteItem = deleteItems[di];
2762
2762
  const endDeleteItemClock = deleteItem.clock + deleteItem.len;
2763
2763
  for (let si = findIndexSS(structs, deleteItem.clock), struct = structs[si];si < structs.length && struct.id.clock < endDeleteItemClock; struct = structs[++si]) {
2764
- const struct2 = structs[si];
2765
- if (deleteItem.clock + deleteItem.len <= struct2.id.clock) {
2764
+ const struct = structs[si];
2765
+ if (deleteItem.clock + deleteItem.len <= struct.id.clock) {
2766
2766
  break;
2767
2767
  }
2768
- if (struct2 instanceof Item && struct2.deleted && !struct2.keep && gcFilter(struct2)) {
2769
- struct2.gc(store, false);
2768
+ if (struct instanceof Item && struct.deleted && !struct.keep && gcFilter(struct)) {
2769
+ struct.gc(store, false);
2770
2770
  }
2771
2771
  }
2772
2772
  }
@@ -2787,14 +2787,14 @@ var tryMergeDeleteSet = (ds, store) => {
2787
2787
  var cleanupTransactions = (transactionCleanups, i) => {
2788
2788
  if (i < transactionCleanups.length) {
2789
2789
  const transaction = transactionCleanups[i];
2790
- const doc2 = transaction.doc;
2791
- const store = doc2.store;
2790
+ const doc = transaction.doc;
2791
+ const store = doc.store;
2792
2792
  const ds = transaction.deleteSet;
2793
2793
  const mergeStructs = transaction._mergeStructs;
2794
2794
  try {
2795
2795
  sortAndMergeDeleteSet(ds);
2796
2796
  transaction.afterState = getStateVector(transaction.doc.store);
2797
- doc2.emit("beforeObserverCalls", [transaction, doc2]);
2797
+ doc.emit("beforeObserverCalls", [transaction, doc]);
2798
2798
  const fs = [];
2799
2799
  transaction.changed.forEach((subs, itemtype) => fs.push(() => {
2800
2800
  if (itemtype._item === null || !itemtype._item.deleted) {
@@ -2815,7 +2815,7 @@ var cleanupTransactions = (transactionCleanups, i) => {
2815
2815
  });
2816
2816
  }
2817
2817
  });
2818
- fs.push(() => doc2.emit("afterTransaction", [transaction, doc2]));
2818
+ fs.push(() => doc.emit("afterTransaction", [transaction, doc]));
2819
2819
  fs.push(() => {
2820
2820
  if (transaction._needFormattingCleanup) {
2821
2821
  cleanupYTextAfterTransaction(transaction);
@@ -2824,8 +2824,8 @@ var cleanupTransactions = (transactionCleanups, i) => {
2824
2824
  });
2825
2825
  callAll(fs, []);
2826
2826
  } finally {
2827
- if (doc2.gc) {
2828
- tryGcDeleteSet(ds, store, doc2.gcFilter);
2827
+ if (doc.gc) {
2828
+ tryGcDeleteSet(ds, store, doc.gcFilter);
2829
2829
  }
2830
2830
  tryMergeDeleteSet(ds, store);
2831
2831
  transaction.afterState.forEach((clock, client) => {
@@ -2833,13 +2833,13 @@ var cleanupTransactions = (transactionCleanups, i) => {
2833
2833
  if (beforeClock !== clock) {
2834
2834
  const structs = store.clients.get(client);
2835
2835
  const firstChangePos = max(findIndexSS(structs, beforeClock), 1);
2836
- for (let i2 = structs.length - 1;i2 >= firstChangePos; ) {
2837
- i2 -= 1 + tryToMergeWithLefts(structs, i2);
2836
+ for (let i = structs.length - 1;i >= firstChangePos; ) {
2837
+ i -= 1 + tryToMergeWithLefts(structs, i);
2838
2838
  }
2839
2839
  }
2840
2840
  });
2841
- for (let i2 = mergeStructs.length - 1;i2 >= 0; i2--) {
2842
- const { client, clock } = mergeStructs[i2].id;
2841
+ for (let i = mergeStructs.length - 1;i >= 0; i--) {
2842
+ const { client, clock } = mergeStructs[i].id;
2843
2843
  const structs = store.clients.get(client);
2844
2844
  const replacedStructPos = findIndexSS(structs, clock);
2845
2845
  if (replacedStructPos + 1 < structs.length) {
@@ -2851,66 +2851,66 @@ var cleanupTransactions = (transactionCleanups, i) => {
2851
2851
  tryToMergeWithLefts(structs, replacedStructPos);
2852
2852
  }
2853
2853
  }
2854
- if (!transaction.local && transaction.afterState.get(doc2.clientID) !== transaction.beforeState.get(doc2.clientID)) {
2854
+ if (!transaction.local && transaction.afterState.get(doc.clientID) !== transaction.beforeState.get(doc.clientID)) {
2855
2855
  print(ORANGE, BOLD, "[yjs] ", UNBOLD, RED, "Changed the client-id because another client seems to be using it.");
2856
- doc2.clientID = generateNewClientId();
2856
+ doc.clientID = generateNewClientId();
2857
2857
  }
2858
- doc2.emit("afterTransactionCleanup", [transaction, doc2]);
2859
- if (doc2._observers.has("update")) {
2858
+ doc.emit("afterTransactionCleanup", [transaction, doc]);
2859
+ if (doc._observers.has("update")) {
2860
2860
  const encoder = new UpdateEncoderV1;
2861
- const hasContent2 = writeUpdateMessageFromTransaction(encoder, transaction);
2862
- if (hasContent2) {
2863
- doc2.emit("update", [encoder.toUint8Array(), transaction.origin, doc2, transaction]);
2861
+ const hasContent = writeUpdateMessageFromTransaction(encoder, transaction);
2862
+ if (hasContent) {
2863
+ doc.emit("update", [encoder.toUint8Array(), transaction.origin, doc, transaction]);
2864
2864
  }
2865
2865
  }
2866
- if (doc2._observers.has("updateV2")) {
2866
+ if (doc._observers.has("updateV2")) {
2867
2867
  const encoder = new UpdateEncoderV2;
2868
- const hasContent2 = writeUpdateMessageFromTransaction(encoder, transaction);
2869
- if (hasContent2) {
2870
- doc2.emit("updateV2", [encoder.toUint8Array(), transaction.origin, doc2, transaction]);
2868
+ const hasContent = writeUpdateMessageFromTransaction(encoder, transaction);
2869
+ if (hasContent) {
2870
+ doc.emit("updateV2", [encoder.toUint8Array(), transaction.origin, doc, transaction]);
2871
2871
  }
2872
2872
  }
2873
2873
  const { subdocsAdded, subdocsLoaded, subdocsRemoved } = transaction;
2874
2874
  if (subdocsAdded.size > 0 || subdocsRemoved.size > 0 || subdocsLoaded.size > 0) {
2875
2875
  subdocsAdded.forEach((subdoc) => {
2876
- subdoc.clientID = doc2.clientID;
2876
+ subdoc.clientID = doc.clientID;
2877
2877
  if (subdoc.collectionid == null) {
2878
- subdoc.collectionid = doc2.collectionid;
2878
+ subdoc.collectionid = doc.collectionid;
2879
2879
  }
2880
- doc2.subdocs.add(subdoc);
2880
+ doc.subdocs.add(subdoc);
2881
2881
  });
2882
- subdocsRemoved.forEach((subdoc) => doc2.subdocs.delete(subdoc));
2883
- doc2.emit("subdocs", [{ loaded: subdocsLoaded, added: subdocsAdded, removed: subdocsRemoved }, doc2, transaction]);
2882
+ subdocsRemoved.forEach((subdoc) => doc.subdocs.delete(subdoc));
2883
+ doc.emit("subdocs", [{ loaded: subdocsLoaded, added: subdocsAdded, removed: subdocsRemoved }, doc, transaction]);
2884
2884
  subdocsRemoved.forEach((subdoc) => subdoc.destroy());
2885
2885
  }
2886
2886
  if (transactionCleanups.length <= i + 1) {
2887
- doc2._transactionCleanups = [];
2888
- doc2.emit("afterAllTransactions", [doc2, transactionCleanups]);
2887
+ doc._transactionCleanups = [];
2888
+ doc.emit("afterAllTransactions", [doc, transactionCleanups]);
2889
2889
  } else {
2890
2890
  cleanupTransactions(transactionCleanups, i + 1);
2891
2891
  }
2892
2892
  }
2893
2893
  }
2894
2894
  };
2895
- var transact = (doc2, f, origin = null, local = true) => {
2896
- const transactionCleanups = doc2._transactionCleanups;
2895
+ var transact = (doc, f, origin = null, local = true) => {
2896
+ const transactionCleanups = doc._transactionCleanups;
2897
2897
  let initialCall = false;
2898
2898
  let result = null;
2899
- if (doc2._transaction === null) {
2899
+ if (doc._transaction === null) {
2900
2900
  initialCall = true;
2901
- doc2._transaction = new Transaction(doc2, origin, local);
2902
- transactionCleanups.push(doc2._transaction);
2901
+ doc._transaction = new Transaction(doc, origin, local);
2902
+ transactionCleanups.push(doc._transaction);
2903
2903
  if (transactionCleanups.length === 1) {
2904
- doc2.emit("beforeAllTransactions", [doc2]);
2904
+ doc.emit("beforeAllTransactions", [doc]);
2905
2905
  }
2906
- doc2.emit("beforeTransaction", [doc2._transaction, doc2]);
2906
+ doc.emit("beforeTransaction", [doc._transaction, doc]);
2907
2907
  }
2908
2908
  try {
2909
- result = f(doc2._transaction);
2909
+ result = f(doc._transaction);
2910
2910
  } finally {
2911
2911
  if (initialCall) {
2912
- const finishCleanup = doc2._transaction === transactionCleanups[0];
2913
- doc2._transaction = null;
2912
+ const finishCleanup = doc._transaction === transactionCleanups[0];
2913
+ doc._transaction = null;
2914
2914
  if (finishCleanup) {
2915
2915
  cleanupTransactions(transactionCleanups, 0);
2916
2916
  }
@@ -2935,11 +2935,11 @@ var clearUndoManagerStackItem = (tr, um, stackItem) => {
2935
2935
  };
2936
2936
  var popStackItem = (undoManager, stack, eventType) => {
2937
2937
  let _tr = null;
2938
- const doc2 = undoManager.doc;
2938
+ const doc = undoManager.doc;
2939
2939
  const scope = undoManager.scope;
2940
- transact(doc2, (transaction) => {
2940
+ transact(doc, (transaction) => {
2941
2941
  while (stack.length > 0 && undoManager.currStackItem === null) {
2942
- const store = doc2.store;
2942
+ const store = doc.store;
2943
2943
  const stackItem = stack.pop();
2944
2944
  const itemsToRedo = new Set;
2945
2945
  const itemsToDelete = [];
@@ -2991,18 +2991,18 @@ var popStackItem = (undoManager, stack, eventType) => {
2991
2991
  return res;
2992
2992
  };
2993
2993
 
2994
- class UndoManager extends ObservableV2 {
2994
+ class UndoManager2 extends ObservableV2 {
2995
2995
  constructor(typeScope, {
2996
2996
  captureTimeout = 500,
2997
2997
  captureTransaction = (_tr) => true,
2998
2998
  deleteFilter = () => true,
2999
2999
  trackedOrigins = new Set([null]),
3000
3000
  ignoreRemoteMapChanges = false,
3001
- doc: doc2 = isArray(typeScope) ? typeScope[0].doc : typeScope instanceof Doc ? typeScope : typeScope.doc
3001
+ doc = isArray(typeScope) ? typeScope[0].doc : typeScope instanceof Doc ? typeScope : typeScope.doc
3002
3002
  } = {}) {
3003
3003
  super();
3004
3004
  this.scope = [];
3005
- this.doc = doc2;
3005
+ this.doc = doc;
3006
3006
  this.addToScope(typeScope);
3007
3007
  this.deleteFilter = deleteFilter;
3008
3008
  trackedOrigins.add(this);
@@ -3140,7 +3140,7 @@ function* lazyStructReaderGenerator(decoder) {
3140
3140
  const numberOfStructs = readVarUint(decoder.restDecoder);
3141
3141
  const client = decoder.readClient();
3142
3142
  let clock = readVarUint(decoder.restDecoder);
3143
- for (let i2 = 0;i2 < numberOfStructs; i2++) {
3143
+ for (let i = 0;i < numberOfStructs; i++) {
3144
3144
  const info = decoder.readInfo();
3145
3145
  if (info === 10) {
3146
3146
  const len = readVarUint(decoder.restDecoder);
@@ -3383,7 +3383,7 @@ class YEvent {
3383
3383
  if (this.transaction.doc._transactionCleanups.length === 0) {
3384
3384
  throw create2(errorComputeChanges);
3385
3385
  }
3386
- const keys2 = new Map;
3386
+ const keys = new Map;
3387
3387
  const target = this.target;
3388
3388
  const changed = this.transaction.changed.get(target);
3389
3389
  changed.forEach((key) => {
@@ -3420,10 +3420,10 @@ class YEvent {
3420
3420
  return;
3421
3421
  }
3422
3422
  }
3423
- keys2.set(key, { action, oldValue });
3423
+ keys.set(key, { action, oldValue });
3424
3424
  }
3425
3425
  });
3426
- this._keys = keys2;
3426
+ this._keys = keys;
3427
3427
  }
3428
3428
  return this._keys;
3429
3429
  }
@@ -3793,9 +3793,9 @@ var typeListGet = (type, index) => {
3793
3793
  };
3794
3794
  var typeListInsertGenericsAfter = (transaction, parent, referenceItem, content) => {
3795
3795
  let left = referenceItem;
3796
- const doc2 = transaction.doc;
3797
- const ownClientId = doc2.clientID;
3798
- const store = doc2.store;
3796
+ const doc = transaction.doc;
3797
+ const ownClientId = doc.clientID;
3798
+ const store = doc.store;
3799
3799
  const right = referenceItem === null ? parent._start : referenceItem.right;
3800
3800
  let jsonContent = [];
3801
3801
  const packJsonContent = () => {
@@ -3890,12 +3890,12 @@ var typeListPushGenerics = (transaction, parent, content) => {
3890
3890
  }
3891
3891
  return typeListInsertGenericsAfter(transaction, parent, n, content);
3892
3892
  };
3893
- var typeListDelete = (transaction, parent, index, length2) => {
3894
- if (length2 === 0) {
3893
+ var typeListDelete = (transaction, parent, index, length) => {
3894
+ if (length === 0) {
3895
3895
  return;
3896
3896
  }
3897
3897
  const startIndex = index;
3898
- const startLength = length2;
3898
+ const startLength = length;
3899
3899
  const marker = findMarker(parent, index);
3900
3900
  let n = parent._start;
3901
3901
  if (marker !== null) {
@@ -3910,21 +3910,21 @@ var typeListDelete = (transaction, parent, index, length2) => {
3910
3910
  index -= n.length;
3911
3911
  }
3912
3912
  }
3913
- while (length2 > 0 && n !== null) {
3913
+ while (length > 0 && n !== null) {
3914
3914
  if (!n.deleted) {
3915
- if (length2 < n.length) {
3916
- getItemCleanStart(transaction, createID(n.id.client, n.id.clock + length2));
3915
+ if (length < n.length) {
3916
+ getItemCleanStart(transaction, createID(n.id.client, n.id.clock + length));
3917
3917
  }
3918
3918
  n.delete(transaction);
3919
- length2 -= n.length;
3919
+ length -= n.length;
3920
3920
  }
3921
3921
  n = n.right;
3922
3922
  }
3923
- if (length2 > 0) {
3923
+ if (length > 0) {
3924
3924
  throw lengthExceeded();
3925
3925
  }
3926
3926
  if (parent._searchMarker) {
3927
- updateMarkerChanges(parent._searchMarker, startIndex, -startLength + length2);
3927
+ updateMarkerChanges(parent._searchMarker, startIndex, -startLength + length);
3928
3928
  }
3929
3929
  };
3930
3930
  var typeMapDelete = (transaction, parent, key) => {
@@ -3935,8 +3935,8 @@ var typeMapDelete = (transaction, parent, key) => {
3935
3935
  };
3936
3936
  var typeMapSet = (transaction, parent, key, value) => {
3937
3937
  const left = parent._map.get(key) || null;
3938
- const doc2 = transaction.doc;
3939
- const ownClientId = doc2.clientID;
3938
+ const doc = transaction.doc;
3939
+ const ownClientId = doc.clientID;
3940
3940
  let content;
3941
3941
  if (value == null) {
3942
3942
  content = new ContentAny([value]);
@@ -3965,7 +3965,7 @@ var typeMapSet = (transaction, parent, key, value) => {
3965
3965
  }
3966
3966
  }
3967
3967
  }
3968
- new Item(createID(ownClientId, getState(doc2.store, ownClientId)), left, left && left.lastId, null, null, parent, key, content).integrate(transaction, 0);
3968
+ new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, null, null, parent, key, content).integrate(transaction, 0);
3969
3969
  };
3970
3970
  var typeMapGet = (parent, key) => {
3971
3971
  parent.doc ?? warnPrematureAccess();
@@ -4061,13 +4061,13 @@ class YArray extends AbstractType {
4061
4061
  unshift(content) {
4062
4062
  this.insert(0, content);
4063
4063
  }
4064
- delete(index, length2 = 1) {
4064
+ delete(index, length = 1) {
4065
4065
  if (this.doc !== null) {
4066
4066
  transact(this.doc, (transaction) => {
4067
- typeListDelete(transaction, this, index, length2);
4067
+ typeListDelete(transaction, this, index, length);
4068
4068
  });
4069
4069
  } else {
4070
- this._prelimContent.splice(index, length2);
4070
+ this._prelimContent.splice(index, length);
4071
4071
  }
4072
4072
  }
4073
4073
  get(index) {
@@ -4125,25 +4125,25 @@ class YMap extends AbstractType {
4125
4125
  return new YMap;
4126
4126
  }
4127
4127
  clone() {
4128
- const map2 = new YMap;
4128
+ const map = new YMap;
4129
4129
  this.forEach((value, key) => {
4130
- map2.set(key, value instanceof AbstractType ? value.clone() : value);
4130
+ map.set(key, value instanceof AbstractType ? value.clone() : value);
4131
4131
  });
4132
- return map2;
4132
+ return map;
4133
4133
  }
4134
4134
  _callObserver(transaction, parentSubs) {
4135
4135
  callTypeObservers(this, transaction, new YMapEvent(this, transaction, parentSubs));
4136
4136
  }
4137
4137
  toJSON() {
4138
4138
  this.doc ?? warnPrematureAccess();
4139
- const map2 = {};
4139
+ const map = {};
4140
4140
  this._map.forEach((item, key) => {
4141
4141
  if (!item.deleted) {
4142
4142
  const v = item.content.getContent()[item.length - 1];
4143
- map2[key] = v instanceof AbstractType ? v.toJSON() : v;
4143
+ map[key] = v instanceof AbstractType ? v.toJSON() : v;
4144
4144
  }
4145
4145
  });
4146
- return map2;
4146
+ return map;
4147
4147
  }
4148
4148
  get size() {
4149
4149
  return [...createMapIterator(this)].length;
@@ -4196,8 +4196,8 @@ class YMap extends AbstractType {
4196
4196
  clear() {
4197
4197
  if (this.doc !== null) {
4198
4198
  transact(this.doc, (transaction) => {
4199
- this.forEach(function(_value, key, map2) {
4200
- typeMapDelete(transaction, map2, key);
4199
+ this.forEach(function(_value, key, map) {
4200
+ typeMapDelete(transaction, map, key);
4201
4201
  });
4202
4202
  });
4203
4203
  } else {
@@ -4279,12 +4279,12 @@ var insertNegatedAttributes = (transaction, parent, currPos, negatedAttributes)
4279
4279
  }
4280
4280
  currPos.forward();
4281
4281
  }
4282
- const doc2 = transaction.doc;
4283
- const ownClientId = doc2.clientID;
4282
+ const doc = transaction.doc;
4283
+ const ownClientId = doc.clientID;
4284
4284
  negatedAttributes.forEach((val, key) => {
4285
4285
  const left = currPos.left;
4286
4286
  const right = currPos.right;
4287
- const nextFormat = new Item(createID(ownClientId, getState(doc2.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val));
4287
+ const nextFormat = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val));
4288
4288
  nextFormat.integrate(transaction, 0);
4289
4289
  currPos.right = nextFormat;
4290
4290
  currPos.forward();
@@ -4311,8 +4311,8 @@ var minimizeAttributeChanges = (currPos, attributes) => {
4311
4311
  }
4312
4312
  };
4313
4313
  var insertAttributes = (transaction, parent, currPos, attributes) => {
4314
- const doc2 = transaction.doc;
4315
- const ownClientId = doc2.clientID;
4314
+ const doc = transaction.doc;
4315
+ const ownClientId = doc.clientID;
4316
4316
  const negatedAttributes = new Map;
4317
4317
  for (const key in attributes) {
4318
4318
  const val = attributes[key];
@@ -4320,42 +4320,42 @@ var insertAttributes = (transaction, parent, currPos, attributes) => {
4320
4320
  if (!equalAttrs(currentVal, val)) {
4321
4321
  negatedAttributes.set(key, currentVal);
4322
4322
  const { left, right } = currPos;
4323
- currPos.right = new Item(createID(ownClientId, getState(doc2.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val));
4323
+ currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val));
4324
4324
  currPos.right.integrate(transaction, 0);
4325
4325
  currPos.forward();
4326
4326
  }
4327
4327
  }
4328
4328
  return negatedAttributes;
4329
4329
  };
4330
- var insertText = (transaction, parent, currPos, text2, attributes) => {
4330
+ var insertText = (transaction, parent, currPos, text, attributes) => {
4331
4331
  currPos.currentAttributes.forEach((_val, key) => {
4332
4332
  if (attributes[key] === undefined) {
4333
4333
  attributes[key] = null;
4334
4334
  }
4335
4335
  });
4336
- const doc2 = transaction.doc;
4337
- const ownClientId = doc2.clientID;
4336
+ const doc = transaction.doc;
4337
+ const ownClientId = doc.clientID;
4338
4338
  minimizeAttributeChanges(currPos, attributes);
4339
4339
  const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes);
4340
- const content = text2.constructor === String ? new ContentString(text2) : text2 instanceof AbstractType ? new ContentType(text2) : new ContentEmbed(text2);
4340
+ const content = text.constructor === String ? new ContentString(text) : text instanceof AbstractType ? new ContentType(text) : new ContentEmbed(text);
4341
4341
  let { left, right, index } = currPos;
4342
4342
  if (parent._searchMarker) {
4343
4343
  updateMarkerChanges(parent._searchMarker, currPos.index, content.getLength());
4344
4344
  }
4345
- right = new Item(createID(ownClientId, getState(doc2.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, content);
4345
+ right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, content);
4346
4346
  right.integrate(transaction, 0);
4347
4347
  currPos.right = right;
4348
4348
  currPos.index = index;
4349
4349
  currPos.forward();
4350
4350
  insertNegatedAttributes(transaction, parent, currPos, negatedAttributes);
4351
4351
  };
4352
- var formatText = (transaction, parent, currPos, length2, attributes) => {
4353
- const doc2 = transaction.doc;
4354
- const ownClientId = doc2.clientID;
4352
+ var formatText = (transaction, parent, currPos, length, attributes) => {
4353
+ const doc = transaction.doc;
4354
+ const ownClientId = doc.clientID;
4355
4355
  minimizeAttributeChanges(currPos, attributes);
4356
4356
  const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes);
4357
4357
  iterationLoop:
4358
- while (currPos.right !== null && (length2 > 0 || negatedAttributes.size > 0 && (currPos.right.deleted || currPos.right.content.constructor === ContentFormat))) {
4358
+ while (currPos.right !== null && (length > 0 || negatedAttributes.size > 0 && (currPos.right.deleted || currPos.right.content.constructor === ContentFormat))) {
4359
4359
  if (!currPos.right.deleted) {
4360
4360
  switch (currPos.right.content.constructor) {
4361
4361
  case ContentFormat: {
@@ -4365,7 +4365,7 @@ var formatText = (transaction, parent, currPos, length2, attributes) => {
4365
4365
  if (equalAttrs(attr, value)) {
4366
4366
  negatedAttributes.delete(key);
4367
4367
  } else {
4368
- if (length2 === 0) {
4368
+ if (length === 0) {
4369
4369
  break iterationLoop;
4370
4370
  }
4371
4371
  negatedAttributes.set(key, value);
@@ -4377,22 +4377,22 @@ var formatText = (transaction, parent, currPos, length2, attributes) => {
4377
4377
  break;
4378
4378
  }
4379
4379
  default:
4380
- if (length2 < currPos.right.length) {
4381
- getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length2));
4380
+ if (length < currPos.right.length) {
4381
+ getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length));
4382
4382
  }
4383
- length2 -= currPos.right.length;
4383
+ length -= currPos.right.length;
4384
4384
  break;
4385
4385
  }
4386
4386
  }
4387
4387
  currPos.forward();
4388
4388
  }
4389
- if (length2 > 0) {
4389
+ if (length > 0) {
4390
4390
  let newlines = "";
4391
- for (;length2 > 0; length2--) {
4391
+ for (;length > 0; length--) {
4392
4392
  newlines += `
4393
4393
  `;
4394
4394
  }
4395
- currPos.right = new Item(createID(ownClientId, getState(doc2.store, ownClientId)), currPos.left, currPos.left && currPos.left.lastId, currPos.right, currPos.right && currPos.right.id, parent, null, new ContentString(newlines));
4395
+ currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), currPos.left, currPos.left && currPos.left.lastId, currPos.right, currPos.right && currPos.right.id, parent, null, new ContentString(newlines));
4396
4396
  currPos.right.integrate(transaction, 0);
4397
4397
  currPos.forward();
4398
4398
  }
@@ -4486,19 +4486,19 @@ var cleanupYTextFormatting = (type) => {
4486
4486
  };
4487
4487
  var cleanupYTextAfterTransaction = (transaction) => {
4488
4488
  const needFullCleanup = new Set;
4489
- const doc2 = transaction.doc;
4489
+ const doc = transaction.doc;
4490
4490
  for (const [client, afterClock] of transaction.afterState.entries()) {
4491
4491
  const clock = transaction.beforeState.get(client) || 0;
4492
4492
  if (afterClock === clock) {
4493
4493
  continue;
4494
4494
  }
4495
- iterateStructs(transaction, doc2.store.clients.get(client), clock, afterClock, (item) => {
4495
+ iterateStructs(transaction, doc.store.clients.get(client), clock, afterClock, (item) => {
4496
4496
  if (!item.deleted && item.content.constructor === ContentFormat && item.constructor !== GC) {
4497
4497
  needFullCleanup.add(item.parent);
4498
4498
  }
4499
4499
  });
4500
4500
  }
4501
- transact(doc2, (t) => {
4501
+ transact(doc, (t) => {
4502
4502
  iterateDeletedStructs(transaction, transaction.deleteSet, (item) => {
4503
4503
  if (item instanceof GC || !item.parent._hasFormatting || needFullCleanup.has(item.parent)) {
4504
4504
  return;
@@ -4515,20 +4515,20 @@ var cleanupYTextAfterTransaction = (transaction) => {
4515
4515
  }
4516
4516
  });
4517
4517
  };
4518
- var deleteText = (transaction, currPos, length2) => {
4519
- const startLength = length2;
4518
+ var deleteText = (transaction, currPos, length) => {
4519
+ const startLength = length;
4520
4520
  const startAttrs = copy(currPos.currentAttributes);
4521
4521
  const start = currPos.right;
4522
- while (length2 > 0 && currPos.right !== null) {
4522
+ while (length > 0 && currPos.right !== null) {
4523
4523
  if (currPos.right.deleted === false) {
4524
4524
  switch (currPos.right.content.constructor) {
4525
4525
  case ContentType:
4526
4526
  case ContentEmbed:
4527
4527
  case ContentString:
4528
- if (length2 < currPos.right.length) {
4529
- getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length2));
4528
+ if (length < currPos.right.length) {
4529
+ getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length));
4530
4530
  }
4531
- length2 -= currPos.right.length;
4531
+ length -= currPos.right.length;
4532
4532
  currPos.right.delete(transaction);
4533
4533
  break;
4534
4534
  }
@@ -4540,7 +4540,7 @@ var deleteText = (transaction, currPos, length2) => {
4540
4540
  }
4541
4541
  const parent = (currPos.left || currPos.right).parent;
4542
4542
  if (parent._searchMarker) {
4543
- updateMarkerChanges(parent._searchMarker, currPos.index, -startLength + length2);
4543
+ updateMarkerChanges(parent._searchMarker, currPos.index, -startLength + length);
4544
4544
  }
4545
4545
  return currPos;
4546
4546
  };
@@ -4766,9 +4766,9 @@ class YText extends AbstractType {
4766
4766
  return new YText;
4767
4767
  }
4768
4768
  clone() {
4769
- const text2 = new YText;
4770
- text2.applyDelta(this.toDelta());
4771
- return text2;
4769
+ const text = new YText;
4770
+ text.applyDelta(this.toDelta());
4771
+ return text;
4772
4772
  }
4773
4773
  _callObserver(transaction, parentSubs) {
4774
4774
  super._callObserver(transaction, parentSubs);
@@ -4820,7 +4820,7 @@ class YText extends AbstractType {
4820
4820
  this.doc ?? warnPrematureAccess();
4821
4821
  const ops = [];
4822
4822
  const currentAttributes = new Map;
4823
- const doc2 = this.doc;
4823
+ const doc = this.doc;
4824
4824
  let str = "";
4825
4825
  let n = this._start;
4826
4826
  function packStr() {
@@ -4891,7 +4891,7 @@ class YText extends AbstractType {
4891
4891
  packStr();
4892
4892
  };
4893
4893
  if (snapshot || prevSnapshot) {
4894
- transact(doc2, (transaction) => {
4894
+ transact(doc, (transaction) => {
4895
4895
  if (snapshot) {
4896
4896
  splitSnapshotAffectedStructs(transaction, snapshot);
4897
4897
  }
@@ -4905,8 +4905,8 @@ class YText extends AbstractType {
4905
4905
  }
4906
4906
  return ops;
4907
4907
  }
4908
- insert(index, text2, attributes) {
4909
- if (text2.length <= 0) {
4908
+ insert(index, text, attributes) {
4909
+ if (text.length <= 0) {
4910
4910
  return;
4911
4911
  }
4912
4912
  const y = this.doc;
@@ -4919,10 +4919,10 @@ class YText extends AbstractType {
4919
4919
  attributes[k] = v;
4920
4920
  });
4921
4921
  }
4922
- insertText(transaction, this, pos, text2, attributes);
4922
+ insertText(transaction, this, pos, text, attributes);
4923
4923
  });
4924
4924
  } else {
4925
- this._pending.push(() => this.insert(index, text2, attributes));
4925
+ this._pending.push(() => this.insert(index, text, attributes));
4926
4926
  }
4927
4927
  }
4928
4928
  insertEmbed(index, embed, attributes) {
@@ -4936,21 +4936,21 @@ class YText extends AbstractType {
4936
4936
  this._pending.push(() => this.insertEmbed(index, embed, attributes || {}));
4937
4937
  }
4938
4938
  }
4939
- delete(index, length2) {
4940
- if (length2 === 0) {
4939
+ delete(index, length) {
4940
+ if (length === 0) {
4941
4941
  return;
4942
4942
  }
4943
4943
  const y = this.doc;
4944
4944
  if (y !== null) {
4945
4945
  transact(y, (transaction) => {
4946
- deleteText(transaction, findPosition(transaction, this, index, true), length2);
4946
+ deleteText(transaction, findPosition(transaction, this, index, true), length);
4947
4947
  });
4948
4948
  } else {
4949
- this._pending.push(() => this.delete(index, length2));
4949
+ this._pending.push(() => this.delete(index, length));
4950
4950
  }
4951
4951
  }
4952
- format(index, length2, attributes) {
4953
- if (length2 === 0) {
4952
+ format(index, length, attributes) {
4953
+ if (length === 0) {
4954
4954
  return;
4955
4955
  }
4956
4956
  const y = this.doc;
@@ -4960,10 +4960,10 @@ class YText extends AbstractType {
4960
4960
  if (pos.right === null) {
4961
4961
  return;
4962
4962
  }
4963
- formatText(transaction, this, pos, length2, attributes);
4963
+ formatText(transaction, this, pos, length, attributes);
4964
4964
  });
4965
4965
  } else {
4966
- this._pending.push(() => this.format(index, length2, attributes));
4966
+ this._pending.push(() => this.format(index, length, attributes));
4967
4967
  }
4968
4968
  }
4969
4969
  removeAttribute(attributeName) {
@@ -5070,7 +5070,7 @@ class YXmlFragment extends AbstractType {
5070
5070
  }
5071
5071
  querySelector(query) {
5072
5072
  query = query.toUpperCase();
5073
- const iterator = new YXmlTreeWalker(this, (element2) => element2.nodeName && element2.nodeName.toUpperCase() === query);
5073
+ const iterator = new YXmlTreeWalker(this, (element) => element.nodeName && element.nodeName.toUpperCase() === query);
5074
5074
  const next = iterator.next();
5075
5075
  if (next.done) {
5076
5076
  return null;
@@ -5080,7 +5080,7 @@ class YXmlFragment extends AbstractType {
5080
5080
  }
5081
5081
  querySelectorAll(query) {
5082
5082
  query = query.toUpperCase();
5083
- return from(new YXmlTreeWalker(this, (element2) => element2.nodeName && element2.nodeName.toUpperCase() === query));
5083
+ return from(new YXmlTreeWalker(this, (element) => element.nodeName && element.nodeName.toUpperCase() === query));
5084
5084
  }
5085
5085
  _callObserver(transaction, parentSubs) {
5086
5086
  callTypeObservers(this, transaction, new YXmlEvent(this, parentSubs, transaction));
@@ -5125,13 +5125,13 @@ class YXmlFragment extends AbstractType {
5125
5125
  pc.splice(index, 0, ...content);
5126
5126
  }
5127
5127
  }
5128
- delete(index, length2 = 1) {
5128
+ delete(index, length = 1) {
5129
5129
  if (this.doc !== null) {
5130
5130
  transact(this.doc, (transaction) => {
5131
- typeListDelete(transaction, this, index, length2);
5131
+ typeListDelete(transaction, this, index, length);
5132
5132
  });
5133
5133
  } else {
5134
- this._prelimContent.splice(index, length2);
5134
+ this._prelimContent.splice(index, length);
5135
5135
  }
5136
5136
  }
5137
5137
  toArray() {
@@ -5194,14 +5194,14 @@ class YXmlElement extends YXmlFragment {
5194
5194
  toString() {
5195
5195
  const attrs = this.getAttributes();
5196
5196
  const stringBuilder = [];
5197
- const keys2 = [];
5197
+ const keys = [];
5198
5198
  for (const key in attrs) {
5199
- keys2.push(key);
5199
+ keys.push(key);
5200
5200
  }
5201
- keys2.sort();
5202
- const keysLen = keys2.length;
5201
+ keys.sort();
5202
+ const keysLen = keys.length;
5203
5203
  for (let i = 0;i < keysLen; i++) {
5204
- const key = keys2[i];
5204
+ const key = keys[i];
5205
5205
  stringBuilder.push(key + '="' + attrs[key] + '"');
5206
5206
  }
5207
5207
  const nodeName = this.nodeName.toLocaleLowerCase();
@@ -5323,9 +5323,9 @@ class YXmlText extends YText {
5323
5323
  return new YXmlText;
5324
5324
  }
5325
5325
  clone() {
5326
- const text2 = new YXmlText;
5327
- text2.applyDelta(this.toDelta());
5328
- return text2;
5326
+ const text = new YXmlText;
5327
+ text.applyDelta(this.toDelta());
5328
+ return text;
5329
5329
  }
5330
5330
  toDOM(_document = document, hooks, binding) {
5331
5331
  const dom = _document.createTextNode(this.toString());
@@ -5373,9 +5373,9 @@ class YXmlText extends YText {
5373
5373
  var readYXmlText = (decoder) => new YXmlText;
5374
5374
 
5375
5375
  class AbstractStruct {
5376
- constructor(id2, length2) {
5377
- this.id = id2;
5378
- this.length = length2;
5376
+ constructor(id, length) {
5377
+ this.id = id;
5378
+ this.length = length;
5379
5379
  }
5380
5380
  get deleted() {
5381
5381
  throw methodUnimplemented();
@@ -5496,21 +5496,21 @@ var readContentDeleted = (decoder) => new ContentDeleted(decoder.readLen());
5496
5496
  var createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false });
5497
5497
 
5498
5498
  class ContentDoc {
5499
- constructor(doc2) {
5500
- if (doc2._item) {
5499
+ constructor(doc) {
5500
+ if (doc._item) {
5501
5501
  console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid.");
5502
5502
  }
5503
- this.doc = doc2;
5503
+ this.doc = doc;
5504
5504
  const opts = {};
5505
5505
  this.opts = opts;
5506
- if (!doc2.gc) {
5506
+ if (!doc.gc) {
5507
5507
  opts.gc = false;
5508
5508
  }
5509
- if (doc2.autoLoad) {
5509
+ if (doc.autoLoad) {
5510
5510
  opts.autoLoad = true;
5511
5511
  }
5512
- if (doc2.meta !== null) {
5513
- opts.meta = doc2.meta;
5512
+ if (doc.meta !== null) {
5513
+ opts.meta = doc.meta;
5514
5514
  }
5515
5515
  }
5516
5516
  getLength() {
@@ -5828,11 +5828,11 @@ class ContentType {
5828
5828
  }
5829
5829
  item = item.right;
5830
5830
  }
5831
- this.type._map.forEach((item2) => {
5832
- if (!item2.deleted) {
5833
- item2.delete(transaction);
5834
- } else if (item2.id.clock < (transaction.beforeState.get(item2.id.client) || 0)) {
5835
- transaction._mergeStructs.push(item2);
5831
+ this.type._map.forEach((item) => {
5832
+ if (!item.deleted) {
5833
+ item.delete(transaction);
5834
+ } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {
5835
+ transaction._mergeStructs.push(item);
5836
5836
  }
5837
5837
  });
5838
5838
  transaction.changed.delete(this.type);
@@ -5844,10 +5844,10 @@ class ContentType {
5844
5844
  item = item.right;
5845
5845
  }
5846
5846
  this.type._start = null;
5847
- this.type._map.forEach((item2) => {
5848
- while (item2 !== null) {
5849
- item2.gc(store, true);
5850
- item2 = item2.left;
5847
+ this.type._map.forEach((item) => {
5848
+ while (item !== null) {
5849
+ item.gc(store, true);
5850
+ item = item.left;
5851
5851
  }
5852
5852
  });
5853
5853
  this.type._map = new Map;
@@ -5860,8 +5860,8 @@ class ContentType {
5860
5860
  }
5861
5861
  }
5862
5862
  var readContentType = (decoder) => new ContentType(typeRefs[decoder.readTypeRef()](decoder));
5863
- var followRedone = (store, id2) => {
5864
- let nextID = id2;
5863
+ var followRedone = (store, id) => {
5864
+ let nextID = id;
5865
5865
  let diff = 0;
5866
5866
  let item;
5867
5867
  do {
@@ -5906,11 +5906,11 @@ var splitItem = (transaction, leftItem, diff) => {
5906
5906
  leftItem.length = diff;
5907
5907
  return rightItem;
5908
5908
  };
5909
- var isDeletedByUndoStack = (stack, id2) => some(stack, (s) => isDeleted(s.deletions, id2));
5909
+ var isDeletedByUndoStack = (stack, id) => some(stack, (s) => isDeleted(s.deletions, id));
5910
5910
  var redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) => {
5911
- const doc2 = transaction.doc;
5912
- const store = doc2.store;
5913
- const ownClientID = doc2.clientID;
5911
+ const doc = transaction.doc;
5912
+ const store = doc.store;
5913
+ const ownClientID = doc.clientID;
5914
5914
  const redone = item.redone;
5915
5915
  if (redone !== null) {
5916
5916
  return getItemCleanStart(transaction, redone);
@@ -5981,8 +5981,8 @@ var redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChan
5981
5981
  };
5982
5982
 
5983
5983
  class Item extends AbstractStruct {
5984
- constructor(id2, left, origin, right, rightOrigin, parent, parentSub, content) {
5985
- super(id2, content.getLength());
5984
+ constructor(id, left, origin, right, rightOrigin, parent, parentSub, content) {
5985
+ super(id, content.getLength());
5986
5986
  this.origin = origin;
5987
5987
  this.left = left;
5988
5988
  this.right = right;
@@ -6301,85 +6301,85 @@ if (glo[importIdentifier] === true) {
6301
6301
  glo[importIdentifier] = true;
6302
6302
 
6303
6303
  // ../collab/src/envelope.ts
6304
- var FRAME_DOC_SYNC = 0;
6305
- var FRAME_AWARENESS = 1;
6306
- var FRAME_DOC_CLOSE = 2;
6307
- var FRAME_CONTROL = 3;
6304
+ var FRAME_DOC_SYNC2 = 0;
6305
+ var FRAME_AWARENESS2 = 1;
6306
+ var FRAME_DOC_CLOSE2 = 2;
6307
+ var FRAME_CONTROL2 = 3;
6308
6308
 
6309
- class EnvelopeError extends Error {
6309
+ class EnvelopeError2 extends Error {
6310
6310
  constructor(message) {
6311
6311
  super(message);
6312
6312
  this.name = "EnvelopeError";
6313
6313
  }
6314
6314
  }
6315
- function encodeFrame(frame) {
6315
+ function encodeFrame2(frame) {
6316
6316
  const encoder = createEncoder();
6317
6317
  switch (frame.type) {
6318
6318
  case "doc-sync": {
6319
- writeVarUint(encoder, FRAME_DOC_SYNC);
6319
+ writeVarUint(encoder, FRAME_DOC_SYNC2);
6320
6320
  writeVarString(encoder, frame.path);
6321
6321
  writeVarUint(encoder, frame.epoch);
6322
6322
  writeVarUint8Array(encoder, frame.body);
6323
6323
  break;
6324
6324
  }
6325
6325
  case "awareness": {
6326
- writeVarUint(encoder, FRAME_AWARENESS);
6326
+ writeVarUint(encoder, FRAME_AWARENESS2);
6327
6327
  writeVarUint8Array(encoder, frame.body);
6328
6328
  break;
6329
6329
  }
6330
6330
  case "doc-close": {
6331
- writeVarUint(encoder, FRAME_DOC_CLOSE);
6331
+ writeVarUint(encoder, FRAME_DOC_CLOSE2);
6332
6332
  writeVarString(encoder, frame.path);
6333
6333
  break;
6334
6334
  }
6335
6335
  case "control": {
6336
- writeVarUint(encoder, FRAME_CONTROL);
6336
+ writeVarUint(encoder, FRAME_CONTROL2);
6337
6337
  writeVarString(encoder, JSON.stringify(frame.message));
6338
6338
  break;
6339
6339
  }
6340
6340
  default: {
6341
- throw new EnvelopeError(`unknown-frame:${frame.type}`);
6341
+ throw new EnvelopeError2(`unknown-frame:${frame.type}`);
6342
6342
  }
6343
6343
  }
6344
6344
  return toUint8Array(encoder);
6345
6345
  }
6346
- function decodeFrame(data) {
6346
+ function decodeFrame2(data) {
6347
6347
  try {
6348
6348
  const decoder = createDecoder(data);
6349
6349
  const frameType = readVarUint(decoder);
6350
6350
  switch (frameType) {
6351
- case FRAME_DOC_SYNC: {
6351
+ case FRAME_DOC_SYNC2: {
6352
6352
  const path = readVarString(decoder);
6353
6353
  const epoch = readVarUint(decoder);
6354
6354
  const body = readVarUint8Array(decoder);
6355
6355
  return { body, epoch, path, type: "doc-sync" };
6356
6356
  }
6357
- case FRAME_AWARENESS: {
6357
+ case FRAME_AWARENESS2: {
6358
6358
  return { body: readVarUint8Array(decoder), type: "awareness" };
6359
6359
  }
6360
- case FRAME_DOC_CLOSE: {
6360
+ case FRAME_DOC_CLOSE2: {
6361
6361
  return { path: readVarString(decoder), type: "doc-close" };
6362
6362
  }
6363
- case FRAME_CONTROL: {
6363
+ case FRAME_CONTROL2: {
6364
6364
  const message = JSON.parse(readVarString(decoder));
6365
6365
  if (typeof message !== "object" || typeof message.type !== "string") {
6366
- throw new EnvelopeError("malformed-control");
6366
+ throw new EnvelopeError2("malformed-control");
6367
6367
  }
6368
6368
  return { message, type: "control" };
6369
6369
  }
6370
6370
  default: {
6371
- throw new EnvelopeError(`unknown-frame-type:${frameType}`);
6371
+ throw new EnvelopeError2(`unknown-frame-type:${frameType}`);
6372
6372
  }
6373
6373
  }
6374
6374
  } catch (error) {
6375
- if (error instanceof EnvelopeError) {
6375
+ if (error instanceof EnvelopeError2) {
6376
6376
  throw error;
6377
6377
  }
6378
- throw new EnvelopeError(`malformed-frame: ${error instanceof Error ? error.message : String(error)}`);
6378
+ throw new EnvelopeError2(`malformed-frame: ${error instanceof Error ? error.message : String(error)}`);
6379
6379
  }
6380
6380
  }
6381
6381
 
6382
- export { Observable, floor, createEncoder, length, toUint8Array, writeVarUint, writeVarString, writeVarUint8Array, createDecoder, readVarUint8Array, readVarUint, readVarString, getUnixTime, equalityDeep, Doc, applyUpdate, encodeStateAsUpdate, encodeStateVector, createRelativePositionFromTypeIndex, createAbsolutePositionFromRelativePosition, UndoManager, YArrayEvent, YArray, YMapEvent, YMap, YTextEvent, YText, FRAME_DOC_SYNC, FRAME_AWARENESS, FRAME_DOC_CLOSE, FRAME_CONTROL, EnvelopeError, encodeFrame, decodeFrame };
6382
+ export { Observable, floor, createEncoder, length, toUint8Array, writeVarUint, writeVarString, writeVarUint8Array, createDecoder, readVarUint8Array, readVarUint, readVarString, getUnixTime, equalityDeep, Doc, applyUpdate, encodeStateAsUpdate, encodeStateVector, createRelativePositionFromTypeIndex2, createAbsolutePositionFromRelativePosition2, UndoManager2, YArrayEvent, YArray, YMapEvent, YMap, YTextEvent, YText, FRAME_DOC_SYNC2, FRAME_AWARENESS2, FRAME_DOC_CLOSE2, FRAME_CONTROL2, EnvelopeError2, encodeFrame2, decodeFrame2 };
6383
6383
 
6384
- //# debugId=74ABB7E8A417C70564756E2164756E21
6385
- //# sourceMappingURL=studio-3n4ndrzh.js.map
6384
+ //# debugId=4356C2FD61A1E57464756E2164756E21
6385
+ //# sourceMappingURL=studio-h4nvnjvz.js.map