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