@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,2324 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+ function getDefaultExportFromCjs (x) {
6
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
+ }
8
+
9
+ var utils = {};
10
+
11
+ var constants;
12
+ var hasRequiredConstants;
13
+
14
+ function requireConstants () {
15
+ if (hasRequiredConstants) return constants;
16
+ hasRequiredConstants = 1;
17
+
18
+ const WIN_SLASH = '\\\\/';
19
+ const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
20
+
21
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
22
+
23
+ const DOT_LITERAL = '\\.';
24
+ const PLUS_LITERAL = '\\+';
25
+ const QMARK_LITERAL = '\\?';
26
+ const SLASH_LITERAL = '\\/';
27
+ const ONE_CHAR = '(?=.)';
28
+ const QMARK = '[^/]';
29
+ const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
30
+ const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
31
+ const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
32
+ const NO_DOT = `(?!${DOT_LITERAL})`;
33
+ const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
34
+ const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
35
+ const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
36
+ const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
37
+ const STAR = `${QMARK}*?`;
38
+ const SEP = '/';
39
+
40
+ const POSIX_CHARS = {
41
+ DOT_LITERAL,
42
+ PLUS_LITERAL,
43
+ QMARK_LITERAL,
44
+ SLASH_LITERAL,
45
+ ONE_CHAR,
46
+ QMARK,
47
+ END_ANCHOR,
48
+ DOTS_SLASH,
49
+ NO_DOT,
50
+ NO_DOTS,
51
+ NO_DOT_SLASH,
52
+ NO_DOTS_SLASH,
53
+ QMARK_NO_DOT,
54
+ STAR,
55
+ START_ANCHOR,
56
+ SEP
57
+ };
58
+
59
+ const WINDOWS_CHARS = {
60
+ ...POSIX_CHARS,
61
+
62
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
63
+ QMARK: WIN_NO_SLASH,
64
+ STAR: `${WIN_NO_SLASH}*?`,
65
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
66
+ NO_DOT: `(?!${DOT_LITERAL})`,
67
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
68
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
69
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
70
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
71
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
72
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
73
+ SEP: '\\'
74
+ };
75
+
76
+ const POSIX_REGEX_SOURCE = {
77
+ __proto__: null,
78
+ alnum: 'a-zA-Z0-9',
79
+ alpha: 'a-zA-Z',
80
+ ascii: '\\x00-\\x7F',
81
+ blank: ' \\t',
82
+ cntrl: '\\x00-\\x1F\\x7F',
83
+ digit: '0-9',
84
+ graph: '\\x21-\\x7E',
85
+ lower: 'a-z',
86
+ print: '\\x20-\\x7E ',
87
+ punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
88
+ space: ' \\t\\r\\n\\v\\f',
89
+ upper: 'A-Z',
90
+ word: 'A-Za-z0-9_',
91
+ xdigit: 'A-Fa-f0-9'
92
+ };
93
+
94
+ constants = {
95
+ DEFAULT_MAX_EXTGLOB_RECURSION,
96
+ MAX_LENGTH: 1024 * 64,
97
+ POSIX_REGEX_SOURCE,
98
+
99
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
100
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
101
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
102
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
103
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
104
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
105
+
106
+ REPLACEMENTS: {
107
+ __proto__: null,
108
+ '***': '*',
109
+ '**/**': '**',
110
+ '**/**/**': '**'
111
+ },
112
+
113
+ CHAR_0: 48,
114
+ CHAR_9: 57,
115
+
116
+ CHAR_UPPERCASE_A: 65,
117
+ CHAR_LOWERCASE_A: 97,
118
+ CHAR_UPPERCASE_Z: 90,
119
+ CHAR_LOWERCASE_Z: 122,
120
+
121
+ CHAR_LEFT_PARENTHESES: 40,
122
+ CHAR_RIGHT_PARENTHESES: 41,
123
+
124
+ CHAR_ASTERISK: 42,
125
+
126
+ CHAR_AMPERSAND: 38,
127
+ CHAR_AT: 64,
128
+ CHAR_BACKWARD_SLASH: 92,
129
+ CHAR_CARRIAGE_RETURN: 13,
130
+ CHAR_CIRCUMFLEX_ACCENT: 94,
131
+ CHAR_COLON: 58,
132
+ CHAR_COMMA: 44,
133
+ CHAR_DOT: 46,
134
+ CHAR_DOUBLE_QUOTE: 34,
135
+ CHAR_EQUAL: 61,
136
+ CHAR_EXCLAMATION_MARK: 33,
137
+ CHAR_FORM_FEED: 12,
138
+ CHAR_FORWARD_SLASH: 47,
139
+ CHAR_GRAVE_ACCENT: 96,
140
+ CHAR_HASH: 35,
141
+ CHAR_HYPHEN_MINUS: 45,
142
+ CHAR_LEFT_ANGLE_BRACKET: 60,
143
+ CHAR_LEFT_CURLY_BRACE: 123,
144
+ CHAR_LEFT_SQUARE_BRACKET: 91,
145
+ CHAR_LINE_FEED: 10,
146
+ CHAR_NO_BREAK_SPACE: 160,
147
+ CHAR_PERCENT: 37,
148
+ CHAR_PLUS: 43,
149
+ CHAR_QUESTION_MARK: 63,
150
+ CHAR_RIGHT_ANGLE_BRACKET: 62,
151
+ CHAR_RIGHT_CURLY_BRACE: 125,
152
+ CHAR_RIGHT_SQUARE_BRACKET: 93,
153
+ CHAR_SEMICOLON: 59,
154
+ CHAR_SINGLE_QUOTE: 39,
155
+ CHAR_SPACE: 32,
156
+ CHAR_TAB: 9,
157
+ CHAR_UNDERSCORE: 95,
158
+ CHAR_VERTICAL_LINE: 124,
159
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
160
+
161
+ extglobChars(chars) {
162
+ return {
163
+ '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
164
+ '?': { type: 'qmark', open: '(?:', close: ')?' },
165
+ '+': { type: 'plus', open: '(?:', close: ')+' },
166
+ '*': { type: 'star', open: '(?:', close: ')*' },
167
+ '@': { type: 'at', open: '(?:', close: ')' }
168
+ };
169
+ },
170
+
171
+ globChars(win32) {
172
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
173
+ }
174
+ };
175
+ return constants;
176
+ }
177
+
178
+ var hasRequiredUtils;
179
+
180
+ function requireUtils () {
181
+ if (hasRequiredUtils) return utils;
182
+ hasRequiredUtils = 1;
183
+ (function (exports$1) {
184
+
185
+ const {
186
+ REGEX_BACKSLASH,
187
+ REGEX_REMOVE_BACKSLASH,
188
+ REGEX_SPECIAL_CHARS,
189
+ REGEX_SPECIAL_CHARS_GLOBAL
190
+ } = /*@__PURE__*/ requireConstants();
191
+
192
+ exports$1.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
193
+ exports$1.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
194
+ exports$1.isRegexChar = str => str.length === 1 && exports$1.hasRegexChars(str);
195
+ exports$1.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
196
+ exports$1.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
197
+
198
+ exports$1.isWindows = () => {
199
+ if (typeof navigator !== 'undefined' && navigator.platform) {
200
+ const platform = navigator.platform.toLowerCase();
201
+ return platform === 'win32' || platform === 'windows';
202
+ }
203
+
204
+ if (typeof process !== 'undefined' && process.platform) {
205
+ return process.platform === 'win32';
206
+ }
207
+
208
+ return false;
209
+ };
210
+
211
+ exports$1.removeBackslashes = str => {
212
+ return str.replace(REGEX_REMOVE_BACKSLASH, match => {
213
+ return match === '\\' ? '' : match;
214
+ });
215
+ };
216
+
217
+ exports$1.escapeLast = (input, char, lastIdx) => {
218
+ const idx = input.lastIndexOf(char, lastIdx);
219
+ if (idx === -1) return input;
220
+ if (input[idx - 1] === '\\') return exports$1.escapeLast(input, char, idx - 1);
221
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
222
+ };
223
+
224
+ exports$1.removePrefix = (input, state = {}) => {
225
+ let output = input;
226
+ if (output.startsWith('./')) {
227
+ output = output.slice(2);
228
+ state.prefix = './';
229
+ }
230
+ return output;
231
+ };
232
+
233
+ exports$1.wrapOutput = (input, state = {}, options = {}) => {
234
+ const prepend = options.contains ? '' : '^';
235
+ const append = options.contains ? '' : '$';
236
+
237
+ let output = `${prepend}(?:${input})${append}`;
238
+ if (state.negated === true) {
239
+ output = `(?:^(?!${output}).*$)`;
240
+ }
241
+ return output;
242
+ };
243
+
244
+ exports$1.basename = (path, { windows } = {}) => {
245
+ const segs = path.split(windows ? /[\\/]/ : '/');
246
+ const last = segs[segs.length - 1];
247
+
248
+ if (last === '') {
249
+ return segs[segs.length - 2];
250
+ }
251
+
252
+ return last;
253
+ };
254
+ } (utils));
255
+ return utils;
256
+ }
257
+
258
+ var scan_1;
259
+ var hasRequiredScan;
260
+
261
+ function requireScan () {
262
+ if (hasRequiredScan) return scan_1;
263
+ hasRequiredScan = 1;
264
+
265
+ const utils = /*@__PURE__*/ requireUtils();
266
+ const {
267
+ CHAR_ASTERISK,
268
+ CHAR_AT,
269
+ CHAR_BACKWARD_SLASH,
270
+ CHAR_COMMA,
271
+ CHAR_DOT,
272
+ CHAR_EXCLAMATION_MARK,
273
+ CHAR_FORWARD_SLASH,
274
+ CHAR_LEFT_CURLY_BRACE,
275
+ CHAR_LEFT_PARENTHESES,
276
+ CHAR_LEFT_SQUARE_BRACKET,
277
+ CHAR_PLUS,
278
+ CHAR_QUESTION_MARK,
279
+ CHAR_RIGHT_CURLY_BRACE,
280
+ CHAR_RIGHT_PARENTHESES,
281
+ CHAR_RIGHT_SQUARE_BRACKET
282
+ } = /*@__PURE__*/ requireConstants();
283
+
284
+ const isPathSeparator = code => {
285
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
286
+ };
287
+
288
+ const depth = token => {
289
+ if (token.isPrefix !== true) {
290
+ token.depth = token.isGlobstar ? Infinity : 1;
291
+ }
292
+ };
293
+
294
+ const scan = (input, options) => {
295
+ const opts = options || {};
296
+
297
+ const length = input.length - 1;
298
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
299
+ const slashes = [];
300
+ const tokens = [];
301
+ const parts = [];
302
+
303
+ let str = input;
304
+ let index = -1;
305
+ let start = 0;
306
+ let lastIndex = 0;
307
+ let isBrace = false;
308
+ let isBracket = false;
309
+ let isGlob = false;
310
+ let isExtglob = false;
311
+ let isGlobstar = false;
312
+ let braceEscaped = false;
313
+ let backslashes = false;
314
+ let negated = false;
315
+ let negatedExtglob = false;
316
+ let finished = false;
317
+ let braces = 0;
318
+ let prev;
319
+ let code;
320
+ let token = { value: '', depth: 0, isGlob: false };
321
+
322
+ const eos = () => index >= length;
323
+ const peek = () => str.charCodeAt(index + 1);
324
+ const advance = () => {
325
+ prev = code;
326
+ return str.charCodeAt(++index);
327
+ };
328
+
329
+ while (index < length) {
330
+ code = advance();
331
+ let next;
332
+
333
+ if (code === CHAR_BACKWARD_SLASH) {
334
+ backslashes = token.backslashes = true;
335
+ code = advance();
336
+
337
+ if (code === CHAR_LEFT_CURLY_BRACE) {
338
+ braceEscaped = true;
339
+ }
340
+ continue;
341
+ }
342
+
343
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
344
+ braces++;
345
+
346
+ while (eos() !== true && (code = advance())) {
347
+ if (code === CHAR_BACKWARD_SLASH) {
348
+ backslashes = token.backslashes = true;
349
+ advance();
350
+ continue;
351
+ }
352
+
353
+ if (code === CHAR_LEFT_CURLY_BRACE) {
354
+ braces++;
355
+ continue;
356
+ }
357
+
358
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
359
+ isBrace = token.isBrace = true;
360
+ isGlob = token.isGlob = true;
361
+ finished = true;
362
+
363
+ if (scanToEnd === true) {
364
+ continue;
365
+ }
366
+
367
+ break;
368
+ }
369
+
370
+ if (braceEscaped !== true && code === CHAR_COMMA) {
371
+ isBrace = token.isBrace = true;
372
+ isGlob = token.isGlob = true;
373
+ finished = true;
374
+
375
+ if (scanToEnd === true) {
376
+ continue;
377
+ }
378
+
379
+ break;
380
+ }
381
+
382
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
383
+ braces--;
384
+
385
+ if (braces === 0) {
386
+ braceEscaped = false;
387
+ isBrace = token.isBrace = true;
388
+ finished = true;
389
+ break;
390
+ }
391
+ }
392
+ }
393
+
394
+ if (scanToEnd === true) {
395
+ continue;
396
+ }
397
+
398
+ break;
399
+ }
400
+
401
+ if (code === CHAR_FORWARD_SLASH) {
402
+ slashes.push(index);
403
+ tokens.push(token);
404
+ token = { value: '', depth: 0, isGlob: false };
405
+
406
+ if (finished === true) continue;
407
+ if (prev === CHAR_DOT && index === (start + 1)) {
408
+ start += 2;
409
+ continue;
410
+ }
411
+
412
+ lastIndex = index + 1;
413
+ continue;
414
+ }
415
+
416
+ if (opts.noext !== true) {
417
+ const isExtglobChar = code === CHAR_PLUS
418
+ || code === CHAR_AT
419
+ || code === CHAR_ASTERISK
420
+ || code === CHAR_QUESTION_MARK
421
+ || code === CHAR_EXCLAMATION_MARK;
422
+
423
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
424
+ isGlob = token.isGlob = true;
425
+ isExtglob = token.isExtglob = true;
426
+ finished = true;
427
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
428
+ negatedExtglob = true;
429
+ }
430
+
431
+ if (scanToEnd === true) {
432
+ while (eos() !== true && (code = advance())) {
433
+ if (code === CHAR_BACKWARD_SLASH) {
434
+ backslashes = token.backslashes = true;
435
+ code = advance();
436
+ continue;
437
+ }
438
+
439
+ if (code === CHAR_RIGHT_PARENTHESES) {
440
+ isGlob = token.isGlob = true;
441
+ finished = true;
442
+ break;
443
+ }
444
+ }
445
+ continue;
446
+ }
447
+ break;
448
+ }
449
+ }
450
+
451
+ if (code === CHAR_ASTERISK) {
452
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
453
+ isGlob = token.isGlob = true;
454
+ finished = true;
455
+
456
+ if (scanToEnd === true) {
457
+ continue;
458
+ }
459
+ break;
460
+ }
461
+
462
+ if (code === CHAR_QUESTION_MARK) {
463
+ isGlob = token.isGlob = true;
464
+ finished = true;
465
+
466
+ if (scanToEnd === true) {
467
+ continue;
468
+ }
469
+ break;
470
+ }
471
+
472
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
473
+ while (eos() !== true && (next = advance())) {
474
+ if (next === CHAR_BACKWARD_SLASH) {
475
+ backslashes = token.backslashes = true;
476
+ advance();
477
+ continue;
478
+ }
479
+
480
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
481
+ isBracket = token.isBracket = true;
482
+ isGlob = token.isGlob = true;
483
+ finished = true;
484
+ break;
485
+ }
486
+ }
487
+
488
+ if (scanToEnd === true) {
489
+ continue;
490
+ }
491
+
492
+ break;
493
+ }
494
+
495
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
496
+ negated = token.negated = true;
497
+ start++;
498
+ continue;
499
+ }
500
+
501
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
502
+ isGlob = token.isGlob = true;
503
+
504
+ if (scanToEnd === true) {
505
+ while (eos() !== true && (code = advance())) {
506
+ if (code === CHAR_LEFT_PARENTHESES) {
507
+ backslashes = token.backslashes = true;
508
+ code = advance();
509
+ continue;
510
+ }
511
+
512
+ if (code === CHAR_RIGHT_PARENTHESES) {
513
+ finished = true;
514
+ break;
515
+ }
516
+ }
517
+ continue;
518
+ }
519
+ break;
520
+ }
521
+
522
+ if (isGlob === true) {
523
+ finished = true;
524
+
525
+ if (scanToEnd === true) {
526
+ continue;
527
+ }
528
+
529
+ break;
530
+ }
531
+ }
532
+
533
+ if (opts.noext === true) {
534
+ isExtglob = false;
535
+ isGlob = false;
536
+ }
537
+
538
+ let base = str;
539
+ let prefix = '';
540
+ let glob = '';
541
+
542
+ if (start > 0) {
543
+ prefix = str.slice(0, start);
544
+ str = str.slice(start);
545
+ lastIndex -= start;
546
+ }
547
+
548
+ if (base && isGlob === true && lastIndex > 0) {
549
+ base = str.slice(0, lastIndex);
550
+ glob = str.slice(lastIndex);
551
+ } else if (isGlob === true) {
552
+ base = '';
553
+ glob = str;
554
+ } else {
555
+ base = str;
556
+ }
557
+
558
+ if (base && base !== '' && base !== '/' && base !== str) {
559
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
560
+ base = base.slice(0, -1);
561
+ }
562
+ }
563
+
564
+ if (opts.unescape === true) {
565
+ if (glob) glob = utils.removeBackslashes(glob);
566
+
567
+ if (base && backslashes === true) {
568
+ base = utils.removeBackslashes(base);
569
+ }
570
+ }
571
+
572
+ const state = {
573
+ prefix,
574
+ input,
575
+ start,
576
+ base,
577
+ glob,
578
+ isBrace,
579
+ isBracket,
580
+ isGlob,
581
+ isExtglob,
582
+ isGlobstar,
583
+ negated,
584
+ negatedExtglob
585
+ };
586
+
587
+ if (opts.tokens === true) {
588
+ state.maxDepth = 0;
589
+ if (!isPathSeparator(code)) {
590
+ tokens.push(token);
591
+ }
592
+ state.tokens = tokens;
593
+ }
594
+
595
+ if (opts.parts === true || opts.tokens === true) {
596
+ let prevIndex;
597
+
598
+ for (let idx = 0; idx < slashes.length; idx++) {
599
+ const n = prevIndex ? prevIndex + 1 : start;
600
+ const i = slashes[idx];
601
+ const value = input.slice(n, i);
602
+ if (opts.tokens) {
603
+ if (idx === 0 && start !== 0) {
604
+ tokens[idx].isPrefix = true;
605
+ tokens[idx].value = prefix;
606
+ } else {
607
+ tokens[idx].value = value;
608
+ }
609
+ depth(tokens[idx]);
610
+ state.maxDepth += tokens[idx].depth;
611
+ }
612
+ if (idx !== 0 || value !== '') {
613
+ parts.push(value);
614
+ }
615
+ prevIndex = i;
616
+ }
617
+
618
+ if (prevIndex && prevIndex + 1 < input.length) {
619
+ const value = input.slice(prevIndex + 1);
620
+ parts.push(value);
621
+
622
+ if (opts.tokens) {
623
+ tokens[tokens.length - 1].value = value;
624
+ depth(tokens[tokens.length - 1]);
625
+ state.maxDepth += tokens[tokens.length - 1].depth;
626
+ }
627
+ }
628
+
629
+ state.slashes = slashes;
630
+ state.parts = parts;
631
+ }
632
+
633
+ return state;
634
+ };
635
+
636
+ scan_1 = scan;
637
+ return scan_1;
638
+ }
639
+
640
+ var parse_1;
641
+ var hasRequiredParse;
642
+
643
+ function requireParse () {
644
+ if (hasRequiredParse) return parse_1;
645
+ hasRequiredParse = 1;
646
+
647
+ const constants = /*@__PURE__*/ requireConstants();
648
+ const utils = /*@__PURE__*/ requireUtils();
649
+
650
+ const {
651
+ MAX_LENGTH,
652
+ POSIX_REGEX_SOURCE,
653
+ REGEX_NON_SPECIAL_CHARS,
654
+ REGEX_SPECIAL_CHARS_BACKREF,
655
+ REPLACEMENTS
656
+ } = constants;
657
+
658
+ const expandRange = (args, options) => {
659
+ if (typeof options.expandRange === 'function') {
660
+ return options.expandRange(...args, options);
661
+ }
662
+
663
+ args.sort();
664
+ const value = `[${args.join('-')}]`;
665
+
666
+ try {
667
+ new RegExp(value);
668
+ } catch (ex) {
669
+ return args.map(v => utils.escapeRegex(v)).join('..');
670
+ }
671
+
672
+ return value;
673
+ };
674
+
675
+ const syntaxError = (type, char) => {
676
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
677
+ };
678
+
679
+ const splitTopLevel = input => {
680
+ const parts = [];
681
+ let bracket = 0;
682
+ let paren = 0;
683
+ let quote = 0;
684
+ let value = '';
685
+ let escaped = false;
686
+
687
+ for (const ch of input) {
688
+ if (escaped === true) {
689
+ value += ch;
690
+ escaped = false;
691
+ continue;
692
+ }
693
+
694
+ if (ch === '\\') {
695
+ value += ch;
696
+ escaped = true;
697
+ continue;
698
+ }
699
+
700
+ if (ch === '"') {
701
+ quote = quote === 1 ? 0 : 1;
702
+ value += ch;
703
+ continue;
704
+ }
705
+
706
+ if (quote === 0) {
707
+ if (ch === '[') {
708
+ bracket++;
709
+ } else if (ch === ']' && bracket > 0) {
710
+ bracket--;
711
+ } else if (bracket === 0) {
712
+ if (ch === '(') {
713
+ paren++;
714
+ } else if (ch === ')' && paren > 0) {
715
+ paren--;
716
+ } else if (ch === '|' && paren === 0) {
717
+ parts.push(value);
718
+ value = '';
719
+ continue;
720
+ }
721
+ }
722
+ }
723
+
724
+ value += ch;
725
+ }
726
+
727
+ parts.push(value);
728
+ return parts;
729
+ };
730
+
731
+ const isPlainBranch = branch => {
732
+ let escaped = false;
733
+
734
+ for (const ch of branch) {
735
+ if (escaped === true) {
736
+ escaped = false;
737
+ continue;
738
+ }
739
+
740
+ if (ch === '\\') {
741
+ escaped = true;
742
+ continue;
743
+ }
744
+
745
+ if (/[?*+@!()[\]{}]/.test(ch)) {
746
+ return false;
747
+ }
748
+ }
749
+
750
+ return true;
751
+ };
752
+
753
+ const normalizeSimpleBranch = branch => {
754
+ let value = branch.trim();
755
+ let changed = true;
756
+
757
+ while (changed === true) {
758
+ changed = false;
759
+
760
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
761
+ value = value.slice(2, -1);
762
+ changed = true;
763
+ }
764
+ }
765
+
766
+ if (!isPlainBranch(value)) {
767
+ return;
768
+ }
769
+
770
+ return value.replace(/\\(.)/g, '$1');
771
+ };
772
+
773
+ const hasRepeatedCharPrefixOverlap = branches => {
774
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
775
+
776
+ for (let i = 0; i < values.length; i++) {
777
+ for (let j = i + 1; j < values.length; j++) {
778
+ const a = values[i];
779
+ const b = values[j];
780
+ const char = a[0];
781
+
782
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
783
+ continue;
784
+ }
785
+
786
+ if (a === b || a.startsWith(b) || b.startsWith(a)) {
787
+ return true;
788
+ }
789
+ }
790
+ }
791
+
792
+ return false;
793
+ };
794
+
795
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
796
+ if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') {
797
+ return;
798
+ }
799
+
800
+ let bracket = 0;
801
+ let paren = 0;
802
+ let quote = 0;
803
+ let escaped = false;
804
+
805
+ for (let i = 1; i < pattern.length; i++) {
806
+ const ch = pattern[i];
807
+
808
+ if (escaped === true) {
809
+ escaped = false;
810
+ continue;
811
+ }
812
+
813
+ if (ch === '\\') {
814
+ escaped = true;
815
+ continue;
816
+ }
817
+
818
+ if (ch === '"') {
819
+ quote = quote === 1 ? 0 : 1;
820
+ continue;
821
+ }
822
+
823
+ if (quote === 1) {
824
+ continue;
825
+ }
826
+
827
+ if (ch === '[') {
828
+ bracket++;
829
+ continue;
830
+ }
831
+
832
+ if (ch === ']' && bracket > 0) {
833
+ bracket--;
834
+ continue;
835
+ }
836
+
837
+ if (bracket > 0) {
838
+ continue;
839
+ }
840
+
841
+ if (ch === '(') {
842
+ paren++;
843
+ continue;
844
+ }
845
+
846
+ if (ch === ')') {
847
+ paren--;
848
+
849
+ if (paren === 0) {
850
+ if (requireEnd === true && i !== pattern.length - 1) {
851
+ return;
852
+ }
853
+
854
+ return {
855
+ type: pattern[0],
856
+ body: pattern.slice(2, i),
857
+ end: i
858
+ };
859
+ }
860
+ }
861
+ }
862
+ };
863
+
864
+ const getStarExtglobSequenceOutput = pattern => {
865
+ let index = 0;
866
+ const chars = [];
867
+
868
+ while (index < pattern.length) {
869
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
870
+
871
+ if (!match || match.type !== '*') {
872
+ return;
873
+ }
874
+
875
+ const branches = splitTopLevel(match.body).map(branch => branch.trim());
876
+ if (branches.length !== 1) {
877
+ return;
878
+ }
879
+
880
+ const branch = normalizeSimpleBranch(branches[0]);
881
+ if (!branch || branch.length !== 1) {
882
+ return;
883
+ }
884
+
885
+ chars.push(branch);
886
+ index += match.end + 1;
887
+ }
888
+
889
+ if (chars.length < 1) {
890
+ return;
891
+ }
892
+
893
+ const source = chars.length === 1
894
+ ? utils.escapeRegex(chars[0])
895
+ : `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`;
896
+
897
+ return `${source}*`;
898
+ };
899
+
900
+ const repeatedExtglobRecursion = pattern => {
901
+ let depth = 0;
902
+ let value = pattern.trim();
903
+ let match = parseRepeatedExtglob(value);
904
+
905
+ while (match) {
906
+ depth++;
907
+ value = match.body.trim();
908
+ match = parseRepeatedExtglob(value);
909
+ }
910
+
911
+ return depth;
912
+ };
913
+
914
+ const analyzeRepeatedExtglob = (body, options) => {
915
+ if (options.maxExtglobRecursion === false) {
916
+ return { risky: false };
917
+ }
918
+
919
+ const max =
920
+ typeof options.maxExtglobRecursion === 'number'
921
+ ? options.maxExtglobRecursion
922
+ : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
923
+
924
+ const branches = splitTopLevel(body).map(branch => branch.trim());
925
+
926
+ if (branches.length > 1) {
927
+ if (
928
+ branches.some(branch => branch === '') ||
929
+ branches.some(branch => /^[*?]+$/.test(branch)) ||
930
+ hasRepeatedCharPrefixOverlap(branches)
931
+ ) {
932
+ return { risky: true };
933
+ }
934
+ }
935
+
936
+ for (const branch of branches) {
937
+ const safeOutput = getStarExtglobSequenceOutput(branch);
938
+ if (safeOutput) {
939
+ return { risky: true, safeOutput };
940
+ }
941
+
942
+ if (repeatedExtglobRecursion(branch) > max) {
943
+ return { risky: true };
944
+ }
945
+ }
946
+
947
+ return { risky: false };
948
+ };
949
+
950
+ const parse = (input, options) => {
951
+ if (typeof input !== 'string') {
952
+ throw new TypeError('Expected a string');
953
+ }
954
+
955
+ input = REPLACEMENTS[input] || input;
956
+
957
+ const opts = { ...options };
958
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
959
+
960
+ let len = input.length;
961
+ if (len > max) {
962
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
963
+ }
964
+
965
+ const bos = { type: 'bos', value: '', output: opts.prepend || '' };
966
+ const tokens = [bos];
967
+
968
+ const capture = opts.capture ? '' : '?:';
969
+
970
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
971
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
972
+
973
+ const {
974
+ DOT_LITERAL,
975
+ PLUS_LITERAL,
976
+ SLASH_LITERAL,
977
+ ONE_CHAR,
978
+ DOTS_SLASH,
979
+ NO_DOT,
980
+ NO_DOT_SLASH,
981
+ NO_DOTS_SLASH,
982
+ QMARK,
983
+ QMARK_NO_DOT,
984
+ STAR,
985
+ START_ANCHOR
986
+ } = PLATFORM_CHARS;
987
+
988
+ const globstar = opts => {
989
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
990
+ };
991
+
992
+ const nodot = opts.dot ? '' : NO_DOT;
993
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
994
+ let star = opts.bash === true ? globstar(opts) : STAR;
995
+
996
+ if (opts.capture) {
997
+ star = `(${star})`;
998
+ }
999
+
1000
+ if (typeof opts.noext === 'boolean') {
1001
+ opts.noextglob = opts.noext;
1002
+ }
1003
+
1004
+ const state = {
1005
+ input,
1006
+ index: -1,
1007
+ start: 0,
1008
+ dot: opts.dot === true,
1009
+ consumed: '',
1010
+ output: '',
1011
+ prefix: '',
1012
+ backtrack: false,
1013
+ negated: false,
1014
+ brackets: 0,
1015
+ braces: 0,
1016
+ parens: 0,
1017
+ quotes: 0,
1018
+ globstar: false,
1019
+ tokens
1020
+ };
1021
+
1022
+ input = utils.removePrefix(input, state);
1023
+ len = input.length;
1024
+
1025
+ const extglobs = [];
1026
+ const braces = [];
1027
+ const stack = [];
1028
+ let prev = bos;
1029
+ let value;
1030
+
1031
+ const eos = () => state.index === len - 1;
1032
+ const peek = state.peek = (n = 1) => input[state.index + n];
1033
+ const advance = state.advance = () => input[++state.index] || '';
1034
+ const remaining = () => input.slice(state.index + 1);
1035
+ const consume = (value = '', num = 0) => {
1036
+ state.consumed += value;
1037
+ state.index += num;
1038
+ };
1039
+
1040
+ const append = token => {
1041
+ state.output += token.output != null ? token.output : token.value;
1042
+ consume(token.value);
1043
+ };
1044
+
1045
+ const negate = () => {
1046
+ let count = 1;
1047
+
1048
+ while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
1049
+ advance();
1050
+ state.start++;
1051
+ count++;
1052
+ }
1053
+
1054
+ if (count % 2 === 0) {
1055
+ return false;
1056
+ }
1057
+
1058
+ state.negated = true;
1059
+ state.start++;
1060
+ return true;
1061
+ };
1062
+
1063
+ const increment = type => {
1064
+ state[type]++;
1065
+ stack.push(type);
1066
+ };
1067
+
1068
+ const decrement = type => {
1069
+ state[type]--;
1070
+ stack.pop();
1071
+ };
1072
+
1073
+ const push = tok => {
1074
+ if (prev.type === 'globstar') {
1075
+ const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
1076
+ const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
1077
+
1078
+ if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
1079
+ state.output = state.output.slice(0, -prev.output.length);
1080
+ prev.type = 'star';
1081
+ prev.value = '*';
1082
+ prev.output = star;
1083
+ state.output += prev.output;
1084
+ }
1085
+ }
1086
+
1087
+ if (extglobs.length && tok.type !== 'paren') {
1088
+ extglobs[extglobs.length - 1].inner += tok.value;
1089
+ }
1090
+
1091
+ if (tok.value || tok.output) append(tok);
1092
+ if (prev && prev.type === 'text' && tok.type === 'text') {
1093
+ prev.output = (prev.output || prev.value) + tok.value;
1094
+ prev.value += tok.value;
1095
+ return;
1096
+ }
1097
+
1098
+ tok.prev = prev;
1099
+ tokens.push(tok);
1100
+ prev = tok;
1101
+ };
1102
+
1103
+ const extglobOpen = (type, value) => {
1104
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
1105
+
1106
+ token.prev = prev;
1107
+ token.parens = state.parens;
1108
+ token.output = state.output;
1109
+ token.startIndex = state.index;
1110
+ token.tokensIndex = tokens.length;
1111
+ const output = (opts.capture ? '(' : '') + token.open;
1112
+
1113
+ increment('parens');
1114
+ push({ type, value, output: state.output ? '' : ONE_CHAR });
1115
+ push({ type: 'paren', extglob: true, value: advance(), output });
1116
+ extglobs.push(token);
1117
+ };
1118
+
1119
+ const extglobClose = token => {
1120
+ const literal = input.slice(token.startIndex, state.index + 1);
1121
+ const body = input.slice(token.startIndex + 2, state.index);
1122
+ const analysis = analyzeRepeatedExtglob(body, opts);
1123
+
1124
+ if ((token.type === 'plus' || token.type === 'star') && analysis.risky) {
1125
+ const safeOutput = analysis.safeOutput
1126
+ ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput)
1127
+ : undefined;
1128
+ const open = tokens[token.tokensIndex];
1129
+
1130
+ open.type = 'text';
1131
+ open.value = literal;
1132
+ open.output = safeOutput || utils.escapeRegex(literal);
1133
+
1134
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
1135
+ tokens[i].value = '';
1136
+ tokens[i].output = '';
1137
+ delete tokens[i].suffix;
1138
+ }
1139
+
1140
+ state.output = token.output + open.output;
1141
+ state.backtrack = true;
1142
+
1143
+ push({ type: 'paren', extglob: true, value, output: '' });
1144
+ decrement('parens');
1145
+ return;
1146
+ }
1147
+
1148
+ let output = token.close + (opts.capture ? ')' : '');
1149
+ let rest;
1150
+
1151
+ if (token.type === 'negate') {
1152
+ let extglobStar = star;
1153
+
1154
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
1155
+ extglobStar = globstar(opts);
1156
+ }
1157
+
1158
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
1159
+ output = token.close = `)$))${extglobStar}`;
1160
+ }
1161
+
1162
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
1163
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
1164
+
1165
+ output = token.close = `)${expression})${extglobStar})`;
1166
+ }
1167
+
1168
+ if (token.prev.type === 'bos') {
1169
+ state.negatedExtglob = true;
1170
+ }
1171
+ }
1172
+
1173
+ push({ type: 'paren', extglob: true, value, output });
1174
+ decrement('parens');
1175
+ };
1176
+
1177
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
1178
+ let backslashes = false;
1179
+
1180
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
1181
+ if (first === '\\') {
1182
+ backslashes = true;
1183
+ return m;
1184
+ }
1185
+
1186
+ if (first === '?') {
1187
+ if (esc) {
1188
+ return esc + first + (rest ? QMARK.repeat(rest.length) : '');
1189
+ }
1190
+ if (index === 0) {
1191
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
1192
+ }
1193
+ return QMARK.repeat(chars.length);
1194
+ }
1195
+
1196
+ if (first === '.') {
1197
+ return DOT_LITERAL.repeat(chars.length);
1198
+ }
1199
+
1200
+ if (first === '*') {
1201
+ if (esc) {
1202
+ return esc + first + (rest ? star : '');
1203
+ }
1204
+ return star;
1205
+ }
1206
+ return esc ? m : `\\${m}`;
1207
+ });
1208
+
1209
+ if (backslashes === true) {
1210
+ if (opts.unescape === true) {
1211
+ output = output.replace(/\\/g, '');
1212
+ } else {
1213
+ output = output.replace(/\\+/g, m => {
1214
+ return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
1215
+ });
1216
+ }
1217
+ }
1218
+
1219
+ if (output === input && opts.contains === true) {
1220
+ state.output = input;
1221
+ return state;
1222
+ }
1223
+
1224
+ state.output = utils.wrapOutput(output, state, options);
1225
+ return state;
1226
+ }
1227
+
1228
+ while (!eos()) {
1229
+ value = advance();
1230
+
1231
+ if (value === '\u0000') {
1232
+ continue;
1233
+ }
1234
+
1235
+ if (value === '\\') {
1236
+ const next = peek();
1237
+
1238
+ if (next === '/' && opts.bash !== true) {
1239
+ continue;
1240
+ }
1241
+
1242
+ if (next === '.' || next === ';') {
1243
+ continue;
1244
+ }
1245
+
1246
+ if (!next) {
1247
+ value += '\\';
1248
+ push({ type: 'text', value });
1249
+ continue;
1250
+ }
1251
+
1252
+ const match = /^\\+/.exec(remaining());
1253
+ let slashes = 0;
1254
+
1255
+ if (match && match[0].length > 2) {
1256
+ slashes = match[0].length;
1257
+ state.index += slashes;
1258
+ if (slashes % 2 !== 0) {
1259
+ value += '\\';
1260
+ }
1261
+ }
1262
+
1263
+ if (opts.unescape === true) {
1264
+ value = advance();
1265
+ } else {
1266
+ value += advance();
1267
+ }
1268
+
1269
+ if (state.brackets === 0) {
1270
+ push({ type: 'text', value });
1271
+ continue;
1272
+ }
1273
+ }
1274
+
1275
+ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
1276
+ if (opts.posix !== false && value === ':') {
1277
+ const inner = prev.value.slice(1);
1278
+ if (inner.includes('[')) {
1279
+ prev.posix = true;
1280
+
1281
+ if (inner.includes(':')) {
1282
+ const idx = prev.value.lastIndexOf('[');
1283
+ const pre = prev.value.slice(0, idx);
1284
+ const rest = prev.value.slice(idx + 2);
1285
+ const posix = POSIX_REGEX_SOURCE[rest];
1286
+ if (posix) {
1287
+ prev.value = pre + posix;
1288
+ state.backtrack = true;
1289
+ advance();
1290
+
1291
+ if (!bos.output && tokens.indexOf(prev) === 1) {
1292
+ bos.output = ONE_CHAR;
1293
+ }
1294
+ continue;
1295
+ }
1296
+ }
1297
+ }
1298
+ }
1299
+
1300
+ if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
1301
+ value = `\\${value}`;
1302
+ }
1303
+
1304
+ if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
1305
+ value = `\\${value}`;
1306
+ }
1307
+
1308
+ if (opts.posix === true && value === '!' && prev.value === '[') {
1309
+ value = '^';
1310
+ }
1311
+
1312
+ prev.value += value;
1313
+ append({ value });
1314
+ continue;
1315
+ }
1316
+
1317
+ if (state.quotes === 1 && value !== '"') {
1318
+ value = utils.escapeRegex(value);
1319
+ prev.value += value;
1320
+ append({ value });
1321
+ continue;
1322
+ }
1323
+
1324
+ if (value === '"') {
1325
+ state.quotes = state.quotes === 1 ? 0 : 1;
1326
+ if (opts.keepQuotes === true) {
1327
+ push({ type: 'text', value });
1328
+ }
1329
+ continue;
1330
+ }
1331
+
1332
+ if (value === '(') {
1333
+ increment('parens');
1334
+ push({ type: 'paren', value });
1335
+ continue;
1336
+ }
1337
+
1338
+ if (value === ')') {
1339
+ if (state.parens === 0 && opts.strictBrackets === true) {
1340
+ throw new SyntaxError(syntaxError('opening', '('));
1341
+ }
1342
+
1343
+ const extglob = extglobs[extglobs.length - 1];
1344
+ if (extglob && state.parens === extglob.parens + 1) {
1345
+ extglobClose(extglobs.pop());
1346
+ continue;
1347
+ }
1348
+
1349
+ push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
1350
+ decrement('parens');
1351
+ continue;
1352
+ }
1353
+
1354
+ if (value === '[') {
1355
+ if (opts.nobracket === true || !remaining().includes(']')) {
1356
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
1357
+ throw new SyntaxError(syntaxError('closing', ']'));
1358
+ }
1359
+
1360
+ value = `\\${value}`;
1361
+ } else {
1362
+ increment('brackets');
1363
+ }
1364
+
1365
+ push({ type: 'bracket', value });
1366
+ continue;
1367
+ }
1368
+
1369
+ if (value === ']') {
1370
+ if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
1371
+ push({ type: 'text', value, output: `\\${value}` });
1372
+ continue;
1373
+ }
1374
+
1375
+ if (state.brackets === 0) {
1376
+ if (opts.strictBrackets === true) {
1377
+ throw new SyntaxError(syntaxError('opening', '['));
1378
+ }
1379
+
1380
+ push({ type: 'text', value, output: `\\${value}` });
1381
+ continue;
1382
+ }
1383
+
1384
+ decrement('brackets');
1385
+
1386
+ const prevValue = prev.value.slice(1);
1387
+ if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
1388
+ value = `/${value}`;
1389
+ }
1390
+
1391
+ prev.value += value;
1392
+ append({ value });
1393
+
1394
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
1395
+ continue;
1396
+ }
1397
+
1398
+ const escaped = utils.escapeRegex(prev.value);
1399
+ state.output = state.output.slice(0, -prev.value.length);
1400
+
1401
+ if (opts.literalBrackets === true) {
1402
+ state.output += escaped;
1403
+ prev.value = escaped;
1404
+ continue;
1405
+ }
1406
+
1407
+ prev.value = `(${capture}${escaped}|${prev.value})`;
1408
+ state.output += prev.value;
1409
+ continue;
1410
+ }
1411
+
1412
+ if (value === '{' && opts.nobrace !== true) {
1413
+ increment('braces');
1414
+
1415
+ const open = {
1416
+ type: 'brace',
1417
+ value,
1418
+ output: '(',
1419
+ outputIndex: state.output.length,
1420
+ tokensIndex: state.tokens.length
1421
+ };
1422
+
1423
+ braces.push(open);
1424
+ push(open);
1425
+ continue;
1426
+ }
1427
+
1428
+ if (value === '}') {
1429
+ const brace = braces[braces.length - 1];
1430
+
1431
+ if (opts.nobrace === true || !brace) {
1432
+ push({ type: 'text', value, output: value });
1433
+ continue;
1434
+ }
1435
+
1436
+ let output = ')';
1437
+
1438
+ if (brace.dots === true) {
1439
+ const arr = tokens.slice();
1440
+ const range = [];
1441
+
1442
+ for (let i = arr.length - 1; i >= 0; i--) {
1443
+ tokens.pop();
1444
+ if (arr[i].type === 'brace') {
1445
+ break;
1446
+ }
1447
+ if (arr[i].type !== 'dots') {
1448
+ range.unshift(arr[i].value);
1449
+ }
1450
+ }
1451
+
1452
+ output = expandRange(range, opts);
1453
+ state.backtrack = true;
1454
+ }
1455
+
1456
+ if (brace.comma !== true && brace.dots !== true) {
1457
+ const out = state.output.slice(0, brace.outputIndex);
1458
+ const toks = state.tokens.slice(brace.tokensIndex);
1459
+ brace.value = brace.output = '\\{';
1460
+ value = output = '\\}';
1461
+ state.output = out;
1462
+ for (const t of toks) {
1463
+ state.output += (t.output || t.value);
1464
+ }
1465
+ }
1466
+
1467
+ push({ type: 'brace', value, output });
1468
+ decrement('braces');
1469
+ braces.pop();
1470
+ continue;
1471
+ }
1472
+
1473
+ if (value === '|') {
1474
+ if (extglobs.length > 0) {
1475
+ extglobs[extglobs.length - 1].conditions++;
1476
+ }
1477
+ push({ type: 'text', value });
1478
+ continue;
1479
+ }
1480
+
1481
+ if (value === ',') {
1482
+ let output = value;
1483
+
1484
+ const brace = braces[braces.length - 1];
1485
+ if (brace && stack[stack.length - 1] === 'braces') {
1486
+ brace.comma = true;
1487
+ output = '|';
1488
+ }
1489
+
1490
+ push({ type: 'comma', value, output });
1491
+ continue;
1492
+ }
1493
+
1494
+ if (value === '/') {
1495
+ if (prev.type === 'dot' && state.index === state.start + 1) {
1496
+ state.start = state.index + 1;
1497
+ state.consumed = '';
1498
+ state.output = '';
1499
+ tokens.pop();
1500
+ prev = bos;
1501
+ continue;
1502
+ }
1503
+
1504
+ push({ type: 'slash', value, output: SLASH_LITERAL });
1505
+ continue;
1506
+ }
1507
+
1508
+ if (value === '.') {
1509
+ if (state.braces > 0 && prev.type === 'dot') {
1510
+ if (prev.value === '.') prev.output = DOT_LITERAL;
1511
+ const brace = braces[braces.length - 1];
1512
+ prev.type = 'dots';
1513
+ prev.output += value;
1514
+ prev.value += value;
1515
+ brace.dots = true;
1516
+ continue;
1517
+ }
1518
+
1519
+ if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
1520
+ push({ type: 'text', value, output: DOT_LITERAL });
1521
+ continue;
1522
+ }
1523
+
1524
+ push({ type: 'dot', value, output: DOT_LITERAL });
1525
+ continue;
1526
+ }
1527
+
1528
+ if (value === '?') {
1529
+ const isGroup = prev && prev.value === '(';
1530
+ if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1531
+ extglobOpen('qmark', value);
1532
+ continue;
1533
+ }
1534
+
1535
+ if (prev && prev.type === 'paren') {
1536
+ const next = peek();
1537
+ let output = value;
1538
+
1539
+ if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
1540
+ output = `\\${value}`;
1541
+ }
1542
+
1543
+ push({ type: 'text', value, output });
1544
+ continue;
1545
+ }
1546
+
1547
+ if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
1548
+ push({ type: 'qmark', value, output: QMARK_NO_DOT });
1549
+ continue;
1550
+ }
1551
+
1552
+ push({ type: 'qmark', value, output: QMARK });
1553
+ continue;
1554
+ }
1555
+
1556
+ if (value === '!') {
1557
+ if (opts.noextglob !== true && peek() === '(') {
1558
+ if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
1559
+ extglobOpen('negate', value);
1560
+ continue;
1561
+ }
1562
+ }
1563
+
1564
+ if (opts.nonegate !== true && state.index === 0) {
1565
+ negate();
1566
+ continue;
1567
+ }
1568
+ }
1569
+
1570
+ if (value === '+') {
1571
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1572
+ extglobOpen('plus', value);
1573
+ continue;
1574
+ }
1575
+
1576
+ if ((prev && prev.value === '(') || opts.regex === false) {
1577
+ push({ type: 'plus', value, output: PLUS_LITERAL });
1578
+ continue;
1579
+ }
1580
+
1581
+ if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
1582
+ push({ type: 'plus', value });
1583
+ continue;
1584
+ }
1585
+
1586
+ push({ type: 'plus', value: PLUS_LITERAL });
1587
+ continue;
1588
+ }
1589
+
1590
+ if (value === '@') {
1591
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1592
+ push({ type: 'at', extglob: true, value, output: '' });
1593
+ continue;
1594
+ }
1595
+
1596
+ push({ type: 'text', value });
1597
+ continue;
1598
+ }
1599
+
1600
+ if (value !== '*') {
1601
+ if (value === '$' || value === '^') {
1602
+ value = `\\${value}`;
1603
+ }
1604
+
1605
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
1606
+ if (match) {
1607
+ value += match[0];
1608
+ state.index += match[0].length;
1609
+ }
1610
+
1611
+ push({ type: 'text', value });
1612
+ continue;
1613
+ }
1614
+
1615
+ if (prev && (prev.type === 'globstar' || prev.star === true)) {
1616
+ prev.type = 'star';
1617
+ prev.star = true;
1618
+ prev.value += value;
1619
+ prev.output = star;
1620
+ state.backtrack = true;
1621
+ state.globstar = true;
1622
+ consume(value);
1623
+ continue;
1624
+ }
1625
+
1626
+ let rest = remaining();
1627
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
1628
+ extglobOpen('star', value);
1629
+ continue;
1630
+ }
1631
+
1632
+ if (prev.type === 'star') {
1633
+ if (opts.noglobstar === true) {
1634
+ consume(value);
1635
+ continue;
1636
+ }
1637
+
1638
+ const prior = prev.prev;
1639
+ const before = prior.prev;
1640
+ const isStart = prior.type === 'slash' || prior.type === 'bos';
1641
+ const afterStar = before && (before.type === 'star' || before.type === 'globstar');
1642
+
1643
+ if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
1644
+ push({ type: 'star', value, output: '' });
1645
+ continue;
1646
+ }
1647
+
1648
+ const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
1649
+ const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
1650
+ if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
1651
+ push({ type: 'star', value, output: '' });
1652
+ continue;
1653
+ }
1654
+
1655
+ while (rest.slice(0, 3) === '/**') {
1656
+ const after = input[state.index + 4];
1657
+ if (after && after !== '/') {
1658
+ break;
1659
+ }
1660
+ rest = rest.slice(3);
1661
+ consume('/**', 3);
1662
+ }
1663
+
1664
+ if (prior.type === 'bos' && eos()) {
1665
+ prev.type = 'globstar';
1666
+ prev.value += value;
1667
+ prev.output = globstar(opts);
1668
+ state.output = prev.output;
1669
+ state.globstar = true;
1670
+ consume(value);
1671
+ continue;
1672
+ }
1673
+
1674
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
1675
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1676
+ prior.output = `(?:${prior.output}`;
1677
+
1678
+ prev.type = 'globstar';
1679
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
1680
+ prev.value += value;
1681
+ state.globstar = true;
1682
+ state.output += prior.output + prev.output;
1683
+ consume(value);
1684
+ continue;
1685
+ }
1686
+
1687
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
1688
+ const end = rest[1] !== void 0 ? '|$' : '';
1689
+
1690
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1691
+ prior.output = `(?:${prior.output}`;
1692
+
1693
+ prev.type = 'globstar';
1694
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
1695
+ prev.value += value;
1696
+
1697
+ state.output += prior.output + prev.output;
1698
+ state.globstar = true;
1699
+
1700
+ consume(value + advance());
1701
+
1702
+ push({ type: 'slash', value: '/', output: '' });
1703
+ continue;
1704
+ }
1705
+
1706
+ if (prior.type === 'bos' && rest[0] === '/') {
1707
+ prev.type = 'globstar';
1708
+ prev.value += value;
1709
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
1710
+ state.output = prev.output;
1711
+ state.globstar = true;
1712
+ consume(value + advance());
1713
+ push({ type: 'slash', value: '/', output: '' });
1714
+ continue;
1715
+ }
1716
+
1717
+ state.output = state.output.slice(0, -prev.output.length);
1718
+
1719
+ prev.type = 'globstar';
1720
+ prev.output = globstar(opts);
1721
+ prev.value += value;
1722
+
1723
+ state.output += prev.output;
1724
+ state.globstar = true;
1725
+ consume(value);
1726
+ continue;
1727
+ }
1728
+
1729
+ const token = { type: 'star', value, output: star };
1730
+
1731
+ if (opts.bash === true) {
1732
+ token.output = '.*?';
1733
+ if (prev.type === 'bos' || prev.type === 'slash') {
1734
+ token.output = nodot + token.output;
1735
+ }
1736
+ push(token);
1737
+ continue;
1738
+ }
1739
+
1740
+ if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
1741
+ token.output = value;
1742
+ push(token);
1743
+ continue;
1744
+ }
1745
+
1746
+ if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
1747
+ if (prev.type === 'dot') {
1748
+ state.output += NO_DOT_SLASH;
1749
+ prev.output += NO_DOT_SLASH;
1750
+
1751
+ } else if (opts.dot === true) {
1752
+ state.output += NO_DOTS_SLASH;
1753
+ prev.output += NO_DOTS_SLASH;
1754
+
1755
+ } else {
1756
+ state.output += nodot;
1757
+ prev.output += nodot;
1758
+ }
1759
+
1760
+ if (peek() !== '*') {
1761
+ state.output += ONE_CHAR;
1762
+ prev.output += ONE_CHAR;
1763
+ }
1764
+ }
1765
+
1766
+ push(token);
1767
+ }
1768
+
1769
+ while (state.brackets > 0) {
1770
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
1771
+ state.output = utils.escapeLast(state.output, '[');
1772
+ decrement('brackets');
1773
+ }
1774
+
1775
+ while (state.parens > 0) {
1776
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
1777
+ state.output = utils.escapeLast(state.output, '(');
1778
+ decrement('parens');
1779
+ }
1780
+
1781
+ while (state.braces > 0) {
1782
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
1783
+ state.output = utils.escapeLast(state.output, '{');
1784
+ decrement('braces');
1785
+ }
1786
+
1787
+ if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
1788
+ push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
1789
+ }
1790
+
1791
+ if (state.backtrack === true) {
1792
+ state.output = '';
1793
+
1794
+ for (const token of state.tokens) {
1795
+ state.output += token.output != null ? token.output : token.value;
1796
+
1797
+ if (token.suffix) {
1798
+ state.output += token.suffix;
1799
+ }
1800
+ }
1801
+ }
1802
+
1803
+ return state;
1804
+ };
1805
+
1806
+ parse.fastpaths = (input, options) => {
1807
+ const opts = { ...options };
1808
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1809
+ const len = input.length;
1810
+ if (len > max) {
1811
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1812
+ }
1813
+
1814
+ input = REPLACEMENTS[input] || input;
1815
+
1816
+ const {
1817
+ DOT_LITERAL,
1818
+ SLASH_LITERAL,
1819
+ ONE_CHAR,
1820
+ DOTS_SLASH,
1821
+ NO_DOT,
1822
+ NO_DOTS,
1823
+ NO_DOTS_SLASH,
1824
+ STAR,
1825
+ START_ANCHOR
1826
+ } = constants.globChars(opts.windows);
1827
+
1828
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
1829
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1830
+ const capture = opts.capture ? '' : '?:';
1831
+ const state = { negated: false, prefix: '' };
1832
+ let star = opts.bash === true ? '.*?' : STAR;
1833
+
1834
+ if (opts.capture) {
1835
+ star = `(${star})`;
1836
+ }
1837
+
1838
+ const globstar = opts => {
1839
+ if (opts.noglobstar === true) return star;
1840
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1841
+ };
1842
+
1843
+ const create = str => {
1844
+ switch (str) {
1845
+ case '*':
1846
+ return `${nodot}${ONE_CHAR}${star}`;
1847
+
1848
+ case '.*':
1849
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
1850
+
1851
+ case '*.*':
1852
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1853
+
1854
+ case '*/*':
1855
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
1856
+
1857
+ case '**':
1858
+ return nodot + globstar(opts);
1859
+
1860
+ case '**/*':
1861
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
1862
+
1863
+ case '**/*.*':
1864
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1865
+
1866
+ case '**/.*':
1867
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
1868
+
1869
+ default: {
1870
+ const match = /^(.*?)\.(\w+)$/.exec(str);
1871
+ if (!match) return;
1872
+
1873
+ const source = create(match[1]);
1874
+ if (!source) return;
1875
+
1876
+ return source + DOT_LITERAL + match[2];
1877
+ }
1878
+ }
1879
+ };
1880
+
1881
+ const output = utils.removePrefix(input, state);
1882
+ let source = create(output);
1883
+
1884
+ if (source && opts.strictSlashes !== true) {
1885
+ source += `${SLASH_LITERAL}?`;
1886
+ }
1887
+
1888
+ return source;
1889
+ };
1890
+
1891
+ parse_1 = parse;
1892
+ return parse_1;
1893
+ }
1894
+
1895
+ var picomatch_1$1;
1896
+ var hasRequiredPicomatch$1;
1897
+
1898
+ function requirePicomatch$1 () {
1899
+ if (hasRequiredPicomatch$1) return picomatch_1$1;
1900
+ hasRequiredPicomatch$1 = 1;
1901
+
1902
+ const scan = /*@__PURE__*/ requireScan();
1903
+ const parse = /*@__PURE__*/ requireParse();
1904
+ const utils = /*@__PURE__*/ requireUtils();
1905
+ const constants = /*@__PURE__*/ requireConstants();
1906
+ const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
1907
+
1908
+ const picomatch = (glob, options, returnState = false) => {
1909
+ if (Array.isArray(glob)) {
1910
+ const fns = glob.map(input => picomatch(input, options, returnState));
1911
+ const arrayMatcher = str => {
1912
+ for (const isMatch of fns) {
1913
+ const state = isMatch(str);
1914
+ if (state) return state;
1915
+ }
1916
+ return false;
1917
+ };
1918
+ return arrayMatcher;
1919
+ }
1920
+
1921
+ const isState = isObject(glob) && glob.tokens && glob.input;
1922
+
1923
+ if (glob === '' || (typeof glob !== 'string' && !isState)) {
1924
+ throw new TypeError('Expected pattern to be a non-empty string');
1925
+ }
1926
+
1927
+ const opts = options || {};
1928
+ const posix = opts.windows;
1929
+ const regex = isState
1930
+ ? picomatch.compileRe(glob, options)
1931
+ : picomatch.makeRe(glob, options, false, true);
1932
+
1933
+ const state = regex.state;
1934
+ delete regex.state;
1935
+
1936
+ let isIgnored = () => false;
1937
+ if (opts.ignore) {
1938
+ const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
1939
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
1940
+ }
1941
+
1942
+ const matcher = (input, returnObject = false) => {
1943
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
1944
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
1945
+
1946
+ if (typeof opts.onResult === 'function') {
1947
+ opts.onResult(result);
1948
+ }
1949
+
1950
+ if (isMatch === false) {
1951
+ result.isMatch = false;
1952
+ return returnObject ? result : false;
1953
+ }
1954
+
1955
+ if (isIgnored(input)) {
1956
+ if (typeof opts.onIgnore === 'function') {
1957
+ opts.onIgnore(result);
1958
+ }
1959
+ result.isMatch = false;
1960
+ return returnObject ? result : false;
1961
+ }
1962
+
1963
+ if (typeof opts.onMatch === 'function') {
1964
+ opts.onMatch(result);
1965
+ }
1966
+ return returnObject ? result : true;
1967
+ };
1968
+
1969
+ if (returnState) {
1970
+ matcher.state = state;
1971
+ }
1972
+
1973
+ return matcher;
1974
+ };
1975
+
1976
+ picomatch.test = (input, regex, options, { glob, posix } = {}) => {
1977
+ if (typeof input !== 'string') {
1978
+ throw new TypeError('Expected input to be a string');
1979
+ }
1980
+
1981
+ if (input === '') {
1982
+ return { isMatch: false, output: '' };
1983
+ }
1984
+
1985
+ const opts = options || {};
1986
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
1987
+ let match = input === glob;
1988
+ let output = (match && format) ? format(input) : input;
1989
+
1990
+ if (match === false) {
1991
+ output = format ? format(input) : input;
1992
+ match = output === glob;
1993
+ }
1994
+
1995
+ if (match === false || opts.capture === true) {
1996
+ if (opts.matchBase === true || opts.basename === true) {
1997
+ match = picomatch.matchBase(input, regex, options, posix);
1998
+ } else {
1999
+ match = regex.exec(output);
2000
+ }
2001
+ }
2002
+
2003
+ return { isMatch: Boolean(match), match, output };
2004
+ };
2005
+
2006
+ picomatch.matchBase = (input, glob, options) => {
2007
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
2008
+ return regex.test(utils.basename(input));
2009
+ };
2010
+
2011
+ picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
2012
+
2013
+ picomatch.parse = (pattern, options) => {
2014
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
2015
+ return parse(pattern, { ...options, fastpaths: false });
2016
+ };
2017
+
2018
+ picomatch.scan = (input, options) => scan(input, options);
2019
+
2020
+ picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
2021
+ if (returnOutput === true) {
2022
+ return state.output;
2023
+ }
2024
+
2025
+ const opts = options || {};
2026
+ const prepend = opts.contains ? '' : '^';
2027
+ const append = opts.contains ? '' : '$';
2028
+
2029
+ let source = `${prepend}(?:${state.output})${append}`;
2030
+ if (state && state.negated === true) {
2031
+ source = `^(?!${source}).*$`;
2032
+ }
2033
+
2034
+ const regex = picomatch.toRegex(source, options);
2035
+ if (returnState === true) {
2036
+ regex.state = state;
2037
+ }
2038
+
2039
+ return regex;
2040
+ };
2041
+
2042
+ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2043
+ if (!input || typeof input !== 'string') {
2044
+ throw new TypeError('Expected a non-empty string');
2045
+ }
2046
+
2047
+ let parsed = { negated: false, fastpaths: true };
2048
+
2049
+ if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
2050
+ parsed.output = parse.fastpaths(input, options);
2051
+ }
2052
+
2053
+ if (!parsed.output) {
2054
+ parsed = parse(input, options);
2055
+ }
2056
+
2057
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
2058
+ };
2059
+
2060
+ picomatch.toRegex = (source, options) => {
2061
+ try {
2062
+ const opts = options || {};
2063
+ return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
2064
+ } catch (err) {
2065
+ if (options && options.debug === true) throw err;
2066
+ return /$^/;
2067
+ }
2068
+ };
2069
+
2070
+ picomatch.constants = constants;
2071
+
2072
+ picomatch_1$1 = picomatch;
2073
+ return picomatch_1$1;
2074
+ }
2075
+
2076
+ var picomatch_1;
2077
+ var hasRequiredPicomatch;
2078
+
2079
+ function requirePicomatch () {
2080
+ if (hasRequiredPicomatch) return picomatch_1;
2081
+ hasRequiredPicomatch = 1;
2082
+
2083
+ const pico = /*@__PURE__*/ requirePicomatch$1();
2084
+ const utils = /*@__PURE__*/ requireUtils();
2085
+
2086
+ function picomatch(glob, options, returnState = false) {
2087
+ if (options && (options.windows === null || options.windows === undefined)) {
2088
+ options = { ...options, windows: utils.isWindows() };
2089
+ }
2090
+
2091
+ return pico(glob, options, returnState);
2092
+ }
2093
+
2094
+ Object.assign(picomatch, pico);
2095
+ picomatch_1 = picomatch;
2096
+ return picomatch_1;
2097
+ }
2098
+
2099
+ var picomatchExports = /*@__PURE__*/ requirePicomatch();
2100
+ const pm = /*@__PURE__*/getDefaultExportFromCjs(picomatchExports);
2101
+
2102
+ function isArray(arg) {
2103
+ return Array.isArray(arg);
2104
+ }
2105
+ function ensureArray(thing) {
2106
+ if (isArray(thing))
2107
+ return thing;
2108
+ if (thing == null)
2109
+ return [];
2110
+ return [thing];
2111
+ }
2112
+
2113
+ const normalizePathRegExp = new RegExp(`\\${path.win32.sep}`, 'g');
2114
+ const normalizePath = function normalizePath(filename) {
2115
+ return filename.replace(normalizePathRegExp, path.posix.sep);
2116
+ };
2117
+
2118
+ function getMatcherString(id, resolutionBase) {
2119
+ if (resolutionBase === false || path.isAbsolute(id) || id.startsWith('**')) {
2120
+ return normalizePath(id);
2121
+ }
2122
+ const basePath = normalizePath(path.resolve(resolutionBase || ''))
2123
+ .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
2124
+ return path.posix.join(basePath, normalizePath(id));
2125
+ }
2126
+ const createFilter = function createFilter(include, exclude, options) {
2127
+ const resolutionBase = options && options.resolve;
2128
+ const getMatcher = (id) => id instanceof RegExp
2129
+ ? id
2130
+ : {
2131
+ test: (what) => {
2132
+ const pattern = getMatcherString(id, resolutionBase);
2133
+ const fn = pm(pattern, { dot: true });
2134
+ const result = fn(what);
2135
+ return result;
2136
+ }
2137
+ };
2138
+ const includeMatchers = ensureArray(include).map(getMatcher);
2139
+ const excludeMatchers = ensureArray(exclude).map(getMatcher);
2140
+ if (!includeMatchers.length && !excludeMatchers.length)
2141
+ return (id) => typeof id === 'string' && !id.includes('\0');
2142
+ return function result(id) {
2143
+ if (typeof id !== 'string')
2144
+ return false;
2145
+ if (id.includes('\0'))
2146
+ return false;
2147
+ const pathId = normalizePath(id);
2148
+ for (let i = 0; i < excludeMatchers.length; ++i) {
2149
+ const matcher = excludeMatchers[i];
2150
+ if (matcher instanceof RegExp) {
2151
+ matcher.lastIndex = 0;
2152
+ }
2153
+ if (matcher.test(pathId))
2154
+ return false;
2155
+ }
2156
+ for (let i = 0; i < includeMatchers.length; ++i) {
2157
+ const matcher = includeMatchers[i];
2158
+ if (matcher instanceof RegExp) {
2159
+ matcher.lastIndex = 0;
2160
+ }
2161
+ if (matcher.test(pathId))
2162
+ return true;
2163
+ }
2164
+ return !includeMatchers.length;
2165
+ };
2166
+ };
2167
+
2168
+ 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';
2169
+ 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';
2170
+ const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));
2171
+ forbiddenIdentifiers.add('');
2172
+ const makeLegalIdentifier = function makeLegalIdentifier(str) {
2173
+ let identifier = str
2174
+ .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
2175
+ .replace(/[^$_a-zA-Z0-9]/g, '_');
2176
+ if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {
2177
+ identifier = `_${identifier}`;
2178
+ }
2179
+ return identifier || '_';
2180
+ };
2181
+
2182
+ function stringify(obj) {
2183
+ return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
2184
+ }
2185
+ function serializeArray(arr, indent, baseIndent) {
2186
+ let output = '[';
2187
+ const separator = indent ? `\n${baseIndent}${indent}` : '';
2188
+ for (let i = 0; i < arr.length; i++) {
2189
+ const key = arr[i];
2190
+ output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;
2191
+ }
2192
+ return `${output}${indent ? `\n${baseIndent}` : ''}]`;
2193
+ }
2194
+ function serializeObject(obj, indent, baseIndent) {
2195
+ let output = '{';
2196
+ const separator = indent ? `\n${baseIndent}${indent}` : '';
2197
+ const entries = Object.entries(obj);
2198
+ for (let i = 0; i < entries.length; i++) {
2199
+ const [key, value] = entries[i];
2200
+ const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);
2201
+ output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;
2202
+ }
2203
+ return `${output}${indent ? `\n${baseIndent}` : ''}}`;
2204
+ }
2205
+ function serialize(obj, indent, baseIndent) {
2206
+ if (typeof obj === 'object' && obj !== null) {
2207
+ if (Array.isArray(obj))
2208
+ return serializeArray(obj, indent, baseIndent);
2209
+ if (obj instanceof Date)
2210
+ return `new Date(${obj.getTime()})`;
2211
+ if (obj instanceof RegExp)
2212
+ return obj.toString();
2213
+ return serializeObject(obj, indent, baseIndent);
2214
+ }
2215
+ if (typeof obj === 'number') {
2216
+ if (obj === Infinity)
2217
+ return 'Infinity';
2218
+ if (obj === -Infinity)
2219
+ return '-Infinity';
2220
+ if (obj === 0)
2221
+ return 1 / obj === Infinity ? '0' : '-0';
2222
+ if (obj !== obj)
2223
+ return 'NaN';
2224
+ }
2225
+ if (typeof obj === 'symbol') {
2226
+ const key = Symbol.keyFor(obj);
2227
+ if (key !== undefined)
2228
+ return `Symbol.for(${stringify(key)})`;
2229
+ }
2230
+ if (typeof obj === 'bigint')
2231
+ return `${obj}n`;
2232
+ return stringify(obj);
2233
+ }
2234
+ const hasStringIsWellFormed = 'isWellFormed' in String.prototype;
2235
+ function isWellFormedString(input) {
2236
+ if (hasStringIsWellFormed)
2237
+ return input.isWellFormed();
2238
+ return !/\p{Surrogate}/u.test(input);
2239
+ }
2240
+ const dataToEsm = function dataToEsm(data, options = {}) {
2241
+ var _a, _b;
2242
+ const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
2243
+ const _ = options.compact ? '' : ' ';
2244
+ const n = options.compact ? '' : '\n';
2245
+ const declarationType = options.preferConst ? 'const' : 'var';
2246
+ if (options.namedExports === false ||
2247
+ typeof data !== 'object' ||
2248
+ Array.isArray(data) ||
2249
+ data instanceof Date ||
2250
+ data instanceof RegExp ||
2251
+ data === null) {
2252
+ const code = serialize(data, options.compact ? null : t, '');
2253
+ const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' ');
2254
+ return `export default${magic}${code};`;
2255
+ }
2256
+ let maxUnderbarPrefixLength = 0;
2257
+ for (const key of Object.keys(data)) {
2258
+ const underbarPrefixLength = (_b = (_a = /^(_+)/.exec(key)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0;
2259
+ if (underbarPrefixLength > maxUnderbarPrefixLength) {
2260
+ maxUnderbarPrefixLength = underbarPrefixLength;
2261
+ }
2262
+ }
2263
+ const arbitraryNamePrefix = `${'_'.repeat(maxUnderbarPrefixLength + 1)}arbitrary`;
2264
+ let namedExportCode = '';
2265
+ const defaultExportRows = [];
2266
+ const arbitraryNameExportRows = [];
2267
+ for (const [key, value] of Object.entries(data)) {
2268
+ if (key === makeLegalIdentifier(key)) {
2269
+ if (options.objectShorthand)
2270
+ defaultExportRows.push(key);
2271
+ else
2272
+ defaultExportRows.push(`${key}:${_}${key}`);
2273
+ namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
2274
+ }
2275
+ else {
2276
+ defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
2277
+ if (options.includeArbitraryNames && isWellFormedString(key)) {
2278
+ const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
2279
+ namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
2280
+ arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
2281
+ }
2282
+ }
2283
+ }
2284
+ const arbitraryExportCode = arbitraryNameExportRows.length > 0
2285
+ ? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}`
2286
+ : '';
2287
+ const defaultExportCode = `export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
2288
+ return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`;
2289
+ };
2290
+
2291
+ function json(options) {
2292
+ if ( options === void 0 ) options = {};
2293
+
2294
+ var filter = createFilter(options.include, options.exclude);
2295
+ var indent = 'indent' in options ? options.indent : '\t';
2296
+
2297
+ return {
2298
+ name: 'json',
2299
+
2300
+ transform: function transform(code, id) {
2301
+ if (id.slice(-5) !== '.json' || !filter(id)) { return null; }
2302
+
2303
+ try {
2304
+ var parsed = JSON.parse(code);
2305
+ return {
2306
+ code: dataToEsm(parsed, {
2307
+ preferConst: options.preferConst,
2308
+ compact: options.compact,
2309
+ namedExports: options.namedExports,
2310
+ includeArbitraryNames: options.includeArbitraryNames,
2311
+ indent: indent
2312
+ }),
2313
+ map: { mappings: '' }
2314
+ };
2315
+ } catch (err) {
2316
+ var message = 'Could not parse JSON file';
2317
+ this.error({ message: message, id: id, cause: err });
2318
+ return null;
2319
+ }
2320
+ }
2321
+ };
2322
+ }
2323
+
2324
+ module.exports = json;