@bkm016/basalt 0.1.18 → 0.1.20

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 (979) hide show
  1. package/README.md +1 -1
  2. package/chunk-0b2brwjc.js +3 -0
  3. package/chunk-0bgg0hdd.js +2 -0
  4. package/chunk-0g8rtf05.js +18 -0
  5. package/chunk-0wwd4q6h.js +5 -0
  6. package/chunk-11xxfc0x.js +3 -0
  7. package/chunk-1gaj43fx.js +2 -0
  8. package/chunk-1tbv5t08.js +5 -0
  9. package/chunk-204c01mz.js +25 -0
  10. package/chunk-29g01nrz.js +20 -0
  11. package/chunk-2fts9k52.js +3 -0
  12. package/chunk-30bbdzma.js +16 -0
  13. package/chunk-3phf8eg6.js +3 -0
  14. package/chunk-3r38vbt5.js +2 -0
  15. package/chunk-3sg32v3n.js +2 -0
  16. package/chunk-4dgqcp6q.js +2 -0
  17. package/chunk-4fbj3k59.js +3 -0
  18. package/chunk-4wc2gbhe.js +2 -0
  19. package/chunk-51pfvmhh.js +470 -0
  20. package/chunk-5e7yegea.js +2 -0
  21. package/chunk-5ja0vsam.js +10 -0
  22. package/chunk-5tsfqsmf.js +2 -0
  23. package/chunk-6en06hkk.js +2 -0
  24. package/chunk-6hatfwsq.js +2 -0
  25. package/chunk-78ky455y.js +4 -0
  26. package/chunk-7kz9435k.js +11 -0
  27. package/chunk-8mqaq042.js +2 -0
  28. package/chunk-9qzyn98b.js +3 -0
  29. package/chunk-a1vdrgsh.js +59 -0
  30. package/chunk-a2z1cy84.js +2 -0
  31. package/chunk-a3fpx924.js +3 -0
  32. package/chunk-agb771ak.js +3 -0
  33. package/chunk-ak9rkrf3.js +5 -0
  34. package/chunk-as2mwf79.js +2 -0
  35. package/chunk-bkhsva5n.js +7 -0
  36. package/chunk-c5pg2875.js +3552 -0
  37. package/chunk-cks36jdh.js +8 -0
  38. package/chunk-cwrf78vs.js +3 -0
  39. package/chunk-d2f0hq8z.js +2 -0
  40. package/chunk-e0ytnnwt.js +3 -0
  41. package/chunk-e3bgzeb3.js +3 -0
  42. package/chunk-enmrpjpt.js +3 -0
  43. package/chunk-eps1epfr.js +4 -0
  44. package/chunk-ewr51fwc.js +3 -0
  45. package/chunk-eyyxqb6y.js +7 -0
  46. package/chunk-fgjw0r6g.js +12 -0
  47. package/chunk-g9hsrrj5.js +2 -0
  48. package/chunk-gg3kfa12.js +3 -0
  49. package/chunk-gpceyezp.js +2 -0
  50. package/chunk-gs5aebwh.js +2 -0
  51. package/chunk-h2pp8mnh.js +4 -0
  52. package/chunk-h4n0gg11.js +2 -0
  53. package/chunk-jzya0e5n.js +7 -0
  54. package/chunk-mde2dd79.js +2 -0
  55. package/chunk-ncb0tyaw.js +2 -0
  56. package/chunk-np2xnt1g.js +3 -0
  57. package/chunk-nszq2z0w.js +2 -0
  58. package/chunk-p0e82mee.js +3 -0
  59. package/chunk-qxpx8dn6.js +12 -0
  60. package/chunk-s819vmwh.js +3 -0
  61. package/chunk-s8m4svhf.js +3 -0
  62. package/chunk-sm9fpy18.js +390 -0
  63. package/chunk-svx7mz0w.js +25 -0
  64. package/chunk-tb3zsqe8.js +3 -0
  65. package/chunk-tp885r8h.js +39 -0
  66. package/chunk-tpeg9fkd.js +2 -0
  67. package/chunk-tpetsqzt.js +9 -0
  68. package/chunk-v0mw006s.js +15 -0
  69. package/chunk-v7da0aqn.js +7 -0
  70. package/chunk-vzrmdaba.js +2 -0
  71. package/chunk-w045zk55.js +2 -0
  72. package/chunk-w6nc3jn7.js +2 -0
  73. package/chunk-w9fdcchk.js +3 -0
  74. package/chunk-wj09qkyw.js +3 -0
  75. package/chunk-x1y4s01x.js +31 -0
  76. package/chunk-y3vap4a1.js +10 -0
  77. package/chunk-y83tnkr3.js +11 -0
  78. package/chunk-yk29stq0.js +5 -0
  79. package/chunk-ys2fds2x.js +3 -0
  80. package/chunk-yshdvnsp.js +2 -0
  81. package/chunk-z9p2ry9w.js +3 -0
  82. package/chunk-zkjnt298.js +3 -0
  83. package/compiled.js +10 -10
  84. package/package.json +1 -1
  85. package/ui-test-worker.js +37 -37
  86. package/web/chunk-08w40agf.js +34 -0
  87. package/web/chunk-08w40agf.js.br +0 -0
  88. package/web/chunk-08w40agf.js.gz +0 -0
  89. package/web/chunk-0bfypmyv.js +1 -0
  90. package/web/chunk-0bfypmyv.js.br +2 -0
  91. package/web/chunk-0bfypmyv.js.gz +0 -0
  92. package/web/chunk-0h0whn75.js +24 -0
  93. package/web/chunk-0h0whn75.js.br +0 -0
  94. package/web/chunk-0h0whn75.js.gz +0 -0
  95. package/web/chunk-0pzs9k06.js +1 -0
  96. package/web/chunk-0pzs9k06.js.br +0 -0
  97. package/web/chunk-0pzs9k06.js.gz +0 -0
  98. package/web/chunk-0rvx1z2b.js +1 -0
  99. package/web/chunk-0rvx1z2b.js.br +0 -0
  100. package/web/chunk-0rvx1z2b.js.gz +0 -0
  101. package/web/chunk-0tcmnvab.js +2 -0
  102. package/web/chunk-0tcmnvab.js.br +0 -0
  103. package/web/chunk-0tcmnvab.js.gz +0 -0
  104. package/web/chunk-0wqmwnd8.js +2 -0
  105. package/web/chunk-0wqmwnd8.js.br +0 -0
  106. package/web/chunk-0wqmwnd8.js.gz +0 -0
  107. package/web/chunk-0z10aqp1.js +2 -0
  108. package/web/chunk-0z10aqp1.js.br +0 -0
  109. package/web/chunk-0z10aqp1.js.gz +0 -0
  110. package/web/chunk-12vcrj7y.js +1 -0
  111. package/web/chunk-12vcrj7y.js.br +0 -0
  112. package/web/chunk-12vcrj7y.js.gz +0 -0
  113. package/web/chunk-186rp10x.js +62 -0
  114. package/web/chunk-186rp10x.js.br +0 -0
  115. package/web/chunk-186rp10x.js.gz +0 -0
  116. package/web/chunk-1cwyy3gh.js +2 -0
  117. package/web/chunk-1cwyy3gh.js.br +0 -0
  118. package/web/chunk-1cwyy3gh.js.gz +0 -0
  119. package/web/chunk-1ecsxh85.js +1 -0
  120. package/web/chunk-1ecsxh85.js.br +0 -0
  121. package/web/chunk-1ecsxh85.js.gz +0 -0
  122. package/web/chunk-1ghnag5v.js +2 -0
  123. package/web/chunk-1ghnag5v.js.br +0 -0
  124. package/web/chunk-1ghnag5v.js.gz +0 -0
  125. package/web/chunk-1ps9fj5n.js +2 -0
  126. package/web/chunk-1ps9fj5n.js.br +0 -0
  127. package/web/chunk-1ps9fj5n.js.gz +0 -0
  128. package/web/chunk-1ratg1jd.js +332 -0
  129. package/web/chunk-1ratg1jd.js.br +0 -0
  130. package/web/chunk-1ratg1jd.js.gz +0 -0
  131. package/web/chunk-1yvcxpp2.js +7 -0
  132. package/web/chunk-1yvcxpp2.js.br +0 -0
  133. package/web/chunk-1yvcxpp2.js.gz +0 -0
  134. package/web/chunk-2r3w0pt0.js +8 -0
  135. package/web/chunk-2r3w0pt0.js.br +0 -0
  136. package/web/chunk-2r3w0pt0.js.gz +0 -0
  137. package/web/chunk-2rnnvxa5.js +291 -0
  138. package/web/chunk-2rnnvxa5.js.br +0 -0
  139. package/web/chunk-2rnnvxa5.js.gz +0 -0
  140. package/web/chunk-2stffcvc.js +1 -0
  141. package/web/chunk-2stffcvc.js.br +0 -0
  142. package/web/chunk-2stffcvc.js.gz +0 -0
  143. package/web/chunk-2svqgkqw.js +1 -0
  144. package/web/chunk-2svqgkqw.js.br +0 -0
  145. package/web/chunk-2svqgkqw.js.gz +0 -0
  146. package/web/chunk-366a11ec.js +1 -0
  147. package/web/chunk-366a11ec.js.br +0 -0
  148. package/web/chunk-366a11ec.js.gz +0 -0
  149. package/web/chunk-37hmswdk.js +7 -0
  150. package/web/chunk-37hmswdk.js.br +0 -0
  151. package/web/chunk-37hmswdk.js.gz +0 -0
  152. package/web/chunk-3fd6mgf0.js +1 -0
  153. package/web/chunk-3fd6mgf0.js.br +0 -0
  154. package/web/chunk-3fd6mgf0.js.gz +0 -0
  155. package/web/chunk-4mypk63p.js +2 -0
  156. package/web/chunk-4mypk63p.js.br +0 -0
  157. package/web/chunk-4mypk63p.js.gz +0 -0
  158. package/web/chunk-52tt9qt4.js +2 -0
  159. package/web/chunk-52tt9qt4.js.br +0 -0
  160. package/web/chunk-52tt9qt4.js.gz +0 -0
  161. package/web/chunk-53cg6pxm.js +142 -0
  162. package/web/chunk-53cg6pxm.js.br +0 -0
  163. package/web/chunk-53cg6pxm.js.gz +0 -0
  164. package/web/chunk-59h87pvn.js +12 -0
  165. package/web/chunk-59h87pvn.js.br +0 -0
  166. package/web/chunk-59h87pvn.js.gz +0 -0
  167. package/web/chunk-5cp4n5ck.js +2 -0
  168. package/web/chunk-5cp4n5ck.js.br +0 -0
  169. package/web/chunk-5cp4n5ck.js.gz +0 -0
  170. package/web/chunk-6a3wt5c5.js +30 -0
  171. package/web/chunk-6a3wt5c5.js.br +0 -0
  172. package/web/chunk-6a3wt5c5.js.gz +0 -0
  173. package/web/chunk-6n1ha6ta.js +7 -0
  174. package/web/chunk-6n1ha6ta.js.br +0 -0
  175. package/web/chunk-6n1ha6ta.js.gz +0 -0
  176. package/web/chunk-6pbhqbv0.js +1 -0
  177. package/web/chunk-6pbhqbv0.js.br +0 -0
  178. package/web/chunk-6pbhqbv0.js.gz +0 -0
  179. package/web/chunk-72st75n7.js +70 -0
  180. package/web/chunk-72st75n7.js.br +0 -0
  181. package/web/chunk-72st75n7.js.gz +0 -0
  182. package/web/chunk-7cf1kk45.js +1 -0
  183. package/web/chunk-7cf1kk45.js.br +2 -0
  184. package/web/chunk-7cf1kk45.js.gz +0 -0
  185. package/web/chunk-7h59ac2b.js +38 -0
  186. package/web/chunk-7h59ac2b.js.br +0 -0
  187. package/web/chunk-7h59ac2b.js.gz +0 -0
  188. package/web/chunk-81xbfpbq.js +41 -0
  189. package/web/chunk-81xbfpbq.js.br +0 -0
  190. package/web/chunk-81xbfpbq.js.gz +0 -0
  191. package/web/chunk-82q4e8ff.js +1 -0
  192. package/web/chunk-82q4e8ff.js.br +0 -0
  193. package/web/chunk-82q4e8ff.js.gz +0 -0
  194. package/web/chunk-89crtpnw.js +1 -0
  195. package/web/chunk-89crtpnw.js.br +0 -0
  196. package/web/chunk-89crtpnw.js.gz +0 -0
  197. package/web/chunk-89e8629e.js +1 -0
  198. package/web/chunk-89e8629e.js.br +0 -0
  199. package/web/chunk-89e8629e.js.gz +0 -0
  200. package/web/chunk-9n1nsdqs.js +1 -0
  201. package/web/chunk-9n1nsdqs.js.br +0 -0
  202. package/web/chunk-9n1nsdqs.js.gz +0 -0
  203. package/web/chunk-9r7nbre7.js +2 -0
  204. package/web/chunk-9r7nbre7.js.br +0 -0
  205. package/web/chunk-9r7nbre7.js.gz +0 -0
  206. package/web/chunk-9y9nwaqj.js +1 -0
  207. package/web/chunk-9y9nwaqj.js.br +0 -0
  208. package/web/chunk-9y9nwaqj.js.gz +0 -0
  209. package/web/chunk-a8qe7kvz.js +1 -0
  210. package/web/chunk-a8qe7kvz.js.br +0 -0
  211. package/web/chunk-a8qe7kvz.js.gz +0 -0
  212. package/web/chunk-ahdca62g.js +1 -0
  213. package/web/chunk-ahdca62g.js.br +0 -0
  214. package/web/chunk-ahdca62g.js.gz +0 -0
  215. package/web/chunk-apr33amc.js +140 -0
  216. package/web/chunk-apr33amc.js.br +0 -0
  217. package/web/chunk-apr33amc.js.gz +0 -0
  218. package/web/chunk-aw9bwd4w.js +3 -0
  219. package/web/chunk-aw9bwd4w.js.br +0 -0
  220. package/web/chunk-aw9bwd4w.js.gz +0 -0
  221. package/web/chunk-bg0qgabv.js +1 -0
  222. package/web/chunk-bg0qgabv.js.br +0 -0
  223. package/web/chunk-bg0qgabv.js.gz +0 -0
  224. package/web/chunk-bks2k04k.js +2 -0
  225. package/web/chunk-bks2k04k.js.br +0 -0
  226. package/web/chunk-bks2k04k.js.gz +0 -0
  227. package/web/chunk-c28crzwk.js +120 -0
  228. package/web/chunk-c28crzwk.js.br +0 -0
  229. package/web/chunk-c28crzwk.js.gz +0 -0
  230. package/web/chunk-cmhxtckb.js +2 -0
  231. package/web/chunk-cmhxtckb.js.br +0 -0
  232. package/web/chunk-cmhxtckb.js.gz +0 -0
  233. package/web/chunk-d7f85w1y.js +1 -0
  234. package/web/chunk-d7f85w1y.js.br +0 -0
  235. package/web/chunk-d7f85w1y.js.gz +0 -0
  236. package/web/chunk-dmhezjv3.js +217 -0
  237. package/web/chunk-dmhezjv3.js.br +0 -0
  238. package/web/chunk-dmhezjv3.js.gz +0 -0
  239. package/web/chunk-dmzvhbpn.js +292 -0
  240. package/web/chunk-dmzvhbpn.js.br +0 -0
  241. package/web/chunk-dmzvhbpn.js.gz +0 -0
  242. package/web/chunk-e2z3kdhw.js +39 -0
  243. package/web/chunk-e2z3kdhw.js.br +0 -0
  244. package/web/chunk-e2z3kdhw.js.gz +0 -0
  245. package/web/chunk-e65y60v1.js +2 -0
  246. package/web/chunk-e65y60v1.js.br +0 -0
  247. package/web/chunk-e65y60v1.js.gz +0 -0
  248. package/web/chunk-ed8qqn45.js +2 -0
  249. package/web/chunk-ed8qqn45.js.br +0 -0
  250. package/web/chunk-ed8qqn45.js.gz +0 -0
  251. package/web/chunk-ef1h0tt7.js +2 -0
  252. package/web/chunk-ef1h0tt7.js.br +0 -0
  253. package/web/chunk-ef1h0tt7.js.gz +0 -0
  254. package/web/chunk-eqmghkwh.js +1 -0
  255. package/web/chunk-eqmghkwh.js.br +0 -0
  256. package/web/chunk-eqmghkwh.js.gz +0 -0
  257. package/web/chunk-esckazz2.js +1 -0
  258. package/web/chunk-esckazz2.js.br +0 -0
  259. package/web/chunk-esckazz2.js.gz +0 -0
  260. package/web/chunk-ezj5rjqr.js +4 -0
  261. package/web/chunk-ezj5rjqr.js.br +0 -0
  262. package/web/chunk-ezj5rjqr.js.gz +0 -0
  263. package/web/chunk-fjrgg82c.js +139 -0
  264. package/web/chunk-fjrgg82c.js.br +0 -0
  265. package/web/chunk-fjrgg82c.js.gz +0 -0
  266. package/web/chunk-g3vbtxgy.js +2 -0
  267. package/web/chunk-g3vbtxgy.js.br +0 -0
  268. package/web/chunk-g3vbtxgy.js.gz +0 -0
  269. package/web/chunk-gbcf0rdk.js +1 -0
  270. package/web/chunk-gbcf0rdk.js.br +0 -0
  271. package/web/chunk-gbcf0rdk.js.gz +0 -0
  272. package/web/chunk-gj6bdv1y.js +200 -0
  273. package/web/chunk-gj6bdv1y.js.br +0 -0
  274. package/web/chunk-gj6bdv1y.js.gz +0 -0
  275. package/web/chunk-gk1bc3c3.js +2 -0
  276. package/web/chunk-gk1bc3c3.js.br +0 -0
  277. package/web/chunk-gk1bc3c3.js.gz +0 -0
  278. package/web/chunk-gpjytpyw.js +2 -0
  279. package/web/chunk-gpjytpyw.js.br +0 -0
  280. package/web/chunk-gpjytpyw.js.gz +0 -0
  281. package/web/chunk-h1c0m3g4.js +99 -0
  282. package/web/chunk-h1c0m3g4.js.br +0 -0
  283. package/web/chunk-h1c0m3g4.js.gz +0 -0
  284. package/web/chunk-h1qv0cpd.css +1 -0
  285. package/web/chunk-h1qv0cpd.css.br +0 -0
  286. package/web/chunk-h1qv0cpd.css.gz +0 -0
  287. package/web/chunk-hj067dfg.js +1 -0
  288. package/web/chunk-hj067dfg.js.br +2 -0
  289. package/web/chunk-hj067dfg.js.gz +0 -0
  290. package/web/chunk-hq7e5xgd.js +1 -0
  291. package/web/chunk-hq7e5xgd.js.br +0 -0
  292. package/web/chunk-hq7e5xgd.js.gz +0 -0
  293. package/web/chunk-hqt1f3fm.js +24 -0
  294. package/web/chunk-hqt1f3fm.js.br +0 -0
  295. package/web/chunk-hqt1f3fm.js.gz +0 -0
  296. package/web/chunk-hwxj58j5.js +2 -0
  297. package/web/chunk-hwxj58j5.js.br +0 -0
  298. package/web/chunk-hwxj58j5.js.gz +0 -0
  299. package/web/chunk-hxzb25a8.js +1 -0
  300. package/web/chunk-hxzb25a8.js.br +0 -0
  301. package/web/chunk-hxzb25a8.js.gz +0 -0
  302. package/web/chunk-j4942vkb.js +1 -0
  303. package/web/chunk-j4942vkb.js.br +0 -0
  304. package/web/chunk-j4942vkb.js.gz +0 -0
  305. package/web/chunk-jmnzcm1f.js +21 -0
  306. package/web/chunk-jmnzcm1f.js.br +0 -0
  307. package/web/chunk-jmnzcm1f.js.gz +0 -0
  308. package/web/chunk-js940jjj.js +40 -0
  309. package/web/chunk-js940jjj.js.br +0 -0
  310. package/web/chunk-js940jjj.js.gz +0 -0
  311. package/web/chunk-jy9vkfbf.js +1 -0
  312. package/web/chunk-jy9vkfbf.js.br +0 -0
  313. package/web/chunk-jy9vkfbf.js.gz +0 -0
  314. package/web/chunk-k1d0y72z.js +2 -0
  315. package/web/chunk-k1d0y72z.js.br +0 -0
  316. package/web/chunk-k1d0y72z.js.gz +0 -0
  317. package/web/chunk-k4pknkvp.js +16 -0
  318. package/web/chunk-k4pknkvp.js.br +0 -0
  319. package/web/chunk-k4pknkvp.js.gz +0 -0
  320. package/web/chunk-k6fwzn0z.js +324 -0
  321. package/web/chunk-k6fwzn0z.js.br +0 -0
  322. package/web/chunk-k6fwzn0z.js.gz +0 -0
  323. package/web/chunk-kdegb6pd.js +169 -0
  324. package/web/chunk-kdegb6pd.js.br +0 -0
  325. package/web/chunk-kdegb6pd.js.gz +0 -0
  326. package/web/chunk-kedjfh66.js +2 -0
  327. package/web/chunk-kedjfh66.js.br +0 -0
  328. package/web/chunk-kedjfh66.js.gz +0 -0
  329. package/web/chunk-kh0xyffx.js +1 -0
  330. package/web/chunk-kh0xyffx.js.br +0 -0
  331. package/web/chunk-kh0xyffx.js.gz +0 -0
  332. package/web/chunk-ktvxgxsd.js +2 -0
  333. package/web/chunk-ktvxgxsd.js.br +0 -0
  334. package/web/chunk-ktvxgxsd.js.gz +0 -0
  335. package/web/chunk-mbpv2w5h.js +78 -0
  336. package/web/chunk-mbpv2w5h.js.br +0 -0
  337. package/web/chunk-mbpv2w5h.js.gz +0 -0
  338. package/web/chunk-mh3nkkpx.js +84 -0
  339. package/web/chunk-mh3nkkpx.js.br +0 -0
  340. package/web/chunk-mh3nkkpx.js.gz +0 -0
  341. package/web/chunk-mhzqgzh0.js +89 -0
  342. package/web/chunk-mhzqgzh0.js.br +0 -0
  343. package/web/chunk-mhzqgzh0.js.gz +0 -0
  344. package/web/chunk-mj8dzc8q.js +214 -0
  345. package/web/chunk-mj8dzc8q.js.br +0 -0
  346. package/web/chunk-mj8dzc8q.js.gz +0 -0
  347. package/web/chunk-mwfrxgbs.js +2 -0
  348. package/web/chunk-mwfrxgbs.js.br +0 -0
  349. package/web/chunk-mwfrxgbs.js.gz +0 -0
  350. package/web/chunk-n419cees.js +1 -0
  351. package/web/chunk-n419cees.js.br +0 -0
  352. package/web/chunk-n419cees.js.gz +0 -0
  353. package/web/chunk-n45fgfyt.js +1 -0
  354. package/web/chunk-n45fgfyt.js.br +2 -0
  355. package/web/chunk-n45fgfyt.js.gz +0 -0
  356. package/web/chunk-n5v71fas.js +2 -0
  357. package/web/chunk-n5v71fas.js.br +0 -0
  358. package/web/chunk-n5v71fas.js.gz +0 -0
  359. package/web/chunk-nb58m79v.js +89 -0
  360. package/web/chunk-nb58m79v.js.br +0 -0
  361. package/web/chunk-nb58m79v.js.gz +0 -0
  362. package/web/chunk-nsna2v2r.js +1 -0
  363. package/web/chunk-nsna2v2r.js.br +0 -0
  364. package/web/chunk-nsna2v2r.js.gz +0 -0
  365. package/web/chunk-nxdp58nf.js +1 -0
  366. package/web/chunk-nxdp58nf.js.br +0 -0
  367. package/web/chunk-nxdp58nf.js.gz +0 -0
  368. package/web/chunk-nytgs01h.js +1 -0
  369. package/web/chunk-nytgs01h.js.br +0 -0
  370. package/web/chunk-nytgs01h.js.gz +0 -0
  371. package/web/chunk-p76f6cf4.js +2 -0
  372. package/web/chunk-p76f6cf4.js.br +0 -0
  373. package/web/chunk-p76f6cf4.js.gz +0 -0
  374. package/web/chunk-pkxn54jm.js +1 -0
  375. package/web/chunk-pkxn54jm.js.br +0 -0
  376. package/web/chunk-pkxn54jm.js.gz +0 -0
  377. package/web/chunk-q0srq8g5.js +1 -0
  378. package/web/chunk-q0srq8g5.js.br +0 -0
  379. package/web/chunk-q0srq8g5.js.gz +0 -0
  380. package/web/chunk-qgtqwmkb.js +1 -0
  381. package/web/chunk-qgtqwmkb.js.br +2 -0
  382. package/web/chunk-qgtqwmkb.js.gz +0 -0
  383. package/web/chunk-qjg6dw46.js +1134 -0
  384. package/web/chunk-qjg6dw46.js.br +0 -0
  385. package/web/chunk-qjg6dw46.js.gz +0 -0
  386. package/web/chunk-qjjxevxe.js +1 -0
  387. package/web/chunk-qjjxevxe.js.br +0 -0
  388. package/web/chunk-qjjxevxe.js.gz +0 -0
  389. package/web/chunk-qx5ab39c.js +4 -0
  390. package/web/chunk-qx5ab39c.js.br +0 -0
  391. package/web/chunk-qx5ab39c.js.gz +0 -0
  392. package/web/chunk-qygjhm63.js +1 -0
  393. package/web/chunk-qygjhm63.js.br +0 -0
  394. package/web/chunk-qygjhm63.js.gz +0 -0
  395. package/web/chunk-recfg8af.js +2 -0
  396. package/web/chunk-recfg8af.js.br +0 -0
  397. package/web/chunk-recfg8af.js.gz +0 -0
  398. package/web/chunk-rfsg5rke.js +1 -0
  399. package/web/chunk-rfsg5rke.js.br +2 -0
  400. package/web/chunk-rfsg5rke.js.gz +0 -0
  401. package/web/chunk-s7h50avx.js +2 -0
  402. package/web/chunk-s7h50avx.js.br +0 -0
  403. package/web/chunk-s7h50avx.js.gz +0 -0
  404. package/web/chunk-sk47kk5j.js +1 -0
  405. package/web/chunk-sk47kk5j.js.br +0 -0
  406. package/web/chunk-sk47kk5j.js.gz +0 -0
  407. package/web/chunk-t9heac9a.js +2 -0
  408. package/web/chunk-t9heac9a.js.br +0 -0
  409. package/web/chunk-t9heac9a.js.gz +0 -0
  410. package/web/chunk-tg3f9xmp.js +1 -0
  411. package/web/chunk-tg3f9xmp.js.br +0 -0
  412. package/web/chunk-tg3f9xmp.js.gz +0 -0
  413. package/web/chunk-tgeeggkh.js +1 -0
  414. package/web/chunk-tgeeggkh.js.br +0 -0
  415. package/web/chunk-tgeeggkh.js.gz +0 -0
  416. package/web/chunk-v2bkkhb8.js +303 -0
  417. package/web/chunk-v2bkkhb8.js.br +0 -0
  418. package/web/chunk-v2bkkhb8.js.gz +0 -0
  419. package/web/chunk-v5p2fds9.js +36 -0
  420. package/web/chunk-v5p2fds9.js.br +0 -0
  421. package/web/chunk-v5p2fds9.js.gz +0 -0
  422. package/web/chunk-v6snw1sw.js +1 -0
  423. package/web/chunk-v6snw1sw.js.br +0 -0
  424. package/web/chunk-v6snw1sw.js.gz +0 -0
  425. package/web/chunk-veadbga2.js +1 -0
  426. package/web/chunk-veadbga2.js.br +2 -0
  427. package/web/chunk-veadbga2.js.gz +0 -0
  428. package/web/chunk-vh2prc6k.js +1 -0
  429. package/web/chunk-vh2prc6k.js.br +0 -0
  430. package/web/chunk-vh2prc6k.js.gz +0 -0
  431. package/web/chunk-vhpzp7zd.js +2 -0
  432. package/web/chunk-vhpzp7zd.js.br +0 -0
  433. package/web/chunk-vhpzp7zd.js.gz +0 -0
  434. package/web/chunk-vpbnyz43.js +98 -0
  435. package/web/chunk-vpbnyz43.js.br +0 -0
  436. package/web/chunk-vpbnyz43.js.gz +0 -0
  437. package/web/chunk-vxadngbp.js +2 -0
  438. package/web/chunk-vxadngbp.js.br +3 -0
  439. package/web/chunk-vxadngbp.js.gz +0 -0
  440. package/web/chunk-wa8wr2y9.js +106 -0
  441. package/web/chunk-wa8wr2y9.js.br +0 -0
  442. package/web/chunk-wa8wr2y9.js.gz +0 -0
  443. package/web/chunk-wbxz2bjb.js +1 -0
  444. package/web/chunk-wbxz2bjb.js.br +0 -0
  445. package/web/chunk-wbxz2bjb.js.gz +0 -0
  446. package/web/chunk-wgzatts8.js +1 -0
  447. package/web/chunk-wgzatts8.js.br +0 -0
  448. package/web/chunk-wgzatts8.js.gz +0 -0
  449. package/web/chunk-whczyxqw.js +1 -0
  450. package/web/chunk-whczyxqw.js.br +0 -0
  451. package/web/chunk-whczyxqw.js.gz +0 -0
  452. package/web/chunk-wmzz2crn.js +1 -0
  453. package/web/chunk-wmzz2crn.js.br +0 -0
  454. package/web/chunk-wmzz2crn.js.gz +0 -0
  455. package/web/chunk-wvqcbp4a.js +1 -0
  456. package/web/chunk-wvqcbp4a.js.br +0 -0
  457. package/web/chunk-wvqcbp4a.js.gz +0 -0
  458. package/web/chunk-wvvrdqgb.js +1 -0
  459. package/web/chunk-wvvrdqgb.js.br +2 -0
  460. package/web/chunk-wvvrdqgb.js.gz +0 -0
  461. package/web/chunk-x2hxq5yr.js +55 -0
  462. package/web/chunk-x2hxq5yr.js.br +0 -0
  463. package/web/chunk-x2hxq5yr.js.gz +0 -0
  464. package/web/chunk-x8bnp6vr.js +1 -0
  465. package/web/chunk-x8bnp6vr.js.br +0 -0
  466. package/web/chunk-x8bnp6vr.js.gz +0 -0
  467. package/web/chunk-xp9tdb5t.js +1 -0
  468. package/web/chunk-xp9tdb5t.js.br +2 -0
  469. package/web/chunk-xp9tdb5t.js.gz +0 -0
  470. package/web/chunk-xvmzsftt.js +2 -0
  471. package/web/chunk-xvmzsftt.js.br +0 -0
  472. package/web/chunk-xvmzsftt.js.gz +0 -0
  473. package/web/chunk-y10hsdq4.js +1 -0
  474. package/web/chunk-y10hsdq4.js.br +0 -0
  475. package/web/chunk-y10hsdq4.js.gz +0 -0
  476. package/web/chunk-ye7vge7s.js +1 -0
  477. package/web/chunk-ye7vge7s.js.br +0 -0
  478. package/web/chunk-ye7vge7s.js.gz +0 -0
  479. package/web/chunk-zbzgd8kn.js +2 -0
  480. package/web/chunk-zbzgd8kn.js.br +0 -0
  481. package/web/chunk-zbzgd8kn.js.gz +0 -0
  482. package/web/chunk-zhwqscat.js +1 -0
  483. package/web/chunk-zhwqscat.js.br +0 -0
  484. package/web/chunk-zhwqscat.js.gz +0 -0
  485. package/web/chunk-znrsm604.js +370 -0
  486. package/web/chunk-znrsm604.js.br +0 -0
  487. package/web/chunk-znrsm604.js.gz +0 -0
  488. package/web/chunk-zthww0ws.js +1 -0
  489. package/web/chunk-zthww0ws.js.br +0 -0
  490. package/web/chunk-zthww0ws.js.gz +0 -0
  491. package/web/index.html +3 -1
  492. package/web/index.html.br +0 -0
  493. package/web/index.html.gz +0 -0
  494. package/worker.js +1 -1
  495. package/chunk-02q61grt.js +0 -3
  496. package/chunk-03r6s8pm.js +0 -2
  497. package/chunk-09fsdkd3.js +0 -5
  498. package/chunk-0bg4w7ht.js +0 -3
  499. package/chunk-0s4r7k7j.js +0 -2
  500. package/chunk-27kw4nth.js +0 -2
  501. package/chunk-2ag9mvms.js +0 -10
  502. package/chunk-2shwjp8q.js +0 -3
  503. package/chunk-3114vstw.js +0 -2
  504. package/chunk-31meb34a.js +0 -2
  505. package/chunk-34w345mt.js +0 -2
  506. package/chunk-3amfr8zp.js +0 -7
  507. package/chunk-40nk2jjt.js +0 -2
  508. package/chunk-49bz6hg5.js +0 -25
  509. package/chunk-4hgkwa4k.js +0 -3
  510. package/chunk-4wfd77kc.js +0 -2
  511. package/chunk-55kpabb3.js +0 -2
  512. package/chunk-5p2asrj6.js +0 -2
  513. package/chunk-65hg0v7e.js +0 -2
  514. package/chunk-67qw30cj.js +0 -3770
  515. package/chunk-6rehcf49.js +0 -12
  516. package/chunk-6vkz3wqz.js +0 -25
  517. package/chunk-81yk0kj2.js +0 -3
  518. package/chunk-885vf5kb.js +0 -2
  519. package/chunk-8wy08x0d.js +0 -2
  520. package/chunk-9cqa9trx.js +0 -4
  521. package/chunk-ae45qq4z.js +0 -2
  522. package/chunk-ag3em5yv.js +0 -4
  523. package/chunk-b5k5p49x.js +0 -2
  524. package/chunk-b84vbfjc.js +0 -2
  525. package/chunk-dkpgstr2.js +0 -18
  526. package/chunk-dzn4c87v.js +0 -3
  527. package/chunk-e5xsyr0n.js +0 -3
  528. package/chunk-f97ma522.js +0 -3
  529. package/chunk-f9yneea6.js +0 -3
  530. package/chunk-fk43jgwe.js +0 -31
  531. package/chunk-frjqjdkx.js +0 -11
  532. package/chunk-fycz7ap5.js +0 -2
  533. package/chunk-fzefs6kn.js +0 -3
  534. package/chunk-g1n8k4dg.js +0 -5
  535. package/chunk-g5mdw639.js +0 -3
  536. package/chunk-gnvx44kj.js +0 -10
  537. package/chunk-gpympx0t.js +0 -467
  538. package/chunk-gyp2jn7d.js +0 -3
  539. package/chunk-hambwbfz.js +0 -7
  540. package/chunk-j02kqpvq.js +0 -5
  541. package/chunk-j1h7pabk.js +0 -7
  542. package/chunk-j6hn9qz6.js +0 -3
  543. package/chunk-jfx4c32t.js +0 -8
  544. package/chunk-jjj8a18b.js +0 -59
  545. package/chunk-k3c32v59.js +0 -3
  546. package/chunk-k8j3fvx5.js +0 -2
  547. package/chunk-kcn3af9r.js +0 -12
  548. package/chunk-m45dpnd1.js +0 -16
  549. package/chunk-m4wf04dz.js +0 -15
  550. package/chunk-m8k6t63k.js +0 -2
  551. package/chunk-nrggp4x6.js +0 -2
  552. package/chunk-nt549hv5.js +0 -2
  553. package/chunk-pg4mtrdy.js +0 -3
  554. package/chunk-psr4rxnn.js +0 -20
  555. package/chunk-qhhv81gd.js +0 -2
  556. package/chunk-qprms4rt.js +0 -2
  557. package/chunk-r0pm6dap.js +0 -3
  558. package/chunk-rck0kx09.js +0 -2
  559. package/chunk-rsn8ad6s.js +0 -2
  560. package/chunk-skzh3q1s.js +0 -2
  561. package/chunk-sm4b3q49.js +0 -3
  562. package/chunk-ste3ek53.js +0 -3
  563. package/chunk-trw86cmb.js +0 -11
  564. package/chunk-tv7met41.js +0 -3
  565. package/chunk-w33aapmk.js +0 -39
  566. package/chunk-wkqrsfrb.js +0 -389
  567. package/chunk-wxngqzqs.js +0 -3
  568. package/chunk-xafx1p7z.js +0 -3
  569. package/chunk-xgfqmm46.js +0 -2
  570. package/chunk-xr77j4f8.js +0 -9
  571. package/chunk-ykstnss8.js +0 -3
  572. package/chunk-yqv7ej5r.js +0 -5
  573. package/chunk-z97bcdg2.js +0 -3
  574. package/chunk-z9s7pwv5.js +0 -7
  575. package/web/chunk-013et20n.js +0 -2
  576. package/web/chunk-013et20n.js.br +0 -0
  577. package/web/chunk-013et20n.js.gz +0 -0
  578. package/web/chunk-0ernj3c0.js +0 -1
  579. package/web/chunk-0ernj3c0.js.br +0 -0
  580. package/web/chunk-0ernj3c0.js.gz +0 -0
  581. package/web/chunk-0j65yg1p.js +0 -1
  582. package/web/chunk-0j65yg1p.js.br +0 -0
  583. package/web/chunk-0j65yg1p.js.gz +0 -0
  584. package/web/chunk-0khcpaa8.js +0 -1
  585. package/web/chunk-0khcpaa8.js.br +0 -0
  586. package/web/chunk-0khcpaa8.js.gz +0 -0
  587. package/web/chunk-0wbdd74r.js +0 -1
  588. package/web/chunk-0wbdd74r.js.br +0 -2
  589. package/web/chunk-0wbdd74r.js.gz +0 -0
  590. package/web/chunk-1f2wvhq9.js +0 -1
  591. package/web/chunk-1f2wvhq9.js.br +0 -0
  592. package/web/chunk-1f2wvhq9.js.gz +0 -0
  593. package/web/chunk-1q2kmv35.js +0 -332
  594. package/web/chunk-1q2kmv35.js.br +0 -0
  595. package/web/chunk-1q2kmv35.js.gz +0 -0
  596. package/web/chunk-1tfrm3pk.js +0 -2
  597. package/web/chunk-1tfrm3pk.js.br +0 -0
  598. package/web/chunk-1tfrm3pk.js.gz +0 -0
  599. package/web/chunk-2qt5fy5n.js +0 -1
  600. package/web/chunk-2qt5fy5n.js.br +0 -0
  601. package/web/chunk-2qt5fy5n.js.gz +0 -0
  602. package/web/chunk-2sxtb709.js +0 -1
  603. package/web/chunk-2sxtb709.js.br +0 -0
  604. package/web/chunk-2sxtb709.js.gz +0 -0
  605. package/web/chunk-2wrwm0qe.js +0 -1
  606. package/web/chunk-2wrwm0qe.js.br +0 -0
  607. package/web/chunk-2wrwm0qe.js.gz +0 -0
  608. package/web/chunk-2wwj27b9.js +0 -7
  609. package/web/chunk-2wwj27b9.js.br +0 -0
  610. package/web/chunk-2wwj27b9.js.gz +0 -0
  611. package/web/chunk-33mmrjdp.js +0 -1
  612. package/web/chunk-33mmrjdp.js.br +0 -2
  613. package/web/chunk-33mmrjdp.js.gz +0 -0
  614. package/web/chunk-33tb7q04.js +0 -2
  615. package/web/chunk-33tb7q04.js.br +0 -0
  616. package/web/chunk-33tb7q04.js.gz +0 -0
  617. package/web/chunk-3txb4sha.js +0 -1
  618. package/web/chunk-3txb4sha.js.br +0 -0
  619. package/web/chunk-3txb4sha.js.gz +0 -0
  620. package/web/chunk-3xgfsx7y.js +0 -2
  621. package/web/chunk-3xgfsx7y.js.br +0 -0
  622. package/web/chunk-3xgfsx7y.js.gz +0 -0
  623. package/web/chunk-40jka4r7.js +0 -2
  624. package/web/chunk-40jka4r7.js.br +0 -0
  625. package/web/chunk-40jka4r7.js.gz +0 -0
  626. package/web/chunk-41vh5n86.js +0 -1
  627. package/web/chunk-41vh5n86.js.br +0 -0
  628. package/web/chunk-41vh5n86.js.gz +0 -0
  629. package/web/chunk-5kz048x3.js +0 -2
  630. package/web/chunk-5kz048x3.js.br +0 -0
  631. package/web/chunk-5kz048x3.js.gz +0 -0
  632. package/web/chunk-5mbz8yj9.js +0 -3
  633. package/web/chunk-5mbz8yj9.js.br +0 -0
  634. package/web/chunk-5mbz8yj9.js.gz +0 -0
  635. package/web/chunk-6024wfxb.js +0 -30
  636. package/web/chunk-6024wfxb.js.br +0 -0
  637. package/web/chunk-6024wfxb.js.gz +0 -0
  638. package/web/chunk-6ey4c6gw.js +0 -2
  639. package/web/chunk-6ey4c6gw.js.br +0 -0
  640. package/web/chunk-6ey4c6gw.js.gz +0 -0
  641. package/web/chunk-6q3p851n.js +0 -1
  642. package/web/chunk-6q3p851n.js.br +0 -2
  643. package/web/chunk-6q3p851n.js.gz +0 -0
  644. package/web/chunk-74g3wh08.js +0 -2
  645. package/web/chunk-74g3wh08.js.br +0 -0
  646. package/web/chunk-74g3wh08.js.gz +0 -0
  647. package/web/chunk-78akzkgs.js +0 -84
  648. package/web/chunk-78akzkgs.js.br +0 -0
  649. package/web/chunk-78akzkgs.js.gz +0 -0
  650. package/web/chunk-7ck99bsp.js +0 -62
  651. package/web/chunk-7ck99bsp.js.br +0 -0
  652. package/web/chunk-7ck99bsp.js.gz +0 -0
  653. package/web/chunk-7fjbyns9.js +0 -1
  654. package/web/chunk-7fjbyns9.js.br +0 -0
  655. package/web/chunk-7fjbyns9.js.gz +0 -0
  656. package/web/chunk-7n6b2xra.js +0 -21
  657. package/web/chunk-7n6b2xra.js.br +0 -0
  658. package/web/chunk-7n6b2xra.js.gz +0 -0
  659. package/web/chunk-7p4mcqkd.js +0 -78
  660. package/web/chunk-7p4mcqkd.js.br +0 -0
  661. package/web/chunk-7p4mcqkd.js.gz +0 -0
  662. package/web/chunk-7ztwkhg5.js +0 -1
  663. package/web/chunk-7ztwkhg5.js.br +0 -0
  664. package/web/chunk-7ztwkhg5.js.gz +0 -0
  665. package/web/chunk-823etvc3.js +0 -99
  666. package/web/chunk-823etvc3.js.br +0 -0
  667. package/web/chunk-823etvc3.js.gz +0 -0
  668. package/web/chunk-8ec53vjd.js +0 -1
  669. package/web/chunk-8ec53vjd.js.br +0 -0
  670. package/web/chunk-8ec53vjd.js.gz +0 -0
  671. package/web/chunk-8g55ytgz.js +0 -1
  672. package/web/chunk-8g55ytgz.js.br +0 -0
  673. package/web/chunk-8g55ytgz.js.gz +0 -0
  674. package/web/chunk-8nxjthxc.js +0 -1
  675. package/web/chunk-8nxjthxc.js.br +0 -0
  676. package/web/chunk-8nxjthxc.js.gz +0 -0
  677. package/web/chunk-8q76yd76.js +0 -291
  678. package/web/chunk-8q76yd76.js.br +0 -0
  679. package/web/chunk-8q76yd76.js.gz +0 -0
  680. package/web/chunk-9kbrjmtz.js +0 -1
  681. package/web/chunk-9kbrjmtz.js.br +0 -0
  682. package/web/chunk-9kbrjmtz.js.gz +0 -0
  683. package/web/chunk-9s4bh6qm.js +0 -40
  684. package/web/chunk-9s4bh6qm.js.br +0 -0
  685. package/web/chunk-9s4bh6qm.js.gz +0 -0
  686. package/web/chunk-9vf3zy3d.js +0 -2
  687. package/web/chunk-9vf3zy3d.js.br +0 -0
  688. package/web/chunk-9vf3zy3d.js.gz +0 -0
  689. package/web/chunk-a449xjq6.js +0 -7
  690. package/web/chunk-a449xjq6.js.br +0 -0
  691. package/web/chunk-a449xjq6.js.gz +0 -0
  692. package/web/chunk-b05eay33.js +0 -1
  693. package/web/chunk-b05eay33.js.br +0 -0
  694. package/web/chunk-b05eay33.js.gz +0 -0
  695. package/web/chunk-bdypt5mj.js +0 -142
  696. package/web/chunk-bdypt5mj.js.br +0 -0
  697. package/web/chunk-bdypt5mj.js.gz +0 -0
  698. package/web/chunk-ccy2q2z0.js +0 -2
  699. package/web/chunk-ccy2q2z0.js.br +0 -0
  700. package/web/chunk-ccy2q2z0.js.gz +0 -0
  701. package/web/chunk-ceg13tma.js +0 -2
  702. package/web/chunk-ceg13tma.js.br +0 -0
  703. package/web/chunk-ceg13tma.js.gz +0 -0
  704. package/web/chunk-ch60a61d.js +0 -2
  705. package/web/chunk-ch60a61d.js.br +0 -0
  706. package/web/chunk-ch60a61d.js.gz +0 -0
  707. package/web/chunk-czvdg0c5.js +0 -1
  708. package/web/chunk-czvdg0c5.js.br +0 -0
  709. package/web/chunk-czvdg0c5.js.gz +0 -0
  710. package/web/chunk-drr7mqg2.js +0 -1
  711. package/web/chunk-drr7mqg2.js.br +0 -0
  712. package/web/chunk-drr7mqg2.js.gz +0 -0
  713. package/web/chunk-dsa5m3h6.js +0 -200
  714. package/web/chunk-dsa5m3h6.js.br +0 -0
  715. package/web/chunk-dsa5m3h6.js.gz +0 -0
  716. package/web/chunk-dww3grm3.js +0 -24
  717. package/web/chunk-dww3grm3.js.br +0 -0
  718. package/web/chunk-dww3grm3.js.gz +0 -0
  719. package/web/chunk-e187gt5x.js +0 -1
  720. package/web/chunk-e187gt5x.js.br +0 -0
  721. package/web/chunk-e187gt5x.js.gz +0 -0
  722. package/web/chunk-emxa4wv3.js +0 -2
  723. package/web/chunk-emxa4wv3.js.br +0 -0
  724. package/web/chunk-emxa4wv3.js.gz +0 -0
  725. package/web/chunk-ey0zwvbx.js +0 -1
  726. package/web/chunk-ey0zwvbx.js.br +0 -0
  727. package/web/chunk-ey0zwvbx.js.gz +0 -0
  728. package/web/chunk-ey14knbn.js +0 -2
  729. package/web/chunk-ey14knbn.js.br +0 -0
  730. package/web/chunk-ey14knbn.js.gz +0 -0
  731. package/web/chunk-fba06jm8.js +0 -1132
  732. package/web/chunk-fba06jm8.js.br +0 -0
  733. package/web/chunk-fba06jm8.js.gz +0 -0
  734. package/web/chunk-fh56vgfx.js +0 -39
  735. package/web/chunk-fh56vgfx.js.br +0 -0
  736. package/web/chunk-fh56vgfx.js.gz +0 -0
  737. package/web/chunk-ft05x3my.js +0 -169
  738. package/web/chunk-ft05x3my.js.br +0 -0
  739. package/web/chunk-ft05x3my.js.gz +0 -0
  740. package/web/chunk-fzmrnh17.js +0 -303
  741. package/web/chunk-fzmrnh17.js.br +0 -0
  742. package/web/chunk-fzmrnh17.js.gz +0 -0
  743. package/web/chunk-gbt7asd7.js +0 -2
  744. package/web/chunk-gbt7asd7.js.br +0 -0
  745. package/web/chunk-gbt7asd7.js.gz +0 -0
  746. package/web/chunk-gh9fkn3t.js +0 -1
  747. package/web/chunk-gh9fkn3t.js.br +0 -2
  748. package/web/chunk-gh9fkn3t.js.gz +0 -0
  749. package/web/chunk-h1syyjqq.js +0 -2
  750. package/web/chunk-h1syyjqq.js.br +0 -0
  751. package/web/chunk-h1syyjqq.js.gz +0 -0
  752. package/web/chunk-h7byk4z3.js +0 -140
  753. package/web/chunk-h7byk4z3.js.br +0 -0
  754. package/web/chunk-h7byk4z3.js.gz +0 -0
  755. package/web/chunk-hby0hkv4.js +0 -1
  756. package/web/chunk-hby0hkv4.js.br +0 -0
  757. package/web/chunk-hby0hkv4.js.gz +0 -0
  758. package/web/chunk-hjvsp2yx.js +0 -1
  759. package/web/chunk-hjvsp2yx.js.br +0 -0
  760. package/web/chunk-hjvsp2yx.js.gz +0 -0
  761. package/web/chunk-hpjzy5ww.js +0 -1
  762. package/web/chunk-hpjzy5ww.js.br +0 -0
  763. package/web/chunk-hpjzy5ww.js.gz +0 -0
  764. package/web/chunk-hzfp8kqx.js +0 -217
  765. package/web/chunk-hzfp8kqx.js.br +0 -0
  766. package/web/chunk-hzfp8kqx.js.gz +0 -0
  767. package/web/chunk-j6jjk46a.js +0 -2
  768. package/web/chunk-j6jjk46a.js.br +0 -0
  769. package/web/chunk-j6jjk46a.js.gz +0 -0
  770. package/web/chunk-j8f0m1dq.js +0 -1
  771. package/web/chunk-j8f0m1dq.js.br +0 -0
  772. package/web/chunk-j8f0m1dq.js.gz +0 -0
  773. package/web/chunk-jc178ad5.js +0 -2
  774. package/web/chunk-jc178ad5.js.br +0 -0
  775. package/web/chunk-jc178ad5.js.gz +0 -0
  776. package/web/chunk-jcsf0ke5.js +0 -41
  777. package/web/chunk-jcsf0ke5.js.br +0 -0
  778. package/web/chunk-jcsf0ke5.js.gz +0 -0
  779. package/web/chunk-jg43a2xk.js +0 -139
  780. package/web/chunk-jg43a2xk.js.br +0 -0
  781. package/web/chunk-jg43a2xk.js.gz +0 -0
  782. package/web/chunk-jrgdxqtq.js +0 -7
  783. package/web/chunk-jrgdxqtq.js.br +0 -0
  784. package/web/chunk-jrgdxqtq.js.gz +0 -0
  785. package/web/chunk-js8dvtfg.js +0 -2
  786. package/web/chunk-js8dvtfg.js.br +0 -0
  787. package/web/chunk-js8dvtfg.js.gz +0 -0
  788. package/web/chunk-jt0s9qs7.js +0 -1
  789. package/web/chunk-jt0s9qs7.js.br +0 -0
  790. package/web/chunk-jt0s9qs7.js.gz +0 -0
  791. package/web/chunk-jv5faf88.js +0 -34
  792. package/web/chunk-jv5faf88.js.br +0 -0
  793. package/web/chunk-jv5faf88.js.gz +0 -0
  794. package/web/chunk-k295x81w.js +0 -370
  795. package/web/chunk-k295x81w.js.br +0 -0
  796. package/web/chunk-k295x81w.js.gz +0 -0
  797. package/web/chunk-k3aa37pw.js +0 -2
  798. package/web/chunk-k3aa37pw.js.br +0 -0
  799. package/web/chunk-k3aa37pw.js.gz +0 -0
  800. package/web/chunk-k6wxwgp1.js +0 -55
  801. package/web/chunk-k6wxwgp1.js.br +0 -0
  802. package/web/chunk-k6wxwgp1.js.gz +0 -0
  803. package/web/chunk-k9vc7kp2.js +0 -292
  804. package/web/chunk-k9vc7kp2.js.br +0 -0
  805. package/web/chunk-k9vc7kp2.js.gz +0 -0
  806. package/web/chunk-kxyws7q7.js +0 -1
  807. package/web/chunk-kxyws7q7.js.br +0 -0
  808. package/web/chunk-kxyws7q7.js.gz +0 -0
  809. package/web/chunk-mcgf645h.js +0 -1
  810. package/web/chunk-mcgf645h.js.br +0 -4
  811. package/web/chunk-mcgf645h.js.gz +0 -0
  812. package/web/chunk-mj3tshy8.js +0 -214
  813. package/web/chunk-mj3tshy8.js.br +0 -0
  814. package/web/chunk-mj3tshy8.js.gz +0 -0
  815. package/web/chunk-mnb2wdvy.js +0 -24
  816. package/web/chunk-mnb2wdvy.js.br +0 -0
  817. package/web/chunk-mnb2wdvy.js.gz +0 -0
  818. package/web/chunk-ndf58dgc.js +0 -1
  819. package/web/chunk-ndf58dgc.js.br +0 -0
  820. package/web/chunk-ndf58dgc.js.gz +0 -0
  821. package/web/chunk-nhpm5nd5.js +0 -2
  822. package/web/chunk-nhpm5nd5.js.br +0 -0
  823. package/web/chunk-nhpm5nd5.js.gz +0 -0
  824. package/web/chunk-nwxjdetb.js +0 -1
  825. package/web/chunk-nwxjdetb.js.br +0 -0
  826. package/web/chunk-nwxjdetb.js.gz +0 -0
  827. package/web/chunk-nyjfcard.js +0 -106
  828. package/web/chunk-nyjfcard.js.br +0 -0
  829. package/web/chunk-nyjfcard.js.gz +0 -0
  830. package/web/chunk-pcfjcy3a.js +0 -324
  831. package/web/chunk-pcfjcy3a.js.br +0 -0
  832. package/web/chunk-pcfjcy3a.js.gz +0 -0
  833. package/web/chunk-pry6wdbe.js +0 -1
  834. package/web/chunk-pry6wdbe.js.br +0 -0
  835. package/web/chunk-pry6wdbe.js.gz +0 -0
  836. package/web/chunk-pvahdcgy.js +0 -2
  837. package/web/chunk-pvahdcgy.js.br +0 -0
  838. package/web/chunk-pvahdcgy.js.gz +0 -0
  839. package/web/chunk-q3njnnef.js +0 -16
  840. package/web/chunk-q3njnnef.js.br +0 -0
  841. package/web/chunk-q3njnnef.js.gz +0 -0
  842. package/web/chunk-qxvqkkmw.js +0 -1
  843. package/web/chunk-qxvqkkmw.js.br +0 -0
  844. package/web/chunk-qxvqkkmw.js.gz +0 -0
  845. package/web/chunk-qych3sbs.js +0 -1
  846. package/web/chunk-qych3sbs.js.br +0 -0
  847. package/web/chunk-qych3sbs.js.gz +0 -0
  848. package/web/chunk-rbmp2e4b.js +0 -1
  849. package/web/chunk-rbmp2e4b.js.br +0 -0
  850. package/web/chunk-rbmp2e4b.js.gz +0 -0
  851. package/web/chunk-rcre1stj.js +0 -1
  852. package/web/chunk-rcre1stj.js.br +0 -0
  853. package/web/chunk-rcre1stj.js.gz +0 -0
  854. package/web/chunk-rdb6091n.js +0 -89
  855. package/web/chunk-rdb6091n.js.br +0 -0
  856. package/web/chunk-rdb6091n.js.gz +0 -0
  857. package/web/chunk-ryw7xnab.js +0 -1
  858. package/web/chunk-ryw7xnab.js.br +0 -0
  859. package/web/chunk-ryw7xnab.js.gz +0 -0
  860. package/web/chunk-sbbmy02e.js +0 -2
  861. package/web/chunk-sbbmy02e.js.br +0 -0
  862. package/web/chunk-sbbmy02e.js.gz +0 -0
  863. package/web/chunk-sgbc835w.js +0 -2
  864. package/web/chunk-sgbc835w.js.br +0 -0
  865. package/web/chunk-sgbc835w.js.gz +0 -0
  866. package/web/chunk-sydy10mb.js +0 -1
  867. package/web/chunk-sydy10mb.js.br +0 -0
  868. package/web/chunk-sydy10mb.js.gz +0 -0
  869. package/web/chunk-t0ywnp5e.js +0 -1
  870. package/web/chunk-t0ywnp5e.js.br +0 -0
  871. package/web/chunk-t0ywnp5e.js.gz +0 -0
  872. package/web/chunk-t72jq97z.js +0 -2
  873. package/web/chunk-t72jq97z.js.br +0 -0
  874. package/web/chunk-t72jq97z.js.gz +0 -0
  875. package/web/chunk-tfcc9bcz.js +0 -4
  876. package/web/chunk-tfcc9bcz.js.br +0 -0
  877. package/web/chunk-tfcc9bcz.js.gz +0 -0
  878. package/web/chunk-v2bvbgfc.js +0 -2
  879. package/web/chunk-v2bvbgfc.js.br +0 -0
  880. package/web/chunk-v2bvbgfc.js.gz +0 -0
  881. package/web/chunk-v7zq4vc9.js +0 -12
  882. package/web/chunk-v7zq4vc9.js.br +0 -0
  883. package/web/chunk-v7zq4vc9.js.gz +0 -0
  884. package/web/chunk-vh8pkcem.css +0 -1
  885. package/web/chunk-vh8pkcem.css.br +0 -0
  886. package/web/chunk-vh8pkcem.css.gz +0 -0
  887. package/web/chunk-vq3sby7x.js +0 -1
  888. package/web/chunk-vq3sby7x.js.br +0 -0
  889. package/web/chunk-vq3sby7x.js.gz +0 -0
  890. package/web/chunk-vszya05r.js +0 -2
  891. package/web/chunk-vszya05r.js.br +0 -0
  892. package/web/chunk-vszya05r.js.gz +0 -0
  893. package/web/chunk-was9xf03.js +0 -8
  894. package/web/chunk-was9xf03.js.br +0 -0
  895. package/web/chunk-was9xf03.js.gz +0 -0
  896. package/web/chunk-we1v1829.js +0 -2
  897. package/web/chunk-we1v1829.js.br +0 -0
  898. package/web/chunk-we1v1829.js.gz +0 -0
  899. package/web/chunk-wfa1c8dn.js +0 -1
  900. package/web/chunk-wfa1c8dn.js.br +0 -0
  901. package/web/chunk-wfa1c8dn.js.gz +0 -0
  902. package/web/chunk-wg2exnxe.js +0 -1
  903. package/web/chunk-wg2exnxe.js.br +0 -2
  904. package/web/chunk-wg2exnxe.js.gz +0 -0
  905. package/web/chunk-wvd3zj1m.js +0 -70
  906. package/web/chunk-wvd3zj1m.js.br +0 -0
  907. package/web/chunk-wvd3zj1m.js.gz +0 -0
  908. package/web/chunk-wzmxtr30.js +0 -1
  909. package/web/chunk-wzmxtr30.js.br +0 -0
  910. package/web/chunk-wzmxtr30.js.gz +0 -0
  911. package/web/chunk-x815g7yp.js +0 -1
  912. package/web/chunk-x815g7yp.js.br +0 -0
  913. package/web/chunk-x815g7yp.js.gz +0 -0
  914. package/web/chunk-x8ps0p82.js +0 -98
  915. package/web/chunk-x8ps0p82.js.br +0 -0
  916. package/web/chunk-x8ps0p82.js.gz +0 -0
  917. package/web/chunk-xea3snym.js +0 -1
  918. package/web/chunk-xea3snym.js.br +0 -0
  919. package/web/chunk-xea3snym.js.gz +0 -0
  920. package/web/chunk-xg4v60m7.js +0 -1
  921. package/web/chunk-xg4v60m7.js.br +0 -0
  922. package/web/chunk-xg4v60m7.js.gz +0 -0
  923. package/web/chunk-xhr9jrjt.js +0 -89
  924. package/web/chunk-xhr9jrjt.js.br +0 -0
  925. package/web/chunk-xhr9jrjt.js.gz +0 -0
  926. package/web/chunk-xp90g2e7.js +0 -36
  927. package/web/chunk-xp90g2e7.js.br +0 -0
  928. package/web/chunk-xp90g2e7.js.gz +0 -0
  929. package/web/chunk-xs1g97qa.js +0 -2
  930. package/web/chunk-xs1g97qa.js.br +0 -0
  931. package/web/chunk-xs1g97qa.js.gz +0 -0
  932. package/web/chunk-xyk1wpr4.js +0 -1
  933. package/web/chunk-xyk1wpr4.js.br +0 -3
  934. package/web/chunk-xyk1wpr4.js.gz +0 -0
  935. package/web/chunk-yavbdwyt.js +0 -1
  936. package/web/chunk-yavbdwyt.js.br +0 -0
  937. package/web/chunk-yavbdwyt.js.gz +0 -0
  938. package/web/chunk-yfnhnsxe.js +0 -4
  939. package/web/chunk-yfnhnsxe.js.br +0 -0
  940. package/web/chunk-yfnhnsxe.js.gz +0 -0
  941. package/web/chunk-yk965yth.js +0 -1
  942. package/web/chunk-yk965yth.js.br +0 -0
  943. package/web/chunk-yk965yth.js.gz +0 -0
  944. package/web/chunk-ynhcjhsx.js +0 -2
  945. package/web/chunk-ynhcjhsx.js.br +0 -0
  946. package/web/chunk-ynhcjhsx.js.gz +0 -0
  947. package/web/chunk-ypmm1gts.js +0 -1
  948. package/web/chunk-ypmm1gts.js.br +0 -0
  949. package/web/chunk-ypmm1gts.js.gz +0 -0
  950. package/web/chunk-yssx5a5q.js +0 -1
  951. package/web/chunk-yssx5a5q.js.br +0 -0
  952. package/web/chunk-yssx5a5q.js.gz +0 -0
  953. package/web/chunk-z0a8cnq8.js +0 -1
  954. package/web/chunk-z0a8cnq8.js.br +0 -0
  955. package/web/chunk-z0a8cnq8.js.gz +0 -0
  956. package/web/chunk-z1afsvbv.js +0 -2
  957. package/web/chunk-z1afsvbv.js.br +0 -0
  958. package/web/chunk-z1afsvbv.js.gz +0 -0
  959. package/web/chunk-z1ka8jtd.js +0 -2
  960. package/web/chunk-z1ka8jtd.js.br +0 -0
  961. package/web/chunk-z1ka8jtd.js.gz +0 -0
  962. package/web/chunk-z7tdzen9.js +0 -1
  963. package/web/chunk-z7tdzen9.js.br +0 -0
  964. package/web/chunk-z7tdzen9.js.gz +0 -0
  965. package/web/chunk-zbwjj06m.js +0 -38
  966. package/web/chunk-zbwjj06m.js.br +0 -0
  967. package/web/chunk-zbwjj06m.js.gz +0 -0
  968. package/web/chunk-zd2j189j.js +0 -1
  969. package/web/chunk-zd2j189j.js.br +0 -0
  970. package/web/chunk-zd2j189j.js.gz +0 -0
  971. package/web/chunk-zfgpq4n4.js +0 -120
  972. package/web/chunk-zfgpq4n4.js.br +0 -0
  973. package/web/chunk-zfgpq4n4.js.gz +0 -0
  974. package/web/chunk-zgas56xw.js +0 -1
  975. package/web/chunk-zgas56xw.js.br +0 -0
  976. package/web/chunk-zgas56xw.js.gz +0 -0
  977. package/web/chunk-zkfepf91.js +0 -1
  978. package/web/chunk-zkfepf91.js.br +0 -0
  979. package/web/chunk-zkfepf91.js.gz +0 -0
@@ -1,370 +0,0 @@
1
- import{t,a,B,S,U,A,R,I,L,D,P,N,u,f,F,zo,Ie,Te,Ee,cn,Fe,ze}from"./chunk-fzmrnh17.js";import{Be}from"./chunk-pvahdcgy.js";import{Re}from"./chunk-ceg13tma.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 i(){return typeof n.bar}return i(),i(),e;(0,eval)(e)}function $r(e){if(Gr(e))return e.LABEL;else return e.name}function Gr(e){return typeof e.LABEL==="string"&&e.LABEL!==""}class Se{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 W extends Se{constructor(e){super([]);this.idx=1,Object.assign(this,Ce(e))}set definition(e){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(e){e.visit(this)}}class de extends Se{constructor(e){super(e.definition);this.orgText="",Object.assign(this,Ce(e))}}class j extends Se{constructor(e){super(e.definition);this.ignoreAmbiguities=!1,Object.assign(this,Ce(e))}}class K extends Se{constructor(e){super(e.definition);this.idx=1,Object.assign(this,Ce(e))}}class Z extends Se{constructor(e){super(e.definition);this.idx=1,Object.assign(this,Ce(e))}}class Q extends Se{constructor(e){super(e.definition);this.idx=1,Object.assign(this,Ce(e))}}class G extends Se{constructor(e){super(e.definition);this.idx=1,Object.assign(this,Ce(e))}}class q extends Se{constructor(e){super(e.definition);this.idx=1,Object.assign(this,Ce(e))}}class J extends Se{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,Ce(e))}}class M{constructor(e){this.idx=1,Object.assign(this,Ce(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 W){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 j)return{type:"Alternative",definition:s(e.definition)};else if(e instanceof K)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 M({terminalType:e.separator})),definition:s(e.definition)};else if(e instanceof q)return{type:"RepetitionWithSeparator",idx:e.idx,separator:st(new M({terminalType:e.separator})),definition:s(e.definition)};else if(e instanceof G)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 M){let n={type:"Terminal",name:e.terminalType.name,label:$r(e.terminalType),idx:e.idx};if(typeof e.label==="string")n.terminalLabel=e.label;let i=e.terminalType.PATTERN;if(e.terminalType.PATTERN)n.pattern=i instanceof RegExp?i.source:i;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 Ce(e){return Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0))}class pe{visit(e){let s=e;switch(s.constructor){case W:return this.visitNonTerminal(s);case j:return this.visitAlternative(s);case K:return this.visitOption(s);case Z:return this.visitRepetitionMandatory(s);case Q:return this.visitRepetitionMandatoryWithSeparator(s);case q:return this.visitRepetitionWithSeparator(s);case G:return this.visitRepetition(s);case J:return this.visitAlternation(s);case M: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 xs(e){return e instanceof j||e instanceof K||e instanceof G||e instanceof Z||e instanceof Q||e instanceof q||e instanceof M||e instanceof de}function We(e,s=[]){if(e instanceof K||e instanceof G||e instanceof q)return!0;if(e instanceof J)return e.definition.some((i)=>We(i,s));else if(e instanceof W&&s.includes(e))return!1;else if(e instanceof Se){if(e instanceof W)s.push(e);return e.definition.every((i)=>We(i,s))}else return!1}function vs(e){return e instanceof J}function fe(e){if(e instanceof W)return"SUBRULE";else if(e instanceof K)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 G)return"MANY";else if(e instanceof M)return"CONSUME";else throw Error("non exhaustive match")}class De{walk(e,s=[]){e.definition.forEach((n,i)=>{let r=e.definition.slice(i+1);if(n instanceof W)this.walkProdRef(n,r,s);else if(n instanceof M)this.walkTerminal(n,r,s);else if(n instanceof j)this.walkFlat(n,r,s);else if(n instanceof K)this.walkOption(n,r,s);else if(n instanceof Z)this.walkAtLeastOne(n,r,s);else if(n instanceof Q)this.walkAtLeastOneSep(n,r,s);else if(n instanceof q)this.walkManySep(n,r,s);else if(n instanceof G)this.walkMany(n,r,s);else if(n instanceof J)this.walkOr(n,r,s);else throw Error("non exhaustive match")})}walkTerminal(e,s,n){}walkProdRef(e,s,n){}walkFlat(e,s,n){let i=s.concat(n);this.walk(e,i)}walkOption(e,s,n){let i=s.concat(n);this.walk(e,i)}walkAtLeastOne(e,s,n){let i=[new K({definition:e.definition})].concat(s,n);this.walk(e,i)}walkAtLeastOneSep(e,s,n){let i=Nn(e,s,n);this.walk(e,i)}walkMany(e,s,n){let i=[new K({definition:e.definition})].concat(s,n);this.walk(e,i)}walkManySep(e,s,n){let i=Nn(e,s,n);this.walk(e,i)}walkOr(e,s,n){let i=s.concat(n);e.definition.forEach((r)=>{let o=new j({definition:[r]});this.walk(o,i)})}}function Nn(e,s,n){return[new K({definition:[new M({terminalType:e.separator})].concat(e.definition)})].concat(s,n)}function je(e){if(e instanceof W)return je(e.referencedRule);else if(e instanceof M)return Kr(e);else if(xs(e))return Wr(e);else if(vs(e))return jr(e);else throw Error("non exhaustive match")}function Wr(e){let s=[],n=e.definition,i=0,r=n.length>i,o,c=!0;while(r&&c)o=n[i],c=We(o),s=s.concat(je(o)),i=i+1,r=n.length>i;return[...new Set(s)]}function jr(e){let s=e.definition.map((n)=>je(n));return[...new Set(s.flat())]}function Kr(e){return[e.terminalType]}var Wt="_~IN~_";class In extends De{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 i=Vr(e.referencedRule,e.idx)+this.topProd.name,r=s.concat(n),o=new j({definition:r}),c=je(o);this.follows[i]=c}}function kn(e){let s={};return e.forEach((n)=>{let i=new In(n).startWalking();Object.assign(s,i)}),s}function Vr(e,s){return e.name+s+Wt}function C(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 Ms(e){return e.type==="Character"}var Rt=[];for(let e=C("0");e<=C("9");e++)Rt.push(e);var yt=[C("_")].concat(Rt);for(let e=C("a");e<=C("z");e++)yt.push(e);for(let e=C("A");e<=C("Z");e++)yt.push(e);var ws=[C(" "),C("\f"),C(`
2
- `),C("\r"),C("\t"),C("\v"),C("\t"),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C("\u2028"),C("\u2029"),C(" "),C(" "),C(" "),C("\uFEFF")];var zr=/[0-9a-fA-F]/,Kt=/[0-9]/,Hr=/[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 i=this.integerIncludingZero();switch(this.popChar()){case"}":s={atLeast:i,atMost:i};break;case",":let r;if(this.isDigit())r=this.integerIncludingZero(),s={atLeast:i,atMost:r};else s={atLeast:i,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:[C(`
3
- `),C("\r"),C("\u2028"),C("\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=ws;break;case"S":e=ws,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=C("\f");break;case"n":e=C(`
4
- `);break;case"r":e=C("\r");break;case"t":e=C("\t");break;case"v":e=C("\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:C("\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:C(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:C(e)}}}characterClass(){let e=[],s=!1;if(this.consumeChar("["),this.peekChar(0)==="^")this.consumeChar("^"),s=!0;while(this.isClassAtom()){let n=this.classAtom(),i=n.type==="Character";if(Ms(n)&&this.isRangeDash()){this.consumeChar("-");let r=this.classAtom(),o=r.type==="Character";if(Ms(r)){if(r.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:r.value})}else jt(n.value,e),e.push(C("-")),jt(r.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:C("\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(Hr.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:C(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 i=0;i<e;i++){let r=this.popChar();if(zr.test(r)===!1)throw Error("Expecting a HexDecimal digits");s+=r}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((i)=>{this.visit(i)},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={},Xr=new Vt;function He(e){let s=e.toString();if(zt.hasOwnProperty(s))return zt[s];else{let n=Xr.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=He(e);return Us(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 i="";if(s)i=`
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`+i)}}return[]}function Us(e,s,n){switch(e.type){case"Disjunction":for(let r=0;r<e.value.length;r++)Us(e.value[r],s,n);break;case"Alternative":let i=e.value;for(let r=0;r<i.length;r++){let o=i[r];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 d=l;if(n===!0)for(let p=d.from;p<=d.to;p++)Ht(p,s,n);else{for(let p=d.from;p<=d.to&&p<it;p++)Ht(p,s,n);if(d.to>=it){let p=d.from>=it?d.from:it,m=d.to,T=be(p),g=be(m);for(let x=T;x<=g;x++)s[x]=x}}}});break;case"Group":Us(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"&&Ps(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 i=be(e);if(s[i]=i,n===!0)Yr(e,s)}function Yr(e,s){let n=String.fromCharCode(e),i=n.toUpperCase();if(i!==n){let r=be(i.charCodeAt(0));s[r]=r}else{let r=n.toLowerCase();if(r!==n){let o=be(r.charCodeAt(0));s[o]=o}}}function bn(e,s){return e.value.find((n)=>{if(typeof n==="number")return s.includes(n);else{let i=n;return s.find((r)=>i.from<=r&&r<=i.to)!==void 0}})}function Ps(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(Ps):Ps(e.value)}class vn 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=He(s),i=new vn(e);return i.visit(n),i.found}else{for(let n of s){let i=n.charCodeAt(0);if(e.includes(i))return!0}return!1}}var Xe="PATTERN",rt="defaultMode",Yt="modes",Jt=0,Lt=1,Zt=2,Qt=3;function wn(e,s){s=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
19
- `],tracer:(O,E)=>E()},s);let n=s.tracer;n("initCharCodeToOptimizedIndexMap",()=>{ma()});let i;n("Reject Lexer.NA",()=>{i=e.filter((O)=>O[Xe]!==z.NA)});let r=!1,o;n("Transform Patterns",()=>{r=!1,o=i.map((O)=>{let E=O[Xe];if(E instanceof RegExp){let _=E.source;if(_.length===1&&_!=="^"&&_!=="$"&&_!=="."&&!E.ignoreCase)return _;else if(_.length===2&&_[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(_[1]))return _[1];else return Mn(E)}else if(typeof E==="function")return r=!0,{exec:E};else if(typeof E==="object")return r=!0,E;else if(typeof E==="string")if(E.length===1)return E;else{let _=E.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),te=new RegExp(_);return Mn(te)}else throw Error("non exhaustive match")})});let c,h,l,d,p;n("misc mapping",()=>{c=i.map((O)=>O.tokenTypeIdx),h=i.map((O)=>{let E=O.GROUP;if(E===z.SKIPPED)return;else if(typeof E==="string")return E;else if(E===void 0)return!1;else throw Error("non exhaustive match")}),l=i.map((O)=>{let E=O.LONGER_ALT;if(E)return Array.isArray(E)?E.map((te)=>i.indexOf(te)):[i.indexOf(E)]}),d=i.map((O)=>O.PUSH_MODE),p=i.map((O)=>Object.hasOwn(O,"POP_MODE"))});let m;n("Line Terminator Handling",()=>{let O=Gn(s.lineTerminatorCharacters);if(m=i.map((E)=>!1),s.positionTracking!=="onlyOffset")m=i.map((E)=>{if(Object.hasOwn(E,"LINE_BREAKS"))return!!E.LINE_BREAKS;else return $n(E,O)===!1&&Xt(O,E.PATTERN)})});let T,g,x,v;n("Misc Mapping #2",()=>{T=i.map(Fn),g=o.map(pa),x=i.reduce((O,E)=>{let _=E.GROUP;if(typeof _==="string"&&_!==z.SKIPPED)O[_]=[];return O},{}),v=o.map((O,E)=>{let _=h[E]===void 0&&l[E]===void 0?qr(i[E].PATTERN):void 0;return{pattern:o[E],asciiClass:_,longerAlt:l[E],canLineTerminator:m[E],matchType:_!==void 0?Qt:g[E]!==!1?Jt:T[E]?Lt:Zt,short:g[E],group:h[E],push:d[E],pop:p[E],tokenTypeIdx:c[E],tokenType:i[E]}})});let b=!0,k=[];if(!s.safeMode)n("First Char Optimization",()=>{k=i.reduce((O,E,_)=>{if(typeof E.PATTERN==="string"){let te=E.PATTERN.charCodeAt(0),oe=be(te);Ds(O,oe,v[_])}else if(Array.isArray(E.START_CHARS_HINT)){let te;E.START_CHARS_HINT.forEach((oe)=>{let pt=typeof oe==="string"?oe.charCodeAt(0):oe,_e=be(pt);if(te!==_e)te=_e,Ds(O,_e,v[_])})}else if(E.PATTERN instanceof RegExp)if(E.PATTERN.unicode){if(b=!1,s.ensureOptimizations)tt(`${Ot} Unable to analyze < ${E.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(E.PATTERN,s.ensureOptimizations);if(te.length===0)b=!1;te.forEach((oe)=>{Ds(O,oe,v[_])})}else{if(s.ensureOptimizations)tt(`${Ot} TokenType: <${E.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`);b=!1}return O},[])});return{emptyGroups:x,patternIdxToConfig:v,charCodeToPatternIdxToConfig:k,hasCustom:r,canBeOptimized:b}}function qr(e){var s,n;if(!(e instanceof RegExp)||e.flags!=="")return;let i;try{i=He(e)}catch(h){return}if(i.value.value.length!==1||i.value.value[0].value.length!==1)return;let r=i.value.value[0].value[0],o;while(r.type==="Group"){if(r.capturing||r.quantifier!==void 0&&o!==void 0||r.value.value.length!==1||r.value.value[0].value.length!==1)return;o=(s=r.quantifier)!==null&&s!==void 0?s:o,r=r.value.value[0].value[0]}if(r.type!=="Set"||r.complement||r.quantifier!==void 0&&o!==void 0)return;if(o=(n=r.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 r.value){let l=typeof h==="number"?h:h.from,d=typeof h==="number"?h:h.to;if(l<0||d>=c.length)return;c.fill(1,l,d+1)}return c}function Un(e,s){let n=[],i=Zr(e);n=n.concat(i.errors);let r=Qr(i.valid),o=r.valid;return n=n.concat(r.errors),n=n.concat(Jr(o)),n=n.concat(oa(o)),n=n.concat(la(o,s)),n=n.concat(ca(o)),n}function Jr(e){let s=[],n=e.filter((i)=>i[Xe]instanceof RegExp);return s=s.concat(ta(n)),s=s.concat(ia(n)),s=s.concat(ra(n)),s=s.concat(aa(n)),s=s.concat(sa(n)),s}function Zr(e){let s=e.filter((r)=>!Object.hasOwn(r,Xe)),n=s.map((r)=>({message:"Token Type: ->"+r.name+"<- missing static 'PATTERN' property",type:V.MISSING_PATTERN,tokenTypes:[r]})),i=e.filter((r)=>!s.includes(r));return{errors:n,valid:i}}function Qr(e){let s=e.filter((r)=>{let o=r[Xe];return!(o instanceof RegExp)&&typeof o!=="function"&&!Object.hasOwn(o,"exec")&&typeof o!=="string"}),n=s.map((r)=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:V.INVALID_PATTERN,tokenTypes:[r]})),i=e.filter((r)=>!s.includes(r));return{errors:n,valid:i}}var ea=/[^\\][$]/;function ta(e){class s extends Ve{constructor(){super(...arguments);this.found=!1}visitEndAnchor(r){this.found=!0}}return e.filter((r)=>{let o=r.PATTERN;try{let c=He(o),h=new s;return h.visit(c),h.found}catch(c){return ea.test(o.source)}}).map((r)=>({message:`Unexpected RegExp Anchor Error:
25
- Token Type: ->`+r.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
26
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:V.EOI_ANCHOR_FOUND,tokenTypes:[r]}))}function sa(e){return e.filter((i)=>i.PATTERN.test("")).map((i)=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:V.EMPTY_MATCH_PATTERN,tokenTypes:[i]}))}var na=/[^\\[][\^]|^\^/;function ia(e){class s extends Ve{constructor(){super(...arguments);this.found=!1}visitStartAnchor(r){this.found=!0}}return e.filter((r)=>{let o=r.PATTERN;try{let c=He(o),h=new s;return h.visit(c),h.found}catch(c){return na.test(o.source)}}).map((r)=>({message:`Unexpected RegExp Anchor Error:
27
- Token Type: ->`+r.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
28
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:V.SOI_ANCHOR_FOUND,tokenTypes:[r]}))}function ra(e){return e.filter((i)=>{let r=i[Xe];return r instanceof RegExp&&(r.multiline||r.global)}).map((i)=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:V.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}))}function aa(e){let s=[],n=e.map((o)=>e.reduce((c,h)=>{if(o.PATTERN.source===h.PATTERN.source&&!s.includes(h)&&h.PATTERN!==z.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:V.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function oa(e){return e.filter((i)=>{if(!Object.hasOwn(i,"GROUP"))return!1;let r=i.GROUP;return r!==z.SKIPPED&&r!==z.NA&&typeof r!=="string"}).map((i)=>({message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:V.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}))}function la(e,s){return e.filter((r)=>r.PUSH_MODE!==void 0&&!s.includes(r.PUSH_MODE)).map((r)=>({message:`Token Type: ->${r.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${r.PUSH_MODE}<-which does not exist`,type:V.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[r]}))}function ca(e){let s=[],n=e.reduce((i,r,o)=>{let c=r.PATTERN;if(c===z.NA)return i;if(typeof c==="string")i.push({str:c,idx:o,tokenType:r});else if(c instanceof RegExp&&ua(c))i.push({str:c.source,idx:o,tokenType:r});return i},[]);return e.forEach((i,r)=>{n.forEach(({str:o,idx:c,tokenType:h})=>{if(r<c&&ha(o,i.PATTERN)){let l=`Token: ->${h.name}<- can never be matched.
29
- Because it appears AFTER the Token Type ->${i.name}<-in the lexer's definition.
30
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;s.push({message:l,type:V.UNREACHABLE_PATTERN,tokenTypes:[i,h]})}})}),s}function ha(e,s){if(s instanceof RegExp){if(da(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 ua(e){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find((n)=>e.source.indexOf(n)!==-1)===void 0}function da(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function Mn(e){let s=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,s)}function Pn(e,s,n){let i=[];if(!Object.hasOwn(e,rt))i.push({message:"A MultiMode Lexer cannot be initialized without a <"+rt+`> property in its definition
31
- `,type:V.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE});if(!Object.hasOwn(e,Yt))i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Yt+`> property in its definition
32
- `,type:V.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY});if(Object.hasOwn(e,Yt)&&Object.hasOwn(e,rt)&&!Object.hasOwn(e.modes,e.defaultMode))i.push({message:`A MultiMode Lexer cannot be initialized with a ${rt}: <${e.defaultMode}>which does not exist
33
- `,type:V.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST});if(Object.hasOwn(e,Yt))Object.keys(e.modes).forEach((r)=>{let o=e.modes[r];o.forEach((c,h)=>{if(c===void 0)i.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${r}> at index: <${h}>
34
- `,type:V.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Object.hasOwn(c,"LONGER_ALT"))(Array.isArray(c.LONGER_ALT)?c.LONGER_ALT:[c.LONGER_ALT]).forEach((d)=>{if(d!==void 0&&!o.includes(d))i.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${d.name}> on token <${c.name}> outside of mode <${r}>
35
- `,type:V.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})});return i}function Dn(e,s,n){let i=[],r=!1,c=Object.values(e.modes||{}).flat().filter(Boolean).filter((l)=>l[Xe]!==z.NA),h=Gn(n);if(s)c.forEach((l)=>{let d=$n(l,h);if(d!==!1){let m={message:fa(l,d),type:d.issue,tokenType:l};i.push(m)}else if(Object.hasOwn(l,"LINE_BREAKS")){if(l.LINE_BREAKS===!0)r=!0}else if(Xt(h,l.PATTERN))r=!0});if(s&&!r)i.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:V.NO_LINE_BREAKS_FLAGS});return i}function Fn(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 pa(e){if(typeof e==="string"&&e.length===1)return e.charCodeAt(0);else return!1}var Bn={test:function(e){let s=e.length;for(let n=this.lastIndex;n<s;n++){let i=e.charCodeAt(n);if(i===10)return this.lastIndex=n+1,!0;else if(i===13){if(e.charCodeAt(n+1)===10)this.lastIndex=n+2;else this.lastIndex=n+1;return!0}}return!1},lastIndex:0};function $n(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:V.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else if(typeof e.PATTERN==="string")return!1;else if(Fn(e))return{issue:V.CUSTOM_LINE_BREAK};else throw Error("non exhaustive match")}function fa(e,s){if(s.issue===V.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===V.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 Gn(e){return e.map((n)=>{if(typeof n==="string")return n.charCodeAt(0);else return n})}function Ds(e,s,n){if(e[s]===void 0)e[s]=[n];else e[s].push(n)}var it=256,qt=[];function be(e){return e<it?e:qt[e]}function ma(){if(qt.length===0){qt=Array(65536);for(let e=0;e<65536;e++)qt[e]=e>255?255+~~(e/255):e}}function ve(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 Wn=1,Kn={};function Me(e){let s=Ea(e);Ta(s),Aa(s),ga(s),s.forEach((n)=>{n.isParent=n.categoryMatches.length>0})}function Ea(e){let s=[...e],n=e,i=!0;while(i){n=n.map((o)=>o.CATEGORIES).flat().filter(Boolean);let r=n.filter((o)=>!s.includes(o));if(s=s.concat(r),r.length===0)i=!1;else n=r}return s}function Ta(e){e.forEach((s)=>{if(!Fs(s))Kn[Wn]=s,s.tokenTypeIdx=Wn++;if(jn(s)&&!Array.isArray(s.CATEGORIES))s.CATEGORIES=[s.CATEGORIES];if(!jn(s))s.CATEGORIES=[];if(!Sa(s))s.categoryMatches=[];if(!Ra(s))s.categoryMatchesMap={}})}function ga(e){e.forEach((s)=>{s.categoryMatches=[],Object.keys(s.categoryMatchesMap).forEach((n)=>{s.categoryMatches.push(Kn[n].tokenTypeIdx)})})}function Aa(e){e.forEach((s)=>{Vn([],s)})}function Vn(e,s){e.forEach((n)=>{s.categoryMatchesMap[n.tokenTypeIdx]=!0}),s.CATEGORIES.forEach((n)=>{let i=e.concat(s);if(!i.includes(n))Vn(i,n)})}function Fs(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"tokenTypeIdx")}function jn(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"CATEGORIES")}function Sa(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"categoryMatches")}function Ra(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"categoryMatchesMap")}function zn(e){return Object.hasOwn(e!==null&&e!==void 0?e:{},"tokenTypeIdx")}var Bs={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,s,n,i,r,o){return`unexpected character: ->${e.charAt(s)}<- at offset: ${s}, skipped ${n} characters.`}};var V;(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"})(V||(V={}));var Nt={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
45
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Bs,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Nt);class z{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=(i,r)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let o=Array(this.traceInitIndent+1).join("\t");if(this.traceInitIndent<this.traceInitMaxIdent)console.log(`${o}--> <${i}>`);let{time:c,value:h}=gt(r),l=c>10?console.warn:console.log;if(this.traceInitIndent<this.traceInitMaxIdent)l(`${o}<-- <${i}> time: ${c}ms`);return this.traceInitIndent--,h}else return r()},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 i,r=!0;if(this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Nt.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Bn;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))i={modes:{defaultMode:[...e]},defaultMode:rt};else r=!1,i=Object.assign({},e)}),this.config.skipValidations===!1)this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Pn(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Dn(i,this.trackStartLines,this.config.lineTerminatorCharacters))});i.modes=i.modes?i.modes:{},Object.entries(i.modes).forEach(([c,h])=>{i.modes[c]=h.filter((l)=>l!==void 0)});let o=Object.keys(i.modes);if(Object.entries(i.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(Un(h,o))});if(this.lexerDefinitionErrors.length===0){Me(h);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=wn(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=i.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(r)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,d])=>{if(d===!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 i=this.lexerDefinitionErrors.map((r)=>r.message).join(`-----------------------
52
- `);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
53
- `+i)}return this.tokenizeInternal(e,s)}tokenizeInternal(e,s){let n,i,r,o,c,h,l,d,p,m,T,g,x,v,b,k=e,O=k.length,E=0,_=0,te=this.hasCustom?0:Math.floor(e.length/10),oe=Array(te),pt=[],_e=this.trackStartLines?1:void 0,ke=this.trackStartLines?1:void 0,et={};for(let se=0;se<this.cachedGroupKeys.length;se++)et[this.cachedGroupKeys[se]]=[];let Fr=this.trackStartLines,Is=this.config.lineTerminatorsPattern,ks=0,Ge=[],ft=[],mt=[],yn=[];Object.freeze(yn);let Et=!1,Br=(se)=>{if(mt.length===1&&se.tokenType.PUSH_MODE===void 0){let Ae=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(se);pt.push({offset:se.startOffset,line:se.startLine,column:se.startColumn,length:se.image.length,message:Ae})}else{mt.pop();let Ae=mt.at(-1);Ge=this.patternIdxToConfig[Ae],ft=this.charCodeToPatternIdxToConfig[Ae],ks=Ge.length;let Cs=this.canModeBeOptimized[Ae]&&this.config.safeMode===!1;if(ft&&Cs)Et=!0;else Et=!1}};function On(se){mt.push(se),ft=this.charCodeToPatternIdxToConfig[se],Ge=this.patternIdxToConfig[se],ks=Ge.length;let Ae=this.canModeBeOptimized[se]&&this.config.safeMode===!1;if(ft&&Ae)Et=!0;else Et=!1}On.call(this,s);let ge,Ln=this.config.recoveryEnabled;while(E<O){h=null,p=-1;let se=k.charCodeAt(E),Ae;if(Et){let re=be(se),ue=ft[re];Ae=ue!==void 0?ue:yn}else Ae=Ge;let Cs=Ae.length;for(n=0;n<Cs;n++){ge=Ae[n];let re=ge.pattern;switch(l=null,ge.matchType){case Jt:if(se===ge.short)p=1,h=re;break;case Lt:if(b=re.exec(k,E,oe,et),b!==null){if(h=b[0],p=h.length,b.payload!==void 0)l=b.payload}else h=null;break;case Qt:{let ue=ge.asciiClass;if(ue[se]!==1){re.lastIndex=0;break}let ce=E+1;while(ue[k.charCodeAt(ce)]===1)ce++;p=ce-E,re.lastIndex=ce;break}case Zt:re.lastIndex=E,p=this.matchLength(re,e,E);break}if(p!==-1){if(c=ge.longerAlt,c!==void 0){h=e.substring(E,E+p);let ue=c.length;for(r=0;r<ue;r++){let ce=Ge[c[r]],xe=ce.pattern;if(d=null,ce.matchType===Lt)if(b=xe.exec(k,E,oe,et),b!==null){if(o=b[0],b.payload!==void 0)d=b.payload}else o=null;else xe.lastIndex=E,o=this.match(xe,e,E);if(o&&o.length>h.length){h=o,p=o.length,l=d,ge=ce;break}}}break}}if(p!==-1){if(m=ge.group,m!==void 0)if(h=h!==null?h:e.substring(E,E+p),T=ge.tokenTypeIdx,g=this.createTokenInstance(h,E,T,ge.tokenType,_e,ke,p),this.handlePayload(g,l),m===!1)_=this.addToken(oe,_,g);else et[m].push(g);if(Fr===!0&&ge.canLineTerminator===!0){let re=0,ue,ce;Is.lastIndex=0;do if(h=h!==null?h:e.substring(E,E+p),ue=Is.test(h),ue===!0)ce=Is.lastIndex-1,re++;while(ue===!0);if(re!==0)_e=_e+re,ke=p-ce,this.updateTokenEndLineColumnLocation(g,m,ce,re,_e,ke,p);else ke=this.computeNewColumn(ke,p)}else ke=this.computeNewColumn(ke,p);E=E+p,this.handleModes(ge,Br,On,g)}else{let re=E,ue=_e,ce=ke,xe=Ln===!1;while(xe===!1&&E<O){E++;for(i=0;i<ks;i++){let bs=Ge[i],_s=bs.pattern;switch(bs.matchType){case Jt:if(k.charCodeAt(E)===bs.short)xe=!0;break;case Lt:xe=_s.exec(k,E,oe,et)!==null;break;case Qt:case Zt:_s.lastIndex=E,xe=_s.exec(e)!==null;break}if(xe===!0)break}}if(x=E-re,ke=this.computeNewColumn(ke,x),v=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(k,re,x,ue,ce,mt.at(-1)),pt.push({offset:re,line:ue,column:ce,length:x,message:v}),Ln===!1)break}}if(!this.hasCustom)oe.length=_;return{tokens:oe,groups:et,errors:pt}}handleModes(e,s,n,i){if(e.pop===!0){let r=e.push;if(s(i),r!==void 0)n.call(this,r)}else if(e.push!==void 0)n.call(this,e.push)}updateTokenEndLineColumnLocation(e,s,n,i,r,o,c){let h,l;if(s!==void 0){if(h=n===c-1,l=h?-1:0,!(i===1&&h===!0))e.endLine=r+l,e.endColumn=o-1+-l}}computeNewColumn(e,s){return e+s}createOffsetOnlyToken(e,s,n,i){return{image:e,startOffset:s,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,s,n,i,r,o){return{image:e,startOffset:s,startLine:r,startColumn:o,tokenTypeIdx:n,tokenType:i}}createFullToken(e,s,n,i,r,o,c){return{image:e,startOffset:s,endOffset:s+c-1,startLine:r,endLine:r,startColumn:o,endColumn:o+c-1,tokenTypeIdx:n,tokenType:i}}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}}z.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.";z.NA=/NOT_APPLICABLE/;function Ye(e){if($s(e))return e.LABEL;else return e.name}function $s(e){return typeof e.LABEL==="string"&&e.LABEL!==""}var ya="parent",Hn="categories",Xn="label",Yn="group",qn="push_mode",Jn="pop_mode",Zn="longer_alt",Qn="line_breaks",ei="start_chars_hint";function y(e){return Oa(e)}function Oa(e){let s=e.pattern,n={};if(n.name=e.name,s!==void 0)n.PATTERN=s;if(Object.hasOwn(e,ya))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,Hn))n.CATEGORIES=e[Hn];if(Me([n]),Object.hasOwn(e,Xn))n.LABEL=e[Xn];if(Object.hasOwn(e,Yn))n.GROUP=e[Yn];if(Object.hasOwn(e,Jn))n.POP_MODE=e[Jn];if(Object.hasOwn(e,qn))n.PUSH_MODE=e[qn];if(Object.hasOwn(e,Zn))n.LONGER_ALT=e[Zn];if(Object.hasOwn(e,Qn))n.LINE_BREAKS=e[Qn];if(Object.hasOwn(e,ei))n.START_CHARS_HINT=e[ei];return n}var me=y({name:"EOF",pattern:z.NA});Me([me]);function qe(e,s,n,i,r,o,c,h){return{image:s,startOffset:n,endOffset:i,startLine:r,endLine:o,startColumn:c,endColumn:h,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function It(e,s){return ve(e,s)}var es={buildMismatchTokenMessage({expected:e,actual:s,previous:n,ruleName:i}){return`Expecting ${$s(e)?`--> ${Ye(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:i,ruleName:r}){let h=`
55
- but found: '`+s[0].image+"'";if(i)return"Expecting: "+i+h;else return`Expecting: one of these possible Token sequences:
56
- ${e.reduce((T,g)=>T.concat(g),[]).map((T)=>`[${T.map((g)=>Ye(g)).join(", ")}]`).map((T,g)=>` ${g+1}. ${T}`).join(`
57
- `)}`+h},buildEarlyExitMessage({expectedIterationPaths:e,actual:s,customUserDescription:n,ruleName:i}){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((d)=>`[${d.map((p)=>Ye(p)).join(",")}]`).join(" ,")}>`+c}};Object.freeze(es);var ti={buildRuleNotFoundError(e,s){return"Invalid grammar, reference to a rule which is not defined: ->"+s.nonTerminalName+`<-
60
- inside top level rule: ->`+e.name+"<-"}},Le={buildDuplicateFoundError(e,s){function n(p){if(p instanceof M)return p.terminalType.name;else if(p instanceof W)return p.nonTerminalName;else return""}let i=e.name,r=s[0],o=r.idx,c=fe(r),h=n(r),l=o>0,d=`->${c}${l?o:""}<- ${h?`with argument: ->${h}<-`:""}
61
- appears more than once (${s.length} times) in the top level rule: ->${i}<-.
62
- For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
63
- `;return d=d.replace(/[ \t]+/g," "),d=d.replace(/\s\s+/g,`
64
- `),d},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((r)=>Ye(r)).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,i=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${s}> inside <${e.topLevelRule.name}> Rule,
73
- `;if(n)i+=`These alternatives are all empty (match no tokens), making them indistinguishable.
74
- Only the last alternative may be empty.
75
- `;else{let r=e.prefixPath.map((o)=>Ye(o)).join(", ");i+=`<${r}> may appears as a prefix path in all these alternatives.
76
- `}return i+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
77
- For Further details.`,i},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),i=`${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
- ${i}
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 si(e,s){let n=new ni(e,s);return n.resolveRefs(),n.errors}class ni 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 ii extends De{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 i=s.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}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 Gs extends ii{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 i=s.concat(n),r=new j({definition:i});this.possibleTokTypes=je(r),this.found=!0}}}class kt extends De{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 Ws extends kt{walkMany(e,s,n){if(e.idx===this.occurrence){let i=s.concat(n)[0];if(this.result.isEndOfRule=i===void 0,i instanceof M)this.result.token=i.terminalType,this.result.occurrence=i.idx}else super.walkMany(e,s,n)}}class ts extends kt{walkManySep(e,s,n){if(e.idx===this.occurrence){let i=s.concat(n)[0];if(this.result.isEndOfRule=i===void 0,i instanceof M)this.result.token=i.terminalType,this.result.occurrence=i.idx}else super.walkManySep(e,s,n)}}class js extends kt{walkAtLeastOne(e,s,n){if(e.idx===this.occurrence){let i=s.concat(n)[0];if(this.result.isEndOfRule=i===void 0,i instanceof M)this.result.token=i.terminalType,this.result.occurrence=i.idx}else super.walkAtLeastOne(e,s,n)}}class ss extends kt{walkAtLeastOneSep(e,s,n){if(e.idx===this.occurrence){let i=s.concat(n)[0];if(this.result.isEndOfRule=i===void 0,i instanceof M)this.result.token=i.terminalType,this.result.occurrence=i.idx}else super.walkAtLeastOneSep(e,s,n)}}function ns(e,s,n=[]){n=[...n];let i=[],r=0;function o(h){return h.concat(e.slice(r+1))}function c(h){let l=ns(o(h),s,n);return i.concat(l)}while(n.length<s&&r<e.length){let h=e[r];if(h instanceof j)return c(h.definition);else if(h instanceof W)return c(h.definition);else if(h instanceof K)i=c(h.definition);else if(h instanceof Z){let l=h.definition.concat([new G({definition:h.definition})]);return c(l)}else if(h instanceof Q){let l=[new j({definition:h.definition}),new G({definition:[new M({terminalType:h.separator})].concat(h.definition)})];return c(l)}else if(h instanceof q){let l=h.definition.concat([new G({definition:[new M({terminalType:h.separator})].concat(h.definition)})]);i=c(l)}else if(h instanceof G){let l=h.definition.concat([new G({definition:h.definition})]);i=c(l)}else if(h instanceof J)return h.definition.forEach((l)=>{if(l.definition.length!==0)i=c(l.definition)}),i;else if(h instanceof M)n.push(h.terminalType);else throw Error("non exhaustive match");r++}return i.push({partialPath:n,suffixDef:e.slice(r)}),i}function ri(e,s,n,i){let o=["EXIT_NONE_TERMINAL"],c="EXIT_ALTERNATIVE",h=!1,l=s.length,d=l-i-1,p=[],m=[];m.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});while(m.length!==0){let T=m.pop();if(T==="EXIT_ALTERNATIVE"){if(h&&m.at(-1).idx<=d)m.pop();continue}let{def:g,idx:x,ruleStack:v,occurrenceStack:b}=T;if(g.length===0)continue;let k=g[0];if(k==="EXIT_NONE_TERMINAL"){let O={idx:x,def:g.slice(1),ruleStack:v.slice(0,-1),occurrenceStack:b.slice(0,-1)};m.push(O)}else if(k instanceof M)if(x<l-1){let O=x+1,E=s[O];if(n(E,k.terminalType)){let _={idx:O,def:g.slice(1),ruleStack:v,occurrenceStack:b};m.push(_)}}else if(x===l-1)p.push({nextTokenType:k.terminalType,nextTokenOccurrence:k.idx,ruleStack:v,occurrenceStack:b}),h=!0;else throw Error("non exhaustive match");else if(k instanceof W){let O=[...v];O.push(k.nonTerminalName);let E=[...b];E.push(k.idx);let _={idx:x,def:k.definition.concat(o,g.slice(1)),ruleStack:O,occurrenceStack:E};m.push(_)}else if(k instanceof K){let O={idx:x,def:g.slice(1),ruleStack:v,occurrenceStack:b};m.push(O),m.push("EXIT_ALTERNATIVE");let E={idx:x,def:k.definition.concat(g.slice(1)),ruleStack:v,occurrenceStack:b};m.push(E)}else if(k instanceof Z){let O=new G({definition:k.definition,idx:k.idx}),E=k.definition.concat([O],g.slice(1)),_={idx:x,def:E,ruleStack:v,occurrenceStack:b};m.push(_)}else if(k instanceof Q){let O=new M({terminalType:k.separator}),E=new G({definition:[O].concat(k.definition),idx:k.idx}),_=k.definition.concat([E],g.slice(1)),te={idx:x,def:_,ruleStack:v,occurrenceStack:b};m.push(te)}else if(k instanceof q){let O={idx:x,def:g.slice(1),ruleStack:v,occurrenceStack:b};m.push(O),m.push("EXIT_ALTERNATIVE");let E=new M({terminalType:k.separator}),_=new G({definition:[E].concat(k.definition),idx:k.idx}),te=k.definition.concat([_],g.slice(1)),oe={idx:x,def:te,ruleStack:v,occurrenceStack:b};m.push(oe)}else if(k instanceof G){let O={idx:x,def:g.slice(1),ruleStack:v,occurrenceStack:b};m.push(O),m.push("EXIT_ALTERNATIVE");let E=new G({definition:k.definition,idx:k.idx}),_=k.definition.concat([E],g.slice(1)),te={idx:x,def:_,ruleStack:v,occurrenceStack:b};m.push(te)}else if(k instanceof J)for(let O=k.definition.length-1;O>=0;O--){let E=k.definition[O],_={idx:x,def:E.definition.concat(g.slice(1)),ruleStack:v,occurrenceStack:b};m.push(_),m.push("EXIT_ALTERNATIVE")}else if(k instanceof j)m.push({idx:x,def:k.definition.concat(g.slice(1)),ruleStack:v,occurrenceStack:b});else if(k instanceof de)m.push(La(k,x,v,b));else throw Error("non exhaustive match")}return p}function La(e,s,n,i){let r=[...n];r.push(e.name);let o=[...i];return o.push(1),{idx:s,def:e.definition,ruleStack:r,occurrenceStack:o}}var H;(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"})(H||(H={}));function is(e){if(e instanceof K||e==="Option")return H.OPTION;else if(e instanceof G||e==="Repetition")return H.REPETITION;else if(e instanceof Z||e==="RepetitionMandatory")return H.REPETITION_MANDATORY;else if(e instanceof Q||e==="RepetitionMandatoryWithSeparator")return H.REPETITION_MANDATORY_WITH_SEPARATOR;else if(e instanceof q||e==="RepetitionWithSeparator")return H.REPETITION_WITH_SEPARATOR;else if(e instanceof J||e==="Alternation")return H.ALTERNATION;else throw Error("non exhaustive match")}function oi(e,s,n,i,r,o){let c=Ct(e,s,n),h=fi(c)?at:ve;return o(c,i,h,r)}function li(e,s,n,i,r,o){let c=bt(e,s,r,n),h=fi(c)?at:ve;return o(c[0],h,i)}function ci(e,s,n,i){let r=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<r;l++){let d=e[l],p=d.length,m=h[l];if(m!==void 0&&m.call(this)===!1)continue;e:for(let T=0;T<p;T++){let g=d[T],x=g.length;for(let v=0;v<x;v++){let b=this.LA_FAST(v+1);if(n(b,g[v])===!1)continue e}return l}}return};else if(o&&!i){let h=e.map((l)=>l.flat()).reduce((l,d,p)=>(d.forEach((m)=>{if(!(m.tokenTypeIdx in l))l[m.tokenTypeIdx]=p;m.categoryMatches.forEach((T)=>{if(!Object.hasOwn(l,T))l[T]=p})}),l),{});return function(){let l=this.LA_FAST(1);return h[l.tokenTypeIdx]}}else return function(){for(let c=0;c<r;c++){let h=e[c],l=h.length;e:for(let d=0;d<l;d++){let p=h[d],m=p.length;for(let T=0;T<m;T++){let g=this.LA_FAST(T+1);if(n(g,p[T])===!1)continue e}return c}}return}}function hi(e,s,n){let i=e.every((o)=>o.length===1),r=e.length;if(i&&!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,d)=>(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<r;o++){let c=e[o],h=c.length;for(let l=0;l<h;l++){let d=this.LA_FAST(l+1);if(s(d,c[l])===!1)continue e}return!0}return!1}}class ui extends De{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,i){if(e.idx===this.targetOccurrence&&this.targetProdType===s)return this.restDef=n.concat(i),!0;return!1}walkOption(e,s,n){if(!this.checkIsTarget(e,H.OPTION,s,n))super.walkOption(e,s,n)}walkAtLeastOne(e,s,n){if(!this.checkIsTarget(e,H.REPETITION_MANDATORY,s,n))super.walkOption(e,s,n)}walkAtLeastOneSep(e,s,n){if(!this.checkIsTarget(e,H.REPETITION_MANDATORY_WITH_SEPARATOR,s,n))super.walkOption(e,s,n)}walkMany(e,s,n){if(!this.checkIsTarget(e,H.REPETITION,s,n))super.walkOption(e,s,n)}walkManySep(e,s,n){if(!this.checkIsTarget(e,H.REPETITION_WITH_SEPARATOR,s,n))super.walkOption(e,s,n)}}class Vs 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,H.OPTION)}visitRepetition(e){this.checkIsTarget(e,H.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,H.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,H.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,H.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,H.ALTERNATION)}}function ai(e){let s=Array(e);for(let n=0;n<e;n++)s[n]=[];return s}function Ks(e){let s=[""];for(let n=0;n<e.length;n++){let i=e[n],r=[];for(let o=0;o<s.length;o++){let c=s[o];r.push(c+"_"+i.tokenTypeIdx);for(let h=0;h<i.categoryMatches.length;h++){let l="_"+i.categoryMatches[h];r.push(c+l)}}s=r}return s}function Na(e,s,n){for(let i=0;i<e.length;i++){if(i===n)continue;let r=e[i];for(let o=0;o<s.length;o++){let c=s[o];if(r[c]===!0)return!1}}return!0}function di(e,s){let n=e.map((c)=>ns([c],1)),i=ai(n.length),r=n.map((c)=>{let h={};return c.forEach((l)=>{Ks(l.partialPath).forEach((p)=>{h[p]=!0})}),h}),o=n;for(let c=1;c<=s;c++){let h=o;o=ai(h.length);for(let l=0;l<h.length;l++){let d=h[l];for(let p=0;p<d.length;p++){let m=d[p].partialPath,T=d[p].suffixDef,g=Ks(m);if(Na(r,g,l)||T.length===0||m.length===s){let v=i[l];if(rs(v,m)===!1){v.push(m);for(let b=0;b<g.length;b++){let k=g[b];r[l][k]=!0}}}else{let v=ns(T,c+1,m);o[l]=o[l].concat(v),v.forEach((b)=>{Ks(b.partialPath).forEach((O)=>{r[l][O]=!0})})}}}}return i}function Ct(e,s,n,i){let r=new Vs(e,H.ALTERNATION,i);return s.accept(r),di(r.result,n)}function bt(e,s,n,i){let r=new Vs(e,n);s.accept(r);let o=r.result,h=new ui(s,e,n).startWalking(),l=new j({definition:o}),d=new j({definition:h});return di([l,d],i)}function rs(e,s){e:for(let n=0;n<e.length;n++){let i=e[n];if(i.length!==s.length)continue;for(let r=0;r<i.length;r++){let o=s[r],c=i[r];if((o===c||c.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}return!1}function pi(e,s){return e.length<s.length&&e.every((n,i)=>{let r=s[i];return n===r||r.categoryMatchesMap[n.tokenTypeIdx]})}function fi(e){return e.every((s)=>s.every((n)=>n.every((i)=>i.categoryMatches.length===0)))}function mi(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 Ei(e,s,n,i){let r=e.flatMap((l)=>Ia(l,n)),o=va(e,s,n),c=e.flatMap((l)=>ba(l,n)),h=e.flatMap((l)=>Ca(l,e,i,n));return r.concat(o,c,h)}function Ia(e,s){let n=new gi;e.accept(n);let i=n.allProductions,r=Object.groupBy(i,ka),o=Object.fromEntries(Object.entries(r).filter(([h,l])=>l.length>1));return Object.values(o).map((h)=>{let l=h[0],d=s.buildDuplicateFoundError(e,h),p=fe(l),m={message:d,type:ne.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:p,occurrence:l.idx},T=Ti(l);if(T)m.parameter=T;return m})}function ka(e){return`${fe(e)}_#_${e.idx}_#_${Ti(e)}`}function Ti(e){if(e instanceof M)return e.terminalType.name;else if(e instanceof W)return e.nonTerminalName;else return""}class gi 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 Ca(e,s,n,i){let r=[];if(s.reduce((c,h)=>{if(h.name===e.name)return c+1;return c},0)>1){let c=i.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});r.push({message:c,type:ne.DUPLICATE_RULE_NAME,ruleName:e.name})}return r}function Ai(e,s,n){let i=[],r;if(!s.includes(e))r=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,i.push({message:r,type:ne.INVALID_RULE_OVERRIDE,ruleName:e});return i}function zs(e,s,n,i=[]){let r=[],o=as(s.definition);if(o.length===0)return[];else{let c=e.name;if(o.includes(e))r.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:i}),type:ne.LEFT_RECURSION,ruleName:c});let l=i.concat([e]),p=o.filter((m)=>!l.includes(m)).flatMap((m)=>{let T=[...i];return T.push(m),zs(e,m,n,T)});return r.concat(p)}}function as(e){let s=[];if(e.length===0)return s;let n=e[0];if(n instanceof W)s.push(n.referencedRule);else if(n instanceof j||n instanceof K||n instanceof Z||n instanceof Q||n instanceof q||n instanceof G)s=s.concat(as(n.definition));else if(n instanceof J)s=n.definition.map((o)=>as(o.definition)).flat();else if(n instanceof M);else throw Error("non exhaustive match");let i=We(n),r=e.length>1;if(i&&r){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 Si(e,s){let n=new os;return e.accept(n),n.alternations.flatMap((o)=>o.definition.slice(0,-1).flatMap((h,l)=>{if(ri([h],[],ve,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 Ri(e,s,n){let i=new os;e.accept(i);let r=i.alternations;return r=r.filter((c)=>c.ignoreAmbiguities!==!0),r.flatMap((c)=>{let h=c.idx,l=c.maxLookahead||s,d=Ct(h,e,l,c),p=_a(d,c,e,n),m=xa(d,c,e,n);return p.concat(m)})}class yi 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 ba(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 Oi(e,s,n){let i=[];return e.forEach((r)=>{let o=new yi;r.accept(o),o.allProductions.forEach((h)=>{let l=is(h),d=h.maxLookahead||s,p=h.idx;if(bt(p,r,l,d)[0].flat().length===0){let g=n.buildEmptyRepetitionError({topLevelRule:r,repetition:h});i.push({message:g,type:ne.NO_NON_EMPTY_LOOKAHEAD,ruleName:r.name})}})}),i}function _a(e,s,n,i){let r=[];return e.reduce((h,l,d)=>{if(s.definition[d].ignoreAmbiguities===!0)return h;return l.forEach((p)=>{let m=[d];if(e.forEach((T,g)=>{if(d!==g&&rs(T,p)&&s.definition[g].ignoreAmbiguities!==!0)m.push(g)}),m.length>1&&!rs(r,p))r.push(p),h.push({alts:m,path:p})}),h},[]).map((h)=>{let l=h.alts.map((p)=>p+1);return{message:i.buildAlternationAmbiguityError({topLevelRule:n,alternation:s,ambiguityIndices:l,prefixPath:h.path}),type:ne.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:s.idx,alternatives:h.alts}})}function xa(e,s,n,i){let r=e.reduce((c,h,l)=>{let d=h.map((p)=>({idx:l,path:p}));return c.concat(d)},[]);return r.flatMap((c)=>{if(s.definition[c.idx].ignoreAmbiguities===!0)return[];let{idx:l,path:d}=c;return r.filter((T)=>s.definition[T.idx].ignoreAmbiguities!==!0&&T.idx<l&&pi(T.path,d)).map((T)=>{let g=[T.idx+1,l+1],x=s.idx===0?"":s.idx;return{message:i.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:s,ambiguityIndices:g,prefixPath:T.path}),type:ne.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:x,alternatives:g}})})}function va(e,s,n){let i=[],r=s.map((o)=>o.name);return e.forEach((o)=>{let c=o.name;if(r.includes(c)){let h=n.buildNamespaceConflictError(o);i.push({message:h,type:ne.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:c})}}),i}function Li(e){let s=Object.assign({errMsgProvider:ti},e),n={};return e.rules.forEach((i)=>{n[i.name]=i}),si(n,s.errMsgProvider)}function Ni(e){var s;let n=(s=e.errMsgProvider)!==null&&s!==void 0?s:Le;return Ei(e.rules,e.tokenTypes,n,e.grammarName)}var Ii=["MismatchedTokenException","NoViableAltException","EarlyExitException","NotAllInputParsedException"];Object.freeze(Ii);function $e(e){return Ii.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 cs extends _t{constructor(e,s){super(e,s);this.name="NotAllInputParsedException"}}class hs extends _t{constructor(e,s,n){super(e,s);this.previousToken=n,this.name="EarlyExitException"}}var Hs={},Xs="InRuleRecoveryException";class ki extends Error{constructor(e){super(e);this.name=Xs}}class Ys{initRecoverable(e){if(this.firstAfterRepMap=[],this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,"recoveryEnabled")?e.recoveryEnabled:he.recoveryEnabled,this.recoveryEnabled)this.attemptInRepetitionRecovery=Ma}getTokenToInsert(e){let s=qe(e,"",-1,-1,-1,-1,-1,-1);return s.isInsertedInRecovery=!0,s}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,s,n,i){let r=this.findReSyncTokenType(),o=this.exportLexerState(),c=[],h=!1,l=this.LA_FAST(1),d=this.LA_FAST(1),p=()=>{let m=this.LA(0),T=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:m,ruleName:this.getCurrRuleFullName()}),g=new ot(T,l,this.LA(0));g.resyncedTokens=c.slice(0,-1),this.SAVE_ERROR(g)};while(!h)if(this.tokenMatcher(d,i)){p();return}else if(n.call(this)){p(),e.apply(this,s);return}else if(this.tokenMatcher(d,r))h=!0;else d=this.SKIP_TOKEN(),this.addToResyncTokens(d,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],i=this.getGAstProductions()[s];return new Gs(i,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 ki("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((r)=>this.tokenMatcher(n,r))!==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 i=e.find((r)=>It(s,r));if(i!==void 0)return i;s=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return Hs;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,i=Array(n);for(let r=0;r<n;r++)if(r===0)i[r]=Hs;else i[r]={ruleName:this.shortRuleNameToFullName(e[r]),idxInCallingRule:s[r],inRule:this.shortRuleNameToFullName(e[r-1])};return i}flattenFollowSet(){return this.buildFullFollowKeyStack().map((s)=>this.getFollowSetFromFollowKey(s)).flat()}getFollowSetFromFollowKey(e){if(e===Hs)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,i,r,o,c){}getCurrentGrammarPath(e,s){let n=this.getHumanReadableRuleStack(),i=this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1);return{ruleStack:n,occurrenceStack:i,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 Ma(e,s,n,i,r,o,c){var h,l,d;let p=i|r,m=(h=(l=this.firstAfterRepMap)[d=this.currRuleShortName])!==null&&h!==void 0?h:l[d]=[],T=m[p];if(T===void 0){let b=this.getCurrRuleFullName(),k=this.getGAstProductions()[b];T=new o(k,r).startWalking(),m[p]=T}let g=T.token,x=T.occurrence,v=T.isEndOfRule;if(this.RULE_STACK_IDX===0&&v&&g===void 0)g=me,x=1;if(g===void 0||x===void 0)return;if(this.shouldInRepetitionRecoveryBeTried(g,x,c))this.tryInRepetitionRecovery(e,s,n,g)}var us=256,ds=512,xt=768,vt=1024,Mt=1280,lt=1536;class ps{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),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),r=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...s,...n,...i,...r]}return s}validateNoLeftRecursion(e){return e.flatMap((s)=>zs(s,s,Le))}validateEmptyOrAlternatives(e){return e.flatMap((s)=>Si(s,Le))}validateAmbiguousAlternationAlternatives(e,s){return e.flatMap((n)=>Ri(n,s,Le))}validateSomeNonEmptyLookaheadPath(e,s){return Oi(e,s,Le)}buildLookaheadForAlternation(e){return oi(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,ci)}buildLookaheadForOptional(e){return li(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,is(e.prodType),hi)}}class qs{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 ps({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=[],this.currRuleLookaheadFuncs=[]}preComputeLookaheadFunctions(e){e.forEach((s)=>{this.TRACE_INIT(`${s.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:r,repetitionMandatory:o,repetitionMandatoryWithSeparator:c,repetitionWithSeparator:h}=wa(s);n.forEach((l)=>{let d=l.idx===0?"":l.idx;this.TRACE_INIT(`${fe(l)}${d}`,()=>{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],us|l.idx,p)})}),i.forEach((l)=>{this.computeLookaheadFunc(s,l.idx,xt,"Repetition",l.maxLookahead,fe(l))}),r.forEach((l)=>{this.computeLookaheadFunc(s,l.idx,ds,"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,i,r,o){this.TRACE_INIT(`${o}${s===0?"":s}`,()=>{let c=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:s,rule:e,maxLookahead:r||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i});this.setLaFuncCache(this.fullRuleNameToShort[e.name],n|s,c)})}setLaFuncCache(e,s,n){let i=this.lookAheadFuncsCache[e];if(i===void 0)i=[],this.lookAheadFuncsCache[e]=i;i[s]=n}}class Ci 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 fs=new Ci;function wa(e){fs.reset(),e.accept(fs);let s=fs.dslMethods;return fs.reset(),s}function Js(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 Zs(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 bi(e,s,n){if(e.children[n]===void 0)e.children[n]=[s];else e.children[n].push(s)}function _i(e,s,n){if(e.children[s]===void 0)e.children[s]=[n];else e.children[s].push(n)}function Qs(e,s){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:s})}function Ua(e,s){let n=Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r],c=e[o],h=c.length;for(let l=0;l<h;l++){let d=c[l];if(d.tokenTypeIdx===void 0)this[d.name](d.children,s)}}}function xi(e,s){let n=function(){};Qs(n,e+"BaseSemantics");let i={visit:function(r,o){if(Array.isArray(r))r=r[0];if(r===void 0)return;return this[r.name](r.children,o)},validateVisitor:function(){let r=Pa(this,s);if(r.length!==0){let o=r.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=i,n.prototype.constructor=n,n._RULE_NAMES=s,n}function vi(e,s,n){let i=function(){};Qs(i,e+"BaseSemanticsWithDefaults");let r=Object.create(n.prototype);return s.forEach((o)=>{r[o]=Ua}),i.prototype=r,i.prototype.constructor=i,i}var en;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(en||(en={}));function Pa(e,s){return Da(e,s)}function Da(e,s){return s.filter((r)=>typeof e[r]==="function"===!1).map((r)=>({msg:`Missing visitor method: <${r}> on ${e.constructor.name} CST Visitor.`,type:en.MISSING_METHOD,methodName:r})).filter(Boolean)}class tn{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=Zs,this.setNodeLocationFromNode=Zs,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=Js,this.setNodeLocationFromNode=Js,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];bi(n,s,e),this.setNodeLocationFromToken(n.location,s)}cstPostNonTerminal(e,s){let n=this.CST_STACK[this.CST_STACK.length-1];_i(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=xi(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let e=vi(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 sn{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 nn{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:Le.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ne.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);let i=this.defineRule(e,s,n);return this[e]=i,i}OVERRIDE_RULE(e,s,n=ct){let i=Ai(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let r=this.defineRule(e,s,n);return this[e]=r,r}BACKTRACK(e,s){var n;let i=(n=e.coreRule)!==null&&n!==void 0?n:e;return function(){this.isBackTrackingStack.push(1);let r=this.saveRecogState();try{return i.apply(this,s),!0}catch(o){if($e(o))return!1;else throw o}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Gt(Object.values(this.gastProductionsCache))}}class rn{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((r,o)=>(r[o.name]=o,r),{});else if(Object.hasOwn(e,"modes")&&Object.values(e.modes).flat().every(zn)){let r=Object.values(e.modes).flat(),o=[...new Set(r)];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 i=(Object.hasOwn(e,"modes")?Object.values(e.modes).flat():Object.values(e)).every((r)=>{var o;return((o=r.categoryMatches)===null||o===void 0?void 0:o.length)==0});this.tokenMatcher=i?at:ve,Me(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 i=Object.hasOwn(n,"resyncEnabled")?n.resyncEnabled:ct.resyncEnabled,r=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 m=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(m),m}catch(m){return this.invokeRuleCatch(m,i,r)}finally{this.ruleFinallyStateUpdate()}};else c=function(...p){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),s.apply(this,p)}catch(m){return this.invokeRuleCatch(m,i,r)}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 i=this.RULE_STACK_IDX===0,r=s&&!this.isBackTracking()&&this.recoveryEnabled;if($e(e)){let o=e;if(r){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(i)return this.moveToTerminatedState(),n(e);else throw o}else throw e}optionInternal(e,s){let n=ds|s;return this.optionInternalLogic(e,s,n)}optionInternalLogic(e,s,n){let i=this.currRuleLookaheadFuncs[n],r;if(typeof e!=="function"){r=e.DEF;let o=e.GATE;if(o!==void 0){let c=i;i=()=>o.call(this)&&c.call(this)}}else r=e;if(i.call(this)===!0)return r.call(this);return}atLeastOneInternal(e,s){let n=vt|e;return this.atLeastOneInternalLogic(e,s,n)}atLeastOneInternalLogic(e,s,n){let i=this.currRuleLookaheadFuncs[n],r;if(typeof s!=="function"){r=s.DEF;let o=s.GATE;if(o!==void 0){let c=i;i=()=>o.call(this)&&c.call(this)}}else r=s;if(i.call(this)===!0){let o=this.doSingleRepetition(r);while(i.call(this)===!0&&o===!0)o=this.doSingleRepetition(r)}else throw this.raiseEarlyExitException(e,H.REPETITION_MANDATORY,s.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,s],i,vt,e,js)}atLeastOneSepFirstInternal(e,s){let n=lt|e;this.atLeastOneSepFirstInternalLogic(e,s,n)}atLeastOneSepFirstInternalLogic(e,s,n){let{DEF:i,SEP:r}=s;if(this.currRuleLookaheadFuncs[n].call(this)===!0){i.call(this);let c=()=>this.tokenMatcher(this.LA_FAST(1),r);while(this.tokenMatcher(this.LA_FAST(1),r)===!0)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,c,i,ss],c,lt,e,ss)}else throw this.raiseEarlyExitException(e,H.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 i=this.currRuleLookaheadFuncs[n],r;if(typeof s!=="function"){r=s.DEF;let c=s.GATE;if(c!==void 0){let h=i;i=()=>c.call(this)&&h.call(this)}}else r=s;let o=!0;while(i.call(this)===!0&&o===!0)o=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,s],i,xt,e,Ws,o)}manySepFirstInternal(e,s){let n=Mt|e;this.manySepFirstInternalLogic(e,s,n)}manySepFirstInternalLogic(e,s,n){let{DEF:i,SEP:r}=s;if(this.currRuleLookaheadFuncs[n].call(this)===!0){i.call(this);let c=()=>this.tokenMatcher(this.LA_FAST(1),r);while(this.tokenMatcher(this.LA_FAST(1),r)===!0)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,c,i,ts],c,Mt,e,ts)}}repetitionSepSecondInternal(e,s,n,i,r){while(n())this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,n,i,r],n,lt,e,r)}doSingleRepetition(e){let s=this.getLexerPosition();return e.call(this),this.getLexerPosition()>s}orInternal(e,s){let n=us|s,i=Array.isArray(e)?e:e.DEF,o=this.currRuleLookaheadFuncs[n].call(this,i);if(o!==void 0)return i[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 i;try{let r=n!==void 0?n.ARGS:void 0;return this.subruleIdx=s,i=e.coreRule.apply(this,r),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(r){throw this.subruleInternalError(r,n,e.ruleName)}}subruleInternalError(e,s,n){if($e(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 i;try{let r=this.LA_FAST(1);if(this.tokenMatcher(r,e)===!0)this.consumeToken(),i=r;else this.consumeInternalError(e,r,n)}catch(r){i=this.consumeInternalRecovery(e,s,r)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,s,n){let i,r=this.LA(0);if(n!==void 0&&n.ERR_MSG)i=n.ERR_MSG;else i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:s,previous:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ot(i,s,r))}consumeInternalRecovery(e,s,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,s);try{return this.tryInRuleRecovery(e,i)}catch(r){if(r.name===Xs)throw n;else throw r}}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 cs(n,s))}while(this.tokVector.at(-1)===we)this.tokVector.pop()}}class an{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,"errorMessageProvider")?e.errorMessageProvider:he.errorMessageProvider}SAVE_ERROR(e){if($e(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 i=this.getCurrRuleFullName(),r=this.getGAstProductions()[i],c=bt(e,r,s,this.maxLookahead)[0],h=[];for(let d=1;d<=this.maxLookahead;d++)h.push(this.LA(d));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:c,actual:h,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new hs(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,s){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],r=Ct(e,i,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:r,actual:o,previous:c,customUserDescription:s,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ls(h,this.LA(1),c))}}var Es={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Es);var Mi=!0,wi=255,Pi=y({name:"RECORDING_PHASE_TOKEN",pattern:z.NA});Me([Pi]);var Di=qe(Pi,`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(Di);var Fa={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 on{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,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${s}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},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(i){throw n}throw n}}optionInternalRecord(e,s){return wt.call(this,K,e,s)}atLeastOneInternalRecord(e,s){wt.call(this,Z,s,e)}atLeastOneSepFirstInternalRecord(e,s){wt.call(this,Q,s,e,Mi)}manyInternalRecord(e,s){wt.call(this,G,s,e)}manySepFirstInternalRecord(e,s){wt.call(this,q,s,e,Mi)}orInternalRecord(e,s){return Ba.call(this,e,s)}subruleInternalRecord(e,s,n){if(ms(s),!e||!Object.hasOwn(e,"ruleName")){let c=Error(`<SUBRULE${Ui(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 i=this.recordingProdStack.at(-1),r=e.ruleName,o=new W({idx:s,nonTerminalName:r,label:n===null||n===void 0?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?Fa:Es}consumeInternalRecord(e,s,n){if(ms(s),!Fs(e)){let o=Error(`<CONSUME${Ui(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 i=this.recordingProdStack.at(-1),r=new M({idx:s,terminalType:e,label:n===null||n===void 0?void 0:n.LABEL});return i.definition.push(r),Di}}function wt(e,s,n,i=!1){ms(n);let r=this.recordingProdStack.at(-1),o=typeof s==="function"?s:s.DEF,c=new e({definition:[],idx:n});if(i)c.separator=s.SEP;if(Object.hasOwn(s,"MAX_LOOKAHEAD"))c.maxLookahead=s.MAX_LOOKAHEAD;return this.recordingProdStack.push(c),o.call(this),r.definition.push(c),this.recordingProdStack.pop(),Es}function Ba(e,s){ms(s);let n=this.recordingProdStack.at(-1),i=Array.isArray(e)===!1,r=i===!1?e:e.DEF,o=new J({definition:[],idx:s,ignoreAmbiguities:i&&e.IGNORE_AMBIGUITIES===!0});if(Object.hasOwn(e,"MAX_LOOKAHEAD"))o.maxLookahead=e.MAX_LOOKAHEAD;let c=r.some((h)=>typeof h.GATE==="function");return o.hasPredicates=c,n.definition.push(o),r.forEach((h)=>{let l=new j({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()}),Es}function Ui(e){return e===0?"":`${e}`}function ms(e){if(e<0||e>wi){let s=Error(`Invalid DSL Method idx value: <${e}>
104
- Idx value must be a none negative value smaller than ${wi+1}`);throw s.KNOWN_RECORDER_ERROR=!0,s}}class ln{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:i,value:r}=gt(s),o=i>10?console.warn:console.log;if(this.traceInitIndent<this.traceInitMaxIdent)o(`${n}<-- <${e}> time: ${i}ms`);return this.traceInitIndent--,r}else return s()}}function Fi(e,s){s.forEach((n)=>{let i=n.prototype;Object.getOwnPropertyNames(i).forEach((r)=>{if(r==="constructor")return;let o=Object.getOwnPropertyDescriptor(i,r);if(o&&(o.get||o.set))Object.defineProperty(e.prototype,r,o);else e.prototype[r]=n.prototype[r]})})}var we=qe(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((i)=>{let o=this[i].originalGrammarAction,c;this.TRACE_INIT(`${i} Rule`,()=>{c=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=c})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=Li({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(n.length===0&&this.skipValidations===!1){let i=Ni({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:Le,grammarName:s}),r=mi({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:s});this.definitionErrors=this.definitionErrors.concat(i,r)}}),this.definitionErrors.length===0){if(this.recoveryEnabled)this.TRACE_INIT("computeAllProdsFollows",()=>{let i=kn(Object.values(this.gastProductionsCache));this.resyncFollows=i});this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,r;(r=(i=this.lookaheadStrategy).initialize)===null||r===void 0||r.call(i,{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((i)=>i.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;Fi(Ut,[Ys,qs,tn,sn,rn,nn,an,on,ln]);class Ts 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 Hi(e,s){let n=e.lexer.tokenize(s);if(n.errors.length>0){let r=n.errors[0],o=ut(r.offset)?r.offset:s.length,c=o+(ut(r.length)?r.length:0);throw Error(`Error lexing ${e.diagramType} diagram: ${r.message} at line ${r.line??1}, column ${r.column??1} [${o},${c})`)}e.parser.input=n.tokens;let i=e.entry();if(e.parser.errors.length>0)throw Error(`Error parsing ${e.diagramType} diagram: ${e.parser.errors[0].message}`);e.visit(i)}t(Hi,"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},Ga="LR",Wa=B.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:Ga,relationshipCounter:0,noteCounter:0,accTitle:"",accDescription:"",ast:void 0,config:structuredClone(Wa)}),"createModel"),ja=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(),Ka=t(()=>structuredClone(w.config),"getConfig"),Va=t(()=>w.ast,"getAST"),za=t((e)=>{let s=structuredClone(e);ja(s);let n=I(),i=D();try{R(s.accTitle),L(s.accDescription),w=s}catch(r){throw R(n),L(i),r}},"commit"),Ha=t(()=>{w=Tn(),A()},"clear"),Xa=t(()=>w.actors,"getActors"),Ya=t((e)=>w.actors.get(e),"getActor"),qa=t(()=>w.useCases,"getUseCases"),Ja=t((e)=>w.useCases.get(e),"getUseCase"),Za=t(()=>w.systemBoundaries,"getSystemBoundaries"),Qa=t((e)=>w.systemBoundaries.get(e),"getSystemBoundary"),eo=t(()=>w.relationships,"getRelationships"),to=t(()=>w.notes,"getNotes"),so=t((e)=>w.notes.get(e),"getNote"),no=t(()=>w.jsonNodes,"getJsonNodes"),io=t((e)=>w.jsonNodes.get(e),"getJsonNode"),ro=t(()=>w.classDefs,"getClassDefs"),ao=t((e)=>w.classDefs.get(e),"getClassDef"),Xi=t(()=>w.direction,"getDirection"),Je=t((e)=>{let s=new Map;for(let n of["default",...e]){let i=w.classDefs.get(n);if(!i)continue;for(let r of i.styles){let o=r.trim(),c=o.indexOf(":"),h=(c===-1?o:o.slice(0,c)).trim();if(h)s.set(h,o)}}return[...s.values()]},"getCompiledStyles"),oo=t((e)=>e.replaceAll("~","~0").replaceAll("/","~1"),"escapeJsonPointerPart"),Bi=t((e)=>typeof e==="string"?e:e===null?"null":String(e),"displayJsonScalar"),lo=t((e,s,n=(i)=>i)=>{let i=[],r=t((c,h,l)=>{i.push({key:n(c),accessibleKey:n(h),value:n(l)})},"append"),o=t((c,h,l)=>{if(Array.isArray(c)){if(c.length===0){r(h,h,"[]");return}if(c.every((p)=>p===null||["string","number","boolean"].includes(typeof p))){for(let[p,m]of c.entries())r(p===0?h:"",h,Bi(m));return}for(let[p,m]of c.entries())o(m,`${h}[${p}]`,`${l}/${p}`);return}if(c!==null&&typeof c==="object"){let d=c,p=s[l]??Object.keys(d);if(p.length===0){r(h,h,"{}");return}for(let m of p){let T=h?`${h}.${m}`:m;o(d[m],T,`${l}/${oo(m)}`)}return}r(h,h,Bi(c))},"visit");return o(e,"",""),i},"flattenJsonRows"),co=t((e)=>{switch(e.type){case"hollow":return"usecaseActorHollow";case"awesome":return"usecaseActorAwesome";case"icon":return"usecaseActorIcon";case"normal":return"usecaseActor"}},"actorShape"),ho=t((e)=>{if(e.shape==="ellipse")return e.business?"usecaseBusiness":"usecaseEllipse";return e.shape},"useCaseShape"),uo=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"),po=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{...uo(e.arrowType),pattern:"solid",...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},"relationshipVisuals"),fo=t((e)=>e.animate||e.animation?[`edge-animation-${e.animation??"fast"}`]:[],"animationClasses"),Pt=t((...e)=>e.filter((s)=>Boolean(s)).join(" "),"classNames"),mo=t(()=>{let e=u(),s={...w.config,...e.usecase},n=t((l)=>U(l,e),"sanitize"),i=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"),r=[],o=[],c=0,h=0;for(let l of w.actors.values())r.push({id:l.id,label:n(l.label),labelType:l.labelType,shape:co(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())r.push({id:l.id,label:n(l.label),labelType:l.labelType,shape:ho(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())r.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())r.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:lo(l.value,l.propertyOrder,n)});for(let l of w.systemBoundaries.values())r.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:d,...p}=po(l);o.push({id:l.id,start:l.source,end:l.target,source:l.source,target:l.target,sourceLabel:i(l.source),targetLabel:i(l.target),type:"edge",relationshipType:l.type,internal:!1,...p,...d!==void 0?{label:n(d)}:{},labelpos:"c",classes:Pt("default","relationship",`relationship-${l.type}`,...l.classes,...fo(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:i(l.id),targetLabel:i(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 r){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:r,edges:o,config:e,type:"usecase",layoutAlgorithm:"dagre",direction:Xi(),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"),Ls={getConfig:Ka,createModel:Tn,commit:za,getAST:Va,clear:Ha,setDiagramTitle:P,getDiagramTitle:N,setAccTitle:R,getAccTitle:I,setAccDescription:L,getAccDescription:D,getActors:Xa,getActor:Ya,getUseCases:qa,getUseCase:Ja,getSystemBoundaries:Za,getSystemBoundary:Qa,getRelationships:eo,getNotes:to,getNote:so,getJsonNodes:no,getJsonNode:io,getClassDefs:ro,getClassDef:ao,getDirection:Xi,getData:mo};function Qe(e,s,n){let i=[n];return i.index=s,i.input=e,i}t(Qe,"customMatch");var Eo=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"),To=t((e,s)=>{if(e[s]!=="%"||e[s+1]!=="%")return null;for(let i=s-1;i>=0;i--){let r=e[i];if(r===`
111
- `||r==="\r")break;if(r!==" "&&r!=="\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"),Yi=t((e,s)=>{for(let n=s-1;n>=0;n--){let i=e[n];if(i===`
113
- `||i==="\r")return!0;if(i!==" "&&i!=="\t")return!1}return!0},"isIndentedLineStart"),qi=t((e,s,n)=>{if(!Yi(e,s))return null;let i=n.exec(e.slice(s));return i?Qe(e,s,i[0]):null},"matchAccessibilityLine"),go=t((e,s)=>{if(!Yi(e,s))return null;let n=/^accDescr[\t ]*{/.exec(e.slice(s));if(!n)return null;let i=e.indexOf("}",s+n[0].length);return i===-1?null:Qe(e,s,e.slice(s,i+1))},"matchAccDescrBlock"),Ao=t((e,s)=>{if(e[s]!=="{")return null;let n=0,i=!1,r=!1;for(let o=s;o<e.length;o++){let c=e[o];if(i){if(r)r=!1;else if(c==="\\")r=!0;else if(c==='"')i=!1;continue}if(c==='"')i=!0;else if(c==="{")n++;else if(c==="}"&&--n===0)return Qe(e,s,e.slice(s,o+1))}return null},"matchJsonObject"),So=t((e,s)=>{let n=e.indexOf(">>",s);if(n===-1||/[\n\r]/.test(e.slice(s,n)))return null;let i=e.slice(s,n);return i.trim()?Qe(e,s,i):null},"matchStereotypeText"),ie=y({name:"LABEL_TEXT",pattern:z.NA}),dt=y({name:"WORD",pattern:z.NA,categories:ie}),gn=y({name:"NUMBER",pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:ie}),Y=y({name:"IDENTIFIER",pattern:/\w+/,longer_alt:gn,categories:dt}),Ro=y({name:"HWS",pattern:/[\t ]+/,group:z.SKIPPED}),Pe=y({name:"MARKDOWN_STRING",pattern:Eo,start_chars_hint:['"'],line_breaks:!0}),yo=y({name:"UNCLOSED_MARKDOWN_STRING",pattern:/"`[^]*/,line_breaks:!0}),un=y({name:"COMMENT",pattern:To,start_chars_hint:["%"],line_breaks:!1}),Ue=y({name:"NEWLINE",pattern:/\r\n|\n|\r/,line_breaks:!0}),Ji=y({name:"ACC_DESCR_BLOCK",pattern:go,start_chars_hint:["a"],line_breaks:!0}),Oo=/^accTitle[\t ]*:[^\n\r]*/,Lo=/^accDescr[\t ]*:[^\n\r]*/,Zi=y({name:"ACC_TITLE_LINE",pattern:t((e,s)=>qi(e,s,Oo),"pattern"),start_chars_hint:["a"],line_breaks:!1}),Qi=y({name:"ACC_DESCR_LINE",pattern:t((e,s)=>qi(e,s,Lo),"pattern"),start_chars_hint:["a"],line_breaks:!1}),er=y({name:"JSON_DECLARATION_START",pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:"jsonBody"}),An=y({name:"JSON_OBJECT_LITERAL",pattern:Ao,start_chars_hint:["{"],line_breaks:!0,pop_mode:!0}),tr=y({name:"UNCLOSED_JSON_OBJECT_LITERAL",pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),ee=t((e,s)=>y({name:e,pattern:s,longer_alt:Y,categories:dt}),"keyword"),sr=ee("USECASE",/usecase-beta/),dn=ee("ACTOR",/actor/),nr=ee("SYSTEM_BOUNDARY",/systemBoundary/),ir=ee("END",/end/),rr=ee("DIRECTION",/direction/),ar=ee("TD",/TD/),or=ee("TB",/TB/),lr=ee("BT",/BT/),cr=ee("LR",/LR/),hr=ee("RL",/RL/),ur=ee("NOTE",/note/),dr=ee("FOR",/for/),No=ee("JSON",/json/),pr=ee("CLASS_DEF",/classDef/),fr=ee("CLASS",/class/),mr=ee("STYLE",/style/),Er=ee("INCLUDE",/include/i),Tr=ee("EXTEND",/extend/i),gr=ee("TRUE",/true/),Ar=ee("FALSE",/false/),Sr=y({name:"GENERALIZATION",pattern:/--\|>/}),Rr=y({name:"DEPENDENCY_ARROW",pattern:/\.\.>/}),yr=y({name:"STEREOTYPE_START",pattern:/<</,push_mode:"stereotype"}),Sn=y({name:"STEREOTYPE_END",pattern:/>>/,pop_mode:!0}),Rn=y({name:"STEREOTYPE_TEXT",pattern:So,line_breaks:!1}),Or=y({name:"UNCLOSED_STEREOTYPE_TEXT",pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),Lr=y({name:"CLASS_SEPARATOR",pattern:/:::/}),gs=y({name:"FORWARD_SOLID",pattern:/--+>/}),Nr=y({name:"BACKWARD_SOLID",pattern:/<--+/}),As=y({name:"FORWARD_CIRCLE",pattern:/--o/}),Ir=y({name:"BACKWARD_CIRCLE",pattern:/o--/}),Ss=y({name:"FORWARD_CROSS",pattern:/--x/}),kr=y({name:"BACKWARD_CROSS",pattern:/x--/}),ye=y({name:"MARKERLESS_SOLID",pattern:/--+/}),pn=y({name:"METADATA_START",pattern:/@{/}),Rs=y({name:"AT",pattern:/@/,categories:ie}),Cr=y({name:"LBRACE",pattern:/{/}),fn=y({name:"RBRACE",pattern:/}/}),ys=y({name:"LBRACKET",pattern:/\[/}),Os=y({name:"RBRACKET",pattern:/]/}),Dt=y({name:"LPAREN",pattern:/\(/}),Ft=y({name:"RPAREN",pattern:/\)/}),Ne=y({name:"COMMA",pattern:/,/,categories:ie}),Bt=y({name:"COLON",pattern:/:/,categories:ie}),br=y({name:"HASH_COLOR",pattern:/#[\dA-Fa-f]+/,categories:ie}),Oe=y({name:"PLAIN_STRING",pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),mn=y({name:"CSS_IDENTIFIER",pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:ie}),_r=y({name:"CSS_ESCAPED_COMMA",pattern:/\\,/,categories:ie}),xr=y({name:"DASH",pattern:/-/,categories:ie}),vr=y({name:"DOT",pattern:/\./,categories:ie}),Mr=y({name:"PERCENT",pattern:/%/,categories:ie}),wr=y({name:"CSS_PUNCTUATION",pattern:/[!#$&*+/=?^_|~]/,categories:ie}),Io=y({name:"LABEL_PUNCTUATION",pattern:/[;<>\\`]/,categories:ie}),ko=y({name:"LABEL_SYMBOL",pattern:/[^\t\n\r !-~]+/,categories:ie}),Ur=[ie,dt,Ro,Pe,yo,un,Ue,Ji,Zi,Qi,er,sr,dn,nr,ir,rr,ar,or,lr,cr,hr,ur,dr,No,pr,fr,mr,Er,Tr,gr,Ar,Sr,Rr,yr,Lr,gs,Nr,As,Ir,Ss,kr,ye,pn,Rs,Cr,fn,ys,Os,Dt,Ft,Ne,Bt,br,Oe,mn,Y,gn,_r,xr,vr,Mr,wr,Io,ko],Co={defaultMode:"defaultMode",modes:{defaultMode:[...Ur],jsonBody:[An,tr],stereotype:[Sn,Rn,Or]}},bo=[...Ur,An,tr,Sn,Rn,Or],_o=new z(Co),$i=t((e)=>It(e,ie)||e.tokenType===Oe||e.tokenType===Pe,"isLabelToken"),xo={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},vo=class extends Ts{static{t(this,"UsecaseParser")}constructor(){super(bo,{nodeLocationTracking:"full"});this.RULE("start",()=>{this.CONSUME(sr),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(Ue),"ALT")},{ALT:t(()=>this.CONSUME(me),"ALT")}])}),this.RULE("blankLine",()=>{this.CONSUME(Ue)}),this.RULE("commentLine",()=>{this.CONSUME(un),this.SUBRULE(this.lineEnd)}),this.RULE("accTitleStatement",()=>{this.CONSUME(Zi),this.SUBRULE(this.lineEnd)}),this.RULE("accDescrStatement",()=>{this.OR([{ALT:t(()=>this.CONSUME(Qi),"ALT")},{ALT:t(()=>this.CONSUME(Ji),"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(Ne),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(Oe),"ALT")},{ALT:t(()=>this.CONSUME(Pe),"ALT")}])}),this.RULE("actorDeclarationOnly",()=>{this.CONSUME(dn),this.SUBRULE(this.actorItem),this.MANY(()=>{this.CONSUME(Ne),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(ys),this.SUBRULE2(this.nodeLabel),this.CONSUME(Os)},"ALT")}])})},"ALT")},{ALT:t(()=>this.CONSUME(Oe),"ALT")},{ALT:t(()=>this.CONSUME(Pe),"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(Oe),"ALT")},{ALT:t(()=>this.CONSUME(Pe),"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===Rs,"GATE"),DEF:t(()=>{this.CONSUME(Y),this.CONSUME(Rs)},"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(gs)}),this.RULE("backwardSolidOperator",()=>{this.CONSUME(Nr),this.OPTION({GATE:t(()=>this.LA(0).image==="<--"&&this.hasLabeledRight([ye]),"GATE"),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(ye)},"DEF")})}),this.RULE("markerlessSolidOperator",()=>{this.CONSUME(ye),this.OPTION({GATE:t(()=>this.LA(0).image==="--"&&this.hasLabeledRight([gs,ye,As,Ss]),"GATE"),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:t(()=>this.CONSUME(gs),"ALT")},{ALT:t(()=>this.CONSUME2(ye),"ALT")},{ALT:t(()=>this.CONSUME(As),"ALT")},{ALT:t(()=>this.CONSUME(Ss),"ALT")}])},"DEF")})}),this.RULE("forwardCircleOperator",()=>{this.CONSUME(As)}),this.RULE("backwardCircleOperator",()=>{this.CONSUME(Ir),this.OPTION({GATE:t(()=>this.hasLabeledRight([ye]),"GATE"),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(ye)},"DEF")})}),this.RULE("forwardCrossOperator",()=>{this.CONSUME(Ss)}),this.RULE("backwardCrossOperator",()=>{this.CONSUME(kr),this.OPTION({GATE:t(()=>this.hasLabeledRight([ye]),"GATE"),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(ye)},"DEF")})}),this.RULE("edgeLabel",()=>{this.OR([{ALT:t(()=>this.CONSUME(Oe),"ALT")},{ALT:t(()=>this.CONSUME(Pe),"ALT")},{ALT:t(()=>this.AT_LEAST_ONE(()=>this.CONSUME(ie)),"ALT")}])}),this.RULE("semanticRelation",()=>{this.OR([{ALT:t(()=>{this.CONSUME(Rr),this.CONSUME(Bt),this.OR2([{ALT:t(()=>this.CONSUME(Er),"ALT")},{ALT:t(()=>this.CONSUME(Tr),"ALT")}])},"ALT")},{ALT:t(()=>this.CONSUME(Sr),"ALT")}])}),this.RULE("metadata",()=>{this.CONSUME(pn),this.MANY(()=>this.CONSUME(Ue)),this.OPTION(()=>{this.SUBRULE(this.metadataProperty),this.MANY2(()=>{this.SUBRULE(this.metadataSeparator),this.SUBRULE2(this.metadataProperty)}),this.OPTION2(()=>this.CONSUME(Ne)),this.MANY3(()=>this.CONSUME2(Ue))}),this.CONSUME(fn)}),this.RULE("metadataProperty",()=>{this.OR([{ALT:t(()=>this.CONSUME(Y),"ALT")},{ALT:t(()=>this.CONSUME(Oe),"ALT")}]),this.CONSUME(Bt),this.OR2([{ALT:t(()=>this.CONSUME2(Y),"ALT")},{ALT:t(()=>this.CONSUME2(Oe),"ALT")},{ALT:t(()=>this.CONSUME(gr),"ALT")},{ALT:t(()=>this.CONSUME(Ar),"ALT")}])}),this.RULE("metadataSeparator",()=>{this.OR([{ALT:t(()=>{this.CONSUME(Ne),this.MANY(()=>this.CONSUME(Ue))},"ALT")},{ALT:t(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(Ue)),this.OPTION(()=>this.CONSUME2(Ne)),this.MANY2(()=>this.CONSUME3(Ue))},"ALT")}])}),this.RULE("systemBoundaryStatement",()=>{this.CONSUME(nr),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(ir),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(ys),this.SUBRULE2(this.nodeLabel),this.CONSUME(Os)},"ALT")}])})},"ALT")},{ALT:t(()=>this.CONSUME(Oe),"ALT")},{ALT:t(()=>this.CONSUME(Pe),"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(Oe),"ALT")},{ALT:t(()=>this.CONSUME(Pe),"ALT")}])}),this.RULE("noteStatement",()=>{this.CONSUME(ur),this.CONSUME(dr),this.CONSUME(Y),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE("stereotype",()=>{this.CONSUME(yr),this.CONSUME(Rn),this.CONSUME(Sn)}),this.RULE("classSuffix",()=>{this.CONSUME(Lr),this.CONSUME(Y),this.MANY(()=>{this.CONSUME(Ne),this.CONSUME2(Y)})}),this.RULE("jsonStatement",()=>{this.CONSUME(er),this.CONSUME(An),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE("directionStatement",()=>{this.CONSUME(rr),this.OR([{ALT:t(()=>this.CONSUME(ar),"ALT")},{ALT:t(()=>this.CONSUME(or),"ALT")},{ALT:t(()=>this.CONSUME(lr),"ALT")},{ALT:t(()=>this.CONSUME(cr),"ALT")},{ALT:t(()=>this.CONSUME(hr),"ALT")}]),this.SUBRULE(this.lineEnd)}),this.RULE("classDefStatement",()=>{this.CONSUME(pr),this.CONSUME(Y),this.MANY(()=>{this.CONSUME(Ne),this.CONSUME2(Y)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE("classStatement",()=>{this.CONSUME(fr),this.CONSUME(Y),this.MANY(()=>{this.CONSUME(Ne),this.CONSUME2(Y)}),this.CONSUME3(Y),this.MANY2(()=>{this.CONSUME2(Ne),this.CONSUME4(Y)}),this.SUBRULE(this.lineEnd)}),this.RULE("styleStatement",()=>{this.CONSUME(mr),this.CONSUME(Y),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE("styles",()=>{this.SUBRULE(this.styleValue),this.MANY(()=>{this.CONSUME(Ne),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(ye),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(Oe),"ALT")},{ALT:t(()=>this.CONSUME(gn),"ALT")},{ALT:t(()=>this.CONSUME(br),"ALT")},{ALT:t(()=>this.CONSUME(mn),"ALT")},{ALT:t(()=>this.CONSUME(_r),"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(Bt),"ALT")},{ALT:t(()=>this.CONSUME(Dt),"ALT")},{ALT:t(()=>this.CONSUME(Ft),"ALT")},{ALT:t(()=>this.CONSUME(ys),"ALT")},{ALT:t(()=>this.CONSUME(Os),"ALT")},{ALT:t(()=>this.CONSUME(Cr),"ALT")},{ALT:t(()=>this.CONSUME(fn),"ALT")},{ALT:t(()=>this.CONSUME(Rs),"ALT")},{ALT:t(()=>this.CONSUME(ye),"ALT")}])}),this.performSelfAnalysis()}isMetadataAssignment(){let e=this.LA(1).tokenType;return(e===Y||e===Oe||e===Pe)&&this.LA(2).tokenType===pn}isStatementStart(){let e=this.LA(1).tokenType;return e!==me&&e!==Ue&&e!==un}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===Y&&xo[this.LA(1).image.toLowerCase()]===!0}hasLabeledRight(e){if(!$i(this.LA(1)))return!1;for(let s=2;;s++){let n=this.LA(s);if(e.includes(n.tokenType))return!0;if(!$i(n))return!1}}},$t=new vo,Gi=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,i)=>{let r=n,o=i,c=Math.min(Math.max(s,0),e.length);for(let h=0;h<c;h++){let l=e[h];if(l==="\r")r++,o=1;else if(l===`
114
- `){if(h===0||e[h-1]!=="\r")r++,o=1}else o++}return{line:r,column:o}},"locationAtOffset"),Mo=t((e,s,n,i)=>{let r=/\bposition (\d+)\b/u.exec(e);if(r)return En(s,Number.parseInt(r[1],10),n,i);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?i+h-1:h}}if(/unexpected end|end of json input/iu.test(e))return En(s,s.length,n,i);return},"locationFromErrorMessage"),ae=class extends Error{constructor(e){super("Invalid JSON token");this.offset=e}static{t(this,"JsonWalkError")}},Wi=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 i=this.readString(!0),r=`${e}/${i.replaceAll("~","~0").replaceAll("/","~1")}`;if(n.has(i))this.deletePointerSubtree(r);else n.add(i),s.push(i);if(this.skipWhitespace(),this.text[this.offset]!==":")throw new ae(this.offset);if(this.offset++,this.collectValue(r),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,i=this.text[this.offset++];if(i==='"')return s;if(i.charCodeAt(0)<32)throw new ae(n);if(i!=="\\"){if(e)s+=i;continue}let r=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(r)}}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 Pr(e,s,n){let i;try{i=JSON.parse(e)}catch(r){let o=r instanceof Error?r.message:String(r),c=Mo(o,e,s,n);if(!c){let h=0;try{new Wi(e).collect()}catch(l){if(l instanceof ae)h=l.offset}c=En(e,h,s,n)}throw new Gi(`Invalid JSON: ${o}`,c.line,c.column)}if(typeof i!=="object"||i===null||Array.isArray(i))throw new Gi("JSON value must have an object root",s,n);return{value:i,propertyOrder:new Wi(e).collect()}}t(Pr,"parseOrderedJsonObject");var wo=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"),Uo=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"),Po=t((e)=>({label:e.label,shape:"note",attrs:{kind:"note",target:e.target,labelType:e.labelType}}),"noteNode"),Do=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"),Fo=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"),Bo=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"),$o=t((e,s,n,i)=>{let r={};for(let l of e.getActors().values())r[l.id]=wo(l);for(let l of e.getUseCases().values())r[l.id]=Uo(l);for(let l of e.getNotes().values())r[l.id]=Po(l);for(let l of e.getJsonNodes().values())r[l.id]=Do(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:r,edges:[...e.getRelationships().map(Fo),...[...e.getNotes().values()].map(Bo)],groups:o,classDefs:c,statements:i}},"buildUsecaseGraphAST"),le=t((e)=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,"locationText"),ji=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"),Go=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,i){this.metadataAssignments.push({target:e,targetLocation:s,metadata:n,statement:i})}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,i=new Map,r=new Map;for(let l of this.relationshipDrafts)this.recordFirst(r,l.source.id,l.source.location.span[0]),this.recordFirst(r,l.target.id,l.target.location.span[0]);for(let l of this.elements)this.recordFirst(r,l.id,l.location.span[0]);for(let l of this.boundaries)this.recordFirst(r,l.id,l.location.span[0]);for(let l of this.jsonDrafts)this.recordFirst(r,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,d)=>l.offset-d.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,i);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,r),this.materializeBoundaries(i,r),this.materializeJson(r);let c=this.materializeRelationships(s,n,r);this.reorderElements(n,r),this.applyMetadataAssignments(s,n,i,c),this.validateAndRefreshElements(n),this.refreshBoundaries(i,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,d])=>[l,d.kind]));let h=$o(this,this.source,e,this.statements);return this.model.ast=h,this.db.commit(this.model),h}collectElement(e,s,n){let i=s.get(e.id),r=Ze({generated:e.generated,label:e.label.text});if(i&&i.kind!==e.kind)this.conflict(`ID '${e.id}' is declared as both ${i.kind} and ${e.kind}`,e.location,i.location,r,Ze(i));if(i&&(i.generated||e.generated))this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,i.location,r,Ze(i));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 i=s.get(e.id),r=Ze({generated:e.generated,label:e.label.text});if(i&&i.kind!=="boundary")this.conflict(`ID '${e.id}' is declared as both ${i.kind} and boundary`,e.location,i.location,r,Ze(i));if(i&&(i.generated||e.generated))this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,i.location,r,Ze(i));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((i,r)=>(s.get(i.id)??0)-(s.get(r.id)??0)))this.setElementModel(n)}materializeBoundaries(e,s){for(let n of[...e.values()].sort((i,r)=>(s.get(i.id)??0)-(s.get(r.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,i)=>(e.get(n.id)??0)-(e.get(i.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 i=new Map,r=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-${r++}`,d={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(d),i.set(l,{draft:o,relationship:d})}return this.model.relationshipCounter=r,i}resolveEndpoint(e,s,n,i){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${le(e.location)}`);let r=s.get(e.id);if(r)return r.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(i,e.id,e.location.span[0]),"usecase"}reorderElements(e,s){let n=new Map(this.model.actors),i=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(let r of[...e.values()].sort((o,c)=>(s.get(o.id)??0)-(s.get(c.id)??0))){if(!n.has(r.id)&&!i.has(r.id))this.setElementModel(r);let o=n.get(r.id)??this.model.actors.get(r.id),c=i.get(r.id)??this.model.useCases.get(r.id);if(o)this.model.actors.set(r.id,o);else if(c)this.model.useCases.set(r.id,c)}}applyMetadataAssignments(e,s,n,i){for(let r of this.metadataAssignments){let o=e.get(r.target);if(!o){let c=this.inferMetadataKind(r.metadata);throw Error(`Metadata target '${r.target}' is unresolved${c?` (metadata implies ${c})`:""} at ${le(r.targetLocation)}`)}if(o.kind==="actor"||o.kind==="usecase")this.applyStandaloneElementMetadata(s.get(r.target),r.metadata);else if(o.kind==="boundary"){let c=n.get(r.target);for(let h of r.metadata.properties){if(h.key!=="type"||h.value!=="rect"&&h.value!=="package")this.invalidMetadata(r.target,o.kind,h);c.type=h.value}}else if(o.kind==="edge"){let c=i.get(r.target);if(!c)throw Error(`Metadata target '${r.target}' is not an explicit edge at ${le(r.targetLocation)}`);r.statement.kind="edgeMetadata",r.statement.edges=[{id:r.target,span:r.statement.span,idSpan:r.targetLocation.span,...r.statement.metadata?{metadata:r.statement.metadata}:{}}],delete r.statement.nodes;for(let h of r.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(r.target,o.kind,h)}else for(let c of r.metadata.properties)this.invalidMetadata(r.target,o.kind,c)}for(let{relationship:r}of i.values())if(r.animation)r.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((i,r)=>i.location.span[0]-r.location.span[0])){if(!n.parentId)continue;let i=e.get(n.parentId);if(!i)throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${le(n.parentLocation??n.location)}`);if(!i.members.includes(n.id))i.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 i=this.model.systemBoundaries.get(n.id);i.type=n.type??"rect",i.members=[...n.members],i.classes=[...n.classes],i.styles=[...n.styles]}}materializeNotes(e){let s=0;for(let n of this.noteDrafts){let i=e.get(n.target);if(!i)throw Error(`Note target '${n.target}' is unresolved at ${le(n.targetLocation)}`);if(i.kind!=="actor"&&i.kind!=="usecase")this.conflict(`Note target '${n.target}' must be an actor or use case, not ${i.kind}`,n.targetLocation,i.location);let r=`note-${s++}`;this.model.notes.set(r,{id:r,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 i of n.targets)hn(this.getStylable(i.id,e,s,i.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,i){let r=s.get(e)?.kind,o=r==="actor"?this.model.actors.get(e):r==="usecase"?this.model.useCases.get(e):r==="boundary"?this.model.systemBoundaries.get(e):r==="json"?this.model.jsonNodes.get(e):r==="edge"?n.get(e)?.relationship:void 0;if(!o)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${le(i)}`);return o}validateRelationship(e,s,n,i){let r=t((o)=>o==="actor"||o==="usecase"||o==="json","allowed");if(!r(s))this.conflict(`Relationship source '${e.source.id}' cannot be ${s}`,e.source.location,i.get(e.source.id).location);if(!r(n))this.conflict(`Relationship target '${e.target.id}' cannot be ${n}`,e.target.location,i.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,i,r){let o=e.get(s);if(o)this.conflict(`ID '${s}' is declared more than once (${o.kind} and ${n})`,i,o.location,void 0,Ze(o));e.set(s,{kind:n,location:i,generated:r})}recordFirst(e,s,n){let i=e.get(s);if(i===void 0||n<i)e.set(s,n)}conflict(e,s,n,i,r){throw Error(`${e} at ${le(s)}${ji(i)}; previous declaration at ${le(n)}${ji(r)}`)}},Wo=$t.getBaseCstVisitorConstructor(),jo=class extends Wo{constructor(){super();this.builder=new Go(Ls),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 i of this.nodes(e,"line"))n.push(this.visit(i));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],i=s?s.image.slice(s.image.indexOf(":")+1).trim():n.image.slice(n.image.indexOf("{")+1,n.image.lastIndexOf("}")).trim();return this.builder.setAccDescription(i),{kind:"accDescr",span:[0,0]}}actorStatement(e){let s=this.nodes(e,"actorItem"),n=s.map((l)=>this.visit(l)),i=this.nodes(e,"relationTail")[0],r=n.map((l,d)=>this.actorOccurrence(s[d],l,!0));for(let l of n)this.builder.addElement(this.actorDraft(l));if(!i)return{kind:"node",span:[0,0],nodes:r};let o=this.visit(i);if(o.target.explicitDeclaration)this.builder.addElement(this.entityDraft(o.target));let c=this.relationshipDraft(n[0],o,this.nodeLocation(i));this.builder.addRelationship(c);let h=c.explicitId??`edge-${this.anonymousEdge++}`;return r.push(this.entityOccurrence(this.nodes(i.children,"entityName")[0],o.target,o.target.explicitDeclaration)),{kind:"edge",span:[0,0],nodes:r,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],i=this.nodes(e,"stereotype")[0],r=this.nodes(e,"classSuffix")[0],o=r?this.visit(r):{classes:[],spans:[]};return{...s,...n?{metadata:this.visit(n)}:{},...i?{stereotype:this.visit(i)}:{},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 r=this.nodes(e,"nodeLabel")[0],o=r?this.visit(r):this.tokenLabel(s);return{id:s.image,label:o,location:this.tokenLocation(s),generated:!1,classes:[],classSpans:[]}}let i=this.tokenLabel(n);return{id:this.generateId(i.text),label:i,location:this.tokenLocation(n),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let s=this.nodes(e,"actorItem"),n=s.map((i)=>this.visit(i));for(let i of n)this.builder.addElement(this.actorDraft(i));return{kind:"node",span:[0,0],nodes:n.map((i,r)=>this.actorOccurrence(s[r],i,!0))}}entityStatement(e){let s=this.nodes(e,"entityName"),n=this.visit(s[0]),i=this.nodes(e,"relationTail")[0];if(!i)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 r=this.visit(i);if(r.target.explicitDeclaration)this.builder.addElement(this.entityDraft(r.target));let o={source:this.endpoint(n),target:this.endpoint(r.target),location:this.nodeLocation(i),...r.explicitId?{explicitId:r.explicitId,explicitIdLocation:r.explicitIdLocation}:{},...r.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(i.children,"entityName")[0],r.target,r.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],i=this.nodes(e,"nodeLabel")[0],r=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 d=i?this.visit(i):this.tokenLabel(s),p=i?this.tokens(e,"LBRACKET").length?"rect":"ellipse":void 0;return{id:s.image,label:d,location:this.tokenLocation(s),generated:!1,...p?{shape:p}:{},...r?{metadata:this.visit(r)}:{},...o?{stereotype:this.visit(o)}:{},classes:h.classes,classSpans:h.spans,explicitDeclaration:Boolean(p||r||o)}}let l=this.tokenLabel(n);return{id:this.generateId(l.text),label:l,location:this.tokenLocation(n),generated:!0,...r?{metadata:this.visit(r)}:{},...o?{stereotype:this.visit(o)}:{},classes:h.classes,classSpans:h.spans,explicitDeclaration:Boolean(r||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],i=s[1],r=i.tokenType.name==="TRUE"?!0:i.tokenType.name==="FALSE"?!1:this.decodePlain(i),o=[n.startOffset,(i.endOffset??i.startOffset)+1];return{key:this.decodePlain(n),value:r,span:o,keySpan:this.contentSpan(n),valueSpan:this.contentSpan(i),location:this.tokenLocation(n)}}metadataSeparator(e){return}systemBoundaryStatement(e){let s=this.visit(this.nodes(e,"systemBoundaryName")[0]),n=this.nodes(e,"classSuffix")[0],i=n?this.visit(n):{classes:[],spans:[]};s.classes=i.classes,this.builder.addBoundary(s);let r=this.parentBoundary;this.parentBoundary={id:s.id,location:s.location};let o=this.nodes(e,"systemBoundaryContent")[0],c=o?this.visit(o):[];this.parentBoundary=r;let h=this.tokens(e,"END")[0],l=this.nodes(e,"metadata")[0],d=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:i.spans,...d?{metadata:d.properties.map(({key:m,span:T,keySpan:g,valueSpan:x})=>({key:m,span:T,keySpan:g,valueSpan:x}))}:{},...c.length?{children:c}:{}};if(d)this.builder.addMetadataAssignment(s.id,s.location,d,p);return p}systemBoundaryName(e){let s=this.tokens(e,"IDENTIFIER")[0];if(s){let r=this.nodes(e,"nodeLabel")[0];return{id:s.image,label:r?this.visit(r):this.tokenLabel(s),location:this.tokenLocation(s),generated:!1,classes:[]}}let n=this.tokens(e,"PLAIN_STRING")[0]??this.tokens(e,"MARKDOWN_STRING")[0],i=this.tokenLabel(n);return{id:this.generateId(i.text),label:i,location:this.tokenLocation(n),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,"blankLine"),...this.nodes(e,"commentLine"),...this.nodes(e,"boundaryElement")].sort((n,i)=>(n.location?.startOffset??0)-(i.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],i=this.visit(n);return i.explicitDeclaration=!0,i.shape??="ellipse",this.builder.addElement(this.entityDraft(i)),{kind:"node",span:[0,0],nodes:[this.entityOccurrence(n,i,!0)]}}metadataAssignmentStatement(e){let s=this.visit(this.nodes(e,"metadataAssignmentTarget")[0]),n=this.visit(this.nodes(e,"metadata")[0]),i={kind:"metadata",span:[0,0],nodes:[{id:s.id,span:s.location.span,idSpan:s.location.span}],metadata:n.properties.map(({key:r,span:o,keySpan:c,valueSpan:h})=>({key:r,span:o,keySpan:c,valueSpan:h}))};return this.builder.addMetadataAssignment(s.id,s.location,n,i),i}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],i=/^json[\t ]+(\w+)/.exec(s.image),r=i[1],o=i[0].length-r.length,c={span:[s.startOffset+o,s.startOffset+o+r.length],line:s.startLine??1,column:(s.startColumn??1)+o},h=Pr(n.image,n.startLine??1,n.startColumn??1),l=this.nodes(e,"classSuffix")[0],d=l?this.visit(l):{classes:[],spans:[]},p={id:r,value:h.value,propertyOrder:h.propertyOrder,location:c,classes:d.classes};return this.builder.addJson(p),{kind:"json",span:[0,0],nodes:[{id:r,span:c.span,idSpan:c.span,defines:!0,classSpans:d.spans}],classSpans:d.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((i)=>i.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 i=s.slice(0,n).map((o)=>({id:o.image,location:this.tokenLocation(o)})),r=s.slice(n).map((o)=>o.image);return this.builder.addClassAssignment(i,r),{kind:"classAssign",span:[0,0],ref:r[0],refSpan:this.tokenSpan(s[n]),nodes:i.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],i=n?this.tokens(e,"MARKERLESS_SOLID").at(-1):s;return{type:"association",arrowType:X.BACK_ARROW,minlen:this.solidMinlen(i),...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 i=n.at(-1),r=i.tokenType.name==="FORWARD_SOLID"?X.SOLID_ARROW:i.tokenType.name==="FORWARD_CIRCLE"?X.CIRCLE_ARROW:i.tokenType.name==="FORWARD_CROSS"?X.CROSS_ARROW:X.LINE_SOLID;return{type:"association",arrowType:r,label:this.visit(s),minlen:r===X.SOLID_ARROW||r===X.LINE_SOLID?this.solidMinlen(i):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:i,span:r,keySpan:o,valueSpan:c})=>({key:i,span:r,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,i=this.tokenSpan(e,n);return{text:this.source.slice(i[0],i[1]),type:s,span:i}}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((r)=>r.tokenType.name!=="NEWLINE"&&r.tokenType.name!=="EOF"),n=s[0],i=s.at(-1);return{span:[n.startOffset,Math.min(this.source.length,(i.endOffset??i.startOffset+i.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((r)=>r.tokenType.name!=="NEWLINE"&&r.tokenType.name!=="EOF"),n=s[0],i=s.at(-1);if(!n||!i)throw Error("Usecase CST node has no source token");return[n.startOffset,Math.min(this.source.length,(i.endOffset??i.startOffset+i.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 i=this.nodes(e,n)[0];if(i)return i}throw Error(`Usecase CST is missing one of: ${s.join(", ")}`)}allTokens(e){let s=[];for(let n of Object.values(e))for(let i of n)if("tokenTypeIdx"in i)s.push(i);else s.push(...this.allTokens(i.children));return s.sort((n,i)=>n.startOffset-i.startOffset)}},Ko=new jo,Vo={parse:t(async(e)=>{Ls.clear(),$t.input=[];try{Hi({diagramType:"usecase",lexer:_o,parser:$t,entry:t(()=>$t.start(),"entry"),visit:t((s)=>Ko.build(s,e),"visit")},e)}catch(s){Ls.clear();let n=$t.errors[0];if(n){let{token:i}=n,r=ut(i.startOffset)?i.startOffset:e.length,o=ut(i.endOffset)?i.endOffset+1:r,c=ut(i.startLine)?i.startLine:e.slice(0,r).split(/\r\n|\r|\n/).length,h=Math.max(e.lastIndexOf(`
117
- `,r-1),e.lastIndexOf("\r",r-1)),l=ut(i.startColumn)?i.startColumn:r-h,d=s instanceof Error?s.message:String(s);throw Error(`${d} at line ${c}, column ${l} [${r},${o})`)}throw s}},"parse")},Ho=["point","circle","cross","extension"],Dr={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},Ki=t((e,s)=>{let[n,i]=[e,s].map((r)=>r.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element");return`usecase-${n}-${i}`},"usecaseDomId"),Xo=t((e)=>`usecase-${e.replace(/[^\w-]+/g,"_").replace(/^_+|_+$/g,"")||"element"}`,"usecaseNodeDomId"),Ns=t((e,s)=>{if(s!=="markdown")return e;return zo(e).map((n)=>n.map((i)=>i.content).join(" ")).join(`
118
- `)},"getAccessibleLabel"),Yo=t((e)=>{let s=Ns(e.label??e.id,e.labelType);if(Dr[e.shape]){let i=e.actorType&&e.actorType!=="normal"?`${e.actorType} `:"",r=e.business?"business ":"",o=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${r}${i}actor ${s}${o}`}if(e.shape==="note")return`Note for ${e.noteTargetLabel??e.noteTarget??""}: ${s}`;if(e.shape==="usecaseJsonTable"){let i=(e.jsonRows??[]).map((r)=>`${r.accessibleKey}: ${r.value}`).join("; ");return i?`${s}: ${i}`:s}let n=e.stereotype?`, stereotype ${e.stereotype}`:"";return`${e.business?"business ":""}use case ${s}${n}`},"getUsecaseNodeAccessibleName"),qo=t((e)=>`${e.boundaryType} system boundary ${Ns(e.label??e.id,e.labelType)}`,"getUsecaseBoundaryAccessibleName"),Jo=t((e)=>{if(e.relationshipType==="note")return"";return`${e.relationshipType==="association"&&e.label?`association ${Ns(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"),Vi=t((e)=>e.replace(/([*[\\\]_`])/g,"\\$1"),"escapeMarkdownMarkers"),Zo=t((e,s)=>{e.diagramId=s,e.markers=[...Ho];for(let n of e.nodes){let i=n;if(i.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((r)=>({...r,key:ht(r.key),value:ht(r.value)}));if(!n.isGroup&&(n.shape==="usecaseEllipse"||n.shape==="rect")&&n.stereotype){let r=n.label??ht(n.id);n.label=`«${Vi(n.stereotype)}»<br/>${n.labelType==="text"?Vi(r):r}`,n.labelType="markdown",i.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 r of s.nodes){let o=typeof r.domId==="string"?r.domId:Ki(s.diagramId,r.id),c=e.select(`#${o}`),h=r.isGroup?"boundary":Dr[r.shape]?"actor":r.shape==="note"?"note":r.shape==="usecaseJsonTable"?"json":"usecase",l=n.nodes.get(r.id)??r.id;if(c.attr("data-usecase-id",r.id).attr("data-usecase-kind",h).attr("role","img").attr("aria-label",l),!r.isGroup&&(r.shape==="usecaseEllipse"||r.shape==="rect")&&"hasFoldedStereotype"in r&&r.hasFoldedStereotype===!0){let d=c.node(),p=d?.querySelector(".nodeLabel"),m=p?.querySelector("p")??p,T=m?.firstChild;if(m&&T?.nodeType===3){let g=m.ownerDocument.createElement("span");g.className="usecase-stereotype",m.insertBefore(g,T),g.appendChild(T)}else d?.querySelector(".label tspan tspan, .label tspan")?.classList.add("usecase-stereotype")}}let i=new Map(s.edges.map((r)=>[r.id,r]));e.selectAll('path[data-et="edge"]').each(function(){let r=i.get(this.getAttribute("data-id")??"");if(!r)return;let o=f(this);if(o.attr("id",Ki(s.diagramId,r.id)).attr("data-usecase-id",r.id).attr("data-usecase-kind",r.internal?"note-connector":"relationship"),r.internal)o.attr("aria-hidden","true");else o.attr("role","img").attr("aria-label",n.edges.get(r.id)??r.id)})},"annotateUsecaseElements"),zi=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,i)=>{a.info("Drawing usecase diagram (unified)",s);let{layout:r}=u(),o=i.db,c=o.getData(),h=new Map(c.nodes.map((m)=>[m.id,Ns(m.label??m.id,m.labelType)])),l={nodes:new Map(c.nodes.map((m)=>[m.id,m.isGroup?qo(m):Yo(m.shape==="note"?{...m,noteTargetLabel:h.get(m.noteTarget??"")}:m)])),edges:new Map(c.edges.map((m)=>[m.id,Jo({...m,sourceLabel:h.get(m.source)??m.sourceLabel,targetLabel:h.get(m.target)??m.targetLabel})]))},d=Be(s,c.config.securityLevel);c.layoutAlgorithm=ze(r),Zo(c,s),zi(d,c),await Fe(c,d),Qo(d,c,l);let p=c.diagramPadding;F.insertTitle(d,"usecaseDiagramTitleText",0,o.getDiagramTitle?.()??""),Re(d,p,"usecaseDiagram",c.useMaxWidth),zi(d,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:i}=e;if(!Te(s,i))return"";let r=S().usecase?.colorScheme==="rotate",o=Ee(e.look),c=o==="handDrawn",h=Ie(n),l="";for(let d=0;d<cn(i);d++){let p=i[d],m=h?`fill: ${n[d%n.length]};`:"",T=`[data-look="${o}"][data-color-id="color-${d}"]`;if(l+=`
119
-
120
- & ${T}.system-boundary rect.boundary-body,
121
- & ${T}.system-boundary rect.boundary-tab,
122
- & ${T}.system-boundary .boundary-body path,
123
- & ${T}.system-boundary .boundary-tab path {
124
- stroke: ${p};
125
- ${m}
126
- }
127
- `,!r)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
- & ${T}.usecase-element ellipse,
139
- & ${T}.usecase-element rect {
140
- stroke: ${p};
141
- ${m}
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
- & ${T}.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
- & ${T}.usecase-actor .usecase-actor-shape,
156
- & ${T}.usecase-actor .usecase-actor-hollow,
157
- & ${T}.usecase-actor .usecase-actor-awesome,
158
- & ${T}.usecase-actor .usecase-actor-icon {
159
- stroke: ${p};
160
- ${m}
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
- & ${T}.usecase-actor .usecase-actor-glyph path,
173
- & ${T}.usecase-actor .usecase-actor-glyph circle {
174
- stroke: ${p};
175
- }
176
- `}
177
- `}return l},"genColor");var il=t((e)=>{let s=sl(e),n=Ee(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="${Ee(e.look)}"].node.usecase-element ellipse,
239
- & [data-look="${Ee(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="${Ee(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:Vo,db:Ls,renderer:tl,styles:rl};export{ed as diagram};