@hyperfrontend/builder 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/FUNDING.md +141 -0
  3. package/LICENSE.md +21 -0
  4. package/README.md +162 -0
  5. package/SECURITY.md +82 -0
  6. package/THIRD_PARTY_LICENSES.md +13 -0
  7. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.cjs.js +7 -0
  8. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.esm.js +5 -0
  9. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/console/index.cjs.js +13 -0
  10. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/console/index.esm.js +8 -0
  11. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/date/index.cjs.js +5 -0
  12. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/date/index.esm.js +4 -0
  13. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/encoding/index.cjs.js +1 -0
  14. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/encoding/index.esm.js +1 -0
  15. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.cjs.js +6 -0
  16. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.esm.js +5 -0
  17. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/function/index.cjs.js +1 -0
  18. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/function/index.esm.js +1 -0
  19. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.cjs.js +7 -0
  20. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.esm.js +5 -0
  21. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/map/index.cjs.js +6 -0
  22. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/map/index.esm.js +5 -0
  23. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/math/index.cjs.js +7 -0
  24. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/math/index.esm.js +5 -0
  25. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/messaging/index.cjs.js +1 -0
  26. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/messaging/index.esm.js +1 -0
  27. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/number/index.cjs.js +1 -0
  28. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/number/index.esm.js +1 -0
  29. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.cjs.js +13 -0
  30. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.esm.js +8 -0
  31. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/promise/index.cjs.js +6 -0
  32. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/promise/index.esm.js +5 -0
  33. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/reflect/index.cjs.js +1 -0
  34. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/reflect/index.esm.js +1 -0
  35. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/regexp/index.cjs.js +6 -0
  36. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/regexp/index.esm.js +5 -0
  37. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.cjs.js +6 -0
  38. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.esm.js +5 -0
  39. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/string/index.cjs.js +1 -0
  40. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/string/index.esm.js +1 -0
  41. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/symbol/index.cjs.js +1 -0
  42. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/symbol/index.esm.js +1 -0
  43. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/timers/index.cjs.js +13 -0
  44. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/timers/index.esm.js +10 -0
  45. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays/index.cjs.js +1 -0
  46. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/typed-arrays/index.esm.js +1 -0
  47. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/url/index.cjs.js +6 -0
  48. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/url/index.esm.js +5 -0
  49. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/weak-map/index.cjs.js +1 -0
  50. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/weak-map/index.esm.js +1 -0
  51. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/weak-set/index.cjs.js +1 -0
  52. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/weak-set/index.esm.js +1 -0
  53. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/websocket/index.cjs.js +1 -0
  54. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/websocket/index.esm.js +1 -0
  55. package/_dependencies/@hyperfrontend/immutable-api-utils/index.cjs.js +1 -0
  56. package/_dependencies/@hyperfrontend/immutable-api-utils/index.esm.js +1 -0
  57. package/_dependencies/@hyperfrontend/immutable-api-utils/locked/index.cjs.js +1 -0
  58. package/_dependencies/@hyperfrontend/immutable-api-utils/locked/index.esm.js +1 -0
  59. package/_dependencies/@hyperfrontend/immutable-api-utils/locked-prop-descriptors/index.cjs.js +1 -0
  60. package/_dependencies/@hyperfrontend/immutable-api-utils/locked-prop-descriptors/index.esm.js +1 -0
  61. package/_dependencies/@hyperfrontend/immutable-api-utils/locked-props/index.cjs.js +1 -0
  62. package/_dependencies/@hyperfrontend/immutable-api-utils/locked-props/index.esm.js +1 -0
  63. package/_dependencies/@hyperfrontend/logging/index.cjs.js +191 -0
  64. package/_dependencies/@hyperfrontend/logging/index.esm.js +186 -0
  65. package/_dependencies/@hyperfrontend/project-scope/cli/index.cjs.js +196 -0
  66. package/_dependencies/@hyperfrontend/project-scope/cli/index.esm.js +196 -0
  67. package/_dependencies/@hyperfrontend/project-scope/core/encoding/index.cjs.js +82 -0
  68. package/_dependencies/@hyperfrontend/project-scope/core/encoding/index.esm.js +82 -0
  69. package/_dependencies/@hyperfrontend/project-scope/core/fs/index.cjs.js +154 -0
  70. package/_dependencies/@hyperfrontend/project-scope/core/fs/index.esm.js +149 -0
  71. package/_dependencies/@hyperfrontend/project-scope/core/index.cjs.js +459 -0
  72. package/_dependencies/@hyperfrontend/project-scope/core/index.esm.js +440 -0
  73. package/_dependencies/@hyperfrontend/project-scope/core/logger/index.cjs.js +84 -0
  74. package/_dependencies/@hyperfrontend/project-scope/core/logger/index.esm.js +80 -0
  75. package/_dependencies/@hyperfrontend/project-scope/core/path/index.cjs.js +26 -0
  76. package/_dependencies/@hyperfrontend/project-scope/core/path/index.esm.js +22 -0
  77. package/_dependencies/@hyperfrontend/project-scope/core/platform/index.cjs.js +1 -0
  78. package/_dependencies/@hyperfrontend/project-scope/core/platform/index.esm.js +1 -0
  79. package/_dependencies/@hyperfrontend/project-scope/heuristics/dependencies/index.cjs.js +90 -0
  80. package/_dependencies/@hyperfrontend/project-scope/heuristics/dependencies/index.esm.js +90 -0
  81. package/_dependencies/@hyperfrontend/project-scope/heuristics/entry-points/index.cjs.js +174 -0
  82. package/_dependencies/@hyperfrontend/project-scope/heuristics/entry-points/index.esm.js +174 -0
  83. package/_dependencies/@hyperfrontend/project-scope/heuristics/framework/index.cjs.js +174 -0
  84. package/_dependencies/@hyperfrontend/project-scope/heuristics/framework/index.esm.js +172 -0
  85. package/_dependencies/@hyperfrontend/project-scope/heuristics/index.cjs.js +184 -0
  86. package/_dependencies/@hyperfrontend/project-scope/heuristics/index.esm.js +184 -0
  87. package/_dependencies/@hyperfrontend/project-scope/heuristics/project-type/index.cjs.js +172 -0
  88. package/_dependencies/@hyperfrontend/project-scope/heuristics/project-type/index.esm.js +172 -0
  89. package/_dependencies/@hyperfrontend/project-scope/index.cjs.js +222 -0
  90. package/_dependencies/@hyperfrontend/project-scope/index.esm.js +219 -0
  91. package/_dependencies/@hyperfrontend/project-scope/models/index.cjs.js +2 -0
  92. package/_dependencies/@hyperfrontend/project-scope/models/index.esm.js +1 -0
  93. package/_dependencies/@hyperfrontend/project-scope/nx/index.cjs.js +94 -0
  94. package/_dependencies/@hyperfrontend/project-scope/nx/index.esm.js +94 -0
  95. package/_dependencies/@hyperfrontend/project-scope/project/config/index.cjs.js +172 -0
  96. package/_dependencies/@hyperfrontend/project-scope/project/config/index.esm.js +172 -0
  97. package/_dependencies/@hyperfrontend/project-scope/project/index.cjs.js +176 -0
  98. package/_dependencies/@hyperfrontend/project-scope/project/index.esm.js +176 -0
  99. package/_dependencies/@hyperfrontend/project-scope/project/package/index.cjs.js +88 -0
  100. package/_dependencies/@hyperfrontend/project-scope/project/package/index.esm.js +88 -0
  101. package/_dependencies/@hyperfrontend/project-scope/project/root/index.cjs.js +154 -0
  102. package/_dependencies/@hyperfrontend/project-scope/project/root/index.esm.js +153 -0
  103. package/_dependencies/@hyperfrontend/project-scope/project/traversal/index.cjs.js +91 -0
  104. package/_dependencies/@hyperfrontend/project-scope/project/traversal/index.esm.js +89 -0
  105. package/_dependencies/@hyperfrontend/project-scope/tech/backend/index.cjs.js +88 -0
  106. package/_dependencies/@hyperfrontend/project-scope/tech/backend/index.esm.js +88 -0
  107. package/_dependencies/@hyperfrontend/project-scope/tech/build/index.cjs.js +88 -0
  108. package/_dependencies/@hyperfrontend/project-scope/tech/build/index.esm.js +88 -0
  109. package/_dependencies/@hyperfrontend/project-scope/tech/frontend/index.cjs.js +88 -0
  110. package/_dependencies/@hyperfrontend/project-scope/tech/frontend/index.esm.js +88 -0
  111. package/_dependencies/@hyperfrontend/project-scope/tech/index.cjs.js +171 -0
  112. package/_dependencies/@hyperfrontend/project-scope/tech/index.esm.js +169 -0
  113. package/_dependencies/@hyperfrontend/project-scope/tech/legacy/index.cjs.js +88 -0
  114. package/_dependencies/@hyperfrontend/project-scope/tech/legacy/index.esm.js +88 -0
  115. package/_dependencies/@hyperfrontend/project-scope/tech/linting/index.cjs.js +88 -0
  116. package/_dependencies/@hyperfrontend/project-scope/tech/linting/index.esm.js +88 -0
  117. package/_dependencies/@hyperfrontend/project-scope/tech/monorepo/index.cjs.js +88 -0
  118. package/_dependencies/@hyperfrontend/project-scope/tech/monorepo/index.esm.js +88 -0
  119. package/_dependencies/@hyperfrontend/project-scope/tech/testing/index.cjs.js +88 -0
  120. package/_dependencies/@hyperfrontend/project-scope/tech/testing/index.esm.js +88 -0
  121. package/_dependencies/@hyperfrontend/project-scope/tech/types/index.cjs.js +88 -0
  122. package/_dependencies/@hyperfrontend/project-scope/tech/types/index.esm.js +88 -0
  123. package/_dependencies/@hyperfrontend/project-scope/vfs/index.cjs.js +102 -0
  124. package/_dependencies/@hyperfrontend/project-scope/vfs/index.esm.js +102 -0
  125. package/_dependencies/@hyperfrontend/versioning/changelog/compare/index.cjs.js +1 -0
  126. package/_dependencies/@hyperfrontend/versioning/changelog/compare/index.esm.js +1 -0
  127. package/_dependencies/@hyperfrontend/versioning/changelog/index.cjs.js +1 -0
  128. package/_dependencies/@hyperfrontend/versioning/changelog/index.esm.js +1 -0
  129. package/_dependencies/@hyperfrontend/versioning/changelog/models/index.cjs.js +1 -0
  130. package/_dependencies/@hyperfrontend/versioning/changelog/models/index.esm.js +1 -0
  131. package/_dependencies/@hyperfrontend/versioning/changelog/operations/index.cjs.js +1 -0
  132. package/_dependencies/@hyperfrontend/versioning/changelog/operations/index.esm.js +1 -0
  133. package/_dependencies/@hyperfrontend/versioning/changelog/parse/index.cjs.js +1 -0
  134. package/_dependencies/@hyperfrontend/versioning/changelog/parse/index.esm.js +1 -0
  135. package/_dependencies/@hyperfrontend/versioning/changelog/serialize/index.cjs.js +1 -0
  136. package/_dependencies/@hyperfrontend/versioning/changelog/serialize/index.esm.js +1 -0
  137. package/_dependencies/@hyperfrontend/versioning/commits/author/index.cjs.js +2403 -0
  138. package/_dependencies/@hyperfrontend/versioning/commits/author/index.esm.js +2381 -0
  139. package/_dependencies/@hyperfrontend/versioning/commits/classify/index.cjs.js +38 -0
  140. package/_dependencies/@hyperfrontend/versioning/commits/classify/index.esm.js +30 -0
  141. package/_dependencies/@hyperfrontend/versioning/commits/format/index.cjs.js +1 -0
  142. package/_dependencies/@hyperfrontend/versioning/commits/format/index.esm.js +1 -0
  143. package/_dependencies/@hyperfrontend/versioning/commits/index.cjs.js +2457 -0
  144. package/_dependencies/@hyperfrontend/versioning/commits/index.esm.js +2407 -0
  145. package/_dependencies/@hyperfrontend/versioning/commits/models/index.cjs.js +1 -0
  146. package/_dependencies/@hyperfrontend/versioning/commits/models/index.esm.js +1 -0
  147. package/_dependencies/@hyperfrontend/versioning/commits/parse/index.cjs.js +1 -0
  148. package/_dependencies/@hyperfrontend/versioning/commits/parse/index.esm.js +1 -0
  149. package/_dependencies/@hyperfrontend/versioning/commits/validate/index.cjs.js +27 -0
  150. package/_dependencies/@hyperfrontend/versioning/commits/validate/index.esm.js +25 -0
  151. package/_dependencies/@hyperfrontend/versioning/flow/executor/index.cjs.js +36 -0
  152. package/_dependencies/@hyperfrontend/versioning/flow/executor/index.esm.js +36 -0
  153. package/_dependencies/@hyperfrontend/versioning/flow/index.cjs.js +51 -0
  154. package/_dependencies/@hyperfrontend/versioning/flow/index.esm.js +51 -0
  155. package/_dependencies/@hyperfrontend/versioning/flow/models/index.cjs.js +30 -0
  156. package/_dependencies/@hyperfrontend/versioning/flow/models/index.esm.js +28 -0
  157. package/_dependencies/@hyperfrontend/versioning/flow/presets/index.cjs.js +47 -0
  158. package/_dependencies/@hyperfrontend/versioning/flow/presets/index.esm.js +45 -0
  159. package/_dependencies/@hyperfrontend/versioning/flow/steps/index.cjs.js +47 -0
  160. package/_dependencies/@hyperfrontend/versioning/flow/steps/index.esm.js +45 -0
  161. package/_dependencies/@hyperfrontend/versioning/git/index.cjs.js +8 -0
  162. package/_dependencies/@hyperfrontend/versioning/git/index.esm.js +9 -0
  163. package/_dependencies/@hyperfrontend/versioning/git/models/index.cjs.js +1 -0
  164. package/_dependencies/@hyperfrontend/versioning/git/models/index.esm.js +1 -0
  165. package/_dependencies/@hyperfrontend/versioning/git/operations/index.cjs.js +3 -0
  166. package/_dependencies/@hyperfrontend/versioning/git/operations/index.esm.js +3 -0
  167. package/_dependencies/@hyperfrontend/versioning/index.cjs.js +2481 -0
  168. package/_dependencies/@hyperfrontend/versioning/index.esm.js +2423 -0
  169. package/_dependencies/@hyperfrontend/versioning/registry/index.cjs.js +1 -0
  170. package/_dependencies/@hyperfrontend/versioning/registry/index.esm.js +1 -0
  171. package/_dependencies/@hyperfrontend/versioning/registry/models/index.cjs.js +1 -0
  172. package/_dependencies/@hyperfrontend/versioning/registry/models/index.esm.js +1 -0
  173. package/_dependencies/@hyperfrontend/versioning/registry/npm/index.cjs.js +1 -0
  174. package/_dependencies/@hyperfrontend/versioning/registry/npm/index.esm.js +1 -0
  175. package/_dependencies/@hyperfrontend/versioning/repository/index.cjs.js +18 -0
  176. package/_dependencies/@hyperfrontend/versioning/repository/index.esm.js +17 -0
  177. package/_dependencies/@hyperfrontend/versioning/repository/models/index.cjs.js +11 -0
  178. package/_dependencies/@hyperfrontend/versioning/repository/models/index.esm.js +10 -0
  179. package/_dependencies/@hyperfrontend/versioning/repository/parse/index.cjs.js +184 -0
  180. package/_dependencies/@hyperfrontend/versioning/repository/parse/index.esm.js +185 -0
  181. package/_dependencies/@hyperfrontend/versioning/repository/url/index.cjs.js +10 -0
  182. package/_dependencies/@hyperfrontend/versioning/repository/url/index.esm.js +8 -0
  183. package/_dependencies/@hyperfrontend/versioning/semver/compare/index.cjs.js +1 -0
  184. package/_dependencies/@hyperfrontend/versioning/semver/compare/index.esm.js +1 -0
  185. package/_dependencies/@hyperfrontend/versioning/semver/format/index.cjs.js +1 -0
  186. package/_dependencies/@hyperfrontend/versioning/semver/format/index.esm.js +1 -0
  187. package/_dependencies/@hyperfrontend/versioning/semver/increment/index.cjs.js +1 -0
  188. package/_dependencies/@hyperfrontend/versioning/semver/increment/index.esm.js +1 -0
  189. package/_dependencies/@hyperfrontend/versioning/semver/index.cjs.js +1 -0
  190. package/_dependencies/@hyperfrontend/versioning/semver/index.esm.js +1 -0
  191. package/_dependencies/@hyperfrontend/versioning/semver/models/index.cjs.js +1 -0
  192. package/_dependencies/@hyperfrontend/versioning/semver/models/index.esm.js +1 -0
  193. package/_dependencies/@hyperfrontend/versioning/semver/parse/index.cjs.js +1 -0
  194. package/_dependencies/@hyperfrontend/versioning/semver/parse/index.esm.js +1 -0
  195. package/_dependencies/@hyperfrontend/versioning/workspace/discovery/index.cjs.js +29 -0
  196. package/_dependencies/@hyperfrontend/versioning/workspace/discovery/index.esm.js +29 -0
  197. package/_dependencies/@hyperfrontend/versioning/workspace/index.cjs.js +29 -0
  198. package/_dependencies/@hyperfrontend/versioning/workspace/index.esm.js +29 -0
  199. package/_dependencies/@hyperfrontend/versioning/workspace/models/index.cjs.js +1 -0
  200. package/_dependencies/@hyperfrontend/versioning/workspace/models/index.esm.js +1 -0
  201. package/_dependencies/@hyperfrontend/versioning/workspace/operations/index.cjs.js +2 -0
  202. package/_dependencies/@hyperfrontend/versioning/workspace/operations/index.esm.js +2 -0
  203. package/_dependencies/@rollup/plugin-commonjs/index.cjs.js +6629 -0
  204. package/_dependencies/@rollup/plugin-commonjs/index.esm.js +6608 -0
  205. package/_dependencies/@rollup/plugin-json/index.cjs.js +2324 -0
  206. package/_dependencies/@rollup/plugin-json/index.esm.js +2322 -0
  207. package/_dependencies/@rollup/plugin-node-resolve/index.cjs.js +5430 -0
  208. package/_dependencies/@rollup/plugin-node-resolve/index.esm.js +5424 -0
  209. package/_dependencies/@rollup/plugin-terser/index.cjs.js +33220 -0
  210. package/_dependencies/@rollup/plugin-terser/index.esm.js +33217 -0
  211. package/_dependencies/@rollup/plugin-typescript/index.cjs.js +4840 -0
  212. package/_dependencies/@rollup/plugin-typescript/index.esm.js +4819 -0
  213. package/_dependencies/postject/index.cjs.js +5140 -0
  214. package/_dependencies/postject/index.esm.js +5131 -0
  215. package/_dependencies/rollup/index.cjs.js +24668 -0
  216. package/_dependencies/rollup/index.d.ts +1921 -0
  217. package/_dependencies/rollup/index.esm.js +24652 -0
  218. package/_dependencies/rollup-plugin-dts/index.cjs.js +6547 -0
  219. package/_dependencies/rollup-plugin-dts/index.esm.js +6537 -0
  220. package/_shared/bin/format/index.cjs.js +7 -0
  221. package/_shared/bin/format/index.esm.js +5 -0
  222. package/_shared/bin/native/codesign/index.cjs.js +30 -0
  223. package/_shared/bin/native/codesign/index.esm.js +26 -0
  224. package/_shared/bin/native/host-binary/index.cjs.js +13 -0
  225. package/_shared/bin/native/host-binary/index.esm.js +11 -0
  226. package/_shared/bin/native/inject/index.cjs.js +25 -0
  227. package/_shared/bin/native/inject/index.esm.js +18 -0
  228. package/_shared/bin/native/platform-check/index.cjs.js +13 -0
  229. package/_shared/bin/native/platform-check/index.esm.js +10 -0
  230. package/_shared/bin/native/sea-blob/index.cjs.js +21 -0
  231. package/_shared/bin/native/sea-blob/index.esm.js +19 -0
  232. package/_shared/bin/native/sea-config/index.cjs.js +9 -0
  233. package/_shared/bin/native/sea-config/index.esm.js +7 -0
  234. package/_shared/bin/script/bootstrap-footer/index.cjs.js +22 -0
  235. package/_shared/bin/script/bootstrap-footer/index.esm.js +19 -0
  236. package/_shared/bundle/declarations/flatten-paths/index.cjs.js +34 -0
  237. package/_shared/bundle/declarations/flatten-paths/index.esm.js +29 -0
  238. package/_shared/bundle/dependencies/collect-workspace-deps/index.cjs.js +24 -0
  239. package/_shared/bundle/dependencies/collect-workspace-deps/index.esm.js +21 -0
  240. package/_shared/bundle/dependencies/externalize-plugin/index.cjs.js +93 -0
  241. package/_shared/bundle/dependencies/externalize-plugin/index.esm.js +86 -0
  242. package/_shared/bundle/dependencies/prune/ast-utils/index.esm.js +31 -0
  243. package/_shared/bundle/dependencies/prune/namespace-usage/index.esm.js +208 -0
  244. package/_shared/bundle/dependencies/prune/specifiers/index.cjs.js +62 -0
  245. package/_shared/bundle/dependencies/prune/specifiers/index.esm.js +53 -0
  246. package/_shared/bundle/entries/discover-entries/index.cjs.js +87 -0
  247. package/_shared/bundle/entries/discover-entries/index.esm.js +80 -0
  248. package/_shared/bundle/entries/resolve-entries/index.cjs.js +38 -0
  249. package/_shared/bundle/entries/resolve-entries/index.esm.js +34 -0
  250. package/_shared/bundle/externals/validate-globals/index.cjs.js +14 -0
  251. package/_shared/bundle/externals/validate-globals/index.esm.js +12 -0
  252. package/_shared/bundle/fs/deps-root/index.cjs.js +7 -0
  253. package/_shared/bundle/fs/deps-root/index.esm.js +5 -0
  254. package/_shared/bundle/fs/empty-dirs/index.cjs.js +23 -0
  255. package/_shared/bundle/fs/empty-dirs/index.esm.js +21 -0
  256. package/_shared/bundle/fs/entry-dir/index.cjs.js +7 -0
  257. package/_shared/bundle/fs/entry-dir/index.esm.js +5 -0
  258. package/_shared/bundle/fs/posix-path/index.cjs.js +9 -0
  259. package/_shared/bundle/fs/posix-path/index.esm.js +4 -0
  260. package/_shared/bundle/fs/under-dir/index.cjs.js +5 -0
  261. package/_shared/bundle/fs/under-dir/index.esm.js +3 -0
  262. package/_shared/memory/recover/index.cjs.js +15 -0
  263. package/_shared/memory/recover/index.esm.js +14 -0
  264. package/_shared/package/finalize-files/index.cjs.js +16 -0
  265. package/_shared/package/finalize-files/index.esm.js +15 -0
  266. package/_shared/package/json/cdn-paths/index.cjs.js +13 -0
  267. package/_shared/package/json/cdn-paths/index.esm.js +11 -0
  268. package/_shared/package/json/filter-deps/index.cjs.js +37 -0
  269. package/_shared/package/json/filter-deps/index.esm.js +34 -0
  270. package/_shared/package/json/generate-exports/index.cjs.js +56 -0
  271. package/_shared/package/json/generate-exports/index.esm.js +52 -0
  272. package/_shared/package/json/inherit-fields/index.cjs.js +19 -0
  273. package/_shared/package/json/inherit-fields/index.esm.js +17 -0
  274. package/_shared/package/json/read-package-json/index.cjs.js +7 -0
  275. package/_shared/package/json/read-package-json/index.esm.js +6 -0
  276. package/_shared/package/json/reflect-files-allowlist/index.cjs.js +39 -0
  277. package/_shared/package/json/reflect-files-allowlist/index.esm.js +33 -0
  278. package/_shared/package/json/synthesize/index.cjs.js +72 -0
  279. package/_shared/package/json/synthesize/index.esm.js +68 -0
  280. package/_shared/package/json/write/index.cjs.js +9 -0
  281. package/_shared/package/json/write/index.esm.js +8 -0
  282. package/_shared/package/licenses/generate-content/index.cjs.js +17 -0
  283. package/_shared/package/licenses/generate-content/index.esm.js +17 -0
  284. package/_shared/package/licenses/license-url/index.esm.js +29 -0
  285. package/_shared/package/licenses/write/index.cjs.js +9 -0
  286. package/_shared/package/licenses/write/index.esm.js +8 -0
  287. package/_shared/presets/by-names/index.cjs.js +10 -0
  288. package/_shared/presets/by-names/index.esm.js +8 -0
  289. package/_shared/presets/by-prefix/index.cjs.js +7 -0
  290. package/_shared/presets/by-prefix/index.esm.js +5 -0
  291. package/bin/format.d.ts +18 -0
  292. package/bin/format.d.ts.map +1 -0
  293. package/bin/hf-build.d.ts +81 -0
  294. package/bin/hf-build.d.ts.map +1 -0
  295. package/bin/hf-build.js +208533 -0
  296. package/bin/hf-build.linux-x64 +0 -0
  297. package/bin/index.cjs.js +548 -0
  298. package/bin/index.d.ts +26 -0
  299. package/bin/index.d.ts.map +1 -0
  300. package/bin/index.esm.js +546 -0
  301. package/bin/native/build-native.d.ts +44 -0
  302. package/bin/native/build-native.d.ts.map +1 -0
  303. package/bin/native/codesign.d.ts +65 -0
  304. package/bin/native/codesign.d.ts.map +1 -0
  305. package/bin/native/dispatch.d.ts +75 -0
  306. package/bin/native/dispatch.d.ts.map +1 -0
  307. package/bin/native/host-binary.d.ts +36 -0
  308. package/bin/native/host-binary.d.ts.map +1 -0
  309. package/bin/native/index.cjs.js +264 -0
  310. package/bin/native/index.d.ts +407 -0
  311. package/bin/native/index.d.ts.map +1 -0
  312. package/bin/native/index.esm.js +249 -0
  313. package/bin/native/inject.d.ts +61 -0
  314. package/bin/native/inject.d.ts.map +1 -0
  315. package/bin/native/platform-check.d.ts +39 -0
  316. package/bin/native/platform-check.d.ts.map +1 -0
  317. package/bin/native/sea-blob.d.ts +40 -0
  318. package/bin/native/sea-blob.d.ts.map +1 -0
  319. package/bin/native/sea-config.d.ts +45 -0
  320. package/bin/native/sea-config.d.ts.map +1 -0
  321. package/bin/native/worker/index.cjs.js +88 -0
  322. package/bin/native/worker/index.d.ts +68 -0
  323. package/bin/native/worker/index.d.ts.map +1 -0
  324. package/bin/native/worker/index.esm.js +86 -0
  325. package/bin/native/worker/job-runner.d.ts +29 -0
  326. package/bin/native/worker/job-runner.d.ts.map +1 -0
  327. package/bin/native/worker/types.d.ts +38 -0
  328. package/bin/native/worker/types.d.ts.map +1 -0
  329. package/bin/run-bin-phase.d.ts +24 -0
  330. package/bin/run-bin-phase.d.ts.map +1 -0
  331. package/bin/script/bootstrap-footer.d.ts +41 -0
  332. package/bin/script/bootstrap-footer.d.ts.map +1 -0
  333. package/bin/script/build-bin.d.ts +36 -0
  334. package/bin/script/build-bin.d.ts.map +1 -0
  335. package/bin/script/index.cjs.js +265 -0
  336. package/bin/script/index.d.ts +79 -0
  337. package/bin/script/index.d.ts.map +1 -0
  338. package/bin/script/index.esm.js +262 -0
  339. package/build.d.ts +56 -0
  340. package/build.d.ts.map +1 -0
  341. package/bundle/declarations/dts-per-entry.d.ts +27 -0
  342. package/bundle/declarations/dts-per-entry.d.ts.map +1 -0
  343. package/bundle/declarations/dts-pre-pass.d.ts +18 -0
  344. package/bundle/declarations/dts-pre-pass.d.ts.map +1 -0
  345. package/bundle/declarations/flatten-paths.d.ts +28 -0
  346. package/bundle/declarations/flatten-paths.d.ts.map +1 -0
  347. package/bundle/declarations/generate-declarations.d.ts +33 -0
  348. package/bundle/declarations/generate-declarations.d.ts.map +1 -0
  349. package/bundle/declarations/index.cjs.js +868 -0
  350. package/bundle/declarations/index.d.ts +262 -0
  351. package/bundle/declarations/index.d.ts.map +1 -0
  352. package/bundle/declarations/index.esm.js +857 -0
  353. package/bundle/declarations/prune-orphan-dts.d.ts +33 -0
  354. package/bundle/declarations/prune-orphan-dts.d.ts.map +1 -0
  355. package/bundle/declarations/sibling-resolver.d.ts +125 -0
  356. package/bundle/declarations/sibling-resolver.d.ts.map +1 -0
  357. package/bundle/dedupe/attribute-modules.d.ts +178 -0
  358. package/bundle/dedupe/attribute-modules.d.ts.map +1 -0
  359. package/bundle/dedupe/extract-chunk.d.ts +103 -0
  360. package/bundle/dedupe/extract-chunk.d.ts.map +1 -0
  361. package/bundle/dedupe/hoist-shared.d.ts +37 -0
  362. package/bundle/dedupe/hoist-shared.d.ts.map +1 -0
  363. package/bundle/dedupe/index.cjs.js +818 -0
  364. package/bundle/dedupe/index.d.ts +400 -0
  365. package/bundle/dedupe/index.d.ts.map +1 -0
  366. package/bundle/dedupe/index.esm.js +766 -0
  367. package/bundle/dedupe/plan-hoists.d.ts +46 -0
  368. package/bundle/dedupe/plan-hoists.d.ts.map +1 -0
  369. package/bundle/dedupe/rewrite-entry.d.ts +39 -0
  370. package/bundle/dedupe/rewrite-entry.d.ts.map +1 -0
  371. package/bundle/dependencies/collect-workspace-deps.d.ts +34 -0
  372. package/bundle/dependencies/collect-workspace-deps.d.ts.map +1 -0
  373. package/bundle/dependencies/externalize-plugin.d.ts +100 -0
  374. package/bundle/dependencies/externalize-plugin.d.ts.map +1 -0
  375. package/bundle/dependencies/index.cjs.js +964 -0
  376. package/bundle/dependencies/index.d.ts +388 -0
  377. package/bundle/dependencies/index.d.ts.map +1 -0
  378. package/bundle/dependencies/index.esm.js +947 -0
  379. package/bundle/dependencies/pre-pass.d.ts +154 -0
  380. package/bundle/dependencies/pre-pass.d.ts.map +1 -0
  381. package/bundle/dependencies/prune/ast-utils.d.ts +121 -0
  382. package/bundle/dependencies/prune/ast-utils.d.ts.map +1 -0
  383. package/bundle/dependencies/prune/chunk-graph.d.ts +175 -0
  384. package/bundle/dependencies/prune/chunk-graph.d.ts.map +1 -0
  385. package/bundle/dependencies/prune/dead-export-pass.d.ts +32 -0
  386. package/bundle/dependencies/prune/dead-export-pass.d.ts.map +1 -0
  387. package/bundle/dependencies/prune/dead-exports.d.ts +36 -0
  388. package/bundle/dependencies/prune/dead-exports.d.ts.map +1 -0
  389. package/bundle/dependencies/prune/destructure-requires-pass.d.ts +31 -0
  390. package/bundle/dependencies/prune/destructure-requires-pass.d.ts.map +1 -0
  391. package/bundle/dependencies/prune/destructure-requires.d.ts +42 -0
  392. package/bundle/dependencies/prune/destructure-requires.d.ts.map +1 -0
  393. package/bundle/dependencies/prune/edits.d.ts +30 -0
  394. package/bundle/dependencies/prune/edits.d.ts.map +1 -0
  395. package/bundle/dependencies/prune/namespace-usage.d.ts +104 -0
  396. package/bundle/dependencies/prune/namespace-usage.d.ts.map +1 -0
  397. package/bundle/dependencies/prune/orphan-chunks.d.ts +69 -0
  398. package/bundle/dependencies/prune/orphan-chunks.d.ts.map +1 -0
  399. package/bundle/dependencies/prune/property-strip-pass.d.ts +38 -0
  400. package/bundle/dependencies/prune/property-strip-pass.d.ts.map +1 -0
  401. package/bundle/dependencies/prune/property-strip.d.ts +69 -0
  402. package/bundle/dependencies/prune/property-strip.d.ts.map +1 -0
  403. package/bundle/dependencies/prune/prune-dependencies.d.ts +52 -0
  404. package/bundle/dependencies/prune/prune-dependencies.d.ts.map +1 -0
  405. package/bundle/dependencies/prune/reachability.d.ts +36 -0
  406. package/bundle/dependencies/prune/reachability.d.ts.map +1 -0
  407. package/bundle/dependencies/prune/specifiers.d.ts +39 -0
  408. package/bundle/dependencies/prune/specifiers.d.ts.map +1 -0
  409. package/bundle/dependencies/prune/strip-comments.d.ts +47 -0
  410. package/bundle/dependencies/prune/strip-comments.d.ts.map +1 -0
  411. package/bundle/dependencies/prune/used-exports.d.ts +32 -0
  412. package/bundle/dependencies/prune/used-exports.d.ts.map +1 -0
  413. package/bundle/dependencies/resolve-bundled-deps.d.ts +37 -0
  414. package/bundle/dependencies/resolve-bundled-deps.d.ts.map +1 -0
  415. package/bundle/dependencies/resolve-dep-entry.d.ts +38 -0
  416. package/bundle/dependencies/resolve-dep-entry.d.ts.map +1 -0
  417. package/bundle/dependencies/resolve-workspace-bundled-deps.d.ts +96 -0
  418. package/bundle/dependencies/resolve-workspace-bundled-deps.d.ts.map +1 -0
  419. package/bundle/dependencies/worker/index.cjs.js +524 -0
  420. package/bundle/dependencies/worker/index.d.ts +102 -0
  421. package/bundle/dependencies/worker/index.d.ts.map +1 -0
  422. package/bundle/dependencies/worker/index.esm.js +515 -0
  423. package/bundle/dependencies/worker/job-runner.d.ts +115 -0
  424. package/bundle/dependencies/worker/job-runner.d.ts.map +1 -0
  425. package/bundle/entries/by-platform.d.ts +27 -0
  426. package/bundle/entries/by-platform.d.ts.map +1 -0
  427. package/bundle/entries/discover-entries.d.ts +24 -0
  428. package/bundle/entries/discover-entries.d.ts.map +1 -0
  429. package/bundle/entries/index.cjs.js +38 -0
  430. package/bundle/entries/index.d.ts +70 -0
  431. package/bundle/entries/index.d.ts.map +1 -0
  432. package/bundle/entries/index.esm.js +33 -0
  433. package/bundle/entries/resolve-entries.d.ts +19 -0
  434. package/bundle/entries/resolve-entries.d.ts.map +1 -0
  435. package/bundle/externals/index.cjs.js +54 -0
  436. package/bundle/externals/index.d.ts +74 -0
  437. package/bundle/externals/index.d.ts.map +1 -0
  438. package/bundle/externals/index.esm.js +51 -0
  439. package/bundle/externals/resolve-externals.d.ts +52 -0
  440. package/bundle/externals/resolve-externals.d.ts.map +1 -0
  441. package/bundle/externals/validate-globals.d.ts +19 -0
  442. package/bundle/externals/validate-globals.d.ts.map +1 -0
  443. package/bundle/fs/deps-root.d.ts +17 -0
  444. package/bundle/fs/deps-root.d.ts.map +1 -0
  445. package/bundle/fs/empty-dirs.d.ts +18 -0
  446. package/bundle/fs/empty-dirs.d.ts.map +1 -0
  447. package/bundle/fs/entry-dir.d.ts +21 -0
  448. package/bundle/fs/entry-dir.d.ts.map +1 -0
  449. package/bundle/fs/posix-path.d.ts +30 -0
  450. package/bundle/fs/posix-path.d.ts.map +1 -0
  451. package/bundle/fs/under-dir.d.ts +19 -0
  452. package/bundle/fs/under-dir.d.ts.map +1 -0
  453. package/bundle/index.cjs.js +4046 -0
  454. package/bundle/index.d.ts +25 -0
  455. package/bundle/index.d.ts.map +1 -0
  456. package/bundle/index.esm.js +3689 -0
  457. package/bundle/rollup/descriptor.d.ts +99 -0
  458. package/bundle/rollup/descriptor.d.ts.map +1 -0
  459. package/bundle/rollup/dispatch.d.ts +72 -0
  460. package/bundle/rollup/dispatch.d.ts.map +1 -0
  461. package/bundle/rollup/index.cjs.js +715 -0
  462. package/bundle/rollup/index.d.ts +174 -0
  463. package/bundle/rollup/index.d.ts.map +1 -0
  464. package/bundle/rollup/index.esm.js +698 -0
  465. package/bundle/rollup/worker/index.cjs.js +290 -0
  466. package/bundle/rollup/worker/index.d.ts +131 -0
  467. package/bundle/rollup/worker/index.d.ts.map +1 -0
  468. package/bundle/rollup/worker/index.esm.js +280 -0
  469. package/bundle/rollup/worker/job-runner.d.ts +18 -0
  470. package/bundle/rollup/worker/job-runner.d.ts.map +1 -0
  471. package/bundle/rollup/worker/types.d.ts +111 -0
  472. package/bundle/rollup/worker/types.d.ts.map +1 -0
  473. package/bundle/run-bundle-phase.d.ts +23 -0
  474. package/bundle/run-bundle-phase.d.ts.map +1 -0
  475. package/clean-output.d.ts +26 -0
  476. package/clean-output.d.ts.map +1 -0
  477. package/index.cjs.js +5317 -0
  478. package/index.d.ts +64 -0
  479. package/index.d.ts.map +1 -0
  480. package/index.esm.js +4910 -0
  481. package/memory/index.cjs.js +101 -0
  482. package/memory/index.d.ts +81 -0
  483. package/memory/index.d.ts.map +1 -0
  484. package/memory/index.esm.js +98 -0
  485. package/memory/monitor.d.ts +59 -0
  486. package/memory/monitor.d.ts.map +1 -0
  487. package/memory/recover.d.ts +19 -0
  488. package/memory/recover.d.ts.map +1 -0
  489. package/models/build-config.d.ts +266 -0
  490. package/models/build-config.d.ts.map +1 -0
  491. package/models/build-context.d.ts +68 -0
  492. package/models/build-context.d.ts.map +1 -0
  493. package/models/build-result.d.ts +43 -0
  494. package/models/build-result.d.ts.map +1 -0
  495. package/models/entry-point.d.ts +45 -0
  496. package/models/entry-point.d.ts.map +1 -0
  497. package/models/format-output.d.ts +34 -0
  498. package/models/format-output.d.ts.map +1 -0
  499. package/models/index.cjs.js +2 -0
  500. package/models/index.d.ts +581 -0
  501. package/models/index.d.ts.map +1 -0
  502. package/models/index.esm.js +1 -0
  503. package/models/package-json.d.ts +130 -0
  504. package/models/package-json.d.ts.map +1 -0
  505. package/package/assets/copy-assets.d.ts +31 -0
  506. package/package/assets/copy-assets.d.ts.map +1 -0
  507. package/package/assets/index.cjs.js +84 -0
  508. package/package/assets/index.d.ts +33 -0
  509. package/package/assets/index.d.ts.map +1 -0
  510. package/package/assets/index.esm.js +82 -0
  511. package/package/finalize-files.d.ts +25 -0
  512. package/package/finalize-files.d.ts.map +1 -0
  513. package/package/index.cjs.js +276 -0
  514. package/package/index.d.ts +56 -0
  515. package/package/index.d.ts.map +1 -0
  516. package/package/index.esm.js +231 -0
  517. package/package/json/cdn-paths.d.ts +41 -0
  518. package/package/json/cdn-paths.d.ts.map +1 -0
  519. package/package/json/filter-deps.d.ts +39 -0
  520. package/package/json/filter-deps.d.ts.map +1 -0
  521. package/package/json/generate-exports.d.ts +29 -0
  522. package/package/json/generate-exports.d.ts.map +1 -0
  523. package/package/json/index.cjs.js +24 -0
  524. package/package/json/index.d.ts +252 -0
  525. package/package/json/index.d.ts.map +1 -0
  526. package/package/json/index.esm.js +14 -0
  527. package/package/json/inherit-fields.d.ts +25 -0
  528. package/package/json/inherit-fields.d.ts.map +1 -0
  529. package/package/json/read-package-json.d.ts +18 -0
  530. package/package/json/read-package-json.d.ts.map +1 -0
  531. package/package/json/reflect-files-allowlist.d.ts +32 -0
  532. package/package/json/reflect-files-allowlist.d.ts.map +1 -0
  533. package/package/json/synthesize.d.ts +53 -0
  534. package/package/json/synthesize.d.ts.map +1 -0
  535. package/package/json/write.d.ts +18 -0
  536. package/package/json/write.d.ts.map +1 -0
  537. package/package/licenses/collect.d.ts +25 -0
  538. package/package/licenses/collect.d.ts.map +1 -0
  539. package/package/licenses/generate-content.d.ts +20 -0
  540. package/package/licenses/generate-content.d.ts.map +1 -0
  541. package/package/licenses/index.cjs.js +135 -0
  542. package/package/licenses/index.d.ts +73 -0
  543. package/package/licenses/index.d.ts.map +1 -0
  544. package/package/licenses/index.esm.js +89 -0
  545. package/package/licenses/license-url.d.ts +20 -0
  546. package/package/licenses/license-url.d.ts.map +1 -0
  547. package/package/licenses/types.d.ts +12 -0
  548. package/package/licenses/types.d.ts.map +1 -0
  549. package/package/licenses/write.d.ts +16 -0
  550. package/package/licenses/write.d.ts.map +1 -0
  551. package/package/run-package-phase.d.ts +30 -0
  552. package/package/run-package-phase.d.ts.map +1 -0
  553. package/package.json +347 -0
  554. package/presets/by-names.d.ts +20 -0
  555. package/presets/by-names.d.ts.map +1 -0
  556. package/presets/by-prefix.d.ts +22 -0
  557. package/presets/by-prefix.d.ts.map +1 -0
  558. package/presets/index.cjs.js +8 -0
  559. package/presets/index.d.ts +43 -0
  560. package/presets/index.d.ts.map +1 -0
  561. package/presets/index.esm.js +5 -0
@@ -0,0 +1,4819 @@
1
+ import * as path$2 from 'path';
2
+ import path__default, { win32, posix, isAbsolute, resolve as resolve$2, dirname, relative } from 'path';
3
+ import * as fs__default from 'fs';
4
+ import fs__default__default, { promises, readFileSync } from 'fs';
5
+ import * as require$$0 from 'os';
6
+ import require$$0__default from 'os';
7
+ import typescript$1 from 'typescript';
8
+ import { fileURLToPath } from 'url';
9
+
10
+ function getDefaultExportFromCjs (x) {
11
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
12
+ }
13
+
14
+ var utils = {};
15
+
16
+ var constants$2;
17
+ var hasRequiredConstants;
18
+
19
+ function requireConstants () {
20
+ if (hasRequiredConstants) return constants$2;
21
+ hasRequiredConstants = 1;
22
+
23
+ const WIN_SLASH = '\\\\/';
24
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
25
+
26
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
27
+
28
+ const DOT_LITERAL = '\\.';
29
+ const PLUS_LITERAL = '\\+';
30
+ const QMARK_LITERAL = '\\?';
31
+ const SLASH_LITERAL = '\\/';
32
+ const ONE_CHAR = '(?=.)';
33
+ const QMARK = '[^/]';
34
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
35
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
36
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
37
+ const NO_DOT = `(?!${DOT_LITERAL})`;
38
+ const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
39
+ const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
40
+ const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
41
+ const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
42
+ const STAR = `${QMARK}*?`;
43
+ const SEP = '/';
44
+
45
+ const POSIX_CHARS = {
46
+ DOT_LITERAL,
47
+ PLUS_LITERAL,
48
+ QMARK_LITERAL,
49
+ SLASH_LITERAL,
50
+ ONE_CHAR,
51
+ QMARK,
52
+ END_ANCHOR,
53
+ DOTS_SLASH,
54
+ NO_DOT,
55
+ NO_DOTS,
56
+ NO_DOT_SLASH,
57
+ NO_DOTS_SLASH,
58
+ QMARK_NO_DOT,
59
+ STAR,
60
+ START_ANCHOR,
61
+ SEP
62
+ };
63
+
64
+ const WINDOWS_CHARS = {
65
+ ...POSIX_CHARS,
66
+
67
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
68
+ QMARK: WIN_NO_SLASH,
69
+ STAR: `${WIN_NO_SLASH}*?`,
70
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
71
+ NO_DOT: `(?!${DOT_LITERAL})`,
72
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
73
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
74
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
75
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
76
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
77
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
78
+ SEP: '\\'
79
+ };
80
+
81
+ const POSIX_REGEX_SOURCE = {
82
+ __proto__: null,
83
+ alnum: 'a-zA-Z0-9',
84
+ alpha: 'a-zA-Z',
85
+ ascii: '\\x00-\\x7F',
86
+ blank: ' \\t',
87
+ cntrl: '\\x00-\\x1F\\x7F',
88
+ digit: '0-9',
89
+ graph: '\\x21-\\x7E',
90
+ lower: 'a-z',
91
+ print: '\\x20-\\x7E ',
92
+ punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
93
+ space: ' \\t\\r\\n\\v\\f',
94
+ upper: 'A-Z',
95
+ word: 'A-Za-z0-9_',
96
+ xdigit: 'A-Fa-f0-9'
97
+ };
98
+
99
+ constants$2 = {
100
+ DEFAULT_MAX_EXTGLOB_RECURSION,
101
+ MAX_LENGTH: 1024 * 64,
102
+ POSIX_REGEX_SOURCE,
103
+
104
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
105
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
106
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
107
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
108
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
109
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
110
+
111
+ REPLACEMENTS: {
112
+ __proto__: null,
113
+ '***': '*',
114
+ '**/**': '**',
115
+ '**/**/**': '**'
116
+ },
117
+
118
+ CHAR_0: 48,
119
+ CHAR_9: 57,
120
+
121
+ CHAR_UPPERCASE_A: 65,
122
+ CHAR_LOWERCASE_A: 97,
123
+ CHAR_UPPERCASE_Z: 90,
124
+ CHAR_LOWERCASE_Z: 122,
125
+
126
+ CHAR_LEFT_PARENTHESES: 40,
127
+ CHAR_RIGHT_PARENTHESES: 41,
128
+
129
+ CHAR_ASTERISK: 42,
130
+
131
+ CHAR_AMPERSAND: 38,
132
+ CHAR_AT: 64,
133
+ CHAR_BACKWARD_SLASH: 92,
134
+ CHAR_CARRIAGE_RETURN: 13,
135
+ CHAR_CIRCUMFLEX_ACCENT: 94,
136
+ CHAR_COLON: 58,
137
+ CHAR_COMMA: 44,
138
+ CHAR_DOT: 46,
139
+ CHAR_DOUBLE_QUOTE: 34,
140
+ CHAR_EQUAL: 61,
141
+ CHAR_EXCLAMATION_MARK: 33,
142
+ CHAR_FORM_FEED: 12,
143
+ CHAR_FORWARD_SLASH: 47,
144
+ CHAR_GRAVE_ACCENT: 96,
145
+ CHAR_HASH: 35,
146
+ CHAR_HYPHEN_MINUS: 45,
147
+ CHAR_LEFT_ANGLE_BRACKET: 60,
148
+ CHAR_LEFT_CURLY_BRACE: 123,
149
+ CHAR_LEFT_SQUARE_BRACKET: 91,
150
+ CHAR_LINE_FEED: 10,
151
+ CHAR_NO_BREAK_SPACE: 160,
152
+ CHAR_PERCENT: 37,
153
+ CHAR_PLUS: 43,
154
+ CHAR_QUESTION_MARK: 63,
155
+ CHAR_RIGHT_ANGLE_BRACKET: 62,
156
+ CHAR_RIGHT_CURLY_BRACE: 125,
157
+ CHAR_RIGHT_SQUARE_BRACKET: 93,
158
+ CHAR_SEMICOLON: 59,
159
+ CHAR_SINGLE_QUOTE: 39,
160
+ CHAR_SPACE: 32,
161
+ CHAR_TAB: 9,
162
+ CHAR_UNDERSCORE: 95,
163
+ CHAR_VERTICAL_LINE: 124,
164
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
165
+
166
+ extglobChars(chars) {
167
+ return {
168
+ '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
169
+ '?': { type: 'qmark', open: '(?:', close: ')?' },
170
+ '+': { type: 'plus', open: '(?:', close: ')+' },
171
+ '*': { type: 'star', open: '(?:', close: ')*' },
172
+ '@': { type: 'at', open: '(?:', close: ')' }
173
+ };
174
+ },
175
+
176
+ globChars(win32) {
177
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
178
+ }
179
+ };
180
+ return constants$2;
181
+ }
182
+
183
+ var hasRequiredUtils;
184
+
185
+ function requireUtils () {
186
+ if (hasRequiredUtils) return utils;
187
+ hasRequiredUtils = 1;
188
+ (function (exports$1) {
189
+
190
+ const {
191
+ REGEX_BACKSLASH,
192
+ REGEX_REMOVE_BACKSLASH,
193
+ REGEX_SPECIAL_CHARS,
194
+ REGEX_SPECIAL_CHARS_GLOBAL
195
+ } = /*@__PURE__*/ requireConstants();
196
+
197
+ exports$1.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
198
+ exports$1.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
199
+ exports$1.isRegexChar = str => str.length === 1 && exports$1.hasRegexChars(str);
200
+ exports$1.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
201
+ exports$1.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
202
+
203
+ exports$1.isWindows = () => {
204
+ if (typeof navigator !== 'undefined' && navigator.platform) {
205
+ const platform = navigator.platform.toLowerCase();
206
+ return platform === 'win32' || platform === 'windows';
207
+ }
208
+
209
+ if (typeof process !== 'undefined' && process.platform) {
210
+ return process.platform === 'win32';
211
+ }
212
+
213
+ return false;
214
+ };
215
+
216
+ exports$1.removeBackslashes = str => {
217
+ return str.replace(REGEX_REMOVE_BACKSLASH, match => {
218
+ return match === '\\' ? '' : match;
219
+ });
220
+ };
221
+
222
+ exports$1.escapeLast = (input, char, lastIdx) => {
223
+ const idx = input.lastIndexOf(char, lastIdx);
224
+ if (idx === -1) return input;
225
+ if (input[idx - 1] === '\\') return exports$1.escapeLast(input, char, idx - 1);
226
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
227
+ };
228
+
229
+ exports$1.removePrefix = (input, state = {}) => {
230
+ let output = input;
231
+ if (output.startsWith('./')) {
232
+ output = output.slice(2);
233
+ state.prefix = './';
234
+ }
235
+ return output;
236
+ };
237
+
238
+ exports$1.wrapOutput = (input, state = {}, options = {}) => {
239
+ const prepend = options.contains ? '' : '^';
240
+ const append = options.contains ? '' : '$';
241
+
242
+ let output = `${prepend}(?:${input})${append}`;
243
+ if (state.negated === true) {
244
+ output = `(?:^(?!${output}).*$)`;
245
+ }
246
+ return output;
247
+ };
248
+
249
+ exports$1.basename = (path, { windows } = {}) => {
250
+ const segs = path.split(windows ? /[\\/]/ : '/');
251
+ const last = segs[segs.length - 1];
252
+
253
+ if (last === '') {
254
+ return segs[segs.length - 2];
255
+ }
256
+
257
+ return last;
258
+ };
259
+ } (utils));
260
+ return utils;
261
+ }
262
+
263
+ var scan_1;
264
+ var hasRequiredScan;
265
+
266
+ function requireScan () {
267
+ if (hasRequiredScan) return scan_1;
268
+ hasRequiredScan = 1;
269
+
270
+ const utils = /*@__PURE__*/ requireUtils();
271
+ const {
272
+ CHAR_ASTERISK,
273
+ CHAR_AT,
274
+ CHAR_BACKWARD_SLASH,
275
+ CHAR_COMMA,
276
+ CHAR_DOT,
277
+ CHAR_EXCLAMATION_MARK,
278
+ CHAR_FORWARD_SLASH,
279
+ CHAR_LEFT_CURLY_BRACE,
280
+ CHAR_LEFT_PARENTHESES,
281
+ CHAR_LEFT_SQUARE_BRACKET,
282
+ CHAR_PLUS,
283
+ CHAR_QUESTION_MARK,
284
+ CHAR_RIGHT_CURLY_BRACE,
285
+ CHAR_RIGHT_PARENTHESES,
286
+ CHAR_RIGHT_SQUARE_BRACKET
287
+ } = /*@__PURE__*/ requireConstants();
288
+
289
+ const isPathSeparator = code => {
290
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
291
+ };
292
+
293
+ const depth = token => {
294
+ if (token.isPrefix !== true) {
295
+ token.depth = token.isGlobstar ? Infinity : 1;
296
+ }
297
+ };
298
+
299
+ const scan = (input, options) => {
300
+ const opts = options || {};
301
+
302
+ const length = input.length - 1;
303
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
304
+ const slashes = [];
305
+ const tokens = [];
306
+ const parts = [];
307
+
308
+ let str = input;
309
+ let index = -1;
310
+ let start = 0;
311
+ let lastIndex = 0;
312
+ let isBrace = false;
313
+ let isBracket = false;
314
+ let isGlob = false;
315
+ let isExtglob = false;
316
+ let isGlobstar = false;
317
+ let braceEscaped = false;
318
+ let backslashes = false;
319
+ let negated = false;
320
+ let negatedExtglob = false;
321
+ let finished = false;
322
+ let braces = 0;
323
+ let prev;
324
+ let code;
325
+ let token = { value: '', depth: 0, isGlob: false };
326
+
327
+ const eos = () => index >= length;
328
+ const peek = () => str.charCodeAt(index + 1);
329
+ const advance = () => {
330
+ prev = code;
331
+ return str.charCodeAt(++index);
332
+ };
333
+
334
+ while (index < length) {
335
+ code = advance();
336
+ let next;
337
+
338
+ if (code === CHAR_BACKWARD_SLASH) {
339
+ backslashes = token.backslashes = true;
340
+ code = advance();
341
+
342
+ if (code === CHAR_LEFT_CURLY_BRACE) {
343
+ braceEscaped = true;
344
+ }
345
+ continue;
346
+ }
347
+
348
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
349
+ braces++;
350
+
351
+ while (eos() !== true && (code = advance())) {
352
+ if (code === CHAR_BACKWARD_SLASH) {
353
+ backslashes = token.backslashes = true;
354
+ advance();
355
+ continue;
356
+ }
357
+
358
+ if (code === CHAR_LEFT_CURLY_BRACE) {
359
+ braces++;
360
+ continue;
361
+ }
362
+
363
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
364
+ isBrace = token.isBrace = true;
365
+ isGlob = token.isGlob = true;
366
+ finished = true;
367
+
368
+ if (scanToEnd === true) {
369
+ continue;
370
+ }
371
+
372
+ break;
373
+ }
374
+
375
+ if (braceEscaped !== true && code === CHAR_COMMA) {
376
+ isBrace = token.isBrace = true;
377
+ isGlob = token.isGlob = true;
378
+ finished = true;
379
+
380
+ if (scanToEnd === true) {
381
+ continue;
382
+ }
383
+
384
+ break;
385
+ }
386
+
387
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
388
+ braces--;
389
+
390
+ if (braces === 0) {
391
+ braceEscaped = false;
392
+ isBrace = token.isBrace = true;
393
+ finished = true;
394
+ break;
395
+ }
396
+ }
397
+ }
398
+
399
+ if (scanToEnd === true) {
400
+ continue;
401
+ }
402
+
403
+ break;
404
+ }
405
+
406
+ if (code === CHAR_FORWARD_SLASH) {
407
+ slashes.push(index);
408
+ tokens.push(token);
409
+ token = { value: '', depth: 0, isGlob: false };
410
+
411
+ if (finished === true) continue;
412
+ if (prev === CHAR_DOT && index === (start + 1)) {
413
+ start += 2;
414
+ continue;
415
+ }
416
+
417
+ lastIndex = index + 1;
418
+ continue;
419
+ }
420
+
421
+ if (opts.noext !== true) {
422
+ const isExtglobChar = code === CHAR_PLUS
423
+ || code === CHAR_AT
424
+ || code === CHAR_ASTERISK
425
+ || code === CHAR_QUESTION_MARK
426
+ || code === CHAR_EXCLAMATION_MARK;
427
+
428
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
429
+ isGlob = token.isGlob = true;
430
+ isExtglob = token.isExtglob = true;
431
+ finished = true;
432
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
433
+ negatedExtglob = true;
434
+ }
435
+
436
+ if (scanToEnd === true) {
437
+ while (eos() !== true && (code = advance())) {
438
+ if (code === CHAR_BACKWARD_SLASH) {
439
+ backslashes = token.backslashes = true;
440
+ code = advance();
441
+ continue;
442
+ }
443
+
444
+ if (code === CHAR_RIGHT_PARENTHESES) {
445
+ isGlob = token.isGlob = true;
446
+ finished = true;
447
+ break;
448
+ }
449
+ }
450
+ continue;
451
+ }
452
+ break;
453
+ }
454
+ }
455
+
456
+ if (code === CHAR_ASTERISK) {
457
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
458
+ isGlob = token.isGlob = true;
459
+ finished = true;
460
+
461
+ if (scanToEnd === true) {
462
+ continue;
463
+ }
464
+ break;
465
+ }
466
+
467
+ if (code === CHAR_QUESTION_MARK) {
468
+ isGlob = token.isGlob = true;
469
+ finished = true;
470
+
471
+ if (scanToEnd === true) {
472
+ continue;
473
+ }
474
+ break;
475
+ }
476
+
477
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
478
+ while (eos() !== true && (next = advance())) {
479
+ if (next === CHAR_BACKWARD_SLASH) {
480
+ backslashes = token.backslashes = true;
481
+ advance();
482
+ continue;
483
+ }
484
+
485
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
486
+ isBracket = token.isBracket = true;
487
+ isGlob = token.isGlob = true;
488
+ finished = true;
489
+ break;
490
+ }
491
+ }
492
+
493
+ if (scanToEnd === true) {
494
+ continue;
495
+ }
496
+
497
+ break;
498
+ }
499
+
500
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
501
+ negated = token.negated = true;
502
+ start++;
503
+ continue;
504
+ }
505
+
506
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
507
+ isGlob = token.isGlob = true;
508
+
509
+ if (scanToEnd === true) {
510
+ while (eos() !== true && (code = advance())) {
511
+ if (code === CHAR_LEFT_PARENTHESES) {
512
+ backslashes = token.backslashes = true;
513
+ code = advance();
514
+ continue;
515
+ }
516
+
517
+ if (code === CHAR_RIGHT_PARENTHESES) {
518
+ finished = true;
519
+ break;
520
+ }
521
+ }
522
+ continue;
523
+ }
524
+ break;
525
+ }
526
+
527
+ if (isGlob === true) {
528
+ finished = true;
529
+
530
+ if (scanToEnd === true) {
531
+ continue;
532
+ }
533
+
534
+ break;
535
+ }
536
+ }
537
+
538
+ if (opts.noext === true) {
539
+ isExtglob = false;
540
+ isGlob = false;
541
+ }
542
+
543
+ let base = str;
544
+ let prefix = '';
545
+ let glob = '';
546
+
547
+ if (start > 0) {
548
+ prefix = str.slice(0, start);
549
+ str = str.slice(start);
550
+ lastIndex -= start;
551
+ }
552
+
553
+ if (base && isGlob === true && lastIndex > 0) {
554
+ base = str.slice(0, lastIndex);
555
+ glob = str.slice(lastIndex);
556
+ } else if (isGlob === true) {
557
+ base = '';
558
+ glob = str;
559
+ } else {
560
+ base = str;
561
+ }
562
+
563
+ if (base && base !== '' && base !== '/' && base !== str) {
564
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
565
+ base = base.slice(0, -1);
566
+ }
567
+ }
568
+
569
+ if (opts.unescape === true) {
570
+ if (glob) glob = utils.removeBackslashes(glob);
571
+
572
+ if (base && backslashes === true) {
573
+ base = utils.removeBackslashes(base);
574
+ }
575
+ }
576
+
577
+ const state = {
578
+ prefix,
579
+ input,
580
+ start,
581
+ base,
582
+ glob,
583
+ isBrace,
584
+ isBracket,
585
+ isGlob,
586
+ isExtglob,
587
+ isGlobstar,
588
+ negated,
589
+ negatedExtglob
590
+ };
591
+
592
+ if (opts.tokens === true) {
593
+ state.maxDepth = 0;
594
+ if (!isPathSeparator(code)) {
595
+ tokens.push(token);
596
+ }
597
+ state.tokens = tokens;
598
+ }
599
+
600
+ if (opts.parts === true || opts.tokens === true) {
601
+ let prevIndex;
602
+
603
+ for (let idx = 0; idx < slashes.length; idx++) {
604
+ const n = prevIndex ? prevIndex + 1 : start;
605
+ const i = slashes[idx];
606
+ const value = input.slice(n, i);
607
+ if (opts.tokens) {
608
+ if (idx === 0 && start !== 0) {
609
+ tokens[idx].isPrefix = true;
610
+ tokens[idx].value = prefix;
611
+ } else {
612
+ tokens[idx].value = value;
613
+ }
614
+ depth(tokens[idx]);
615
+ state.maxDepth += tokens[idx].depth;
616
+ }
617
+ if (idx !== 0 || value !== '') {
618
+ parts.push(value);
619
+ }
620
+ prevIndex = i;
621
+ }
622
+
623
+ if (prevIndex && prevIndex + 1 < input.length) {
624
+ const value = input.slice(prevIndex + 1);
625
+ parts.push(value);
626
+
627
+ if (opts.tokens) {
628
+ tokens[tokens.length - 1].value = value;
629
+ depth(tokens[tokens.length - 1]);
630
+ state.maxDepth += tokens[tokens.length - 1].depth;
631
+ }
632
+ }
633
+
634
+ state.slashes = slashes;
635
+ state.parts = parts;
636
+ }
637
+
638
+ return state;
639
+ };
640
+
641
+ scan_1 = scan;
642
+ return scan_1;
643
+ }
644
+
645
+ var parse_1;
646
+ var hasRequiredParse;
647
+
648
+ function requireParse () {
649
+ if (hasRequiredParse) return parse_1;
650
+ hasRequiredParse = 1;
651
+
652
+ const constants = /*@__PURE__*/ requireConstants();
653
+ const utils = /*@__PURE__*/ requireUtils();
654
+
655
+ const {
656
+ MAX_LENGTH,
657
+ POSIX_REGEX_SOURCE,
658
+ REGEX_NON_SPECIAL_CHARS,
659
+ REGEX_SPECIAL_CHARS_BACKREF,
660
+ REPLACEMENTS
661
+ } = constants;
662
+
663
+ const expandRange = (args, options) => {
664
+ if (typeof options.expandRange === 'function') {
665
+ return options.expandRange(...args, options);
666
+ }
667
+
668
+ args.sort();
669
+ const value = `[${args.join('-')}]`;
670
+
671
+ try {
672
+ new RegExp(value);
673
+ } catch (ex) {
674
+ return args.map(v => utils.escapeRegex(v)).join('..');
675
+ }
676
+
677
+ return value;
678
+ };
679
+
680
+ const syntaxError = (type, char) => {
681
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
682
+ };
683
+
684
+ const splitTopLevel = input => {
685
+ const parts = [];
686
+ let bracket = 0;
687
+ let paren = 0;
688
+ let quote = 0;
689
+ let value = '';
690
+ let escaped = false;
691
+
692
+ for (const ch of input) {
693
+ if (escaped === true) {
694
+ value += ch;
695
+ escaped = false;
696
+ continue;
697
+ }
698
+
699
+ if (ch === '\\') {
700
+ value += ch;
701
+ escaped = true;
702
+ continue;
703
+ }
704
+
705
+ if (ch === '"') {
706
+ quote = quote === 1 ? 0 : 1;
707
+ value += ch;
708
+ continue;
709
+ }
710
+
711
+ if (quote === 0) {
712
+ if (ch === '[') {
713
+ bracket++;
714
+ } else if (ch === ']' && bracket > 0) {
715
+ bracket--;
716
+ } else if (bracket === 0) {
717
+ if (ch === '(') {
718
+ paren++;
719
+ } else if (ch === ')' && paren > 0) {
720
+ paren--;
721
+ } else if (ch === '|' && paren === 0) {
722
+ parts.push(value);
723
+ value = '';
724
+ continue;
725
+ }
726
+ }
727
+ }
728
+
729
+ value += ch;
730
+ }
731
+
732
+ parts.push(value);
733
+ return parts;
734
+ };
735
+
736
+ const isPlainBranch = branch => {
737
+ let escaped = false;
738
+
739
+ for (const ch of branch) {
740
+ if (escaped === true) {
741
+ escaped = false;
742
+ continue;
743
+ }
744
+
745
+ if (ch === '\\') {
746
+ escaped = true;
747
+ continue;
748
+ }
749
+
750
+ if (/[?*+@!()[\]{}]/.test(ch)) {
751
+ return false;
752
+ }
753
+ }
754
+
755
+ return true;
756
+ };
757
+
758
+ const normalizeSimpleBranch = branch => {
759
+ let value = branch.trim();
760
+ let changed = true;
761
+
762
+ while (changed === true) {
763
+ changed = false;
764
+
765
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
766
+ value = value.slice(2, -1);
767
+ changed = true;
768
+ }
769
+ }
770
+
771
+ if (!isPlainBranch(value)) {
772
+ return;
773
+ }
774
+
775
+ return value.replace(/\\(.)/g, '$1');
776
+ };
777
+
778
+ const hasRepeatedCharPrefixOverlap = branches => {
779
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
780
+
781
+ for (let i = 0; i < values.length; i++) {
782
+ for (let j = i + 1; j < values.length; j++) {
783
+ const a = values[i];
784
+ const b = values[j];
785
+ const char = a[0];
786
+
787
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
788
+ continue;
789
+ }
790
+
791
+ if (a === b || a.startsWith(b) || b.startsWith(a)) {
792
+ return true;
793
+ }
794
+ }
795
+ }
796
+
797
+ return false;
798
+ };
799
+
800
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
801
+ if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') {
802
+ return;
803
+ }
804
+
805
+ let bracket = 0;
806
+ let paren = 0;
807
+ let quote = 0;
808
+ let escaped = false;
809
+
810
+ for (let i = 1; i < pattern.length; i++) {
811
+ const ch = pattern[i];
812
+
813
+ if (escaped === true) {
814
+ escaped = false;
815
+ continue;
816
+ }
817
+
818
+ if (ch === '\\') {
819
+ escaped = true;
820
+ continue;
821
+ }
822
+
823
+ if (ch === '"') {
824
+ quote = quote === 1 ? 0 : 1;
825
+ continue;
826
+ }
827
+
828
+ if (quote === 1) {
829
+ continue;
830
+ }
831
+
832
+ if (ch === '[') {
833
+ bracket++;
834
+ continue;
835
+ }
836
+
837
+ if (ch === ']' && bracket > 0) {
838
+ bracket--;
839
+ continue;
840
+ }
841
+
842
+ if (bracket > 0) {
843
+ continue;
844
+ }
845
+
846
+ if (ch === '(') {
847
+ paren++;
848
+ continue;
849
+ }
850
+
851
+ if (ch === ')') {
852
+ paren--;
853
+
854
+ if (paren === 0) {
855
+ if (requireEnd === true && i !== pattern.length - 1) {
856
+ return;
857
+ }
858
+
859
+ return {
860
+ type: pattern[0],
861
+ body: pattern.slice(2, i),
862
+ end: i
863
+ };
864
+ }
865
+ }
866
+ }
867
+ };
868
+
869
+ const getStarExtglobSequenceOutput = pattern => {
870
+ let index = 0;
871
+ const chars = [];
872
+
873
+ while (index < pattern.length) {
874
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
875
+
876
+ if (!match || match.type !== '*') {
877
+ return;
878
+ }
879
+
880
+ const branches = splitTopLevel(match.body).map(branch => branch.trim());
881
+ if (branches.length !== 1) {
882
+ return;
883
+ }
884
+
885
+ const branch = normalizeSimpleBranch(branches[0]);
886
+ if (!branch || branch.length !== 1) {
887
+ return;
888
+ }
889
+
890
+ chars.push(branch);
891
+ index += match.end + 1;
892
+ }
893
+
894
+ if (chars.length < 1) {
895
+ return;
896
+ }
897
+
898
+ const source = chars.length === 1
899
+ ? utils.escapeRegex(chars[0])
900
+ : `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`;
901
+
902
+ return `${source}*`;
903
+ };
904
+
905
+ const repeatedExtglobRecursion = pattern => {
906
+ let depth = 0;
907
+ let value = pattern.trim();
908
+ let match = parseRepeatedExtglob(value);
909
+
910
+ while (match) {
911
+ depth++;
912
+ value = match.body.trim();
913
+ match = parseRepeatedExtglob(value);
914
+ }
915
+
916
+ return depth;
917
+ };
918
+
919
+ const analyzeRepeatedExtglob = (body, options) => {
920
+ if (options.maxExtglobRecursion === false) {
921
+ return { risky: false };
922
+ }
923
+
924
+ const max =
925
+ typeof options.maxExtglobRecursion === 'number'
926
+ ? options.maxExtglobRecursion
927
+ : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
928
+
929
+ const branches = splitTopLevel(body).map(branch => branch.trim());
930
+
931
+ if (branches.length > 1) {
932
+ if (
933
+ branches.some(branch => branch === '') ||
934
+ branches.some(branch => /^[*?]+$/.test(branch)) ||
935
+ hasRepeatedCharPrefixOverlap(branches)
936
+ ) {
937
+ return { risky: true };
938
+ }
939
+ }
940
+
941
+ for (const branch of branches) {
942
+ const safeOutput = getStarExtglobSequenceOutput(branch);
943
+ if (safeOutput) {
944
+ return { risky: true, safeOutput };
945
+ }
946
+
947
+ if (repeatedExtglobRecursion(branch) > max) {
948
+ return { risky: true };
949
+ }
950
+ }
951
+
952
+ return { risky: false };
953
+ };
954
+
955
+ const parse = (input, options) => {
956
+ if (typeof input !== 'string') {
957
+ throw new TypeError('Expected a string');
958
+ }
959
+
960
+ input = REPLACEMENTS[input] || input;
961
+
962
+ const opts = { ...options };
963
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
964
+
965
+ let len = input.length;
966
+ if (len > max) {
967
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
968
+ }
969
+
970
+ const bos = { type: 'bos', value: '', output: opts.prepend || '' };
971
+ const tokens = [bos];
972
+
973
+ const capture = opts.capture ? '' : '?:';
974
+
975
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
976
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
977
+
978
+ const {
979
+ DOT_LITERAL,
980
+ PLUS_LITERAL,
981
+ SLASH_LITERAL,
982
+ ONE_CHAR,
983
+ DOTS_SLASH,
984
+ NO_DOT,
985
+ NO_DOT_SLASH,
986
+ NO_DOTS_SLASH,
987
+ QMARK,
988
+ QMARK_NO_DOT,
989
+ STAR,
990
+ START_ANCHOR
991
+ } = PLATFORM_CHARS;
992
+
993
+ const globstar = opts => {
994
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
995
+ };
996
+
997
+ const nodot = opts.dot ? '' : NO_DOT;
998
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
999
+ let star = opts.bash === true ? globstar(opts) : STAR;
1000
+
1001
+ if (opts.capture) {
1002
+ star = `(${star})`;
1003
+ }
1004
+
1005
+ if (typeof opts.noext === 'boolean') {
1006
+ opts.noextglob = opts.noext;
1007
+ }
1008
+
1009
+ const state = {
1010
+ input,
1011
+ index: -1,
1012
+ start: 0,
1013
+ dot: opts.dot === true,
1014
+ consumed: '',
1015
+ output: '',
1016
+ prefix: '',
1017
+ backtrack: false,
1018
+ negated: false,
1019
+ brackets: 0,
1020
+ braces: 0,
1021
+ parens: 0,
1022
+ quotes: 0,
1023
+ globstar: false,
1024
+ tokens
1025
+ };
1026
+
1027
+ input = utils.removePrefix(input, state);
1028
+ len = input.length;
1029
+
1030
+ const extglobs = [];
1031
+ const braces = [];
1032
+ const stack = [];
1033
+ let prev = bos;
1034
+ let value;
1035
+
1036
+ const eos = () => state.index === len - 1;
1037
+ const peek = state.peek = (n = 1) => input[state.index + n];
1038
+ const advance = state.advance = () => input[++state.index] || '';
1039
+ const remaining = () => input.slice(state.index + 1);
1040
+ const consume = (value = '', num = 0) => {
1041
+ state.consumed += value;
1042
+ state.index += num;
1043
+ };
1044
+
1045
+ const append = token => {
1046
+ state.output += token.output != null ? token.output : token.value;
1047
+ consume(token.value);
1048
+ };
1049
+
1050
+ const negate = () => {
1051
+ let count = 1;
1052
+
1053
+ while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
1054
+ advance();
1055
+ state.start++;
1056
+ count++;
1057
+ }
1058
+
1059
+ if (count % 2 === 0) {
1060
+ return false;
1061
+ }
1062
+
1063
+ state.negated = true;
1064
+ state.start++;
1065
+ return true;
1066
+ };
1067
+
1068
+ const increment = type => {
1069
+ state[type]++;
1070
+ stack.push(type);
1071
+ };
1072
+
1073
+ const decrement = type => {
1074
+ state[type]--;
1075
+ stack.pop();
1076
+ };
1077
+
1078
+ const push = tok => {
1079
+ if (prev.type === 'globstar') {
1080
+ const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
1081
+ const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
1082
+
1083
+ if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
1084
+ state.output = state.output.slice(0, -prev.output.length);
1085
+ prev.type = 'star';
1086
+ prev.value = '*';
1087
+ prev.output = star;
1088
+ state.output += prev.output;
1089
+ }
1090
+ }
1091
+
1092
+ if (extglobs.length && tok.type !== 'paren') {
1093
+ extglobs[extglobs.length - 1].inner += tok.value;
1094
+ }
1095
+
1096
+ if (tok.value || tok.output) append(tok);
1097
+ if (prev && prev.type === 'text' && tok.type === 'text') {
1098
+ prev.output = (prev.output || prev.value) + tok.value;
1099
+ prev.value += tok.value;
1100
+ return;
1101
+ }
1102
+
1103
+ tok.prev = prev;
1104
+ tokens.push(tok);
1105
+ prev = tok;
1106
+ };
1107
+
1108
+ const extglobOpen = (type, value) => {
1109
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
1110
+
1111
+ token.prev = prev;
1112
+ token.parens = state.parens;
1113
+ token.output = state.output;
1114
+ token.startIndex = state.index;
1115
+ token.tokensIndex = tokens.length;
1116
+ const output = (opts.capture ? '(' : '') + token.open;
1117
+
1118
+ increment('parens');
1119
+ push({ type, value, output: state.output ? '' : ONE_CHAR });
1120
+ push({ type: 'paren', extglob: true, value: advance(), output });
1121
+ extglobs.push(token);
1122
+ };
1123
+
1124
+ const extglobClose = token => {
1125
+ const literal = input.slice(token.startIndex, state.index + 1);
1126
+ const body = input.slice(token.startIndex + 2, state.index);
1127
+ const analysis = analyzeRepeatedExtglob(body, opts);
1128
+
1129
+ if ((token.type === 'plus' || token.type === 'star') && analysis.risky) {
1130
+ const safeOutput = analysis.safeOutput
1131
+ ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput)
1132
+ : undefined;
1133
+ const open = tokens[token.tokensIndex];
1134
+
1135
+ open.type = 'text';
1136
+ open.value = literal;
1137
+ open.output = safeOutput || utils.escapeRegex(literal);
1138
+
1139
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
1140
+ tokens[i].value = '';
1141
+ tokens[i].output = '';
1142
+ delete tokens[i].suffix;
1143
+ }
1144
+
1145
+ state.output = token.output + open.output;
1146
+ state.backtrack = true;
1147
+
1148
+ push({ type: 'paren', extglob: true, value, output: '' });
1149
+ decrement('parens');
1150
+ return;
1151
+ }
1152
+
1153
+ let output = token.close + (opts.capture ? ')' : '');
1154
+ let rest;
1155
+
1156
+ if (token.type === 'negate') {
1157
+ let extglobStar = star;
1158
+
1159
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
1160
+ extglobStar = globstar(opts);
1161
+ }
1162
+
1163
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
1164
+ output = token.close = `)$))${extglobStar}`;
1165
+ }
1166
+
1167
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
1168
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
1169
+
1170
+ output = token.close = `)${expression})${extglobStar})`;
1171
+ }
1172
+
1173
+ if (token.prev.type === 'bos') {
1174
+ state.negatedExtglob = true;
1175
+ }
1176
+ }
1177
+
1178
+ push({ type: 'paren', extglob: true, value, output });
1179
+ decrement('parens');
1180
+ };
1181
+
1182
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
1183
+ let backslashes = false;
1184
+
1185
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
1186
+ if (first === '\\') {
1187
+ backslashes = true;
1188
+ return m;
1189
+ }
1190
+
1191
+ if (first === '?') {
1192
+ if (esc) {
1193
+ return esc + first + (rest ? QMARK.repeat(rest.length) : '');
1194
+ }
1195
+ if (index === 0) {
1196
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
1197
+ }
1198
+ return QMARK.repeat(chars.length);
1199
+ }
1200
+
1201
+ if (first === '.') {
1202
+ return DOT_LITERAL.repeat(chars.length);
1203
+ }
1204
+
1205
+ if (first === '*') {
1206
+ if (esc) {
1207
+ return esc + first + (rest ? star : '');
1208
+ }
1209
+ return star;
1210
+ }
1211
+ return esc ? m : `\\${m}`;
1212
+ });
1213
+
1214
+ if (backslashes === true) {
1215
+ if (opts.unescape === true) {
1216
+ output = output.replace(/\\/g, '');
1217
+ } else {
1218
+ output = output.replace(/\\+/g, m => {
1219
+ return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
1220
+ });
1221
+ }
1222
+ }
1223
+
1224
+ if (output === input && opts.contains === true) {
1225
+ state.output = input;
1226
+ return state;
1227
+ }
1228
+
1229
+ state.output = utils.wrapOutput(output, state, options);
1230
+ return state;
1231
+ }
1232
+
1233
+ while (!eos()) {
1234
+ value = advance();
1235
+
1236
+ if (value === '\u0000') {
1237
+ continue;
1238
+ }
1239
+
1240
+ if (value === '\\') {
1241
+ const next = peek();
1242
+
1243
+ if (next === '/' && opts.bash !== true) {
1244
+ continue;
1245
+ }
1246
+
1247
+ if (next === '.' || next === ';') {
1248
+ continue;
1249
+ }
1250
+
1251
+ if (!next) {
1252
+ value += '\\';
1253
+ push({ type: 'text', value });
1254
+ continue;
1255
+ }
1256
+
1257
+ const match = /^\\+/.exec(remaining());
1258
+ let slashes = 0;
1259
+
1260
+ if (match && match[0].length > 2) {
1261
+ slashes = match[0].length;
1262
+ state.index += slashes;
1263
+ if (slashes % 2 !== 0) {
1264
+ value += '\\';
1265
+ }
1266
+ }
1267
+
1268
+ if (opts.unescape === true) {
1269
+ value = advance();
1270
+ } else {
1271
+ value += advance();
1272
+ }
1273
+
1274
+ if (state.brackets === 0) {
1275
+ push({ type: 'text', value });
1276
+ continue;
1277
+ }
1278
+ }
1279
+
1280
+ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
1281
+ if (opts.posix !== false && value === ':') {
1282
+ const inner = prev.value.slice(1);
1283
+ if (inner.includes('[')) {
1284
+ prev.posix = true;
1285
+
1286
+ if (inner.includes(':')) {
1287
+ const idx = prev.value.lastIndexOf('[');
1288
+ const pre = prev.value.slice(0, idx);
1289
+ const rest = prev.value.slice(idx + 2);
1290
+ const posix = POSIX_REGEX_SOURCE[rest];
1291
+ if (posix) {
1292
+ prev.value = pre + posix;
1293
+ state.backtrack = true;
1294
+ advance();
1295
+
1296
+ if (!bos.output && tokens.indexOf(prev) === 1) {
1297
+ bos.output = ONE_CHAR;
1298
+ }
1299
+ continue;
1300
+ }
1301
+ }
1302
+ }
1303
+ }
1304
+
1305
+ if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
1306
+ value = `\\${value}`;
1307
+ }
1308
+
1309
+ if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
1310
+ value = `\\${value}`;
1311
+ }
1312
+
1313
+ if (opts.posix === true && value === '!' && prev.value === '[') {
1314
+ value = '^';
1315
+ }
1316
+
1317
+ prev.value += value;
1318
+ append({ value });
1319
+ continue;
1320
+ }
1321
+
1322
+ if (state.quotes === 1 && value !== '"') {
1323
+ value = utils.escapeRegex(value);
1324
+ prev.value += value;
1325
+ append({ value });
1326
+ continue;
1327
+ }
1328
+
1329
+ if (value === '"') {
1330
+ state.quotes = state.quotes === 1 ? 0 : 1;
1331
+ if (opts.keepQuotes === true) {
1332
+ push({ type: 'text', value });
1333
+ }
1334
+ continue;
1335
+ }
1336
+
1337
+ if (value === '(') {
1338
+ increment('parens');
1339
+ push({ type: 'paren', value });
1340
+ continue;
1341
+ }
1342
+
1343
+ if (value === ')') {
1344
+ if (state.parens === 0 && opts.strictBrackets === true) {
1345
+ throw new SyntaxError(syntaxError('opening', '('));
1346
+ }
1347
+
1348
+ const extglob = extglobs[extglobs.length - 1];
1349
+ if (extglob && state.parens === extglob.parens + 1) {
1350
+ extglobClose(extglobs.pop());
1351
+ continue;
1352
+ }
1353
+
1354
+ push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
1355
+ decrement('parens');
1356
+ continue;
1357
+ }
1358
+
1359
+ if (value === '[') {
1360
+ if (opts.nobracket === true || !remaining().includes(']')) {
1361
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
1362
+ throw new SyntaxError(syntaxError('closing', ']'));
1363
+ }
1364
+
1365
+ value = `\\${value}`;
1366
+ } else {
1367
+ increment('brackets');
1368
+ }
1369
+
1370
+ push({ type: 'bracket', value });
1371
+ continue;
1372
+ }
1373
+
1374
+ if (value === ']') {
1375
+ if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
1376
+ push({ type: 'text', value, output: `\\${value}` });
1377
+ continue;
1378
+ }
1379
+
1380
+ if (state.brackets === 0) {
1381
+ if (opts.strictBrackets === true) {
1382
+ throw new SyntaxError(syntaxError('opening', '['));
1383
+ }
1384
+
1385
+ push({ type: 'text', value, output: `\\${value}` });
1386
+ continue;
1387
+ }
1388
+
1389
+ decrement('brackets');
1390
+
1391
+ const prevValue = prev.value.slice(1);
1392
+ if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
1393
+ value = `/${value}`;
1394
+ }
1395
+
1396
+ prev.value += value;
1397
+ append({ value });
1398
+
1399
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
1400
+ continue;
1401
+ }
1402
+
1403
+ const escaped = utils.escapeRegex(prev.value);
1404
+ state.output = state.output.slice(0, -prev.value.length);
1405
+
1406
+ if (opts.literalBrackets === true) {
1407
+ state.output += escaped;
1408
+ prev.value = escaped;
1409
+ continue;
1410
+ }
1411
+
1412
+ prev.value = `(${capture}${escaped}|${prev.value})`;
1413
+ state.output += prev.value;
1414
+ continue;
1415
+ }
1416
+
1417
+ if (value === '{' && opts.nobrace !== true) {
1418
+ increment('braces');
1419
+
1420
+ const open = {
1421
+ type: 'brace',
1422
+ value,
1423
+ output: '(',
1424
+ outputIndex: state.output.length,
1425
+ tokensIndex: state.tokens.length
1426
+ };
1427
+
1428
+ braces.push(open);
1429
+ push(open);
1430
+ continue;
1431
+ }
1432
+
1433
+ if (value === '}') {
1434
+ const brace = braces[braces.length - 1];
1435
+
1436
+ if (opts.nobrace === true || !brace) {
1437
+ push({ type: 'text', value, output: value });
1438
+ continue;
1439
+ }
1440
+
1441
+ let output = ')';
1442
+
1443
+ if (brace.dots === true) {
1444
+ const arr = tokens.slice();
1445
+ const range = [];
1446
+
1447
+ for (let i = arr.length - 1; i >= 0; i--) {
1448
+ tokens.pop();
1449
+ if (arr[i].type === 'brace') {
1450
+ break;
1451
+ }
1452
+ if (arr[i].type !== 'dots') {
1453
+ range.unshift(arr[i].value);
1454
+ }
1455
+ }
1456
+
1457
+ output = expandRange(range, opts);
1458
+ state.backtrack = true;
1459
+ }
1460
+
1461
+ if (brace.comma !== true && brace.dots !== true) {
1462
+ const out = state.output.slice(0, brace.outputIndex);
1463
+ const toks = state.tokens.slice(brace.tokensIndex);
1464
+ brace.value = brace.output = '\\{';
1465
+ value = output = '\\}';
1466
+ state.output = out;
1467
+ for (const t of toks) {
1468
+ state.output += (t.output || t.value);
1469
+ }
1470
+ }
1471
+
1472
+ push({ type: 'brace', value, output });
1473
+ decrement('braces');
1474
+ braces.pop();
1475
+ continue;
1476
+ }
1477
+
1478
+ if (value === '|') {
1479
+ if (extglobs.length > 0) {
1480
+ extglobs[extglobs.length - 1].conditions++;
1481
+ }
1482
+ push({ type: 'text', value });
1483
+ continue;
1484
+ }
1485
+
1486
+ if (value === ',') {
1487
+ let output = value;
1488
+
1489
+ const brace = braces[braces.length - 1];
1490
+ if (brace && stack[stack.length - 1] === 'braces') {
1491
+ brace.comma = true;
1492
+ output = '|';
1493
+ }
1494
+
1495
+ push({ type: 'comma', value, output });
1496
+ continue;
1497
+ }
1498
+
1499
+ if (value === '/') {
1500
+ if (prev.type === 'dot' && state.index === state.start + 1) {
1501
+ state.start = state.index + 1;
1502
+ state.consumed = '';
1503
+ state.output = '';
1504
+ tokens.pop();
1505
+ prev = bos;
1506
+ continue;
1507
+ }
1508
+
1509
+ push({ type: 'slash', value, output: SLASH_LITERAL });
1510
+ continue;
1511
+ }
1512
+
1513
+ if (value === '.') {
1514
+ if (state.braces > 0 && prev.type === 'dot') {
1515
+ if (prev.value === '.') prev.output = DOT_LITERAL;
1516
+ const brace = braces[braces.length - 1];
1517
+ prev.type = 'dots';
1518
+ prev.output += value;
1519
+ prev.value += value;
1520
+ brace.dots = true;
1521
+ continue;
1522
+ }
1523
+
1524
+ if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
1525
+ push({ type: 'text', value, output: DOT_LITERAL });
1526
+ continue;
1527
+ }
1528
+
1529
+ push({ type: 'dot', value, output: DOT_LITERAL });
1530
+ continue;
1531
+ }
1532
+
1533
+ if (value === '?') {
1534
+ const isGroup = prev && prev.value === '(';
1535
+ if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1536
+ extglobOpen('qmark', value);
1537
+ continue;
1538
+ }
1539
+
1540
+ if (prev && prev.type === 'paren') {
1541
+ const next = peek();
1542
+ let output = value;
1543
+
1544
+ if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
1545
+ output = `\\${value}`;
1546
+ }
1547
+
1548
+ push({ type: 'text', value, output });
1549
+ continue;
1550
+ }
1551
+
1552
+ if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
1553
+ push({ type: 'qmark', value, output: QMARK_NO_DOT });
1554
+ continue;
1555
+ }
1556
+
1557
+ push({ type: 'qmark', value, output: QMARK });
1558
+ continue;
1559
+ }
1560
+
1561
+ if (value === '!') {
1562
+ if (opts.noextglob !== true && peek() === '(') {
1563
+ if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
1564
+ extglobOpen('negate', value);
1565
+ continue;
1566
+ }
1567
+ }
1568
+
1569
+ if (opts.nonegate !== true && state.index === 0) {
1570
+ negate();
1571
+ continue;
1572
+ }
1573
+ }
1574
+
1575
+ if (value === '+') {
1576
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1577
+ extglobOpen('plus', value);
1578
+ continue;
1579
+ }
1580
+
1581
+ if ((prev && prev.value === '(') || opts.regex === false) {
1582
+ push({ type: 'plus', value, output: PLUS_LITERAL });
1583
+ continue;
1584
+ }
1585
+
1586
+ if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
1587
+ push({ type: 'plus', value });
1588
+ continue;
1589
+ }
1590
+
1591
+ push({ type: 'plus', value: PLUS_LITERAL });
1592
+ continue;
1593
+ }
1594
+
1595
+ if (value === '@') {
1596
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1597
+ push({ type: 'at', extglob: true, value, output: '' });
1598
+ continue;
1599
+ }
1600
+
1601
+ push({ type: 'text', value });
1602
+ continue;
1603
+ }
1604
+
1605
+ if (value !== '*') {
1606
+ if (value === '$' || value === '^') {
1607
+ value = `\\${value}`;
1608
+ }
1609
+
1610
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
1611
+ if (match) {
1612
+ value += match[0];
1613
+ state.index += match[0].length;
1614
+ }
1615
+
1616
+ push({ type: 'text', value });
1617
+ continue;
1618
+ }
1619
+
1620
+ if (prev && (prev.type === 'globstar' || prev.star === true)) {
1621
+ prev.type = 'star';
1622
+ prev.star = true;
1623
+ prev.value += value;
1624
+ prev.output = star;
1625
+ state.backtrack = true;
1626
+ state.globstar = true;
1627
+ consume(value);
1628
+ continue;
1629
+ }
1630
+
1631
+ let rest = remaining();
1632
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
1633
+ extglobOpen('star', value);
1634
+ continue;
1635
+ }
1636
+
1637
+ if (prev.type === 'star') {
1638
+ if (opts.noglobstar === true) {
1639
+ consume(value);
1640
+ continue;
1641
+ }
1642
+
1643
+ const prior = prev.prev;
1644
+ const before = prior.prev;
1645
+ const isStart = prior.type === 'slash' || prior.type === 'bos';
1646
+ const afterStar = before && (before.type === 'star' || before.type === 'globstar');
1647
+
1648
+ if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
1649
+ push({ type: 'star', value, output: '' });
1650
+ continue;
1651
+ }
1652
+
1653
+ const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
1654
+ const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
1655
+ if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
1656
+ push({ type: 'star', value, output: '' });
1657
+ continue;
1658
+ }
1659
+
1660
+ while (rest.slice(0, 3) === '/**') {
1661
+ const after = input[state.index + 4];
1662
+ if (after && after !== '/') {
1663
+ break;
1664
+ }
1665
+ rest = rest.slice(3);
1666
+ consume('/**', 3);
1667
+ }
1668
+
1669
+ if (prior.type === 'bos' && eos()) {
1670
+ prev.type = 'globstar';
1671
+ prev.value += value;
1672
+ prev.output = globstar(opts);
1673
+ state.output = prev.output;
1674
+ state.globstar = true;
1675
+ consume(value);
1676
+ continue;
1677
+ }
1678
+
1679
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
1680
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1681
+ prior.output = `(?:${prior.output}`;
1682
+
1683
+ prev.type = 'globstar';
1684
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
1685
+ prev.value += value;
1686
+ state.globstar = true;
1687
+ state.output += prior.output + prev.output;
1688
+ consume(value);
1689
+ continue;
1690
+ }
1691
+
1692
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
1693
+ const end = rest[1] !== void 0 ? '|$' : '';
1694
+
1695
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1696
+ prior.output = `(?:${prior.output}`;
1697
+
1698
+ prev.type = 'globstar';
1699
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
1700
+ prev.value += value;
1701
+
1702
+ state.output += prior.output + prev.output;
1703
+ state.globstar = true;
1704
+
1705
+ consume(value + advance());
1706
+
1707
+ push({ type: 'slash', value: '/', output: '' });
1708
+ continue;
1709
+ }
1710
+
1711
+ if (prior.type === 'bos' && rest[0] === '/') {
1712
+ prev.type = 'globstar';
1713
+ prev.value += value;
1714
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
1715
+ state.output = prev.output;
1716
+ state.globstar = true;
1717
+ consume(value + advance());
1718
+ push({ type: 'slash', value: '/', output: '' });
1719
+ continue;
1720
+ }
1721
+
1722
+ state.output = state.output.slice(0, -prev.output.length);
1723
+
1724
+ prev.type = 'globstar';
1725
+ prev.output = globstar(opts);
1726
+ prev.value += value;
1727
+
1728
+ state.output += prev.output;
1729
+ state.globstar = true;
1730
+ consume(value);
1731
+ continue;
1732
+ }
1733
+
1734
+ const token = { type: 'star', value, output: star };
1735
+
1736
+ if (opts.bash === true) {
1737
+ token.output = '.*?';
1738
+ if (prev.type === 'bos' || prev.type === 'slash') {
1739
+ token.output = nodot + token.output;
1740
+ }
1741
+ push(token);
1742
+ continue;
1743
+ }
1744
+
1745
+ if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
1746
+ token.output = value;
1747
+ push(token);
1748
+ continue;
1749
+ }
1750
+
1751
+ if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
1752
+ if (prev.type === 'dot') {
1753
+ state.output += NO_DOT_SLASH;
1754
+ prev.output += NO_DOT_SLASH;
1755
+
1756
+ } else if (opts.dot === true) {
1757
+ state.output += NO_DOTS_SLASH;
1758
+ prev.output += NO_DOTS_SLASH;
1759
+
1760
+ } else {
1761
+ state.output += nodot;
1762
+ prev.output += nodot;
1763
+ }
1764
+
1765
+ if (peek() !== '*') {
1766
+ state.output += ONE_CHAR;
1767
+ prev.output += ONE_CHAR;
1768
+ }
1769
+ }
1770
+
1771
+ push(token);
1772
+ }
1773
+
1774
+ while (state.brackets > 0) {
1775
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
1776
+ state.output = utils.escapeLast(state.output, '[');
1777
+ decrement('brackets');
1778
+ }
1779
+
1780
+ while (state.parens > 0) {
1781
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
1782
+ state.output = utils.escapeLast(state.output, '(');
1783
+ decrement('parens');
1784
+ }
1785
+
1786
+ while (state.braces > 0) {
1787
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
1788
+ state.output = utils.escapeLast(state.output, '{');
1789
+ decrement('braces');
1790
+ }
1791
+
1792
+ if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
1793
+ push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
1794
+ }
1795
+
1796
+ if (state.backtrack === true) {
1797
+ state.output = '';
1798
+
1799
+ for (const token of state.tokens) {
1800
+ state.output += token.output != null ? token.output : token.value;
1801
+
1802
+ if (token.suffix) {
1803
+ state.output += token.suffix;
1804
+ }
1805
+ }
1806
+ }
1807
+
1808
+ return state;
1809
+ };
1810
+
1811
+ parse.fastpaths = (input, options) => {
1812
+ const opts = { ...options };
1813
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1814
+ const len = input.length;
1815
+ if (len > max) {
1816
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1817
+ }
1818
+
1819
+ input = REPLACEMENTS[input] || input;
1820
+
1821
+ const {
1822
+ DOT_LITERAL,
1823
+ SLASH_LITERAL,
1824
+ ONE_CHAR,
1825
+ DOTS_SLASH,
1826
+ NO_DOT,
1827
+ NO_DOTS,
1828
+ NO_DOTS_SLASH,
1829
+ STAR,
1830
+ START_ANCHOR
1831
+ } = constants.globChars(opts.windows);
1832
+
1833
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
1834
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1835
+ const capture = opts.capture ? '' : '?:';
1836
+ const state = { negated: false, prefix: '' };
1837
+ let star = opts.bash === true ? '.*?' : STAR;
1838
+
1839
+ if (opts.capture) {
1840
+ star = `(${star})`;
1841
+ }
1842
+
1843
+ const globstar = opts => {
1844
+ if (opts.noglobstar === true) return star;
1845
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1846
+ };
1847
+
1848
+ const create = str => {
1849
+ switch (str) {
1850
+ case '*':
1851
+ return `${nodot}${ONE_CHAR}${star}`;
1852
+
1853
+ case '.*':
1854
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
1855
+
1856
+ case '*.*':
1857
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1858
+
1859
+ case '*/*':
1860
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
1861
+
1862
+ case '**':
1863
+ return nodot + globstar(opts);
1864
+
1865
+ case '**/*':
1866
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
1867
+
1868
+ case '**/*.*':
1869
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1870
+
1871
+ case '**/.*':
1872
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
1873
+
1874
+ default: {
1875
+ const match = /^(.*?)\.(\w+)$/.exec(str);
1876
+ if (!match) return;
1877
+
1878
+ const source = create(match[1]);
1879
+ if (!source) return;
1880
+
1881
+ return source + DOT_LITERAL + match[2];
1882
+ }
1883
+ }
1884
+ };
1885
+
1886
+ const output = utils.removePrefix(input, state);
1887
+ let source = create(output);
1888
+
1889
+ if (source && opts.strictSlashes !== true) {
1890
+ source += `${SLASH_LITERAL}?`;
1891
+ }
1892
+
1893
+ return source;
1894
+ };
1895
+
1896
+ parse_1 = parse;
1897
+ return parse_1;
1898
+ }
1899
+
1900
+ var picomatch_1$1;
1901
+ var hasRequiredPicomatch$1;
1902
+
1903
+ function requirePicomatch$1 () {
1904
+ if (hasRequiredPicomatch$1) return picomatch_1$1;
1905
+ hasRequiredPicomatch$1 = 1;
1906
+
1907
+ const scan = /*@__PURE__*/ requireScan();
1908
+ const parse = /*@__PURE__*/ requireParse();
1909
+ const utils = /*@__PURE__*/ requireUtils();
1910
+ const constants = /*@__PURE__*/ requireConstants();
1911
+ const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
1912
+
1913
+ const picomatch = (glob, options, returnState = false) => {
1914
+ if (Array.isArray(glob)) {
1915
+ const fns = glob.map(input => picomatch(input, options, returnState));
1916
+ const arrayMatcher = str => {
1917
+ for (const isMatch of fns) {
1918
+ const state = isMatch(str);
1919
+ if (state) return state;
1920
+ }
1921
+ return false;
1922
+ };
1923
+ return arrayMatcher;
1924
+ }
1925
+
1926
+ const isState = isObject(glob) && glob.tokens && glob.input;
1927
+
1928
+ if (glob === '' || (typeof glob !== 'string' && !isState)) {
1929
+ throw new TypeError('Expected pattern to be a non-empty string');
1930
+ }
1931
+
1932
+ const opts = options || {};
1933
+ const posix = opts.windows;
1934
+ const regex = isState
1935
+ ? picomatch.compileRe(glob, options)
1936
+ : picomatch.makeRe(glob, options, false, true);
1937
+
1938
+ const state = regex.state;
1939
+ delete regex.state;
1940
+
1941
+ let isIgnored = () => false;
1942
+ if (opts.ignore) {
1943
+ const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
1944
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
1945
+ }
1946
+
1947
+ const matcher = (input, returnObject = false) => {
1948
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
1949
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
1950
+
1951
+ if (typeof opts.onResult === 'function') {
1952
+ opts.onResult(result);
1953
+ }
1954
+
1955
+ if (isMatch === false) {
1956
+ result.isMatch = false;
1957
+ return returnObject ? result : false;
1958
+ }
1959
+
1960
+ if (isIgnored(input)) {
1961
+ if (typeof opts.onIgnore === 'function') {
1962
+ opts.onIgnore(result);
1963
+ }
1964
+ result.isMatch = false;
1965
+ return returnObject ? result : false;
1966
+ }
1967
+
1968
+ if (typeof opts.onMatch === 'function') {
1969
+ opts.onMatch(result);
1970
+ }
1971
+ return returnObject ? result : true;
1972
+ };
1973
+
1974
+ if (returnState) {
1975
+ matcher.state = state;
1976
+ }
1977
+
1978
+ return matcher;
1979
+ };
1980
+
1981
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
1982
+ if (typeof input !== 'string') {
1983
+ throw new TypeError('Expected input to be a string');
1984
+ }
1985
+
1986
+ if (input === '') {
1987
+ return { isMatch: false, output: '' };
1988
+ }
1989
+
1990
+ const opts = options || {};
1991
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
1992
+ let match = input === glob;
1993
+ let output = (match && format) ? format(input) : input;
1994
+
1995
+ if (match === false) {
1996
+ output = format ? format(input) : input;
1997
+ match = output === glob;
1998
+ }
1999
+
2000
+ if (match === false || opts.capture === true) {
2001
+ if (opts.matchBase === true || opts.basename === true) {
2002
+ match = picomatch.matchBase(input, regex, options, posix);
2003
+ } else {
2004
+ match = regex.exec(output);
2005
+ }
2006
+ }
2007
+
2008
+ return { isMatch: Boolean(match), match, output };
2009
+ };
2010
+
2011
+ picomatch.matchBase = (input, glob, options) => {
2012
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
2013
+ return regex.test(utils.basename(input));
2014
+ };
2015
+
2016
+ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
2017
+
2018
+ picomatch.parse = (pattern, options) => {
2019
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
2020
+ return parse(pattern, { ...options, fastpaths: false });
2021
+ };
2022
+
2023
+ picomatch.scan = (input, options) => scan(input, options);
2024
+
2025
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
2026
+ if (returnOutput === true) {
2027
+ return state.output;
2028
+ }
2029
+
2030
+ const opts = options || {};
2031
+ const prepend = opts.contains ? '' : '^';
2032
+ const append = opts.contains ? '' : '$';
2033
+
2034
+ let source = `${prepend}(?:${state.output})${append}`;
2035
+ if (state && state.negated === true) {
2036
+ source = `^(?!${source}).*$`;
2037
+ }
2038
+
2039
+ const regex = picomatch.toRegex(source, options);
2040
+ if (returnState === true) {
2041
+ regex.state = state;
2042
+ }
2043
+
2044
+ return regex;
2045
+ };
2046
+
2047
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2048
+ if (!input || typeof input !== 'string') {
2049
+ throw new TypeError('Expected a non-empty string');
2050
+ }
2051
+
2052
+ let parsed = { negated: false, fastpaths: true };
2053
+
2054
+ if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
2055
+ parsed.output = parse.fastpaths(input, options);
2056
+ }
2057
+
2058
+ if (!parsed.output) {
2059
+ parsed = parse(input, options);
2060
+ }
2061
+
2062
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
2063
+ };
2064
+
2065
+ picomatch.toRegex = (source, options) => {
2066
+ try {
2067
+ const opts = options || {};
2068
+ return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
2069
+ } catch (err) {
2070
+ if (options && options.debug === true) throw err;
2071
+ return /$^/;
2072
+ }
2073
+ };
2074
+
2075
+ picomatch.constants = constants;
2076
+
2077
+ picomatch_1$1 = picomatch;
2078
+ return picomatch_1$1;
2079
+ }
2080
+
2081
+ var picomatch_1;
2082
+ var hasRequiredPicomatch;
2083
+
2084
+ function requirePicomatch () {
2085
+ if (hasRequiredPicomatch) return picomatch_1;
2086
+ hasRequiredPicomatch = 1;
2087
+
2088
+ const pico = /*@__PURE__*/ requirePicomatch$1();
2089
+ const utils = /*@__PURE__*/ requireUtils();
2090
+
2091
+ function picomatch(glob, options, returnState = false) {
2092
+ if (options && (options.windows === null || options.windows === undefined)) {
2093
+ options = { ...options, windows: utils.isWindows() };
2094
+ }
2095
+
2096
+ return pico(glob, options, returnState);
2097
+ }
2098
+
2099
+ Object.assign(picomatch, pico);
2100
+ picomatch_1 = picomatch;
2101
+ return picomatch_1;
2102
+ }
2103
+
2104
+ var picomatchExports = /*@__PURE__*/ requirePicomatch();
2105
+ const pm = /*@__PURE__*/getDefaultExportFromCjs(picomatchExports);
2106
+
2107
+ function isArray(arg) {
2108
+ return Array.isArray(arg);
2109
+ }
2110
+ function ensureArray(thing) {
2111
+ if (isArray(thing))
2112
+ return thing;
2113
+ if (thing == null)
2114
+ return [];
2115
+ return [thing];
2116
+ }
2117
+
2118
+ const normalizePathRegExp = new RegExp(`\\${win32.sep}`, 'g');
2119
+ const normalizePath$1 = function normalizePath(filename) {
2120
+ return filename.replace(normalizePathRegExp, posix.sep);
2121
+ };
2122
+
2123
+ function getMatcherString(id, resolutionBase) {
2124
+ if (resolutionBase === false || isAbsolute(id) || id.startsWith('**')) {
2125
+ return normalizePath$1(id);
2126
+ }
2127
+ const basePath = normalizePath$1(resolve$2(resolutionBase || ''))
2128
+ .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
2129
+ return posix.join(basePath, normalizePath$1(id));
2130
+ }
2131
+ const createFilter = function createFilter(include, exclude, options) {
2132
+ const resolutionBase = options && options.resolve;
2133
+ const getMatcher = (id) => id instanceof RegExp
2134
+ ? id
2135
+ : {
2136
+ test: (what) => {
2137
+ const pattern = getMatcherString(id, resolutionBase);
2138
+ const fn = pm(pattern, { dot: true });
2139
+ const result = fn(what);
2140
+ return result;
2141
+ }
2142
+ };
2143
+ const includeMatchers = ensureArray(include).map(getMatcher);
2144
+ const excludeMatchers = ensureArray(exclude).map(getMatcher);
2145
+ if (!includeMatchers.length && !excludeMatchers.length)
2146
+ return (id) => typeof id === 'string' && !id.includes('\0');
2147
+ return function result(id) {
2148
+ if (typeof id !== 'string')
2149
+ return false;
2150
+ if (id.includes('\0'))
2151
+ return false;
2152
+ const pathId = normalizePath$1(id);
2153
+ for (let i = 0; i < excludeMatchers.length; ++i) {
2154
+ const matcher = excludeMatchers[i];
2155
+ if (matcher instanceof RegExp) {
2156
+ matcher.lastIndex = 0;
2157
+ }
2158
+ if (matcher.test(pathId))
2159
+ return false;
2160
+ }
2161
+ for (let i = 0; i < includeMatchers.length; ++i) {
2162
+ const matcher = includeMatchers[i];
2163
+ if (matcher instanceof RegExp) {
2164
+ matcher.lastIndex = 0;
2165
+ }
2166
+ if (matcher.test(pathId))
2167
+ return true;
2168
+ }
2169
+ return !includeMatchers.length;
2170
+ };
2171
+ };
2172
+
2173
+ const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
2174
+ const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
2175
+ const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));
2176
+ forbiddenIdentifiers.add('');
2177
+
2178
+ var homedir;
2179
+ var hasRequiredHomedir;
2180
+
2181
+ function requireHomedir () {
2182
+ if (hasRequiredHomedir) return homedir;
2183
+ hasRequiredHomedir = 1;
2184
+
2185
+ var os = require$$0__default;
2186
+
2187
+ homedir = os.homedir || function homedir() {
2188
+ var home = process.env.HOME;
2189
+ var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
2190
+
2191
+ if (process.platform === 'win32') {
2192
+ return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null;
2193
+ }
2194
+
2195
+ if (process.platform === 'darwin') {
2196
+ return home || (user ? '/Users/' + user : null);
2197
+ }
2198
+
2199
+ if (process.platform === 'linux') {
2200
+ return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null));
2201
+ }
2202
+
2203
+ return home || null;
2204
+ };
2205
+ return homedir;
2206
+ }
2207
+
2208
+ var caller;
2209
+ var hasRequiredCaller;
2210
+
2211
+ function requireCaller () {
2212
+ if (hasRequiredCaller) return caller;
2213
+ hasRequiredCaller = 1;
2214
+ caller = function () {
2215
+ var origPrepareStackTrace = Error.prepareStackTrace;
2216
+ Error.prepareStackTrace = function (_, stack) { return stack; };
2217
+ var stack = (new Error()).stack;
2218
+ Error.prepareStackTrace = origPrepareStackTrace;
2219
+ return stack[2].getFileName();
2220
+ };
2221
+ return caller;
2222
+ }
2223
+
2224
+ var pathParse = {exports: {}};
2225
+
2226
+ var hasRequiredPathParse;
2227
+
2228
+ function requirePathParse () {
2229
+ if (hasRequiredPathParse) return pathParse.exports;
2230
+ hasRequiredPathParse = 1;
2231
+
2232
+ var isWindows = process.platform === 'win32';
2233
+
2234
+ var splitWindowsRe =
2235
+ /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
2236
+
2237
+ var win32 = {};
2238
+
2239
+ function win32SplitPath(filename) {
2240
+ return splitWindowsRe.exec(filename).slice(1);
2241
+ }
2242
+
2243
+ win32.parse = function(pathString) {
2244
+ if (typeof pathString !== 'string') {
2245
+ throw new TypeError(
2246
+ "Parameter 'pathString' must be a string, not " + typeof pathString
2247
+ );
2248
+ }
2249
+ var allParts = win32SplitPath(pathString);
2250
+ if (!allParts || allParts.length !== 5) {
2251
+ throw new TypeError("Invalid path '" + pathString + "'");
2252
+ }
2253
+ return {
2254
+ root: allParts[1],
2255
+ dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
2256
+ base: allParts[2],
2257
+ ext: allParts[4],
2258
+ name: allParts[3]
2259
+ };
2260
+ };
2261
+
2262
+
2263
+
2264
+ var splitPathRe =
2265
+ /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
2266
+ var posix = {};
2267
+
2268
+
2269
+ function posixSplitPath(filename) {
2270
+ return splitPathRe.exec(filename).slice(1);
2271
+ }
2272
+
2273
+
2274
+ posix.parse = function(pathString) {
2275
+ if (typeof pathString !== 'string') {
2276
+ throw new TypeError(
2277
+ "Parameter 'pathString' must be a string, not " + typeof pathString
2278
+ );
2279
+ }
2280
+ var allParts = posixSplitPath(pathString);
2281
+ if (!allParts || allParts.length !== 5) {
2282
+ throw new TypeError("Invalid path '" + pathString + "'");
2283
+ }
2284
+
2285
+ return {
2286
+ root: allParts[1],
2287
+ dir: allParts[0].slice(0, -1),
2288
+ base: allParts[2],
2289
+ ext: allParts[4],
2290
+ name: allParts[3],
2291
+ };
2292
+ };
2293
+
2294
+
2295
+ if (isWindows)
2296
+ pathParse.exports = win32.parse;
2297
+ else
2298
+ pathParse.exports = posix.parse;
2299
+
2300
+ pathParse.exports.posix = posix.parse;
2301
+ pathParse.exports.win32 = win32.parse;
2302
+ return pathParse.exports;
2303
+ }
2304
+
2305
+ var nodeModulesPaths;
2306
+ var hasRequiredNodeModulesPaths;
2307
+
2308
+ function requireNodeModulesPaths () {
2309
+ if (hasRequiredNodeModulesPaths) return nodeModulesPaths;
2310
+ hasRequiredNodeModulesPaths = 1;
2311
+ var path = path__default;
2312
+ var parse = path.parse || requirePathParse();
2313
+
2314
+ var driveLetterRegex = /^([A-Za-z]:)/;
2315
+ var uncPathRegex = /^\\\\/;
2316
+
2317
+ var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
2318
+ var prefix = '/';
2319
+ if (driveLetterRegex.test(absoluteStart)) {
2320
+ prefix = '';
2321
+ } else if (uncPathRegex.test(absoluteStart)) {
2322
+ prefix = '\\\\';
2323
+ }
2324
+
2325
+ var paths = [absoluteStart];
2326
+ var parsed = parse(absoluteStart);
2327
+ while (parsed.dir !== paths[paths.length - 1]) {
2328
+ paths.push(parsed.dir);
2329
+ parsed = parse(parsed.dir);
2330
+ }
2331
+
2332
+ return paths.reduce(function (dirs, aPath) {
2333
+ return dirs.concat(modules.map(function (moduleDir) {
2334
+ return path.resolve(prefix, aPath, moduleDir);
2335
+ }));
2336
+ }, []);
2337
+ };
2338
+
2339
+ nodeModulesPaths = function nodeModulesPaths(start, opts, request) {
2340
+ var modules = opts && opts.moduleDirectory
2341
+ ? [].concat(opts.moduleDirectory)
2342
+ : ['node_modules'];
2343
+
2344
+ if (opts && typeof opts.paths === 'function') {
2345
+ return opts.paths(
2346
+ request,
2347
+ start,
2348
+ function () { return getNodeModulesDirs(start, modules); },
2349
+ opts
2350
+ );
2351
+ }
2352
+
2353
+ var dirs = getNodeModulesDirs(start, modules);
2354
+ return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
2355
+ };
2356
+ return nodeModulesPaths;
2357
+ }
2358
+
2359
+ var normalizeOptions;
2360
+ var hasRequiredNormalizeOptions;
2361
+
2362
+ function requireNormalizeOptions () {
2363
+ if (hasRequiredNormalizeOptions) return normalizeOptions;
2364
+ hasRequiredNormalizeOptions = 1;
2365
+ normalizeOptions = function (x, opts) {
2366
+ return opts || {};
2367
+ };
2368
+ return normalizeOptions;
2369
+ }
2370
+
2371
+ var implementation;
2372
+ var hasRequiredImplementation;
2373
+
2374
+ function requireImplementation () {
2375
+ if (hasRequiredImplementation) return implementation;
2376
+ hasRequiredImplementation = 1;
2377
+
2378
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
2379
+ var toStr = Object.prototype.toString;
2380
+ var max = Math.max;
2381
+ var funcType = '[object Function]';
2382
+
2383
+ var concatty = function concatty(a, b) {
2384
+ var arr = [];
2385
+
2386
+ for (var i = 0; i < a.length; i += 1) {
2387
+ arr[i] = a[i];
2388
+ }
2389
+ for (var j = 0; j < b.length; j += 1) {
2390
+ arr[j + a.length] = b[j];
2391
+ }
2392
+
2393
+ return arr;
2394
+ };
2395
+
2396
+ var slicy = function slicy(arrLike, offset) {
2397
+ var arr = [];
2398
+ for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
2399
+ arr[j] = arrLike[i];
2400
+ }
2401
+ return arr;
2402
+ };
2403
+
2404
+ var joiny = function (arr, joiner) {
2405
+ var str = '';
2406
+ for (var i = 0; i < arr.length; i += 1) {
2407
+ str += arr[i];
2408
+ if (i + 1 < arr.length) {
2409
+ str += joiner;
2410
+ }
2411
+ }
2412
+ return str;
2413
+ };
2414
+
2415
+ implementation = function bind(that) {
2416
+ var target = this;
2417
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
2418
+ throw new TypeError(ERROR_MESSAGE + target);
2419
+ }
2420
+ var args = slicy(arguments, 1);
2421
+
2422
+ var bound;
2423
+ var binder = function () {
2424
+ if (this instanceof bound) {
2425
+ var result = target.apply(
2426
+ this,
2427
+ concatty(args, arguments)
2428
+ );
2429
+ if (Object(result) === result) {
2430
+ return result;
2431
+ }
2432
+ return this;
2433
+ }
2434
+ return target.apply(
2435
+ that,
2436
+ concatty(args, arguments)
2437
+ );
2438
+
2439
+ };
2440
+
2441
+ var boundLength = max(0, target.length - args.length);
2442
+ var boundArgs = [];
2443
+ for (var i = 0; i < boundLength; i++) {
2444
+ boundArgs[i] = '$' + i;
2445
+ }
2446
+
2447
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
2448
+
2449
+ if (target.prototype) {
2450
+ var Empty = function Empty() {};
2451
+ Empty.prototype = target.prototype;
2452
+ bound.prototype = new Empty();
2453
+ Empty.prototype = null;
2454
+ }
2455
+
2456
+ return bound;
2457
+ };
2458
+ return implementation;
2459
+ }
2460
+
2461
+ var functionBind;
2462
+ var hasRequiredFunctionBind;
2463
+
2464
+ function requireFunctionBind () {
2465
+ if (hasRequiredFunctionBind) return functionBind;
2466
+ hasRequiredFunctionBind = 1;
2467
+
2468
+ var implementation = requireImplementation();
2469
+
2470
+ functionBind = Function.prototype.bind || implementation;
2471
+ return functionBind;
2472
+ }
2473
+
2474
+ var hasown;
2475
+ var hasRequiredHasown;
2476
+
2477
+ function requireHasown () {
2478
+ if (hasRequiredHasown) return hasown;
2479
+ hasRequiredHasown = 1;
2480
+
2481
+ var call = Function.prototype.call;
2482
+ var $hasOwn = Object.prototype.hasOwnProperty;
2483
+ var bind = requireFunctionBind();
2484
+
2485
+ hasown = bind.call(call, $hasOwn);
2486
+ return hasown;
2487
+ }
2488
+
2489
+ var assert$1 = true;
2490
+ var async_hooks$1 = ">= 8";
2491
+ var buffer_ieee754$1 = ">= 0.5 && < 0.9.7";
2492
+ var buffer$1 = true;
2493
+ var child_process$1 = true;
2494
+ var cluster$1 = ">= 0.5";
2495
+ var console$1 = true;
2496
+ var constants$1 = true;
2497
+ var crypto$1 = true;
2498
+ var _debug_agent$1 = ">= 1 && < 8";
2499
+ var _debugger$1 = "< 8";
2500
+ var dgram$1 = true;
2501
+ var diagnostics_channel$1 = [
2502
+ ">= 14.17 && < 15",
2503
+ ">= 15.1"
2504
+ ];
2505
+ var dns$1 = true;
2506
+ var domain$1 = ">= 0.7.12";
2507
+ var events$1 = true;
2508
+ var freelist$1 = "< 6";
2509
+ var fs$1 = true;
2510
+ var _http_agent$1 = ">= 0.11.1";
2511
+ var _http_client$1 = ">= 0.11.1";
2512
+ var _http_common$1 = ">= 0.11.1";
2513
+ var _http_incoming$1 = ">= 0.11.1";
2514
+ var _http_outgoing$1 = ">= 0.11.1";
2515
+ var _http_server$1 = ">= 0.11.1";
2516
+ var http$1 = true;
2517
+ var http2$1 = ">= 8.8";
2518
+ var https$1 = true;
2519
+ var inspector$1 = ">= 8";
2520
+ var _linklist$1 = "< 8";
2521
+ var module$2 = true;
2522
+ var net$1 = true;
2523
+ var os$1 = true;
2524
+ var path$1 = true;
2525
+ var perf_hooks$1 = ">= 8.5";
2526
+ var process$2 = ">= 1";
2527
+ var punycode$1 = ">= 0.5";
2528
+ var querystring$1 = true;
2529
+ var readline$1 = true;
2530
+ var repl$1 = true;
2531
+ var smalloc$1 = ">= 0.11.5 && < 3";
2532
+ var _stream_duplex$1 = ">= 0.9.4";
2533
+ var _stream_transform$1 = ">= 0.9.4";
2534
+ var _stream_wrap$1 = ">= 1.4.1";
2535
+ var _stream_passthrough$1 = ">= 0.9.4";
2536
+ var _stream_readable$1 = ">= 0.9.4";
2537
+ var _stream_writable$1 = ">= 0.9.4";
2538
+ var stream$1 = true;
2539
+ var string_decoder$1 = true;
2540
+ var sys$1 = [
2541
+ ">= 0.4 && < 0.7",
2542
+ ">= 0.8"
2543
+ ];
2544
+ var timers$1 = true;
2545
+ var _tls_common$1 = ">= 0.11.13";
2546
+ var _tls_legacy$1 = ">= 0.11.3 && < 10";
2547
+ var _tls_wrap$1 = ">= 0.11.3";
2548
+ var tls$1 = true;
2549
+ var trace_events$1 = ">= 10";
2550
+ var tty$1 = true;
2551
+ var url$1 = true;
2552
+ var util$1 = true;
2553
+ var v8$1 = ">= 1";
2554
+ var vm$1 = true;
2555
+ var wasi$1 = [
2556
+ ">= 13.4 && < 13.5",
2557
+ ">= 18.17 && < 19",
2558
+ ">= 20"
2559
+ ];
2560
+ var worker_threads$1 = ">= 11.7";
2561
+ var zlib$1 = ">= 0.5";
2562
+ const require$$1$1 = {
2563
+ assert: assert$1,
2564
+ "node:assert": [
2565
+ ">= 14.18 && < 15",
2566
+ ">= 16"
2567
+ ],
2568
+ "assert/strict": ">= 15",
2569
+ "node:assert/strict": ">= 16",
2570
+ async_hooks: async_hooks$1,
2571
+ "node:async_hooks": [
2572
+ ">= 14.18 && < 15",
2573
+ ">= 16"
2574
+ ],
2575
+ buffer_ieee754: buffer_ieee754$1,
2576
+ buffer: buffer$1,
2577
+ "node:buffer": [
2578
+ ">= 14.18 && < 15",
2579
+ ">= 16"
2580
+ ],
2581
+ child_process: child_process$1,
2582
+ "node:child_process": [
2583
+ ">= 14.18 && < 15",
2584
+ ">= 16"
2585
+ ],
2586
+ cluster: cluster$1,
2587
+ "node:cluster": [
2588
+ ">= 14.18 && < 15",
2589
+ ">= 16"
2590
+ ],
2591
+ console: console$1,
2592
+ "node:console": [
2593
+ ">= 14.18 && < 15",
2594
+ ">= 16"
2595
+ ],
2596
+ constants: constants$1,
2597
+ "node:constants": [
2598
+ ">= 14.18 && < 15",
2599
+ ">= 16"
2600
+ ],
2601
+ crypto: crypto$1,
2602
+ "node:crypto": [
2603
+ ">= 14.18 && < 15",
2604
+ ">= 16"
2605
+ ],
2606
+ _debug_agent: _debug_agent$1,
2607
+ _debugger: _debugger$1,
2608
+ dgram: dgram$1,
2609
+ "node:dgram": [
2610
+ ">= 14.18 && < 15",
2611
+ ">= 16"
2612
+ ],
2613
+ diagnostics_channel: diagnostics_channel$1,
2614
+ "node:diagnostics_channel": [
2615
+ ">= 14.18 && < 15",
2616
+ ">= 16"
2617
+ ],
2618
+ dns: dns$1,
2619
+ "node:dns": [
2620
+ ">= 14.18 && < 15",
2621
+ ">= 16"
2622
+ ],
2623
+ "dns/promises": ">= 15",
2624
+ "node:dns/promises": ">= 16",
2625
+ domain: domain$1,
2626
+ "node:domain": [
2627
+ ">= 14.18 && < 15",
2628
+ ">= 16"
2629
+ ],
2630
+ events: events$1,
2631
+ "node:events": [
2632
+ ">= 14.18 && < 15",
2633
+ ">= 16"
2634
+ ],
2635
+ freelist: freelist$1,
2636
+ fs: fs$1,
2637
+ "node:fs": [
2638
+ ">= 14.18 && < 15",
2639
+ ">= 16"
2640
+ ],
2641
+ "fs/promises": [
2642
+ ">= 10 && < 10.1",
2643
+ ">= 14"
2644
+ ],
2645
+ "node:fs/promises": [
2646
+ ">= 14.18 && < 15",
2647
+ ">= 16"
2648
+ ],
2649
+ _http_agent: _http_agent$1,
2650
+ "node:_http_agent": [
2651
+ ">= 14.18 && < 15",
2652
+ ">= 16"
2653
+ ],
2654
+ _http_client: _http_client$1,
2655
+ "node:_http_client": [
2656
+ ">= 14.18 && < 15",
2657
+ ">= 16"
2658
+ ],
2659
+ _http_common: _http_common$1,
2660
+ "node:_http_common": [
2661
+ ">= 14.18 && < 15",
2662
+ ">= 16"
2663
+ ],
2664
+ _http_incoming: _http_incoming$1,
2665
+ "node:_http_incoming": [
2666
+ ">= 14.18 && < 15",
2667
+ ">= 16"
2668
+ ],
2669
+ _http_outgoing: _http_outgoing$1,
2670
+ "node:_http_outgoing": [
2671
+ ">= 14.18 && < 15",
2672
+ ">= 16"
2673
+ ],
2674
+ _http_server: _http_server$1,
2675
+ "node:_http_server": [
2676
+ ">= 14.18 && < 15",
2677
+ ">= 16"
2678
+ ],
2679
+ http: http$1,
2680
+ "node:http": [
2681
+ ">= 14.18 && < 15",
2682
+ ">= 16"
2683
+ ],
2684
+ http2: http2$1,
2685
+ "node:http2": [
2686
+ ">= 14.18 && < 15",
2687
+ ">= 16"
2688
+ ],
2689
+ https: https$1,
2690
+ "node:https": [
2691
+ ">= 14.18 && < 15",
2692
+ ">= 16"
2693
+ ],
2694
+ inspector: inspector$1,
2695
+ "node:inspector": [
2696
+ ">= 14.18 && < 15",
2697
+ ">= 16"
2698
+ ],
2699
+ "inspector/promises": [
2700
+ ">= 19"
2701
+ ],
2702
+ "node:inspector/promises": [
2703
+ ">= 19"
2704
+ ],
2705
+ _linklist: _linklist$1,
2706
+ module: module$2,
2707
+ "node:module": [
2708
+ ">= 14.18 && < 15",
2709
+ ">= 16"
2710
+ ],
2711
+ net: net$1,
2712
+ "node:net": [
2713
+ ">= 14.18 && < 15",
2714
+ ">= 16"
2715
+ ],
2716
+ "node-inspect/lib/_inspect": ">= 7.6 && < 12",
2717
+ "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
2718
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
2719
+ os: os$1,
2720
+ "node:os": [
2721
+ ">= 14.18 && < 15",
2722
+ ">= 16"
2723
+ ],
2724
+ path: path$1,
2725
+ "node:path": [
2726
+ ">= 14.18 && < 15",
2727
+ ">= 16"
2728
+ ],
2729
+ "path/posix": ">= 15.3",
2730
+ "node:path/posix": ">= 16",
2731
+ "path/win32": ">= 15.3",
2732
+ "node:path/win32": ">= 16",
2733
+ perf_hooks: perf_hooks$1,
2734
+ "node:perf_hooks": [
2735
+ ">= 14.18 && < 15",
2736
+ ">= 16"
2737
+ ],
2738
+ process: process$2,
2739
+ "node:process": [
2740
+ ">= 14.18 && < 15",
2741
+ ">= 16"
2742
+ ],
2743
+ punycode: punycode$1,
2744
+ "node:punycode": [
2745
+ ">= 14.18 && < 15",
2746
+ ">= 16"
2747
+ ],
2748
+ querystring: querystring$1,
2749
+ "node:querystring": [
2750
+ ">= 14.18 && < 15",
2751
+ ">= 16"
2752
+ ],
2753
+ readline: readline$1,
2754
+ "node:readline": [
2755
+ ">= 14.18 && < 15",
2756
+ ">= 16"
2757
+ ],
2758
+ "readline/promises": ">= 17",
2759
+ "node:readline/promises": ">= 17",
2760
+ repl: repl$1,
2761
+ "node:repl": [
2762
+ ">= 14.18 && < 15",
2763
+ ">= 16"
2764
+ ],
2765
+ "node:sea": [
2766
+ ">= 20.12 && < 21",
2767
+ ">= 21.7"
2768
+ ],
2769
+ smalloc: smalloc$1,
2770
+ "node:sqlite": [
2771
+ ">= 22.13 && < 23",
2772
+ ">= 23.4"
2773
+ ],
2774
+ _stream_duplex: _stream_duplex$1,
2775
+ "node:_stream_duplex": [
2776
+ ">= 14.18 && < 15",
2777
+ ">= 16"
2778
+ ],
2779
+ _stream_transform: _stream_transform$1,
2780
+ "node:_stream_transform": [
2781
+ ">= 14.18 && < 15",
2782
+ ">= 16"
2783
+ ],
2784
+ _stream_wrap: _stream_wrap$1,
2785
+ "node:_stream_wrap": [
2786
+ ">= 14.18 && < 15",
2787
+ ">= 16"
2788
+ ],
2789
+ _stream_passthrough: _stream_passthrough$1,
2790
+ "node:_stream_passthrough": [
2791
+ ">= 14.18 && < 15",
2792
+ ">= 16"
2793
+ ],
2794
+ _stream_readable: _stream_readable$1,
2795
+ "node:_stream_readable": [
2796
+ ">= 14.18 && < 15",
2797
+ ">= 16"
2798
+ ],
2799
+ _stream_writable: _stream_writable$1,
2800
+ "node:_stream_writable": [
2801
+ ">= 14.18 && < 15",
2802
+ ">= 16"
2803
+ ],
2804
+ stream: stream$1,
2805
+ "node:stream": [
2806
+ ">= 14.18 && < 15",
2807
+ ">= 16"
2808
+ ],
2809
+ "stream/consumers": ">= 16.7",
2810
+ "node:stream/consumers": ">= 16.7",
2811
+ "stream/promises": ">= 15",
2812
+ "node:stream/promises": ">= 16",
2813
+ "stream/web": ">= 16.5",
2814
+ "node:stream/web": ">= 16.5",
2815
+ string_decoder: string_decoder$1,
2816
+ "node:string_decoder": [
2817
+ ">= 14.18 && < 15",
2818
+ ">= 16"
2819
+ ],
2820
+ sys: sys$1,
2821
+ "node:sys": [
2822
+ ">= 14.18 && < 15",
2823
+ ">= 16"
2824
+ ],
2825
+ "test/reporters": ">= 19.9 && < 20.2",
2826
+ "node:test/reporters": [
2827
+ ">= 18.17 && < 19",
2828
+ ">= 19.9",
2829
+ ">= 20"
2830
+ ],
2831
+ "test/mock_loader": ">= 22.3 && < 22.7",
2832
+ "node:test/mock_loader": ">= 22.3 && < 22.7",
2833
+ "node:test": [
2834
+ ">= 16.17 && < 17",
2835
+ ">= 18"
2836
+ ],
2837
+ timers: timers$1,
2838
+ "node:timers": [
2839
+ ">= 14.18 && < 15",
2840
+ ">= 16"
2841
+ ],
2842
+ "timers/promises": ">= 15",
2843
+ "node:timers/promises": ">= 16",
2844
+ _tls_common: _tls_common$1,
2845
+ "node:_tls_common": [
2846
+ ">= 14.18 && < 15",
2847
+ ">= 16"
2848
+ ],
2849
+ _tls_legacy: _tls_legacy$1,
2850
+ _tls_wrap: _tls_wrap$1,
2851
+ "node:_tls_wrap": [
2852
+ ">= 14.18 && < 15",
2853
+ ">= 16"
2854
+ ],
2855
+ tls: tls$1,
2856
+ "node:tls": [
2857
+ ">= 14.18 && < 15",
2858
+ ">= 16"
2859
+ ],
2860
+ trace_events: trace_events$1,
2861
+ "node:trace_events": [
2862
+ ">= 14.18 && < 15",
2863
+ ">= 16"
2864
+ ],
2865
+ tty: tty$1,
2866
+ "node:tty": [
2867
+ ">= 14.18 && < 15",
2868
+ ">= 16"
2869
+ ],
2870
+ url: url$1,
2871
+ "node:url": [
2872
+ ">= 14.18 && < 15",
2873
+ ">= 16"
2874
+ ],
2875
+ util: util$1,
2876
+ "node:util": [
2877
+ ">= 14.18 && < 15",
2878
+ ">= 16"
2879
+ ],
2880
+ "util/types": ">= 15.3",
2881
+ "node:util/types": ">= 16",
2882
+ "v8/tools/arguments": ">= 10 && < 12",
2883
+ "v8/tools/codemap": [
2884
+ ">= 4.4 && < 5",
2885
+ ">= 5.2 && < 12"
2886
+ ],
2887
+ "v8/tools/consarray": [
2888
+ ">= 4.4 && < 5",
2889
+ ">= 5.2 && < 12"
2890
+ ],
2891
+ "v8/tools/csvparser": [
2892
+ ">= 4.4 && < 5",
2893
+ ">= 5.2 && < 12"
2894
+ ],
2895
+ "v8/tools/logreader": [
2896
+ ">= 4.4 && < 5",
2897
+ ">= 5.2 && < 12"
2898
+ ],
2899
+ "v8/tools/profile_view": [
2900
+ ">= 4.4 && < 5",
2901
+ ">= 5.2 && < 12"
2902
+ ],
2903
+ "v8/tools/splaytree": [
2904
+ ">= 4.4 && < 5",
2905
+ ">= 5.2 && < 12"
2906
+ ],
2907
+ v8: v8$1,
2908
+ "node:v8": [
2909
+ ">= 14.18 && < 15",
2910
+ ">= 16"
2911
+ ],
2912
+ vm: vm$1,
2913
+ "node:vm": [
2914
+ ">= 14.18 && < 15",
2915
+ ">= 16"
2916
+ ],
2917
+ wasi: wasi$1,
2918
+ "node:wasi": [
2919
+ ">= 18.17 && < 19",
2920
+ ">= 20"
2921
+ ],
2922
+ worker_threads: worker_threads$1,
2923
+ "node:worker_threads": [
2924
+ ">= 14.18 && < 15",
2925
+ ">= 16"
2926
+ ],
2927
+ zlib: zlib$1,
2928
+ "node:zlib": [
2929
+ ">= 14.18 && < 15",
2930
+ ">= 16"
2931
+ ]
2932
+ };
2933
+
2934
+ var isCoreModule;
2935
+ var hasRequiredIsCoreModule;
2936
+
2937
+ function requireIsCoreModule () {
2938
+ if (hasRequiredIsCoreModule) return isCoreModule;
2939
+ hasRequiredIsCoreModule = 1;
2940
+
2941
+ var hasOwn = /*@__PURE__*/ requireHasown();
2942
+
2943
+ function specifierIncluded(current, specifier) {
2944
+ var nodeParts = current.split('.');
2945
+ var parts = specifier.split(' ');
2946
+ var op = parts.length > 1 ? parts[0] : '=';
2947
+ var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
2948
+
2949
+ for (var i = 0; i < 3; ++i) {
2950
+ var cur = parseInt(nodeParts[i] || 0, 10);
2951
+ var ver = parseInt(versionParts[i] || 0, 10);
2952
+ if (cur === ver) {
2953
+ continue;
2954
+ }
2955
+ if (op === '<') {
2956
+ return cur < ver;
2957
+ }
2958
+ if (op === '>=') {
2959
+ return cur >= ver;
2960
+ }
2961
+ return false;
2962
+ }
2963
+ return op === '>=';
2964
+ }
2965
+
2966
+ function matchesRange(current, range) {
2967
+ var specifiers = range.split(/ ?&& ?/);
2968
+ if (specifiers.length === 0) {
2969
+ return false;
2970
+ }
2971
+ for (var i = 0; i < specifiers.length; ++i) {
2972
+ if (!specifierIncluded(current, specifiers[i])) {
2973
+ return false;
2974
+ }
2975
+ }
2976
+ return true;
2977
+ }
2978
+
2979
+ function versionIncluded(nodeVersion, specifierValue) {
2980
+ if (typeof specifierValue === 'boolean') {
2981
+ return specifierValue;
2982
+ }
2983
+
2984
+ var current = typeof nodeVersion === 'undefined'
2985
+ ? process.versions && process.versions.node
2986
+ : nodeVersion;
2987
+
2988
+ if (typeof current !== 'string') {
2989
+ throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');
2990
+ }
2991
+
2992
+ if (specifierValue && typeof specifierValue === 'object') {
2993
+ for (var i = 0; i < specifierValue.length; ++i) {
2994
+ if (matchesRange(current, specifierValue[i])) {
2995
+ return true;
2996
+ }
2997
+ }
2998
+ return false;
2999
+ }
3000
+ return matchesRange(current, specifierValue);
3001
+ }
3002
+
3003
+ var data = require$$1$1;
3004
+
3005
+ isCoreModule = function isCore(x, nodeVersion) {
3006
+ return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
3007
+ };
3008
+ return isCoreModule;
3009
+ }
3010
+
3011
+ var async;
3012
+ var hasRequiredAsync;
3013
+
3014
+ function requireAsync () {
3015
+ if (hasRequiredAsync) return async;
3016
+ hasRequiredAsync = 1;
3017
+ var fs = fs__default__default;
3018
+ var getHomedir = requireHomedir();
3019
+ var path = path__default;
3020
+ var caller = requireCaller();
3021
+ var nodeModulesPaths = requireNodeModulesPaths();
3022
+ var normalizeOptions = requireNormalizeOptions();
3023
+ var isCore = /*@__PURE__*/ requireIsCoreModule();
3024
+
3025
+ var realpathFS = process.platform !== 'win32' && fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
3026
+
3027
+ var relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/;
3028
+ var windowsDriveRegex = /^\w:[/\\]*$/;
3029
+ var nodeModulesRegex = /[/\\]node_modules[/\\]*$/;
3030
+
3031
+ var homedir = getHomedir();
3032
+ var defaultPaths = function () {
3033
+ return [
3034
+ path.join(homedir, '.node_modules'),
3035
+ path.join(homedir, '.node_libraries')
3036
+ ];
3037
+ };
3038
+
3039
+ var defaultIsFile = function isFile(file, cb) {
3040
+ fs.stat(file, function (err, stat) {
3041
+ if (!err) {
3042
+ return cb(null, stat.isFile() || stat.isFIFO());
3043
+ }
3044
+ if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
3045
+ return cb(err);
3046
+ });
3047
+ };
3048
+
3049
+ var defaultIsDir = function isDirectory(dir, cb) {
3050
+ fs.stat(dir, function (err, stat) {
3051
+ if (!err) {
3052
+ return cb(null, stat.isDirectory());
3053
+ }
3054
+ if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
3055
+ return cb(err);
3056
+ });
3057
+ };
3058
+
3059
+ var defaultRealpath = function realpath(x, cb) {
3060
+ realpathFS(x, function (realpathErr, realPath) {
3061
+ if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);
3062
+ else cb(null, realpathErr ? x : realPath);
3063
+ });
3064
+ };
3065
+
3066
+ var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
3067
+ if (opts && opts.preserveSymlinks === false) {
3068
+ realpath(x, cb);
3069
+ } else {
3070
+ cb(null, x);
3071
+ }
3072
+ };
3073
+
3074
+ var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) {
3075
+ readFile(pkgfile, function (readFileErr, body) {
3076
+ if (readFileErr) cb(readFileErr);
3077
+ else {
3078
+ try {
3079
+ var pkg = JSON.parse(body);
3080
+ cb(null, pkg);
3081
+ } catch (jsonErr) {
3082
+ cb(null);
3083
+ }
3084
+ }
3085
+ });
3086
+ };
3087
+
3088
+ var getPackageCandidates = function getPackageCandidates(x, start, opts) {
3089
+ var dirs = nodeModulesPaths(start, opts, x);
3090
+ for (var i = 0; i < dirs.length; i++) {
3091
+ dirs[i] = path.join(dirs[i], x);
3092
+ }
3093
+ return dirs;
3094
+ };
3095
+
3096
+ async = function resolve(x, options, callback) {
3097
+ var cb = callback;
3098
+ var opts = options;
3099
+ if (typeof options === 'function') {
3100
+ cb = opts;
3101
+ opts = {};
3102
+ }
3103
+ if (typeof x !== 'string') {
3104
+ var err = new TypeError('Path must be a string.');
3105
+ return process.nextTick(function () {
3106
+ cb(err);
3107
+ });
3108
+ }
3109
+
3110
+ opts = normalizeOptions(x, opts);
3111
+
3112
+ var isFile = opts.isFile || defaultIsFile;
3113
+ var isDirectory = opts.isDirectory || defaultIsDir;
3114
+ var readFile = opts.readFile || fs.readFile;
3115
+ var realpath = opts.realpath || defaultRealpath;
3116
+ var readPackage = opts.readPackage || defaultReadPackage;
3117
+ if (opts.readFile && opts.readPackage) {
3118
+ var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.');
3119
+ return process.nextTick(function () {
3120
+ cb(conflictErr);
3121
+ });
3122
+ }
3123
+ var packageIterator = opts.packageIterator;
3124
+
3125
+ var extensions = opts.extensions || ['.js'];
3126
+ var includeCoreModules = opts.includeCoreModules !== false;
3127
+ var basedir = opts.basedir || path.dirname(caller());
3128
+ var parent = opts.filename || basedir;
3129
+
3130
+ opts.paths = opts.paths || defaultPaths();
3131
+
3132
+ var absoluteStart = path.resolve(basedir);
3133
+
3134
+ maybeRealpath(
3135
+ realpath,
3136
+ absoluteStart,
3137
+ opts,
3138
+ function (err, realStart) {
3139
+ if (err) cb(err);
3140
+ else init(realStart);
3141
+ }
3142
+ );
3143
+
3144
+ var res;
3145
+ function init(basedir) {
3146
+ if (relativePathRegex.test(x)) {
3147
+ res = path.resolve(basedir, x);
3148
+ if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
3149
+ if (x.slice(-1) === '/' && res === basedir) {
3150
+ loadAsDirectory(res, opts.package, onfile);
3151
+ } else loadAsFile(res, opts.package, onfile);
3152
+ } else if (includeCoreModules && isCore(x)) {
3153
+ return cb(null, x);
3154
+ } else loadNodeModules(x, basedir, function (err, n, pkg) {
3155
+ if (err) cb(err);
3156
+ else if (n) {
3157
+ return maybeRealpath(realpath, n, opts, function (err, realN) {
3158
+ if (err) {
3159
+ cb(err);
3160
+ } else {
3161
+ cb(null, realN, pkg);
3162
+ }
3163
+ });
3164
+ } else {
3165
+ var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
3166
+ moduleError.code = 'MODULE_NOT_FOUND';
3167
+ cb(moduleError);
3168
+ }
3169
+ });
3170
+ }
3171
+
3172
+ function onfile(err, m, pkg) {
3173
+ if (err) cb(err);
3174
+ else if (m) cb(null, m, pkg);
3175
+ else loadAsDirectory(res, function (err, d, pkg) {
3176
+ if (err) cb(err);
3177
+ else if (d) {
3178
+ maybeRealpath(realpath, d, opts, function (err, realD) {
3179
+ if (err) {
3180
+ cb(err);
3181
+ } else {
3182
+ cb(null, realD, pkg);
3183
+ }
3184
+ });
3185
+ } else {
3186
+ var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
3187
+ moduleError.code = 'MODULE_NOT_FOUND';
3188
+ cb(moduleError);
3189
+ }
3190
+ });
3191
+ }
3192
+
3193
+ function loadAsFile(x, thePackage, callback) {
3194
+ var loadAsFilePackage = thePackage;
3195
+ var cb = callback;
3196
+ if (typeof loadAsFilePackage === 'function') {
3197
+ cb = loadAsFilePackage;
3198
+ loadAsFilePackage = undefined;
3199
+ }
3200
+
3201
+ var exts = [''].concat(extensions);
3202
+ load(exts, x, loadAsFilePackage);
3203
+
3204
+ function load(exts, x, loadPackage) {
3205
+ if (exts.length === 0) return cb(null, undefined, loadPackage);
3206
+ var file = x + exts[0];
3207
+
3208
+ var pkg = loadPackage;
3209
+ if (pkg) onpkg(null, pkg);
3210
+ else loadpkg(path.dirname(file), onpkg);
3211
+
3212
+ function onpkg(err, pkg_, dir) {
3213
+ pkg = pkg_;
3214
+ if (err) return cb(err);
3215
+ if (dir && pkg && opts.pathFilter) {
3216
+ var rfile = path.relative(dir, file);
3217
+ var rel = rfile.slice(0, rfile.length - exts[0].length);
3218
+ var r = opts.pathFilter(pkg, x, rel);
3219
+ if (r) return load(
3220
+ [''].concat(extensions.slice()),
3221
+ path.resolve(dir, r),
3222
+ pkg
3223
+ );
3224
+ }
3225
+ isFile(file, onex);
3226
+ }
3227
+ function onex(err, ex) {
3228
+ if (err) return cb(err);
3229
+ if (ex) return cb(null, file, pkg);
3230
+ load(exts.slice(1), x, pkg);
3231
+ }
3232
+ }
3233
+ }
3234
+
3235
+ function loadpkg(dir, cb) {
3236
+ if (dir === '' || dir === '/') return cb(null);
3237
+ if (process.platform === 'win32' && windowsDriveRegex.test(dir)) {
3238
+ return cb(null);
3239
+ }
3240
+ if (nodeModulesRegex.test(dir)) return cb(null);
3241
+
3242
+ maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
3243
+ if (unwrapErr) return loadpkg(path.dirname(dir), cb);
3244
+ var pkgfile = path.join(pkgdir, 'package.json');
3245
+ isFile(pkgfile, function (err, ex) {
3246
+ if (!ex) return loadpkg(path.dirname(dir), cb);
3247
+
3248
+ readPackage(readFile, pkgfile, function (err, pkgParam) {
3249
+ if (err) cb(err);
3250
+
3251
+ var pkg = pkgParam;
3252
+
3253
+ if (pkg && opts.packageFilter) {
3254
+ pkg = opts.packageFilter(pkg, pkgfile);
3255
+ }
3256
+ cb(null, pkg, dir);
3257
+ });
3258
+ });
3259
+ });
3260
+ }
3261
+
3262
+ function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
3263
+ var cb = callback;
3264
+ var fpkg = loadAsDirectoryPackage;
3265
+ if (typeof fpkg === 'function') {
3266
+ cb = fpkg;
3267
+ fpkg = opts.package;
3268
+ }
3269
+
3270
+ maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) {
3271
+ if (unwrapErr) return cb(unwrapErr);
3272
+ var pkgfile = path.join(pkgdir, 'package.json');
3273
+ isFile(pkgfile, function (err, ex) {
3274
+ if (err) return cb(err);
3275
+ if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb);
3276
+
3277
+ readPackage(readFile, pkgfile, function (err, pkgParam) {
3278
+ if (err) return cb(err);
3279
+
3280
+ var pkg = pkgParam;
3281
+
3282
+ if (pkg && opts.packageFilter) {
3283
+ pkg = opts.packageFilter(pkg, pkgfile);
3284
+ }
3285
+
3286
+ if (pkg && pkg.main) {
3287
+ if (typeof pkg.main !== 'string') {
3288
+ var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
3289
+ mainError.code = 'INVALID_PACKAGE_MAIN';
3290
+ return cb(mainError);
3291
+ }
3292
+ if (pkg.main === '.' || pkg.main === './') {
3293
+ pkg.main = 'index';
3294
+ }
3295
+ loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {
3296
+ if (err) return cb(err);
3297
+ if (m) return cb(null, m, pkg);
3298
+ if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb);
3299
+
3300
+ var dir = path.resolve(x, pkg.main);
3301
+ loadAsDirectory(dir, pkg, function (err, n, pkg) {
3302
+ if (err) return cb(err);
3303
+ if (n) return cb(null, n, pkg);
3304
+ loadAsFile(path.join(x, 'index'), pkg, cb);
3305
+ });
3306
+ });
3307
+ return;
3308
+ }
3309
+
3310
+ loadAsFile(path.join(x, '/index'), pkg, cb);
3311
+ });
3312
+ });
3313
+ });
3314
+ }
3315
+
3316
+ function processDirs(cb, dirs) {
3317
+ if (dirs.length === 0) return cb(null, undefined);
3318
+ var dir = dirs[0];
3319
+
3320
+ isDirectory(path.dirname(dir), isdir);
3321
+
3322
+ function isdir(err, isdir) {
3323
+ if (err) return cb(err);
3324
+ if (!isdir) return processDirs(cb, dirs.slice(1));
3325
+ loadAsFile(dir, opts.package, onfile);
3326
+ }
3327
+
3328
+ function onfile(err, m, pkg) {
3329
+ if (err) return cb(err);
3330
+ if (m) return cb(null, m, pkg);
3331
+ loadAsDirectory(dir, opts.package, ondir);
3332
+ }
3333
+
3334
+ function ondir(err, n, pkg) {
3335
+ if (err) return cb(err);
3336
+ if (n) return cb(null, n, pkg);
3337
+ processDirs(cb, dirs.slice(1));
3338
+ }
3339
+ }
3340
+ function loadNodeModules(x, start, cb) {
3341
+ var thunk = function () { return getPackageCandidates(x, start, opts); };
3342
+ processDirs(
3343
+ cb,
3344
+ packageIterator ? packageIterator(x, start, thunk, opts) : thunk()
3345
+ );
3346
+ }
3347
+ };
3348
+ return async;
3349
+ }
3350
+
3351
+ var assert = true;
3352
+ var async_hooks = ">= 8";
3353
+ var buffer_ieee754 = ">= 0.5 && < 0.9.7";
3354
+ var buffer = true;
3355
+ var child_process = true;
3356
+ var cluster = ">= 0.5";
3357
+ var console = true;
3358
+ var constants = true;
3359
+ var crypto = true;
3360
+ var _debug_agent = ">= 1 && < 8";
3361
+ var _debugger = "< 8";
3362
+ var dgram = true;
3363
+ var diagnostics_channel = [
3364
+ ">= 14.17 && < 15",
3365
+ ">= 15.1"
3366
+ ];
3367
+ var dns = true;
3368
+ var domain = ">= 0.7.12";
3369
+ var events = true;
3370
+ var freelist = "< 6";
3371
+ var fs = true;
3372
+ var _http_agent = ">= 0.11.1";
3373
+ var _http_client = ">= 0.11.1";
3374
+ var _http_common = ">= 0.11.1";
3375
+ var _http_incoming = ">= 0.11.1";
3376
+ var _http_outgoing = ">= 0.11.1";
3377
+ var _http_server = ">= 0.11.1";
3378
+ var http = true;
3379
+ var http2 = ">= 8.8";
3380
+ var https = true;
3381
+ var inspector = ">= 8";
3382
+ var _linklist = "< 8";
3383
+ var module$1 = true;
3384
+ var net = true;
3385
+ var os = true;
3386
+ var path = true;
3387
+ var perf_hooks = ">= 8.5";
3388
+ var process$1 = ">= 1";
3389
+ var punycode = ">= 0.5";
3390
+ var querystring = true;
3391
+ var readline = true;
3392
+ var repl = true;
3393
+ var smalloc = ">= 0.11.5 && < 3";
3394
+ var _stream_duplex = ">= 0.9.4";
3395
+ var _stream_transform = ">= 0.9.4";
3396
+ var _stream_wrap = ">= 1.4.1";
3397
+ var _stream_passthrough = ">= 0.9.4";
3398
+ var _stream_readable = ">= 0.9.4";
3399
+ var _stream_writable = ">= 0.9.4";
3400
+ var stream = true;
3401
+ var string_decoder = true;
3402
+ var sys = [
3403
+ ">= 0.4 && < 0.7",
3404
+ ">= 0.8"
3405
+ ];
3406
+ var timers = true;
3407
+ var _tls_common = ">= 0.11.13";
3408
+ var _tls_legacy = ">= 0.11.3 && < 10";
3409
+ var _tls_wrap = ">= 0.11.3";
3410
+ var tls = true;
3411
+ var trace_events = ">= 10";
3412
+ var tty = true;
3413
+ var url = true;
3414
+ var util = true;
3415
+ var v8 = ">= 1";
3416
+ var vm = true;
3417
+ var wasi = [
3418
+ ">= 13.4 && < 13.5",
3419
+ ">= 18.17 && < 19",
3420
+ ">= 20"
3421
+ ];
3422
+ var worker_threads = ">= 11.7";
3423
+ var zlib = ">= 0.5";
3424
+ const require$$1 = {
3425
+ assert: assert,
3426
+ "node:assert": [
3427
+ ">= 14.18 && < 15",
3428
+ ">= 16"
3429
+ ],
3430
+ "assert/strict": ">= 15",
3431
+ "node:assert/strict": ">= 16",
3432
+ async_hooks: async_hooks,
3433
+ "node:async_hooks": [
3434
+ ">= 14.18 && < 15",
3435
+ ">= 16"
3436
+ ],
3437
+ buffer_ieee754: buffer_ieee754,
3438
+ buffer: buffer,
3439
+ "node:buffer": [
3440
+ ">= 14.18 && < 15",
3441
+ ">= 16"
3442
+ ],
3443
+ child_process: child_process,
3444
+ "node:child_process": [
3445
+ ">= 14.18 && < 15",
3446
+ ">= 16"
3447
+ ],
3448
+ cluster: cluster,
3449
+ "node:cluster": [
3450
+ ">= 14.18 && < 15",
3451
+ ">= 16"
3452
+ ],
3453
+ console: console,
3454
+ "node:console": [
3455
+ ">= 14.18 && < 15",
3456
+ ">= 16"
3457
+ ],
3458
+ constants: constants,
3459
+ "node:constants": [
3460
+ ">= 14.18 && < 15",
3461
+ ">= 16"
3462
+ ],
3463
+ crypto: crypto,
3464
+ "node:crypto": [
3465
+ ">= 14.18 && < 15",
3466
+ ">= 16"
3467
+ ],
3468
+ _debug_agent: _debug_agent,
3469
+ _debugger: _debugger,
3470
+ dgram: dgram,
3471
+ "node:dgram": [
3472
+ ">= 14.18 && < 15",
3473
+ ">= 16"
3474
+ ],
3475
+ diagnostics_channel: diagnostics_channel,
3476
+ "node:diagnostics_channel": [
3477
+ ">= 14.18 && < 15",
3478
+ ">= 16"
3479
+ ],
3480
+ dns: dns,
3481
+ "node:dns": [
3482
+ ">= 14.18 && < 15",
3483
+ ">= 16"
3484
+ ],
3485
+ "dns/promises": ">= 15",
3486
+ "node:dns/promises": ">= 16",
3487
+ domain: domain,
3488
+ "node:domain": [
3489
+ ">= 14.18 && < 15",
3490
+ ">= 16"
3491
+ ],
3492
+ events: events,
3493
+ "node:events": [
3494
+ ">= 14.18 && < 15",
3495
+ ">= 16"
3496
+ ],
3497
+ freelist: freelist,
3498
+ fs: fs,
3499
+ "node:fs": [
3500
+ ">= 14.18 && < 15",
3501
+ ">= 16"
3502
+ ],
3503
+ "fs/promises": [
3504
+ ">= 10 && < 10.1",
3505
+ ">= 14"
3506
+ ],
3507
+ "node:fs/promises": [
3508
+ ">= 14.18 && < 15",
3509
+ ">= 16"
3510
+ ],
3511
+ _http_agent: _http_agent,
3512
+ "node:_http_agent": [
3513
+ ">= 14.18 && < 15",
3514
+ ">= 16"
3515
+ ],
3516
+ _http_client: _http_client,
3517
+ "node:_http_client": [
3518
+ ">= 14.18 && < 15",
3519
+ ">= 16"
3520
+ ],
3521
+ _http_common: _http_common,
3522
+ "node:_http_common": [
3523
+ ">= 14.18 && < 15",
3524
+ ">= 16"
3525
+ ],
3526
+ _http_incoming: _http_incoming,
3527
+ "node:_http_incoming": [
3528
+ ">= 14.18 && < 15",
3529
+ ">= 16"
3530
+ ],
3531
+ _http_outgoing: _http_outgoing,
3532
+ "node:_http_outgoing": [
3533
+ ">= 14.18 && < 15",
3534
+ ">= 16"
3535
+ ],
3536
+ _http_server: _http_server,
3537
+ "node:_http_server": [
3538
+ ">= 14.18 && < 15",
3539
+ ">= 16"
3540
+ ],
3541
+ http: http,
3542
+ "node:http": [
3543
+ ">= 14.18 && < 15",
3544
+ ">= 16"
3545
+ ],
3546
+ http2: http2,
3547
+ "node:http2": [
3548
+ ">= 14.18 && < 15",
3549
+ ">= 16"
3550
+ ],
3551
+ https: https,
3552
+ "node:https": [
3553
+ ">= 14.18 && < 15",
3554
+ ">= 16"
3555
+ ],
3556
+ inspector: inspector,
3557
+ "node:inspector": [
3558
+ ">= 14.18 && < 15",
3559
+ ">= 16"
3560
+ ],
3561
+ "inspector/promises": [
3562
+ ">= 19"
3563
+ ],
3564
+ "node:inspector/promises": [
3565
+ ">= 19"
3566
+ ],
3567
+ _linklist: _linklist,
3568
+ module: module$1,
3569
+ "node:module": [
3570
+ ">= 14.18 && < 15",
3571
+ ">= 16"
3572
+ ],
3573
+ net: net,
3574
+ "node:net": [
3575
+ ">= 14.18 && < 15",
3576
+ ">= 16"
3577
+ ],
3578
+ "node-inspect/lib/_inspect": ">= 7.6 && < 12",
3579
+ "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
3580
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
3581
+ os: os,
3582
+ "node:os": [
3583
+ ">= 14.18 && < 15",
3584
+ ">= 16"
3585
+ ],
3586
+ path: path,
3587
+ "node:path": [
3588
+ ">= 14.18 && < 15",
3589
+ ">= 16"
3590
+ ],
3591
+ "path/posix": ">= 15.3",
3592
+ "node:path/posix": ">= 16",
3593
+ "path/win32": ">= 15.3",
3594
+ "node:path/win32": ">= 16",
3595
+ perf_hooks: perf_hooks,
3596
+ "node:perf_hooks": [
3597
+ ">= 14.18 && < 15",
3598
+ ">= 16"
3599
+ ],
3600
+ process: process$1,
3601
+ "node:process": [
3602
+ ">= 14.18 && < 15",
3603
+ ">= 16"
3604
+ ],
3605
+ punycode: punycode,
3606
+ "node:punycode": [
3607
+ ">= 14.18 && < 15",
3608
+ ">= 16"
3609
+ ],
3610
+ querystring: querystring,
3611
+ "node:querystring": [
3612
+ ">= 14.18 && < 15",
3613
+ ">= 16"
3614
+ ],
3615
+ readline: readline,
3616
+ "node:readline": [
3617
+ ">= 14.18 && < 15",
3618
+ ">= 16"
3619
+ ],
3620
+ "readline/promises": ">= 17",
3621
+ "node:readline/promises": ">= 17",
3622
+ repl: repl,
3623
+ "node:repl": [
3624
+ ">= 14.18 && < 15",
3625
+ ">= 16"
3626
+ ],
3627
+ "node:sea": [
3628
+ ">= 20.12 && < 21",
3629
+ ">= 21.7"
3630
+ ],
3631
+ smalloc: smalloc,
3632
+ "node:sqlite": [
3633
+ ">= 22.13 && < 23",
3634
+ ">= 23.4"
3635
+ ],
3636
+ _stream_duplex: _stream_duplex,
3637
+ "node:_stream_duplex": [
3638
+ ">= 14.18 && < 15",
3639
+ ">= 16"
3640
+ ],
3641
+ _stream_transform: _stream_transform,
3642
+ "node:_stream_transform": [
3643
+ ">= 14.18 && < 15",
3644
+ ">= 16"
3645
+ ],
3646
+ _stream_wrap: _stream_wrap,
3647
+ "node:_stream_wrap": [
3648
+ ">= 14.18 && < 15",
3649
+ ">= 16"
3650
+ ],
3651
+ _stream_passthrough: _stream_passthrough,
3652
+ "node:_stream_passthrough": [
3653
+ ">= 14.18 && < 15",
3654
+ ">= 16"
3655
+ ],
3656
+ _stream_readable: _stream_readable,
3657
+ "node:_stream_readable": [
3658
+ ">= 14.18 && < 15",
3659
+ ">= 16"
3660
+ ],
3661
+ _stream_writable: _stream_writable,
3662
+ "node:_stream_writable": [
3663
+ ">= 14.18 && < 15",
3664
+ ">= 16"
3665
+ ],
3666
+ stream: stream,
3667
+ "node:stream": [
3668
+ ">= 14.18 && < 15",
3669
+ ">= 16"
3670
+ ],
3671
+ "stream/consumers": ">= 16.7",
3672
+ "node:stream/consumers": ">= 16.7",
3673
+ "stream/promises": ">= 15",
3674
+ "node:stream/promises": ">= 16",
3675
+ "stream/web": ">= 16.5",
3676
+ "node:stream/web": ">= 16.5",
3677
+ string_decoder: string_decoder,
3678
+ "node:string_decoder": [
3679
+ ">= 14.18 && < 15",
3680
+ ">= 16"
3681
+ ],
3682
+ sys: sys,
3683
+ "node:sys": [
3684
+ ">= 14.18 && < 15",
3685
+ ">= 16"
3686
+ ],
3687
+ "test/reporters": ">= 19.9 && < 20.2",
3688
+ "node:test/reporters": [
3689
+ ">= 18.17 && < 19",
3690
+ ">= 19.9",
3691
+ ">= 20"
3692
+ ],
3693
+ "test/mock_loader": ">= 22.3 && < 22.7",
3694
+ "node:test/mock_loader": ">= 22.3 && < 22.7",
3695
+ "node:test": [
3696
+ ">= 16.17 && < 17",
3697
+ ">= 18"
3698
+ ],
3699
+ timers: timers,
3700
+ "node:timers": [
3701
+ ">= 14.18 && < 15",
3702
+ ">= 16"
3703
+ ],
3704
+ "timers/promises": ">= 15",
3705
+ "node:timers/promises": ">= 16",
3706
+ _tls_common: _tls_common,
3707
+ "node:_tls_common": [
3708
+ ">= 14.18 && < 15",
3709
+ ">= 16"
3710
+ ],
3711
+ _tls_legacy: _tls_legacy,
3712
+ _tls_wrap: _tls_wrap,
3713
+ "node:_tls_wrap": [
3714
+ ">= 14.18 && < 15",
3715
+ ">= 16"
3716
+ ],
3717
+ tls: tls,
3718
+ "node:tls": [
3719
+ ">= 14.18 && < 15",
3720
+ ">= 16"
3721
+ ],
3722
+ trace_events: trace_events,
3723
+ "node:trace_events": [
3724
+ ">= 14.18 && < 15",
3725
+ ">= 16"
3726
+ ],
3727
+ tty: tty,
3728
+ "node:tty": [
3729
+ ">= 14.18 && < 15",
3730
+ ">= 16"
3731
+ ],
3732
+ url: url,
3733
+ "node:url": [
3734
+ ">= 14.18 && < 15",
3735
+ ">= 16"
3736
+ ],
3737
+ util: util,
3738
+ "node:util": [
3739
+ ">= 14.18 && < 15",
3740
+ ">= 16"
3741
+ ],
3742
+ "util/types": ">= 15.3",
3743
+ "node:util/types": ">= 16",
3744
+ "v8/tools/arguments": ">= 10 && < 12",
3745
+ "v8/tools/codemap": [
3746
+ ">= 4.4 && < 5",
3747
+ ">= 5.2 && < 12"
3748
+ ],
3749
+ "v8/tools/consarray": [
3750
+ ">= 4.4 && < 5",
3751
+ ">= 5.2 && < 12"
3752
+ ],
3753
+ "v8/tools/csvparser": [
3754
+ ">= 4.4 && < 5",
3755
+ ">= 5.2 && < 12"
3756
+ ],
3757
+ "v8/tools/logreader": [
3758
+ ">= 4.4 && < 5",
3759
+ ">= 5.2 && < 12"
3760
+ ],
3761
+ "v8/tools/profile_view": [
3762
+ ">= 4.4 && < 5",
3763
+ ">= 5.2 && < 12"
3764
+ ],
3765
+ "v8/tools/splaytree": [
3766
+ ">= 4.4 && < 5",
3767
+ ">= 5.2 && < 12"
3768
+ ],
3769
+ v8: v8,
3770
+ "node:v8": [
3771
+ ">= 14.18 && < 15",
3772
+ ">= 16"
3773
+ ],
3774
+ vm: vm,
3775
+ "node:vm": [
3776
+ ">= 14.18 && < 15",
3777
+ ">= 16"
3778
+ ],
3779
+ wasi: wasi,
3780
+ "node:wasi": [
3781
+ ">= 18.17 && < 19",
3782
+ ">= 20"
3783
+ ],
3784
+ worker_threads: worker_threads,
3785
+ "node:worker_threads": [
3786
+ ">= 14.18 && < 15",
3787
+ ">= 16"
3788
+ ],
3789
+ zlib: zlib,
3790
+ "node:zlib": [
3791
+ ">= 14.18 && < 15",
3792
+ ">= 16"
3793
+ ]
3794
+ };
3795
+
3796
+ var core_1;
3797
+ var hasRequiredCore;
3798
+
3799
+ function requireCore () {
3800
+ if (hasRequiredCore) return core_1;
3801
+ hasRequiredCore = 1;
3802
+
3803
+ var isCoreModule = /*@__PURE__*/ requireIsCoreModule();
3804
+ var data = require$$1;
3805
+
3806
+ var core = {};
3807
+ for (var mod in data) {
3808
+ if (Object.prototype.hasOwnProperty.call(data, mod)) {
3809
+ core[mod] = isCoreModule(mod);
3810
+ }
3811
+ }
3812
+ core_1 = core;
3813
+ return core_1;
3814
+ }
3815
+
3816
+ var isCore;
3817
+ var hasRequiredIsCore;
3818
+
3819
+ function requireIsCore () {
3820
+ if (hasRequiredIsCore) return isCore;
3821
+ hasRequiredIsCore = 1;
3822
+ var isCoreModule = /*@__PURE__*/ requireIsCoreModule();
3823
+
3824
+ isCore = function isCore(x) {
3825
+ return isCoreModule(x);
3826
+ };
3827
+ return isCore;
3828
+ }
3829
+
3830
+ var sync;
3831
+ var hasRequiredSync;
3832
+
3833
+ function requireSync () {
3834
+ if (hasRequiredSync) return sync;
3835
+ hasRequiredSync = 1;
3836
+ var isCore = /*@__PURE__*/ requireIsCoreModule();
3837
+ var fs = fs__default__default;
3838
+ var path = path__default;
3839
+ var getHomedir = requireHomedir();
3840
+ var caller = requireCaller();
3841
+ var nodeModulesPaths = requireNodeModulesPaths();
3842
+ var normalizeOptions = requireNormalizeOptions();
3843
+
3844
+ var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
3845
+
3846
+ var relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/;
3847
+ var windowsDriveRegex = /^\w:[/\\]*$/;
3848
+ var nodeModulesRegex = /[/\\]node_modules[/\\]*$/;
3849
+
3850
+ var homedir = getHomedir();
3851
+ var defaultPaths = function () {
3852
+ return [
3853
+ path.join(homedir, '.node_modules'),
3854
+ path.join(homedir, '.node_libraries')
3855
+ ];
3856
+ };
3857
+
3858
+ var defaultIsFile = function isFile(file) {
3859
+ try {
3860
+ var stat = fs.statSync(file, { throwIfNoEntry: false });
3861
+ } catch (e) {
3862
+ if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
3863
+ throw e;
3864
+ }
3865
+ return !!stat && (stat.isFile() || stat.isFIFO());
3866
+ };
3867
+
3868
+ var defaultIsDir = function isDirectory(dir) {
3869
+ try {
3870
+ var stat = fs.statSync(dir, { throwIfNoEntry: false });
3871
+ } catch (e) {
3872
+ if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
3873
+ throw e;
3874
+ }
3875
+ return !!stat && stat.isDirectory();
3876
+ };
3877
+
3878
+ var defaultRealpathSync = function realpathSync(x) {
3879
+ try {
3880
+ return realpathFS(x);
3881
+ } catch (realpathErr) {
3882
+ if (realpathErr.code !== 'ENOENT') {
3883
+ throw realpathErr;
3884
+ }
3885
+ }
3886
+ return x;
3887
+ };
3888
+
3889
+ var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
3890
+ if (opts && opts.preserveSymlinks === false) {
3891
+ return realpathSync(x);
3892
+ }
3893
+ return x;
3894
+ };
3895
+
3896
+ var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) {
3897
+ var body = readFileSync(pkgfile);
3898
+ try {
3899
+ var pkg = JSON.parse(body);
3900
+ return pkg;
3901
+ } catch (jsonErr) {}
3902
+ };
3903
+
3904
+ var getPackageCandidates = function getPackageCandidates(x, start, opts) {
3905
+ var dirs = nodeModulesPaths(start, opts, x);
3906
+ for (var i = 0; i < dirs.length; i++) {
3907
+ dirs[i] = path.join(dirs[i], x);
3908
+ }
3909
+ return dirs;
3910
+ };
3911
+
3912
+ sync = function resolveSync(x, options) {
3913
+ if (typeof x !== 'string') {
3914
+ throw new TypeError('Path must be a string.');
3915
+ }
3916
+ var opts = normalizeOptions(x, options);
3917
+
3918
+ var isFile = opts.isFile || defaultIsFile;
3919
+ var readFileSync = opts.readFileSync || fs.readFileSync;
3920
+ var isDirectory = opts.isDirectory || defaultIsDir;
3921
+ var realpathSync = opts.realpathSync || defaultRealpathSync;
3922
+ var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
3923
+ if (opts.readFileSync && opts.readPackageSync) {
3924
+ throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.');
3925
+ }
3926
+ var packageIterator = opts.packageIterator;
3927
+
3928
+ var extensions = opts.extensions || ['.js'];
3929
+ var includeCoreModules = opts.includeCoreModules !== false;
3930
+ var basedir = opts.basedir || path.dirname(caller());
3931
+ var parent = opts.filename || basedir;
3932
+
3933
+ opts.paths = opts.paths || defaultPaths();
3934
+
3935
+ var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);
3936
+
3937
+ if (relativePathRegex.test(x)) {
3938
+ var res = path.resolve(absoluteStart, x);
3939
+ if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
3940
+ var m = loadAsFileSync(res) || loadAsDirectorySync(res);
3941
+ if (m) return maybeRealpathSync(realpathSync, m, opts);
3942
+ } else if (includeCoreModules && isCore(x)) {
3943
+ return x;
3944
+ } else {
3945
+ var n = loadNodeModulesSync(x, absoluteStart);
3946
+ if (n) return maybeRealpathSync(realpathSync, n, opts);
3947
+ }
3948
+
3949
+ var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
3950
+ err.code = 'MODULE_NOT_FOUND';
3951
+ throw err;
3952
+
3953
+ function loadAsFileSync(x) {
3954
+ var pkg = loadpkg(path.dirname(x));
3955
+
3956
+ if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
3957
+ var rfile = path.relative(pkg.dir, x);
3958
+ var r = opts.pathFilter(pkg.pkg, x, rfile);
3959
+ if (r) {
3960
+ x = path.resolve(pkg.dir, r);
3961
+ }
3962
+ }
3963
+
3964
+ if (isFile(x)) {
3965
+ return x;
3966
+ }
3967
+
3968
+ for (var i = 0; i < extensions.length; i++) {
3969
+ var file = x + extensions[i];
3970
+ if (isFile(file)) {
3971
+ return file;
3972
+ }
3973
+ }
3974
+ }
3975
+
3976
+ function loadpkg(dir) {
3977
+ if (dir === '' || dir === '/') return;
3978
+ if (process.platform === 'win32' && windowsDriveRegex.test(dir)) {
3979
+ return;
3980
+ }
3981
+ if (nodeModulesRegex.test(dir)) return;
3982
+
3983
+ var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');
3984
+
3985
+ if (!isFile(pkgfile)) {
3986
+ return loadpkg(path.dirname(dir));
3987
+ }
3988
+
3989
+ var pkg = readPackageSync(readFileSync, pkgfile);
3990
+
3991
+ if (pkg && opts.packageFilter) {
3992
+ pkg = opts.packageFilter(pkg, dir);
3993
+ }
3994
+
3995
+ return { pkg: pkg, dir: dir };
3996
+ }
3997
+
3998
+ function loadAsDirectorySync(x) {
3999
+ var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json');
4000
+ if (isFile(pkgfile)) {
4001
+ try {
4002
+ var pkg = readPackageSync(readFileSync, pkgfile);
4003
+ } catch (e) {}
4004
+
4005
+ if (pkg && opts.packageFilter) {
4006
+ pkg = opts.packageFilter(pkg, x);
4007
+ }
4008
+
4009
+ if (pkg && pkg.main) {
4010
+ if (typeof pkg.main !== 'string') {
4011
+ var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
4012
+ mainError.code = 'INVALID_PACKAGE_MAIN';
4013
+ throw mainError;
4014
+ }
4015
+ if (pkg.main === '.' || pkg.main === './') {
4016
+ pkg.main = 'index';
4017
+ }
4018
+ try {
4019
+ var m = loadAsFileSync(path.resolve(x, pkg.main));
4020
+ if (m) return m;
4021
+ var n = loadAsDirectorySync(path.resolve(x, pkg.main));
4022
+ if (n) return n;
4023
+ } catch (e) {}
4024
+ }
4025
+ }
4026
+
4027
+ return loadAsFileSync(path.join(x, '/index'));
4028
+ }
4029
+
4030
+ function loadNodeModulesSync(x, start) {
4031
+ var thunk = function () { return getPackageCandidates(x, start, opts); };
4032
+ var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();
4033
+
4034
+ for (var i = 0; i < dirs.length; i++) {
4035
+ var dir = dirs[i];
4036
+ if (isDirectory(path.dirname(dir))) {
4037
+ var m = loadAsFileSync(dir);
4038
+ if (m) return m;
4039
+ var n = loadAsDirectorySync(dir);
4040
+ if (n) return n;
4041
+ }
4042
+ }
4043
+ }
4044
+ };
4045
+ return sync;
4046
+ }
4047
+
4048
+ var resolve$1;
4049
+ var hasRequiredResolve;
4050
+
4051
+ function requireResolve () {
4052
+ if (hasRequiredResolve) return resolve$1;
4053
+ hasRequiredResolve = 1;
4054
+ var async = requireAsync();
4055
+ async.core = requireCore();
4056
+ async.isCore = requireIsCore();
4057
+ async.sync = requireSync();
4058
+
4059
+ resolve$1 = async;
4060
+ return resolve$1;
4061
+ }
4062
+
4063
+ var resolveExports = requireResolve();
4064
+ const resolve = /*@__PURE__*/getDefaultExportFromCjs(resolveExports);
4065
+
4066
+ function createFormattingHost(ts, compilerOptions) {
4067
+ return {
4068
+ getCompilationSettings: () => compilerOptions,
4069
+ getCurrentDirectory: () => process.cwd(),
4070
+ getNewLine() {
4071
+ switch (compilerOptions.newLine) {
4072
+ case ts.NewLineKind.CarriageReturnLineFeed:
4073
+ return '\r\n';
4074
+ case ts.NewLineKind.LineFeed:
4075
+ return '\n';
4076
+ default:
4077
+ return ts.sys.newLine;
4078
+ }
4079
+ },
4080
+ getCanonicalFileName: (fileName) => ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase()
4081
+ };
4082
+ }
4083
+
4084
+ function createModuleResolver(ts, host, filter) {
4085
+ const compilerOptions = host.getCompilationSettings();
4086
+ const cache = ts.createModuleResolutionCache(process.cwd(), host.getCanonicalFileName, compilerOptions);
4087
+ const moduleHost = { ...ts.sys, ...host };
4088
+ return (moduleName, containingFile, redirectedReference, mode) => {
4089
+ const { resolvedModule } = ts.resolveModuleName(moduleName, containingFile, compilerOptions, moduleHost, cache, redirectedReference, mode);
4090
+ if ((resolvedModule === null || resolvedModule === void 0 ? void 0 : resolvedModule.isExternalLibraryImport) && filter(resolvedModule === null || resolvedModule === void 0 ? void 0 : resolvedModule.resolvedFileName)) {
4091
+ resolvedModule.isExternalLibraryImport = false;
4092
+ }
4093
+ return resolvedModule;
4094
+ };
4095
+ }
4096
+
4097
+ const resolveId = (file, opts) => resolve.sync(file, opts);
4098
+ const getTsLibPath = () => {
4099
+ try {
4100
+ return resolveId(process.env.__TSLIB_TEST_PATH__ || 'tslib/tslib.es6.js', {
4101
+ basedir: fileURLToPath(new URL('.', import.meta.url))
4102
+ });
4103
+ }
4104
+ catch (_) {
4105
+ return null;
4106
+ }
4107
+ };
4108
+
4109
+ const getPluginOptions = (options) => {
4110
+ const { cacheDir, exclude, include, filterRoot, noForceEmit, transformers, recreateTransformersOnRebuild, tsconfig, tslib, typescript, outputToFilesystem, compilerOptions,
4111
+ ...extra } = options;
4112
+ return {
4113
+ cacheDir,
4114
+ include,
4115
+ exclude,
4116
+ filterRoot,
4117
+ noForceEmit: noForceEmit || false,
4118
+ tsconfig,
4119
+ compilerOptions: { ...extra, ...compilerOptions },
4120
+ typescript: typescript || typescript$1,
4121
+ tslib: tslib || getTsLibPath(),
4122
+ transformers,
4123
+ recreateTransformersOnRebuild: recreateTransformersOnRebuild === true,
4124
+ outputToFilesystem
4125
+ };
4126
+ };
4127
+
4128
+ function diagnosticToWarning(ts, host, diagnostic) {
4129
+ const pluginCode = `TS${diagnostic.code}`;
4130
+ const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
4131
+ const warning = {
4132
+ pluginCode,
4133
+ message: `@rollup/plugin-typescript ${pluginCode}: ${message}`
4134
+ };
4135
+ if (diagnostic.file) {
4136
+ const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
4137
+ warning.loc = {
4138
+ column: character + 1,
4139
+ line: line + 1,
4140
+ file: diagnostic.file.fileName
4141
+ };
4142
+ if (host) {
4143
+ const formatted = ts.formatDiagnosticsWithColorAndContext([diagnostic], host);
4144
+ let frame = formatted.slice(formatted.indexOf(message) + message.length);
4145
+ const newLine = host.getNewLine();
4146
+ if (frame.startsWith(newLine)) {
4147
+ frame = frame.slice(frame.indexOf(newLine) + newLine.length);
4148
+ }
4149
+ warning.frame = frame;
4150
+ }
4151
+ }
4152
+ return warning;
4153
+ }
4154
+
4155
+ const DEFAULT_COMPILER_OPTIONS = {
4156
+ module: 'esnext',
4157
+ skipLibCheck: true
4158
+ };
4159
+ const OVERRIDABLE_EMIT_COMPILER_OPTIONS = {
4160
+ noEmit: false,
4161
+ emitDeclarationOnly: false
4162
+ };
4163
+ const FORCED_COMPILER_OPTIONS = {
4164
+ noEmitHelpers: true,
4165
+ importHelpers: true,
4166
+ noResolve: false
4167
+ };
4168
+
4169
+ const DIRECTORY_PROPS = ['outDir', 'declarationDir'];
4170
+ function makePathsAbsolute(compilerOptions, relativeTo) {
4171
+ for (const pathProp of DIRECTORY_PROPS) {
4172
+ if (compilerOptions[pathProp]) {
4173
+ compilerOptions[pathProp] = resolve$2(relativeTo, compilerOptions[pathProp]);
4174
+ }
4175
+ }
4176
+ }
4177
+ function normalizeCompilerOptions(ts, compilerOptions) {
4178
+ let autoSetSourceMap = false;
4179
+ if (compilerOptions.inlineSourceMap) {
4180
+ compilerOptions.sourceMap = true;
4181
+ compilerOptions.inlineSourceMap = false;
4182
+ }
4183
+ else if (typeof compilerOptions.sourceMap !== 'boolean') {
4184
+ compilerOptions.sourceMap = true;
4185
+ compilerOptions.inlineSources = true;
4186
+ autoSetSourceMap = true;
4187
+ }
4188
+ switch (compilerOptions.module) {
4189
+ case ts.ModuleKind.ES2015:
4190
+ case ts.ModuleKind.ESNext:
4191
+ case ts.ModuleKind.Node16:
4192
+ case ts.ModuleKind.NodeNext:
4193
+ case ts.ModuleKind.CommonJS:
4194
+ return autoSetSourceMap;
4195
+ case ts.ModuleKind.None:
4196
+ case ts.ModuleKind.AMD:
4197
+ case ts.ModuleKind.UMD:
4198
+ case ts.ModuleKind.System: {
4199
+ const moduleType = ts.ModuleKind[compilerOptions.module];
4200
+ throw new Error(`@rollup/plugin-typescript: The module kind should be 'ES2015', 'ESNext', 'node16' or 'nodenext', found: '${moduleType}'`);
4201
+ }
4202
+ default:
4203
+ compilerOptions.module = ts.ModuleKind.ESNext;
4204
+ }
4205
+ return autoSetSourceMap;
4206
+ }
4207
+
4208
+ const { ModuleKind: ModuleKind$1, ModuleResolutionKind } = typescript$1;
4209
+ function makeForcedCompilerOptions(noForceEmit) {
4210
+ return { ...FORCED_COMPILER_OPTIONS, ...(noForceEmit ? {} : OVERRIDABLE_EMIT_COMPILER_OPTIONS) };
4211
+ }
4212
+ function getTsConfigPath(ts, relativePath) {
4213
+ if (relativePath === false)
4214
+ return null;
4215
+ const tsConfigPath = resolve$2(process.cwd(), relativePath || 'tsconfig.json');
4216
+ if (!ts.sys.fileExists(tsConfigPath)) {
4217
+ if (relativePath) {
4218
+ throw new Error(`Could not find specified tsconfig.json at ${tsConfigPath}`);
4219
+ }
4220
+ else {
4221
+ return null;
4222
+ }
4223
+ }
4224
+ return tsConfigPath;
4225
+ }
4226
+ function readTsConfigFile(ts, tsConfigPath) {
4227
+ const { config, error } = ts.readConfigFile(tsConfigPath, (path) => readFileSync(path, 'utf8'));
4228
+ if (error) {
4229
+ throw Object.assign(Error(), diagnosticToWarning(ts, null, error));
4230
+ }
4231
+ return config || {};
4232
+ }
4233
+ function containsEnumOptions(compilerOptions) {
4234
+ const enums = [
4235
+ 'module',
4236
+ 'target',
4237
+ 'jsx',
4238
+ 'moduleResolution',
4239
+ 'newLine'
4240
+ ];
4241
+ return enums.some((prop) => prop in compilerOptions && typeof compilerOptions[prop] === 'number');
4242
+ }
4243
+ function setModuleResolutionKind(parsedConfig) {
4244
+ const moduleKind = parsedConfig.options.module;
4245
+ const moduleResolution = moduleKind === ModuleKind$1.Node16
4246
+ ? ModuleResolutionKind.Node16
4247
+ : moduleKind === ModuleKind$1.NodeNext
4248
+ ? ModuleResolutionKind.NodeNext
4249
+ : ModuleResolutionKind.NodeJs;
4250
+ return {
4251
+ ...parsedConfig,
4252
+ options: {
4253
+ moduleResolution,
4254
+ ...parsedConfig.options
4255
+ }
4256
+ };
4257
+ }
4258
+ const configCache = new Map();
4259
+ function parseTypescriptConfig(ts, tsconfig, compilerOptions, noForceEmit) {
4260
+ const cwd = process.cwd();
4261
+ makePathsAbsolute(compilerOptions, cwd);
4262
+ let parsedConfig;
4263
+ const tsConfigPath = getTsConfigPath(ts, tsconfig) || undefined;
4264
+ const tsConfigFile = tsConfigPath ? readTsConfigFile(ts, tsConfigPath) : {};
4265
+ const basePath = tsConfigPath ? dirname(tsConfigPath) : cwd;
4266
+ if (containsEnumOptions(compilerOptions)) {
4267
+ parsedConfig = setModuleResolutionKind(ts.parseJsonConfigFileContent({
4268
+ ...tsConfigFile,
4269
+ compilerOptions: {
4270
+ ...DEFAULT_COMPILER_OPTIONS,
4271
+ ...tsConfigFile.compilerOptions
4272
+ }
4273
+ }, ts.sys, basePath, { ...compilerOptions, ...makeForcedCompilerOptions(noForceEmit) }, tsConfigPath, undefined, undefined, configCache));
4274
+ }
4275
+ else {
4276
+ parsedConfig = setModuleResolutionKind(ts.parseJsonConfigFileContent({
4277
+ ...tsConfigFile,
4278
+ compilerOptions: {
4279
+ ...DEFAULT_COMPILER_OPTIONS,
4280
+ ...tsConfigFile.compilerOptions,
4281
+ ...compilerOptions
4282
+ }
4283
+ }, ts.sys, basePath, makeForcedCompilerOptions(noForceEmit), tsConfigPath, undefined, undefined, configCache));
4284
+ }
4285
+ const autoSetSourceMap = normalizeCompilerOptions(ts, parsedConfig.options);
4286
+ return {
4287
+ ...parsedConfig,
4288
+ autoSetSourceMap
4289
+ };
4290
+ }
4291
+ function emitParsedOptionsErrors(ts, context, parsedOptions) {
4292
+ if (parsedOptions.errors.length > 0) {
4293
+ parsedOptions.errors.forEach((error) => context.warn(diagnosticToWarning(ts, null, error)));
4294
+ context.error(`@rollup/plugin-typescript: Couldn't process compiler options`);
4295
+ }
4296
+ }
4297
+
4298
+ function validateSourceMap(context, compilerOptions, outputOptions, autoSetSourceMap) {
4299
+ if (compilerOptions.sourceMap && !outputOptions.sourcemap && !autoSetSourceMap) {
4300
+ context.warn(`@rollup/plugin-typescript: Rollup 'sourcemap' option must be set to generate source maps.`);
4301
+ }
4302
+ else if (!compilerOptions.sourceMap && outputOptions.sourcemap) {
4303
+ context.warn(`@rollup/plugin-typescript: Typescript 'sourceMap' compiler option must be set to generate source maps.`);
4304
+ }
4305
+ }
4306
+ function validatePaths(context, compilerOptions, outputOptions) {
4307
+ if (compilerOptions.out) {
4308
+ context.error(`@rollup/plugin-typescript: Deprecated Typescript compiler option 'out' is not supported. Use 'outDir' instead.`);
4309
+ }
4310
+ else if (compilerOptions.outFile) {
4311
+ context.error(`@rollup/plugin-typescript: Typescript compiler option 'outFile' is not supported. Use 'outDir' instead.`);
4312
+ }
4313
+ let outputDir = outputOptions.dir;
4314
+ if (outputOptions.file) {
4315
+ outputDir = dirname(outputOptions.file);
4316
+ }
4317
+ for (const dirProperty of DIRECTORY_PROPS) {
4318
+ if (compilerOptions[dirProperty] && outputDir) {
4319
+ if (outputOptions.dir) {
4320
+ const fromRollupDirToTs = relative(outputDir, compilerOptions[dirProperty]);
4321
+ if (fromRollupDirToTs.startsWith('..')) {
4322
+ context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside Rollup 'dir' option.`);
4323
+ }
4324
+ }
4325
+ else if (dirProperty === 'outDir') {
4326
+ const fromTsDirToRollup = relative(compilerOptions[dirProperty], outputDir);
4327
+ if (fromTsDirToRollup.startsWith('..')) {
4328
+ context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside the same directory as the Rollup 'file' option.`);
4329
+ }
4330
+ }
4331
+ else {
4332
+ const fromTsDirToRollup = relative(outputDir, compilerOptions[dirProperty]);
4333
+ if (fromTsDirToRollup.startsWith('..')) {
4334
+ context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside the same directory as the Rollup 'file' option.`);
4335
+ }
4336
+ }
4337
+ }
4338
+ }
4339
+ if (compilerOptions.declaration || compilerOptions.declarationMap || compilerOptions.composite) {
4340
+ if (DIRECTORY_PROPS.every((dirProperty) => !compilerOptions[dirProperty])) {
4341
+ context.error(`@rollup/plugin-typescript: You are using one of Typescript's compiler options 'declaration', 'declarationMap' or 'composite'. ` +
4342
+ `In this case 'outDir' or 'declarationDir' must be specified to generate declaration files.`);
4343
+ }
4344
+ }
4345
+ }
4346
+
4347
+ function isCodeOutputFile(name) {
4348
+ return !isMapOutputFile(name) && !isDeclarationOutputFile(name);
4349
+ }
4350
+ function isMapOutputFile(name) {
4351
+ return name.endsWith('.map');
4352
+ }
4353
+ function isTypeScriptMapOutputFile(name) {
4354
+ return name.endsWith('ts.map');
4355
+ }
4356
+ function isDeclarationOutputFile(name) {
4357
+ return /\.d\.[cm]?ts$/.test(name);
4358
+ }
4359
+ function getEmittedFile(fileName, emittedFiles, tsCache) {
4360
+ let code;
4361
+ if (fileName) {
4362
+ if (emittedFiles.has(fileName)) {
4363
+ code = emittedFiles.get(fileName);
4364
+ }
4365
+ else {
4366
+ code = tsCache.getCached(fileName);
4367
+ }
4368
+ }
4369
+ return code;
4370
+ }
4371
+ function findTypescriptOutput(ts, parsedOptions, id, emittedFiles, tsCache) {
4372
+ const emittedFileNames = ts.getOutputFileNames(parsedOptions, id, !ts.sys.useCaseSensitiveFileNames);
4373
+ const codeFile = emittedFileNames.find(isCodeOutputFile);
4374
+ const mapFile = emittedFileNames.find(isMapOutputFile);
4375
+ return {
4376
+ code: getEmittedFile(codeFile, emittedFiles, tsCache),
4377
+ map: getEmittedFile(mapFile, emittedFiles, tsCache),
4378
+ declarations: emittedFileNames.filter((name) => name !== codeFile && name !== mapFile)
4379
+ };
4380
+ }
4381
+ function normalizePath(fileName) {
4382
+ return fileName.split(path$2.win32.sep).join(path$2.posix.sep);
4383
+ }
4384
+ async function emitFile({ dir }, outputToFilesystem, context, filePath, fileSource) {
4385
+ const normalizedFilePath = normalizePath(filePath);
4386
+ const relativePath = dir ? path$2.relative(dir, normalizedFilePath) : '..';
4387
+ if (relativePath.startsWith('..')) {
4388
+ if (outputToFilesystem == null) {
4389
+ context.warn(`@rollup/plugin-typescript: outputToFilesystem option is defaulting to true.`);
4390
+ }
4391
+ if (outputToFilesystem !== false) {
4392
+ await promises.mkdir(path$2.dirname(normalizedFilePath), { recursive: true });
4393
+ await promises.writeFile(normalizedFilePath, fileSource);
4394
+ }
4395
+ }
4396
+ else {
4397
+ context.emitFile({
4398
+ type: 'asset',
4399
+ fileName: relativePath,
4400
+ source: fileSource
4401
+ });
4402
+ }
4403
+ }
4404
+
4405
+ const { ModuleKind } = typescript$1;
4406
+ const pluginName = '@rollup/plugin-typescript';
4407
+ const moduleErrorMessage = `
4408
+ ${pluginName}: Rollup requires that TypeScript produces ES Modules. Unfortunately your configuration specifies a
4409
+ "module" other than "esnext". Unless you know what you're doing, please change "module" to "esnext"
4410
+ in the target tsconfig.json file or plugin options.`.replace(/\n/g, '');
4411
+ const tsLibErrorMessage = `${pluginName}: Could not find module 'tslib', which is required by this plugin. Is it installed?`;
4412
+ let undef;
4413
+ const validModules = [
4414
+ ModuleKind.ES2015,
4415
+ ModuleKind.ES2020,
4416
+ ModuleKind.ESNext,
4417
+ ModuleKind.Node16,
4418
+ ModuleKind.NodeNext,
4419
+ undef
4420
+ ];
4421
+ const preflight = ({ config, context, inputPreserveModules, tslib }) => {
4422
+ if (!validModules.includes(config.options.module)) {
4423
+ context.warn(moduleErrorMessage);
4424
+ }
4425
+ if (!inputPreserveModules && tslib === null) {
4426
+ context.error(tsLibErrorMessage);
4427
+ }
4428
+ };
4429
+
4430
+ const CANNOT_COMPILE_ESM = 1204;
4431
+ function emitDiagnostic(ts, context, host, diagnostic) {
4432
+ if (diagnostic.code === CANNOT_COMPILE_ESM)
4433
+ return;
4434
+ const { noEmitOnError } = host.getCompilationSettings();
4435
+ const warning = diagnosticToWarning(ts, host, diagnostic);
4436
+ if (noEmitOnError && diagnostic.category === ts.DiagnosticCategory.Error) {
4437
+ context.error(warning);
4438
+ }
4439
+ else {
4440
+ context.warn(warning);
4441
+ }
4442
+ }
4443
+ function buildDiagnosticReporter(ts, context, host) {
4444
+ return function reportDiagnostics(diagnostic) {
4445
+ emitDiagnostic(ts, context, host, diagnostic);
4446
+ };
4447
+ }
4448
+
4449
+ function mergeTransformers(builder, ...input) {
4450
+ const transformerTypes = ['after', 'afterDeclarations', 'before'];
4451
+ const accumulator = {
4452
+ after: [],
4453
+ afterDeclarations: [],
4454
+ before: []
4455
+ };
4456
+ let program;
4457
+ let typeChecker;
4458
+ input.forEach((transformers) => {
4459
+ if (!transformers) {
4460
+ return;
4461
+ }
4462
+ transformerTypes.forEach((stage) => {
4463
+ getTransformers(transformers[stage]).forEach((transformer) => {
4464
+ if (!transformer) {
4465
+ return;
4466
+ }
4467
+ if ('type' in transformer) {
4468
+ if (typeof transformer.factory === 'function') {
4469
+ let factory;
4470
+ if (transformer.type === 'program') {
4471
+ const currentProgram = program !== null && program !== void 0 ? program : builder.getProgram();
4472
+ factory = transformer.factory(currentProgram, () => builder.getProgram());
4473
+ program = currentProgram;
4474
+ }
4475
+ else {
4476
+ const currentProgram = program !== null && program !== void 0 ? program : builder.getProgram();
4477
+ const currentTypeChecker = typeChecker !== null && typeChecker !== void 0 ? typeChecker : currentProgram.getTypeChecker();
4478
+ factory = transformer.factory(currentTypeChecker);
4479
+ program = currentProgram;
4480
+ typeChecker = currentTypeChecker;
4481
+ }
4482
+ if (factory) {
4483
+ accumulator[stage].push(factory);
4484
+ }
4485
+ }
4486
+ }
4487
+ else {
4488
+ accumulator[stage].push(transformer);
4489
+ }
4490
+ });
4491
+ });
4492
+ });
4493
+ return accumulator;
4494
+ }
4495
+ function getTransformers(transformers) {
4496
+ return transformers || [];
4497
+ }
4498
+
4499
+ const { DiagnosticCategory } = typescript$1;
4500
+ var DiagnosticCode;
4501
+ (function (DiagnosticCode) {
4502
+ DiagnosticCode[DiagnosticCode["FILE_CHANGE_DETECTED"] = 6032] = "FILE_CHANGE_DETECTED";
4503
+ DiagnosticCode[DiagnosticCode["FOUND_1_ERROR_WATCHING_FOR_FILE_CHANGES"] = 6193] = "FOUND_1_ERROR_WATCHING_FOR_FILE_CHANGES";
4504
+ DiagnosticCode[DiagnosticCode["FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES"] = 6194] = "FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES";
4505
+ })(DiagnosticCode || (DiagnosticCode = {}));
4506
+ function createDeferred(timeout) {
4507
+ let promise;
4508
+ let resolve = () => { };
4509
+ if (timeout) {
4510
+ promise = Promise.race([
4511
+ new Promise((r) => setTimeout(r, timeout, true)),
4512
+ new Promise((r) => (resolve = r))
4513
+ ]);
4514
+ }
4515
+ else {
4516
+ promise = new Promise((r) => (resolve = r));
4517
+ }
4518
+ return { promise, resolve };
4519
+ }
4520
+ class WatchProgramHelper {
4521
+ constructor() {
4522
+ this._startDeferred = null;
4523
+ this._finishDeferred = null;
4524
+ }
4525
+ watch(timeout = 1000) {
4526
+ this._startDeferred = createDeferred(timeout);
4527
+ this._finishDeferred = createDeferred();
4528
+ }
4529
+ handleStatus(diagnostic) {
4530
+ if (diagnostic.category === DiagnosticCategory.Message) {
4531
+ switch (diagnostic.code) {
4532
+ case DiagnosticCode.FILE_CHANGE_DETECTED:
4533
+ this.resolveStart();
4534
+ break;
4535
+ case DiagnosticCode.FOUND_1_ERROR_WATCHING_FOR_FILE_CHANGES:
4536
+ case DiagnosticCode.FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES:
4537
+ this.resolveFinish();
4538
+ break;
4539
+ }
4540
+ }
4541
+ }
4542
+ resolveStart() {
4543
+ if (this._startDeferred) {
4544
+ this._startDeferred.resolve(false);
4545
+ this._startDeferred = null;
4546
+ }
4547
+ }
4548
+ resolveFinish() {
4549
+ if (this._finishDeferred) {
4550
+ this._finishDeferred.resolve(false);
4551
+ this._finishDeferred = null;
4552
+ }
4553
+ }
4554
+ async wait() {
4555
+ var _a;
4556
+ if (this._startDeferred) {
4557
+ const timeout = await this._startDeferred.promise;
4558
+ if (timeout) {
4559
+ this._startDeferred = null;
4560
+ this._finishDeferred = null;
4561
+ }
4562
+ await ((_a = this._finishDeferred) === null || _a === void 0 ? void 0 : _a.promise);
4563
+ }
4564
+ }
4565
+ }
4566
+ function createWatchHost(ts, context, { formatHost, parsedOptions, writeFile, status, resolveModule, transformers, recreateTransformersOnRebuild }) {
4567
+ const createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram;
4568
+ const baseHost = ts.createWatchCompilerHost(parsedOptions.fileNames, parsedOptions.options, ts.sys, createProgram, buildDiagnosticReporter(ts, context, formatHost), status, parsedOptions.projectReferences);
4569
+ let createdTransformers;
4570
+ return {
4571
+ ...baseHost,
4572
+ afterProgramCreate(program) {
4573
+ if (recreateTransformersOnRebuild) {
4574
+ createdTransformers = void 0;
4575
+ }
4576
+ const origEmit = program.emit;
4577
+ program.emit = (targetSourceFile, _, cancellationToken, emitOnlyDtsFiles, customTransformers) => {
4578
+ createdTransformers !== null && createdTransformers !== void 0 ? createdTransformers : (createdTransformers = typeof transformers === 'function'
4579
+ ? transformers(program.getProgram())
4580
+ : mergeTransformers(program, transformers, customTransformers));
4581
+ return origEmit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, createdTransformers);
4582
+ };
4583
+ return baseHost.afterProgramCreate(program);
4584
+ },
4585
+ resolveModuleNames(moduleNames, containingFile, _reusedNames, redirectedReference, _optionsOnlyWithNewerTsVersions, containingSourceFile) {
4586
+ return moduleNames.map((moduleName, i) => {
4587
+ var _a;
4588
+ const mode = containingSourceFile
4589
+ ? (_a = ts.getModeForResolutionAtIndex) === null || _a === void 0 ? void 0 : _a.call(ts, containingSourceFile, i)
4590
+ : undefined;
4591
+ return resolveModule(moduleName, containingFile, redirectedReference, mode);
4592
+ });
4593
+ }
4594
+ };
4595
+ }
4596
+ function createWatchProgram(ts, context, options) {
4597
+ return ts.createWatchProgram(createWatchHost(ts, context, options));
4598
+ }
4599
+
4600
+ const createFileFolder = (filePath) => {
4601
+ const folderPath = path__default.dirname(filePath);
4602
+ fs__default__default.mkdirSync(folderPath, { recursive: true });
4603
+ };
4604
+ class TSCache {
4605
+ constructor(cacheFolder = '.rollup.cache') {
4606
+ this._cacheFolder = cacheFolder;
4607
+ }
4608
+ cachedFilename(fileName) {
4609
+ return path__default.join(this._cacheFolder, fileName.replace(/^([a-zA-Z]+):/, '$1'));
4610
+ }
4611
+ cacheCode(fileName, code) {
4612
+ const cachedPath = this.cachedFilename(fileName);
4613
+ createFileFolder(cachedPath);
4614
+ fs__default__default.writeFileSync(cachedPath, code);
4615
+ }
4616
+ isCached(fileName) {
4617
+ return fs__default__default.existsSync(this.cachedFilename(fileName));
4618
+ }
4619
+ getCached(fileName) {
4620
+ let code;
4621
+ if (this.isCached(fileName)) {
4622
+ code = fs__default__default.readFileSync(this.cachedFilename(fileName), { encoding: 'utf-8' });
4623
+ }
4624
+ return code;
4625
+ }
4626
+ }
4627
+
4628
+ function typescript(options = {}) {
4629
+ const { cacheDir, compilerOptions, exclude, filterRoot, include, outputToFilesystem, noForceEmit, transformers, recreateTransformersOnRebuild, tsconfig, tslib, typescript: ts } = getPluginOptions(options);
4630
+ const tsCache = new TSCache(cacheDir);
4631
+ const emittedFiles = new Map();
4632
+ const watchProgramHelper = new WatchProgramHelper();
4633
+ let autoOutDir = null;
4634
+ const cleanupAutoOutDir = () => {
4635
+ if (!autoOutDir)
4636
+ return;
4637
+ try {
4638
+ fs__default.rmSync(autoOutDir, { recursive: true, force: true });
4639
+ }
4640
+ catch {
4641
+ }
4642
+ autoOutDir = null;
4643
+ };
4644
+ const closeProgramAndCleanup = () => {
4645
+ try {
4646
+ program === null || program === void 0 ? void 0 : program.close();
4647
+ }
4648
+ finally {
4649
+ cleanupAutoOutDir();
4650
+ }
4651
+ };
4652
+ const parsedOptions = parseTypescriptConfig(ts, tsconfig, compilerOptions, noForceEmit);
4653
+ if (parsedOptions.options.allowJs && !parsedOptions.options.outDir) {
4654
+ autoOutDir = fs__default.mkdtempSync(path$2.join(require$$0.tmpdir(), 'rollup-plugin-typescript-allowjs-'));
4655
+ parsedOptions.options.outDir = autoOutDir;
4656
+ }
4657
+ const defaultInclude = parsedOptions.options.allowJs
4658
+ ? '{,**/}*.{cts,mts,ts,tsx,js,jsx,mjs,cjs}'
4659
+ : '{,**/}*.{cts,mts,ts,tsx}';
4660
+ const filterExclude = Array.isArray(exclude) ? [...exclude] : exclude ? [exclude] : [];
4661
+ if (parsedOptions.options.allowJs && !include && !exclude) {
4662
+ filterExclude.push('**/node_modules/**');
4663
+ }
4664
+ const effectiveOutDir = parsedOptions.options.outDir
4665
+ ? path$2.resolve(parsedOptions.options.outDir)
4666
+ : null;
4667
+ const willResolvePatterns = filterRoot !== false;
4668
+ const configuredBase = willResolvePatterns
4669
+ ? typeof filterRoot === 'string'
4670
+ ? filterRoot
4671
+ : parsedOptions.options.rootDir
4672
+ : null;
4673
+ const filterBaseAbs = configuredBase ? path$2.resolve(configuredBase) : null;
4674
+ if (effectiveOutDir) {
4675
+ const baseForContainment = filterBaseAbs !== null && filterBaseAbs !== void 0 ? filterBaseAbs : process.cwd();
4676
+ const outDirContainsFilterBase = (() => {
4677
+ const getRoot = (p) => {
4678
+ const r = path$2.parse(p).root;
4679
+ return process.platform === 'win32' ? r.toLowerCase() : r;
4680
+ };
4681
+ if (getRoot(effectiveOutDir) !== getRoot(baseForContainment))
4682
+ return false;
4683
+ const rel = path$2.relative(effectiveOutDir, baseForContainment);
4684
+ return rel === '' || (!rel.startsWith('..') && !path$2.isAbsolute(rel));
4685
+ })();
4686
+ if (!outDirContainsFilterBase) {
4687
+ filterExclude.push(normalizePath(path$2.join(effectiveOutDir, '**')));
4688
+ }
4689
+ }
4690
+ const filter = createFilter(include || defaultInclude, filterExclude, {
4691
+ resolve: typeof filterRoot === 'string'
4692
+ ? filterRoot
4693
+ : filterRoot === false
4694
+ ? false
4695
+ : parsedOptions.options.rootDir || process.cwd()
4696
+ });
4697
+ parsedOptions.fileNames = parsedOptions.fileNames.filter(filter);
4698
+ const formatHost = createFormattingHost(ts, parsedOptions.options);
4699
+ const resolveModule = createModuleResolver(ts, formatHost, filter);
4700
+ let program = null;
4701
+ return {
4702
+ name: 'typescript',
4703
+ buildStart(rollupOptions) {
4704
+ emitParsedOptionsErrors(ts, this, parsedOptions);
4705
+ preflight({
4706
+ config: parsedOptions,
4707
+ context: this,
4708
+ inputPreserveModules: rollupOptions
4709
+ .preserveModules,
4710
+ tslib
4711
+ });
4712
+ if (this.meta.watchMode !== true) {
4713
+ program === null || program === void 0 ? void 0 : program.close();
4714
+ program = null;
4715
+ }
4716
+ if (!program) {
4717
+ program = createWatchProgram(ts, this, {
4718
+ formatHost,
4719
+ resolveModule,
4720
+ parsedOptions,
4721
+ writeFile(fileName, data) {
4722
+ if (parsedOptions.options.composite || parsedOptions.options.incremental) {
4723
+ tsCache.cacheCode(fileName, data);
4724
+ }
4725
+ emittedFiles.set(fileName, data);
4726
+ },
4727
+ status(diagnostic) {
4728
+ watchProgramHelper.handleStatus(diagnostic);
4729
+ },
4730
+ transformers,
4731
+ recreateTransformersOnRebuild
4732
+ });
4733
+ }
4734
+ },
4735
+ watchChange(id) {
4736
+ if (!filter(id))
4737
+ return;
4738
+ watchProgramHelper.watch();
4739
+ },
4740
+ buildEnd() {
4741
+ if (this.meta.watchMode !== true) {
4742
+ closeProgramAndCleanup();
4743
+ }
4744
+ },
4745
+ closeWatcher() {
4746
+ closeProgramAndCleanup();
4747
+ },
4748
+ renderStart(outputOptions) {
4749
+ validateSourceMap(this, parsedOptions.options, outputOptions, parsedOptions.autoSetSourceMap);
4750
+ validatePaths(this, parsedOptions.options, outputOptions);
4751
+ },
4752
+ resolveId(importee, importer) {
4753
+ if (importee === 'tslib') {
4754
+ return tslib;
4755
+ }
4756
+ if (!importer)
4757
+ return null;
4758
+ const containingFile = normalizePath(importer);
4759
+ const mode = typeof ts.getImpliedNodeFormatForFile === 'function'
4760
+ ? ts.getImpliedNodeFormatForFile(
4761
+ containingFile, undefined,
4762
+ { ...ts.sys, ...formatHost }, parsedOptions.options)
4763
+ : undefined;
4764
+ const resolved = resolveModule(importee, containingFile, undefined, mode);
4765
+ if (resolved) {
4766
+ if (/\.d\.[cm]?ts/.test(resolved.extension))
4767
+ return null;
4768
+ if (!filter(resolved.resolvedFileName))
4769
+ return null;
4770
+ return path$2.normalize(resolved.resolvedFileName);
4771
+ }
4772
+ return null;
4773
+ },
4774
+ async load(id) {
4775
+ if (!filter(id))
4776
+ return null;
4777
+ this.addWatchFile(id);
4778
+ await watchProgramHelper.wait();
4779
+ const fileName = normalizePath(id);
4780
+ if (!parsedOptions.fileNames.includes(fileName)) {
4781
+ parsedOptions.fileNames.push(fileName);
4782
+ }
4783
+ const output = findTypescriptOutput(ts, parsedOptions, id, emittedFiles, tsCache);
4784
+ return output.code != null ? output : null;
4785
+ },
4786
+ async generateBundle(outputOptions) {
4787
+ const declarationAndTypeScriptMapFiles = [...emittedFiles.keys()].filter((fileName) => isDeclarationOutputFile(fileName) || isTypeScriptMapOutputFile(fileName));
4788
+ declarationAndTypeScriptMapFiles.forEach((id) => {
4789
+ const code = getEmittedFile(id, emittedFiles, tsCache);
4790
+ if (!code || !parsedOptions.options.declaration) {
4791
+ return;
4792
+ }
4793
+ let baseDir;
4794
+ if (outputOptions.dir) {
4795
+ baseDir = outputOptions.dir;
4796
+ }
4797
+ else if (outputOptions.file) {
4798
+ baseDir = path$2.dirname(outputOptions.file);
4799
+ }
4800
+ if (!baseDir)
4801
+ return;
4802
+ this.emitFile({
4803
+ type: 'asset',
4804
+ fileName: normalizePath(path$2.relative(baseDir, id)),
4805
+ source: code
4806
+ });
4807
+ });
4808
+ const tsBuildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(parsedOptions.options);
4809
+ if (tsBuildInfoPath) {
4810
+ const tsBuildInfoSource = emittedFiles.get(tsBuildInfoPath);
4811
+ if (tsBuildInfoSource) {
4812
+ await emitFile(outputOptions, outputToFilesystem, this, tsBuildInfoPath, tsBuildInfoSource);
4813
+ }
4814
+ }
4815
+ }
4816
+ };
4817
+ }
4818
+
4819
+ export { typescript as default };