@powerlines/plugin-alloy 0.26.179 → 0.26.181

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 (422) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +14 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  3. package/dist/core/components/infrastructure-file.cjs +8 -1
  4. package/dist/core/components/infrastructure-file.mjs +3 -1
  5. package/dist/core/components/infrastructure-file.mjs.map +1 -1
  6. package/dist/core/components/infrastructure-file.test.cjs +16 -0
  7. package/dist/core/components/infrastructure-file.test.d.cts +1 -0
  8. package/dist/core/components/infrastructure-file.test.d.mts +1 -0
  9. package/dist/core/components/infrastructure-file.test.mjs +18 -0
  10. package/dist/core/components/infrastructure-file.test.mjs.map +1 -0
  11. package/dist/core/components/output.cjs +9 -1
  12. package/dist/core/components/output.d.cts.map +1 -1
  13. package/dist/core/components/output.d.mts.map +1 -1
  14. package/dist/core/components/output.mjs +3 -1
  15. package/dist/core/components/output.mjs.map +1 -1
  16. package/dist/core/components/output.test.cjs +16 -0
  17. package/dist/core/components/output.test.d.cts +1 -0
  18. package/dist/core/components/output.test.d.mts +1 -0
  19. package/dist/core/components/output.test.mjs +18 -0
  20. package/dist/core/components/output.test.mjs.map +1 -0
  21. package/dist/core/components/single-line-comment.cjs +9 -1
  22. package/dist/core/components/single-line-comment.mjs +3 -1
  23. package/dist/core/components/single-line-comment.mjs.map +1 -1
  24. package/dist/core/components/single-line-comment.test.cjs +16 -0
  25. package/dist/core/components/single-line-comment.test.d.cts +1 -0
  26. package/dist/core/components/single-line-comment.test.d.mts +1 -0
  27. package/dist/core/components/single-line-comment.test.mjs +18 -0
  28. package/dist/core/components/single-line-comment.test.mjs.map +1 -0
  29. package/dist/core/components/source-file.cjs +8 -1
  30. package/dist/core/components/source-file.mjs +3 -1
  31. package/dist/core/components/source-file.mjs.map +1 -1
  32. package/dist/core/components/source-file.test.cjs +16 -0
  33. package/dist/core/components/source-file.test.d.cts +1 -0
  34. package/dist/core/components/source-file.test.d.mts +1 -0
  35. package/dist/core/components/source-file.test.mjs +18 -0
  36. package/dist/core/components/source-file.test.mjs.map +1 -0
  37. package/dist/core/components/spacing.cjs +9 -1
  38. package/dist/core/components/spacing.d.cts.map +1 -1
  39. package/dist/core/components/spacing.d.mts.map +1 -1
  40. package/dist/core/components/spacing.mjs +3 -1
  41. package/dist/core/components/spacing.mjs.map +1 -1
  42. package/dist/core/components/spacing.test.cjs +16 -0
  43. package/dist/core/components/spacing.test.d.cts +1 -0
  44. package/dist/core/components/spacing.test.d.mts +1 -0
  45. package/dist/core/components/spacing.test.mjs +18 -0
  46. package/dist/core/components/spacing.test.mjs.map +1 -0
  47. package/dist/core/contexts/context.cjs +13 -0
  48. package/dist/core/contexts/context.d.cts.map +1 -1
  49. package/dist/core/contexts/context.d.mts.map +1 -1
  50. package/dist/core/contexts/context.mjs +8 -1
  51. package/dist/core/contexts/context.mjs.map +1 -1
  52. package/dist/core/contexts/context.test.cjs +16 -0
  53. package/dist/core/contexts/context.test.d.cts +1 -0
  54. package/dist/core/contexts/context.test.d.mts +1 -0
  55. package/dist/core/contexts/context.test.mjs +18 -0
  56. package/dist/core/contexts/context.test.mjs.map +1 -0
  57. package/dist/core/contexts/meta.cjs +13 -0
  58. package/dist/core/contexts/meta.d.cts.map +1 -1
  59. package/dist/core/contexts/meta.d.mts.map +1 -1
  60. package/dist/core/contexts/meta.mjs +8 -1
  61. package/dist/core/contexts/meta.mjs.map +1 -1
  62. package/dist/core/contexts/meta.test.cjs +16 -0
  63. package/dist/core/contexts/meta.test.d.cts +1 -0
  64. package/dist/core/contexts/meta.test.d.mts +1 -0
  65. package/dist/core/contexts/meta.test.mjs +18 -0
  66. package/dist/core/contexts/meta.test.mjs.map +1 -0
  67. package/dist/core/contexts/schema.cjs +13 -0
  68. package/dist/core/contexts/schema.d.cts.map +1 -1
  69. package/dist/core/contexts/schema.d.mts.map +1 -1
  70. package/dist/core/contexts/schema.mjs +8 -1
  71. package/dist/core/contexts/schema.mjs.map +1 -1
  72. package/dist/core/contexts/schema.test.cjs +16 -0
  73. package/dist/core/contexts/schema.test.d.cts +1 -0
  74. package/dist/core/contexts/schema.test.d.mts +1 -0
  75. package/dist/core/contexts/schema.test.mjs +18 -0
  76. package/dist/core/contexts/schema.test.mjs.map +1 -0
  77. package/dist/core/helpers/code.cjs +9 -1
  78. package/dist/core/helpers/code.mjs +3 -1
  79. package/dist/core/helpers/code.mjs.map +1 -1
  80. package/dist/core/helpers/code.test.cjs +16 -0
  81. package/dist/core/helpers/code.test.d.cts +1 -0
  82. package/dist/core/helpers/code.test.d.mts +1 -0
  83. package/dist/core/helpers/code.test.mjs +18 -0
  84. package/dist/core/helpers/code.test.mjs.map +1 -0
  85. package/dist/hcl/components/block-declaration.cjs +9 -1
  86. package/dist/hcl/components/block-declaration.mjs +3 -1
  87. package/dist/hcl/components/block-declaration.mjs.map +1 -1
  88. package/dist/hcl/components/block-declaration.test.cjs +16 -0
  89. package/dist/hcl/components/block-declaration.test.d.cts +1 -0
  90. package/dist/hcl/components/block-declaration.test.d.mts +1 -0
  91. package/dist/hcl/components/block-declaration.test.mjs +18 -0
  92. package/dist/hcl/components/block-declaration.test.mjs.map +1 -0
  93. package/dist/hcl/components/hcl-file.cjs +12 -1
  94. package/dist/hcl/components/hcl-file.mjs +6 -1
  95. package/dist/hcl/components/hcl-file.mjs.map +1 -1
  96. package/dist/hcl/components/hcl-file.test.cjs +16 -0
  97. package/dist/hcl/components/hcl-file.test.d.cts +1 -0
  98. package/dist/hcl/components/hcl-file.test.d.mts +1 -0
  99. package/dist/hcl/components/hcl-file.test.mjs +18 -0
  100. package/dist/hcl/components/hcl-file.test.mjs.map +1 -0
  101. package/dist/hcl/components/packer-file.cjs +9 -1
  102. package/dist/hcl/components/packer-file.mjs +3 -1
  103. package/dist/hcl/components/packer-file.mjs.map +1 -1
  104. package/dist/hcl/components/packer-file.test.cjs +16 -0
  105. package/dist/hcl/components/packer-file.test.d.cts +1 -0
  106. package/dist/hcl/components/packer-file.test.d.mts +1 -0
  107. package/dist/hcl/components/packer-file.test.mjs +18 -0
  108. package/dist/hcl/components/packer-file.test.mjs.map +1 -0
  109. package/dist/hcl/components/terraform-file.cjs +9 -1
  110. package/dist/hcl/components/terraform-file.mjs +3 -1
  111. package/dist/hcl/components/terraform-file.mjs.map +1 -1
  112. package/dist/hcl/components/terraform-file.test.cjs +16 -0
  113. package/dist/hcl/components/terraform-file.test.d.cts +1 -0
  114. package/dist/hcl/components/terraform-file.test.d.mts +1 -0
  115. package/dist/hcl/components/terraform-file.test.mjs +18 -0
  116. package/dist/hcl/components/terraform-file.test.mjs.map +1 -0
  117. package/dist/helpers/capnp.cjs +24 -0
  118. package/dist/helpers/capnp.d.cts.map +1 -1
  119. package/dist/helpers/capnp.d.mts.map +1 -1
  120. package/dist/helpers/capnp.mjs +20 -1
  121. package/dist/helpers/capnp.mjs.map +1 -1
  122. package/dist/helpers/capnp.test.cjs +16 -0
  123. package/dist/helpers/capnp.test.d.cts +1 -0
  124. package/dist/helpers/capnp.test.d.mts +1 -0
  125. package/dist/helpers/capnp.test.mjs +18 -0
  126. package/dist/helpers/capnp.test.mjs.map +1 -0
  127. package/dist/helpers/create-builtin.cjs +9 -1
  128. package/dist/helpers/create-builtin.d.cts.map +1 -1
  129. package/dist/helpers/create-builtin.d.mts.map +1 -1
  130. package/dist/helpers/create-builtin.mjs +3 -1
  131. package/dist/helpers/create-builtin.mjs.map +1 -1
  132. package/dist/helpers/create-builtin.test.cjs +16 -0
  133. package/dist/helpers/create-builtin.test.d.cts +1 -0
  134. package/dist/helpers/create-builtin.test.d.mts +1 -0
  135. package/dist/helpers/create-builtin.test.mjs +18 -0
  136. package/dist/helpers/create-builtin.test.mjs.map +1 -0
  137. package/dist/helpers/refkey.cjs +1 -0
  138. package/dist/helpers/refkey.d.cts.map +1 -1
  139. package/dist/helpers/refkey.d.mts.map +1 -1
  140. package/dist/helpers/refkey.mjs +1 -0
  141. package/dist/helpers/refkey.mjs.map +1 -1
  142. package/dist/helpers/refkey.test.cjs +30 -0
  143. package/dist/helpers/refkey.test.d.cts +1 -0
  144. package/dist/helpers/refkey.test.d.mts +1 -0
  145. package/dist/helpers/refkey.test.mjs +32 -0
  146. package/dist/helpers/refkey.test.mjs.map +1 -0
  147. package/dist/helpers/typescript.cjs +9 -1
  148. package/dist/helpers/typescript.d.cts.map +1 -1
  149. package/dist/helpers/typescript.d.mts.map +1 -1
  150. package/dist/helpers/typescript.mjs +3 -1
  151. package/dist/helpers/typescript.mjs.map +1 -1
  152. package/dist/helpers/typescript.test.cjs +16 -0
  153. package/dist/helpers/typescript.test.d.cts +1 -0
  154. package/dist/helpers/typescript.test.d.mts +1 -0
  155. package/dist/helpers/typescript.test.mjs +18 -0
  156. package/dist/helpers/typescript.test.mjs.map +1 -0
  157. package/dist/markdown/components/front-matter.cjs +9 -1
  158. package/dist/markdown/components/front-matter.mjs +3 -1
  159. package/dist/markdown/components/front-matter.mjs.map +1 -1
  160. package/dist/markdown/components/front-matter.test.cjs +16 -0
  161. package/dist/markdown/components/front-matter.test.d.cts +1 -0
  162. package/dist/markdown/components/front-matter.test.d.mts +1 -0
  163. package/dist/markdown/components/front-matter.test.mjs +18 -0
  164. package/dist/markdown/components/front-matter.test.mjs.map +1 -0
  165. package/dist/markdown/components/heading.cjs +9 -1
  166. package/dist/markdown/components/heading.mjs +3 -1
  167. package/dist/markdown/components/heading.mjs.map +1 -1
  168. package/dist/markdown/components/heading.test.cjs +16 -0
  169. package/dist/markdown/components/heading.test.d.cts +1 -0
  170. package/dist/markdown/components/heading.test.d.mts +1 -0
  171. package/dist/markdown/components/heading.test.mjs +18 -0
  172. package/dist/markdown/components/heading.test.mjs.map +1 -0
  173. package/dist/markdown/components/markdown-file.cjs +12 -1
  174. package/dist/markdown/components/markdown-file.mjs +6 -1
  175. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  176. package/dist/markdown/components/markdown-file.test.cjs +16 -0
  177. package/dist/markdown/components/markdown-file.test.d.cts +1 -0
  178. package/dist/markdown/components/markdown-file.test.d.mts +1 -0
  179. package/dist/markdown/components/markdown-file.test.mjs +18 -0
  180. package/dist/markdown/components/markdown-file.test.mjs.map +1 -0
  181. package/dist/markdown/components/markdown-table.cjs +13 -1
  182. package/dist/markdown/components/markdown-table.d.cts.map +1 -1
  183. package/dist/markdown/components/markdown-table.d.mts.map +1 -1
  184. package/dist/markdown/components/markdown-table.mjs +7 -1
  185. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  186. package/dist/markdown/components/markdown-table.test.cjs +16 -0
  187. package/dist/markdown/components/markdown-table.test.d.cts +1 -0
  188. package/dist/markdown/components/markdown-table.test.d.mts +1 -0
  189. package/dist/markdown/components/markdown-table.test.mjs +18 -0
  190. package/dist/markdown/components/markdown-table.test.mjs.map +1 -0
  191. package/dist/markdown/contexts/markdown-table.cjs +13 -0
  192. package/dist/markdown/contexts/markdown-table.d.cts.map +1 -1
  193. package/dist/markdown/contexts/markdown-table.d.mts.map +1 -1
  194. package/dist/markdown/contexts/markdown-table.mjs +8 -1
  195. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  196. package/dist/markdown/contexts/markdown-table.test.cjs +16 -0
  197. package/dist/markdown/contexts/markdown-table.test.d.cts +1 -0
  198. package/dist/markdown/contexts/markdown-table.test.d.mts +1 -0
  199. package/dist/markdown/contexts/markdown-table.test.mjs +18 -0
  200. package/dist/markdown/contexts/markdown-table.test.mjs.map +1 -0
  201. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +78 -0
  202. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
  203. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
  204. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.cjs +1487 -0
  205. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs +1473 -0
  206. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs.map +1 -0
  207. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.cjs +889 -0
  208. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs +888 -0
  209. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -0
  210. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs +1614 -0
  211. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1594 -0
  212. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -0
  213. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.cjs +1 -0
  214. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.mjs +3 -0
  215. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.cjs +1 -0
  216. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.mjs +3 -0
  217. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.cjs +923 -0
  218. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs +922 -0
  219. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -0
  220. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.cjs +391 -0
  221. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs +386 -0
  222. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs.map +1 -0
  223. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.cjs +82 -0
  224. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +82 -0
  225. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -0
  226. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.cjs +1358 -0
  227. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs +1357 -0
  228. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs.map +1 -0
  229. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.cjs +561 -0
  230. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs +559 -0
  231. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs.map +1 -0
  232. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.cjs +37 -0
  233. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs +38 -0
  234. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs.map +1 -0
  235. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.cjs +197 -0
  236. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs +181 -0
  237. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -0
  238. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.cjs +29 -0
  239. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs +27 -0
  240. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs.map +1 -0
  241. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.cjs +77 -0
  242. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs +77 -0
  243. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -0
  244. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.cjs +374 -0
  245. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs +374 -0
  246. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -0
  247. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.cjs +38 -0
  248. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs +37 -0
  249. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs.map +1 -0
  250. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.cjs +2978 -0
  251. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs +2973 -0
  252. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs.map +1 -0
  253. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +939 -0
  254. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
  255. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
  256. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.cjs +87 -0
  257. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs +87 -0
  258. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs.map +1 -0
  259. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.cjs +6 -0
  260. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +6 -0
  261. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -0
  262. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.cjs +54 -0
  263. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +52 -0
  264. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -0
  265. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs +2696 -0
  266. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +2697 -0
  267. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -0
  268. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.cjs +47 -0
  269. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +45 -0
  270. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -0
  271. package/dist/render.d.cts.map +1 -1
  272. package/dist/render.d.mts.map +1 -1
  273. package/dist/render.mjs.map +1 -1
  274. package/dist/typescript/components/builtin-file.cjs +9 -1
  275. package/dist/typescript/components/builtin-file.mjs +3 -1
  276. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  277. package/dist/typescript/components/builtin-file.test.cjs +16 -0
  278. package/dist/typescript/components/builtin-file.test.d.cts +1 -0
  279. package/dist/typescript/components/builtin-file.test.d.mts +1 -0
  280. package/dist/typescript/components/builtin-file.test.mjs +18 -0
  281. package/dist/typescript/components/builtin-file.test.mjs.map +1 -0
  282. package/dist/typescript/components/class-declaration.cjs +16 -1
  283. package/dist/typescript/components/class-declaration.mjs +10 -1
  284. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  285. package/dist/typescript/components/class-declaration.test.cjs +16 -0
  286. package/dist/typescript/components/class-declaration.test.d.cts +1 -0
  287. package/dist/typescript/components/class-declaration.test.d.mts +1 -0
  288. package/dist/typescript/components/class-declaration.test.mjs +18 -0
  289. package/dist/typescript/components/class-declaration.test.mjs.map +1 -0
  290. package/dist/typescript/components/dynamic-import-statement.cjs +9 -1
  291. package/dist/typescript/components/dynamic-import-statement.mjs +3 -1
  292. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  293. package/dist/typescript/components/dynamic-import-statement.test.cjs +16 -0
  294. package/dist/typescript/components/dynamic-import-statement.test.d.cts +1 -0
  295. package/dist/typescript/components/dynamic-import-statement.test.d.mts +1 -0
  296. package/dist/typescript/components/dynamic-import-statement.test.mjs +18 -0
  297. package/dist/typescript/components/dynamic-import-statement.test.mjs.map +1 -0
  298. package/dist/typescript/components/entry-file.cjs +8 -1
  299. package/dist/typescript/components/entry-file.mjs +3 -1
  300. package/dist/typescript/components/entry-file.mjs.map +1 -1
  301. package/dist/typescript/components/entry-file.test.cjs +16 -0
  302. package/dist/typescript/components/entry-file.test.d.cts +1 -0
  303. package/dist/typescript/components/entry-file.test.d.mts +1 -0
  304. package/dist/typescript/components/entry-file.test.mjs +18 -0
  305. package/dist/typescript/components/entry-file.test.mjs.map +1 -0
  306. package/dist/typescript/components/interface-declaration.cjs +14 -1
  307. package/dist/typescript/components/interface-declaration.mjs +8 -1
  308. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  309. package/dist/typescript/components/interface-declaration.test.cjs +16 -0
  310. package/dist/typescript/components/interface-declaration.test.d.cts +1 -0
  311. package/dist/typescript/components/interface-declaration.test.d.mts +1 -0
  312. package/dist/typescript/components/interface-declaration.test.mjs +18 -0
  313. package/dist/typescript/components/interface-declaration.test.mjs.map +1 -0
  314. package/dist/typescript/components/object-declaration.cjs +12 -1
  315. package/dist/typescript/components/object-declaration.mjs +6 -1
  316. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  317. package/dist/typescript/components/object-declaration.test.cjs +16 -0
  318. package/dist/typescript/components/object-declaration.test.d.cts +1 -0
  319. package/dist/typescript/components/object-declaration.test.d.mts +1 -0
  320. package/dist/typescript/components/object-declaration.test.mjs +18 -0
  321. package/dist/typescript/components/object-declaration.test.mjs.map +1 -0
  322. package/dist/typescript/components/property-name.cjs +9 -1
  323. package/dist/typescript/components/property-name.mjs +3 -1
  324. package/dist/typescript/components/property-name.mjs.map +1 -1
  325. package/dist/typescript/components/property-name.test.cjs +16 -0
  326. package/dist/typescript/components/property-name.test.d.cts +1 -0
  327. package/dist/typescript/components/property-name.test.d.mts +1 -0
  328. package/dist/typescript/components/property-name.test.mjs +18 -0
  329. package/dist/typescript/components/property-name.test.mjs.map +1 -0
  330. package/dist/typescript/components/record-expression.cjs +9 -1
  331. package/dist/typescript/components/record-expression.d.cts.map +1 -1
  332. package/dist/typescript/components/record-expression.d.mts.map +1 -1
  333. package/dist/typescript/components/record-expression.mjs +3 -1
  334. package/dist/typescript/components/record-expression.mjs.map +1 -1
  335. package/dist/typescript/components/record-expression.test.cjs +16 -0
  336. package/dist/typescript/components/record-expression.test.d.cts +1 -0
  337. package/dist/typescript/components/record-expression.test.d.mts +1 -0
  338. package/dist/typescript/components/record-expression.test.mjs +18 -0
  339. package/dist/typescript/components/record-expression.test.mjs.map +1 -0
  340. package/dist/typescript/components/tsdoc-schema.cjs +12 -1
  341. package/dist/typescript/components/tsdoc-schema.mjs +6 -1
  342. package/dist/typescript/components/tsdoc-schema.mjs.map +1 -1
  343. package/dist/typescript/components/tsdoc-schema.test.cjs +16 -0
  344. package/dist/typescript/components/tsdoc-schema.test.d.cts +1 -0
  345. package/dist/typescript/components/tsdoc-schema.test.d.mts +1 -0
  346. package/dist/typescript/components/tsdoc-schema.test.mjs +18 -0
  347. package/dist/typescript/components/tsdoc-schema.test.mjs.map +1 -0
  348. package/dist/typescript/components/tsdoc.cjs +32 -1
  349. package/dist/typescript/components/tsdoc.d.cts.map +1 -1
  350. package/dist/typescript/components/tsdoc.d.mts.map +1 -1
  351. package/dist/typescript/components/tsdoc.mjs +26 -1
  352. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  353. package/dist/typescript/components/tsdoc.test.cjs +16 -0
  354. package/dist/typescript/components/tsdoc.test.d.cts +1 -0
  355. package/dist/typescript/components/tsdoc.test.d.mts +1 -0
  356. package/dist/typescript/components/tsdoc.test.mjs +18 -0
  357. package/dist/typescript/components/tsdoc.test.mjs.map +1 -0
  358. package/dist/typescript/components/type-declaration.cjs +9 -1
  359. package/dist/typescript/components/type-declaration.mjs +3 -1
  360. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  361. package/dist/typescript/components/type-declaration.test.cjs +16 -0
  362. package/dist/typescript/components/type-declaration.test.d.cts +1 -0
  363. package/dist/typescript/components/type-declaration.test.d.mts +1 -0
  364. package/dist/typescript/components/type-declaration.test.mjs +18 -0
  365. package/dist/typescript/components/type-declaration.test.mjs.map +1 -0
  366. package/dist/typescript/components/type-parameters.cjs +9 -1
  367. package/dist/typescript/components/type-parameters.mjs +3 -1
  368. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  369. package/dist/typescript/components/type-parameters.test.cjs +16 -0
  370. package/dist/typescript/components/type-parameters.test.d.cts +1 -0
  371. package/dist/typescript/components/type-parameters.test.d.mts +1 -0
  372. package/dist/typescript/components/type-parameters.test.mjs +18 -0
  373. package/dist/typescript/components/type-parameters.test.mjs.map +1 -0
  374. package/dist/typescript/components/typescript-file.cjs +13 -1
  375. package/dist/typescript/components/typescript-file.mjs +7 -1
  376. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  377. package/dist/typescript/components/typescript-file.test.cjs +16 -0
  378. package/dist/typescript/components/typescript-file.test.d.cts +1 -0
  379. package/dist/typescript/components/typescript-file.test.d.mts +1 -0
  380. package/dist/typescript/components/typescript-file.test.mjs +18 -0
  381. package/dist/typescript/components/typescript-file.test.mjs.map +1 -0
  382. package/dist/typescript/contexts/lexical-scope.cjs +9 -1
  383. package/dist/typescript/contexts/lexical-scope.mjs +3 -1
  384. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  385. package/dist/typescript/contexts/lexical-scope.test.cjs +16 -0
  386. package/dist/typescript/contexts/lexical-scope.test.d.cts +1 -0
  387. package/dist/typescript/contexts/lexical-scope.test.d.mts +1 -0
  388. package/dist/typescript/contexts/lexical-scope.test.mjs +18 -0
  389. package/dist/typescript/contexts/lexical-scope.test.mjs.map +1 -0
  390. package/dist/typescript/contexts/member-scope.cjs +9 -1
  391. package/dist/typescript/contexts/member-scope.mjs +3 -1
  392. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  393. package/dist/typescript/contexts/member-scope.test.cjs +16 -0
  394. package/dist/typescript/contexts/member-scope.test.d.cts +1 -0
  395. package/dist/typescript/contexts/member-scope.test.d.mts +1 -0
  396. package/dist/typescript/contexts/member-scope.test.mjs +18 -0
  397. package/dist/typescript/contexts/member-scope.test.mjs.map +1 -0
  398. package/dist/typescript/helpers/get-call-signature-props.cjs +9 -1
  399. package/dist/typescript/helpers/get-call-signature-props.mjs +3 -1
  400. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  401. package/dist/typescript/helpers/get-call-signature-props.test.cjs +16 -0
  402. package/dist/typescript/helpers/get-call-signature-props.test.d.cts +1 -0
  403. package/dist/typescript/helpers/get-call-signature-props.test.d.mts +1 -0
  404. package/dist/typescript/helpers/get-call-signature-props.test.mjs +18 -0
  405. package/dist/typescript/helpers/get-call-signature-props.test.mjs.map +1 -0
  406. package/dist/typescript/helpers/utilities.cjs +9 -1
  407. package/dist/typescript/helpers/utilities.mjs +4 -1
  408. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  409. package/dist/typescript/helpers/utilities.test.cjs +16 -0
  410. package/dist/typescript/helpers/utilities.test.d.cts +1 -0
  411. package/dist/typescript/helpers/utilities.test.d.mts +1 -0
  412. package/dist/typescript/helpers/utilities.test.mjs +18 -0
  413. package/dist/typescript/helpers/utilities.test.mjs.map +1 -0
  414. package/dist/yaml/components/yaml-file.cjs +12 -1
  415. package/dist/yaml/components/yaml-file.mjs +6 -1
  416. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  417. package/dist/yaml/components/yaml-file.test.cjs +16 -0
  418. package/dist/yaml/components/yaml-file.test.d.cts +1 -0
  419. package/dist/yaml/components/yaml-file.test.d.mts +1 -0
  420. package/dist/yaml/components/yaml-file.test.mjs +18 -0
  421. package/dist/yaml/components/yaml-file.test.mjs.map +1 -0
  422. package/package.json +590 -17
@@ -0,0 +1,939 @@
1
+ const require_sourcemap_codec = require('../../../../@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs');
2
+
3
+ //#region ../../../node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
4
+ var BitSet = class BitSet {
5
+ constructor(arg) {
6
+ this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
7
+ }
8
+ add(n) {
9
+ this.bits[n >> 5] |= 1 << (n & 31);
10
+ }
11
+ has(n) {
12
+ return !!(this.bits[n >> 5] & 1 << (n & 31));
13
+ }
14
+ };
15
+ var Chunk = class Chunk {
16
+ constructor(start, end, content) {
17
+ this.start = start;
18
+ this.end = end;
19
+ this.original = content;
20
+ this.intro = "";
21
+ this.outro = "";
22
+ this.content = content;
23
+ this.storeName = false;
24
+ this.edited = false;
25
+ this.previous = null;
26
+ this.next = null;
27
+ }
28
+ appendLeft(content) {
29
+ this.outro += content;
30
+ }
31
+ appendRight(content) {
32
+ this.intro = this.intro + content;
33
+ }
34
+ clone() {
35
+ const chunk = new Chunk(this.start, this.end, this.original);
36
+ chunk.intro = this.intro;
37
+ chunk.outro = this.outro;
38
+ chunk.content = this.content;
39
+ chunk.storeName = this.storeName;
40
+ chunk.edited = this.edited;
41
+ return chunk;
42
+ }
43
+ contains(index) {
44
+ return this.start < index && index < this.end;
45
+ }
46
+ eachNext(fn) {
47
+ let chunk = this;
48
+ while (chunk) {
49
+ fn(chunk);
50
+ chunk = chunk.next;
51
+ }
52
+ }
53
+ eachPrevious(fn) {
54
+ let chunk = this;
55
+ while (chunk) {
56
+ fn(chunk);
57
+ chunk = chunk.previous;
58
+ }
59
+ }
60
+ edit(content, storeName, contentOnly) {
61
+ this.content = content;
62
+ if (!contentOnly) {
63
+ this.intro = "";
64
+ this.outro = "";
65
+ }
66
+ this.storeName = storeName;
67
+ this.edited = true;
68
+ return this;
69
+ }
70
+ prependLeft(content) {
71
+ this.outro = content + this.outro;
72
+ }
73
+ prependRight(content) {
74
+ this.intro = content + this.intro;
75
+ }
76
+ reset() {
77
+ this.intro = "";
78
+ this.outro = "";
79
+ if (this.edited) {
80
+ this.content = this.original;
81
+ this.storeName = false;
82
+ this.edited = false;
83
+ }
84
+ }
85
+ split(index) {
86
+ const sliceIndex = index - this.start;
87
+ const originalBefore = this.original.slice(0, sliceIndex);
88
+ const originalAfter = this.original.slice(sliceIndex);
89
+ this.original = originalBefore;
90
+ const newChunk = new Chunk(index, this.end, originalAfter);
91
+ newChunk.outro = this.outro;
92
+ this.outro = "";
93
+ this.end = index;
94
+ if (this.edited) {
95
+ newChunk.edit("", false);
96
+ this.content = "";
97
+ } else this.content = originalBefore;
98
+ newChunk.next = this.next;
99
+ if (newChunk.next) newChunk.next.previous = newChunk;
100
+ newChunk.previous = this;
101
+ this.next = newChunk;
102
+ return newChunk;
103
+ }
104
+ toString() {
105
+ return this.intro + this.content + this.outro;
106
+ }
107
+ trimEnd(rx) {
108
+ this.outro = this.outro.replace(rx, "");
109
+ if (this.outro.length) return true;
110
+ const trimmed = this.content.replace(rx, "");
111
+ if (trimmed.length) {
112
+ if (trimmed !== this.content) {
113
+ this.split(this.start + trimmed.length).edit("", void 0, true);
114
+ if (this.edited) this.edit(trimmed, this.storeName, true);
115
+ }
116
+ return true;
117
+ } else {
118
+ this.edit("", void 0, true);
119
+ this.intro = this.intro.replace(rx, "");
120
+ if (this.intro.length) return true;
121
+ }
122
+ }
123
+ trimStart(rx) {
124
+ this.intro = this.intro.replace(rx, "");
125
+ if (this.intro.length) return true;
126
+ const trimmed = this.content.replace(rx, "");
127
+ if (trimmed.length) {
128
+ if (trimmed !== this.content) {
129
+ const newChunk = this.split(this.end - trimmed.length);
130
+ if (this.edited) newChunk.edit(trimmed, this.storeName, true);
131
+ this.edit("", void 0, true);
132
+ }
133
+ return true;
134
+ } else {
135
+ this.edit("", void 0, true);
136
+ this.outro = this.outro.replace(rx, "");
137
+ if (this.outro.length) return true;
138
+ }
139
+ }
140
+ };
141
+ function getBtoa() {
142
+ if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
143
+ else if (typeof Buffer === "function") return (str) => Buffer.from(str, "utf-8").toString("base64");
144
+ else return () => {
145
+ throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
146
+ };
147
+ }
148
+ const btoa = /*#__PURE__*/ getBtoa();
149
+ var SourceMap = class {
150
+ constructor(properties) {
151
+ this.version = 3;
152
+ this.file = properties.file;
153
+ this.sources = properties.sources;
154
+ this.sourcesContent = properties.sourcesContent;
155
+ this.names = properties.names;
156
+ this.mappings = require_sourcemap_codec.encode(properties.mappings);
157
+ if (typeof properties.x_google_ignoreList !== "undefined") this.x_google_ignoreList = properties.x_google_ignoreList;
158
+ if (typeof properties.debugId !== "undefined") this.debugId = properties.debugId;
159
+ }
160
+ toString() {
161
+ return JSON.stringify(this);
162
+ }
163
+ toUrl() {
164
+ return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
165
+ }
166
+ };
167
+ function guessIndent(code) {
168
+ const lines = code.split("\n");
169
+ const tabbed = lines.filter((line) => /^\t+/.test(line));
170
+ const spaced = lines.filter((line) => /^ {2,}/.test(line));
171
+ if (tabbed.length === 0 && spaced.length === 0) return null;
172
+ if (tabbed.length >= spaced.length) return " ";
173
+ const min = spaced.reduce((previous, current) => {
174
+ const numSpaces = /^ +/.exec(current)[0].length;
175
+ return Math.min(numSpaces, previous);
176
+ }, Infinity);
177
+ return new Array(min + 1).join(" ");
178
+ }
179
+ function getRelativePath(from, to) {
180
+ const fromParts = from.split(/[/\\]/);
181
+ const toParts = to.split(/[/\\]/);
182
+ fromParts.pop();
183
+ while (fromParts[0] === toParts[0]) {
184
+ fromParts.shift();
185
+ toParts.shift();
186
+ }
187
+ if (fromParts.length) {
188
+ let i = fromParts.length;
189
+ while (i--) fromParts[i] = "..";
190
+ }
191
+ return fromParts.concat(toParts).join("/");
192
+ }
193
+ const toString = Object.prototype.toString;
194
+ function isObject(thing) {
195
+ return toString.call(thing) === "[object Object]";
196
+ }
197
+ function getLocator(source) {
198
+ const originalLines = source.split("\n");
199
+ const lineOffsets = [];
200
+ for (let i = 0, pos = 0; i < originalLines.length; i++) {
201
+ lineOffsets.push(pos);
202
+ pos += originalLines[i].length + 1;
203
+ }
204
+ return function locate(index) {
205
+ let i = 0;
206
+ let j = lineOffsets.length;
207
+ while (i < j) {
208
+ const m = i + j >> 1;
209
+ if (index < lineOffsets[m]) j = m;
210
+ else i = m + 1;
211
+ }
212
+ const line = i - 1;
213
+ return {
214
+ line,
215
+ column: index - lineOffsets[line]
216
+ };
217
+ };
218
+ }
219
+ const wordRegex = /\w/;
220
+ var Mappings = class {
221
+ constructor(hires) {
222
+ this.hires = hires;
223
+ this.generatedCodeLine = 0;
224
+ this.generatedCodeColumn = 0;
225
+ this.raw = [];
226
+ this.rawSegments = this.raw[this.generatedCodeLine] = [];
227
+ this.pending = null;
228
+ }
229
+ addEdit(sourceIndex, content, loc, nameIndex) {
230
+ if (content.length) {
231
+ const contentLengthMinusOne = content.length - 1;
232
+ let contentLineEnd = content.indexOf("\n", 0);
233
+ let previousContentLineEnd = -1;
234
+ while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
235
+ const segment = [
236
+ this.generatedCodeColumn,
237
+ sourceIndex,
238
+ loc.line,
239
+ loc.column
240
+ ];
241
+ if (nameIndex >= 0) segment.push(nameIndex);
242
+ this.rawSegments.push(segment);
243
+ this.generatedCodeLine += 1;
244
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
245
+ this.generatedCodeColumn = 0;
246
+ previousContentLineEnd = contentLineEnd;
247
+ contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
248
+ }
249
+ const segment = [
250
+ this.generatedCodeColumn,
251
+ sourceIndex,
252
+ loc.line,
253
+ loc.column
254
+ ];
255
+ if (nameIndex >= 0) segment.push(nameIndex);
256
+ this.rawSegments.push(segment);
257
+ this.advance(content.slice(previousContentLineEnd + 1));
258
+ } else if (this.pending) {
259
+ this.rawSegments.push(this.pending);
260
+ this.advance(content);
261
+ }
262
+ this.pending = null;
263
+ }
264
+ addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
265
+ let originalCharIndex = chunk.start;
266
+ let first = true;
267
+ let charInHiresBoundary = false;
268
+ while (originalCharIndex < chunk.end) {
269
+ if (original[originalCharIndex] === "\n") {
270
+ loc.line += 1;
271
+ loc.column = 0;
272
+ this.generatedCodeLine += 1;
273
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
274
+ this.generatedCodeColumn = 0;
275
+ first = true;
276
+ charInHiresBoundary = false;
277
+ } else {
278
+ if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
279
+ const segment = [
280
+ this.generatedCodeColumn,
281
+ sourceIndex,
282
+ loc.line,
283
+ loc.column
284
+ ];
285
+ if (this.hires === "boundary") if (wordRegex.test(original[originalCharIndex])) {
286
+ if (!charInHiresBoundary) {
287
+ this.rawSegments.push(segment);
288
+ charInHiresBoundary = true;
289
+ }
290
+ } else {
291
+ this.rawSegments.push(segment);
292
+ charInHiresBoundary = false;
293
+ }
294
+ else this.rawSegments.push(segment);
295
+ }
296
+ loc.column += 1;
297
+ this.generatedCodeColumn += 1;
298
+ first = false;
299
+ }
300
+ originalCharIndex += 1;
301
+ }
302
+ this.pending = null;
303
+ }
304
+ advance(str) {
305
+ if (!str) return;
306
+ const lines = str.split("\n");
307
+ if (lines.length > 1) {
308
+ for (let i = 0; i < lines.length - 1; i++) {
309
+ this.generatedCodeLine++;
310
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
311
+ }
312
+ this.generatedCodeColumn = 0;
313
+ }
314
+ this.generatedCodeColumn += lines[lines.length - 1].length;
315
+ }
316
+ };
317
+ const n = "\n";
318
+ const warned = {
319
+ insertLeft: false,
320
+ insertRight: false,
321
+ storeName: false
322
+ };
323
+ var MagicString = class MagicString {
324
+ constructor(string, options = {}) {
325
+ const chunk = new Chunk(0, string.length, string);
326
+ Object.defineProperties(this, {
327
+ original: {
328
+ writable: true,
329
+ value: string
330
+ },
331
+ outro: {
332
+ writable: true,
333
+ value: ""
334
+ },
335
+ intro: {
336
+ writable: true,
337
+ value: ""
338
+ },
339
+ firstChunk: {
340
+ writable: true,
341
+ value: chunk
342
+ },
343
+ lastChunk: {
344
+ writable: true,
345
+ value: chunk
346
+ },
347
+ lastSearchedChunk: {
348
+ writable: true,
349
+ value: chunk
350
+ },
351
+ byStart: {
352
+ writable: true,
353
+ value: {}
354
+ },
355
+ byEnd: {
356
+ writable: true,
357
+ value: {}
358
+ },
359
+ filename: {
360
+ writable: true,
361
+ value: options.filename
362
+ },
363
+ indentExclusionRanges: {
364
+ writable: true,
365
+ value: options.indentExclusionRanges
366
+ },
367
+ sourcemapLocations: {
368
+ writable: true,
369
+ value: new BitSet()
370
+ },
371
+ storedNames: {
372
+ writable: true,
373
+ value: {}
374
+ },
375
+ indentStr: {
376
+ writable: true,
377
+ value: void 0
378
+ },
379
+ ignoreList: {
380
+ writable: true,
381
+ value: options.ignoreList
382
+ },
383
+ offset: {
384
+ writable: true,
385
+ value: options.offset || 0
386
+ }
387
+ });
388
+ this.byStart[0] = chunk;
389
+ this.byEnd[string.length] = chunk;
390
+ }
391
+ addSourcemapLocation(char) {
392
+ this.sourcemapLocations.add(char);
393
+ }
394
+ append(content) {
395
+ if (typeof content !== "string") throw new TypeError("outro content must be a string");
396
+ this.outro += content;
397
+ return this;
398
+ }
399
+ appendLeft(index, content) {
400
+ index = index + this.offset;
401
+ if (typeof content !== "string") throw new TypeError("inserted content must be a string");
402
+ this._split(index);
403
+ const chunk = this.byEnd[index];
404
+ if (chunk) chunk.appendLeft(content);
405
+ else this.intro += content;
406
+ return this;
407
+ }
408
+ appendRight(index, content) {
409
+ index = index + this.offset;
410
+ if (typeof content !== "string") throw new TypeError("inserted content must be a string");
411
+ this._split(index);
412
+ const chunk = this.byStart[index];
413
+ if (chunk) chunk.appendRight(content);
414
+ else this.outro += content;
415
+ return this;
416
+ }
417
+ clone() {
418
+ const cloned = new MagicString(this.original, {
419
+ filename: this.filename,
420
+ offset: this.offset
421
+ });
422
+ let originalChunk = this.firstChunk;
423
+ let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
424
+ while (originalChunk) {
425
+ cloned.byStart[clonedChunk.start] = clonedChunk;
426
+ cloned.byEnd[clonedChunk.end] = clonedChunk;
427
+ const nextOriginalChunk = originalChunk.next;
428
+ const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
429
+ if (nextClonedChunk) {
430
+ clonedChunk.next = nextClonedChunk;
431
+ nextClonedChunk.previous = clonedChunk;
432
+ clonedChunk = nextClonedChunk;
433
+ }
434
+ originalChunk = nextOriginalChunk;
435
+ }
436
+ cloned.lastChunk = clonedChunk;
437
+ if (this.indentExclusionRanges) cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
438
+ cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
439
+ cloned.intro = this.intro;
440
+ cloned.outro = this.outro;
441
+ return cloned;
442
+ }
443
+ generateDecodedMap(options) {
444
+ options = options || {};
445
+ const sourceIndex = 0;
446
+ const names = Object.keys(this.storedNames);
447
+ const mappings = new Mappings(options.hires);
448
+ const locate = getLocator(this.original);
449
+ if (this.intro) mappings.advance(this.intro);
450
+ this.firstChunk.eachNext((chunk) => {
451
+ const loc = locate(chunk.start);
452
+ if (chunk.intro.length) mappings.advance(chunk.intro);
453
+ if (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);
454
+ else mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
455
+ if (chunk.outro.length) mappings.advance(chunk.outro);
456
+ });
457
+ if (this.outro) mappings.advance(this.outro);
458
+ return {
459
+ file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
460
+ sources: [options.source ? getRelativePath(options.file || "", options.source) : options.file || ""],
461
+ sourcesContent: options.includeContent ? [this.original] : void 0,
462
+ names,
463
+ mappings: mappings.raw,
464
+ x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
465
+ };
466
+ }
467
+ generateMap(options) {
468
+ return new SourceMap(this.generateDecodedMap(options));
469
+ }
470
+ _ensureindentStr() {
471
+ if (this.indentStr === void 0) this.indentStr = guessIndent(this.original);
472
+ }
473
+ _getRawIndentString() {
474
+ this._ensureindentStr();
475
+ return this.indentStr;
476
+ }
477
+ getIndentString() {
478
+ this._ensureindentStr();
479
+ return this.indentStr === null ? " " : this.indentStr;
480
+ }
481
+ indent(indentStr, options) {
482
+ const pattern = /^[^\r\n]/gm;
483
+ if (isObject(indentStr)) {
484
+ options = indentStr;
485
+ indentStr = void 0;
486
+ }
487
+ if (indentStr === void 0) {
488
+ this._ensureindentStr();
489
+ indentStr = this.indentStr || " ";
490
+ }
491
+ if (indentStr === "") return this;
492
+ options = options || {};
493
+ const isExcluded = {};
494
+ if (options.exclude) (typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude).forEach((exclusion) => {
495
+ for (let i = exclusion[0]; i < exclusion[1]; i += 1) isExcluded[i] = true;
496
+ });
497
+ let shouldIndentNextCharacter = options.indentStart !== false;
498
+ const replacer = (match) => {
499
+ if (shouldIndentNextCharacter) return `${indentStr}${match}`;
500
+ shouldIndentNextCharacter = true;
501
+ return match;
502
+ };
503
+ this.intro = this.intro.replace(pattern, replacer);
504
+ let charIndex = 0;
505
+ let chunk = this.firstChunk;
506
+ while (chunk) {
507
+ const end = chunk.end;
508
+ if (chunk.edited) {
509
+ if (!isExcluded[charIndex]) {
510
+ chunk.content = chunk.content.replace(pattern, replacer);
511
+ if (chunk.content.length) shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
512
+ }
513
+ } else {
514
+ charIndex = chunk.start;
515
+ while (charIndex < end) {
516
+ if (!isExcluded[charIndex]) {
517
+ const char = this.original[charIndex];
518
+ if (char === "\n") shouldIndentNextCharacter = true;
519
+ else if (char !== "\r" && shouldIndentNextCharacter) {
520
+ shouldIndentNextCharacter = false;
521
+ if (charIndex === chunk.start) chunk.prependRight(indentStr);
522
+ else {
523
+ this._splitChunk(chunk, charIndex);
524
+ chunk = chunk.next;
525
+ chunk.prependRight(indentStr);
526
+ }
527
+ }
528
+ }
529
+ charIndex += 1;
530
+ }
531
+ }
532
+ charIndex = chunk.end;
533
+ chunk = chunk.next;
534
+ }
535
+ this.outro = this.outro.replace(pattern, replacer);
536
+ return this;
537
+ }
538
+ insert() {
539
+ throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)");
540
+ }
541
+ insertLeft(index, content) {
542
+ if (!warned.insertLeft) {
543
+ console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");
544
+ warned.insertLeft = true;
545
+ }
546
+ return this.appendLeft(index, content);
547
+ }
548
+ insertRight(index, content) {
549
+ if (!warned.insertRight) {
550
+ console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");
551
+ warned.insertRight = true;
552
+ }
553
+ return this.prependRight(index, content);
554
+ }
555
+ move(start, end, index) {
556
+ start = start + this.offset;
557
+ end = end + this.offset;
558
+ index = index + this.offset;
559
+ if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
560
+ this._split(start);
561
+ this._split(end);
562
+ this._split(index);
563
+ const first = this.byStart[start];
564
+ const last = this.byEnd[end];
565
+ const oldLeft = first.previous;
566
+ const oldRight = last.next;
567
+ const newRight = this.byStart[index];
568
+ if (!newRight && last === this.lastChunk) return this;
569
+ const newLeft = newRight ? newRight.previous : this.lastChunk;
570
+ if (oldLeft) oldLeft.next = oldRight;
571
+ if (oldRight) oldRight.previous = oldLeft;
572
+ if (newLeft) newLeft.next = first;
573
+ if (newRight) newRight.previous = last;
574
+ if (!first.previous) this.firstChunk = last.next;
575
+ if (!last.next) {
576
+ this.lastChunk = first.previous;
577
+ this.lastChunk.next = null;
578
+ }
579
+ first.previous = newLeft;
580
+ last.next = newRight || null;
581
+ if (!newLeft) this.firstChunk = first;
582
+ if (!newRight) this.lastChunk = last;
583
+ return this;
584
+ }
585
+ overwrite(start, end, content, options) {
586
+ options = options || {};
587
+ return this.update(start, end, content, {
588
+ ...options,
589
+ overwrite: !options.contentOnly
590
+ });
591
+ }
592
+ update(start, end, content, options) {
593
+ start = start + this.offset;
594
+ end = end + this.offset;
595
+ if (typeof content !== "string") throw new TypeError("replacement content must be a string");
596
+ if (this.original.length !== 0) {
597
+ while (start < 0) start += this.original.length;
598
+ while (end < 0) end += this.original.length;
599
+ }
600
+ if (end > this.original.length) throw new Error("end is out of bounds");
601
+ if (start === end) throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");
602
+ this._split(start);
603
+ this._split(end);
604
+ if (options === true) {
605
+ if (!warned.storeName) {
606
+ console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");
607
+ warned.storeName = true;
608
+ }
609
+ options = { storeName: true };
610
+ }
611
+ const storeName = options !== void 0 ? options.storeName : false;
612
+ const overwrite = options !== void 0 ? options.overwrite : false;
613
+ if (storeName) {
614
+ const original = this.original.slice(start, end);
615
+ Object.defineProperty(this.storedNames, original, {
616
+ writable: true,
617
+ value: true,
618
+ enumerable: true
619
+ });
620
+ }
621
+ const first = this.byStart[start];
622
+ const last = this.byEnd[end];
623
+ if (first) {
624
+ let chunk = first;
625
+ while (chunk !== last) {
626
+ if (chunk.next !== this.byStart[chunk.end]) throw new Error("Cannot overwrite across a split point");
627
+ chunk = chunk.next;
628
+ chunk.edit("", false);
629
+ }
630
+ first.edit(content, storeName, !overwrite);
631
+ } else {
632
+ const newChunk = new Chunk(start, end, "").edit(content, storeName);
633
+ last.next = newChunk;
634
+ newChunk.previous = last;
635
+ }
636
+ return this;
637
+ }
638
+ prepend(content) {
639
+ if (typeof content !== "string") throw new TypeError("outro content must be a string");
640
+ this.intro = content + this.intro;
641
+ return this;
642
+ }
643
+ prependLeft(index, content) {
644
+ index = index + this.offset;
645
+ if (typeof content !== "string") throw new TypeError("inserted content must be a string");
646
+ this._split(index);
647
+ const chunk = this.byEnd[index];
648
+ if (chunk) chunk.prependLeft(content);
649
+ else this.intro = content + this.intro;
650
+ return this;
651
+ }
652
+ prependRight(index, content) {
653
+ index = index + this.offset;
654
+ if (typeof content !== "string") throw new TypeError("inserted content must be a string");
655
+ this._split(index);
656
+ const chunk = this.byStart[index];
657
+ if (chunk) chunk.prependRight(content);
658
+ else this.outro = content + this.outro;
659
+ return this;
660
+ }
661
+ remove(start, end) {
662
+ start = start + this.offset;
663
+ end = end + this.offset;
664
+ if (this.original.length !== 0) {
665
+ while (start < 0) start += this.original.length;
666
+ while (end < 0) end += this.original.length;
667
+ }
668
+ if (start === end) return this;
669
+ if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
670
+ if (start > end) throw new Error("end must be greater than start");
671
+ this._split(start);
672
+ this._split(end);
673
+ let chunk = this.byStart[start];
674
+ while (chunk) {
675
+ chunk.intro = "";
676
+ chunk.outro = "";
677
+ chunk.edit("");
678
+ chunk = end > chunk.end ? this.byStart[chunk.end] : null;
679
+ }
680
+ return this;
681
+ }
682
+ reset(start, end) {
683
+ start = start + this.offset;
684
+ end = end + this.offset;
685
+ if (this.original.length !== 0) {
686
+ while (start < 0) start += this.original.length;
687
+ while (end < 0) end += this.original.length;
688
+ }
689
+ if (start === end) return this;
690
+ if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
691
+ if (start > end) throw new Error("end must be greater than start");
692
+ this._split(start);
693
+ this._split(end);
694
+ let chunk = this.byStart[start];
695
+ while (chunk) {
696
+ chunk.reset();
697
+ chunk = end > chunk.end ? this.byStart[chunk.end] : null;
698
+ }
699
+ return this;
700
+ }
701
+ lastChar() {
702
+ if (this.outro.length) return this.outro[this.outro.length - 1];
703
+ let chunk = this.lastChunk;
704
+ do {
705
+ if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
706
+ if (chunk.content.length) return chunk.content[chunk.content.length - 1];
707
+ if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
708
+ } while (chunk = chunk.previous);
709
+ if (this.intro.length) return this.intro[this.intro.length - 1];
710
+ return "";
711
+ }
712
+ lastLine() {
713
+ let lineIndex = this.outro.lastIndexOf(n);
714
+ if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
715
+ let lineStr = this.outro;
716
+ let chunk = this.lastChunk;
717
+ do {
718
+ if (chunk.outro.length > 0) {
719
+ lineIndex = chunk.outro.lastIndexOf(n);
720
+ if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
721
+ lineStr = chunk.outro + lineStr;
722
+ }
723
+ if (chunk.content.length > 0) {
724
+ lineIndex = chunk.content.lastIndexOf(n);
725
+ if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
726
+ lineStr = chunk.content + lineStr;
727
+ }
728
+ if (chunk.intro.length > 0) {
729
+ lineIndex = chunk.intro.lastIndexOf(n);
730
+ if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
731
+ lineStr = chunk.intro + lineStr;
732
+ }
733
+ } while (chunk = chunk.previous);
734
+ lineIndex = this.intro.lastIndexOf(n);
735
+ if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
736
+ return this.intro + lineStr;
737
+ }
738
+ slice(start = 0, end = this.original.length - this.offset) {
739
+ start = start + this.offset;
740
+ end = end + this.offset;
741
+ if (this.original.length !== 0) {
742
+ while (start < 0) start += this.original.length;
743
+ while (end < 0) end += this.original.length;
744
+ }
745
+ let result = "";
746
+ let chunk = this.firstChunk;
747
+ while (chunk && (chunk.start > start || chunk.end <= start)) {
748
+ if (chunk.start < end && chunk.end >= end) return result;
749
+ chunk = chunk.next;
750
+ }
751
+ if (chunk && chunk.edited && chunk.start !== start) throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
752
+ const startChunk = chunk;
753
+ while (chunk) {
754
+ if (chunk.intro && (startChunk !== chunk || chunk.start === start)) result += chunk.intro;
755
+ const containsEnd = chunk.start < end && chunk.end >= end;
756
+ if (containsEnd && chunk.edited && chunk.end !== end) throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
757
+ const sliceStart = startChunk === chunk ? start - chunk.start : 0;
758
+ const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
759
+ result += chunk.content.slice(sliceStart, sliceEnd);
760
+ if (chunk.outro && (!containsEnd || chunk.end === end)) result += chunk.outro;
761
+ if (containsEnd) break;
762
+ chunk = chunk.next;
763
+ }
764
+ return result;
765
+ }
766
+ snip(start, end) {
767
+ const clone = this.clone();
768
+ clone.remove(0, start);
769
+ clone.remove(end, clone.original.length);
770
+ return clone;
771
+ }
772
+ _split(index) {
773
+ if (this.byStart[index] || this.byEnd[index]) return;
774
+ let chunk = this.lastSearchedChunk;
775
+ let previousChunk = chunk;
776
+ const searchForward = index > chunk.end;
777
+ while (chunk) {
778
+ if (chunk.contains(index)) return this._splitChunk(chunk, index);
779
+ chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
780
+ if (chunk === previousChunk) return;
781
+ previousChunk = chunk;
782
+ }
783
+ }
784
+ _splitChunk(chunk, index) {
785
+ if (chunk.edited && chunk.content.length) {
786
+ const loc = getLocator(this.original)(index);
787
+ throw new Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`);
788
+ }
789
+ const newChunk = chunk.split(index);
790
+ this.byEnd[index] = chunk;
791
+ this.byStart[index] = newChunk;
792
+ this.byEnd[newChunk.end] = newChunk;
793
+ if (chunk === this.lastChunk) this.lastChunk = newChunk;
794
+ this.lastSearchedChunk = chunk;
795
+ return true;
796
+ }
797
+ toString() {
798
+ let str = this.intro;
799
+ let chunk = this.firstChunk;
800
+ while (chunk) {
801
+ str += chunk.toString();
802
+ chunk = chunk.next;
803
+ }
804
+ return str + this.outro;
805
+ }
806
+ isEmpty() {
807
+ let chunk = this.firstChunk;
808
+ do
809
+ if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false;
810
+ while (chunk = chunk.next);
811
+ return true;
812
+ }
813
+ length() {
814
+ let chunk = this.firstChunk;
815
+ let length = 0;
816
+ do
817
+ length += chunk.intro.length + chunk.content.length + chunk.outro.length;
818
+ while (chunk = chunk.next);
819
+ return length;
820
+ }
821
+ trimLines() {
822
+ return this.trim("[\\r\\n]");
823
+ }
824
+ trim(charType) {
825
+ return this.trimStart(charType).trimEnd(charType);
826
+ }
827
+ trimEndAborted(charType) {
828
+ const rx = new RegExp((charType || "\\s") + "+$");
829
+ this.outro = this.outro.replace(rx, "");
830
+ if (this.outro.length) return true;
831
+ let chunk = this.lastChunk;
832
+ do {
833
+ const end = chunk.end;
834
+ const aborted = chunk.trimEnd(rx);
835
+ if (chunk.end !== end) {
836
+ if (this.lastChunk === chunk) this.lastChunk = chunk.next;
837
+ this.byEnd[chunk.end] = chunk;
838
+ this.byStart[chunk.next.start] = chunk.next;
839
+ this.byEnd[chunk.next.end] = chunk.next;
840
+ }
841
+ if (aborted) return true;
842
+ chunk = chunk.previous;
843
+ } while (chunk);
844
+ return false;
845
+ }
846
+ trimEnd(charType) {
847
+ this.trimEndAborted(charType);
848
+ return this;
849
+ }
850
+ trimStartAborted(charType) {
851
+ const rx = new RegExp("^" + (charType || "\\s") + "+");
852
+ this.intro = this.intro.replace(rx, "");
853
+ if (this.intro.length) return true;
854
+ let chunk = this.firstChunk;
855
+ do {
856
+ const end = chunk.end;
857
+ const aborted = chunk.trimStart(rx);
858
+ if (chunk.end !== end) {
859
+ if (chunk === this.lastChunk) this.lastChunk = chunk.next;
860
+ this.byEnd[chunk.end] = chunk;
861
+ this.byStart[chunk.next.start] = chunk.next;
862
+ this.byEnd[chunk.next.end] = chunk.next;
863
+ }
864
+ if (aborted) return true;
865
+ chunk = chunk.next;
866
+ } while (chunk);
867
+ return false;
868
+ }
869
+ trimStart(charType) {
870
+ this.trimStartAborted(charType);
871
+ return this;
872
+ }
873
+ hasChanged() {
874
+ return this.original !== this.toString();
875
+ }
876
+ _replaceRegexp(searchValue, replacement) {
877
+ function getReplacement(match, str) {
878
+ if (typeof replacement === "string") return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
879
+ if (i === "$") return "$";
880
+ if (i === "&") return match[0];
881
+ if (+i < match.length) return match[+i];
882
+ return `$${i}`;
883
+ });
884
+ else return replacement(...match, match.index, str, match.groups);
885
+ }
886
+ function matchAll(re, str) {
887
+ let match;
888
+ const matches = [];
889
+ while (match = re.exec(str)) matches.push(match);
890
+ return matches;
891
+ }
892
+ if (searchValue.global) matchAll(searchValue, this.original).forEach((match) => {
893
+ if (match.index != null) {
894
+ const replacement = getReplacement(match, this.original);
895
+ if (replacement !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement);
896
+ }
897
+ });
898
+ else {
899
+ const match = this.original.match(searchValue);
900
+ if (match && match.index != null) {
901
+ const replacement = getReplacement(match, this.original);
902
+ if (replacement !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement);
903
+ }
904
+ }
905
+ return this;
906
+ }
907
+ _replaceString(string, replacement) {
908
+ const { original } = this;
909
+ const index = original.indexOf(string);
910
+ if (index !== -1) {
911
+ if (typeof replacement === "function") replacement = replacement(string, index, original);
912
+ if (string !== replacement) this.overwrite(index, index + string.length, replacement);
913
+ }
914
+ return this;
915
+ }
916
+ replace(searchValue, replacement) {
917
+ if (typeof searchValue === "string") return this._replaceString(searchValue, replacement);
918
+ return this._replaceRegexp(searchValue, replacement);
919
+ }
920
+ _replaceAllString(string, replacement) {
921
+ const { original } = this;
922
+ const stringLength = string.length;
923
+ for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
924
+ const previous = original.slice(index, index + stringLength);
925
+ let _replacement = replacement;
926
+ if (typeof replacement === "function") _replacement = replacement(previous, index, original);
927
+ if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
928
+ }
929
+ return this;
930
+ }
931
+ replaceAll(searchValue, replacement) {
932
+ if (typeof searchValue === "string") return this._replaceAllString(searchValue, replacement);
933
+ if (!searchValue.global) throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");
934
+ return this._replaceRegexp(searchValue, replacement);
935
+ }
936
+ };
937
+
938
+ //#endregion
939
+ exports.default = MagicString;