@aussieljk/forkbook 0.0.0-stage → 0.0.1-2

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 (598) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +77 -2
  3. package/assets/addon-vitest/templates/vitest.config.4.template.ts +36 -0
  4. package/assets/browser/favicon-wrapper.svg +46 -0
  5. package/assets/browser/favicon.svg +1 -0
  6. package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
  7. package/assets/browser/nunito-sans-bold.woff2 +0 -0
  8. package/assets/browser/nunito-sans-italic.woff2 +0 -0
  9. package/assets/browser/nunito-sans-regular.woff2 +0 -0
  10. package/assets/builder-vite/iframe.html +99 -0
  11. package/assets/create/rendererAssets/.eslintrc.json +16 -0
  12. package/assets/create/rendererAssets/common/Configure.mdx +388 -0
  13. package/assets/create/rendererAssets/common/assets/accessibility.png +0 -0
  14. package/assets/create/rendererAssets/common/assets/accessibility.svg +1 -0
  15. package/assets/create/rendererAssets/common/assets/addon-library.png +0 -0
  16. package/assets/create/rendererAssets/common/assets/assets.png +0 -0
  17. package/assets/create/rendererAssets/common/assets/avif-test-image.avif +0 -0
  18. package/assets/create/rendererAssets/common/assets/context.png +0 -0
  19. package/assets/create/rendererAssets/common/assets/discord.svg +1 -0
  20. package/assets/create/rendererAssets/common/assets/docs.png +0 -0
  21. package/assets/create/rendererAssets/common/assets/figma-plugin.png +0 -0
  22. package/assets/create/rendererAssets/common/assets/github.svg +1 -0
  23. package/assets/create/rendererAssets/common/assets/share.png +0 -0
  24. package/assets/create/rendererAssets/common/assets/styling.png +0 -0
  25. package/assets/create/rendererAssets/common/assets/testing.png +0 -0
  26. package/assets/create/rendererAssets/common/assets/theming.png +0 -0
  27. package/assets/create/rendererAssets/common/assets/tutorials.svg +1 -0
  28. package/assets/create/rendererAssets/common/assets/youtube.svg +1 -0
  29. package/assets/create/rendererAssets/common/button.css +30 -0
  30. package/assets/create/rendererAssets/common/header.css +32 -0
  31. package/assets/create/rendererAssets/common/page.css +68 -0
  32. package/assets/create/templates/react-native/index.expo.js +20 -0
  33. package/assets/create/templates/react-native/index.js +25 -0
  34. package/assets/docs/addon-backgrounds.gif +0 -0
  35. package/assets/docs/addon-controls-args-annotated.png +0 -0
  36. package/assets/docs/addon-controls-args-background-color.png +0 -0
  37. package/assets/docs/addon-controls-args-background-string.png +0 -0
  38. package/assets/docs/addon-controls-args-docs.png +0 -0
  39. package/assets/docs/addon-controls-args-logging.png +0 -0
  40. package/assets/docs/addon-controls-args-no-annotation.png +0 -0
  41. package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
  42. package/assets/docs/addon-controls-args-reflow.png +0 -0
  43. package/assets/docs/addon-controls-args-template.png +0 -0
  44. package/assets/docs/addon-controls-expanded.png +0 -0
  45. package/assets/docs/addon-controls-hero.gif +0 -0
  46. package/assets/docs/addon-controls-install.png +0 -0
  47. package/assets/docs/hero.gif +0 -0
  48. package/assets/docs/highlight.png +0 -0
  49. package/assets/docs/message-reference.png +0 -0
  50. package/assets/docs/viewport.png +0 -0
  51. package/assets/react-native/metro-env.d.ts +69 -0
  52. package/assets/server/addon.tsconfig.json +6 -0
  53. package/assets/server/base-preview-body.html +116 -0
  54. package/assets/server/base-preview-head.html +494 -0
  55. package/assets/server/openBrowser.applescript +94 -0
  56. package/assets/server/template.ejs +87 -0
  57. package/dist/.build-stamp +0 -0
  58. package/dist/_browser-chunks/Color-PCLE2J36.js +1025 -0
  59. package/dist/_browser-chunks/DocsRenderer-JXND3PVQ.js +10 -0
  60. package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +1619 -0
  61. package/dist/_browser-chunks/chunk-2JDQ35OA.js +247 -0
  62. package/dist/_browser-chunks/chunk-2JT76G3E.js +104 -0
  63. package/dist/_browser-chunks/chunk-2MEPHP35.js +17 -0
  64. package/dist/_browser-chunks/chunk-2SCZVUKW.js +24 -0
  65. package/dist/_browser-chunks/chunk-46Z7NGAS.js +41 -0
  66. package/dist/_browser-chunks/chunk-4ATQOMJB.js +30 -0
  67. package/dist/_browser-chunks/chunk-52CW7FF7.js +49 -0
  68. package/dist/_browser-chunks/chunk-5I7E4GMO.js +62 -0
  69. package/dist/_browser-chunks/chunk-5P4QA6MY.js +20 -0
  70. package/dist/_browser-chunks/chunk-5WMXI5GW.js +816 -0
  71. package/dist/_browser-chunks/chunk-66OCZ54D.js +2604 -0
  72. package/dist/_browser-chunks/chunk-6SXYJQST.js +253 -0
  73. package/dist/_browser-chunks/chunk-AYRF6EJB.js +36 -0
  74. package/dist/_browser-chunks/chunk-B4AUNNU4.js +156 -0
  75. package/dist/_browser-chunks/chunk-BCP2FFXF.js +369 -0
  76. package/dist/_browser-chunks/chunk-C3D4HEFY.js +3396 -0
  77. package/dist/_browser-chunks/chunk-CFAOWGL7.js +43 -0
  78. package/dist/_browser-chunks/chunk-CFWWCCZV.js +223 -0
  79. package/dist/_browser-chunks/chunk-CNED6RYH.js +18 -0
  80. package/dist/_browser-chunks/chunk-DRQKCCAG.js +136 -0
  81. package/dist/_browser-chunks/chunk-ECQ75MKQ.js +0 -0
  82. package/dist/_browser-chunks/chunk-EIYAKDGP.js +302 -0
  83. package/dist/_browser-chunks/chunk-ENKK74N4.js +12 -0
  84. package/dist/_browser-chunks/chunk-FENFYI4X.js +698 -0
  85. package/dist/_browser-chunks/chunk-FJGWSWL5.js +155 -0
  86. package/dist/_browser-chunks/chunk-FVSEPWWX.js +2810 -0
  87. package/dist/_browser-chunks/chunk-GNZY6LOW.js +10116 -0
  88. package/dist/_browser-chunks/chunk-IE4ULIOQ.js +14 -0
  89. package/dist/_browser-chunks/chunk-IMSF75WX.js +42 -0
  90. package/dist/_browser-chunks/chunk-IWQGIXJS.js +14 -0
  91. package/dist/_browser-chunks/chunk-JMC7AIKT.js +108 -0
  92. package/dist/_browser-chunks/chunk-JPUOQJUI.js +8 -0
  93. package/dist/_browser-chunks/chunk-JSBKXXXF.js +218 -0
  94. package/dist/_browser-chunks/chunk-JWSKPMPC.js +73 -0
  95. package/dist/_browser-chunks/chunk-JYVGARBG.js +2943 -0
  96. package/dist/_browser-chunks/chunk-KBK7GKBN.js +35 -0
  97. package/dist/_browser-chunks/chunk-KQ7CRO2B.js +108 -0
  98. package/dist/_browser-chunks/chunk-LAWXTSXK.js +18 -0
  99. package/dist/_browser-chunks/chunk-LE2LTDW3.js +14 -0
  100. package/dist/_browser-chunks/chunk-LEVSOOLQ.js +48 -0
  101. package/dist/_browser-chunks/chunk-LV5PIKV4.js +93 -0
  102. package/dist/_browser-chunks/chunk-MDOL7KML.js +56 -0
  103. package/dist/_browser-chunks/chunk-MFMDGWP6.js +34 -0
  104. package/dist/_browser-chunks/chunk-MLBOOZL4.js +67 -0
  105. package/dist/_browser-chunks/chunk-NQUD4B7H.js +91 -0
  106. package/dist/_browser-chunks/chunk-NULBREPZ.js +43 -0
  107. package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
  108. package/dist/_browser-chunks/chunk-OD6IBQCC.js +117 -0
  109. package/dist/_browser-chunks/chunk-ODVJ3XZJ.js +157 -0
  110. package/dist/_browser-chunks/chunk-OQWFVDIN.js +386 -0
  111. package/dist/_browser-chunks/chunk-OVH3USFB.js +20 -0
  112. package/dist/_browser-chunks/chunk-OZZPSYQR.js +14 -0
  113. package/dist/_browser-chunks/chunk-P6PK47TQ.js +1970 -0
  114. package/dist/_browser-chunks/chunk-PFRNG3UC.js +22 -0
  115. package/dist/_browser-chunks/chunk-PJSMZ27A.js +13 -0
  116. package/dist/_browser-chunks/chunk-QC4HFS6K.js +41 -0
  117. package/dist/_browser-chunks/chunk-QDXFODK4.js +274 -0
  118. package/dist/_browser-chunks/chunk-RBCHTR7C.js +28 -0
  119. package/dist/_browser-chunks/chunk-RMYQ3QN3.js +294 -0
  120. package/dist/_browser-chunks/chunk-RNTIV5CE.js +411 -0
  121. package/dist/_browser-chunks/chunk-RSPAQWVJ.js +80 -0
  122. package/dist/_browser-chunks/chunk-S6TK43XQ.js +836 -0
  123. package/dist/_browser-chunks/chunk-SC67XZST.js +18 -0
  124. package/dist/_browser-chunks/chunk-SFVA4SBT.js +683 -0
  125. package/dist/_browser-chunks/chunk-SZYFOQMT.js +25 -0
  126. package/dist/_browser-chunks/chunk-TBJCJXK4.js +18 -0
  127. package/dist/_browser-chunks/chunk-UMDO3KB7.js +205 -0
  128. package/dist/_browser-chunks/chunk-V2G23FV7.js +11 -0
  129. package/dist/_browser-chunks/chunk-V5M7Q4HT.js +88 -0
  130. package/dist/_browser-chunks/chunk-W5M6NPS3.js +198 -0
  131. package/dist/_browser-chunks/chunk-W7NE2JXW.js +84 -0
  132. package/dist/_browser-chunks/chunk-WGVAAM43.js +1110 -0
  133. package/dist/_browser-chunks/chunk-WHQRNHXD.js +8 -0
  134. package/dist/_browser-chunks/chunk-WOSOWBCA.js +12 -0
  135. package/dist/_browser-chunks/chunk-WZ7KR7SH.js +85 -0
  136. package/dist/_browser-chunks/chunk-YEKO6BHJ.js +20 -0
  137. package/dist/_browser-chunks/chunk-YI2IBIQS.js +7 -0
  138. package/dist/_browser-chunks/chunk-YTIT5NA5.js +1966 -0
  139. package/dist/_browser-chunks/chunk-ZEHRUHTA.js +6 -0
  140. package/dist/_browser-chunks/chunk-ZTQ5MEJ5.js +203 -0
  141. package/dist/_browser-chunks/matchers-YLBYSYAF.js +1263 -0
  142. package/dist/_browser-chunks/react-dom-client-4OHE3QDV.js +9 -0
  143. package/dist/_node-chunks/attached-runtime-I2G4WLJI.js +282 -0
  144. package/dist/_node-chunks/builder-manager-VVHYQXCH.js +1661 -0
  145. package/dist/_node-chunks/chunk-2BUPBPFB.js +82 -0
  146. package/dist/_node-chunks/chunk-2DSIDINN.js +884 -0
  147. package/dist/_node-chunks/chunk-2RU7BKEW.js +23 -0
  148. package/dist/_node-chunks/chunk-34EO2PUT.js +26 -0
  149. package/dist/_node-chunks/chunk-3BKIBF5S.js +3008 -0
  150. package/dist/_node-chunks/chunk-3SDUYDXH.js +98 -0
  151. package/dist/_node-chunks/chunk-3T4ZSNPH.js +662 -0
  152. package/dist/_node-chunks/chunk-3W7F2B7P.js +79 -0
  153. package/dist/_node-chunks/chunk-3Y6AAY5H.js +80 -0
  154. package/dist/_node-chunks/chunk-42UWAGPW.js +1193 -0
  155. package/dist/_node-chunks/chunk-4FEANXWU.js +1986 -0
  156. package/dist/_node-chunks/chunk-5DQFEZEA.js +40 -0
  157. package/dist/_node-chunks/chunk-6KEHV53S.js +1218 -0
  158. package/dist/_node-chunks/chunk-6LMWA44H.js +3837 -0
  159. package/dist/_node-chunks/chunk-6YKBRP72.js +20 -0
  160. package/dist/_node-chunks/chunk-7GUDZVRQ.js +110 -0
  161. package/dist/_node-chunks/chunk-B5J7Q7J4.js +21 -0
  162. package/dist/_node-chunks/chunk-BS2WMZMR.js +90 -0
  163. package/dist/_node-chunks/chunk-BSKFCWQD.js +47 -0
  164. package/dist/_node-chunks/chunk-BXVYT7SB.js +36 -0
  165. package/dist/_node-chunks/chunk-CCOTJ4FC.js +688 -0
  166. package/dist/_node-chunks/chunk-CQKMLL5J.js +33 -0
  167. package/dist/_node-chunks/chunk-CXRU72ET.js +63 -0
  168. package/dist/_node-chunks/chunk-DC7DKR5K.js +20 -0
  169. package/dist/_node-chunks/chunk-DHJFTB4K.js +25 -0
  170. package/dist/_node-chunks/chunk-DUR55DJJ.js +1094 -0
  171. package/dist/_node-chunks/chunk-E6YESGLX.js +7032 -0
  172. package/dist/_node-chunks/chunk-EHUNOMDD.js +52345 -0
  173. package/dist/_node-chunks/chunk-ET7PWEO7.js +298 -0
  174. package/dist/_node-chunks/chunk-EWOX7HPJ.js +20 -0
  175. package/dist/_node-chunks/chunk-F3ZFKBHY.js +844 -0
  176. package/dist/_node-chunks/chunk-FK7KGTV7.js +26 -0
  177. package/dist/_node-chunks/chunk-FPZB5OI7.js +35 -0
  178. package/dist/_node-chunks/chunk-FW2HQUBQ.js +25 -0
  179. package/dist/_node-chunks/chunk-FY6UXW6G.js +11 -0
  180. package/dist/_node-chunks/chunk-GEFQN7K3.js +499 -0
  181. package/dist/_node-chunks/chunk-GRBLDJCR.js +989 -0
  182. package/dist/_node-chunks/chunk-H32DYT6P.js +87 -0
  183. package/dist/_node-chunks/chunk-H4PPVMP5.js +23 -0
  184. package/dist/_node-chunks/chunk-HMP2G23X.js +25 -0
  185. package/dist/_node-chunks/chunk-ICPBH3E7.js +59 -0
  186. package/dist/_node-chunks/chunk-IDEL2J23.js +23 -0
  187. package/dist/_node-chunks/chunk-IK4FGZLR.js +223 -0
  188. package/dist/_node-chunks/chunk-JDXXX6LB.js +68 -0
  189. package/dist/_node-chunks/chunk-JGGFYIG5.js +5468 -0
  190. package/dist/_node-chunks/chunk-JPAZLYJ3.js +29 -0
  191. package/dist/_node-chunks/chunk-JZOO7GGC.js +48 -0
  192. package/dist/_node-chunks/chunk-KISMCCP5.js +4744 -0
  193. package/dist/_node-chunks/chunk-LCK4ZQKG.js +115 -0
  194. package/dist/_node-chunks/chunk-LO56I6E2.js +132 -0
  195. package/dist/_node-chunks/chunk-LXBD4UL4.js +104 -0
  196. package/dist/_node-chunks/chunk-MA24JW6C.js +7162 -0
  197. package/dist/_node-chunks/chunk-MK2KYAI6.js +5414 -0
  198. package/dist/_node-chunks/chunk-NDWKJ4CL.js +2102 -0
  199. package/dist/_node-chunks/chunk-NIBT7XDZ.js +168 -0
  200. package/dist/_node-chunks/chunk-NPO45IMH.js +33 -0
  201. package/dist/_node-chunks/chunk-OISX4AGQ.js +414 -0
  202. package/dist/_node-chunks/chunk-OUW6R7C3.js +26 -0
  203. package/dist/_node-chunks/chunk-OWNFOGTA.js +194 -0
  204. package/dist/_node-chunks/chunk-Q7QNUM5H.js +49 -0
  205. package/dist/_node-chunks/chunk-QEQLR22M.js +1877 -0
  206. package/dist/_node-chunks/chunk-RRN2V55B.js +45 -0
  207. package/dist/_node-chunks/chunk-RWFIFGO5.js +144 -0
  208. package/dist/_node-chunks/chunk-RXNJDRGO.js +209 -0
  209. package/dist/_node-chunks/chunk-RZMQ7S3L.js +92 -0
  210. package/dist/_node-chunks/chunk-SIEXZVCR.js +51 -0
  211. package/dist/_node-chunks/chunk-SLWQNBGO.js +2034 -0
  212. package/dist/_node-chunks/chunk-SVTBJ7Q3.js +35 -0
  213. package/dist/_node-chunks/chunk-SWO5CDYU.js +32 -0
  214. package/dist/_node-chunks/chunk-TD5PLLQG.js +121 -0
  215. package/dist/_node-chunks/chunk-TEQGGSP7.js +33 -0
  216. package/dist/_node-chunks/chunk-TFCEV2XX.js +155 -0
  217. package/dist/_node-chunks/chunk-TFEWM4E3.js +1073 -0
  218. package/dist/_node-chunks/chunk-TINO74G5.js +21 -0
  219. package/dist/_node-chunks/chunk-TNJIXE37.js +40 -0
  220. package/dist/_node-chunks/chunk-TWI4GVH7.js +19 -0
  221. package/dist/_node-chunks/chunk-U5W53R2J.js +1011 -0
  222. package/dist/_node-chunks/chunk-UBOGWBEA.js +148 -0
  223. package/dist/_node-chunks/chunk-UMUBKI6E.js +3787 -0
  224. package/dist/_node-chunks/chunk-UVINFLGY.js +56 -0
  225. package/dist/_node-chunks/chunk-V2DY426G.js +1133 -0
  226. package/dist/_node-chunks/chunk-VLOXOXXE.js +45 -0
  227. package/dist/_node-chunks/chunk-W4OMYLSP.js +1297 -0
  228. package/dist/_node-chunks/chunk-WAXVSN3O.js +18 -0
  229. package/dist/_node-chunks/chunk-WCULS5TP.js +3767 -0
  230. package/dist/_node-chunks/chunk-WNZ2UMFM.js +153 -0
  231. package/dist/_node-chunks/chunk-WZJF2OUH.js +74 -0
  232. package/dist/_node-chunks/chunk-XGIUVY52.js +611 -0
  233. package/dist/_node-chunks/chunk-XHL2LVBM.js +415 -0
  234. package/dist/_node-chunks/chunk-XI6B6P47.js +59 -0
  235. package/dist/_node-chunks/chunk-XLP2ZKXV.js +60 -0
  236. package/dist/_node-chunks/chunk-YCMRA6RX.js +95 -0
  237. package/dist/_node-chunks/chunk-YZFWBA5L.js +2700 -0
  238. package/dist/_node-chunks/chunk-ZMAMXQKP.js +4731 -0
  239. package/dist/_node-chunks/chunk-ZWBCQ4MJ.js +110 -0
  240. package/dist/_node-chunks/dist-VTSTZKUB.js +16 -0
  241. package/dist/_node-chunks/globby-OEMHPBFY.js +2884 -0
  242. package/dist/_node-chunks/jiti-NFX6UU74.js +3848 -0
  243. package/dist/_node-chunks/lib-MDVARD7W.js +366 -0
  244. package/dist/_node-chunks/local-runtime-NTKIN2QT.js +78 -0
  245. package/dist/_node-chunks/mdx-plugin-MWISDWDQ.js +5680 -0
  246. package/dist/_node-chunks/monorepo-LIRFMQXE.js +121 -0
  247. package/dist/_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js +121 -0
  248. package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +22 -0
  249. package/dist/_node-chunks/pattern-copy-play-EKHIUAU2.js +807 -0
  250. package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +20 -0
  251. package/dist/_node-chunks/rehype-external-links-BUN3HUCO.js +121 -0
  252. package/dist/_node-chunks/rehype-slug-PLADX223.js +52 -0
  253. package/dist/_node-chunks/relaxed-limits-GBHW6KIQ.js +117 -0
  254. package/dist/_node-chunks/run-KDTIZNSY.js +103 -0
  255. package/dist/_node-chunks/run-NL66VTNR.js +4532 -0
  256. package/dist/_node-chunks/session-id-KIIVOQLR.js +23 -0
  257. package/dist/_node-chunks/setup-MGC7BQO6.js +278 -0
  258. package/dist/_node-chunks/vitest.config.4.template-JH2THZFG.js +54 -0
  259. package/dist/actions/decorator.d.ts +7 -0
  260. package/dist/actions/decorator.js +43 -0
  261. package/dist/actions/index.d.ts +67 -0
  262. package/dist/actions/index.js +28 -0
  263. package/dist/addon-a11y/index.d.ts +52 -0
  264. package/dist/addon-a11y/index.js +16 -0
  265. package/dist/addon-a11y/manager.js +1429 -0
  266. package/dist/addon-a11y/preset.js +18 -0
  267. package/dist/addon-a11y/preview.d.ts +17 -0
  268. package/dist/addon-a11y/preview.js +15 -0
  269. package/dist/addon-docs/blocks.d.ts +1061 -0
  270. package/dist/addon-docs/blocks.js +2461 -0
  271. package/dist/addon-docs/index.d.ts +236 -0
  272. package/dist/addon-docs/index.js +16 -0
  273. package/dist/addon-docs/manager.js +90 -0
  274. package/dist/addon-docs/mdx-react-shim.d.ts +1 -0
  275. package/dist/addon-docs/mdx-react-shim.js +2 -0
  276. package/dist/addon-docs/preset.js +378 -0
  277. package/dist/addon-docs/preview.d.ts +4 -0
  278. package/dist/addon-docs/preview.js +7 -0
  279. package/dist/addon-links/index.d.ts +22 -0
  280. package/dist/addon-links/index.js +20 -0
  281. package/dist/addon-links/manager.js +14 -0
  282. package/dist/addon-links/preview.d.ts +6 -0
  283. package/dist/addon-links/preview.js +9 -0
  284. package/dist/addon-links/react/index.d.ts +25 -0
  285. package/dist/addon-links/react/index.js +52 -0
  286. package/dist/addon-mcp/preset.js +1345 -0
  287. package/dist/addon-mcp/preview.js +29 -0
  288. package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +1153 -0
  289. package/dist/addon-ondevice-actions/index.d.ts +4 -0
  290. package/dist/addon-ondevice-actions/index.js +7 -0
  291. package/dist/addon-ondevice-actions/register.js +7 -0
  292. package/dist/addon-ondevice-controls/index.d.ts +6 -0
  293. package/dist/addon-ondevice-controls/index.js +14 -0
  294. package/dist/addon-ondevice-controls/register.js +10 -0
  295. package/dist/addon-pseudo-states/index.d.ts +35 -0
  296. package/dist/addon-pseudo-states/index.js +15 -0
  297. package/dist/addon-pseudo-states/manager.js +53 -0
  298. package/dist/addon-pseudo-states/preview.d.ts +9 -0
  299. package/dist/addon-pseudo-states/preview.js +10 -0
  300. package/dist/addon-themes/index.d.ts +80 -0
  301. package/dist/addon-themes/index.js +104 -0
  302. package/dist/addon-themes/manager.js +97 -0
  303. package/dist/addon-themes/postinstall.js +33 -0
  304. package/dist/addon-themes/preview.d.ts +6 -0
  305. package/dist/addon-themes/preview.js +8 -0
  306. package/dist/addon-vitest/constants.d.ts +132 -0
  307. package/dist/addon-vitest/constants.js +66 -0
  308. package/dist/addon-vitest/index.d.ts +4 -0
  309. package/dist/addon-vitest/index.js +8 -0
  310. package/dist/addon-vitest/manager.js +665 -0
  311. package/dist/addon-vitest/node/coverage-reporter.js +1284 -0
  312. package/dist/addon-vitest/node/vitest.js +674 -0
  313. package/dist/addon-vitest/postinstall.js +24 -0
  314. package/dist/addon-vitest/preset.js +943 -0
  315. package/dist/addon-vitest/vitest-plugin/global-setup.js +162 -0
  316. package/dist/addon-vitest/vitest-plugin/index.d.ts +56 -0
  317. package/dist/addon-vitest/vitest-plugin/index.js +463 -0
  318. package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +9 -0
  319. package/dist/addon-vitest/vitest-plugin/setup-file.browser.4.js +20 -0
  320. package/dist/addon-vitest/vitest-plugin/setup-file.js +50 -0
  321. package/dist/addon-vitest/vitest-plugin/test-utils.js +128 -0
  322. package/dist/babel/index.d.ts +2301 -0
  323. package/dist/babel/index.js +61 -0
  324. package/dist/backgrounds/index.d.ts +6 -0
  325. package/dist/backgrounds/index.js +15 -0
  326. package/dist/bin/core.js +1705 -0
  327. package/dist/bin/dispatcher.js +43 -0
  328. package/dist/bin/loader.js +115 -0
  329. package/dist/builder-vite/index.d.ts +50 -0
  330. package/dist/builder-vite/index.js +245 -0
  331. package/dist/builder-vite/preset.js +27 -0
  332. package/dist/channels/index.d.ts +2 -0
  333. package/dist/channels/index.js +352 -0
  334. package/dist/chunk-B2t1tGRh.d.ts +284 -0
  335. package/dist/chunk-BCoJQE-f.d.ts +602 -0
  336. package/dist/chunk-BGkgZp-H.d.ts +214 -0
  337. package/dist/chunk-BTVrWliM.d.ts +115 -0
  338. package/dist/chunk-BXLImeLy.d.ts +197 -0
  339. package/dist/chunk-BfBzpgct.d.ts +916 -0
  340. package/dist/chunk-Bpi2tz-6.d.ts +511 -0
  341. package/dist/chunk-BxWufQms.d.ts +142 -0
  342. package/dist/chunk-C-bavsOH.d.ts +34 -0
  343. package/dist/chunk-C2p5r3Vt.d.ts +13001 -0
  344. package/dist/chunk-C6PAgHLT.d.ts +12 -0
  345. package/dist/chunk-CMeX4WRe.d.ts +179 -0
  346. package/dist/chunk-Ct9xd6IM.d.ts +65 -0
  347. package/dist/chunk-CwQKNaYL.d.ts +15 -0
  348. package/dist/chunk-D7DwV41f.d.ts +3622 -0
  349. package/dist/chunk-DEVFdzxR.d.ts +253 -0
  350. package/dist/chunk-DaVb55-_.d.ts +124 -0
  351. package/dist/chunk-DgRNfmj_.d.ts +40 -0
  352. package/dist/chunk-DoIGKY33.d.ts +666 -0
  353. package/dist/chunk-Dr3R0DXk.d.ts +40 -0
  354. package/dist/chunk-DtHByo32.d.ts +55 -0
  355. package/dist/chunk-Dw1z1Pki.d.ts +933 -0
  356. package/dist/chunk-DzuY9DXg.d.ts +79 -0
  357. package/dist/chunk-FjDVzZTj.d.ts +62 -0
  358. package/dist/chunk-Kt1tW-D1.d.ts +59 -0
  359. package/dist/chunk-XP8oHzpE.d.ts +6 -0
  360. package/dist/chunk-gCX81nOr.d.ts +61 -0
  361. package/dist/chunk-pcFXCimE.d.ts +741 -0
  362. package/dist/cli/index.d.ts +1174 -0
  363. package/dist/cli/index.js +5613 -0
  364. package/dist/cli/skills/content/index.d.ts +72 -0
  365. package/dist/cli/skills/content/index.js +335 -0
  366. package/dist/cli/tools/sdk/child-host.d.ts +61 -0
  367. package/dist/cli/tools/sdk/child-host.js +131 -0
  368. package/dist/cli/tools/sdk/index.d.ts +137 -0
  369. package/dist/cli/tools/sdk/index.js +44 -0
  370. package/dist/cli-commands/bin/index.js +25 -0
  371. package/dist/client-logger/index.d.ts +31 -0
  372. package/dist/client-logger/index.js +63 -0
  373. package/dist/common/index.d.ts +1103 -0
  374. package/dist/common/index.js +364 -0
  375. package/dist/components/index.d.ts +1924 -0
  376. package/dist/components/index.js +13759 -0
  377. package/dist/core-events/index.d.ts +155 -0
  378. package/dist/core-events/index.js +136 -0
  379. package/dist/core-server/index.d.ts +2200 -0
  380. package/dist/core-server/index.js +4165 -0
  381. package/dist/core-server/presets/common-manager.css +170 -0
  382. package/dist/core-server/presets/common-manager.js +4168 -0
  383. package/dist/core-server/presets/common-override-preset.js +81 -0
  384. package/dist/core-server/presets/common-preset.js +2187 -0
  385. package/dist/create/bin/index.js +23 -0
  386. package/dist/create/index.js +25 -0
  387. package/dist/csf/csf-utils.d.ts +2 -0
  388. package/dist/csf/csf-utils.js +19 -0
  389. package/dist/csf/index.d.ts +7 -0
  390. package/dist/csf/index.js +2142 -0
  391. package/dist/csf-tools/index.d.ts +1157 -0
  392. package/dist/csf-tools/index.js +736 -0
  393. package/dist/docs-tools/index.d.ts +197 -0
  394. package/dist/docs-tools/index.js +61 -0
  395. package/dist/highlight/index.d.ts +10 -0
  396. package/dist/highlight/index.js +15 -0
  397. package/dist/instrumenter/index.d.ts +113 -0
  398. package/dist/instrumenter/index.js +2595 -0
  399. package/dist/manager/_manager-chunks/globals-runtime-8HkdnU2F.js +6144 -0
  400. package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +3389 -0
  401. package/dist/manager/_manager-chunks/globals-runtime-BdGkqNEt.js +45 -0
  402. package/dist/manager/_manager-chunks/globals-runtime-BmphMP6z.js +1190 -0
  403. package/dist/manager/_manager-chunks/globals-runtime-BvM-NY2g.js +13307 -0
  404. package/dist/manager/_manager-chunks/globals-runtime-C02fvgcd.js +9243 -0
  405. package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +9766 -0
  406. package/dist/manager/_manager-chunks/globals-runtime-DpNYC-qi.js +5564 -0
  407. package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +5357 -0
  408. package/dist/manager/_manager-chunks/globals-runtime-DwFqpqya.js +722 -0
  409. package/dist/manager/_manager-chunks/globals-runtime-FC201B7s.js +6837 -0
  410. package/dist/manager/_manager-chunks/globals-runtime-Rp_zjGnh.js +121 -0
  411. package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +10463 -0
  412. package/dist/manager/_manager-chunks/globals-runtime-eLPTIfX-.js +7759 -0
  413. package/dist/manager/_manager-chunks/globals-runtime-qKvCZHFY.js +4468 -0
  414. package/dist/manager/_manager-chunks/globals-runtime-sGpNlIJ1.js +5102 -0
  415. package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +452 -0
  416. package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +22 -0
  417. package/dist/manager/_manager-chunks/runtime-BhkT2CXl.js +1408 -0
  418. package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +998 -0
  419. package/dist/manager/_manager-chunks/runtime-D0UOWx0U.js +979 -0
  420. package/dist/manager/_manager-chunks/runtime-D94Vq3oR.js +4014 -0
  421. package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +77 -0
  422. package/dist/manager/_manager-chunks/runtime-EITvVbkG.js +46 -0
  423. package/dist/manager/_manager-chunks/runtime-cp5pazY2.js +8936 -0
  424. package/dist/manager/_manager-chunks/runtime-eDVAYF7N.js +6860 -0
  425. package/dist/manager/_manager-chunks/runtime-i-PDAHLR.js +2493 -0
  426. package/dist/manager/globals-runtime.js +2 -0
  427. package/dist/manager/globals.d.ts +23 -0
  428. package/dist/manager/globals.js +26 -0
  429. package/dist/manager/manager-stores.d.ts +2 -0
  430. package/dist/manager/manager-stores.js +19 -0
  431. package/dist/manager/runtime.js +2 -0
  432. package/dist/manager-api/index.d.ts +2 -0
  433. package/dist/manager-api/index.js +3257 -0
  434. package/dist/manager-errors.d.ts +89 -0
  435. package/dist/manager-errors.js +20 -0
  436. package/dist/mcp/index.d.ts +270 -0
  437. package/dist/mcp/index.js +305 -0
  438. package/dist/mocking-utils/index.d.ts +689 -0
  439. package/dist/mocking-utils/index.js +521 -0
  440. package/dist/mocking-utils/mocker-runtime.js +1254 -0
  441. package/dist/nextjs-vite/config/preview.js +3 -0
  442. package/dist/nextjs-vite/export-mocks/cache/index.d.ts +25 -0
  443. package/dist/nextjs-vite/export-mocks/cache/index.js +29 -0
  444. package/dist/nextjs-vite/export-mocks/headers/index.d.ts +37 -0
  445. package/dist/nextjs-vite/export-mocks/headers/index.js +54 -0
  446. package/dist/nextjs-vite/export-mocks/link/index.d.ts +9 -0
  447. package/dist/nextjs-vite/export-mocks/link/index.js +59 -0
  448. package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +28 -0
  449. package/dist/nextjs-vite/export-mocks/navigation/index.js +58 -0
  450. package/dist/nextjs-vite/export-mocks/router/index.d.ts +34 -0
  451. package/dist/nextjs-vite/export-mocks/router/index.js +63 -0
  452. package/dist/nextjs-vite/index.d.ts +92 -0
  453. package/dist/nextjs-vite/index.js +58 -0
  454. package/dist/nextjs-vite/node/index.d.ts +6 -0
  455. package/dist/nextjs-vite/node/index.js +20 -0
  456. package/dist/nextjs-vite/preset.js +648 -0
  457. package/dist/nextjs-vite/preview.d.ts +20 -0
  458. package/dist/nextjs-vite/preview.js +11 -0
  459. package/dist/nextjs-vite/vite-plugin/index.d.ts +6 -0
  460. package/dist/nextjs-vite/vite-plugin/index.js +19 -0
  461. package/dist/nextjs-vite-plugin/index.d.ts +28 -0
  462. package/dist/nextjs-vite-plugin/index.js +923 -0
  463. package/dist/nextjs-vite-plugin/mocks/storybook.global.js +29 -0
  464. package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-context.js +8 -0
  465. package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-default-loader.js +23 -0
  466. package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +28 -0
  467. package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +17 -0
  468. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/cache/index.js +29 -0
  469. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/dynamic/index.js +40 -0
  470. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/headers/index.js +55 -0
  471. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/link/index.js +63 -0
  472. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/navigation/index.js +71 -0
  473. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +74 -0
  474. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/rsc/server-only.js +7 -0
  475. package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/safe-stable-stringify/index.js +13 -0
  476. package/dist/nextjs-vite-plugin/plugins/next-mocks/compatibility/draft-mode.compat.js +7 -0
  477. package/dist/node-logger/index.d.ts +495 -0
  478. package/dist/node-logger/index.js +42 -0
  479. package/dist/oxc-parser/index.d.ts +99 -0
  480. package/dist/oxc-parser/index.js +275 -0
  481. package/dist/oxc-parser/worker.js +37 -0
  482. package/dist/preview/_chunks/runtime-BIzIdDbb.js +10263 -0
  483. package/dist/preview/_chunks/runtime-BTPtVY1p.js +1102 -0
  484. package/dist/preview/_chunks/runtime-BZSnICCg.js +8484 -0
  485. package/dist/preview/_chunks/runtime-BdGkqNEt.js +45 -0
  486. package/dist/preview/_chunks/runtime-BwSxqk3t.js +63 -0
  487. package/dist/preview/_chunks/runtime-CqHxptiK.js +6143 -0
  488. package/dist/preview/_chunks/runtime-CsV4HZPV.js +5064 -0
  489. package/dist/preview/_chunks/runtime-CxZK_Ln3.js +284 -0
  490. package/dist/preview/_chunks/runtime-DZToXfvO.js +9767 -0
  491. package/dist/preview/_chunks/runtime-DrTjJkPY.js +3872 -0
  492. package/dist/preview/_chunks/runtime-DuHdxMFA.js +387 -0
  493. package/dist/preview/_chunks/runtime-iXdo8CR8.js +3635 -0
  494. package/dist/preview/_chunks/runtime-q3wt0e_N.js +6838 -0
  495. package/dist/preview/globals.d.ts +16 -0
  496. package/dist/preview/globals.js +20 -0
  497. package/dist/preview/runtime.js +6 -0
  498. package/dist/preview-api/index.d.ts +4 -0
  499. package/dist/preview-api/index.js +147 -0
  500. package/dist/preview-errors.d.ts +186 -0
  501. package/dist/preview-errors.js +56 -0
  502. package/dist/react/docgen/docgen-worker.js +38 -0
  503. package/dist/react/entry-preview-argtypes.js +9 -0
  504. package/dist/react/entry-preview-docs.js +12 -0
  505. package/dist/react/entry-preview-rsc.js +11 -0
  506. package/dist/react/entry-preview.js +21 -0
  507. package/dist/react/index.d.ts +119 -0
  508. package/dist/react/index.js +26 -0
  509. package/dist/react/preset.js +301 -0
  510. package/dist/react/preview.d.ts +2 -0
  511. package/dist/react/preview.js +11 -0
  512. package/dist/react-native/bin/get-stories.js +34 -0
  513. package/dist/react-native/index.d.ts +160 -0
  514. package/dist/react-native/index.js +1547 -0
  515. package/dist/react-native/metro/node.d.ts +83 -0
  516. package/dist/react-native/metro/node.js +21 -0
  517. package/dist/react-native/metro/withStorybook.d.ts +2269 -0
  518. package/dist/react-native/metro/withStorybook.js +138 -0
  519. package/dist/react-native/preview.d.ts +6 -0
  520. package/dist/react-native/preview.js +20 -0
  521. package/dist/react-native/scripts/generate.d.ts +22 -0
  522. package/dist/react-native/scripts/generate.js +18 -0
  523. package/dist/react-native/stub.js +20 -0
  524. package/dist/react-native-theming/index.d.ts +175 -0
  525. package/dist/react-native-theming/index.js +2591 -0
  526. package/dist/react-native-ui/index.d.ts +130 -0
  527. package/dist/react-native-ui/index.js +1448 -0
  528. package/dist/react-native-ui-common/index.d.ts +230 -0
  529. package/dist/react-native-ui-common/index.js +514 -0
  530. package/dist/react-vite/index.d.ts +4 -0
  531. package/dist/react-vite/index.js +8 -0
  532. package/dist/react-vite/node/index.d.ts +6 -0
  533. package/dist/react-vite/node/index.js +20 -0
  534. package/dist/react-vite/preset.d.ts +6 -0
  535. package/dist/react-vite/preset.js +21 -0
  536. package/dist/router/index.d.ts +141 -0
  537. package/dist/router/index.js +1217 -0
  538. package/dist/server-errors.d.ts +2 -0
  539. package/dist/server-errors.js +149 -0
  540. package/dist/shared/open-service/index.d.ts +3 -0
  541. package/dist/shared/open-service/index.js +115 -0
  542. package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +75 -0
  543. package/dist/shared/open-service/toolsets/docs/public.d.ts +1296 -0
  544. package/dist/shared/open-service/toolsets/docs/public.js +991 -0
  545. package/dist/telemetry/index.d.ts +314 -0
  546. package/dist/telemetry/index.js +103 -0
  547. package/dist/test/index.d.ts +158 -0
  548. package/dist/test/index.js +19421 -0
  549. package/dist/theming/create.d.ts +15 -0
  550. package/dist/theming/create.js +11 -0
  551. package/dist/theming/index.d.ts +54 -0
  552. package/dist/theming/index.js +511 -0
  553. package/dist/types/index.d.ts +2 -0
  554. package/dist/types/index.js +48 -0
  555. package/dist/viewport/index.d.ts +275 -0
  556. package/dist/viewport/index.js +21 -0
  557. package/package.json +1054 -4
  558. package/template/nextjs-vite/cli/.eslintrc.json +6 -0
  559. package/template/nextjs-vite/cli/js/Button.jsx +42 -0
  560. package/template/nextjs-vite/cli/js/Button.stories.js +49 -0
  561. package/template/nextjs-vite/cli/js/Configure.mdx +470 -0
  562. package/template/nextjs-vite/cli/js/Header.jsx +58 -0
  563. package/template/nextjs-vite/cli/js/Header.stories.js +30 -0
  564. package/template/nextjs-vite/cli/js/Page.jsx +68 -0
  565. package/template/nextjs-vite/cli/js/Page.stories.js +28 -0
  566. package/template/nextjs-vite/cli/ts/Button.stories.ts +54 -0
  567. package/template/nextjs-vite/cli/ts/Button.tsx +39 -0
  568. package/template/nextjs-vite/cli/ts/Configure.mdx +446 -0
  569. package/template/nextjs-vite/cli/ts/Header.stories.ts +34 -0
  570. package/template/nextjs-vite/cli/ts/Header.tsx +54 -0
  571. package/template/nextjs-vite/cli/ts/Page.stories.ts +33 -0
  572. package/template/nextjs-vite/cli/ts/Page.tsx +73 -0
  573. package/template/react/cli/.eslintrc.json +5 -0
  574. package/template/react/cli/js/Button.jsx +39 -0
  575. package/template/react/cli/js/Button.stories.js +49 -0
  576. package/template/react/cli/js/Header.jsx +56 -0
  577. package/template/react/cli/js/Header.stories.js +29 -0
  578. package/template/react/cli/js/Page.jsx +69 -0
  579. package/template/react/cli/js/Page.stories.js +28 -0
  580. package/template/react/cli/ts/Button.stories.ts +54 -0
  581. package/template/react/cli/ts/Button.tsx +37 -0
  582. package/template/react/cli/ts/Header.stories.ts +34 -0
  583. package/template/react/cli/ts/Header.tsx +56 -0
  584. package/template/react/cli/ts/Page.stories.ts +33 -0
  585. package/template/react/cli/ts/Page.tsx +73 -0
  586. package/template/react-vite/cli/.eslintrc.json +5 -0
  587. package/template/react-vite/cli/js/Button.jsx +39 -0
  588. package/template/react-vite/cli/js/Button.stories.js +49 -0
  589. package/template/react-vite/cli/js/Header.jsx +56 -0
  590. package/template/react-vite/cli/js/Header.stories.js +29 -0
  591. package/template/react-vite/cli/js/Page.jsx +69 -0
  592. package/template/react-vite/cli/js/Page.stories.js +28 -0
  593. package/template/react-vite/cli/ts/Button.stories.ts +54 -0
  594. package/template/react-vite/cli/ts/Button.tsx +37 -0
  595. package/template/react-vite/cli/ts/Header.stories.ts +34 -0
  596. package/template/react-vite/cli/ts/Header.tsx +56 -0
  597. package/template/react-vite/cli/ts/Page.stories.ts +33 -0
  598. package/template/react-vite/cli/ts/Page.tsx +73 -0
@@ -0,0 +1,4744 @@
1
+ import CJS_COMPAT_NODE_URL_ro17f80mg6k from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ro17f80mg6k from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ro17f80mg6k from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_ro17f80mg6k.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ro17f80mg6k.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ro17f80mg6k.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Forkbook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import {
13
+ require_lib
14
+ } from "./chunk-3T4ZSNPH.js";
15
+ import {
16
+ Parser,
17
+ init_acorn,
18
+ require_acorn_jsx
19
+ } from "./chunk-WCULS5TP.js";
20
+ import {
21
+ up2 as up
22
+ } from "./chunk-JDXXX6LB.js";
23
+ import {
24
+ __commonJS,
25
+ __toESM
26
+ } from "./chunk-CXRU72ET.js";
27
+
28
+ // ../../node_modules/estraverse/estraverse.js
29
+ var require_estraverse = __commonJS({
30
+ "../../node_modules/estraverse/estraverse.js"(exports) {
31
+ (function clone(exports2) {
32
+ "use strict";
33
+ var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE;
34
+ function deepCopy(obj) {
35
+ var ret = {}, key, val;
36
+ for (key in obj)
37
+ obj.hasOwnProperty(key) && (val = obj[key], typeof val == "object" && val !== null ? ret[key] = deepCopy(val) : ret[key] = val);
38
+ return ret;
39
+ }
40
+ function upperBound(array, func) {
41
+ var diff, len, i, current;
42
+ for (len = array.length, i = 0; len; )
43
+ diff = len >>> 1, current = i + diff, func(array[current]) ? len = diff : (i = current + 1, len -= diff + 1);
44
+ return i;
45
+ }
46
+ Syntax = {
47
+ AssignmentExpression: "AssignmentExpression",
48
+ AssignmentPattern: "AssignmentPattern",
49
+ ArrayExpression: "ArrayExpression",
50
+ ArrayPattern: "ArrayPattern",
51
+ ArrowFunctionExpression: "ArrowFunctionExpression",
52
+ AwaitExpression: "AwaitExpression",
53
+ // CAUTION: It's deferred to ES7.
54
+ BlockStatement: "BlockStatement",
55
+ BinaryExpression: "BinaryExpression",
56
+ BreakStatement: "BreakStatement",
57
+ CallExpression: "CallExpression",
58
+ CatchClause: "CatchClause",
59
+ ChainExpression: "ChainExpression",
60
+ ClassBody: "ClassBody",
61
+ ClassDeclaration: "ClassDeclaration",
62
+ ClassExpression: "ClassExpression",
63
+ ComprehensionBlock: "ComprehensionBlock",
64
+ // CAUTION: It's deferred to ES7.
65
+ ComprehensionExpression: "ComprehensionExpression",
66
+ // CAUTION: It's deferred to ES7.
67
+ ConditionalExpression: "ConditionalExpression",
68
+ ContinueStatement: "ContinueStatement",
69
+ DebuggerStatement: "DebuggerStatement",
70
+ DirectiveStatement: "DirectiveStatement",
71
+ DoWhileStatement: "DoWhileStatement",
72
+ EmptyStatement: "EmptyStatement",
73
+ ExportAllDeclaration: "ExportAllDeclaration",
74
+ ExportDefaultDeclaration: "ExportDefaultDeclaration",
75
+ ExportNamedDeclaration: "ExportNamedDeclaration",
76
+ ExportSpecifier: "ExportSpecifier",
77
+ ExpressionStatement: "ExpressionStatement",
78
+ ForStatement: "ForStatement",
79
+ ForInStatement: "ForInStatement",
80
+ ForOfStatement: "ForOfStatement",
81
+ FunctionDeclaration: "FunctionDeclaration",
82
+ FunctionExpression: "FunctionExpression",
83
+ GeneratorExpression: "GeneratorExpression",
84
+ // CAUTION: It's deferred to ES7.
85
+ Identifier: "Identifier",
86
+ IfStatement: "IfStatement",
87
+ ImportExpression: "ImportExpression",
88
+ ImportDeclaration: "ImportDeclaration",
89
+ ImportDefaultSpecifier: "ImportDefaultSpecifier",
90
+ ImportNamespaceSpecifier: "ImportNamespaceSpecifier",
91
+ ImportSpecifier: "ImportSpecifier",
92
+ Literal: "Literal",
93
+ LabeledStatement: "LabeledStatement",
94
+ LogicalExpression: "LogicalExpression",
95
+ MemberExpression: "MemberExpression",
96
+ MetaProperty: "MetaProperty",
97
+ MethodDefinition: "MethodDefinition",
98
+ ModuleSpecifier: "ModuleSpecifier",
99
+ NewExpression: "NewExpression",
100
+ ObjectExpression: "ObjectExpression",
101
+ ObjectPattern: "ObjectPattern",
102
+ PrivateIdentifier: "PrivateIdentifier",
103
+ Program: "Program",
104
+ Property: "Property",
105
+ PropertyDefinition: "PropertyDefinition",
106
+ RestElement: "RestElement",
107
+ ReturnStatement: "ReturnStatement",
108
+ SequenceExpression: "SequenceExpression",
109
+ SpreadElement: "SpreadElement",
110
+ Super: "Super",
111
+ SwitchStatement: "SwitchStatement",
112
+ SwitchCase: "SwitchCase",
113
+ TaggedTemplateExpression: "TaggedTemplateExpression",
114
+ TemplateElement: "TemplateElement",
115
+ TemplateLiteral: "TemplateLiteral",
116
+ ThisExpression: "ThisExpression",
117
+ ThrowStatement: "ThrowStatement",
118
+ TryStatement: "TryStatement",
119
+ UnaryExpression: "UnaryExpression",
120
+ UpdateExpression: "UpdateExpression",
121
+ VariableDeclaration: "VariableDeclaration",
122
+ VariableDeclarator: "VariableDeclarator",
123
+ WhileStatement: "WhileStatement",
124
+ WithStatement: "WithStatement",
125
+ YieldExpression: "YieldExpression"
126
+ }, VisitorKeys = {
127
+ AssignmentExpression: ["left", "right"],
128
+ AssignmentPattern: ["left", "right"],
129
+ ArrayExpression: ["elements"],
130
+ ArrayPattern: ["elements"],
131
+ ArrowFunctionExpression: ["params", "body"],
132
+ AwaitExpression: ["argument"],
133
+ // CAUTION: It's deferred to ES7.
134
+ BlockStatement: ["body"],
135
+ BinaryExpression: ["left", "right"],
136
+ BreakStatement: ["label"],
137
+ CallExpression: ["callee", "arguments"],
138
+ CatchClause: ["param", "body"],
139
+ ChainExpression: ["expression"],
140
+ ClassBody: ["body"],
141
+ ClassDeclaration: ["id", "superClass", "body"],
142
+ ClassExpression: ["id", "superClass", "body"],
143
+ ComprehensionBlock: ["left", "right"],
144
+ // CAUTION: It's deferred to ES7.
145
+ ComprehensionExpression: ["blocks", "filter", "body"],
146
+ // CAUTION: It's deferred to ES7.
147
+ ConditionalExpression: ["test", "consequent", "alternate"],
148
+ ContinueStatement: ["label"],
149
+ DebuggerStatement: [],
150
+ DirectiveStatement: [],
151
+ DoWhileStatement: ["body", "test"],
152
+ EmptyStatement: [],
153
+ ExportAllDeclaration: ["source"],
154
+ ExportDefaultDeclaration: ["declaration"],
155
+ ExportNamedDeclaration: ["declaration", "specifiers", "source"],
156
+ ExportSpecifier: ["exported", "local"],
157
+ ExpressionStatement: ["expression"],
158
+ ForStatement: ["init", "test", "update", "body"],
159
+ ForInStatement: ["left", "right", "body"],
160
+ ForOfStatement: ["left", "right", "body"],
161
+ FunctionDeclaration: ["id", "params", "body"],
162
+ FunctionExpression: ["id", "params", "body"],
163
+ GeneratorExpression: ["blocks", "filter", "body"],
164
+ // CAUTION: It's deferred to ES7.
165
+ Identifier: [],
166
+ IfStatement: ["test", "consequent", "alternate"],
167
+ ImportExpression: ["source"],
168
+ ImportDeclaration: ["specifiers", "source"],
169
+ ImportDefaultSpecifier: ["local"],
170
+ ImportNamespaceSpecifier: ["local"],
171
+ ImportSpecifier: ["imported", "local"],
172
+ Literal: [],
173
+ LabeledStatement: ["label", "body"],
174
+ LogicalExpression: ["left", "right"],
175
+ MemberExpression: ["object", "property"],
176
+ MetaProperty: ["meta", "property"],
177
+ MethodDefinition: ["key", "value"],
178
+ ModuleSpecifier: [],
179
+ NewExpression: ["callee", "arguments"],
180
+ ObjectExpression: ["properties"],
181
+ ObjectPattern: ["properties"],
182
+ PrivateIdentifier: [],
183
+ Program: ["body"],
184
+ Property: ["key", "value"],
185
+ PropertyDefinition: ["key", "value"],
186
+ RestElement: ["argument"],
187
+ ReturnStatement: ["argument"],
188
+ SequenceExpression: ["expressions"],
189
+ SpreadElement: ["argument"],
190
+ Super: [],
191
+ SwitchStatement: ["discriminant", "cases"],
192
+ SwitchCase: ["test", "consequent"],
193
+ TaggedTemplateExpression: ["tag", "quasi"],
194
+ TemplateElement: [],
195
+ TemplateLiteral: ["quasis", "expressions"],
196
+ ThisExpression: [],
197
+ ThrowStatement: ["argument"],
198
+ TryStatement: ["block", "handler", "finalizer"],
199
+ UnaryExpression: ["argument"],
200
+ UpdateExpression: ["argument"],
201
+ VariableDeclaration: ["declarations"],
202
+ VariableDeclarator: ["id", "init"],
203
+ WhileStatement: ["test", "body"],
204
+ WithStatement: ["object", "body"],
205
+ YieldExpression: ["argument"]
206
+ }, BREAK = {}, SKIP = {}, REMOVE = {}, VisitorOption = {
207
+ Break: BREAK,
208
+ Skip: SKIP,
209
+ Remove: REMOVE
210
+ };
211
+ function Reference(parent, key) {
212
+ this.parent = parent, this.key = key;
213
+ }
214
+ Reference.prototype.replace = function(node) {
215
+ this.parent[this.key] = node;
216
+ }, Reference.prototype.remove = function() {
217
+ return Array.isArray(this.parent) ? (this.parent.splice(this.key, 1), !0) : (this.replace(null), !1);
218
+ };
219
+ function Element(node, path3, wrap, ref) {
220
+ this.node = node, this.path = path3, this.wrap = wrap, this.ref = ref;
221
+ }
222
+ function Controller() {
223
+ }
224
+ Controller.prototype.path = function() {
225
+ var i, iz, j, jz, result, element;
226
+ function addToPath(result2, path4) {
227
+ if (Array.isArray(path4))
228
+ for (j = 0, jz = path4.length; j < jz; ++j)
229
+ result2.push(path4[j]);
230
+ else
231
+ result2.push(path4);
232
+ }
233
+ if (!this.__current.path)
234
+ return null;
235
+ for (result = [], i = 2, iz = this.__leavelist.length; i < iz; ++i)
236
+ element = this.__leavelist[i], addToPath(result, element.path);
237
+ return addToPath(result, this.__current.path), result;
238
+ }, Controller.prototype.type = function() {
239
+ var node = this.current();
240
+ return node.type || this.__current.wrap;
241
+ }, Controller.prototype.parents = function() {
242
+ var i, iz, result;
243
+ for (result = [], i = 1, iz = this.__leavelist.length; i < iz; ++i)
244
+ result.push(this.__leavelist[i].node);
245
+ return result;
246
+ }, Controller.prototype.current = function() {
247
+ return this.__current.node;
248
+ }, Controller.prototype.__execute = function(callback, element) {
249
+ var previous, result;
250
+ return result = void 0, previous = this.__current, this.__current = element, this.__state = null, callback && (result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node)), this.__current = previous, result;
251
+ }, Controller.prototype.notify = function(flag) {
252
+ this.__state = flag;
253
+ }, Controller.prototype.skip = function() {
254
+ this.notify(SKIP);
255
+ }, Controller.prototype.break = function() {
256
+ this.notify(BREAK);
257
+ }, Controller.prototype.remove = function() {
258
+ this.notify(REMOVE);
259
+ }, Controller.prototype.__initialize = function(root, visitor) {
260
+ this.visitor = visitor, this.root = root, this.__worklist = [], this.__leavelist = [], this.__current = null, this.__state = null, this.__fallback = null, visitor.fallback === "iteration" ? this.__fallback = Object.keys : typeof visitor.fallback == "function" && (this.__fallback = visitor.fallback), this.__keys = VisitorKeys, visitor.keys && (this.__keys = Object.assign(Object.create(this.__keys), visitor.keys));
261
+ };
262
+ function isNode(node) {
263
+ return node == null ? !1 : typeof node == "object" && typeof node.type == "string";
264
+ }
265
+ function isProperty(nodeType, key) {
266
+ return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && key === "properties";
267
+ }
268
+ function candidateExistsInLeaveList(leavelist, candidate) {
269
+ for (var i = leavelist.length - 1; i >= 0; --i)
270
+ if (leavelist[i].node === candidate)
271
+ return !0;
272
+ return !1;
273
+ }
274
+ Controller.prototype.traverse = function(root, visitor) {
275
+ var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;
276
+ for (this.__initialize(root, visitor), sentinel = {}, worklist = this.__worklist, leavelist = this.__leavelist, worklist.push(new Element(root, null, null, null)), leavelist.push(new Element(null, null, null, null)); worklist.length; ) {
277
+ if (element = worklist.pop(), element === sentinel) {
278
+ if (element = leavelist.pop(), ret = this.__execute(visitor.leave, element), this.__state === BREAK || ret === BREAK)
279
+ return;
280
+ continue;
281
+ }
282
+ if (element.node) {
283
+ if (ret = this.__execute(visitor.enter, element), this.__state === BREAK || ret === BREAK)
284
+ return;
285
+ if (worklist.push(sentinel), leavelist.push(element), this.__state === SKIP || ret === SKIP)
286
+ continue;
287
+ if (node = element.node, nodeType = node.type || element.wrap, candidates = this.__keys[nodeType], !candidates)
288
+ if (this.__fallback)
289
+ candidates = this.__fallback(node);
290
+ else
291
+ throw new Error("Unknown node type " + nodeType + ".");
292
+ for (current = candidates.length; (current -= 1) >= 0; )
293
+ if (key = candidates[current], candidate = node[key], !!candidate) {
294
+ if (Array.isArray(candidate)) {
295
+ for (current2 = candidate.length; (current2 -= 1) >= 0; )
296
+ if (candidate[current2] && !candidateExistsInLeaveList(leavelist, candidate[current2])) {
297
+ if (isProperty(nodeType, candidates[current]))
298
+ element = new Element(candidate[current2], [key, current2], "Property", null);
299
+ else if (isNode(candidate[current2]))
300
+ element = new Element(candidate[current2], [key, current2], null, null);
301
+ else
302
+ continue;
303
+ worklist.push(element);
304
+ }
305
+ } else if (isNode(candidate)) {
306
+ if (candidateExistsInLeaveList(leavelist, candidate))
307
+ continue;
308
+ worklist.push(new Element(candidate, key, null, null));
309
+ }
310
+ }
311
+ }
312
+ }
313
+ }, Controller.prototype.replace = function(root, visitor) {
314
+ var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
315
+ function removeElem(element2) {
316
+ var i, key2, nextElem, parent;
317
+ if (element2.ref.remove()) {
318
+ for (key2 = element2.ref.key, parent = element2.ref.parent, i = worklist.length; i--; )
319
+ if (nextElem = worklist[i], nextElem.ref && nextElem.ref.parent === parent) {
320
+ if (nextElem.ref.key < key2)
321
+ break;
322
+ --nextElem.ref.key;
323
+ }
324
+ }
325
+ }
326
+ for (this.__initialize(root, visitor), sentinel = {}, worklist = this.__worklist, leavelist = this.__leavelist, outer = {
327
+ root
328
+ }, element = new Element(root, null, null, new Reference(outer, "root")), worklist.push(element), leavelist.push(element); worklist.length; ) {
329
+ if (element = worklist.pop(), element === sentinel) {
330
+ if (element = leavelist.pop(), target = this.__execute(visitor.leave, element), target !== void 0 && target !== BREAK && target !== SKIP && target !== REMOVE && element.ref.replace(target), (this.__state === REMOVE || target === REMOVE) && removeElem(element), this.__state === BREAK || target === BREAK)
331
+ return outer.root;
332
+ continue;
333
+ }
334
+ if (target = this.__execute(visitor.enter, element), target !== void 0 && target !== BREAK && target !== SKIP && target !== REMOVE && (element.ref.replace(target), element.node = target), (this.__state === REMOVE || target === REMOVE) && (removeElem(element), element.node = null), this.__state === BREAK || target === BREAK)
335
+ return outer.root;
336
+ if (node = element.node, !!node && (worklist.push(sentinel), leavelist.push(element), !(this.__state === SKIP || target === SKIP))) {
337
+ if (nodeType = node.type || element.wrap, candidates = this.__keys[nodeType], !candidates)
338
+ if (this.__fallback)
339
+ candidates = this.__fallback(node);
340
+ else
341
+ throw new Error("Unknown node type " + nodeType + ".");
342
+ for (current = candidates.length; (current -= 1) >= 0; )
343
+ if (key = candidates[current], candidate = node[key], !!candidate)
344
+ if (Array.isArray(candidate)) {
345
+ for (current2 = candidate.length; (current2 -= 1) >= 0; )
346
+ if (candidate[current2]) {
347
+ if (isProperty(nodeType, candidates[current]))
348
+ element = new Element(candidate[current2], [key, current2], "Property", new Reference(candidate, current2));
349
+ else if (isNode(candidate[current2]))
350
+ element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
351
+ else
352
+ continue;
353
+ worklist.push(element);
354
+ }
355
+ } else isNode(candidate) && worklist.push(new Element(candidate, key, null, new Reference(node, key)));
356
+ }
357
+ }
358
+ return outer.root;
359
+ };
360
+ function traverse(root, visitor) {
361
+ var controller = new Controller();
362
+ return controller.traverse(root, visitor);
363
+ }
364
+ function replace(root, visitor) {
365
+ var controller = new Controller();
366
+ return controller.replace(root, visitor);
367
+ }
368
+ function extendCommentRange(comment, tokens) {
369
+ var target;
370
+ return target = upperBound(tokens, function(token) {
371
+ return token.range[0] > comment.range[0];
372
+ }), comment.extendedRange = [comment.range[0], comment.range[1]], target !== tokens.length && (comment.extendedRange[1] = tokens[target].range[0]), target -= 1, target >= 0 && (comment.extendedRange[0] = tokens[target].range[1]), comment;
373
+ }
374
+ function attachComments(tree, providedComments, tokens) {
375
+ var comments = [], comment, len, i, cursor;
376
+ if (!tree.range)
377
+ throw new Error("attachComments needs range information");
378
+ if (!tokens.length) {
379
+ if (providedComments.length) {
380
+ for (i = 0, len = providedComments.length; i < len; i += 1)
381
+ comment = deepCopy(providedComments[i]), comment.extendedRange = [0, tree.range[0]], comments.push(comment);
382
+ tree.leadingComments = comments;
383
+ }
384
+ return tree;
385
+ }
386
+ for (i = 0, len = providedComments.length; i < len; i += 1)
387
+ comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
388
+ return cursor = 0, traverse(tree, {
389
+ enter: function(node) {
390
+ for (var comment2; cursor < comments.length && (comment2 = comments[cursor], !(comment2.extendedRange[1] > node.range[0])); )
391
+ comment2.extendedRange[1] === node.range[0] ? (node.leadingComments || (node.leadingComments = []), node.leadingComments.push(comment2), comments.splice(cursor, 1)) : cursor += 1;
392
+ if (cursor === comments.length)
393
+ return VisitorOption.Break;
394
+ if (comments[cursor].extendedRange[0] > node.range[1])
395
+ return VisitorOption.Skip;
396
+ }
397
+ }), cursor = 0, traverse(tree, {
398
+ leave: function(node) {
399
+ for (var comment2; cursor < comments.length && (comment2 = comments[cursor], !(node.range[1] < comment2.extendedRange[0])); )
400
+ node.range[1] === comment2.extendedRange[0] ? (node.trailingComments || (node.trailingComments = []), node.trailingComments.push(comment2), comments.splice(cursor, 1)) : cursor += 1;
401
+ if (cursor === comments.length)
402
+ return VisitorOption.Break;
403
+ if (comments[cursor].extendedRange[0] > node.range[1])
404
+ return VisitorOption.Skip;
405
+ }
406
+ }), tree;
407
+ }
408
+ return exports2.Syntax = Syntax, exports2.traverse = traverse, exports2.replace = replace, exports2.attachComments = attachComments, exports2.VisitorKeys = VisitorKeys, exports2.VisitorOption = VisitorOption, exports2.Controller = Controller, exports2.cloneEnvironment = function() {
409
+ return clone({});
410
+ }, exports2;
411
+ })(exports);
412
+ }
413
+ });
414
+
415
+ // ../../node_modules/esutils/lib/ast.js
416
+ var require_ast = __commonJS({
417
+ "../../node_modules/esutils/lib/ast.js"(exports, module) {
418
+ (function() {
419
+ "use strict";
420
+ function isExpression(node) {
421
+ if (node == null)
422
+ return !1;
423
+ switch (node.type) {
424
+ case "ArrayExpression":
425
+ case "AssignmentExpression":
426
+ case "BinaryExpression":
427
+ case "CallExpression":
428
+ case "ConditionalExpression":
429
+ case "FunctionExpression":
430
+ case "Identifier":
431
+ case "Literal":
432
+ case "LogicalExpression":
433
+ case "MemberExpression":
434
+ case "NewExpression":
435
+ case "ObjectExpression":
436
+ case "SequenceExpression":
437
+ case "ThisExpression":
438
+ case "UnaryExpression":
439
+ case "UpdateExpression":
440
+ return !0;
441
+ }
442
+ return !1;
443
+ }
444
+ function isIterationStatement(node) {
445
+ if (node == null)
446
+ return !1;
447
+ switch (node.type) {
448
+ case "DoWhileStatement":
449
+ case "ForInStatement":
450
+ case "ForStatement":
451
+ case "WhileStatement":
452
+ return !0;
453
+ }
454
+ return !1;
455
+ }
456
+ function isStatement(node) {
457
+ if (node == null)
458
+ return !1;
459
+ switch (node.type) {
460
+ case "BlockStatement":
461
+ case "BreakStatement":
462
+ case "ContinueStatement":
463
+ case "DebuggerStatement":
464
+ case "DoWhileStatement":
465
+ case "EmptyStatement":
466
+ case "ExpressionStatement":
467
+ case "ForInStatement":
468
+ case "ForStatement":
469
+ case "IfStatement":
470
+ case "LabeledStatement":
471
+ case "ReturnStatement":
472
+ case "SwitchStatement":
473
+ case "ThrowStatement":
474
+ case "TryStatement":
475
+ case "VariableDeclaration":
476
+ case "WhileStatement":
477
+ case "WithStatement":
478
+ return !0;
479
+ }
480
+ return !1;
481
+ }
482
+ function isSourceElement(node) {
483
+ return isStatement(node) || node != null && node.type === "FunctionDeclaration";
484
+ }
485
+ function trailingStatement(node) {
486
+ switch (node.type) {
487
+ case "IfStatement":
488
+ return node.alternate != null ? node.alternate : node.consequent;
489
+ case "LabeledStatement":
490
+ case "ForStatement":
491
+ case "ForInStatement":
492
+ case "WhileStatement":
493
+ case "WithStatement":
494
+ return node.body;
495
+ }
496
+ return null;
497
+ }
498
+ function isProblematicIfStatement(node) {
499
+ var current;
500
+ if (node.type !== "IfStatement" || node.alternate == null)
501
+ return !1;
502
+ current = node.consequent;
503
+ do {
504
+ if (current.type === "IfStatement" && current.alternate == null)
505
+ return !0;
506
+ current = trailingStatement(current);
507
+ } while (current);
508
+ return !1;
509
+ }
510
+ module.exports = {
511
+ isExpression,
512
+ isStatement,
513
+ isIterationStatement,
514
+ isSourceElement,
515
+ isProblematicIfStatement,
516
+ trailingStatement
517
+ };
518
+ })();
519
+ }
520
+ });
521
+
522
+ // ../../node_modules/esutils/lib/code.js
523
+ var require_code = __commonJS({
524
+ "../../node_modules/esutils/lib/code.js"(exports, module) {
525
+ (function() {
526
+ "use strict";
527
+ var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;
528
+ ES5Regex = {
529
+ // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart:
530
+ NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]/,
531
+ // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart:
532
+ NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
533
+ }, ES6Regex = {
534
+ // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart:
535
+ NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
536
+ // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart:
537
+ NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
538
+ };
539
+ function isDecimalDigit(ch2) {
540
+ return 48 <= ch2 && ch2 <= 57;
541
+ }
542
+ function isHexDigit(ch2) {
543
+ return 48 <= ch2 && ch2 <= 57 || // 0..9
544
+ 97 <= ch2 && ch2 <= 102 || // a..f
545
+ 65 <= ch2 && ch2 <= 70;
546
+ }
547
+ function isOctalDigit(ch2) {
548
+ return ch2 >= 48 && ch2 <= 55;
549
+ }
550
+ NON_ASCII_WHITESPACES = [
551
+ 5760,
552
+ 8192,
553
+ 8193,
554
+ 8194,
555
+ 8195,
556
+ 8196,
557
+ 8197,
558
+ 8198,
559
+ 8199,
560
+ 8200,
561
+ 8201,
562
+ 8202,
563
+ 8239,
564
+ 8287,
565
+ 12288,
566
+ 65279
567
+ ];
568
+ function isWhiteSpace(ch2) {
569
+ return ch2 === 32 || ch2 === 9 || ch2 === 11 || ch2 === 12 || ch2 === 160 || ch2 >= 5760 && NON_ASCII_WHITESPACES.indexOf(ch2) >= 0;
570
+ }
571
+ function isLineTerminator(ch2) {
572
+ return ch2 === 10 || ch2 === 13 || ch2 === 8232 || ch2 === 8233;
573
+ }
574
+ function fromCodePoint(cp) {
575
+ if (cp <= 65535)
576
+ return String.fromCharCode(cp);
577
+ var cu1 = String.fromCharCode(Math.floor((cp - 65536) / 1024) + 55296), cu2 = String.fromCharCode((cp - 65536) % 1024 + 56320);
578
+ return cu1 + cu2;
579
+ }
580
+ for (IDENTIFIER_START = new Array(128), ch = 0; ch < 128; ++ch)
581
+ IDENTIFIER_START[ch] = ch >= 97 && ch <= 122 || // a..z
582
+ ch >= 65 && ch <= 90 || // A..Z
583
+ ch === 36 || ch === 95;
584
+ for (IDENTIFIER_PART = new Array(128), ch = 0; ch < 128; ++ch)
585
+ IDENTIFIER_PART[ch] = ch >= 97 && ch <= 122 || // a..z
586
+ ch >= 65 && ch <= 90 || // A..Z
587
+ ch >= 48 && ch <= 57 || // 0..9
588
+ ch === 36 || ch === 95;
589
+ function isIdentifierStartES5(ch2) {
590
+ return ch2 < 128 ? IDENTIFIER_START[ch2] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch2));
591
+ }
592
+ function isIdentifierPartES5(ch2) {
593
+ return ch2 < 128 ? IDENTIFIER_PART[ch2] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch2));
594
+ }
595
+ function isIdentifierStartES6(ch2) {
596
+ return ch2 < 128 ? IDENTIFIER_START[ch2] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch2));
597
+ }
598
+ function isIdentifierPartES6(ch2) {
599
+ return ch2 < 128 ? IDENTIFIER_PART[ch2] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch2));
600
+ }
601
+ module.exports = {
602
+ isDecimalDigit,
603
+ isHexDigit,
604
+ isOctalDigit,
605
+ isWhiteSpace,
606
+ isLineTerminator,
607
+ isIdentifierStartES5,
608
+ isIdentifierPartES5,
609
+ isIdentifierStartES6,
610
+ isIdentifierPartES6
611
+ };
612
+ })();
613
+ }
614
+ });
615
+
616
+ // ../../node_modules/esutils/lib/keyword.js
617
+ var require_keyword = __commonJS({
618
+ "../../node_modules/esutils/lib/keyword.js"(exports, module) {
619
+ (function() {
620
+ "use strict";
621
+ var code = require_code();
622
+ function isStrictModeReservedWordES6(id) {
623
+ switch (id) {
624
+ case "implements":
625
+ case "interface":
626
+ case "package":
627
+ case "private":
628
+ case "protected":
629
+ case "public":
630
+ case "static":
631
+ case "let":
632
+ return !0;
633
+ default:
634
+ return !1;
635
+ }
636
+ }
637
+ function isKeywordES5(id, strict) {
638
+ return !strict && id === "yield" ? !1 : isKeywordES6(id, strict);
639
+ }
640
+ function isKeywordES6(id, strict) {
641
+ if (strict && isStrictModeReservedWordES6(id))
642
+ return !0;
643
+ switch (id.length) {
644
+ case 2:
645
+ return id === "if" || id === "in" || id === "do";
646
+ case 3:
647
+ return id === "var" || id === "for" || id === "new" || id === "try";
648
+ case 4:
649
+ return id === "this" || id === "else" || id === "case" || id === "void" || id === "with" || id === "enum";
650
+ case 5:
651
+ return id === "while" || id === "break" || id === "catch" || id === "throw" || id === "const" || id === "yield" || id === "class" || id === "super";
652
+ case 6:
653
+ return id === "return" || id === "typeof" || id === "delete" || id === "switch" || id === "export" || id === "import";
654
+ case 7:
655
+ return id === "default" || id === "finally" || id === "extends";
656
+ case 8:
657
+ return id === "function" || id === "continue" || id === "debugger";
658
+ case 10:
659
+ return id === "instanceof";
660
+ default:
661
+ return !1;
662
+ }
663
+ }
664
+ function isReservedWordES5(id, strict) {
665
+ return id === "null" || id === "true" || id === "false" || isKeywordES5(id, strict);
666
+ }
667
+ function isReservedWordES6(id, strict) {
668
+ return id === "null" || id === "true" || id === "false" || isKeywordES6(id, strict);
669
+ }
670
+ function isRestrictedWord(id) {
671
+ return id === "eval" || id === "arguments";
672
+ }
673
+ function isIdentifierNameES5(id) {
674
+ var i, iz, ch;
675
+ if (id.length === 0 || (ch = id.charCodeAt(0), !code.isIdentifierStartES5(ch)))
676
+ return !1;
677
+ for (i = 1, iz = id.length; i < iz; ++i)
678
+ if (ch = id.charCodeAt(i), !code.isIdentifierPartES5(ch))
679
+ return !1;
680
+ return !0;
681
+ }
682
+ function decodeUtf16(lead, trail) {
683
+ return (lead - 55296) * 1024 + (trail - 56320) + 65536;
684
+ }
685
+ function isIdentifierNameES6(id) {
686
+ var i, iz, ch, lowCh, check;
687
+ if (id.length === 0)
688
+ return !1;
689
+ for (check = code.isIdentifierStartES6, i = 0, iz = id.length; i < iz; ++i) {
690
+ if (ch = id.charCodeAt(i), 55296 <= ch && ch <= 56319) {
691
+ if (++i, i >= iz || (lowCh = id.charCodeAt(i), !(56320 <= lowCh && lowCh <= 57343)))
692
+ return !1;
693
+ ch = decodeUtf16(ch, lowCh);
694
+ }
695
+ if (!check(ch))
696
+ return !1;
697
+ check = code.isIdentifierPartES6;
698
+ }
699
+ return !0;
700
+ }
701
+ function isIdentifierES5(id, strict) {
702
+ return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
703
+ }
704
+ function isIdentifierES6(id, strict) {
705
+ return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
706
+ }
707
+ module.exports = {
708
+ isKeywordES5,
709
+ isKeywordES6,
710
+ isReservedWordES5,
711
+ isReservedWordES6,
712
+ isRestrictedWord,
713
+ isIdentifierNameES5,
714
+ isIdentifierNameES6,
715
+ isIdentifierES5,
716
+ isIdentifierES6
717
+ };
718
+ })();
719
+ }
720
+ });
721
+
722
+ // ../../node_modules/esutils/lib/utils.js
723
+ var require_utils = __commonJS({
724
+ "../../node_modules/esutils/lib/utils.js"(exports) {
725
+ (function() {
726
+ "use strict";
727
+ exports.ast = require_ast(), exports.code = require_code(), exports.keyword = require_keyword();
728
+ })();
729
+ }
730
+ });
731
+
732
+ // ../../node_modules/escodegen/node_modules/source-map/lib/base64.js
733
+ var require_base64 = __commonJS({
734
+ "../../node_modules/escodegen/node_modules/source-map/lib/base64.js"(exports) {
735
+ var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
736
+ exports.encode = function(number) {
737
+ if (0 <= number && number < intToCharMap.length)
738
+ return intToCharMap[number];
739
+ throw new TypeError("Must be between 0 and 63: " + number);
740
+ };
741
+ exports.decode = function(charCode) {
742
+ var bigA = 65, bigZ = 90, littleA = 97, littleZ = 122, zero = 48, nine = 57, plus = 43, slash = 47, littleOffset = 26, numberOffset = 52;
743
+ return bigA <= charCode && charCode <= bigZ ? charCode - bigA : littleA <= charCode && charCode <= littleZ ? charCode - littleA + littleOffset : zero <= charCode && charCode <= nine ? charCode - zero + numberOffset : charCode == plus ? 62 : charCode == slash ? 63 : -1;
744
+ };
745
+ }
746
+ });
747
+
748
+ // ../../node_modules/escodegen/node_modules/source-map/lib/base64-vlq.js
749
+ var require_base64_vlq = __commonJS({
750
+ "../../node_modules/escodegen/node_modules/source-map/lib/base64-vlq.js"(exports) {
751
+ var base64 = require_base64(), VLQ_BASE_SHIFT = 5, VLQ_BASE = 1 << VLQ_BASE_SHIFT, VLQ_BASE_MASK = VLQ_BASE - 1, VLQ_CONTINUATION_BIT = VLQ_BASE;
752
+ function toVLQSigned(aValue) {
753
+ return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
754
+ }
755
+ function fromVLQSigned(aValue) {
756
+ var isNegative = (aValue & 1) === 1, shifted = aValue >> 1;
757
+ return isNegative ? -shifted : shifted;
758
+ }
759
+ exports.encode = function(aValue) {
760
+ var encoded = "", digit, vlq = toVLQSigned(aValue);
761
+ do
762
+ digit = vlq & VLQ_BASE_MASK, vlq >>>= VLQ_BASE_SHIFT, vlq > 0 && (digit |= VLQ_CONTINUATION_BIT), encoded += base64.encode(digit);
763
+ while (vlq > 0);
764
+ return encoded;
765
+ };
766
+ exports.decode = function(aStr, aIndex, aOutParam) {
767
+ var strLen = aStr.length, result = 0, shift = 0, continuation, digit;
768
+ do {
769
+ if (aIndex >= strLen)
770
+ throw new Error("Expected more digits in base 64 VLQ value.");
771
+ if (digit = base64.decode(aStr.charCodeAt(aIndex++)), digit === -1)
772
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
773
+ continuation = !!(digit & VLQ_CONTINUATION_BIT), digit &= VLQ_BASE_MASK, result = result + (digit << shift), shift += VLQ_BASE_SHIFT;
774
+ } while (continuation);
775
+ aOutParam.value = fromVLQSigned(result), aOutParam.rest = aIndex;
776
+ };
777
+ }
778
+ });
779
+
780
+ // ../../node_modules/escodegen/node_modules/source-map/lib/util.js
781
+ var require_util = __commonJS({
782
+ "../../node_modules/escodegen/node_modules/source-map/lib/util.js"(exports) {
783
+ function getArg(aArgs, aName, aDefaultValue) {
784
+ if (aName in aArgs)
785
+ return aArgs[aName];
786
+ if (arguments.length === 3)
787
+ return aDefaultValue;
788
+ throw new Error('"' + aName + '" is a required argument.');
789
+ }
790
+ exports.getArg = getArg;
791
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/, dataUrlRegexp = /^data:.+\,.+$/;
792
+ function urlParse(aUrl) {
793
+ var match = aUrl.match(urlRegexp);
794
+ return match ? {
795
+ scheme: match[1],
796
+ auth: match[2],
797
+ host: match[3],
798
+ port: match[4],
799
+ path: match[5]
800
+ } : null;
801
+ }
802
+ exports.urlParse = urlParse;
803
+ function urlGenerate(aParsedUrl) {
804
+ var url = "";
805
+ return aParsedUrl.scheme && (url += aParsedUrl.scheme + ":"), url += "//", aParsedUrl.auth && (url += aParsedUrl.auth + "@"), aParsedUrl.host && (url += aParsedUrl.host), aParsedUrl.port && (url += ":" + aParsedUrl.port), aParsedUrl.path && (url += aParsedUrl.path), url;
806
+ }
807
+ exports.urlGenerate = urlGenerate;
808
+ function normalize(aPath) {
809
+ var path3 = aPath, url = urlParse(aPath);
810
+ if (url) {
811
+ if (!url.path)
812
+ return aPath;
813
+ path3 = url.path;
814
+ }
815
+ for (var isAbsolute = exports.isAbsolute(path3), parts = path3.split(/\/+/), part, up2 = 0, i = parts.length - 1; i >= 0; i--)
816
+ part = parts[i], part === "." ? parts.splice(i, 1) : part === ".." ? up2++ : up2 > 0 && (part === "" ? (parts.splice(i + 1, up2), up2 = 0) : (parts.splice(i, 2), up2--));
817
+ return path3 = parts.join("/"), path3 === "" && (path3 = isAbsolute ? "/" : "."), url ? (url.path = path3, urlGenerate(url)) : path3;
818
+ }
819
+ exports.normalize = normalize;
820
+ function join(aRoot, aPath) {
821
+ aRoot === "" && (aRoot = "."), aPath === "" && (aPath = ".");
822
+ var aPathUrl = urlParse(aPath), aRootUrl = urlParse(aRoot);
823
+ if (aRootUrl && (aRoot = aRootUrl.path || "/"), aPathUrl && !aPathUrl.scheme)
824
+ return aRootUrl && (aPathUrl.scheme = aRootUrl.scheme), urlGenerate(aPathUrl);
825
+ if (aPathUrl || aPath.match(dataUrlRegexp))
826
+ return aPath;
827
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path)
828
+ return aRootUrl.host = aPath, urlGenerate(aRootUrl);
829
+ var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
830
+ return aRootUrl ? (aRootUrl.path = joined, urlGenerate(aRootUrl)) : joined;
831
+ }
832
+ exports.join = join;
833
+ exports.isAbsolute = function(aPath) {
834
+ return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
835
+ };
836
+ function relative(aRoot, aPath) {
837
+ aRoot === "" && (aRoot = "."), aRoot = aRoot.replace(/\/$/, "");
838
+ for (var level = 0; aPath.indexOf(aRoot + "/") !== 0; ) {
839
+ var index = aRoot.lastIndexOf("/");
840
+ if (index < 0 || (aRoot = aRoot.slice(0, index), aRoot.match(/^([^\/]+:\/)?\/*$/)))
841
+ return aPath;
842
+ ++level;
843
+ }
844
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
845
+ }
846
+ exports.relative = relative;
847
+ var supportsNullProto = (function() {
848
+ var obj = /* @__PURE__ */ Object.create(null);
849
+ return !("__proto__" in obj);
850
+ })();
851
+ function identity(s) {
852
+ return s;
853
+ }
854
+ function toSetString(aStr) {
855
+ return isProtoString(aStr) ? "$" + aStr : aStr;
856
+ }
857
+ exports.toSetString = supportsNullProto ? identity : toSetString;
858
+ function fromSetString(aStr) {
859
+ return isProtoString(aStr) ? aStr.slice(1) : aStr;
860
+ }
861
+ exports.fromSetString = supportsNullProto ? identity : fromSetString;
862
+ function isProtoString(s) {
863
+ if (!s)
864
+ return !1;
865
+ var length = s.length;
866
+ if (length < 9 || s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95)
867
+ return !1;
868
+ for (var i = length - 10; i >= 0; i--)
869
+ if (s.charCodeAt(i) !== 36)
870
+ return !1;
871
+ return !0;
872
+ }
873
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
874
+ var cmp = strcmp(mappingA.source, mappingB.source);
875
+ return cmp !== 0 || (cmp = mappingA.originalLine - mappingB.originalLine, cmp !== 0) || (cmp = mappingA.originalColumn - mappingB.originalColumn, cmp !== 0 || onlyCompareOriginal) || (cmp = mappingA.generatedColumn - mappingB.generatedColumn, cmp !== 0) || (cmp = mappingA.generatedLine - mappingB.generatedLine, cmp !== 0) ? cmp : strcmp(mappingA.name, mappingB.name);
876
+ }
877
+ exports.compareByOriginalPositions = compareByOriginalPositions;
878
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
879
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
880
+ return cmp !== 0 || (cmp = mappingA.generatedColumn - mappingB.generatedColumn, cmp !== 0 || onlyCompareGenerated) || (cmp = strcmp(mappingA.source, mappingB.source), cmp !== 0) || (cmp = mappingA.originalLine - mappingB.originalLine, cmp !== 0) || (cmp = mappingA.originalColumn - mappingB.originalColumn, cmp !== 0) ? cmp : strcmp(mappingA.name, mappingB.name);
881
+ }
882
+ exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
883
+ function strcmp(aStr1, aStr2) {
884
+ return aStr1 === aStr2 ? 0 : aStr1 === null ? 1 : aStr2 === null ? -1 : aStr1 > aStr2 ? 1 : -1;
885
+ }
886
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
887
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
888
+ return cmp !== 0 || (cmp = mappingA.generatedColumn - mappingB.generatedColumn, cmp !== 0) || (cmp = strcmp(mappingA.source, mappingB.source), cmp !== 0) || (cmp = mappingA.originalLine - mappingB.originalLine, cmp !== 0) || (cmp = mappingA.originalColumn - mappingB.originalColumn, cmp !== 0) ? cmp : strcmp(mappingA.name, mappingB.name);
889
+ }
890
+ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
891
+ function parseSourceMapInput(str) {
892
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
893
+ }
894
+ exports.parseSourceMapInput = parseSourceMapInput;
895
+ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
896
+ if (sourceURL = sourceURL || "", sourceRoot && (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/" && (sourceRoot += "/"), sourceURL = sourceRoot + sourceURL), sourceMapURL) {
897
+ var parsed = urlParse(sourceMapURL);
898
+ if (!parsed)
899
+ throw new Error("sourceMapURL could not be parsed");
900
+ if (parsed.path) {
901
+ var index = parsed.path.lastIndexOf("/");
902
+ index >= 0 && (parsed.path = parsed.path.substring(0, index + 1));
903
+ }
904
+ sourceURL = join(urlGenerate(parsed), sourceURL);
905
+ }
906
+ return normalize(sourceURL);
907
+ }
908
+ exports.computeSourceURL = computeSourceURL;
909
+ }
910
+ });
911
+
912
+ // ../../node_modules/escodegen/node_modules/source-map/lib/array-set.js
913
+ var require_array_set = __commonJS({
914
+ "../../node_modules/escodegen/node_modules/source-map/lib/array-set.js"(exports) {
915
+ var util = require_util(), has = Object.prototype.hasOwnProperty, hasNativeMap = typeof Map < "u";
916
+ function ArraySet() {
917
+ this._array = [], this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
918
+ }
919
+ ArraySet.fromArray = function(aArray, aAllowDuplicates) {
920
+ for (var set = new ArraySet(), i = 0, len = aArray.length; i < len; i++)
921
+ set.add(aArray[i], aAllowDuplicates);
922
+ return set;
923
+ };
924
+ ArraySet.prototype.size = function() {
925
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
926
+ };
927
+ ArraySet.prototype.add = function(aStr, aAllowDuplicates) {
928
+ var sStr = hasNativeMap ? aStr : util.toSetString(aStr), isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr), idx = this._array.length;
929
+ (!isDuplicate || aAllowDuplicates) && this._array.push(aStr), isDuplicate || (hasNativeMap ? this._set.set(aStr, idx) : this._set[sStr] = idx);
930
+ };
931
+ ArraySet.prototype.has = function(aStr) {
932
+ if (hasNativeMap)
933
+ return this._set.has(aStr);
934
+ var sStr = util.toSetString(aStr);
935
+ return has.call(this._set, sStr);
936
+ };
937
+ ArraySet.prototype.indexOf = function(aStr) {
938
+ if (hasNativeMap) {
939
+ var idx = this._set.get(aStr);
940
+ if (idx >= 0)
941
+ return idx;
942
+ } else {
943
+ var sStr = util.toSetString(aStr);
944
+ if (has.call(this._set, sStr))
945
+ return this._set[sStr];
946
+ }
947
+ throw new Error('"' + aStr + '" is not in the set.');
948
+ };
949
+ ArraySet.prototype.at = function(aIdx) {
950
+ if (aIdx >= 0 && aIdx < this._array.length)
951
+ return this._array[aIdx];
952
+ throw new Error("No element indexed by " + aIdx);
953
+ };
954
+ ArraySet.prototype.toArray = function() {
955
+ return this._array.slice();
956
+ };
957
+ exports.ArraySet = ArraySet;
958
+ }
959
+ });
960
+
961
+ // ../../node_modules/escodegen/node_modules/source-map/lib/mapping-list.js
962
+ var require_mapping_list = __commonJS({
963
+ "../../node_modules/escodegen/node_modules/source-map/lib/mapping-list.js"(exports) {
964
+ var util = require_util();
965
+ function generatedPositionAfter(mappingA, mappingB) {
966
+ var lineA = mappingA.generatedLine, lineB = mappingB.generatedLine, columnA = mappingA.generatedColumn, columnB = mappingB.generatedColumn;
967
+ return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
968
+ }
969
+ function MappingList() {
970
+ this._array = [], this._sorted = !0, this._last = { generatedLine: -1, generatedColumn: 0 };
971
+ }
972
+ MappingList.prototype.unsortedForEach = function(aCallback, aThisArg) {
973
+ this._array.forEach(aCallback, aThisArg);
974
+ };
975
+ MappingList.prototype.add = function(aMapping) {
976
+ generatedPositionAfter(this._last, aMapping) ? (this._last = aMapping, this._array.push(aMapping)) : (this._sorted = !1, this._array.push(aMapping));
977
+ };
978
+ MappingList.prototype.toArray = function() {
979
+ return this._sorted || (this._array.sort(util.compareByGeneratedPositionsInflated), this._sorted = !0), this._array;
980
+ };
981
+ exports.MappingList = MappingList;
982
+ }
983
+ });
984
+
985
+ // ../../node_modules/escodegen/node_modules/source-map/lib/source-map-generator.js
986
+ var require_source_map_generator = __commonJS({
987
+ "../../node_modules/escodegen/node_modules/source-map/lib/source-map-generator.js"(exports) {
988
+ var base64VLQ = require_base64_vlq(), util = require_util(), ArraySet = require_array_set().ArraySet, MappingList = require_mapping_list().MappingList;
989
+ function SourceMapGenerator(aArgs) {
990
+ aArgs || (aArgs = {}), this._file = util.getArg(aArgs, "file", null), this._sourceRoot = util.getArg(aArgs, "sourceRoot", null), this._skipValidation = util.getArg(aArgs, "skipValidation", !1), this._sources = new ArraySet(), this._names = new ArraySet(), this._mappings = new MappingList(), this._sourcesContents = null;
991
+ }
992
+ SourceMapGenerator.prototype._version = 3;
993
+ SourceMapGenerator.fromSourceMap = function(aSourceMapConsumer) {
994
+ var sourceRoot = aSourceMapConsumer.sourceRoot, generator = new SourceMapGenerator({
995
+ file: aSourceMapConsumer.file,
996
+ sourceRoot
997
+ });
998
+ return aSourceMapConsumer.eachMapping(function(mapping) {
999
+ var newMapping = {
1000
+ generated: {
1001
+ line: mapping.generatedLine,
1002
+ column: mapping.generatedColumn
1003
+ }
1004
+ };
1005
+ mapping.source != null && (newMapping.source = mapping.source, sourceRoot != null && (newMapping.source = util.relative(sourceRoot, newMapping.source)), newMapping.original = {
1006
+ line: mapping.originalLine,
1007
+ column: mapping.originalColumn
1008
+ }, mapping.name != null && (newMapping.name = mapping.name)), generator.addMapping(newMapping);
1009
+ }), aSourceMapConsumer.sources.forEach(function(sourceFile) {
1010
+ var sourceRelative = sourceFile;
1011
+ sourceRoot !== null && (sourceRelative = util.relative(sourceRoot, sourceFile)), generator._sources.has(sourceRelative) || generator._sources.add(sourceRelative);
1012
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1013
+ content != null && generator.setSourceContent(sourceFile, content);
1014
+ }), generator;
1015
+ };
1016
+ SourceMapGenerator.prototype.addMapping = function(aArgs) {
1017
+ var generated = util.getArg(aArgs, "generated"), original = util.getArg(aArgs, "original", null), source = util.getArg(aArgs, "source", null), name = util.getArg(aArgs, "name", null);
1018
+ this._skipValidation || this._validateMapping(generated, original, source, name), source != null && (source = String(source), this._sources.has(source) || this._sources.add(source)), name != null && (name = String(name), this._names.has(name) || this._names.add(name)), this._mappings.add({
1019
+ generatedLine: generated.line,
1020
+ generatedColumn: generated.column,
1021
+ originalLine: original != null && original.line,
1022
+ originalColumn: original != null && original.column,
1023
+ source,
1024
+ name
1025
+ });
1026
+ };
1027
+ SourceMapGenerator.prototype.setSourceContent = function(aSourceFile, aSourceContent) {
1028
+ var source = aSourceFile;
1029
+ this._sourceRoot != null && (source = util.relative(this._sourceRoot, source)), aSourceContent != null ? (this._sourcesContents || (this._sourcesContents = /* @__PURE__ */ Object.create(null)), this._sourcesContents[util.toSetString(source)] = aSourceContent) : this._sourcesContents && (delete this._sourcesContents[util.toSetString(source)], Object.keys(this._sourcesContents).length === 0 && (this._sourcesContents = null));
1030
+ };
1031
+ SourceMapGenerator.prototype.applySourceMap = function(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
1032
+ var sourceFile = aSourceFile;
1033
+ if (aSourceFile == null) {
1034
+ if (aSourceMapConsumer.file == null)
1035
+ throw new Error(
1036
+ `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
1037
+ );
1038
+ sourceFile = aSourceMapConsumer.file;
1039
+ }
1040
+ var sourceRoot = this._sourceRoot;
1041
+ sourceRoot != null && (sourceFile = util.relative(sourceRoot, sourceFile));
1042
+ var newSources = new ArraySet(), newNames = new ArraySet();
1043
+ this._mappings.unsortedForEach(function(mapping) {
1044
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
1045
+ var original = aSourceMapConsumer.originalPositionFor({
1046
+ line: mapping.originalLine,
1047
+ column: mapping.originalColumn
1048
+ });
1049
+ original.source != null && (mapping.source = original.source, aSourceMapPath != null && (mapping.source = util.join(aSourceMapPath, mapping.source)), sourceRoot != null && (mapping.source = util.relative(sourceRoot, mapping.source)), mapping.originalLine = original.line, mapping.originalColumn = original.column, original.name != null && (mapping.name = original.name));
1050
+ }
1051
+ var source = mapping.source;
1052
+ source != null && !newSources.has(source) && newSources.add(source);
1053
+ var name = mapping.name;
1054
+ name != null && !newNames.has(name) && newNames.add(name);
1055
+ }, this), this._sources = newSources, this._names = newNames, aSourceMapConsumer.sources.forEach(function(sourceFile2) {
1056
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
1057
+ content != null && (aSourceMapPath != null && (sourceFile2 = util.join(aSourceMapPath, sourceFile2)), sourceRoot != null && (sourceFile2 = util.relative(sourceRoot, sourceFile2)), this.setSourceContent(sourceFile2, content));
1058
+ }, this);
1059
+ };
1060
+ SourceMapGenerator.prototype._validateMapping = function(aGenerated, aOriginal, aSource, aName) {
1061
+ if (aOriginal && typeof aOriginal.line != "number" && typeof aOriginal.column != "number")
1062
+ throw new Error(
1063
+ "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
1064
+ );
1065
+ if (!(aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName)) {
1066
+ if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource)
1067
+ return;
1068
+ throw new Error("Invalid mapping: " + JSON.stringify({
1069
+ generated: aGenerated,
1070
+ source: aSource,
1071
+ original: aOriginal,
1072
+ name: aName
1073
+ }));
1074
+ }
1075
+ };
1076
+ SourceMapGenerator.prototype._serializeMappings = function() {
1077
+ for (var previousGeneratedColumn = 0, previousGeneratedLine = 1, previousOriginalColumn = 0, previousOriginalLine = 0, previousName = 0, previousSource = 0, result = "", next, mapping, nameIdx, sourceIdx, mappings = this._mappings.toArray(), i = 0, len = mappings.length; i < len; i++) {
1078
+ if (mapping = mappings[i], next = "", mapping.generatedLine !== previousGeneratedLine)
1079
+ for (previousGeneratedColumn = 0; mapping.generatedLine !== previousGeneratedLine; )
1080
+ next += ";", previousGeneratedLine++;
1081
+ else if (i > 0) {
1082
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1]))
1083
+ continue;
1084
+ next += ",";
1085
+ }
1086
+ next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn), previousGeneratedColumn = mapping.generatedColumn, mapping.source != null && (sourceIdx = this._sources.indexOf(mapping.source), next += base64VLQ.encode(sourceIdx - previousSource), previousSource = sourceIdx, next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine), previousOriginalLine = mapping.originalLine - 1, next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn), previousOriginalColumn = mapping.originalColumn, mapping.name != null && (nameIdx = this._names.indexOf(mapping.name), next += base64VLQ.encode(nameIdx - previousName), previousName = nameIdx)), result += next;
1087
+ }
1088
+ return result;
1089
+ };
1090
+ SourceMapGenerator.prototype._generateSourcesContent = function(aSources, aSourceRoot) {
1091
+ return aSources.map(function(source) {
1092
+ if (!this._sourcesContents)
1093
+ return null;
1094
+ aSourceRoot != null && (source = util.relative(aSourceRoot, source));
1095
+ var key = util.toSetString(source);
1096
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
1097
+ }, this);
1098
+ };
1099
+ SourceMapGenerator.prototype.toJSON = function() {
1100
+ var map = {
1101
+ version: this._version,
1102
+ sources: this._sources.toArray(),
1103
+ names: this._names.toArray(),
1104
+ mappings: this._serializeMappings()
1105
+ };
1106
+ return this._file != null && (map.file = this._file), this._sourceRoot != null && (map.sourceRoot = this._sourceRoot), this._sourcesContents && (map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot)), map;
1107
+ };
1108
+ SourceMapGenerator.prototype.toString = function() {
1109
+ return JSON.stringify(this.toJSON());
1110
+ };
1111
+ exports.SourceMapGenerator = SourceMapGenerator;
1112
+ }
1113
+ });
1114
+
1115
+ // ../../node_modules/escodegen/node_modules/source-map/lib/binary-search.js
1116
+ var require_binary_search = __commonJS({
1117
+ "../../node_modules/escodegen/node_modules/source-map/lib/binary-search.js"(exports) {
1118
+ exports.GREATEST_LOWER_BOUND = 1;
1119
+ exports.LEAST_UPPER_BOUND = 2;
1120
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
1121
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow, cmp = aCompare(aNeedle, aHaystack[mid], !0);
1122
+ return cmp === 0 ? mid : cmp > 0 ? aHigh - mid > 1 ? recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias) : aBias == exports.LEAST_UPPER_BOUND ? aHigh < aHaystack.length ? aHigh : -1 : mid : mid - aLow > 1 ? recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias) : aBias == exports.LEAST_UPPER_BOUND ? mid : aLow < 0 ? -1 : aLow;
1123
+ }
1124
+ exports.search = function(aNeedle, aHaystack, aCompare, aBias) {
1125
+ if (aHaystack.length === 0)
1126
+ return -1;
1127
+ var index = recursiveSearch(
1128
+ -1,
1129
+ aHaystack.length,
1130
+ aNeedle,
1131
+ aHaystack,
1132
+ aCompare,
1133
+ aBias || exports.GREATEST_LOWER_BOUND
1134
+ );
1135
+ if (index < 0)
1136
+ return -1;
1137
+ for (; index - 1 >= 0 && aCompare(aHaystack[index], aHaystack[index - 1], !0) === 0; )
1138
+ --index;
1139
+ return index;
1140
+ };
1141
+ }
1142
+ });
1143
+
1144
+ // ../../node_modules/escodegen/node_modules/source-map/lib/quick-sort.js
1145
+ var require_quick_sort = __commonJS({
1146
+ "../../node_modules/escodegen/node_modules/source-map/lib/quick-sort.js"(exports) {
1147
+ function swap(ary, x, y) {
1148
+ var temp = ary[x];
1149
+ ary[x] = ary[y], ary[y] = temp;
1150
+ }
1151
+ function randomIntInRange(low, high) {
1152
+ return Math.round(low + Math.random() * (high - low));
1153
+ }
1154
+ function doQuickSort(ary, comparator, p, r) {
1155
+ if (p < r) {
1156
+ var pivotIndex = randomIntInRange(p, r), i = p - 1;
1157
+ swap(ary, pivotIndex, r);
1158
+ for (var pivot = ary[r], j = p; j < r; j++)
1159
+ comparator(ary[j], pivot) <= 0 && (i += 1, swap(ary, i, j));
1160
+ swap(ary, i + 1, j);
1161
+ var q = i + 1;
1162
+ doQuickSort(ary, comparator, p, q - 1), doQuickSort(ary, comparator, q + 1, r);
1163
+ }
1164
+ }
1165
+ exports.quickSort = function(ary, comparator) {
1166
+ doQuickSort(ary, comparator, 0, ary.length - 1);
1167
+ };
1168
+ }
1169
+ });
1170
+
1171
+ // ../../node_modules/escodegen/node_modules/source-map/lib/source-map-consumer.js
1172
+ var require_source_map_consumer = __commonJS({
1173
+ "../../node_modules/escodegen/node_modules/source-map/lib/source-map-consumer.js"(exports) {
1174
+ var util = require_util(), binarySearch = require_binary_search(), ArraySet = require_array_set().ArraySet, base64VLQ = require_base64_vlq(), quickSort = require_quick_sort().quickSort;
1175
+ function SourceMapConsumer(aSourceMap, aSourceMapURL) {
1176
+ var sourceMap = aSourceMap;
1177
+ return typeof aSourceMap == "string" && (sourceMap = util.parseSourceMapInput(aSourceMap)), sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
1178
+ }
1179
+ SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
1180
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
1181
+ };
1182
+ SourceMapConsumer.prototype._version = 3;
1183
+ SourceMapConsumer.prototype.__generatedMappings = null;
1184
+ Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
1185
+ configurable: !0,
1186
+ enumerable: !0,
1187
+ get: function() {
1188
+ return this.__generatedMappings || this._parseMappings(this._mappings, this.sourceRoot), this.__generatedMappings;
1189
+ }
1190
+ });
1191
+ SourceMapConsumer.prototype.__originalMappings = null;
1192
+ Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
1193
+ configurable: !0,
1194
+ enumerable: !0,
1195
+ get: function() {
1196
+ return this.__originalMappings || this._parseMappings(this._mappings, this.sourceRoot), this.__originalMappings;
1197
+ }
1198
+ });
1199
+ SourceMapConsumer.prototype._charIsMappingSeparator = function(aStr, index) {
1200
+ var c = aStr.charAt(index);
1201
+ return c === ";" || c === ",";
1202
+ };
1203
+ SourceMapConsumer.prototype._parseMappings = function(aStr, aSourceRoot) {
1204
+ throw new Error("Subclasses must implement _parseMappings");
1205
+ };
1206
+ SourceMapConsumer.GENERATED_ORDER = 1;
1207
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
1208
+ SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
1209
+ SourceMapConsumer.LEAST_UPPER_BOUND = 2;
1210
+ SourceMapConsumer.prototype.eachMapping = function(aCallback, aContext, aOrder) {
1211
+ var context = aContext || null, order = aOrder || SourceMapConsumer.GENERATED_ORDER, mappings;
1212
+ switch (order) {
1213
+ case SourceMapConsumer.GENERATED_ORDER:
1214
+ mappings = this._generatedMappings;
1215
+ break;
1216
+ case SourceMapConsumer.ORIGINAL_ORDER:
1217
+ mappings = this._originalMappings;
1218
+ break;
1219
+ default:
1220
+ throw new Error("Unknown order of iteration.");
1221
+ }
1222
+ var sourceRoot = this.sourceRoot;
1223
+ mappings.map(function(mapping) {
1224
+ var source = mapping.source === null ? null : this._sources.at(mapping.source);
1225
+ return source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL), {
1226
+ source,
1227
+ generatedLine: mapping.generatedLine,
1228
+ generatedColumn: mapping.generatedColumn,
1229
+ originalLine: mapping.originalLine,
1230
+ originalColumn: mapping.originalColumn,
1231
+ name: mapping.name === null ? null : this._names.at(mapping.name)
1232
+ };
1233
+ }, this).forEach(aCallback, context);
1234
+ };
1235
+ SourceMapConsumer.prototype.allGeneratedPositionsFor = function(aArgs) {
1236
+ var line = util.getArg(aArgs, "line"), needle = {
1237
+ source: util.getArg(aArgs, "source"),
1238
+ originalLine: line,
1239
+ originalColumn: util.getArg(aArgs, "column", 0)
1240
+ };
1241
+ if (needle.source = this._findSourceIndex(needle.source), needle.source < 0)
1242
+ return [];
1243
+ var mappings = [], index = this._findMapping(
1244
+ needle,
1245
+ this._originalMappings,
1246
+ "originalLine",
1247
+ "originalColumn",
1248
+ util.compareByOriginalPositions,
1249
+ binarySearch.LEAST_UPPER_BOUND
1250
+ );
1251
+ if (index >= 0) {
1252
+ var mapping = this._originalMappings[index];
1253
+ if (aArgs.column === void 0)
1254
+ for (var originalLine = mapping.originalLine; mapping && mapping.originalLine === originalLine; )
1255
+ mappings.push({
1256
+ line: util.getArg(mapping, "generatedLine", null),
1257
+ column: util.getArg(mapping, "generatedColumn", null),
1258
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
1259
+ }), mapping = this._originalMappings[++index];
1260
+ else
1261
+ for (var originalColumn = mapping.originalColumn; mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn; )
1262
+ mappings.push({
1263
+ line: util.getArg(mapping, "generatedLine", null),
1264
+ column: util.getArg(mapping, "generatedColumn", null),
1265
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
1266
+ }), mapping = this._originalMappings[++index];
1267
+ }
1268
+ return mappings;
1269
+ };
1270
+ exports.SourceMapConsumer = SourceMapConsumer;
1271
+ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
1272
+ var sourceMap = aSourceMap;
1273
+ typeof aSourceMap == "string" && (sourceMap = util.parseSourceMapInput(aSourceMap));
1274
+ var version = util.getArg(sourceMap, "version"), sources = util.getArg(sourceMap, "sources"), names = util.getArg(sourceMap, "names", []), sourceRoot = util.getArg(sourceMap, "sourceRoot", null), sourcesContent = util.getArg(sourceMap, "sourcesContent", null), mappings = util.getArg(sourceMap, "mappings"), file = util.getArg(sourceMap, "file", null);
1275
+ if (version != this._version)
1276
+ throw new Error("Unsupported version: " + version);
1277
+ sourceRoot && (sourceRoot = util.normalize(sourceRoot)), sources = sources.map(String).map(util.normalize).map(function(source) {
1278
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
1279
+ }), this._names = ArraySet.fromArray(names.map(String), !0), this._sources = ArraySet.fromArray(sources, !0), this._absoluteSources = this._sources.toArray().map(function(s) {
1280
+ return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
1281
+ }), this.sourceRoot = sourceRoot, this.sourcesContent = sourcesContent, this._mappings = mappings, this._sourceMapURL = aSourceMapURL, this.file = file;
1282
+ }
1283
+ BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
1284
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
1285
+ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
1286
+ var relativeSource = aSource;
1287
+ if (this.sourceRoot != null && (relativeSource = util.relative(this.sourceRoot, relativeSource)), this._sources.has(relativeSource))
1288
+ return this._sources.indexOf(relativeSource);
1289
+ var i;
1290
+ for (i = 0; i < this._absoluteSources.length; ++i)
1291
+ if (this._absoluteSources[i] == aSource)
1292
+ return i;
1293
+ return -1;
1294
+ };
1295
+ BasicSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
1296
+ var smc = Object.create(BasicSourceMapConsumer.prototype), names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), !0), sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), !0);
1297
+ smc.sourceRoot = aSourceMap._sourceRoot, smc.sourcesContent = aSourceMap._generateSourcesContent(
1298
+ smc._sources.toArray(),
1299
+ smc.sourceRoot
1300
+ ), smc.file = aSourceMap._file, smc._sourceMapURL = aSourceMapURL, smc._absoluteSources = smc._sources.toArray().map(function(s) {
1301
+ return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
1302
+ });
1303
+ for (var generatedMappings = aSourceMap._mappings.toArray().slice(), destGeneratedMappings = smc.__generatedMappings = [], destOriginalMappings = smc.__originalMappings = [], i = 0, length = generatedMappings.length; i < length; i++) {
1304
+ var srcMapping = generatedMappings[i], destMapping = new Mapping();
1305
+ destMapping.generatedLine = srcMapping.generatedLine, destMapping.generatedColumn = srcMapping.generatedColumn, srcMapping.source && (destMapping.source = sources.indexOf(srcMapping.source), destMapping.originalLine = srcMapping.originalLine, destMapping.originalColumn = srcMapping.originalColumn, srcMapping.name && (destMapping.name = names.indexOf(srcMapping.name)), destOriginalMappings.push(destMapping)), destGeneratedMappings.push(destMapping);
1306
+ }
1307
+ return quickSort(smc.__originalMappings, util.compareByOriginalPositions), smc;
1308
+ };
1309
+ BasicSourceMapConsumer.prototype._version = 3;
1310
+ Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
1311
+ get: function() {
1312
+ return this._absoluteSources.slice();
1313
+ }
1314
+ });
1315
+ function Mapping() {
1316
+ this.generatedLine = 0, this.generatedColumn = 0, this.source = null, this.originalLine = null, this.originalColumn = null, this.name = null;
1317
+ }
1318
+ BasicSourceMapConsumer.prototype._parseMappings = function(aStr, aSourceRoot) {
1319
+ for (var generatedLine = 1, previousGeneratedColumn = 0, previousOriginalLine = 0, previousOriginalColumn = 0, previousSource = 0, previousName = 0, length = aStr.length, index = 0, cachedSegments = {}, temp = {}, originalMappings = [], generatedMappings = [], mapping, str, segment, end, value; index < length; )
1320
+ if (aStr.charAt(index) === ";")
1321
+ generatedLine++, index++, previousGeneratedColumn = 0;
1322
+ else if (aStr.charAt(index) === ",")
1323
+ index++;
1324
+ else {
1325
+ for (mapping = new Mapping(), mapping.generatedLine = generatedLine, end = index; end < length && !this._charIsMappingSeparator(aStr, end); end++)
1326
+ ;
1327
+ if (str = aStr.slice(index, end), segment = cachedSegments[str], segment)
1328
+ index += str.length;
1329
+ else {
1330
+ for (segment = []; index < end; )
1331
+ base64VLQ.decode(aStr, index, temp), value = temp.value, index = temp.rest, segment.push(value);
1332
+ if (segment.length === 2)
1333
+ throw new Error("Found a source, but no line and column");
1334
+ if (segment.length === 3)
1335
+ throw new Error("Found a source and line, but no column");
1336
+ cachedSegments[str] = segment;
1337
+ }
1338
+ mapping.generatedColumn = previousGeneratedColumn + segment[0], previousGeneratedColumn = mapping.generatedColumn, segment.length > 1 && (mapping.source = previousSource + segment[1], previousSource += segment[1], mapping.originalLine = previousOriginalLine + segment[2], previousOriginalLine = mapping.originalLine, mapping.originalLine += 1, mapping.originalColumn = previousOriginalColumn + segment[3], previousOriginalColumn = mapping.originalColumn, segment.length > 4 && (mapping.name = previousName + segment[4], previousName += segment[4])), generatedMappings.push(mapping), typeof mapping.originalLine == "number" && originalMappings.push(mapping);
1339
+ }
1340
+ quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated), this.__generatedMappings = generatedMappings, quickSort(originalMappings, util.compareByOriginalPositions), this.__originalMappings = originalMappings;
1341
+ };
1342
+ BasicSourceMapConsumer.prototype._findMapping = function(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
1343
+ if (aNeedle[aLineName] <= 0)
1344
+ throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
1345
+ if (aNeedle[aColumnName] < 0)
1346
+ throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
1347
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
1348
+ };
1349
+ BasicSourceMapConsumer.prototype.computeColumnSpans = function() {
1350
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
1351
+ var mapping = this._generatedMappings[index];
1352
+ if (index + 1 < this._generatedMappings.length) {
1353
+ var nextMapping = this._generatedMappings[index + 1];
1354
+ if (mapping.generatedLine === nextMapping.generatedLine) {
1355
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
1356
+ continue;
1357
+ }
1358
+ }
1359
+ mapping.lastGeneratedColumn = 1 / 0;
1360
+ }
1361
+ };
1362
+ BasicSourceMapConsumer.prototype.originalPositionFor = function(aArgs) {
1363
+ var needle = {
1364
+ generatedLine: util.getArg(aArgs, "line"),
1365
+ generatedColumn: util.getArg(aArgs, "column")
1366
+ }, index = this._findMapping(
1367
+ needle,
1368
+ this._generatedMappings,
1369
+ "generatedLine",
1370
+ "generatedColumn",
1371
+ util.compareByGeneratedPositionsDeflated,
1372
+ util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
1373
+ );
1374
+ if (index >= 0) {
1375
+ var mapping = this._generatedMappings[index];
1376
+ if (mapping.generatedLine === needle.generatedLine) {
1377
+ var source = util.getArg(mapping, "source", null);
1378
+ source !== null && (source = this._sources.at(source), source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL));
1379
+ var name = util.getArg(mapping, "name", null);
1380
+ return name !== null && (name = this._names.at(name)), {
1381
+ source,
1382
+ line: util.getArg(mapping, "originalLine", null),
1383
+ column: util.getArg(mapping, "originalColumn", null),
1384
+ name
1385
+ };
1386
+ }
1387
+ }
1388
+ return {
1389
+ source: null,
1390
+ line: null,
1391
+ column: null,
1392
+ name: null
1393
+ };
1394
+ };
1395
+ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function() {
1396
+ return this.sourcesContent ? this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
1397
+ return sc == null;
1398
+ }) : !1;
1399
+ };
1400
+ BasicSourceMapConsumer.prototype.sourceContentFor = function(aSource, nullOnMissing) {
1401
+ if (!this.sourcesContent)
1402
+ return null;
1403
+ var index = this._findSourceIndex(aSource);
1404
+ if (index >= 0)
1405
+ return this.sourcesContent[index];
1406
+ var relativeSource = aSource;
1407
+ this.sourceRoot != null && (relativeSource = util.relative(this.sourceRoot, relativeSource));
1408
+ var url;
1409
+ if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
1410
+ var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
1411
+ if (url.scheme == "file" && this._sources.has(fileUriAbsPath))
1412
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
1413
+ if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource))
1414
+ return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
1415
+ }
1416
+ if (nullOnMissing)
1417
+ return null;
1418
+ throw new Error('"' + relativeSource + '" is not in the SourceMap.');
1419
+ };
1420
+ BasicSourceMapConsumer.prototype.generatedPositionFor = function(aArgs) {
1421
+ var source = util.getArg(aArgs, "source");
1422
+ if (source = this._findSourceIndex(source), source < 0)
1423
+ return {
1424
+ line: null,
1425
+ column: null,
1426
+ lastColumn: null
1427
+ };
1428
+ var needle = {
1429
+ source,
1430
+ originalLine: util.getArg(aArgs, "line"),
1431
+ originalColumn: util.getArg(aArgs, "column")
1432
+ }, index = this._findMapping(
1433
+ needle,
1434
+ this._originalMappings,
1435
+ "originalLine",
1436
+ "originalColumn",
1437
+ util.compareByOriginalPositions,
1438
+ util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
1439
+ );
1440
+ if (index >= 0) {
1441
+ var mapping = this._originalMappings[index];
1442
+ if (mapping.source === needle.source)
1443
+ return {
1444
+ line: util.getArg(mapping, "generatedLine", null),
1445
+ column: util.getArg(mapping, "generatedColumn", null),
1446
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
1447
+ };
1448
+ }
1449
+ return {
1450
+ line: null,
1451
+ column: null,
1452
+ lastColumn: null
1453
+ };
1454
+ };
1455
+ exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
1456
+ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
1457
+ var sourceMap = aSourceMap;
1458
+ typeof aSourceMap == "string" && (sourceMap = util.parseSourceMapInput(aSourceMap));
1459
+ var version = util.getArg(sourceMap, "version"), sections = util.getArg(sourceMap, "sections");
1460
+ if (version != this._version)
1461
+ throw new Error("Unsupported version: " + version);
1462
+ this._sources = new ArraySet(), this._names = new ArraySet();
1463
+ var lastOffset = {
1464
+ line: -1,
1465
+ column: 0
1466
+ };
1467
+ this._sections = sections.map(function(s) {
1468
+ if (s.url)
1469
+ throw new Error("Support for url field in sections not implemented.");
1470
+ var offset = util.getArg(s, "offset"), offsetLine = util.getArg(offset, "line"), offsetColumn = util.getArg(offset, "column");
1471
+ if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column)
1472
+ throw new Error("Section offsets must be ordered and non-overlapping.");
1473
+ return lastOffset = offset, {
1474
+ generatedOffset: {
1475
+ // The offset fields are 0-based, but we use 1-based indices when
1476
+ // encoding/decoding from VLQ.
1477
+ generatedLine: offsetLine + 1,
1478
+ generatedColumn: offsetColumn + 1
1479
+ },
1480
+ consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
1481
+ };
1482
+ });
1483
+ }
1484
+ IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
1485
+ IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
1486
+ IndexedSourceMapConsumer.prototype._version = 3;
1487
+ Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
1488
+ get: function() {
1489
+ for (var sources = [], i = 0; i < this._sections.length; i++)
1490
+ for (var j = 0; j < this._sections[i].consumer.sources.length; j++)
1491
+ sources.push(this._sections[i].consumer.sources[j]);
1492
+ return sources;
1493
+ }
1494
+ });
1495
+ IndexedSourceMapConsumer.prototype.originalPositionFor = function(aArgs) {
1496
+ var needle = {
1497
+ generatedLine: util.getArg(aArgs, "line"),
1498
+ generatedColumn: util.getArg(aArgs, "column")
1499
+ }, sectionIndex = binarySearch.search(
1500
+ needle,
1501
+ this._sections,
1502
+ function(needle2, section2) {
1503
+ var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
1504
+ return cmp || needle2.generatedColumn - section2.generatedOffset.generatedColumn;
1505
+ }
1506
+ ), section = this._sections[sectionIndex];
1507
+ return section ? section.consumer.originalPositionFor({
1508
+ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
1509
+ column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1510
+ bias: aArgs.bias
1511
+ }) : {
1512
+ source: null,
1513
+ line: null,
1514
+ column: null,
1515
+ name: null
1516
+ };
1517
+ };
1518
+ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function() {
1519
+ return this._sections.every(function(s) {
1520
+ return s.consumer.hasContentsOfAllSources();
1521
+ });
1522
+ };
1523
+ IndexedSourceMapConsumer.prototype.sourceContentFor = function(aSource, nullOnMissing) {
1524
+ for (var i = 0; i < this._sections.length; i++) {
1525
+ var section = this._sections[i], content = section.consumer.sourceContentFor(aSource, !0);
1526
+ if (content)
1527
+ return content;
1528
+ }
1529
+ if (nullOnMissing)
1530
+ return null;
1531
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
1532
+ };
1533
+ IndexedSourceMapConsumer.prototype.generatedPositionFor = function(aArgs) {
1534
+ for (var i = 0; i < this._sections.length; i++) {
1535
+ var section = this._sections[i];
1536
+ if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) !== -1) {
1537
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
1538
+ if (generatedPosition) {
1539
+ var ret = {
1540
+ line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
1541
+ column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
1542
+ };
1543
+ return ret;
1544
+ }
1545
+ }
1546
+ }
1547
+ return {
1548
+ line: null,
1549
+ column: null
1550
+ };
1551
+ };
1552
+ IndexedSourceMapConsumer.prototype._parseMappings = function(aStr, aSourceRoot) {
1553
+ this.__generatedMappings = [], this.__originalMappings = [];
1554
+ for (var i = 0; i < this._sections.length; i++)
1555
+ for (var section = this._sections[i], sectionMappings = section.consumer._generatedMappings, j = 0; j < sectionMappings.length; j++) {
1556
+ var mapping = sectionMappings[j], source = section.consumer._sources.at(mapping.source);
1557
+ source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL), this._sources.add(source), source = this._sources.indexOf(source);
1558
+ var name = null;
1559
+ mapping.name && (name = section.consumer._names.at(mapping.name), this._names.add(name), name = this._names.indexOf(name));
1560
+ var adjustedMapping = {
1561
+ source,
1562
+ generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
1563
+ generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1564
+ originalLine: mapping.originalLine,
1565
+ originalColumn: mapping.originalColumn,
1566
+ name
1567
+ };
1568
+ this.__generatedMappings.push(adjustedMapping), typeof adjustedMapping.originalLine == "number" && this.__originalMappings.push(adjustedMapping);
1569
+ }
1570
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated), quickSort(this.__originalMappings, util.compareByOriginalPositions);
1571
+ };
1572
+ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
1573
+ }
1574
+ });
1575
+
1576
+ // ../../node_modules/escodegen/node_modules/source-map/lib/source-node.js
1577
+ var require_source_node = __commonJS({
1578
+ "../../node_modules/escodegen/node_modules/source-map/lib/source-node.js"(exports) {
1579
+ var SourceMapGenerator = require_source_map_generator().SourceMapGenerator, util = require_util(), REGEX_NEWLINE = /(\r?\n)/, NEWLINE_CODE = 10, isSourceNode = "$$$isSourceNode$$$";
1580
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
1581
+ this.children = [], this.sourceContents = {}, this.line = aLine ?? null, this.column = aColumn ?? null, this.source = aSource ?? null, this.name = aName ?? null, this[isSourceNode] = !0, aChunks != null && this.add(aChunks);
1582
+ }
1583
+ SourceNode.fromStringWithSourceMap = function(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
1584
+ var node = new SourceNode(), remainingLines = aGeneratedCode.split(REGEX_NEWLINE), remainingLinesIndex = 0, shiftNextLine = function() {
1585
+ var lineContents = getNextLine(), newLine = getNextLine() || "";
1586
+ return lineContents + newLine;
1587
+ function getNextLine() {
1588
+ return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
1589
+ }
1590
+ }, lastGeneratedLine = 1, lastGeneratedColumn = 0, lastMapping = null;
1591
+ return aSourceMapConsumer.eachMapping(function(mapping) {
1592
+ if (lastMapping !== null)
1593
+ if (lastGeneratedLine < mapping.generatedLine)
1594
+ addMappingWithCode(lastMapping, shiftNextLine()), lastGeneratedLine++, lastGeneratedColumn = 0;
1595
+ else {
1596
+ var nextLine = remainingLines[remainingLinesIndex] || "", code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
1597
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn), lastGeneratedColumn = mapping.generatedColumn, addMappingWithCode(lastMapping, code), lastMapping = mapping;
1598
+ return;
1599
+ }
1600
+ for (; lastGeneratedLine < mapping.generatedLine; )
1601
+ node.add(shiftNextLine()), lastGeneratedLine++;
1602
+ if (lastGeneratedColumn < mapping.generatedColumn) {
1603
+ var nextLine = remainingLines[remainingLinesIndex] || "";
1604
+ node.add(nextLine.substr(0, mapping.generatedColumn)), remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn), lastGeneratedColumn = mapping.generatedColumn;
1605
+ }
1606
+ lastMapping = mapping;
1607
+ }, this), remainingLinesIndex < remainingLines.length && (lastMapping && addMappingWithCode(lastMapping, shiftNextLine()), node.add(remainingLines.splice(remainingLinesIndex).join(""))), aSourceMapConsumer.sources.forEach(function(sourceFile) {
1608
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1609
+ content != null && (aRelativePath != null && (sourceFile = util.join(aRelativePath, sourceFile)), node.setSourceContent(sourceFile, content));
1610
+ }), node;
1611
+ function addMappingWithCode(mapping, code) {
1612
+ if (mapping === null || mapping.source === void 0)
1613
+ node.add(code);
1614
+ else {
1615
+ var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
1616
+ node.add(new SourceNode(
1617
+ mapping.originalLine,
1618
+ mapping.originalColumn,
1619
+ source,
1620
+ code,
1621
+ mapping.name
1622
+ ));
1623
+ }
1624
+ }
1625
+ };
1626
+ SourceNode.prototype.add = function(aChunk) {
1627
+ if (Array.isArray(aChunk))
1628
+ aChunk.forEach(function(chunk) {
1629
+ this.add(chunk);
1630
+ }, this);
1631
+ else if (aChunk[isSourceNode] || typeof aChunk == "string")
1632
+ aChunk && this.children.push(aChunk);
1633
+ else
1634
+ throw new TypeError(
1635
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
1636
+ );
1637
+ return this;
1638
+ };
1639
+ SourceNode.prototype.prepend = function(aChunk) {
1640
+ if (Array.isArray(aChunk))
1641
+ for (var i = aChunk.length - 1; i >= 0; i--)
1642
+ this.prepend(aChunk[i]);
1643
+ else if (aChunk[isSourceNode] || typeof aChunk == "string")
1644
+ this.children.unshift(aChunk);
1645
+ else
1646
+ throw new TypeError(
1647
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
1648
+ );
1649
+ return this;
1650
+ };
1651
+ SourceNode.prototype.walk = function(aFn) {
1652
+ for (var chunk, i = 0, len = this.children.length; i < len; i++)
1653
+ chunk = this.children[i], chunk[isSourceNode] ? chunk.walk(aFn) : chunk !== "" && aFn(chunk, {
1654
+ source: this.source,
1655
+ line: this.line,
1656
+ column: this.column,
1657
+ name: this.name
1658
+ });
1659
+ };
1660
+ SourceNode.prototype.join = function(aSep) {
1661
+ var newChildren, i, len = this.children.length;
1662
+ if (len > 0) {
1663
+ for (newChildren = [], i = 0; i < len - 1; i++)
1664
+ newChildren.push(this.children[i]), newChildren.push(aSep);
1665
+ newChildren.push(this.children[i]), this.children = newChildren;
1666
+ }
1667
+ return this;
1668
+ };
1669
+ SourceNode.prototype.replaceRight = function(aPattern, aReplacement) {
1670
+ var lastChild = this.children[this.children.length - 1];
1671
+ return lastChild[isSourceNode] ? lastChild.replaceRight(aPattern, aReplacement) : typeof lastChild == "string" ? this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement) : this.children.push("".replace(aPattern, aReplacement)), this;
1672
+ };
1673
+ SourceNode.prototype.setSourceContent = function(aSourceFile, aSourceContent) {
1674
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
1675
+ };
1676
+ SourceNode.prototype.walkSourceContents = function(aFn) {
1677
+ for (var i = 0, len = this.children.length; i < len; i++)
1678
+ this.children[i][isSourceNode] && this.children[i].walkSourceContents(aFn);
1679
+ for (var sources = Object.keys(this.sourceContents), i = 0, len = sources.length; i < len; i++)
1680
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
1681
+ };
1682
+ SourceNode.prototype.toString = function() {
1683
+ var str = "";
1684
+ return this.walk(function(chunk) {
1685
+ str += chunk;
1686
+ }), str;
1687
+ };
1688
+ SourceNode.prototype.toStringWithSourceMap = function(aArgs) {
1689
+ var generated = {
1690
+ code: "",
1691
+ line: 1,
1692
+ column: 0
1693
+ }, map = new SourceMapGenerator(aArgs), sourceMappingActive = !1, lastOriginalSource = null, lastOriginalLine = null, lastOriginalColumn = null, lastOriginalName = null;
1694
+ return this.walk(function(chunk, original) {
1695
+ generated.code += chunk, original.source !== null && original.line !== null && original.column !== null ? ((lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) && map.addMapping({
1696
+ source: original.source,
1697
+ original: {
1698
+ line: original.line,
1699
+ column: original.column
1700
+ },
1701
+ generated: {
1702
+ line: generated.line,
1703
+ column: generated.column
1704
+ },
1705
+ name: original.name
1706
+ }), lastOriginalSource = original.source, lastOriginalLine = original.line, lastOriginalColumn = original.column, lastOriginalName = original.name, sourceMappingActive = !0) : sourceMappingActive && (map.addMapping({
1707
+ generated: {
1708
+ line: generated.line,
1709
+ column: generated.column
1710
+ }
1711
+ }), lastOriginalSource = null, sourceMappingActive = !1);
1712
+ for (var idx = 0, length = chunk.length; idx < length; idx++)
1713
+ chunk.charCodeAt(idx) === NEWLINE_CODE ? (generated.line++, generated.column = 0, idx + 1 === length ? (lastOriginalSource = null, sourceMappingActive = !1) : sourceMappingActive && map.addMapping({
1714
+ source: original.source,
1715
+ original: {
1716
+ line: original.line,
1717
+ column: original.column
1718
+ },
1719
+ generated: {
1720
+ line: generated.line,
1721
+ column: generated.column
1722
+ },
1723
+ name: original.name
1724
+ })) : generated.column++;
1725
+ }), this.walkSourceContents(function(sourceFile, sourceContent) {
1726
+ map.setSourceContent(sourceFile, sourceContent);
1727
+ }), { code: generated.code, map };
1728
+ };
1729
+ exports.SourceNode = SourceNode;
1730
+ }
1731
+ });
1732
+
1733
+ // ../../node_modules/escodegen/node_modules/source-map/source-map.js
1734
+ var require_source_map = __commonJS({
1735
+ "../../node_modules/escodegen/node_modules/source-map/source-map.js"(exports) {
1736
+ exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1737
+ exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
1738
+ exports.SourceNode = require_source_node().SourceNode;
1739
+ }
1740
+ });
1741
+
1742
+ // ../../node_modules/escodegen/package.json
1743
+ var require_package = __commonJS({
1744
+ "../../node_modules/escodegen/package.json"(exports, module) {
1745
+ module.exports = {
1746
+ name: "escodegen",
1747
+ description: "ECMAScript code generator",
1748
+ homepage: "http://github.com/estools/escodegen",
1749
+ main: "escodegen.js",
1750
+ bin: {
1751
+ esgenerate: "./bin/esgenerate.js",
1752
+ escodegen: "./bin/escodegen.js"
1753
+ },
1754
+ files: [
1755
+ "LICENSE.BSD",
1756
+ "README.md",
1757
+ "bin",
1758
+ "escodegen.js",
1759
+ "package.json"
1760
+ ],
1761
+ version: "2.1.0",
1762
+ engines: {
1763
+ node: ">=6.0"
1764
+ },
1765
+ maintainers: [
1766
+ {
1767
+ name: "Yusuke Suzuki",
1768
+ email: "utatane.tea@gmail.com",
1769
+ web: "http://github.com/Constellation"
1770
+ }
1771
+ ],
1772
+ repository: {
1773
+ type: "git",
1774
+ url: "http://github.com/estools/escodegen.git"
1775
+ },
1776
+ dependencies: {
1777
+ estraverse: "^5.2.0",
1778
+ esutils: "^2.0.2",
1779
+ esprima: "^4.0.1"
1780
+ },
1781
+ optionalDependencies: {
1782
+ "source-map": "~0.6.1"
1783
+ },
1784
+ devDependencies: {
1785
+ acorn: "^8.0.4",
1786
+ bluebird: "^3.4.7",
1787
+ "bower-registry-client": "^1.0.0",
1788
+ chai: "^4.2.0",
1789
+ "chai-exclude": "^2.0.2",
1790
+ "commonjs-everywhere": "^0.9.7",
1791
+ gulp: "^4.0.2",
1792
+ "gulp-eslint": "^6.0.0",
1793
+ "gulp-mocha": "^7.0.2",
1794
+ minimist: "^1.2.5",
1795
+ optionator: "^0.9.1",
1796
+ semver: "^7.3.4"
1797
+ },
1798
+ license: "BSD-2-Clause",
1799
+ scripts: {
1800
+ test: "gulp travis",
1801
+ "unit-test": "gulp test",
1802
+ lint: "gulp lint",
1803
+ release: "node tools/release.js",
1804
+ "build-min": "./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js",
1805
+ build: "./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js"
1806
+ }
1807
+ };
1808
+ }
1809
+ });
1810
+
1811
+ // ../../node_modules/escodegen/escodegen.js
1812
+ var require_escodegen = __commonJS({
1813
+ "../../node_modules/escodegen/escodegen.js"(exports) {
1814
+ (function() {
1815
+ "use strict";
1816
+ var Syntax, Precedence, BinaryPrecedence, SourceNode, estraverse, esutils, base2, indent, json, renumber, hexadecimal, quotes, escapeless, newline, space, parentheses, semicolons, safeConcatenation, directive, extra, parse2, sourceMap, sourceCode, preserveBlankLines, FORMAT_MINIFY, FORMAT_DEFAULTS;
1817
+ estraverse = require_estraverse(), esutils = require_utils(), Syntax = estraverse.Syntax;
1818
+ function isExpression(node) {
1819
+ return CodeGenerator.Expression.hasOwnProperty(node.type);
1820
+ }
1821
+ function isStatement(node) {
1822
+ return CodeGenerator.Statement.hasOwnProperty(node.type);
1823
+ }
1824
+ Precedence = {
1825
+ Sequence: 0,
1826
+ Yield: 1,
1827
+ Assignment: 1,
1828
+ Conditional: 2,
1829
+ ArrowFunction: 2,
1830
+ Coalesce: 3,
1831
+ LogicalOR: 4,
1832
+ LogicalAND: 5,
1833
+ BitwiseOR: 6,
1834
+ BitwiseXOR: 7,
1835
+ BitwiseAND: 8,
1836
+ Equality: 9,
1837
+ Relational: 10,
1838
+ BitwiseSHIFT: 11,
1839
+ Additive: 12,
1840
+ Multiplicative: 13,
1841
+ Exponentiation: 14,
1842
+ Await: 15,
1843
+ Unary: 15,
1844
+ Postfix: 16,
1845
+ OptionalChaining: 17,
1846
+ Call: 18,
1847
+ New: 19,
1848
+ TaggedTemplate: 20,
1849
+ Member: 21,
1850
+ Primary: 22
1851
+ }, BinaryPrecedence = {
1852
+ "??": Precedence.Coalesce,
1853
+ "||": Precedence.LogicalOR,
1854
+ "&&": Precedence.LogicalAND,
1855
+ "|": Precedence.BitwiseOR,
1856
+ "^": Precedence.BitwiseXOR,
1857
+ "&": Precedence.BitwiseAND,
1858
+ "==": Precedence.Equality,
1859
+ "!=": Precedence.Equality,
1860
+ "===": Precedence.Equality,
1861
+ "!==": Precedence.Equality,
1862
+ is: Precedence.Equality,
1863
+ isnt: Precedence.Equality,
1864
+ "<": Precedence.Relational,
1865
+ ">": Precedence.Relational,
1866
+ "<=": Precedence.Relational,
1867
+ ">=": Precedence.Relational,
1868
+ in: Precedence.Relational,
1869
+ instanceof: Precedence.Relational,
1870
+ "<<": Precedence.BitwiseSHIFT,
1871
+ ">>": Precedence.BitwiseSHIFT,
1872
+ ">>>": Precedence.BitwiseSHIFT,
1873
+ "+": Precedence.Additive,
1874
+ "-": Precedence.Additive,
1875
+ "*": Precedence.Multiplicative,
1876
+ "%": Precedence.Multiplicative,
1877
+ "/": Precedence.Multiplicative,
1878
+ "**": Precedence.Exponentiation
1879
+ };
1880
+ var F_ALLOW_IN = 1, F_ALLOW_CALL = 2, F_ALLOW_UNPARATH_NEW = 4, F_FUNC_BODY = 8, F_DIRECTIVE_CTX = 16, F_SEMICOLON_OPT = 32, F_FOUND_COALESCE = 64, E_FTT = F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, E_TTF = F_ALLOW_IN | F_ALLOW_CALL, E_TTT = F_ALLOW_IN | F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, E_TFF = F_ALLOW_IN, E_FFT = F_ALLOW_UNPARATH_NEW, E_TFT = F_ALLOW_IN | F_ALLOW_UNPARATH_NEW, S_TFFF = F_ALLOW_IN, S_TFFT = F_ALLOW_IN | F_SEMICOLON_OPT, S_FFFF = 0, S_TFTF = F_ALLOW_IN | F_DIRECTIVE_CTX, S_TTFF = F_ALLOW_IN | F_FUNC_BODY;
1881
+ function getDefaultOptions() {
1882
+ return {
1883
+ indent: null,
1884
+ base: null,
1885
+ parse: null,
1886
+ comment: !1,
1887
+ format: {
1888
+ indent: {
1889
+ style: " ",
1890
+ base: 0,
1891
+ adjustMultilineComment: !1
1892
+ },
1893
+ newline: `
1894
+ `,
1895
+ space: " ",
1896
+ json: !1,
1897
+ renumber: !1,
1898
+ hexadecimal: !1,
1899
+ quotes: "single",
1900
+ escapeless: !1,
1901
+ compact: !1,
1902
+ parentheses: !0,
1903
+ semicolons: !0,
1904
+ safeConcatenation: !1,
1905
+ preserveBlankLines: !1
1906
+ },
1907
+ moz: {
1908
+ comprehensionExpressionStartsWithAssignment: !1,
1909
+ starlessGenerator: !1
1910
+ },
1911
+ sourceMap: null,
1912
+ sourceMapRoot: null,
1913
+ sourceMapWithCode: !1,
1914
+ directive: !1,
1915
+ raw: !0,
1916
+ verbatim: null,
1917
+ sourceCode: null
1918
+ };
1919
+ }
1920
+ function stringRepeat(str, num) {
1921
+ var result = "";
1922
+ for (num |= 0; num > 0; num >>>= 1, str += str)
1923
+ num & 1 && (result += str);
1924
+ return result;
1925
+ }
1926
+ function hasLineTerminator(str) {
1927
+ return /[\r\n]/g.test(str);
1928
+ }
1929
+ function endsWithLineTerminator(str) {
1930
+ var len = str.length;
1931
+ return len && esutils.code.isLineTerminator(str.charCodeAt(len - 1));
1932
+ }
1933
+ function merge(target, override) {
1934
+ var key;
1935
+ for (key in override)
1936
+ override.hasOwnProperty(key) && (target[key] = override[key]);
1937
+ return target;
1938
+ }
1939
+ function updateDeeply(target, override) {
1940
+ var key, val;
1941
+ function isHashObject(target2) {
1942
+ return typeof target2 == "object" && target2 instanceof Object && !(target2 instanceof RegExp);
1943
+ }
1944
+ for (key in override)
1945
+ override.hasOwnProperty(key) && (val = override[key], isHashObject(val) ? isHashObject(target[key]) ? updateDeeply(target[key], val) : target[key] = updateDeeply({}, val) : target[key] = val);
1946
+ return target;
1947
+ }
1948
+ function generateNumber(value) {
1949
+ var result, point, temp, exponent, pos;
1950
+ if (value !== value)
1951
+ throw new Error("Numeric literal whose value is NaN");
1952
+ if (value < 0 || value === 0 && 1 / value < 0)
1953
+ throw new Error("Numeric literal whose value is negative");
1954
+ if (value === 1 / 0)
1955
+ return json ? "null" : renumber ? "1e400" : "1e+400";
1956
+ if (result = "" + value, !renumber || result.length < 3)
1957
+ return result;
1958
+ for (point = result.indexOf("."), !json && result.charCodeAt(0) === 48 && point === 1 && (point = 0, result = result.slice(1)), temp = result, result = result.replace("e+", "e"), exponent = 0, (pos = temp.indexOf("e")) > 0 && (exponent = +temp.slice(pos + 1), temp = temp.slice(0, pos)), point >= 0 && (exponent -= temp.length - point - 1, temp = +(temp.slice(0, point) + temp.slice(point + 1)) + ""), pos = 0; temp.charCodeAt(temp.length + pos - 1) === 48; )
1959
+ --pos;
1960
+ return pos !== 0 && (exponent -= pos, temp = temp.slice(0, pos)), exponent !== 0 && (temp += "e" + exponent), (temp.length < result.length || hexadecimal && value > 1e12 && Math.floor(value) === value && (temp = "0x" + value.toString(16)).length < result.length) && +temp === value && (result = temp), result;
1961
+ }
1962
+ function escapeRegExpCharacter(ch, previousIsBackslash) {
1963
+ return (ch & -2) === 8232 ? (previousIsBackslash ? "u" : "\\u") + (ch === 8232 ? "2028" : "2029") : ch === 10 || ch === 13 ? (previousIsBackslash ? "" : "\\") + (ch === 10 ? "n" : "r") : String.fromCharCode(ch);
1964
+ }
1965
+ function generateRegExp(reg) {
1966
+ var match, result, flags, i, iz, ch, characterInBrack, previousIsBackslash;
1967
+ if (result = reg.toString(), reg.source) {
1968
+ if (match = result.match(/\/([^/]*)$/), !match)
1969
+ return result;
1970
+ for (flags = match[1], result = "", characterInBrack = !1, previousIsBackslash = !1, i = 0, iz = reg.source.length; i < iz; ++i)
1971
+ ch = reg.source.charCodeAt(i), previousIsBackslash ? (result += escapeRegExpCharacter(ch, previousIsBackslash), previousIsBackslash = !1) : (characterInBrack ? ch === 93 && (characterInBrack = !1) : ch === 47 ? result += "\\" : ch === 91 && (characterInBrack = !0), result += escapeRegExpCharacter(ch, previousIsBackslash), previousIsBackslash = ch === 92);
1972
+ return "/" + result + "/" + flags;
1973
+ }
1974
+ return result;
1975
+ }
1976
+ function escapeAllowedCharacter(code, next) {
1977
+ var hex;
1978
+ return code === 8 ? "\\b" : code === 12 ? "\\f" : code === 9 ? "\\t" : (hex = code.toString(16).toUpperCase(), json || code > 255 ? "\\u" + "0000".slice(hex.length) + hex : code === 0 && !esutils.code.isDecimalDigit(next) ? "\\0" : code === 11 ? "\\x0B" : "\\x" + "00".slice(hex.length) + hex);
1979
+ }
1980
+ function escapeDisallowedCharacter(code) {
1981
+ if (code === 92)
1982
+ return "\\\\";
1983
+ if (code === 10)
1984
+ return "\\n";
1985
+ if (code === 13)
1986
+ return "\\r";
1987
+ if (code === 8232)
1988
+ return "\\u2028";
1989
+ if (code === 8233)
1990
+ return "\\u2029";
1991
+ throw new Error("Incorrectly classified character");
1992
+ }
1993
+ function escapeDirective(str) {
1994
+ var i, iz, code, quote;
1995
+ for (quote = quotes === "double" ? '"' : "'", i = 0, iz = str.length; i < iz; ++i)
1996
+ if (code = str.charCodeAt(i), code === 39) {
1997
+ quote = '"';
1998
+ break;
1999
+ } else if (code === 34) {
2000
+ quote = "'";
2001
+ break;
2002
+ } else code === 92 && ++i;
2003
+ return quote + str + quote;
2004
+ }
2005
+ function escapeString(str) {
2006
+ var result = "", i, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote;
2007
+ for (i = 0, len = str.length; i < len; ++i) {
2008
+ if (code = str.charCodeAt(i), code === 39)
2009
+ ++singleQuotes;
2010
+ else if (code === 34)
2011
+ ++doubleQuotes;
2012
+ else if (code === 47 && json)
2013
+ result += "\\";
2014
+ else if (esutils.code.isLineTerminator(code) || code === 92) {
2015
+ result += escapeDisallowedCharacter(code);
2016
+ continue;
2017
+ } else if (!esutils.code.isIdentifierPartES5(code) && (json && code < 32 || !json && !escapeless && (code < 32 || code > 126))) {
2018
+ result += escapeAllowedCharacter(code, str.charCodeAt(i + 1));
2019
+ continue;
2020
+ }
2021
+ result += String.fromCharCode(code);
2022
+ }
2023
+ if (single = !(quotes === "double" || quotes === "auto" && doubleQuotes < singleQuotes), quote = single ? "'" : '"', !(single ? singleQuotes : doubleQuotes))
2024
+ return quote + result + quote;
2025
+ for (str = result, result = quote, i = 0, len = str.length; i < len; ++i)
2026
+ code = str.charCodeAt(i), (code === 39 && single || code === 34 && !single) && (result += "\\"), result += String.fromCharCode(code);
2027
+ return result + quote;
2028
+ }
2029
+ function flattenToString(arr) {
2030
+ var i, iz, elem, result = "";
2031
+ for (i = 0, iz = arr.length; i < iz; ++i)
2032
+ elem = arr[i], result += Array.isArray(elem) ? flattenToString(elem) : elem;
2033
+ return result;
2034
+ }
2035
+ function toSourceNodeWhenNeeded(generated, node) {
2036
+ if (!sourceMap)
2037
+ return Array.isArray(generated) ? flattenToString(generated) : generated;
2038
+ if (node == null) {
2039
+ if (generated instanceof SourceNode)
2040
+ return generated;
2041
+ node = {};
2042
+ }
2043
+ return node.loc == null ? new SourceNode(null, null, sourceMap, generated, node.name || null) : new SourceNode(node.loc.start.line, node.loc.start.column, sourceMap === !0 ? node.loc.source || null : sourceMap, generated, node.name || null);
2044
+ }
2045
+ function noEmptySpace() {
2046
+ return space || " ";
2047
+ }
2048
+ function join(left, right) {
2049
+ var leftSource, rightSource, leftCharCode, rightCharCode;
2050
+ return leftSource = toSourceNodeWhenNeeded(left).toString(), leftSource.length === 0 ? [right] : (rightSource = toSourceNodeWhenNeeded(right).toString(), rightSource.length === 0 ? [left] : (leftCharCode = leftSource.charCodeAt(leftSource.length - 1), rightCharCode = rightSource.charCodeAt(0), (leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || leftCharCode === 47 && rightCharCode === 105 ? [left, noEmptySpace(), right] : esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode) ? [left, right] : [left, space, right]));
2051
+ }
2052
+ function addIndent(stmt) {
2053
+ return [base2, stmt];
2054
+ }
2055
+ function withIndent(fn) {
2056
+ var previousBase;
2057
+ previousBase = base2, base2 += indent, fn(base2), base2 = previousBase;
2058
+ }
2059
+ function calculateSpaces(str) {
2060
+ var i;
2061
+ for (i = str.length - 1; i >= 0 && !esutils.code.isLineTerminator(str.charCodeAt(i)); --i)
2062
+ ;
2063
+ return str.length - 1 - i;
2064
+ }
2065
+ function adjustMultilineComment(value, specialBase) {
2066
+ var array, i, len, line, j, spaces, previousBase, sn;
2067
+ for (array = value.split(/\r\n|[\r\n]/), spaces = Number.MAX_VALUE, i = 1, len = array.length; i < len; ++i) {
2068
+ for (line = array[i], j = 0; j < line.length && esutils.code.isWhiteSpace(line.charCodeAt(j)); )
2069
+ ++j;
2070
+ spaces > j && (spaces = j);
2071
+ }
2072
+ for (typeof specialBase < "u" ? (previousBase = base2, array[1][spaces] === "*" && (specialBase += " "), base2 = specialBase) : (spaces & 1 && --spaces, previousBase = base2), i = 1, len = array.length; i < len; ++i)
2073
+ sn = toSourceNodeWhenNeeded(addIndent(array[i].slice(spaces))), array[i] = sourceMap ? sn.join("") : sn;
2074
+ return base2 = previousBase, array.join(`
2075
+ `);
2076
+ }
2077
+ function generateComment(comment, specialBase) {
2078
+ if (comment.type === "Line") {
2079
+ if (endsWithLineTerminator(comment.value))
2080
+ return "//" + comment.value;
2081
+ var result = "//" + comment.value;
2082
+ return preserveBlankLines || (result += `
2083
+ `), result;
2084
+ }
2085
+ return extra.format.indent.adjustMultilineComment && /[\n\r]/.test(comment.value) ? adjustMultilineComment("/*" + comment.value + "*/", specialBase) : "/*" + comment.value + "*/";
2086
+ }
2087
+ function addComments(stmt, result) {
2088
+ var i, len, comment, save, tailingToStatement, specialBase, fragment, extRange, range, prevRange, prefix, infix, suffix, count;
2089
+ if (stmt.leadingComments && stmt.leadingComments.length > 0) {
2090
+ if (save = result, preserveBlankLines) {
2091
+ for (comment = stmt.leadingComments[0], result = [], extRange = comment.extendedRange, range = comment.range, prefix = sourceCode.substring(extRange[0], range[0]), count = (prefix.match(/\n/g) || []).length, count > 0 ? (result.push(stringRepeat(`
2092
+ `, count)), result.push(addIndent(generateComment(comment)))) : (result.push(prefix), result.push(generateComment(comment))), prevRange = range, i = 1, len = stmt.leadingComments.length; i < len; i++)
2093
+ comment = stmt.leadingComments[i], range = comment.range, infix = sourceCode.substring(prevRange[1], range[0]), count = (infix.match(/\n/g) || []).length, result.push(stringRepeat(`
2094
+ `, count)), result.push(addIndent(generateComment(comment))), prevRange = range;
2095
+ suffix = sourceCode.substring(range[1], extRange[1]), count = (suffix.match(/\n/g) || []).length, result.push(stringRepeat(`
2096
+ `, count));
2097
+ } else
2098
+ for (comment = stmt.leadingComments[0], result = [], safeConcatenation && stmt.type === Syntax.Program && stmt.body.length === 0 && result.push(`
2099
+ `), result.push(generateComment(comment)), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(`
2100
+ `), i = 1, len = stmt.leadingComments.length; i < len; ++i)
2101
+ comment = stmt.leadingComments[i], fragment = [generateComment(comment)], endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString()) || fragment.push(`
2102
+ `), result.push(addIndent(fragment));
2103
+ result.push(addIndent(save));
2104
+ }
2105
+ if (stmt.trailingComments)
2106
+ if (preserveBlankLines)
2107
+ comment = stmt.trailingComments[0], extRange = comment.extendedRange, range = comment.range, prefix = sourceCode.substring(extRange[0], range[0]), count = (prefix.match(/\n/g) || []).length, count > 0 ? (result.push(stringRepeat(`
2108
+ `, count)), result.push(addIndent(generateComment(comment)))) : (result.push(prefix), result.push(generateComment(comment)));
2109
+ else
2110
+ for (tailingToStatement = !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()), specialBase = stringRepeat(" ", calculateSpaces(toSourceNodeWhenNeeded([base2, result, indent]).toString())), i = 0, len = stmt.trailingComments.length; i < len; ++i)
2111
+ comment = stmt.trailingComments[i], tailingToStatement ? (i === 0 ? result = [result, indent] : result = [result, specialBase], result.push(generateComment(comment, specialBase))) : result = [result, addIndent(generateComment(comment))], i !== len - 1 && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) && (result = [result, `
2112
+ `]);
2113
+ return result;
2114
+ }
2115
+ function generateBlankLines(start, end, result) {
2116
+ var j, newlineCount = 0;
2117
+ for (j = start; j < end; j++)
2118
+ sourceCode[j] === `
2119
+ ` && newlineCount++;
2120
+ for (j = 1; j < newlineCount; j++)
2121
+ result.push(newline);
2122
+ }
2123
+ function parenthesize(text, current, should) {
2124
+ return current < should ? ["(", text, ")"] : text;
2125
+ }
2126
+ function generateVerbatimString(string) {
2127
+ var i, iz, result;
2128
+ for (result = string.split(/\r\n|\n/), i = 1, iz = result.length; i < iz; i++)
2129
+ result[i] = newline + base2 + result[i];
2130
+ return result;
2131
+ }
2132
+ function generateVerbatim(expr, precedence) {
2133
+ var verbatim, result, prec;
2134
+ return verbatim = expr[extra.verbatim], typeof verbatim == "string" ? result = parenthesize(generateVerbatimString(verbatim), Precedence.Sequence, precedence) : (result = generateVerbatimString(verbatim.content), prec = verbatim.precedence != null ? verbatim.precedence : Precedence.Sequence, result = parenthesize(result, prec, precedence)), toSourceNodeWhenNeeded(result, expr);
2135
+ }
2136
+ function CodeGenerator() {
2137
+ }
2138
+ CodeGenerator.prototype.maybeBlock = function(stmt, flags) {
2139
+ var result, noLeadingComment, that = this;
2140
+ return noLeadingComment = !extra.comment || !stmt.leadingComments, stmt.type === Syntax.BlockStatement && noLeadingComment ? [space, this.generateStatement(stmt, flags)] : stmt.type === Syntax.EmptyStatement && noLeadingComment ? ";" : (withIndent(function() {
2141
+ result = [
2142
+ newline,
2143
+ addIndent(that.generateStatement(stmt, flags))
2144
+ ];
2145
+ }), result);
2146
+ }, CodeGenerator.prototype.maybeBlockSuffix = function(stmt, result) {
2147
+ var ends = endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString());
2148
+ return stmt.type === Syntax.BlockStatement && (!extra.comment || !stmt.leadingComments) && !ends ? [result, space] : ends ? [result, base2] : [result, newline, base2];
2149
+ };
2150
+ function generateIdentifier(node) {
2151
+ return toSourceNodeWhenNeeded(node.name, node);
2152
+ }
2153
+ function generateAsyncPrefix(node, spaceRequired) {
2154
+ return node.async ? "async" + (spaceRequired ? noEmptySpace() : space) : "";
2155
+ }
2156
+ function generateStarSuffix(node) {
2157
+ var isGenerator = node.generator && !extra.moz.starlessGenerator;
2158
+ return isGenerator ? "*" + space : "";
2159
+ }
2160
+ function generateMethodPrefix(prop) {
2161
+ var func = prop.value, prefix = "";
2162
+ return func.async && (prefix += generateAsyncPrefix(func, !prop.computed)), func.generator && (prefix += generateStarSuffix(func) ? "*" : ""), prefix;
2163
+ }
2164
+ CodeGenerator.prototype.generatePattern = function(node, precedence, flags) {
2165
+ return node.type === Syntax.Identifier ? generateIdentifier(node) : this.generateExpression(node, precedence, flags);
2166
+ }, CodeGenerator.prototype.generateFunctionParams = function(node) {
2167
+ var i, iz, result, hasDefault;
2168
+ if (hasDefault = !1, node.type === Syntax.ArrowFunctionExpression && !node.rest && (!node.defaults || node.defaults.length === 0) && node.params.length === 1 && node.params[0].type === Syntax.Identifier)
2169
+ result = [generateAsyncPrefix(node, !0), generateIdentifier(node.params[0])];
2170
+ else {
2171
+ for (result = node.type === Syntax.ArrowFunctionExpression ? [generateAsyncPrefix(node, !1)] : [], result.push("("), node.defaults && (hasDefault = !0), i = 0, iz = node.params.length; i < iz; ++i)
2172
+ hasDefault && node.defaults[i] ? result.push(this.generateAssignment(node.params[i], node.defaults[i], "=", Precedence.Assignment, E_TTT)) : result.push(this.generatePattern(node.params[i], Precedence.Assignment, E_TTT)), i + 1 < iz && result.push("," + space);
2173
+ node.rest && (node.params.length && result.push("," + space), result.push("..."), result.push(generateIdentifier(node.rest))), result.push(")");
2174
+ }
2175
+ return result;
2176
+ }, CodeGenerator.prototype.generateFunctionBody = function(node) {
2177
+ var result, expr;
2178
+ return result = this.generateFunctionParams(node), node.type === Syntax.ArrowFunctionExpression && (result.push(space), result.push("=>")), node.expression ? (result.push(space), expr = this.generateExpression(node.body, Precedence.Assignment, E_TTT), expr.toString().charAt(0) === "{" && (expr = ["(", expr, ")"]), result.push(expr)) : result.push(this.maybeBlock(node.body, S_TTFF)), result;
2179
+ }, CodeGenerator.prototype.generateIterationForStatement = function(operator, stmt, flags) {
2180
+ var result = ["for" + (stmt.await ? noEmptySpace() + "await" : "") + space + "("], that = this;
2181
+ return withIndent(function() {
2182
+ stmt.left.type === Syntax.VariableDeclaration ? withIndent(function() {
2183
+ result.push(stmt.left.kind + noEmptySpace()), result.push(that.generateStatement(stmt.left.declarations[0], S_FFFF));
2184
+ }) : result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT)), result = join(result, operator), result = [join(
2185
+ result,
2186
+ that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)
2187
+ ), ")"];
2188
+ }), result.push(this.maybeBlock(stmt.body, flags)), result;
2189
+ }, CodeGenerator.prototype.generatePropertyKey = function(expr, computed) {
2190
+ var result = [];
2191
+ return computed && result.push("["), result.push(this.generateExpression(expr, Precedence.Assignment, E_TTT)), computed && result.push("]"), result;
2192
+ }, CodeGenerator.prototype.generateAssignment = function(left, right, operator, precedence, flags) {
2193
+ return Precedence.Assignment < precedence && (flags |= F_ALLOW_IN), parenthesize(
2194
+ [
2195
+ this.generateExpression(left, Precedence.Call, flags),
2196
+ space + operator + space,
2197
+ this.generateExpression(right, Precedence.Assignment, flags)
2198
+ ],
2199
+ Precedence.Assignment,
2200
+ precedence
2201
+ );
2202
+ }, CodeGenerator.prototype.semicolon = function(flags) {
2203
+ return !semicolons && flags & F_SEMICOLON_OPT ? "" : ";";
2204
+ }, CodeGenerator.Statement = {
2205
+ BlockStatement: function(stmt, flags) {
2206
+ var range, content, result = ["{", newline], that = this;
2207
+ return withIndent(function() {
2208
+ stmt.body.length === 0 && preserveBlankLines && (range = stmt.range, range[1] - range[0] > 2 && (content = sourceCode.substring(range[0] + 1, range[1] - 1), content[0] === `
2209
+ ` && (result = ["{"]), result.push(content)));
2210
+ var i, iz, fragment, bodyFlags;
2211
+ for (bodyFlags = S_TFFF, flags & F_FUNC_BODY && (bodyFlags |= F_DIRECTIVE_CTX), i = 0, iz = stmt.body.length; i < iz; ++i)
2212
+ preserveBlankLines && (i === 0 && (stmt.body[0].leadingComments && (range = stmt.body[0].leadingComments[0].extendedRange, content = sourceCode.substring(range[0], range[1]), content[0] === `
2213
+ ` && (result = ["{"])), stmt.body[0].leadingComments || generateBlankLines(stmt.range[0], stmt.body[0].range[0], result)), i > 0 && !stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments && generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result)), i === iz - 1 && (bodyFlags |= F_SEMICOLON_OPT), stmt.body[i].leadingComments && preserveBlankLines ? fragment = that.generateStatement(stmt.body[i], bodyFlags) : fragment = addIndent(that.generateStatement(stmt.body[i], bodyFlags)), result.push(fragment), endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString()) || preserveBlankLines && i < iz - 1 && stmt.body[i + 1].leadingComments || result.push(newline), preserveBlankLines && i === iz - 1 && (stmt.body[i].trailingComments || generateBlankLines(stmt.body[i].range[1], stmt.range[1], result));
2214
+ }), result.push(addIndent("}")), result;
2215
+ },
2216
+ BreakStatement: function(stmt, flags) {
2217
+ return stmt.label ? "break " + stmt.label.name + this.semicolon(flags) : "break" + this.semicolon(flags);
2218
+ },
2219
+ ContinueStatement: function(stmt, flags) {
2220
+ return stmt.label ? "continue " + stmt.label.name + this.semicolon(flags) : "continue" + this.semicolon(flags);
2221
+ },
2222
+ ClassBody: function(stmt, flags) {
2223
+ var result = ["{", newline], that = this;
2224
+ return withIndent(function(indent2) {
2225
+ var i, iz;
2226
+ for (i = 0, iz = stmt.body.length; i < iz; ++i)
2227
+ result.push(indent2), result.push(that.generateExpression(stmt.body[i], Precedence.Sequence, E_TTT)), i + 1 < iz && result.push(newline);
2228
+ }), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(newline), result.push(base2), result.push("}"), result;
2229
+ },
2230
+ ClassDeclaration: function(stmt, flags) {
2231
+ var result, fragment;
2232
+ return result = ["class"], stmt.id && (result = join(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT))), stmt.superClass && (fragment = join("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT)), result = join(result, fragment)), result.push(space), result.push(this.generateStatement(stmt.body, S_TFFT)), result;
2233
+ },
2234
+ DirectiveStatement: function(stmt, flags) {
2235
+ return extra.raw && stmt.raw ? stmt.raw + this.semicolon(flags) : escapeDirective(stmt.directive) + this.semicolon(flags);
2236
+ },
2237
+ DoWhileStatement: function(stmt, flags) {
2238
+ var result = join("do", this.maybeBlock(stmt.body, S_TFFF));
2239
+ return result = this.maybeBlockSuffix(stmt.body, result), join(result, [
2240
+ "while" + space + "(",
2241
+ this.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
2242
+ ")" + this.semicolon(flags)
2243
+ ]);
2244
+ },
2245
+ CatchClause: function(stmt, flags) {
2246
+ var result, that = this;
2247
+ return withIndent(function() {
2248
+ var guard;
2249
+ stmt.param ? (result = [
2250
+ "catch" + space + "(",
2251
+ that.generateExpression(stmt.param, Precedence.Sequence, E_TTT),
2252
+ ")"
2253
+ ], stmt.guard && (guard = that.generateExpression(stmt.guard, Precedence.Sequence, E_TTT), result.splice(2, 0, " if ", guard))) : result = ["catch"];
2254
+ }), result.push(this.maybeBlock(stmt.body, S_TFFF)), result;
2255
+ },
2256
+ DebuggerStatement: function(stmt, flags) {
2257
+ return "debugger" + this.semicolon(flags);
2258
+ },
2259
+ EmptyStatement: function(stmt, flags) {
2260
+ return ";";
2261
+ },
2262
+ ExportDefaultDeclaration: function(stmt, flags) {
2263
+ var result = ["export"], bodyFlags;
2264
+ return bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF, result = join(result, "default"), isStatement(stmt.declaration) ? result = join(result, this.generateStatement(stmt.declaration, bodyFlags)) : result = join(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags)), result;
2265
+ },
2266
+ ExportNamedDeclaration: function(stmt, flags) {
2267
+ var result = ["export"], bodyFlags, that = this;
2268
+ return bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF, stmt.declaration ? join(result, this.generateStatement(stmt.declaration, bodyFlags)) : (stmt.specifiers && (stmt.specifiers.length === 0 ? result = join(result, "{" + space + "}") : stmt.specifiers[0].type === Syntax.ExportBatchSpecifier ? result = join(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT)) : (result = join(result, "{"), withIndent(function(indent2) {
2269
+ var i, iz;
2270
+ for (result.push(newline), i = 0, iz = stmt.specifiers.length; i < iz; ++i)
2271
+ result.push(indent2), result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)), i + 1 < iz && result.push("," + newline);
2272
+ }), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(newline), result.push(base2 + "}")), stmt.source ? result = join(result, [
2273
+ "from" + space,
2274
+ // ModuleSpecifier
2275
+ this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
2276
+ this.semicolon(flags)
2277
+ ]) : result.push(this.semicolon(flags))), result);
2278
+ },
2279
+ ExportAllDeclaration: function(stmt, flags) {
2280
+ return [
2281
+ "export" + space,
2282
+ "*" + space,
2283
+ "from" + space,
2284
+ // ModuleSpecifier
2285
+ this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
2286
+ this.semicolon(flags)
2287
+ ];
2288
+ },
2289
+ ExpressionStatement: function(stmt, flags) {
2290
+ var result, fragment;
2291
+ function isClassPrefixed(fragment2) {
2292
+ var code;
2293
+ return fragment2.slice(0, 5) !== "class" ? !1 : (code = fragment2.charCodeAt(5), code === 123 || esutils.code.isWhiteSpace(code) || esutils.code.isLineTerminator(code));
2294
+ }
2295
+ function isFunctionPrefixed(fragment2) {
2296
+ var code;
2297
+ return fragment2.slice(0, 8) !== "function" ? !1 : (code = fragment2.charCodeAt(8), code === 40 || esutils.code.isWhiteSpace(code) || code === 42 || esutils.code.isLineTerminator(code));
2298
+ }
2299
+ function isAsyncPrefixed(fragment2) {
2300
+ var code, i, iz;
2301
+ if (fragment2.slice(0, 5) !== "async" || !esutils.code.isWhiteSpace(fragment2.charCodeAt(5)))
2302
+ return !1;
2303
+ for (i = 6, iz = fragment2.length; i < iz && esutils.code.isWhiteSpace(fragment2.charCodeAt(i)); ++i)
2304
+ ;
2305
+ return i === iz || fragment2.slice(i, i + 8) !== "function" ? !1 : (code = fragment2.charCodeAt(i + 8), code === 40 || esutils.code.isWhiteSpace(code) || code === 42 || esutils.code.isLineTerminator(code));
2306
+ }
2307
+ return result = [this.generateExpression(stmt.expression, Precedence.Sequence, E_TTT)], fragment = toSourceNodeWhenNeeded(result).toString(), fragment.charCodeAt(0) === 123 || // ObjectExpression
2308
+ isClassPrefixed(fragment) || isFunctionPrefixed(fragment) || isAsyncPrefixed(fragment) || directive && flags & F_DIRECTIVE_CTX && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value == "string" ? result = ["(", result, ")" + this.semicolon(flags)] : result.push(this.semicolon(flags)), result;
2309
+ },
2310
+ ImportDeclaration: function(stmt, flags) {
2311
+ var result, cursor, that = this;
2312
+ return stmt.specifiers.length === 0 ? [
2313
+ "import",
2314
+ space,
2315
+ // ModuleSpecifier
2316
+ this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
2317
+ this.semicolon(flags)
2318
+ ] : (result = [
2319
+ "import"
2320
+ ], cursor = 0, stmt.specifiers[cursor].type === Syntax.ImportDefaultSpecifier && (result = join(result, [
2321
+ this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
2322
+ ]), ++cursor), stmt.specifiers[cursor] && (cursor !== 0 && result.push(","), stmt.specifiers[cursor].type === Syntax.ImportNamespaceSpecifier ? result = join(result, [
2323
+ space,
2324
+ this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)
2325
+ ]) : (result.push(space + "{"), stmt.specifiers.length - cursor === 1 ? (result.push(space), result.push(this.generateExpression(stmt.specifiers[cursor], Precedence.Sequence, E_TTT)), result.push(space + "}" + space)) : (withIndent(function(indent2) {
2326
+ var i, iz;
2327
+ for (result.push(newline), i = cursor, iz = stmt.specifiers.length; i < iz; ++i)
2328
+ result.push(indent2), result.push(that.generateExpression(stmt.specifiers[i], Precedence.Sequence, E_TTT)), i + 1 < iz && result.push("," + newline);
2329
+ }), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(newline), result.push(base2 + "}" + space)))), result = join(result, [
2330
+ "from" + space,
2331
+ // ModuleSpecifier
2332
+ this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
2333
+ this.semicolon(flags)
2334
+ ]), result);
2335
+ },
2336
+ VariableDeclarator: function(stmt, flags) {
2337
+ var itemFlags = flags & F_ALLOW_IN ? E_TTT : E_FTT;
2338
+ return stmt.init ? [
2339
+ this.generateExpression(stmt.id, Precedence.Assignment, itemFlags),
2340
+ space,
2341
+ "=",
2342
+ space,
2343
+ this.generateExpression(stmt.init, Precedence.Assignment, itemFlags)
2344
+ ] : this.generatePattern(stmt.id, Precedence.Assignment, itemFlags);
2345
+ },
2346
+ VariableDeclaration: function(stmt, flags) {
2347
+ var result, i, iz, node, bodyFlags, that = this;
2348
+ result = [stmt.kind], bodyFlags = flags & F_ALLOW_IN ? S_TFFF : S_FFFF;
2349
+ function block() {
2350
+ for (node = stmt.declarations[0], extra.comment && node.leadingComments ? (result.push(`
2351
+ `), result.push(addIndent(that.generateStatement(node, bodyFlags)))) : (result.push(noEmptySpace()), result.push(that.generateStatement(node, bodyFlags))), i = 1, iz = stmt.declarations.length; i < iz; ++i)
2352
+ node = stmt.declarations[i], extra.comment && node.leadingComments ? (result.push("," + newline), result.push(addIndent(that.generateStatement(node, bodyFlags)))) : (result.push("," + space), result.push(that.generateStatement(node, bodyFlags)));
2353
+ }
2354
+ return stmt.declarations.length > 1 ? withIndent(block) : block(), result.push(this.semicolon(flags)), result;
2355
+ },
2356
+ ThrowStatement: function(stmt, flags) {
2357
+ return [join(
2358
+ "throw",
2359
+ this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
2360
+ ), this.semicolon(flags)];
2361
+ },
2362
+ TryStatement: function(stmt, flags) {
2363
+ var result, i, iz, guardedHandlers;
2364
+ if (result = ["try", this.maybeBlock(stmt.block, S_TFFF)], result = this.maybeBlockSuffix(stmt.block, result), stmt.handlers)
2365
+ for (i = 0, iz = stmt.handlers.length; i < iz; ++i)
2366
+ result = join(result, this.generateStatement(stmt.handlers[i], S_TFFF)), (stmt.finalizer || i + 1 !== iz) && (result = this.maybeBlockSuffix(stmt.handlers[i].body, result));
2367
+ else {
2368
+ for (guardedHandlers = stmt.guardedHandlers || [], i = 0, iz = guardedHandlers.length; i < iz; ++i)
2369
+ result = join(result, this.generateStatement(guardedHandlers[i], S_TFFF)), (stmt.finalizer || i + 1 !== iz) && (result = this.maybeBlockSuffix(guardedHandlers[i].body, result));
2370
+ if (stmt.handler)
2371
+ if (Array.isArray(stmt.handler))
2372
+ for (i = 0, iz = stmt.handler.length; i < iz; ++i)
2373
+ result = join(result, this.generateStatement(stmt.handler[i], S_TFFF)), (stmt.finalizer || i + 1 !== iz) && (result = this.maybeBlockSuffix(stmt.handler[i].body, result));
2374
+ else
2375
+ result = join(result, this.generateStatement(stmt.handler, S_TFFF)), stmt.finalizer && (result = this.maybeBlockSuffix(stmt.handler.body, result));
2376
+ }
2377
+ return stmt.finalizer && (result = join(result, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)])), result;
2378
+ },
2379
+ SwitchStatement: function(stmt, flags) {
2380
+ var result, fragment, i, iz, bodyFlags, that = this;
2381
+ if (withIndent(function() {
2382
+ result = [
2383
+ "switch" + space + "(",
2384
+ that.generateExpression(stmt.discriminant, Precedence.Sequence, E_TTT),
2385
+ ")" + space + "{" + newline
2386
+ ];
2387
+ }), stmt.cases)
2388
+ for (bodyFlags = S_TFFF, i = 0, iz = stmt.cases.length; i < iz; ++i)
2389
+ i === iz - 1 && (bodyFlags |= F_SEMICOLON_OPT), fragment = addIndent(this.generateStatement(stmt.cases[i], bodyFlags)), result.push(fragment), endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString()) || result.push(newline);
2390
+ return result.push(addIndent("}")), result;
2391
+ },
2392
+ SwitchCase: function(stmt, flags) {
2393
+ var result, fragment, i, iz, bodyFlags, that = this;
2394
+ return withIndent(function() {
2395
+ for (stmt.test ? result = [
2396
+ join("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)),
2397
+ ":"
2398
+ ] : result = ["default:"], i = 0, iz = stmt.consequent.length, iz && stmt.consequent[0].type === Syntax.BlockStatement && (fragment = that.maybeBlock(stmt.consequent[0], S_TFFF), result.push(fragment), i = 1), i !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) && result.push(newline), bodyFlags = S_TFFF; i < iz; ++i)
2399
+ i === iz - 1 && flags & F_SEMICOLON_OPT && (bodyFlags |= F_SEMICOLON_OPT), fragment = addIndent(that.generateStatement(stmt.consequent[i], bodyFlags)), result.push(fragment), i + 1 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString()) && result.push(newline);
2400
+ }), result;
2401
+ },
2402
+ IfStatement: function(stmt, flags) {
2403
+ var result, bodyFlags, semicolonOptional, that = this;
2404
+ return withIndent(function() {
2405
+ result = [
2406
+ "if" + space + "(",
2407
+ that.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
2408
+ ")"
2409
+ ];
2410
+ }), semicolonOptional = flags & F_SEMICOLON_OPT, bodyFlags = S_TFFF, semicolonOptional && (bodyFlags |= F_SEMICOLON_OPT), stmt.alternate ? (result.push(this.maybeBlock(stmt.consequent, S_TFFF)), result = this.maybeBlockSuffix(stmt.consequent, result), stmt.alternate.type === Syntax.IfStatement ? result = join(result, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]) : result = join(result, join("else", this.maybeBlock(stmt.alternate, bodyFlags)))) : result.push(this.maybeBlock(stmt.consequent, bodyFlags)), result;
2411
+ },
2412
+ ForStatement: function(stmt, flags) {
2413
+ var result, that = this;
2414
+ return withIndent(function() {
2415
+ result = ["for" + space + "("], stmt.init ? stmt.init.type === Syntax.VariableDeclaration ? result.push(that.generateStatement(stmt.init, S_FFFF)) : (result.push(that.generateExpression(stmt.init, Precedence.Sequence, E_FTT)), result.push(";")) : result.push(";"), stmt.test && (result.push(space), result.push(that.generateExpression(stmt.test, Precedence.Sequence, E_TTT))), result.push(";"), stmt.update && (result.push(space), result.push(that.generateExpression(stmt.update, Precedence.Sequence, E_TTT))), result.push(")");
2416
+ }), result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)), result;
2417
+ },
2418
+ ForInStatement: function(stmt, flags) {
2419
+ return this.generateIterationForStatement("in", stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF);
2420
+ },
2421
+ ForOfStatement: function(stmt, flags) {
2422
+ return this.generateIterationForStatement("of", stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF);
2423
+ },
2424
+ LabeledStatement: function(stmt, flags) {
2425
+ return [stmt.label.name + ":", this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)];
2426
+ },
2427
+ Program: function(stmt, flags) {
2428
+ var result, fragment, i, iz, bodyFlags;
2429
+ for (iz = stmt.body.length, result = [safeConcatenation && iz > 0 ? `
2430
+ ` : ""], bodyFlags = S_TFTF, i = 0; i < iz; ++i)
2431
+ !safeConcatenation && i === iz - 1 && (bodyFlags |= F_SEMICOLON_OPT), preserveBlankLines && (i === 0 && (stmt.body[0].leadingComments || generateBlankLines(stmt.range[0], stmt.body[i].range[0], result)), i > 0 && !stmt.body[i - 1].trailingComments && !stmt.body[i].leadingComments && generateBlankLines(stmt.body[i - 1].range[1], stmt.body[i].range[0], result)), fragment = addIndent(this.generateStatement(stmt.body[i], bodyFlags)), result.push(fragment), i + 1 < iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString()) && (preserveBlankLines && stmt.body[i + 1].leadingComments || result.push(newline)), preserveBlankLines && i === iz - 1 && (stmt.body[i].trailingComments || generateBlankLines(stmt.body[i].range[1], stmt.range[1], result));
2432
+ return result;
2433
+ },
2434
+ FunctionDeclaration: function(stmt, flags) {
2435
+ return [
2436
+ generateAsyncPrefix(stmt, !0),
2437
+ "function",
2438
+ generateStarSuffix(stmt) || noEmptySpace(),
2439
+ stmt.id ? generateIdentifier(stmt.id) : "",
2440
+ this.generateFunctionBody(stmt)
2441
+ ];
2442
+ },
2443
+ ReturnStatement: function(stmt, flags) {
2444
+ return stmt.argument ? [join(
2445
+ "return",
2446
+ this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
2447
+ ), this.semicolon(flags)] : ["return" + this.semicolon(flags)];
2448
+ },
2449
+ WhileStatement: function(stmt, flags) {
2450
+ var result, that = this;
2451
+ return withIndent(function() {
2452
+ result = [
2453
+ "while" + space + "(",
2454
+ that.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
2455
+ ")"
2456
+ ];
2457
+ }), result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)), result;
2458
+ },
2459
+ WithStatement: function(stmt, flags) {
2460
+ var result, that = this;
2461
+ return withIndent(function() {
2462
+ result = [
2463
+ "with" + space + "(",
2464
+ that.generateExpression(stmt.object, Precedence.Sequence, E_TTT),
2465
+ ")"
2466
+ ];
2467
+ }), result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)), result;
2468
+ }
2469
+ }, merge(CodeGenerator.prototype, CodeGenerator.Statement), CodeGenerator.Expression = {
2470
+ SequenceExpression: function(expr, precedence, flags) {
2471
+ var result, i, iz;
2472
+ for (Precedence.Sequence < precedence && (flags |= F_ALLOW_IN), result = [], i = 0, iz = expr.expressions.length; i < iz; ++i)
2473
+ result.push(this.generateExpression(expr.expressions[i], Precedence.Assignment, flags)), i + 1 < iz && result.push("," + space);
2474
+ return parenthesize(result, Precedence.Sequence, precedence);
2475
+ },
2476
+ AssignmentExpression: function(expr, precedence, flags) {
2477
+ return this.generateAssignment(expr.left, expr.right, expr.operator, precedence, flags);
2478
+ },
2479
+ ArrowFunctionExpression: function(expr, precedence, flags) {
2480
+ return parenthesize(this.generateFunctionBody(expr), Precedence.ArrowFunction, precedence);
2481
+ },
2482
+ ConditionalExpression: function(expr, precedence, flags) {
2483
+ return Precedence.Conditional < precedence && (flags |= F_ALLOW_IN), parenthesize(
2484
+ [
2485
+ this.generateExpression(expr.test, Precedence.Coalesce, flags),
2486
+ space + "?" + space,
2487
+ this.generateExpression(expr.consequent, Precedence.Assignment, flags),
2488
+ space + ":" + space,
2489
+ this.generateExpression(expr.alternate, Precedence.Assignment, flags)
2490
+ ],
2491
+ Precedence.Conditional,
2492
+ precedence
2493
+ );
2494
+ },
2495
+ LogicalExpression: function(expr, precedence, flags) {
2496
+ return expr.operator === "??" && (flags |= F_FOUND_COALESCE), this.BinaryExpression(expr, precedence, flags);
2497
+ },
2498
+ BinaryExpression: function(expr, precedence, flags) {
2499
+ var result, leftPrecedence, rightPrecedence, currentPrecedence, fragment, leftSource;
2500
+ return currentPrecedence = BinaryPrecedence[expr.operator], leftPrecedence = expr.operator === "**" ? Precedence.Postfix : currentPrecedence, rightPrecedence = expr.operator === "**" ? currentPrecedence : currentPrecedence + 1, currentPrecedence < precedence && (flags |= F_ALLOW_IN), fragment = this.generateExpression(expr.left, leftPrecedence, flags), leftSource = fragment.toString(), leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0)) ? result = [fragment, noEmptySpace(), expr.operator] : result = join(fragment, expr.operator), fragment = this.generateExpression(expr.right, rightPrecedence, flags), expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--" ? (result.push(noEmptySpace()), result.push(fragment)) : result = join(result, fragment), expr.operator === "in" && !(flags & F_ALLOW_IN) ? ["(", result, ")"] : (expr.operator === "||" || expr.operator === "&&") && flags & F_FOUND_COALESCE ? ["(", result, ")"] : parenthesize(result, currentPrecedence, precedence);
2501
+ },
2502
+ CallExpression: function(expr, precedence, flags) {
2503
+ var result, i, iz;
2504
+ for (result = [this.generateExpression(expr.callee, Precedence.Call, E_TTF)], expr.optional && result.push("?."), result.push("("), i = 0, iz = expr.arguments.length; i < iz; ++i)
2505
+ result.push(this.generateExpression(expr.arguments[i], Precedence.Assignment, E_TTT)), i + 1 < iz && result.push("," + space);
2506
+ return result.push(")"), flags & F_ALLOW_CALL ? parenthesize(result, Precedence.Call, precedence) : ["(", result, ")"];
2507
+ },
2508
+ ChainExpression: function(expr, precedence, flags) {
2509
+ Precedence.OptionalChaining < precedence && (flags |= F_ALLOW_CALL);
2510
+ var result = this.generateExpression(expr.expression, Precedence.OptionalChaining, flags);
2511
+ return parenthesize(result, Precedence.OptionalChaining, precedence);
2512
+ },
2513
+ NewExpression: function(expr, precedence, flags) {
2514
+ var result, length, i, iz, itemFlags;
2515
+ if (length = expr.arguments.length, itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF, result = join(
2516
+ "new",
2517
+ this.generateExpression(expr.callee, Precedence.New, itemFlags)
2518
+ ), !(flags & F_ALLOW_UNPARATH_NEW) || parentheses || length > 0) {
2519
+ for (result.push("("), i = 0, iz = length; i < iz; ++i)
2520
+ result.push(this.generateExpression(expr.arguments[i], Precedence.Assignment, E_TTT)), i + 1 < iz && result.push("," + space);
2521
+ result.push(")");
2522
+ }
2523
+ return parenthesize(result, Precedence.New, precedence);
2524
+ },
2525
+ MemberExpression: function(expr, precedence, flags) {
2526
+ var result, fragment;
2527
+ return result = [this.generateExpression(expr.object, Precedence.Call, flags & F_ALLOW_CALL ? E_TTF : E_TFF)], expr.computed ? (expr.optional && result.push("?."), result.push("["), result.push(this.generateExpression(expr.property, Precedence.Sequence, flags & F_ALLOW_CALL ? E_TTT : E_TFT)), result.push("]")) : (!expr.optional && expr.object.type === Syntax.Literal && typeof expr.object.value == "number" && (fragment = toSourceNodeWhenNeeded(result).toString(), fragment.indexOf(".") < 0 && !/[eExX]/.test(fragment) && esutils.code.isDecimalDigit(fragment.charCodeAt(fragment.length - 1)) && !(fragment.length >= 2 && fragment.charCodeAt(0) === 48) && result.push(" ")), result.push(expr.optional ? "?." : "."), result.push(generateIdentifier(expr.property))), parenthesize(result, Precedence.Member, precedence);
2528
+ },
2529
+ MetaProperty: function(expr, precedence, flags) {
2530
+ var result;
2531
+ return result = [], result.push(typeof expr.meta == "string" ? expr.meta : generateIdentifier(expr.meta)), result.push("."), result.push(typeof expr.property == "string" ? expr.property : generateIdentifier(expr.property)), parenthesize(result, Precedence.Member, precedence);
2532
+ },
2533
+ UnaryExpression: function(expr, precedence, flags) {
2534
+ var result, fragment, rightCharCode, leftSource, leftCharCode;
2535
+ return fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT), space === "" ? result = join(expr.operator, fragment) : (result = [expr.operator], expr.operator.length > 2 ? result = join(result, fragment) : (leftSource = toSourceNodeWhenNeeded(result).toString(), leftCharCode = leftSource.charCodeAt(leftSource.length - 1), rightCharCode = fragment.toString().charCodeAt(0), ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode)) && result.push(noEmptySpace()), result.push(fragment))), parenthesize(result, Precedence.Unary, precedence);
2536
+ },
2537
+ YieldExpression: function(expr, precedence, flags) {
2538
+ var result;
2539
+ return expr.delegate ? result = "yield*" : result = "yield", expr.argument && (result = join(
2540
+ result,
2541
+ this.generateExpression(expr.argument, Precedence.Yield, E_TTT)
2542
+ )), parenthesize(result, Precedence.Yield, precedence);
2543
+ },
2544
+ AwaitExpression: function(expr, precedence, flags) {
2545
+ var result = join(
2546
+ expr.all ? "await*" : "await",
2547
+ this.generateExpression(expr.argument, Precedence.Await, E_TTT)
2548
+ );
2549
+ return parenthesize(result, Precedence.Await, precedence);
2550
+ },
2551
+ UpdateExpression: function(expr, precedence, flags) {
2552
+ return expr.prefix ? parenthesize(
2553
+ [
2554
+ expr.operator,
2555
+ this.generateExpression(expr.argument, Precedence.Unary, E_TTT)
2556
+ ],
2557
+ Precedence.Unary,
2558
+ precedence
2559
+ ) : parenthesize(
2560
+ [
2561
+ this.generateExpression(expr.argument, Precedence.Postfix, E_TTT),
2562
+ expr.operator
2563
+ ],
2564
+ Precedence.Postfix,
2565
+ precedence
2566
+ );
2567
+ },
2568
+ FunctionExpression: function(expr, precedence, flags) {
2569
+ var result = [
2570
+ generateAsyncPrefix(expr, !0),
2571
+ "function"
2572
+ ];
2573
+ return expr.id ? (result.push(generateStarSuffix(expr) || noEmptySpace()), result.push(generateIdentifier(expr.id))) : result.push(generateStarSuffix(expr) || space), result.push(this.generateFunctionBody(expr)), result;
2574
+ },
2575
+ ArrayPattern: function(expr, precedence, flags) {
2576
+ return this.ArrayExpression(expr, precedence, flags, !0);
2577
+ },
2578
+ ArrayExpression: function(expr, precedence, flags, isPattern) {
2579
+ var result, multiline, that = this;
2580
+ return expr.elements.length ? (multiline = isPattern ? !1 : expr.elements.length > 1, result = ["[", multiline ? newline : ""], withIndent(function(indent2) {
2581
+ var i, iz;
2582
+ for (i = 0, iz = expr.elements.length; i < iz; ++i)
2583
+ expr.elements[i] ? (result.push(multiline ? indent2 : ""), result.push(that.generateExpression(expr.elements[i], Precedence.Assignment, E_TTT))) : (multiline && result.push(indent2), i + 1 === iz && result.push(",")), i + 1 < iz && result.push("," + (multiline ? newline : space));
2584
+ }), multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) && result.push(newline), result.push(multiline ? base2 : ""), result.push("]"), result) : "[]";
2585
+ },
2586
+ RestElement: function(expr, precedence, flags) {
2587
+ return "..." + this.generatePattern(expr.argument);
2588
+ },
2589
+ ClassExpression: function(expr, precedence, flags) {
2590
+ var result, fragment;
2591
+ return result = ["class"], expr.id && (result = join(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT))), expr.superClass && (fragment = join("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT)), result = join(result, fragment)), result.push(space), result.push(this.generateStatement(expr.body, S_TFFT)), result;
2592
+ },
2593
+ MethodDefinition: function(expr, precedence, flags) {
2594
+ var result, fragment;
2595
+ return expr.static ? result = ["static" + space] : result = [], expr.kind === "get" || expr.kind === "set" ? fragment = [
2596
+ join(expr.kind, this.generatePropertyKey(expr.key, expr.computed)),
2597
+ this.generateFunctionBody(expr.value)
2598
+ ] : fragment = [
2599
+ generateMethodPrefix(expr),
2600
+ this.generatePropertyKey(expr.key, expr.computed),
2601
+ this.generateFunctionBody(expr.value)
2602
+ ], join(result, fragment);
2603
+ },
2604
+ Property: function(expr, precedence, flags) {
2605
+ return expr.kind === "get" || expr.kind === "set" ? [
2606
+ expr.kind,
2607
+ noEmptySpace(),
2608
+ this.generatePropertyKey(expr.key, expr.computed),
2609
+ this.generateFunctionBody(expr.value)
2610
+ ] : expr.shorthand ? expr.value.type === "AssignmentPattern" ? this.AssignmentPattern(expr.value, Precedence.Sequence, E_TTT) : this.generatePropertyKey(expr.key, expr.computed) : expr.method ? [
2611
+ generateMethodPrefix(expr),
2612
+ this.generatePropertyKey(expr.key, expr.computed),
2613
+ this.generateFunctionBody(expr.value)
2614
+ ] : [
2615
+ this.generatePropertyKey(expr.key, expr.computed),
2616
+ ":" + space,
2617
+ this.generateExpression(expr.value, Precedence.Assignment, E_TTT)
2618
+ ];
2619
+ },
2620
+ ObjectExpression: function(expr, precedence, flags) {
2621
+ var multiline, result, fragment, that = this;
2622
+ return expr.properties.length ? (multiline = expr.properties.length > 1, withIndent(function() {
2623
+ fragment = that.generateExpression(expr.properties[0], Precedence.Sequence, E_TTT);
2624
+ }), !multiline && !hasLineTerminator(toSourceNodeWhenNeeded(fragment).toString()) ? ["{", space, fragment, space, "}"] : (withIndent(function(indent2) {
2625
+ var i, iz;
2626
+ if (result = ["{", newline, indent2, fragment], multiline)
2627
+ for (result.push("," + newline), i = 1, iz = expr.properties.length; i < iz; ++i)
2628
+ result.push(indent2), result.push(that.generateExpression(expr.properties[i], Precedence.Sequence, E_TTT)), i + 1 < iz && result.push("," + newline);
2629
+ }), endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) || result.push(newline), result.push(base2), result.push("}"), result)) : "{}";
2630
+ },
2631
+ AssignmentPattern: function(expr, precedence, flags) {
2632
+ return this.generateAssignment(expr.left, expr.right, "=", precedence, flags);
2633
+ },
2634
+ ObjectPattern: function(expr, precedence, flags) {
2635
+ var result, i, iz, multiline, property, that = this;
2636
+ if (!expr.properties.length)
2637
+ return "{}";
2638
+ if (multiline = !1, expr.properties.length === 1)
2639
+ property = expr.properties[0], property.type === Syntax.Property && property.value.type !== Syntax.Identifier && (multiline = !0);
2640
+ else
2641
+ for (i = 0, iz = expr.properties.length; i < iz; ++i)
2642
+ if (property = expr.properties[i], property.type === Syntax.Property && !property.shorthand) {
2643
+ multiline = !0;
2644
+ break;
2645
+ }
2646
+ return result = ["{", multiline ? newline : ""], withIndent(function(indent2) {
2647
+ var i2, iz2;
2648
+ for (i2 = 0, iz2 = expr.properties.length; i2 < iz2; ++i2)
2649
+ result.push(multiline ? indent2 : ""), result.push(that.generateExpression(expr.properties[i2], Precedence.Sequence, E_TTT)), i2 + 1 < iz2 && result.push("," + (multiline ? newline : space));
2650
+ }), multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()) && result.push(newline), result.push(multiline ? base2 : ""), result.push("}"), result;
2651
+ },
2652
+ ThisExpression: function(expr, precedence, flags) {
2653
+ return "this";
2654
+ },
2655
+ Super: function(expr, precedence, flags) {
2656
+ return "super";
2657
+ },
2658
+ Identifier: function(expr, precedence, flags) {
2659
+ return generateIdentifier(expr);
2660
+ },
2661
+ ImportDefaultSpecifier: function(expr, precedence, flags) {
2662
+ return generateIdentifier(expr.id || expr.local);
2663
+ },
2664
+ ImportNamespaceSpecifier: function(expr, precedence, flags) {
2665
+ var result = ["*"], id = expr.id || expr.local;
2666
+ return id && result.push(space + "as" + noEmptySpace() + generateIdentifier(id)), result;
2667
+ },
2668
+ ImportSpecifier: function(expr, precedence, flags) {
2669
+ var imported = expr.imported, result = [imported.name], local = expr.local;
2670
+ return local && local.name !== imported.name && result.push(noEmptySpace() + "as" + noEmptySpace() + generateIdentifier(local)), result;
2671
+ },
2672
+ ExportSpecifier: function(expr, precedence, flags) {
2673
+ var local = expr.local, result = [local.name], exported = expr.exported;
2674
+ return exported && exported.name !== local.name && result.push(noEmptySpace() + "as" + noEmptySpace() + generateIdentifier(exported)), result;
2675
+ },
2676
+ Literal: function(expr, precedence, flags) {
2677
+ var raw;
2678
+ if (expr.hasOwnProperty("raw") && parse2 && extra.raw)
2679
+ try {
2680
+ if (raw = parse2(expr.raw).body[0].expression, raw.type === Syntax.Literal && raw.value === expr.value)
2681
+ return expr.raw;
2682
+ } catch {
2683
+ }
2684
+ return expr.regex ? "/" + expr.regex.pattern + "/" + expr.regex.flags : typeof expr.value == "bigint" ? expr.value.toString() + "n" : expr.bigint ? expr.bigint + "n" : expr.value === null ? "null" : typeof expr.value == "string" ? escapeString(expr.value) : typeof expr.value == "number" ? generateNumber(expr.value) : typeof expr.value == "boolean" ? expr.value ? "true" : "false" : generateRegExp(expr.value);
2685
+ },
2686
+ GeneratorExpression: function(expr, precedence, flags) {
2687
+ return this.ComprehensionExpression(expr, precedence, flags);
2688
+ },
2689
+ ComprehensionExpression: function(expr, precedence, flags) {
2690
+ var result, i, iz, fragment, that = this;
2691
+ return result = expr.type === Syntax.GeneratorExpression ? ["("] : ["["], extra.moz.comprehensionExpressionStartsWithAssignment && (fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT), result.push(fragment)), expr.blocks && withIndent(function() {
2692
+ for (i = 0, iz = expr.blocks.length; i < iz; ++i)
2693
+ fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT), i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment ? result = join(result, fragment) : result.push(fragment);
2694
+ }), expr.filter && (result = join(result, "if" + space), fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT), result = join(result, ["(", fragment, ")"])), extra.moz.comprehensionExpressionStartsWithAssignment || (fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT), result = join(result, fragment)), result.push(expr.type === Syntax.GeneratorExpression ? ")" : "]"), result;
2695
+ },
2696
+ ComprehensionBlock: function(expr, precedence, flags) {
2697
+ var fragment;
2698
+ return expr.left.type === Syntax.VariableDeclaration ? fragment = [
2699
+ expr.left.kind,
2700
+ noEmptySpace(),
2701
+ this.generateStatement(expr.left.declarations[0], S_FFFF)
2702
+ ] : fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT), fragment = join(fragment, expr.of ? "of" : "in"), fragment = join(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT)), ["for" + space + "(", fragment, ")"];
2703
+ },
2704
+ SpreadElement: function(expr, precedence, flags) {
2705
+ return [
2706
+ "...",
2707
+ this.generateExpression(expr.argument, Precedence.Assignment, E_TTT)
2708
+ ];
2709
+ },
2710
+ TaggedTemplateExpression: function(expr, precedence, flags) {
2711
+ var itemFlags = E_TTF;
2712
+ flags & F_ALLOW_CALL || (itemFlags = E_TFF);
2713
+ var result = [
2714
+ this.generateExpression(expr.tag, Precedence.Call, itemFlags),
2715
+ this.generateExpression(expr.quasi, Precedence.Primary, E_FFT)
2716
+ ];
2717
+ return parenthesize(result, Precedence.TaggedTemplate, precedence);
2718
+ },
2719
+ TemplateElement: function(expr, precedence, flags) {
2720
+ return expr.value.raw;
2721
+ },
2722
+ TemplateLiteral: function(expr, precedence, flags) {
2723
+ var result, i, iz;
2724
+ for (result = ["`"], i = 0, iz = expr.quasis.length; i < iz; ++i)
2725
+ result.push(this.generateExpression(expr.quasis[i], Precedence.Primary, E_TTT)), i + 1 < iz && (result.push("${" + space), result.push(this.generateExpression(expr.expressions[i], Precedence.Sequence, E_TTT)), result.push(space + "}"));
2726
+ return result.push("`"), result;
2727
+ },
2728
+ ModuleSpecifier: function(expr, precedence, flags) {
2729
+ return this.Literal(expr, precedence, flags);
2730
+ },
2731
+ ImportExpression: function(expr, precedence, flag) {
2732
+ return parenthesize([
2733
+ "import(",
2734
+ this.generateExpression(expr.source, Precedence.Assignment, E_TTT),
2735
+ ")"
2736
+ ], Precedence.Call, precedence);
2737
+ }
2738
+ }, merge(CodeGenerator.prototype, CodeGenerator.Expression), CodeGenerator.prototype.generateExpression = function(expr, precedence, flags) {
2739
+ var result, type;
2740
+ return type = expr.type || Syntax.Property, extra.verbatim && expr.hasOwnProperty(extra.verbatim) ? generateVerbatim(expr, precedence) : (result = this[type](expr, precedence, flags), extra.comment && (result = addComments(expr, result)), toSourceNodeWhenNeeded(result, expr));
2741
+ }, CodeGenerator.prototype.generateStatement = function(stmt, flags) {
2742
+ var result, fragment;
2743
+ return result = this[stmt.type](stmt, flags), extra.comment && (result = addComments(stmt, result)), fragment = toSourceNodeWhenNeeded(result).toString(), stmt.type === Syntax.Program && !safeConcatenation && newline === "" && fragment.charAt(fragment.length - 1) === `
2744
+ ` && (result = sourceMap ? toSourceNodeWhenNeeded(result).replaceRight(/\s+$/, "") : fragment.replace(/\s+$/, "")), toSourceNodeWhenNeeded(result, stmt);
2745
+ };
2746
+ function generateInternal(node) {
2747
+ var codegen;
2748
+ if (codegen = new CodeGenerator(), isStatement(node))
2749
+ return codegen.generateStatement(node, S_TFFF);
2750
+ if (isExpression(node))
2751
+ return codegen.generateExpression(node, Precedence.Sequence, E_TTT);
2752
+ throw new Error("Unknown node type: " + node.type);
2753
+ }
2754
+ function generate2(node, options) {
2755
+ var defaultOptions = getDefaultOptions(), result, pair;
2756
+ return options != null ? (typeof options.indent == "string" && (defaultOptions.format.indent.style = options.indent), typeof options.base == "number" && (defaultOptions.format.indent.base = options.base), options = updateDeeply(defaultOptions, options), indent = options.format.indent.style, typeof options.base == "string" ? base2 = options.base : base2 = stringRepeat(indent, options.format.indent.base)) : (options = defaultOptions, indent = options.format.indent.style, base2 = stringRepeat(indent, options.format.indent.base)), json = options.format.json, renumber = options.format.renumber, hexadecimal = json ? !1 : options.format.hexadecimal, quotes = json ? "double" : options.format.quotes, escapeless = options.format.escapeless, newline = options.format.newline, space = options.format.space, options.format.compact && (newline = space = indent = base2 = ""), parentheses = options.format.parentheses, semicolons = options.format.semicolons, safeConcatenation = options.format.safeConcatenation, directive = options.directive, parse2 = json ? null : options.parse, sourceMap = options.sourceMap, sourceCode = options.sourceCode, preserveBlankLines = options.format.preserveBlankLines && sourceCode !== null, extra = options, sourceMap && (exports.browser ? SourceNode = global.sourceMap.SourceNode : SourceNode = require_source_map().SourceNode), result = generateInternal(node), sourceMap ? (pair = result.toStringWithSourceMap({
2757
+ file: options.file,
2758
+ sourceRoot: options.sourceMapRoot
2759
+ }), options.sourceContent && pair.map.setSourceContent(
2760
+ options.sourceMap,
2761
+ options.sourceContent
2762
+ ), options.sourceMapWithCode ? pair : pair.map.toString()) : (pair = { code: result.toString(), map: null }, options.sourceMapWithCode ? pair : pair.code);
2763
+ }
2764
+ FORMAT_MINIFY = {
2765
+ indent: {
2766
+ style: "",
2767
+ base: 0
2768
+ },
2769
+ renumber: !0,
2770
+ hexadecimal: !0,
2771
+ quotes: "auto",
2772
+ escapeless: !0,
2773
+ compact: !0,
2774
+ parentheses: !1,
2775
+ semicolons: !1
2776
+ }, FORMAT_DEFAULTS = getDefaultOptions().format, exports.version = require_package().version, exports.generate = generate2, exports.attachComments = estraverse.attachComments, exports.Precedence = updateDeeply({}, Precedence), exports.browser = !1, exports.FORMAT_MINIFY = FORMAT_MINIFY, exports.FORMAT_DEFAULTS = FORMAT_DEFAULTS;
2777
+ })();
2778
+ }
2779
+ });
2780
+
2781
+ // ../../node_modules/acorn-walk/dist/walk.js
2782
+ var require_walk = __commonJS({
2783
+ "../../node_modules/acorn-walk/dist/walk.js"(exports, module) {
2784
+ (function(global2, factory) {
2785
+ typeof exports == "object" && typeof module < "u" ? factory(exports) : typeof define == "function" && define.amd ? define(["exports"], factory) : (global2 = global2 || self, factory((global2.acorn = global2.acorn || {}, global2.acorn.walk = {})));
2786
+ })(exports, (function(exports2) {
2787
+ "use strict";
2788
+ function simple2(node, visitors, baseVisitor, state, override) {
2789
+ baseVisitor || (baseVisitor = base2), (function c(node2, st, override2) {
2790
+ var type = override2 || node2.type, found = visitors[type];
2791
+ baseVisitor[type](node2, st, c), found && found(node2, st);
2792
+ })(node, state, override);
2793
+ }
2794
+ function ancestor2(node, visitors, baseVisitor, state, override) {
2795
+ var ancestors = [];
2796
+ baseVisitor || (baseVisitor = base2), (function c(node2, st, override2) {
2797
+ var type = override2 || node2.type, found = visitors[type], isNew = node2 !== ancestors[ancestors.length - 1];
2798
+ isNew && ancestors.push(node2), baseVisitor[type](node2, st, c), found && found(node2, st || ancestors, ancestors), isNew && ancestors.pop();
2799
+ })(node, state, override);
2800
+ }
2801
+ function recursive(node, state, funcs, baseVisitor, override) {
2802
+ var visitor = funcs ? make(funcs, baseVisitor || void 0) : baseVisitor;
2803
+ (function c(node2, st, override2) {
2804
+ visitor[override2 || node2.type](node2, st, c);
2805
+ })(node, state, override);
2806
+ }
2807
+ function makeTest(test) {
2808
+ return typeof test == "string" ? function(type) {
2809
+ return type === test;
2810
+ } : test || function() {
2811
+ return !0;
2812
+ };
2813
+ }
2814
+ var Found = function(node, state) {
2815
+ this.node = node, this.state = state;
2816
+ };
2817
+ function full(node, callback, baseVisitor, state, override) {
2818
+ baseVisitor || (baseVisitor = base2), (function c(node2, st, override2) {
2819
+ var type = override2 || node2.type;
2820
+ baseVisitor[type](node2, st, c), override2 || callback(node2, st, type);
2821
+ })(node, state, override);
2822
+ }
2823
+ function fullAncestor(node, callback, baseVisitor, state) {
2824
+ baseVisitor || (baseVisitor = base2);
2825
+ var ancestors = [];
2826
+ (function c(node2, st, override) {
2827
+ var type = override || node2.type, isNew = node2 !== ancestors[ancestors.length - 1];
2828
+ isNew && ancestors.push(node2), baseVisitor[type](node2, st, c), override || callback(node2, st || ancestors, ancestors, type), isNew && ancestors.pop();
2829
+ })(node, state);
2830
+ }
2831
+ function findNodeAt(node, start, end, test, baseVisitor, state) {
2832
+ baseVisitor || (baseVisitor = base2), test = makeTest(test);
2833
+ try {
2834
+ (function c(node2, st, override) {
2835
+ var type = override || node2.type;
2836
+ if ((start == null || node2.start <= start) && (end == null || node2.end >= end) && baseVisitor[type](node2, st, c), (start == null || node2.start === start) && (end == null || node2.end === end) && test(type, node2))
2837
+ throw new Found(node2, st);
2838
+ })(node, state);
2839
+ } catch (e) {
2840
+ if (e instanceof Found)
2841
+ return e;
2842
+ throw e;
2843
+ }
2844
+ }
2845
+ function findNodeAround(node, pos, test, baseVisitor, state) {
2846
+ test = makeTest(test), baseVisitor || (baseVisitor = base2);
2847
+ try {
2848
+ (function c(node2, st, override) {
2849
+ var type = override || node2.type;
2850
+ if (!(node2.start > pos || node2.end < pos) && (baseVisitor[type](node2, st, c), test(type, node2)))
2851
+ throw new Found(node2, st);
2852
+ })(node, state);
2853
+ } catch (e) {
2854
+ if (e instanceof Found)
2855
+ return e;
2856
+ throw e;
2857
+ }
2858
+ }
2859
+ function findNodeAfter(node, pos, test, baseVisitor, state) {
2860
+ test = makeTest(test), baseVisitor || (baseVisitor = base2);
2861
+ try {
2862
+ (function c(node2, st, override) {
2863
+ if (!(node2.end < pos)) {
2864
+ var type = override || node2.type;
2865
+ if (node2.start >= pos && test(type, node2))
2866
+ throw new Found(node2, st);
2867
+ baseVisitor[type](node2, st, c);
2868
+ }
2869
+ })(node, state);
2870
+ } catch (e) {
2871
+ if (e instanceof Found)
2872
+ return e;
2873
+ throw e;
2874
+ }
2875
+ }
2876
+ function findNodeBefore(node, pos, test, baseVisitor, state) {
2877
+ test = makeTest(test), baseVisitor || (baseVisitor = base2);
2878
+ var max;
2879
+ return (function c(node2, st, override) {
2880
+ if (!(node2.start > pos)) {
2881
+ var type = override || node2.type;
2882
+ node2.end <= pos && (!max || max.node.end < node2.end) && test(type, node2) && (max = new Found(node2, st)), baseVisitor[type](node2, st, c);
2883
+ }
2884
+ })(node, state), max;
2885
+ }
2886
+ var create = Object.create || function(proto) {
2887
+ function Ctor() {
2888
+ }
2889
+ return Ctor.prototype = proto, new Ctor();
2890
+ };
2891
+ function make(funcs, baseVisitor) {
2892
+ var visitor = create(baseVisitor || base2);
2893
+ for (var type in funcs)
2894
+ visitor[type] = funcs[type];
2895
+ return visitor;
2896
+ }
2897
+ function skipThrough(node, st, c) {
2898
+ c(node, st);
2899
+ }
2900
+ function ignore(_node, _st, _c) {
2901
+ }
2902
+ var base2 = {};
2903
+ base2.Program = base2.BlockStatement = function(node, st, c) {
2904
+ for (var i = 0, list = node.body; i < list.length; i += 1) {
2905
+ var stmt = list[i];
2906
+ c(stmt, st, "Statement");
2907
+ }
2908
+ }, base2.Statement = skipThrough, base2.EmptyStatement = ignore, base2.ExpressionStatement = base2.ParenthesizedExpression = base2.ChainExpression = function(node, st, c) {
2909
+ return c(node.expression, st, "Expression");
2910
+ }, base2.IfStatement = function(node, st, c) {
2911
+ c(node.test, st, "Expression"), c(node.consequent, st, "Statement"), node.alternate && c(node.alternate, st, "Statement");
2912
+ }, base2.LabeledStatement = function(node, st, c) {
2913
+ return c(node.body, st, "Statement");
2914
+ }, base2.BreakStatement = base2.ContinueStatement = ignore, base2.WithStatement = function(node, st, c) {
2915
+ c(node.object, st, "Expression"), c(node.body, st, "Statement");
2916
+ }, base2.SwitchStatement = function(node, st, c) {
2917
+ c(node.discriminant, st, "Expression");
2918
+ for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {
2919
+ var cs = list$1[i$1];
2920
+ cs.test && c(cs.test, st, "Expression");
2921
+ for (var i = 0, list = cs.consequent; i < list.length; i += 1) {
2922
+ var cons = list[i];
2923
+ c(cons, st, "Statement");
2924
+ }
2925
+ }
2926
+ }, base2.SwitchCase = function(node, st, c) {
2927
+ node.test && c(node.test, st, "Expression");
2928
+ for (var i = 0, list = node.consequent; i < list.length; i += 1) {
2929
+ var cons = list[i];
2930
+ c(cons, st, "Statement");
2931
+ }
2932
+ }, base2.ReturnStatement = base2.YieldExpression = base2.AwaitExpression = function(node, st, c) {
2933
+ node.argument && c(node.argument, st, "Expression");
2934
+ }, base2.ThrowStatement = base2.SpreadElement = function(node, st, c) {
2935
+ return c(node.argument, st, "Expression");
2936
+ }, base2.TryStatement = function(node, st, c) {
2937
+ c(node.block, st, "Statement"), node.handler && c(node.handler, st), node.finalizer && c(node.finalizer, st, "Statement");
2938
+ }, base2.CatchClause = function(node, st, c) {
2939
+ node.param && c(node.param, st, "Pattern"), c(node.body, st, "Statement");
2940
+ }, base2.WhileStatement = base2.DoWhileStatement = function(node, st, c) {
2941
+ c(node.test, st, "Expression"), c(node.body, st, "Statement");
2942
+ }, base2.ForStatement = function(node, st, c) {
2943
+ node.init && c(node.init, st, "ForInit"), node.test && c(node.test, st, "Expression"), node.update && c(node.update, st, "Expression"), c(node.body, st, "Statement");
2944
+ }, base2.ForInStatement = base2.ForOfStatement = function(node, st, c) {
2945
+ c(node.left, st, "ForInit"), c(node.right, st, "Expression"), c(node.body, st, "Statement");
2946
+ }, base2.ForInit = function(node, st, c) {
2947
+ node.type === "VariableDeclaration" ? c(node, st) : c(node, st, "Expression");
2948
+ }, base2.DebuggerStatement = ignore, base2.FunctionDeclaration = function(node, st, c) {
2949
+ return c(node, st, "Function");
2950
+ }, base2.VariableDeclaration = function(node, st, c) {
2951
+ for (var i = 0, list = node.declarations; i < list.length; i += 1) {
2952
+ var decl = list[i];
2953
+ c(decl, st);
2954
+ }
2955
+ }, base2.VariableDeclarator = function(node, st, c) {
2956
+ c(node.id, st, "Pattern"), node.init && c(node.init, st, "Expression");
2957
+ }, base2.Function = function(node, st, c) {
2958
+ node.id && c(node.id, st, "Pattern");
2959
+ for (var i = 0, list = node.params; i < list.length; i += 1) {
2960
+ var param = list[i];
2961
+ c(param, st, "Pattern");
2962
+ }
2963
+ c(node.body, st, node.expression ? "Expression" : "Statement");
2964
+ }, base2.Pattern = function(node, st, c) {
2965
+ node.type === "Identifier" ? c(node, st, "VariablePattern") : node.type === "MemberExpression" ? c(node, st, "MemberPattern") : c(node, st);
2966
+ }, base2.VariablePattern = ignore, base2.MemberPattern = skipThrough, base2.RestElement = function(node, st, c) {
2967
+ return c(node.argument, st, "Pattern");
2968
+ }, base2.ArrayPattern = function(node, st, c) {
2969
+ for (var i = 0, list = node.elements; i < list.length; i += 1) {
2970
+ var elt = list[i];
2971
+ elt && c(elt, st, "Pattern");
2972
+ }
2973
+ }, base2.ObjectPattern = function(node, st, c) {
2974
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
2975
+ var prop = list[i];
2976
+ prop.type === "Property" ? (prop.computed && c(prop.key, st, "Expression"), c(prop.value, st, "Pattern")) : prop.type === "RestElement" && c(prop.argument, st, "Pattern");
2977
+ }
2978
+ }, base2.Expression = skipThrough, base2.ThisExpression = base2.Super = base2.MetaProperty = ignore, base2.ArrayExpression = function(node, st, c) {
2979
+ for (var i = 0, list = node.elements; i < list.length; i += 1) {
2980
+ var elt = list[i];
2981
+ elt && c(elt, st, "Expression");
2982
+ }
2983
+ }, base2.ObjectExpression = function(node, st, c) {
2984
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
2985
+ var prop = list[i];
2986
+ c(prop, st);
2987
+ }
2988
+ }, base2.FunctionExpression = base2.ArrowFunctionExpression = base2.FunctionDeclaration, base2.SequenceExpression = function(node, st, c) {
2989
+ for (var i = 0, list = node.expressions; i < list.length; i += 1) {
2990
+ var expr = list[i];
2991
+ c(expr, st, "Expression");
2992
+ }
2993
+ }, base2.TemplateLiteral = function(node, st, c) {
2994
+ for (var i = 0, list = node.quasis; i < list.length; i += 1) {
2995
+ var quasi = list[i];
2996
+ c(quasi, st);
2997
+ }
2998
+ for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) {
2999
+ var expr = list$1[i$1];
3000
+ c(expr, st, "Expression");
3001
+ }
3002
+ }, base2.TemplateElement = ignore, base2.UnaryExpression = base2.UpdateExpression = function(node, st, c) {
3003
+ c(node.argument, st, "Expression");
3004
+ }, base2.BinaryExpression = base2.LogicalExpression = function(node, st, c) {
3005
+ c(node.left, st, "Expression"), c(node.right, st, "Expression");
3006
+ }, base2.AssignmentExpression = base2.AssignmentPattern = function(node, st, c) {
3007
+ c(node.left, st, "Pattern"), c(node.right, st, "Expression");
3008
+ }, base2.ConditionalExpression = function(node, st, c) {
3009
+ c(node.test, st, "Expression"), c(node.consequent, st, "Expression"), c(node.alternate, st, "Expression");
3010
+ }, base2.NewExpression = base2.CallExpression = function(node, st, c) {
3011
+ if (c(node.callee, st, "Expression"), node.arguments)
3012
+ for (var i = 0, list = node.arguments; i < list.length; i += 1) {
3013
+ var arg = list[i];
3014
+ c(arg, st, "Expression");
3015
+ }
3016
+ }, base2.MemberExpression = function(node, st, c) {
3017
+ c(node.object, st, "Expression"), node.computed && c(node.property, st, "Expression");
3018
+ }, base2.ExportNamedDeclaration = base2.ExportDefaultDeclaration = function(node, st, c) {
3019
+ node.declaration && c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"), node.source && c(node.source, st, "Expression");
3020
+ }, base2.ExportAllDeclaration = function(node, st, c) {
3021
+ node.exported && c(node.exported, st), c(node.source, st, "Expression");
3022
+ }, base2.ImportDeclaration = function(node, st, c) {
3023
+ for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
3024
+ var spec = list[i];
3025
+ c(spec, st);
3026
+ }
3027
+ c(node.source, st, "Expression");
3028
+ }, base2.ImportExpression = function(node, st, c) {
3029
+ c(node.source, st, "Expression");
3030
+ }, base2.ImportSpecifier = base2.ImportDefaultSpecifier = base2.ImportNamespaceSpecifier = base2.Identifier = base2.Literal = ignore, base2.TaggedTemplateExpression = function(node, st, c) {
3031
+ c(node.tag, st, "Expression"), c(node.quasi, st, "Expression");
3032
+ }, base2.ClassDeclaration = base2.ClassExpression = function(node, st, c) {
3033
+ return c(node, st, "Class");
3034
+ }, base2.Class = function(node, st, c) {
3035
+ node.id && c(node.id, st, "Pattern"), node.superClass && c(node.superClass, st, "Expression"), c(node.body, st);
3036
+ }, base2.ClassBody = function(node, st, c) {
3037
+ for (var i = 0, list = node.body; i < list.length; i += 1) {
3038
+ var elt = list[i];
3039
+ c(elt, st);
3040
+ }
3041
+ }, base2.MethodDefinition = base2.Property = function(node, st, c) {
3042
+ node.computed && c(node.key, st, "Expression"), c(node.value, st, "Expression");
3043
+ }, exports2.ancestor = ancestor2, exports2.base = base2, exports2.findNodeAfter = findNodeAfter, exports2.findNodeAround = findNodeAround, exports2.findNodeAt = findNodeAt, exports2.findNodeBefore = findNodeBefore, exports2.full = full, exports2.fullAncestor = fullAncestor, exports2.make = make, exports2.recursive = recursive, exports2.simple = simple2, Object.defineProperty(exports2, "__esModule", { value: !0 });
3044
+ }));
3045
+ }
3046
+ });
3047
+
3048
+ // ../../node_modules/html-tags/html-tags.json
3049
+ var require_html_tags = __commonJS({
3050
+ "../../node_modules/html-tags/html-tags.json"(exports, module) {
3051
+ module.exports = [
3052
+ "a",
3053
+ "abbr",
3054
+ "address",
3055
+ "area",
3056
+ "article",
3057
+ "aside",
3058
+ "audio",
3059
+ "b",
3060
+ "base",
3061
+ "bdi",
3062
+ "bdo",
3063
+ "blockquote",
3064
+ "body",
3065
+ "br",
3066
+ "button",
3067
+ "canvas",
3068
+ "caption",
3069
+ "cite",
3070
+ "code",
3071
+ "col",
3072
+ "colgroup",
3073
+ "data",
3074
+ "datalist",
3075
+ "dd",
3076
+ "del",
3077
+ "details",
3078
+ "dfn",
3079
+ "dialog",
3080
+ "div",
3081
+ "dl",
3082
+ "dt",
3083
+ "em",
3084
+ "embed",
3085
+ "fieldset",
3086
+ "figcaption",
3087
+ "figure",
3088
+ "footer",
3089
+ "form",
3090
+ "h1",
3091
+ "h2",
3092
+ "h3",
3093
+ "h4",
3094
+ "h5",
3095
+ "h6",
3096
+ "head",
3097
+ "header",
3098
+ "hgroup",
3099
+ "hr",
3100
+ "html",
3101
+ "i",
3102
+ "iframe",
3103
+ "img",
3104
+ "input",
3105
+ "ins",
3106
+ "kbd",
3107
+ "label",
3108
+ "legend",
3109
+ "li",
3110
+ "link",
3111
+ "main",
3112
+ "map",
3113
+ "mark",
3114
+ "math",
3115
+ "menu",
3116
+ "menuitem",
3117
+ "meta",
3118
+ "meter",
3119
+ "nav",
3120
+ "noscript",
3121
+ "object",
3122
+ "ol",
3123
+ "optgroup",
3124
+ "option",
3125
+ "output",
3126
+ "p",
3127
+ "param",
3128
+ "picture",
3129
+ "pre",
3130
+ "progress",
3131
+ "q",
3132
+ "rb",
3133
+ "rp",
3134
+ "rt",
3135
+ "rtc",
3136
+ "ruby",
3137
+ "s",
3138
+ "samp",
3139
+ "script",
3140
+ "search",
3141
+ "section",
3142
+ "select",
3143
+ "slot",
3144
+ "small",
3145
+ "source",
3146
+ "span",
3147
+ "strong",
3148
+ "style",
3149
+ "sub",
3150
+ "summary",
3151
+ "sup",
3152
+ "svg",
3153
+ "table",
3154
+ "tbody",
3155
+ "td",
3156
+ "template",
3157
+ "textarea",
3158
+ "tfoot",
3159
+ "th",
3160
+ "thead",
3161
+ "time",
3162
+ "title",
3163
+ "tr",
3164
+ "track",
3165
+ "u",
3166
+ "ul",
3167
+ "var",
3168
+ "video",
3169
+ "wbr"
3170
+ ];
3171
+ }
3172
+ });
3173
+
3174
+ // ../../node_modules/html-tags/index.js
3175
+ var require_html_tags2 = __commonJS({
3176
+ "../../node_modules/html-tags/index.js"(exports, module) {
3177
+ "use strict";
3178
+ module.exports = require_html_tags();
3179
+ }
3180
+ });
3181
+
3182
+ // src/react/componentManifest/componentMeta/ComponentMetaManager.ts
3183
+ import { statSync } from "node:fs";
3184
+ import { logger } from "@aussieljk/forkbook/internal/node-logger";
3185
+ import { API } from "typescript-native/unstable/sync";
3186
+
3187
+ // src/react/componentManifest/componentMeta/componentMetaExtractor.ts
3188
+ import {
3189
+ SyntaxKind,
3190
+ isArrowFunction,
3191
+ isAsExpression,
3192
+ isAwaitExpression,
3193
+ isBinaryExpression,
3194
+ isBindingElement,
3195
+ isBlock,
3196
+ isCallExpression,
3197
+ isClassDeclaration,
3198
+ isConditionalExpression,
3199
+ isEnumDeclaration,
3200
+ isEnumMember,
3201
+ isExportAssignment,
3202
+ isExpressionStatement,
3203
+ isFunctionDeclaration,
3204
+ isFunctionExpression,
3205
+ isIdentifier,
3206
+ isImportDeclaration,
3207
+ isInterfaceDeclaration,
3208
+ isJsxOpeningElement,
3209
+ isJsxSelfClosingElement,
3210
+ isLiteralTypeNode,
3211
+ isNamedImports,
3212
+ isNamespaceImport,
3213
+ isNewExpression,
3214
+ isNonNullExpression,
3215
+ isNumericLiteral,
3216
+ isObjectBindingPattern,
3217
+ isObjectLiteralExpression,
3218
+ isParenthesizedExpression,
3219
+ isPropertyAccessExpression,
3220
+ isPropertyAssignment,
3221
+ isPropertyDeclaration,
3222
+ isSatisfiesExpression,
3223
+ isShorthandPropertyAssignment,
3224
+ isStringLiteral,
3225
+ isTypeAliasDeclaration,
3226
+ isTypeReferenceNode,
3227
+ isUnionTypeNode,
3228
+ isVariableDeclaration,
3229
+ isVariableStatement
3230
+ } from "typescript-native/unstable/ast";
3231
+ import {
3232
+ SignatureKind,
3233
+ SymbolFlags,
3234
+ TypeFlags,
3235
+ isUnionType
3236
+ } from "typescript-native/unstable/sync";
3237
+ var LARGE_SOURCE_THRESHOLD = 30, MAX_DEPTH = 5;
3238
+ function extractComponentDocFromStory(project, storyPath, ref) {
3239
+ let storyFile = project.program.getSourceFile(storyPath);
3240
+ if (!storyFile || !ref.importName)
3241
+ return;
3242
+ let ctx = { project, checker: project.checker }, imported = findImport(ctx, storyFile, ref), resolved = (imported && resolveFromStoryJsx(ctx, storyFile, ref, imported.local)) ?? resolveFromMetaComponent(ctx, storyFile, ref, imported?.local) ?? (imported && resolveFromModuleExport(ctx, imported.module, ref));
3243
+ return resolved && serializeComponentDoc(ctx, resolved, ref.importName, ref, imported?.module);
3244
+ }
3245
+ function extractComponentDocFromFile(project, filePath, exportName = "default") {
3246
+ let sourceFile = project.program.getSourceFile(filePath), ctx = { project, checker: project.checker }, module = sourceFile && ctx.checker.getSymbolAtLocation(sourceFile);
3247
+ if (!module)
3248
+ return;
3249
+ let ref = { componentName: exportName, importName: exportName, isPackage: !1 }, resolved = resolveFromModuleExport(ctx, module, ref);
3250
+ return resolved && serializeComponentDoc(ctx, resolved, exportName, { ...ref, path: filePath }, module);
3251
+ }
3252
+ function resolveAlias(ctx, symbol) {
3253
+ if (!(symbol.flags & SymbolFlags.Alias))
3254
+ return symbol;
3255
+ let target = ctx.checker.getAliasedSymbol(symbol);
3256
+ return ctx.checker.isUnknownSymbol(target) ? symbol : target;
3257
+ }
3258
+ function resolveHandle(ctx, handle) {
3259
+ return handle?.resolve(ctx.project);
3260
+ }
3261
+ function getDeclaration(ctx, symbol) {
3262
+ return resolveHandle(ctx, symbol.valueDeclaration ?? symbol.declarations[0]);
3263
+ }
3264
+ function getDeclarations(ctx, symbol) {
3265
+ return symbol.declarations.flatMap((handle) => resolveHandle(ctx, handle) ?? []);
3266
+ }
3267
+ function sameSymbol(a, b) {
3268
+ return !!a && !!b && a.id === b.id;
3269
+ }
3270
+ function getExport(ctx, module, name) {
3271
+ return ctx.checker.getExportsOfModule(module).find((symbol) => symbol.name === name);
3272
+ }
3273
+ function getProperty(ctx, type, name) {
3274
+ return ctx.checker.getPropertyOfType(type, name);
3275
+ }
3276
+ function skipWrappers(node) {
3277
+ let current = node;
3278
+ for (; isParenthesizedExpression(current) || isAsExpression(current) || isSatisfiesExpression(current) || isNonNullExpression(current); )
3279
+ current = current.expression;
3280
+ return current;
3281
+ }
3282
+ function resolveComponentSymbol(ctx, symbol, depth = 0) {
3283
+ let resolved = resolveAlias(ctx, symbol);
3284
+ if (depth > MAX_DEPTH)
3285
+ return resolved;
3286
+ let declaration = getDeclaration(ctx, resolved);
3287
+ if (declaration && (isArrowFunction(declaration) || isFunctionExpression(declaration)) && isVariableDeclaration(declaration.parent) && isIdentifier(declaration.parent.name)) {
3288
+ let variable = ctx.checker.getSymbolAtLocation(declaration.parent.name);
3289
+ variable && (resolved = resolveAlias(ctx, variable), declaration = getDeclaration(ctx, resolved));
3290
+ }
3291
+ if (!declaration)
3292
+ return resolved;
3293
+ let next;
3294
+ return isShorthandPropertyAssignment(declaration) ? next = ctx.checker.getShorthandAssignmentValueSymbol(declaration) : isPropertyAssignment(declaration) ? next = ctx.checker.getSymbolAtLocation(skipWrappers(declaration.initializer)) : isBinaryExpression(declaration) && declaration.operatorToken.kind === SyntaxKind.EqualsToken ? next = ctx.checker.getSymbolAtLocation(skipWrappers(declaration.right)) : (declaration.kind === SyntaxKind.PropertySignature || isPropertyDeclaration(declaration)) && (next = ctx.checker.getTypeOfSymbol(resolved)?.getSymbol()), next && !sameSymbol(resolveAlias(ctx, next), resolved) ? resolveComponentSymbol(ctx, next, depth + 1) : resolved;
3295
+ }
3296
+ function findImport(ctx, storyFile, ref) {
3297
+ for (let statement of storyFile.statements) {
3298
+ if (!isImportDeclaration(statement) || !isStringLiteral(statement.moduleSpecifier) || statement.moduleSpecifier.text !== ref.importId || !statement.importClause)
3299
+ continue;
3300
+ let module = ctx.checker.getSymbolAtLocation(statement.moduleSpecifier), { name, namedBindings } = statement.importClause, localName;
3301
+ ref.importName === "default" && name && (localName = name), !localName && namedBindings && isNamedImports(namedBindings) && (localName = namedBindings.elements.find(
3302
+ (element) => (element.propertyName ?? element.name).text === ref.importName
3303
+ )?.name), !localName && ref.member && namedBindings && isNamespaceImport(namedBindings) && (localName = namedBindings.name);
3304
+ let local = localName && ctx.checker.getSymbolAtLocation(localName);
3305
+ if (local && module)
3306
+ return { local, module };
3307
+ }
3308
+ }
3309
+ function resolveFromStoryJsx(ctx, storyFile, ref, local) {
3310
+ let result, visit = (node) => {
3311
+ if (!result) {
3312
+ if (isJsxSelfClosingElement(node) || isJsxOpeningElement(node)) {
3313
+ let { tagName } = node, signature = (ref.member ? isPropertyAccessExpression(tagName) && tagName.name.text === ref.member && sameSymbol(ctx.checker.getSymbolAtLocation(tagName.expression), local) : isIdentifier(tagName) && sameSymbol(ctx.checker.getSymbolAtLocation(tagName), local)) ? ctx.checker.getResolvedSignature(node) : void 0;
3314
+ if (signature) {
3315
+ let [propsParameter] = signature.getParameters(), member = ref.member && isPropertyAccessExpression(tagName) ? ctx.checker.getSymbolAtLocation(tagName.name) : void 0;
3316
+ result = {
3317
+ propsType: propsParameter ? ctx.checker.getTypeOfSymbolAtLocation(propsParameter, node) : void 0,
3318
+ symbol: resolveComponentSymbol(ctx, member ?? local)
3319
+ };
3320
+ return;
3321
+ }
3322
+ }
3323
+ node.forEachChild(visit);
3324
+ }
3325
+ };
3326
+ return visit(storyFile), result;
3327
+ }
3328
+ function resolveFromMetaComponent(ctx, storyFile, ref, local) {
3329
+ let module = ctx.checker.getSymbolAtLocation(storyFile), meta = module && getExport(ctx, module, "default"), metaType = meta && ctx.checker.getTypeOfSymbol(meta), componentProperty = metaType && getProperty(ctx, metaType, "component"), declaration = componentProperty && getDeclaration(ctx, componentProperty);
3330
+ if (!componentProperty || !declaration || !isPropertyAssignment(declaration))
3331
+ return;
3332
+ let initializer = skipWrappers(declaration.initializer), metaName = isIdentifier(initializer) ? initializer.text : isPropertyAccessExpression(initializer) && isIdentifier(initializer.expression) ? `${initializer.expression.text}.${initializer.name.text}` : void 0, initializerSymbol = ctx.checker.getSymbolAtLocation(initializer);
3333
+ if (!(!ref.member && local && initializerSymbol ? sameSymbol(resolveAlias(ctx, local), resolveAlias(ctx, initializerSymbol)) : metaName === ref.componentName) || !initializerSymbol)
3334
+ return;
3335
+ let componentType = ctx.checker.getTypeOfSymbol(componentProperty), symbol = initializerSymbol;
3336
+ if (ref.member && !isPropertyAccessExpression(initializer)) {
3337
+ let member = componentType && getProperty(ctx, componentType, ref.member);
3338
+ if (!member)
3339
+ return;
3340
+ componentType = ctx.checker.getTypeOfSymbol(member), symbol = member;
3341
+ }
3342
+ return resolveFromComponentType(ctx, componentType, resolveComponentSymbol(ctx, symbol));
3343
+ }
3344
+ function resolveFromModuleExport(ctx, module, ref) {
3345
+ let exportName = ref.importName ?? ref.componentName.split(".").at(-1), symbol = exportName ? getExport(ctx, module, exportName) : void 0, componentType = symbol && ctx.checker.getTypeOfSymbol(symbol);
3346
+ return ref.member && !ref.namespace && (symbol = componentType && getProperty(ctx, componentType, ref.member), componentType = symbol && ctx.checker.getTypeOfSymbol(symbol)), symbol && resolveFromComponentType(ctx, componentType, resolveComponentSymbol(ctx, symbol));
3347
+ }
3348
+ function resolveFromComponentType(ctx, componentType, symbol) {
3349
+ if (!componentType)
3350
+ return;
3351
+ let isAny = (type) => !type || !!(type.flags & TypeFlags.Any), [callSignature] = ctx.checker.getSignaturesOfType(componentType, SignatureKind.Call);
3352
+ if (callSignature) {
3353
+ let [propsParameter] = callSignature.getParameters();
3354
+ if (!propsParameter)
3355
+ return { propsType: void 0, symbol };
3356
+ let propsType = ctx.checker.getTypeOfSymbol(propsParameter);
3357
+ if (!isAny(propsType))
3358
+ return { propsType, symbol };
3359
+ }
3360
+ for (let signature of ctx.checker.getSignaturesOfType(componentType, SignatureKind.Construct)) {
3361
+ let instanceType = ctx.checker.getReturnTypeOfSignature(signature), props = instanceType && getProperty(ctx, instanceType, "props"), propsType = props && ctx.checker.getTypeOfSymbol(props);
3362
+ if (!isAny(propsType))
3363
+ return { propsType, symbol };
3364
+ }
3365
+ }
3366
+ function getPropSymbols(ctx, propsType, location) {
3367
+ let members = isUnionType(propsType) ? propsType.getTypes() : [];
3368
+ if (members.length === 0) {
3369
+ let apparent = ctx.checker.getApparentType(propsType) ?? propsType;
3370
+ return ctx.checker.getPropertiesOfType(apparent).map((symbol) => ({ symbol, forceOptional: !1 }));
3371
+ }
3372
+ let isDegraded = (symbol) => !!(ctx.checker.getTypeOfSymbolAtLocation(symbol, location).flags & (TypeFlags.Never | TypeFlags.Undefined)), props = /* @__PURE__ */ new Map();
3373
+ for (let member of members)
3374
+ for (let symbol of ctx.checker.getPropertiesOfType(member)) {
3375
+ let degraded = isDegraded(symbol), optional = !!(symbol.flags & SymbolFlags.Optional) || degraded, existing = props.get(symbol.name);
3376
+ if (!existing) {
3377
+ props.set(symbol.name, { symbol, forceOptional: optional, count: 1, degraded });
3378
+ continue;
3379
+ }
3380
+ existing.count++, existing.forceOptional ||= optional, existing.degraded && !degraded && Object.assign(existing, { symbol, degraded });
3381
+ }
3382
+ return [...props.values()].map(({ symbol, forceOptional, count }) => {
3383
+ let unionProperty = getProperty(ctx, propsType, symbol.name);
3384
+ return {
3385
+ symbol,
3386
+ forceOptional: forceOptional || count < members.length,
3387
+ type: unionProperty && ctx.checker.getTypeOfSymbolAtLocation(unionProperty, location)
3388
+ };
3389
+ });
3390
+ }
3391
+ function getParent(ctx, prop) {
3392
+ let node = resolveHandle(ctx, prop.declarations[0])?.parent;
3393
+ for (; node; ) {
3394
+ if (isInterfaceDeclaration(node) || isTypeAliasDeclaration(node))
3395
+ return { name: node.name.text, fileName: node.getSourceFile().fileName };
3396
+ node = node.parent;
3397
+ }
3398
+ }
3399
+ var isLibraryPath = (path3) => path3.includes("node_modules") || path3.endsWith(".d.ts");
3400
+ function getBulkProps(ctx, props) {
3401
+ let candidates = props.flatMap((prop) => {
3402
+ let paths = prop.declarations.map((declaration) => declaration.path);
3403
+ return paths.length === 0 || !paths.every(isLibraryPath) ? [] : [{ name: prop.name, source: paths[0], parent: getParent(ctx, prop)?.name }];
3404
+ }), count = (keys) => {
3405
+ let counts = /* @__PURE__ */ new Map();
3406
+ for (let key of keys)
3407
+ key && counts.set(key, (counts.get(key) ?? 0) + 1);
3408
+ return counts;
3409
+ }, bySource = count(candidates.map(({ source }) => source)), byParent = count(candidates.map(({ parent }) => parent)), isBulk = (counts, key) => !!key && (counts.get(key) ?? 0) > LARGE_SOURCE_THRESHOLD;
3410
+ return new Set(
3411
+ candidates.filter(({ source, parent }) => isBulk(bySource, source) || isBulk(byParent, parent)).map(({ name }) => name)
3412
+ );
3413
+ }
3414
+ function getSourceLiteralOrder(ctx, prop) {
3415
+ let texts = [], visit = (node, depth) => {
3416
+ if (!(!node || depth > MAX_DEPTH))
3417
+ if (isUnionTypeNode(node))
3418
+ node.types.forEach((type) => visit(type, depth + 1));
3419
+ else if (isLiteralTypeNode(node))
3420
+ texts.push(node.literal.getText());
3421
+ else if (isTypeReferenceNode(node)) {
3422
+ let symbol = ctx.checker.getSymbolAtLocation(node.typeName), alias = symbol && getDeclaration(ctx, resolveAlias(ctx, symbol));
3423
+ alias && isTypeAliasDeclaration(alias) && visit(alias.type, depth + 1), alias && isEnumDeclaration(alias) && alias.members.forEach((member) => visit(member.initializer, depth + 1));
3424
+ } else (isStringLiteral(node) || isNumericLiteral(node)) && texts.push(node.getText());
3425
+ }, declaration = getDeclaration(ctx, prop);
3426
+ return declaration && "type" in declaration && visit(declaration.type, 0), texts.map((text) => text.replace(/^'(.*)'$/s, (_, value) => JSON.stringify(value)));
3427
+ }
3428
+ function serializeType(ctx, type, required, sourceOrder, depth = 0) {
3429
+ let { checker } = ctx;
3430
+ if (depth > MAX_DEPTH)
3431
+ return { name: checker.typeToString(type) };
3432
+ if (isUnionType(type)) {
3433
+ let all = type.getTypes(), members = all.filter((member) => !(member.flags & TypeFlags.Undefined));
3434
+ if (members.length === 2 && members.every((member) => member.flags & TypeFlags.BooleanLiteral))
3435
+ return { name: "boolean" };
3436
+ let literals = members.filter(
3437
+ (member) => !!(member.flags & (TypeFlags.StringLiteral | TypeFlags.NumberLiteral))
3438
+ );
3439
+ if (literals.length > 0 && literals.length === members.length) {
3440
+ let order = sourceOrder(), position = (member) => {
3441
+ let index = order.indexOf(JSON.stringify(member.value));
3442
+ return index === -1 ? order.length : index;
3443
+ }, sorted = [...literals].sort((a, b) => position(a) - position(b));
3444
+ return {
3445
+ name: "enum",
3446
+ raw: sorted.map((member) => checker.typeToString(member)).join(" | "),
3447
+ value: sorted.map((member) => ({ value: JSON.stringify(member.value) }))
3448
+ };
3449
+ }
3450
+ if (!required && members.length === 1 && members.length < all.length)
3451
+ return { name: checker.typeToString(members[0]) };
3452
+ }
3453
+ if (type.flags & TypeFlags.TypeParameter) {
3454
+ let constraint = checker.getBaseConstraintOfType(type);
3455
+ if (constraint && constraint.id !== type.id)
3456
+ return serializeType(ctx, constraint, required, sourceOrder, depth + 1);
3457
+ }
3458
+ return { name: checker.typeToString(type) };
3459
+ }
3460
+ function isFunctionLike(node) {
3461
+ return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node);
3462
+ }
3463
+ function findFunction(ctx, node, depth = 0) {
3464
+ if (!(!node || depth > MAX_DEPTH)) {
3465
+ if (isFunctionLike(node))
3466
+ return node;
3467
+ if (isParenthesizedExpression(node) || isAsExpression(node) || isSatisfiesExpression(node))
3468
+ return findFunction(ctx, node.expression, depth + 1);
3469
+ if (isCallExpression(node)) {
3470
+ for (let argument of node.arguments) {
3471
+ let fn = findFunction(ctx, argument, depth + 1);
3472
+ if (fn)
3473
+ return fn;
3474
+ }
3475
+ return;
3476
+ }
3477
+ if (isIdentifier(node)) {
3478
+ let symbol = ctx.checker.getSymbolAtLocation(node), declaration = symbol && getDeclaration(ctx, resolveAlias(ctx, symbol));
3479
+ if (declaration && isVariableDeclaration(declaration))
3480
+ return findFunction(ctx, declaration.initializer, depth + 1);
3481
+ if (declaration && isFunctionDeclaration(declaration))
3482
+ return declaration;
3483
+ }
3484
+ }
3485
+ }
3486
+ function resolveLiteral(ctx, node, depth = 0) {
3487
+ return depth > MAX_DEPTH || !(isIdentifier(node) || isPropertyAccessExpression(node)) ? node.getText() : isIdentifier(node) && node.text === "undefined" ? "undefined" : resolveSymbolLiteral(ctx, ctx.checker.getSymbolAtLocation(node), node.getText(), depth);
3488
+ }
3489
+ function resolveSymbolLiteral(ctx, symbol, text, depth = 0) {
3490
+ let declaration = symbol && getDeclaration(ctx, resolveAlias(ctx, symbol)), initializer = declaration && (isVariableDeclaration(declaration) || isEnumMember(declaration) || isBindingElement(declaration) || isPropertyAssignment(declaration)) ? declaration.initializer : void 0;
3491
+ return initializer ? resolveLiteral(ctx, initializer, depth + 1) : text;
3492
+ }
3493
+ function collectBindingDefaults(ctx, pattern, defaults) {
3494
+ for (let element of pattern.elements)
3495
+ if (element.initializer && element.name) {
3496
+ let name = (element.propertyName ?? element.name).getText();
3497
+ defaults.set(name, resolveLiteral(ctx, element.initializer));
3498
+ }
3499
+ }
3500
+ function readsProps(ctx, node, props) {
3501
+ let expression = skipWrappers(node);
3502
+ return isIdentifier(expression) ? sameSymbol(ctx.checker.getSymbolAtLocation(expression), props) : isAwaitExpression(expression) ? readsProps(ctx, expression.expression, props) : isBinaryExpression(expression) ? readsProps(ctx, expression.left, props) || readsProps(ctx, expression.right, props) : isConditionalExpression(expression) ? readsProps(ctx, expression.whenTrue, props) || readsProps(ctx, expression.whenFalse, props) : isCallExpression(expression) || isNewExpression(expression) ? expression.arguments?.some((argument) => readsProps(ctx, argument, props)) ?? !1 : !1;
3503
+ }
3504
+ function getDestructuringDefaults(ctx, component) {
3505
+ let defaults = /* @__PURE__ */ new Map(), declarations = getDeclarations(ctx, component), declaration = getDeclaration(ctx, component), fn;
3506
+ declaration && isFunctionDeclaration(declaration) ? fn = declarations.find(
3507
+ (node) => isFunctionDeclaration(node) && !!node.body
3508
+ ) : declaration && isVariableDeclaration(declaration) ? fn = findFunction(ctx, declaration.initializer) : declaration && isExportAssignment(declaration) && (fn = findFunction(ctx, declaration.expression));
3509
+ let [propsParameter] = fn?.parameters ?? [];
3510
+ if (!fn || !propsParameter)
3511
+ return defaults;
3512
+ if (isObjectBindingPattern(propsParameter.name))
3513
+ return collectBindingDefaults(ctx, propsParameter.name, defaults), defaults;
3514
+ let props = isIdentifier(propsParameter.name) ? ctx.checker.getSymbolAtLocation(propsParameter.name) : void 0;
3515
+ if (!props || !fn.body || !isBlock(fn.body))
3516
+ return defaults;
3517
+ for (let statement of fn.body.statements)
3518
+ if (isVariableStatement(statement))
3519
+ for (let variable of statement.declarationList.declarations)
3520
+ isObjectBindingPattern(variable.name) && variable.initializer && readsProps(ctx, variable.initializer, props) && collectBindingDefaults(ctx, variable.name, defaults);
3521
+ return defaults;
3522
+ }
3523
+ function collectObjectDefaults(ctx, object, defaults) {
3524
+ for (let property of object.properties)
3525
+ if (isPropertyAssignment(property))
3526
+ defaults.set(property.name.getText(), resolveLiteral(ctx, property.initializer));
3527
+ else if (isShorthandPropertyAssignment(property)) {
3528
+ let name = property.name.getText(), symbol = ctx.checker.getShorthandAssignmentValueSymbol(property);
3529
+ defaults.set(name, resolveSymbolLiteral(ctx, symbol, name));
3530
+ }
3531
+ }
3532
+ function toObjectLiteral(ctx, node) {
3533
+ if (node && isIdentifier(node)) {
3534
+ let symbol = ctx.checker.getSymbolAtLocation(node), declaration = symbol && getDeclaration(ctx, symbol);
3535
+ node = declaration && isVariableDeclaration(declaration) ? declaration.initializer : void 0;
3536
+ }
3537
+ return node && isObjectLiteralExpression(node) ? node : void 0;
3538
+ }
3539
+ function getDefaultPropsDefaults(ctx, component) {
3540
+ let defaults = /* @__PURE__ */ new Map(), sourceFile = getDeclaration(ctx, component)?.getSourceFile();
3541
+ if (!sourceFile)
3542
+ return defaults;
3543
+ let isComponent = (node) => {
3544
+ let symbol = ctx.checker.getSymbolAtLocation(node);
3545
+ return !!symbol && sameSymbol(resolveAlias(ctx, symbol), component);
3546
+ };
3547
+ for (let statement of sourceFile.statements) {
3548
+ if (isClassDeclaration(statement) && statement.name && isComponent(statement.name)) {
3549
+ for (let member of statement.members)
3550
+ if (isPropertyDeclaration(member) && member.name.getText() === "defaultProps") {
3551
+ let object = toObjectLiteral(ctx, member.initializer);
3552
+ object && collectObjectDefaults(ctx, object, defaults);
3553
+ }
3554
+ }
3555
+ if (isExpressionStatement(statement) && isBinaryExpression(statement.expression) && statement.expression.operatorToken.kind === SyntaxKind.EqualsToken && isPropertyAccessExpression(statement.expression.left) && statement.expression.left.name.text === "defaultProps" && isComponent(statement.expression.left.expression)) {
3556
+ let object = toObjectLiteral(ctx, statement.expression.right);
3557
+ object && collectObjectDefaults(ctx, object, defaults);
3558
+ }
3559
+ }
3560
+ return defaults;
3561
+ }
3562
+ function findImplementation(ctx, symbol) {
3563
+ let current = symbol;
3564
+ for (let depth = 0; depth <= MAX_DEPTH; depth++) {
3565
+ let declaration = getDeclaration(ctx, current);
3566
+ if (!declaration || !isVariableDeclaration(declaration) || !declaration.initializer || !isIdentifier(declaration.initializer))
3567
+ break;
3568
+ let next = ctx.checker.getSymbolAtLocation(declaration.initializer);
3569
+ if (!next)
3570
+ break;
3571
+ current = resolveAlias(ctx, next);
3572
+ }
3573
+ return current;
3574
+ }
3575
+ function getJsDocTags(ctx, symbol) {
3576
+ let tags = {};
3577
+ for (let tag of ctx.checker.getJsDocTagsOfSymbol(symbol))
3578
+ (tags[tag.name] ??= []).push((tag.text ?? "").trim());
3579
+ return tags;
3580
+ }
3581
+ function getPropDescription(ctx, prop, tags) {
3582
+ let comment = ctx.checker.getDocumentationCommentOfSymbol(prop), tagLines = tags.map(({ name, text }) => text ? `@${name} ${text}` : `@${name}`);
3583
+ return [comment, ...tagLines].filter(Boolean).join(`
3584
+ `);
3585
+ }
3586
+ function serializeComponentDoc(ctx, { propsType, symbol }, exportName, ref, importedModule) {
3587
+ let component = resolveAlias(ctx, symbol), location = getDeclaration(ctx, component);
3588
+ if (!location)
3589
+ return;
3590
+ let implementation = findImplementation(ctx, component), defaults = getDestructuringDefaults(ctx, implementation);
3591
+ for (let [name, value] of getDefaultPropsDefaults(ctx, implementation))
3592
+ defaults.has(name) || defaults.set(name, value);
3593
+ let propSymbols = propsType ? getPropSymbols(ctx, propsType, location) : [], bulkProps = getBulkProps(
3594
+ ctx,
3595
+ propSymbols.map(({ symbol: prop }) => prop)
3596
+ ), props = {};
3597
+ for (let { symbol: prop, forceOptional, type } of propSymbols) {
3598
+ if (bulkProps.has(prop.name))
3599
+ continue;
3600
+ let tags = ctx.checker.getJsDocTagsOfSymbol(prop);
3601
+ if (tags.some((tag) => tag.name === "ignore"))
3602
+ continue;
3603
+ let required = !(prop.flags & SymbolFlags.Optional) && !forceOptional, propType = type ?? ctx.checker.getTypeOfSymbolAtLocation(prop, location), jsDocDefault = tags.find((tag) => tag.name === "default" || tag.name === "defaultValue"), defaultValue = defaults.get(prop.name) ?? (jsDocDefault?.text?.trim() || void 0);
3604
+ props[prop.name] = {
3605
+ name: prop.name,
3606
+ required,
3607
+ type: serializeType(ctx, propType, required, () => getSourceLiteralOrder(ctx, prop)),
3608
+ description: getPropDescription(ctx, prop, tags),
3609
+ defaultValue: defaultValue !== void 0 ? { value: defaultValue } : null,
3610
+ parent: getParent(ctx, prop)
3611
+ };
3612
+ }
3613
+ let jsDocTags = getJsDocTags(ctx, component), sourceFile = location.getSourceFile(), module = importedModule ?? ctx.checker.getSymbolAtLocation(sourceFile), exportSymbol = module && getExport(ctx, module, exportName);
3614
+ if (!jsDocTags.import && exportSymbol && !sameSymbol(exportSymbol, component)) {
3615
+ let exportTags = getJsDocTags(ctx, resolveAlias(ctx, exportSymbol));
3616
+ exportTags.import && (jsDocTags.import = exportTags.import);
3617
+ }
3618
+ let ownName = component.name !== "default" && !component.name.startsWith("__") ? component.name : void 0;
3619
+ return {
3620
+ displayName: (ref.member ? ref.componentName : void 0) ?? (exportSymbol && exportName !== "default" ? exportName : ownName) ?? ref.componentName,
3621
+ exportName,
3622
+ filePath: ref.path ?? sourceFile.fileName,
3623
+ description: ctx.checker.getDocumentationCommentOfSymbol(component),
3624
+ jsDocTags,
3625
+ props
3626
+ };
3627
+ }
3628
+
3629
+ // src/react/componentManifest/componentMeta/ComponentMetaManager.ts
3630
+ var getModifiedTime = (fileName) => statSync(fileName, { throwIfNoEntry: !1 })?.mtimeMs, ComponentMetaManager = class {
3631
+ constructor(options = {}) {
3632
+ this.openFiles = /* @__PURE__ */ new Set();
3633
+ /** The modified time of each project source file (not in `node_modules`) when tsgo read it. */
3634
+ this.modifiedTimes = /* @__PURE__ */ new Map();
3635
+ this.api = new API({ cwd: process.cwd(), ...options });
3636
+ }
3637
+ /** Adds `reactComponentMeta` and the JSDoc tags to the component of each story file. */
3638
+ batchExtract(entries) {
3639
+ let snapshot = this.update(entries.map((entry) => entry.storyPath));
3640
+ for (let { storyPath, component } of entries) {
3641
+ let project = snapshot.getDefaultProjectForFile(storyPath);
3642
+ if (!(!project || !component?.path || !component.importName))
3643
+ try {
3644
+ let doc = extractComponentDocFromStory(project, storyPath, component);
3645
+ doc && (component.reactComponentMeta = doc, component.componentJsDocTags = doc.jsDocTags, component.importOverride = doc.jsDocTags?.import?.[0]?.trim());
3646
+ } catch (error) {
3647
+ logger.debug(`[reactComponentMeta] Extraction failed for ${storyPath}: ${error}`);
3648
+ }
3649
+ }
3650
+ }
3651
+ /** Makes the docgen of an export of a component file. */
3652
+ extractFromFile(filePath, exportName) {
3653
+ let project = this.update([filePath]).getDefaultProjectForFile(filePath);
3654
+ return project && extractComponentDocFromFile(project, filePath, exportName);
3655
+ }
3656
+ dispose() {
3657
+ this.snapshot?.dispose(), this.api.close();
3658
+ }
3659
+ update(files) {
3660
+ let changed = [], deleted = [];
3661
+ for (let [fileName, time] of this.modifiedTimes) {
3662
+ let currentTime = getModifiedTime(fileName);
3663
+ currentTime !== time && ((currentTime === void 0 ? deleted : changed).push(fileName), this.modifiedTimes.delete(fileName));
3664
+ }
3665
+ let newFiles = [...new Set(files)].filter((fileName) => !this.openFiles.has(fileName));
3666
+ if (this.snapshot && changed.length + deleted.length + newFiles.length === 0)
3667
+ return this.snapshot;
3668
+ deleted.forEach((fileName) => this.openFiles.delete(fileName)), [...changed, ...newFiles].forEach((fileName) => this.openFiles.add(fileName)), this.snapshot?.dispose(), this.snapshot = this.api.updateSnapshot({
3669
+ closeFiles: [...changed, ...deleted],
3670
+ openFiles: [...changed, ...newFiles],
3671
+ fileChanges: { changed, deleted }
3672
+ });
3673
+ for (let project of this.snapshot.getProjects())
3674
+ for (let fileName of project.program.getSourceFileNames())
3675
+ !fileName.includes("/node_modules/") && !this.modifiedTimes.has(fileName) && this.modifiedTimes.set(fileName, getModifiedTime(fileName));
3676
+ return this.snapshot;
3677
+ }
3678
+ };
3679
+
3680
+ // src/react/docgen/buildDocgen.ts
3681
+ import { getStoryImportPathFromEntry } from "@aussieljk/forkbook/internal/common";
3682
+ import path2 from "pathe";
3683
+
3684
+ // src/react/componentManifest/buildReactComponentDocgen.ts
3685
+ import { getComponentIdFromEntry } from "@aussieljk/forkbook/internal/common";
3686
+ import {
3687
+ buildImportStatements as buildImportStatements2,
3688
+ createStoryReferenceResolver,
3689
+ extractComponentDescription,
3690
+ extractDescription
3691
+ } from "@aussieljk/forkbook/internal/csf-tools";
3692
+ import path from "pathe";
3693
+
3694
+ // src/react/componentManifest/resolveComponents.ts
3695
+ import { recast } from "@aussieljk/forkbook/internal/babel";
3696
+ import { extractDeclaredSubcomponents } from "@aussieljk/forkbook/internal/common";
3697
+ import { storyNameFromExport } from "@aussieljk/forkbook/internal/csf/csf-utils";
3698
+ import {
3699
+ createStoryArgsResolver as createStoryArgsResolver2,
3700
+ extractStoryJSDocInfo,
3701
+ loadCsf,
3702
+ unresolvedWarning
3703
+ } from "@aussieljk/forkbook/internal/csf-tools";
3704
+
3705
+ // src/react/componentManifest/generateCodeSnippet.ts
3706
+ import { types as t } from "@aussieljk/forkbook/internal/babel";
3707
+ import {
3708
+ collectImportBindings,
3709
+ createStoryArgsResolver,
3710
+ isCanonicalCsf2BindCall,
3711
+ metaObjectPath,
3712
+ normalizeStoryDeclaration,
3713
+ resolveRenderFunction
3714
+ } from "@aussieljk/forkbook/internal/csf-tools";
3715
+
3716
+ // src/react/componentManifest/utils.ts
3717
+ import { readFileSync, statSync as statSync2 } from "node:fs";
3718
+ import {
3719
+ findTsconfigPathForPath,
3720
+ findTsconfigPath as findTsconfigPathCommon,
3721
+ getTsconfigPathsBaseDir,
3722
+ resolveImport,
3723
+ supportedExtensions
3724
+ } from "@aussieljk/forkbook/internal/common";
3725
+ import { logger as logger2 } from "@aussieljk/forkbook/internal/node-logger";
3726
+ var TsconfigPaths = __toESM(require_lib(), 1);
3727
+ function invariant(condition, message) {
3728
+ if (!condition)
3729
+ throw new Error((typeof message == "function" ? message() : message) ?? "Invariant failed");
3730
+ }
3731
+ var memoStore = /* @__PURE__ */ new WeakMap(), asyncMemoStore = /* @__PURE__ */ new WeakMap(), textFileCache = /* @__PURE__ */ new Map(), cached = (fn, opts = {}) => {
3732
+ let keyOf = opts.key ?? ((...args) => {
3733
+ try {
3734
+ return JSON.stringify(args);
3735
+ } catch {
3736
+ return String(args[0]);
3737
+ }
3738
+ });
3739
+ return (...args) => {
3740
+ let k = keyOf(...args), name = fn.name || opts.name || "anonymous", store = memoStore.get(fn);
3741
+ if (store || (store = /* @__PURE__ */ new Map(), memoStore.set(fn, store)), store.has(k))
3742
+ return logger2.verbose(`[cache] hit ${name} key=${k}`), store.get(k);
3743
+ let start = Date.now(), result = fn(...args), duration = Date.now() - start;
3744
+ return store.set(k, result), logger2.verbose(`[cache] miss ${name} took ${duration}ms key=${k}`), result;
3745
+ };
3746
+ };
3747
+ var invalidateCache = () => {
3748
+ memoStore = /* @__PURE__ */ new WeakMap(), asyncMemoStore = /* @__PURE__ */ new WeakMap(), textFileCache = /* @__PURE__ */ new Map();
3749
+ }, cachedReadFileSync = cached(readFileSync, { name: "cachedReadFile" }), cachedReadTextFileSync = (filePath) => {
3750
+ let mtimeMs;
3751
+ try {
3752
+ mtimeMs = statSync2(filePath).mtimeMs;
3753
+ } catch {
3754
+ mtimeMs = void 0;
3755
+ }
3756
+ if (mtimeMs !== void 0) {
3757
+ let entry = textFileCache.get(filePath);
3758
+ if (entry && entry.mtimeMs === mtimeMs)
3759
+ return entry.content;
3760
+ }
3761
+ let content = readFileSync(filePath, "utf-8");
3762
+ return mtimeMs !== void 0 && textFileCache.set(filePath, { mtimeMs, content }), content;
3763
+ }, cachedFindUp = cached(up, { name: "findUp" }), cachedResolveImport = cached(resolveImport, {
3764
+ name: "resolveImport"
3765
+ }), findTsconfigPath = cached(
3766
+ (cwd) => findTsconfigPathCommon(cwd),
3767
+ {
3768
+ name: "findTsconfigPath"
3769
+ }
3770
+ ), getTsconfigPaths = cached(
3771
+ (path3) => {
3772
+ let tsconfigPath = findTsconfigPathForPath(path3);
3773
+ return tsconfigPath ? TsconfigPaths.loadConfig(tsconfigPath) : { resultType: "failed", message: "Couldn't find tsconfig.json" };
3774
+ },
3775
+ { name: "getTsconfigPaths" }
3776
+ );
3777
+ function matchPath(id, importerPath = process.cwd()) {
3778
+ let tsconfig = getTsconfigPaths(importerPath);
3779
+ return tsconfig.resultType !== "success" ? id : TsconfigPaths.createMatchPath(
3780
+ getTsconfigPathsBaseDir(tsconfig.configFileAbsolutePath),
3781
+ tsconfig.paths,
3782
+ ["browser", "module", "main"]
3783
+ )(id, void 0, void 0, supportedExtensions) ?? id;
3784
+ }
3785
+
3786
+ // src/react/componentManifest/generateCodeSnippet.ts
3787
+ function renderFunctionOf(resolution) {
3788
+ return resolution.kind === "resolved" ? resolution.path : resolution.kind === "unresolved" ? resolution.shadowedRender : void 0;
3789
+ }
3790
+ function getCodeSnippet(csf, storyName, componentName, resolver = createStoryArgsResolver(csf)) {
3791
+ let { args, imports, unresolved } = resolver.resolve(storyName), importedBind = importedBoundStory(csf, storyName, args);
3792
+ return importedBind ? {
3793
+ node: importedBind.node,
3794
+ imports: [...imports, importedBind.importRef],
3795
+ unresolved
3796
+ } : {
3797
+ node: buildSnippetNode(csf, storyName, componentName, args, resolver.ctx),
3798
+ imports,
3799
+ unresolved
3800
+ };
3801
+ }
3802
+ function importedBoundStory(csf, storyName, args) {
3803
+ let declaration = csf._storyDeclarationPath[storyName];
3804
+ if (!declaration?.isVariableDeclarator())
3805
+ return;
3806
+ let init = declaration.get("init");
3807
+ if (!init.isCallExpression() || !isCanonicalCsf2BindCall(init.node))
3808
+ return;
3809
+ let callee = init.get("callee");
3810
+ if (!callee.isMemberExpression())
3811
+ return;
3812
+ let object = callee.get("object");
3813
+ if (!object.isIdentifier())
3814
+ return;
3815
+ let binding = collectImportBindings(csf._file.path).get(object.node.name);
3816
+ if (!binding)
3817
+ return;
3818
+ let values = Object.entries(args).map(([key, value]) => (invariant(t.isExpression(value), `Could not use ${key} as a bound story arg`), t.objectProperty(t.stringLiteral(key), value))), boundCall = t.callExpression(init.node, [t.objectExpression(values)]);
3819
+ return {
3820
+ node: t.variableDeclaration("const", [
3821
+ t.variableDeclarator(t.identifier(storyName), t.arrowFunctionExpression([], boundCall))
3822
+ ]),
3823
+ importRef: {
3824
+ localImportName: object.node.name,
3825
+ importId: binding.importId,
3826
+ importName: binding.importName,
3827
+ ...binding.importName === "*" ? { namespace: object.node.name } : {}
3828
+ }
3829
+ };
3830
+ }
3831
+ function buildSnippetNode(csf, storyName, componentName, merged, ctx) {
3832
+ let storyDeclaration = csf._storyDeclarationPath[storyName];
3833
+ if (!storyDeclaration) {
3834
+ let message = "Expected story to be a function or variable declaration";
3835
+ throw csf._storyPaths[storyName]?.buildCodeFrameError(message) ?? message;
3836
+ }
3837
+ let normalizedStory = normalizeStoryDeclaration(storyDeclaration), storyFn;
3838
+ normalizedStory.type === "fn" && (storyFn = normalizedStory.path);
3839
+ let storyConfigPath = normalizedStory.type === "config" ? normalizedStory.path : void 0, metaRender = resolveRenderFunction(metaObjectPath(csf), storyDeclaration, ctx), storyRender = resolveRenderFunction(storyConfigPath, storyDeclaration, ctx);
3840
+ storyFn || (storyFn = renderFunctionOf(storyRender) ?? (storyRender.kind === "missing" ? renderFunctionOf(metaRender) : void 0));
3841
+ let entries = Object.entries(merged).filter(([k]) => k !== "children"), validEntries = entries.filter(([k, v]) => isValidJsxAttrName(k) && v != null), invalidEntries = entries.filter(([k, v]) => !isValidJsxAttrName(k) && v != null), injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => a != null);
3842
+ if (storyFn) {
3843
+ let fn = storyFn.node;
3844
+ if (t.isArrowFunctionExpression(fn) && (t.isJSXElement(fn.body) || t.isJSXFragment(fn.body))) {
3845
+ let spreadRes = transformArgsSpreadsInJsx(fn.body, merged), inlineRes = inlineArgsInJsx(spreadRes.node, merged);
3846
+ if (spreadRes.changed || inlineRes.changed) {
3847
+ let newFn = t.arrowFunctionExpression(
3848
+ remainingParams(fn, inlineRes.node),
3849
+ inlineRes.node,
3850
+ fn.async
3851
+ );
3852
+ return t.variableDeclaration("const", [
3853
+ t.variableDeclarator(t.identifier(storyName), newFn)
3854
+ ]);
3855
+ }
3856
+ }
3857
+ let stmts = t.isFunctionDeclaration(fn) || t.isObjectMethod(fn) || t.isArrowFunctionExpression(fn) && t.isBlockStatement(fn.body) || t.isFunctionExpression(fn) && t.isBlockStatement(fn.body) ? fn.body.body : void 0;
3858
+ if (stmts) {
3859
+ let changed = !1, newBody = stmts.map((stmt) => {
3860
+ if (t.isReturnStatement(stmt) && stmt.argument && (t.isJSXElement(stmt.argument) || t.isJSXFragment(stmt.argument))) {
3861
+ let spreadRes = transformArgsSpreadsInJsx(stmt.argument, merged), inlineRes = inlineArgsInJsx(spreadRes.node, merged);
3862
+ if (spreadRes.changed || inlineRes.changed)
3863
+ return changed = !0, t.returnStatement(inlineRes.node);
3864
+ }
3865
+ return stmt;
3866
+ });
3867
+ if (changed) {
3868
+ let body = t.blockStatement(newBody), params = remainingParams(fn, body);
3869
+ return t.isFunctionDeclaration(fn) ? t.functionDeclaration(t.identifier(storyName), params, body, fn.generator, fn.async) : t.variableDeclaration("const", [
3870
+ t.variableDeclarator(
3871
+ t.identifier(storyName),
3872
+ t.arrowFunctionExpression(params, body, fn.async)
3873
+ )
3874
+ ]);
3875
+ }
3876
+ }
3877
+ return t.isFunctionDeclaration(fn) ? t.functionDeclaration(t.identifier(storyName), fn.params, fn.body, fn.generator, fn.async) : t.variableDeclaration("const", [
3878
+ t.variableDeclarator(
3879
+ t.identifier(storyName),
3880
+ t.isObjectMethod(fn) ? t.arrowFunctionExpression(fn.params, fn.body, fn.async) : fn
3881
+ )
3882
+ ]);
3883
+ }
3884
+ invariant(componentName, "Could not generate snippet without component name.");
3885
+ let invalidSpread = buildInvalidSpread(invalidEntries), name = t.jsxIdentifier(componentName), openingElAttrs = invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs, children = toJsxChildren(merged.children), selfClosing = children.length === 0, arrow = t.arrowFunctionExpression(
3886
+ [],
3887
+ t.jsxElement(
3888
+ t.jsxOpeningElement(name, openingElAttrs, selfClosing),
3889
+ selfClosing ? null : t.jsxClosingElement(name),
3890
+ children,
3891
+ selfClosing
3892
+ )
3893
+ );
3894
+ return t.variableDeclaration("const", [t.variableDeclarator(t.identifier(storyName), arrow)]);
3895
+ }
3896
+ function remainingParams(fn, body) {
3897
+ return readsArgs(body) ? fn.params : [];
3898
+ }
3899
+ function readsArgs(node) {
3900
+ let named = /* @__PURE__ */ new Set(), reads = !1;
3901
+ return t.traverseFast(node, (current) => {
3902
+ t.isMemberExpression(current) && !current.computed && named.add(current.property), (t.isObjectProperty(current) || t.isObjectMethod(current)) && !current.computed && named.add(current.key), t.isIdentifier(current) && current.name === "args" && !named.has(current) && (reads = !0);
3903
+ }), reads;
3904
+ }
3905
+ function buildInvalidSpread(entries) {
3906
+ if (entries.length === 0)
3907
+ return null;
3908
+ let objectProps = entries.map(
3909
+ ([k, v]) => t.objectProperty(t.stringLiteral(k), t.isExpression(v) ? v : t.identifier("undefined"))
3910
+ );
3911
+ return t.jsxSpreadAttribute(t.objectExpression(objectProps));
3912
+ }
3913
+ var isValidJsxAttrName = (n) => /^[A-Za-z_][A-Za-z0-9_:-]*$/.test(n), toAttr = (key, value) => t.isBooleanLiteral(value) ? value.value ? t.jsxAttribute(t.jsxIdentifier(key), null) : t.jsxAttribute(t.jsxIdentifier(key), t.jsxExpressionContainer(value)) : t.isStringLiteral(value) ? t.jsxAttribute(t.jsxIdentifier(key), t.stringLiteral(value.value)) : t.isExpression(value) ? t.jsxAttribute(t.jsxIdentifier(key), t.jsxExpressionContainer(value)) : null, toJsxChildren = (node) => node ? t.isStringLiteral(node) ? [t.jsxText(node.value)] : t.isJSXElement(node) || t.isJSXFragment(node) ? [node] : t.isExpression(node) ? [t.jsxExpressionContainer(node)] : [] : [];
3914
+ function getArgsMemberKey(expr) {
3915
+ if (t.isMemberExpression(expr) && t.isIdentifier(expr.object) && expr.object.name === "args") {
3916
+ if (t.isIdentifier(expr.property) && !expr.computed)
3917
+ return expr.property.name;
3918
+ if (t.isStringLiteral(expr.property) && expr.computed)
3919
+ return expr.property.value;
3920
+ }
3921
+ if (t.isOptionalMemberExpression?.(expr) && t.isIdentifier(expr.object) && expr.object.name === "args") {
3922
+ let prop = expr.property;
3923
+ if (t.isIdentifier(prop) && !expr.computed)
3924
+ return prop.name;
3925
+ if (t.isStringLiteral(prop) && expr.computed)
3926
+ return prop.value;
3927
+ }
3928
+ return null;
3929
+ }
3930
+ function inlineArgsInJsx(node, merged) {
3931
+ let changed = !1;
3932
+ if (t.isJSXElement(node)) {
3933
+ let opening = node.openingElement, newAttrs = opening.attributes.flatMap((a) => {
3934
+ if (!t.isJSXAttribute(a))
3935
+ return [a];
3936
+ let name = t.isJSXIdentifier(a.name) ? a.name.name : null;
3937
+ if (!(name && a.value && t.isJSXExpressionContainer(a.value)))
3938
+ return [a];
3939
+ let key = getArgsMemberKey(a.value.expression);
3940
+ if (!(key && key in merged))
3941
+ return [a];
3942
+ let repl = toAttr(name, merged[key]);
3943
+ return changed = !0, repl ? [repl] : [];
3944
+ }), newChildren = node.children.flatMap((c) => {
3945
+ if (t.isJSXElement(c) || t.isJSXFragment(c)) {
3946
+ let res = inlineArgsInJsx(c, merged);
3947
+ return changed ||= res.changed, [res.node];
3948
+ }
3949
+ return t.isJSXExpressionContainer(c) && getArgsMemberKey(c.expression) === "children" && merged.children ? (changed = !0, toJsxChildren(merged.children)) : [c];
3950
+ }), selfClosing = opening.selfClosing && newChildren.length === 0;
3951
+ return {
3952
+ node: t.jsxElement(
3953
+ t.jsxOpeningElement(opening.name, newAttrs, selfClosing),
3954
+ selfClosing ? null : node.closingElement ?? t.jsxClosingElement(opening.name),
3955
+ newChildren,
3956
+ selfClosing
3957
+ ),
3958
+ changed
3959
+ };
3960
+ }
3961
+ let fragChildren = node.children.flatMap((c) => {
3962
+ if (t.isJSXElement(c) || t.isJSXFragment(c)) {
3963
+ let res = inlineArgsInJsx(c, merged);
3964
+ return changed ||= res.changed, [res.node];
3965
+ }
3966
+ return t.isJSXExpressionContainer(c) && getArgsMemberKey(c.expression) === "children" && "children" in merged ? (changed = !0, toJsxChildren(merged.children)) : [c];
3967
+ });
3968
+ return { node: t.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
3969
+ }
3970
+ function transformArgsSpreadsInJsx(node, merged) {
3971
+ let changed = !1, makeInjectedPieces = (existing) => {
3972
+ let entries = Object.entries(merged).filter(([k, v]) => v != null && k !== "children"), validEntries = entries.filter(([k]) => isValidJsxAttrName(k)), invalidEntries = entries.filter(([k]) => !isValidJsxAttrName(k)), injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => !!a).filter((a) => t.isJSXIdentifier(a.name) && !existing.has(a.name.name)), invalidSpread = buildInvalidSpread(invalidEntries.filter(([k]) => !existing.has(k)));
3973
+ return invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs;
3974
+ };
3975
+ if (t.isJSXElement(node)) {
3976
+ let opening = node.openingElement, attrs = opening.attributes, isArgsSpread = (a) => t.isJSXSpreadAttribute(a) && t.isIdentifier(a.argument) && a.argument.name === "args", sawArgsSpread = attrs.some(isArgsSpread), firstIdx = attrs.findIndex(isArgsSpread), nonArgsAttrs = attrs.filter((a) => !isArgsSpread(a)), insertionIndex = sawArgsSpread ? attrs.slice(0, firstIdx).filter((a) => !isArgsSpread(a)).length : 0, newAttrs = sawArgsSpread ? (() => {
3977
+ let existing = new Set(
3978
+ nonArgsAttrs.filter((a) => t.isJSXAttribute(a)).flatMap((a) => t.isJSXIdentifier(a.name) ? [a.name.name] : [])
3979
+ ), pieces = makeInjectedPieces(existing);
3980
+ return changed = !0, [
3981
+ ...nonArgsAttrs.slice(0, insertionIndex),
3982
+ ...pieces,
3983
+ ...nonArgsAttrs.slice(insertionIndex)
3984
+ ];
3985
+ })() : nonArgsAttrs, newChildren = node.children.flatMap((c) => {
3986
+ if (t.isJSXElement(c) || t.isJSXFragment(c)) {
3987
+ let res = transformArgsSpreadsInJsx(c, merged);
3988
+ return changed ||= res.changed, [res.node];
3989
+ }
3990
+ return [c];
3991
+ }), children = sawArgsSpread && newChildren.length === 0 && merged.children ? (changed = !0, toJsxChildren(merged.children)) : newChildren, selfClosing = children.length === 0;
3992
+ return {
3993
+ node: t.jsxElement(
3994
+ t.jsxOpeningElement(opening.name, newAttrs, selfClosing),
3995
+ selfClosing ? null : node.closingElement ?? t.jsxClosingElement(opening.name),
3996
+ children,
3997
+ selfClosing
3998
+ ),
3999
+ changed
4000
+ };
4001
+ }
4002
+ let fragChildren = node.children.flatMap((c) => {
4003
+ if (t.isJSXElement(c) || t.isJSXFragment(c)) {
4004
+ let res = transformArgsSpreadsInJsx(c, merged);
4005
+ return changed ||= res.changed, [res.node];
4006
+ }
4007
+ return [c];
4008
+ });
4009
+ return { node: t.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
4010
+ }
4011
+
4012
+ // src/react/componentManifest/getComponentImports.ts
4013
+ import { dirname } from "node:path";
4014
+ import { types as t2 } from "@aussieljk/forkbook/internal/babel";
4015
+ import {
4016
+ buildImportStatements,
4017
+ collectImportBindings as collectImportBindings2,
4018
+ resolveComponentImport
4019
+ } from "@aussieljk/forkbook/internal/csf-tools";
4020
+ import { logger as logger3 } from "@aussieljk/forkbook/internal/node-logger";
4021
+ var baseIdentifier = (component) => component.split(".")[0] ?? component, getComponents = async ({
4022
+ csf,
4023
+ storyFilePath,
4024
+ additionalComponentNames = []
4025
+ }) => {
4026
+ let program = csf._file.path, componentSet = /* @__PURE__ */ new Set(), componentDepth = /* @__PURE__ */ new Map(), localToImport = collectImportBindings2(program), jsxDepth = 0;
4027
+ program.traverse({
4028
+ JSXElement: {
4029
+ enter() {
4030
+ jsxDepth++;
4031
+ },
4032
+ exit() {
4033
+ jsxDepth--;
4034
+ }
4035
+ },
4036
+ JSXOpeningElement(p) {
4037
+ let n = p.node.name, name;
4038
+ if (t2.isJSXIdentifier(n))
4039
+ name = n.name, name && /[A-Z]/.test(name.charAt(0)) && componentSet.add(name);
4040
+ else if (t2.isJSXMemberExpression(n)) {
4041
+ let jsxNameToString = (nm) => t2.isJSXIdentifier(nm) ? nm.name : `${jsxNameToString(nm.object)}.${jsxNameToString(nm.property)}`;
4042
+ name = jsxNameToString(n), componentSet.add(name);
4043
+ }
4044
+ if (name) {
4045
+ let depth = jsxDepth - 1, existing = componentDepth.get(name);
4046
+ (existing === void 0 || depth < existing) && componentDepth.set(name, depth);
4047
+ }
4048
+ }
4049
+ });
4050
+ let metaComp = csf._meta?.component;
4051
+ metaComp && componentSet.add(metaComp);
4052
+ for (let componentName of additionalComponentNames)
4053
+ componentSet.add(componentName);
4054
+ let components = Array.from(componentSet).sort((a, b) => a.localeCompare(b)), isLocallyDefinedWithoutImport = (base2) => {
4055
+ let binding = program.scope.getBinding(base2);
4056
+ return binding ? !!!(binding.path.isImportSpecifier?.() || binding.path.isImportDefaultSpecifier?.() || binding.path.isImportNamespaceSpecifier?.()) : !1;
4057
+ }, filteredComponents = components.filter(
4058
+ (c) => !isLocallyDefinedWithoutImport(baseIdentifier(c))
4059
+ );
4060
+ return (await Promise.all(
4061
+ filteredComponents.map(async (c) => {
4062
+ let component = {
4063
+ ...resolveComponentImport(c, localToImport),
4064
+ jsxDepth: componentDepth.get(c)
4065
+ }, path3, isPackage = !1;
4066
+ try {
4067
+ component.importId && storyFilePath && (path3 = cachedResolveImport(matchPath(component.importId, dirname(storyFilePath)), {
4068
+ basedir: dirname(storyFilePath)
4069
+ }));
4070
+ } catch (e) {
4071
+ logger3.debug(e);
4072
+ }
4073
+ try {
4074
+ component.importId && !component.importId.startsWith(".") && storyFilePath && (cachedResolveImport(component.importId, { basedir: dirname(storyFilePath) }), isPackage = !0);
4075
+ } catch {
4076
+ }
4077
+ return { ...component, isPackage, ...path3 ? { path: path3 } : {} };
4078
+ })
4079
+ )).sort((a, b) => a.componentName.localeCompare(b.componentName));
4080
+ };
4081
+
4082
+ // src/react/componentManifest/subcomponents.ts
4083
+ function findExactComponentMatch(components, componentName) {
4084
+ if (componentName)
4085
+ return components.find((component) => component.componentName === componentName);
4086
+ }
4087
+
4088
+ // src/react/componentManifest/resolveComponents.ts
4089
+ function findMatchingComponent(components, componentName, title) {
4090
+ let exactMatch = findExactComponentMatch(components, componentName);
4091
+ if (exactMatch)
4092
+ return exactMatch;
4093
+ let trimmedTitle = title.replace(/\s+/g, ""), matches = components.filter(
4094
+ (it) => trimmedTitle.includes(it.componentName) || it.localImportName && trimmedTitle.includes(it.localImportName) || it.importName && trimmedTitle.includes(it.importName)
4095
+ );
4096
+ if (matches.length <= 1)
4097
+ return matches[0];
4098
+ let best = matches[0];
4099
+ for (let cur of matches) {
4100
+ if (cur.jsxDepth === 0)
4101
+ return cur;
4102
+ (cur.jsxDepth ?? 1 / 0) < (best.jsxDepth ?? 1 / 0) && (best = cur);
4103
+ }
4104
+ return best;
4105
+ }
4106
+ async function resolveStoryFileComponents(options) {
4107
+ let { storyPath, title } = options, storyFile = cachedReadTextFileSync(storyPath), csf = loadCsf(storyFile, { makeTitle: () => title }).parse(), componentName = csf._meta?.component, declaredSubcomponents = extractDeclaredSubcomponents(csf), allComponents = await getComponents({
4108
+ additionalComponentNames: declaredSubcomponents.map(
4109
+ (subcomponent) => subcomponent.componentName
4110
+ ),
4111
+ csf,
4112
+ storyFilePath: storyPath
4113
+ }), component = findMatchingComponent(allComponents, componentName, title), subcomponents = declaredSubcomponents.map((declared) => ({
4114
+ name: declared.name,
4115
+ component: findExactComponentMatch(allComponents, declared.componentName)
4116
+ }));
4117
+ return { storyPath, storyFile, csf, componentName, allComponents, component, subcomponents };
4118
+ }
4119
+ function extractStorySnippets(csf, componentName, filterStoryIds, references) {
4120
+ let imports = [], resolver = createStoryArgsResolver2(csf, references);
4121
+ return { stories: Object.entries(csf._stories).filter(([, story]) => !filterStoryIds || filterStoryIds.has(story.id)).map(([storyExport, story]) => {
4122
+ let name = story.name ?? storyNameFromExport(storyExport);
4123
+ try {
4124
+ let { description, summary } = extractStoryJSDocInfo(csf._storyStatements[storyExport]), snippet = getCodeSnippet(csf, storyExport, componentName, resolver);
4125
+ imports.push(...snippet.imports);
4126
+ let warning = unresolvedWarning(snippet.unresolved);
4127
+ return {
4128
+ id: story.id,
4129
+ name,
4130
+ snippet: recast.print(snippet.node).code,
4131
+ description,
4132
+ summary,
4133
+ ...warning ? { warning } : {}
4134
+ };
4135
+ } catch (e) {
4136
+ let err = e instanceof Error ? e : new Error(String(e));
4137
+ return { id: story.id, name, error: { name: err.name, message: err.message } };
4138
+ }
4139
+ }), imports };
4140
+ }
4141
+
4142
+ // src/react/componentManifest/buildReactComponentDocgen.ts
4143
+ var openStoryReferences = createStoryReferenceResolver();
4144
+ function getPackageInfo(componentPath, fallbackPath) {
4145
+ let nearestPkg = cachedFindUp("package.json", {
4146
+ cwd: path.dirname(componentPath ?? fallbackPath)
4147
+ });
4148
+ try {
4149
+ if (!nearestPkg)
4150
+ return;
4151
+ let parsed = JSON.parse(cachedReadTextFileSync(nearestPkg));
4152
+ return typeof parsed == "object" && parsed && "name" in parsed && typeof parsed.name == "string" ? parsed.name : void 0;
4153
+ } catch {
4154
+ return;
4155
+ }
4156
+ }
4157
+ function getFallbackImport(packageName, componentName) {
4158
+ let exportName = componentName?.split(".").at(-1);
4159
+ return packageName && exportName ? buildImportStatements2({
4160
+ refs: [{ importId: packageName, importName: exportName, localImportName: exportName }]
4161
+ }).join(`
4162
+ `) : "";
4163
+ }
4164
+ function relativizeComponentMetaPaths(doc) {
4165
+ let relativize = (fileName) => path.relative(process.cwd(), fileName), relativizeProp = (prop) => ({
4166
+ ...prop,
4167
+ parent: prop.parent ? { ...prop.parent, fileName: relativize(prop.parent.fileName) } : prop.parent
4168
+ });
4169
+ return {
4170
+ ...doc,
4171
+ props: Object.fromEntries(
4172
+ Object.entries(doc.props).map(([name, prop]) => [name, relativizeProp(prop)])
4173
+ )
4174
+ };
4175
+ }
4176
+ function getComponentDocgenData(component) {
4177
+ let reactComponentMeta = component?.reactComponentMeta ? relativizeComponentMetaPaths(component.reactComponentMeta) : void 0;
4178
+ return {
4179
+ reactComponentMeta,
4180
+ docgenDescription: reactComponentMeta?.description,
4181
+ docgenJsDocTags: component?.componentJsDocTags
4182
+ };
4183
+ }
4184
+ function createSubcomponentDocgen({
4185
+ component,
4186
+ declaredName,
4187
+ packageName,
4188
+ storyFilePath
4189
+ }) {
4190
+ let imports = buildImportStatements2({ refs: component ? [component] : [], packageName }).join(`
4191
+ `).trim() || getFallbackImport(packageName, component?.componentName), { reactComponentMeta, docgenDescription, docgenJsDocTags } = getComponentDocgenData(component), { description, summary, jsDocTags } = extractComponentDescription(
4192
+ void 0,
4193
+ docgenDescription,
4194
+ docgenJsDocTags
4195
+ );
4196
+ return {
4197
+ name: declaredName,
4198
+ path: component?.path ?? storyFilePath,
4199
+ description,
4200
+ summary,
4201
+ import: imports || void 0,
4202
+ jsDocTags,
4203
+ reactComponentMeta,
4204
+ error: component ? void 0 : {
4205
+ name: "No component import found",
4206
+ message: `No component file found for the "${declaredName}" subcomponent.`
4207
+ }
4208
+ };
4209
+ }
4210
+ function buildStoryDocsFromResolved({
4211
+ entry,
4212
+ storyPath,
4213
+ storyFilePath,
4214
+ csf,
4215
+ componentName,
4216
+ component,
4217
+ allComponents,
4218
+ filterStoryIds
4219
+ }) {
4220
+ let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getPackageInfo(component?.path, storyPath), fallbackImport = getFallbackImport(packageName, componentName), storyEntries = extractStorySnippets(
4221
+ csf,
4222
+ component?.componentName ?? componentName,
4223
+ filterStoryIds,
4224
+ {
4225
+ filePath: storyPath,
4226
+ ...openStoryReferences()
4227
+ }
4228
+ ), argRefs = storyEntries.imports.map((ref) => ({ ...ref, isPackage: !0 })), imports = buildImportStatements2({ refs: [...allComponents, ...argRefs], packageName }).join(`
4229
+ `).trim() || fallbackImport;
4230
+ return {
4231
+ id,
4232
+ name: componentName ?? title,
4233
+ path: storyFilePath,
4234
+ ...imports ? { import: imports } : {},
4235
+ stories: Object.fromEntries(storyEntries.stories.map((story) => [story.id, story]))
4236
+ };
4237
+ }
4238
+ function buildComponentDocgenFromResolved({
4239
+ entry,
4240
+ storyPath,
4241
+ storyFilePath,
4242
+ storyFile,
4243
+ csf,
4244
+ componentName,
4245
+ component,
4246
+ subcomponents
4247
+ }) {
4248
+ let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getPackageInfo(component?.path, storyPath), base2 = {
4249
+ id,
4250
+ name: componentName ?? title,
4251
+ path: storyFilePath,
4252
+ jsDocTags: {}
4253
+ }, { reactComponentMeta, docgenDescription, docgenJsDocTags } = getComponentDocgenData(component);
4254
+ if (!reactComponentMeta) {
4255
+ let error = csf._meta?.component ? {
4256
+ name: "No component import found",
4257
+ message: `No component file found for the "${csf.meta.component}" component.`
4258
+ } : {
4259
+ name: "No component found",
4260
+ message: "We could not detect the component from your story file. Specify meta.component."
4261
+ };
4262
+ return {
4263
+ ...base2,
4264
+ jsDocTags: base2.jsDocTags ?? {},
4265
+ error: {
4266
+ name: error.name,
4267
+ message: (csf._metaStatementPath?.buildCodeFrameError(error.message).message ?? error.message) + `
4268
+
4269
+ ${entry.importPath}:
4270
+ ${storyFile}`
4271
+ }
4272
+ };
4273
+ }
4274
+ let metaJsDoc = extractDescription(csf._metaStatement) || void 0, { description, summary, jsDocTags } = extractComponentDescription(
4275
+ metaJsDoc,
4276
+ docgenDescription,
4277
+ docgenJsDocTags
4278
+ ), subcomponentEntries = Object.fromEntries(
4279
+ subcomponents.map((subcomponent) => [
4280
+ subcomponent.name,
4281
+ createSubcomponentDocgen({
4282
+ component: subcomponent.component,
4283
+ declaredName: subcomponent.name,
4284
+ packageName,
4285
+ storyFilePath
4286
+ })
4287
+ ])
4288
+ );
4289
+ return {
4290
+ ...base2,
4291
+ description,
4292
+ summary,
4293
+ reactComponentMeta,
4294
+ jsDocTags,
4295
+ ...Object.keys(subcomponentEntries).length > 0 ? { subcomponents: subcomponentEntries } : {}
4296
+ };
4297
+ }
4298
+ function buildReactComponentDocgenFromResolved({
4299
+ entry,
4300
+ storyPath,
4301
+ storyFilePath,
4302
+ storyFile,
4303
+ csf,
4304
+ componentName,
4305
+ component,
4306
+ allComponents,
4307
+ subcomponents,
4308
+ filterStoryIds
4309
+ }) {
4310
+ let storyDocs = buildStoryDocsFromResolved({
4311
+ entry,
4312
+ storyPath,
4313
+ storyFilePath,
4314
+ csf,
4315
+ componentName,
4316
+ component,
4317
+ allComponents,
4318
+ filterStoryIds
4319
+ });
4320
+ return {
4321
+ ...buildComponentDocgenFromResolved({
4322
+ entry,
4323
+ storyPath,
4324
+ storyFilePath,
4325
+ storyFile,
4326
+ csf,
4327
+ componentName,
4328
+ component,
4329
+ subcomponents
4330
+ }),
4331
+ // Legacy inline manifests keep CSF-ordered arrays; story-docs open-service payloads use Records.
4332
+ stories: Object.values(storyDocs.stories),
4333
+ ...storyDocs.import ? { import: storyDocs.import } : {}
4334
+ };
4335
+ }
4336
+
4337
+ // src/react/extractArgTypes.ts
4338
+ import { createSummaryValue as createSummaryValue4, extractComponentProps } from "@aussieljk/forkbook/internal/docs-tools";
4339
+
4340
+ // src/react/docs/lib/defaultValues/createDefaultValue.ts
4341
+ import {
4342
+ createSummaryValue as createSummaryValue3,
4343
+ isTooLongForDefaultValueSummary as isTooLongForDefaultValueSummary3
4344
+ } from "@aussieljk/forkbook/internal/docs-tools";
4345
+
4346
+ // src/react/docs/lib/captions.ts
4347
+ var OBJECT_CAPTION = "object", ARRAY_CAPTION = "array", FUNCTION_CAPTION = "func", ELEMENT_CAPTION = "element";
4348
+
4349
+ // src/react/docs/lib/generateCode.ts
4350
+ var import_escodegen = __toESM(require_escodegen(), 1);
4351
+ import { dedent } from "ts-dedent";
4352
+ var BASIC_OPTIONS = {
4353
+ format: {
4354
+ indent: {
4355
+ style: " "
4356
+ },
4357
+ semicolons: !1
4358
+ }
4359
+ }, COMPACT_OPTIONS = {
4360
+ ...BASIC_OPTIONS,
4361
+ format: {
4362
+ newline: ""
4363
+ }
4364
+ }, PRETTY_OPTIONS = {
4365
+ ...BASIC_OPTIONS
4366
+ };
4367
+ function generateCode(ast, compact = !1) {
4368
+ return (0, import_escodegen.generate)(ast, compact ? COMPACT_OPTIONS : PRETTY_OPTIONS);
4369
+ }
4370
+ function generateObjectCode(ast, compact = !1) {
4371
+ return compact ? generateCompactObjectCode(ast) : generateCode(ast);
4372
+ }
4373
+ function generateCompactObjectCode(ast) {
4374
+ let result = generateCode(ast, !0);
4375
+ return result.endsWith(" }") || (result = `${result.slice(0, -1)} }`), result;
4376
+ }
4377
+ function generateArrayCode(ast, compact = !1) {
4378
+ return compact ? generateCompactArrayCode(ast) : generateMultilineArrayCode(ast);
4379
+ }
4380
+ function generateMultilineArrayCode(ast) {
4381
+ let result = generateCode(ast);
4382
+ return result.endsWith(" }]") && (result = dedent(result)), result;
4383
+ }
4384
+ function generateCompactArrayCode(ast) {
4385
+ let result = generateCode(ast, !0);
4386
+ return result.startsWith("[ ") && (result = result.replace("[ ", "[")), result;
4387
+ }
4388
+
4389
+ // src/react/docs/lib/inspection/acornParser.ts
4390
+ init_acorn();
4391
+ var import_acorn_jsx = __toESM(require_acorn_jsx(), 1), acornWalk = __toESM(require_walk(), 1);
4392
+ var ACORN_WALK_VISITORS = {
4393
+ // @ts-expect-error (Converted from ts-ignore)
4394
+ ...acornWalk.base,
4395
+ JSXElement: () => {
4396
+ }
4397
+ }, acornParser = Parser.extend((0, import_acorn_jsx.default)());
4398
+ function extractIdentifierName(identifierNode) {
4399
+ return identifierNode != null ? identifierNode.name : null;
4400
+ }
4401
+ function filterAncestors(ancestors) {
4402
+ return ancestors.filter((x) => x.type === "ObjectExpression" || x.type === "ArrayExpression");
4403
+ }
4404
+ function calculateNodeDepth(node) {
4405
+ let depths = [];
4406
+ return acornWalk.ancestor(
4407
+ // @ts-expect-error (Converted from ts-ignore)
4408
+ node,
4409
+ {
4410
+ ObjectExpression(_, ancestors) {
4411
+ depths.push(filterAncestors(ancestors).length);
4412
+ },
4413
+ ArrayExpression(_, ancestors) {
4414
+ depths.push(filterAncestors(ancestors).length);
4415
+ }
4416
+ },
4417
+ ACORN_WALK_VISITORS
4418
+ ), Math.max(...depths);
4419
+ }
4420
+ function parseIdentifier(identifierNode) {
4421
+ return {
4422
+ inferredType: {
4423
+ type: "Identifier" /* IDENTIFIER */,
4424
+ identifier: extractIdentifierName(identifierNode)
4425
+ },
4426
+ ast: identifierNode
4427
+ };
4428
+ }
4429
+ function parseLiteral(literalNode) {
4430
+ return {
4431
+ inferredType: { type: "Literal" /* LITERAL */ },
4432
+ ast: literalNode
4433
+ };
4434
+ }
4435
+ function parseFunction(funcNode) {
4436
+ let innerJsxElementNode;
4437
+ acornWalk.simple(
4438
+ // @ts-expect-error (Converted from ts-ignore)
4439
+ funcNode.body,
4440
+ {
4441
+ JSXElement(node) {
4442
+ innerJsxElementNode = node;
4443
+ }
4444
+ },
4445
+ ACORN_WALK_VISITORS
4446
+ );
4447
+ let inferredType = {
4448
+ type: innerJsxElementNode != null ? "Element" /* ELEMENT */ : "Function" /* FUNCTION */,
4449
+ params: funcNode.params,
4450
+ hasParams: funcNode.params.length !== 0
4451
+ }, identifierName = extractIdentifierName(funcNode.id);
4452
+ return identifierName != null && (inferredType.identifier = identifierName), {
4453
+ inferredType,
4454
+ ast: funcNode
4455
+ };
4456
+ }
4457
+ function parseClass(classNode) {
4458
+ let innerJsxElementNode;
4459
+ return acornWalk.simple(
4460
+ // @ts-expect-error (Converted from ts-ignore)
4461
+ classNode.body,
4462
+ {
4463
+ JSXElement(node) {
4464
+ innerJsxElementNode = node;
4465
+ }
4466
+ },
4467
+ ACORN_WALK_VISITORS
4468
+ ), {
4469
+ inferredType: {
4470
+ type: innerJsxElementNode != null ? "Element" /* ELEMENT */ : "Class" /* CLASS */,
4471
+ identifier: extractIdentifierName(classNode.id)
4472
+ },
4473
+ ast: classNode
4474
+ };
4475
+ }
4476
+ function parseJsxElement(jsxElementNode) {
4477
+ let inferredType = {
4478
+ type: "Element" /* ELEMENT */
4479
+ }, identifierName = extractIdentifierName(jsxElementNode.openingElement.name);
4480
+ return identifierName != null && (inferredType.identifier = identifierName), {
4481
+ inferredType,
4482
+ ast: jsxElementNode
4483
+ };
4484
+ }
4485
+ function parseCall(callNode) {
4486
+ let identifierNode = callNode.callee.type === "MemberExpression" ? callNode.callee.property : callNode.callee;
4487
+ return extractIdentifierName(identifierNode) === "shape" ? parseObject(callNode.arguments[0]) : null;
4488
+ }
4489
+ function parseObject(objectNode) {
4490
+ return {
4491
+ inferredType: { type: "Object" /* OBJECT */, depth: calculateNodeDepth(objectNode) },
4492
+ ast: objectNode
4493
+ };
4494
+ }
4495
+ function parseArray(arrayNode) {
4496
+ return {
4497
+ inferredType: { type: "Array" /* ARRAY */, depth: calculateNodeDepth(arrayNode) },
4498
+ ast: arrayNode
4499
+ };
4500
+ }
4501
+ function parseExpression(expression) {
4502
+ switch (expression.type) {
4503
+ case "Identifier":
4504
+ return parseIdentifier(expression);
4505
+ case "Literal":
4506
+ return parseLiteral(expression);
4507
+ case "FunctionExpression":
4508
+ case "ArrowFunctionExpression":
4509
+ return parseFunction(expression);
4510
+ case "ClassExpression":
4511
+ return parseClass(expression);
4512
+ case "JSXElement":
4513
+ return parseJsxElement(expression);
4514
+ case "CallExpression":
4515
+ return parseCall(expression);
4516
+ case "ObjectExpression":
4517
+ return parseObject(expression);
4518
+ case "ArrayExpression":
4519
+ return parseArray(expression);
4520
+ default:
4521
+ return null;
4522
+ }
4523
+ }
4524
+ function parse(value) {
4525
+ let ast = acornParser.parse(`(${value})`, { ecmaVersion: 2020 }), parsingResult = {
4526
+ inferredType: { type: "Unknown" /* UNKNOWN */ },
4527
+ ast
4528
+ };
4529
+ if (ast.body[0] != null) {
4530
+ let rootNode = ast.body[0];
4531
+ if (rootNode.type === "ExpressionStatement") {
4532
+ let expressionResult = parseExpression(rootNode.expression);
4533
+ expressionResult != null && (parsingResult = expressionResult);
4534
+ }
4535
+ }
4536
+ return parsingResult;
4537
+ }
4538
+
4539
+ // src/react/docs/lib/inspection/inspectValue.ts
4540
+ function inspectValue(value) {
4541
+ try {
4542
+ return { ...parse(value) };
4543
+ } catch {
4544
+ }
4545
+ return { inferredType: { type: "Unknown" /* UNKNOWN */ } };
4546
+ }
4547
+
4548
+ // src/react/docs/lib/isHtmlTag.ts
4549
+ var import_html_tags = __toESM(require_html_tags2(), 1);
4550
+ function isHtmlTag(tagName) {
4551
+ return import_html_tags.default.includes(tagName.toLowerCase());
4552
+ }
4553
+
4554
+ // src/react/docs/lib/defaultValues/generateArray.ts
4555
+ import {
4556
+ createSummaryValue,
4557
+ isTooLongForDefaultValueSummary
4558
+ } from "@aussieljk/forkbook/internal/docs-tools";
4559
+ function generateArray({ inferredType, ast }) {
4560
+ let { depth } = inferredType;
4561
+ if (depth <= 2) {
4562
+ let compactArray = generateArrayCode(ast, !0);
4563
+ if (!isTooLongForDefaultValueSummary(compactArray))
4564
+ return createSummaryValue(compactArray);
4565
+ }
4566
+ return createSummaryValue(ARRAY_CAPTION, generateArrayCode(ast));
4567
+ }
4568
+
4569
+ // src/react/docs/lib/defaultValues/generateObject.ts
4570
+ import {
4571
+ createSummaryValue as createSummaryValue2,
4572
+ isTooLongForDefaultValueSummary as isTooLongForDefaultValueSummary2
4573
+ } from "@aussieljk/forkbook/internal/docs-tools";
4574
+ function generateObject({ inferredType, ast }) {
4575
+ let { depth } = inferredType;
4576
+ if (depth === 1) {
4577
+ let compactObject = generateObjectCode(ast, !0);
4578
+ if (!isTooLongForDefaultValueSummary2(compactObject))
4579
+ return createSummaryValue2(compactObject);
4580
+ }
4581
+ return createSummaryValue2(OBJECT_CAPTION, generateObjectCode(ast));
4582
+ }
4583
+
4584
+ // src/react/docs/lib/defaultValues/prettyIdentifier.ts
4585
+ function getPrettyFuncIdentifier(identifier, hasArguments) {
4586
+ return hasArguments ? `${identifier}( ... )` : `${identifier}()`;
4587
+ }
4588
+ function getPrettyElementIdentifier(identifier) {
4589
+ return `<${identifier} />`;
4590
+ }
4591
+ function getPrettyIdentifier(inferredType) {
4592
+ let { type, identifier } = inferredType;
4593
+ switch (type) {
4594
+ case "Function" /* FUNCTION */:
4595
+ return getPrettyFuncIdentifier(identifier, inferredType.hasParams);
4596
+ case "Element" /* ELEMENT */:
4597
+ return getPrettyElementIdentifier(identifier);
4598
+ default:
4599
+ return identifier;
4600
+ }
4601
+ }
4602
+
4603
+ // src/react/docs/lib/defaultValues/createDefaultValue.ts
4604
+ function generateFunc({ inferredType, ast }) {
4605
+ let { identifier } = inferredType;
4606
+ if (identifier != null)
4607
+ return createSummaryValue3(
4608
+ getPrettyIdentifier(inferredType),
4609
+ generateCode(ast)
4610
+ );
4611
+ let prettyCaption = generateCode(ast, !0);
4612
+ return isTooLongForDefaultValueSummary3(prettyCaption) ? createSummaryValue3(FUNCTION_CAPTION, generateCode(ast)) : createSummaryValue3(prettyCaption);
4613
+ }
4614
+ function generateElement(defaultValue, inspectionResult) {
4615
+ let { inferredType } = inspectionResult, { identifier } = inferredType;
4616
+ if (identifier != null && !isHtmlTag(identifier)) {
4617
+ let prettyIdentifier = getPrettyIdentifier(
4618
+ inferredType
4619
+ );
4620
+ return createSummaryValue3(prettyIdentifier, defaultValue);
4621
+ }
4622
+ return isTooLongForDefaultValueSummary3(defaultValue) ? createSummaryValue3(ELEMENT_CAPTION, defaultValue) : createSummaryValue3(defaultValue);
4623
+ }
4624
+ function createDefaultValue(defaultValue) {
4625
+ try {
4626
+ let inspectionResult = inspectValue(defaultValue);
4627
+ switch (inspectionResult.inferredType.type) {
4628
+ case "Object" /* OBJECT */:
4629
+ return generateObject(inspectionResult);
4630
+ case "Function" /* FUNCTION */:
4631
+ return generateFunc(inspectionResult);
4632
+ case "Element" /* ELEMENT */:
4633
+ return generateElement(defaultValue, inspectionResult);
4634
+ case "Array" /* ARRAY */:
4635
+ return generateArray(inspectionResult);
4636
+ default:
4637
+ return null;
4638
+ }
4639
+ } catch (e) {
4640
+ console.error(e);
4641
+ }
4642
+ return null;
4643
+ }
4644
+
4645
+ // src/react/extractArgTypes.ts
4646
+ function enhanceProp({ propDef, docgenInfo }) {
4647
+ let { type, defaultValue } = docgenInfo;
4648
+ return type.name === "enum" && Array.isArray(type.value) && (propDef.type = createSummaryValue4(
4649
+ type.value.map(({ value }) => value).join(" | ")
4650
+ )), defaultValue?.value != null && (propDef.defaultValue = createDefaultValue(defaultValue.value) ?? propDef.defaultValue), propDef;
4651
+ }
4652
+ var extractArgTypes = (component) => {
4653
+ if (!component)
4654
+ return null;
4655
+ let rows = extractComponentProps(component, "props").map(enhanceProp);
4656
+ return Object.fromEntries(
4657
+ rows.map(({ name, description, type, sbType, defaultValue, jsDocTags, required }) => [
4658
+ name,
4659
+ {
4660
+ name,
4661
+ description,
4662
+ type: { required, ...sbType },
4663
+ table: {
4664
+ type: type ?? void 0,
4665
+ jsDocTags,
4666
+ defaultValue: defaultValue ?? void 0
4667
+ }
4668
+ }
4669
+ ])
4670
+ );
4671
+ };
4672
+
4673
+ // src/react/docgen/buildDocgen.ts
4674
+ var REACT_ATTRIBUTE_INTERFACES = /* @__PURE__ */ new Set(["Attributes", "RefAttributes", "ClassAttributes"]);
4675
+ function isReactAttribute(prop) {
4676
+ return !!prop.parent && REACT_ATTRIBUTE_INTERFACES.has(prop.parent.name) && /(^|[\\/])node_modules[\\/]/.test(prop.parent.fileName);
4677
+ }
4678
+ function extractArgTypesFromComponentMeta(componentMeta) {
4679
+ if (!componentMeta)
4680
+ return;
4681
+ let props = Object.fromEntries(
4682
+ Object.entries(componentMeta.props).filter(([, prop]) => !isReactAttribute(prop))
4683
+ );
4684
+ return extractArgTypes({ __docgenInfo: { ...componentMeta, props } }) ?? void 0;
4685
+ }
4686
+ function addArgTypesFromComponentMeta(payload) {
4687
+ let argTypes = extractArgTypesFromComponentMeta(payload.reactComponentMeta), subcomponents = payload.subcomponents ? Object.fromEntries(
4688
+ Object.entries(payload.subcomponents).map(([name, subcomponent]) => [
4689
+ name,
4690
+ {
4691
+ ...subcomponent,
4692
+ argTypes: extractArgTypesFromComponentMeta(subcomponent.reactComponentMeta)
4693
+ }
4694
+ ])
4695
+ ) : void 0;
4696
+ return {
4697
+ ...payload,
4698
+ ...argTypes ? { argTypes } : {},
4699
+ ...subcomponents ? { subcomponents } : {}
4700
+ };
4701
+ }
4702
+ async function buildDocgenPayload(input, context) {
4703
+ let storyFilePath = getStoryImportPathFromEntry(input.entry);
4704
+ if (!storyFilePath)
4705
+ return;
4706
+ let storyPath = (context.resolvePath ?? ((importPath) => path2.join(process.cwd(), importPath)))(storyFilePath), resolved;
4707
+ try {
4708
+ resolved = await resolveStoryFileComponents({
4709
+ storyPath,
4710
+ title: input.entry.title
4711
+ });
4712
+ } catch {
4713
+ return;
4714
+ }
4715
+ let { csf, componentName, component, subcomponents, storyFile } = resolved, usableSubcomponents = subcomponents.filter(
4716
+ (sub) => sub.component !== void 0
4717
+ ), storyRefs = [
4718
+ ...component ? [{ storyPath, component }] : [],
4719
+ ...usableSubcomponents.map((sub) => ({ storyPath, component: sub.component }))
4720
+ ];
4721
+ storyRefs.length > 0 && context.componentMetaManager.batchExtract(storyRefs);
4722
+ let componentDocgen = buildComponentDocgenFromResolved({
4723
+ entry: input.entry,
4724
+ storyPath,
4725
+ storyFilePath,
4726
+ storyFile,
4727
+ csf,
4728
+ componentName,
4729
+ component,
4730
+ subcomponents
4731
+ });
4732
+ return addArgTypesFromComponentMeta(componentDocgen);
4733
+ }
4734
+
4735
+ export {
4736
+ ComponentMetaManager,
4737
+ invalidateCache,
4738
+ getCodeSnippet,
4739
+ resolveStoryFileComponents,
4740
+ buildStoryDocsFromResolved,
4741
+ buildReactComponentDocgenFromResolved,
4742
+ extractArgTypesFromComponentMeta,
4743
+ buildDocgenPayload
4744
+ };