@jxsuite/studio 10.1.0 → 10.3.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 (303) hide show
  1. package/dist/chunks/{2020-mkb0qa6p.js → 2020-906vx2dq.js} +3 -3
  2. package/dist/chunks/adapter-hnvad61x.js +4 -0
  3. package/dist/chunks/add-new-flow-3tkn72ey.js +4 -0
  4. package/dist/chunks/cf-account-picker-xb8vvt2h.js +4 -0
  5. package/dist/chunks/cf-settings-mkbcz4z2.js +4 -0
  6. package/dist/chunks/components-w5zqwva1.js +4 -0
  7. package/dist/chunks/content-source-1vzxq1ba.js +4 -0
  8. package/dist/chunks/convert-to-repeater-gwzh9gar.js +4 -0
  9. package/dist/chunks/editor-wvf5e6j9.js +4 -0
  10. package/dist/chunks/entry-commands-mx2whrjx.js +4 -0
  11. package/dist/chunks/extension-sections-338ee35t.js +4 -0
  12. package/dist/chunks/file-ops-9bxvk59j.js +4 -0
  13. package/dist/chunks/files-t07yqqej.js +4 -0
  14. package/dist/chunks/format-host-5ja5gxyk.js +4 -0
  15. package/dist/chunks/fs-events-3424ezp3.js +4 -0
  16. package/dist/chunks/grid-open-1mpq9mzb.js +4 -0
  17. package/dist/chunks/{grid-view-r22jsqht.js → grid-view-w9nfy203.js} +15 -15
  18. package/dist/chunks/icons-gb967qc8.js +4 -0
  19. package/dist/chunks/iframe-host-wsg0bn73.js +4 -0
  20. package/dist/chunks/image-bake-4afr4y6a.js +4 -0
  21. package/dist/chunks/image-editor-x7t8jbjn.js +4 -0
  22. package/dist/chunks/index-f9qr7kzh.js +4 -0
  23. package/dist/chunks/{index-pxwwf00y.js → index-yjrfeks8.js} +3 -3
  24. package/dist/chunks/{javascript-pzqryby6.js → javascript-hy2mws8v.js} +3 -3
  25. package/dist/chunks/{jsonMode-tcnyxyap.js → jsonMode-vj30te2h.js} +6 -6
  26. package/dist/chunks/jx-validate-ttr5ewf0.js +4 -0
  27. package/dist/chunks/layers-m49nmwvx.js +4 -0
  28. package/dist/chunks/layers-panel-hvy2e549.js +4 -0
  29. package/dist/chunks/lit-html-k2mb9k0r.js +4 -0
  30. package/dist/chunks/media-library-ae67q4at.js +4 -0
  31. package/dist/chunks/media-open-yp9jm834.js +4 -0
  32. package/dist/chunks/media-picker-s41ngdfr.js +4 -0
  33. package/dist/chunks/{monaco-binding-bqpge64f.js → monaco-binding-a51py33c.js} +3 -3
  34. package/dist/chunks/monaco-buffer-pa0g6ax7.js +4 -0
  35. package/dist/chunks/{monaco-setup-1mkab762.js → monaco-setup-g9kterhx.js} +3 -3
  36. package/dist/chunks/notify-bwehrp7q.js +4 -0
  37. package/dist/chunks/parse-hee7ne9b.js +4 -0
  38. package/dist/chunks/platform-kv0k65cy.js +4 -0
  39. package/dist/chunks/publish-panel-gzfxcm0t.js +4 -0
  40. package/dist/chunks/publish-quick-w3nxd7q4.js +4 -0
  41. package/dist/chunks/publish-workspace-dppd82tc.js +4 -0
  42. package/dist/chunks/quick-search-tdxaam55.js +4 -0
  43. package/dist/chunks/references-vqyr5s9x.js +4 -0
  44. package/dist/chunks/right-panel-0yrw4cgz.js +4 -0
  45. package/dist/chunks/source-control-6fk72me2.js +4 -0
  46. package/dist/chunks/{studio-0g2sm01j.js → studio-0939t1q1.js} +4 -4
  47. package/dist/chunks/studio-0gvvqj3h.js +5 -0
  48. package/dist/chunks/studio-0khd8xtx.js +4 -0
  49. package/dist/chunks/{studio-rf8d6p9f.js → studio-0w3541dg.js} +6 -6
  50. package/dist/chunks/{studio-9b7177jq.js → studio-0x6f3nk9.js} +4 -4
  51. package/dist/chunks/studio-1410q5dw.js +5 -0
  52. package/dist/chunks/{studio-8qejv8yf.js → studio-15hwqgd8.js} +4 -4
  53. package/dist/chunks/studio-1ks5d9y4.js +5 -0
  54. package/dist/chunks/{studio-881z1xrx.js → studio-2ggfzrrd.js} +4 -4
  55. package/dist/chunks/{studio-jw0q5j6k.js → studio-321ym1tt.js} +4 -4
  56. package/dist/chunks/studio-3c10v2q1.js +5 -0
  57. package/dist/chunks/{studio-9rcbvksg.js → studio-3na1r48j.js} +8 -8
  58. package/dist/chunks/{studio-ggm7zf70.js → studio-3q7mhbgx.js} +5 -5
  59. package/dist/chunks/studio-3qr08sxq.js +4 -0
  60. package/dist/chunks/studio-3xk9zdgb.js +5 -0
  61. package/dist/chunks/studio-423tfdte.js +5 -0
  62. package/dist/chunks/{studio-brdp85q7.js → studio-45mj4jqe.js} +4 -4
  63. package/dist/chunks/studio-4f7thq0p.js +5 -0
  64. package/dist/chunks/{studio-w67vfgy5.js → studio-4fnb5648.js} +4 -4
  65. package/dist/chunks/studio-4zd6an2b.js +5 -0
  66. package/dist/chunks/studio-53wy9ek3.js +5 -0
  67. package/dist/chunks/studio-5n193zqd.js +5 -0
  68. package/dist/chunks/{studio-x2metr13.js → studio-5tet77de.js} +3 -3
  69. package/dist/chunks/studio-7rrdbvex.js +5 -0
  70. package/dist/chunks/studio-8kx6m0rg.js +5 -0
  71. package/dist/chunks/{studio-va0e63sk.js → studio-90zkgne5.js} +7 -7
  72. package/dist/chunks/studio-9c6cbq2c.js +4 -0
  73. package/dist/chunks/studio-9dq7rwc7.js +5 -0
  74. package/dist/chunks/studio-9qx1ywbv.js +9 -0
  75. package/dist/chunks/studio-a65kbs2e.js +9 -0
  76. package/dist/chunks/studio-aam8zt8z.js +5 -0
  77. package/dist/chunks/{studio-8jb31dcf.js → studio-abh9kfdh.js} +4 -4
  78. package/dist/chunks/studio-b4e0ftkt.js +5 -0
  79. package/dist/chunks/studio-b68k0z00.js +5 -0
  80. package/dist/chunks/{studio-dy2xtt7a.js → studio-bct64zmj.js} +4 -4
  81. package/dist/chunks/studio-bz0b5brj.js +6 -0
  82. package/dist/chunks/studio-cfnn70h1.js +5 -0
  83. package/dist/chunks/studio-daksw8kh.js +5 -0
  84. package/dist/chunks/{studio-mwnmzx7g.js → studio-e7vjyp04.js} +7 -7
  85. package/dist/chunks/studio-ea6r1zyr.js +5 -0
  86. package/dist/chunks/studio-egnjpyde.js +9 -0
  87. package/dist/chunks/studio-ejrypvmq.js +5 -0
  88. package/dist/chunks/studio-eqcddvc2.js +928 -0
  89. package/dist/chunks/studio-f8tyeyzt.js +5 -0
  90. package/dist/chunks/studio-fj6c905s.js +5 -0
  91. package/dist/chunks/{studio-hsr3k06v.js → studio-fkrr7kgg.js} +5 -5
  92. package/dist/chunks/studio-fspe7m9t.js +5 -0
  93. package/dist/chunks/{studio-4zqfw5ha.js → studio-g0hxtcga.js} +4 -4
  94. package/dist/chunks/studio-g9brbewz.js +5 -0
  95. package/dist/chunks/studio-ggx3j7nd.js +5 -0
  96. package/dist/chunks/{studio-jh6t5qz4.js → studio-hfxttkyr.js} +4 -4
  97. package/dist/chunks/studio-hh394phe.js +5 -0
  98. package/dist/chunks/{studio-07k0geap.js → studio-j0zf5x2x.js} +4 -4
  99. package/dist/chunks/studio-jeb7hth3.js +5 -0
  100. package/dist/chunks/studio-k0xzrse2.js +64 -0
  101. package/dist/chunks/studio-k1xqrgm5.js +5 -0
  102. package/dist/chunks/studio-k2evngrj.js +7 -0
  103. package/dist/chunks/studio-k3we3kqb.js +5 -0
  104. package/dist/chunks/{studio-nf0pqpbj.js → studio-n9qba0gx.js} +4 -4
  105. package/dist/chunks/studio-nf8esxxc.js +5 -0
  106. package/dist/chunks/studio-nn4f9m9c.js +5 -0
  107. package/dist/chunks/studio-nskxe9q1.js +6 -0
  108. package/dist/chunks/{studio-4nkm4404.js → studio-nvcn2ykc.js} +4 -4
  109. package/dist/chunks/studio-nwynxqtb.js +5 -0
  110. package/dist/chunks/{studio-f2j9et3h.js → studio-nzemfbkk.js} +8 -8
  111. package/dist/chunks/studio-p2a03pgm.js +5 -0
  112. package/dist/chunks/{studio-skynbac3.js → studio-pm17wdc4.js} +4 -4
  113. package/dist/chunks/{studio-9cp96v90.js → studio-q80fg1d6.js} +7 -7
  114. package/dist/chunks/studio-r050sez0.js +6 -0
  115. package/dist/chunks/{studio-sd07xva5.js → studio-s7t4vp1d.js} +5 -5
  116. package/dist/chunks/studio-s9fng7m8.js +7 -0
  117. package/dist/chunks/studio-sce30r7b.js +4 -0
  118. package/dist/chunks/{studio-zxm98z2m.js → studio-stahswgb.js} +6 -6
  119. package/dist/chunks/studio-swedpd82.js +5 -0
  120. package/dist/chunks/studio-thz5t120.js +5 -0
  121. package/dist/chunks/studio-tpxcryf2.js +5 -0
  122. package/dist/chunks/{studio-tpy3rdxn.js → studio-v5wktj6f.js} +4 -4
  123. package/dist/chunks/{studio-7vb997ff.js → studio-vpevkfxw.js} +4 -4
  124. package/dist/chunks/studio-waekn290.js +5 -0
  125. package/dist/chunks/studio-wfct4h6n.js +5 -0
  126. package/dist/chunks/studio-wgc54sxf.js +5 -0
  127. package/dist/chunks/studio-wqfaqw4m.js +5 -0
  128. package/dist/chunks/studio-wse1rs8t.js +7 -0
  129. package/dist/chunks/studio-x0gsfr1d.js +16 -0
  130. package/dist/chunks/studio-xpx91fby.js +6 -0
  131. package/dist/chunks/studio-y1b86ast.js +5 -0
  132. package/dist/chunks/studio-yrcrncev.js +5 -0
  133. package/dist/chunks/{studio-zacvfm31.js → studio-yzpskb0j.js} +4 -4
  134. package/dist/chunks/studio-zfdbmhp3.js +5 -0
  135. package/dist/chunks/{tsMode-6vwhy6ty.js → tsMode-jg1dtphj.js} +7 -7
  136. package/dist/chunks/workspace-9btkc8tk.js +4 -0
  137. package/dist/chunks/workspace-home-qcc4z5ag.js +4 -0
  138. package/dist/chunks/{ws-client-zcxkfgmf.js → ws-client-arz2qsy9.js} +3 -3
  139. package/dist/iframe-entry.js +13 -13
  140. package/dist/manifest.json +83 -77
  141. package/dist/studio.js +74 -75
  142. package/package.json +5 -5
  143. package/src/browse/library-model.ts +56 -23
  144. package/src/browse/library-pane.ts +44 -29
  145. package/src/browse/library-preview.ts +6 -2
  146. package/src/canvas/asset-refs.ts +13 -4
  147. package/src/canvas/asset-resolve.ts +54 -11
  148. package/src/canvas/canvas-render.ts +25 -0
  149. package/src/canvas/iframe-entry.ts +5 -1
  150. package/src/canvas/iframe-host.ts +16 -6
  151. package/src/canvas/iframe-protocol.ts +9 -1
  152. package/src/commands/context.ts +6 -0
  153. package/src/commands/live-context.ts +5 -2
  154. package/src/editor/shortcuts.ts +6 -0
  155. package/src/files/asset-versions.ts +108 -2
  156. package/src/files/file-ops.ts +11 -1
  157. package/src/files/files.ts +111 -48
  158. package/src/files/media-paths.ts +12 -4
  159. package/src/files/media-upload.ts +195 -21
  160. package/src/files/new-file-name.ts +39 -1
  161. package/src/media/image-bake.ts +164 -0
  162. package/src/media/image-editor.ts +846 -0
  163. package/src/media/image-format.ts +262 -0
  164. package/src/media/image-recipe.ts +651 -0
  165. package/src/media/media-commands.ts +65 -1
  166. package/src/media/media-library-model.ts +1 -1
  167. package/src/media/media-library.ts +175 -15
  168. package/src/media/media-open.ts +156 -3
  169. package/src/media/media-pane.ts +8 -4
  170. package/src/panels/data-grid.ts +0 -4
  171. package/src/panels/pane-context.ts +6 -1
  172. package/src/panels/settings-menu.ts +3 -3
  173. package/src/panels/settings-pane.ts +42 -56
  174. package/src/panels/tab-strip.ts +12 -3
  175. package/src/services/ai-import-tools.ts +6 -3
  176. package/src/services/ai-models.ts +65 -11
  177. package/src/services/ai-settings.ts +45 -5
  178. package/src/services/document-assistant.ts +5 -2
  179. package/src/services/settings/definitions.ts +19 -0
  180. package/src/settings/contributed-section.ts +16 -7
  181. package/src/settings/css-vars-editor.ts +4 -4
  182. package/src/settings/general-settings.ts +1 -4
  183. package/src/settings/preferences-accounts.ts +2 -2
  184. package/src/settings/preferences-dialog.ts +4 -2
  185. package/src/settings/project-sections.ts +1 -1
  186. package/src/settings/section-registry.ts +5 -4
  187. package/src/settings/settings-document.ts +33 -24
  188. package/src/settings/settings-workspace.ts +205 -0
  189. package/src/shell.ts +31 -6
  190. package/src/studio.ts +13 -2
  191. package/src/surfaces/ai-credentials-form.json +59 -5
  192. package/src/surfaces/ai-credentials-form.ts +15 -2
  193. package/src/surfaces/commandbar.ts +7 -3
  194. package/src/surfaces/image-editor.json +1390 -0
  195. package/src/surfaces/image-editor.ts +272 -0
  196. package/src/surfaces/media-library.json +129 -1
  197. package/src/surfaces/media-library.ts +17 -2
  198. package/src/surfaces/settings-contributed.json +4 -4
  199. package/src/surfaces/settings-contributed.ts +2 -2
  200. package/src/surfaces/settings-pane.json +262 -180
  201. package/src/surfaces/settings-pane.ts +63 -14
  202. package/src/types.ts +2 -1
  203. package/src/ui/ai-credentials-form.ts +128 -11
  204. package/src/ui/regions.ts +5 -5
  205. package/src/workspace/tab-workspace.ts +5 -3
  206. package/src/workspace/workspace-home.ts +18 -4
  207. package/src/workspace/workspace-ids.ts +40 -7
  208. package/src/workspace/workspace-switch.ts +3 -1
  209. package/src/workspace/workspace.ts +22 -1
  210. package/dist/chunks/adapter-xcpsmecx.js +0 -4
  211. package/dist/chunks/add-new-flow-ptmhmzr9.js +0 -4
  212. package/dist/chunks/cf-account-picker-z1sgwpwd.js +0 -4
  213. package/dist/chunks/cf-settings-xqvhxxe9.js +0 -4
  214. package/dist/chunks/components-whsc81a7.js +0 -4
  215. package/dist/chunks/content-source-jwtxg78w.js +0 -4
  216. package/dist/chunks/convert-to-repeater-f92ey3kp.js +0 -4
  217. package/dist/chunks/editor-zdqdpq1x.js +0 -4
  218. package/dist/chunks/entry-commands-w8p2fbpt.js +0 -4
  219. package/dist/chunks/extension-sections-y2p1te2r.js +0 -4
  220. package/dist/chunks/file-ops-13ab4swj.js +0 -4
  221. package/dist/chunks/files-zbc8p6v1.js +0 -4
  222. package/dist/chunks/format-host-zjsbktbx.js +0 -4
  223. package/dist/chunks/fs-events-t6x0hch6.js +0 -4
  224. package/dist/chunks/grid-open-fyzdwpkh.js +0 -4
  225. package/dist/chunks/icons-853n6qt3.js +0 -4
  226. package/dist/chunks/iframe-host-kbyqc7pt.js +0 -4
  227. package/dist/chunks/index-6nvj89vb.js +0 -4
  228. package/dist/chunks/jx-validate-5sp8a4rm.js +0 -4
  229. package/dist/chunks/layers-panel-qrxj9vr2.js +0 -4
  230. package/dist/chunks/layers-tpzayggx.js +0 -4
  231. package/dist/chunks/lit-html-x6nrxsx3.js +0 -4
  232. package/dist/chunks/media-library-ywppnjrz.js +0 -4
  233. package/dist/chunks/media-picker-etxgc8qq.js +0 -4
  234. package/dist/chunks/monaco-buffer-qrnqhk0b.js +0 -4
  235. package/dist/chunks/notify-kcv38wwe.js +0 -4
  236. package/dist/chunks/parse-df2kkmhc.js +0 -4
  237. package/dist/chunks/platform-dtsysmyd.js +0 -4
  238. package/dist/chunks/publish-panel-evb1rcxt.js +0 -4
  239. package/dist/chunks/publish-quick-m9vkhahq.js +0 -4
  240. package/dist/chunks/publish-workspace-ktk9h536.js +0 -4
  241. package/dist/chunks/quick-search-2f47fxcw.js +0 -4
  242. package/dist/chunks/references-5w6ajjv7.js +0 -4
  243. package/dist/chunks/right-panel-kz0a6byf.js +0 -4
  244. package/dist/chunks/source-control-1phx90zk.js +0 -4
  245. package/dist/chunks/studio-0hr000ba.js +0 -5
  246. package/dist/chunks/studio-1wyp7dt5.js +0 -5
  247. package/dist/chunks/studio-20ap8dds.js +0 -5
  248. package/dist/chunks/studio-291gqh98.js +0 -5
  249. package/dist/chunks/studio-37twdaf7.js +0 -64
  250. package/dist/chunks/studio-4smcnv33.js +0 -5
  251. package/dist/chunks/studio-56egy6vf.js +0 -5
  252. package/dist/chunks/studio-5dmgmyw4.js +0 -5
  253. package/dist/chunks/studio-5e7p1vgd.js +0 -5
  254. package/dist/chunks/studio-5m0w815d.js +0 -5
  255. package/dist/chunks/studio-695k95bw.js +0 -5
  256. package/dist/chunks/studio-6vwvshw8.js +0 -6
  257. package/dist/chunks/studio-732mw0g8.js +0 -5
  258. package/dist/chunks/studio-76t560kn.js +0 -6
  259. package/dist/chunks/studio-7823f0g8.js +0 -5
  260. package/dist/chunks/studio-8486jn4r.js +0 -5
  261. package/dist/chunks/studio-848rk4p1.js +0 -5
  262. package/dist/chunks/studio-8x8616xd.js +0 -5
  263. package/dist/chunks/studio-a3s6frde.js +0 -4
  264. package/dist/chunks/studio-ahf3cspq.js +0 -4
  265. package/dist/chunks/studio-bkmv1h3e.js +0 -9
  266. package/dist/chunks/studio-cgb97rwv.js +0 -5
  267. package/dist/chunks/studio-ch8gt8vt.js +0 -5
  268. package/dist/chunks/studio-cqf1k4qk.js +0 -5
  269. package/dist/chunks/studio-cvz0e00f.js +0 -5
  270. package/dist/chunks/studio-dbgv4fv9.js +0 -16
  271. package/dist/chunks/studio-eesyjg7h.js +0 -9
  272. package/dist/chunks/studio-et6t8g4m.js +0 -4
  273. package/dist/chunks/studio-fep7hr66.js +0 -7
  274. package/dist/chunks/studio-fyf7j57j.js +0 -5
  275. package/dist/chunks/studio-g5prntab.js +0 -5
  276. package/dist/chunks/studio-ga77mf07.js +0 -5
  277. package/dist/chunks/studio-h7gy12h2.js +0 -5
  278. package/dist/chunks/studio-j933k8nr.js +0 -5
  279. package/dist/chunks/studio-jgbvqcgh.js +0 -5
  280. package/dist/chunks/studio-k4xc5g6h.js +0 -5
  281. package/dist/chunks/studio-p0nf2e1f.js +0 -6
  282. package/dist/chunks/studio-pd9dsqpq.js +0 -5
  283. package/dist/chunks/studio-pmzg17fj.js +0 -5
  284. package/dist/chunks/studio-pzfa2vmb.js +0 -5
  285. package/dist/chunks/studio-qyb5bebs.js +0 -9
  286. package/dist/chunks/studio-rt498t2v.js +0 -5
  287. package/dist/chunks/studio-s0fg2wav.js +0 -5
  288. package/dist/chunks/studio-t3j8htp7.js +0 -7
  289. package/dist/chunks/studio-thj81e98.js +0 -7
  290. package/dist/chunks/studio-tyw7tk0x.js +0 -5
  291. package/dist/chunks/studio-vcz63n42.js +0 -5
  292. package/dist/chunks/studio-vffwe9k7.js +0 -5
  293. package/dist/chunks/studio-vjhej0w5.js +0 -928
  294. package/dist/chunks/studio-vxjap704.js +0 -5
  295. package/dist/chunks/studio-xebavr9s.js +0 -5
  296. package/dist/chunks/studio-yg5n49za.js +0 -5
  297. package/dist/chunks/studio-yhz5b313.js +0 -5
  298. package/dist/chunks/studio-zsjpsw08.js +0 -5
  299. package/dist/chunks/workspace-d65bz1qk.js +0 -4
  300. package/dist/chunks/workspace-home-vbg9b3jh.js +0 -4
  301. package/src/settings/settings-dialog.ts +0 -192
  302. package/src/surfaces/settings-dialog.json +0 -51
  303. package/src/surfaces/settings-dialog.ts +0 -169
@@ -1,14 +1,14 @@
1
- import{np,ba,Y0,yd,Wn,we}from"./studio-vjhej0w5.js";import{Kx}from"./studio-eesyjg7h.js";import{vI}from"./studio-37twdaf7.js";class z{constructor(o,e){this._modeId=o,this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){if(this._worker)this._worker.dispose(),this._worker=null;this._client=null}async _updateExtraLibs(){if(!this._worker)return;let o=++this._updateExtraLibsToken,e=await this._worker.getProxy();if(this._updateExtraLibsToken!==o)return;e.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){if(!this._client)this._client=(async()=>{if(this._worker=Kx({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("ts.worker.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync())return await this._worker.withSyncedResources(Wn.getModels().filter((o)=>o.getLanguageId()===this._modeId).map((o)=>o.uri));return await this._worker.getProxy()})();return this._client}async getLanguageServiceWorker(...o){let e=await this._getClient();if(this._worker)await this._worker.withSyncedResources(o);return e}}var i={};i["lib.d.ts"]=!0;i["lib.decorators.d.ts"]=!0;i["lib.decorators.legacy.d.ts"]=!0;i["lib.dom.asynciterable.d.ts"]=!0;i["lib.dom.d.ts"]=!0;i["lib.dom.iterable.d.ts"]=!0;i["lib.es2015.collection.d.ts"]=!0;i["lib.es2015.core.d.ts"]=!0;i["lib.es2015.d.ts"]=!0;i["lib.es2015.generator.d.ts"]=!0;i["lib.es2015.iterable.d.ts"]=!0;i["lib.es2015.promise.d.ts"]=!0;i["lib.es2015.proxy.d.ts"]=!0;i["lib.es2015.reflect.d.ts"]=!0;i["lib.es2015.symbol.d.ts"]=!0;i["lib.es2015.symbol.wellknown.d.ts"]=!0;i["lib.es2016.array.include.d.ts"]=!0;i["lib.es2016.d.ts"]=!0;i["lib.es2016.full.d.ts"]=!0;i["lib.es2016.intl.d.ts"]=!0;i["lib.es2017.arraybuffer.d.ts"]=!0;i["lib.es2017.d.ts"]=!0;i["lib.es2017.date.d.ts"]=!0;i["lib.es2017.full.d.ts"]=!0;i["lib.es2017.intl.d.ts"]=!0;i["lib.es2017.object.d.ts"]=!0;i["lib.es2017.sharedmemory.d.ts"]=!0;i["lib.es2017.string.d.ts"]=!0;i["lib.es2017.typedarrays.d.ts"]=!0;i["lib.es2018.asyncgenerator.d.ts"]=!0;i["lib.es2018.asynciterable.d.ts"]=!0;i["lib.es2018.d.ts"]=!0;i["lib.es2018.full.d.ts"]=!0;i["lib.es2018.intl.d.ts"]=!0;i["lib.es2018.promise.d.ts"]=!0;i["lib.es2018.regexp.d.ts"]=!0;i["lib.es2019.array.d.ts"]=!0;i["lib.es2019.d.ts"]=!0;i["lib.es2019.full.d.ts"]=!0;i["lib.es2019.intl.d.ts"]=!0;i["lib.es2019.object.d.ts"]=!0;i["lib.es2019.string.d.ts"]=!0;i["lib.es2019.symbol.d.ts"]=!0;i["lib.es2020.bigint.d.ts"]=!0;i["lib.es2020.d.ts"]=!0;i["lib.es2020.date.d.ts"]=!0;i["lib.es2020.full.d.ts"]=!0;i["lib.es2020.intl.d.ts"]=!0;i["lib.es2020.number.d.ts"]=!0;i["lib.es2020.promise.d.ts"]=!0;i["lib.es2020.sharedmemory.d.ts"]=!0;i["lib.es2020.string.d.ts"]=!0;i["lib.es2020.symbol.wellknown.d.ts"]=!0;i["lib.es2021.d.ts"]=!0;i["lib.es2021.full.d.ts"]=!0;i["lib.es2021.intl.d.ts"]=!0;i["lib.es2021.promise.d.ts"]=!0;i["lib.es2021.string.d.ts"]=!0;i["lib.es2021.weakref.d.ts"]=!0;i["lib.es2022.array.d.ts"]=!0;i["lib.es2022.d.ts"]=!0;i["lib.es2022.error.d.ts"]=!0;i["lib.es2022.full.d.ts"]=!0;i["lib.es2022.intl.d.ts"]=!0;i["lib.es2022.object.d.ts"]=!0;i["lib.es2022.regexp.d.ts"]=!0;i["lib.es2022.string.d.ts"]=!0;i["lib.es2023.array.d.ts"]=!0;i["lib.es2023.collection.d.ts"]=!0;i["lib.es2023.d.ts"]=!0;i["lib.es2023.full.d.ts"]=!0;i["lib.es2023.intl.d.ts"]=!0;i["lib.es2024.arraybuffer.d.ts"]=!0;i["lib.es2024.collection.d.ts"]=!0;i["lib.es2024.d.ts"]=!0;i["lib.es2024.full.d.ts"]=!0;i["lib.es2024.object.d.ts"]=!0;i["lib.es2024.promise.d.ts"]=!0;i["lib.es2024.regexp.d.ts"]=!0;i["lib.es2024.sharedmemory.d.ts"]=!0;i["lib.es2024.string.d.ts"]=!0;i["lib.es5.d.ts"]=!0;i["lib.es6.d.ts"]=!0;i["lib.esnext.array.d.ts"]=!0;i["lib.esnext.collection.d.ts"]=!0;i["lib.esnext.d.ts"]=!0;i["lib.esnext.decorators.d.ts"]=!0;i["lib.esnext.disposable.d.ts"]=!0;i["lib.esnext.error.d.ts"]=!0;i["lib.esnext.float16.d.ts"]=!0;i["lib.esnext.full.d.ts"]=!0;i["lib.esnext.intl.d.ts"]=!0;i["lib.esnext.iterator.d.ts"]=!0;i["lib.esnext.promise.d.ts"]=!0;i["lib.esnext.sharedmemory.d.ts"]=!0;i["lib.scripthost.d.ts"]=!0;i["lib.webworker.asynciterable.d.ts"]=!0;i["lib.webworker.d.ts"]=!0;i["lib.webworker.importscripts.d.ts"]=!0;i["lib.webworker.iterable.d.ts"]=!0;function M(o,e,n=0){if(typeof o==="string")return o;else if(o===void 0)return"";let c="";if(n){c+=e;for(let r=0;r<n;r++)c+=" "}if(c+=o.messageText,n++,o.next)for(let r of o.next)c+=M(r,e,n);return c}function v(o){if(o)return o.map((e)=>e.text).join("");return""}class b{constructor(o){this._worker=o}_textSpanToRange(o,e){let n=o.getPositionAt(e.start),c=o.getPositionAt(e.start+e.length),{lineNumber:r,column:s}=n,{lineNumber:d,column:t}=c;return{startLineNumber:r,startColumn:s,endLineNumber:d,endColumn:t}}}class A{constructor(o){this._worker=o,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(o){if(!o)return!1;if(o.path.indexOf("/lib.")===0)return!!i[o.path.slice(1)];return!1}getOrCreateModel(o){let e=yd.parse(o),n=Wn.getModel(e);if(n)return n;if(this.isLibFile(e)&&this._hasFetchedLibFiles)return Wn.createModel(this._libFiles[e.path.slice(1)],"typescript",e);let c=vI.getExtraLibs()[o];if(c)return Wn.createModel(c.content,"typescript",e);return null}_containsLibFile(o){for(let e of o)if(this.isLibFile(e))return!0;return!1}async fetchLibFilesIfNecessary(o){if(!this._containsLibFile(o))return;await this._fetchLibFiles()}_fetchLibFiles(){if(!this._fetchLibFilesPromise)this._fetchLibFilesPromise=this._worker().then((o)=>o.getLibFiles()).then((o)=>{this._hasFetchedLibFiles=!0,this._libFiles=o});return this._fetchLibFilesPromise}}class C extends b{constructor(o,e,n,c){super(c);this._libFiles=o,this._defaults=e,this._selector=n,this._disposables=[],this._listener=Object.create(null);let r=(t)=>{if(t.getLanguageId()!==n)return;let l=()=>{let{onlyVisible:u}=this._defaults.getDiagnosticsOptions();if(u){if(t.isAttachedToEditor())this._doValidate(t)}else this._doValidate(t)},p,g=t.onDidChangeContent(()=>{clearTimeout(p),p=window.setTimeout(l,500)}),m=t.onDidChangeAttached(()=>{let{onlyVisible:u}=this._defaults.getDiagnosticsOptions();if(u)if(t.isAttachedToEditor())l();else Wn.setModelMarkers(t,this._selector,[])});this._listener[t.uri.toString()]={dispose(){g.dispose(),m.dispose(),clearTimeout(p)}},l()},s=(t)=>{Wn.setModelMarkers(t,this._selector,[]);let l=t.uri.toString();if(this._listener[l])this._listener[l].dispose(),delete this._listener[l]};this._disposables.push(Wn.onDidCreateModel((t)=>r(t))),this._disposables.push(Wn.onWillDisposeModel(s)),this._disposables.push(Wn.onDidChangeModelLanguage((t)=>{s(t.model),r(t.model)})),this._disposables.push({dispose(){for(let t of Wn.getModels())s(t)}});let d=()=>{for(let t of Wn.getModels())s(t),r(t)};this._disposables.push(this._defaults.onDidChange(d)),this._disposables.push(this._defaults.onDidExtraLibsChange(d)),Wn.getModels().forEach((t)=>r(t))}dispose(){this._disposables.forEach((o)=>o&&o.dispose()),this._disposables=[]}async _doValidate(o){let e=await this._worker(o.uri);if(o.isDisposed())return;let n=[],{noSyntaxValidation:c,noSemanticValidation:r,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();if(!c)n.push(e.getSyntacticDiagnostics(o.uri.toString()));if(!r)n.push(e.getSemanticDiagnostics(o.uri.toString()));if(!s)n.push(e.getSuggestionDiagnostics(o.uri.toString()));let d=await Promise.all(n);if(!d||o.isDisposed())return;let t=d.reduce((p,g)=>g.concat(p),[]).filter((p)=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(p.code)===-1),l=t.map((p)=>p.relatedInformation||[]).reduce((p,g)=>g.concat(p),[]).map((p)=>p.file?yd.parse(p.file.fileName):null);if(await this._libFiles.fetchLibFilesIfNecessary(l),o.isDisposed())return;Wn.setModelMarkers(o,this._selector,t.map((p)=>this._convertDiagnostics(o,p)))}_convertDiagnostics(o,e){let n=e.start||0,c=e.length||1,{lineNumber:r,column:s}=o.getPositionAt(n),{lineNumber:d,column:t}=o.getPositionAt(n+c),l=[];if(e.reportsUnnecessary)l.push(Y0.Unnecessary);if(e.reportsDeprecated)l.push(Y0.Deprecated);return{severity:this._tsDiagnosticCategoryToMarkerSeverity(e.category),startLineNumber:r,startColumn:s,endLineNumber:d,endColumn:t,message:M(e.messageText,`
1
+ import{hp,wa,C_,Ed,Un,xe}from"./studio-eqcddvc2.js";import{_0}from"./studio-egnjpyde.js";import{pR}from"./studio-k0xzrse2.js";class z{constructor(o,e){this._modeId=o,this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){if(this._worker)this._worker.dispose(),this._worker=null;this._client=null}async _updateExtraLibs(){if(!this._worker)return;let o=++this._updateExtraLibsToken,e=await this._worker.getProxy();if(this._updateExtraLibsToken!==o)return;e.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){if(!this._client)this._client=(async()=>{if(this._worker=_0({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("ts.worker.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync())return await this._worker.withSyncedResources(Un.getModels().filter((o)=>o.getLanguageId()===this._modeId).map((o)=>o.uri));return await this._worker.getProxy()})();return this._client}async getLanguageServiceWorker(...o){let e=await this._getClient();if(this._worker)await this._worker.withSyncedResources(o);return e}}var i={};i["lib.d.ts"]=!0;i["lib.decorators.d.ts"]=!0;i["lib.decorators.legacy.d.ts"]=!0;i["lib.dom.asynciterable.d.ts"]=!0;i["lib.dom.d.ts"]=!0;i["lib.dom.iterable.d.ts"]=!0;i["lib.es2015.collection.d.ts"]=!0;i["lib.es2015.core.d.ts"]=!0;i["lib.es2015.d.ts"]=!0;i["lib.es2015.generator.d.ts"]=!0;i["lib.es2015.iterable.d.ts"]=!0;i["lib.es2015.promise.d.ts"]=!0;i["lib.es2015.proxy.d.ts"]=!0;i["lib.es2015.reflect.d.ts"]=!0;i["lib.es2015.symbol.d.ts"]=!0;i["lib.es2015.symbol.wellknown.d.ts"]=!0;i["lib.es2016.array.include.d.ts"]=!0;i["lib.es2016.d.ts"]=!0;i["lib.es2016.full.d.ts"]=!0;i["lib.es2016.intl.d.ts"]=!0;i["lib.es2017.arraybuffer.d.ts"]=!0;i["lib.es2017.d.ts"]=!0;i["lib.es2017.date.d.ts"]=!0;i["lib.es2017.full.d.ts"]=!0;i["lib.es2017.intl.d.ts"]=!0;i["lib.es2017.object.d.ts"]=!0;i["lib.es2017.sharedmemory.d.ts"]=!0;i["lib.es2017.string.d.ts"]=!0;i["lib.es2017.typedarrays.d.ts"]=!0;i["lib.es2018.asyncgenerator.d.ts"]=!0;i["lib.es2018.asynciterable.d.ts"]=!0;i["lib.es2018.d.ts"]=!0;i["lib.es2018.full.d.ts"]=!0;i["lib.es2018.intl.d.ts"]=!0;i["lib.es2018.promise.d.ts"]=!0;i["lib.es2018.regexp.d.ts"]=!0;i["lib.es2019.array.d.ts"]=!0;i["lib.es2019.d.ts"]=!0;i["lib.es2019.full.d.ts"]=!0;i["lib.es2019.intl.d.ts"]=!0;i["lib.es2019.object.d.ts"]=!0;i["lib.es2019.string.d.ts"]=!0;i["lib.es2019.symbol.d.ts"]=!0;i["lib.es2020.bigint.d.ts"]=!0;i["lib.es2020.d.ts"]=!0;i["lib.es2020.date.d.ts"]=!0;i["lib.es2020.full.d.ts"]=!0;i["lib.es2020.intl.d.ts"]=!0;i["lib.es2020.number.d.ts"]=!0;i["lib.es2020.promise.d.ts"]=!0;i["lib.es2020.sharedmemory.d.ts"]=!0;i["lib.es2020.string.d.ts"]=!0;i["lib.es2020.symbol.wellknown.d.ts"]=!0;i["lib.es2021.d.ts"]=!0;i["lib.es2021.full.d.ts"]=!0;i["lib.es2021.intl.d.ts"]=!0;i["lib.es2021.promise.d.ts"]=!0;i["lib.es2021.string.d.ts"]=!0;i["lib.es2021.weakref.d.ts"]=!0;i["lib.es2022.array.d.ts"]=!0;i["lib.es2022.d.ts"]=!0;i["lib.es2022.error.d.ts"]=!0;i["lib.es2022.full.d.ts"]=!0;i["lib.es2022.intl.d.ts"]=!0;i["lib.es2022.object.d.ts"]=!0;i["lib.es2022.regexp.d.ts"]=!0;i["lib.es2022.string.d.ts"]=!0;i["lib.es2023.array.d.ts"]=!0;i["lib.es2023.collection.d.ts"]=!0;i["lib.es2023.d.ts"]=!0;i["lib.es2023.full.d.ts"]=!0;i["lib.es2023.intl.d.ts"]=!0;i["lib.es2024.arraybuffer.d.ts"]=!0;i["lib.es2024.collection.d.ts"]=!0;i["lib.es2024.d.ts"]=!0;i["lib.es2024.full.d.ts"]=!0;i["lib.es2024.object.d.ts"]=!0;i["lib.es2024.promise.d.ts"]=!0;i["lib.es2024.regexp.d.ts"]=!0;i["lib.es2024.sharedmemory.d.ts"]=!0;i["lib.es2024.string.d.ts"]=!0;i["lib.es5.d.ts"]=!0;i["lib.es6.d.ts"]=!0;i["lib.esnext.array.d.ts"]=!0;i["lib.esnext.collection.d.ts"]=!0;i["lib.esnext.d.ts"]=!0;i["lib.esnext.decorators.d.ts"]=!0;i["lib.esnext.disposable.d.ts"]=!0;i["lib.esnext.error.d.ts"]=!0;i["lib.esnext.float16.d.ts"]=!0;i["lib.esnext.full.d.ts"]=!0;i["lib.esnext.intl.d.ts"]=!0;i["lib.esnext.iterator.d.ts"]=!0;i["lib.esnext.promise.d.ts"]=!0;i["lib.esnext.sharedmemory.d.ts"]=!0;i["lib.scripthost.d.ts"]=!0;i["lib.webworker.asynciterable.d.ts"]=!0;i["lib.webworker.d.ts"]=!0;i["lib.webworker.importscripts.d.ts"]=!0;i["lib.webworker.iterable.d.ts"]=!0;function M(o,e,n=0){if(typeof o==="string")return o;else if(o===void 0)return"";let c="";if(n){c+=e;for(let r=0;r<n;r++)c+=" "}if(c+=o.messageText,n++,o.next)for(let r of o.next)c+=M(r,e,n);return c}function v(o){if(o)return o.map((e)=>e.text).join("");return""}class b{constructor(o){this._worker=o}_textSpanToRange(o,e){let n=o.getPositionAt(e.start),c=o.getPositionAt(e.start+e.length),{lineNumber:r,column:s}=n,{lineNumber:d,column:t}=c;return{startLineNumber:r,startColumn:s,endLineNumber:d,endColumn:t}}}class A{constructor(o){this._worker=o,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(o){if(!o)return!1;if(o.path.indexOf("/lib.")===0)return!!i[o.path.slice(1)];return!1}getOrCreateModel(o){let e=Ed.parse(o),n=Un.getModel(e);if(n)return n;if(this.isLibFile(e)&&this._hasFetchedLibFiles)return Un.createModel(this._libFiles[e.path.slice(1)],"typescript",e);let c=pR.getExtraLibs()[o];if(c)return Un.createModel(c.content,"typescript",e);return null}_containsLibFile(o){for(let e of o)if(this.isLibFile(e))return!0;return!1}async fetchLibFilesIfNecessary(o){if(!this._containsLibFile(o))return;await this._fetchLibFiles()}_fetchLibFiles(){if(!this._fetchLibFilesPromise)this._fetchLibFilesPromise=this._worker().then((o)=>o.getLibFiles()).then((o)=>{this._hasFetchedLibFiles=!0,this._libFiles=o});return this._fetchLibFilesPromise}}class C extends b{constructor(o,e,n,c){super(c);this._libFiles=o,this._defaults=e,this._selector=n,this._disposables=[],this._listener=Object.create(null);let r=(t)=>{if(t.getLanguageId()!==n)return;let l=()=>{let{onlyVisible:u}=this._defaults.getDiagnosticsOptions();if(u){if(t.isAttachedToEditor())this._doValidate(t)}else this._doValidate(t)},p,g=t.onDidChangeContent(()=>{clearTimeout(p),p=window.setTimeout(l,500)}),m=t.onDidChangeAttached(()=>{let{onlyVisible:u}=this._defaults.getDiagnosticsOptions();if(u)if(t.isAttachedToEditor())l();else Un.setModelMarkers(t,this._selector,[])});this._listener[t.uri.toString()]={dispose(){g.dispose(),m.dispose(),clearTimeout(p)}},l()},s=(t)=>{Un.setModelMarkers(t,this._selector,[]);let l=t.uri.toString();if(this._listener[l])this._listener[l].dispose(),delete this._listener[l]};this._disposables.push(Un.onDidCreateModel((t)=>r(t))),this._disposables.push(Un.onWillDisposeModel(s)),this._disposables.push(Un.onDidChangeModelLanguage((t)=>{s(t.model),r(t.model)})),this._disposables.push({dispose(){for(let t of Un.getModels())s(t)}});let d=()=>{for(let t of Un.getModels())s(t),r(t)};this._disposables.push(this._defaults.onDidChange(d)),this._disposables.push(this._defaults.onDidExtraLibsChange(d)),Un.getModels().forEach((t)=>r(t))}dispose(){this._disposables.forEach((o)=>o&&o.dispose()),this._disposables=[]}async _doValidate(o){let e=await this._worker(o.uri);if(o.isDisposed())return;let n=[],{noSyntaxValidation:c,noSemanticValidation:r,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();if(!c)n.push(e.getSyntacticDiagnostics(o.uri.toString()));if(!r)n.push(e.getSemanticDiagnostics(o.uri.toString()));if(!s)n.push(e.getSuggestionDiagnostics(o.uri.toString()));let d=await Promise.all(n);if(!d||o.isDisposed())return;let t=d.reduce((p,g)=>g.concat(p),[]).filter((p)=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(p.code)===-1),l=t.map((p)=>p.relatedInformation||[]).reduce((p,g)=>g.concat(p),[]).map((p)=>p.file?Ed.parse(p.file.fileName):null);if(await this._libFiles.fetchLibFilesIfNecessary(l),o.isDisposed())return;Un.setModelMarkers(o,this._selector,t.map((p)=>this._convertDiagnostics(o,p)))}_convertDiagnostics(o,e){let n=e.start||0,c=e.length||1,{lineNumber:r,column:s}=o.getPositionAt(n),{lineNumber:d,column:t}=o.getPositionAt(n+c),l=[];if(e.reportsUnnecessary)l.push(C_.Unnecessary);if(e.reportsDeprecated)l.push(C_.Deprecated);return{severity:this._tsDiagnosticCategoryToMarkerSeverity(e.category),startLineNumber:r,startColumn:s,endLineNumber:d,endColumn:t,message:M(e.messageText,`
2
2
  `),code:e.code.toString(),tags:l,relatedInformation:this._convertRelatedInformation(o,e.relatedInformation)}}_convertRelatedInformation(o,e){if(!e)return[];let n=[];return e.forEach((c)=>{let r=o;if(c.file)r=this._libFiles.getOrCreateModel(c.file.fileName);if(!r)return;let s=c.start||0,d=c.length||1,{lineNumber:t,column:l}=r.getPositionAt(s),{lineNumber:p,column:g}=r.getPositionAt(s+d);n.push({resource:r.uri,startLineNumber:t,startColumn:l,endLineNumber:p,endColumn:g,message:M(c.messageText,`
3
- `)})}),n}_tsDiagnosticCategoryToMarkerSeverity(o){switch(o){case 1:return ba.Error;case 3:return ba.Info;case 0:return ba.Warning;case 2:return ba.Hint}return ba.Info}}class x extends b{get triggerCharacters(){return["."]}async provideCompletionItems(o,e,n,c){let r=o.getWordUntilPosition(e),s=new np(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn),d=o.uri,t=o.getOffsetAt(e),l=await this._worker(d);if(o.isDisposed())return;let p=await l.getCompletionsAtPosition(d.toString(),t);if(!p||o.isDisposed())return;return{suggestions:p.entries.map((m)=>{let u=s;if(m.replacementSpan){let k=o.getPositionAt(m.replacementSpan.start),y=o.getPositionAt(m.replacementSpan.start+m.replacementSpan.length);u=new np(k.lineNumber,k.column,y.lineNumber,y.column)}let w=[];if(m.kindModifiers!==void 0&&m.kindModifiers.indexOf("deprecated")!==-1)w.push(we.CompletionItemTag.Deprecated);return{uri:d,position:e,offset:t,range:u,label:m.name,insertText:m.name,sortText:m.sortText,kind:x.convertKind(m.kind),tags:w}})}}async resolveCompletionItem(o,e){let n=o,{uri:c,position:r,offset:s}=n,t=await(await this._worker(c)).getCompletionEntryDetails(c.toString(),s,n.label);if(!t)return n;return{uri:c,position:r,label:t.name,kind:x.convertKind(t.kind),detail:v(t.displayParts),documentation:{value:x.createDocumentationString(t)}}}static convertKind(o){switch(o){case a.primitiveType:case a.keyword:return we.CompletionItemKind.Keyword;case a.variable:case a.localVariable:return we.CompletionItemKind.Variable;case a.memberVariable:case a.memberGetAccessor:case a.memberSetAccessor:return we.CompletionItemKind.Field;case a.function:case a.memberFunction:case a.constructSignature:case a.callSignature:case a.indexSignature:return we.CompletionItemKind.Function;case a.enum:return we.CompletionItemKind.Enum;case a.module:return we.CompletionItemKind.Module;case a.class:return we.CompletionItemKind.Class;case a.interface:return we.CompletionItemKind.Interface;case a.warning:return we.CompletionItemKind.File}return we.CompletionItemKind.Property}static createDocumentationString(o){let e=v(o.documentation);if(o.tags)for(let n of o.tags)e+=`
3
+ `)})}),n}_tsDiagnosticCategoryToMarkerSeverity(o){switch(o){case 1:return wa.Error;case 3:return wa.Info;case 0:return wa.Warning;case 2:return wa.Hint}return wa.Info}}class x extends b{get triggerCharacters(){return["."]}async provideCompletionItems(o,e,n,c){let r=o.getWordUntilPosition(e),s=new hp(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn),d=o.uri,t=o.getOffsetAt(e),l=await this._worker(d);if(o.isDisposed())return;let p=await l.getCompletionsAtPosition(d.toString(),t);if(!p||o.isDisposed())return;return{suggestions:p.entries.map((m)=>{let u=s;if(m.replacementSpan){let k=o.getPositionAt(m.replacementSpan.start),y=o.getPositionAt(m.replacementSpan.start+m.replacementSpan.length);u=new hp(k.lineNumber,k.column,y.lineNumber,y.column)}let w=[];if(m.kindModifiers!==void 0&&m.kindModifiers.indexOf("deprecated")!==-1)w.push(xe.CompletionItemTag.Deprecated);return{uri:d,position:e,offset:t,range:u,label:m.name,insertText:m.name,sortText:m.sortText,kind:x.convertKind(m.kind),tags:w}})}}async resolveCompletionItem(o,e){let n=o,{uri:c,position:r,offset:s}=n,t=await(await this._worker(c)).getCompletionEntryDetails(c.toString(),s,n.label);if(!t)return n;return{uri:c,position:r,label:t.name,kind:x.convertKind(t.kind),detail:v(t.displayParts),documentation:{value:x.createDocumentationString(t)}}}static convertKind(o){switch(o){case a.primitiveType:case a.keyword:return xe.CompletionItemKind.Keyword;case a.variable:case a.localVariable:return xe.CompletionItemKind.Variable;case a.memberVariable:case a.memberGetAccessor:case a.memberSetAccessor:return xe.CompletionItemKind.Field;case a.function:case a.memberFunction:case a.constructSignature:case a.callSignature:case a.indexSignature:return xe.CompletionItemKind.Function;case a.enum:return xe.CompletionItemKind.Enum;case a.module:return xe.CompletionItemKind.Module;case a.class:return xe.CompletionItemKind.Class;case a.interface:return xe.CompletionItemKind.Interface;case a.warning:return xe.CompletionItemKind.File}return xe.CompletionItemKind.Property}static createDocumentationString(o){let e=v(o.documentation);if(o.tags)for(let n of o.tags)e+=`
4
4
 
5
- ${R(n)}`;return e}}function R(o){let e=`*@${o.name}*`;if(o.name==="param"&&o.text){let[n,...c]=o.text;if(e+=`\`${n.text}\``,c.length>0)e+=` — ${c.map((r)=>r.text).join(" ")}`}else if(Array.isArray(o.text))e+=` — ${o.text.map((n)=>n.text).join(" ")}`;else if(o.text)e+=` — ${o.text}`;return e}class L extends b{constructor(){super(...arguments);this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(o){switch(o.triggerKind){case we.SignatureHelpTriggerKind.TriggerCharacter:if(o.triggerCharacter)if(o.isRetrigger)return{kind:"retrigger",triggerCharacter:o.triggerCharacter};else return{kind:"characterTyped",triggerCharacter:o.triggerCharacter};else return{kind:"invoked"};case we.SignatureHelpTriggerKind.ContentChange:return o.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case we.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(o,e,n,c){let r=o.uri,s=o.getOffsetAt(e),d=await this._worker(r);if(o.isDisposed())return;let t=await d.getSignatureHelpItems(r.toString(),s,{triggerReason:L._toSignatureHelpTriggerReason(c)});if(!t||o.isDisposed())return;let l={activeSignature:t.selectedItemIndex,activeParameter:t.argumentIndex,signatures:[]};return t.items.forEach((p)=>{let g={label:"",parameters:[]};g.documentation={value:v(p.documentation)},g.label+=v(p.prefixDisplayParts),p.parameters.forEach((m,u,w)=>{let k=v(m.displayParts),y={label:k,documentation:{value:v(m.documentation)}};if(g.label+=k,g.parameters.push(y),u<w.length-1)g.label+=v(p.separatorDisplayParts)}),g.label+=v(p.suffixDisplayParts),l.signatures.push(g)}),{value:l,dispose(){}}}}class S extends b{async provideHover(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getQuickInfoAtPosition(c.toString(),r);if(!d||o.isDisposed())return;let t=v(d.documentation),l=d.tags?d.tags.map((g)=>R(g)).join(`
5
+ ${R(n)}`;return e}}function R(o){let e=`*@${o.name}*`;if(o.name==="param"&&o.text){let[n,...c]=o.text;if(e+=`\`${n.text}\``,c.length>0)e+=` — ${c.map((r)=>r.text).join(" ")}`}else if(Array.isArray(o.text))e+=` — ${o.text.map((n)=>n.text).join(" ")}`;else if(o.text)e+=` — ${o.text}`;return e}class L extends b{constructor(){super(...arguments);this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(o){switch(o.triggerKind){case xe.SignatureHelpTriggerKind.TriggerCharacter:if(o.triggerCharacter)if(o.isRetrigger)return{kind:"retrigger",triggerCharacter:o.triggerCharacter};else return{kind:"characterTyped",triggerCharacter:o.triggerCharacter};else return{kind:"invoked"};case xe.SignatureHelpTriggerKind.ContentChange:return o.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case xe.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(o,e,n,c){let r=o.uri,s=o.getOffsetAt(e),d=await this._worker(r);if(o.isDisposed())return;let t=await d.getSignatureHelpItems(r.toString(),s,{triggerReason:L._toSignatureHelpTriggerReason(c)});if(!t||o.isDisposed())return;let l={activeSignature:t.selectedItemIndex,activeParameter:t.argumentIndex,signatures:[]};return t.items.forEach((p)=>{let g={label:"",parameters:[]};g.documentation={value:v(p.documentation)},g.label+=v(p.prefixDisplayParts),p.parameters.forEach((m,u,w)=>{let k=v(m.displayParts),y={label:k,documentation:{value:v(m.documentation)}};if(g.label+=k,g.parameters.push(y),u<w.length-1)g.label+=v(p.separatorDisplayParts)}),g.label+=v(p.suffixDisplayParts),l.signatures.push(g)}),{value:l,dispose(){}}}}class S extends b{async provideHover(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getQuickInfoAtPosition(c.toString(),r);if(!d||o.isDisposed())return;let t=v(d.documentation),l=d.tags?d.tags.map((g)=>R(g)).join(`
6
6
 
7
7
  `):"",p=v(d.displayParts);return{range:this._textSpanToRange(o,d.textSpan),contents:[{value:"```typescript\n"+p+"\n```\n"},{value:t+(l?`
8
8
 
9
- `+l:"")}]}}}class I extends b{async provideDocumentHighlights(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDocumentHighlights(c.toString(),r,[c.toString()]);if(!d||o.isDisposed())return;return d.flatMap((t)=>t.highlightSpans.map((l)=>({range:this._textSpanToRange(o,l.textSpan),kind:l.kind==="writtenReference"?we.DocumentHighlightKind.Write:we.DocumentHighlightKind.Text})))}}class T extends b{constructor(o,e){super(e);this._libFiles=o}async provideDefinition(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDefinitionAtPosition(c.toString(),r);if(!d||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(d.map((l)=>yd.parse(l.fileName))),o.isDisposed())return;let t=[];for(let l of d){let p=this._libFiles.getOrCreateModel(l.fileName);if(p)t.push({uri:p.uri,range:this._textSpanToRange(p,l.textSpan)})}return t}}class D extends b{constructor(o,e){super(e);this._libFiles=o}async provideReferences(o,e,n,c){let r=o.uri,s=o.getOffsetAt(e),d=await this._worker(r);if(o.isDisposed())return;let t=await d.getReferencesAtPosition(r.toString(),s);if(!t||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(t.map((p)=>yd.parse(p.fileName))),o.isDisposed())return;let l=[];for(let p of t){let g=this._libFiles.getOrCreateModel(p.fileName);if(g)l.push({uri:g.uri,range:this._textSpanToRange(g,p.textSpan)})}return l}}class j extends b{async provideDocumentSymbols(o,e){let n=o.uri,c=await this._worker(n);if(o.isDisposed())return;let r=await c.getNavigationTree(n.toString());if(!r||o.isDisposed())return;let s=(t,l)=>({name:t.text,detail:"",kind:h[t.kind]||we.SymbolKind.Variable,range:this._textSpanToRange(o,t.spans[0]),selectionRange:this._textSpanToRange(o,t.spans[0]),tags:[],children:t.childItems?.map((g)=>s(g,t.text)),containerName:l});return r.childItems?r.childItems.map((t)=>s(t)):[]}}class a{}a.unknown="";a.keyword="keyword";a.script="script";a.module="module";a.class="class";a.interface="interface";a.type="type";a.enum="enum";a.variable="var";a.localVariable="local var";a.function="function";a.localFunction="local function";a.memberFunction="method";a.memberGetAccessor="getter";a.memberSetAccessor="setter";a.memberVariable="property";a.constructorImplementation="constructor";a.callSignature="call";a.indexSignature="index";a.constructSignature="construct";a.parameter="parameter";a.typeParameter="type parameter";a.primitiveType="primitive type";a.label="label";a.alias="alias";a.const="const";a.let="let";a.warning="warning";var h=Object.create(null);h[a.module]=we.SymbolKind.Module;h[a.class]=we.SymbolKind.Class;h[a.enum]=we.SymbolKind.Enum;h[a.interface]=we.SymbolKind.Interface;h[a.memberFunction]=we.SymbolKind.Method;h[a.memberVariable]=we.SymbolKind.Property;h[a.memberGetAccessor]=we.SymbolKind.Property;h[a.memberSetAccessor]=we.SymbolKind.Property;h[a.variable]=we.SymbolKind.Variable;h[a.const]=we.SymbolKind.Variable;h[a.localVariable]=we.SymbolKind.Variable;h[a.variable]=we.SymbolKind.Variable;h[a.function]=we.SymbolKind.Function;h[a.localFunction]=we.SymbolKind.Function;class f extends b{static _convertOptions(o){return{ConvertTabsToSpaces:o.insertSpaces,TabSize:o.tabSize,IndentSize:o.tabSize,IndentStyle:2,NewLineCharacter:`
9
+ `+l:"")}]}}}class I extends b{async provideDocumentHighlights(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDocumentHighlights(c.toString(),r,[c.toString()]);if(!d||o.isDisposed())return;return d.flatMap((t)=>t.highlightSpans.map((l)=>({range:this._textSpanToRange(o,l.textSpan),kind:l.kind==="writtenReference"?xe.DocumentHighlightKind.Write:xe.DocumentHighlightKind.Text})))}}class T extends b{constructor(o,e){super(e);this._libFiles=o}async provideDefinition(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDefinitionAtPosition(c.toString(),r);if(!d||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(d.map((l)=>Ed.parse(l.fileName))),o.isDisposed())return;let t=[];for(let l of d){let p=this._libFiles.getOrCreateModel(l.fileName);if(p)t.push({uri:p.uri,range:this._textSpanToRange(p,l.textSpan)})}return t}}class D extends b{constructor(o,e){super(e);this._libFiles=o}async provideReferences(o,e,n,c){let r=o.uri,s=o.getOffsetAt(e),d=await this._worker(r);if(o.isDisposed())return;let t=await d.getReferencesAtPosition(r.toString(),s);if(!t||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(t.map((p)=>Ed.parse(p.fileName))),o.isDisposed())return;let l=[];for(let p of t){let g=this._libFiles.getOrCreateModel(p.fileName);if(g)l.push({uri:g.uri,range:this._textSpanToRange(g,p.textSpan)})}return l}}class j extends b{async provideDocumentSymbols(o,e){let n=o.uri,c=await this._worker(n);if(o.isDisposed())return;let r=await c.getNavigationTree(n.toString());if(!r||o.isDisposed())return;let s=(t,l)=>({name:t.text,detail:"",kind:h[t.kind]||xe.SymbolKind.Variable,range:this._textSpanToRange(o,t.spans[0]),selectionRange:this._textSpanToRange(o,t.spans[0]),tags:[],children:t.childItems?.map((g)=>s(g,t.text)),containerName:l});return r.childItems?r.childItems.map((t)=>s(t)):[]}}class a{}a.unknown="";a.keyword="keyword";a.script="script";a.module="module";a.class="class";a.interface="interface";a.type="type";a.enum="enum";a.variable="var";a.localVariable="local var";a.function="function";a.localFunction="local function";a.memberFunction="method";a.memberGetAccessor="getter";a.memberSetAccessor="setter";a.memberVariable="property";a.constructorImplementation="constructor";a.callSignature="call";a.indexSignature="index";a.constructSignature="construct";a.parameter="parameter";a.typeParameter="type parameter";a.primitiveType="primitive type";a.label="label";a.alias="alias";a.const="const";a.let="let";a.warning="warning";var h=Object.create(null);h[a.module]=xe.SymbolKind.Module;h[a.class]=xe.SymbolKind.Class;h[a.enum]=xe.SymbolKind.Enum;h[a.interface]=xe.SymbolKind.Interface;h[a.memberFunction]=xe.SymbolKind.Method;h[a.memberVariable]=xe.SymbolKind.Property;h[a.memberGetAccessor]=xe.SymbolKind.Property;h[a.memberSetAccessor]=xe.SymbolKind.Property;h[a.variable]=xe.SymbolKind.Variable;h[a.const]=xe.SymbolKind.Variable;h[a.localVariable]=xe.SymbolKind.Variable;h[a.variable]=xe.SymbolKind.Variable;h[a.function]=xe.SymbolKind.Function;h[a.localFunction]=xe.SymbolKind.Function;class f extends b{static _convertOptions(o){return{ConvertTabsToSpaces:o.insertSpaces,TabSize:o.tabSize,IndentSize:o.tabSize,IndentStyle:2,NewLineCharacter:`
10
10
  `,InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(o,e){return{text:e.newText,range:this._textSpanToRange(o,e.span)}}}class q extends f{constructor(){super(...arguments);this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(o,e,n,c){let r=o.uri,s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=await this._worker(r);if(o.isDisposed())return;let l=await t.getFormattingEditsForRange(r.toString(),s,d,f._convertOptions(n));if(!l||o.isDisposed())return;return l.map((p)=>this._convertTextChanges(o,p))}}class B extends f{get autoFormatTriggerCharacters(){return[";","}",`
11
- `]}async provideOnTypeFormattingEdits(o,e,n,c,r){let s=o.uri,d=o.getOffsetAt(e),t=await this._worker(s);if(o.isDisposed())return;let l=await t.getFormattingEditsAfterKeystroke(s.toString(),d,n,f._convertOptions(c));if(!l||o.isDisposed())return;return l.map((p)=>this._convertTextChanges(o,p))}}class F extends f{async provideCodeActions(o,e,n,c){let r=o.uri,s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=f._convertOptions(o.getOptions()),l=n.markers.filter((u)=>u.code).map((u)=>u.code).map(Number),p=await this._worker(r);if(o.isDisposed())return;let g=await p.getCodeFixesAtPosition(r.toString(),s,d,l,t);if(!g||o.isDisposed())return{actions:[],dispose:()=>{}};return{actions:g.filter((u)=>u.changes.filter((w)=>w.isNewFile).length===0).map((u)=>this._tsCodeFixActionToMonacoCodeAction(o,n,u)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(o,e,n){let c=[];for(let s of n.changes)for(let d of s.textChanges)c.push({resource:o.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(o,d.span),text:d.newText}});return{title:n.description,edit:{edits:c},diagnostics:e.markers,kind:"quickfix"}}}class E extends b{constructor(o,e){super(e);this._libFiles=o}async provideRenameEdits(o,e,n,c){let r=o.uri,s=r.toString(),d=o.getOffsetAt(e),t=await this._worker(r);if(o.isDisposed())return;let l=await t.getRenameInfo(s,d,{allowRenameOfImportPath:!1});if(l.canRename===!1)return{edits:[],rejectReason:l.localizedErrorMessage};if(l.fileToRename!==void 0)throw Error("Renaming files is not supported.");let p=await t.findRenameLocations(s,d,!1,!1,!1);if(!p||o.isDisposed())return;let g=[];for(let m of p){let u=this._libFiles.getOrCreateModel(m.fileName);if(u)g.push({resource:u.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(u,m.textSpan),text:n}});else throw Error(`Unknown file ${m.fileName}.`)}return{edits:g}}}class N extends b{async provideInlayHints(o,e,n){let c=o.uri,r=c.toString(),s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=await this._worker(c);if(o.isDisposed())return null;return{hints:(await t.provideInlayHints(r,s,d)).map((g)=>({...g,label:g.text,position:o.getPositionAt(g.position),kind:this._convertHintKind(g.kind)})),dispose:()=>{}}}_convertHintKind(o){switch(o){case"Parameter":return we.InlayHintKind.Parameter;case"Type":return we.InlayHintKind.Type;default:return we.InlayHintKind.Type}}}var W,H;function Ot(o){H=O(o,"typescript")}function _t(o){W=O(o,"javascript")}function Pt(){return new Promise((o,e)=>{if(!W)return e("JavaScript not registered!");o(W)})}function Vt(){return new Promise((o,e)=>{if(!H)return e("TypeScript not registered!");o(H)})}function O(o,e){let n=[],c=new z(e,o),r=(...t)=>c.getLanguageServiceWorker(...t),s=new A(r);function d(){let{modeConfiguration:t}=o;if(_(n),t.completionItems)n.push(we.registerCompletionItemProvider(e,new x(r)));if(t.signatureHelp)n.push(we.registerSignatureHelpProvider(e,new L(r)));if(t.hovers)n.push(we.registerHoverProvider(e,new S(r)));if(t.documentHighlights)n.push(we.registerDocumentHighlightProvider(e,new I(r)));if(t.definitions)n.push(we.registerDefinitionProvider(e,new T(s,r)));if(t.references)n.push(we.registerReferenceProvider(e,new D(s,r)));if(t.documentSymbols)n.push(we.registerDocumentSymbolProvider(e,new j(r)));if(t.rename)n.push(we.registerRenameProvider(e,new E(s,r)));if(t.documentRangeFormattingEdits)n.push(we.registerDocumentRangeFormattingEditProvider(e,new q(r)));if(t.onTypeFormattingEdits)n.push(we.registerOnTypeFormattingEditProvider(e,new B(r)));if(t.codeActions)n.push(we.registerCodeActionProvider(e,new F(r)));if(t.inlayHints)n.push(we.registerInlayHintsProvider(e,new N(r)));if(t.diagnostics)n.push(new C(s,o,e,r))}return d(),r}function _(o){while(o.length)o.pop().dispose()}export{b as Adapter,F as CodeActionAdaptor,T as DefinitionAdapter,C as DiagnosticsAdapter,I as DocumentHighlightAdapter,q as FormatAdapter,f as FormatHelper,B as FormatOnTypeAdapter,N as InlayHintsAdapter,a as Kind,A as LibFiles,j as OutlineAdapter,S as QuickInfoAdapter,D as ReferenceAdapter,E as RenameAdapter,L as SignatureHelpAdapter,x as SuggestAdapter,z as WorkerManager,M as flattenDiagnosticMessageText,Pt as getJavaScriptWorker,Vt as getTypeScriptWorker,_t as setupJavaScript,Ot as setupTypeScript};
11
+ `]}async provideOnTypeFormattingEdits(o,e,n,c,r){let s=o.uri,d=o.getOffsetAt(e),t=await this._worker(s);if(o.isDisposed())return;let l=await t.getFormattingEditsAfterKeystroke(s.toString(),d,n,f._convertOptions(c));if(!l||o.isDisposed())return;return l.map((p)=>this._convertTextChanges(o,p))}}class F extends f{async provideCodeActions(o,e,n,c){let r=o.uri,s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=f._convertOptions(o.getOptions()),l=n.markers.filter((u)=>u.code).map((u)=>u.code).map(Number),p=await this._worker(r);if(o.isDisposed())return;let g=await p.getCodeFixesAtPosition(r.toString(),s,d,l,t);if(!g||o.isDisposed())return{actions:[],dispose:()=>{}};return{actions:g.filter((u)=>u.changes.filter((w)=>w.isNewFile).length===0).map((u)=>this._tsCodeFixActionToMonacoCodeAction(o,n,u)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(o,e,n){let c=[];for(let s of n.changes)for(let d of s.textChanges)c.push({resource:o.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(o,d.span),text:d.newText}});return{title:n.description,edit:{edits:c},diagnostics:e.markers,kind:"quickfix"}}}class E extends b{constructor(o,e){super(e);this._libFiles=o}async provideRenameEdits(o,e,n,c){let r=o.uri,s=r.toString(),d=o.getOffsetAt(e),t=await this._worker(r);if(o.isDisposed())return;let l=await t.getRenameInfo(s,d,{allowRenameOfImportPath:!1});if(l.canRename===!1)return{edits:[],rejectReason:l.localizedErrorMessage};if(l.fileToRename!==void 0)throw Error("Renaming files is not supported.");let p=await t.findRenameLocations(s,d,!1,!1,!1);if(!p||o.isDisposed())return;let g=[];for(let m of p){let u=this._libFiles.getOrCreateModel(m.fileName);if(u)g.push({resource:u.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(u,m.textSpan),text:n}});else throw Error(`Unknown file ${m.fileName}.`)}return{edits:g}}}class N extends b{async provideInlayHints(o,e,n){let c=o.uri,r=c.toString(),s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=await this._worker(c);if(o.isDisposed())return null;return{hints:(await t.provideInlayHints(r,s,d)).map((g)=>({...g,label:g.text,position:o.getPositionAt(g.position),kind:this._convertHintKind(g.kind)})),dispose:()=>{}}}_convertHintKind(o){switch(o){case"Parameter":return xe.InlayHintKind.Parameter;case"Type":return xe.InlayHintKind.Type;default:return xe.InlayHintKind.Type}}}var W,H;function Ot(o){H=O(o,"typescript")}function _t(o){W=O(o,"javascript")}function Pt(){return new Promise((o,e)=>{if(!W)return e("JavaScript not registered!");o(W)})}function Vt(){return new Promise((o,e)=>{if(!H)return e("TypeScript not registered!");o(H)})}function O(o,e){let n=[],c=new z(e,o),r=(...t)=>c.getLanguageServiceWorker(...t),s=new A(r);function d(){let{modeConfiguration:t}=o;if(_(n),t.completionItems)n.push(xe.registerCompletionItemProvider(e,new x(r)));if(t.signatureHelp)n.push(xe.registerSignatureHelpProvider(e,new L(r)));if(t.hovers)n.push(xe.registerHoverProvider(e,new S(r)));if(t.documentHighlights)n.push(xe.registerDocumentHighlightProvider(e,new I(r)));if(t.definitions)n.push(xe.registerDefinitionProvider(e,new T(s,r)));if(t.references)n.push(xe.registerReferenceProvider(e,new D(s,r)));if(t.documentSymbols)n.push(xe.registerDocumentSymbolProvider(e,new j(r)));if(t.rename)n.push(xe.registerRenameProvider(e,new E(s,r)));if(t.documentRangeFormattingEdits)n.push(xe.registerDocumentRangeFormattingEditProvider(e,new q(r)));if(t.onTypeFormattingEdits)n.push(xe.registerOnTypeFormattingEditProvider(e,new B(r)));if(t.codeActions)n.push(xe.registerCodeActionProvider(e,new F(r)));if(t.inlayHints)n.push(xe.registerInlayHintsProvider(e,new N(r)));if(t.diagnostics)n.push(new C(s,o,e,r))}return d(),r}function _(o){while(o.length)o.pop().dispose()}export{b as Adapter,F as CodeActionAdaptor,T as DefinitionAdapter,C as DiagnosticsAdapter,I as DocumentHighlightAdapter,q as FormatAdapter,f as FormatHelper,B as FormatOnTypeAdapter,N as InlayHintsAdapter,a as Kind,A as LibFiles,j as OutlineAdapter,S as QuickInfoAdapter,D as ReferenceAdapter,E as RenameAdapter,L as SignatureHelpAdapter,x as SuggestAdapter,z as WorkerManager,M as flattenDiagnosticMessageText,Pt as getJavaScriptWorker,Vt as getTypeScriptWorker,_t as setupJavaScript,Ot as setupTypeScript};
12
12
 
13
- //# debugId=052FC69A97DFE16064756E2164756E21
14
- //# sourceMappingURL=tsMode-6vwhy6ty.js.map
13
+ //# debugId=9030420828D5214B64756E2164756E21
14
+ //# sourceMappingURL=tsMode-jg1dtphj.js.map
@@ -0,0 +1,4 @@
1
+ import{fi,Xm,yI,m,h,qr,pn,Da,Sr,Qm,i1,o1,oc,eg,tg,r1,s1,a1,ng,Sh,rc,Yp,bl,l1,Si,td,c1,wI,Cv,r0,xI,eu,_I,SI,Ft,kv,CI,kI}from"./studio-yrcrncev.js";import"./studio-swedpd82.js";import"./studio-sce30r7b.js";import"./studio-aam8zt8z.js";import"./studio-4fnb5648.js";import"./studio-nvcn2ykc.js";export{yI as MAX_PANES,fi as PRIMARY_PANE,Xm as SECONDARY_PANE,Ft as activateTab,qr as activePane,h as activeTab,l1 as clearPaneActiveTab,_I as closeAllTabs,eg as closePane,eu as closeTab,ng as detachTab,Sr as focusPane,Sh as insertIntoPane,Qm as isPaneFocused,Yp as isTabActive,xI as moveTab,kv as moveTabToPane,Si as openTab,o1 as paneBeside,pn as paneById,tg as paneIsEmpty,Da as paneOfTab,c1 as promoteDirtyPreviewTabs,td as promoteTab,oc as receivingPane,kI as registerTabCommands,CI as renameTab,SI as replaceAllTabs,a1 as setCloseLanding,wI as setEditBesideDocument,s1 as setEmptyPaneFallback,r0 as setTabPinned,r1 as setTabScope,rc as setWorkspaceProject,i1 as splitRight,Cv as tabHoldsEditBesideDocument,bl as tabIsLive,m as workspace};
2
+
3
+ //# debugId=325891B045F9C5F964756E2164756E21
4
+ //# sourceMappingURL=workspace-9btkc8tk.js.map
@@ -0,0 +1,4 @@
1
+ import{jP,z_,uE,hE,W_,ob,pE}from"./studio-fj6c905s.js";import"./studio-0w3541dg.js";import"./studio-3c10v2q1.js";import"./studio-nf8esxxc.js";import"./studio-nwynxqtb.js";import"./studio-r050sez0.js";import"./studio-jeb7hth3.js";import"./studio-9qx1ywbv.js";import"./studio-b68k0z00.js";import"./studio-yzpskb0j.js";import"./studio-waekn290.js";import"./studio-wse1rs8t.js";import"./studio-wgc54sxf.js";import"./studio-fspe7m9t.js";import"./studio-daksw8kh.js";import"./studio-e7vjyp04.js";import"./studio-thz5t120.js";import"./studio-nskxe9q1.js";import"./studio-8kx6m0rg.js";import"./studio-k2evngrj.js";import"./studio-p2a03pgm.js";import"./studio-a65kbs2e.js";import"./studio-ggx3j7nd.js";import"./studio-stahswgb.js";import"./studio-xpx91fby.js";import"./studio-3q7mhbgx.js";import"./studio-53wy9ek3.js";import"./studio-n9qba0gx.js";import"./studio-x0gsfr1d.js";import"./studio-g9brbewz.js";import"./studio-90zkgne5.js";import"./studio-y1b86ast.js";import"./studio-tpxcryf2.js";import"./studio-5tet77de.js";import"./studio-bct64zmj.js";import"./studio-4zd6an2b.js";import"./studio-zfdbmhp3.js";import"./studio-wqfaqw4m.js";import"./studio-hh394phe.js";import"./studio-yrcrncev.js";import"./studio-swedpd82.js";import"./studio-9c6cbq2c.js";import"./studio-sce30r7b.js";import"./studio-aam8zt8z.js";import"./studio-4fnb5648.js";import"./studio-9dq7rwc7.js";import"./studio-nzemfbkk.js";import"./studio-nvcn2ykc.js";import"./studio-1410q5dw.js";import"./studio-1ks5d9y4.js";import"./studio-k1wvtp03.js";export{jP as WORKSPACE_HOME_MODE_SET,ob as detachWorkspaceHome,z_ as isWorkspaceHomeMode,uE as openWorkspaceHome,hE as placeWorkspaceHome,pE as renderWorkspaceHome,W_ as workspaceHomeMounted};
2
+
3
+ //# debugId=CBDAE9980CBB9F4664756E2164756E21
4
+ //# sourceMappingURL=workspace-home-qcc4z5ag.js.map
@@ -1,4 +1,4 @@
1
- import{pk,os,Ka,fk,br,_t,Ja,Bo,Ya,Xo,Dt,Za,Su,op,wd,KI,JI,YI,mk,gk}from"./studio-9rcbvksg.js";import{Ey}from"./studio-9b7177jq.js";var x=30000;class I extends pk{constructor(e){super();this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let r=Su();if(this.getLocalState()!==null&&x/2<=r-this.meta.get(this.clientID).lastUpdated)this.setLocalState(this.getLocalState());let s=[];if(this.meta.forEach((o,c)=>{if(c!==this.clientID&&x<=r-o.lastUpdated&&this.states.has(c))s.push(c)}),s.length>0)L(this,s,"timeout")},os(x/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let r=this.clientID,s=this.meta.get(r),o=s===void 0?0:s.clock+1,c=this.states.get(r);if(e===null)this.states.delete(r);else this.states.set(r,e);this.meta.set(r,{clock:o,lastUpdated:Su()});let a=[],d=[],y=[],f=[];if(e===null)f.push(r);else if(c==null){if(e!=null)a.push(r)}else if(d.push(r),!op(c,e))y.push(r);if(a.length>0||y.length>0||f.length>0)this.emit("change",[{added:a,updated:y,removed:f},"local"]);this.emit("update",[{added:a,updated:d,removed:f},"local"])}setLocalStateField(e,r){let s=this.getLocalState();if(s!==null)this.setLocalState({...s,[e]:r})}getStates(){return this.states}}var L=(e,r,s)=>{let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(e.states.has(a)){if(e.states.delete(a),a===e.clientID){let d=e.meta.get(a);e.meta.set(a,{clock:d.clock+1,lastUpdated:Su()})}o.push(a)}}if(o.length>0)e.emit("change",[{added:[],updated:[],removed:o},s]),e.emit("update",[{added:[],updated:[],removed:o},s])},M=(e,r,s=e.states)=>{let o=r.length,c=Ka();_t(c,o);for(let a=0;a<o;a++){let d=r[a],y=s.get(d)||null,f=e.meta.get(d).clock;_t(c,d),_t(c,f),Ja(c,JSON.stringify(y))}return br(c)};var F=(e,r,s)=>{let o=Ya(r),c=Su(),a=[],d=[],y=[],f=[],U=Dt(o);for(let b=0;b<U;b++){let h=Dt(o),g=Dt(o),S=JSON.parse(Za(o)),v=e.meta.get(h),k=e.states.get(h),w=v===void 0?0:v.clock;if(w<g||w===g&&S===null&&e.states.has(h)){if(S===null)if(h===e.clientID&&e.getLocalState()!=null)g++;else e.states.delete(h);else e.states.set(h,S);if(e.meta.set(h,{clock:g,lastUpdated:c}),v===void 0&&S!==null)a.push(h);else if(v!==void 0&&S===null)f.push(h);else if(S!==null){if(!op(S,k))y.push(h);d.push(h)}}}if(a.length>0||y.length>0||f.length>0)e.emit("change",[{added:a,updated:y,removed:f},s]);if(a.length>0||d.length>0||f.length>0)e.emit("update",[{added:a,updated:d,removed:f},s])};var W=0,D=1,R=2,j=(e,r)=>{_t(e,W);let s=YI(r);Bo(e,s)},H=(e,r,s)=>{_t(e,D),Bo(e,JI(r,s))},B=(e,r,s)=>H(r,s,Xo(e)),N=(e,r,s,o)=>{try{KI(r,Xo(e),s)}catch(c){if(o!=null)o(c);console.error("Caught error while handling a Yjs update",c)}},J=(e,r)=>{_t(e,R),Bo(e,r)},z=N,_=(e,r,s,o,c)=>{let a=Dt(e);switch(a){case W:B(e,r,s);break;case D:N(e,s,o,c);break;case R:z(e,s,o,c);break;default:throw Error("Unknown message type")}return a};var K=1;function se(e){let r=e.webSocketImpl??globalThis.WebSocket,s=e.openTimeoutMs??1e4,o=new Map,c=new Set,a=new wd,d=new I(a);d.setLocalState(null);let y=null,f=null,U="connecting",b=!1,h=(n)=>{if(U===n)return;U=n;for(let t of c)t(n)},g=(n)=>{if(y&&y.readyState===K)try{y.send(mk(n))}catch{}},S=(n)=>{g({message:{path:n,type:"open"},type:"control"})};d.on("update",(n,t)=>{if(t==="remote")return;let l=[...n.added,...n.updated,...n.removed];g({body:M(d,l),type:"awareness"})});let v=(n)=>{switch(n.type){case"hello":{let t={color:n.color,login:n.login,permission:n.permission};if(n.name!==void 0)t.name=n.name;if(n.avatarUrl!==void 0)t.avatarUrl=n.avatarUrl;f=t;return}case"opened":{let t=o.get(n.path);if(!t)return;if(t.opened&&t.epoch!==n.epoch){w(n.path,t);return}t.epoch=n.epoch,t.opened=!0,t.resolveOpen?.(!0),t.resolveOpen=null;let l=Ka();j(l,t.doc),g({body:br(l),epoch:t.epoch,path:n.path,type:"doc-sync"});return}case"doc-reset":{let t=o.get(n.path);if(t)w(n.path,t);return}case"flush-ack":{let t=o.get(n.path);if(t){for(let l of t.pendingFlush)l();t.pendingFlush.clear()}return}case"doc-dirty":{let t=o.get(n.path);if(t){t.dirty=n.dirty;for(let l of t.dirtyCbs)l(n.dirty)}return}case"error":{if(!n.path)return;let t=o.get(n.path);if(!t)return;if(n.code==="content-not-loaded"&&e.hydratePath&&!t.hydrated){t.hydrated=!0,e.hydratePath(n.path).then(()=>S(n.path),()=>{t.resolveOpen?.(!1),t.resolveOpen=null});return}if(!t.opened)t.resolveOpen?.(!1),t.resolveOpen=null;break}default:break}},k=(n,t,l)=>{let u=o.get(n);if(!u||!u.opened||u.epoch!==t)return;let i=Ya(l),m=Ka(),T=_(i,m,u.doc,"remote");if(fk(m)>0)g({body:br(m),epoch:t,path:n,type:"doc-sync"});if(T===D&&!u.synced)u.synced=!0,u.resolveSynced()},w=(n,t)=>{o.delete(n),t.resolveOpen?.(!1),t.resolveOpen=null;for(let l of t.resetCbs)l();t.doc.destroy()},P=()=>{h("connecting");let n=e.protocols,t=n===void 0||n.length===0?new r(e.url):new r(e.url,n);y=t,t.binaryType="arraybuffer",t.onopen=()=>{O.opened(),h("connected");for(let u of o.keys())S(u);if(d.getLocalState()!==null)g({body:M(d,[d.clientID]),type:"awareness"})},t.onmessage=(l)=>{let u=l.data,i=u instanceof ArrayBuffer?new Uint8Array(u):u instanceof Uint8Array?u:null;if(!i)return;let m;try{m=gk(i)}catch{return}switch(m.type){case"control":{v(m.message);return}case"doc-sync":{k(m.path,m.epoch,m.body);return}case"awareness":{F(d,m.body,"remote");break}default:break}},t.onclose=()=>{if(b)return;h("offline");for(let l of o.values())l.opened=!1;O.scheduleRetry()},t.onerror=()=>{}},A={};if(e.reconnectDelayMs!==void 0)A.baseMs=e.reconnectDelayMs;if(e.reconnectRandom!==void 0)A.random=e.reconnectRandom;let O=Ey(P,A);return P(),{destroy(){if(b)return;b=!0,O.dispose(),L(d,[d.clientID],"destroy"),d.destroy(),a.destroy();for(let[n,t]of o)t.resolveOpen?.(!1),t.doc.destroy(),o.delete(n);y?.close()},async openDoc(n){if(b)return null;let t=o.get(n);if(t&&!t.handleDestroyed)return null;let l=()=>{},u=new Promise((p)=>{l=p}),i={dirty:!1,dirtyCbs:new Set,doc:new wd,epoch:0,handleDestroyed:!1,hydrated:!1,opened:!1,pendingFlush:new Set,resetCbs:new Set,resolveOpen:null,resolveSynced:l,synced:!1,whenSynced:u};if(o.set(n,i),i.doc.on("update",(p,V)=>{if(V==="remote"||!i.opened)return;let C=Ka();J(C,p),g({body:br(C),epoch:i.epoch,path:n,type:"doc-sync"})}),!await new Promise((p)=>{i.resolveOpen=p;let V=setTimeout(()=>{i.resolveOpen=null,p(!1)},s);i.resolveOpen=(C)=>{clearTimeout(V),p(C)},S(n)})){if(o.get(n)===i)o.delete(n);return i.doc.destroy(),null}return{awareness:d,destroy:()=>{if(i.handleDestroyed)return;if(i.handleDestroyed=!0,o.get(n)===i)o.delete(n),g({path:n,type:"doc-close"});i.doc.destroy()},doc:i.doc,flush:()=>new Promise((p)=>{i.pendingFlush.add(p),g({message:{path:n,type:"flush"},type:"control"})}),identity:()=>f,onDirty:(p)=>(i.dirtyCbs.add(p),p(i.dirty),()=>i.dirtyCbs.delete(p)),onReset:(p)=>(i.resetCbs.add(p),()=>i.resetCbs.delete(p)),onStatus:(p)=>(c.add(p),()=>c.delete(p)),whenSynced:i.whenSynced}},status:()=>U}}export{se as createWsCollabConnection};
1
+ import{Yk,is,Qa,Zk,br,_t,el,zo,tl,Xo,Dt,nl,$u,fp,Td,WR,VR,UR,Xk,Qk}from"./studio-3na1r48j.js";import{Qy}from"./studio-0x6f3nk9.js";var x=30000;class I extends Yk{constructor(e){super();this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let r=$u();if(this.getLocalState()!==null&&x/2<=r-this.meta.get(this.clientID).lastUpdated)this.setLocalState(this.getLocalState());let s=[];if(this.meta.forEach((o,c)=>{if(c!==this.clientID&&x<=r-o.lastUpdated&&this.states.has(c))s.push(c)}),s.length>0)L(this,s,"timeout")},is(x/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let r=this.clientID,s=this.meta.get(r),o=s===void 0?0:s.clock+1,c=this.states.get(r);if(e===null)this.states.delete(r);else this.states.set(r,e);this.meta.set(r,{clock:o,lastUpdated:$u()});let a=[],d=[],y=[],f=[];if(e===null)f.push(r);else if(c==null){if(e!=null)a.push(r)}else if(d.push(r),!fp(c,e))y.push(r);if(a.length>0||y.length>0||f.length>0)this.emit("change",[{added:a,updated:y,removed:f},"local"]);this.emit("update",[{added:a,updated:d,removed:f},"local"])}setLocalStateField(e,r){let s=this.getLocalState();if(s!==null)this.setLocalState({...s,[e]:r})}getStates(){return this.states}}var L=(e,r,s)=>{let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(e.states.has(a)){if(e.states.delete(a),a===e.clientID){let d=e.meta.get(a);e.meta.set(a,{clock:d.clock+1,lastUpdated:$u()})}o.push(a)}}if(o.length>0)e.emit("change",[{added:[],updated:[],removed:o},s]),e.emit("update",[{added:[],updated:[],removed:o},s])},M=(e,r,s=e.states)=>{let o=r.length,c=Qa();_t(c,o);for(let a=0;a<o;a++){let d=r[a],y=s.get(d)||null,f=e.meta.get(d).clock;_t(c,d),_t(c,f),el(c,JSON.stringify(y))}return br(c)};var F=(e,r,s)=>{let o=tl(r),c=$u(),a=[],d=[],y=[],f=[],U=Dt(o);for(let b=0;b<U;b++){let h=Dt(o),g=Dt(o),S=JSON.parse(nl(o)),v=e.meta.get(h),k=e.states.get(h),w=v===void 0?0:v.clock;if(w<g||w===g&&S===null&&e.states.has(h)){if(S===null)if(h===e.clientID&&e.getLocalState()!=null)g++;else e.states.delete(h);else e.states.set(h,S);if(e.meta.set(h,{clock:g,lastUpdated:c}),v===void 0&&S!==null)a.push(h);else if(v!==void 0&&S===null)f.push(h);else if(S!==null){if(!fp(S,k))y.push(h);d.push(h)}}}if(a.length>0||y.length>0||f.length>0)e.emit("change",[{added:a,updated:y,removed:f},s]);if(a.length>0||d.length>0||f.length>0)e.emit("update",[{added:a,updated:d,removed:f},s])};var W=0,D=1,R=2,j=(e,r)=>{_t(e,W);let s=UR(r);zo(e,s)},H=(e,r,s)=>{_t(e,D),zo(e,VR(r,s))},B=(e,r,s)=>H(r,s,Xo(e)),N=(e,r,s,o)=>{try{WR(r,Xo(e),s)}catch(c){if(o!=null)o(c);console.error("Caught error while handling a Yjs update",c)}},J=(e,r)=>{_t(e,R),zo(e,r)},z=N,_=(e,r,s,o,c)=>{let a=Dt(e);switch(a){case W:B(e,r,s);break;case D:N(e,s,o,c);break;case R:z(e,s,o,c);break;default:throw Error("Unknown message type")}return a};var K=1;function se(e){let r=e.webSocketImpl??globalThis.WebSocket,s=e.openTimeoutMs??1e4,o=new Map,c=new Set,a=new Td,d=new I(a);d.setLocalState(null);let y=null,f=null,U="connecting",b=!1,h=(n)=>{if(U===n)return;U=n;for(let t of c)t(n)},g=(n)=>{if(y&&y.readyState===K)try{y.send(Xk(n))}catch{}},S=(n)=>{g({message:{path:n,type:"open"},type:"control"})};d.on("update",(n,t)=>{if(t==="remote")return;let l=[...n.added,...n.updated,...n.removed];g({body:M(d,l),type:"awareness"})});let v=(n)=>{switch(n.type){case"hello":{let t={color:n.color,login:n.login,permission:n.permission};if(n.name!==void 0)t.name=n.name;if(n.avatarUrl!==void 0)t.avatarUrl=n.avatarUrl;f=t;return}case"opened":{let t=o.get(n.path);if(!t)return;if(t.opened&&t.epoch!==n.epoch){w(n.path,t);return}t.epoch=n.epoch,t.opened=!0,t.resolveOpen?.(!0),t.resolveOpen=null;let l=Qa();j(l,t.doc),g({body:br(l),epoch:t.epoch,path:n.path,type:"doc-sync"});return}case"doc-reset":{let t=o.get(n.path);if(t)w(n.path,t);return}case"flush-ack":{let t=o.get(n.path);if(t){for(let l of t.pendingFlush)l();t.pendingFlush.clear()}return}case"doc-dirty":{let t=o.get(n.path);if(t){t.dirty=n.dirty;for(let l of t.dirtyCbs)l(n.dirty)}return}case"error":{if(!n.path)return;let t=o.get(n.path);if(!t)return;if(n.code==="content-not-loaded"&&e.hydratePath&&!t.hydrated){t.hydrated=!0,e.hydratePath(n.path).then(()=>S(n.path),()=>{t.resolveOpen?.(!1),t.resolveOpen=null});return}if(!t.opened)t.resolveOpen?.(!1),t.resolveOpen=null;break}default:break}},k=(n,t,l)=>{let u=o.get(n);if(!u||!u.opened||u.epoch!==t)return;let i=tl(l),m=Qa(),T=_(i,m,u.doc,"remote");if(Zk(m)>0)g({body:br(m),epoch:t,path:n,type:"doc-sync"});if(T===D&&!u.synced)u.synced=!0,u.resolveSynced()},w=(n,t)=>{o.delete(n),t.resolveOpen?.(!1),t.resolveOpen=null;for(let l of t.resetCbs)l();t.doc.destroy()},P=()=>{h("connecting");let n=e.protocols,t=n===void 0||n.length===0?new r(e.url):new r(e.url,n);y=t,t.binaryType="arraybuffer",t.onopen=()=>{O.opened(),h("connected");for(let u of o.keys())S(u);if(d.getLocalState()!==null)g({body:M(d,[d.clientID]),type:"awareness"})},t.onmessage=(l)=>{let u=l.data,i=u instanceof ArrayBuffer?new Uint8Array(u):u instanceof Uint8Array?u:null;if(!i)return;let m;try{m=Qk(i)}catch{return}switch(m.type){case"control":{v(m.message);return}case"doc-sync":{k(m.path,m.epoch,m.body);return}case"awareness":{F(d,m.body,"remote");break}default:break}},t.onclose=()=>{if(b)return;h("offline");for(let l of o.values())l.opened=!1;O.scheduleRetry()},t.onerror=()=>{}},A={};if(e.reconnectDelayMs!==void 0)A.baseMs=e.reconnectDelayMs;if(e.reconnectRandom!==void 0)A.random=e.reconnectRandom;let O=Qy(P,A);return P(),{destroy(){if(b)return;b=!0,O.dispose(),L(d,[d.clientID],"destroy"),d.destroy(),a.destroy();for(let[n,t]of o)t.resolveOpen?.(!1),t.doc.destroy(),o.delete(n);y?.close()},async openDoc(n){if(b)return null;let t=o.get(n);if(t&&!t.handleDestroyed)return null;let l=()=>{},u=new Promise((p)=>{l=p}),i={dirty:!1,dirtyCbs:new Set,doc:new Td,epoch:0,handleDestroyed:!1,hydrated:!1,opened:!1,pendingFlush:new Set,resetCbs:new Set,resolveOpen:null,resolveSynced:l,synced:!1,whenSynced:u};if(o.set(n,i),i.doc.on("update",(p,V)=>{if(V==="remote"||!i.opened)return;let C=Qa();J(C,p),g({body:br(C),epoch:i.epoch,path:n,type:"doc-sync"})}),!await new Promise((p)=>{i.resolveOpen=p;let V=setTimeout(()=>{i.resolveOpen=null,p(!1)},s);i.resolveOpen=(C)=>{clearTimeout(V),p(C)},S(n)})){if(o.get(n)===i)o.delete(n);return i.doc.destroy(),null}return{awareness:d,destroy:()=>{if(i.handleDestroyed)return;if(i.handleDestroyed=!0,o.get(n)===i)o.delete(n),g({path:n,type:"doc-close"});i.doc.destroy()},doc:i.doc,flush:()=>new Promise((p)=>{i.pendingFlush.add(p),g({message:{path:n,type:"flush"},type:"control"})}),identity:()=>f,onDirty:(p)=>(i.dirtyCbs.add(p),p(i.dirty),()=>i.dirtyCbs.delete(p)),onReset:(p)=>(i.resetCbs.add(p),()=>i.resetCbs.delete(p)),onStatus:(p)=>(c.add(p),()=>c.delete(p)),whenSynced:i.whenSynced}},status:()=>U}}export{se as createWsCollabConnection};
2
2
 
3
- //# debugId=34FD970C30F0B80464756E2164756E21
4
- //# sourceMappingURL=ws-client-zcxkfgmf.js.map
3
+ //# debugId=A6B7FFCBD3BA89FB64756E2164756E21
4
+ //# sourceMappingURL=ws-client-arz2qsy9.js.map