@bkm016/basalt 0.1.35 → 0.1.37

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 (1003) hide show
  1. package/README.md +1 -1
  2. package/chunk-1jtnjzrz.js +3 -0
  3. package/chunk-1xam7mw7.js +2 -0
  4. package/chunk-2df7yf47.js +3 -0
  5. package/chunk-3a3ta83t.js +12 -0
  6. package/chunk-3bb12192.js +39 -0
  7. package/chunk-3j24he2c.js +25 -0
  8. package/chunk-3yyt010j.js +2 -0
  9. package/chunk-412mm63g.js +3 -0
  10. package/chunk-4hrkad68.js +2 -0
  11. package/chunk-4kw8vvae.js +3 -0
  12. package/chunk-5xj2kq5h.js +3 -0
  13. package/chunk-6hajdf5x.js +2 -0
  14. package/chunk-6rkwh4w5.js +3 -0
  15. package/chunk-792xwgne.js +2 -0
  16. package/chunk-7ygt906s.js +2 -0
  17. package/chunk-8bvjjs3r.js +3 -0
  18. package/chunk-8jf1kd0m.js +3 -0
  19. package/chunk-95npkaze.js +5 -0
  20. package/chunk-9yqn7drg.js +3 -0
  21. package/chunk-9zwy8ypg.js +117 -0
  22. package/chunk-ad5asgnr.js +2 -0
  23. package/chunk-akdav0ay.js +3 -0
  24. package/chunk-arzyd0f7.js +8 -0
  25. package/chunk-avrzwnbk.js +2 -0
  26. package/chunk-b3fwt4jy.js +2 -0
  27. package/chunk-b41a7yc5.js +7 -0
  28. package/chunk-be4p5qak.js +103 -0
  29. package/chunk-bkabw9yr.js +3 -0
  30. package/chunk-br7606yh.js +7 -0
  31. package/chunk-brgcdzj9.js +60 -0
  32. package/chunk-bvh3ccr2.js +3 -0
  33. package/chunk-c0htgv5v.js +3 -0
  34. package/chunk-ch8bhqmp.js +2 -0
  35. package/chunk-d2t7tx0d.js +16 -0
  36. package/chunk-d5qsqt4v.js +2 -0
  37. package/chunk-d5sxt7bc.js +13 -0
  38. package/chunk-dz8jyvp4.js +547 -0
  39. package/chunk-e431qjnf.js +3 -0
  40. package/chunk-e69h0e2f.js +2 -0
  41. package/chunk-e9rp422g.js +9 -0
  42. package/chunk-ebmmdfq3.js +2 -0
  43. package/chunk-etvf4tkk.js +3 -0
  44. package/chunk-ewr4r5yx.js +18 -0
  45. package/chunk-ezm2t479.js +11 -0
  46. package/chunk-f5prr1x7.js +59 -0
  47. package/chunk-fxs37w3f.js +10 -0
  48. package/chunk-g27efryh.js +20 -0
  49. package/chunk-g8zcrfzr.js +2 -0
  50. package/chunk-gde46g2m.js +2 -0
  51. package/chunk-gnf6jvxv.js +25 -0
  52. package/chunk-gswcr5j6.js +2 -0
  53. package/chunk-h22spg1q.js +3 -0
  54. package/chunk-h2br80f8.js +3 -0
  55. package/chunk-he09tqj5.js +2 -0
  56. package/chunk-hkx2cpc5.js +3 -0
  57. package/chunk-hnqtkgcq.js +3 -0
  58. package/chunk-hrxkr8a8.js +3 -0
  59. package/chunk-hwkmxr9a.js +5 -0
  60. package/chunk-j9jg8h44.js +2 -0
  61. package/chunk-jhgf0vpr.js +5 -0
  62. package/chunk-k3ndw7d4.js +3 -0
  63. package/chunk-k8mc2tn3.js +3 -0
  64. package/chunk-mbf7201c.js +5 -0
  65. package/chunk-mzhebc7e.js +7 -0
  66. package/chunk-n1c3t0nj.js +2 -0
  67. package/chunk-nmpqx2sh.js +3 -0
  68. package/chunk-p0dacr9z.js +12 -0
  69. package/chunk-q8gv26ze.js +3 -0
  70. package/chunk-qj6bf18b.js +3 -0
  71. package/chunk-rxq62z5t.js +3 -0
  72. package/chunk-s27309w7.js +3 -0
  73. package/chunk-sjwsj82f.js +10 -0
  74. package/chunk-sxrwwyp7.js +3 -0
  75. package/chunk-tadyy9xh.js +51 -0
  76. package/chunk-tb3tj3ct.js +2 -0
  77. package/chunk-vgvp6cpk.js +2 -0
  78. package/chunk-vj5p29fr.js +2 -0
  79. package/chunk-wbpt03pe.js +31 -0
  80. package/chunk-wgjt31wp.js +8 -0
  81. package/chunk-wk6vjpmj.js +3 -0
  82. package/chunk-x1spmnj8.js +2 -0
  83. package/chunk-x4anmcq9.js +4 -0
  84. package/chunk-xd5hf1rg.js +3178 -0
  85. package/chunk-xp5p6tsp.js +286 -0
  86. package/chunk-xpbt4cpe.js +2 -0
  87. package/chunk-yw2k2syh.js +3 -0
  88. package/chunk-z3x79jnt.js +3 -0
  89. package/chunk-zd569v9h.js +2 -0
  90. package/compiled.js +13 -13
  91. package/package.json +1 -1
  92. package/ui-test-worker.js +57 -57
  93. package/web/chunk-05b25kh6.js +332 -0
  94. package/web/chunk-05b25kh6.js.br +0 -0
  95. package/web/chunk-05b25kh6.js.gz +0 -0
  96. package/web/chunk-0g6z1xs1.js +2 -0
  97. package/web/chunk-0g6z1xs1.js.br +0 -0
  98. package/web/chunk-0g6z1xs1.js.gz +0 -0
  99. package/web/chunk-0kj45mje.js +2 -0
  100. package/web/chunk-0kj45mje.js.br +0 -0
  101. package/web/chunk-0kj45mje.js.gz +0 -0
  102. package/web/chunk-0wt52yw3.js +1 -0
  103. package/web/chunk-0wt52yw3.js.br +2 -0
  104. package/web/chunk-0wt52yw3.js.gz +0 -0
  105. package/web/chunk-0x9cf6bp.js +38 -0
  106. package/web/chunk-0x9cf6bp.js.br +0 -0
  107. package/web/chunk-0x9cf6bp.js.gz +0 -0
  108. package/web/chunk-0y2f60q6.js +1 -0
  109. package/web/chunk-0y2f60q6.js.br +0 -0
  110. package/web/chunk-0y2f60q6.js.gz +0 -0
  111. package/web/chunk-1axw7vb0.js +214 -0
  112. package/web/chunk-1axw7vb0.js.br +0 -0
  113. package/web/chunk-1axw7vb0.js.gz +0 -0
  114. package/web/chunk-1es5ak4r.js +1 -0
  115. package/web/chunk-1es5ak4r.js.br +0 -0
  116. package/web/chunk-1es5ak4r.js.gz +0 -0
  117. package/web/chunk-1mkzfr1m.js +2 -0
  118. package/web/chunk-1mkzfr1m.js.br +0 -0
  119. package/web/chunk-1mkzfr1m.js.gz +0 -0
  120. package/web/chunk-1v45hcve.js +1 -0
  121. package/web/chunk-1v45hcve.js.br +0 -0
  122. package/web/chunk-1v45hcve.js.gz +0 -0
  123. package/web/chunk-1vhk8j0c.js +1 -0
  124. package/web/chunk-1vhk8j0c.js.br +0 -0
  125. package/web/chunk-1vhk8j0c.js.gz +0 -0
  126. package/web/chunk-21jtjwe1.js +1 -0
  127. package/web/chunk-21jtjwe1.js.br +0 -0
  128. package/web/chunk-21jtjwe1.js.gz +0 -0
  129. package/web/chunk-26grg3rq.js +1144 -0
  130. package/web/chunk-26grg3rq.js.br +0 -0
  131. package/web/chunk-26grg3rq.js.gz +0 -0
  132. package/web/chunk-2nwvdqxm.js +1 -0
  133. package/web/chunk-2nwvdqxm.js.br +0 -0
  134. package/web/chunk-2nwvdqxm.js.gz +0 -0
  135. package/web/chunk-2vh05ags.js +2 -0
  136. package/web/chunk-2vh05ags.js.br +0 -0
  137. package/web/chunk-2vh05ags.js.gz +0 -0
  138. package/web/chunk-2wvgy7f4.js +1 -0
  139. package/web/chunk-2wvgy7f4.js.br +0 -0
  140. package/web/chunk-2wvgy7f4.js.gz +0 -0
  141. package/web/chunk-33bfatdr.js +4 -0
  142. package/web/chunk-33bfatdr.js.br +0 -0
  143. package/web/chunk-33bfatdr.js.gz +0 -0
  144. package/web/chunk-38xsaxws.js +1 -0
  145. package/web/chunk-38xsaxws.js.br +0 -0
  146. package/web/chunk-38xsaxws.js.gz +0 -0
  147. package/web/chunk-3av47wwa.js +7 -0
  148. package/web/chunk-3av47wwa.js.br +0 -0
  149. package/web/chunk-3av47wwa.js.gz +0 -0
  150. package/web/chunk-3rxgch48.js +1 -0
  151. package/web/chunk-3rxgch48.js.br +0 -0
  152. package/web/chunk-3rxgch48.js.gz +0 -0
  153. package/web/chunk-40j8gxty.js +303 -0
  154. package/web/chunk-40j8gxty.js.br +0 -0
  155. package/web/chunk-40j8gxty.js.gz +0 -0
  156. package/web/chunk-43kq2dk7.js +21 -0
  157. package/web/chunk-43kq2dk7.js.br +0 -0
  158. package/web/chunk-43kq2dk7.js.gz +0 -0
  159. package/web/chunk-4cw67sdz.js +78 -0
  160. package/web/chunk-4cw67sdz.js.br +0 -0
  161. package/web/chunk-4cw67sdz.js.gz +0 -0
  162. package/web/chunk-4k4c2se1.js +2 -0
  163. package/web/chunk-4k4c2se1.js.br +0 -0
  164. package/web/chunk-4k4c2se1.js.gz +0 -0
  165. package/web/chunk-50dr941q.js +55 -0
  166. package/web/chunk-50dr941q.js.br +0 -0
  167. package/web/chunk-50dr941q.js.gz +0 -0
  168. package/web/chunk-56hx6a5h.js +1 -0
  169. package/web/chunk-56hx6a5h.js.br +0 -0
  170. package/web/chunk-56hx6a5h.js.gz +0 -0
  171. package/web/chunk-5m1p98r5.js +2 -0
  172. package/web/chunk-5m1p98r5.js.br +0 -0
  173. package/web/chunk-5m1p98r5.js.gz +0 -0
  174. package/web/chunk-5m45mc2k.js +99 -0
  175. package/web/chunk-5m45mc2k.js.br +0 -0
  176. package/web/chunk-5m45mc2k.js.gz +0 -0
  177. package/web/chunk-6gfa17h5.js +1 -0
  178. package/web/chunk-6gfa17h5.js.br +0 -0
  179. package/web/chunk-6gfa17h5.js.gz +0 -0
  180. package/web/chunk-7e57me98.js +1 -0
  181. package/web/chunk-7e57me98.js.br +0 -0
  182. package/web/chunk-7e57me98.js.gz +0 -0
  183. package/web/chunk-7ht7dssg.js +1 -0
  184. package/web/chunk-7ht7dssg.js.br +0 -0
  185. package/web/chunk-7ht7dssg.js.gz +0 -0
  186. package/web/chunk-8jxg1srx.js +1 -0
  187. package/web/chunk-8jxg1srx.js.br +2 -0
  188. package/web/chunk-8jxg1srx.js.gz +0 -0
  189. package/web/chunk-8q9970dm.js +2 -0
  190. package/web/chunk-8q9970dm.js.br +0 -0
  191. package/web/chunk-8q9970dm.js.gz +0 -0
  192. package/web/chunk-8t1kh5r9.js +370 -0
  193. package/web/chunk-8t1kh5r9.js.br +0 -0
  194. package/web/chunk-8t1kh5r9.js.gz +0 -0
  195. package/web/chunk-8za5fkrq.js +1 -0
  196. package/web/chunk-8za5fkrq.js.br +0 -0
  197. package/web/chunk-8za5fkrq.js.gz +0 -0
  198. package/web/chunk-96dhr80q.js +8 -0
  199. package/web/chunk-96dhr80q.js.br +0 -0
  200. package/web/chunk-96dhr80q.js.gz +0 -0
  201. package/web/chunk-98y5p1r2.js +1 -0
  202. package/web/chunk-98y5p1r2.js.br +0 -0
  203. package/web/chunk-98y5p1r2.js.gz +0 -0
  204. package/web/chunk-9f77mxfz.js +98 -0
  205. package/web/chunk-9f77mxfz.js.br +0 -0
  206. package/web/chunk-9f77mxfz.js.gz +0 -0
  207. package/web/chunk-9g2fam83.js +2 -0
  208. package/web/chunk-9g2fam83.js.br +0 -0
  209. package/web/chunk-9g2fam83.js.gz +0 -0
  210. package/web/chunk-9we3a8ak.js +84 -0
  211. package/web/chunk-9we3a8ak.js.br +0 -0
  212. package/web/chunk-9we3a8ak.js.gz +0 -0
  213. package/web/chunk-a67d8w1k.js +14 -0
  214. package/web/chunk-a67d8w1k.js.br +0 -0
  215. package/web/chunk-a67d8w1k.js.gz +0 -0
  216. package/web/chunk-adfd0mhj.js +1 -0
  217. package/web/chunk-adfd0mhj.js.br +0 -0
  218. package/web/chunk-adfd0mhj.js.gz +0 -0
  219. package/web/chunk-aem9wyqq.js +30 -0
  220. package/web/chunk-aem9wyqq.js.br +0 -0
  221. package/web/chunk-aem9wyqq.js.gz +0 -0
  222. package/web/chunk-ajzrsqpp.js +1 -0
  223. package/web/chunk-ajzrsqpp.js.br +0 -0
  224. package/web/chunk-ajzrsqpp.js.gz +0 -0
  225. package/web/chunk-b4t33dft.js +7 -0
  226. package/web/chunk-b4t33dft.js.br +0 -0
  227. package/web/chunk-b4t33dft.js.gz +0 -0
  228. package/web/chunk-b86sddt6.js +1 -0
  229. package/web/chunk-b86sddt6.js.br +0 -0
  230. package/web/chunk-b86sddt6.js.gz +0 -0
  231. package/web/chunk-bt8ww8df.js +142 -0
  232. package/web/chunk-bt8ww8df.js.br +0 -0
  233. package/web/chunk-bt8ww8df.js.gz +0 -0
  234. package/web/chunk-c1tsq0ta.js +1 -0
  235. package/web/chunk-c1tsq0ta.js.br +0 -0
  236. package/web/chunk-c1tsq0ta.js.gz +0 -0
  237. package/web/chunk-ckkd4qn1.js +1 -0
  238. package/web/chunk-ckkd4qn1.js.br +0 -0
  239. package/web/chunk-ckkd4qn1.js.gz +0 -0
  240. package/web/chunk-cxh1ztpm.js +200 -0
  241. package/web/chunk-cxh1ztpm.js.br +0 -0
  242. package/web/chunk-cxh1ztpm.js.gz +0 -0
  243. package/web/chunk-db2pew8j.js +2 -0
  244. package/web/chunk-db2pew8j.js.br +0 -0
  245. package/web/chunk-db2pew8j.js.gz +0 -0
  246. package/web/chunk-dfv95z6w.js +1 -0
  247. package/web/chunk-dfv95z6w.js.br +0 -0
  248. package/web/chunk-dfv95z6w.js.gz +0 -0
  249. package/web/chunk-dk2jv3kv.js +2 -0
  250. package/web/chunk-dk2jv3kv.js.br +0 -0
  251. package/web/chunk-dk2jv3kv.js.gz +0 -0
  252. package/web/chunk-dk9efr2r.js +1 -0
  253. package/web/chunk-dk9efr2r.js.br +0 -0
  254. package/web/chunk-dk9efr2r.js.gz +0 -0
  255. package/web/chunk-dmn5rvmt.js +169 -0
  256. package/web/chunk-dmn5rvmt.js.br +0 -0
  257. package/web/chunk-dmn5rvmt.js.gz +0 -0
  258. package/web/chunk-dtzm3qsp.js +34 -0
  259. package/web/chunk-dtzm3qsp.js.br +0 -0
  260. package/web/chunk-dtzm3qsp.js.gz +0 -0
  261. package/web/chunk-e1j49cha.js +140 -0
  262. package/web/chunk-e1j49cha.js.br +0 -0
  263. package/web/chunk-e1j49cha.js.gz +0 -0
  264. package/web/chunk-e24ammbc.js +292 -0
  265. package/web/chunk-e24ammbc.js.br +0 -0
  266. package/web/chunk-e24ammbc.js.gz +0 -0
  267. package/web/chunk-ebvk893x.js +2 -0
  268. package/web/chunk-ebvk893x.js.br +0 -0
  269. package/web/chunk-ebvk893x.js.gz +0 -0
  270. package/web/chunk-ecv7r3t9.js +24 -0
  271. package/web/chunk-ecv7r3t9.js.br +0 -0
  272. package/web/chunk-ecv7r3t9.js.gz +0 -0
  273. package/web/chunk-etkhjrfg.js +1 -0
  274. package/web/chunk-etkhjrfg.js.br +0 -0
  275. package/web/chunk-etkhjrfg.js.gz +0 -0
  276. package/web/chunk-f3ennx3q.js +1 -0
  277. package/web/chunk-f3ennx3q.js.br +0 -0
  278. package/web/chunk-f3ennx3q.js.gz +0 -0
  279. package/web/chunk-f5wyg9zh.js +2 -0
  280. package/web/chunk-f5wyg9zh.js.br +0 -0
  281. package/web/chunk-f5wyg9zh.js.gz +0 -0
  282. package/web/chunk-f9rv8b13.js +1 -0
  283. package/web/chunk-f9rv8b13.js.br +0 -0
  284. package/web/chunk-f9rv8b13.js.gz +0 -0
  285. package/web/chunk-fpg6cdg9.js +1 -0
  286. package/web/chunk-fpg6cdg9.js.br +0 -0
  287. package/web/chunk-fpg6cdg9.js.gz +0 -0
  288. package/web/chunk-fq9kkd61.js +1 -0
  289. package/web/chunk-fq9kkd61.js.br +0 -0
  290. package/web/chunk-fq9kkd61.js.gz +0 -0
  291. package/web/chunk-fr9gd1pt.js +1 -0
  292. package/web/chunk-fr9gd1pt.js.br +0 -0
  293. package/web/chunk-fr9gd1pt.js.gz +0 -0
  294. package/web/chunk-fsfpgs2w.css +1 -0
  295. package/web/chunk-fsfpgs2w.css.br +0 -0
  296. package/web/chunk-fsfpgs2w.css.gz +0 -0
  297. package/web/chunk-ftggg1s9.js +324 -0
  298. package/web/chunk-ftggg1s9.js.br +0 -0
  299. package/web/chunk-ftggg1s9.js.gz +0 -0
  300. package/web/chunk-g337nkpz.js +2 -0
  301. package/web/chunk-g337nkpz.js.br +0 -0
  302. package/web/chunk-g337nkpz.js.gz +0 -0
  303. package/web/chunk-g52np0en.js +1 -0
  304. package/web/chunk-g52np0en.js.br +0 -0
  305. package/web/chunk-g52np0en.js.gz +0 -0
  306. package/web/chunk-gc6pdwjs.js +2 -0
  307. package/web/chunk-gc6pdwjs.js.br +0 -0
  308. package/web/chunk-gc6pdwjs.js.gz +0 -0
  309. package/web/chunk-gks3ybk7.js +291 -0
  310. package/web/chunk-gks3ybk7.js.br +0 -0
  311. package/web/chunk-gks3ybk7.js.gz +0 -0
  312. package/web/chunk-hr1t5hxj.js +1 -0
  313. package/web/chunk-hr1t5hxj.js.br +0 -0
  314. package/web/chunk-hr1t5hxj.js.gz +0 -0
  315. package/web/chunk-k67ze3zq.js +2 -0
  316. package/web/chunk-k67ze3zq.js.br +0 -0
  317. package/web/chunk-k67ze3zq.js.gz +0 -0
  318. package/web/chunk-kcrkppec.js +1 -0
  319. package/web/chunk-kcrkppec.js.br +0 -0
  320. package/web/chunk-kcrkppec.js.gz +0 -0
  321. package/web/chunk-kd2346aw.js +2 -0
  322. package/web/chunk-kd2346aw.js.br +0 -0
  323. package/web/chunk-kd2346aw.js.gz +0 -0
  324. package/web/chunk-kh93xybm.js +62 -0
  325. package/web/chunk-kh93xybm.js.br +0 -0
  326. package/web/chunk-kh93xybm.js.gz +0 -0
  327. package/web/chunk-m32tg04f.js +1 -0
  328. package/web/chunk-m32tg04f.js.br +0 -0
  329. package/web/chunk-m32tg04f.js.gz +0 -0
  330. package/web/chunk-mg98g3yx.js +106 -0
  331. package/web/chunk-mg98g3yx.js.br +0 -0
  332. package/web/chunk-mg98g3yx.js.gz +0 -0
  333. package/web/chunk-mqdvg55y.js +2 -0
  334. package/web/chunk-mqdvg55y.js.br +0 -0
  335. package/web/chunk-mqdvg55y.js.gz +0 -0
  336. package/web/chunk-mx1e3jgh.js +1 -0
  337. package/web/chunk-mx1e3jgh.js.br +0 -0
  338. package/web/chunk-mx1e3jgh.js.gz +0 -0
  339. package/web/chunk-myg415b8.js +1 -0
  340. package/web/chunk-myg415b8.js.br +0 -0
  341. package/web/chunk-myg415b8.js.gz +0 -0
  342. package/web/chunk-myn0rj98.js +2 -0
  343. package/web/chunk-myn0rj98.js.br +0 -0
  344. package/web/chunk-myn0rj98.js.gz +0 -0
  345. package/web/chunk-nvq8s71g.js +1 -0
  346. package/web/chunk-nvq8s71g.js.br +0 -0
  347. package/web/chunk-nvq8s71g.js.gz +0 -0
  348. package/web/chunk-pphtw0xj.js +7 -0
  349. package/web/chunk-pphtw0xj.js.br +0 -0
  350. package/web/chunk-pphtw0xj.js.gz +0 -0
  351. package/web/chunk-ptdh13r5.js +1 -0
  352. package/web/chunk-ptdh13r5.js.br +0 -0
  353. package/web/chunk-ptdh13r5.js.gz +0 -0
  354. package/web/chunk-q1gyt5y6.js +1 -0
  355. package/web/chunk-q1gyt5y6.js.br +0 -0
  356. package/web/chunk-q1gyt5y6.js.gz +0 -0
  357. package/web/chunk-q3v1563q.js +2 -0
  358. package/web/chunk-q3v1563q.js.br +0 -0
  359. package/web/chunk-q3v1563q.js.gz +0 -0
  360. package/web/chunk-q40c0y7d.js +24 -0
  361. package/web/chunk-q40c0y7d.js.br +0 -0
  362. package/web/chunk-q40c0y7d.js.gz +0 -0
  363. package/web/chunk-q6vt7t8d.js +2 -0
  364. package/web/chunk-q6vt7t8d.js.br +0 -0
  365. package/web/chunk-q6vt7t8d.js.gz +0 -0
  366. package/web/chunk-q7pyqxqn.js +89 -0
  367. package/web/chunk-q7pyqxqn.js.br +0 -0
  368. package/web/chunk-q7pyqxqn.js.gz +0 -0
  369. package/web/chunk-r5rt7t62.js +1 -0
  370. package/web/chunk-r5rt7t62.js.br +0 -0
  371. package/web/chunk-r5rt7t62.js.gz +0 -0
  372. package/web/chunk-ra8jt8jw.js +2 -0
  373. package/web/chunk-ra8jt8jw.js.br +0 -0
  374. package/web/chunk-ra8jt8jw.js.gz +0 -0
  375. package/web/chunk-rgh3x4h4.js +1 -0
  376. package/web/chunk-rgh3x4h4.js.br +0 -0
  377. package/web/chunk-rgh3x4h4.js.gz +0 -0
  378. package/web/chunk-rvcq48wy.js +1 -0
  379. package/web/chunk-rvcq48wy.js.br +0 -0
  380. package/web/chunk-rvcq48wy.js.gz +0 -0
  381. package/web/chunk-rvgx4jhr.js +1 -0
  382. package/web/chunk-rvgx4jhr.js.br +0 -0
  383. package/web/chunk-rvgx4jhr.js.gz +0 -0
  384. package/web/chunk-rxvvg771.js +1 -0
  385. package/web/chunk-rxvvg771.js.br +0 -0
  386. package/web/chunk-rxvvg771.js.gz +0 -0
  387. package/web/chunk-sfb3w9nf.js +1 -0
  388. package/web/chunk-sfb3w9nf.js.br +2 -0
  389. package/web/chunk-sfb3w9nf.js.gz +0 -0
  390. package/web/chunk-srwx1v8c.js +39 -0
  391. package/web/chunk-srwx1v8c.js.br +0 -0
  392. package/web/chunk-srwx1v8c.js.gz +0 -0
  393. package/web/chunk-t1et0w6s.js +2 -0
  394. package/web/chunk-t1et0w6s.js.br +0 -0
  395. package/web/chunk-t1et0w6s.js.gz +0 -0
  396. package/web/chunk-tm7c78hm.js +1 -0
  397. package/web/chunk-tm7c78hm.js.br +0 -0
  398. package/web/chunk-tm7c78hm.js.gz +0 -0
  399. package/web/chunk-tmrh8hv1.js +1 -0
  400. package/web/chunk-tmrh8hv1.js.br +0 -0
  401. package/web/chunk-tmrh8hv1.js.gz +0 -0
  402. package/web/chunk-tntwwpyh.js +2 -0
  403. package/web/chunk-tntwwpyh.js.br +0 -0
  404. package/web/chunk-tntwwpyh.js.gz +0 -0
  405. package/web/chunk-tyengwea.js +12 -0
  406. package/web/chunk-tyengwea.js.br +0 -0
  407. package/web/chunk-tyengwea.js.gz +0 -0
  408. package/web/chunk-v13gqed9.js +2 -0
  409. package/web/chunk-v13gqed9.js.br +0 -0
  410. package/web/chunk-v13gqed9.js.gz +0 -0
  411. package/web/chunk-v6srkjvx.js +41 -0
  412. package/web/chunk-v6srkjvx.js.br +0 -0
  413. package/web/chunk-v6srkjvx.js.gz +0 -0
  414. package/web/chunk-vyn5qg7j.js +1 -0
  415. package/web/chunk-vyn5qg7j.js.br +0 -0
  416. package/web/chunk-vyn5qg7j.js.gz +0 -0
  417. package/web/chunk-w8se91rf.js +2 -0
  418. package/web/chunk-w8se91rf.js.br +0 -0
  419. package/web/chunk-w8se91rf.js.gz +0 -0
  420. package/web/chunk-wc533d3w.js +4 -0
  421. package/web/chunk-wc533d3w.js.br +0 -0
  422. package/web/chunk-wc533d3w.js.gz +0 -0
  423. package/web/chunk-wdd9pasx.js +1 -0
  424. package/web/chunk-wdd9pasx.js.br +0 -0
  425. package/web/chunk-wdd9pasx.js.gz +0 -0
  426. package/web/chunk-we9q8a9q.js +2 -0
  427. package/web/chunk-we9q8a9q.js.br +0 -0
  428. package/web/chunk-we9q8a9q.js.gz +0 -0
  429. package/web/chunk-wjpdjzkt.js +36 -0
  430. package/web/chunk-wjpdjzkt.js.br +0 -0
  431. package/web/chunk-wjpdjzkt.js.gz +0 -0
  432. package/web/chunk-wwnzjj7x.js +2 -0
  433. package/web/chunk-wwnzjj7x.js.br +0 -0
  434. package/web/chunk-wwnzjj7x.js.gz +0 -0
  435. package/web/chunk-wypacndw.js +120 -0
  436. package/web/chunk-wypacndw.js.br +0 -0
  437. package/web/chunk-wypacndw.js.gz +0 -0
  438. package/web/chunk-x3p573sq.js +2 -0
  439. package/web/chunk-x3p573sq.js.br +0 -0
  440. package/web/chunk-x3p573sq.js.gz +0 -0
  441. package/web/chunk-x6zh7fcc.js +16 -0
  442. package/web/chunk-x6zh7fcc.js.br +0 -0
  443. package/web/chunk-x6zh7fcc.js.gz +0 -0
  444. package/web/chunk-x87bgw5s.js +89 -0
  445. package/web/chunk-x87bgw5s.js.br +0 -0
  446. package/web/chunk-x87bgw5s.js.gz +0 -0
  447. package/web/chunk-xevjmmdd.js +217 -0
  448. package/web/chunk-xevjmmdd.js.br +0 -0
  449. package/web/chunk-xevjmmdd.js.gz +0 -0
  450. package/web/chunk-xkqekh81.js +2 -0
  451. package/web/chunk-xkqekh81.js.br +0 -0
  452. package/web/chunk-xkqekh81.js.gz +0 -0
  453. package/web/chunk-xwjytx6p.js +139 -0
  454. package/web/chunk-xwjytx6p.js.br +0 -0
  455. package/web/chunk-xwjytx6p.js.gz +0 -0
  456. package/web/chunk-y0xvbh5g.js +1 -0
  457. package/web/chunk-y0xvbh5g.js.br +0 -0
  458. package/web/chunk-y0xvbh5g.js.gz +0 -0
  459. package/web/chunk-ya7gs2bv.js +1 -0
  460. package/web/chunk-ya7gs2bv.js.br +0 -0
  461. package/web/chunk-ya7gs2bv.js.gz +0 -0
  462. package/web/chunk-ybq42mr5.js +2 -0
  463. package/web/chunk-ybq42mr5.js.br +0 -0
  464. package/web/chunk-ybq42mr5.js.gz +0 -0
  465. package/web/chunk-yhzcc87m.js +3 -0
  466. package/web/chunk-yhzcc87m.js.br +0 -0
  467. package/web/chunk-yhzcc87m.js.gz +0 -0
  468. package/web/chunk-yphdbf42.js +70 -0
  469. package/web/chunk-yphdbf42.js.br +0 -0
  470. package/web/chunk-yphdbf42.js.gz +0 -0
  471. package/web/chunk-ythxsag5.js +40 -0
  472. package/web/chunk-ythxsag5.js.br +0 -0
  473. package/web/chunk-ythxsag5.js.gz +0 -0
  474. package/web/chunk-z0smmkfw.js +2 -0
  475. package/web/chunk-z0smmkfw.js.br +0 -0
  476. package/web/chunk-z0smmkfw.js.gz +0 -0
  477. package/web/chunk-zcjdarjr.js +1 -0
  478. package/web/chunk-zcjdarjr.js.br +0 -0
  479. package/web/chunk-zcjdarjr.js.gz +0 -0
  480. package/web/chunk-zmm3f9sr.js +1 -0
  481. package/web/chunk-zmm3f9sr.js.br +0 -0
  482. package/web/chunk-zmm3f9sr.js.gz +0 -0
  483. package/web/chunk-zxt6qh82.js +2 -0
  484. package/web/chunk-zxt6qh82.js.br +0 -0
  485. package/web/chunk-zxt6qh82.js.gz +0 -0
  486. package/web/explorer-ttd27vzr.png +0 -0
  487. package/web/finder-aynbqpvz.png +0 -0
  488. package/web/idea-c8rwk1e2.png +0 -0
  489. package/web/index.html +1 -1
  490. package/web/index.html.br +0 -0
  491. package/web/index.html.gz +0 -0
  492. package/web/sw.js +3 -1
  493. package/web/sw.js.br +0 -0
  494. package/web/sw.js.gz +0 -0
  495. package/web/vscode-33qgcrqp.png +0 -0
  496. package/worker.js +1 -1
  497. package/chunk-10y5hvt2.js +0 -2
  498. package/chunk-22k2be3e.js +0 -13
  499. package/chunk-28hye007.js +0 -2
  500. package/chunk-2fmsw1c6.js +0 -5
  501. package/chunk-2h2mvrw2.js +0 -3
  502. package/chunk-2xj51v3m.js +0 -3
  503. package/chunk-3x0wm92n.js +0 -3
  504. package/chunk-4fgsqb1e.js +0 -2
  505. package/chunk-519eek65.js +0 -39
  506. package/chunk-5qa4dean.js +0 -2
  507. package/chunk-5x256mz8.js +0 -2
  508. package/chunk-6n01sefp.js +0 -8
  509. package/chunk-74xtmwpw.js +0 -2
  510. package/chunk-7mafj833.js +0 -3
  511. package/chunk-7v1sqn9k.js +0 -59
  512. package/chunk-8my52htr.js +0 -3
  513. package/chunk-8vh98e46.js +0 -2
  514. package/chunk-92mpgche.js +0 -2
  515. package/chunk-9nkb5q43.js +0 -3
  516. package/chunk-9vacevyf.js +0 -3
  517. package/chunk-9y44m27k.js +0 -5
  518. package/chunk-a5wv2shs.js +0 -3
  519. package/chunk-a78qhb4t.js +0 -5
  520. package/chunk-axsxx67j.js +0 -3
  521. package/chunk-b49fzzzn.js +0 -2
  522. package/chunk-bc8awbnt.js +0 -2
  523. package/chunk-crxs0n0r.js +0 -3
  524. package/chunk-csed8fsv.js +0 -3
  525. package/chunk-cspx3bz9.js +0 -2
  526. package/chunk-ctdtmwmd.js +0 -63
  527. package/chunk-d3xsmwbh.js +0 -25
  528. package/chunk-dvwgpsfz.js +0 -3
  529. package/chunk-dzd8k6bw.js +0 -3
  530. package/chunk-e2xqa46t.js +0 -2
  531. package/chunk-e41mpwx9.js +0 -9
  532. package/chunk-e5ccfgsk.js +0 -3
  533. package/chunk-e67wqhzh.js +0 -12
  534. package/chunk-emeb13nd.js +0 -25
  535. package/chunk-ers9s2c4.js +0 -31
  536. package/chunk-ezq0fnz6.js +0 -3
  537. package/chunk-ezqvx0hm.js +0 -2
  538. package/chunk-f10ca9ma.js +0 -12
  539. package/chunk-f72jhcp8.js +0 -2
  540. package/chunk-fjv41a8r.js +0 -4155
  541. package/chunk-fsekbhqb.js +0 -3
  542. package/chunk-gj0dhgbg.js +0 -3
  543. package/chunk-h0ggc6pv.js +0 -60
  544. package/chunk-hrt42rkh.js +0 -4
  545. package/chunk-j7m36g5w.js +0 -3
  546. package/chunk-jhn30hjp.js +0 -2
  547. package/chunk-ka41gq1g.js +0 -16
  548. package/chunk-kcp9byws.js +0 -2
  549. package/chunk-me72k64f.js +0 -7
  550. package/chunk-n4jemqf1.js +0 -2
  551. package/chunk-ndt4jvh1.js +0 -3
  552. package/chunk-pyxn4wqj.js +0 -3
  553. package/chunk-rajb3566.js +0 -2
  554. package/chunk-rbq2gsar.js +0 -3
  555. package/chunk-rd98e7kg.js +0 -10
  556. package/chunk-rm5dbbsg.js +0 -3
  557. package/chunk-rztw3tgx.js +0 -3
  558. package/chunk-s4mn41eh.js +0 -8
  559. package/chunk-s9p624fq.js +0 -44
  560. package/chunk-sawrte7v.js +0 -3
  561. package/chunk-sd8d792h.js +0 -51
  562. package/chunk-sgvmxx0d.js +0 -2
  563. package/chunk-sqbnt2t1.js +0 -3
  564. package/chunk-t2bvj735.js +0 -2
  565. package/chunk-t8tkamx6.js +0 -2
  566. package/chunk-tbehe5ky.js +0 -18
  567. package/chunk-tnay319j.js +0 -3
  568. package/chunk-tsha69rv.js +0 -7
  569. package/chunk-twqwer9t.js +0 -5
  570. package/chunk-vr2rtqeh.js +0 -2
  571. package/chunk-vr6eej6b.js +0 -3
  572. package/chunk-w41gswj8.js +0 -3
  573. package/chunk-x7tras0x.js +0 -498
  574. package/chunk-xakmebnm.js +0 -10
  575. package/chunk-xj453mny.js +0 -286
  576. package/chunk-xmrw19xj.js +0 -2
  577. package/chunk-xpj8fcjp.js +0 -20
  578. package/chunk-y218jsvc.js +0 -3
  579. package/chunk-y33fkh8m.js +0 -2
  580. package/chunk-z3h9ydyr.js +0 -11
  581. package/chunk-zc51vfhr.js +0 -2
  582. package/chunk-zm88mnds.js +0 -7
  583. package/chunk-zz9rj82y.js +0 -3
  584. package/web/chunk-0b5vh2pt.js +0 -2
  585. package/web/chunk-0b5vh2pt.js.br +0 -0
  586. package/web/chunk-0b5vh2pt.js.gz +0 -0
  587. package/web/chunk-0hkdqhkv.js +0 -1
  588. package/web/chunk-0hkdqhkv.js.br +0 -0
  589. package/web/chunk-0hkdqhkv.js.gz +0 -0
  590. package/web/chunk-0v7wrb32.js +0 -2
  591. package/web/chunk-0v7wrb32.js.br +0 -0
  592. package/web/chunk-0v7wrb32.js.gz +0 -0
  593. package/web/chunk-0x2fgw1m.js +0 -1
  594. package/web/chunk-0x2fgw1m.js.br +0 -0
  595. package/web/chunk-0x2fgw1m.js.gz +0 -0
  596. package/web/chunk-0xctxqvv.js +0 -2
  597. package/web/chunk-0xctxqvv.js.br +0 -0
  598. package/web/chunk-0xctxqvv.js.gz +0 -0
  599. package/web/chunk-0y9tf0rt.js +0 -89
  600. package/web/chunk-0y9tf0rt.js.br +0 -0
  601. package/web/chunk-0y9tf0rt.js.gz +0 -0
  602. package/web/chunk-0yrp0f6x.js +0 -1
  603. package/web/chunk-0yrp0f6x.js.br +0 -0
  604. package/web/chunk-0yrp0f6x.js.gz +0 -0
  605. package/web/chunk-10jk2pn9.js +0 -1
  606. package/web/chunk-10jk2pn9.js.br +0 -0
  607. package/web/chunk-10jk2pn9.js.gz +0 -0
  608. package/web/chunk-15ka35m9.js +0 -2
  609. package/web/chunk-15ka35m9.js.br +0 -0
  610. package/web/chunk-15ka35m9.js.gz +0 -0
  611. package/web/chunk-1700cges.js +0 -1
  612. package/web/chunk-1700cges.js.br +0 -0
  613. package/web/chunk-1700cges.js.gz +0 -0
  614. package/web/chunk-1apw6pnk.css +0 -1
  615. package/web/chunk-1apw6pnk.css.br +0 -0
  616. package/web/chunk-1apw6pnk.css.gz +0 -0
  617. package/web/chunk-1b005nqw.js +0 -139
  618. package/web/chunk-1b005nqw.js.br +0 -0
  619. package/web/chunk-1b005nqw.js.gz +0 -0
  620. package/web/chunk-1c9khgyt.js +0 -1
  621. package/web/chunk-1c9khgyt.js.br +0 -2
  622. package/web/chunk-1c9khgyt.js.gz +0 -0
  623. package/web/chunk-1pr20x9x.js +0 -1
  624. package/web/chunk-1pr20x9x.js.br +0 -0
  625. package/web/chunk-1pr20x9x.js.gz +0 -0
  626. package/web/chunk-1sjgdggk.js +0 -7
  627. package/web/chunk-1sjgdggk.js.br +0 -0
  628. package/web/chunk-1sjgdggk.js.gz +0 -0
  629. package/web/chunk-1tt5ympp.js +0 -1
  630. package/web/chunk-1tt5ympp.js.br +0 -0
  631. package/web/chunk-1tt5ympp.js.gz +0 -0
  632. package/web/chunk-29fpfs5q.js +0 -1142
  633. package/web/chunk-29fpfs5q.js.br +0 -0
  634. package/web/chunk-29fpfs5q.js.gz +0 -0
  635. package/web/chunk-2gr7vwnp.js +0 -24
  636. package/web/chunk-2gr7vwnp.js.br +0 -0
  637. package/web/chunk-2gr7vwnp.js.gz +0 -0
  638. package/web/chunk-2p84jch3.js +0 -1
  639. package/web/chunk-2p84jch3.js.br +0 -0
  640. package/web/chunk-2p84jch3.js.gz +0 -0
  641. package/web/chunk-2qs283mh.js +0 -2
  642. package/web/chunk-2qs283mh.js.br +0 -0
  643. package/web/chunk-2qs283mh.js.gz +0 -0
  644. package/web/chunk-3gf2d852.js +0 -1
  645. package/web/chunk-3gf2d852.js.br +0 -0
  646. package/web/chunk-3gf2d852.js.gz +0 -0
  647. package/web/chunk-3hswqkb0.js +0 -1
  648. package/web/chunk-3hswqkb0.js.br +0 -0
  649. package/web/chunk-3hswqkb0.js.gz +0 -0
  650. package/web/chunk-46yjp1x4.js +0 -2
  651. package/web/chunk-46yjp1x4.js.br +0 -0
  652. package/web/chunk-46yjp1x4.js.gz +0 -0
  653. package/web/chunk-4ezd1rkc.js +0 -84
  654. package/web/chunk-4ezd1rkc.js.br +0 -0
  655. package/web/chunk-4ezd1rkc.js.gz +0 -0
  656. package/web/chunk-4v9ar0sf.js +0 -142
  657. package/web/chunk-4v9ar0sf.js.br +0 -0
  658. package/web/chunk-4v9ar0sf.js.gz +0 -0
  659. package/web/chunk-51z88j1t.js +0 -21
  660. package/web/chunk-51z88j1t.js.br +0 -0
  661. package/web/chunk-51z88j1t.js.gz +0 -0
  662. package/web/chunk-5f5zcfga.js +0 -1
  663. package/web/chunk-5f5zcfga.js.br +0 -2
  664. package/web/chunk-5f5zcfga.js.gz +0 -0
  665. package/web/chunk-5n61r0rr.js +0 -36
  666. package/web/chunk-5n61r0rr.js.br +0 -0
  667. package/web/chunk-5n61r0rr.js.gz +0 -0
  668. package/web/chunk-5vcdeenv.js +0 -2
  669. package/web/chunk-5vcdeenv.js.br +0 -0
  670. package/web/chunk-5vcdeenv.js.gz +0 -0
  671. package/web/chunk-5y7ks8c3.js +0 -30
  672. package/web/chunk-5y7ks8c3.js.br +0 -0
  673. package/web/chunk-5y7ks8c3.js.gz +0 -0
  674. package/web/chunk-60v8qwec.js +0 -2
  675. package/web/chunk-60v8qwec.js.br +0 -0
  676. package/web/chunk-60v8qwec.js.gz +0 -0
  677. package/web/chunk-61m5t9wg.js +0 -200
  678. package/web/chunk-61m5t9wg.js.br +0 -0
  679. package/web/chunk-61m5t9wg.js.gz +0 -0
  680. package/web/chunk-669n37qf.js +0 -70
  681. package/web/chunk-669n37qf.js.br +0 -0
  682. package/web/chunk-669n37qf.js.gz +0 -0
  683. package/web/chunk-6kf1xwz9.js +0 -2
  684. package/web/chunk-6kf1xwz9.js.br +0 -0
  685. package/web/chunk-6kf1xwz9.js.gz +0 -0
  686. package/web/chunk-6rw72jmj.js +0 -2
  687. package/web/chunk-6rw72jmj.js.br +0 -0
  688. package/web/chunk-6rw72jmj.js.gz +0 -0
  689. package/web/chunk-6wyxxd9h.js +0 -2
  690. package/web/chunk-6wyxxd9h.js.br +0 -0
  691. package/web/chunk-6wyxxd9h.js.gz +0 -0
  692. package/web/chunk-77vj65dc.js +0 -1
  693. package/web/chunk-77vj65dc.js.br +0 -0
  694. package/web/chunk-77vj65dc.js.gz +0 -0
  695. package/web/chunk-8ktz0w1x.js +0 -120
  696. package/web/chunk-8ktz0w1x.js.br +0 -0
  697. package/web/chunk-8ktz0w1x.js.gz +0 -0
  698. package/web/chunk-8rcfpj02.js +0 -2
  699. package/web/chunk-8rcfpj02.js.br +0 -0
  700. package/web/chunk-8rcfpj02.js.gz +0 -0
  701. package/web/chunk-8x4s1c9g.js +0 -1
  702. package/web/chunk-8x4s1c9g.js.br +0 -2
  703. package/web/chunk-8x4s1c9g.js.gz +0 -0
  704. package/web/chunk-8zf4cywy.js +0 -1
  705. package/web/chunk-8zf4cywy.js.br +0 -0
  706. package/web/chunk-8zf4cywy.js.gz +0 -0
  707. package/web/chunk-a18y5dmf.js +0 -2
  708. package/web/chunk-a18y5dmf.js.br +0 -0
  709. package/web/chunk-a18y5dmf.js.gz +0 -0
  710. package/web/chunk-a36sfjyk.js +0 -1
  711. package/web/chunk-a36sfjyk.js.br +0 -0
  712. package/web/chunk-a36sfjyk.js.gz +0 -0
  713. package/web/chunk-aahzqxq7.js +0 -34
  714. package/web/chunk-aahzqxq7.js.br +0 -0
  715. package/web/chunk-aahzqxq7.js.gz +0 -0
  716. package/web/chunk-b2gtwatf.js +0 -370
  717. package/web/chunk-b2gtwatf.js.br +0 -0
  718. package/web/chunk-b2gtwatf.js.gz +0 -0
  719. package/web/chunk-bdp4y1zg.js +0 -1
  720. package/web/chunk-bdp4y1zg.js.br +0 -0
  721. package/web/chunk-bdp4y1zg.js.gz +0 -0
  722. package/web/chunk-be67vfx1.js +0 -1
  723. package/web/chunk-be67vfx1.js.br +0 -0
  724. package/web/chunk-be67vfx1.js.gz +0 -0
  725. package/web/chunk-bt6r78y9.js +0 -106
  726. package/web/chunk-bt6r78y9.js.br +0 -0
  727. package/web/chunk-bt6r78y9.js.gz +0 -0
  728. package/web/chunk-bvyjy17t.js +0 -14
  729. package/web/chunk-bvyjy17t.js.br +0 -0
  730. package/web/chunk-bvyjy17t.js.gz +0 -0
  731. package/web/chunk-c97th1x0.js +0 -1
  732. package/web/chunk-c97th1x0.js.br +0 -0
  733. package/web/chunk-c97th1x0.js.gz +0 -0
  734. package/web/chunk-cfkp7taw.js +0 -1
  735. package/web/chunk-cfkp7taw.js.br +0 -0
  736. package/web/chunk-cfkp7taw.js.gz +0 -0
  737. package/web/chunk-cvf9k1fy.js +0 -140
  738. package/web/chunk-cvf9k1fy.js.br +0 -0
  739. package/web/chunk-cvf9k1fy.js.gz +0 -0
  740. package/web/chunk-d33n9fsr.js +0 -1
  741. package/web/chunk-d33n9fsr.js.br +0 -1
  742. package/web/chunk-d33n9fsr.js.gz +0 -0
  743. package/web/chunk-e667nxc9.js +0 -1
  744. package/web/chunk-e667nxc9.js.br +0 -0
  745. package/web/chunk-e667nxc9.js.gz +0 -0
  746. package/web/chunk-eejjsqm1.js +0 -303
  747. package/web/chunk-eejjsqm1.js.br +0 -0
  748. package/web/chunk-eejjsqm1.js.gz +0 -0
  749. package/web/chunk-eg3qjy7a.js +0 -2
  750. package/web/chunk-eg3qjy7a.js.br +0 -0
  751. package/web/chunk-eg3qjy7a.js.gz +0 -0
  752. package/web/chunk-embvjvdj.js +0 -12
  753. package/web/chunk-embvjvdj.js.br +0 -0
  754. package/web/chunk-embvjvdj.js.gz +0 -0
  755. package/web/chunk-etjfr79m.js +0 -2
  756. package/web/chunk-etjfr79m.js.br +0 -0
  757. package/web/chunk-etjfr79m.js.gz +0 -0
  758. package/web/chunk-ez36gbz3.js +0 -7
  759. package/web/chunk-ez36gbz3.js.br +0 -0
  760. package/web/chunk-ez36gbz3.js.gz +0 -0
  761. package/web/chunk-f0vcm8mk.js +0 -214
  762. package/web/chunk-f0vcm8mk.js.br +0 -0
  763. package/web/chunk-f0vcm8mk.js.gz +0 -0
  764. package/web/chunk-f3t3ey83.js +0 -1
  765. package/web/chunk-f3t3ey83.js.br +0 -0
  766. package/web/chunk-f3t3ey83.js.gz +0 -0
  767. package/web/chunk-f84sngcq.js +0 -2
  768. package/web/chunk-f84sngcq.js.br +0 -0
  769. package/web/chunk-f84sngcq.js.gz +0 -0
  770. package/web/chunk-f97hz4v5.js +0 -99
  771. package/web/chunk-f97hz4v5.js.br +0 -0
  772. package/web/chunk-f97hz4v5.js.gz +0 -0
  773. package/web/chunk-fnkp6s0g.js +0 -1
  774. package/web/chunk-fnkp6s0g.js.br +0 -0
  775. package/web/chunk-fnkp6s0g.js.gz +0 -0
  776. package/web/chunk-fpdyzyn8.js +0 -16
  777. package/web/chunk-fpdyzyn8.js.br +0 -0
  778. package/web/chunk-fpdyzyn8.js.gz +0 -0
  779. package/web/chunk-g43z223a.js +0 -2
  780. package/web/chunk-g43z223a.js.br +0 -0
  781. package/web/chunk-g43z223a.js.gz +0 -0
  782. package/web/chunk-gcm82aj8.js +0 -1
  783. package/web/chunk-gcm82aj8.js.br +0 -0
  784. package/web/chunk-gcm82aj8.js.gz +0 -0
  785. package/web/chunk-gffb3p4z.js +0 -2
  786. package/web/chunk-gffb3p4z.js.br +0 -0
  787. package/web/chunk-gffb3p4z.js.gz +0 -0
  788. package/web/chunk-gnzg3krt.js +0 -1
  789. package/web/chunk-gnzg3krt.js.br +0 -0
  790. package/web/chunk-gnzg3krt.js.gz +0 -0
  791. package/web/chunk-grqtpfdp.js +0 -2
  792. package/web/chunk-grqtpfdp.js.br +0 -0
  793. package/web/chunk-grqtpfdp.js.gz +0 -0
  794. package/web/chunk-gsm8spf8.js +0 -1
  795. package/web/chunk-gsm8spf8.js.br +0 -0
  796. package/web/chunk-gsm8spf8.js.gz +0 -0
  797. package/web/chunk-h6ygrnd0.js +0 -38
  798. package/web/chunk-h6ygrnd0.js.br +0 -0
  799. package/web/chunk-h6ygrnd0.js.gz +0 -0
  800. package/web/chunk-h8n9w5th.js +0 -169
  801. package/web/chunk-h8n9w5th.js.br +0 -0
  802. package/web/chunk-h8n9w5th.js.gz +0 -0
  803. package/web/chunk-hmdvm5pp.js +0 -2
  804. package/web/chunk-hmdvm5pp.js.br +0 -0
  805. package/web/chunk-hmdvm5pp.js.gz +0 -0
  806. package/web/chunk-hrntwvx8.js +0 -1
  807. package/web/chunk-hrntwvx8.js.br +0 -0
  808. package/web/chunk-hrntwvx8.js.gz +0 -0
  809. package/web/chunk-hrys15jh.js +0 -324
  810. package/web/chunk-hrys15jh.js.br +0 -0
  811. package/web/chunk-hrys15jh.js.gz +0 -0
  812. package/web/chunk-j0ng7zdq.js +0 -41
  813. package/web/chunk-j0ng7zdq.js.br +0 -0
  814. package/web/chunk-j0ng7zdq.js.gz +0 -0
  815. package/web/chunk-j2t5ycte.js +0 -78
  816. package/web/chunk-j2t5ycte.js.br +0 -0
  817. package/web/chunk-j2t5ycte.js.gz +0 -0
  818. package/web/chunk-jkjd1y3p.js +0 -3
  819. package/web/chunk-jkjd1y3p.js.br +0 -0
  820. package/web/chunk-jkjd1y3p.js.gz +0 -0
  821. package/web/chunk-jweahmyy.js +0 -1
  822. package/web/chunk-jweahmyy.js.br +0 -0
  823. package/web/chunk-jweahmyy.js.gz +0 -0
  824. package/web/chunk-k56v8k7n.js +0 -4
  825. package/web/chunk-k56v8k7n.js.br +0 -0
  826. package/web/chunk-k56v8k7n.js.gz +0 -0
  827. package/web/chunk-k59sk88z.js +0 -7
  828. package/web/chunk-k59sk88z.js.br +0 -0
  829. package/web/chunk-k59sk88z.js.gz +0 -0
  830. package/web/chunk-k75a0fpt.js +0 -62
  831. package/web/chunk-k75a0fpt.js.br +0 -0
  832. package/web/chunk-k75a0fpt.js.gz +0 -0
  833. package/web/chunk-kfx9q7xv.js +0 -2
  834. package/web/chunk-kfx9q7xv.js.br +0 -0
  835. package/web/chunk-kfx9q7xv.js.gz +0 -0
  836. package/web/chunk-ksp1gg3v.js +0 -1
  837. package/web/chunk-ksp1gg3v.js.br +0 -0
  838. package/web/chunk-ksp1gg3v.js.gz +0 -0
  839. package/web/chunk-kxxp1mn4.js +0 -2
  840. package/web/chunk-kxxp1mn4.js.br +0 -0
  841. package/web/chunk-kxxp1mn4.js.gz +0 -0
  842. package/web/chunk-mapbxzsz.js +0 -1
  843. package/web/chunk-mapbxzsz.js.br +0 -0
  844. package/web/chunk-mapbxzsz.js.gz +0 -0
  845. package/web/chunk-msw43fnq.js +0 -2
  846. package/web/chunk-msw43fnq.js.br +0 -0
  847. package/web/chunk-msw43fnq.js.gz +0 -0
  848. package/web/chunk-mzzjg4sn.js +0 -2
  849. package/web/chunk-mzzjg4sn.js.br +0 -0
  850. package/web/chunk-mzzjg4sn.js.gz +0 -0
  851. package/web/chunk-n1bmcj13.js +0 -2
  852. package/web/chunk-n1bmcj13.js.br +0 -0
  853. package/web/chunk-n1bmcj13.js.gz +0 -0
  854. package/web/chunk-n5y4ar3e.js +0 -1
  855. package/web/chunk-n5y4ar3e.js.br +0 -0
  856. package/web/chunk-n5y4ar3e.js.gz +0 -0
  857. package/web/chunk-n9vszqw9.js +0 -1
  858. package/web/chunk-n9vszqw9.js.br +0 -0
  859. package/web/chunk-n9vszqw9.js.gz +0 -0
  860. package/web/chunk-nzzcmxq8.js +0 -1
  861. package/web/chunk-nzzcmxq8.js.br +0 -0
  862. package/web/chunk-nzzcmxq8.js.gz +0 -0
  863. package/web/chunk-p25eppk1.js +0 -1
  864. package/web/chunk-p25eppk1.js.br +0 -0
  865. package/web/chunk-p25eppk1.js.gz +0 -0
  866. package/web/chunk-p9352vpw.js +0 -1
  867. package/web/chunk-p9352vpw.js.br +0 -0
  868. package/web/chunk-p9352vpw.js.gz +0 -0
  869. package/web/chunk-pdvm4n6f.js +0 -1
  870. package/web/chunk-pdvm4n6f.js.br +0 -2
  871. package/web/chunk-pdvm4n6f.js.gz +0 -0
  872. package/web/chunk-pjm2t9da.js +0 -1
  873. package/web/chunk-pjm2t9da.js.br +0 -0
  874. package/web/chunk-pjm2t9da.js.gz +0 -0
  875. package/web/chunk-pka3qm06.js +0 -98
  876. package/web/chunk-pka3qm06.js.br +0 -0
  877. package/web/chunk-pka3qm06.js.gz +0 -0
  878. package/web/chunk-pkbcbta6.js +0 -1
  879. package/web/chunk-pkbcbta6.js.br +0 -0
  880. package/web/chunk-pkbcbta6.js.gz +0 -0
  881. package/web/chunk-pq4vn3zh.js +0 -1
  882. package/web/chunk-pq4vn3zh.js.br +0 -0
  883. package/web/chunk-pq4vn3zh.js.gz +0 -0
  884. package/web/chunk-prk9ks5j.js +0 -1
  885. package/web/chunk-prk9ks5j.js.br +0 -0
  886. package/web/chunk-prk9ks5j.js.gz +0 -0
  887. package/web/chunk-px68tdjm.js +0 -1
  888. package/web/chunk-px68tdjm.js.br +0 -2
  889. package/web/chunk-px68tdjm.js.gz +0 -0
  890. package/web/chunk-px8k5edz.js +0 -24
  891. package/web/chunk-px8k5edz.js.br +0 -0
  892. package/web/chunk-px8k5edz.js.gz +0 -0
  893. package/web/chunk-pz4g2bem.js +0 -292
  894. package/web/chunk-pz4g2bem.js.br +0 -0
  895. package/web/chunk-pz4g2bem.js.gz +0 -0
  896. package/web/chunk-q0gx75nf.js +0 -55
  897. package/web/chunk-q0gx75nf.js.br +0 -0
  898. package/web/chunk-q0gx75nf.js.gz +0 -0
  899. package/web/chunk-q9rpxfmm.js +0 -1
  900. package/web/chunk-q9rpxfmm.js.br +0 -0
  901. package/web/chunk-q9rpxfmm.js.gz +0 -0
  902. package/web/chunk-qpfhs1x0.js +0 -1
  903. package/web/chunk-qpfhs1x0.js.br +0 -0
  904. package/web/chunk-qpfhs1x0.js.gz +0 -0
  905. package/web/chunk-qredmg6m.js +0 -1
  906. package/web/chunk-qredmg6m.js.br +0 -0
  907. package/web/chunk-qredmg6m.js.gz +0 -0
  908. package/web/chunk-qtc9ar2m.js +0 -2
  909. package/web/chunk-qtc9ar2m.js.br +0 -0
  910. package/web/chunk-qtc9ar2m.js.gz +0 -0
  911. package/web/chunk-r5dsw56r.js +0 -1
  912. package/web/chunk-r5dsw56r.js.br +0 -0
  913. package/web/chunk-r5dsw56r.js.gz +0 -0
  914. package/web/chunk-rkaps675.js +0 -1
  915. package/web/chunk-rkaps675.js.br +0 -0
  916. package/web/chunk-rkaps675.js.gz +0 -0
  917. package/web/chunk-rp87pgcp.js +0 -40
  918. package/web/chunk-rp87pgcp.js.br +0 -0
  919. package/web/chunk-rp87pgcp.js.gz +0 -0
  920. package/web/chunk-rs1mtd35.js +0 -2
  921. package/web/chunk-rs1mtd35.js.br +0 -0
  922. package/web/chunk-rs1mtd35.js.gz +0 -0
  923. package/web/chunk-s31n33g5.js +0 -2
  924. package/web/chunk-s31n33g5.js.br +0 -0
  925. package/web/chunk-s31n33g5.js.gz +0 -0
  926. package/web/chunk-sbcyvn42.js +0 -1
  927. package/web/chunk-sbcyvn42.js.br +0 -0
  928. package/web/chunk-sbcyvn42.js.gz +0 -0
  929. package/web/chunk-sew9vfwy.js +0 -1
  930. package/web/chunk-sew9vfwy.js.br +0 -0
  931. package/web/chunk-sew9vfwy.js.gz +0 -0
  932. package/web/chunk-sgaw26nc.js +0 -2
  933. package/web/chunk-sgaw26nc.js.br +0 -0
  934. package/web/chunk-sgaw26nc.js.gz +0 -0
  935. package/web/chunk-t2ak4a9d.js +0 -1
  936. package/web/chunk-t2ak4a9d.js.br +0 -0
  937. package/web/chunk-t2ak4a9d.js.gz +0 -0
  938. package/web/chunk-ta0e3dk6.js +0 -2
  939. package/web/chunk-ta0e3dk6.js.br +0 -0
  940. package/web/chunk-ta0e3dk6.js.gz +0 -0
  941. package/web/chunk-tqax5mb6.js +0 -217
  942. package/web/chunk-tqax5mb6.js.br +0 -0
  943. package/web/chunk-tqax5mb6.js.gz +0 -0
  944. package/web/chunk-v1wxeq38.js +0 -2
  945. package/web/chunk-v1wxeq38.js.br +0 -0
  946. package/web/chunk-v1wxeq38.js.gz +0 -0
  947. package/web/chunk-v3kwg4zn.js +0 -2
  948. package/web/chunk-v3kwg4zn.js.br +0 -0
  949. package/web/chunk-v3kwg4zn.js.gz +0 -0
  950. package/web/chunk-vcpvhkxh.js +0 -39
  951. package/web/chunk-vcpvhkxh.js.br +0 -0
  952. package/web/chunk-vcpvhkxh.js.gz +0 -0
  953. package/web/chunk-vg9qv3aa.js +0 -1
  954. package/web/chunk-vg9qv3aa.js.br +0 -0
  955. package/web/chunk-vg9qv3aa.js.gz +0 -0
  956. package/web/chunk-vwxnt3nh.js +0 -1
  957. package/web/chunk-vwxnt3nh.js.br +0 -0
  958. package/web/chunk-vwxnt3nh.js.gz +0 -0
  959. package/web/chunk-w1xjqhwy.js +0 -1
  960. package/web/chunk-w1xjqhwy.js.br +0 -2
  961. package/web/chunk-w1xjqhwy.js.gz +0 -0
  962. package/web/chunk-w3nfxvzd.js +0 -1
  963. package/web/chunk-w3nfxvzd.js.br +0 -0
  964. package/web/chunk-w3nfxvzd.js.gz +0 -0
  965. package/web/chunk-w7h3x3ys.js +0 -1
  966. package/web/chunk-w7h3x3ys.js.br +0 -0
  967. package/web/chunk-w7h3x3ys.js.gz +0 -0
  968. package/web/chunk-wb0yn3r4.js +0 -8
  969. package/web/chunk-wb0yn3r4.js.br +0 -0
  970. package/web/chunk-wb0yn3r4.js.gz +0 -0
  971. package/web/chunk-wff6hqjf.js +0 -1
  972. package/web/chunk-wff6hqjf.js.br +0 -0
  973. package/web/chunk-wff6hqjf.js.gz +0 -0
  974. package/web/chunk-whj4e4sb.js +0 -89
  975. package/web/chunk-whj4e4sb.js.br +0 -0
  976. package/web/chunk-whj4e4sb.js.gz +0 -0
  977. package/web/chunk-wn3kdpj0.js +0 -1
  978. package/web/chunk-wn3kdpj0.js.br +0 -0
  979. package/web/chunk-wn3kdpj0.js.gz +0 -0
  980. package/web/chunk-wzq3qxpb.js +0 -1
  981. package/web/chunk-wzq3qxpb.js.br +0 -0
  982. package/web/chunk-wzq3qxpb.js.gz +0 -0
  983. package/web/chunk-x2tezwv1.js +0 -4
  984. package/web/chunk-x2tezwv1.js.br +0 -0
  985. package/web/chunk-x2tezwv1.js.gz +0 -0
  986. package/web/chunk-xmajh4qe.js +0 -2
  987. package/web/chunk-xmajh4qe.js.br +0 -0
  988. package/web/chunk-xmajh4qe.js.gz +0 -0
  989. package/web/chunk-xz7py7yx.js +0 -1
  990. package/web/chunk-xz7py7yx.js.br +0 -0
  991. package/web/chunk-xz7py7yx.js.gz +0 -0
  992. package/web/chunk-y4af9gsm.js +0 -291
  993. package/web/chunk-y4af9gsm.js.br +0 -0
  994. package/web/chunk-y4af9gsm.js.gz +0 -0
  995. package/web/chunk-y512gr5a.js +0 -332
  996. package/web/chunk-y512gr5a.js.br +0 -0
  997. package/web/chunk-y512gr5a.js.gz +0 -0
  998. package/web/chunk-ywg44m2b.js +0 -2
  999. package/web/chunk-ywg44m2b.js.br +0 -0
  1000. package/web/chunk-ywg44m2b.js.gz +0 -0
  1001. package/web/chunk-zhzp4fm1.js +0 -2
  1002. package/web/chunk-zhzp4fm1.js.br +0 -0
  1003. package/web/chunk-zhzp4fm1.js.gz +0 -0
@@ -1,370 +0,0 @@
1
- import{t,i,F,A,G,N,M,P,R,I,O,D,d,y,H,cs,Oe,Me,Re,vn,je,qe}from"./chunk-eejjsqm1.js";import{Ue}from"./chunk-8rcfpj02.js";import{Ie}from"./chunk-s31n33g5.js";function tt(e){if(console&&console.error)console.error(`Error: ${e}`)}function Tt(e){if(console&&console.warn)console.warn(`Warning: ${e}`)}function gt(e){let s=new Date().getTime(),n=e();return{time:new Date().getTime()-s,value:n}}function At(e){function s(){}s.prototype=e;let n=new s;function r(){return typeof n.bar}return r(),r(),e;(0,eval)(e)}function Gr(e){if(Wr(e))return e.LABEL;else return e.name}function Wr(e){return typeof e.LABEL==="string"&&e.LABEL!==""}class ge{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach((s)=>{s.accept(e)})}}class B extends ge{constructor(e){super([]);this.idx=1,Object.assign(this,ke(e))}set definition(e){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(e){e.visit(this)}}class de extends ge{constructor(e){super(e.definition);this.orgText="",Object.assign(this,ke(e))}}class W extends ge{constructor(e){super(e.definition);this.ignoreAmbiguities=!1,Object.assign(this,ke(e))}}class j extends ge{constructor(e){super(e.definition);this.idx=1,Object.assign(this,ke(e))}}class Z extends ge{constructor(e){super(e.definition);this.idx=1,Object.assign(this,ke(e))}}class Q extends ge{constructor(e){super(e.definition);this.idx=1,Object.assign(this,ke(e))}}class U extends ge{constructor(e){super(e.definition);this.idx=1,Object.assign(this,ke(e))}}class q extends ge{constructor(e){super(e.definition);this.idx=1,Object.assign(this,ke(e))}}class J extends ge{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition);this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ke(e))}}class v{constructor(e){this.idx=1,Object.assign(this,ke(e))}accept(e){e.visit(this)}}function Gt(e){return e.map(st)}function st(e){function s(n){return n.map(st)}if(e instanceof B){let n={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(typeof e.label==="string")n.label=e.label;return n}else if(e instanceof W)return{type:"Alternative",definition:s(e.definition)};else if(e instanceof j)return{type:"Option",idx:e.idx,definition:s(e.definition)};else if(e instanceof Z)return{type:"RepetitionMandatory",idx:e.idx,definition:s(e.definition)};else if(e instanceof Q)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:st(new v({terminalType:e.separator})),definition:s(e.definition)};else if(e instanceof q)return{type:"RepetitionWithSeparator",idx:e.idx,separator:st(new v({terminalType:e.separator})),definition:s(e.definition)};else if(e instanceof U)return{type:"Repetition",idx:e.idx,definition:s(e.definition)};else if(e instanceof J)return{type:"Alternation",idx:e.idx,definition:s(e.definition)};else if(e instanceof v){let n={type:"Terminal",name:e.terminalType.name,label:Gr(e.terminalType),idx:e.idx};if(typeof e.label==="string")n.terminalLabel=e.label;let r=e.terminalType.PATTERN;if(e.terminalType.PATTERN)n.pattern=r instanceof RegExp?r.source:r;return n}else if(e instanceof de)return{type:"Rule",name:e.name,orgText:e.orgText,definition:s(e.definition)};else throw Error("non exhaustive match")}function ke(e){return Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0))}class pe{visit(e){let s=e;switch(s.constructor){case B:return this.visitNonTerminal(s);case W:return this.visitAlternative(s);case j:return this.visitOption(s);case Z:return this.visitRepetitionMandatory(s);case Q:return this.visitRepetitionMandatoryWithSeparator(s);case q:return this.visitRepetitionWithSeparator(s);case U:return this.visitRepetition(s);case J:return this.visitAlternation(s);case v:return this.visitTerminal(s);case de:return this.visitRule(s);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function vs(e){return e instanceof W||e instanceof j||e instanceof U||e instanceof Z||e instanceof Q||e instanceof q||e instanceof v||e instanceof de}function Ge(e,s=[]){if(e instanceof j||e instanceof U||e instanceof q)return!0;if(e instanceof J)return e.definition.some((r)=>Ge(r,s));else if(e instanceof B&&s.includes(e))return!1;else if(e instanceof ge){if(e instanceof B)s.push(e);return e.definition.every((r)=>Ge(r,s))}else return!1}function Ms(e){return e instanceof J}function fe(e){if(e instanceof B)return"SUBRULE";else if(e instanceof j)return"OPTION";else if(e instanceof J)return"OR";else if(e instanceof Z)return"AT_LEAST_ONE";else if(e instanceof Q)return"AT_LEAST_ONE_SEP";else if(e instanceof q)return"MANY_SEP";else if(e instanceof U)return"MANY";else if(e instanceof v)return"CONSUME";else throw Error("non exhaustive match")}class Fe{walk(e,s=[]){e.definition.forEach((n,r)=>{let a=e.definition.slice(r+1);if(n instanceof B)this.walkProdRef(n,a,s);else if(n instanceof v)this.walkTerminal(n,a,s);else if(n instanceof W)this.walkFlat(n,a,s);else if(n instanceof j)this.walkOption(n,a,s);else if(n instanceof Z)this.walkAtLeastOne(n,a,s);else if(n instanceof Q)this.walkAtLeastOneSep(n,a,s);else if(n instanceof q)this.walkManySep(n,a,s);else if(n instanceof U)this.walkMany(n,a,s);else if(n instanceof J)this.walkOr(n,a,s);else throw Error("non exhaustive match")})}walkTerminal(e,s,n){}walkProdRef(e,s,n){}walkFlat(e,s,n){let r=s.concat(n);this.walk(e,r)}walkOption(e,s,n){let r=s.concat(n);this.walk(e,r)}walkAtLeastOne(e,s,n){let r=[new j({definition:e.definition})].concat(s,n);this.walk(e,r)}walkAtLeastOneSep(e,s,n){let r=Nn(e,s,n);this.walk(e,r)}walkMany(e,s,n){let r=[new j({definition:e.definition})].concat(s,n);this.walk(e,r)}walkManySep(e,s,n){let r=Nn(e,s,n);this.walk(e,r)}walkOr(e,s,n){let r=s.concat(n);e.definition.forEach((a)=>{let o=new W({definition:[a]});this.walk(o,r)})}}function Nn(e,s,n){return[new j({definition:[new v({terminalType:e.separator})].concat(e.definition)})].concat(s,n)}function We(e){if(e instanceof B)return We(e.referencedRule);else if(e instanceof v)return Vr(e);else if(vs(e))return jr(e);else if(Ms(e))return Kr(e);else throw Error("non exhaustive match")}function jr(e){let s=[],n=e.definition,r=0,a=n.length>r,o,c=!0;while(a&&c)o=n[r],c=Ge(o),s=s.concat(We(o)),r=r+1,a=n.length>r;return[...new Set(s)]}function Kr(e){let s=e.definition.map((n)=>We(n));return[...new Set(s.flat())]}function Vr(e){return[e.terminalType]}var Wt="_~IN~_";class In extends Fe{constructor(e){super();this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,s,n){}walkProdRef(e,s,n){let r=zr(e.referencedRule,e.idx)+this.topProd.name,a=s.concat(n),o=new W({definition:a}),c=We(o);this.follows[r]=c}}function kn(e){let s={};return e.forEach((n)=>{let r=new In(n).startWalking();Object.assign(s,r)}),s}function zr(e,s){return e.name+s+Wt}function k(e){return e.charCodeAt(0)}function jt(e,s){if(Array.isArray(e))e.forEach(function(n){s.push(n)});else s.push(e)}function nt(e,s){if(e[s]===!0)throw"duplicate flag "+s;let n=e[s];e[s]=!0}function Ke(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function St(){throw Error("Internal Error - Should never get here!")}function ws(e){return e.type==="Character"}var Rt=[];for(let e=k("0");e<=k("9");e++)Rt.push(e);var yt=[k("_")].concat(Rt);for(let e=k("a");e<=k("z");e++)yt.push(e);for(let e=k("A");e<=k("Z");e++)yt.push(e);var Us=[k(" "),k("\f"),k(`
2
- `),k("\r"),k("\t"),k("\v"),k("\t"),k(" "),k(" "),k(" "),k(" "),k(" "),k(" "),k(" "),k(" "),k(" "),k(" "),k(" "),k(" "),k(" "),k("\u2028"),k("\u2029"),k(" "),k(" "),k(" "),k("\uFEFF")];var Hr=/[0-9a-fA-F]/,Kt=/[0-9]/,Xr=/[1-9]/;class Vt{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let s=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};while(this.isRegExpFlag())switch(this.popChar()){case"g":nt(n,"global");break;case"i":nt(n,"ignoreCase");break;case"m":nt(n,"multiLine");break;case"u":nt(n,"unicode");break;case"y":nt(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:s,loc:this.loc(0)}}disjunction(){let e=[],s=this.idx;e.push(this.alternative());while(this.peekChar()==="|")this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(s)}}alternative(){let e=[],s=this.idx;while(this.isTerm())e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(s)}}term(){if(this.isAssertion())return this.assertion();else return this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let s;switch(this.popChar()){case"=":s="Lookahead";break;case"!":s="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":s="Lookbehind";break;case"!":s="NegativeLookbehind"}break}}Ke(s);let n=this.disjunction();return this.consumeChar(")"),{type:s,value:n,loc:this.loc(e)}}return St()}quantifier(e=!1){let s=void 0,n=this.idx;switch(this.popChar()){case"*":s={atLeast:0,atMost:1/0};break;case"+":s={atLeast:1,atMost:1/0};break;case"?":s={atLeast:0,atMost:1};break;case"{":let r=this.integerIncludingZero();switch(this.popChar()){case"}":s={atLeast:r,atMost:r};break;case",":let a;if(this.isDigit())a=this.integerIncludingZero(),s={atLeast:r,atMost:a};else s={atLeast:r,atMost:1/0};this.consumeChar("}");break}if(e===!0&&s===void 0)return;Ke(s);break}if(e===!0&&s===void 0)return;if(Ke(s)){if(this.peekChar(0)==="?")this.consumeChar("?"),s.greedy=!1;else s.greedy=!0;return s.type="Quantifier",s.loc=this.loc(n),s}}atom(){let e,s=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter())e=this.patternCharacter();if(Ke(e)){if(e.loc=this.loc(s),this.isQuantifier())e.quantifier=this.quantifier();return e}return St()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[k(`
3
- `),k("\r"),k("\u2028"),k("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,s=!1;switch(this.popChar()){case"d":e=Rt;break;case"D":e=Rt,s=!0;break;case"s":e=Us;break;case"S":e=Us,s=!0;break;case"w":e=yt;break;case"W":e=yt,s=!0;break}if(Ke(e))return{type:"Set",value:e,complement:s};return St()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=k("\f");break;case"n":e=k(`
4
- `);break;case"r":e=k("\r");break;case"t":e=k("\t");break;case"v":e=k("\v");break}if(Ke(e))return{type:"Character",value:e};return St()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:k("\x00")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:k(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
- `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:k(e)}}}characterClass(){let e=[],s=!1;if(this.consumeChar("["),this.peekChar(0)==="^")this.consumeChar("^"),s=!0;while(this.isClassAtom()){let n=this.classAtom(),r=n.type==="Character";if(ws(n)&&this.isRangeDash()){this.consumeChar("-");let a=this.classAtom(),o=a.type==="Character";if(ws(a)){if(a.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:a.value})}else jt(n.value,e),e.push(k("-")),jt(a.value,e)}else jt(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:s,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
6
- `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:k("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let s=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:s};if(e)n.idx=this.groupIdx;return n}positiveInteger(){let e=this.popChar();if(Xr.test(e)===!1)throw Error("Expecting a positive integer");while(Kt.test(this.peekChar(0)))e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Kt.test(e)===!1)throw Error("Expecting an integer");while(Kt.test(this.peekChar(0)))e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
7
- `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:k(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Kt.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
8
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch(s){return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
9
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let s="";for(let r=0;r<e;r++){let a=this.popChar();if(Hr.test(a)===!1)throw Error("Expecting a HexDecimal digits");s+=a}return{type:"Character",value:parseInt(s,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class Ve{visitChildren(e){for(let s in e){let n=e[s];if(e.hasOwnProperty(s)){if(n.type!==void 0)this.visit(n);else if(Array.isArray(n))n.forEach((r)=>{this.visit(r)},this)}}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}var zt={},Yr=new Vt;function ze(e){let s=e.toString();if(zt.hasOwnProperty(s))return zt[s];else{let n=Yr.pattern(s);return zt[s]=n,n}}function Cn(){zt={}}var _n="Complement Sets are not supported for first char optimization",Ot=`Unable to use "first char" lexer optimizations:
10
- `;function xn(e,s=!1){try{let n=ze(e);return Ps(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===_n){if(s)Tt(`${Ot} Unable to optimize: < ${e.toString()} >
11
- Complement Sets cannot be automatically optimized.
12
- This will disable the lexer's first char optimizations.
13
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`)}else{let r="";if(s)r=`
14
- This will disable the lexer's first char optimizations.
15
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`;tt(`${Ot}
16
- Failed parsing: < ${e.toString()} >
17
- Using the @chevrotain/regexp-to-ast library
18
- Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function Ps(e,s,n){switch(e.type){case"Disjunction":for(let a=0;a<e.value.length;a++)Ps(e.value[a],s,n);break;case"Alternative":let r=e.value;for(let a=0;a<r.length;a++){let o=r[a];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let c=o;switch(c.type){case"Character":Ht(c.value,s,n);break;case"Set":if(c.complement===!0)throw Error(_n);c.value.forEach((l)=>{if(typeof l==="number")Ht(l,s,n);else{let u=l;if(n===!0)for(let p=u.from;p<=u.to;p++)Ht(p,s,n);else{for(let p=u.from;p<=u.to&&p<it;p++)Ht(p,s,n);if(u.to>=it){let p=u.from>=it?u.from:it,f=u.to,E=Ce(p),T=Ce(f);for(let _=E;_<=T;_++)s[_]=_}}}});break;case"Group":Ps(c.value,s,n);break;default:throw Error("Non Exhaustive Match")}let h=c.quantifier!==void 0&&c.quantifier.atLeast===0;if(c.type==="Group"&&Ds(c)===!1||c.type!=="Group"&&h===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(s)}function Ht(e,s,n){let r=Ce(e);if(s[r]=r,n===!0)qr(e,s)}function qr(e,s){let n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){let a=Ce(r.charCodeAt(0));s[a]=a}else{let a=n.toLowerCase();if(a!==n){let o=Ce(a.charCodeAt(0));s[o]=o}}}function bn(e,s){return e.value.find((n)=>{if(typeof n==="number")return s.includes(n);else{let r=n;return s.find((a)=>r.from<=a&&a<=r.to)!==void 0}})}function Ds(e){let s=e.quantifier;if(s&&s.atLeast===0)return!0;if(!e.value)return!1;return Array.isArray(e.value)?e.value.every(Ds):Ds(e.value)}class Mn extends Ve{constructor(e){super();this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found===!0)return;switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}visitCharacter(e){if(this.targetCharCodes.includes(e.value))this.found=!0}visitSet(e){if(e.complement){if(bn(e,this.targetCharCodes)===void 0)this.found=!0}else if(bn(e,this.targetCharCodes)!==void 0)this.found=!0}}function Xt(e,s){if(s instanceof RegExp){let n=ze(s),r=new Mn(e);return r.visit(n),r.found}else{for(let n of s){let r=n.charCodeAt(0);if(e.includes(r))return!0}return!1}}var He="PATTERN",rt="defaultMode",Yt="modes",Jt=0,Lt=1,Zt=2,Qt=3;function Un(e,s){s=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
19
- `],tracer:(S,m)=>m()},s);let n=s.tracer;n("initCharCodeToOptimizedIndexMap",()=>{Ea()});let r;n("Reject Lexer.NA",()=>{r=e.filter((S)=>S[He]!==V.NA)});let a=!1,o;n("Transform Patterns",()=>{a=!1,o=r.map((S)=>{let m=S[He];if(m instanceof RegExp){let b=m.source;if(b.length===1&&b!=="^"&&b!=="$"&&b!=="."&&!m.ignoreCase)return b;else if(b.length===2&&b[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(b[1]))return b[1];else return wn(m)}else if(typeof m==="function")return a=!0,{exec:m};else if(typeof m==="object")return a=!0,m;else if(typeof m==="string")if(m.length===1)return m;else{let b=m.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),te=new RegExp(b);return wn(te)}else throw Error("non exhaustive match")})});let c,h,l,u,p;n("misc mapping",()=>{c=r.map((S)=>S.tokenTypeIdx),h=r.map((S)=>{let m=S.GROUP;if(m===V.SKIPPED)return;else if(typeof m==="string")return m;else if(m===void 0)return!1;else throw Error("non exhaustive match")}),l=r.map((S)=>{let m=S.LONGER_ALT;if(m)return Array.isArray(m)?m.map((te)=>r.indexOf(te)):[r.indexOf(m)]}),u=r.map((S)=>S.PUSH_MODE),p=r.map((S)=>Object.hasOwn(S,"POP_MODE"))});let f;n("Line Terminator Handling",()=>{let S=Wn(s.lineTerminatorCharacters);if(f=r.map((m)=>!1),s.positionTracking!=="onlyOffset")f=r.map((m)=>{if(Object.hasOwn(m,"LINE_BREAKS"))return!!m.LINE_BREAKS;else return Gn(m,S)===!1&&Xt(S,m.PATTERN)})});let E,T,_,x;n("Misc Mapping #2",()=>{E=r.map(Bn),T=o.map(fa),_=r.reduce((S,m)=>{let b=m.GROUP;if(typeof b==="string"&&b!==V.SKIPPED)S[b]=[];return S},{}),x=o.map((S,m)=>{let b=h[m]===void 0&&l[m]===void 0?Jr(r[m].PATTERN):void 0;return{pattern:o[m],asciiClass:b,longerAlt:l[m],canLineTerminator:f[m],matchType:b!==void 0?Qt:T[m]!==!1?Jt:E[m]?Lt:Zt,short:T[m],group:h[m],push:u[m],pop:p[m],tokenTypeIdx:c[m],tokenType:r[m]}})});let C=!0,L=[];if(!s.safeMode)n("First Char Optimization",()=>{L=r.reduce((S,m,b)=>{if(typeof m.PATTERN==="string"){let te=m.PATTERN.charCodeAt(0),oe=Ce(te);Fs(S,oe,x[b])}else if(Array.isArray(m.START_CHARS_HINT)){let te;m.START_CHARS_HINT.forEach((oe)=>{let pt=typeof oe==="string"?oe.charCodeAt(0):oe,be=Ce(pt);if(te!==be)te=be,Fs(S,be,x[b])})}else if(m.PATTERN instanceof RegExp)if(m.PATTERN.unicode){if(C=!1,s.ensureOptimizations)tt(`${Ot} Unable to analyze < ${m.PATTERN.toString()} > pattern.
20
- The regexp unicode flag is not currently supported by the regexp-to-ast library.
21
- This will disable the lexer's first char optimizations.
22
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`)}else{let te=xn(m.PATTERN,s.ensureOptimizations);if(te.length===0)C=!1;te.forEach((oe)=>{Fs(S,oe,x[b])})}else{if(s.ensureOptimizations)tt(`${Ot} TokenType: <${m.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
23
- This will disable the lexer's first char optimizations.
24
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`);C=!1}return S},[])});return{emptyGroups:_,patternIdxToConfig:x,charCodeToPatternIdxToConfig:L,hasCustom:a,canBeOptimized:C}}function Jr(e){var s,n;if(!(e instanceof RegExp)||e.flags!=="")return;let r;try{r=ze(e)}catch(h){return}if(r.value.value.length!==1||r.value.value[0].value.length!==1)return;let a=r.value.value[0].value[0],o;while(a.type==="Group"){if(a.capturing||a.quantifier!==void 0&&o!==void 0||a.value.value.length!==1||a.value.value[0].value.length!==1)return;o=(s=a.quantifier)!==null&&s!==void 0?s:o,a=a.value.value[0].value[0]}if(a.type!=="Set"||a.complement||a.quantifier!==void 0&&o!==void 0)return;if(o=(n=a.quantifier)!==null&&n!==void 0?n:o,(o===null||o===void 0?void 0:o.atLeast)!==1||o.atMost!==1/0||!o.greedy)return;let c=new Uint8Array(128);for(let h of a.value){let l=typeof h==="number"?h:h.from,u=typeof h==="number"?h:h.to;if(l<0||u>=c.length)return;c.fill(1,l,u+1)}return c}function Pn(e,s){let n=[],r=Qr(e);n=n.concat(r.errors);let a=ea(r.valid),o=a.valid;return n=n.concat(a.errors),n=n.concat(Zr(o)),n=n.concat(la(o)),n=n.concat(ca(o,s)),n=n.concat(ha(o)),n}function Zr(e){let s=[],n=e.filter((r)=>r[He]instanceof RegExp);return s=s.concat(sa(n)),s=s.concat(ra(n)),s=s.concat(aa(n)),s=s.concat(oa(n)),s=s.concat(na(n)),s}function Qr(e){let s=e.filter((a)=>!Object.hasOwn(a,He)),n=s.map((a)=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:K.MISSING_PATTERN,tokenTypes:[a]})),r=e.filter((a)=>!s.includes(a));return{errors:n,valid:r}}function ea(e){let s=e.filter((a)=>{let o=a[He];return!(o instanceof RegExp)&&typeof o!=="function"&&!Object.hasOwn(o,"exec")&&typeof o!=="string"}),n=s.map((a)=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:K.INVALID_PATTERN,tokenTypes:[a]})),r=e.filter((a)=>!s.includes(a));return{errors:n,valid:r}}var ta=/[^\\][$]/;function sa(e){class s extends Ve{constructor(){super(...arguments);this.found=!1}visitEndAnchor(a){this.found=!0}}return e.filter((a)=>{let o=a.PATTERN;try{let c=ze(o),h=new s;return h.visit(c),h.found}catch(c){return ta.test(o.source)}}).map((a)=>({message:`Unexpected RegExp Anchor Error:
25
- Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
26
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:K.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}function na(e){return e.filter((r)=>r.PATTERN.test("")).map((r)=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:K.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}var ia=/[^\\[][\^]|^\^/;function ra(e){class s extends Ve{constructor(){super(...arguments);this.found=!1}visitStartAnchor(a){this.found=!0}}return e.filter((a)=>{let o=a.PATTERN;try{let c=ze(o),h=new s;return h.visit(c),h.found}catch(c){return ia.test(o.source)}}).map((a)=>({message:`Unexpected RegExp Anchor Error:
27
- Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
28
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:K.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}function aa(e){return e.filter((r)=>{let a=r[He];return a instanceof RegExp&&(a.multiline||a.global)}).map((r)=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:K.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function oa(e){let s=[],n=e.map((o)=>e.reduce((c,h)=>{if(o.PATTERN.source===h.PATTERN.source&&!s.includes(h)&&h.PATTERN!==V.NA)return s.push(h),c.push(h),c;return c},[]));return n=n.filter(Boolean),n.filter((o)=>o.length>1).map((o)=>{let c=o.map((l)=>l.name);return{message:`The same RegExp pattern ->${o[0].PATTERN}<-has been used in all of the following Token Types: ${c.join(", ")} <-`,type:K.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function la(e){return e.filter((r)=>{if(!Object.hasOwn(r,"GROUP"))return!1;let a=r.GROUP;return a!==V.SKIPPED&&a!==V.NA&&typeof a!=="string"}).map((r)=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:K.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function ca(e,s){return e.filter((a)=>a.PUSH_MODE!==void 0&&!s.includes(a.PUSH_MODE)).map((a)=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:K.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}function ha(e){let s=[],n=e.reduce((r,a,o)=>{let c=a.PATTERN;if(c===V.NA)return r;if(typeof c==="string")r.push({str:c,idx:o,tokenType:a});else if(c instanceof RegExp&&da(c))r.push({str:c.source,idx:o,tokenType:a});return r},[]);return e.forEach((r,a)=>{n.forEach(({str:o,idx:c,tokenType:h})=>{if(a<c&&ua(o,r.PATTERN)){let l=`Token: ->${h.name}<- can never be matched.
29
- Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
30
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;s.push({message:l,type:K.UNREACHABLE_PATTERN,tokenTypes:[r,h]})}})}),s}function ua(e,s){if(s instanceof RegExp){if(pa(s))return!1;let n=s.exec(e);return n!==null&&n.index===0}else if(typeof s==="function")return s(e,0,[],{});else if(Object.hasOwn(s,"exec"))return s.exec(e,0,[],{});else if(typeof s==="string")return s===e;else throw Error("non exhaustive match")}function da(e){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find((n)=>e.source.indexOf(n)!==-1)===void 0}function pa(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function wn(e){let s=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,s)}function Dn(e,s,n){let r=[];if(!Object.hasOwn(e,rt))r.push({message:"A MultiMode Lexer cannot be initialized without a <"+rt+`> property in its definition
31
- `,type:K.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE});if(!Object.hasOwn(e,Yt))r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Yt+`> property in its definition
32
- `,type:K.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY});if(Object.hasOwn(e,Yt)&&Object.hasOwn(e,rt)&&!Object.hasOwn(e.modes,e.defaultMode))r.push({message:`A MultiMode Lexer cannot be initialized with a ${rt}: <${e.defaultMode}>which does not exist
33
- `,type:K.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST});if(Object.hasOwn(e,Yt))Object.keys(e.modes).forEach((a)=>{let o=e.modes[a];o.forEach((c,h)=>{if(c===void 0)r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${h}>
34
- `,type:K.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Object.hasOwn(c,"LONGER_ALT"))(Array.isArray(c.LONGER_ALT)?c.LONGER_ALT:[c.LONGER_ALT]).forEach((u)=>{if(u!==void 0&&!o.includes(u))r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${c.name}> outside of mode <${a}>
35
- `,type:K.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})});return r}function Fn(e,s,n){let r=[],a=!1,c=Object.values(e.modes||{}).flat().filter(Boolean).filter((l)=>l[He]!==V.NA),h=Wn(n);if(s)c.forEach((l)=>{let u=Gn(l,h);if(u!==!1){let f={message:ma(l,u),type:u.issue,tokenType:l};r.push(f)}else if(Object.hasOwn(l,"LINE_BREAKS")){if(l.LINE_BREAKS===!0)a=!0}else if(Xt(h,l.PATTERN))a=!0});if(s&&!a)r.push({message:`Warning: No LINE_BREAKS Found.
36
- This Lexer has been defined to track line and column information,
37
- But none of the Token Types can be identified as matching a line terminator.
38
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
39
- for details.`,type:K.NO_LINE_BREAKS_FLAGS});return r}function Bn(e){let s=e.PATTERN;if(s instanceof RegExp)return!1;else if(typeof s==="function")return!0;else if(Object.hasOwn(s,"exec"))return!0;else if(typeof s==="string")return!1;else throw Error("non exhaustive match")}function fa(e){if(typeof e==="string"&&e.length===1)return e.charCodeAt(0);else return!1}var $n={test:function(e){let s=e.length;for(let n=this.lastIndex;n<s;n++){let r=e.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;else if(r===13){if(e.charCodeAt(n+1)===10)this.lastIndex=n+2;else this.lastIndex=n+1;return!0}}return!1},lastIndex:0};function Gn(e,s){if(Object.hasOwn(e,"LINE_BREAKS"))return!1;else if(e.PATTERN instanceof RegExp){try{Xt(s,e.PATTERN)}catch(n){return{issue:K.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else if(typeof e.PATTERN==="string")return!1;else if(Bn(e))return{issue:K.CUSTOM_LINE_BREAK};else throw Error("non exhaustive match")}function ma(e,s){if(s.issue===K.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
40
- The problem is in the <${e.name}> Token Type
41
- Root cause: ${s.errMsg}.
42
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;else if(s.issue===K.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
43
- The problem is in the <${e.name}> Token Type
44
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;else throw Error("non exhaustive match")}function Wn(e){return e.map((n)=>{if(typeof n==="string")return n.charCodeAt(0);else return n})}function Fs(e,s,n){if(e[s]===void 0)e[s]=[n];else e[s].push(n)}var it=256,qt=[];function Ce(e){return e<it?e:qt[e]}function Ea(){if(qt.length===0){qt=Array(65536);for(let e=0;e<65536;e++)qt[e]=e>255?255+~~(e/255):e}}function xe(e,s){let n=e.tokenTypeIdx;if(n===s.tokenTypeIdx)return!0;else return s.isParent===!0&&s.categoryMatchesMap[n]===!0}function at(e,s){return e.tokenTypeIdx===s.tokenTypeIdx}var jn=1,Vn={};function ve(e){let s=Ta(e);ga(s),Sa(s),Aa(s),s.forEach((n)=>{n.isParent=n.categoryMatches.length>0})}function Ta(e){let s=[...e],n=e,r=!0;while(r){n=n.map((o)=>o.CATEGORIES).flat().filter(Boolean);let a=n.filter((o)=>!s.includes(o));if(s=s.concat(a),a.length===0)r=!1;else n=a}return s}function ga(e){e.forEach((s)=>{if(!Bs(s))Vn[jn]=s,s.tokenTypeIdx=jn++;if(Kn(s)&&!Array.isArray(s.CATEGORIES))s.CATEGORIES=[s.CATEGORIES];if(!Kn(s))s.CATEGORIES=[];if(!Ra(s))s.categoryMatches=[];if(!ya(s))s.categoryMatchesMap={}})}function Aa(e){e.forEach((s)=>{s.categoryMatches=[],Object.keys(s.categoryMatchesMap).forEach((n)=>{s.categoryMatches.push(Vn[n].tokenTypeIdx)})})}function Sa(e){e.forEach((s)=>{zn([],s)})}function zn(e,s){e.forEach((n)=>{s.categoryMatchesMap[n.tokenTypeIdx]=!0}),s.CATEGORIES.forEach((n)=>{let r=e.concat(s);if(!r.includes(n))zn(r,n)})}function Bs(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"tokenTypeIdx")}function Kn(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"CATEGORIES")}function Ra(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"categoryMatches")}function ya(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"categoryMatchesMap")}function Hn(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"tokenTypeIdx")}var $s={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,s,n,r,a,o){return`unexpected character: ->${e.charAt(s)}<- at offset: ${s}, skipped ${n} characters.`}};var K;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(K||(K={}));var Nt={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
45
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:$s,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Nt);class V{constructor(e,s=Nt){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.cachedGroupKeys=[],this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(r,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let o=Array(this.traceInitIndent+1).join("\t");if(this.traceInitIndent<this.traceInitMaxIdent)console.log(`${o}--> <${r}>`);let{time:c,value:h}=gt(a),l=c>10?console.warn:console.log;if(this.traceInitIndent<this.traceInitMaxIdent)l(`${o}<-- <${r}> time: ${c}ms`);return this.traceInitIndent--,h}else return a()},typeof s==="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
46
- a boolean 2nd argument is no longer supported`);this.config=Object.assign({},Nt,s);let n=this.config.traceInitPerf;if(n===!0)this.traceInitMaxIdent=1/0,this.traceInitPerf=!0;else if(typeof n==="number")this.traceInitMaxIdent=n,this.traceInitPerf=!0;this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let r,a=!0;if(this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Nt.lineTerminatorsPattern)this.config.lineTerminatorsPattern=$n;else if(this.config.lineTerminatorCharacters===Nt.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
47
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(s.safeMode&&s.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');if(this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e))r={modes:{defaultMode:[...e]},defaultMode:rt};else a=!1,r=Object.assign({},e)}),this.config.skipValidations===!1)this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Dn(r,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Fn(r,this.trackStartLines,this.config.lineTerminatorCharacters))});r.modes=r.modes?r.modes:{},Object.entries(r.modes).forEach(([c,h])=>{r.modes[c]=h.filter((l)=>l!==void 0)});let o=Object.keys(r.modes);if(Object.entries(r.modes).forEach(([c,h])=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1)this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Pn(h,o))});if(this.lexerDefinitionErrors.length===0){ve(h);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=Un(h,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:s.positionTracking,ensureOptimizations:s.ensureOptimizations,safeMode:s.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=l.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=l.canBeOptimized}})}),this.defaultMode=r.defaultMode,this.cachedGroupKeys=Object.keys(this.emptyGroups),this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){let h=this.lexerDefinitionErrors.map((l)=>l.message).join(`-----------------------
48
- `);throw Error(`Errors detected in definition of Lexer:
49
- `+h)}this.lexerDefinitionWarning.forEach((c)=>{Tt(c.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a)this.handleModes=()=>{};if(this.trackStartLines===!1)this.computeNewColumn=(c)=>c;if(this.trackEndLines===!1)this.updateTokenEndLineColumnLocation=()=>{};if(/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);if(this.hasCustom)this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom;else this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let c=Object.entries(this.canModeBeOptimized).reduce((h,[l,u])=>{if(u===!1)h.push(l);return h},[]);if(s.ensureOptimizations&&c.length>0)throw Error(`Lexer Modes: < ${c.join(", ")} > cannot be optimized.
50
- Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
51
- Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Cn()}),this.TRACE_INIT("toFastProperties",()=>{At(this)})})}tokenize(e,s=this.defaultMode){if(this.lexerDefinitionErrors.length>0){let r=this.lexerDefinitionErrors.map((a)=>a.message).join(`-----------------------
52
- `);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
53
- `+r)}return this.tokenizeInternal(e,s)}tokenizeInternal(e,s){let n,r,a,o,c,h,l,u,p,f,E,T,_,x,C,L=e,S=L.length,m=0,b=0,te=this.hasCustom?0:Math.floor(e.length/10),oe=Array(te),pt=[],be=this.trackStartLines?1:void 0,Ne=this.trackStartLines?1:void 0,et={};for(let se=0;se<this.cachedGroupKeys.length;se++)et[this.cachedGroupKeys[se]]=[];let Br=this.trackStartLines,ks=this.config.lineTerminatorsPattern,Cs=0,$e=[],ft=[],mt=[],yn=[];Object.freeze(yn);let Et=!1,$r=(se)=>{if(mt.length===1&&se.tokenType.PUSH_MODE===void 0){let Te=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(se);pt.push({offset:se.startOffset,line:se.startLine,column:se.startColumn,length:se.image.length,message:Te})}else{mt.pop();let Te=mt.at(-1);$e=this.patternIdxToConfig[Te],ft=this.charCodeToPatternIdxToConfig[Te],Cs=$e.length;let bs=this.canModeBeOptimized[Te]&&this.config.safeMode===!1;if(ft&&bs)Et=!0;else Et=!1}};function On(se){mt.push(se),ft=this.charCodeToPatternIdxToConfig[se],$e=this.patternIdxToConfig[se],Cs=$e.length;let Te=this.canModeBeOptimized[se]&&this.config.safeMode===!1;if(ft&&Te)Et=!0;else Et=!1}On.call(this,s);let Ee,Ln=this.config.recoveryEnabled;while(m<S){h=null,p=-1;let se=L.charCodeAt(m),Te;if(Et){let re=Ce(se),ue=ft[re];Te=ue!==void 0?ue:yn}else Te=$e;let bs=Te.length;for(n=0;n<bs;n++){Ee=Te[n];let re=Ee.pattern;switch(l=null,Ee.matchType){case Jt:if(se===Ee.short)p=1,h=re;break;case Lt:if(C=re.exec(L,m,oe,et),C!==null){if(h=C[0],p=h.length,C.payload!==void 0)l=C.payload}else h=null;break;case Qt:{let ue=Ee.asciiClass;if(ue[se]!==1){re.lastIndex=0;break}let ce=m+1;while(ue[L.charCodeAt(ce)]===1)ce++;p=ce-m,re.lastIndex=ce;break}case Zt:re.lastIndex=m,p=this.matchLength(re,e,m);break}if(p!==-1){if(c=Ee.longerAlt,c!==void 0){h=e.substring(m,m+p);let ue=c.length;for(a=0;a<ue;a++){let ce=$e[c[a]],_e=ce.pattern;if(u=null,ce.matchType===Lt)if(C=_e.exec(L,m,oe,et),C!==null){if(o=C[0],C.payload!==void 0)u=C.payload}else o=null;else _e.lastIndex=m,o=this.match(_e,e,m);if(o&&o.length>h.length){h=o,p=o.length,l=u,Ee=ce;break}}}break}}if(p!==-1){if(f=Ee.group,f!==void 0)if(h=h!==null?h:e.substring(m,m+p),E=Ee.tokenTypeIdx,T=this.createTokenInstance(h,m,E,Ee.tokenType,be,Ne,p),this.handlePayload(T,l),f===!1)b=this.addToken(oe,b,T);else et[f].push(T);if(Br===!0&&Ee.canLineTerminator===!0){let re=0,ue,ce;ks.lastIndex=0;do if(h=h!==null?h:e.substring(m,m+p),ue=ks.test(h),ue===!0)ce=ks.lastIndex-1,re++;while(ue===!0);if(re!==0)be=be+re,Ne=p-ce,this.updateTokenEndLineColumnLocation(T,f,ce,re,be,Ne,p);else Ne=this.computeNewColumn(Ne,p)}else Ne=this.computeNewColumn(Ne,p);m=m+p,this.handleModes(Ee,$r,On,T)}else{let re=m,ue=be,ce=Ne,_e=Ln===!1;while(_e===!1&&m<S){m++;for(r=0;r<Cs;r++){let _s=$e[r],xs=_s.pattern;switch(_s.matchType){case Jt:if(L.charCodeAt(m)===_s.short)_e=!0;break;case Lt:_e=xs.exec(L,m,oe,et)!==null;break;case Qt:case Zt:xs.lastIndex=m,_e=xs.exec(e)!==null;break}if(_e===!0)break}}if(_=m-re,Ne=this.computeNewColumn(Ne,_),x=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(L,re,_,ue,ce,mt.at(-1)),pt.push({offset:re,line:ue,column:ce,length:_,message:x}),Ln===!1)break}}if(!this.hasCustom)oe.length=b;return{tokens:oe,groups:et,errors:pt}}handleModes(e,s,n,r){if(e.pop===!0){let a=e.push;if(s(r),a!==void 0)n.call(this,a)}else if(e.push!==void 0)n.call(this,e.push)}updateTokenEndLineColumnLocation(e,s,n,r,a,o,c){let h,l;if(s!==void 0){if(h=n===c-1,l=h?-1:0,!(r===1&&h===!0))e.endLine=a+l,e.endColumn=o-1+-l}}computeNewColumn(e,s){return e+s}createOffsetOnlyToken(e,s,n,r){return{image:e,startOffset:s,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,s,n,r,a,o){return{image:e,startOffset:s,startLine:a,startColumn:o,tokenTypeIdx:n,tokenType:r}}createFullToken(e,s,n,r,a,o,c){return{image:e,startOffset:s,endOffset:s+c-1,startLine:a,endLine:a,startColumn:o,endColumn:o+c-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,s,n){return e.push(n),s}addTokenUsingMemberAccess(e,s,n){return e[s]=n,s++,s}handlePayloadNoCustom(e,s){}handlePayloadWithCustom(e,s){if(s!==null)e.payload=s}match(e,s,n){if(e.test(s)===!0)return s.substring(n,e.lastIndex);return null}matchLength(e,s,n){if(e.test(s)===!0)return e.lastIndex-n;return-1}}V.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";V.NA=/NOT_APPLICABLE/;function Xe(e){if(Gs(e))return e.LABEL;else return e.name}function Gs(e){return typeof e.LABEL==="string"&&e.LABEL!==""}var Oa="parent",Xn="categories",Yn="label",qn="group",Jn="push_mode",Zn="pop_mode",Qn="longer_alt",ei="line_breaks",ti="start_chars_hint";function g(e){return La(e)}function La(e){let s=e.pattern,n={};if(n.name=e.name,s!==void 0)n.PATTERN=s;if(Object.hasOwn(e,Oa))throw`The parent property is no longer supported.
54
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;if(Object.hasOwn(e,Xn))n.CATEGORIES=e[Xn];if(ve([n]),Object.hasOwn(e,Yn))n.LABEL=e[Yn];if(Object.hasOwn(e,qn))n.GROUP=e[qn];if(Object.hasOwn(e,Zn))n.POP_MODE=e[Zn];if(Object.hasOwn(e,Jn))n.PUSH_MODE=e[Jn];if(Object.hasOwn(e,Qn))n.LONGER_ALT=e[Qn];if(Object.hasOwn(e,ei))n.LINE_BREAKS=e[ei];if(Object.hasOwn(e,ti))n.START_CHARS_HINT=e[ti];return n}var me=g({name:"EOF",pattern:V.NA});ve([me]);function Ye(e,s,n,r,a,o,c,h){return{image:s,startOffset:n,endOffset:r,startLine:a,endLine:o,startColumn:c,endColumn:h,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function It(e,s){return xe(e,s)}var es={buildMismatchTokenMessage({expected:e,actual:s,previous:n,ruleName:r}){return`Expecting ${Gs(e)?`--> ${Xe(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${s.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:s}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:s,previous:n,customUserDescription:r,ruleName:a}){let h=`
55
- but found: '`+s[0].image+"'";if(r)return"Expecting: "+r+h;else return`Expecting: one of these possible Token sequences:
56
- ${e.reduce((E,T)=>E.concat(T),[]).map((E)=>`[${E.map((T)=>Xe(T)).join(", ")}]`).map((E,T)=>` ${T+1}. ${E}`).join(`
57
- `)}`+h},buildEarlyExitMessage({expectedIterationPaths:e,actual:s,customUserDescription:n,ruleName:r}){let c=`
58
- but found: '`+s[0].image+"'";if(n)return"Expecting: "+n+c;else return`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::
59
- <${e.map((u)=>`[${u.map((p)=>Xe(p)).join(",")}]`).join(" ,")}>`+c}};Object.freeze(es);var si={buildRuleNotFoundError(e,s){return"Invalid grammar, reference to a rule which is not defined: ->"+s.nonTerminalName+`<-
60
- inside top level rule: ->`+e.name+"<-"}},ye={buildDuplicateFoundError(e,s){function n(p){if(p instanceof v)return p.terminalType.name;else if(p instanceof B)return p.nonTerminalName;else return""}let r=e.name,a=s[0],o=a.idx,c=fe(a),h=n(a),l=o>0,u=`->${c}${l?o:""}<- ${h?`with argument: ->${h}<-`:""}
61
- appears more than once (${s.length} times) in the top level rule: ->${r}<-.
62
- For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
63
- `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
64
- `),u},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.
65
- The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.
66
- To resolve this make sure each Terminal and Non-Terminal names are unique
67
- This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
68
- and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let s=e.prefixPath.map((a)=>Xe(a)).join(", "),n=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix
69
- in <OR${n}> inside <${e.topLevelRule.name}> Rule,
70
- <${s}> may appears as a prefix path in all these alternatives.
71
- See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
72
- For Further details.`},buildAlternationAmbiguityError(e){let s=e.alternation.idx===0?"":e.alternation.idx,n=e.prefixPath.length===0,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${s}> inside <${e.topLevelRule.name}> Rule,
73
- `;if(n)r+=`These alternatives are all empty (match no tokens), making them indistinguishable.
74
- Only the last alternative may be empty.
75
- `;else{let a=e.prefixPath.map((o)=>Xe(o)).join(", ");r+=`<${a}> may appears as a prefix path in all these alternatives.
76
- `}return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
77
- For Further details.`,r},buildEmptyRepetitionError(e){let s=fe(e.repetition);if(e.repetition.idx!==0)s+=e.repetition.idx;return`The repetition <${s}> within Rule <${e.topLevelRule.name}> can never consume any tokens.
78
- This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
79
- Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:
80
- <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
81
- has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let s=e.topLevelRule.name,n=e.leftRecursionPath.map((o)=>o.name),r=`${s} --> ${n.concat([s]).join(" --> ")}`;return`Left Recursion found in grammar.
82
- rule: <${s}> can be invoked from itself (directly or indirectly)
83
- without consuming any Tokens. The grammar path that causes this is:
84
- ${r}
85
- To fix this refactor your grammar to remove the left recursion.
86
- see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let s;if(e.topLevelRule instanceof de)s=e.topLevelRule.name;else s=e.topLevelRule;return`Duplicate definition, rule: ->${s}<- is already defined in the grammar: ->${e.grammarName}<-`}};function ni(e,s){let n=new ii(e,s);return n.resolveRefs(),n.errors}class ii extends pe{constructor(e,s){super();this.nameToTopRule=e,this.errMsgProvider=s,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach((e)=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let s=this.nameToTopRule[e.nonTerminalName];if(!s){let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:ne.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}else e.referencedRule=s}}class ri extends Fe{constructor(e,s){super();this.topProd=e,this.path=s,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,s=[]){if(!this.found)super.walk(e,s)}walkProdRef(e,s,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=s.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){if(this.ruleStack.length===0)this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0;else this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop()}}class Ws extends ri{constructor(e,s){super(e,s);this.path=s,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,s,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let r=s.concat(n),a=new W({definition:r});this.possibleTokTypes=We(a),this.found=!0}}}class kt extends Fe{constructor(e,s){super();this.topRule=e,this.occurrence=s,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class js extends kt{walkMany(e,s,n){if(e.idx===this.occurrence){let r=s.concat(n)[0];if(this.result.isEndOfRule=r===void 0,r instanceof v)this.result.token=r.terminalType,this.result.occurrence=r.idx}else super.walkMany(e,s,n)}}class ts extends kt{walkManySep(e,s,n){if(e.idx===this.occurrence){let r=s.concat(n)[0];if(this.result.isEndOfRule=r===void 0,r instanceof v)this.result.token=r.terminalType,this.result.occurrence=r.idx}else super.walkManySep(e,s,n)}}class Ks extends kt{walkAtLeastOne(e,s,n){if(e.idx===this.occurrence){let r=s.concat(n)[0];if(this.result.isEndOfRule=r===void 0,r instanceof v)this.result.token=r.terminalType,this.result.occurrence=r.idx}else super.walkAtLeastOne(e,s,n)}}class ss extends kt{walkAtLeastOneSep(e,s,n){if(e.idx===this.occurrence){let r=s.concat(n)[0];if(this.result.isEndOfRule=r===void 0,r instanceof v)this.result.token=r.terminalType,this.result.occurrence=r.idx}else super.walkAtLeastOneSep(e,s,n)}}function ns(e,s,n=[]){n=[...n];let r=[],a=0;function o(h){return h.concat(e.slice(a+1))}function c(h){let l=ns(o(h),s,n);return r.concat(l)}while(n.length<s&&a<e.length){let h=e[a];if(h instanceof W)return c(h.definition);else if(h instanceof B)return c(h.definition);else if(h instanceof j)r=c(h.definition);else if(h instanceof Z){let l=h.definition.concat([new U({definition:h.definition})]);return c(l)}else if(h instanceof Q){let l=[new W({definition:h.definition}),new U({definition:[new v({terminalType:h.separator})].concat(h.definition)})];return c(l)}else if(h instanceof q){let l=h.definition.concat([new U({definition:[new v({terminalType:h.separator})].concat(h.definition)})]);r=c(l)}else if(h instanceof U){let l=h.definition.concat([new U({definition:h.definition})]);r=c(l)}else if(h instanceof J)return h.definition.forEach((l)=>{if(l.definition.length!==0)r=c(l.definition)}),r;else if(h instanceof v)n.push(h.terminalType);else throw Error("non exhaustive match");a++}return r.push({partialPath:n,suffixDef:e.slice(a)}),r}function ai(e,s,n,r){let o=["EXIT_NONE_TERMINAL"],c="EXIT_ALTERNATIVE",h=!1,l=s.length,u=l-r-1,p=[],f=[];f.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});while(f.length!==0){let E=f.pop();if(E==="EXIT_ALTERNATIVE"){if(h&&f.at(-1).idx<=u)f.pop();continue}let{def:T,idx:_,ruleStack:x,occurrenceStack:C}=E;if(T.length===0)continue;let L=T[0];if(L==="EXIT_NONE_TERMINAL"){let S={idx:_,def:T.slice(1),ruleStack:x.slice(0,-1),occurrenceStack:C.slice(0,-1)};f.push(S)}else if(L instanceof v)if(_<l-1){let S=_+1,m=s[S];if(n(m,L.terminalType)){let b={idx:S,def:T.slice(1),ruleStack:x,occurrenceStack:C};f.push(b)}}else if(_===l-1)p.push({nextTokenType:L.terminalType,nextTokenOccurrence:L.idx,ruleStack:x,occurrenceStack:C}),h=!0;else throw Error("non exhaustive match");else if(L instanceof B){let S=[...x];S.push(L.nonTerminalName);let m=[...C];m.push(L.idx);let b={idx:_,def:L.definition.concat(o,T.slice(1)),ruleStack:S,occurrenceStack:m};f.push(b)}else if(L instanceof j){let S={idx:_,def:T.slice(1),ruleStack:x,occurrenceStack:C};f.push(S),f.push("EXIT_ALTERNATIVE");let m={idx:_,def:L.definition.concat(T.slice(1)),ruleStack:x,occurrenceStack:C};f.push(m)}else if(L instanceof Z){let S=new U({definition:L.definition,idx:L.idx}),m=L.definition.concat([S],T.slice(1)),b={idx:_,def:m,ruleStack:x,occurrenceStack:C};f.push(b)}else if(L instanceof Q){let S=new v({terminalType:L.separator}),m=new U({definition:[S].concat(L.definition),idx:L.idx}),b=L.definition.concat([m],T.slice(1)),te={idx:_,def:b,ruleStack:x,occurrenceStack:C};f.push(te)}else if(L instanceof q){let S={idx:_,def:T.slice(1),ruleStack:x,occurrenceStack:C};f.push(S),f.push("EXIT_ALTERNATIVE");let m=new v({terminalType:L.separator}),b=new U({definition:[m].concat(L.definition),idx:L.idx}),te=L.definition.concat([b],T.slice(1)),oe={idx:_,def:te,ruleStack:x,occurrenceStack:C};f.push(oe)}else if(L instanceof U){let S={idx:_,def:T.slice(1),ruleStack:x,occurrenceStack:C};f.push(S),f.push("EXIT_ALTERNATIVE");let m=new U({definition:L.definition,idx:L.idx}),b=L.definition.concat([m],T.slice(1)),te={idx:_,def:b,ruleStack:x,occurrenceStack:C};f.push(te)}else if(L instanceof J)for(let S=L.definition.length-1;S>=0;S--){let m=L.definition[S],b={idx:_,def:m.definition.concat(T.slice(1)),ruleStack:x,occurrenceStack:C};f.push(b),f.push("EXIT_ALTERNATIVE")}else if(L instanceof W)f.push({idx:_,def:L.definition.concat(T.slice(1)),ruleStack:x,occurrenceStack:C});else if(L instanceof de)f.push(Na(L,_,x,C));else throw Error("non exhaustive match")}return p}function Na(e,s,n,r){let a=[...n];a.push(e.name);let o=[...r];return o.push(1),{idx:s,def:e.definition,ruleStack:a,occurrenceStack:o}}var z;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(z||(z={}));function is(e){if(e instanceof j||e==="Option")return z.OPTION;else if(e instanceof U||e==="Repetition")return z.REPETITION;else if(e instanceof Z||e==="RepetitionMandatory")return z.REPETITION_MANDATORY;else if(e instanceof Q||e==="RepetitionMandatoryWithSeparator")return z.REPETITION_MANDATORY_WITH_SEPARATOR;else if(e instanceof q||e==="RepetitionWithSeparator")return z.REPETITION_WITH_SEPARATOR;else if(e instanceof J||e==="Alternation")return z.ALTERNATION;else throw Error("non exhaustive match")}function li(e,s,n,r,a,o){let c=Ct(e,s,n),h=mi(c)?at:xe;return o(c,r,h,a)}function ci(e,s,n,r,a,o){let c=bt(e,s,a,n),h=mi(c)?at:xe;return o(c[0],h,r)}function hi(e,s,n,r){let a=e.length,o=e.every((c)=>c.every((h)=>h.length===1));if(s)return function(c){let h=c.map((l)=>l.GATE);for(let l=0;l<a;l++){let u=e[l],p=u.length,f=h[l];if(f!==void 0&&f.call(this)===!1)continue;e:for(let E=0;E<p;E++){let T=u[E],_=T.length;for(let x=0;x<_;x++){let C=this.LA_FAST(x+1);if(n(C,T[x])===!1)continue e}return l}}return};else if(o&&!r){let h=e.map((l)=>l.flat()).reduce((l,u,p)=>(u.forEach((f)=>{if(!(f.tokenTypeIdx in l))l[f.tokenTypeIdx]=p;f.categoryMatches.forEach((E)=>{if(!Object.hasOwn(l,E))l[E]=p})}),l),{});return function(){let l=this.LA_FAST(1);return h[l.tokenTypeIdx]}}else return function(){for(let c=0;c<a;c++){let h=e[c],l=h.length;e:for(let u=0;u<l;u++){let p=h[u],f=p.length;for(let E=0;E<f;E++){let T=this.LA_FAST(E+1);if(n(T,p[E])===!1)continue e}return c}}return}}function ui(e,s,n){let r=e.every((o)=>o.length===1),a=e.length;if(r&&!n){let o=e.flat();if(o.length===1&&o[0].categoryMatches.length===0){let h=o[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===h}}else{let c=o.reduce((h,l,u)=>(h[l.tokenTypeIdx]=!0,l.categoryMatches.forEach((p)=>{h[p]=!0}),h),[]);return function(){let h=this.LA_FAST(1);return c[h.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<a;o++){let c=e[o],h=c.length;for(let l=0;l<h;l++){let u=this.LA_FAST(l+1);if(s(u,c[l])===!1)continue e}return!0}return!1}}class di extends Fe{constructor(e,s,n){super();this.topProd=e,this.targetOccurrence=s,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,s,n,r){if(e.idx===this.targetOccurrence&&this.targetProdType===s)return this.restDef=n.concat(r),!0;return!1}walkOption(e,s,n){if(!this.checkIsTarget(e,z.OPTION,s,n))super.walkOption(e,s,n)}walkAtLeastOne(e,s,n){if(!this.checkIsTarget(e,z.REPETITION_MANDATORY,s,n))super.walkOption(e,s,n)}walkAtLeastOneSep(e,s,n){if(!this.checkIsTarget(e,z.REPETITION_MANDATORY_WITH_SEPARATOR,s,n))super.walkOption(e,s,n)}walkMany(e,s,n){if(!this.checkIsTarget(e,z.REPETITION,s,n))super.walkOption(e,s,n)}walkManySep(e,s,n){if(!this.checkIsTarget(e,z.REPETITION_WITH_SEPARATOR,s,n))super.walkOption(e,s,n)}}class zs extends pe{constructor(e,s,n){super();this.targetOccurrence=e,this.targetProdType=s,this.targetRef=n,this.result=[]}checkIsTarget(e,s){if(e.idx===this.targetOccurrence&&this.targetProdType===s&&(this.targetRef===void 0||e===this.targetRef))this.result=e.definition}visitOption(e){this.checkIsTarget(e,z.OPTION)}visitRepetition(e){this.checkIsTarget(e,z.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,z.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,z.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,z.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,z.ALTERNATION)}}function oi(e){let s=Array(e);for(let n=0;n<e;n++)s[n]=[];return s}function Vs(e){let s=[""];for(let n=0;n<e.length;n++){let r=e[n],a=[];for(let o=0;o<s.length;o++){let c=s[o];a.push(c+"_"+r.tokenTypeIdx);for(let h=0;h<r.categoryMatches.length;h++){let l="_"+r.categoryMatches[h];a.push(c+l)}}s=a}return s}function Ia(e,s,n){for(let r=0;r<e.length;r++){if(r===n)continue;let a=e[r];for(let o=0;o<s.length;o++){let c=s[o];if(a[c]===!0)return!1}}return!0}function pi(e,s){let n=e.map((c)=>ns([c],1)),r=oi(n.length),a=n.map((c)=>{let h={};return c.forEach((l)=>{Vs(l.partialPath).forEach((p)=>{h[p]=!0})}),h}),o=n;for(let c=1;c<=s;c++){let h=o;o=oi(h.length);for(let l=0;l<h.length;l++){let u=h[l];for(let p=0;p<u.length;p++){let f=u[p].partialPath,E=u[p].suffixDef,T=Vs(f);if(Ia(a,T,l)||E.length===0||f.length===s){let x=r[l];if(rs(x,f)===!1){x.push(f);for(let C=0;C<T.length;C++){let L=T[C];a[l][L]=!0}}}else{let x=ns(E,c+1,f);o[l]=o[l].concat(x),x.forEach((C)=>{Vs(C.partialPath).forEach((S)=>{a[l][S]=!0})})}}}}return r}function Ct(e,s,n,r){let a=new zs(e,z.ALTERNATION,r);return s.accept(a),pi(a.result,n)}function bt(e,s,n,r){let a=new zs(e,n);s.accept(a);let o=a.result,h=new di(s,e,n).startWalking(),l=new W({definition:o}),u=new W({definition:h});return pi([l,u],r)}function rs(e,s){e:for(let n=0;n<e.length;n++){let r=e[n];if(r.length!==s.length)continue;for(let a=0;a<r.length;a++){let o=s[a],c=r[a];if((o===c||c.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}return!1}function fi(e,s){return e.length<s.length&&e.every((n,r)=>{let a=s[r];return n===a||a.categoryMatchesMap[n.tokenTypeIdx]})}function mi(e){return e.every((s)=>s.every((n)=>n.every((r)=>r.categoryMatches.length===0)))}function Ei(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map((n)=>Object.assign({type:ne.CUSTOM_LOOKAHEAD_VALIDATION},n))}function Ti(e,s,n,r){let a=e.flatMap((l)=>ka(l,n)),o=Ma(e,s,n),c=e.flatMap((l)=>_a(l,n)),h=e.flatMap((l)=>ba(l,e,r,n));return a.concat(o,c,h)}function ka(e,s){let n=new Ai;e.accept(n);let r=n.allProductions,a=Object.groupBy(r,Ca),o=Object.fromEntries(Object.entries(a).filter(([h,l])=>l.length>1));return Object.values(o).map((h)=>{let l=h[0],u=s.buildDuplicateFoundError(e,h),p=fe(l),f={message:u,type:ne.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:p,occurrence:l.idx},E=gi(l);if(E)f.parameter=E;return f})}function Ca(e){return`${fe(e)}_#_${e.idx}_#_${gi(e)}`}function gi(e){if(e instanceof v)return e.terminalType.name;else if(e instanceof B)return e.nonTerminalName;else return""}class Ai extends pe{constructor(){super(...arguments);this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function ba(e,s,n,r){let a=[];if(s.reduce((c,h)=>{if(h.name===e.name)return c+1;return c},0)>1){let c=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});a.push({message:c,type:ne.DUPLICATE_RULE_NAME,ruleName:e.name})}return a}function Si(e,s,n){let r=[],a;if(!s.includes(e))a=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:a,type:ne.INVALID_RULE_OVERRIDE,ruleName:e});return r}function Hs(e,s,n,r=[]){let a=[],o=as(s.definition);if(o.length===0)return[];else{let c=e.name;if(o.includes(e))a.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:ne.LEFT_RECURSION,ruleName:c});let l=r.concat([e]),p=o.filter((f)=>!l.includes(f)).flatMap((f)=>{let E=[...r];return E.push(f),Hs(e,f,n,E)});return a.concat(p)}}function as(e){let s=[];if(e.length===0)return s;let n=e[0];if(n instanceof B)s.push(n.referencedRule);else if(n instanceof W||n instanceof j||n instanceof Z||n instanceof Q||n instanceof q||n instanceof U)s=s.concat(as(n.definition));else if(n instanceof J)s=n.definition.map((o)=>as(o.definition)).flat();else if(n instanceof v);else throw Error("non exhaustive match");let r=Ge(n),a=e.length>1;if(r&&a){let o=e.slice(1);return s.concat(as(o))}else return s}class os extends pe{constructor(){super(...arguments);this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Ri(e,s){let n=new os;return e.accept(n),n.alternations.flatMap((o)=>o.definition.slice(0,-1).flatMap((h,l)=>{if(ai([h],[],xe,1).length===0)return[{message:s.buildEmptyAlternationError({topLevelRule:e,alternation:o,emptyChoiceIdx:l}),type:ne.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:o.idx,alternative:l+1}];else return[]}))}function yi(e,s,n){let r=new os;e.accept(r);let a=r.alternations;return a=a.filter((c)=>c.ignoreAmbiguities!==!0),a.flatMap((c)=>{let h=c.idx,l=c.maxLookahead||s,u=Ct(h,e,l,c),p=xa(u,c,e,n),f=va(u,c,e,n);return p.concat(f)})}class Oi extends pe{constructor(){super(...arguments);this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function _a(e,s){let n=new os;return e.accept(n),n.alternations.flatMap((o)=>{if(o.definition.length>255)return[{message:s.buildTooManyAlternativesError({topLevelRule:e,alternation:o}),type:ne.TOO_MANY_ALTS,ruleName:e.name,occurrence:o.idx}];else return[]})}function Li(e,s,n){let r=[];return e.forEach((a)=>{let o=new Oi;a.accept(o),o.allProductions.forEach((h)=>{let l=is(h),u=h.maxLookahead||s,p=h.idx;if(bt(p,a,l,u)[0].flat().length===0){let T=n.buildEmptyRepetitionError({topLevelRule:a,repetition:h});r.push({message:T,type:ne.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),r}function xa(e,s,n,r){let a=[];return e.reduce((h,l,u)=>{if(s.definition[u].ignoreAmbiguities===!0)return h;return l.forEach((p)=>{let f=[u];if(e.forEach((E,T)=>{if(u!==T&&rs(E,p)&&s.definition[T].ignoreAmbiguities!==!0)f.push(T)}),f.length>1&&!rs(a,p))a.push(p),h.push({alts:f,path:p})}),h},[]).map((h)=>{let l=h.alts.map((p)=>p+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:s,ambiguityIndices:l,prefixPath:h.path}),type:ne.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:s.idx,alternatives:h.alts}})}function va(e,s,n,r){let a=e.reduce((c,h,l)=>{let u=h.map((p)=>({idx:l,path:p}));return c.concat(u)},[]);return a.flatMap((c)=>{if(s.definition[c.idx].ignoreAmbiguities===!0)return[];let{idx:l,path:u}=c;return a.filter((E)=>s.definition[E.idx].ignoreAmbiguities!==!0&&E.idx<l&&fi(E.path,u)).map((E)=>{let T=[E.idx+1,l+1],_=s.idx===0?"":s.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:s,ambiguityIndices:T,prefixPath:E.path}),type:ne.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:_,alternatives:T}})})}function Ma(e,s,n){let r=[],a=s.map((o)=>o.name);return e.forEach((o)=>{let c=o.name;if(a.includes(c)){let h=n.buildNamespaceConflictError(o);r.push({message:h,type:ne.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:c})}}),r}function Ni(e){let s=Object.assign({errMsgProvider:si},e),n={};return e.rules.forEach((r)=>{n[r.name]=r}),ni(n,s.errMsgProvider)}function Ii(e){var s;let n=(s=e.errMsgProvider)!==null&&s!==void 0?s:ye;return Ti(e.rules,e.tokenTypes,n,e.grammarName)}var ki=["MismatchedTokenException","NoViableAltException","EarlyExitException","NotAllInputParsedException"];Object.freeze(ki);function Be(e){return ki.includes(e.name)}class _t extends Error{constructor(e,s){super(e);if(this.token=s,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}}class ot extends _t{constructor(e,s,n){super(e,s);this.previousToken=n,this.name="MismatchedTokenException"}}class ls extends _t{constructor(e,s,n){super(e,s);this.previousToken=n,this.name="NoViableAltException"}}class hs extends _t{constructor(e,s){super(e,s);this.name="NotAllInputParsedException"}}class us extends _t{constructor(e,s,n){super(e,s);this.previousToken=n,this.name="EarlyExitException"}}var Xs={},Ys="InRuleRecoveryException";class Ci extends Error{constructor(e){super(e);this.name=Ys}}class qs{initRecoverable(e){if(this.firstAfterRepMap=[],this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:he.recoveryEnabled,this.recoveryEnabled)this.attemptInRepetitionRecovery=wa}getTokenToInsert(e){let s=Ye(e,"",-1,-1,-1,-1,-1,-1);return s.isInsertedInRecovery=!0,s}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,s,n,r){let a=this.findReSyncTokenType(),o=this.exportLexerState(),c=[],h=!1,l=this.LA_FAST(1),u=this.LA_FAST(1),p=()=>{let f=this.LA(0),E=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:f,ruleName:this.getCurrRuleFullName()}),T=new ot(E,l,this.LA(0));T.resyncedTokens=c.slice(0,-1),this.SAVE_ERROR(T)};while(!h)if(this.tokenMatcher(u,r)){p();return}else if(n.call(this)){p(),e.apply(this,s);return}else if(this.tokenMatcher(u,a))h=!0;else u=this.SKIP_TOKEN(),this.addToResyncTokens(u,c);this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,s,n){if(n===!1)return!1;if(this.tokenMatcher(this.LA_FAST(1),e))return!1;if(this.isBackTracking())return!1;if(this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,s)))return!1;return!0}getNextPossibleTokenTypes(e){let s=e.ruleStack[0],r=this.getGAstProductions()[s];return new Ws(r,e).startWalking()}getFollowsForInRuleRecovery(e,s){let n=this.getCurrentGrammarPath(e,s);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,s){if(this.canRecoverWithSingleTokenInsertion(e,s))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Ci("sad sad panda")}canPerformInRuleRecovery(e,s){return this.canRecoverWithSingleTokenInsertion(e,s)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,s){if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(s.length===0)return!1;let n=this.LA_FAST(1);return s.find((a)=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){if(!this.canTokenTypeBeDeletedInRecovery(e))return!1;return this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){let s=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(s).includes(e)}findReSyncTokenType(){let e=this.flattenFollowSet(),s=this.LA_FAST(1),n=2;while(!0){let r=e.find((a)=>It(s,a));if(r!==void 0)return r;s=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return Xs;let e=this.currRuleShortName,s=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:s,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,s=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=Array(n);for(let a=0;a<n;a++)if(a===0)r[a]=Xs;else r[a]={ruleName:this.shortRuleNameToFullName(e[a]),idxInCallingRule:s[a],inRule:this.shortRuleNameToFullName(e[a-1])};return r}flattenFollowSet(){return this.buildFullFollowKeyStack().map((s)=>this.getFollowSetFromFollowKey(s)).flat()}getFollowSetFromFollowKey(e){if(e===Xs)return[me];let s=e.ruleName+e.idxInCallingRule+Wt+e.inRule;return this.resyncFollows[s]}addToResyncTokens(e,s){if(!this.tokenMatcher(e,me))s.push(e);return s}reSyncTo(e){let s=[],n=this.LA_FAST(1);while(this.tokenMatcher(n,e)===!1)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,s);return s.slice(0,-1)}attemptInRepetitionRecovery(e,s,n,r,a,o,c){}getCurrentGrammarPath(e,s){let n=this.getHumanReadableRuleStack(),r=this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1);return{ruleStack:n,occurrenceStack:r,lastTok:e,lastTokOccurrence:s}}getHumanReadableRuleStack(){let e=this.RULE_STACK_IDX+1,s=Array(e);for(let n=0;n<e;n++)s[n]=this.shortRuleNameToFullName(this.RULE_STACK[n]);return s}}function wa(e,s,n,r,a,o,c){var h,l,u;let p=r|a,f=(h=(l=this.firstAfterRepMap)[u=this.currRuleShortName])!==null&&h!==void 0?h:l[u]=[],E=f[p];if(E===void 0){let C=this.getCurrRuleFullName(),L=this.getGAstProductions()[C];E=new o(L,a).startWalking(),f[p]=E}let T=E.token,_=E.occurrence,x=E.isEndOfRule;if(this.RULE_STACK_IDX===0&&x&&T===void 0)T=me,_=1;if(T===void 0||_===void 0)return;if(this.shouldInRepetitionRecoveryBeTried(T,_,c))this.tryInRepetitionRecovery(e,s,n,T)}var ds=256,ps=512,xt=768,vt=1024,Mt=1280,lt=1536;class fs{constructor(e){var s;this.maxLookahead=(s=e===null||e===void 0?void 0:e.maxLookahead)!==null&&s!==void 0?s:he.maxLookahead}validate(e){let s=this.validateNoLeftRecursion(e.rules);if(s.length===0){let n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...s,...n,...r,...a]}return s}validateNoLeftRecursion(e){return e.flatMap((s)=>Hs(s,s,ye))}validateEmptyOrAlternatives(e){return e.flatMap((s)=>Ri(s,ye))}validateAmbiguousAlternationAlternatives(e,s){return e.flatMap((n)=>yi(n,s,ye))}validateSomeNonEmptyLookaheadPath(e,s){return Li(e,s,ye)}buildLookaheadForAlternation(e){return li(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,hi)}buildLookaheadForOptional(e){return ci(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,is(e.prodType),ui)}}class Js{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:he.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,"maxLookahead")?e.maxLookahead:he.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,"lookaheadStrategy")?e.lookaheadStrategy:new fs({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=[],this.currRuleLookaheadFuncs=[]}preComputeLookaheadFunctions(e){e.forEach((s)=>{this.TRACE_INIT(`${s.name} Rule Lookahead`,()=>{let{alternation:n,repetition:r,option:a,repetitionMandatory:o,repetitionMandatoryWithSeparator:c,repetitionWithSeparator:h}=Ua(s);n.forEach((l)=>{let u=l.idx===0?"":l.idx;this.TRACE_INIT(`${fe(l)}${u}`,()=>{let p=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:s,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled});this.setLaFuncCache(this.fullRuleNameToShort[s.name],ds|l.idx,p)})}),r.forEach((l)=>{this.computeLookaheadFunc(s,l.idx,xt,"Repetition",l.maxLookahead,fe(l))}),a.forEach((l)=>{this.computeLookaheadFunc(s,l.idx,ps,"Option",l.maxLookahead,fe(l))}),o.forEach((l)=>{this.computeLookaheadFunc(s,l.idx,vt,"RepetitionMandatory",l.maxLookahead,fe(l))}),c.forEach((l)=>{this.computeLookaheadFunc(s,l.idx,lt,"RepetitionMandatoryWithSeparator",l.maxLookahead,fe(l))}),h.forEach((l)=>{this.computeLookaheadFunc(s,l.idx,Mt,"RepetitionWithSeparator",l.maxLookahead,fe(l))})})})}computeLookaheadFunc(e,s,n,r,a,o){this.TRACE_INIT(`${o}${s===0?"":s}`,()=>{let c=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:s,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r});this.setLaFuncCache(this.fullRuleNameToShort[e.name],n|s,c)})}setLaFuncCache(e,s,n){let r=this.lookAheadFuncsCache[e];if(r===void 0)r=[],this.lookAheadFuncsCache[e]=r;r[s]=n}}class bi extends pe{constructor(){super(...arguments);this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}var ms=new bi;function Ua(e){ms.reset(),e.accept(ms);let s=ms.dslMethods;return ms.reset(),s}function Zs(e,s){if(e.startOffset===-1)e.startOffset=s.startOffset,e.endOffset=s.endOffset;else if(e.endOffset<s.endOffset===!0)e.endOffset=s.endOffset}function Qs(e,s){if(e.startOffset===-1)e.startOffset=s.startOffset,e.startColumn=s.startColumn,e.startLine=s.startLine,e.endOffset=s.endOffset,e.endColumn=s.endColumn,e.endLine=s.endLine;else if(e.endOffset<s.endOffset===!0)e.endOffset=s.endOffset,e.endColumn=s.endColumn,e.endLine=s.endLine}function _i(e,s,n){if(e.children[n]===void 0)e.children[n]=[s];else e.children[n].push(s)}function xi(e,s,n){if(e.children[s]===void 0)e.children[s]=[n];else e.children[s].push(n)}function en(e,s){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:s})}function Pa(e,s){let n=Object.keys(e),r=n.length;for(let a=0;a<r;a++){let o=n[a],c=e[o],h=c.length;for(let l=0;l<h;l++){let u=c[l];if(u.tokenTypeIdx===void 0)this[u.name](u.children,s)}}}function vi(e,s){let n=function(){};en(n,e+"BaseSemantics");let r={visit:function(a,o){if(Array.isArray(a))a=a[0];if(a===void 0)return;return this[a.name](a.children,o)},validateVisitor:function(){let a=Da(this,s);if(a.length!==0){let o=a.map((c)=>c.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
87
- ${o.join(`
88
-
89
- `).replace(/\n/g,`
90
- `)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=s,n}function Mi(e,s,n){let r=function(){};en(r,e+"BaseSemanticsWithDefaults");let a=Object.create(n.prototype);return s.forEach((o)=>{a[o]=Pa}),r.prototype=a,r.prototype.constructor=r,r}var tn;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(tn||(tn={}));function Da(e,s){return Fa(e,s)}function Fa(e,s){return s.filter((a)=>typeof e[a]==="function"===!1).map((a)=>({msg:`Missing visitor method: <${a}> on ${e.constructor.name} CST Visitor.`,type:tn.MISSING_METHOD,methodName:a})).filter(Boolean)}class sn{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,"nodeLocationTracking")?e.nodeLocationTracking:he.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))if(this.recoveryEnabled)this.setNodeLocationFromToken=Qs,this.setNodeLocationFromNode=Qs,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery;else this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular;else if(/onlyOffset/i.test(this.nodeLocationTracking))if(this.recoveryEnabled)this.setNodeLocationFromToken=Zs,this.setNodeLocationFromNode=Zs,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery;else this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular;else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{};else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:-1,endOffset:-1}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:-1}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:-1,startLine:-1,startColumn:-1,endOffset:-1,endLine:-1,endColumn:-1}}setInitialNodeLocationFullRegular(e){let s=this.LA_FAST(1);e.location={startOffset:s.startOffset,startLine:s.startLine,startColumn:s.startColumn,endOffset:-1,endLine:-1,endColumn:-1}}cstInvocationStateUpdate(e){let s={name:e,children:Object.create(null)};this.setInitialNodeLocation(s),this.CST_STACK.push(s)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let s=this.LA(0),n=e.location;if(n.startOffset!==-1&&n.startOffset<=s.startOffset===!0)n.endOffset=s.endOffset,n.endLine=s.endLine,n.endColumn=s.endColumn;else n.startOffset=-1,n.startLine=-1,n.startColumn=-1}cstPostRuleOnlyOffset(e){let s=this.LA(0),n=e.location;if(n.startOffset!==-1&&n.startOffset<=s.startOffset===!0)n.endOffset=s.endOffset;else n.startOffset=-1}cstPostTerminal(e,s){let n=this.CST_STACK[this.CST_STACK.length-1];_i(n,s,e),this.setNodeLocationFromToken(n.location,s)}cstPostNonTerminal(e,s){let n=this.CST_STACK[this.CST_STACK.length-1];xi(n,s,e),this.setNodeLocationFromNode(n.location,e.location)}get currCSTNode(){let e=this;return e.CST_STACK[e.CST_STACK.length-1]}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let e=vi(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let e=Mi(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}}class nn{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){if(this.currIdx<=this.tokVectorLength-2)return this.consumeToken(),this.LA_FAST(1);else return we}LA_FAST(e){let s=this.currIdx+e;return this.tokVector[s]}LA(e){let s=this.currIdx+e;if(s<0||this.tokVectorLength<=s)return we;else return this.tokVector[s]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}}class rn{ACTION(e){return e.call(this)}consume(e,s,n){return this.consumeInternal(s,e,n)}subrule(e,s,n){return this.subruleInternal(s,e,n)}option(e,s){return this.optionInternal(s,e)}or(e,s){return this.orInternal(s,e)}many(e,s){return this.manyInternal(e,s)}atLeastOne(e,s){return this.atLeastOneInternal(e,s)}CONSUME(e,s){return this.consumeInternal(e,0,s)}CONSUME1(e,s){return this.consumeInternal(e,1,s)}CONSUME2(e,s){return this.consumeInternal(e,2,s)}CONSUME3(e,s){return this.consumeInternal(e,3,s)}CONSUME4(e,s){return this.consumeInternal(e,4,s)}CONSUME5(e,s){return this.consumeInternal(e,5,s)}CONSUME6(e,s){return this.consumeInternal(e,6,s)}CONSUME7(e,s){return this.consumeInternal(e,7,s)}CONSUME8(e,s){return this.consumeInternal(e,8,s)}CONSUME9(e,s){return this.consumeInternal(e,9,s)}SUBRULE(e,s){return this.subruleInternal(e,0,s)}SUBRULE1(e,s){return this.subruleInternal(e,1,s)}SUBRULE2(e,s){return this.subruleInternal(e,2,s)}SUBRULE3(e,s){return this.subruleInternal(e,3,s)}SUBRULE4(e,s){return this.subruleInternal(e,4,s)}SUBRULE5(e,s){return this.subruleInternal(e,5,s)}SUBRULE6(e,s){return this.subruleInternal(e,6,s)}SUBRULE7(e,s){return this.subruleInternal(e,7,s)}SUBRULE8(e,s){return this.subruleInternal(e,8,s)}SUBRULE9(e,s){return this.subruleInternal(e,9,s)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,s,n=ct){if(this.definedRulesNames.includes(e)){let o={message:ye.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ne.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);let r=this.defineRule(e,s,n);return this[e]=r,r}OVERRIDE_RULE(e,s,n=ct){let r=Si(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);let a=this.defineRule(e,s,n);return this[e]=a,a}BACKTRACK(e,s){var n;let r=(n=e.coreRule)!==null&&n!==void 0?n:e;return function(){this.isBackTrackingStack.push(1);let a=this.saveRecogState();try{return r.apply(this,s),!0}catch(o){if(Be(o))return!1;else throw o}finally{this.reloadRecogState(a),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Gt(Object.values(this.gastProductionsCache))}}class an{initRecognizerEngine(e,s){if(this.className=this.constructor.name,this.shortRuleNameToFull=[],this.fullRuleNameToShort={},this.ruleShortNameIdx=0,this.tokenMatcher=at,this.subruleIdx=0,this.currRuleShortName=-1,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(s,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
91
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
92
- For Further details.`);if(Array.isArray(e)){if(e.length===0)throw Error(`A Token Vocabulary cannot be empty.
93
- Note that the first argument for the parser constructor
94
- is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset==="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
95
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
96
- For Further details.`)}if(Array.isArray(e))this.tokensMap=e.reduce((a,o)=>(a[o.name]=o,a),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(Hn)){let a=Object.values(e.modes).flat(),o=[...new Set(a)];this.tokensMap=o.reduce((c,h)=>(c[h.name]=h,c),{})}else if(typeof e==="object"&&e!==null)this.tokensMap=Object.assign({},e);else throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=me;let r=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every((a)=>{var o;return((o=a.categoryMatches)===null||o===void 0?void 0:o.length)==0});this.tokenMatcher=r?at:xe,ve(Object.values(this.tokensMap))}defineRule(e,s,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
97
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let r=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:ct.resyncEnabled,a=Object.hasOwn(n,"recoveryValueFunc")?n.recoveryValueFunc:ct.recoveryValueFunc,o=this.ruleShortNameIdx++;this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let c;if(this.outputCst===!0)c=function(...p){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),s.apply(this,p);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,r,a)}finally{this.ruleFinallyStateUpdate()}};else c=function(...p){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),s.apply(this,p)}catch(f){return this.invokeRuleCatch(f,r,a)}finally{this.ruleFinallyStateUpdate()}};return Object.assign(function(...p){this.onBeforeParse(e);try{return c.apply(this,p)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:s,coreRule:c})}invokeRuleCatch(e,s,n){let r=this.RULE_STACK_IDX===0,a=s&&!this.isBackTracking()&&this.recoveryEnabled;if(Be(e)){let o=e;if(a){let c=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(c))if(o.resyncedTokens=this.reSyncTo(c),this.outputCst){let h=this.CST_STACK[this.CST_STACK.length-1];return h.recoveredNode=!0,h}else return n(e);else{if(this.outputCst){let h=this.CST_STACK[this.CST_STACK.length-1];h.recoveredNode=!0,o.partialCstResult=h}throw o}}else if(r)return this.moveToTerminatedState(),n(e);else throw o}else throw e}optionInternal(e,s){let n=ps|s;return this.optionInternalLogic(e,s,n)}optionInternalLogic(e,s,n){let r=this.currRuleLookaheadFuncs[n],a;if(typeof e!=="function"){a=e.DEF;let o=e.GATE;if(o!==void 0){let c=r;r=()=>o.call(this)&&c.call(this)}}else a=e;if(r.call(this)===!0)return a.call(this);return}atLeastOneInternal(e,s){let n=vt|e;return this.atLeastOneInternalLogic(e,s,n)}atLeastOneInternalLogic(e,s,n){let r=this.currRuleLookaheadFuncs[n],a;if(typeof s!=="function"){a=s.DEF;let o=s.GATE;if(o!==void 0){let c=r;r=()=>o.call(this)&&c.call(this)}}else a=s;if(r.call(this)===!0){let o=this.doSingleRepetition(a);while(r.call(this)===!0&&o===!0)o=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,z.REPETITION_MANDATORY,s.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,s],r,vt,e,Ks)}atLeastOneSepFirstInternal(e,s){let n=lt|e;this.atLeastOneSepFirstInternalLogic(e,s,n)}atLeastOneSepFirstInternalLogic(e,s,n){let{DEF:r,SEP:a}=s;if(this.currRuleLookaheadFuncs[n].call(this)===!0){r.call(this);let c=()=>this.tokenMatcher(this.LA_FAST(1),a);while(this.tokenMatcher(this.LA_FAST(1),a)===!0)this.CONSUME(a),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,c,r,ss],c,lt,e,ss)}else throw this.raiseEarlyExitException(e,z.REPETITION_MANDATORY_WITH_SEPARATOR,s.ERR_MSG)}manyInternal(e,s){let n=xt|e;return this.manyInternalLogic(e,s,n)}manyInternalLogic(e,s,n){let r=this.currRuleLookaheadFuncs[n],a;if(typeof s!=="function"){a=s.DEF;let c=s.GATE;if(c!==void 0){let h=r;r=()=>c.call(this)&&h.call(this)}}else a=s;let o=!0;while(r.call(this)===!0&&o===!0)o=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,s],r,xt,e,js,o)}manySepFirstInternal(e,s){let n=Mt|e;this.manySepFirstInternalLogic(e,s,n)}manySepFirstInternalLogic(e,s,n){let{DEF:r,SEP:a}=s;if(this.currRuleLookaheadFuncs[n].call(this)===!0){r.call(this);let c=()=>this.tokenMatcher(this.LA_FAST(1),a);while(this.tokenMatcher(this.LA_FAST(1),a)===!0)this.CONSUME(a),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,c,r,ts],c,Mt,e,ts)}}repetitionSepSecondInternal(e,s,n,r,a){while(n())this.CONSUME(s),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,n,r,a],n,lt,e,a)}doSingleRepetition(e){let s=this.getLexerPosition();return e.call(this),this.getLexerPosition()>s}orInternal(e,s){let n=ds|s,r=Array.isArray(e)?e:e.DEF,o=this.currRuleLookaheadFuncs[n].call(this,r);if(o!==void 0)return r[o].ALT.call(this);this.raiseNoAltException(s,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0)this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName];this.cstFinallyStateUpdate()}subruleInternal(e,s,n){let r;try{let a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=s,r=e.coreRule.apply(this,a),this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),r}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,s,n){if(Be(e)&&e.partialCstResult!==void 0)this.cstPostNonTerminal(e.partialCstResult,s!==void 0&&s.LABEL!==void 0?s.LABEL:n),delete e.partialCstResult;throw e}consumeInternal(e,s,n){let r;try{let a=this.LA_FAST(1);if(this.tokenMatcher(a,e)===!0)this.consumeToken(),r=a;else this.consumeInternalError(e,a,n)}catch(a){r=this.consumeInternalRecovery(e,s,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r),r}consumeInternalError(e,s,n){let r,a=this.LA(0);if(n!==void 0&&n.ERR_MSG)r=n.ERR_MSG;else r=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:s,previous:a,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ot(r,s,a))}consumeInternalRecovery(e,s,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let r=this.getFollowsForInRuleRecovery(e,s);try{return this.tryInRuleRecovery(e,r)}catch(a){if(a.name===Ys)throw n;else throw a}}else throw n}saveRecogState(){let e=this.errors,s=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:s,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);let s=e.RULE_STACK;for(let n=0;n<s.length;n++)this.RULE_STACK[n]=s[n];if(this.RULE_STACK_IDX=s.length-1,this.RULE_STACK_IDX>=0)this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName]}ruleInvocationStateUpdate(e,s,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[e],this.cstInvocationStateUpdate(s)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),me)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=-1,this.currRuleLookaheadFuncs=[],this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let s=0;s<this.maxLookahead+1;s++)this.tokVector.push(we)}onAfterParse(e){if(this.isAtEndOfInput()===!1){let s=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:s,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new hs(n,s))}while(this.tokVector.at(-1)===we)this.tokVector.pop()}}class on{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:he.errorMessageProvider}SAVE_ERROR(e){if(Be(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;else throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,s,n){let r=this.getCurrRuleFullName(),a=this.getGAstProductions()[r],c=bt(e,a,s,this.maxLookahead)[0],h=[];for(let u=1;u<=this.maxLookahead;u++)h.push(this.LA(u));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:c,actual:h,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new us(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,s){let n=this.getCurrRuleFullName(),r=this.getGAstProductions()[n],a=Ct(e,r,this.maxLookahead),o=[];for(let l=1;l<=this.maxLookahead;l++)o.push(this.LA(l));let c=this.LA(0),h=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:o,previous:c,customUserDescription:s,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ls(h,this.LA(1),c))}}var Ts={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Ts);var wi=!0,Ui=255,Di=g({name:"RECORDING_PHASE_TOKEN",pattern:V.NA});ve([Di]);var Fi=Ye(Di,`This IToken indicates the Parser is in Recording Phase
98
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Fi);var Ba={name:`This CSTNode indicates the Parser is in Recording Phase
99
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class ln{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let s=e>0?e:"";this[`CONSUME${s}`]=function(n,r){return this.consumeInternalRecord(n,e,r)},this[`SUBRULE${s}`]=function(n,r){return this.subruleInternalRecord(n,e,r)},this[`OPTION${s}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${s}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${s}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${s}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${s}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${s}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,s,n){return this.consumeInternalRecord(s,e,n)},this.subrule=function(e,s,n){return this.subruleInternalRecord(s,e,n)},this.option=function(e,s){return this.optionInternalRecord(s,e)},this.or=function(e,s){return this.orInternalRecord(s,e)},this.many=function(e,s){this.manyInternalRecord(e,s)},this.atLeastOne=function(e,s){this.atLeastOneInternalRecord(e,s)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let s=0;s<10;s++){let n=s>0?s:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,s){return()=>!0}LA_RECORD(e){return we}topLevelRuleRecord(e,s){try{let n=new de({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),s.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
100
- This error was thrown during the "grammar recording phase" For more info see:
101
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(r){throw n}throw n}}optionInternalRecord(e,s){return wt.call(this,j,e,s)}atLeastOneInternalRecord(e,s){wt.call(this,Z,s,e)}atLeastOneSepFirstInternalRecord(e,s){wt.call(this,Q,s,e,wi)}manyInternalRecord(e,s){wt.call(this,U,s,e)}manySepFirstInternalRecord(e,s){wt.call(this,q,s,e,wi)}orInternalRecord(e,s){return $a.call(this,e,s)}subruleInternalRecord(e,s,n){if(Es(s),!e||!Object.hasOwn(e,"ruleName")){let c=Error(`<SUBRULE${Pi(s)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
102
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw c.KNOWN_RECORDER_ERROR=!0,c}let r=this.recordingProdStack.at(-1),a=e.ruleName,o=new B({idx:s,nonTerminalName:a,label:n===null||n===void 0?void 0:n.LABEL,referencedRule:void 0});return r.definition.push(o),this.outputCst?Ba:Ts}consumeInternalRecord(e,s,n){if(Es(s),!Bs(e)){let o=Error(`<CONSUME${Pi(s)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
103
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}let r=this.recordingProdStack.at(-1),a=new v({idx:s,terminalType:e,label:n===null||n===void 0?void 0:n.LABEL});return r.definition.push(a),Fi}}function wt(e,s,n,r=!1){Es(n);let a=this.recordingProdStack.at(-1),o=typeof s==="function"?s:s.DEF,c=new e({definition:[],idx:n});if(r)c.separator=s.SEP;if(Object.hasOwn(s,"MAX_LOOKAHEAD"))c.maxLookahead=s.MAX_LOOKAHEAD;return this.recordingProdStack.push(c),o.call(this),a.definition.push(c),this.recordingProdStack.pop(),Ts}function $a(e,s){Es(s);let n=this.recordingProdStack.at(-1),r=Array.isArray(e)===!1,a=r===!1?e:e.DEF,o=new J({definition:[],idx:s,ignoreAmbiguities:r&&e.IGNORE_AMBIGUITIES===!0});if(Object.hasOwn(e,"MAX_LOOKAHEAD"))o.maxLookahead=e.MAX_LOOKAHEAD;let c=a.some((h)=>typeof h.GATE==="function");return o.hasPredicates=c,n.definition.push(o),a.forEach((h)=>{let l=new W({definition:[]});if(o.definition.push(l),Object.hasOwn(h,"IGNORE_AMBIGUITIES"))l.ignoreAmbiguities=h.IGNORE_AMBIGUITIES;else if(Object.hasOwn(h,"GATE"))l.ignoreAmbiguities=!0;this.recordingProdStack.push(l),h.ALT.call(this),this.recordingProdStack.pop()}),Ts}function Pi(e){return e===0?"":`${e}`}function Es(e){if(e<0||e>Ui){let s=Error(`Invalid DSL Method idx value: <${e}>
104
- Idx value must be a none negative value smaller than ${Ui+1}`);throw s.KNOWN_RECORDER_ERROR=!0,s}}class cn{initPerformanceTracer(e){if(Object.hasOwn(e,"traceInitPerf")){let s=e.traceInitPerf,n=typeof s==="number";this.traceInitMaxIdent=n?s:1/0,this.traceInitPerf=n?s>0:s}else this.traceInitMaxIdent=0,this.traceInitPerf=he.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,s){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join("\t");if(this.traceInitIndent<this.traceInitMaxIdent)console.log(`${n}--> <${e}>`);let{time:r,value:a}=gt(s),o=r>10?console.warn:console.log;if(this.traceInitIndent<this.traceInitMaxIdent)o(`${n}<-- <${e}> time: ${r}ms`);return this.traceInitIndent--,a}else return s()}}function Bi(e,s){s.forEach((n)=>{let r=n.prototype;Object.getOwnPropertyNames(r).forEach((a)=>{if(a==="constructor")return;let o=Object.getOwnPropertyDescriptor(r,a);if(o&&(o.get||o.set))Object.defineProperty(e.prototype,a,o);else e.prototype[a]=n.prototype[a]})})}var we=Ye(me,"",-1,-1,-1,-1,-1,-1);Object.freeze(we);var he=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:es,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ct=Object.freeze({recoveryValueFunc:()=>{return},resyncEnabled:!0}),ne;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ne||(ne={}));class Ut{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let s=this.className;this.TRACE_INIT("toFastProps",()=>{At(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach((r)=>{let o=this[r].originalGrammarAction,c;this.TRACE_INIT(`${r} Rule`,()=>{c=this.topLevelRuleRecord(r,o)}),this.gastProductionsCache[r]=c})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Ni({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(n.length===0&&this.skipValidations===!1){let r=Ii({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:ye,grammarName:s}),a=Ei({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:s});this.definitionErrors=this.definitionErrors.concat(r,a)}}),this.definitionErrors.length===0){if(this.recoveryEnabled)this.TRACE_INIT("computeAllProdsFollows",()=>{let r=kn(Object.values(this.gastProductionsCache));this.resyncFollows=r});this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var r,a;(a=(r=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(r,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})}if(!Ut.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw e=this.definitionErrors.map((r)=>r.message),Error(`Parser Definition Errors detected:
105
- ${e.join(`
106
- -------------------------------
107
- `)}`)})}constructor(e,s){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(s),n.initLexerAdapter(),n.initLooksAhead(s),n.initRecognizerEngine(e,s),n.initRecoverable(s),n.initTreeBuilder(s),n.initGastRecorder(s),n.initPerformanceTracer(s),Object.hasOwn(s,"ignoredIssues"))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
108
- Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
109
- See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
110
- For further details.`);this.skipValidations=Object.hasOwn(s,"skipValidations")?s.skipValidations:he.skipValidations}}Ut.DEFER_DEFINITION_ERRORS_HANDLING=!1;Bi(Ut,[qs,Js,sn,nn,an,rn,on,ln,cn]);class gs extends Ut{constructor(e,s=he){let n=Object.assign({},s);n.outputCst=!0;super(e,n)}}var ut=t((e)=>e!==void 0&&e>=0,"isKnownLocation");function Xi(e,s){let n=e.lexer.tokenize(s);if(n.errors.length>0){let a=n.errors[0],o=ut(a.offset)?a.offset:s.length,c=o+(ut(a.length)?a.length:0);throw Error(`Error lexing ${e.diagramType} diagram: ${a.message} at line ${a.line??1}, column ${a.column??1} [${o},${c})`)}e.parser.input=n.tokens;let r=e.entry();if(e.parser.errors.length>0)throw Error(`Error parsing ${e.diagramType} diagram: ${e.parser.errors[0].message}`);e.visit(r)}t(Xi,"runChevrotainParse");var X={SOLID_ARROW:0,BACK_ARROW:1,LINE_SOLID:2,CIRCLE_ARROW:3,CROSS_ARROW:4,CIRCLE_ARROW_REVERSED:5,CROSS_ARROW_REVERSED:6},Wa="LR",ja=F.usecase,Tn=t(()=>({actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,symbols:new Map,direction:Wa,relationshipCounter:0,noteCounter:0,accTitle:"",accDescription:"",ast:void 0,config:structuredClone(ja)}),"createModel"),Ka=t((e)=>{if(!(e.actors instanceof Map)||!(e.useCases instanceof Map)||!(e.systemBoundaries instanceof Map)||!Array.isArray(e.relationships)||!(e.notes instanceof Map)||!(e.jsonNodes instanceof Map)||!(e.classDefs instanceof Map)||!(e.symbols instanceof Map)||!["TB","TD","BT","RL","LR"].includes(e.direction)||!Number.isSafeInteger(e.relationshipCounter)||e.relationshipCounter<0||!Number.isSafeInteger(e.noteCounter)||e.noteCounter<0||typeof e.accTitle!=="string"||typeof e.accDescription!=="string"||!e.config)throw Error("Cannot commit an incomplete usecase model")},"assertCompleteModel"),w=Tn(),Va=t(()=>structuredClone(w.config),"getConfig"),za=t(()=>w.ast,"getAST"),Ha=t((e)=>{let s=structuredClone(e);Ka(s);let n=P(),r=I();try{M(s.accTitle),R(s.accDescription),w=s}catch(a){throw M(n),R(r),a}},"commit"),Xa=t(()=>{w=Tn(),N()},"clear"),Ya=t(()=>w.actors,"getActors"),qa=t((e)=>w.actors.get(e),"getActor"),Ja=t(()=>w.useCases,"getUseCases"),Za=t((e)=>w.useCases.get(e),"getUseCase"),Qa=t(()=>w.systemBoundaries,"getSystemBoundaries"),eo=t((e)=>w.systemBoundaries.get(e),"getSystemBoundary"),to=t(()=>w.relationships,"getRelationships"),so=t(()=>w.notes,"getNotes"),no=t((e)=>w.notes.get(e),"getNote"),io=t(()=>w.jsonNodes,"getJsonNodes"),ro=t((e)=>w.jsonNodes.get(e),"getJsonNode"),ao=t(()=>w.classDefs,"getClassDefs"),oo=t((e)=>w.classDefs.get(e),"getClassDef"),Yi=t(()=>w.direction,"getDirection"),Je=t((e)=>{let s=new Map;for(let n of["default",...e]){let r=w.classDefs.get(n);if(!r)continue;for(let a of r.styles){let o=a.trim(),c=o.indexOf(":"),h=(c===-1?o:o.slice(0,c)).trim();if(h)s.set(h,o)}}return[...s.values()]},"getCompiledStyles"),lo=t((e)=>e.replaceAll("~","~0").replaceAll("/","~1"),"escapeJsonPointerPart"),$i=t((e)=>typeof e==="string"?e:e===null?"null":String(e),"displayJsonScalar"),co=t((e,s,n=(r)=>r)=>{let r=[],a=t((c,h,l)=>{r.push({key:n(c),accessibleKey:n(h),value:n(l)})},"append"),o=t((c,h,l)=>{if(Array.isArray(c)){if(c.length===0){a(h,h,"[]");return}if(c.every((p)=>p===null||["string","number","boolean"].includes(typeof p))){for(let[p,f]of c.entries())a(p===0?h:"",h,$i(f));return}for(let[p,f]of c.entries())o(f,`${h}[${p}]`,`${l}/${p}`);return}if(c!==null&&typeof c==="object"){let u=c,p=s[l]??Object.keys(u);if(p.length===0){a(h,h,"{}");return}for(let f of p){let E=h?`${h}.${f}`:f;o(u[f],E,`${l}/${lo(f)}`)}return}a(h,h,$i(c))},"visit");return o(e,"",""),r},"flattenJsonRows"),ho=t((e)=>{switch(e.type){case"hollow":return"usecaseActorHollow";case"awesome":return"usecaseActorAwesome";case"icon":return"usecaseActorIcon";case"normal":return"usecaseActor"}},"actorShape"),uo=t((e)=>{if(e.shape==="ellipse")return e.business?"usecaseBusiness":"usecaseEllipse";return e.shape},"useCaseShape"),po=t((e)=>{switch(e){case X.SOLID_ARROW:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_point"};case X.BACK_ARROW:return{arrowTypeStart:"arrow_point",arrowTypeEnd:"none"};case X.CIRCLE_ARROW:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_circle"};case X.CROSS_ARROW:return{arrowTypeStart:"none",arrowTypeEnd:"arrow_cross"};case X.CIRCLE_ARROW_REVERSED:return{arrowTypeStart:"arrow_circle",arrowTypeEnd:"none"};case X.CROSS_ARROW_REVERSED:return{arrowTypeStart:"arrow_cross",arrowTypeEnd:"none"};case X.LINE_SOLID:return{arrowTypeStart:"none",arrowTypeEnd:"none"}}},"associationMarkers"),fo=t((e)=>{switch(e.type){case"include":case"extend":return{arrowTypeStart:"none",arrowTypeEnd:"arrow_point",pattern:"dotted",label:e.type,labelType:"text"};case"generalization":return{arrowTypeStart:"none",arrowTypeEnd:"extension",pattern:"solid"};case"association":return{...po(e.arrowType),pattern:"solid",...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},"relationshipVisuals"),mo=t((e)=>e.animate||e.animation?[`edge-animation-${e.animation??"fast"}`]:[],"animationClasses"),Pt=t((...e)=>e.filter((s)=>Boolean(s)).join(" "),"classNames"),Eo=t(()=>{let e=d(),s={...w.config,...e.usecase},n=t((l)=>G(l,e),"sanitize"),r=t((l)=>n(w.actors.get(l)?.label??w.useCases.get(l)?.label??w.jsonNodes.get(l)?.id??w.notes.get(l)?.label??l),"endpointLabel"),a=[],o=[],c=0,h=0;for(let l of w.actors.values())a.push({id:l.id,label:n(l.label),labelType:l.labelType,shape:ho(l),isGroup:!1,padding:10,look:e.look,colorIndex:c++,cssClasses:Pt("default","usecase-actor",`usecase-actor-${l.type}`,l.business&&"usecase-business",...l.classes),cssStyles:[...l.styles],cssCompiledStyles:Je(l.classes),actorType:l.type,business:l.business,...l.icon?{icon:l.icon}:{},...l.stereotype?{stereotype:n(l.stereotype)}:{},...l.parentId?{parentId:l.parentId}:{}});for(let l of w.useCases.values())a.push({id:l.id,label:n(l.label),labelType:l.labelType,shape:uo(l),isGroup:!1,padding:l.shape==="ellipse"?20:10,look:e.look,colorIndex:c++,cssClasses:Pt("default","usecase-element",`usecase-${l.shape}`,l.business&&"usecase-business",...l.classes),cssStyles:[...l.styles],cssCompiledStyles:Je(l.classes),business:l.business,...l.stereotype?{stereotype:n(l.stereotype)}:{},...l.parentId?{parentId:l.parentId}:{}});for(let l of w.notes.values())a.push({id:l.id,label:n(l.label),labelType:l.labelType,shape:"note",isGroup:!1,padding:10,look:e.look,cssClasses:"default usecase-note",cssStyles:[],cssCompiledStyles:Je([]),noteTarget:l.target,noteTargetLabel:n(w.actors.get(l.target)?.label??w.useCases.get(l.target)?.label??w.jsonNodes.get(l.target)?.id??l.target)});for(let l of w.jsonNodes.values())a.push({id:l.id,label:n(l.id),labelType:"text",shape:"usecaseJsonTable",isGroup:!1,padding:10,look:e.look,cssClasses:Pt("default","usecase-json-table",...l.classes),cssStyles:[...l.styles],cssCompiledStyles:Je(l.classes),jsonRows:co(l.value,l.propertyOrder,n)});for(let l of w.systemBoundaries.values())a.push({id:l.id,label:n(l.label),labelType:l.labelType,shape:"usecaseSystemBoundary",isGroup:!0,padding:20,look:e.look,colorIndex:h++,cssClasses:Pt("default","system-boundary",`system-boundary-${l.type}`,...l.classes),cssStyles:[...l.styles],cssCompiledStyles:Je(l.classes),boundaryType:l.type});for(let l of w.relationships){let{label:u,...p}=fo(l);o.push({id:l.id,start:l.source,end:l.target,source:l.source,target:l.target,sourceLabel:r(l.source),targetLabel:r(l.target),type:"edge",relationshipType:l.type,internal:!1,...p,...u!==void 0?{label:n(u)}:{},labelpos:"c",classes:Pt("default","relationship",`relationship-${l.type}`,...l.classes,...mo(l)),style:[...l.styles],cssCompiledStyles:Je(l.classes),animate:l.animate,...l.animation?{animation:l.animation}:{},look:e.look,thickness:"normal",minlen:l.minlen,isUserDefinedId:l.explicitId})}for(let l of w.notes.values())o.push({id:`${l.id}-edge`,start:l.id,end:l.target,source:l.id,target:l.target,type:"edge",relationshipType:"note",sourceLabel:r(l.id),targetLabel:r(l.target),internal:!0,pattern:"dotted",arrowTypeStart:"none",arrowTypeEnd:"none",labelpos:"c",classes:"default relationship relationship-note",style:[],cssCompiledStyles:Je([]),animate:!1,look:e.look,thickness:"normal",minlen:1,isUserDefinedId:!1});for(let l of a){if(l.wrappingWidth??=s.wrappingWidth,!l.isGroup&&!l.shape.startsWith("usecaseActor"))l.minWidth??=s.minNodeWidth;if(l.shape==="usecaseEllipse"||l.shape==="usecaseBusiness")l.spreadPorts=!0}return{nodes:a,edges:o,config:e,type:"usecase",layoutAlgorithm:"dagre",direction:Yi(),nodeSpacing:s.nodeSpacing,rankSpacing:s.rankSpacing,actorFontSize:s.actorFontSize,actorFontFamily:s.actorFontFamily,actorFontWeight:s.actorFontWeight,usecaseFontSize:s.usecaseFontSize,usecaseFontFamily:s.usecaseFontFamily,usecaseFontWeight:s.usecaseFontWeight,diagramPadding:s.diagramPadding,useMaxWidth:s.useMaxWidth,markers:["point","circle","cross","extension"]}},"getData"),Ns={getConfig:Va,createModel:Tn,commit:Ha,getAST:za,clear:Xa,setDiagramTitle:O,getDiagramTitle:D,setAccTitle:M,getAccTitle:P,setAccDescription:R,getAccDescription:I,getActors:Ya,getActor:qa,getUseCases:Ja,getUseCase:Za,getSystemBoundaries:Qa,getSystemBoundary:eo,getRelationships:to,getNotes:so,getNote:no,getJsonNodes:io,getJsonNode:ro,getClassDefs:ao,getClassDef:oo,getDirection:Yi,getData:Eo};function Qe(e,s,n){let r=[n];return r.index=s,r.input=e,r}t(Qe,"customMatch");var To=t((e,s)=>{if(e[s]!=='"'||e[s+1]!=="`")return null;for(let n=s+2;n<e.length-1;n++)if(e[n]==="`"&&e[n+1]==='"')return Qe(e,s,e.slice(s,n+2));return null},"matchMarkdownString"),go=t((e,s)=>{if(e[s]!=="%"||e[s+1]!=="%")return null;for(let r=s-1;r>=0;r--){let a=e[r];if(a===`
111
- `||a==="\r")break;if(a!==" "&&a!=="\t")return null}let n=s+2;while(n<e.length&&e[n]!==`
112
- `&&e[n]!=="\r")n++;return Qe(e,s,e.slice(s,n))},"matchComment"),qi=t((e,s)=>{for(let n=s-1;n>=0;n--){let r=e[n];if(r===`
113
- `||r==="\r")return!0;if(r!==" "&&r!=="\t")return!1}return!0},"isIndentedLineStart"),Ji=t((e,s,n)=>{if(!qi(e,s))return null;let r=n.exec(e.slice(s));return r?Qe(e,s,r[0]):null},"matchAccessibilityLine"),Ao=t((e,s)=>{if(!qi(e,s))return null;let n=/^accDescr[\t ]*{/.exec(e.slice(s));if(!n)return null;let r=e.indexOf("}",s+n[0].length);return r===-1?null:Qe(e,s,e.slice(s,r+1))},"matchAccDescrBlock"),So=t((e,s)=>{if(e[s]!=="{")return null;let n=0,r=!1,a=!1;for(let o=s;o<e.length;o++){let c=e[o];if(r){if(a)a=!1;else if(c==="\\")a=!0;else if(c==='"')r=!1;continue}if(c==='"')r=!0;else if(c==="{")n++;else if(c==="}"&&--n===0)return Qe(e,s,e.slice(s,o+1))}return null},"matchJsonObject"),Ro=t((e,s)=>{let n=e.indexOf(">>",s);if(n===-1||/[\n\r]/.test(e.slice(s,n)))return null;let r=e.slice(s,n);return r.trim()?Qe(e,s,r):null},"matchStereotypeText"),ie=g({name:"LABEL_TEXT",pattern:V.NA}),dt=g({name:"WORD",pattern:V.NA,categories:ie}),gn=g({name:"NUMBER",pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:ie}),Y=g({name:"IDENTIFIER",pattern:/\w+/,longer_alt:gn,categories:dt}),yo=g({name:"HWS",pattern:/[\t ]+/,group:V.SKIPPED}),De=g({name:"MARKDOWN_STRING",pattern:To,start_chars_hint:['"'],line_breaks:!0}),Oo=g({name:"UNCLOSED_MARKDOWN_STRING",pattern:/"`[^]*/,line_breaks:!0}),un=g({name:"COMMENT",pattern:go,start_chars_hint:["%"],line_breaks:!1}),Pe=g({name:"NEWLINE",pattern:/\r\n|\n|\r/,line_breaks:!0}),Zi=g({name:"ACC_DESCR_BLOCK",pattern:Ao,start_chars_hint:["a"],line_breaks:!0}),Lo=/^accTitle[\t ]*:[^\n\r]*/,No=/^accDescr[\t ]*:[^\n\r]*/,Qi=g({name:"ACC_TITLE_LINE",pattern:t((e,s)=>Ji(e,s,Lo),"pattern"),start_chars_hint:["a"],line_breaks:!1}),er=g({name:"ACC_DESCR_LINE",pattern:t((e,s)=>Ji(e,s,No),"pattern"),start_chars_hint:["a"],line_breaks:!1}),tr=g({name:"JSON_DECLARATION_START",pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:"jsonBody"}),An=g({name:"JSON_OBJECT_LITERAL",pattern:So,start_chars_hint:["{"],line_breaks:!0,pop_mode:!0}),sr=g({name:"UNCLOSED_JSON_OBJECT_LITERAL",pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),ee=t((e,s)=>g({name:e,pattern:s,longer_alt:Y,categories:dt}),"keyword"),nr=ee("USECASE",/usecase-beta/),dn=ee("ACTOR",/actor/),ir=ee("SYSTEM_BOUNDARY",/systemBoundary/),rr=ee("END",/end/),ar=ee("DIRECTION",/direction/),or=ee("TD",/TD/),lr=ee("TB",/TB/),cr=ee("BT",/BT/),hr=ee("LR",/LR/),ur=ee("RL",/RL/),dr=ee("NOTE",/note/),pr=ee("FOR",/for/),Io=ee("JSON",/json/),fr=ee("CLASS_DEF",/classDef/),mr=ee("CLASS",/class/),Er=ee("STYLE",/style/),Tr=ee("INCLUDE",/include/i),gr=ee("EXTEND",/extend/i),Ar=ee("TRUE",/true/),Sr=ee("FALSE",/false/),Rr=g({name:"GENERALIZATION",pattern:/--\|>/}),yr=g({name:"DEPENDENCY_ARROW",pattern:/\.\.>/}),Or=g({name:"STEREOTYPE_START",pattern:/<</,push_mode:"stereotype"}),Sn=g({name:"STEREOTYPE_END",pattern:/>>/,pop_mode:!0}),Rn=g({name:"STEREOTYPE_TEXT",pattern:Ro,line_breaks:!1}),Lr=g({name:"UNCLOSED_STEREOTYPE_TEXT",pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),Nr=g({name:"CLASS_SEPARATOR",pattern:/:::/}),As=g({name:"FORWARD_SOLID",pattern:/--+>/}),Ir=g({name:"BACKWARD_SOLID",pattern:/<--+/}),Ss=g({name:"FORWARD_CIRCLE",pattern:/--o/}),kr=g({name:"BACKWARD_CIRCLE",pattern:/o--/}),Rs=g({name:"FORWARD_CROSS",pattern:/--x/}),Cr=g({name:"BACKWARD_CROSS",pattern:/x--/}),Ae=g({name:"MARKERLESS_SOLID",pattern:/--+/}),pn=g({name:"METADATA_START",pattern:/@{/}),ys=g({name:"AT",pattern:/@/,categories:ie}),br=g({name:"LBRACE",pattern:/{/}),fn=g({name:"RBRACE",pattern:/}/}),Os=g({name:"LBRACKET",pattern:/\[/}),Ls=g({name:"RBRACKET",pattern:/]/}),Dt=g({name:"LPAREN",pattern:/\(/}),Ft=g({name:"RPAREN",pattern:/\)/}),Le=g({name:"COMMA",pattern:/,/,categories:ie}),Bt=g({name:"COLON",pattern:/:/,categories:ie}),_r=g({name:"HASH_COLOR",pattern:/#[\dA-Fa-f]+/,categories:ie}),Se=g({name:"PLAIN_STRING",pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),mn=g({name:"CSS_IDENTIFIER",pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:ie}),xr=g({name:"CSS_ESCAPED_COMMA",pattern:/\\,/,categories:ie}),vr=g({name:"DASH",pattern:/-/,categories:ie}),Mr=g({name:"DOT",pattern:/\./,categories:ie}),wr=g({name:"PERCENT",pattern:/%/,categories:ie}),Ur=g({name:"CSS_PUNCTUATION",pattern:/[!#$&*+/=?^_|~]/,categories:ie}),ko=g({name:"LABEL_PUNCTUATION",pattern:/[;<>\\`]/,categories:ie}),Co=g({name:"LABEL_SYMBOL",pattern:/[^\t\n\r !-~]+/,categories:ie}),Pr=[ie,dt,yo,De,Oo,un,Pe,Zi,Qi,er,tr,nr,dn,ir,rr,ar,or,lr,cr,hr,ur,dr,pr,Io,fr,mr,Er,Tr,gr,Ar,Sr,Rr,yr,Or,Nr,As,Ir,Ss,kr,Rs,Cr,Ae,pn,ys,br,fn,Os,Ls,Dt,Ft,Le,Bt,_r,Se,mn,Y,gn,xr,vr,Mr,wr,Ur,ko,Co],bo={defaultMode:"defaultMode",modes:{defaultMode:[...Pr],jsonBody:[An,sr],stereotype:[Sn,Rn,Lr]}},_o=[...Pr,An,sr,Sn,Rn,Lr],xo=new V(bo),Gi=t((e)=>It(e,ie)||e.tokenType===Se||e.tokenType===De,"isLabelToken"),vo={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},Mo=class extends gs{static{t(this,"UsecaseParser")}constructor(){super(_o,{nodeLocationTracking:"full"});this.RULE("start",()=>{this.CONSUME(nr),this.SUBRULE(this.lineEnd),this.MANY(()=>this.SUBRULE(this.line))}),this.RULE("line",()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.blankLine),"ALT")},{ALT:t(()=>this.SUBRULE(this.commentLine),"ALT")},{GATE:t(()=>this.isStatementStart(),"GATE"),ALT:t(()=>this.SUBRULE(this.statement),"ALT")}])}),this.RULE("statement",()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.accTitleStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.accDescrStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.directionStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.actorStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.systemBoundaryStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.noteStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.jsonStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.classDefStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.classStatement),"ALT")},{ALT:t(()=>this.SUBRULE(this.styleStatement),"ALT")},{GATE:t(()=>this.isMetadataAssignment(),"GATE"),ALT:t(()=>this.SUBRULE(this.metadataAssignmentStatement),"ALT")},{GATE:t(()=>!this.isForbiddenPlantUmlStatement(),"GATE"),ALT:t(()=>this.SUBRULE(this.entityStatement),"ALT")}])}),this.RULE("lineEnd",()=>{this.OR([{ALT:t(()=>this.CONSUME(Pe),"ALT")},{ALT:t(()=>this.CONSUME(me),"ALT")}])}),this.RULE("blankLine",()=>{this.CONSUME(Pe)}),this.RULE("commentLine",()=>{this.CONSUME(un),this.SUBRULE(this.lineEnd)}),this.RULE("accTitleStatement",()=>{this.CONSUME(Qi),this.SUBRULE(this.lineEnd)}),this.RULE("accDescrStatement",()=>{this.OR([{ALT:t(()=>this.CONSUME(er),"ALT")},{ALT:t(()=>this.CONSUME(Zi),"ALT")}]),this.SUBRULE(this.lineEnd)}),this.RULE("actorStatement",()=>{this.CONSUME(dn),this.SUBRULE(this.actorItem),this.OPTION(()=>{this.OR([{ALT:t(()=>this.AT_LEAST_ONE(()=>{this.CONSUME(Le),this.SUBRULE2(this.actorItem)}),"ALT")},{ALT:t(()=>this.SUBRULE(this.relationTail),"ALT")}])}),this.SUBRULE(this.lineEnd)}),this.RULE("actorItem",()=>{this.SUBRULE(this.actorName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.stereotype)),this.OPTION3(()=>this.SUBRULE(this.classSuffix))}),this.RULE("actorName",()=>{this.OR([{ALT:t(()=>{this.CONSUME(Y),this.OPTION(()=>{this.CONSUME(Dt),this.SUBRULE(this.nodeLabel),this.CONSUME(Ft)})},"ALT")},{ALT:t(()=>this.CONSUME(Se),"ALT")},{ALT:t(()=>this.CONSUME(De),"ALT")}])}),this.RULE("actorDeclarationOnly",()=>{this.CONSUME(dn),this.SUBRULE(this.actorItem),this.MANY(()=>{this.CONSUME(Le),this.SUBRULE2(this.actorItem)}),this.SUBRULE(this.lineEnd)}),this.RULE("entityStatement",()=>{this.SUBRULE(this.entityName),this.OPTION(()=>this.SUBRULE(this.relationTail)),this.SUBRULE(this.lineEnd)}),this.RULE("entityName",()=>{this.OR([{ALT:t(()=>{this.CONSUME(Y),this.OPTION(()=>{this.OR2([{ALT:t(()=>{this.CONSUME(Dt),this.SUBRULE(this.nodeLabel),this.CONSUME(Ft)},"ALT")},{ALT:t(()=>{this.CONSUME(Os),this.SUBRULE2(this.nodeLabel),this.CONSUME(Ls)},"ALT")}])})},"ALT")},{ALT:t(()=>this.CONSUME(Se),"ALT")},{ALT:t(()=>this.CONSUME(De),"ALT")}]),this.OPTION2(()=>this.SUBRULE(this.useCaseMetadata)),this.OPTION3(()=>this.SUBRULE(this.stereotype)),this.OPTION4(()=>this.SUBRULE(this.classSuffix))}),this.RULE("nodeLabel",()=>{this.OR([{ALT:t(()=>this.CONSUME(Se),"ALT")},{ALT:t(()=>this.CONSUME(De),"ALT")},{ALT:t(()=>this.AT_LEAST_ONE(()=>this.CONSUME(ie)),"ALT")}])}),this.RULE("useCaseMetadata",()=>{this.SUBRULE(this.metadata)}),this.RULE("relationTail",()=>{this.OPTION({GATE:t(()=>this.LA(1).tokenType===Y&&this.LA(2).tokenType===ys,"GATE"),DEF:t(()=>{this.CONSUME(Y),this.CONSUME(ys)},"DEF")}),this.SUBRULE(this.arrow),this.SUBRULE(this.entityName)}),this.RULE("arrow",()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.semanticRelation),"ALT")},{ALT:t(()=>this.SUBRULE(this.forwardSolidOperator),"ALT")},{ALT:t(()=>this.SUBRULE(this.backwardSolidOperator),"ALT")},{ALT:t(()=>this.SUBRULE(this.markerlessSolidOperator),"ALT")},{ALT:t(()=>this.SUBRULE(this.forwardCircleOperator),"ALT")},{ALT:t(()=>this.SUBRULE(this.backwardCircleOperator),"ALT")},{ALT:t(()=>this.SUBRULE(this.forwardCrossOperator),"ALT")},{ALT:t(()=>this.SUBRULE(this.backwardCrossOperator),"ALT")}])}),this.RULE("forwardSolidOperator",()=>{this.CONSUME(As)}),this.RULE("backwardSolidOperator",()=>{this.CONSUME(Ir),this.OPTION({GATE:t(()=>this.LA(0).image==="<--"&&this.hasLabeledRight([Ae]),"GATE"),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Ae)},"DEF")})}),this.RULE("markerlessSolidOperator",()=>{this.CONSUME(Ae),this.OPTION({GATE:t(()=>this.LA(0).image==="--"&&this.hasLabeledRight([As,Ae,Ss,Rs]),"GATE"),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:t(()=>this.CONSUME(As),"ALT")},{ALT:t(()=>this.CONSUME2(Ae),"ALT")},{ALT:t(()=>this.CONSUME(Ss),"ALT")},{ALT:t(()=>this.CONSUME(Rs),"ALT")}])},"DEF")})}),this.RULE("forwardCircleOperator",()=>{this.CONSUME(Ss)}),this.RULE("backwardCircleOperator",()=>{this.CONSUME(kr),this.OPTION({GATE:t(()=>this.hasLabeledRight([Ae]),"GATE"),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Ae)},"DEF")})}),this.RULE("forwardCrossOperator",()=>{this.CONSUME(Rs)}),this.RULE("backwardCrossOperator",()=>{this.CONSUME(Cr),this.OPTION({GATE:t(()=>this.hasLabeledRight([Ae]),"GATE"),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Ae)},"DEF")})}),this.RULE("edgeLabel",()=>{this.OR([{ALT:t(()=>this.CONSUME(Se),"ALT")},{ALT:t(()=>this.CONSUME(De),"ALT")},{ALT:t(()=>this.AT_LEAST_ONE(()=>this.CONSUME(ie)),"ALT")}])}),this.RULE("semanticRelation",()=>{this.OR([{ALT:t(()=>{this.CONSUME(yr),this.CONSUME(Bt),this.OR2([{ALT:t(()=>this.CONSUME(Tr),"ALT")},{ALT:t(()=>this.CONSUME(gr),"ALT")}])},"ALT")},{ALT:t(()=>this.CONSUME(Rr),"ALT")}])}),this.RULE("metadata",()=>{this.CONSUME(pn),this.MANY(()=>this.CONSUME(Pe)),this.OPTION(()=>{this.SUBRULE(this.metadataProperty),this.MANY2(()=>{this.SUBRULE(this.metadataSeparator),this.SUBRULE2(this.metadataProperty)}),this.OPTION2(()=>this.CONSUME(Le)),this.MANY3(()=>this.CONSUME2(Pe))}),this.CONSUME(fn)}),this.RULE("metadataProperty",()=>{this.OR([{ALT:t(()=>this.CONSUME(Y),"ALT")},{ALT:t(()=>this.CONSUME(Se),"ALT")}]),this.CONSUME(Bt),this.OR2([{ALT:t(()=>this.CONSUME2(Y),"ALT")},{ALT:t(()=>this.CONSUME2(Se),"ALT")},{ALT:t(()=>this.CONSUME(Ar),"ALT")},{ALT:t(()=>this.CONSUME(Sr),"ALT")}])}),this.RULE("metadataSeparator",()=>{this.OR([{ALT:t(()=>{this.CONSUME(Le),this.MANY(()=>this.CONSUME(Pe))},"ALT")},{ALT:t(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(Pe)),this.OPTION(()=>this.CONSUME2(Le)),this.MANY2(()=>this.CONSUME3(Pe))},"ALT")}])}),this.RULE("systemBoundaryStatement",()=>{this.CONSUME(ir),this.SUBRULE(this.systemBoundaryName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd),this.SUBRULE(this.systemBoundaryContent),this.CONSUME(rr),this.SUBRULE2(this.lineEnd)}),this.RULE("systemBoundaryName",()=>{this.OR([{ALT:t(()=>{this.CONSUME(Y),this.OPTION(()=>{this.OR2([{ALT:t(()=>{this.CONSUME(Dt),this.SUBRULE(this.nodeLabel),this.CONSUME(Ft)},"ALT")},{ALT:t(()=>{this.CONSUME(Os),this.SUBRULE2(this.nodeLabel),this.CONSUME(Ls)},"ALT")}])})},"ALT")},{ALT:t(()=>this.CONSUME(Se),"ALT")},{ALT:t(()=>this.CONSUME(De),"ALT")}])}),this.RULE("systemBoundaryContent",()=>{this.MANY(()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.blankLine),"ALT")},{ALT:t(()=>this.SUBRULE(this.commentLine),"ALT")},{ALT:t(()=>this.SUBRULE(this.boundaryElement),"ALT")}])})}),this.RULE("boundaryElement",()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.actorDeclarationOnly),"ALT")},{ALT:t(()=>{this.SUBRULE(this.entityName),this.SUBRULE(this.lineEnd)},"ALT")}])}),this.RULE("metadataAssignmentStatement",()=>{this.SUBRULE(this.metadataAssignmentTarget),this.SUBRULE(this.metadata),this.SUBRULE(this.lineEnd)}),this.RULE("metadataAssignmentTarget",()=>{this.OR([{ALT:t(()=>this.CONSUME(Y),"ALT")},{ALT:t(()=>this.CONSUME(Se),"ALT")},{ALT:t(()=>this.CONSUME(De),"ALT")}])}),this.RULE("noteStatement",()=>{this.CONSUME(dr),this.CONSUME(pr),this.CONSUME(Y),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE("stereotype",()=>{this.CONSUME(Or),this.CONSUME(Rn),this.CONSUME(Sn)}),this.RULE("classSuffix",()=>{this.CONSUME(Nr),this.CONSUME(Y),this.MANY(()=>{this.CONSUME(Le),this.CONSUME2(Y)})}),this.RULE("jsonStatement",()=>{this.CONSUME(tr),this.CONSUME(An),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE("directionStatement",()=>{this.CONSUME(ar),this.OR([{ALT:t(()=>this.CONSUME(or),"ALT")},{ALT:t(()=>this.CONSUME(lr),"ALT")},{ALT:t(()=>this.CONSUME(cr),"ALT")},{ALT:t(()=>this.CONSUME(hr),"ALT")},{ALT:t(()=>this.CONSUME(ur),"ALT")}]),this.SUBRULE(this.lineEnd)}),this.RULE("classDefStatement",()=>{this.CONSUME(fr),this.CONSUME(Y),this.MANY(()=>{this.CONSUME(Le),this.CONSUME2(Y)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE("classStatement",()=>{this.CONSUME(mr),this.CONSUME(Y),this.MANY(()=>{this.CONSUME(Le),this.CONSUME2(Y)}),this.CONSUME3(Y),this.MANY2(()=>{this.CONSUME2(Le),this.CONSUME4(Y)}),this.SUBRULE(this.lineEnd)}),this.RULE("styleStatement",()=>{this.CONSUME(Er),this.CONSUME(Y),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE("styles",()=>{this.SUBRULE(this.styleValue),this.MANY(()=>{this.CONSUME(Le),this.SUBRULE2(this.styleValue)})}),this.RULE("styleValue",()=>{this.OR([{ALT:t(()=>this.CONSUME(dt),"ALT")},{ALT:t(()=>this.CONSUME(mn),"ALT")},{ALT:t(()=>{this.CONSUME(Ae),this.CONSUME2(dt)},"ALT")}]),this.CONSUME(Bt),this.AT_LEAST_ONE(()=>this.SUBRULE(this.styleComponent))}),this.RULE("styleComponent",()=>{this.OR([{ALT:t(()=>this.CONSUME(dt),"ALT")},{ALT:t(()=>this.CONSUME(Se),"ALT")},{ALT:t(()=>this.CONSUME(gn),"ALT")},{ALT:t(()=>this.CONSUME(_r),"ALT")},{ALT:t(()=>this.CONSUME(mn),"ALT")},{ALT:t(()=>this.CONSUME(xr),"ALT")},{ALT:t(()=>this.CONSUME(vr),"ALT")},{ALT:t(()=>this.CONSUME(Mr),"ALT")},{ALT:t(()=>this.CONSUME(wr),"ALT")},{ALT:t(()=>this.CONSUME(Ur),"ALT")},{ALT:t(()=>this.CONSUME(Bt),"ALT")},{ALT:t(()=>this.CONSUME(Dt),"ALT")},{ALT:t(()=>this.CONSUME(Ft),"ALT")},{ALT:t(()=>this.CONSUME(Os),"ALT")},{ALT:t(()=>this.CONSUME(Ls),"ALT")},{ALT:t(()=>this.CONSUME(br),"ALT")},{ALT:t(()=>this.CONSUME(fn),"ALT")},{ALT:t(()=>this.CONSUME(ys),"ALT")},{ALT:t(()=>this.CONSUME(Ae),"ALT")}])}),this.performSelfAnalysis()}isMetadataAssignment(){let e=this.LA(1).tokenType;return(e===Y||e===Se||e===De)&&this.LA(2).tokenType===pn}isStatementStart(){let e=this.LA(1).tokenType;return e!==me&&e!==Pe&&e!==un}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===Y&&vo[this.LA(1).image.toLowerCase()]===!0}hasLabeledRight(e){if(!Gi(this.LA(1)))return!1;for(let s=2;;s++){let n=this.LA(s);if(e.includes(n.tokenType))return!0;if(!Gi(n))return!1}}},$t=new Mo,Wi=class extends Error{constructor(e,s,n){super(`${e} (line ${s}, column ${n})`);this.line=s,this.column=n,this.name="UsecaseJsonError"}static{t(this,"UsecaseJsonError")}},En=t((e,s,n,r)=>{let a=n,o=r,c=Math.min(Math.max(s,0),e.length);for(let h=0;h<c;h++){let l=e[h];if(l==="\r")a++,o=1;else if(l===`
114
- `){if(h===0||e[h-1]!=="\r")a++,o=1}else o++}return{line:a,column:o}},"locationAtOffset"),wo=t((e,s,n,r)=>{let a=/\bposition (\d+)\b/u.exec(e);if(a)return En(s,Number.parseInt(a[1],10),n,r);let o=/\bline (\d+) column (\d+)\b/u.exec(e);if(o){let c=Number.parseInt(o[1],10),h=Number.parseInt(o[2],10);return{line:n+c-1,column:c===1?r+h-1:h}}if(/unexpected end|end of json input/iu.test(e))return En(s,s.length,n,r);return},"locationFromErrorMessage"),ae=class extends Error{constructor(e){super("Invalid JSON token");this.offset=e}static{t(this,"JsonWalkError")}},ji=class{constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{t(this,"PropertyOrderCollector")}collect(){if(this.skipWhitespace(),this.collectValue(""),this.skipWhitespace(),this.offset!==this.text.length)throw new ae(this.offset);return this.propertyOrder}collectValue(e){this.skipWhitespace();let s=this.text[this.offset];if(s==="{")this.collectObject(e);else if(s==="[")this.collectArray(e);else if(s==='"')this.readString(!1);else if(s==="t")this.consumeLiteral("true");else if(s==="f")this.consumeLiteral("false");else if(s==="n")this.consumeLiteral("null");else if(s==="-"||s>="0"&&s<="9")this.consumeNumber();else throw new ae(this.offset)}collectObject(e){this.offset++;let s=[],n=new Set;if(this.propertyOrder[e]=s,this.skipWhitespace(),this.text[this.offset]==="}"){this.offset++;return}while(this.offset<this.text.length){if(this.text[this.offset]!=='"')throw new ae(this.offset);let r=this.readString(!0),a=`${e}/${r.replaceAll("~","~0").replaceAll("/","~1")}`;if(n.has(r))this.deletePointerSubtree(a);else n.add(r),s.push(r);if(this.skipWhitespace(),this.text[this.offset]!==":")throw new ae(this.offset);if(this.offset++,this.collectValue(a),this.skipWhitespace(),this.text[this.offset]==="}"){this.offset++;return}if(this.text[this.offset]!==",")throw new ae(this.offset);this.offset++,this.skipWhitespace()}throw new ae(this.offset)}collectArray(e){if(this.offset++,this.skipWhitespace(),this.text[this.offset]==="]"){this.offset++;return}let s=0;while(this.offset<this.text.length){if(this.collectValue(`${e}/${s}`),s++,this.skipWhitespace(),this.text[this.offset]==="]"){this.offset++;return}if(this.text[this.offset]!==",")throw new ae(this.offset);this.offset++,this.skipWhitespace()}throw new ae(this.offset)}readString(e){this.offset++;let s="";while(this.offset<this.text.length){let n=this.offset,r=this.text[this.offset++];if(r==='"')return s;if(r.charCodeAt(0)<32)throw new ae(n);if(r!=="\\"){if(e)s+=r;continue}let a=this.offset,o=this.text[this.offset++];switch(o){case'"':case"\\":case"/":if(e)s+=o;break;case"b":if(e)s+="\b";break;case"f":if(e)s+="\f";break;case"n":if(e)s+=`
115
- `;break;case"r":if(e)s+="\r";break;case"t":if(e)s+="\t";break;case"u":{let c=this.text.slice(this.offset,this.offset+4);if(!/^[\dA-Fa-f]{4}$/u.test(c))throw new ae(this.offset);if(e)s+=String.fromCharCode(Number.parseInt(c,16));this.offset+=4;break}default:throw new ae(a)}}throw new ae(this.offset)}consumeLiteral(e){let s=0;for(let n of e){if(this.text[this.offset+s]!==n)throw new ae(this.offset+s);s++}this.offset+=e.length}consumeNumber(){if(this.text[this.offset]==="-")this.offset++;if(this.text[this.offset]==="0")this.offset++;else if(this.text[this.offset]>="1"&&this.text[this.offset]<="9")while(this.text[this.offset]>="0"&&this.text[this.offset]<="9")this.offset++;else throw new ae(this.offset);if(this.text[this.offset]==="."){if(this.offset++,this.text[this.offset]<"0"||this.text[this.offset]>"9")throw new ae(this.offset);while(this.text[this.offset]>="0"&&this.text[this.offset]<="9")this.offset++}if(this.text[this.offset]==="e"||this.text[this.offset]==="E"){if(this.offset++,this.text[this.offset]==="+"||this.text[this.offset]==="-")this.offset++;if(this.text[this.offset]<"0"||this.text[this.offset]>"9")throw new ae(this.offset);while(this.text[this.offset]>="0"&&this.text[this.offset]<="9")this.offset++}}skipWhitespace(){while(this.offset<this.text.length){let e=this.text[this.offset];if(e!==" "&&e!=="\t"&&e!==`
116
- `&&e!=="\r")return;this.offset++}}deletePointerSubtree(e){let s=`${e}/`;for(let n of Object.keys(this.propertyOrder))if(n===e||n.startsWith(s))delete this.propertyOrder[n]}};function Dr(e,s,n){let r;try{r=JSON.parse(e)}catch(a){let o=a instanceof Error?a.message:String(a),c=wo(o,e,s,n);if(!c){let h=0;try{new ji(e).collect()}catch(l){if(l instanceof ae)h=l.offset}c=En(e,h,s,n)}throw new Wi(`Invalid JSON: ${o}`,c.line,c.column)}if(typeof r!=="object"||r===null||Array.isArray(r))throw new Wi("JSON value must have an object root",s,n);return{value:r,propertyOrder:new ji(e).collect()}}t(Dr,"parseOrderedJsonObject");var Uo=t((e)=>({shape:e.type==="normal"?"actor":e.type==="hollow"?"actor-hollow":e.type==="awesome"?"actor-awesome":"actor-icon",...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"actor",actorType:e.type,business:e.business,labelType:e.labelType,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),"actorNode"),Po=t((e)=>({shape:e.shape,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"usecase",useCaseShape:e.shape,business:e.business,labelType:e.labelType,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),"useCaseNode"),Do=t((e)=>({label:e.label,shape:"note",attrs:{kind:"note",target:e.target,labelType:e.labelType}}),"noteNode"),Fo=t((e)=>({label:e.id,shape:"json-table",...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:"json",value:e.value,propertyOrder:e.propertyOrder,labelType:"text"}}),"jsonNode"),Bo=t((e)=>({id:e.id,source:e.source,target:e.target,...e.label?{label:e.label}:{},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{relationshipType:e.type,arrowType:e.arrowType,minlen:e.minlen,explicitId:e.explicitId,animate:e.animate,...e.animation?{animation:e.animation}:{},...e.labelType?{labelType:e.labelType}:{}}}),"relationshipEdge"),$o=t((e)=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:"note",arrowType:X.LINE_SOLID,pattern:"dotted",minlen:1,explicitId:!1,animate:!1,internal:!0}}),"noteEdge"),Go=t((e,s,n,r)=>{let a={};for(let l of e.getActors().values())a[l.id]=Uo(l);for(let l of e.getUseCases().values())a[l.id]=Po(l);for(let l of e.getNotes().values())a[l.id]=Do(l);for(let l of e.getJsonNodes().values())a[l.id]=Fo(l);let o={};for(let l of e.getSystemBoundaries().values())o[l.id]={...l.label===l.id?{}:{title:l.label},nodes:[...l.members],...l.classes.length?{classes:[...l.classes]}:{},...l.styles.length?{styles:[...l.styles]}:{},attrs:{kind:"systemBoundary",boundaryType:l.type,labelType:l.labelType}};let c={};for(let l of e.getClassDefs().values())c[l.id]={styles:[...l.styles]};let h=e.getDirection();return{version:1,diagramType:"usecase",source:s,header:{keyword:"usecase",direction:h==="TD"?"TB":h,span:n},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:a,edges:[...e.getRelationships().map(Bo),...[...e.getNotes().values()].map($o)],groups:o,classDefs:c,statements:r}},"buildUsecaseGraphAST"),le=t((e)=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,"locationText"),Ki=t((e)=>e===void 0?"":` (label "${e}")`,"labelSuffix"),Ze=t((e)=>e.generated?e.label:void 0,"generatedFrom"),hn=t((e,s)=>{for(let n of s)if(!e.includes(n))e.push(n)},"pushUnique"),Wo=class{constructor(e){this.db=e,this.source="",this.statements=[],this.elements=[],this.boundaries=[],this.jsonDrafts=[],this.relationshipDrafts=[],this.noteDrafts=[],this.metadataAssignments=[],this.classAssignments=[],this.styleAssignments=[],this.classDefinitions=[],this.directions=[],this.model=e.createModel()}static{t(this,"UsecaseModelBuilder")}reset(e){this.model=this.db.createModel(),this.source=e,this.statements=[],this.elements.length=0,this.boundaries.length=0,this.jsonDrafts.length=0,this.relationshipDrafts.length=0,this.noteDrafts.length=0,this.metadataAssignments.length=0,this.classAssignments.length=0,this.styleAssignments.length=0,this.classDefinitions.length=0,this.directions.length=0}addElement(e){this.elements.push(e)}addBoundary(e){this.boundaries.push(e)}addJson(e){this.jsonDrafts.push(e)}addRelationship(e){this.relationshipDrafts.push(e)}addNote(e){this.noteDrafts.push(e)}addMetadataAssignment(e,s,n,r){this.metadataAssignments.push({target:e,targetLocation:s,metadata:n,statement:r})}addClassDef(e,s){this.classDefinitions.push({ids:e,styles:s})}addClassAssignment(e,s){this.classAssignments.push({targets:e,classes:s})}addStyleAssignment(e,s,n){this.styleAssignments.push({target:e,location:s,styles:n})}setDirection(e){this.directions.push(e==="TD"?"TB":e)}setAccTitle(e){this.model.accTitle=e}setAccDescription(e){this.model.accDescription=e}setStatements(e){this.statements=e}getActors(){return this.model.actors}getUseCases(){return this.model.useCases}getSystemBoundaries(){return this.model.systemBoundaries}getRelationships(){return this.model.relationships}getNotes(){return this.model.notes}getJsonNodes(){return this.model.jsonNodes}getClassDefs(){return this.model.classDefs}getDirection(){return this.model.direction}getAccTitle(){return this.model.accTitle}getAccDescription(){return this.model.accDescription}finalize(e){let s=new Map,n=new Map,r=new Map,a=new Map;for(let l of this.relationshipDrafts)this.recordFirst(a,l.source.id,l.source.location.span[0]),this.recordFirst(a,l.target.id,l.target.location.span[0]);for(let l of this.elements)this.recordFirst(a,l.id,l.location.span[0]);for(let l of this.boundaries)this.recordFirst(a,l.id,l.location.span[0]);for(let l of this.jsonDrafts)this.recordFirst(a,l.id,l.location.span[0]);let o=[...this.elements.map((l)=>({offset:l.location.span[0],type:"element",value:l})),...this.boundaries.map((l)=>({offset:l.location.span[0],type:"boundary",value:l})),...this.jsonDrafts.map((l)=>({offset:l.location.span[0],type:"json",value:l})),...this.relationshipDrafts.filter((l)=>l.explicitId).map((l)=>({offset:l.explicitIdLocation.span[0],type:"edge",value:l}))].sort((l,u)=>l.offset-u.offset);for(let l of o)if(l.type==="element")this.collectElement(l.value,s,n);else if(l.type==="boundary")this.collectBoundary(l.value,s,r);else if(l.type==="json")this.registerUnique(s,l.value.id,"json",l.value.location,!1);else this.registerUnique(s,l.value.explicitId,"edge",l.value.explicitIdLocation,!1);this.materializeElements(n,a),this.materializeBoundaries(r,a),this.materializeJson(a);let c=this.materializeRelationships(s,n,a);this.reorderElements(n,a),this.applyMetadataAssignments(s,n,r,c),this.validateAndRefreshElements(n),this.refreshBoundaries(r,n),this.materializeNotes(s),this.applyClassDefinitions(),this.applyClassesAndStyles(s,c),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...s].map(([l,u])=>[l,u.kind]));let h=Go(this,this.source,e,this.statements);return this.model.ast=h,this.db.commit(this.model),h}collectElement(e,s,n){let r=s.get(e.id),a=Ze({generated:e.generated,label:e.label.text});if(r&&r.kind!==e.kind)this.conflict(`ID '${e.id}' is declared as both ${r.kind} and ${e.kind}`,e.location,r.location,a,Ze(r));if(r&&(r.generated||e.generated))this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,a,Ze(r));let o=n.get(e.id);if(!o){let c={kind:e.kind,id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],...e.parentId?{parentId:e.parentId,parentLocation:e.parentLocation}:{},...e.shape?{shape:e.shape}:{},...e.stereotype?{stereotype:e.stereotype,stereotypeLocation:e.location}:{}};this.applyDeclarationMetadata(c,e.metadata),n.set(e.id,c),s.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text});return}if(o.label.text!==e.label.text||o.label.type!==e.label.type)this.conflict(`ID '${e.id}' has conflicting labels`,e.location,o.location);if(e.shape&&o.shape&&e.shape!==o.shape)this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,o.location);if(e.parentId&&o.parentId&&e.parentId!==o.parentId)this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,o.parentLocation??o.location);if(e.stereotype&&o.stereotype&&e.stereotype!==o.stereotype)this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,o.stereotypeLocation??o.location);o.shape??=e.shape,o.parentId??=e.parentId,o.parentLocation??=e.parentLocation,o.stereotype??=e.stereotype,o.stereotypeLocation??=e.stereotype?e.location:void 0,hn(o.classes,e.classes),this.applyDeclarationMetadata(o,e.metadata)}collectBoundary(e,s,n){let r=s.get(e.id),a=Ze({generated:e.generated,label:e.label.text});if(r&&r.kind!=="boundary")this.conflict(`ID '${e.id}' is declared as both ${r.kind} and boundary`,e.location,r.location,a,Ze(r));if(r&&(r.generated||e.generated))this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,a,Ze(r));let o=n.get(e.id);if(o){if(o.label.text!==e.label.text||o.label.type!==e.label.type)this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,o.location);hn(o.classes,e.classes);return}n.set(e.id,{id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],styles:[],members:[]}),s.set(e.id,{kind:"boundary",location:e.location,generated:e.generated,label:e.label.text})}materializeElements(e,s){for(let n of[...e.values()].sort((r,a)=>(s.get(r.id)??0)-(s.get(a.id)??0)))this.setElementModel(n)}materializeBoundaries(e,s){for(let n of[...e.values()].sort((r,a)=>(s.get(r.id)??0)-(s.get(a.id)??0)))this.model.systemBoundaries.set(n.id,{id:n.id,label:n.label.text,labelType:n.label.type,type:n.type??"rect",members:[],classes:[...n.classes],styles:[...n.styles]})}materializeJson(e){for(let s of[...this.jsonDrafts].sort((n,r)=>(e.get(n.id)??0)-(e.get(r.id)??0)))this.model.jsonNodes.set(s.id,{id:s.id,value:s.value,propertyOrder:s.propertyOrder,classes:[...s.classes],styles:[]})}materializeRelationships(e,s,n){let r=new Map,a=0;for(let o of this.relationshipDrafts){let c=this.resolveEndpoint(o.source,e,s,n),h=this.resolveEndpoint(o.target,e,s,n);this.validateRelationship(o,c,h,e);let l=o.explicitId??`edge-${a++}`,u={id:l,explicitId:Boolean(o.explicitId),source:o.source.id,target:o.target.id,type:o.type,arrowType:o.arrowType,...o.label?{label:o.label.text,labelType:o.label.type}:{},minlen:o.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(u),r.set(l,{draft:o,relationship:u})}return this.model.relationshipCounter=a,r}resolveEndpoint(e,s,n,r){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${le(e.location)}`);let a=s.get(e.id);if(a)return a.kind;return n.set(e.id,{kind:"usecase",id:e.id,label:e.label,location:e.location,generated:e.generated,shape:"ellipse",classes:[]}),s.set(e.id,{kind:"usecase",location:e.location,generated:e.generated,label:e.label.text}),this.recordFirst(r,e.id,e.location.span[0]),"usecase"}reorderElements(e,s){let n=new Map(this.model.actors),r=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(let a of[...e.values()].sort((o,c)=>(s.get(o.id)??0)-(s.get(c.id)??0))){if(!n.has(a.id)&&!r.has(a.id))this.setElementModel(a);let o=n.get(a.id)??this.model.actors.get(a.id),c=r.get(a.id)??this.model.useCases.get(a.id);if(o)this.model.actors.set(a.id,o);else if(c)this.model.useCases.set(a.id,c)}}applyMetadataAssignments(e,s,n,r){for(let a of this.metadataAssignments){let o=e.get(a.target);if(!o){let c=this.inferMetadataKind(a.metadata);throw Error(`Metadata target '${a.target}' is unresolved${c?` (metadata implies ${c})`:""} at ${le(a.targetLocation)}`)}if(o.kind==="actor"||o.kind==="usecase")this.applyStandaloneElementMetadata(s.get(a.target),a.metadata);else if(o.kind==="boundary"){let c=n.get(a.target);for(let h of a.metadata.properties){if(h.key!=="type"||h.value!=="rect"&&h.value!=="package")this.invalidMetadata(a.target,o.kind,h);c.type=h.value}}else if(o.kind==="edge"){let c=r.get(a.target);if(!c)throw Error(`Metadata target '${a.target}' is not an explicit edge at ${le(a.targetLocation)}`);a.statement.kind="edgeMetadata",a.statement.edges=[{id:a.target,span:a.statement.span,idSpan:a.targetLocation.span,...a.statement.metadata?{metadata:a.statement.metadata}:{}}],delete a.statement.nodes;for(let h of a.metadata.properties)if(h.key==="animate"&&typeof h.value==="boolean")c.relationship.animate=h.value;else if(h.key==="animation"&&(h.value==="fast"||h.value==="slow"))c.relationship.animation=h.value,c.relationship.animate=!0;else this.invalidMetadata(a.target,o.kind,h)}else for(let c of a.metadata.properties)this.invalidMetadata(a.target,o.kind,c)}for(let{relationship:a}of r.values())if(a.animation)a.animate=!0}applyStandaloneElementMetadata(e,s){for(let n of s.properties)if(e.kind==="actor")this.applyActorProperty(e,n,!0);else if(n.key==="business"&&typeof n.value==="boolean")e.business=n.value;else this.invalidMetadata(e.id,e.kind,n)}applyDeclarationMetadata(e,s){if(!s)return;for(let n of s.properties)if(e.kind==="actor")this.applyActorProperty(e,n,!1);else if(n.key==="business"&&typeof n.value==="boolean"){if(e.business!==void 0&&e.business!==n.value)this.conflict(`Use case '${e.id}' has conflicting business metadata`,n.location,e.location);e.business=n.value}else this.invalidMetadata(e.id,e.kind,n)}applyActorProperty(e,s,n){if(s.key==="type"&&(s.value==="normal"||s.value==="hollow"||s.value==="awesome")){if(!n&&e.actorType!==void 0&&e.actorType!==s.value)this.conflict(`Actor '${e.id}' has conflicting type metadata`,s.location,e.location);e.actorType=s.value}else if(s.key==="icon"&&typeof s.value==="string"){if(!n&&e.icon!==void 0&&e.icon!==s.value)this.conflict(`Actor '${e.id}' has conflicting icon metadata`,s.location,e.location);e.icon=s.value}else if(s.key==="business"&&typeof s.value==="boolean"){if(!n&&e.business!==void 0&&e.business!==s.value)this.conflict(`Actor '${e.id}' has conflicting business metadata`,s.location,e.location);e.business=s.value}else this.invalidMetadata(e.id,e.kind,s)}validateAndRefreshElements(e){for(let s of e.values()){let n=s.icon?"icon":s.actorType??"normal";if(s.kind==="actor"){if(s.icon&&s.actorType&&s.actorType!=="normal")throw Error(`Actor '${s.id}' cannot combine icon with type '${s.actorType}' at ${le(s.location)}`);if(s.business&&(n==="icon"||n==="awesome"))throw Error(`Business actor '${s.id}' must use normal or hollow geometry at ${le(s.location)}`)}else if((s.shape??"ellipse")==="rect"&&s.business)throw Error(`Rectangular use case '${s.id}' cannot be a business use case at ${le(s.location)}`);this.setElementModel(s)}}refreshBoundaries(e,s){for(let n of e.values())n.members.length=0;for(let n of[...this.elements].sort((r,a)=>r.location.span[0]-a.location.span[0])){if(!n.parentId)continue;let r=e.get(n.parentId);if(!r)throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${le(n.parentLocation??n.location)}`);if(!r.members.includes(n.id))r.members.push(n.id)}for(let n of s.values())if(n.parentId&&!e.has(n.parentId))throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${le(n.parentLocation??n.location)}`);for(let n of e.values()){let r=this.model.systemBoundaries.get(n.id);r.type=n.type??"rect",r.members=[...n.members],r.classes=[...n.classes],r.styles=[...n.styles]}}materializeNotes(e){let s=0;for(let n of this.noteDrafts){let r=e.get(n.target);if(!r)throw Error(`Note target '${n.target}' is unresolved at ${le(n.targetLocation)}`);if(r.kind!=="actor"&&r.kind!=="usecase")this.conflict(`Note target '${n.target}' must be an actor or use case, not ${r.kind}`,n.targetLocation,r.location);let a=`note-${s++}`;this.model.notes.set(a,{id:a,target:n.target,label:n.label.text,labelType:n.label.type})}this.model.noteCounter=s}applyClassDefinitions(){for(let e of this.classDefinitions)for(let s of e.ids)this.model.classDefs.set(s,{id:s,styles:[...e.styles]})}applyClassesAndStyles(e,s){for(let n of this.classAssignments)for(let r of n.targets)hn(this.getStylable(r.id,e,s,r.location).classes,n.classes);for(let n of this.styleAssignments)this.getStylable(n.target,e,s,n.location).styles.push(...n.styles)}getStylable(e,s,n,r){let a=s.get(e)?.kind,o=a==="actor"?this.model.actors.get(e):a==="usecase"?this.model.useCases.get(e):a==="boundary"?this.model.systemBoundaries.get(e):a==="json"?this.model.jsonNodes.get(e):a==="edge"?n.get(e)?.relationship:void 0;if(!o)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${le(r)}`);return o}validateRelationship(e,s,n,r){let a=t((o)=>o==="actor"||o==="usecase"||o==="json","allowed");if(!a(s))this.conflict(`Relationship source '${e.source.id}' cannot be ${s}`,e.source.location,r.get(e.source.id).location);if(!a(n))this.conflict(`Relationship target '${e.target.id}' cannot be ${n}`,e.target.location,r.get(e.target.id).location);if((e.type==="include"||e.type==="extend")&&(s!=="usecase"||n!=="usecase"))throw Error(`${e.type} relationship requires use-case endpoints at ${le(e.location)}`);if(e.type==="generalization"&&(s!=="actor"&&s!=="usecase"||s!==n))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${le(e.location)}`);if(e.type==="association"&&(s==="json"||n==="json")&&![0,1,2].includes(e.arrowType))throw Error(`JSON relationship '${e.source.id}' to '${e.target.id}' permits only point, reversed-point, or markerless solid association at ${le(e.location)}`)}setElementModel(e){if(e.kind==="actor"){let s=e.icon?"icon":e.actorType??"normal";this.model.useCases.delete(e.id),this.model.actors.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:s,...e.icon?{icon:e.icon}:{},business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.actors.get(e.id)?.styles??[]})}else this.model.actors.delete(e.id),this.model.useCases.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,shape:e.shape??"ellipse",business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.useCases.get(e.id)?.styles??[]})}inferMetadataKind(e){let s=new Set(["actor","usecase","boundary","edge"]);for(let n of e.properties)if(n.key==="icon")s.clear(),s.add("actor");else if(n.key==="animate"||n.key==="animation")s.clear(),s.add("edge");else if(n.key==="type"){if(s.clear(),n.value==="rect"||n.value==="package")s.add("boundary");else if(n.value==="normal"||n.value==="hollow"||n.value==="awesome")s.add("actor")}else if(n.key==="business")s.delete("boundary"),s.delete("edge");else return;return s.size===1?[...s][0]:void 0}invalidMetadata(e,s,n){throw Error(`Metadata property '${n.key}' is invalid for ${s} '${e}' at ${le(n.location)}`)}registerUnique(e,s,n,r,a){let o=e.get(s);if(o)this.conflict(`ID '${s}' is declared more than once (${o.kind} and ${n})`,r,o.location,void 0,Ze(o));e.set(s,{kind:n,location:r,generated:a})}recordFirst(e,s,n){let r=e.get(s);if(r===void 0||n<r)e.set(s,n)}conflict(e,s,n,r,a){throw Error(`${e} at ${le(s)}${Ki(r)}; previous declaration at ${le(n)}${Ki(a)}`)}},jo=$t.getBaseCstVisitorConstructor(),Ko=class extends jo{constructor(){super();this.builder=new Wo(Ns),this.source="",this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{t(this,"UsecaseVisitor")}build(e,s){this.source=s,this.parentBoundary=void 0,this.anonymousEdge=0,this.anonymousNote=0,this.builder.reset(s),this.visit(e)}start(e){let s=this.tokens(e,"USECASE")[0],n=[];for(let r of this.nodes(e,"line"))n.push(this.visit(r));this.builder.setStatements(n),this.builder.finalize(this.tokenSpan(s))}line(e){let s=this.firstNode(e,"blankLine","commentLine","statement");return this.wrap(s,this.visit(s))}statement(e){return this.visit(this.firstNode(e,"accTitleStatement","accDescrStatement","directionStatement","actorStatement","systemBoundaryStatement","noteStatement","jsonStatement","classDefStatement","classStatement","styleStatement","metadataAssignmentStatement","entityStatement"))}lineEnd(e){return}blankLine(e){return{kind:"blank",span:this.tokenSpan(this.tokens(e,"NEWLINE")[0])}}commentLine(e){return{kind:"comment",span:this.tokenSpan(this.tokens(e,"COMMENT")[0])}}accTitleStatement(e){let s=this.tokens(e,"ACC_TITLE_LINE")[0].image;return this.builder.setAccTitle(s.slice(s.indexOf(":")+1).trim()),{kind:"accTitle",span:[0,0]}}accDescrStatement(e){let s=this.tokens(e,"ACC_DESCR_LINE")[0],n=this.tokens(e,"ACC_DESCR_BLOCK")[0],r=s?s.image.slice(s.image.indexOf(":")+1).trim():n.image.slice(n.image.indexOf("{")+1,n.image.lastIndexOf("}")).trim();return this.builder.setAccDescription(r),{kind:"accDescr",span:[0,0]}}actorStatement(e){let s=this.nodes(e,"actorItem"),n=s.map((l)=>this.visit(l)),r=this.nodes(e,"relationTail")[0],a=n.map((l,u)=>this.actorOccurrence(s[u],l,!0));for(let l of n)this.builder.addElement(this.actorDraft(l));if(!r)return{kind:"node",span:[0,0],nodes:a};let o=this.visit(r);if(o.target.explicitDeclaration)this.builder.addElement(this.entityDraft(o.target));let c=this.relationshipDraft(n[0],o,this.nodeLocation(r));this.builder.addRelationship(c);let h=c.explicitId??`edge-${this.anonymousEdge++}`;return a.push(this.entityOccurrence(this.nodes(r.children,"entityName")[0],o.target,o.target.explicitDeclaration)),{kind:"edge",span:[0,0],nodes:a,edges:[{id:h,span:[0,0],...c.explicitIdLocation?{idSpan:c.explicitIdLocation.span}:{},...c.label?{labelSpan:c.label.span}:{}}]}}actorItem(e){let s=this.visit(this.nodes(e,"actorName")[0]),n=this.nodes(e,"metadata")[0],r=this.nodes(e,"stereotype")[0],a=this.nodes(e,"classSuffix")[0],o=a?this.visit(a):{classes:[],spans:[]};return{...s,...n?{metadata:this.visit(n)}:{},...r?{stereotype:this.visit(r)}:{},classes:o.classes,classSpans:o.spans}}actorName(e){let s=this.tokens(e,"IDENTIFIER")[0],n=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0];if(s){let a=this.nodes(e,"nodeLabel")[0],o=a?this.visit(a):this.tokenLabel(s);return{id:s.image,label:o,location:this.tokenLocation(s),generated:!1,classes:[],classSpans:[]}}let r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let s=this.nodes(e,"actorItem"),n=s.map((r)=>this.visit(r));for(let r of n)this.builder.addElement(this.actorDraft(r));return{kind:"node",span:[0,0],nodes:n.map((r,a)=>this.actorOccurrence(s[a],r,!0))}}entityStatement(e){let s=this.nodes(e,"entityName"),n=this.visit(s[0]),r=this.nodes(e,"relationTail")[0];if(!r)return n.explicitDeclaration=!0,n.shape??="ellipse",this.builder.addElement(this.entityDraft(n)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(s[0],n,!0)]};if(n.explicitDeclaration)this.builder.addElement(this.entityDraft(n));let a=this.visit(r);if(a.target.explicitDeclaration)this.builder.addElement(this.entityDraft(a.target));let o={source:this.endpoint(n),target:this.endpoint(a.target),location:this.nodeLocation(r),...a.explicitId?{explicitId:a.explicitId,explicitIdLocation:a.explicitIdLocation}:{},...a.arrow};this.builder.addRelationship(o);let c=o.explicitId??`edge-${this.anonymousEdge++}`;return{kind:"edge",span:[0,0],nodes:[this.entityOccurrence(s[0],n,n.explicitDeclaration),this.entityOccurrence(this.nodes(r.children,"entityName")[0],a.target,a.target.explicitDeclaration)],edges:[{id:c,span:[0,0],...o.explicitIdLocation?{idSpan:o.explicitIdLocation.span}:{},...o.label?{labelSpan:o.label.span}:{}}]}}entityName(e){let s=this.tokens(e,"IDENTIFIER")[0],n=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],r=this.nodes(e,"nodeLabel")[0],a=this.nodes(e,"useCaseMetadata")[0],o=this.nodes(e,"stereotype")[0],c=this.nodes(e,"classSuffix")[0],h=c?this.visit(c):{classes:[],spans:[]};if(s){let u=r?this.visit(r):this.tokenLabel(s),p=r?this.tokens(e,"LBRACKET").length?"rect":"ellipse":void 0;return{id:s.image,label:u,location:this.tokenLocation(s),generated:!1,...p?{shape:p}:{},...a?{metadata:this.visit(a)}:{},...o?{stereotype:this.visit(o)}:{},classes:h.classes,classSpans:h.spans,explicitDeclaration:Boolean(p||a||o)}}let l=this.tokenLabel(n);return{id:this.generateId(l.text),label:l,location:this.tokenLocation(n),generated:!0,...a?{metadata:this.visit(a)}:{},...o?{stereotype:this.visit(o)}:{},classes:h.classes,classSpans:h.spans,explicitDeclaration:Boolean(a||o)}}nodeLabel(e){let s=this.allTokens(e);if(s.length===1&&(s[0].tokenType.name==="PLAIN_STRING"||s[0].tokenType.name==="MARKDOWN_STRING"))return this.tokenLabel(s[0]);let n=[s[0].startOffset,(s.at(-1).endOffset??s.at(-1).startOffset)+1];return{text:this.source.slice(n[0],n[1]),type:"text",span:n}}useCaseMetadata(e){return this.visit(this.nodes(e,"metadata")[0])}relationTail(e){let s=this.tokens(e,"IDENTIFIER")[0];return{...s?{explicitId:s.image,explicitIdLocation:this.tokenLocation(s)}:{},arrow:this.visit(this.nodes(e,"arrow")[0]),target:this.visit(this.nodes(e,"entityName")[0])}}arrow(e){return this.visit(this.firstNode(e,"semanticRelation","forwardSolidOperator","backwardSolidOperator","markerlessSolidOperator","forwardCircleOperator","backwardCircleOperator","forwardCrossOperator","backwardCrossOperator"))}edgeLabel(e){return this.nodeLabel(e)}semanticRelation(e){if(this.tokens(e,"GENERALIZATION").length)return{type:"generalization",arrowType:X.SOLID_ARROW,minlen:1};let s=this.tokens(e,"INCLUDE").length?"include":"extend",n=this.tokens(e,s==="include"?"INCLUDE":"EXTEND")[0];return{type:s,arrowType:X.SOLID_ARROW,label:{text:s,type:"text",span:this.tokenSpan(n)},minlen:1}}metadata(e){return{properties:this.nodes(e,"metadataProperty").map((s)=>this.visit(s)),location:this.ctxLocation(e)}}metadataProperty(e){let s=this.allTokens(e).filter((c)=>c.tokenType.name!=="COLON"),n=s[0],r=s[1],a=r.tokenType.name==="TRUE"?!0:r.tokenType.name==="FALSE"?!1:this.decodePlain(r),o=[n.startOffset,(r.endOffset??r.startOffset)+1];return{key:this.decodePlain(n),value:a,span:o,keySpan:this.contentSpan(n),valueSpan:this.contentSpan(r),location:this.tokenLocation(n)}}metadataSeparator(e){return}systemBoundaryStatement(e){let s=this.visit(this.nodes(e,"systemBoundaryName")[0]),n=this.nodes(e,"classSuffix")[0],r=n?this.visit(n):{classes:[],spans:[]};s.classes=r.classes,this.builder.addBoundary(s);let a=this.parentBoundary;this.parentBoundary={id:s.id,location:s.location};let o=this.nodes(e,"systemBoundaryContent")[0],c=o?this.visit(o):[];this.parentBoundary=a;let h=this.tokens(e,"END")[0],l=this.nodes(e,"metadata")[0],u=l?this.visit(l):void 0,p={kind:"group",span:[0,0],group:s.id,idSpan:s.location.span,titleSpan:s.label.span,endSpan:this.tokenSpan(h),classSpans:r.spans,...u?{metadata:u.properties.map(({key:f,span:E,keySpan:T,valueSpan:_})=>({key:f,span:E,keySpan:T,valueSpan:_}))}:{},...c.length?{children:c}:{}};if(u)this.builder.addMetadataAssignment(s.id,s.location,u,p);return p}systemBoundaryName(e){let s=this.tokens(e,"IDENTIFIER")[0];if(s){let a=this.nodes(e,"nodeLabel")[0];return{id:s.image,label:a?this.visit(a):this.tokenLabel(s),location:this.tokenLocation(s),generated:!1,classes:[]}}let n=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,"blankLine"),...this.nodes(e,"commentLine"),...this.nodes(e,"boundaryElement")].sort((n,r)=>(n.location?.startOffset??0)-(r.location?.startOffset??0)).map((n)=>this.wrap(n,this.visit(n)))}boundaryElement(e){let s=this.nodes(e,"actorDeclarationOnly")[0];if(s)return this.visit(s);let n=this.nodes(e,"entityName")[0],r=this.visit(n);return r.explicitDeclaration=!0,r.shape??="ellipse",this.builder.addElement(this.entityDraft(r)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(n,r,!0)]}}metadataAssignmentStatement(e){let s=this.visit(this.nodes(e,"metadataAssignmentTarget")[0]),n=this.visit(this.nodes(e,"metadata")[0]),r={kind:"metadata",span:[0,0],nodes:[{id:s.id,span:s.location.span,idSpan:s.location.span}],metadata:n.properties.map(({key:a,span:o,keySpan:c,valueSpan:h})=>({key:a,span:o,keySpan:c,valueSpan:h}))};return this.builder.addMetadataAssignment(s.id,s.location,n,r),r}metadataAssignmentTarget(e){let s=this.allTokens(e)[0],n=this.tokenLabel(s);return{id:s.tokenType.name==="IDENTIFIER"?s.image:this.generateId(n.text),location:this.tokenLocation(s)}}noteStatement(e){let s=this.tokens(e,"IDENTIFIER")[0],n=this.visit(this.nodes(e,"nodeLabel")[0]);return this.builder.addNote({target:s.image,targetLocation:this.tokenLocation(s),label:n,location:this.ctxLocation(e)}),{kind:"note",span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:n.span,nodes:[{id:s.image,span:this.tokenSpan(s),idSpan:this.tokenSpan(s)}]}}stereotype(e){let s=this.tokens(e,"STEREOTYPE_TEXT")[0];return{value:s.image.trim(),span:this.tokenSpan(s)}}classSuffix(e){let s=this.tokens(e,"IDENTIFIER");return{classes:s.map((n)=>n.image),spans:s.map((n)=>this.tokenSpan(n))}}jsonStatement(e){let s=this.tokens(e,"JSON_DECLARATION_START")[0],n=this.tokens(e,"JSON_OBJECT_LITERAL")[0],r=/^json[\t ]+(\w+)/.exec(s.image),a=r[1],o=r[0].length-a.length,c={span:[s.startOffset+o,s.startOffset+o+a.length],line:s.startLine??1,column:(s.startColumn??1)+o},h=Dr(n.image,n.startLine??1,n.startColumn??1),l=this.nodes(e,"classSuffix")[0],u=l?this.visit(l):{classes:[],spans:[]},p={id:a,value:h.value,propertyOrder:h.propertyOrder,location:c,classes:u.classes};return this.builder.addJson(p),{kind:"json",span:[0,0],nodes:[{id:a,span:c.span,idSpan:c.span,defines:!0,classSpans:u.spans}],classSpans:u.spans}}directionStatement(e){let s=this.allTokens(e).find((n)=>["TD","TB","BT","RL","LR"].includes(n.tokenType.name));return this.builder.setDirection(s.image),{kind:"direction",span:[0,0]}}classDefStatement(e){let s=this.tokens(e,"IDENTIFIER"),n=this.visit(this.nodes(e,"styles")[0]);return this.builder.addClassDef(s.map((r)=>r.image),n),{kind:"classDef",span:[0,0],ref:s[0].image,refSpan:this.tokenSpan(s[0])}}classStatement(e){let s=this.tokens(e,"IDENTIFIER"),n=1;for(;n<s.length;n++)if(!this.source.slice((s[n-1].endOffset??s[n-1].startOffset)+1,s[n].startOffset).includes(","))break;let r=s.slice(0,n).map((o)=>({id:o.image,location:this.tokenLocation(o)})),a=s.slice(n).map((o)=>o.image);return this.builder.addClassAssignment(r,a),{kind:"classAssign",span:[0,0],ref:a[0],refSpan:this.tokenSpan(s[n]),nodes:r.map(({id:o,location:c})=>({id:o,span:c.span,idSpan:c.span}))}}styleStatement(e){let s=this.tokens(e,"IDENTIFIER")[0],n=this.visit(this.nodes(e,"styles")[0]);return this.builder.addStyleAssignment(s.image,this.tokenLocation(s),n),{kind:"style",span:[0,0],nodes:[{id:s.image,span:this.tokenSpan(s),idSpan:this.tokenSpan(s)}]}}styles(e){return this.nodes(e,"styleValue").map((s)=>this.visit(s))}styleValue(e){let s=this.allTokens(e),n=[s[0].startOffset,(s.at(-1).endOffset??s.at(-1).startOffset)+1];return this.source.slice(n[0],n[1]).replaceAll("\\,",",")}styleComponent(e){return this.allTokens(e).map((s)=>s.image).join("")}forwardSolidOperator(e){let s=this.tokens(e,"FORWARD_SOLID")[0];return{type:"association",arrowType:X.SOLID_ARROW,minlen:this.solidMinlen(s)}}backwardSolidOperator(e){let s=this.tokens(e,"BACKWARD_SOLID")[0],n=this.nodes(e,"edgeLabel")[0],r=n?this.tokens(e,"MARKERLESS_SOLID").at(-1):s;return{type:"association",arrowType:X.BACK_ARROW,minlen:this.solidMinlen(r),...n?{label:this.visit(n)}:{}}}markerlessSolidOperator(e){let s=this.nodes(e,"edgeLabel")[0],n=this.allTokens(e);if(!s)return{type:"association",arrowType:X.LINE_SOLID,minlen:this.solidMinlen(this.tokens(e,"MARKERLESS_SOLID")[0])};let r=n.at(-1),a=r.tokenType.name==="FORWARD_SOLID"?X.SOLID_ARROW:r.tokenType.name==="FORWARD_CIRCLE"?X.CIRCLE_ARROW:r.tokenType.name==="FORWARD_CROSS"?X.CROSS_ARROW:X.LINE_SOLID;return{type:"association",arrowType:a,label:this.visit(s),minlen:a===X.SOLID_ARROW||a===X.LINE_SOLID?this.solidMinlen(r):1}}forwardCircleOperator(e){return{type:"association",arrowType:X.CIRCLE_ARROW,minlen:1}}backwardCircleOperator(e){let s=this.nodes(e,"edgeLabel")[0];return{type:"association",arrowType:X.CIRCLE_ARROW_REVERSED,minlen:1,...s?{label:this.visit(s)}:{}}}forwardCrossOperator(e){return{type:"association",arrowType:X.CROSS_ARROW,minlen:1}}backwardCrossOperator(e){let s=this.nodes(e,"edgeLabel")[0];return{type:"association",arrowType:X.CROSS_ARROW_REVERSED,minlen:1,...s?{label:this.visit(s)}:{}}}actorDraft(e){return{id:e.id,kind:"actor",label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}entityDraft(e){return{id:e.id,kind:"usecase",label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.shape?{shape:e.shape}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}endpoint(e,s=e.explicitDeclaration??!0){return{id:e.id,label:e.label,location:e.location,generated:e.generated,declaration:s,classesOnReference:e.classes.length>0}}relationshipDraft(e,s,n){return{source:this.endpoint(e,!0),target:this.endpoint(s.target),location:n,...s.explicitId?{explicitId:s.explicitId,explicitIdLocation:s.explicitIdLocation}:{},...s.arrow}}actorOccurrence(e,s,n){return{id:s.id,span:this.nodeSpan(e),idSpan:s.location.span,labelSpan:s.label.span,...n?{defines:!0}:{},...s.stereotype?{stereotypeSpan:s.stereotype.span}:{},...s.metadata?{metadata:s.metadata.properties.map(({key:r,span:a,keySpan:o,valueSpan:c})=>({key:r,span:a,keySpan:o,valueSpan:c}))}:{},...s.classSpans.length?{classSpans:s.classSpans}:{}}}entityOccurrence(e,s,n){return this.actorOccurrence(e,s,n)}wrap(e,s){if(s.kind==="blank"||s.kind==="comment")return s;s.span=this.nodeSpan(e);for(let n of s.edges??[])n.span=s.span;return s}tokenLabel(e){let s=e.tokenType.name==="MARKDOWN_STRING"?"markdown":"text",n=s==="markdown"?2:e.tokenType.name==="PLAIN_STRING"?1:0,r=this.tokenSpan(e,n);return{text:this.source.slice(r[0],r[1]),type:s,span:r}}decodePlain(e){return e.tokenType.name==="PLAIN_STRING"?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,e.tokenType.name==="PLAIN_STRING"?1:e.tokenType.name==="MARKDOWN_STRING"?2:0)}generateId(e){return e.replace(/\W/g,"_")}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){let s=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:s.startLine??1,column:s.startColumn??1}}ctxLocation(e){let s=this.allTokens(e).filter((a)=>a.tokenType.name!=="NEWLINE"&&a.tokenType.name!=="EOF"),n=s[0],r=s.at(-1);return{span:[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)],line:n.startLine??1,column:n.startColumn??1}}tokenLocation(e){let s=e.tokenType.name==="PLAIN_STRING"?1:e.tokenType.name==="MARKDOWN_STRING"?2:0;return{span:this.tokenSpan(e,s),line:e.startLine??1,column:(e.startColumn??1)+s}}nodeSpan(e){let s=this.allTokens(e.children).filter((a)=>a.tokenType.name!=="NEWLINE"&&a.tokenType.name!=="EOF"),n=s[0],r=s.at(-1);if(!n||!r)throw Error("Usecase CST node has no source token");return[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)]}tokenSpan(e,s=0){return[e.startOffset+s,Math.min(this.source.length,(e.endOffset??e.startOffset+e.image.length-1)+1-s)]}nodes(e,s){return(e[s]??[]).filter((n)=>("children"in n))}tokens(e,s){return(e[s]??[]).filter((n)=>("tokenTypeIdx"in n))}firstNode(e,...s){for(let n of s){let r=this.nodes(e,n)[0];if(r)return r}throw Error(`Usecase CST is missing one of: ${s.join(", ")}`)}allTokens(e){let s=[];for(let n of Object.values(e))for(let r of n)if("tokenTypeIdx"in r)s.push(r);else s.push(...this.allTokens(r.children));return s.sort((n,r)=>n.startOffset-r.startOffset)}},Vo=new Ko,zo={parse:t(async(e)=>{Ns.clear(),$t.input=[];try{Xi({diagramType:"usecase",lexer:xo,parser:$t,entry:t(()=>$t.start(),"entry"),visit:t((s)=>Vo.build(s,e),"visit")},e)}catch(s){Ns.clear();let n=$t.errors[0];if(n){let{token:r}=n,a=ut(r.startOffset)?r.startOffset:e.length,o=ut(r.endOffset)?r.endOffset+1:a,c=ut(r.startLine)?r.startLine:e.slice(0,a).split(/\r\n|\r|\n/).length,h=Math.max(e.lastIndexOf(`
117
- `,a-1),e.lastIndexOf("\r",a-1)),l=ut(r.startColumn)?r.startColumn:a-h,u=s instanceof Error?s.message:String(s);throw Error(`${u} at line ${c}, column ${l} [${a},${o})`)}throw s}},"parse")},Ho=["point","circle","cross","extension"],Fr={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},Vi=t((e,s)=>{let[n,r]=[e,s].map((a)=>a.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element");return`usecase-${n}-${r}`},"usecaseDomId"),Xo=t((e)=>`usecase-${e.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element"}`,"usecaseNodeDomId"),Is=t((e,s)=>{if(s!=="markdown")return e;return cs(e).map((n)=>n.map((r)=>r.content).join(" ")).join(`
118
- `)},"getAccessibleLabel"),Yo=t((e)=>{let s=Is(e.label??e.id,e.labelType);if(Fr[e.shape]){let r=e.actorType&&e.actorType!=="normal"?`${e.actorType} `:"",a=e.business?"business ":"",o=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${a}${r}actor ${s}${o}`}if(e.shape==="note")return`Note for ${e.noteTargetLabel??e.noteTarget??""}: ${s}`;if(e.shape==="usecaseJsonTable"){let r=(e.jsonRows??[]).map((a)=>`${a.accessibleKey}: ${a.value}`).join("; ");return r?`${s}: ${r}`:s}let n=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${e.business?"business ":""}use case ${s}${n}`},"getUsecaseNodeAccessibleName"),qo=t((e)=>`${e.boundaryType} system boundary ${Is(e.label??e.id,e.labelType)}`,"getUsecaseBoundaryAccessibleName"),Jo=t((e)=>{if(e.relationshipType==="note")return"";return`${e.relationshipType==="association"&&e.label?`association ${Is(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`},"getUsecaseEdgeAccessibleName"),ht=t((e)=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"escapePlainLabel"),zi=t((e)=>e.replace(/([*[\\\]_`])/g,"\\$1"),"escapeMarkdownMarkers"),Zo=t((e,s)=>{e.diagramId=s,e.markers=[...Ho];for(let n of e.nodes){let r=n;if(r.domId=Xo(n.id),n.label!==void 0&&n.labelType==="text")n.label=ht(n.label);if(n.stereotype)n.stereotype=ht(n.stereotype);if(!n.isGroup&&n.shape==="usecaseJsonTable")n.jsonRows=n.jsonRows?.map((a)=>({...a,key:ht(a.key),value:ht(a.value)}));if(!n.isGroup&&(n.shape==="usecaseEllipse"||n.shape==="rect")&&n.stereotype){let a=n.label??ht(n.id);n.label=`«${zi(n.stereotype)}»<br/>${n.labelType==="text"?zi(a):a}`,n.labelType="markdown",r.hasFoldedStereotype=!0,delete n.stereotype}}for(let n of e.edges)if(n.label!==void 0&&n.labelType==="text")n.label=ht(n.label);return e},"prepareUsecaseLayoutData"),Qo=t((e,s,n)=>{for(let a of s.nodes){let o=typeof a.domId==="string"?a.domId:Vi(s.diagramId,a.id),c=e.select(`#${o}`),h=a.isGroup?"boundary":Fr[a.shape]?"actor":a.shape==="note"?"note":a.shape==="usecaseJsonTable"?"json":"usecase",l=n.nodes.get(a.id)??a.id;if(c.attr("data-usecase-id",a.id).attr("data-usecase-kind",h).attr("role","img").attr("aria-label",l),!a.isGroup&&(a.shape==="usecaseEllipse"||a.shape==="rect")&&"hasFoldedStereotype"in a&&a.hasFoldedStereotype===!0){let u=c.node(),p=u?.querySelector(".nodeLabel"),f=p?.querySelector("p")??p,E=f?.firstChild;if(f&&E?.nodeType===3){let T=f.ownerDocument.createElement("span");T.className="usecase-stereotype",f.insertBefore(T,E),T.appendChild(E)}else u?.querySelector(".label tspan tspan, .label tspan")?.classList.add("usecase-stereotype")}}let r=new Map(s.edges.map((a)=>[a.id,a]));e.selectAll('path[data-et="edge"]').each(function(){let a=r.get(this.getAttribute("data-id")??"");if(!a)return;let o=y(this);if(o.attr("id",Vi(s.diagramId,a.id)).attr("data-usecase-id",a.id).attr("data-usecase-kind",a.internal?"note-connector":"relationship"),a.internal)o.attr("aria-hidden","true");else o.attr("role","img").attr("aria-label",n.edges.get(a.id)??a.id)})},"annotateUsecaseElements"),Hi=t((e,s)=>{e.style("--mermaid-usecase-actor-font-size",`${s.actorFontSize}px`).style("--mermaid-usecase-actor-font-family",s.actorFontFamily).style("--mermaid-usecase-actor-font-weight",s.actorFontWeight).style("--mermaid-usecase-font-size",`${s.usecaseFontSize}px`).style("--mermaid-usecase-font-family",s.usecaseFontFamily).style("--mermaid-usecase-font-weight",s.usecaseFontWeight)},"applyUsecaseFonts"),el=t(async(e,s,n,r)=>{i.info("Drawing usecase diagram (unified)",s);let{layout:a}=d(),o=r.db,c=o.getData(),h=new Map(c.nodes.map((f)=>[f.id,Is(f.label??f.id,f.labelType)])),l={nodes:new Map(c.nodes.map((f)=>[f.id,f.isGroup?qo(f):Yo(f.shape==="note"?{...f,noteTargetLabel:h.get(f.noteTarget??"")}:f)])),edges:new Map(c.edges.map((f)=>[f.id,Jo({...f,sourceLabel:h.get(f.source)??f.sourceLabel,targetLabel:h.get(f.target)??f.targetLabel})]))},u=Ue(s,c.config.securityLevel);c.layoutAlgorithm=qe(a),Zo(c,s),Hi(u,c),await je(c,u),Qo(u,c,l);let p=c.diagramPadding;H.insertTitle(u,"usecaseDiagramTitleText",0,o.getDiagramTitle?.()??""),Ie(u,p,"usecaseDiagram",c.useMaxWidth),Hi(u,c)},"draw"),tl={draw:el},sl=t((e)=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),"roleColors"),nl=t((e)=>{let{theme:s,bkgColorArray:n,borderColorArray:r}=e;if(!Me(s,r))return"";let a=A().usecase?.colorScheme==="rotate",o=Re(e.look),c=o==="handDrawn",h=Oe(n),l="";for(let u=0;u<vn(r);u++){let p=r[u],f=h?`fill: ${n[u%n.length]};`:"",E=`[data-look="${o}"][data-color-id="color-${u}"]`;if(l+=`
119
-
120
- & ${E}.system-boundary rect.boundary-body,
121
- & ${E}.system-boundary rect.boundary-tab,
122
- & ${E}.system-boundary .boundary-body path,
123
- & ${E}.system-boundary .boundary-tab path {
124
- stroke: ${p};
125
- ${f}
126
- }
127
- `,!a)continue;l+=`
128
-
129
- /* Use case bodies -- \`.usecase-element\` covers the ellipse form, the \`[Rect]\` form and
130
- the business variant.
131
-
132
- Element selectors only, never a bare \`path\`. Under the handDrawn look roughjs draws
133
- the body as a *pair* of paths, an outline stroked in the border colour and a hachure
134
- fill stroked in the background colour, with no class to tell them apart. Stroking
135
- both repaints the fill lines as border colour and the shape collapses into a solid
136
- block -- which is what \`.usecase-element path\` did. So handDrawn bodies keep the
137
- theme's uniform colours, exactly as handDrawn flowchart nodes do. */
138
- & ${E}.usecase-element ellipse,
139
- & ${E}.usecase-element rect {
140
- stroke: ${p};
141
- ${f}
142
- }
143
-
144
- /* The business marker is a single classed path, so it can be reached safely by name --
145
- without it the marker keeps the uniform border beside a palette-coloured body. No
146
- \`fill\`: the marker is drawn with \`fill="none"\` and has to stay that way. */
147
- & ${E}.usecase-element .usecase-business-marker {
148
- stroke: ${p};
149
- }
150
-
151
- /* Actor glyphs, mirroring the uniform rule further down. The fill goes on the glyph
152
- group, never on its children, so the hollow variant's own \`fill="none"\` keeps
153
- winning and a hollow actor stays hollow. Same reason as above for not descending
154
- into the handDrawn paths. */
155
- & ${E}.usecase-actor .usecase-actor-shape,
156
- & ${E}.usecase-actor .usecase-actor-hollow,
157
- & ${E}.usecase-actor .usecase-actor-awesome,
158
- & ${E}.usecase-actor .usecase-actor-icon {
159
- stroke: ${p};
160
- ${f}
161
- }
162
- ${c?"":`
163
- /* The group rule above reaches the glyph by inheritance, which the neo look breaks: it
164
- ships a \`[data-look="neo"].node path { stroke }\` rule that hits the glyph's own paths,
165
- and a value set directly on the child always beats one inherited from the parent,
166
- whatever the parent rule's specificity. So name the children too.
167
-
168
- Emitted for every look *except* handDrawn, where roughjs draws the glyph as an
169
- outline path plus a hachure fill path stroked in the fill colour, indistinguishable
170
- in CSS -- stroking both turns a hollow actor into a solid disc. Deliberately no
171
- \`fill\` either way, so the hollow variant's own \`fill="none"\` keeps winning. */
172
- & ${E}.usecase-actor .usecase-actor-glyph path,
173
- & ${E}.usecase-actor .usecase-actor-glyph circle {
174
- stroke: ${p};
175
- }
176
- `}
177
- `}return l},"genColor");var il=t((e)=>{let s=sl(e),n=Re(e.look)==="handDrawn";return`
178
- ${nl(e)}
179
- & .usecase-actor {
180
- color: ${e.actorTextColor??e.primaryTextColor};
181
- }
182
-
183
- & .usecase-actor-shape,
184
- & .usecase-actor-hollow,
185
- & .usecase-actor-awesome,
186
- & .usecase-actor-icon {
187
- fill: ${s.actorBkg};
188
- stroke: ${s.actorBorder};
189
- stroke-width: 2px;
190
- }
191
- ${n?"":`
192
- /* The rule above colours the glyph group and lets its children inherit, which the neo
193
- look breaks: it ships a \`[data-look="neo"].node path { stroke }\` rule that lands on
194
- the glyph's own paths, and a value set directly on a child always beats one inherited
195
- from its parent, whatever the parent rule's specificity. Since neo is the default look,
196
- without this every actor renders in the node border colour rather than the actor
197
- colour the rule above asks for.
198
-
199
- \`.node\` is in the selector to outrank that neo rule rather than tie with it: both
200
- would otherwise be one attribute plus one class plus one element, leaving the winner to
201
- depend on which stylesheet is concatenated last.
202
-
203
- Stroke only: the hollow variant's own \`fill="none"\` has to keep winning. */
204
- & .node.usecase-actor .usecase-actor-glyph path,
205
- & .node.usecase-actor .usecase-actor-glyph circle {
206
- stroke: ${s.actorBorder};
207
- }
208
- `}
209
- & .usecase-actor .nodeLabel,
210
- & .actor-label {
211
- color: ${e.actorTextColor??e.primaryTextColor};
212
- fill: ${e.actorTextColor??e.primaryTextColor};
213
- font-family: var(--mermaid-usecase-actor-font-family, ${e.fontFamily});
214
- font-size: var(--mermaid-usecase-actor-font-size, 14px);
215
- font-weight: var(--mermaid-usecase-actor-font-weight, normal);
216
- }
217
-
218
- & .usecase-element ellipse,
219
- & .usecase-element rect,
220
- & .usecase-business ellipse,
221
- & .usecase-business rect {
222
- fill: ${s.bkg};
223
- stroke: ${s.border};
224
- stroke-width: 2px;
225
- }
226
- ${n?"":`
227
- /* The same interception the actor glyph hits, one element down: neo ships
228
- \`[data-look="neo"].node rect { stroke: nodeBorder }\`, which outranks the plain
229
- \`.usecase-element rect\` above, so a use case written in the \`[Rect]\` form kept the node
230
- border colour while its ellipse siblings took the role colour. An \`<ellipse>\` has no
231
- equivalent neo rule and is already correct; restating it here costs nothing and means
232
- the two forms cannot drift apart again.
233
-
234
- Qualified with \`[data-look]\` *and* \`.node\` to land strictly above that rule rather than
235
- tie with it -- on a tie the later stylesheet would win, which is how neo took this in
236
- the first place. Skipped under handDrawn, where roughjs draws paths and neither element
237
- exists. */
238
- & [data-look="${Re(e.look)}"].node.usecase-element ellipse,
239
- & [data-look="${Re(e.look)}"].node.usecase-element rect {
240
- fill: ${s.bkg};
241
- stroke: ${s.border};
242
- }
243
-
244
- /* The business marker is a \`<path>\`, so it loses to \`[data-look="neo"].node path\` the same
245
- way. No \`fill\`: the marker is drawn with \`fill="none"\` and has to stay that way. */
246
- & [data-look="${Re(e.look)}"].node.usecase-element .usecase-business-marker {
247
- stroke: ${s.border};
248
- }
249
- `}
250
- & .usecase-element .nodeLabel,
251
- & .usecase-label {
252
- color: ${e.primaryTextColor};
253
- fill: ${e.primaryTextColor};
254
- font-family: var(--mermaid-usecase-font-family, ${e.fontFamily});
255
- font-size: var(--mermaid-usecase-font-size, 12px);
256
- font-weight: var(--mermaid-usecase-font-weight, normal);
257
- }
258
-
259
- & .usecase-stereotype,
260
- & .usecase-business-marker {
261
- color: ${e.primaryTextColor};
262
- fill: ${e.primaryTextColor};
263
- stroke: ${s.border};
264
- }
265
-
266
- & .system-boundary rect.boundary-body,
267
- & .system-boundary rect.boundary-tab,
268
- & .system-boundary-package-tab {
269
- fill: ${s.boundaryBkg};
270
- stroke: ${s.boundaryBorder};
271
- stroke-width: 1px;
272
- }
273
-
274
- & .system-boundary-title text {
275
- fill: ${e.titleColor??e.primaryTextColor};
276
- }
277
-
278
- /* Only the span, never the <p> inside it: the renderer puts a user-supplied
279
- 'color' on the span, and that has to stay inheritable by its children. */
280
- & .system-boundary-title span {
281
- color: ${e.titleColor??e.primaryTextColor};
282
- }
283
-
284
- & .usecase-note {
285
- fill: ${e.noteBkgColor};
286
- stroke: ${e.noteBorderColor};
287
- color: ${e.noteTextColor};
288
- }
289
-
290
- & .usecase-note .nodeLabel {
291
- color: ${e.noteTextColor};
292
- fill: ${e.noteTextColor};
293
- }
294
-
295
- & .usecase-json-table,
296
- & .usecase-json-table rect,
297
- & .usecase-json-cell {
298
- fill: ${e.mainBkg};
299
- stroke: ${e.nodeBorder??e.primaryColor};
300
- }
301
-
302
- & .usecase-json-title,
303
- & .usecase-json-key,
304
- & .usecase-json-value {
305
- color: ${e.primaryTextColor};
306
- fill: ${e.primaryTextColor};
307
- }
308
-
309
- & .relationship {
310
- fill: none;
311
- stroke: ${e.lineColor};
312
- }
313
-
314
- & .relationship-include,
315
- & .relationship-extend,
316
- & .relationship-note {
317
- stroke-dasharray: 3;
318
- }
319
-
320
- /* Include and extend are both dashed, which is a weak distinction at small sizes. The
321
- tokens default to \`lineColor\`, so a theme that does not set them is unchanged. */
322
- & .relationship-include {
323
- stroke: ${s.includeLine};
324
- }
325
-
326
- & .relationship-extend {
327
- stroke: ${s.extendLine};
328
- }
329
-
330
- & .relationship.edge-animation-fast,
331
- & .relationship.edge-animation-slow {
332
- stroke-linecap: round;
333
- }
334
-
335
- & .edgeLabel,
336
- & .edgeLabel p {
337
- background-color: ${e.edgeLabelBackground};
338
- }
339
-
340
- & .labelBkg {
341
- background-color: ${e.edgeLabelBackground};
342
- padding: 0 2px;
343
- }
344
-
345
- & .edgeLabel .label rect {
346
- fill: ${e.edgeLabelBackground};
347
- }
348
-
349
- & .relationship-label,
350
- & .edgeLabel {
351
- color: ${e.primaryTextColor};
352
- fill: ${e.primaryTextColor};
353
- font-family: ${e.fontFamily};
354
- font-size: 10px;
355
- font-weight: normal;
356
- }
357
-
358
- & .marker,
359
- & .marker.point,
360
- & .marker.circle,
361
- & .marker.cross {
362
- fill: ${e.lineColor};
363
- stroke: ${e.lineColor};
364
- }
365
-
366
- & .marker.extension {
367
- fill: ${e.mainBkg};
368
- stroke: ${e.lineColor};
369
- }
370
- `},"getStyles"),rl=il,ed={parser:zo,db:Ns,renderer:tl,styles:rl};export{ed as diagram};