collabmd 0.1.47 → 0.1.49

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 (305) hide show
  1. package/README.md +70 -11
  2. package/bin/collabmd.js +3 -0
  3. package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-C-nmgL5g.js +1 -0
  4. package/dist/client/assets/JetBrainsMono-Regular-BQaDgvhP.woff2 +0 -0
  5. package/dist/client/assets/abnfDiagram-VCTEODGH-CdVZqicp.js +1 -0
  6. package/dist/client/assets/{architectureDiagram-5GKGNRK7-I39sYjHI.js → architectureDiagram-5GKGNRK7-wUo0bXif.js} +3 -3
  7. package/dist/client/assets/babel-CY5KOv-I.js +16 -0
  8. package/dist/client/assets/{blockDiagram-NRAW4CY4-C6DtJy5Y.js → blockDiagram-I7D4REHJ-BRSK3m49.js} +4 -4
  9. package/dist/client/assets/browser-utils-DbXSMI-6.js +1 -0
  10. package/dist/client/assets/{c4Diagram-UCG6FXSJ-CtWtxS9_.js → c4Diagram-7LVT6UL2-yD2poxqw.js} +1 -1
  11. package/dist/client/assets/channel-Fa4GS_-F.js +1 -0
  12. package/dist/client/assets/chunk-2E4U76K2-BPnTT-J3.js +2 -0
  13. package/dist/client/assets/{chunk-TEH6E4GO-DVayPj-q.js → chunk-4HAMMTFA-DStbIfJ1.js} +20 -20
  14. package/dist/client/assets/{chunk-75Z2AOVW-CdFSaPjz.js → chunk-75Z2AOVW-C5pGd3W9.js} +1 -1
  15. package/dist/client/assets/{chunk-CLGD4ZFX-DQLgbQrv.js → chunk-CLGD4ZFX-BMeArk03.js} +1 -1
  16. package/dist/client/assets/chunk-DU6HZSFF-Zkp69c6c.js +127 -0
  17. package/dist/client/assets/{chunk-F27PBJKO-CNHIFhjo.js → chunk-F27PBJKO-D4xNct1r.js} +1 -1
  18. package/dist/client/assets/{chunk-GMAD6QVW-CbcBqPM5.js → chunk-GMAD6QVW-NZ6WpDb8.js} +1 -1
  19. package/dist/client/assets/{chunk-OBVCFTLP-BJR7u1jh.js → chunk-GVQU2GXP-D8SDprfX.js} +1 -1
  20. package/dist/client/assets/{chunk-G27WJ6UU-D9-eg537.js → chunk-IMKFNOWR-D8jEuU3Q.js} +2 -2
  21. package/dist/client/assets/{chunk-JQ64N6SF-DSFNH4bh.js → chunk-L3NEJ4N5-aijKP-eh.js} +1 -1
  22. package/dist/client/assets/chunk-OSK3NFVY-CCbLQAMa.js +10 -0
  23. package/dist/client/assets/{chunk-P2QGCYS3-BRpqY32H.js → chunk-P2QGCYS3-Oag_FdCq.js} +1 -1
  24. package/dist/client/assets/{chunk-POPQ4Y6H-Cb4SlVZF.js → chunk-POPQ4Y6H-CYnpIgXT.js} +1 -1
  25. package/dist/client/assets/{chunk-PWAF6VOD-Cz8IwBB5.js → chunk-PWAF6VOD-JSNrcBmP.js} +1 -1
  26. package/dist/client/assets/{chunk-RM4UPSZO-CWRwxNWJ.js → chunk-RM4UPSZO-DOWllDY8.js} +4 -4
  27. package/dist/client/assets/{chunk-RHFEMEQ7-CWY8cf4H.js → chunk-SHT3W25Y-BiQGljao.js} +5 -5
  28. package/dist/client/assets/{chunk-SVP7TREG-CyHOmcac.js → chunk-SVP7TREG-DB485R5x.js} +1 -1
  29. package/dist/client/assets/{chunk-LCL6LL3I-DmDkVukh.js → chunk-TICWLB2K-8rAVvoS3.js} +4 -4
  30. package/dist/client/assets/{chunk-CKBBP62Z-DG26UiBv.js → chunk-TLUHSLCS-DTY5v0aj.js} +2 -2
  31. package/dist/client/assets/classDiagram-ZZMXUADV-BsQWoR3Q.js +1 -0
  32. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BsQWoR3Q.js +1 -0
  33. package/dist/client/assets/{comment-thread-store-CdcwrObc.js → comment-thread-store-CX98zR6q.js} +1 -1
  34. package/dist/client/assets/comment-threads-BnRwo5B9.js +4 -0
  35. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CdTPi2yO.js → cynefinDiagram-5FMLGOSQ-rTz9RhFH.js} +1 -1
  36. package/dist/client/assets/{dagre-3AP2YEHR-5gtJtd0O.js → dagre-GXQ25YYZ-Cr67wLpQ.js} +2 -2
  37. package/dist/client/assets/{diagram-S7CK7UJ4-BudWz9WU.js → diagram-S7CK7UJ4-DywERe__.js} +2 -2
  38. package/dist/client/assets/{diagram-UQ7AKVKN-3v4rbH-s.js → diagram-UQ7AKVKN-CNYlXtu4.js} +1 -1
  39. package/dist/client/assets/diagram-VSXAHHWV-0H1a61Bn.js +3 -0
  40. package/dist/client/assets/{diagram-VX7I27RA-C_-rj0sw.js → diagram-VX7I27RA-CsJbsx5F.js} +1 -1
  41. package/dist/client/assets/{diagram-Z3DM3KII-B4yxavgj.js → diagram-Z3DM3KII-D0mLxEgI.js} +1 -1
  42. package/dist/client/assets/dist--hk9I5HQ.js +1 -0
  43. package/dist/client/assets/{dist-DutPuFmC.js → dist-B1XEa-Zs.js} +1 -1
  44. package/dist/client/assets/dist-Bd1JucQF.js +1 -0
  45. package/dist/client/assets/{dist-DZAAWTG-.js → dist-C0G3AaXG.js} +1 -1
  46. package/dist/client/assets/dist-ChRoo3IB.js +9 -0
  47. package/dist/client/assets/dist-Dm4w5UId.js +1 -0
  48. package/dist/client/assets/{dist-B_yQaEv_.js → dist-DpYDHR9p.js} +1 -1
  49. package/dist/client/assets/{dist-CietwTVS.js → dist-DzNmC81X.js} +1 -1
  50. package/dist/client/assets/{dist-DDUn5zTz.js → dist-GvvCNBe4.js} +1 -1
  51. package/dist/client/assets/dist-JaU3aRlD.js +19 -0
  52. package/dist/client/assets/{dist-Bw3VIE_v.js → dist-TW8iFRyW.js} +1 -1
  53. package/dist/client/assets/{dist-Dir5dDKZ.js → dist-jVU5Be5P.js} +1 -1
  54. package/dist/client/assets/document-formatter-rDDjRfZ2.js +2 -0
  55. package/dist/client/assets/drawioEditor-JubEEha7.js +9 -0
  56. package/dist/client/assets/ebnfDiagram-PWID7BFC-HeTxHpCU.js +1 -0
  57. package/dist/client/assets/editor-session-Bk6oIvSr.js +54 -0
  58. package/dist/client/assets/embedded-editor-base-BlCgz6mw.css +1 -0
  59. package/dist/client/assets/{erDiagram-SSCWMZ5O-C-iy6VkX.js → erDiagram-RLTQ6QDP-CbrDdd5P.js} +2 -2
  60. package/dist/client/assets/{es-CAsWR6hG.js → es-Bfdp096f.js} +13 -13
  61. package/dist/client/assets/estree-CuT_pB8K.js +44 -0
  62. package/dist/client/assets/excalidraw-element-link-YLIaTnVF.js +7 -0
  63. package/dist/client/assets/{excalidraw-scene-BOben2gr.js → excalidraw-scene-6uROebca.js} +1 -1
  64. package/dist/client/assets/{excalidraw-editor-BlcN6umJ.css → excalidrawEditor-BbSbI80a.css} +1 -1
  65. package/dist/client/assets/excalidrawEditor-dBMbRX_S.js +9 -0
  66. package/dist/client/assets/export-page-CRRQ2NEl.js +57 -0
  67. package/dist/client/assets/exportDocument-BlQRd9_m.js +2 -0
  68. package/dist/client/assets/exportDocument-CNSbjZwu.css +1 -0
  69. package/dist/client/assets/{file-icon-svg-CQAjlWjK.js → file-icon-svg-Y_kpF957.js} +1 -1
  70. package/dist/client/assets/file-kind-BwMIcZbi.js +1 -0
  71. package/dist/client/assets/file-search-DDLyyLDU.js +1 -0
  72. package/dist/client/assets/flowDiagram-HODETNUW-D5Gy0wmg.js +1 -0
  73. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DtKHAbez.js → ganttDiagram-EL5Y4UJY-BHgOYiZz.js} +1 -1
  74. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-oue8fQ5o.js → gitGraphDiagram-WWUBYQGX-Dl__X3Sk.js} +1 -1
  75. package/dist/client/assets/html-Cdnr2qzU.js +25 -0
  76. package/dist/client/assets/image-ZVKINSPA-DgzW5zAy.js +1 -0
  77. package/dist/client/assets/index-D3RER1SZ.js +1023 -0
  78. package/dist/client/assets/index-DREVKl_K.css +1 -0
  79. package/dist/client/assets/{infoDiagram-RXCK75RN-BMzo6KIn.js → infoDiagram-27XIBGKW-DBpoANC9.js} +1 -1
  80. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BIM3h287.js → ishikawaDiagram-5VMMS53U-BMPC6hfp.js} +1 -1
  81. package/dist/client/assets/{journeyDiagram-EYS64GPL-mF6Lh8O-.js → journeyDiagram-3NMN7TZE-B1sApUmM.js} +2 -2
  82. package/dist/client/assets/{kanban-definition-3QL26DDD-DLN2NyoR.js → kanban-definition-UXKFOSKX-C9yP4td1.js} +4 -4
  83. package/dist/client/assets/{line-BfTWJmgf.js → line-BFl3ujec.js} +1 -1
  84. package/dist/client/assets/markdown-CByV-4CU.js +70 -0
  85. package/dist/client/assets/{mermaid.core-CLZBlpIW.js → mermaid.core-BrY09czX.js} +5 -5
  86. package/dist/client/assets/mermaid.core-DfcNfOTv.js +1 -0
  87. package/dist/client/assets/{mindmap-definition-FBJOCRG2-CRyHaHTk.js → mindmap-definition-YA3MSWOX-BUQHcYbK.js} +8 -8
  88. package/dist/client/assets/pegDiagram-XKGWAZYB-Bi2Iml7Z.js +1 -0
  89. package/dist/client/assets/{pieDiagram-E7YTZNPT-B5OZPb88.js → pieDiagram-E7YTZNPT-_gYXnMoi.js} +1 -1
  90. package/dist/client/assets/preview-render-compiler-CfxJYldJ.js +41 -0
  91. package/dist/client/assets/preview-render-compiler-Cu8_i9iS.js +1 -0
  92. package/dist/client/assets/{preview-render-worker-BmN79bVc.js → preview-render-worker-c4Yi93qW.js} +41 -35
  93. package/dist/client/assets/prod-BiJL30sl.js +1 -0
  94. package/dist/client/assets/prod-qAk7rHa4.js +177 -0
  95. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Drrw14YH.js → quadrantDiagram-AXDQQJYC-DwexhEhd.js} +1 -1
  96. package/dist/client/assets/quick-switcher-controller-BoIK_wuG.js +1 -0
  97. package/dist/client/assets/railroadDiagram-O6MQD6OU-BVA5UbMu.js +1 -0
  98. package/dist/client/assets/{requirementDiagram-EFPCY7ZU-CRZG6mRB.js → requirementDiagram-BXWQKSXE-C4cKwiIw.js} +2 -2
  99. package/dist/client/assets/runtime-config-DcmnGcXU.js +1 -0
  100. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DvarEJpo.js → sankeyDiagram-P5KCCOFB-B5HHkRT2.js} +1 -1
  101. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-B4oWlb-w.js → sequenceDiagram-WJ2MYXX4-BX6jqJFD.js} +6 -6
  102. package/dist/client/assets/standalone-6z5x8CWe.js +29 -0
  103. package/dist/client/assets/{stateDiagram-HBIQ2CUA-qbHIIqRZ.js → stateDiagram-D77RDMKH-CmqxyRGx.js} +1 -1
  104. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-zoLLQVyh.js +1 -0
  105. package/dist/client/assets/{swimlanes-XN3QIQJK-xB6CtUGj.js → swimlanes-42K2YHIH-Bmgb9Zld.js} +1 -1
  106. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DS-KQN37.js +8 -0
  107. package/dist/client/assets/{timeline-definition-24CTP7MA-Lj_yTNlY.js → timeline-definition-24CTP7MA-BA-lVH6P.js} +1 -1
  108. package/dist/client/assets/vault-api-client-iZLhMJKe.js +6 -0
  109. package/dist/client/assets/{vennDiagram-4TSXK5OY-BekRp5Y0.js → vennDiagram-4TSXK5OY-DNdUC_Xj.js} +1 -1
  110. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-kdnV_Hdm.js → wardleyDiagram-VM6X3IG4-C2oY-YbF.js} +1 -1
  111. package/dist/client/assets/wiki-link-resolver-DFIwErjc.js +1 -0
  112. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-DufGwNSB.js → xychartDiagram-S5SC5T6Z-CoIR8CBX.js} +1 -1
  113. package/dist/client/assets/yaml-9ltHPDNO.js +154 -0
  114. package/dist/client/assets/{yjs-provider-reset-guard-DE0vINDP.js → yjs-provider-reset-guard-9ul1qF6k.js} +1 -1
  115. package/dist/client/drawio-editor.html +11 -3
  116. package/dist/client/excalidraw-editor.html +45 -2
  117. package/dist/client/export-document.html +3 -3
  118. package/dist/client/index.html +106 -52
  119. package/integrations/pi/index.ts +94 -0
  120. package/package.json +41 -29
  121. package/src/client/app/drawio-editor.html +2 -2
  122. package/src/client/app/excalidraw-editor.html +2 -2
  123. package/src/client/app/export-document.html +1 -1
  124. package/src/client/app/index.html +88 -50
  125. package/src/client/app/main-entry.js +15 -1
  126. package/src/client/application/app-shell/chat-feature.js +7 -22
  127. package/src/client/application/app-shell/export-feature.js +17 -1
  128. package/src/client/application/app-shell/git-feature.js +51 -14
  129. package/src/client/application/app-shell/presence-feature.js +8 -25
  130. package/src/client/application/app-shell/ui-feature-identity.js +13 -0
  131. package/src/client/application/app-shell/ui-feature-shell.js +199 -99
  132. package/src/client/application/app-shell/ui-feature-sidebar.js +43 -7
  133. package/src/client/application/app-shell/ui-feature-tab-activity.js +19 -6
  134. package/src/client/application/app-shell/ui-feature-toolbar.js +16 -129
  135. package/src/client/application/app-shell-elements.js +8 -0
  136. package/src/client/application/preview-render-compiler.js +1 -87
  137. package/src/client/application/preview-render-scheduler.js +8 -24
  138. package/src/client/application/preview-renderer.js +2 -2
  139. package/src/client/application/webmcp-diagram-renderer.js +47 -0
  140. package/src/client/application/workspace-coordinator.js +23 -4
  141. package/src/client/application/workspace-preview-controller.js +120 -2
  142. package/src/client/application/workspace-route-controller.js +11 -1
  143. package/src/client/assets/vendor/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
  144. package/src/client/assets/vendor/jetbrains-mono/OFL.txt +93 -0
  145. package/src/client/bootstrap/collabmd-app-shell.js +99 -6
  146. package/src/client/domain/document-formatter.js +193 -0
  147. package/src/client/domain/excalidraw-element-link.js +73 -0
  148. package/src/client/domain/excalidraw-scene.js +21 -0
  149. package/src/client/domain/file-search.js +73 -0
  150. package/src/client/domain/git-labels.js +5 -0
  151. package/src/client/domain/hash-routes.js +8 -0
  152. package/src/client/domain/room.js +1 -5
  153. package/src/client/domain/runtime-paths.js +5 -0
  154. package/src/client/domain/vault-paths.js +6 -4
  155. package/src/client/domain/wiki-link-completions.js +20 -20
  156. package/src/client/drawio-editor.js +8 -3
  157. package/src/client/excalidraw-editor.js +287 -16
  158. package/src/client/export/export-host.js +59 -36
  159. package/src/client/export/export-page.js +14 -4
  160. package/src/client/export/export-pipeline.js +270 -42
  161. package/src/client/infrastructure/agent-connection-api-client.js +23 -0
  162. package/src/client/infrastructure/auth-client.js +3 -13
  163. package/src/client/infrastructure/editor-session.js +15 -0
  164. package/src/client/infrastructure/editor-view-adapter.js +73 -14
  165. package/src/client/infrastructure/excalidraw-room-client.js +80 -1
  166. package/src/client/infrastructure/git-api-client.js +39 -33
  167. package/src/client/infrastructure/lobby-presence.js +2 -5
  168. package/src/client/infrastructure/runtime-config.js +11 -1
  169. package/src/client/infrastructure/tab-activity-lock.js +2 -5
  170. package/src/client/infrastructure/vault-api-client.js +33 -26
  171. package/src/client/infrastructure/webmcp-tool-registry.js +283 -0
  172. package/src/client/infrastructure/workspace-sync-client.js +6 -4
  173. package/src/client/presentation/agent-connection-controller.js +255 -0
  174. package/src/client/presentation/backlinks-panel.js +3 -0
  175. package/src/client/presentation/bases-preview-controller.js +59 -26
  176. package/src/client/presentation/comment-ui/comment-ui-card.js +4 -2
  177. package/src/client/presentation/create-menu-presenter.js +19 -16
  178. package/src/client/presentation/excalidraw-embed-controller.js +164 -4
  179. package/src/client/presentation/file-action-controller.js +15 -2
  180. package/src/client/presentation/file-explorer-controller.js +3 -0
  181. package/src/client/presentation/file-explorer-view.js +71 -12
  182. package/src/client/presentation/file-history-view-controller.js +19 -12
  183. package/src/client/presentation/file-tree-state.js +1 -11
  184. package/src/client/presentation/git-diff-view-controller.js +70 -53
  185. package/src/client/presentation/git-panel-controller.js +86 -32
  186. package/src/client/presentation/image-lightbox-controller.js +20 -16
  187. package/src/client/presentation/layout-controller.js +3 -1
  188. package/src/client/presentation/quick-switcher-controller.js +74 -232
  189. package/src/client/presentation/quick-switcher-text-search.js +10 -14
  190. package/src/client/styles/components/navigation.css +1 -2
  191. package/src/client/styles/components/scrollbars.css +10 -0
  192. package/src/client/styles/export-document.css +44 -29
  193. package/src/client/styles/features/agent-connection.css +202 -0
  194. package/src/client/styles/features/collaboration-chat.css +8 -1
  195. package/src/client/styles/features/collaboration-dialogs.css +16 -1
  196. package/src/client/styles/features/collaboration-presence.css +30 -5
  197. package/src/client/styles/features/diff-toolbar.css +1 -1
  198. package/src/client/styles/features/media-lightbox.css +12 -3
  199. package/src/client/styles/features/preview-markdown.css +54 -0
  200. package/src/client/styles/features/quick-switcher.css +20 -11
  201. package/src/client/styles/foundation/themes.css +2 -0
  202. package/src/client/styles/foundation/tokens.css +8 -0
  203. package/src/client/styles/layout/editor-page.css +25 -11
  204. package/src/client/styles/layout/responsive.css +2 -20
  205. package/src/client/styles/layout/shell.css +77 -24
  206. package/src/client/styles/layout/sidebar.css +7 -4
  207. package/src/client/styles/layout/view-modes.css +2 -0
  208. package/src/client/styles/overrides/codemirror.css +31 -19
  209. package/src/client/styles/primitives/controls.css +21 -54
  210. package/src/client/styles/style.css +1 -0
  211. package/src/client/styles/surfaces/excalidraw-editor.css +42 -0
  212. package/src/domain/agent-tool-definitions.js +796 -0
  213. package/src/domain/collabmd-content-capabilities.js +149 -0
  214. package/src/domain/collaboration-protocol.js +2 -0
  215. package/src/domain/comment-threads.js +3 -5
  216. package/src/domain/diagram-source.js +50 -0
  217. package/src/domain/editable-content-revision.js +10 -0
  218. package/src/domain/editable-text.js +3 -0
  219. package/src/domain/exact-text-edits.js +69 -0
  220. package/src/domain/excalidraw-agent-scene.js +522 -0
  221. package/src/domain/excalidraw-agent-verification.js +460 -0
  222. package/src/domain/excalidraw-room-codec.js +1 -5
  223. package/src/domain/file-kind.js +12 -1
  224. package/src/domain/video-embed.js +76 -0
  225. package/src/server/application/agent-connection-service.js +178 -0
  226. package/src/server/application/agent-content-service.js +773 -0
  227. package/src/server/application/workspace-reconciliation.js +5 -7
  228. package/src/server/config/env.js +51 -1
  229. package/src/server/create-app-server.js +36 -0
  230. package/src/server/domain/bases/base-query-service.js +1 -5
  231. package/src/server/domain/collaboration/collaboration-room.js +121 -25
  232. package/src/server/domain/collaboration/protocol.js +4 -0
  233. package/src/server/domain/hosted-workspace.js +21 -0
  234. package/src/server/domain/markdown-reference-extractor.js +15 -1
  235. package/src/server/domain/ripgrep-search-service.js +110 -37
  236. package/src/server/infrastructure/git/git-service.js +19 -1
  237. package/src/server/infrastructure/git/history-service.js +1 -1
  238. package/src/server/infrastructure/git/local-exclude.js +25 -0
  239. package/src/server/infrastructure/git/parsers.js +19 -17
  240. package/src/server/infrastructure/git/path-utils.js +0 -16
  241. package/src/server/infrastructure/git/status-service.js +1 -1
  242. package/src/server/infrastructure/git/untracked-files.js +12 -21
  243. package/src/server/infrastructure/http/create-agent-api-handler.js +171 -0
  244. package/src/server/infrastructure/http/create-git-api-command-handler.js +32 -0
  245. package/src/server/infrastructure/http/create-request-handler.js +28 -0
  246. package/src/server/infrastructure/http/create-static-handler.js +6 -0
  247. package/src/server/infrastructure/mcp/create-agent-mcp-handler.js +199 -0
  248. package/src/server/infrastructure/persistence/agent-connection-store.js +120 -0
  249. package/src/server/infrastructure/persistence/path-utils.js +10 -4
  250. package/src/server/infrastructure/persistence/pull-backup-store.js +2 -27
  251. package/src/server/infrastructure/persistence/vault-file-store.js +11 -2
  252. package/src/server/shared/agent-tool-image.js +22 -0
  253. package/src/server/shared/agent-tool-rate-limiter.js +20 -0
  254. package/src/server/startup/git-remote-bootstrap.js +5 -33
  255. package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BPH4FJkv.js +0 -1
  256. package/dist/client/assets/abnfDiagram-VCTEODGH-BNDLzJ7L.js +0 -1
  257. package/dist/client/assets/browser-utils--H_DkyEF.js +0 -1
  258. package/dist/client/assets/channel-CaoKA_We.js +0 -1
  259. package/dist/client/assets/chunk-DSNCTWBM-8xkug7fQ.js +0 -2
  260. package/dist/client/assets/chunk-DU6HZSFF-COXDzJK1.js +0 -127
  261. package/dist/client/assets/chunk-R7TYR2AO-CTd0Yj98.js +0 -10
  262. package/dist/client/assets/classDiagram-DTDB5LWJ-7fEmn0zV.js +0 -1
  263. package/dist/client/assets/classDiagram-v2-JRS7N3AN-7fEmn0zV.js +0 -1
  264. package/dist/client/assets/comment-threads-9J6Em-_y.js +0 -4
  265. package/dist/client/assets/comment-ui-shared-DWkk9Vh3.js +0 -7
  266. package/dist/client/assets/diagram-VSXAHHWV-CQRVEZR7.js +0 -3
  267. package/dist/client/assets/dist-73RPdcyU.js +0 -1
  268. package/dist/client/assets/dist-CH-sQu3r.js +0 -1
  269. package/dist/client/assets/drawio-editor-BjrxTe3l.js +0 -9
  270. package/dist/client/assets/drawioEditor-DUVZjSSr.js +0 -2
  271. package/dist/client/assets/ebnfDiagram-PWID7BFC-OXa8VEp1.js +0 -1
  272. package/dist/client/assets/editor-session-DfZuRgB_.js +0 -54
  273. package/dist/client/assets/embedded-editor-base-DvMynhKu.css +0 -1
  274. package/dist/client/assets/excalidraw-editor-D7pnUCLH.js +0 -9
  275. package/dist/client/assets/excalidraw-mermaid-stub-BNckbX2n.js +0 -1
  276. package/dist/client/assets/excalidraw-mermaid-stub-DE5FTiZB.js +0 -1
  277. package/dist/client/assets/excalidrawEditor-B0jOK3lv.js +0 -2
  278. package/dist/client/assets/export-page-Bs3xE1fg.js +0 -57
  279. package/dist/client/assets/exportDocument-Dg9MjkIk.js +0 -2
  280. package/dist/client/assets/exportDocument-PnYU3v1s.css +0 -1
  281. package/dist/client/assets/file-kind-BbqgGzpc.js +0 -1
  282. package/dist/client/assets/flowDiagram-A5DVABFB-CiW1eN8C.js +0 -1
  283. package/dist/client/assets/image-ZVKINSPA-0zXSnE7M.js +0 -1
  284. package/dist/client/assets/index-BIpgxyGZ.css +0 -1
  285. package/dist/client/assets/index-Z5sI0Bj-.js +0 -2
  286. package/dist/client/assets/main-Dwnj9Gaq.js +0 -903
  287. package/dist/client/assets/pegDiagram-XKGWAZYB-B31fKPR2.js +0 -1
  288. package/dist/client/assets/preview-render-compiler-BApvlLLo.js +0 -35
  289. package/dist/client/assets/preview-render-compiler-BQ_3h9vD.js +0 -1
  290. package/dist/client/assets/preview-render-profile-CE-5rVTC.js +0 -1
  291. package/dist/client/assets/prod-BiYPMR1i.js +0 -177
  292. package/dist/client/assets/prod-VxdGZ5Ly.js +0 -1
  293. package/dist/client/assets/quick-switcher-controller-ButWPmCI.js +0 -12
  294. package/dist/client/assets/railroadDiagram-O6MQD6OU-BPifP0MB.js +0 -1
  295. package/dist/client/assets/runtime-config-BLrEKVO1.js +0 -1
  296. package/dist/client/assets/stateDiagram-v2-4QOOHH4V-B--gjrit.js +0 -1
  297. package/dist/client/assets/swimlanesDiagram-VK2B7HYN-DO8XNXEg.js +0 -8
  298. package/dist/client/assets/vault-api-client-_LpV1aIn.js +0 -6
  299. package/dist/client/assets/vault-utils-wdQ0RNR9.js +0 -1
  300. package/src/client/app/drawio-editor-entry.js +0 -1
  301. package/src/client/app/excalidraw-editor-entry.js +0 -1
  302. package/src/client/excalidraw-mermaid-stub.js +0 -7
  303. package/src/client/main.js +0 -16
  304. /package/dist/client/assets/{drawio-editor-UQQ8XHou.css → drawioEditor-UQQ8XHou.css} +0 -0
  305. /package/dist/client/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
@@ -0,0 +1,16 @@
1
+ var e=Object.defineProperty,t=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},n={};t(n,{parsers:()=>Wi});var r={};t(r,{__babel_estree:()=>Ni,__js_expression:()=>Ai,__ts_expression:()=>ji,__vue_event_binding:()=>Oi,__vue_expression:()=>Ai,__vue_ts_event_binding:()=>ki,__vue_ts_expression:()=>ji,babel:()=>Oi,"babel-flow":()=>Mi,"babel-ts":()=>ki});var i=(e,t)=>(n,r,...i)=>n|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,i),a=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},o=i(`replaceAll`,function(){if(typeof this==`string`)return a}),s=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),c=class{constructor(e,t,n){this.line=void 0,this.column=void 0,n!==void 0&&(this.index=void 0),this.line=e,this.column=t,n!==void 0&&(this.index=n)}},l=class{start;end;filename;identifierName;constructor(e,t){this.start=e,this.end=t}};function u(e,t){let{line:n,column:r,index:i}=e;return new c(n,r+t,i+t)}var d=`BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED`,f={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:d},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:d}},p={ArrayPattern:`array destructuring pattern`,AssignmentExpression:`assignment expression`,AssignmentPattern:`assignment expression`,ArrowFunctionExpression:`arrow function expression`,ConditionalExpression:`conditional expression`,CatchClause:`catch clause`,ForOfStatement:`for-of statement`,ForInStatement:`for-in statement`,ForStatement:`for-loop`,FormalParameters:`function parameter list`,Identifier:`identifier`,ImportSpecifier:`import specifier`,ImportDefaultSpecifier:`import default specifier`,ImportNamespaceSpecifier:`import namespace specifier`,ObjectPattern:`object destructuring pattern`,ParenthesizedExpression:`parenthesized expression`,RestElement:`rest element`,UpdateExpression:{true:`prefix operation`,false:`postfix operation`},VariableDeclarator:`variable declaration`,YieldExpression:`yield expression`},m=e=>e.type===`UpdateExpression`?p.UpdateExpression[`${e.prefix}`]:p[e.type],ee={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:`'arguments' is only allowed in functions and class methods.`,AsyncFunctionInSingleStatementContext:`Async functions can only be declared at the top level or inside a block.`,AwaitBindingIdentifier:`Can not use 'await' as identifier inside an async function.`,AwaitBindingIdentifierInStaticBlock:`Can not use 'await' as identifier inside a static block.`,AwaitExpressionFormalParameter:`'await' is not allowed in async function parameters.`,AwaitUsingNotInAsyncContext:`'await using' is only allowed within async functions and at the top levels of modules.`,AwaitNotInAsyncContext:`'await' is only allowed within async functions and at the top levels of modules.`,BadGetterArity:`A 'get' accessor must not have any formal parameters.`,BadSetterArity:`A 'set' accessor must have exactly one formal parameter.`,BadSetterRestParameter:`A 'set' accessor function argument must not be a rest parameter.`,ConstructorClassField:`Classes may not have a field named 'constructor'.`,ConstructorClassPrivateField:`Classes may not have a private field named '#constructor'.`,ConstructorIsAccessor:`Class constructor may not be an accessor.`,ConstructorIsAsync:`Constructor can't be an async function.`,ConstructorIsGenerator:`Constructor can't be a generator.`,DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:`Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.`,DecoratorsBeforeAfterExport:`Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.`,DecoratorConstructor:`Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?`,DecoratorSemicolon:`Decorators must not be followed by a semicolon.`,DecoratorStaticBlock:`Decorators can't be used with a static block.`,DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:`Deleting a private field is not allowed.`,DestructureNamedImport:`ES2015 named imports do not destructure. Use another statement for destructuring after the import.`,DuplicateConstructor:`Duplicate constructor in the same class.`,DuplicateDefaultExport:`Only one default export allowed per module.`,DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:`Redefinition of __proto__ property.`,DuplicateRegExpFlags:`Duplicate regular expression flag.`,ElementAfterRest:`Rest element must be last element.`,EscapedCharNotAnIdentifier:`Invalid Unicode escape.`,ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
2
+ - Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:`'from' is not allowed as an identifier after 'export default'.`,ForInOfLoopInitializer:({type:e})=>`'${e===`ForInStatement`?`for-in`:`for-of`}' loop variable declaration may not have an initializer.`,ForInUsing:`For-in loop may not start with 'using' declaration.`,ForOfAsync:`The left-hand side of a for-of loop may not be 'async'.`,ForOfLet:`The left-hand side of a for-of loop may not start with 'let'.`,GeneratorInSingleStatementContext:`Generators can only be declared at the top level or inside a block.`,IllegalBreakContinue:({type:e})=>`Unsyntactic ${e===`BreakStatement`?`break`:`continue`}.`,IllegalLanguageModeDirective:`Illegal 'use strict' directive in function with non-simple parameter list.`,IllegalReturn:`'return' outside of function.`,ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.
3
+ - Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:({phase:e})=>`\`import${e?`.${e}`:``}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:e})=>`Cannot use new with import${e?`.${e}`:``}().`,ImportCallSpreadArgument:({phase:e})=>`\`...\` is not allowed in \`import${e?`.${e}`:``}()\`.`,IncompatibleRegExpUVFlags:`The 'u' and 'v' regular expression flags cannot be enabled at the same time.`,InvalidBigIntLiteral:`Invalid BigIntLiteral.`,InvalidCodePoint:`Code point out of bounds.`,InvalidCoverDiscardElement:`'void' must be followed by an expression when not used in a binding position.`,InvalidCoverInitializedName:`Invalid shorthand property initializer.`,InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:`Bad character escape sequence.`,InvalidEscapeSequenceTemplate:`Invalid escape sequence in template.`,InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${m(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${m(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${m(e)}.`,InvalidNumber:`Invalid number.`,InvalidOrMissingExponent:`Floating-point numbers require a valid exponent after the 'e'.`,InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:`Invalid parenthesized assignment pattern.`,InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:`Binding member expression.`,InvalidRestAssignmentPattern:`Invalid rest operator's argument.`,LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:`'let' is disallowed as a lexically bound name.`,LineTerminatorBeforeArrow:`No line break is allowed before '=>'.`,MalformedRegExpFlags:`Invalid regular expression flag.`,MissingClassName:`A class name is required.`,MissingEqInAssignment:`Only '=' operator can be used for specifying default value.`,MissingSemicolon:`Missing semicolon.`,MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingUnicodeEscape:`Expecting Unicode escape sequence \\uXXXX.`,MixingCoalesceWithLogical:`Nullish coalescing operator(??) requires parens when mixing with logical operators.`,ModuleAttributeInvalidValue:`Only string literals are allowed as module attribute values.`,ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:`Multiple default clauses.`,NewlineAfterThrow:`Illegal newline after throw.`,NoCatchOrFinally:`Missing catch or finally clause.`,NumberIdentifier:`Identifier directly after number.`,NumericSeparatorInEscapeSequence:`Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.`,ObsoleteAwaitStar:`'await*' has been removed from the async functions proposal. Use Promise.all() instead.`,OptionalChainingNoNew:`Constructors in/after an Optional Chain are not allowed.`,OptionalChainingNoTemplate:`Tagged Template Literals are not allowed in optionalChain.`,OverrideOnConstructor:`'override' modifier cannot appear on a constructor declaration.`,ParamDupe:`Argument name clash.`,PatternHasAccessor:`Object pattern can't contain getter or setter.`,PatternHasMethod:`Object pattern can't contain methods.`,PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RestTrailingComma:`Unexpected trailing comma after rest element.`,SloppyFunction:`In non-strict mode code, functions can only be declared at top level or inside a block.`,SloppyFunctionAnnexB:`In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.`,SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:`Classes may not have static property named prototype.`,SuperCallNotNewExpression:`Cannot use new with super(...).`,SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:`Private fields can't be accessed on super.`,TrailingDecorator:`Decorators must be attached to a class element.`,UnexpectedArgumentPlaceholder:`Unexpected argument placeholder.`,UnexpectedDigitAfterHash:`Unexpected digit after hash token.`,UnexpectedImportExport:`'import' and 'export' may only appear at the top level.`,UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:`Leading decorators must be attached to a class declaration.`,UnexpectedLexicalDeclaration:`Lexical declaration cannot appear in a single-statement context.`,UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:`A numeric separator is only allowed between two digits.`,UnexpectedPrivateField:`Unexpected private name.`,UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:`'super' is only allowed in object methods and classes.`,UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:``}${e?`, expected "${e}"`:``}`,UnexpectedTokenUnaryExponentiation:`Illegal expression. Wrap left hand side or entire exponentiation in parentheses.`,UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:`Unexpected void binding.`,UnsupportedDecoratorExport:`A decorated export must export a class declaration.`,UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:`Decorators cannot be used to decorate parameters.`,UnsupportedPropertyDecorator:`Decorators cannot be used to decorate object literal properties.`,UnsupportedSuper:`'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).`,UnterminatedComment:`Unterminated comment.`,UnterminatedRegExp:`Unterminated regular expression.`,UnterminatedString:`Unterminated string constant.`,UnterminatedTemplate:`Unterminated template.`,UsingDeclarationExport:`Using declaration cannot be exported.`,UsingDeclarationHasBindingPattern:`Using declaration cannot have destructuring patterns.`,VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:`A void binding may not have an initializer.`,YieldBindingIdentifier:`Can not use 'yield' as identifier inside a generator.`,YieldInParameter:`Yield expression is not allowed in formal parameters.`,YieldNotInGeneratorFunction:`'yield' is only allowed within generator functions.`,ZeroDigitNumericSeparator:`Numeric separator can not be used after leading 0.`},te={StrictDelete:`Deleting local variable in strict mode.`,StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:`In strict mode code, functions can only be declared at top level or inside a block.`,StrictNumericEscape:`The only valid numeric escape in strict mode is '\\0'.`,StrictOctalLiteral:`Legacy octal literals are not allowed in strict mode.`,StrictWith:`'with' in strict mode.`},ne={ParseExpressionEmptyInput:`Unexpected parseExpression() input: The input is empty or contains only comments.`,ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},re=new Set([`ArrowFunctionExpression`,`AssignmentExpression`,`ConditionalExpression`,`YieldExpression`]),ie={PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:`Topic reference is unbound; it must be inside a pipe body.`,PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:`Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.`,PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${m({type:e})}; please wrap it in parentheses.`,PipelineUnparenthesized:`Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses.`},ae={UnsupportedBind:`Binding should be performed on object property.`,UnsupportedBindRHS:`The right-hand side of binding can not be super or import.`};function oe(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n})}function se({toMessage:e,code:t,reasonCode:n,syntaxPlugin:r}){let i=n===`MissingPlugin`||n===`MissingOneOfPlugins`;return function a(o,s,l){let u=SyntaxError();return u.code=t,u.reasonCode=n,u.loc=o,u.pos=s,u.syntaxPlugin=r,i&&(u.missingPlugin=l.missingPlugin),oe(u,`clone`,function(e={}){let{line:t,column:n,index:r=s}=e.loc??o;return a(new c(t,n),r,{...l,...e.details})}),oe(u,`details`,l),Object.defineProperty(u,"message",{configurable:!0,get(){let t=`${e(l)} (${o.line}:${o.column})`;return this.message=t,t},set(e){Object.defineProperty(this,"message",{value:e,writable:!0})}}),u}}function h(e,t){if(Array.isArray(e))return t=>h(t,e[0]);let n={};for(let r of Object.keys(e)){let i=e[r],{message:a,...o}=typeof i==`string`?{message:()=>i}:typeof i==`function`?{message:i}:i;n[r]=se({code:`BABEL_PARSER_SYNTAX_ERROR`,reasonCode:r,toMessage:typeof a==`string`?()=>a:a,...t?{syntaxPlugin:t}:{},...o})}return n}var g={...h(f),...h(ee),...h(te),...h(ne),...h`pipelineOperator`(ie),...h`functionBind`(ae)};function ce(){return{sourceType:`script`,sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,locations:!0,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function le(e){let t=ce();if(e==null)return t;if(e.annexB!=null&&e.annexB!==!1)throw Error("The `annexB` option can only be set to `false`.");for(let n of Object.keys(t))e[n]!=null&&(t[n]=e[n]);if(t.startLine===1)e.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:e.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if(e.startColumn==null||e.startIndex==null)throw Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType===`commonjs`){if(e.allowAwaitOutsideFunction!=null)throw Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(e.allowReturnOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(e.allowNewTargetOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}function _(e){let{start:t,end:n}=e.loc;return e.loc.start=new c(t.line,t.column),e.loc.end=new c(n.line,n.column),e}var ue=e=>class extends e{createPosition(e){return new c(e.line,e.column)}parse(){let e=super.parse();return this.optionFlags&512&&(e.tokens=e.tokens.map(_)),_(e)}parseRegExpLiteral({pattern:e,flags:t}){let n=null;try{n=new RegExp(e,t)}catch{}let r=this.estreeParseLiteral(n);return r.regex={pattern:e,flags:t},r}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}let n=this.estreeParseLiteral(t);return n.bigint=String(n.value||e),n}estreeParseLiteral(e){return this.parseLiteral(e,`Literal`)}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,t){let n=this.startNodeAtNode(e);return n.expression=e,this.finishNodeAtNode(n,`ChainExpression`,t)}directiveToStmt(e){let t=e.value;delete e.value,this.castNodeTo(t,`Literal`),t.raw=t.extra.raw,t.value=t.extra.expressionValue;let n=this.castNodeTo(e,`ExpressionStatement`);return n.expression=t,n.directive=t.extra.rawValue,delete t.extra,n}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:t,end:n,loc:r,range:i,raw:a,value:o}=e,s=Object.create(e.constructor.prototype);return s.type=`Literal`,s.start=t,s.end=n,s.loc=r,s.range=i,s.raw=a,s.value=o,s}initFunction(e,t){super.initFunction(e,t),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){return e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&!e.expression.extra?.parenthesized}parseBlockBody(e,t,n,r,i){super.parseBlockBody(e,t,n,r,i),e.body=e.directives.map(e=>this.directiveToStmt(e)).concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(e)}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return delete e.id,e.name=t,this.castNodeTo(e,`PrivateIdentifier`)}isPrivateName(e){return e.type===`PrivateIdentifier`}getPrivateNameSV(e){return e.name}parseLiteral(e,t){let n=super.parseLiteral(e,t);return n.raw=n.extra.raw,delete n.extra,n}parseFunctionBody(e,t,n=!1){super.parseFunctionBody(e,t,n),e.expression=e.body.type!==`BlockStatement`}parseMethod(e,t,n,r,i,a,o=!1){let s=this.startNode();s.kind=e.kind,s=super.parseMethod(s,t,n,r,i,a,o),delete s.kind;let{typeParameters:c}=e;return c&&(delete e.typeParameters,s.typeParameters=c,this.resetStartLocationFromNode(s,c)),e.value=this.castNodeTo(s,this.hasPlugin(`typescript`)&&!s.body?`TSEmptyBodyFunctionExpression`:`FunctionExpression`),a===`ClassPrivateMethod`&&(e.computed=!1),this.hasPlugin(`typescript`)&&e.abstract?(delete e.abstract,this.finishNode(e,`TSAbstractMethodDefinition`)):a===`ObjectMethod`?(e.kind===`method`&&(e.kind=`init`),e.shorthand=!1,this.finishNode(e,`Property`)):this.finishNode(e,`MethodDefinition`)}nameIsConstructor(e){return e.type===`Literal`?e.value===`constructor`:super.nameIsConstructor(e)}parseClassProperty(...e){let t=super.parseClassProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractPropertyDefinition`)):this.castNodeTo(t,`PropertyDefinition`),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?this.castNodeTo(t,`TSAbstractPropertyDefinition`):this.castNodeTo(t,`PropertyDefinition`),t.computed=!1,t}parseClassAccessorProperty(e){let t=super.parseClassAccessorProperty(e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractAccessorProperty`)):this.castNodeTo(t,`AccessorProperty`),t}parseObjectProperty(e,t,n,r){let i=super.parseObjectProperty(e,t,n,r);return i&&(i.kind=`init`,this.castNodeTo(i,`Property`)),i}finishObjectProperty(e){return e.kind=`init`,this.finishNode(e,`Property`)}isValidLVal(e,t,n,r){return e===`Property`?`value`:super.isValidLVal(e,t,n,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,n){e.type===`Property`&&(e.kind===`get`||e.kind===`set`)?this.raise(g.PatternHasAccessor,e.key):e.type===`Property`&&e.method?this.raise(g.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,n)}finishCallExpression(e,t){let n=super.finishCallExpression(e,t);return n.callee.type===`Import`?(this.castNodeTo(n,`ImportExpression`),n.source=n.arguments[0],n.options=n.arguments[1]??null,delete n.arguments,delete n.callee):n.type===`OptionalCallExpression`?this.castNodeTo(n,`CallExpression`):n.optional=!1,n}parseExport(e,t){let n=this.state.lastTokStartLoc,r=super.parseExport(e,t);switch(r.type){case`ExportAllDeclaration`:r.exported=null;break;case`ExportNamedDeclaration`:r.specifiers.length===1&&r.specifiers[0].type===`ExportNamespaceSpecifier`&&(this.castNodeTo(r,`ExportAllDeclaration`),r.exported=r.specifiers[0].exported,delete r.specifiers);case`ExportDefaultDeclaration`:{let{declaration:e}=r;e?.type===`ClassDeclaration`&&e.decorators?.length>0&&e.start===r.start&&this.resetStartLocation(r,n)}}return r}stopParseSubscript(e,t){let n=super.stopParseSubscript(e,t);return t.optionalChainMember?this.estreeParseChainExpression(n,e):n}parseMember(e,t,n,r,i){let a=super.parseMember(e,t,n,r,i);return a.type===`OptionalMemberExpression`?this.castNodeTo(a,`MemberExpression`):a.optional=!1,a}isOptionalMemberExpression(e){return e.type===`ChainExpression`?e.expression.type===`MemberExpression`:super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type===`ChainExpression`&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type===`Property`&&e.kind===`init`&&!e.method}isObjectMethod(e){return e.type===`Property`&&(e.method||e.kind===`get`||e.kind===`set`)}castNodeTo(e,t){let n=super.castNodeTo(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}cloneIdentifier(e){let t=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(t),t}cloneStringLiteral(e){return e.type===`Literal`?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,t,n){return _(super.finishNodeAt(e,t,n))}finishNodeAtNode(e,t,n){return _(super.finishNodeAtNode(e,t,n))}finishNode(e,t){let n=super.finishNode(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}resetStartLocation(e,t){super.resetStartLocation(e,t),_(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),_(e)}},v=!0,y=!0,de=!0,b=!0,x=!0,fe=!0,pe=class{label;keyword;beforeExpr;startsExpr;rightAssociative;isLoop;isAssign;prefix;postfix;binop;constructor(e,t={}){this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop==null?null:t.binop}},me=new Map;function S(e,t={}){t.keyword=e;let n=T(e,t);return me.set(e,n),n}function C(e,t){return T(e,{beforeExpr:v,binop:t})}var w=-1,he=[],ge=[],_e=[],ve=[],ye=[],be=[];function T(e,t={}){return++w,ge.push(e),_e.push(t.binop??-1),ve.push(t.beforeExpr??!1),ye.push(t.startsExpr??!1),be.push(t.prefix??!1),he.push(new pe(e,t)),w}function E(e,t={}){return++w,me.set(e,w),ge.push(e),_e.push(t.binop??-1),ve.push(t.beforeExpr??!1),ye.push(t.startsExpr??!1),be.push(t.prefix??!1),he.push(new pe(`name`,t)),w}var xe={bracketL:T(`[`,{beforeExpr:v,startsExpr:y}),bracketR:T(`]`),braceL:T(`{`,{beforeExpr:v,startsExpr:y}),braceBarL:T(`{|`,{beforeExpr:v,startsExpr:y}),braceR:T(`}`),braceBarR:T(`|}`),parenL:T(`(`,{beforeExpr:v,startsExpr:y}),parenR:T(`)`),comma:T(`,`,{beforeExpr:v}),semi:T(`;`,{beforeExpr:v}),colon:T(`:`,{beforeExpr:v}),doubleColon:T(`::`,{beforeExpr:v}),dot:T(`.`),question:T(`?`,{beforeExpr:v}),questionDot:T(`?.`),arrow:T(`=>`,{beforeExpr:v}),template:T(`template`),ellipsis:T(`...`,{beforeExpr:v}),backQuote:T("`",{startsExpr:y}),dollarBraceL:T("${",{beforeExpr:v,startsExpr:y}),templateTail:T("...`",{startsExpr:y}),templateNonTail:T("...${",{beforeExpr:v,startsExpr:y}),at:T(`@`),hash:T(`#`,{startsExpr:y}),interpreterDirective:T(`#!...`),eq:T(`=`,{beforeExpr:v,isAssign:b}),assign:T(`_=`,{beforeExpr:v,isAssign:b}),slashAssign:T(`_=`,{beforeExpr:v,isAssign:b}),xorAssign:T(`_=`,{beforeExpr:v,isAssign:b}),moduloAssign:T(`_=`,{beforeExpr:v,isAssign:b}),incDec:T(`++/--`,{prefix:x,postfix:fe,startsExpr:y}),bang:T(`!`,{beforeExpr:v,prefix:x,startsExpr:y}),tilde:T(`~`,{beforeExpr:v,prefix:x,startsExpr:y}),doubleCaret:T(`^^`,{startsExpr:y}),doubleAt:T(`@@`,{startsExpr:y}),pipeline:C(`|>`,0),nullishCoalescing:C(`??`,1),logicalOR:C(`||`,1),logicalAND:C(`&&`,2),bitwiseOR:C(`|`,3),bitwiseXOR:C(`^`,4),bitwiseAND:C(`&`,5),equality:C(`==/!=/===/!==`,6),lt:C(`</>/<=/>=`,7),gt:C(`</>/<=/>=`,7),relational:C(`</>/<=/>=`,7),bitShift:C(`<</>>/>>>`,8),bitShiftL:C(`<</>>/>>>`,8),bitShiftR:C(`<</>>/>>>`,8),plusMin:T(`+/-`,{beforeExpr:v,binop:9,prefix:x,startsExpr:y}),modulo:T(`%`,{binop:10,startsExpr:y}),star:T(`*`,{binop:10}),slash:C(`/`,10),exponent:T(`**`,{beforeExpr:v,binop:11,rightAssociative:!0}),_in:S(`in`,{beforeExpr:v,binop:7}),_instanceof:S(`instanceof`,{beforeExpr:v,binop:7}),_break:S(`break`),_case:S(`case`,{beforeExpr:v}),_catch:S(`catch`),_continue:S(`continue`),_debugger:S(`debugger`),_default:S(`default`,{beforeExpr:v}),_else:S(`else`,{beforeExpr:v}),_finally:S(`finally`),_function:S(`function`,{startsExpr:y}),_if:S(`if`),_return:S(`return`,{beforeExpr:v}),_switch:S(`switch`),_throw:S(`throw`,{beforeExpr:v,prefix:x,startsExpr:y}),_try:S(`try`),_var:S(`var`),_const:S(`const`),_with:S(`with`),_new:S(`new`,{beforeExpr:v,startsExpr:y}),_this:S(`this`,{startsExpr:y}),_super:S(`super`,{startsExpr:y}),_class:S(`class`,{startsExpr:y}),_extends:S(`extends`,{beforeExpr:v}),_export:S(`export`),_import:S(`import`,{startsExpr:y}),_null:S(`null`,{startsExpr:y}),_true:S(`true`,{startsExpr:y}),_false:S(`false`,{startsExpr:y}),_typeof:S(`typeof`,{beforeExpr:v,prefix:x,startsExpr:y}),_void:S(`void`,{beforeExpr:v,prefix:x,startsExpr:y}),_delete:S(`delete`,{beforeExpr:v,prefix:x,startsExpr:y}),_do:S(`do`,{isLoop:de,beforeExpr:v}),_for:S(`for`,{isLoop:de}),_while:S(`while`,{isLoop:de}),_as:E(`as`,{startsExpr:y}),_assert:E(`assert`,{startsExpr:y}),_async:E(`async`,{startsExpr:y}),_await:E(`await`,{startsExpr:y}),_defer:E(`defer`,{startsExpr:y}),_from:E(`from`,{startsExpr:y}),_get:E(`get`,{startsExpr:y}),_let:E(`let`,{startsExpr:y}),_meta:E(`meta`,{startsExpr:y}),_of:E(`of`,{startsExpr:y}),_sent:E(`sent`,{startsExpr:y}),_set:E(`set`,{startsExpr:y}),_source:E(`source`,{startsExpr:y}),_static:E(`static`,{startsExpr:y}),_using:E(`using`,{startsExpr:y}),_yield:E(`yield`,{startsExpr:y}),_asserts:E(`asserts`,{startsExpr:y}),_checks:E(`checks`,{startsExpr:y}),_exports:E(`exports`,{startsExpr:y}),_global:E(`global`,{startsExpr:y}),_implements:E(`implements`,{startsExpr:y}),_intrinsic:E(`intrinsic`,{startsExpr:y}),_infer:E(`infer`,{startsExpr:y}),_is:E(`is`,{startsExpr:y}),_mixins:E(`mixins`,{startsExpr:y}),_proto:E(`proto`,{startsExpr:y}),_require:E(`require`,{startsExpr:y}),_satisfies:E(`satisfies`,{startsExpr:y}),_keyof:E(`keyof`,{startsExpr:y}),_readonly:E(`readonly`,{startsExpr:y}),_unique:E(`unique`,{startsExpr:y}),_abstract:E(`abstract`,{startsExpr:y}),_declare:E(`declare`,{startsExpr:y}),_enum:E(`enum`,{startsExpr:y}),_module:E(`module`,{startsExpr:y}),_namespace:E(`namespace`,{startsExpr:y}),_interface:E(`interface`,{startsExpr:y}),_type:E(`type`,{startsExpr:y}),_opaque:E(`opaque`,{startsExpr:y}),name:T(`name`,{startsExpr:y}),placeholder:T(`%%`,{startsExpr:y}),string:T(`string`,{startsExpr:y}),num:T(`num`,{startsExpr:y}),bigint:T(`bigint`,{startsExpr:y}),regexp:T(`regexp`,{startsExpr:y}),privateName:T(`#name`,{startsExpr:y}),eof:T(`eof`),jsxName:T(`jsxName`),jsxText:T(`jsxText`,{beforeExpr:v}),jsxTagStart:T(`jsxTagStart`,{startsExpr:y}),jsxTagEnd:T(`jsxTagEnd`)};function D(e){return e>=89&&e<=129}function Se(e){return e<=88}function O(e){return e>=54&&e<=129}function Ce(e){return e>=54&&e<=132}function we(e){return ve[e]}function k(e){return ye[e]}function Te(e){return e>=25&&e<=29}function Ee(e){return e>=125&&e<=127}function De(e){return e>=86&&e<=88}function Oe(e){return e>=54&&e<=88}function ke(e){return e>=35&&e<=55}function Ae(e){return e===30}function je(e){return be[e]}function Me(e){return e>=117&&e<=119}function Ne(e){return e>=120&&e<=126}function A(e){return ge[e]}function Pe(e){return _e[e]}function Fe(e){return e===53}function Ie(e){return e>=20&&e<=21}function Le(e){return he[e]}var Re=class{constructor(e,t){this.token=e,this.preserveSpace=!!t}token;preserveSpace},j={brace:new Re(`{`),j_oTag:new Re(`<tag`),j_cTag:new Re(`</tag`),j_expr:new Re(`<tag>...</tag>`,!0)},ze=`\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc`,Be=`\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65`,Ve=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],He=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Ue=RegExp(`[`+ze+`]`),We=RegExp(`[`+ze+Be+`]`);function Ge(e,t){let n=65536;for(let r=0,i=t.length;r<i;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function M(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Ue.test(String.fromCharCode(e)):Ge(e,Ve)}function N(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&We.test(String.fromCharCode(e)):Ge(e,Ve)||Ge(e,He)}var Ke={keyword:`break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete`.split(`.`),strict:[`implements`,`interface`,`let`,`package`,`private`,`protected`,`public`,`static`,`yield`],strictBind:[`eval`,`arguments`]},qe=new Set(Ke.keyword),Je=new Set(Ke.strict),Ye=new Set(Ke.strictBind);function Xe(e,t){return t&&e===`await`||e===`enum`}function Ze(e,t){return Xe(e,t)||Je.has(e)}function Qe(e){return Ye.has(e)}function $e(e,t){return Ze(e,t)||Qe(e)}function et(e){return qe.has(e)}function tt(e,t,n){return e===64&&t===64&&M(n)}var nt=new Set(`break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete.implements.interface.let.package.private.protected.public.static.yield.eval.arguments.enum.await`.split(`.`));function rt(e){return nt.has(e)}var it=class{flags=0;names=new Map;firstLexicalName=``;constructor(e){this.flags=e}},at=class{parser;scopeStack=[];inModule;undefinedExports=new Map;constructor(e,t){this.parser=e,this.inModule=t}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&!(e&2)}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&128)return!0;if(t&3779)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new it(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,t,n){let r=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(r,e,t,n);let i=r.names.get(e)||0;t&16?i|=4:(r.firstLexicalName||(r.firstLexicalName=e),i|=2),r.names.set(e,i),t&8&&this.maybeExportDefined(r,e)}else if(t&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,e,t,n),r.names.set(e,(r.names.get(e)||0)|1),this.maybeExportDefined(r,e),!(r.flags&3715));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,n,r){this.isRedeclaredInScope(e,t,n)&&this.parser.raise(g.VarRedeclaration,r,{identifierName:t})}isRedeclaredInScope(e,t,n){if(!(n&1))return!1;if(n&8)return e.names.has(t);let r=e.names.get(t)||0;return n&16?(r&2)>0||!this.treatFunctionsAsVarInScope(e)&&(r&1)>0:(r&2)>0&&!(e.flags&8&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(r&4)>0}checkLocalExport(e){let{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3715)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3779&&!(t&4))return t}}},ot=class extends it{declareFunctions=new Set},st=class extends at{createScope(e){return new ot(e)}declareName(e,t,n){let r=this.currentScope();if(t&2048){this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e),r.declareFunctions.add(e);return}super.declareName(e,t,n)}isRedeclaredInScope(e,t,n){if(super.isRedeclaredInScope(e,t,n))return!0;if(n&2048&&!e.declareFunctions.has(t)){let n=e.names.get(t);return(n&4)>0||(n&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},ct=new Set([`_`,`any`,`bool`,`boolean`,`empty`,`extends`,`false`,`interface`,`mixed`,`null`,`number`,`static`,`string`,`true`,`typeof`,`void`]),P=h`flow`({AmbiguousConditionalArrow:`Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.`,AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:n})=>`Enum \`${e}\` has type \`${n}\`, so the initializer of \`${t}\` needs to be a ${n} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:n})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${n}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:`Explicit inexact syntax cannot appear inside an explicit exact object type.`,InexactInsideNonObject:`Explicit inexact syntax cannot appear in class or interface definitions.`,InexactVariance:`Explicit inexact syntax cannot have variance.`,InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:`Type parameter declaration needs a default, since a preceding type parameter declaration has a default.`,NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:`Cannot have a flow comment inside another flow comment.`,PatternIsOptional:{message:`A binding pattern parameter cannot be optional in an implementation signature.`},SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:`Spread properties cannot have variance.`,ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:`The type cast expression is expected to be wrapped with parenthesis.`,UnexpectedExplicitInexactInObject:`Explicit inexact syntax must appear at the end of an inexact object.`,UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:`Spread operator cannot appear in class or interface definitions.`,UnexpectedSubtractionOperand:`Unexpected token, expected "number" or "bigint".`,UnexpectedTokenAfterTypeParameter:`Expected an arrow function after this type parameter declaration.`,UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:`Only declares and type imports are allowed inside declare module.`,UnterminatedFlowComment:`Unterminated flow-comment.`});function lt(e){return e.type===`DeclareExportAllDeclaration`||e.type===`DeclareExportDeclaration`&&(!e.declaration||e.declaration.type!==`TypeAlias`&&e.declaration.type!==`InterfaceDeclaration`)}function ut(e){return e.importKind===`type`||e.importKind===`typeof`}var dt={const:`declare export var`,let:`declare export var`,type:`export type`,interface:`export interface`};function ft(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)(t(e[i],i,e)?n:r).push(e[i]);return[n,r]}var pt=/\*?\s*@((?:no)?flow)\b/,mt=e=>class extends e{flowPragma=void 0;getScopeHandler(){return st}shouldParseTypes(){return this.getPluginOption(`flow`,`all`)||this.flowPragma===`flow`}finishToken(e,t){e!==130&&e!==9&&e!==24&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=pt.exec(e.value);if(t){if(t[1]===`flow`)this.flowPragma=`flow`;else if(t[1]===`noflow`)this.flowPragma=`noflow`;else throw Error(`Unexpected flow pragma`)}}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||10);let n=this.flowParseType();return this.state.inType=t,n}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(106),this.state.lastTokStartLoc.index>t.index+1&&this.raise(P.UnexpectedSpaceBetweenModuloChecks,t),this.eat(6)?(e.value=super.parseExpression(),this.expect(7),this.finishNode(e,`DeclaredPredicate`)):this.finishNode(e,`InferredPredicate`)}flowParseTypeAndPredicateInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(10);let n=null,r=null;return e&&this.match(50)?(this.state.inType=t,r=this.flowParsePredicate()):(n=this.flowParseType(),this.state.inType=t,this.match(50)&&(r=this.flowParsePredicate())),[n,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,`DeclareClass`)}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),n=this.startNode(),r=this.startNode();n.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,this.expect(6);let i=this.flowParseFunctionTypeParams();return n.params=i.params,n.rest=i.rest,n.this=i._this,this.expect(7),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!1),r.typeAnnotation=this.finishNode(n,`FunctionTypeAnnotation`),t.typeAnnotation=this.finishNode(r,`TypeAnnotation`),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.start),this.finishNode(e,`DeclareFunction`)}flowParseDeclare(e,t){if(this.match(76))return this.flowParseDeclareClass(e);if(this.match(64))return this.flowParseDeclareFunction(e);if(this.match(70))return this.flowParseDeclareVariable(e);if(this.eatContextual(123))return this.match(12)?this.flowParseDeclareModuleExports(e):(t&&this.raise(P.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(126))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(127))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(125))return this.flowParseDeclareInterface(e);if(this.match(78))return this.flowParseDeclareExportDeclaration(e,t);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.start),this.semicolon(),this.finishNode(e,`DeclareVariable`)}flowParseDeclareModule(e){this.scope.enter(0),e.id=this.match(130)?super.parseExprAtom():this.parseIdentifier();let t=this.startNode(),n=t.body=[];for(this.expect(2);!this.match(4);){let e=this.startNode();this.match(79)?(this.next(),!this.isContextual(126)&&!this.match(83)&&this.raise(P.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),n.push(super.parseImport(e))):(this.expectContextual(121,P.UnsupportedStatementInDeclareModule),n.push(this.flowParseDeclare(e,!0)))}this.scope.exit(),this.expect(4),e.body=this.finishNode(t,`BlockStatement`);let r=null,i=!1;return n.forEach(e=>{lt(e)?(r===`CommonJS`&&this.raise(P.AmbiguousDeclareModuleKind,e),r=`ES`):e.type===`DeclareModuleExports`&&(i&&this.raise(P.DuplicateDeclareModuleExports,e),r===`ES`&&this.raise(P.AmbiguousDeclareModuleKind,e),r=`CommonJS`,i=!0)}),e.kind=r||`CommonJS`,this.finishNode(e,`DeclareModule`)}flowParseDeclareExportDeclaration(e,t){if(this.expect(78),this.eat(61))return this.match(64)||this.match(76)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(71)||this.isLet()||(this.isContextual(126)||this.isContextual(125))&&!t){let e=this.state.value;throw this.raise(P.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:e,suggestion:dt[e]})}if(this.match(70)||this.match(64)||this.match(76)||this.isContextual(127))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(51)||this.match(2)||this.isContextual(125)||this.isContextual(126)||this.isContextual(127)){let t=this.parseExport(e,null);return t.type===`ExportNamedDeclaration`?(t.default=!1,delete t.exportKind,this.castNodeTo(t,`DeclareExportDeclaration`)):this.castNodeTo(t,`DeclareExportAllDeclaration`)}throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(107),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,`DeclareModuleExports`)}flowParseDeclareTypeAlias(e){this.next();let t=this.flowParseTypeAlias(e);return this.castNodeTo(t,`DeclareTypeAlias`),t}flowParseDeclareOpaqueType(e){return this.next(),this.flowParseOpaqueType(e,!0)}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,`DeclareInterface`)}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(!t&&this.eat(8));if(t){let t=[],n=[];if(this.eatContextual(113))do n.push(this.flowParseInterfaceExtends());while(this.eat(8));if(this.eatContextual(109))do t.push(this.flowParseClassImplements());while(this.eat(8));e.implements=t,e.mixins=n}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),e.typeParameters=this.match(43)?this.flowParseTypeParameterInstantiation():null,this.finishNode(e,`InterfaceExtends`)}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,`InterfaceDeclaration`)}checkNotUnderscore(e){e===`_`&&this.raise(P.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,n){ct.has(e)&&this.raise(n?P.AssignReservedType:P.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifierName(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,t){let n=this.startNode(),r=this.flowParseRestrictedIdentifierName(e,t);return this.createIdentifier(n,r)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.right=this.flowParseTypeInitialiser(25),this.semicolon(),this.finishNode(e,`TypeAlias`)}flowParseOpaqueType(e,t){return this.expectContextual(126),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.supertype=null,this.match(10)&&(e.supertype=this.flowParseTypeInitialiser(10)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(25)),this.semicolon(),this.finishNode(e,t?`DeclareOpaqueType`:`OpaqueType`)}flowParseTypeParameterBound(){if(this.match(10)||this.isContextual(77)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,`TypeAnnotation`)}}flowParseTypeParameter(e=!1){let t=this.state.startLoc,n=this.startNode(),r=this.flowParseVariance();return n.name=this.flowParseRestrictedIdentifierName(),n.variance=r,n.bound=this.flowParseTypeParameterBound(),this.match(25)?(this.eat(25),n.default=this.flowParseType()):e&&this.raise(P.MissingTypeParamDefault,t),this.finishNode(n,`TypeParameter`)}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(43)||this.match(138)?this.next():this.unexpected();let n=!1;do{let e=this.flowParseTypeParameter(n);t.params.push(e),e.default&&(n=!0),this.match(44)||this.expect(8)}while(!this.match(44));return this.expect(44),this.state.inType=e,this.finishNode(t,`TypeParameterDeclaration`)}flowInTopLevelContext(e){if(this.curContext()!==j.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===43)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(43);let t=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(44);)e.params.push(this.flowParseType()),this.match(44)||this.expect(8);this.state.noAnonFunctionType=t}),this.state.inType=t,!this.state.inType&&this.curContext()===j.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TypeParameterInstantiation`)}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==43)return null;let e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(43);!this.match(44);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(44)||this.expect(8);return this.expect(44),this.state.inType=t,this.finishNode(e,`TypeParameterInstantiation`)}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(125),e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(8));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,`InterfaceTypeAnnotation`)}flowParseObjectPropertyKey(){return this.match(131)||this.match(130)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,n){return e.static=t,this.lookahead().type===10?(e.id=this.parseIdentifier(!0),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(1),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.finishNode(e,`ObjectTypeIndexer`)}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.parseIdentifier(!0),this.expect(1),this.expect(1),this.match(43)||this.match(6)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e))):(e.method=!1,this.eat(13)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,`ObjectTypeInternalSlot`)}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(6),this.match(74)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(7),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,`FunctionTypeAnnotation`)}flowParseObjectTypeCallProperty(e,t){let n=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,`ObjectTypeCallProperty`)}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:n,allowProto:r,allowInexact:i}){let a=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let s,c,l=!1;for(t&&this.match(3)?(this.expect(3),s=5,c=!0):(this.expect(2),s=4,c=!1),o.exact=c;!this.match(s);){let t=!1,a=null,s=null,u=this.startNode();if(r&&this.isContextual(114)){let t=this.lookahead();t.type!==10&&t.type!==13&&(this.next(),a=this.state.startLoc,e=!1)}if(e&&this.isContextual(102)){let e=this.lookahead();e.type!==10&&e.type!==13&&(this.next(),t=!0)}let d=this.flowParseVariance();if(this.eat(0))a!=null&&this.unexpected(a),this.eat(0)?(d&&this.unexpected(d.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(u,t))):o.indexers.push(this.flowParseObjectTypeIndexer(u,t,d));else if(this.match(6)||this.match(43))a!=null&&this.unexpected(a),d&&this.unexpected(d.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(u,t));else{let e=`init`;(this.isContextual(95)||this.isContextual(100))&&Ce(this.lookahead().type)&&(e=this.state.value,this.next());let r=this.flowParseObjectTypeProperty(u,t,a,d,e,n,i??!c);r===null?(l=!0,s=this.state.lastTokStartLoc):o.properties.push(r)}this.flowObjectTypeSemicolon(),s&&!this.match(4)&&!this.match(5)&&this.raise(P.UnexpectedExplicitInexactInObject,s)}this.expect(s),n&&(o.inexact=l);let u=this.finishNode(o,`ObjectTypeAnnotation`);return this.state.inType=a,u}flowParseObjectTypeProperty(e,t,n,r,i,a,o){if(this.eat(17))return this.match(8)||this.match(9)||this.match(4)||this.match(5)?(a?o||this.raise(P.InexactInsideExact,this.state.lastTokStartLoc):this.raise(P.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(P.InexactVariance,r),null):(a||this.raise(P.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),r&&this.raise(P.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,`ObjectTypeSpreadProperty`));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=n!=null,e.kind=i;let o=!1;return this.match(43)||this.match(6)?(e.method=!0,n!=null&&this.unexpected(n),r&&this.unexpected(r.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)),i===`get`||i===`set`?this.flowCheckGetterSetterParams(e):!t&&!a&&e.key.name===`constructor`&&e.value.this&&this.raise(P.ThisParamBannedInConstructor,e.value.this)):(i!==`init`&&this.unexpected(),e.method=!1,this.eat(13)&&(o=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=o,this.finishNode(e,`ObjectTypeProperty`)}}flowCheckGetterSetterParams(e){let t=e.kind===`get`?0:1,n=e.value,r=n.params.length+ +!!n.rest;n.this&&this.raise(e.kind===`get`?P.GetterMayNotHaveThisParam:P.SetterMayNotHaveThisParam,n.this),r!==t&&this.raise(e.kind===`get`?g.BadGetterArity:g.BadSetterArity,e),e.kind===`set`&&n.rest&&this.raise(g.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(9)&&!this.eat(8)&&!this.match(4)&&!this.match(5)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){e??=this.state.startLoc;let n=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(12);){let t=this.startNodeAt(e);t.qualification=n,t.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(t,`QualifiedTypeIdentifier`)}return n}flowParseGenericType(e,t){let n=this.startNodeAt(e);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(43)&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,`GenericTypeAnnotation`)}flowParseTypeofType(){let e=this.startNode();return this.expect(83),e.argument=this.flowParsePrimaryType(),this.finishNode(e,`TypeofTypeAnnotation`)}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(1)&&(e.types.push(this.flowParseType()),!this.match(1));)this.expect(8);return this.expect(1),this.finishNode(e,`TupleTypeAnnotation`)}flowParseFunctionTypeParam(e){let t=null,n=!1,r,i=this.startNode(),a=this.lookahead(),o=this.state.type===74;return a.type===10||a.type===13?(o&&!e&&this.raise(P.ThisParamMustBeFirst,i),t=this.parseIdentifier(o),this.eat(13)&&(n=!0,o&&this.raise(P.ThisParamMayNotBeOptional,i)),r=this.flowParseTypeInitialiser()):r=this.flowParseType(),i.name=t,i.optional=n,i.typeAnnotation=r,this.finishNode(i,`FunctionTypeParam`)}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAtNode(e);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,`FunctionTypeParam`)}flowParseFunctionTypeParams(e=[]){let t=null,n=null;for(this.match(74)&&(n=this.flowParseFunctionTypeParam(!0),n.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:n}}flowIdentToTypeAnnotation(e,t,n){switch(n.name){case`any`:return this.finishNode(t,`AnyTypeAnnotation`);case`bool`:case`boolean`:return this.finishNode(t,`BooleanTypeAnnotation`);case`mixed`:return this.finishNode(t,`MixedTypeAnnotation`);case`empty`:return this.finishNode(t,`EmptyTypeAnnotation`);case`number`:return this.finishNode(t,`NumberTypeAnnotation`);case`string`:return this.finishNode(t,`StringTypeAnnotation`);case`symbol`:return this.finishNode(t,`SymbolTypeAnnotation`);default:return this.checkNotUnderscore(n.name),this.flowParseGenericType(e,n)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),n,r,i=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case 2:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 3:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,r=this.flowParseTupleType(),this.state.noAnonFunctionType=a,r;case 43:{let e=this.startNode();return e.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(6),n=this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),this.finishNode(e,`FunctionTypeAnnotation`)}case 6:{let e=this.startNode();if(this.next(),!this.match(7)&&!this.match(17)){if(D(this.state.type)||this.match(74)){let e=this.lookahead().type;i=e!==13&&e!==10}else i=!0}if(i){if(this.state.noAnonFunctionType=!1,r=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(8)||this.match(7)&&this.lookahead().type===15))return this.expect(7),r;this.eat(8)}return n=r?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(r)]):this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),e.typeParameters=null,this.finishNode(e,`FunctionTypeAnnotation`)}case 130:return this.parseLiteral(this.state.value,`StringLiteralTypeAnnotation`);case 81:case 82:return t.value=this.match(81),this.next(),this.finishNode(t,`BooleanLiteralTypeAnnotation`);case 49:if(this.state.value===`-`){if(this.next(),this.match(131))return this.parseLiteralAtNode(-this.state.value,`NumberLiteralTypeAnnotation`,t);if(this.match(132))return this.parseLiteralAtNode(-this.state.value,`BigIntLiteralTypeAnnotation`,t);throw this.raise(P.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 131:return this.parseLiteral(this.state.value,`NumberLiteralTypeAnnotation`);case 132:return this.parseLiteral(this.state.value,`BigIntLiteralTypeAnnotation`);case 84:return this.next(),this.finishNode(t,`VoidTypeAnnotation`);case 80:return this.next(),this.finishNode(t,`NullLiteralTypeAnnotation`);case 74:return this.next(),this.finishNode(t,`ThisTypeAnnotation`);case 51:return this.next(),this.finishNode(t,`ExistsTypeAnnotation`);case 83:return this.flowParseTypeofType();default:if(Oe(this.state.type)){let e=A(this.state.type);return this.next(),super.createIdentifier(t,e)}if(D(this.state.type))return this.isContextual(125)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),n=!1;for(;(this.match(0)||this.match(14))&&!this.canInsertSemicolon();){let r=this.startNodeAt(e),i=this.eat(14);n||=i,this.expect(0),!i&&this.match(1)?(r.elementType=t,this.next(),t=this.finishNode(r,`ArrayTypeAnnotation`)):(r.objectType=t,r.indexType=this.flowParseType(),this.expect(1),n?(r.optional=i,t=this.finishNode(r,`OptionalIndexedAccessType`)):t=this.finishNode(r,`IndexedAccessType`))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(13)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,`NullableTypeAnnotation`)):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(15)){let t=this.startNodeAtNode(e);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,`FunctionTypeAnnotation`)}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(41);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(41);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,`IntersectionTypeAnnotation`)}flowParseUnionType(){let e=this.startNode();this.eat(39);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(39);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,`UnionTypeAnnotation`)}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===128&&this.state.value===`_`){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,`TypeAnnotation`)}flowParseTypeAnnotatableIdentifier(){let e=this.startNode(),t=this.parseIdentifierName();return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,t)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}flowParseVariance(){let e=null;return this.match(49)?(e=this.startNode(),this.state.value===`+`?e.kind=`plus`:e.kind=`minus`,this.next(),this.finishNode(e,`Variance`)):e}parseFunctionBody(e,t,n=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,n));return}super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,t,n=!1){if(this.match(10)){let n=this.startNode();t===`FunctionDeclaration`||t===`FunctionExpression`||t===`ArrowFunctionExpression`?[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0):n.typeAnnotation=this.flowParseTypeInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,`TypeAnnotation`):null}return super.parseFunctionBodyAndFinish(e,t,n)}parseStatementLike(e){if(this.state.strict&&this.isContextual(125)){if(O(this.lookahead().type)){let e=this.startNode();return this.next(),this.flowParseInterface(e)}}else if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t,n){if(t.type===`Identifier`){if(t.name===`declare`){if(this.match(76)||D(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(D(this.state.type)){if(t.name===`interface`)return this.flowParseInterface(e);if(t.name===`type`)return this.flowParseTypeAlias(e);if(t.name===`opaque`)return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t,n)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===122||Ee(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===122||Ee(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.expect(13);let r=this.state.clone(),i=this.state.noArrowAt,a=this.startNodeAt(t),{consequent:o,failed:s}=this.tryParseConditionalConsequent(),c=this.getArrowLikeExpressions(o),l=c[0],u=c[1];if(s||u.length>0){let e=[...i];if(u.length>0){this.state=r,this.state.noArrowAt=e;for(let t=0;t<u.length;t++)e.push(u[t].start);({consequent:o,failed:s}=this.tryParseConditionalConsequent()),[l]=this.getArrowLikeExpressions(o)}s&&l.length>1&&this.raise(P.AmbiguousConditionalArrow,r.startLoc),s&&l.length===1&&(this.state=r,e.push(l[0].start),this.state.noArrowAt=e,{consequent:o}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=i,this.expect(10),a.test=e,a.consequent=o,a.alternate=this.forwardNoArrowParamsConversionAt(a,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(a,`ConditionalExpression`)}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),t=!this.match(10);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let n=[e],r=[];for(;n.length!==0;){let e=n.pop();e.type===`ArrowFunctionExpression`&&e.body.type!==`BlockStatement`?(e.typeParameters||!e.returnType?this.finishArrowValidation(e):r.push(e),n.push(e.body)):e.type===`ConditionalExpression`&&(n.push(e.consequent),n.push(e.alternate))}return t?(r.forEach(e=>this.finishArrowValidation(e)),[r,[]]):ft(r,e=>e.params.every(e=>this.isAssignable(e,!0)))}finishArrowValidation(e){this.toAssignableList(e.params,e.extra?.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let n;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),n=t(),this.state.noArrowParamsConversionAt.pop()):n=t(),n}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let e=this.startNodeAt(t);return e.expression=n,e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,`TypeCastExpression`)}return n}assertModuleNodeAllowed(e){e.type===`ImportDeclaration`&&(e.importKind===`type`||e.importKind===`typeof`)||e.type===`ExportNamedDeclaration`&&e.exportKind===`type`||e.type===`ExportAllDeclaration`&&e.exportKind===`type`||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(126)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.match(2)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}if(this.isContextual(127)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}if(this.isContextual(125)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseInterface(t)}if(this.isContextual(122)){e.exportKind=`value`;let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(126)&&this.lookahead().type===51?(e.exportKind=`type`,this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:t}=this.state,n=super.maybeParseExportNamespaceSpecifier(e);return n&&e.exportKind===`type`&&this.unexpected(t),n}parseClassId(e,t,n){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n),this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,n){let{startLoc:r}=this.state;if(this.isContextual(121)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,n),t.declare&&(t.type!==`ClassProperty`&&t.type!==`ClassPrivateProperty`&&t.type!==`PropertyDefinition`?this.raise(P.DeclareClassElement,r):t.value&&this.raise(P.DeclareClassFieldInitializer,t.value))}isIterator(e){return e===`iterator`||e===`asyncIterator`}readIterator(){let e=super.readWord1(),t=`@@`+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(g.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(128,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(3,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?44:43,1):this.state.inType&&e===63?t===46?this.finishOp(14,2):this.finishOp(13,1):tt(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type===`TypeCastExpression`?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type===`AssignmentExpression`&&e.left.type===`TypeCastExpression`&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableListItem(e,t,n){let r=e[t];r.type===`TypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}toReferencedList(e,t){for(let n=0;n<e.length;n++){let r=e[n];r?.type===`TypeCastExpression`&&!r.extra?.parenthesized&&(e.length>1||!t)&&this.raise(P.TypeCastInPattern,r.typeAnnotation)}return e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.toReferencedList(n.elements),n}isValidLVal(e,t,n,r){return e===`TypeCastExpression`||super.isValidLVal(e,t,n,r)}parseClassProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(10)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(10)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,n,r,i,a){if(t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,n,r,i,a),t.params&&i){let e=t.params;e.length>0&&this.isThisParam(e[0])&&this.raise(P.ThisParamBannedInConstructor,t)}else if(t.type===`MethodDefinition`&&i&&t.value.params){let e=t.value.params;e.length>0&&this.isThisParam(e[0])&&this.raise(P.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,n,r){t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,n,r)}flowParseClassImplements(){let e=this.startNode();return e.id=this.flowParseRestrictedIdentifier(!0),e.typeParameters=this.match(43)?this.flowParseTypeParameterInstantiation():null,this.finishNode(e,`ClassImplements`)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(43)||this.match(47))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.eatContextual(109)){let t=e.implements=[];do t.push(this.flowParseClassImplements());while(this.eat(8))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let n=t[0];this.isThisParam(n)&&e.kind===`get`?this.raise(P.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(P.SetterMayNotHaveThisParam,n)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,n,r,i,a,o){e.variance&&this.unexpected(e.variance.start),delete e.variance;let s;this.match(43)&&!a&&(s=this.flowParseTypeParameterDeclaration(),this.match(6)||this.unexpected());let c=super.parseObjPropValue(e,t,n,r,i,a,o);return s&&((c.value||c).typeParameters=s),c}parseFunctionParamType(e){return this.eat(13)&&(e.type!==`Identifier`&&this.raise(P.PatternIsOptional,e),this.isThisParam(e)&&this.raise(P.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(10)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(P.ThisParamAnnotationRequired,e),this.match(25)&&this.isThisParam(e)&&this.raise(P.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(P.TypeBeforeInitializer,n.typeAnnotation),n}parseImportSpecifierLocal(e,t,n){t.local=ut(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){if(super.applyImportPhase(e,t,n,r),t){if(!n&&this.match(61))return;e.exportKind=n===`type`?n:`value`}else n===`type`&&this.match(51)&&this.unexpected(),e.importKind=n===`type`||n===`typeof`?n:`value`}parseImportSpecifier(e,t,n,r,i){let a=e.imported,o=null;a.type===`Identifier`&&(a.name===`type`?o=`type`:a.name===`typeof`&&(o=`typeof`));let s=!1;if(this.isContextual(89)&&!this.isLookaheadContextual(`as`)){let t=this.parseIdentifier(!0);o!==null&&!O(this.state.type)?(e.imported=t,e.importKind=o,e.local=this.cloneIdentifier(t)):(e.imported=a,e.importKind=null,e.local=this.parseIdentifier())}else{if(o!==null&&O(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=o;else{if(t)throw this.raise(g.ImportBindingIsString,e,{importName:a.value});e.imported=a,e.importKind=null}this.eatContextual(89)?e.local=this.parseIdentifier():(s=!0,e.local=this.cloneIdentifier(e.imported))}let c=ut(e);return n&&c&&this.raise(P.ImportTypeShorthandOnlyInPureImport,e),(n||c)&&this.checkReservedType(e.local.name,e.local.start,!0),s&&!n&&!c&&this.checkReservedWord(e.local.name,e.start,!0,!0),this.finishImportSpecifier(e,`ImportSpecifier`)}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseFunctionParams(e,t){let n=e.kind;n!==`get`&&n!==`set`&&this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(10)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(10)){let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=t}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(10)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){let n=null,r;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===j.j_oTag||a===j.j_expr)&&i.pop()}if(r?.error||this.match(43)){n||=this.state.clone();let i,a=this.tryParse(n=>{i=this.flowParseTypeParameterDeclaration();let r=this.forwardNoArrowParamsConversionAt(i,()=>{let n=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(n,i),n});r.extra?.parenthesized&&n();let a=this.maybeUnwrapTypeCastExpression(r);return a.type!==`ArrowFunctionExpression`&&n(),a.typeParameters=i,this.resetStartLocationFromNode(a,i),r},n),o=null;if(a.node&&this.maybeUnwrapTypeCastExpression(a.node).type===`ArrowFunctionExpression`){if(!a.error&&!a.aborted)return a.node.async&&this.raise(P.UnexpectedTypeParameterBeforeAsyncArrowFunction,i),a.node;o=a.node}if(r?.node)return this.state=r.failState,r.node;if(o)return this.state=a.failState,o;throw r?.thrown?r.error:a.thrown?a.error:this.raise(P.UnexpectedTokenAfterTypeParameter,i)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(()=>{let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0),this.state.noAnonFunctionType=t,this.canInsertSemicolon()&&this.unexpected(),this.match(15)||this.unexpected(),n});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,`TypeAnnotation`):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(10)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,n,r=!0){if(!(n&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let t=0;t<e.params.length;t++)this.isThisParam(e.params[t])&&t>0&&this.raise(P.ThisParamMustBeFirst,e.params[t]);super.checkParams(e,t,n,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,t,n){if(e.type===`Identifier`&&e.name===`async`&&this.state.noArrowAt.includes(t.index)){this.next();let n=this.startNodeAt(t);n.callee=e,n.arguments=super.parseCallExpressionArguments(),e=this.finishNode(n,`CallExpression`)}else if(e.type===`Identifier`&&e.name===`async`&&this.match(43)){let r=this.state.clone(),i=this.tryParse(e=>this.parseAsyncArrowWithTypeParameters(t)||e(),r);if(!i.error&&!i.aborted)return i.node;let a=this.tryParse(()=>super.parseSubscripts(e,t,n),r);if(a.node&&!a.error)return a.node;if(i.node)return this.state=i.failState,i.node;if(a.node)return this.state=a.failState,a.node;throw i.error||a.error}return super.parseSubscripts(e,t,n)}parseSubscript(e,t,n,r){if(this.match(14)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,n)return r.stop=!0,e;this.next();let i=this.startNodeAt(t);return i.callee=e,i.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(6),i.arguments=this.parseCallExpressionArguments(),i.optional=!0,this.finishCallExpression(i,!0)}if(!n&&this.shouldParseTypes()&&(this.match(43)||this.match(47))){let n=this.startNodeAt(t);n.callee=e;let i=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(6),n.arguments=super.parseCallExpressionArguments(),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(i.node)return i.error&&(this.state=i.failState),i.node}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(43)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(5,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let n=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(P.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin(`flowComments`)&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(P.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?`*-/`:`*/`)}skipFlowComment(){let{pos:e}=this.state,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let n=this.input.charCodeAt(t+e),r=this.input.charCodeAt(t+e+1);return n===58&&r===58?t+2:this.input.slice(t+e,t+e+12)===`flow-include`?t+12:n===58&&r!==58&&t}hasFlowCommentCompletion(){if(this.input.indexOf(`*/`,this.state.pos)===-1)throw this.raise(g.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,t){this.raise(P.EnumBooleanMemberNotInitialized,e,t)}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType===`symbol`?P.EnumInvalidMemberInitializerSymbolType:P.EnumInvalidMemberInitializerPrimaryType:P.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(P.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(P.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(8)||this.match(4);switch(this.state.type){case 131:{let e=this.parseNumericLiteral(this.state.value);if(t())return{type:`number`,loc:e.start,value:e};break}case 130:{let e=this.parseStringLiteral(this.state.value);if(t())return{type:`string`,loc:e.start,value:e};break}case 81:case 82:{let e=this.parseBooleanLiteral(this.match(81));if(t())return{type:`boolean`,loc:e.start,value:e}}}return{type:`invalid`,loc:e}}flowEnumMemberRaw(){let e=this.state.startLoc;return{id:this.parseIdentifier(!0),init:this.eat(25)?this.flowEnumMemberInit():{type:`none`,loc:e}}}flowEnumCheckExplicitTypeMismatch(e,t,n){let{explicitType:r}=t;r!==null&&r!==n&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let n=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},i=!1;for(;!this.match(4);){if(this.eat(17)){i=!0;break}let a=this.startNode(),{id:o,init:s}=this.flowEnumMemberRaw(),c=o.name;if(c===``)continue;/^[a-z]/.test(c)&&this.raise(P.EnumInvalidMemberName,o,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),n.has(c)&&this.raise(P.EnumDuplicateMemberName,o,{memberName:c,enumName:e}),n.add(c);let l={enumName:e,explicitType:t,memberName:c};switch(a.id=o,s.type){case`boolean`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`boolean`),a.init=s.value,r.booleanMembers.push(this.finishNode(a,`EnumBooleanMember`));break;case`number`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`number`),a.init=s.value,r.numberMembers.push(this.finishNode(a,`EnumNumberMember`));break;case`string`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`string`),a.init=s.value,r.stringMembers.push(this.finishNode(a,`EnumStringMember`));break;case`invalid`:throw this.flowEnumErrorInvalidMemberInitializer(s.loc,l);case`none`:switch(t){case`boolean`:this.flowEnumErrorBooleanMemberNotInitialized(s.loc,l);break;case`number`:this.flowEnumErrorNumberMemberNotInitialized(s.loc,l);break;default:r.defaultedMembers.push(this.finishNode(a,`EnumDefaultedMember`))}}this.match(4)||this.expect(8)}return{members:r,hasUnknownMembers:i}}flowEnumStringMembers(e,t,{enumName:n}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let t of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(t,{enumName:n});return t}for(let e of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:n});return e}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(98))return null;if(!D(this.state.type))throw this.raise(P.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!==`boolean`&&t!==`number`&&t!==`string`&&t!==`symbol`&&this.raise(P.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let n=t.name,r=t.start,i=this.flowEnumParseExplicitType({enumName:n});this.expect(2);let{members:a,hasUnknownMembers:o}=this.flowEnumMembers({enumName:n,explicitType:i});switch(e.hasUnknownMembers=o,i){case`boolean`:return e.explicitType=!0,e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`);case`number`:return e.explicitType=!0,e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`);case`string`:return e.explicitType=!0,e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);case`symbol`:return e.members=a.defaultedMembers,this.expect(4),this.finishNode(e,`EnumSymbolBody`);default:{let t=()=>(e.members=[],this.expect(4),this.finishNode(e,`EnumStringBody`));e.explicitType=!1;let i=a.booleanMembers.length,o=a.numberMembers.length,s=a.stringMembers.length,c=a.defaultedMembers.length;if(!i&&!o&&!s&&!c)return t();if(!i&&!o)return e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);if(!o&&!s&&i>=c){for(let e of a.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`)}if(!i&&!s&&o>=c){for(let e of a.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`)}return this.raise(P.EnumInconsistentMemberValues,r,{enumName:n}),t()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,`EnumDeclaration`)}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(43)||this.match(47))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}maybeUnwrapTypeCastExpression(e){return e.type===`TypeCastExpression`?e.expression:e}},ht=RegExp(`\\r\\n|[\\r\\n\\u2028\\u2029]`,`g`);function F(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function gt(e,t,n){for(let r=t;r<n;r++)if(F(e.charCodeAt(r)))return!0;return!1}var _t=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,vt=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function yt(e){switch(e){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var I=h`jsx`({AttributeIsEmpty:`JSX attributes must only be assigned a non-empty expression.`,MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:`Expected corresponding JSX closing tag for <>.`,UnexpectedSequenceExpression:`Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?`,UnexpectedToken:({unexpected:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:`JSX value should be either an expression or a quoted JSX text.`,UnterminatedJsxContent:`Unterminated JSX contents.`,UnwrappedAdjacentJSXElements:`Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?`});function L(e){return e?e.type===`JSXOpeningFragment`||e.type===`JSXClosingFragment`:!1}function R(e){if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return R(e.object)+`.`+R(e.property);throw Error(`Node had unexpected type: `+e.type)}var bt=e=>class extends e{jsxReadToken(){let e=``,t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(I.UnterminatedJsxContent,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:if(this.state.pos===this.state.start){n===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(138)):super.getTokenFromCode(n);return}e+=this.input.slice(t,this.state.pos),this.finishToken(137,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:this.raise(I.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:n===125?`&rbrace;`:`&gt;`});default:F(n)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),n;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,n=e?`
4
+ `:`\r
5
+ `):n=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let t=``,n=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(g.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadEntity(),n=this.state.pos):F(r)?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}t+=this.input.slice(n,this.state.pos++),this.finishToken(130,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let e=10;this.codePointAtPos(this.state.pos)===120&&(e=16,++this.state.pos);let t=this.readInt(e,void 0,!1,`bail`);if(t!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(t)}else{let t=0,n=!1;for(;t++<10&&this.state.pos<this.length&&!(n=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;n&&(this.input.slice(e,this.state.pos),++this.state.pos)}return this.state.pos=e,`&`}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(N(e)||e===45);this.finishToken(136,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(136)?e.name=this.state.value:Oe(this.state.type)?e.name=A(this.state.type):this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(10))return t;let n=this.startNodeAt(e);return n.namespace=t,n.name=this.jsxParseIdentifier(),this.finishNode(n,`JSXNamespacedName`)}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type===`JSXNamespacedName`)return t;for(;this.eat(12);){let n=this.startNodeAt(e);n.object=t,n.property=this.jsxParseIdentifier(),t=this.finishNode(n,`JSXMemberExpression`)}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 2:return e=this.startNode(),this.setContext(j.brace),this.next(),e=this.jsxParseExpressionContainer(e,j.j_oTag),e.expression.type===`JSXEmptyExpression`&&this.raise(I.AttributeIsEmpty,e),e;case 138:case 130:return this.parseExprAtom();default:throw this.raise(I.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(j.j_expr),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadChild`)}jsxParseExpressionContainer(e,t){if(this.match(4))e.expression=this.jsxParseEmptyExpression();else{let t=this.parseExpression();t.type===`SequenceExpression`&&!t.extra?.parenthesized&&this.raise(I.UnexpectedSequenceExpression,t.expressions[1]),e.expression=t}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXExpressionContainer`)}jsxParseAttribute(){if(this.match(2)){let e=this.startNode();return this.setContext(j.brace),this.next(),this.expect(17),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(j.j_oTag),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadAttribute`)}let e=this.startNode();return e.name=this.jsxParseNamespacedName(),e.value=this.eat(25)?this.jsxParseAttributeValue():null,this.finishNode(e,`JSXAttribute`)}jsxParseOpeningElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXOpeningFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t)}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(52)&&!this.match(139);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(52),this.expect(139),this.finishNode(e,`JSXOpeningElement`)}jsxParseClosingElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXClosingFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.expect(139),this.finishNode(t,`JSXClosingElement`)}jsxParseElementAt(e){let t=this.startNodeAt(e),n=[],r=this.jsxParseOpeningElementAt(e),i=null;if(!r.selfClosing){t:for(;;)switch(this.state.type){case 138:if(e=this.state.startLoc,this.next(),this.eat(52)){this.setLoc(e),i=this.jsxParseClosingElementAt(e);break t}n.push(this.jsxParseElementAt(e));break;case 137:n.push(this.parseLiteral(this.state.value,`JSXText`));break;case 2:{let e=this.startNode();this.setContext(j.brace),this.next(),this.match(17)?n.push(this.jsxParseSpreadChild(e)):n.push(this.jsxParseExpressionContainer(e,j.j_expr));break}default:this.unexpected()}L(r)&&!L(i)&&i!==null?this.raise(I.MissingClosingTagFragment,i):(!L(r)&&L(i)||!L(r)&&!L(i)&&R(i.name)!==R(r.name))&&this.raise(I.MissingClosingTagElement,i,{openingTagName:R(r.name)})}if(L(r)?(t.openingFragment=r,t.closingFragment=i):(t.openingElement=r,t.closingElement=i),t.children=n,this.match(43))throw this.raise(I.UnwrappedAdjacentJSXElements,this.state.startLoc);return L(r)?this.finishNode(t,`JSXFragment`):this.finishNode(t,`JSXElement`)}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(138)?this.jsxParseElement():this.match(43)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(138),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===j.j_expr){this.jsxReadToken();return}if(t===j.j_oTag||t===j.j_cTag){if(M(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(139);return}if((e===34||e===39)&&t===j.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(138);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:n}=this.state;if(n===52&&e===138)t.splice(-2,2,j.j_cTag),this.state.canStartJSXElement=!1;else if(n===138)t.push(j.j_oTag);else if(n===139){let n=t[t.length-1];n===j.j_oTag&&e===52||n===j.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===j.j_expr):(this.setContext(j.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=we(n)}},xt=class extends it{tsNames=new Map},St=class extends at{get inTSNamespace(){let e=this.scopeStack;return e.length>=2&&e[e.length-1].flags===0&&(e[e.length-2].flags&2048)>0}importsStack=[];createScope(e){return this.importsStack.push(new Set),new xt(e)}enter(e){e&3072&&this.importsStack.push(new Set),super.enter(e)}exit(){let e=super.exit();return e&3072&&this.importsStack.pop(),e}hasImport(e,t){let n=this.importsStack.length;if(this.importsStack[n-1].has(e))return!0;if(!t&&n>1){for(let t=0;t<n-1;t++)if(this.importsStack[t].has(e))return!0}return!1}declareName(e,t,n){if(t&4096){this.hasImport(e,!0)&&this.parser.raise(g.VarRedeclaration,n,{identifierName:e}),this.importsStack[this.importsStack.length-1].add(e);return}let r=this.currentScope(),i=r.tsNames.get(e)||0;if(t&1024){this.maybeExportDefined(r,e),r.tsNames.set(e,i|16);return}super.declareName(e,t,n),t&2&&(t&1||(this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e)),i|=1),t&256&&(i|=2),t&512&&(i|=4),t&128&&(i|=8),i&&r.tsNames.set(e,i)}isRedeclaredInScope(e,t,n){let r=e.tsNames.get(t);return(r&2)>0?n&256?(n&512)>0!=(r&4)>0:!0:n&128&&(r&8)>0?e.names.get(t)&2?!!(n&1):!1:n&2&&(r&1)>0?!0:super.isRedeclaredInScope(e,t,n)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let n=this.scopeStack.length;for(let e=n-1;e>=0;e--){let n=this.scopeStack[e].tsNames.get(t);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(e)}},Ct=class{sawUnambiguousESM=!1;ambiguousScriptDifferentAst=!1;sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if(typeof e==`string`)return this.plugins.has(e);{let[t,n]=e;if(!this.hasPlugin(t))return!1;let r=this.plugins.get(t);for(let e of Object.keys(n))if(r?.[e]!==n[e])return!1;return!0}}getPluginOption(e,t){return this.plugins.get(e)?.[t]}};function wt(e,t){e.trailingComments===void 0?e.trailingComments=t:e.trailingComments.unshift(...t)}function Tt(e,t){e.leadingComments===void 0?e.leadingComments=t:e.leadingComments.unshift(...t)}function Et(e,t){e.innerComments===void 0?e.innerComments=t:e.innerComments.unshift(...t)}function z(e,t,n){let r=null,i=t.length;for(;r===null&&i>0;)r=t[--i];r===null||r.start>n.start?Et(e,n.comments):wt(r,n.comments)}var Dt=class extends Ct{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:t}=this.state,n=t.length;if(n===0)return;let r=n-1,i=t[r];i.start===e.end&&(i.leadingNode=e,r--);let a=e.start;for(;r>=0;r--){let n=t[r],i=n.end;if(i>a)n.containingNode=e,this.finalizeComment(n),t.splice(r,1);else{i===a&&(n.trailingNode=e);break}}}finalizeComment(e){let{comments:t}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&wt(e.leadingNode,t),e.trailingNode!==null&&Tt(e.trailingNode,t);else{let n=e.containingNode,r=e.start;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(n.type){case`ObjectExpression`:case`ObjectPattern`:z(n,n.properties,e);break;case`CallExpression`:case`NewExpression`:case`OptionalCallExpression`:z(n,n.arguments,e);break;case`ImportExpression`:z(n,[n.source,n.options??null],e);break;case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`ObjectMethod`:case`ClassMethod`:case`ClassPrivateMethod`:case`TSTypeParameterDeclaration`:z(n,n.params,e);break;case`ArrayExpression`:case`ArrayPattern`:z(n,n.elements,e);break;case`ExportNamedDeclaration`:case`ImportDeclaration`:z(n,n.specifiers,e);break;case`TSEnumBody`:z(n,n.members,e);break;case`TSInterfaceBody`:z(n,n.body,e);break;default:Et(n,t)}else Et(n,t)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:t}=this.state,{length:n}=t;if(n===0)return;let r=t[n-1];r.leadingNode===e&&(r.leadingNode=null)}takeSurroundingComments(e,t,n){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let i=r[a],o=i.end;if(i.start===n)i.leadingNode=e;else if(o===t)i.trailingNode=e;else if(o<t)break}}},Ot=class e{flags=2048;get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}startIndex;curLine;lineStart;startLoc;endLoc;init({strictMode:e,sourceType:t,startIndex:n,startLine:r,startColumn:i}){this.strict=e===!1?!1:e===!0||t===`module`,this.startIndex=n,this.curLine=r,this.lineStart=-i,this.startLoc=this.endLoc=new c(r,i,n)}errors=[];noArrowAt=[];noArrowParamsConversionAt=[];get canStartArrow(){return(this.flags&2)>0}set canStartArrow(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get inConditionalConsequent(){return(this.flags&256)>0}set inConditionalConsequent(e){e?this.flags|=256:this.flags&=-257}get inHackPipelineBody(){return(this.flags&512)>0}set inHackPipelineBody(e){e?this.flags|=512:this.flags&=-513}get seenTopicReference(){return(this.flags&1024)>0}set seenTopicReference(e){e?this.flags|=1024:this.flags&=-1025}labels=[];commentsLen=0;commentStack=[];pos=0;type=135;value=null;start=0;end=0;lastTokEndLoc=null;lastTokStartLoc=null;context=[j.brace];get canStartJSXElement(){return(this.flags&2048)>0}set canStartJSXElement(e){e?this.flags|=2048:this.flags&=-2049}get containsEsc(){return(this.flags&4096)>0}set containsEsc(e){e?this.flags|=4096:this.flags&=-4097}firstInvalidTemplateEscapePos=null;get hasTopLevelAwait(){return(this.flags&8192)>0}set hasTopLevelAwait(e){e?this.flags|=8192:this.flags&=-8193}strictErrors=new Map;tokensLength=0;curPosition(){return new c(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new e;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},kt=function(e){return e>=48&&e<=57},At={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},jt={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function Mt(e,t,n,r,i,a){let o=n,s=r,c=i,l=``,u=null,d=n,{length:f}=t;for(;;){if(n>=f){a.unterminated(o,s,c),l+=t.slice(d,n);break}let p=t.charCodeAt(n);if(Nt(e,p,t,n)){l+=t.slice(d,n);break}if(p===92){l+=t.slice(d,n);let o=Pt(t,n,r,i,e===`template`,a);o.ch===null&&!u?u={pos:n,lineStart:r,curLine:i}:l+=o.ch,{pos:n,lineStart:r,curLine:i}=o,d=n}else p===8232||p===8233?(++n,++i,r=n):p===10||p===13?e===`template`?(l+=t.slice(d,n)+`
6
+ `,++n,p===13&&t.charCodeAt(n)===10&&++n,++i,d=r=n):a.unterminated(o,s,c):++n}return{pos:n,str:l,firstInvalidLoc:u,lineStart:r,curLine:i}}function Nt(e,t,n,r){return e===`template`?t===96||t===36&&n.charCodeAt(r+1)===123:t===(e===`double`?34:39)}function Pt(e,t,n,r,i,a){let o=!i;t++;let s=e=>({pos:t,ch:e,lineStart:n,curLine:r}),c=e.charCodeAt(t++);switch(c){case 110:return s(`
7
+ `);case 114:return s(`\r`);case 120:{let i;return{code:i,pos:t}=Ft(e,t,n,r,2,!1,o,a),s(i===null?null:String.fromCharCode(i))}case 117:{let i;return{code:i,pos:t}=Lt(e,t,n,r,o,a),s(i===null?null:String.fromCodePoint(i))}case 116:return s(` `);case 98:return s(`\b`);case 118:return s(`\v`);case 102:return s(`\f`);case 13:e.charCodeAt(t)===10&&++t;case 10:n=t,++r;case 8232:case 8233:return s(``);case 56:case 57:if(i)return s(null);a.strictNumericEscape(t-1,n,r);default:if(c>=48&&c<=55){let o=t-1,c=/^[0-7]+/.exec(e.slice(o,t+2))[0],l=parseInt(c,8);l>255&&(c=c.slice(0,-1),l=parseInt(c,8)),t+=c.length-1;let u=e.charCodeAt(t);if(c!==`0`||u===56||u===57){if(i)return s(null);a.strictNumericEscape(o,n,r)}return s(String.fromCharCode(l))}return s(String.fromCharCode(c))}}function Ft(e,t,n,r,i,a,o,s){let c=t,l;return{n:l,pos:t}=It(e,t,n,r,16,i,a,!1,s,!o),l===null&&(o?s.invalidEscapeSequence(c,n,r):t=c-1),{code:l,pos:t}}function It(e,t,n,r,i,a,o,s,c,l){let u=t,d=i===16?At.hex:At.decBinOct,f=i===16?jt.hex:i===10?jt.dec:i===8?jt.oct:jt.bin,p=!1,m=0;for(let u=0,ee=a??1/0;u<ee;++u){let a=e.charCodeAt(t),u;if(a===95&&s!==`bail`){let i=e.charCodeAt(t-1),a=e.charCodeAt(t+1);if(s){if(Number.isNaN(a)||!f(a)||d.has(i)||d.has(a)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,n,r)}}else{if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,n,r)}++t;continue}if(u=a>=97?a-97+10:a>=65?a-65+10:kt(a)?a-48:1/0,u>=i){if(u<=9&&l)return{n:null,pos:t};if(u<=9&&c.invalidDigit(t,n,r,i))u=0;else if(o)u=0,p=!0;else break}++t,m=m*i+u}return t===u||a!=null&&t-u!==a||p?{n:null,pos:t}:{n:m,pos:t}}function Lt(e,t,n,r,i,a){let o=e.charCodeAt(t),s;if(o===123){if(++t,{code:s,pos:t}=Ft(e,t,n,r,e.indexOf(`}`,t)-t,!0,i,a),++t,s!==null&&s>1114111){if(i)a.invalidCodePoint(t,n,r);else return{code:null,pos:t}}}else({code:s,pos:t}=Ft(e,t,n,r,4,!1,i,a));return{code:s,pos:t}}function B(e,t,n){return new c(n,e-t,e)}var Rt=new Set([103,109,115,105,121,117,100,118]),zt=class{constructor(e){let t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new l(e.startLoc,e.endLoc)}},Bt,Vt=class extends Dt{isLookahead;tokens=[];constructor(e,t){super(),this.state=new Ot,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1,(!Bt||Bt.length<(this.length+1)*2)&&(Bt=new Uint32Array((this.length+1)*2)),this.locData=Bt}setLoc(e){let t=this.offsetToSourcePos(e.index);this.locData[t*2]=e.line,this.locData[t*2+1]=e.column}getLoc(e){let t=this.offsetToSourcePos(e);return new c(this.locData[t*2],this.locData[t*2+1],e)}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&512&&this.pushToken(new zt(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return this.match(e)?(this.next(),!0):!1}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return _t.lastIndex=e,_t.test(this.input)?_t.lastIndex:e}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(e){return this.input.charCodeAt(this.nextTokenStartSince(e))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return vt.lastIndex=e,vt.test(this.input)?vt.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if((t&64512)==55296&&++e<this.input.length){let n=this.input.charCodeAt(e);(n&64512)==56320&&(t=65536+((t&1023)<<10)+(n&1023))}return t}setStrict(e){this.state.strict=e,e&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,t)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(135);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());let n=this.state.pos,r=this.input.indexOf(e,n+2);if(r===-1)throw this.raise(g.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+e.length,ht.lastIndex=n+2;ht.test(this.input)&&ht.lastIndex<=r;)++this.state.curLine,this.state.lineStart=ht.lastIndex;if(this.isLookahead)return;let i={type:`CommentBlock`,value:this.input.slice(n+2,r),start:this.sourceToOffsetPos(n),end:this.sourceToOffsetPos(r+e.length),loc:new l(t,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(i),i}skipLineComment(e){let t=this.state.pos,n;this.isLookahead||(n=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=e);if(this.state.pos<this.length)for(;!F(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,a={type:`CommentLine`,value:this.input.slice(t+e,i),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(i),loc:new l(n,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(a),a}skipSpace(){let e=this.state.pos,t=this.optionFlags&8192?[]:null;t:for(;this.state.pos<this.length;){let n=this.input.charCodeAt(this.state.pos);switch(n){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let e=this.skipBlockComment(`*/`);e!==void 0&&(this.addComment(e),t?.push(e));break}case 47:{let e=this.skipLineComment(2);e!==void 0&&(this.addComment(e),t?.push(e));break}default:break t}break;default:if(yt(n))++this.state.pos;else if(n===45&&!this.inModule&&this.optionFlags&16384){let n=this.state.pos;if(this.input.charCodeAt(n+1)===45&&this.input.charCodeAt(n+2)===62&&(e===0||this.state.lineStart>e)){let e=this.skipLineComment(3);e!==void 0&&(this.addComment(e),t?.push(e))}else break t}else if(n===60&&!this.inModule&&this.optionFlags&16384){let e=this.state.pos;if(this.input.charCodeAt(e+1)===33&&this.input.charCodeAt(e+2)===45&&this.input.charCodeAt(e+3)===45){let e=this.skipLineComment(4);e!==void 0&&(this.addComment(e),t?.push(e))}else break t}else break t}}if(t?.length>0){let n=this.state.pos,r={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(n),comments:t,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let n=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(n)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(g.UnexpectedDigitAfterHash,this.state.curPosition());M(t)?(++this.state.pos,this.finishToken(134,this.readWord1(t))):t===92?(++this.state.pos,this.finishToken(134,this.readWord1())):this.finishOp(23,1)}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57){this.readNumber(!0);return}e===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(17)):(++this.state.pos,this.finishToken(12))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(27,2):this.finishOp(52,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(e!==33)return!1;let t=this.state.pos;for(this.state.pos+=1;!F(e)&&++this.state.pos<this.length;)e=this.input.charCodeAt(this.state.pos);let n=this.input.slice(t+2,this.state.pos);return this.finishToken(24,n),!0}readToken_mult_modulo(e){let t=e===42?51:50,n=1,r=this.input.charCodeAt(this.state.pos+1);e===42&&r===42&&(n++,r=this.input.charCodeAt(this.state.pos+2),t=53),r===61&&!this.state.inType&&(n++,t=e===37?29:26),this.finishOp(t,n)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(26,3):this.finishOp(e===124?37:38,2);return}if(e===124&&t===62){this.finishOp(35,2);return}if(t===61){this.finishOp(26,2);return}this.finishOp(e===124?39:41,1)}readToken_caret(){let e=this.input.charCodeAt(this.state.pos+1);e===61&&!this.state.inType?this.finishOp(28,2):e===94&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`^^`}])?(this.finishOp(33,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(40,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`@@`}])?this.finishOp(34,2):this.finishOp(22,1)}readToken_plus_min(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.finishOp(30,2);return}t===61?this.finishOp(26,2):this.finishOp(49,1)}readToken_lt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===60){if(this.input.charCodeAt(e+2)===61){this.finishOp(26,3);return}this.finishOp(47,2);return}if(t===61){this.finishOp(45,2);return}this.finishOp(43,1)}readToken_gt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===62){let t=this.input.charCodeAt(e+2)===62?3:2;if(this.input.charCodeAt(e+t)===61){this.finishOp(26,t+1);return}this.finishOp(48,t);return}if(t===61){this.finishOp(45,2);return}this.finishOp(44,1)}readToken_eq_excl(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===61){this.finishOp(42,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(e===61&&t===62){this.state.pos+=2,this.finishToken(15);return}this.finishOp(e===61?25:31,1)}readToken_question(){let e=this.input.charCodeAt(this.state.pos+1),t=this.input.charCodeAt(this.state.pos+2);e===63?t===61?this.finishOp(26,3):this.finishOp(36,2):e===46&&!(t>=48&&t<=57)?(this.state.pos+=2,this.finishToken(14)):(++this.state.pos,this.finishToken(13))}getTokenFromCode(e){switch(e){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(6);return;case 41:++this.state.pos,this.finishToken(7);return;case 59:++this.state.pos,this.finishToken(9);return;case 44:++this.state.pos,this.finishToken(8);return;case 91:++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(1);return;case 123:++this.state.pos,this.finishToken(2);return;case 125:++this.state.pos,this.finishToken(4);return;case 58:this.hasPlugin(`functionBind`)&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(11,2):(++this.state.pos,this.finishToken(10));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(e);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(e);return;case 124:case 38:this.readToken_pipe_amp(e);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(e);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(e);return;case 126:this.finishOp(32,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(M(e)){this.readWord(e);return}}throw this.raise(g.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){let n=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,n)}readRegexp(){let e=this.state.startLoc,t=this.state.start+1,n,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(g.UnterminatedRegExp,u(e,1));let t=this.input.charCodeAt(i);if(F(t))throw this.raise(g.UnterminatedRegExp,u(e,1));if(n)n=!1;else{if(t===91)r=!0;else if(t===93&&r)r=!1;else if(t===47&&!r)break;n=t===92}}let a=this.input.slice(t,i);++i;let o=``,s=()=>u(e,i+2-t);for(;i<this.length;){let e=this.codePointAtPos(i),t=String.fromCharCode(e);if(Rt.has(e))e===118?o.includes(`u`)&&this.raise(g.IncompatibleRegExpUVFlags,s()):e===117&&o.includes(`v`)&&this.raise(g.IncompatibleRegExpUVFlags,s()),o.includes(t)&&this.raise(g.DuplicateRegExpFlags,s());else if(N(e)||e===92)this.raise(g.MalformedRegExpFlags,s());else break;++i,o+=t}this.state.pos=i,this.finishToken(133,{pattern:a,flags:o})}readInt(e,t,n=!1,r=!0){let{n:i,pos:a}=It(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,t,n,r,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1;this.state.pos+=2;let i=this.readInt(e);if(i??this.raise(g.InvalidDigit,u(n,2),{radix:e}),this.input.charCodeAt(this.state.pos)===110&&(++this.state.pos,r=!0),M(this.codePointAtPos(this.state.pos)))throw this.raise(g.NumberIdentifier,this.state.curPosition());if(r){let e=this.input.slice(t,this.state.pos).replace(/[_n]/g,``);this.finishToken(132,e);return}this.finishToken(131,i)}readNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1,i=!1,a=!1;!e&&this.readInt(10)===null&&this.raise(g.InvalidNumber,this.state.curPosition());let s=this.state.pos-t>=2&&this.input.charCodeAt(t)===48;if(s){let e=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(g.StrictOctalLiteral,n),!this.state.strict){let t=e.indexOf(`_`);t>0&&this.raise(g.ZeroDigitNumericSeparator,u(n,t))}a=s&&!/[89]/.test(e)}let c=this.input.charCodeAt(this.state.pos);c===46&&!a&&(++this.state.pos,this.readInt(10),r=!0,c=this.input.charCodeAt(this.state.pos)),(c===69||c===101)&&!a&&(c=this.input.charCodeAt(++this.state.pos),(c===43||c===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(g.InvalidOrMissingExponent,n),r=!0,c=this.input.charCodeAt(this.state.pos));let l=o(0,this.input.slice(t,this.state.pos),`_`,``);if(c===110&&((r||s)&&this.raise(g.InvalidBigIntLiteral,n),++this.state.pos,i=!0),M(this.codePointAtPos(this.state.pos)))throw this.raise(g.NumberIdentifier,this.state.curPosition());if(i){this.finishToken(132,l);return}let d=a?parseInt(l,8):parseFloat(l);this.finishToken(131,d)}readCodePoint(e){let{code:t,pos:n}=Lt(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=n,t}readString(e){let{str:t,pos:n,curLine:r,lineStart:i}=Mt(e===34?`double`:`single`,this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=n+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(130,t)}readTemplateContinuation(){this.match(4)||this.unexpected(null,4),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let e=this.input[this.state.pos],{str:t,firstInvalidLoc:n,pos:r,curLine:i,lineStart:a}=Mt(`template`,this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,n&&(this.state.firstInvalidTemplateEscapePos=new c(n.curLine,n.pos-n.lineStart,this.sourceToOffsetPos(n.pos))),this.input.codePointAt(r)===96?this.finishToken(20,n?null:e+t+"`"):(this.state.pos++,this.finishToken(21,n?null:e+t+"${"))}recordStrictModeErrors(e,t){let n=t.index;this.state.strict&&!this.state.strictErrors.has(n)?this.raise(e,t):this.state.strictErrors.set(n,[e,t])}readWord1(e){this.state.containsEsc=!1;let t=``,n=this.state.pos,r=this.state.pos;for(e!==void 0&&(this.state.pos+=e<=65535?1:2);this.state.pos<this.length;){let e=this.codePointAtPos(this.state.pos);if(N(e))this.state.pos+=e<=65535?1:2;else if(e===92){this.state.containsEsc=!0,t+=this.input.slice(r,this.state.pos);let e=this.state.curPosition(),i=this.state.pos===n?M:N;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(g.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let a=this.readCodePoint(!0);a!==null&&(i(a)||this.raise(g.EscapedCharNotAnIdentifier,e),t+=String.fromCodePoint(a)),r=this.state.pos}else break}return t+this.input.slice(r,this.state.pos)}readWord(e){let t=this.readWord1(e),n=me.get(t);n===void 0?this.finishToken(128,t):this.finishToken(n,A(n))}checkKeywordEscapes(){let{type:e}=this.state;Oe(e)&&this.state.containsEsc&&this.raise(g.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:A(e)})}raise(e,t,n={}){let r=t instanceof c?t:typeof t==`number`?this.getLoc(t):this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=e(r,t instanceof c?r.index:typeof t==`number`?t:t.start,n);if(!(this.optionFlags&4096))throw i;return this.isLookahead||this.state.errors.push(i),i}raiseOverwrite(e,t,n={}){let r=t instanceof c?t:this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=t instanceof c?r.index:t.start,a=this.state.errors;for(let t=a.length-1;t>=0;t--){let o=a[t];if(o.pos===i)return a[t]=e(r,i,n);if(o.pos<i)break}return this.raise(e,r,n)}updateContext(e){}unexpected(e,t){throw this.raise(g.UnexpectedToken,e??this.state.startLoc,{expected:t?A(t):null})}expectPlugin(e,t){if(this.hasPlugin(e))return!0;throw this.raise(g.MissingPlugin,t??this.state.startLoc,{missingPlugin:[e]})}expectOnePlugin(e){if(!e.some(e=>this.hasPlugin(e)))throw this.raise(g.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,n,r)=>{this.raise(e,B(t,n,r))}}errorHandlers_readInt={invalidDigit:(e,t,n,r)=>this.optionFlags&4096?(this.raise(g.InvalidDigit,B(e,t,n),{radix:r}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(g.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(g.UnexpectedNumericSeparator)};errorHandlers_readCodePoint={...this.errorHandlers_readInt,invalidEscapeSequence:this.errorBuilder(g.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(g.InvalidCodePoint)};errorHandlers_readStringContents_string={...this.errorHandlers_readCodePoint,strictNumericEscape:(e,t,n)=>{this.recordStrictModeErrors(g.StrictNumericEscape,B(e,t,n))},unterminated:(e,t,n)=>{throw this.raise(g.UnterminatedString,B(e-1,t,n))}};errorHandlers_readStringContents_template={...this.errorHandlers_readCodePoint,strictNumericEscape:this.errorBuilder(g.StrictNumericEscape),unterminated:(e,t,n)=>{throw this.raise(g.UnterminatedTemplate,B(e,t,n))}}},Ht=class{privateNames=new Set;loneAccessors=new Map;undefinedPrivateNames=new Map},Ut=class{parser;stack=[];constructor(e){this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Ht)}exit(){let e=this.stack.pop(),t=this.current();for(let[n,r]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(n)||t.undefinedPrivateNames.set(n,r):this.parser.raise(g.InvalidPrivateFieldResolution,r,{identifierName:n})}declarePrivateName(e,t,n){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),o=r.has(e);if(t&3){let n=o&&i.get(e);if(n){let r=n&4,a=t&4;o=(n&3)==(t&3)||r!==a,o||i.delete(e)}else o||i.set(e,t)}o&&this.parser.raise(g.PrivateNameRedeclaration,n,{identifierName:e}),r.add(e),a.delete(e)}usePrivateName(e,t){let n;for(n of this.stack)if(n.privateNames.has(e))return;n?n.undefinedPrivateNames.set(e,t):this.parser.raise(g.InvalidPrivateFieldResolution,t,{identifierName:e})}},Wt=class{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Gt=class extends Wt{declarationErrors=new Map;constructor(e){super(e)}recordDeclarationError(e,t){this.declarationErrors.set(t,e)}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}},Kt=class{parser;stack=[new Wt];constructor(e){this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){let{stack:n}=this,r=n.length-1,i=n[r];for(;!i.isCertainlyParameterDeclaration();){if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(e,t);else return;i=n[--r]}this.parser.raise(e,t)}recordArrowParameterBindingError(e,t){let{stack:n}=this,r=n[n.length-1],i=t.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(e,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(e,i);else return}recordAsyncArrowParametersError(e){let{stack:t}=this,n=t.length-1,r=t[n];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(g.AwaitBindingIdentifier,e),r=t[--n]}validateAsPattern(){let{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors((t,n)=>{this.parser.raise(t,n);let r=e.length-2,i=e[r];for(;i.canBeArrowParameterDeclaration();)i.clearDeclarationError(n),i=e[--r]})}};function qt(){return new Wt(3)}function Jt(){return new Gt(1)}function Yt(){return new Gt(2)}function Xt(){return new Wt}var Zt=class{stacks=[];enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}get inFSharpPipelineDirectBody(){return!(this.currentFlags()&16)}};function Qt(e,t){return(e?2:0)|!!t}var $t=class extends Vt{addExtra(e,t,n,r=!0){if(!e)return;let{extra:i}=e;i??(i={},e.extra=i),r?i[t]=n:Object.defineProperty(i,t,{enumerable:r,value:n})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){if(this.input.startsWith(t,e)){let n=this.input.charCodeAt(e+t.length);return!(N(n)||(n&64512)==55296)}return!1}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return this.isContextual(e)?(this.next(),!0):!1}expectContextual(e,t){if(!this.eatContextual(e)){if(t!=null)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(135)||this.match(4)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return gt(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return gt(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(9)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(9))||this.raise(g.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){let n={node:null};try{let r=e((e=null)=>{throw n.node=e,n});if(this.state.errors.length>t.errors.length){let e=this.state;return this.state=t,this.state.tokensLength=e.tokensLength,{node:r,error:e.errors[t.errors.length],thrown:!1,aborted:!1,failState:e}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(e){let r=this.state;if(this.state=t,e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:r};if(e===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:r};throw e}}checkExpressionErrors(e,t){if(!e)return!1;let{shorthandAssignLoc:n,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a,voidPatternLoc:o}=e,s=!!n||!!r||!!a||!!i||!!o;if(!t)return s;n!=null&&this.raise(g.InvalidCoverInitializedName,n),r!=null&&this.raise(g.DuplicateProto,r),i!=null&&this.raise(g.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),o!=null&&this.raise(g.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return Ce(this.state.type)}isPrivateName(e){return e.type===`PrivateName`}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)&&this.isPrivateName(e.property)}isObjectProperty(e){return e.type===`ObjectProperty`}isObjectMethod(e){return e.type===`ObjectMethod`}initializeScopes(e=this.options.sourceType===`module`){let t=this.state.labels;this.state.labels=[];let n=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=e;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,e);let o=this.prodParam;this.prodParam=new Zt;let s=this.classScope;this.classScope=new Ut(this);let c=this.expressionScope;return this.expressionScope=new Kt(this),()=>{this.state.labels=t,this.exportedIdentifiers=n,this.inModule=r,this.scope=i,this.prodParam=o,this.classScope=s,this.expressionScope=c}}enterInitialScopes(){let e=0;(this.inModule||this.optionFlags&1)&&(e|=2),this.optionFlags&32&&(e|=1);let t=!this.inModule&&this.options.sourceType===`commonjs`;(t||this.optionFlags&2)&&(e|=4),this.prodParam.enter(e);let n=t?514:1;this.optionFlags&4&&(n|=512),this.optionFlags&16&&(n|=48),this.scope.enter(n)}checkDestructuringPrivate(e){let{privateKeyLoc:t}=e;t!==null&&this.expectPlugin(`destructuringPrivate`,t)}},en=class{shorthandAssignLoc=null;doubleProtoLoc=null;privateKeyLoc=null;optionalParametersLoc=null;voidPatternLoc=null},V=class{constructor(e,t,n,r){this.start=n,this.end=0,r!==void 0&&(this.loc=new l(r)),e&128&&(this.range=[n,0]),r!==void 0&&t&&(this.loc.filename=t)}type=``},tn=V.prototype,nn=class extends $t{createPosition(e){return e}startNode(){let{startLoc:e}=this.state;return this.setLoc(e),this.startNodeAt(e)}startNodeAt(e){let{optionFlags:t,filename:n}=this;return t&256?new V(t,n,e.index,this.createPosition(e)):new V(t,n,e.index)}startNodeAtNode(e){let{optionFlags:t,filename:n}=this;return t&256?new V(t,n,e.start,e.loc.start):new V(t,n,e.start)}finishNode(e,t){return this.finishNodeAt(e,t,this.state.lastTokEndLoc)}finishNodeAt(e,t,n){e.type=t,e.end=n.index;let{optionFlags:r}=this;return r&256&&(e.loc.end=this.createPosition(n)),r&128&&(e.range[1]=n.index),r&8192&&this.processComment(e),e}finishNodeAtNode(e,t,n){e.type=t,e.end=n.end;let{optionFlags:r}=this;return r&256&&(e.loc.end=n.loc.end),r&128&&(e.range[1]=e.end),r&8192&&this.processComment(e),e}resetStartLocation(e,t){e.start=t.index;let{optionFlags:n}=this;n&256&&(e.loc.start=this.createPosition(t)),n&128&&(e.range[0]=t.index)}resetEndLocation(e,t=this.state.lastTokEndLoc){e.end=t.index;let{optionFlags:n}=this;n&256&&(e.loc.end=this.createPosition(t)),n&128&&(e.range[1]=t.index)}resetStartLocationFromNode(e,t){e.start=t.start;let{optionFlags:n}=this;n&256&&(e.loc.start=t.loc.start),n&128&&(e.range[0]=t.start)}resetEndLocationFromNode(e,t){e.end=t.end;let{optionFlags:n}=this;n&256&&(e.loc.end=t.loc.end),n&128&&(e.range[1]=t.end)}castNodeTo(e,t){return e.type=t,e}cloneIdentifier(e){let{type:t,start:n,end:r,loc:i,range:a,name:o}=e,s=Object.create(tn);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.name=o,e.extra&&(s.extra=e.extra),s}cloneStringLiteral(e){let{type:t,start:n,end:r,loc:i,range:a,extra:o}=e,s=Object.create(tn);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.extra=o,s.value=e.value,s}},rn=e=>e.type===`ParenthesizedExpression`?rn(e.expression):e,an=class extends nn{toAssignable(e,t=!1){let n;switch((e.type===`ParenthesizedExpression`||e.extra?.parenthesized)&&(n=rn(e),t?n.type===`Identifier`?this.expressionScope.recordArrowParameterBindingError(g.InvalidParenthesizedAssignment,e):n.type!==`CallExpression`&&n.type!==`MemberExpression`&&!this.isOptionalMemberExpression(n)&&this.raise(g.InvalidParenthesizedAssignment,e):this.raise(g.InvalidParenthesizedAssignment,e)),e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:break;case`ObjectExpression`:this.castNodeTo(e,`ObjectPattern`);for(let n=0,r=e.properties.length,i=r-1;n<r;n++){let r=e.properties[n],a=n===i;this.toAssignableObjectExpressionProp(r,a,t),a&&r.type===`RestElement`&&e.extra?.trailingCommaLoc&&this.raise(g.RestTrailingComma,e.extra.trailingCommaLoc)}break;case`ObjectProperty`:{let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t);break}case`SpreadElement`:throw Error(`Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.`);case`ArrayExpression`:this.castNodeTo(e,`ArrayPattern`),this.toAssignableList(e.elements,e.extra?.trailingCommaLoc,t);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(g.MissingEqInAssignment,this.optionFlags&256?e.left.loc.end:e.left),this.castNodeTo(e,`AssignmentPattern`),delete e.operator,e.left.type===`VoidPattern`&&this.raise(g.VoidPatternInitializer,e.left),this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(n,t)}}toAssignableObjectExpressionProp(e,t,n){if(e.type===`ObjectMethod`)this.raise(e.kind===`get`||e.kind===`set`?g.PatternHasAccessor:g.PatternHasMethod,e.key);else if(e.type===`SpreadElement`){this.castNodeTo(e,`RestElement`);let r=e.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,n),t||this.raise(g.RestTrailingComma,e)}else this.toAssignable(e,n)}toAssignableList(e,t,n){let r=e.length-1;for(let i=0;i<=r;i++){let a=e[i];a&&(this.toAssignableListItem(e,i,n),a.type===`RestElement`&&(i<r?this.raise(g.RestTrailingComma,a):t&&this.raise(g.RestTrailingComma,t)))}}toAssignableListItem(e,t,n){let r=e[t];if(r.type===`SpreadElement`){this.castNodeTo(r,`RestElement`);let e=r.argument;this.checkToRestConversion(e,!0),this.toAssignable(e,n)}else this.toAssignable(r,n)}isAssignable(e,t){switch(e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:return!0;case`ObjectExpression`:{let t=e.properties.length-1;return e.properties.every((e,n)=>e.type!==`ObjectMethod`&&(n===t||e.type!==`SpreadElement`)&&this.isAssignable(e))}case`ObjectProperty`:return this.isAssignable(e.value);case`SpreadElement`:return this.isAssignable(e.argument);case`ArrayExpression`:return e.elements.every(e=>e===null||this.isAssignable(e));case`AssignmentExpression`:return e.operator===`=`;case`ParenthesizedExpression`:return this.isAssignable(e.expression);case`MemberExpression`:case`OptionalMemberExpression`:return!t;default:return!1}}toReferencedList(e,t){return e}parseSpread(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e,void 0),this.finishNode(t,`SpreadElement`)}parseRestBinding(){let e=this.startNode();this.next();let t=this.parseBindingAtom();return t.type===`VoidPattern`&&this.raise(g.UnexpectedVoidPattern,t),e.argument=t,this.finishNode(e,`RestElement`)}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(1,93,1),this.finishNode(e,`ArrayPattern`)}case 2:return this.parseObjectLike(4,!0);case 84:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(e,t,n){let r=n&1,i=[],a=!0;for(;!this.eat(e);)if(a?a=!1:this.expect(8),r&&this.match(8))i.push(null);else{if(this.eat(e))break;if(this.match(17)){let r=this.parseRestBinding();if(n&2&&(r=this.parseFunctionParamType(r)),i.push(r),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{let e=[];if(n&2)for(this.match(22)&&this.hasPlugin(`decorators`)&&this.raise(g.UnsupportedParameterDecorator,this.state.startLoc);this.match(22);)e.push(this.parseDecorator());i.push(this.parseBindingElement(n,e))}}return i}parseBindingRestProperty(e){return this.next(),this.hasPlugin(`discardBinding`)&&this.match(84)?(e.argument=this.parseVoidPattern(null),this.raise(g.UnexpectedVoidPattern,e.argument)):e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,`RestElement`)}parseBindingProperty(){let{type:e,startLoc:t}=this.state;if(e===17)return this.parseBindingRestProperty(this.startNode());let n=this.startNode();return e===134?(this.expectPlugin(`destructuringPrivate`,t),this.classScope.usePrivateName(this.state.value,t),n.key=this.parsePrivateName()):this.parsePropertyName(n),n.method=!1,this.parseObjPropValue(n,t,!1,!1,!0,!1)}parseBindingElement(e,t){let{startLoc:n}=this.state,r=this.parseMaybeDefault();return e&2&&this.parseFunctionParamType(r),t.length&&(r.decorators=t,this.resetStartLocationFromNode(r,t[0])),this.parseMaybeDefault(n,r)}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){if(e??=this.state.startLoc,t??=this.parseBindingAtom(),!this.eat(25))return t;let n=this.startNodeAt(e);return t.type===`VoidPattern`&&this.raise(g.VoidPatternInitializer,t),n.left=t,n.right=this.parseMaybeAssignAllowIn(),this.finishNode(n,`AssignmentPattern`)}isValidLVal(e,t,n,r){switch(e){case`AssignmentPattern`:return`left`;case`RestElement`:return`argument`;case`ObjectProperty`:return`value`;case`ParenthesizedExpression`:return`expression`;case`ArrayPattern`:return`elements`;case`ObjectPattern`:return`properties`;case`VoidPattern`:return!0;case`CallExpression`:if(!t&&!this.state.strict&&this.optionFlags&16384)return!0}return!1}isOptionalMemberExpression(e){return e.type===`OptionalMemberExpression`}checkLVal(e,t,n=64,r=!1,i=!1,a=!1,o=!1){let s=e.type;if(this.isObjectMethod(e))return;let c=this.isOptionalMemberExpression(e);if(c||s===`MemberExpression`){c&&(this.expectPlugin(`optionalChainingAssign`,e.start),t.type!==`AssignmentExpression`&&this.raise(g.InvalidLhsOptionalChaining,e,{ancestor:t})),n!==64&&this.raise(g.InvalidPropertyBindingPattern,e);return}if(s===`Identifier`){this.checkIdentifier(e,n,i);let{name:t}=e;r&&(r.has(t)?this.raise(g.ParamDupe,e):r.add(t));return}s===`VoidPattern`&&t.type===`CatchClause`&&this.raise(g.VoidPatternCatchClauseParam,e);let l=rn(e);o||=l.type===`CallExpression`&&(l.callee.type===`Import`||l.callee.type===`Super`);let u=this.isValidLVal(s,o,!(a||e.extra?.parenthesized)&&t.type===`AssignmentExpression`,n);if(u===!0)return;if(u===!1){let r=n===64?g.InvalidLhs:g.InvalidLhsBinding;this.raise(r,e,{ancestor:t});return}let d,f;typeof u==`string`?(d=u,f=s===`ParenthesizedExpression`):[d,f]=u;let p=s===`ArrayPattern`||s===`ObjectPattern`?{type:s}:t,m=e[d];if(Array.isArray(m))for(let e of m)e&&this.checkLVal(e,p,n,r,i,f,!0);else m&&this.checkLVal(m,p,n,r,i,f,o)}checkIdentifier(e,t,n=!1){this.state.strict&&(n?$e(e.name,this.inModule):Qe(e.name))&&(t===64?this.raise(g.StrictEvalArguments,e,{referenceName:e.name}):this.raise(g.StrictEvalArgumentsBinding,e,{bindingName:e.name})),t&8192&&e.name===`let`&&this.raise(g.LetInLexicalBinding,e),t&64||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.start)}checkToRestConversion(e,t){switch(e.type){case`ParenthesizedExpression`:this.checkToRestConversion(e.expression,t);break;case`Identifier`:case`MemberExpression`:break;case`ArrayExpression`:case`ObjectExpression`:if(t)break;default:this.raise(g.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return this.match(8)?(this.raise(this.lookaheadCharCode()===e?g.RestTrailingComma:g.ElementAfterRest,this.state.startLoc),!0):!1}},on=class extends an{checkProto(e,t,n){if(e.type===`SpreadElement`||this.isObjectMethod(e)||e.computed||e.shorthand)return t;let r=e.key;return(r.type===`Identifier`?r.name:r.value)===`__proto__`?(t&&(n?n.doubleProtoLoc===null&&(n.doubleProtoLoc=this.getLoc(r.start)):this.raise(g.DuplicateProto,r)),!0):t}shouldExitDescending(e){return e.type===`ArrowFunctionExpression`&&!e.extra?.parenthesized}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(135))throw this.raise(g.ParseExpressionEmptyInput,this.state.startLoc);let e=this.parseExpression();if(!this.match(135))throw this.raise(g.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,this.optionFlags&512&&(e.tokens=dn(this.tokens)),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){let t=this.state.startLoc,n=this.parseMaybeAssign(e);if(this.match(8)){let r=this.startNodeAt(t);for(r.expressions=[n];this.eat(8);)r.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(r.expressions),this.finishNode(r,`SequenceExpression`)}return n}parseMaybeAssignDisallowIn(e,t){return this.disallowInAnd(()=>this.parseMaybeAssign(e,t))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){let n=this.state.startLoc,r=this.isContextual(104);if(r&&this.prodParam.hasYield){this.next();let e=this.parseYield(n);return t&&(e=t.call(this,e,n)),e}let i;e?i=!1:(e=new en,i=!0),this.state.canStartArrow=!0;let a=this.parseMaybeConditional(e);if(t&&(a=t.call(this,a,n)),Te(this.state.type)){let t=this.startNodeAt(n),r=this.state.value;if(t.operator=r,this.match(25)){this.toAssignable(a,!0),t.left=a;let r=n.index;e.doubleProtoLoc!=null&&e.doubleProtoLoc.index>=r&&(e.doubleProtoLoc=null),e.shorthandAssignLoc!=null&&e.shorthandAssignLoc.index>=r&&(e.shorthandAssignLoc=null),e.privateKeyLoc!=null&&e.privateKeyLoc.index>=r&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null),e.voidPatternLoc!=null&&e.voidPatternLoc.index>=r&&(e.voidPatternLoc=null)}else t.left=a;return this.next(),t.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(t,`AssignmentExpression`),void 0,void 0,void 0,void 0,r===`||=`||r===`&&=`||r===`??=`),t}if(i&&this.checkExpressionErrors(e,!0),r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?k(e):k(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(g.YieldNotInGeneratorFunction,n),this.parseYield(n)}return a}parseMaybeConditional(e){let t=this.state.startLoc,n=this.parseExprOps(e);return this.shouldExitDescending(n)?n:this.parseConditional(n,t,e)}parseConditional(e,t,n){if(this.eat(13)){let n=this.startNodeAt(t);return n.test=e,n.consequent=this.parseMaybeAssignAllowIn(),this.expect(10),n.alternate=this.parseMaybeAssign(),this.finishNode(n,`ConditionalExpression`)}return e}parseMaybeUnaryOrPrivate(e){return this.match(134)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let t=this.state.startLoc,n=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(n)?n:(this.state.canStartArrow=!1,this.parseExprOp(n,t,-1))}parseExprOp(e,t,n){if(this.isPrivateName(e)){let r=this.getPrivateNameSV(e);(n>=Pe(54)||!this.prodParam.hasIn||!this.match(54))&&this.raise(g.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t)}let r=this.state.type;if(ke(r)&&(this.prodParam.hasIn||!this.match(54))){let i=Pe(r);if(i>n){if(r===35&&(this.expectPlugin(`pipelineOperator`),this.prodParam.inFSharpPipelineDirectBody))return e;let a=this.startNodeAt(t);a.left=e,a.operator=this.state.value;let o=r===37||r===38,s=r===36;s&&(i=Pe(38)),this.next(),a.right=this.parseExprOpRightExpr(r,i);let c=this.finishNode(a,o||s?`LogicalExpression`:`BinaryExpression`),l=this.state.type;if(s&&(l===37||l===38)||o&&l===36)throw this.raise(g.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(c,t,n)}}return e}parseExprOpRightExpr(e,t){switch(e){case 35:switch(this.getPluginOption(`pipelineOperator`,`proposal`)){case`hack`:return this.withTopicBindingContext(()=>this.parseHackPipeBody());case`fsharp`:return this.parseFSharpPipelineBody(t)}default:return this.parseExprOpBaseRightExpr(e,t)}}parseExprOpBaseRightExpr(e,t){let n=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),n,Fe(e)?t-1:t)}parseHackPipeBody(){let{startLoc:e}=this.state,t=this.parseMaybeAssign();return re.has(t.type)&&!t.extra?.parenthesized&&this.raise(g.PipeUnparenthesizedBody,e,{type:t.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(g.PipeTopicUnused,e),t}checkExponentialAfterUnary(e){this.match(53)&&this.raise(g.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){let n=this.state.startLoc,r=this.isContextual(92);if(r&&this.recordAwaitIfAllowed()){this.next();let e=this.parseAwait(n);return t||this.checkExponentialAfterUnary(e),e}let i=this.match(30),a=this.startNode();if(je(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.state.canStartArrow=!1,this.match(68)&&this.expectPlugin(`throwExpressions`);let n=this.match(85);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&n){let e=a.argument;e.type===`Identifier`?this.raise(g.StrictDelete,a):this.hasPropertyAsPrivateName(e)&&this.raise(g.DeletePrivateField,a)}if(!i)return t||this.checkExponentialAfterUnary(a),this.finishNode(a,`UnaryExpression`)}let o=this.parseUpdate(a,i,e);if(r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?k(e):k(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(g.AwaitNotInAsyncContext,n),this.parseAwait(n)}return o}parseUpdate(e,t,n){if(t){let t=this.finishNode(e,`UpdateExpression`);return this.checkLVal(t.argument,t),t}let r=this.state.startLoc,i=this.parseExprSubscripts(n);if(this.checkExpressionErrors(n,!1))return i;for(;Ae(this.state.type)&&!this.canInsertSemicolon();){let e=this.startNodeAt(r);e.operator=this.state.value,e.prefix=!1,e.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(e,`UpdateExpression`))}return i}parseExprSubscripts(e){let t=this.state.startLoc;this.setLoc(t);let n=this.parseExprAtom(e);return this.shouldExitDescending(n)?n:this.parseSubscripts(n,t)}parseSubscripts(e,t,n){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do e=this.parseSubscript(e,t,n,r),r.maybeAsyncArrow=!1;while(!r.stop);return e}parseSubscript(e,t,n,r){let{type:i}=this.state;if(!n&&i===11)return this.parseBind(e,t,r);if(Ie(i))return this.parseTaggedTemplateExpression(e,t,r);let a=!1;if(i===14){if(n&&(this.raise(g.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(e,r);r.optionalChainMember=a=!0,this.next()}if(!n&&this.match(6))return this.parseCoverCallAndAsyncArrowHead(e,t,r,a);{let n=this.eat(0);return n||a||this.eat(12)?this.parseMember(e,t,r,n,a):this.stopParseSubscript(e,r)}}stopParseSubscript(e,t){return t.stop=!0,e}parseMember(e,t,n,r,i){let a=this.startNodeAt(t);return a.object=e,a.computed=r,r?(a.property=this.parseExpression(),this.expect(1)):this.match(134)?(e.type===`Super`&&this.raise(g.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),n.optionalChainMember?(a.optional=i,this.finishNode(a,`OptionalMemberExpression`)):this.finishNode(a,`MemberExpression`)}parseBind(e,t,n){let r=this.startNodeAt(t);r.object=e,this.next();let i=this.match(79),a=this.parseNoCallExpr();if(a.type===`Super`||i&&a.type===`ImportExpression`||a.type===`Import`)throw this.raise(g.UnsupportedBindRHS,a);return r.callee=a,n.stop=!0,this.parseSubscripts(this.finishNode(r,`BindExpression`),t,!1)}parseCoverCallAndAsyncArrowHead(e,t,n,r){let i=null;this.next();let a=this.startNodeAt(t);a.callee=e;let{maybeAsyncArrow:o,optionalChainMember:s}=n;o&&(this.expressionScope.enter(Yt()),i=new en),s&&(a.optional=r),a.arguments=r?this.parseCallExpressionArguments():this.parseCallExpressionArguments(e.type!==`Super`,a,i);let c=this.finishCallExpression(a,s);return o&&this.shouldParseAsyncArrow()&&!r?(n.stop=!0,this.checkDestructuringPrivate(i),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),c)):(o&&(this.checkExpressionErrors(i,!0),this.expressionScope.exit()),this.toReferencedList(a.arguments)),c}parseTaggedTemplateExpression(e,t,n){let r=this.startNodeAt(t);return r.tag=e,r.quasi=this.parseTemplate(!0),n.optionalChainMember&&this.raise(g.OptionalChainingNoTemplate,t),this.finishNode(r,`TaggedTemplateExpression`)}atPossibleAsyncArrow(e){return e.type===`Identifier`&&e.name===`async`&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.state.canStartArrow}finishCallExpression(e,t){if(e.callee.type===`Import`){if(e.arguments.length===0||e.arguments.length>2)this.raise(g.ImportCallArity,e);else for(let t of e.arguments)t.type===`SpreadElement`&&this.raise(g.ImportCallSpreadArgument,t)}return this.finishNode(e,t?`OptionalCallExpression`:`CallExpression`)}parseCallExpressionArguments(e,t,n){let r=[],i=!0;for(;!this.eat(7);){if(i)i=!1;else if(this.expect(8),this.match(7)){t&&this.addTrailingCommaExtraToNode(t),this.next();break}r.push(this.parseExprListItem(7,!1,n,e))}return r}shouldParseAsyncArrow(){return this.match(15)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){return this.resetPreviousNodeTrailingComments(t),this.expect(15),this.parseArrowExpression(e,t.arguments,!0,t.extra?.trailingCommaLoc),t.innerComments&&Et(e,t.innerComments),t.callee.trailingComments&&Et(e,t.callee.trailingComments),e}parseNoCallExpr(){let e=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,!0)}parseExprAtom(e){let t,n=null,{type:r}=this.state;switch(r){case 75:return this.parseSuper();case 79:return t=this.startNode(),this.next(),this.match(12)?this.parseImportMetaPropertyOrPhaseCall(t):this.match(6)?this.optionFlags&1024?this.parseImportCall(t):this.finishNode(t,`Import`):(this.raise(g.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,`Import`));case 74:return t=this.startNode(),this.next(),this.finishNode(t,`ThisExpression`);case 86:return this.parseDo(this.startNode(),!1);case 52:case 27:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 131:return this.parseNumericLiteral(this.state.value);case 132:return this.parseBigIntLiteral(this.state.value);case 130:return this.parseStringLiteral(this.state.value);case 80:return this.parseNullLiteral();case 81:return this.parseBooleanLiteral(!0);case 82:return this.parseBooleanLiteral(!1);case 6:return this.parseParenAndDistinguishExpression(this.state.canStartArrow);case 0:return this.parseArrayLike(1,e);case 2:return this.parseObjectLike(4,!1,e);case 64:return this.parseFunctionOrFunctionSent();case 22:n=this.parseDecorators();case 76:return this.parseClass(this.maybeTakeDecorators(n,this.startNode()),!1);case 73:return this.parseNewOrNewTarget();case 21:case 20:return this.parseTemplate(!1);case 11:{t=this.startNode(),this.next(),t.object=null;let e=t.callee=this.parseNoCallExpr();if(e.type===`MemberExpression`)return this.finishNode(t,`BindExpression`);throw this.raise(g.UnsupportedBind,e)}case 134:return this.raise(g.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 29:return this.parseTopicReferenceThenEqualsSign(50,`%`);case 28:return this.parseTopicReferenceThenEqualsSign(40,`^`);case 33:case 34:return this.parseTopicReference(`hack`);case 40:case 50:case 23:{let e=this.getPluginOption(`pipelineOperator`,`proposal`);if(e)return this.parseTopicReference(e);throw this.unexpected()}case 43:{let e=this.input.codePointAt(this.nextTokenStart());throw M(e)||e===62?this.expectOnePlugin([`jsx`,`flow`,`typescript`]):this.unexpected()}default:if(D(r)){if(this.isContextual(123)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let{canStartArrow:e,containsEsc:t}=this.state,n=this.parseIdentifier();if(!t&&n.name===`async`&&!this.canInsertSemicolon()){let{type:t}=this.state;if(t===64)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(D(t))return e&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(t===86)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return e&&this.match(15)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}throw this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){let n=this.getPluginOption(`pipelineOperator`,`proposal`);if(n)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=u(this.state.endLoc,-1),this.parseTopicReference(n);throw this.unexpected()}parseTopicReference(e){let t=this.startNode(),n=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(t,n,e,r)}finishTopicReference(e,t,n,r){if(this.testTopicReferenceConfiguration(n,t,r))return this.topicReferenceIsAllowedInCurrentContext()||this.raise(g.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,`TopicReference`);throw this.raise(g.PipeTopicUnconfiguredToken,t,{token:A(r)})}testTopicReferenceConfiguration(e,t,n){if(e===`hack`)return this.hasPlugin([`pipelineOperator`,{topicToken:A(n)}]);throw this.raise(g.PipeTopicRequiresHackPipes,t)}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(Qt(!0,this.prodParam.hasYield));let t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(g.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(15),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin(`doExpressions`),t&&this.expectPlugin(`asyncDoExpressions`),e.async=t,this.next();let n=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=n,this.finishNode(e,`DoExpression`)}parseSuper(){let e=this.startNode();return this.next(),this.match(6)&&!this.scope.allowDirectSuper?this.raise(g.SuperNotAllowed,e):this.scope.allowSuper||this.raise(g.UnexpectedSuper,e),!this.match(6)&&!this.match(0)&&!this.match(12)&&this.raise(g.UnsupportedSuper,e),this.finishNode(e,`Super`)}parsePrivateName(){let e=this.startNode(),t=this.startNodeAt(u(this.state.startLoc,1)),n=this.state.value;return this.next(),e.id=this.createIdentifier(t,n),this.finishNode(e,`PrivateName`)}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`function`);return this.next(),this.match(99)?this.expectPlugin(`functionSent`):this.hasPlugin(`functionSent`)||this.unexpected(),this.parseMetaProperty(e,t,`sent`)}return this.parseFunction(e)}parseMetaProperty(e,t,n){e.meta=t;let r=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==n||r)&&this.raise(g.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:n}),this.finishNode(e,`MetaProperty`)}parseImportMetaPropertyOrPhaseCall(e){if(this.next(),this.isContextual(101)||this.isContextual(93)){let t=this.isContextual(101);return this.expectPlugin(t?`sourcePhaseImports`:`deferredImportEvaluation`),this.next(),e.phase=t?`source`:`defer`,this.parseImportCall(e)}{let t=this.createIdentifierAt(this.startNodeAtNode(e),`import`,this.state.lastTokStartLoc);return this.isContextual(97)&&(this.inModule||this.raise(g.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0),this.parseMetaProperty(e,t,`meta`)}}parseLiteralAtNode(e,t,n){return this.addExtra(n,`rawValue`,e),this.addExtra(n,`raw`,this.input.slice(this.offsetToSourcePos(n.start),this.state.end)),n.value=e,this.next(),this.finishNode(n,t)}parseLiteral(e,t){let n=this.startNode();return this.parseLiteralAtNode(e,t,n)}parseStringLiteral(e){return this.parseLiteral(e,`StringLiteral`)}parseNumericLiteral(e){return this.parseLiteral(e,`NumericLiteral`)}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}return this.parseLiteral(t,`BigIntLiteral`)}parseRegExpLiteral(e){let t=this.startNode();return this.addExtra(t,`raw`,this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,`RegExpLiteral`)}parseBooleanLiteral(e){let t=this.startNode();return t.value=e,this.next(),this.finishNode(t,`BooleanLiteral`)}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,`NullLiteral`)}parseParenAndDistinguishExpression(e){let t=this.state.startLoc,n;this.next(),this.expressionScope.enter(Jt());let r=this.state.startLoc,i=[],a=new en,o=!0,s,c;for(;!this.match(7);){if(o)o=!1;else if(this.expect(8,a.optionalParametersLoc===null?null:a.optionalParametersLoc),this.match(7)){c=this.state.startLoc;break}if(this.match(17)){let e=this.state.startLoc;if(s=this.state.startLoc,i.push(this.parseParenItem(this.parseRestBinding(),e)),!this.checkCommaAfterRest(41))break}else i.push(this.parseMaybeAssignAllowInOrVoidPattern(7,a,this.parseParenItem))}let l=this.state.lastTokEndLoc;this.expect(7);let u=this.startNodeAt(t);return e&&this.shouldParseArrow(i)&&(u=this.parseArrow(u))?(this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(u,i,!1),u):(this.expressionScope.exit(),i.length||this.unexpected(this.state.lastTokStartLoc),c&&this.unexpected(c),s&&this.unexpected(s),this.checkExpressionErrors(a,!0),this.toReferencedList(i,!0),i.length>1?(n=this.startNodeAt(r),n.expressions=i,this.finishNode(n,`SequenceExpression`),this.resetEndLocation(n,l)):n=i[0],this.wrapParenthesis(t,n))}wrapParenthesis(e,t){if(!(this.optionFlags&2048))return this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;let n=this.startNodeAt(e);return n.expression=t,this.finishNode(n,`ParenthesizedExpression`)}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(15))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`new`);this.next();let n=this.parseMetaProperty(e,t,`target`);return this.scope.allowNewTarget||this.raise(g.UnexpectedNewTarget,n),n}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(6)){let t=this.parseExprList(7);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,`NewExpression`)}parseNewCallee(e){let t=this.match(79),n=this.parseNoCallExpr();e.callee=n,t&&n.type===`ImportExpression`&&this.raise(g.ImportCallNotNewExpression,n,n),n.type===`Import`&&this.raise(g.ImportCallNotNewExpression,n),n.type===`Super`&&this.raise(g.SuperCallNotNewExpression,n)}parseTemplateElement(e){let{start:t,startLoc:n,end:r,value:i}=this.state,a=t+1,o=this.startNodeAt(u(n,1));i===null&&(e||this.raise(g.InvalidEscapeSequenceTemplate,u(this.state.firstInvalidTemplateEscapePos,1)));let s=this.match(20),c=s?-1:-2,l=r+c;o.value={raw:this.input.slice(a,l).replace(/\r\n?/g,`
8
+ `),cooked:i===null?null:i.slice(1,c)},o.tail=s,this.next();let d=this.finishNode(o,`TemplateElement`);return this.resetEndLocation(d,u(this.state.lastTokEndLoc,c)),d}parseTemplate(e){let t=this.startNode(),n=this.parseTemplateElement(e),r=[n],i=[];for(;!n.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(n=this.parseTemplateElement(e));return t.expressions=i,t.quasis=r,this.finishNode(t,`TemplateLiteral`)}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,n){let r=!1,i=!0,a=this.startNode();for(a.properties=[],this.next();!this.match(e);){if(i)i=!1;else if(this.expect(8),this.match(e)){this.addTrailingCommaExtraToNode(a);break}let o;t?o=this.parseBindingProperty():(o=this.parsePropertyDefinition(n),r=this.checkProto(o,r,n)),a.properties.push(o)}this.next();let o=t?`ObjectPattern`:`ObjectExpression`;return this.finishNode(a,o)}addTrailingCommaExtraToNode(e){this.addExtra(e,`trailingComma`,this.state.lastTokStartLoc.index),this.addExtra(e,`trailingCommaLoc`,this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&e.key.type===`Identifier`&&(this.isLiteralPropertyName()||this.match(0)||this.match(51))}parsePropertyDefinition(e){let t=[];if(this.match(22))for(this.hasPlugin(`decorators`)&&this.raise(g.UnsupportedPropertyDecorator,this.state.startLoc);this.match(22);)t.push(this.parseDecorator());let n=this.startNode(),r=!1,i=!1,a;if(this.match(17))return t.length&&this.unexpected(),this.parseSpread();t.length&&(n.decorators=t),n.method=!1,e&&(a=this.state.startLoc);let o=this.eat(51);this.parsePropertyNamePrefixOperator(n);let s=this.state.containsEsc;if(this.parsePropertyName(n,e),!o&&!s&&this.maybeAsyncOrAccessorProp(n)){let{key:e}=n,t=e.name;t===`async`&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(e),o=this.eat(51),this.parsePropertyName(n)),(t===`get`||t===`set`)&&(i=!0,this.resetPreviousNodeTrailingComments(e),n.kind=t,this.match(51)&&(o=!0,this.raise(g.AccessorIsGenerator,this.state.curPosition(),{kind:t}),this.next()),this.parsePropertyName(n))}return this.parseObjPropValue(n,a,o,r,!1,i,e)}getGetterSetterExpectedParamCount(e){return e.kind===`get`?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){let t=this.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e);n.length!==t&&this.raise(e.kind===`get`?g.BadGetterArity:g.BadSetterArity,e),e.kind===`set`&&n[n.length-1]?.type===`RestElement`&&this.raise(g.BadSetterRestParameter,e)}parseObjectMethod(e,t,n,r,i){if(i){let n=this.parseMethod(e,t,!1,!1,!1,`ObjectMethod`);return this.checkGetterSetterParams(n),n}if(n||t||this.match(6))return r&&this.unexpected(),e.kind=`method`,e.method=!0,this.parseMethod(e,t,n,!1,!1,`ObjectMethod`)}parseObjectProperty(e,t,n,r){if(e.shorthand=!1,this.eat(10))return e.value=n?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(4,r),this.finishObjectProperty(e);if(!e.computed&&e.key.type===`Identifier`){if(this.checkReservedWord(e.key.name,e.key.start,!0,!1),n)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(25)){let n=this.state.startLoc;r==null?this.raise(g.InvalidCoverInitializedName,n):r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,`ObjectProperty`)}parseObjPropValue(e,t,n,r,i,a,o){let s=this.parseObjectMethod(e,n,r,i,a)||this.parseObjectProperty(e,t,i,o);return s||this.unexpected(),s}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(1);else{let{type:n,value:r}=this.state,i;if(O(n))i=this.parseIdentifier(!0);else switch(n){case 131:i=this.parseNumericLiteral(r);break;case 130:i=this.parseStringLiteral(r);break;case 132:i=this.parseBigIntLiteral(r);break;case 134:{let e=this.state.startLoc;t==null?this.raise(g.UnexpectedPrivateField,e):t.privateKeyLoc===null&&(t.privateKeyLoc=e),i=this.parsePrivateName();break}default:this.unexpected()}e.key=i,n!==134&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,n,r,i,a,o=!1){this.initFunction(e,n),e.generator=t,this.scope.enter(530|(o?576:0)|(i?32:0)),this.prodParam.enter(Qt(n,e.generator)),this.parseFunctionParams(e,r);let s=this.parseFunctionBodyAndFinish(e,a,!0);return this.prodParam.exit(),this.scope.exit(),s}parseArrayLike(e,t){let n=this.startNode();return this.next(),n.elements=this.parseExprList(e,!0,t,n),this.finishNode(n,`ArrayExpression`)}parseArrowExpression(e,t,n,r){this.scope.enter(518);let i=Qt(n,!1);return this.match(2)||(i|=this.prodParam.currentFlags()&24),this.prodParam.enter(i),this.initFunction(e,n),t&&this.setArrowFunctionParameters(e,t,r),this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`ArrowFunctionExpression`)}setArrowFunctionParameters(e,t,n){this.toAssignableList(t,n,!1),e.params=t}parseFunctionBodyAndFinish(e,t,n=!1){return this.parseFunctionBody(e,!1,n),this.finishNode(e,t)}parseFunctionBody(e,t,n=!1){let r=t&&!this.match(2);if(this.expressionScope.enter(Xt()),r)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let r=this.state.strict,i=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,i=>{let a=!this.isSimpleParamList(e.params);i&&a&&this.raise(g.IllegalLanguageModeDirective,(e.kind===`method`||e.kind===`constructor`)&&e.key?this.optionFlags&256?e.key.loc.end:e.key:e);let o=!r&&this.state.strict;this.checkParams(e,!this.state.strict&&!t&&!n&&!a,t,o),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,o)}),this.prodParam.exit(),this.state.labels=i}this.expressionScope.exit()}isSimpleParameter(e){return e.type===`Identifier`}isSimpleParamList(e){for(let t=0,n=e.length;t<n;t++)if(!this.isSimpleParameter(e[t]))return!1;return!0}checkParams(e,t,n,r=!0){let i=!t&&new Set,a={type:`FormalParameters`};for(let t of e.params)this.checkLVal(t,a,5,i,r)}parseExprList(e,t,n,r){let i=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(8),this.match(e)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(e,t,n))}return i}parseExprListItem(e,t,n,r){let i;if(this.match(8))t||this.raise(g.UnexpectedToken,this.state.curPosition(),{unexpected:`,`}),i=null;else if(this.match(17)){let e=this.state.startLoc;i=this.parseParenItem(this.parseSpread(n),e)}else if(this.match(13)){this.expectPlugin(`partialApplication`),r||this.raise(g.UnexpectedArgumentPlaceholder,this.state.startLoc);let e=this.startNode();this.next(),i=this.finishNode(e,`ArgumentPlaceholder`)}else i=this.parseMaybeAssignAllowInOrVoidPattern(e,n,this.parseParenItem);return i}parseIdentifier(e){let t=this.startNode(),n=this.parseIdentifierName(e);return this.createIdentifier(t,n)}createIdentifier(e,t){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNode(e,`Identifier`)}createIdentifierAt(e,t,n){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNodeAt(e,`Identifier`,n)}parseIdentifierName(e){let t,{start:n,type:r}=this.state;O(r)?t=this.state.value:this.unexpected();let i=Se(r);return e?i&&this.replaceToken(128):this.checkReservedWord(t,this.sourceToOffsetPos(n),i,!1),this.next(),t}checkReservedWord(e,t,n,r){if(!(e.length>10||!rt(e))){if(n&&et(e)){this.raise(g.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?r?$e:Ze:Xe)(e,this.inModule)){this.raise(g.UnexpectedReservedWord,t,{reservedWord:e});return}if(e===`yield`){if(this.prodParam.hasYield){this.raise(g.YieldBindingIdentifier,t);return}}else if(e===`await`){if(this.prodParam.hasAwait){this.raise(g.AwaitBindingIdentifier,t);return}if(this.scope.inStaticBlock){this.raise(g.AwaitBindingIdentifierInStaticBlock,t);return}this.expressionScope.recordAsyncArrowParametersError(t)}else if(e===`arguments`&&this.scope.inClassAndNotInNonArrowFunction){this.raise(g.ArgumentsInClass,t);return}}}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e,t){let n=e.index;this.setLoc(e);let r=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(g.AwaitExpressionFormalParameter,n),this.eat(51)&&this.raise(g.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),t||(r.argument=this.parseMaybeUnary(null,!0)),this.finishNode(r,`AwaitExpression`)}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return e===49||e===6||e===0||Ie(e)||e===98&&!this.state.containsEsc||e===133||e===52||this.hasPlugin(`v8intrinsic`)&&e===50}parseYield(e){this.setLoc(e);let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(g.YieldInParameter,e.index);let n=!1,r=null;if(!this.hasPrecedingLineBreak())switch(n=this.eat(51),this.state.type){case 9:case 135:case 4:case 7:case 1:case 5:case 10:case 8:if(!n)break;default:r=this.parseMaybeAssign()}return t.delegate=n,t.argument=r,this.finishNode(t,`YieldExpression`)}parseImportCall(e){this.next();let t=this.parseCallExpressionArguments();if(t.length===0||t.length>2)this.raise(g.ImportCallArity,e,e);else for(let n of t)n.type===`SpreadElement`&&this.raise(g.ImportCallSpreadArgument,n,e);return e.source=t[0],e.options=t[1]??null,this.finishNode(e,`ImportExpression`)}withTopicBindingContext(e){let t=this.state.inHackPipelineBody;this.state.inHackPipelineBody=!0;let n=this.state.seenTopicReference;this.state.seenTopicReference=!1;try{return e()}finally{this.state.inHackPipelineBody=t,this.state.seenTopicReference=n}}allowInAnd(e){let t=this.prodParam.currentFlags();if(24&~t){this.prodParam.enter(t|24);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags(),n=8&t,r=16&~t;if(n||r){this.prodParam.enter(t&-9|16);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.seenTopicReference=!0}topicReferenceIsAllowedInCurrentContext(){return this.state.inHackPipelineBody}topicReferenceWasUsedInCurrentContext(){return this.state.seenTopicReference}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.prodParam.enter(this.prodParam.currentFlags()&-17);let n;if(this.isContextual(92)&&this.recordAwaitIfAllowed()){this.next(),n=this.parseAwait(t,!0);let e=this.state.type;ke(e)&&e!==35&&(this.prodParam.hasIn||e!==54)&&this.raise(g.PipelineUnparenthesized,t)}else this.state.canStartArrow=!0,n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.prodParam.exit(),n}parseModuleExpression(){this.expectPlugin(`moduleBlocks`);let e=this.startNode();this.next(),this.match(2)||this.unexpected(null,2);let t=this.startNodeAt(this.state.endLoc);this.next();let n=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,4,`module`)}finally{n()}return this.finishNode(e,`ModuleExpression`)}parseVoidPattern(e){this.expectPlugin(`discardBinding`);let t=this.startNode();return e!=null&&(e.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(t,`VoidPattern`)}parseMaybeAssignAllowInOrVoidPattern(e,t,n){if(t!=null&&this.match(84)){let n=this.lookaheadCharCode();if(n===44||n===(e===1?93:e===4?125:41)||n===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(t))}return this.parseMaybeAssignAllowIn(t,n)}parsePropertyNamePrefixOperator(e){}},sn={kind:1},cn={kind:2},ln=/[\uD800-\uDFFF]/u,un=/in(?:stanceof)?/y;function dn(e){for(let t=0;t<e.length;t++){let n=e[t],{type:r}=n;typeof r==`number`&&(n.type=Le(r))}return e}var fn=class extends on{parseTopLevel(e,t){return e.program=this.parseProgram(t,135,this.options.sourceType===`module`?`module`:`script`),e.comments=this.comments,this.optionFlags&512&&(e.tokens=dn(this.tokens)),this.finishNode(e,`File`)}parseProgram(e,t,n){if(e.sourceType=n,e.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(e,!0,!0,t),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[e,t]of Array.from(this.scope.undefinedExports))this.raise(g.ModuleExportUndefined,t,{localName:e});this.addExtra(e,`topLevelAwait`,this.state.hasTopLevelAwait)}let r;return r=t===135?this.finishNode(e,`Program`):this.finishNodeAt(e,`Program`,u(this.state.startLoc,-1)),r}stmtToDirective(e){let t=this.castNodeTo(e,`Directive`),n=this.castNodeTo(e.expression,`DirectiveLiteral`),r=n.value,i=this.input.slice(this.offsetToSourcePos(n.start),this.offsetToSourcePos(n.end)),a=n.value=i.slice(1,-1);return this.addExtra(n,`raw`,i),this.addExtra(n,`rawValue`,a),this.addExtra(n,`expressionValue`,r),t.value=n,delete e.expression,t}parseInterpreterDirective(){if(!this.match(24))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,`InterpreterDirective`)}isLet(){return this.isContextual(96)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(103)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(103))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,`of`)){let t=this.lookaheadCharCodeSince(e+2);if(t!==61&&t!==58&&t!==59)return!1}return!!(this.chStartsBindingIdentifier(t,e)||this.isUnparsedContextual(e,`void`))}nextTokenIsIdentifierOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isAwaitUsing(){if(!this.isContextual(92))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,`using`)){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return!0}return!1}chStartsBindingIdentifier(e,t){if(M(e)){if(un.lastIndex=t,un.test(this.input)){let e=this.codePointAtPos(un.lastIndex);if(!N(e)&&e!==92)return!1}return!0}return e===92}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===123||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(22)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let n=this.state.type,r=this.startNode(),i=!!(e&2),a=!!(e&4),o=e&1;switch(n){case 56:return this.parseBreakContinueStatement(r,!0);case 59:return this.parseBreakContinueStatement(r,!1);case 60:return this.parseDebuggerStatement(r);case 86:return this.parseDoWhileStatement(r);case 87:return this.parseForStatement(r);case 64:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?g.StrictFunction:this.options.annexB?g.SloppyFunctionAnnexB:g.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 76:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,r),!0);case 65:return this.parseIfStatement(r);case 66:return this.parseReturnStatement(r);case 67:return this.parseSwitchStatement(r);case 68:return this.parseThrowStatement(r);case 69:return this.parseTryStatement(r);case 92:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(g.AwaitUsingNotInAsyncContext,r):this.raise(g.UnexpectedLexicalDeclaration,r):this.raise(g.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,`await using`);break;case 103:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(g.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(g.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,`using`);case 96:{if(this.state.containsEsc)break;let e=this.nextTokenStart(),t=this.codePointAtPos(e);if(t!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(t,e)&&t!==123))break}case 71:i||this.raise(g.UnexpectedLexicalDeclaration,this.state.startLoc);case 70:{let e=this.state.value;return this.parseVarStatement(r,e)}case 88:return this.parseWhileStatement(r);case 72:return this.parseWithStatement(r);case 2:return this.parseBlock();case 9:return this.parseEmptyStatement(r);case 79:{let e=this.lookaheadCharCode();if(e===40||e===46)break}case 78:{!(this.optionFlags&8)&&!o&&this.raise(g.UnexpectedImportExport,this.state.startLoc),this.next();let e;return e=n===79?this.parseImport(r):this.parseExport(r,t),this.assertModuleNodeAllowed(e),e}default:if(this.isAsyncFunction())return i||this.raise(g.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let s=this.state.value,c=this.parseExpression();return D(n)&&c.type===`Identifier`&&this.eat(10)?this.parseLabeledStatement(r,s,c,e):this.parseExpressionStatement(r,c,t)}assertModuleNodeAllowed(e){!(this.optionFlags&8)&&!this.inModule&&this.raise(g.ImportOutsideModule,e)}maybeTakeDecorators(e,t,n){return e&&(t.decorators?.length?(this.raise(g.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),n&&this.resetStartLocationFromNode(n,t)),t}canHaveLeadingDecorator(){return this.match(76)}parseDecorators(e){let t=[];do t.push(this.parseDecorator());while(this.match(22));if(this.match(78))e||this.unexpected();else if(!this.canHaveLeadingDecorator())throw this.raise(g.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin([`decorators`,`decorators-legacy`]);let e=this.startNode();if(this.next(),this.hasPlugin(`decorators`)){let t=this.state.startLoc,n;if(this.match(6)){let t=this.state.startLoc;this.next(),n=this.parseExpression(),this.expect(7),n=this.wrapParenthesis(t,n);let r=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(n,t),e.expression!==n&&this.raise(g.DecoratorArgumentsOutsideParentheses,r)}else{for(n=this.parseIdentifier(!1);this.eat(12);){let e=this.startNodeAt(t);e.object=n,this.match(134)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),e.property=this.parsePrivateName()):e.property=this.parseIdentifier(!0),e.computed=!1,n=this.finishNode(e,`MemberExpression`)}e.expression=this.parseMaybeDecoratorArguments(n,t)}}else this.state.canStartArrow=!1,e.expression=this.parseExprSubscripts();return this.finishNode(e,`Decorator`)}parseMaybeDecoratorArguments(e,t){if(this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.toReferencedList(n.arguments),this.finishNode(n,`CallExpression`)}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?`BreakStatement`:`ContinueStatement`)}verifyBreakContinue(e,t){let n;for(n=0;n<this.state.labels.length;++n){let r=this.state.labels[n];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(t||r.kind===1)||e.label&&t))break}if(n===this.state.labels.length){let n=t?`BreakStatement`:`ContinueStatement`;this.raise(g.IllegalBreakContinue,e,{type:n})}}parseDebuggerStatement(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)}parseHeaderExpression(){this.expect(6);let e=this.parseExpression();return this.expect(7),e}parseDoWhileStatement(e){return this.next(),this.state.labels.push(sn),e.body=this.parseStatement(),this.state.labels.pop(),this.expect(88),e.test=this.parseHeaderExpression(),this.eat(9),this.finishNode(e,`DoWhileStatement`)}parseForStatement(e){this.next(),this.state.labels.push(sn);let t=null;if(this.isContextual(92)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(6),this.match(9))return t!==null&&this.unexpected(t),this.parseFor(e,null);let n=this.isContextual(96);{let r=this.isAwaitUsing(),i=r||this.isForUsing(),a=n&&this.hasFollowingBindingAtom()||i;if(this.match(70)||this.match(71)||a){let n=this.startNode(),a;r?(a=`await using`,this.recordAwaitIfAllowed()||this.raise(g.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):a=this.state.value,this.next(),this.parseVar(n,!0,a);let o=this.finishNode(n,`VariableDeclaration`),s=this.match(54);return s&&i&&this.raise(g.ForInUsing,o),(s||this.isContextual(98))&&o.declarations.length===1?this.parseForIn(e,o,t):(t!==null&&this.unexpected(t),this.parseFor(e,o))}}let r=this.isContextual(91),i=new en,a=this.parseExpression(!0,i),o=this.isContextual(98);if(o&&(n&&this.raise(g.ForOfLet,a),t===null&&r&&a.type===`Identifier`&&this.raise(g.ForOfAsync,a)),o||this.match(54)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let n=o?`ForOfStatement`:`ForInStatement`;return this.checkLVal(a,{type:n}),this.parseForIn(e,a,t)}return this.checkExpressionErrors(i,!0),t!==null&&this.unexpected(t),this.parseFor(e,a)}parseFunctionStatement(e,t,n){return this.next(),this.parseFunction(e,1|(n?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(62)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,`IfStatement`)}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(g.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t=e.cases=[];this.expect(2),this.state.labels.push(cn),this.scope.enter(256);let n;for(let e;!this.match(4);)if(this.match(57)||this.match(61)){let r=this.match(57);n&&this.finishNode(n,`SwitchCase`),t.push(n=this.startNode()),n.consequent=[],this.next(),r?n.test=this.parseExpression():(e&&this.raise(g.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),e=!0,n.test=null),this.expect(10)}else n?n.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),n&&this.finishNode(n,`SwitchCase`),this.next(),this.state.labels.pop(),this.finishNode(e,`SwitchStatement`)}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(g.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type===`Identifier`?8:0),this.checkLVal(e,{type:`CatchClause`},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(58)){let t=this.startNode();this.next(),this.match(6)?(this.expect(6),t.param=this.parseCatchClauseParam(),this.expect(7)):(t.param=null,this.scope.enter(0)),t.body=this.parseBlock(!1,!1),this.scope.exit(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(63)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(g.NoCatchOrFinally,e),this.finishNode(e,`TryStatement`)}parseVarStatement(e,t,n=!1){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(sn),e.body=this.parseStatement(),this.state.labels.pop(),this.finishNode(e,`WhileStatement`)}parseWithStatement(e){return this.state.strict&&this.raise(g.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.parseStatement(),this.finishNode(e,`WithStatement`)}parseEmptyStatement(e){return this.next(),this.finishNode(e,`EmptyStatement`)}parseLabeledStatement(e,t,n,r){for(let e of this.state.labels)e.name===t&&this.raise(g.LabelRedeclaration,n,{labelName:t});let i=De(this.state.type)?1:this.match(67)?2:null;for(let t=this.state.labels.length-1;t>=0;t--){let n=this.state.labels[t];if(n.statementStart===e.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:t,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)}parseExpressionStatement(e,t,n){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)}parseBlock(e=!1,t=!0,n){let r=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(2),t&&this.scope.enter(0),this.parseBlockBody(r,e,!1,4,n),t&&this.scope.exit(),this.finishNode(r,`BlockStatement`)}isValidDirective(e){return e.type===`ExpressionStatement`&&e.expression.type===`StringLiteral`&&!e.expression.extra.parenthesized}parseBlockBody(e,t,n,r,i){let a=e.body=[],o=e.directives=[];this.parseBlockOrModuleBlockBody(a,t?o:void 0,n,r,i)}parseBlockOrModuleBlockBody(e,t,n,r,i){let a=this.state.strict,o=!1,s=!1;for(;!this.match(r);){let r=n?this.parseModuleItem():this.parseStatementListItem();if(t&&!s){if(this.isValidDirective(r)){let e=this.stmtToDirective(r);t.push(e),!o&&e.value.value===`use strict`&&(o=!0,this.setStrict(!0));continue}s=!0,this.state.strictErrors.clear()}e.push(r)}i?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(9)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(7)?null:this.parseExpression(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,`ForStatement`)}parseForIn(e,t,n){let r=this.match(54);return this.next(),r?n!==null&&this.unexpected(n):e.await=n!==null,t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(g.ForInOfLoopInitializer,t,{type:r?`ForInStatement`:`ForOfStatement`}),t.type===`AssignmentPattern`&&this.raise(g.InvalidLhs,t,{ancestor:{type:`ForStatement`}}),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,r?`ForInStatement`:`ForOfStatement`)}parseVar(e,t,n,r=!1){let i=e.declarations=[];for(e.kind=n;;){let e=this.startNode();if(this.parseVarId(e,n),e.init=this.eat(25)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,e.init===null&&!r&&(e.id.type!==`Identifier`&&!(t&&(this.match(54)||this.isContextual(98)))?this.raise(g.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:`destructuring`}):(n===`const`||n===`using`||n===`await using`)&&!(this.match(54)||this.isContextual(98))&&this.raise(g.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:n})),i.push(this.finishNode(e,`VariableDeclarator`)),!this.eat(8))break}return e}parseVarId(e,t){let n=this.parseBindingAtom();t===`using`||t===`await using`?(n.type===`ArrayPattern`||n.type===`ObjectPattern`)&&this.raise(g.UsingDeclarationHasBindingPattern,n):n.type===`VoidPattern`&&this.raise(g.UnexpectedVoidPattern,n),this.checkLVal(n,{type:`VariableDeclarator`},t===`var`?5:8201),e.id=n}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let n=t&2,r=!!(t&1),i=r&&!(t&4),a=!!(t&8);return this.initFunction(e,a),this.match(51)&&(n&&this.raise(g.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),r&&(e.id=this.parseFunctionId(i)),this.scope.enter(514),this.prodParam.enter(Qt(a,e.generator)),r||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.parseFunctionBodyAndFinish(e,r?`FunctionDeclaration`:`FunctionExpression`),this.prodParam.exit(),this.scope.exit(),r&&!n&&this.registerFunctionStatementId(e),e}parseFunctionId(e){return e||D(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(6),this.expressionScope.enter(qt()),e.params=this.parseBindingList(7,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.start)}parseClass(e,t,n){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,n),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,r),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)}isClassProperty(){return this.match(25)||this.match(9)||this.match(4)}isClassMethod(){return this.match(6)}nameIsConstructor(e){return e.type===`Identifier`&&e.name===`constructor`||e.type===`StringLiteral`&&e.value===`constructor`}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let n={hadConstructor:!1,hadSuperClass:e},r=[],i=this.startNode();for(i.body=[],this.expect(2);!this.match(4);){if(this.eat(9)){if(r.length>0)throw this.raise(g.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(22)){r.push(this.parseDecorator());continue}let e=this.startNode();r.length&&(e.decorators=r,this.resetStartLocationFromNode(e,r[0]),r=[]),this.parseClassMember(i,e,n)}if(this.state.strict=t,this.next(),r.length)throw this.raise(g.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,`ClassBody`)}parseClassMemberFromModifier(e,t){let n=this.parseIdentifier(!0);if(this.isClassMethod()){let r=t;return r.kind=`method`,r.computed=!1,r.key=n,r.static=!1,this.pushClassMethod(e,r,!1,!1,!1,!1),!0}if(this.isClassProperty()){let r=t;return r.computed=!1,r.key=n,r.static=!1,e.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(n),!1}parseClassMember(e,t,n){let r=this.isContextual(102);if(r){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(2)){this.parseClassStaticBlock(e,t);return}}this.parseClassMemberWithIsStatic(e,t,n,r)}parseClassMemberWithIsStatic(e,t,n,r){let i=t,a=t,o=t,s=t,c=t,l=i,u=i;if(t.static=r,this.parsePropertyNamePrefixOperator(t),this.eat(51)){l.kind=`method`;let t=this.match(134);if(this.parseClassElementName(l),this.parsePostMemberNameModifiers(l),t){this.pushClassPrivateMethod(e,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(g.ConstructorIsGenerator,i.key),this.pushClassMethod(e,i,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&D(this.state.type),f=this.parseClassElementName(t),p=d?f.name:null,m=this.isPrivateName(f),ee=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(l.kind=`method`,m){this.pushClassPrivateMethod(e,a,!1,!1);return}let r=this.isNonstaticConstructor(i),o=!1;r&&(i.kind=`constructor`,i.decorators&&i.decorators.length>0&&this.raise(g.DecoratorConstructor,t),n.hadConstructor&&!this.hasPlugin(`typescript`)&&this.raise(g.DuplicateConstructor,f),r&&this.hasPlugin(`typescript`)&&t.override&&this.raise(g.OverrideOnConstructor,f),n.hadConstructor=!0,o=n.hadSuperClass),this.pushClassMethod(e,i,!1,!1,r,o)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o);else if(p===`async`&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);let t=this.eat(51);u.optional&&this.unexpected(ee),l.kind=`method`;let n=this.match(134);this.parseClassElementName(l),this.parsePostMemberNameModifiers(u),n?this.pushClassPrivateMethod(e,a,t,!0):(this.isNonstaticConstructor(i)&&this.raise(g.ConstructorIsAsync,i.key),this.pushClassMethod(e,i,t,!0,!1,!1))}else if((p===`get`||p===`set`)&&!(this.match(51)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),l.kind=p;let t=this.match(134);this.parseClassElementName(i),t?this.pushClassPrivateMethod(e,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(g.ConstructorIsAccessor,i.key),this.pushClassMethod(e,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(p===`accessor`&&!this.isLineTerminator()){this.expectPlugin(`decoratorAutoAccessors`),this.resetPreviousNodeTrailingComments(f);let t=this.match(134);this.parseClassElementName(o),this.pushClassAccessorProperty(e,c,t)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o):this.unexpected()}parseClassElementName(e){let{type:t,value:n}=this.state;if((t===128||t===130)&&e.static&&n===`prototype`&&this.raise(g.StaticPrototype,this.state.startLoc),t===134){n===`constructor`&&this.raise(g.ConstructorClassPrivateField,this.state.startLoc);let t=this.parsePrivateName();return e.key=t,t}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){this.scope.enter(720);let n=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=t.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,4),this.prodParam.exit(),this.scope.exit(),this.state.labels=n,e.body.push(this.finishNode(t,`StaticBlock`)),t.decorators?.length&&this.raise(g.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(g.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let n=this.parseClassPrivateProperty(t);e.body.push(n),this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.start)}pushClassAccessorProperty(e,t,n){!n&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(g.ConstructorClassField,t.key);let r=this.parseClassAccessorProperty(t);e.body.push(r),n&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.start)}pushClassMethod(e,t,n,r,i,a){e.body.push(this.parseMethod(t,n,r,i,a,`ClassMethod`,!0))}pushClassPrivateMethod(e,t,n,r){let i=this.parseMethod(t,n,r,!1,!1,`ClassPrivateMethod`,!0);e.body.push(i);let a=i.kind===`get`?i.static?6:2:i.kind===`set`?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassPrivateProperty`)}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassProperty`)}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassAccessorProperty`)}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(Xt()),this.prodParam.enter(0),e.value=this.eat(25)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,n,r=8331){if(D(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,r);else if(n||!t)e.id=null;else throw this.raise(g.MissingClassName,this.state.startLoc)}parseClassSuper(e){this.eat(77)?(this.state.canStartArrow=!1,e.superClass=this.parseExprSubscripts()):e.superClass=null}parseExport(e,t){let n=this.parseMaybeImportPhase(e,!0),r=this.maybeParseExportDefaultSpecifier(e,n),i=!r||this.eat(8),a=i&&this.eatExportStar(e),o=a&&this.maybeParseExportNamespaceSpecifier(e),s=i&&(!o||this.eat(8)),c=r||a;if(a&&!o){if(r&&this.unexpected(),t)throw this.raise(g.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,`ExportAllDeclaration`)}let l=this.maybeParseExportNamedSpecifiers(e);r&&i&&!a&&!l&&this.unexpected(null,2),o&&s&&this.unexpected(null,94);let u;if(c||l){if(u=!1,t)throw this.raise(g.UnsupportedDecoratorExport,e);this.parseExportFrom(e,c)}else u=this.maybeParseExportDeclaration(e);if(c||l||u){let n=e;if(this.checkExport(n,!0,!1,!!n.source),n.declaration?.type===`ClassDeclaration`)this.maybeTakeDecorators(t,n.declaration,n);else if(t)throw this.raise(g.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(n,`ExportNamedDeclaration`)}if(this.eat(61)){let n=e,r=this.parseExportDefaultExpression();if(n.declaration=r,r.type===`ClassDeclaration`)this.maybeTakeDecorators(t,r,n);else if(t)throw this.raise(g.UnsupportedDecoratorExport,e);return this.checkExport(n,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(n,`ExportDefaultDeclaration`)}throw this.unexpected(null,2)}eatExportStar(e){return this.eat(51)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin(`exportDefaultFrom`,t?.start);let n=t||this.parseIdentifier(!0),r=this.startNodeAtNode(n);return r.exported=n,e.specifiers=[this.finishNode(r,`ExportDefaultSpecifier`)],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(89)){e.specifiers??=[];let t=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),t.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(t,`ExportNamespaceSpecifier`)),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(2)){let t=e;t.specifiers||=[];let n=t.exportKind===`type`;return t.specifiers.push(...this.parseExportSpecifiers(n)),t.source=null,t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(91))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,`function`)}parseExportDefaultExpression(){let e=this.startNode();if(this.match(64))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(76))return this.parseClass(e,!0,!0);if(this.match(22))return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(71)||this.match(70)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(g.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(76)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(D(e)){if(e===91&&!this.state.containsEsc||e===96)return!1;if((e===126||e===125)&&!this.state.containsEsc){let e=this.nextTokenStart(),t=this.input.charCodeAt(e);if(t===123||this.chStartsBindingIdentifier(t,e)&&!this.input.startsWith(`from`,e))return this.expectOnePlugin([`flow`,`typescript`]),!1}}else if(!this.match(61))return!1;let t=this.nextTokenStart(),n=this.isUnparsedContextual(t,`from`);if(this.input.charCodeAt(t)===44||D(this.state.type)&&n)return!0;if(this.match(61)&&n){let e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return e===34||e===39}return!1}parseExportFrom(e,t){this.eatContextual(94)?(e.source=this.parseImportSource(),this.checkExport(e),this.maybeParseImportAttributes(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;return e===22&&(this.expectOnePlugin([`decorators`,`decorators-legacy`]),this.hasPlugin(`decorators`))?!0:this.isUsing()||this.isAwaitUsing()?(this.raise(g.UsingDeclarationExport,this.state.startLoc),!0):e===70||e===71||e===64||e===76||this.isLet()||this.isAsyncFunction()}checkExport(e,t,n,r){if(t){if(n){if(this.checkDuplicateExports(e,`default`),this.hasPlugin(`exportDefaultFrom`)){let t=e.declaration;t.type===`Identifier`&&t.name===`from`&&t.end-t.start===4&&!t.extra?.parenthesized&&this.raise(g.ExportDefaultFromAsIdentifier,t)}}else if(e.specifiers?.length)for(let t of e.specifiers){let{exported:e}=t,n=e.type===`Identifier`?e.name:e.value;if(this.checkDuplicateExports(t,n),!r&&t.local){let{local:e}=t;e.type===`Identifier`?(this.checkReservedWord(e.name,e.start,!0,!1),this.scope.checkLocalExport(e)):this.raise(g.ExportBindingIsString,t,{localName:e.value,exportName:n})}}else if(e.declaration){let t=e.declaration;if(t.type===`FunctionDeclaration`||t.type===`ClassDeclaration`){let{id:n}=t;if(!n)throw Error(`Assertion failure`);this.checkDuplicateExports(e,n.name)}else if(t.type===`VariableDeclaration`)for(let e of t.declarations)this.checkDeclaration(e.id)}}}checkDeclaration(e){if(e.type===`Identifier`)this.checkDuplicateExports(e,e.name);else if(e.type===`ObjectPattern`)for(let t of e.properties)this.checkDeclaration(t);else if(e.type===`ArrayPattern`)for(let t of e.elements)t&&this.checkDeclaration(t);else e.type===`ObjectProperty`?this.checkDeclaration(e.value):e.type===`RestElement`?this.checkDeclaration(e.argument):e.type===`AssignmentPattern`&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&(t==="default"?this.raise(g.DuplicateDefaultExport,e):this.raise(g.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],n=!0;for(this.expect(2);!this.eat(4);){if(n)n=!1;else if(this.expect(8),this.eat(4))break;let r=this.isContextual(126),i=this.match(130),a=this.startNode();a.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(a,i,e,r))}return t}parseExportSpecifier(e,t,n,r){return this.eatContextual(89)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||=this.cloneIdentifier(e.local),this.finishNode(e,`ExportSpecifier`)}parseModuleExportName(){if(this.match(130)){let e=this.parseStringLiteral(this.state.value),t=ln.exec(e.value);return t&&this.raise(g.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}checkImportPhase(e){let{specifiers:t}=e,n=t.length===1?t[0].type:null;e.phase===`source`?n!==`ImportDefaultSpecifier`&&this.raise(g.SourcePhaseImportRequiresDefault,t[0]):e.phase===`defer`&&n!==`ImportNamespaceSpecifier`&&this.raise(g.DeferImportRequiresNamespace,t[0])}isPotentialImportPhase(e){return e?!1:this.isContextual(101)||this.isContextual(93)}applyImportPhase(e,t,n,r){t||(n===`source`?(this.expectPlugin(`sourcePhaseImports`,r),e.phase=`source`):n===`defer`?(this.expectPlugin(`deferredImportEvaluation`,r),e.phase=`defer`):this.hasPlugin(`sourcePhaseImports`)&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let n=this.startNode(),r=this.parseIdentifierName(!0),{type:i}=this.state;return(O(i)?i!==94||this.lookaheadCharCode()===102:i!==8)?(this.applyImportPhase(e,t,r,n.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(n,r))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return D(t)?t!==94||this.lookaheadCharCode()===102:t!==8}parseImport(e){return this.match(130)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let n=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(8),r=n&&this.maybeParseStarImportSpecifier(e);return n&&!r&&this.parseNamedImportSpecifiers(e),this.expectContextual(94),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){return e.specifiers??=[],e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportPhase(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.match(130)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,n){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}finishImportSpecifier(e,t,n=8201){return this.checkLVal(e.local,{type:t},n),this.finishNode(e,t)}parseImportAttributes(){this.expect(2);let e=[],t=new Set;do{if(this.match(4))break;let n=this.startNode(),r=this.state.value;if(t.has(r)&&this.raise(g.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),t.add(r),n.key=this.match(130)?this.parseStringLiteral(r):this.parseIdentifier(!0),this.expect(10),!this.match(130))throw this.raise(g.ModuleAttributeInvalidValue,this.state.startLoc);n.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(n,`ImportAttribute`))}while(this.eat(8));return this.expect(4),e}maybeParseImportAttributes(e){let t;if(this.match(72)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),t=this.parseImportAttributes()}else t=[];e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishImportSpecifier(n,`ImportDefaultSpecifier`)),!0}return O(this.state.type)?(this.parseImportSpecifierLocal(e,this.startNode(),`ImportDefaultSpecifier`),!0):!1}maybeParseStarImportSpecifier(e){if(this.match(51)){let t=this.startNode();return this.next(),this.expectContextual(89),this.parseImportSpecifierLocal(e,t,`ImportNamespaceSpecifier`),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(2);!this.eat(4);){if(t)t=!1;else{if(this.eat(10))throw this.raise(g.DestructureNamedImport,this.state.startLoc);if(this.expect(8),this.eat(4))break}let n=this.startNode(),r=this.match(130),i=this.isContextual(126);n.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(n,r,e.importKind===`type`||e.importKind===`typeof`,i,void 0);e.specifiers.push(a)}}parseImportSpecifier(e,t,n,r,i){if(this.eatContextual(89))e.local=this.parseIdentifier();else{let{imported:n}=e;if(t)throw this.raise(g.ImportBindingIsString,e,{importName:n.value});this.checkReservedWord(n.name,e.start,!0,!0),e.local||=this.cloneIdentifier(n)}return this.finishImportSpecifier(e,`ImportSpecifier`,i)}isThisParam(e){return e.type===`Identifier`&&e.name===`this`}},pn=/in(?:stanceof)?|as|satisfies/y;function mn(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function hn(e){if(!e)throw Error(`Assert fail`)}var H=h`typescript`({AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:`An 'accessor' property cannot be declared optional.`,AccessorCannotDeclareThisParameter:`'get' and 'set' accessors cannot declare 'this' parameters.`,AccessorCannotHaveTypeParameters:`An accessor cannot have type parameters.`,ClassMethodHasDeclare:`Class methods cannot have the 'declare' modifier.`,ClassMethodHasReadonly:`Class methods cannot have the 'readonly' modifier.`,ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:`A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.`,ConstructorHasTypeParameters:`Type parameters cannot appear on a constructor declaration.`,DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:`Initializers are not allowed in ambient contexts.`,DeclareFunctionHasImplementation:`An implementation cannot be declared in ambient contexts.`,DecoratorAbstractMethod:({kind:e})=>`Decorators can't be used with ${e.startsWith(`a`)?`an`:`a`} ${e}.`,DuplicateAccessibilityModifier:({modifier:e})=>`Accessibility modifier already seen: '${e}'.`,DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyTypeArguments:`Type argument list cannot be empty.`,EmptyTypeParameters:`Type parameter list cannot be empty.`,ExpectedAmbientAfterExportDeclare:`'export declare' must be followed by an ambient declaration.`,ExportAssignmentInTSNamespace:`An export assignment cannot be used in a namespace.`,ExportInTSNamespace:`Export declarations are not permitted in a namespace.`,ImportAliasHasImportType:`An import alias can not use 'import type'.`,ImportInTSNamespace:`Import declarations in a namespace cannot reference a module.`,IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:`Index signatures cannot have the 'abstract' modifier.`,IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:`Index signatures cannot have the 'declare' modifier.`,IndexSignatureHasOverride:`'override' modifier cannot appear on an index signature.`,IndexSignatureHasStatic:`Index signatures cannot have the 'static' modifier.`,InitializerNotAllowedInAmbientContext:`Initializers are not allowed in ambient contexts.`,InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",InvalidHeritageClauseType:({token:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:e=>`'${e}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:e=>`'${e}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:`Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.`,InvalidTupleMemberLabel:`Tuple members must be labeled with a simple identifier.`,MissingInterfaceName:`'interface' declarations must be followed by an identifier.`,NamespaceExportInTSNamespace:`Global module exports may only appear at top level.`,NonAbstractClassHasAbstractMethod:`Abstract methods can only appear within an abstract class.`,NonClassMethodPropertyHasAbstractModifier:`'abstract' modifier can only appear on a class, method, or property declaration.`,OptionalTypeBeforeRequired:`A required element cannot follow an optional element.`,OverrideNotInSubClass:`This member cannot have an 'override' modifier because its containing class does not extend another class.`,PatternIsOptional:`A binding pattern parameter cannot be optional in an implementation signature.`,PrivateElementHasAbstract:`Private elements cannot have the 'abstract' modifier.`,PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:`'readonly' modifier can only appear on a property declaration or index signature.`,ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:`A 'set' accessor cannot have an optional parameter.`,SetAccessorCannotHaveRestParameter:`A 'set' accessor cannot have rest parameter.`,SetAccessorCannotHaveReturnType:`A 'set' accessor cannot have a return type annotation.`,SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:`Static class blocks cannot have any modifier.`,TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:`A type-only import can specify a default import or named bindings, but not both.`,TypeModifierIsUsedInTypeExports:`The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.`,TypeModifierIsUsedInTypeImports:`The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.`,UnexpectedParameterInitializer:`A parameter initializer is only allowed in a function or constructor implementation.`,UnexpectedParameterModifier:`A parameter property is only allowed in a constructor implementation.`,UnexpectedReadonly:`'readonly' type modifier is only permitted on array and tuple literal types.`,UnexpectedTypeAnnotation:`Did not expect a type annotation here.`,UnexpectedTypeCastInParameter:`Unexpected type cast in parameter position.`,UnexpectedTypeDeclaration:e=>`'${e}' declarations can only be declared inside a block.`,UnsupportedImportTypeArgument:`Argument in a type import must be a string literal.`,UnsupportedParameterPropertyKind:`A parameter property may not be declared using a binding pattern.`,UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,UsingDeclarationInAmbientContext:e=>`'${e}' declarations are not allowed in ambient contexts.`});function gn(e){switch(e){case`any`:return`TSAnyKeyword`;case`boolean`:return`TSBooleanKeyword`;case`bigint`:return`TSBigIntKeyword`;case`never`:return`TSNeverKeyword`;case`number`:return`TSNumberKeyword`;case`object`:return`TSObjectKeyword`;case`string`:return`TSStringKeyword`;case`symbol`:return`TSSymbolKeyword`;case`undefined`:return`TSUndefinedKeyword`;case`unknown`:return`TSUnknownKeyword`;default:return}}function _n(e){return e===`private`||e===`public`||e===`protected`}function vn(e){return e===`in`||e===`out`}function yn(e){if(e.extra?.parenthesized)return!1;switch(e.type){case`Identifier`:return!0;case`MemberExpression`:return!e.computed&&yn(e.object);case`TSInstantiationExpression`:return yn(e.expression);default:return!1}}var bn=e=>class extends e{getScopeHandler(){return St}tsIsIdentifier(){return D(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(134)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),!this.hasPrecedingLineBreak()&&this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(102)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,t,n){if(!D(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let r=this.state.value;if(e.includes(r)){if(n&&this.match(102)||t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:n,errorTemplate:r=H.InvalidModifierOnTypeMember},i){let a=(e,t,n,r)=>{t===n&&i[r]&&this.raise(H.InvalidModifiersOrder,e,{orderedModifiers:[n,r]})},o=(e,t,n,r)=>{(i[n]&&t===r||i[r]&&t===n)&&this.raise(H.IncompatibleModifiers,e,{modifiers:[n,r]})};for(;;){let{startLoc:c}=this.state,l=this.tsParseModifier(e.concat(t??[]),n,i.static);if(!l)break;_n(l)?i.accessibility?this.raise(H.DuplicateAccessibilityModifier,c,{modifier:l}):(a(c,l,l,`override`),a(c,l,l,`static`),a(c,l,l,`readonly`),i.accessibility=l):vn(l)?(i[l]&&this.raise(H.DuplicateModifier,c,{modifier:l}),i[l]=!0,a(c,l,`in`,`out`)):(s(i,l)?this.raise(H.DuplicateModifier,c,{modifier:l}):(a(c,l,`static`,`readonly`),a(c,l,`static`,`override`),a(c,l,`override`,`readonly`),a(c,l,`abstract`,`override`),o(c,l,`declare`,`override`),o(c,l,`static`,`abstract`)),i[l]=!0),t?.includes(l)&&this.raise(r,c,{modifier:l})}}tsIsListTerminator(e){switch(e){case`EnumMembers`:case`TypeMembers`:return this.match(4);case`HeritageClauseElement`:return this.match(2);case`TupleElementTypes`:return this.match(1);case`TypeParametersOrArguments`:return this.match(44)}}tsParseList(e,t){let n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseDelimitedList(e,t,n){return mn(this.tsParseDelimitedListWorker(e,t,!0,n))}tsParseDelimitedListWorker(e,t,n,r){let i=[],a=-1;for(;!this.tsIsListTerminator(e);){a=-1;let r=t();if(r==null)return;if(i.push(r),this.eat(8)){a=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(8);return}return r&&(r.value=a),i}tsParseBracketedList(e,t,n,r,i){r||(n?this.expect(0):this.expect(43));let a=this.tsParseDelimitedList(e,t,i);return n?this.expect(1):this.expect(44),a}tsParseImportType(){let e=this.startNode();return this.expect(79),this.expect(6),this.match(130)?e.source=this.parseStringLiteral(this.state.value):(this.raise(H.UnsupportedImportTypeArgument,this.state.startLoc),e.source=this.tsParseNonConditionalType()),e.options=this.eat(8)?this.tsParseImportTypeOptions():null,this.expect(7),this.eat(12)&&(e.qualifier=this.tsParseEntityName(3)),this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSImportType`)}tsParseImportTypeOptions(){let e=this.startNode();this.expect(2);let t=this.startNode();return this.isContextual(72)?(t.method=!1,t.key=this.parseIdentifier(!0),t.computed=!1,t.shorthand=!1):this.unexpected(null,72),this.expect(10),t.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(t)],this.eat(8),this.expect(4),this.finishNode(e,`ObjectExpression`)}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),t=[];for(this.expect(2);!this.match(4);){let e=this.state.type;D(e)||e===130?t.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(8)}return e.properties=t,this.next(),this.finishNode(e,`ObjectExpression`)}tsParseEntityName(e){let t;if(e&1&&this.match(74)){if(e&2)t=this.parseIdentifier(!0);else{let e=this.startNode();this.next(),t=this.finishNode(e,`ThisExpression`)}}else t=this.parseIdentifier(!!(e&1));for(;this.eat(12);){let n=this.startNodeAtNode(t);n.left=t,n.right=this.parseIdentifier(!!(e&1)),t=this.finishNode(n,`TSQualifiedName`)}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeReference`)}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,`TSTypePredicate`)}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,`TSThisType`)}tsParseTypeQuery(){let e=this.startNode();return this.expect(83),e.exprName=this.match(79)?this.tsParseImportType():this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeQuery`)}tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:[`in`,`out`],disallowedModifiers:[`const`,`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`],errorTemplate:H.InvalidModifierOnTypeParameter});tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:[`const`],disallowedModifiers:[`in`,`out`],errorTemplate:H.InvalidModifierOnTypeParameterPositions});tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:[`in`,`out`,`const`],disallowedModifiers:[`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`],errorTemplate:H.InvalidModifierOnTypeParameter});tsParseTypeParameter(e){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(77),t.default=this.tsEatThenParseType(25),this.finishNode(t,`TSTypeParameter`)}tsTryParseTypeParameters(e){if(this.match(43))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(43)||this.match(138)?this.next():this.unexpected();let n={value:-1};return t.params=this.tsParseBracketedList(`TypeParametersOrArguments`,this.tsParseTypeParameter.bind(this,e),!1,!0,n),t.params.length===0&&this.raise(H.EmptyTypeParameters,t),n.value!==-1&&this.addExtra(t,`trailingComma`,n.value),this.finishNode(t,`TSTypeParameterDeclaration`)}tsFillSignature(e,t){let n=e===15;t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(6),t.params=this.tsParseBindingListForSignature(),(n||this.match(e))&&(t.returnType=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(7,41,2);for(let t of e){let{type:e}=t;(e===`AssignmentPattern`||e===`TSParameterProperty`)&&this.raise(H.UnsupportedSignatureParameterKind,t,{type:e})}return e}tsParseTypeMemberSemicolon(){!this.eat(8)&&!this.isLineTerminator()&&this.expect(9)}tsParseSignatureMember(e,t){return this.tsFillSignature(10,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),D(this.state.type)?(this.next(),this.match(10)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(1),e.parameters=[t];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSIndexSignature`)}tsParsePropertyOrMethodSignature(e,t){if(this.eat(13)&&(e.optional=!0),this.match(6)||this.match(43)){t&&this.raise(H.ReadonlyForMethodSignature,e);let n=e;if(n.kind&&this.match(43)&&this.raise(H.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(10,n),this.tsParseTypeMemberSemicolon(),n.kind===`get`)n.params.length>0&&(this.raise(g.BadGetterArity,this.state.curPosition()),this.isThisParam(n.params[0])&&this.raise(H.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind===`set`){if(n.params.length!==1)this.raise(g.BadSetterArity,this.state.curPosition());else{let e=n.params[0];this.isThisParam(e)&&this.raise(H.AccessorCannotDeclareThisParameter,this.state.curPosition()),e.type===`Identifier`&&e.optional&&this.raise(H.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),e.type===`RestElement`&&this.raise(H.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n.returnType&&this.raise(H.SetAccessorCannotHaveReturnType,n.returnType)}else n.kind=`method`;return this.finishNode(n,`TSMethodSignature`)}{let n=e;t&&(n.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(n.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(n,`TSPropertySignature`)}}tsParseTypeMember(){let e=this.startNode();if(this.match(6)||this.match(43))return this.tsParseSignatureMember(`TSCallSignatureDeclaration`,e);if(this.match(73)){let t=this.startNode();return this.next(),this.match(6)||this.match(43)?this.tsParseSignatureMember(`TSConstructSignatureDeclaration`,e):(e.key=this.createIdentifier(t,`new`),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({allowedModifiers:[`readonly`],disallowedModifiers:[`declare`,`abstract`,`private`,`protected`,`public`,`static`,`override`]},e),this.tsTryParseIndexSignature(e)||(super.parsePropertyName(e),!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(6)&&!this.match(43)&&this.unexpected(null,6)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,`TSTypeLiteral`)}tsParseObjectTypeMembers(){this.expect(2);let e=this.tsParseList(`TypeMembers`,this.tsParseTypeMember.bind(this));return this.expect(4),e}tsIsStartOfMappedType(){return this.next(),this.eat(49)?this.isContextual(118):(this.isContextual(118)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(54)))}tsParseMappedType(){let e=this.startNode();return this.expect(2),this.match(49)?(e.readonly=this.state.value,this.next(),this.expectContextual(118)):this.eatContextual(118)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(54),e.nameType=this.eatContextual(89)?this.tsParseType():null,this.expect(1),this.match(49)?(e.optional=this.state.value,this.next(),this.expect(13)):this.eat(13)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(4),this.finishNode(e,`TSMappedType`)}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList(`TupleElementTypes`,this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(e=>{let{type:n}=e;t&&n!==`TSRestType`&&n!==`TSOptionalType`&&!(n===`TSNamedTupleMember`&&e.optional)&&this.raise(H.OptionalTypeBeforeRequired,e),t||=n===`TSNamedTupleMember`&&e.optional||n===`TSOptionalType`}),this.finishNode(e,`TSTupleType`)}tsParseTupleElementType(){let e=this.state.startLoc,t=this.eat(17),{startLoc:n}=this.state,r,i,a,o,s=O(this.state.type)?this.lookaheadCharCode():null;if(s===58)r=!0,a=!1,i=this.parseIdentifier(!0),this.expect(10),o=this.tsParseType();else if(s===63){a=!0;let e=this.state.value,t=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,i=this.createIdentifier(this.startNodeAt(n),e),this.expect(13),this.expect(10),o=this.tsParseType()):(r=!1,o=t,this.expect(13))}else o=this.tsParseType(),a=this.eat(13),r=this.eat(10);if(r){let e;i?(e=this.startNodeAt(n),e.optional=a,e.label=i,e.elementType=o,this.eat(13)&&(e.optional=!0,this.raise(H.TupleOptionalAfterType,this.state.lastTokStartLoc))):(e=this.startNodeAt(n),e.optional=a,this.raise(H.InvalidTupleMemberLabel,o),e.label=o,e.elementType=this.tsParseType()),o=this.finishNode(e,`TSNamedTupleMember`)}else if(a){let e=this.startNodeAt(n);e.typeAnnotation=o,o=this.finishNode(e,`TSOptionalType`)}if(t){let t=this.startNodeAt(e);t.typeAnnotation=o,o=this.finishNode(t,`TSRestType`)}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(6),e.typeAnnotation=this.tsParseType(),this.expect(7),this.finishNode(e,`TSParenthesizedType`)}tsParseFunctionOrConstructorType(e,t){let n=this.startNode();return e===`TSConstructorType`&&(n.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(15,n)),this.finishNode(n,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 131:case 132:case 130:case 81:case 82:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,`TSLiteralType`)}tsParseTemplateLiteralType(){let e=this.state.startLoc,t=this.parseTemplateElement(!1),n=[t];if(t.tail){let t=this.startNodeAt(e),r=this.startNodeAt(e);return r.expressions=[],r.quasis=n,t.literal=this.finishNode(r,`TemplateLiteral`),this.finishNode(t,`TSLiteralType`)}{let r=[];for(;!t.tail;)r.push(this.tsParseType()),this.readTemplateContinuation(),n.push(t=this.parseTemplateElement(!1));let i=this.startNodeAt(e);return i.types=r,i.quasis=n,this.finishNode(i,`TSTemplateLiteralType`)}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(112)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 130:case 131:case 132:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value===`-`){let e=this.startNode(),t=this.lookahead();return t.type!==131&&t.type!==132&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,`TSLiteralType`)}break;case 74:return this.tsParseThisTypeOrThisTypePredicate();case 83:return this.tsParseTypeQuery();case 79:return this.tsParseImportType();case 2:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 6:if(!(this.optionFlags&2048)){let e=this.state.startLoc;this.next();let t=this.tsParseType();return this.expect(7),this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),t}return this.tsParseParenthesizedType();case 21:case 20:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(D(e)||e===84||e===80){let t=e===84?`TSVoidKeyword`:e===80?`TSNullKeyword`:gn(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,t=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(1)){let n=this.startNodeAt(e);n.elementType=t,this.expect(1),t=this.finishNode(n,`TSArrayType`)}else{let n=this.startNodeAt(e);n.objectType=t,n.indexType=this.tsParseType(),this.expect(1),t=this.finishNode(n,`TSIndexedAccessType`)}return t}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t===`readonly`&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,`TSTypeOperator`)}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case`TSTupleType`:case`TSArrayType`:return;default:this.raise(H.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(111);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,`TSTypeParameter`),this.finishNode(e,`TSInferType`)}tsParseConstraintForInferType(){if(this.eat(77)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(13))return e}}tsParseTypeOperatorOrHigher(){return Me(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(111)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,n){let r=this.startNode(),i=this.eat(n),a=[];do a.push(t());while(this.eat(n));return a.length===1&&!i?a[0]:(r.types=a,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSIntersectionType`,this.tsParseTypeOperatorOrHigher.bind(this),41)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSUnionType`,this.tsParseIntersectionTypeOrHigher.bind(this),39)}tsIsStartOfFunctionType(){return this.match(43)?!0:this.match(6)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(D(this.state.type)||this.match(74))return this.next(),!0;if(this.match(2)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(4,!0),e.length===t}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(1,93,1),e.length===t}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(7)||this.match(17)||this.tsSkipParameterStart()&&(this.match(10)||this.match(8)||this.match(13)||this.match(25)||this.match(7)&&(this.next(),this.match(15))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let n=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(74)){let e=this.tsParseThisTypeOrThisTypePredicate();return e.type===`TSThisType`?(n.parameterName=e,n.asserts=!0,n.typeAnnotation=null,e=this.finishNode(n,`TSTypePredicate`)):(this.resetStartLocationFromNode(e,n),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,`TSTypeAnnotation`)}let i=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!i)return r?(n.parameterName=this.parseIdentifier(),n.asserts=r,n.typeAnnotation=null,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)):this.tsParseTypeAnnotation(!1,t);let a=this.tsParseTypeAnnotation(!1);return n.parameterName=i,n.typeAnnotation=a,n.asserts=r,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(10))return this.tsParseTypeOrTypePredicateAnnotation(10)}tsTryParseTypeAnnotation(){if(this.match(10))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(10)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==105)return!1;let e=this.state.containsEsc;return this.next(),!D(this.state.type)&&!this.match(74)?!1:(e&&this.raise(g.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:`asserts`}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(10),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,`TSTypeAnnotation`)}tsParseType(){hn(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(77))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(13),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(10),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,`TSConditionalType`)}isAbstractConstructorSignature(){return this.isContextual(120)&&this.isLookaheadContextual(`new`)}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType(`TSFunctionType`):this.match(73)?this.tsParseFunctionOrConstructorType(`TSConstructorType`):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType(`TSConstructorType`,!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(H.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?this.tsParseTypeReference():this.tsParseType())),this.expect(44),e.expression=this.parseMaybeUnary(),this.finishNode(e,`TSTypeAssertion`)}tsParseHeritageClause(e){let t=this.state.startLoc,n=this.tsParseDelimitedList(`HeritageClauseElement`,()=>{let t=(this.state.canStartArrow=!1,super.parseExprSubscripts());yn(t)||this.raise(H.InvalidHeritageClauseType,t.start,{token:e});let n=e===`extends`?`TSInterfaceHeritage`:`TSClassImplements`;if(t.type===`TSInstantiationExpression`)return t.type=n,t;let r=this.startNodeAtNode(t);return r.expression=t,(this.match(43)||this.match(47))&&(r.typeArguments=this.tsParseTypeArgumentsInExpression()),this.finishNode(r,n)});return n.length||this.raise(H.EmptyHeritageClauseType,t,{token:e}),n}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(125),t.declare&&(e.declare=!0),D(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(H.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(77)&&(e.extends=this.tsParseHeritageClause(`extends`));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,`TSInterfaceBody`),this.finishNode(e,`TSInterfaceDeclaration`)}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(25),this.isContextual(110)&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,`TSIntrinsicKeyword`)}return this.tsParseType()}),this.semicolon(),this.finishNode(e,`TSTypeAliasDeclaration`)}tsInTopLevelContext(e){if(this.curContext()!==j.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(130)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(25)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,`TSEnumMember`)}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(122),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),e.body=this.tsParseEnumBody(),this.finishNode(e,`TSEnumDeclaration`)}tsParseEnumBody(){let e=this.startNode();return this.expect(2),e.members=this.tsParseDelimitedList(`EnumMembers`,this.tsParseEnumMember.bind(this)),this.expect(4),this.finishNode(e,`TSEnumBody`)}tsParseModuleBlock(e){let t=this.startNode();return e||this.scope.enter(0),this.expect(2),super.parseBlockOrModuleBlockBody(t.body=[],void 0,!0,4),e||this.scope.exit(),this.finishNode(t,`TSModuleBlock`)}tsParseNamespaceDeclaration(e){return e.id=this.tsParseEntityName(0),e.id.type===`Identifier`&&this.checkIdentifier(e.id,1024),this.scope.enter(2048),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(!1),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`TSModuleDeclaration`)}tsParseAmbientExternalModuleDeclaration(e){let t=this.isContextual(108);return t?(e.kind=`global`,e.id=this.parseIdentifier()):(e.kind=`module`,e.id=super.parseStringLiteral(this.state.value)),this.match(2)?(t||this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(t),this.prodParam.exit(),t||this.scope.exit()):this.semicolon(),this.finishNode(e,`TSModuleDeclaration`)}tsParseImportEqualsDeclaration(e,t){e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(25);let n=this.tsParseModuleReference();return e.importKind===`type`&&n.type!==`TSExternalModuleReference`&&this.raise(H.ImportAliasHasImportType,n),e.moduleReference=n,this.semicolon(),this.finishNode(e,`TSImportEqualsDeclaration`)}tsIsExternalModuleReference(){return this.isContextual(115)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(115),this.expect(6),this.match(130)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(7),this.sawUnambiguousESM=!0,this.finishNode(e,`TSExternalModuleReference`)}tsLookAhead(e){let t=this.state.clone(),n=e();return this.state=t,n}tsTryParseAndCatch(e){let t=this.tryParse(t=>e()||t());if(!(t.aborted||!t.node))return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),n=e();if(n!==void 0&&n!==!1)return n;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type;return this.tsInAmbientContext(()=>{switch(t){case 64:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 76:return e.declare=!0,this.parseClass(e,!0,!1);case 122:return this.tsParseEnumDeclaration(e,{declare:!0});case 108:return this.tsParseAmbientExternalModuleDeclaration(e);case 96:if(this.state.containsEsc)return;case 71:case 70:return!this.match(71)||!this.isLookaheadContextual(`enum`)?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(71),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 103:if(this.isUsing())return this.raise(H.InvalidModifierOnUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.parseVarStatement(e,`using`,!0);break;case 92:if(this.isAwaitUsing())return this.raise(H.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.next(),this.parseVarStatement(e,`await using`,!0);break;case 125:{let t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}default:if(D(t))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,t,n,r){switch(t){case 120:if(this.tsCheckLineTerminator(n)&&(this.match(76)||D(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case 123:if(this.tsCheckLineTerminator(n))return this.tsParseAmbientExternalModuleDeclaration(e);break;case 124:if(this.tsCheckLineTerminator(n)&&D(this.state.type))return e.kind=`namespace`,this.tsParseNamespaceDeclaration(e);break;case 126:if(this.tsCheckLineTerminator(n)&&D(this.state.type))return this.tsParseTypeAliasDeclaration(e)}}tsCheckLineTerminator(e){return e?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(43))return;let t=this.tsTryParseAndCatch(()=>{let t=this.startNodeAt(e);return t.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(t),t.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(15),t});if(t)return super.parseArrowExpression(t,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===43)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(43),this.tsParseDelimitedList(`TypeParametersOrArguments`,this.tsParseType.bind(this))))),e.params.length===0?this.raise(H.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===j.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TSTypeParameterInstantiation`)}tsIsDeclarationStart(){return Ne(this.state.type)}isExportDefaultSpecifier(){return!this.tsIsDeclarationStart()&&super.isExportDefaultSpecifier()}parseBindingElement(e,t){let n=t.length?null:this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:[`public`,`private`,`protected`,`override`,`readonly`]},r);let i=r.accessibility,a=r.override,o=r.readonly;!(e&4)&&(i||o||a)&&this.raise(H.UnexpectedParameterModifier,n||t[0]);let s=this.state.startLoc,c=this.parseMaybeDefault(s);e&2&&this.parseFunctionParamType(c);let l=this.parseMaybeDefault(s,c);if(i||o||a){let e=n?this.startNodeAt(n):this.startNodeAtNode(t[0]);return t.length?e.decorators=t:this.setLoc(n),i&&(e.accessibility=i),o&&(e.readonly=o),a&&(e.override=a),l.type!==`Identifier`&&l.type!==`AssignmentPattern`&&this.raise(H.UnsupportedParameterPropertyKind,n||t[0]),e.parameter=l,this.finishNode(e,`TSParameterProperty`)}return t.length&&(c.decorators=t),l}isSimpleParameter(e){return e.type===`TSParameterProperty`&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!==`Identifier`&&t.optional&&!this.state.isAmbientContext&&this.raise(H.PatternIsOptional,t)}setArrowFunctionParameters(e,t,n){super.setArrowFunctionParameters(e,t,n),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,n=!1){this.match(10)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(10));let r=t===`FunctionDeclaration`?`TSDeclareFunction`:t===`ClassMethod`||t===`ClassPrivateMethod`?`TSDeclareMethod`:void 0;if(r&&!this.match(2)&&this.isLineTerminator()){if(r===`TSDeclareMethod`&&e.kind===`constructor`)for(let t of e.params)t.type===`TSParameterProperty`?this.raise(H.UnexpectedParameterModifier,t):t.type===`AssignmentPattern`&&this.raise(H.UnexpectedParameterInitializer,t);else for(let t of e.params)t.type===`AssignmentPattern`&&this.raise(H.UnexpectedParameterInitializer,t);return this.finishNode(e,r)}return r&&this.state.isAmbientContext&&(this.raise(H.DeclareFunctionHasImplementation,this.state.startLoc),r===`TSDeclareFunction`&&e.declare)?super.parseFunctionBodyAndFinish(e,r,n):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,n))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{e?.type===`TSTypeCastExpression`&&this.raise(H.UnexpectedTypeAnnotation,e.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,t,n,r){if(!this.hasPrecedingLineBreak()&&this.match(31)){this.state.canStartJSXElement=!1,this.next();let n=this.startNodeAt(t);return n.expression=e,this.finishNode(n,`TSNonNullExpression`)}let i=!1;if(this.match(14)&&this.lookaheadCharCode()===60){if(n)return r.stop=!0,e;r.optionalChainMember=i=!0,this.next()}if(this.match(43)||this.match(47)){let a,o=this.tsTryParseAndCatch(()=>{if(!n&&this.atPossibleAsyncArrow(e)){let e=this.tsTryParseGenericAsyncArrowFunction(t);if(e)return r.stop=!0,e}let o=this.tsParseTypeArgumentsInExpression();if(!o)return;if(i&&!this.match(6)){a=this.state.curPosition();return}if(Ie(this.state.type)){let n=super.parseTaggedTemplateExpression(e,t,r);return n.typeArguments=o,n}if(!n&&this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(n.arguments),n.typeArguments=o,r.optionalChainMember&&(n.optional=i),this.finishCallExpression(n,r.optionalChainMember)}let s=this.state.type;if(s===44||s===48||s!==6&&s!==89&&s!==116&&k(s)&&!this.hasPrecedingLineBreak())return;let c=this.startNodeAt(t);return c.expression=e,c.typeArguments=o,this.finishNode(c,`TSInstantiationExpression`)});if(a&&this.unexpected(a,6),o)return o.type===`TSInstantiationExpression`&&((this.match(12)||this.match(14)&&this.lookaheadCharCode()!==40)&&this.raise(H.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(12)&&!this.match(14)&&(o.expression=super.stopParseSubscript(e,r))),o}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){super.parseNewCallee(e);let{callee:t}=e;t.type===`TSInstantiationExpression`&&!t.extra?.parenthesized&&(e.typeArguments=t.typeArguments,e.callee=t.expression)}parseExprOp(e,t,n){let r;if(Pe(54)>n&&!this.hasPrecedingLineBreak()&&(this.isContextual(89)||(r=this.isContextual(116)))){let i=this.startNodeAt(t);i.expression=e,i.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?(r&&this.raise(g.UnexpectedKeyword,this.state.startLoc,{keyword:`const`}),this.tsParseTypeReference()):this.tsParseType()));let a=this.finishNode(i,r?`TSSatisfiesExpression`:`TSAsExpression`);return this.reScan_lt_gt(),this.parseExprOp(a,t,n)}return super.parseExprOp(e,t,n)}checkReservedWord(e,t,n,r){this.state.isAmbientContext||super.checkReservedWord(e,t,n,r)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){super.applyImportPhase(e,t,n,r),t?e.exportKind=n===`type`?`type`:`value`:e.importKind=n===`type`||n===`typeof`?n:`value`}parseImport(e){if(this.match(130))return e.importKind=`value`,this.scope.inTSNamespace&&this.raise(H.ImportInTSNamespace,e),super.parseImport(e);let t;if(D(this.state.type)&&this.lookaheadCharCode()===61){e.importKind=`value`;let t=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&t.moduleReference.type===`TSExternalModuleReference`&&this.raise(H.ImportInTSNamespace,e),t}if(this.isContextual(126)){let n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(H.ImportInTSNamespace,e),this.tsParseImportEqualsDeclaration(e,n);t=super.parseImportSpecifiersAndAfter(e,n)}else t=super.parseImport(e);return t.importKind===`type`&&t.specifiers.length>1&&t.specifiers[0].type===`ImportDefaultSpecifier`?this.raise(H.TypeImportCannotSpecifyDefaultAndNamed,t):this.scope.inTSNamespace&&this.raise(H.ImportInTSNamespace,t),t}parseExport(e,t){if(this.match(79)){let t=this.startNode();this.next();let n=null;this.isContextual(126)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(t,!1):t.importKind=`value`;let r=this.tsParseImportEqualsDeclaration(t,n);return e.attributes=[],e.declaration=r,e.exportKind=`value`,e.source=null,e.specifiers=[],this.finishNode(e,`ExportNamedDeclaration`)}if(this.eat(25)){let t=e;return t.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.scope.inTSNamespace&&this.raise(H.ExportAssignmentInTSNamespace,t),this.finishNode(t,`TSExportAssignment`)}if(this.eatContextual(89)){let t=e;return this.expectContextual(124),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,8201),this.semicolon(),this.scope.inTSNamespace&&this.raise(H.NamespaceExportInTSNamespace,t),this.finishNode(t,`TSNamespaceExportDeclaration`)}{let n=super.parseExport(e,t);return this.scope.inTSNamespace&&(n.type!==`ExportNamedDeclaration`||n.source||!n.declaration&&!this.state.isAmbientContext)&&this.raise(H.ExportInTSNamespace,n),n}}isAbstractClass(){return this.isContextual(120)&&this.isLookaheadContextual(`class`)}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(125)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,n=!1){let{isAmbientContext:r}=this.state,i=super.parseVarStatement(e,t,n||r);if(!r)return i;if(!e.declare&&(t===`using`||t===`await using`))return this.raiseOverwrite(H.UsingDeclarationInAmbientContext,e,t),i;for(let{id:e,init:n}of i.declarations)n&&(t===`var`||t===`let`||e.typeAnnotation?this.raise(H.InitializerNotAllowedInAmbientContext,n):Sn(n,this.hasPlugin(`estree`))||this.raise(H.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,n));return i}parseStatementContent(e,t){let n=!!(e&2);if(!this.state.containsEsc)switch(this.state.type){case 71:if(this.isLookaheadContextual(`enum`)){let e=this.startNode();return this.next(),this.tsParseEnumDeclaration(e,{const:!0})}break;case 120:case 121:if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let e=this.state.type,n=this.startNode();this.next();let r=e===121?this.tsTryParseDeclare(n):this.tsParseAbstractDeclaration(n,t);return r?(e===121&&(r.declare=!0),r):(n.expression=this.createIdentifier(this.startNodeAtNode(n),e===121?`declare`:`abstract`),this.semicolon(!1),this.finishNode(n,`ExpressionStatement`))}break;case 122:return this.tsParseEnumDeclaration(this.startNode());case 108:if(this.lookaheadCharCode()===123){let e=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(e)}break;case 125:{let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return n||this.raise(H.UnexpectedTypeDeclaration,e,`interface`),e;break}case 123:if(this.nextTokenIsStringLiteralOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,123,!1,t)}if(this.nextTokenIsIdentifierOnSameLine()){this.raise(H.InlineModuleDeclarationMustUseString,this.state.startLoc);let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 124:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 126:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return n||this.raise(H.UnexpectedTypeDeclaration,e,`type`),this.next(),this.tsParseTypeAliasDeclaration(e)}break}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier([`public`,`protected`,`private`])}tsHasSomeModifiers(e,t){return t.some(t=>_n(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&this.lookaheadCharCode()===123}parseClassMember(e,t,n){let r=[`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:[`in`,`out`],stopOnStartOfClassStaticBlock:!0,errorTemplate:H.InvalidModifierOnTypeParameterPositions},t);let i=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,r)&&this.raise(H.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,n,!!t.static)};t.declare?this.tsInAmbientContext(i):i(),t.decorators&&t.decorators.length>0&&!this.hasPlugin(`decorators-legacy`)&&(t.type===`TSAbstractMethodDefinition`||t.type===`TSDeclareMethod`?this.raise(H.DecoratorAbstractMethod,t,{kind:`abstract method`}):(t.type===`ClassProperty`&&t.abstract||t.type===`ClassProperty`&&t.declare||t.type===`TSAbstractPropertyDefinition`||t.type===`PropertyDefinition`&&t.declare)&&this.raise(H.DecoratorAbstractMethod,t,{kind:t.declare?`declare field`:`abstract field`}))}parseClassMemberWithIsStatic(e,t,n,r){let i=this.tsTryParseIndexSignature(t);if(i){e.body.push(i),t.abstract&&this.raise(H.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(H.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(H.IndexSignatureHasDeclare,t),t.override&&this.raise(H.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(H.NonAbstractClassHasAbstractMethod,t),t.override&&(n.hadSuperClass||this.raise(H.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,n,r)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(H.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(H.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.next();let r=this.startNodeAt(t);r.test=e;let i=this.state.inConditionalConsequent;return this.state.inConditionalConsequent=!0,r.consequent=this.parseMaybeAssignAllowIn(),this.state.inConditionalConsequent=i,this.expect(10),r.alternate=this.parseMaybeAssign(),this.finishNode(r,`ConditionalExpression`)}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let n=this.startNodeAt(t);return n.expression=e,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,`TSTypeCastExpression`)}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(121))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.state.startLoc,n=this.eatContextual(121);if(n&&(this.isContextual(121)||!this.shouldParseExportDeclaration()))throw this.raise(H.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let r=D(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return r?((r.type===`TSInterfaceDeclaration`||r.type===`TSTypeAliasDeclaration`||n)&&(e.exportKind=`type`),n&&r.type!==`TSImportEqualsDeclaration`&&(this.resetStartLocation(r,t),r.declare=!0),r):null}parseClassId(e,t,n,r){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n,e.declare?1024:8331);let i=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);i&&(e.typeParameters=i)}parseClassPropertyAnnotation(e){e.optional||(this.eat(31)?e.definite=!0:this.eat(13)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(25)&&this.raise(H.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:t}=e;this.raise(H.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:t.type===`Identifier`&&!e.computed?t.name:`[${this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(H.PrivateElementHasAbstract,e),e.accessibility&&this.raise(H.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(H.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,n,r,i,a){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&i&&this.raise(H.ConstructorHasTypeParameters,o);let{declare:s=!1,kind:c}=t;s&&(c===`get`||c===`set`)&&this.raise(H.DeclareAccessor,t,{kind:c}),o&&(t.typeParameters=o),super.pushClassMethod(e,t,n,r,i,a)}pushClassPrivateMethod(e,t,n,r){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(t.typeParameters=i),super.pushClassPrivateMethod(e,t,n,r)}declareClassPrivateMethodInScope(e,t){e.type!==`TSDeclareMethod`&&(e.type===`MethodDefinition`&&e.value.body==null||super.declareClassPrivateMethodInScope(e,t))}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass){if(e.superClass.type===`TSInstantiationExpression`){let t=e.superClass,n=t.expression;this.takeSurroundingComments(n,n.start,n.end);let r=t.typeArguments;this.takeSurroundingComments(r,r.start,r.end),e.superClass=n,e.superTypeArguments=r}else(this.match(43)||this.match(47))&&(e.superTypeArguments=this.tsParseTypeArgumentsInExpression())}this.eatContextual(109)&&(e.implements=this.tsParseHeritageClause(`implements`))}parseObjPropValue(e,t,n,r,i,a,o){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);return s&&(e.typeParameters=s),super.parseObjPropValue(e,t,n,r,i,a,o)}parseFunctionParams(e,t){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(e.typeParameters=n),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type===`Identifier`&&!this.hasPrecedingLineBreak()&&this.eat(31)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(10)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){let n,r,i;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===j.j_oTag||a===j.j_expr)&&i.pop()}if(!r?.error&&!this.match(43))return super.parseMaybeAssign(e,t);(!n||n===this.state)&&(n=this.state.clone());let a,o=this.tryParse(n=>{a=this.tsParseTypeParameters(this.tsParseConstModifier);let r=super.parseMaybeAssign(e,t);if((r.type!==`ArrowFunctionExpression`||r.extra?.parenthesized)&&n(),a?.params.length!==0&&this.resetStartLocationFromNode(r,a),r.typeParameters=a,this.hasPlugin(`jsx`)&&r.typeParameters.params.length===1&&!r.typeParameters.extra?.trailingComma){let e=r.typeParameters.params[0];e.constraint||this.raise(H.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?u(e.loc.end,1):e,{typeParameterName:e.name.name})}return r},n);if(!o.error&&!o.aborted)return a&&this.reportReservedArrowTypeParam(a),o.node;if(!r&&(hn(!this.hasPlugin(`jsx`)),i=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!i.error))return i.node;if(r?.node)return this.state=r.failState,r.node;if(o.node)return this.state=o.failState,a&&this.reportReservedArrowTypeParam(a),o.node;if(i?.node)return this.state=i.failState,i.node;throw r?.error||o.error||i?.error}reportReservedArrowTypeParam(e){e.params.length===1&&!e.params[0].constraint&&!e.extra?.trailingComma&&this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(H.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin(`jsx`)&&this.match(43)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(10);return(this.canInsertSemicolon()||!this.match(15))&&e(),t});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(13)&&(e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case`TSTypeCastExpression`:return this.isAssignable(e.expression,t);case`TSParameterProperty`:return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case`ParenthesizedExpression`:this.toAssignableParenthesizedExpression(e,t);break;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:t?this.expressionScope.recordArrowParameterBindingError(H.UnexpectedTypeCastInParameter,e):this.raise(H.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case`AssignmentExpression`:!t&&e.left.type===`TSTypeCastExpression`&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:case`ParenthesizedExpression`:this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:case`TSNonNullExpression`:this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,n,r){switch(e){case`TSTypeCastExpression`:return!0;case`TSParameterProperty`:return`parameter`;case`TSNonNullExpression`:return`expression`;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:return(r!==64||!n)&&[`expression`,!0];default:return super.isValidLVal(e,t,n,r)}}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,t){if(this.match(43)||this.match(47)){let n=this.tsParseTypeArgumentsInExpression();if(this.match(6)){let r=super.parseMaybeDecoratorArguments(e,t);return r.typeArguments=n,r}this.unexpected(null,6)}return super.parseMaybeDecoratorArguments(e,t)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(8)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(31)||this.match(10)||super.isClassProperty()}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(H.TypeAnnotationAfterAssign,n.typeAnnotation),n}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(44,1);return}if(e===60){this.finishOp(43,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}toAssignableListItem(e,t,n){let r=e[t];r.type===`TSTypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}shouldParseArrow(e){return this.match(10)?e.every(e=>this.isAssignable(e,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(10)?!this.state.inConditionalConsequent:super.shouldParseAsyncArrow()}parseParenAndDistinguishExpression(e){let t=this.state.inConditionalConsequent;this.state.inConditionalConsequent=!1;let n=super.parseParenAndDistinguishExpression(e);return this.state.inConditionalConsequent=t,n}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(43)||this.match(47)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeArguments=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:n}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=n}}parseClass(e,t,n){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,n)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,t){if(this.match(76))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(125))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(H.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,76)}parseMethod(e,t,n,r,i,a,o){let s=super.parseMethod(e,t,n,r,i,a,o);if((s.abstract||s.type===`TSAbstractMethodDefinition`)&&(this.hasPlugin(`estree`)?s.value:s).body){let{key:e}=s;this.raise(H.AbstractMethodHasImplementation,s,{methodName:e.type===`Identifier`&&!s.computed?e.name:`[${this.input.slice(this.offsetToSourcePos(e.start),this.offsetToSourcePos(e.end))}]`})}return s}tsParseTypeParameterName(){return this.parseIdentifier()}shouldParseAsAmbientContext(){return!!this.getPluginOption(`typescript`,`dts`)}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,t,n,r){return!t&&r?(this.parseTypeOnlyImportExportSpecifier(e,!1,n),this.finishNode(e,`ExportSpecifier`)):(e.exportKind=`value`,super.parseExportSpecifier(e,t,n,r))}parseImportSpecifier(e,t,n,r,i){return!t&&r?(this.parseTypeOnlyImportExportSpecifier(e,!0,n),this.finishNode(e,`ImportSpecifier`)):(e.importKind=`value`,super.parseImportSpecifier(e,t,n,r,n?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,n){let r=t?`imported`:`local`,i=t?`local`:`exported`,a=e[r],o,s=!1,c=!0,l=a.start;if(this.isContextual(89)){let e=this.parseIdentifier();if(this.isContextual(89)){let n=this.parseIdentifier();O(this.state.type)?(s=!0,a=e,o=t?this.parseIdentifier():this.parseModuleExportName(),c=!1):(o=n,c=!1)}else O(this.state.type)?(c=!1,o=t?this.parseIdentifier():this.parseModuleExportName()):(s=!0,a=e)}else O(this.state.type)&&(s=!0,t?(a=this.parseIdentifier(!0),this.isContextual(89)||this.checkReservedWord(a.name,a.start,!0,!0)):a=this.parseModuleExportName());s&&n&&this.raise(t?H.TypeModifierIsUsedInTypeImports:H.TypeModifierIsUsedInTypeExports,l),e[r]=a,e[i]=o;let u=t?`importKind`:`exportKind`;e[u]=s?`type`:`value`,c&&this.eatContextual(89)&&(e[i]=t?this.parseIdentifier():this.parseModuleExportName()),e[i]||(e[i]=this.cloneIdentifier(e[r])),t&&this.checkIdentifier(e[i],s?4098:4096)}fillOptionalPropertiesForTSESLint(e){switch(e.type){case`ExpressionStatement`:e.directive??=void 0;return;case`RestElement`:e.value=void 0;case`Identifier`:case`ArrayPattern`:case`AssignmentPattern`:case`ObjectPattern`:e.decorators??=[],e.optional??=!1,e.typeAnnotation??=void 0;return;case`TSParameterProperty`:e.accessibility??=void 0,e.decorators??=[],e.override??=!1,e.readonly??=!1,e.static??=!1;return;case`TSEmptyBodyFunctionExpression`:e.body=null;case`TSDeclareFunction`:case`FunctionDeclaration`:case`FunctionExpression`:case`ClassMethod`:case`ClassPrivateMethod`:e.declare??=!1,e.returnType??=void 0,e.typeParameters??=void 0;return;case`Property`:e.optional??=!1;return;case`TSMethodSignature`:case`TSPropertySignature`:e.optional??=!1;case`TSIndexSignature`:e.accessibility??=void 0,e.readonly??=!1,e.static??=!1;return;case`TSAbstractPropertyDefinition`:case`PropertyDefinition`:case`TSAbstractAccessorProperty`:case`AccessorProperty`:e.declare??=!1,e.definite??=!1,e.readonly??=!1,e.typeAnnotation??=void 0;case`TSAbstractMethodDefinition`:case`MethodDefinition`:e.accessibility??=void 0,e.decorators??=[],e.override??=!1,e.optional??=!1;return;case`ClassExpression`:e.id??=null;case`ClassDeclaration`:e.abstract??=!1,e.declare??=!1,e.decorators??=[],e.implements??=[],e.superTypeArguments??=void 0,e.typeParameters??=void 0;return;case`TSTypeAliasDeclaration`:case`VariableDeclaration`:e.declare??=!1;return;case`VariableDeclarator`:e.definite??=!1;return;case`TSEnumDeclaration`:e.const??=!1,e.declare??=!1;return;case`TSEnumMember`:e.computed??=!1;return;case`TSImportType`:e.qualifier??=null,e.options??=null,e.typeArguments??=null;return;case`TSInterfaceDeclaration`:e.declare??=!1,e.extends??=[];return;case`TSMappedType`:e.optional??=!1,e.readonly??=void 0;return;case`TSModuleDeclaration`:e.declare??=!1,e.global??=e.kind===`global`;return;case`TSTypeParameter`:e.const??=!1,e.in??=!1,e.out??=!1;return}}chStartsBindingIdentifierAndNotRelationalOperator(e,t){if(M(e)){if(pn.lastIndex=t,pn.test(this.input)){let e=this.codePointAtPos(pn.lastIndex);if(!N(e)&&e!==92)return!1}return!0}return e===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(t,e)}nextTokenIsStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===34||t===39}};function xn(e){if(e.type!==`MemberExpression`)return!1;let{computed:t,property:n}=e;return t&&n.type!==`StringLiteral`&&(n.type!==`TemplateLiteral`||n.expressions.length>0)?!1:Tn(e.object)}function Sn(e,t){let{type:n}=e;if(e.extra?.parenthesized)return!1;if(t){if(n===`Literal`){let{value:t}=e;if(typeof t==`string`||typeof t==`boolean`)return!0}}else if(n===`StringLiteral`||n===`BooleanLiteral`)return!0;return!!(Cn(e,t)||wn(e,t)||n===`TemplateLiteral`&&e.expressions.length===0||xn(e))}function Cn(e,t){return t?e.type===`Literal`&&(typeof e.value==`number`||`bigint`in e):e.type===`NumericLiteral`||e.type===`BigIntLiteral`}function wn(e,t){if(e.type===`UnaryExpression`){let{operator:n,argument:r}=e;if(n===`-`&&Cn(r,t))return!0}return!1}function Tn(e){return e.type===`Identifier`?!0:e.type!==`MemberExpression`||e.computed?!1:Tn(e.object)}var En=h`placeholders`({ClassNameIsRequired:`A class name is required.`,UnexpectedSpace:`Unexpected space in placeholder.`}),Dn=e=>class extends e{parsePlaceholder(e){if(this.match(129)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(129),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let n=e;return(!n.expectedNode||!n.type)&&(n=this.finishNode(n,`Placeholder`)),n.expectedNode=t,n}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(129,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder(`Expression`)||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder(`Identifier`)||super.parseIdentifier(e)}checkReservedWord(e,t,n,r){e!==void 0&&super.checkReservedWord(e,t,n,r)}cloneIdentifier(e){let t=super.cloneIdentifier(e);return t.type===`Placeholder`&&(t.expectedNode=e.expectedNode),t}cloneStringLiteral(e){return e.type===`Placeholder`?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder(`Pattern`)||super.parseBindingAtom()}isValidLVal(e,t,n,r){return e===`Placeholder`||super.isValidLVal(e,t,n,r)}toAssignable(e,t){e&&e.type===`Placeholder`&&e.expectedNode===`Expression`?e.expectedNode=`Pattern`:super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){if(super.chStartsBindingIdentifier(e,t))return!0;let n=this.nextTokenStart();return this.input.charCodeAt(n)===37&&this.input.charCodeAt(n+1)===37}verifyBreakContinue(e,t){e.label?.type!==`Placeholder`&&super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){if(t.type!==`Placeholder`||t.extra?.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(10)){let n=e;return n.label=this.finishPlaceholder(t,`Identifier`),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,`LabeledStatement`)}this.semicolon();let n=e;return n.name=t.name,this.finishPlaceholder(n,`Statement`)}parseBlock(e,t,n){return this.parsePlaceholder(`BlockStatement`)||super.parseBlock(e,t,n)}parseFunctionId(e){return this.parsePlaceholder(`Identifier`)||super.parseFunctionId(e)}parseClass(e,t,n){let r=t?`ClassDeclaration`:`ClassExpression`;this.next();let i=this.state.strict,a=this.parsePlaceholder(`Identifier`);if(a){if(this.match(77)||this.match(129)||this.match(2))e.id=a;else{if(n||!t)return e.id=null,e.body=this.finishPlaceholder(a,`ClassBody`),this.finishNode(e,r);throw this.raise(En.ClassNameIsRequired,this.state.startLoc)}}else this.parseClassId(e,t,n);return super.parseClassSuper(e),e.body=this.parsePlaceholder(`ClassBody`)||super.parseClassBody(!!e.superClass,i),this.finishNode(e,r)}parseExport(e,t){let n=this.parsePlaceholder(`Identifier`);if(!n)return super.parseExport(e,t);let r=e;if(!this.isContextual(94)&&!this.match(8))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(n,`Declaration`),this.finishNode(r,`ExportNamedDeclaration`);this.expectPlugin(`exportDefaultFrom`);let i=this.startNode();return i.exported=n,r.specifiers=[this.finishNode(i,`ExportDefaultSpecifier`)],super.parseExport(r,t)}isExportDefaultSpecifier(){if(this.match(61)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,`from`)&&this.input.startsWith(A(129),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){return e.specifiers?.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){let{specifiers:t}=e;t?.length&&(e.specifiers=t.filter(e=>e.exported.type===`Placeholder`)),super.checkExport(e),e.specifiers=t}parseImport(e){let t=this.parsePlaceholder(`Identifier`);if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(94)&&!this.match(8))return e.source=this.finishPlaceholder(t,`StringLiteral`),this.semicolon(),this.finishNode(e,`ImportDeclaration`);let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishNode(n,`ImportDefaultSpecifier`)),this.eat(8)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(94),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.parsePlaceholder(`StringLiteral`)||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(En.UnexpectedSpace,this.state.lastTokEndLoc)}},On=e=>class extends e{parseV8Intrinsic(){if(this.match(50)){let e=this.state.startLoc,t=this.startNode();if(this.next(),D(this.state.type)){let e=this.parseIdentifierName(),n=this.createIdentifier(t,e);if(this.castNodeTo(n,`V8IntrinsicIdentifier`),this.match(6))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},kn=[`fsharp`,`hack`],An=[`^^`,`@@`,`^`,`%`,`#`];function jn(e){if(e.has(`decorators`)&&e.has(`decorators-legacy`))throw Error(`Cannot use the decorators and decorators-legacy plugin together`);if(e.has(`flow`)&&e.has(`typescript`))throw Error(`Cannot combine flow and typescript plugins.`);if(e.has(`placeholders`)&&e.has(`v8intrinsic`))throw Error(`Cannot combine placeholders and v8intrinsic plugins.`);if(e.has(`pipelineOperator`)){let t=e.get(`pipelineOperator`).proposal;if(!kn.includes(t)){let e=kn.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`)}if(t===`hack`){if(e.has(`placeholders`))throw Error(`Cannot combine placeholders plugin and Hack-style pipes.`);if(e.has(`v8intrinsic`))throw Error(`Cannot combine v8intrinsic plugin and Hack-style pipes.`);let t=e.get(`pipelineOperator`).topicToken;if(!An.includes(t)){let e=An.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`)}}}if(e.has(`moduleAttributes`))throw Error("`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.");if(e.has(`importAssertions`))throw Error("`importAssertions` has been removed in Babel 8, please use import attributes instead.");if(e.has(`deprecatedImportAssert`)?console.warn("`deprecatedImportAssert` has been removed in Babel 8, please use import attributes instead."):e.has(`importAttributes`)&&e.get(`importAttributes`).deprecatedAssertSyntax&&console.warn("The 'importAttributes' plugin has been removed in Babel 8. Please migrate any usage of `assert`-style attributes to `with`."),e.has(`recordAndTuple`))throw Error(`The 'recordAndTuple' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`asyncDoExpressions`)&&!e.has(`doExpressions`)){let e=Error(`'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.`);throw e.missingPlugins=`doExpressions`,e}if(e.has(`optionalChainingAssign`)&&e.get(`optionalChainingAssign`).version!==`2023-07`)throw Error(`The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.`);if(e.has(`discardBinding`)&&e.get(`discardBinding`).syntaxType!==`void`)throw Error(`The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.`);if(e.has(`decimal`))throw Error(`The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`importReflection`))throw Error(`The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.`)}var Mn={estree:ue,jsx:bt,flow:mt,typescript:bn,v8intrinsic:On,placeholders:Dn},Nn=Object.keys(Mn),Pn=class extends fn{constructor(e,t,n){let r=le(e);super(r,t),this.options=r,this.initializeScopes(),this.plugins=n,this.filename=r.sourceFilename,this.startIndex=r.startIndex;let i=0;r.allowAwaitOutsideFunction&&(i|=1),r.allowReturnOutsideFunction&&(i|=2),r.allowImportExportEverywhere&&(i|=8),r.allowSuperOutsideMethod&&(i|=16),r.allowUndeclaredExports&&(i|=64),r.allowNewTargetOutsideFunction&&(i|=4),r.allowYieldOutsideFunction&&(i|=32),r.ranges&&(i|=128),r.locations===!0&&(i|=256),r.tokens&&(i|=512),r.createImportExpressions&&(i|=1024),r.createParenthesizedExpressions&&(i|=2048),r.errorRecovery&&(i|=4096),r.attachComment&&(i|=8192),r.annexB&&(i|=16384),this.optionFlags=i}getScopeHandler(){return at}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();this.nextToken(),e.errors=[];let n=this.parseTopLevel(e,t);return n.errors=this.state.errors,n.comments.length=this.state.commentsLen,n}};function Fn(e,t){if(t?.sourceType===`unambiguous`){t={...t};try{t.sourceType=`module`;let n=U(t,e),r=n.parse();if(n.sawUnambiguousESM)return r;if(n.ambiguousScriptDifferentAst)try{return t.sourceType=`script`,U(t,e).parse()}catch{}else r.program.sourceType=`script`;return r}catch(n){try{return t.sourceType=`script`,U(t,e).parse()}catch{}throw n}}return U(t,e).parse()}function In(e,t){let n=U(t,e);return n.options.strictMode&&(n.state.strict=!0),n.getExpression()}function Ln(e){let t={};for(let n of Object.keys(e))t[n]=Le(e[n]);return t}Ln(xe);function U(e,t){let n=Pn,r=new Map;if(e?.plugins){for(let t of e.plugins){let e,n;typeof t==`string`?e=t:[e,n]=t,r.has(e)||r.set(e,n||{})}jn(r),n=zn(r)}return new n(e,t,r)}var Rn=new Map;function zn(e){let t=[];for(let n of Nn)e.has(n)&&t.push(n);let n=t.join(`|`),r=Rn.get(n);if(!r){r=Pn;for(let e of t)r=Mn[e](r);Rn.set(n,r)}return r}function Bn(e){return(t,n,r)=>{if(n===!1)return!1;let i=!!r?.backwards,{length:a}=t,o=n;for(;o>=0&&o<a;){let n=t.charAt(o);if(e instanceof RegExp){if(!e.test(n))return o}else if(!e.includes(n))return o;i?o--:o++}return o===-1||o===a?o:!1}}var Vn=Bn(` `),Hn=Bn(/[^\n\r]/);function Un(e,t){if(t===!1)return!1;if(e.charAt(t)===`/`&&e.charAt(t+1)===`*`){for(let n=t+2;n<e.length;++n)if(e.charAt(n)===`*`&&e.charAt(n+1)===`/`)return n+2}return t}var Wn=Un,Gn=e=>e===`
9
+ `||e===`\r`||e===`\u2028`||e===`\u2029`;function Kn(e,t,n){if(t===!1)return!1;let r=!!n?.backwards,i=e.charAt(t);if(r){if(e.charAt(t-1)===`\r`&&i===`
10
+ `)return t-2;if(Gn(i))return t-1}else{if(i===`\r`&&e.charAt(t+1)===`
11
+ `)return t+2;if(Gn(i))return t+1}return t}var qn=Kn;function Jn(e,t){return t===!1?!1:e.charAt(t)===`/`&&e.charAt(t+1)===`/`?Hn(e,t):t}var Yn=Jn;function Xn(e,t){let n=null,r=t;for(;r!==n;)n=r,r=Vn(e,r),r=Wn(e,r),r=Yn(e,r),r=qn(e,r);return r}var Zn=Xn;function Qn(e){let t=[];for(let n of e)try{return n()}catch(e){t.push(e)}throw Object.assign(Error(`All combinations failed`),{errors:t})}function $n(e){if(!e.startsWith(`#!`))return``;let t=e.indexOf(`
12
+ `);return t===-1?e:e.slice(0,t)}var er=$n,tr=Array.prototype.findLast??function(e){for(let t=this.length-1;t>=0;t--){let n=this[t];if(e(n,t,this))return n}},nr=i(`findLast`,function(){if(Array.isArray(this))return tr}),rr=Symbol.for(`comments`);function ir(e){return this[e<0?this.length+e:e]}var ar=i(`at`,function(){if(Array.isArray(this)||typeof this==`string`)return ir});function or(e){let t=new Set(e);return e=>t.has(e?.type)}function sr(e){return e.range?.[1]??e.end}function W(e){let t=e.range?.[0]??e.start,n=(e.declaration?.decorators??e.decorators)?.[0];return n?Math.min(W(n),t):t}var cr=5,lr=8,ur=8,dr=e=>t=>t.label?G(t.label):W(t)+e,fr=e=>e.__contentEnd??sr(e),pr=[`ExpressionStatement`,`Directive`,`ImportDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ExportAllDeclaration`,`ReturnStatement`,`ThrowStatement`,`DoWhileStatement`],mr=new Map([[`BreakStatement`,dr(cr)],[`ContinueStatement`,dr(lr)],[`DebuggerStatement`,e=>W(e)+ur],[`VariableDeclaration`,e=>G(ar(0,e.declarations,-1))],...pr.map(e=>[e,fr])]),hr=or(pr);function G(e){let{type:t}=e;return t===`IfStatement`?G(e.alternate??e.consequent):t===`ForInStatement`||t===`ForOfStatement`||t===`ForStatement`||t===`LabeledStatement`||t===`WithStatement`||t===`WhileStatement`?G(e.body):mr.get(t)?.(e)??sr(e)}var gr=or([`Block`,`CommentBlock`,`MultiLine`]),_r=or([`Line`,`CommentLine`,`SingleLine`,`HashbangComment`,`HTMLOpen`,`HTMLClose`,`Hashbang`,`InterpreterDirective`]);function vr(e,t,n){if(!e.has(t)){let r=n(t);e.set(t,r)}return e.get(t)}var yr=new WeakMap;function br(e){return vr(yr,e,e=>gr(e)&&e.value[0]===`*`&&/@(?:type|satisfies)\b/.test(e.value))}function xr(e){return o(0,e,/[^\n]/g,` `)}var Sr=xr;function Cr(e,t){for(let n of t){let t=W(n),r=G(n);e=e.slice(0,t)+Sr(e.slice(t,r))+e.slice(r)}return e}var wr=new WeakMap;function Tr(e){let t=e[rr];return vr(wr,t,t=>Cr(e.originalText,t))}function Er(e){if(!gr(e)||!e.value.includes(`
13
+ `))return[];let t=[];for(let n of`*${e.value}*`.split(`
14
+ `)){if(n=n.trimStart(),!n.startsWith(`*`))return[];t.push(n)}return t}var Dr=new WeakMap;function Or(e){return vr(Dr,e,Er)}function kr(e){Dr.delete(e)}function Ar(e){return Or(e).length>0}function jr(e){if(e.length<2)return;let t;for(let n=e.length-1;n>=0;n--){let r=e[n];if(t&&G(r)===W(t)&&Ar(r)&&Ar(t)&&(e.splice(n+1,1),r.value+=`*//*`+t.value,r.range=[W(r),G(t)],kr(r)),!_r(r)&&!gr(r))throw TypeError(`Unknown comment type: "${r.type}".`);t=r}}function Mr(e){return typeof e==`object`&&!!e}var Nr=Mr,K=null;function q(e){if(K!==null&&typeof K.property){let e=K;return K=q.prototype=null,e}return K=q.prototype=e??Object.create(null),new q}var Pr=10;for(let e=0;e<=Pr;e++)q();function Fr(e){return q(e)}function Ir(e,t=`type`){Fr(e);function n(n){let r=n[t],i=e[r];if(!Array.isArray(i))throw Object.assign(Error(`Missing visitor keys for '${r}'.`),{node:n});return i}return n}var Lr=Ir,J=[[`elements`],[`left`,`right`],[`value`],[`directives`,`body`],[`label`],[`callee`,`typeArguments`,`arguments`],[`test`,`consequent`,`alternate`],[`body`,`test`],[`expression`],[`left`,`right`,`body`],[`id`,`typeParameters`,`params`,`predicate`,`returnType`,`body`],[`object`,`property`],[`properties`],[`decorators`,`key`,`typeParameters`,`params`,`returnType`,`body`],[`decorators`,`key`,`value`],[`argument`],[`expressions`],[`id`,`init`],[`body`],[`decorators`,`id`,`typeParameters`,`superClass`,`superTypeArguments`,`mixins`,`implements`,`body`],[`declaration`,`specifiers`,`source`,`attributes`],[`local`],[`exported`],[`decorators`,`variance`,`key`,`typeAnnotation`,`value`],[`id`],[`key`,`value`],[`elementType`],[`id`,`typeParameters`],[`id`,`typeParameters`,`extends`,`body`],[`id`,`body`],[`typeAnnotation`],[`id`,`typeParameters`,`right`],[`name`,`typeAnnotation`],[`types`],[`qualification`,`id`],[`elementTypes`],[`expression`,`typeAnnotation`],[`params`],[`members`],[`objectType`,`indexType`],[`decorators`,`key`,`typeAnnotation`,`value`],[`id`,`typeParameters`,`params`,`returnType`,`body`],[`key`,`typeParameters`,`params`,`returnType`],[`typeParameters`,`params`,`returnType`],[`parameterName`,`typeAnnotation`],[`checkType`,`extendsType`,`trueType`,`falseType`],[`typeParameter`],[`literal`],[`expression`,`typeArguments`],[`decorators`,`key`,`typeAnnotation`],[`argument`,`cases`],[`pattern`,`body`,`guard`],[`properties`,`rest`],[`node`]],Rr=Lr({ArrayExpression:J[0],AssignmentExpression:J[1],BinaryExpression:J[1],InterpreterDirective:[],Directive:J[2],DirectiveLiteral:[],BlockStatement:J[3],BreakStatement:J[4],CallExpression:J[5],CatchClause:[`param`,`body`],ConditionalExpression:J[6],ContinueStatement:J[4],DebuggerStatement:[],DoWhileStatement:J[7],EmptyStatement:[],ExpressionStatement:J[8],File:[`program`],ForInStatement:J[9],ForStatement:[`init`,`test`,`update`,`body`],FunctionDeclaration:J[10],FunctionExpression:J[10],Identifier:[`typeAnnotation`,`decorators`],IfStatement:J[6],LabeledStatement:[`label`,`body`],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:J[1],MemberExpression:J[11],NewExpression:J[5],Program:J[3],ObjectExpression:J[12],ObjectMethod:J[13],ObjectProperty:J[14],RestElement:[`argument`,`typeAnnotation`,`decorators`],ReturnStatement:J[15],SequenceExpression:J[16],ParenthesizedExpression:J[8],SwitchCase:[`test`,`consequent`],SwitchStatement:[`discriminant`,`cases`],ThisExpression:[],ThrowStatement:J[15],TryStatement:[`block`,`handler`,`finalizer`],UnaryExpression:J[15],UpdateExpression:J[15],VariableDeclaration:[`declarations`],VariableDeclarator:J[17],WhileStatement:J[7],WithStatement:[`object`,`body`],AssignmentPattern:[`left`,`right`,`decorators`,`typeAnnotation`],ArrayPattern:[`elements`,`typeAnnotation`,`decorators`],ArrowFunctionExpression:[`typeParameters`,`params`,`predicate`,`returnType`,`body`],ClassBody:J[18],ClassExpression:J[19],ClassDeclaration:J[19],ExportAllDeclaration:[`source`,`attributes`,`exported`],ExportDefaultDeclaration:[`declaration`],ExportNamedDeclaration:J[20],ExportSpecifier:[`local`,`exported`],ForOfStatement:J[9],ImportDeclaration:[`specifiers`,`source`,`attributes`],ImportDefaultSpecifier:J[21],ImportNamespaceSpecifier:J[21],ImportSpecifier:[`imported`,`local`],MetaProperty:[`meta`,`property`],ClassMethod:J[13],ObjectPattern:[`decorators`,`properties`,`typeAnnotation`],SpreadElement:J[15],Super:[],TaggedTemplateExpression:[`tag`,`typeArguments`,`quasi`],TemplateElement:[],TemplateLiteral:[`quasis`,`expressions`],YieldExpression:J[15],AwaitExpression:J[15],ImportExpression:[`source`,`options`],BigIntLiteral:[],ExportNamespaceSpecifier:J[22],OptionalMemberExpression:J[11],OptionalCallExpression:J[5],ClassProperty:J[23],ClassPrivateProperty:J[23],ClassPrivateMethod:J[13],PrivateName:J[24],StaticBlock:J[18],ImportAttribute:J[25],AnyTypeAnnotation:[],ArrayTypeAnnotation:J[26],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:J[27],DeclareClass:[`id`,`typeParameters`,`extends`,`mixins`,`implements`,`body`],DeclareFunction:[`id`,`predicate`],DeclareInterface:J[28],DeclareModule:J[29],DeclareModuleExports:J[30],DeclareTypeAlias:J[31],DeclareOpaqueType:[`id`,`typeParameters`,`supertype`,`lowerBound`,`upperBound`],DeclareVariable:[`id`,`declarations`],DeclareExportDeclaration:J[20],DeclareExportAllDeclaration:[`source`,`attributes`],DeclaredPredicate:J[2],ExistsTypeAnnotation:[],FunctionTypeAnnotation:[`typeParameters`,`this`,`params`,`rest`,`returnType`],FunctionTypeParam:J[32],GenericTypeAnnotation:J[27],InferredPredicate:[],InterfaceExtends:J[27],InterfaceDeclaration:J[28],InterfaceTypeAnnotation:[`extends`,`body`],IntersectionTypeAnnotation:J[33],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:J[30],NumberLiteralTypeAnnotation:[],BigIntLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:[`properties`,`indexers`,`callProperties`,`internalSlots`],ObjectTypeInternalSlot:[`id`,`value`],ObjectTypeCallProperty:J[2],ObjectTypeIndexer:[`variance`,`id`,`key`,`value`],ObjectTypeProperty:[`key`,`value`,`variance`],ObjectTypeSpreadProperty:J[15],OpaqueType:[`id`,`typeParameters`,`supertype`,`impltype`,`lowerBound`,`upperBound`],QualifiedTypeIdentifier:J[34],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:J[35],TypeofTypeAnnotation:[`argument`,`typeArguments`],TypeAlias:J[31],TypeAnnotation:J[30],TypeCastExpression:J[36],TypeParameter:[`bound`,`default`,`variance`],TypeParameterDeclaration:J[37],TypeParameterInstantiation:J[37],UnionTypeAnnotation:J[33],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:J[29],EnumBooleanBody:J[38],EnumNumberBody:J[38],EnumStringBody:J[38],EnumSymbolBody:J[38],EnumBooleanMember:J[17],EnumNumberMember:J[17],EnumStringMember:J[17],EnumDefaultedMember:J[24],IndexedAccessType:J[39],OptionalIndexedAccessType:J[39],JSXAttribute:[`name`,`value`],JSXClosingElement:[`name`],JSXElement:[`openingElement`,`children`,`closingElement`],JSXEmptyExpression:[],JSXExpressionContainer:J[8],JSXSpreadChild:J[8],JSXIdentifier:[],JSXMemberExpression:J[11],JSXNamespacedName:[`namespace`,`name`],JSXOpeningElement:[`name`,`typeArguments`,`attributes`],JSXSpreadAttribute:J[15],JSXText:[],JSXFragment:[`openingFragment`,`children`,`closingFragment`],JSXOpeningFragment:[],JSXClosingFragment:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:[`object`,`callee`],ClassAccessorProperty:J[40],Decorator:J[8],DoExpression:J[18],ExportDefaultSpecifier:J[22],ModuleExpression:J[18],TopicReference:[],VoidPattern:[],TSParameterProperty:[`parameter`,`decorators`],TSDeclareFunction:J[41],TSDeclareMethod:J[42],TSQualifiedName:J[1],TSCallSignatureDeclaration:J[43],TSConstructSignatureDeclaration:J[43],TSPropertySignature:[`key`,`typeAnnotation`],TSMethodSignature:J[42],TSIndexSignature:[`parameters`,`typeAnnotation`],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:J[43],TSConstructorType:J[43],TSTypeReference:[`typeName`,`typeArguments`],TSTypePredicate:J[44],TSTypeQuery:[`exprName`,`typeArguments`],TSTypeLiteral:J[38],TSArrayType:J[26],TSTupleType:J[35],TSOptionalType:J[30],TSRestType:J[30],TSNamedTupleMember:[`label`,`elementType`],TSUnionType:J[33],TSIntersectionType:J[33],TSConditionalType:J[45],TSInferType:J[46],TSParenthesizedType:J[30],TSTypeOperator:J[30],TSIndexedAccessType:J[39],TSMappedType:[`key`,`constraint`,`nameType`,`typeAnnotation`],TSTemplateLiteralType:[`quasis`,`types`],TSLiteralType:J[47],TSClassImplements:J[48],TSInterfaceHeritage:J[48],TSInterfaceDeclaration:J[28],TSInterfaceBody:J[18],TSTypeAliasDeclaration:[`id`,`typeParameters`,`typeAnnotation`],TSInstantiationExpression:J[48],TSAsExpression:J[36],TSSatisfiesExpression:J[36],TSTypeAssertion:J[36],TSEnumBody:J[38],TSEnumDeclaration:J[29],TSEnumMember:[`id`,`initializer`],TSModuleDeclaration:J[29],TSModuleBlock:J[18],TSImportType:[`source`,`options`,`qualifier`,`typeArguments`],TSImportEqualsDeclaration:[`id`,`moduleReference`],TSExternalModuleReference:J[8],TSNonNullExpression:J[8],TSExportAssignment:J[8],TSNamespaceExportDeclaration:J[24],TSTypeAnnotation:J[30],TSTypeParameterInstantiation:J[37],TSTypeParameterDeclaration:J[37],TSTypeParameter:[`name`,`constraint`,`default`],ChainExpression:J[8],Literal:[],MethodDefinition:J[14],PrivateIdentifier:[],Property:J[25],PropertyDefinition:J[23],AccessorProperty:J[40],TSAbstractAccessorProperty:J[49],TSAbstractKeyword:[],TSAbstractMethodDefinition:J[25],TSAbstractPropertyDefinition:J[49],TSAsyncKeyword:[],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:[`id`,`typeParameters`,`params`,`returnType`],TSExportKeyword:[],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:J[8],AsExpression:J[36],BigIntTypeAnnotation:[],ComponentDeclaration:[`id`,`params`,`body`,`typeParameters`,`rendersType`],ComponentParameter:[`name`,`local`],ComponentTypeAnnotation:[`params`,`rest`,`typeParameters`,`rendersType`],ComponentTypeParameter:J[32],ConditionalTypeAnnotation:J[45],DeclareComponent:[`id`,`params`,`rest`,`typeParameters`,`rendersType`],DeclareEnum:J[29],DeclareHook:J[24],DeclareNamespace:J[29],EnumBigIntBody:J[38],EnumBigIntMember:J[17],EnumBody:J[38],HookDeclaration:J[41],HookTypeAnnotation:[`params`,`returnType`,`rest`,`typeParameters`],InferTypeAnnotation:J[46],KeyofTypeAnnotation:J[15],MatchArrayPattern:[`elements`,`rest`],MatchAsPattern:[`pattern`,`target`],MatchBindingPattern:J[24],MatchExpression:J[50],MatchExpressionCase:J[51],MatchIdentifierPattern:J[24],MatchInstanceObjectPattern:J[52],MatchInstancePattern:[`targetConstructor`,`properties`],MatchLiteralPattern:J[47],MatchMemberPattern:[`base`,`property`],MatchObjectPattern:J[52],MatchObjectPatternProperty:[`key`,`pattern`],MatchOrPattern:[`patterns`],MatchRestPattern:J[15],MatchStatement:J[50],MatchStatementCase:J[51],MatchUnaryPattern:J[15],MatchWildcardPattern:[],NeverTypeAnnotation:[],ObjectTypeMappedTypeProperty:[`keyTparam`,`propType`,`sourceType`,`variance`],QualifiedTypeofIdentifier:J[34],RecordDeclaration:[`id`,`typeParameters`,`implements`,`body`],RecordDeclarationBody:J[0],RecordDeclarationImplements:[`id`,`typeArguments`],RecordDeclarationProperty:[`key`,`typeAnnotation`,`defaultValue`],RecordDeclarationStaticProperty:[`key`,`typeAnnotation`,`value`],RecordExpression:[`recordConstructor`,`typeArguments`,`properties`],RecordExpressionProperties:J[12],SatisfiesExpression:J[36],TupleTypeLabeledElement:[`label`,`elementType`,`variance`],TupleTypeSpreadElement:[`label`,`typeAnnotation`],TypeOperator:J[30],TypePredicate:J[44],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],NGChainedExpression:J[16],NGEmptyExpression:[],NGPipeExpression:[`left`,`right`,`arguments`],NGMicrosyntax:J[18],NGMicrosyntaxAs:[`key`,`alias`],NGMicrosyntaxExpression:[`expression`,`alias`],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:[`key`,`expression`],NGMicrosyntaxLet:J[25],NGRoot:J[53],JsExpressionRoot:J[53],JsonRoot:J[53],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:J[30],TSJSDocNonNullableType:J[30]});function zr(e,t){if(!Nr(e))return e;if(Array.isArray(e)){for(let n=0;n<e.length;n++)e[n]=zr(e[n],t);return e}if(t.onEnter){let n=t.onEnter(e)??e;if(n!==e)return zr(n,t);e=n}let n=Rr(e);for(let r=0;r<n.length;r++)e[n[r]]=zr(e[n[r]],t);return t.onLeave&&(e=t.onLeave(e)||e),e}var Br=zr;or([`RegExpLiteral`,`BigIntLiteral`,`NumericLiteral`,`StringLiteral`,`DirectiveLiteral`,`Literal`,`JSXText`,`TemplateElement`,`StringLiteralTypeAnnotation`,`NumberLiteralTypeAnnotation`,`BigIntLiteralTypeAnnotation`]);function Vr(e,t){let{text:n,astType:r}=t,{comments:i}=e;jr(i);let a=e.type===`File`?e.program:e;a.interpreter&&(i.unshift(a.interpreter),delete a.interpreter),e.hashbang&&((r===`oxc-ts`||r===`yuku-js`||r===`yuku-ts`)&&i.unshift(e.hashbang),delete e.hashbang),e.type===`Program`&&(e.range=[0,n.length]);let o;return e=Br(e,{onEnter(t){switch(Wr(t,i,n),t.type){case`ParenthesizedExpression`:{let{expression:e}=t,a=W(t);if(e.type===`TypeCastExpression`)return e.range=[a,G(t)],e;let s=!1;if(r!==`oxc-ts`){if(!o){o=[];for(let e of i)br(e)&&o.push(G(e))}let e=nr(0,o,e=>e<=a);s=e&&n.slice(e,a).trim().length===0}return s?void 0:(e.extra={...e.extra,parenthesized:!0},e)}case`TemplateLiteral`:if(t.expressions.length!==t.quasis.length-1)throw Error(`Malformed template literal.`);break;case`TemplateElement`:(r===`flow`||r===`hermes`||r===`espree`||r===`typescript`||r===`oxc-ts`||r===`yuku-ts`)&&(t.range=[W(t)+1,G(t)-(t.tail?1:2)]);break;case`TSParenthesizedType`:return t.typeAnnotation;case`TopicReference`:e.extra={...e.extra,__isUsingHackPipeline:!0};break;case`TSUnionType`:case`TSIntersectionType`:if(t.types.length===1)return t.types[0];break;case`TupleTypeAnnotation`:t.types&&!t.elementTypes&&(t.elementTypes=t.types);break;case`ImportDeclaration`:r===`hermes`&&t.assertions&&!t.attributes&&(t.attributes=t.assertions,delete t.assertions)}},onLeave(e){if(e.type===`LogicalExpression`&&Hr(e))return Ur(e)}}),e}function Hr(e){return e.type===`LogicalExpression`&&e.right.type===`LogicalExpression`&&e.operator===e.right.operator}function Ur(e){return Hr(e)?Ur({type:`LogicalExpression`,operator:e.operator,left:Ur({type:`LogicalExpression`,operator:e.operator,left:e.left,right:e.right.left,range:[W(e.left),G(e.right.left)]}),right:e.right.right,range:[W(e),G(e)]}):e}function Wr(e,t,n){if(!hr(e))return;let r=sr(e);if(n[r-1]!==`;`)return;let i=Tr({[rr]:t,originalText:n});--r;let a=i.slice(W(e),r),o=a.trimEnd();e.__contentEnd=r-(a.length-o.length)}var Gr=Vr;function Kr(e,t){let n=SyntaxError(e+` (`+t.loc.start.line+`:`+t.loc.start.column+`)`);return Object.assign(n,t)}var qr=Kr,Jr=`Unexpected parseExpression() input: `;function Yr(e){let{message:t,loc:n,reasonCode:r}=e;if(!n)return e;let{line:i,column:a}=n,o=e;(r===`MissingPlugin`||r===`MissingOneOfPlugins`)&&(t=`Unexpected token.`,o=void 0);let s=` (${i}:${a})`;return t.endsWith(s)&&(t=t.slice(0,-s.length)),t.startsWith(Jr)&&(t=t.slice(Jr.length)),qr(t,{loc:{start:{line:i,column:a+1}},cause:o})}var Xr=Yr,Zr=/\*\/$/,Qr=/^\/\*\*?/,$r=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,ei=/(^|\s+)\/\/([^\n\r]*)/g,ti=/^(\r?\n)+/,ni=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ri=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,ii=/(\r?\n|^) *\* ?/g,ai=[];function oi(e){let t=e.match($r);return t?t[0].trimStart():``}function si(e){e=o(0,e.replace(Qr,``).replace(Zr,``),ii,`$1`);let t=``;for(;t!==e;)t=e,e=o(0,e,ni,`
15
+ $1 $2
16
+ `);e=e.replace(ti,``).trimEnd();let n=Object.create(null),r=o(0,e,ri,``).replace(ti,``).trimEnd(),i;for(;i=ri.exec(e);){let e=o(0,i[2],ei,``);if(typeof n[i[1]]==`string`||Array.isArray(n[i[1]])){let t=n[i[1]];n[i[1]]=[...ai,...Array.isArray(t)?t:[t],e]}else n[i[1]]=e}return{comments:r,pragmas:n}}var ci=[`noformat`,`noprettier`],li=[`format`,`prettier`];function ui(e){let t=er(e);t&&(e=e.slice(t.length+1));let{pragmas:n,comments:r}=si(oi(e));return{shebang:t,text:e,pragmas:n,comments:r}}function di(e){let{pragmas:t}=ui(e);return li.some(e=>s(t,e))}function fi(e){let{pragmas:t}=ui(e);return ci.some(e=>s(t,e))}function pi(e){return e=typeof e==`function`?{parse:e}:e,{astFormat:`estree`,hasPragma:di,hasIgnorePragma:fi,locStart:W,locEnd:G,...e}}var Y=pi,mi=`module`,hi=`commonjs`;function gi(e){if(typeof e==`string`){if(e=e.toLowerCase(),/\.(?:mjs|mts)$/i.test(e))return mi;if(/\.(?:cjs|cts)$/i.test(e))return hi}}function _i(e){let{type:t=`JsExpressionRoot`,expression:n,comments:r=n?.comments??[],text:i,rootMarker:a}=e,o={type:t,comments:r,range:[0,i.length],rootMarker:a};return n&&(delete n.comments,o.node=n),o}var vi=_i,X=e=>Y(Ti(e)),yi={sourceType:mi,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,attachComment:!1,plugins:[`doExpressions`,`exportDefaultFrom`,`functionBind`,`functionSent`,`throwExpressions`,[`partialApplication`,{version:`2018-07`}],`decorators`,`moduleBlocks`,`asyncDoExpressions`,`destructuringPrivate`,`decoratorAutoAccessors`,`sourcePhaseImports`,`deferredImportEvaluation`,[`optionalChainingAssign`,{version:`2023-07`}],[`discardBinding`,{syntaxType:`void`}]],tokens:!1,ranges:!1},bi=`v8intrinsic`,xi=[[`pipelineOperator`,{proposal:`hack`,topicToken:`%`}],[`pipelineOperator`,{proposal:`fsharp`}]],Z=(e,t=yi)=>({...t,plugins:[...t.plugins,...e]}),Si=/@(?:no)?flow\b/;function Ci(e,t){if(t?.endsWith(`.js.flow`))return!0;let n=er(e);n&&(e=e.slice(n.length));let r=Zn(e,0);return r!==!1&&(e=e.slice(0,r)),Si.test(e)}function wi(e,t,n){let r=e(t,n),i=r.errors.find(e=>!Ei.has(e.reasonCode));if(i)throw i;return r}function Ti({isExpression:e=!1,optionsCombinations:t}){return(n,r={})=>{let{filepath:i}=r;if(typeof i!=`string`&&(i=void 0),(r.parser===`babel`||r.parser===`__babel_estree`)&&Ci(n,i))return r.parser=`babel-flow`,Mi.parse(n,r);let a=t,o=r.__babelSourceType??gi(i);o&&o!==mi&&(a=a.map(e=>({...e,sourceType:o,...o===hi?{allowReturnOutsideFunction:void 0,allowNewTargetOutsideFunction:void 0}:void 0})));let s=/%[A-Z]/.test(n);n.includes(`|>`)?a=(s?[...xi,bi]:xi).flatMap(e=>a.map(t=>Z([e],t))):s&&(a=a.map(e=>Z([bi],e)));let c=e?In:Fn,l;try{l=Qn(a.map(e=>()=>wi(c,n,e)))}catch({errors:[e]}){throw Xr(e)}return e&&(l=vi({expression:l,text:n,rootMarker:r.rootMarker})),Gr(l,{text:n})}}var Ei=new Set([`StrictNumericEscape`,`StrictWith`,`StrictOctalLiteral`,`StrictDelete`,`StrictEvalArguments`,`StrictEvalArgumentsBinding`,`StrictFunction`,`ForInOfLoopInitializer`,`ParamDupe`,`RestTrailingComma`,`UnsupportedParameterDecorator`,`UnterminatedJsxContent`,`UnexpectedReservedWord`,`ModuleAttributesWithDuplicateKeys`,`InvalidEscapeSequenceTemplate`,`NonAbstractClassHasAbstractMethod`,`PatternIsOptional`,`VarRedeclaration`,`InvalidPrivateFieldResolution`,`DuplicateExport`,`DeclarationMissingInitializer`,`DecoratorAbstractMethod`]),Di=[Z([`jsx`])],Oi=X({optionsCombinations:Di}),ki=X({optionsCombinations:[Z([`jsx`,`typescript`]),Z([`typescript`])]}),Ai=X({isExpression:!0,optionsCombinations:[Z([`jsx`])]}),ji=X({isExpression:!0,optionsCombinations:[Z([`typescript`])]}),Mi=X({optionsCombinations:[Z([`jsx`,[`flow`,{all:!0}],`flowComments`])]}),Ni=X({optionsCombinations:Di.map(e=>Z([`estree`],e))}),Pi={};t(Pi,{json:()=>Bi,"json-stringify":()=>Ui,json5:()=>Vi,jsonc:()=>Hi});function Fi(e){return Array.isArray(e)&&e.length>0}var Ii=Fi,Li={tokens:!1,ranges:!1,attachComment:!1,createParenthesizedExpressions:!0};function Ri(e){let t=Fn(e,Li),{program:n}=t;if(n.body.length===0&&n.directives.length===0&&!n.interpreter)return{comments:t.comments}}function zi(e,t={}){let{allowComments:n=!0,allowEmpty:r=!1}=t,i,a;try{i=In(e,Li),a=i.comments}catch(t){if(r&&t.code===`BABEL_PARSER_SYNTAX_ERROR`&&t.reasonCode===`ParseExpressionEmptyInput`)try{({comments:a}=Ri(e))}catch{}if(!a)throw Xr(t)}if(!n&&Ii(a))throw Q(a[0],`Comment`);return(!r||i)&&$(i),i=vi({type:`JsonRoot`,expression:i,comments:a,text:e}),i}function Q(e,t){let[n,r]=[e.loc.start,e.loc.end].map(({line:e,column:t})=>({line:e,column:t+1}));return qr(`${t} is not allowed in JSON.`,{loc:{start:n,end:r}})}function $(e){switch(e.type){case`ArrayExpression`:for(let t of e.elements)t!==null&&$(t);return;case`ObjectExpression`:for(let t of e.properties)$(t);return;case`ObjectProperty`:if(e.computed)throw Q(e.key,`Computed key`);if(e.shorthand)throw Q(e.key,`Shorthand property`);e.key.type!==`Identifier`&&$(e.key),$(e.value);return;case`UnaryExpression`:{let{operator:t,argument:n}=e;if(t!==`+`&&t!==`-`)throw Q(e,`Operator '${e.operator}'`);if(n.type===`NumericLiteral`||n.type===`Identifier`&&(n.name===`Infinity`||n.name===`NaN`))return;throw Q(n,`Operator '${t}' before '${n.type}'`)}case`Identifier`:if(e.name!==`Infinity`&&e.name!==`NaN`&&e.name!==`undefined`)throw Q(e,`Identifier '${e.name}'`);return;case`TemplateLiteral`:if(Ii(e.expressions))throw Q(e.expressions[0],`'TemplateLiteral' with expression`);for(let t of e.quasis)$(t);return;case`NullLiteral`:case`BooleanLiteral`:case`NumericLiteral`:case`StringLiteral`:case`TemplateElement`:return;default:throw Q(e,`'${e.type}'`)}}var Bi=Y({parse:e=>zi(e),hasPragma:()=>!0,hasIgnorePragma:()=>!1}),Vi=Y(e=>zi(e)),Hi=Y(e=>zi(e,{allowEmpty:!0})),Ui=Y({parse:e=>zi(e,{allowComments:!1}),astFormat:`estree-json`}),Wi={...r,...Pi};export{n as default,Wi as parsers};