@cloudraker/reki 2.6.1

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 (762) hide show
  1. package/CHANGELOG.md +1892 -0
  2. package/README.md +525 -0
  3. package/ai/USAGE.md +201 -0
  4. package/ai/component-registry.json +6707 -0
  5. package/ai/component-registry.md +8346 -0
  6. package/ai/schemas.ts +955 -0
  7. package/bin/reki.js +36 -0
  8. package/dist/.build-complete +1 -0
  9. package/dist/ai/schemas.d.ts +2514 -0
  10. package/dist/ai/schemas.d.ts.map +1 -0
  11. package/dist/ai/schemas.js +3985 -0
  12. package/dist/ai/schemas.js.map +1 -0
  13. package/dist/blocks-source/delete-resource/delete-resource.tsx +213 -0
  14. package/dist/blocks-source/page-header/page-header.tsx +99 -0
  15. package/dist/blocks-source/resource-list/resource-list.test.tsx +28 -0
  16. package/dist/blocks-source/resource-list/resource-list.tsx +69 -0
  17. package/dist/catalog.js +229 -0
  18. package/dist/catalog.js.map +1 -0
  19. package/dist/chunks/SankeyChart-jwwpwps4npqzbrvn.js +890 -0
  20. package/dist/chunks/SankeyChart-jwwpwps4npqzbrvn.js.map +1 -0
  21. package/dist/chunks/autocomplete-f4vetako14h2aqsw.js +193 -0
  22. package/dist/chunks/autocomplete-f4vetako14h2aqsw.js.map +1 -0
  23. package/dist/chunks/badge-pc33c5ir7muabgfh.js +163 -0
  24. package/dist/chunks/badge-pc33c5ir7muabgfh.js.map +1 -0
  25. package/dist/chunks/banner-kis9h1yq636liunc.js +120 -0
  26. package/dist/chunks/banner-kis9h1yq636liunc.js.map +1 -0
  27. package/dist/chunks/bash-g5z23u7me5rx7bzt.js +15 -0
  28. package/dist/chunks/bash-g5z23u7me5rx7bzt.js.map +1 -0
  29. package/dist/chunks/breadcrumbs-d6149hyct4puz3x4.js +169 -0
  30. package/dist/chunks/breadcrumbs-d6149hyct4puz3x4.js.map +1 -0
  31. package/dist/chunks/button-nc5p1h28cwes0tjw.js +237 -0
  32. package/dist/chunks/button-nc5p1h28cwes0tjw.js.map +1 -0
  33. package/dist/chunks/checkbox-g2661n3eodgoispq.js +216 -0
  34. package/dist/chunks/checkbox-g2661n3eodgoispq.js.map +1 -0
  35. package/dist/chunks/clipboard-text-g3659lejx2d7i93e.js +191 -0
  36. package/dist/chunks/clipboard-text-g3659lejx2d7i93e.js.map +1 -0
  37. package/dist/chunks/cloudflare-logo-k0f07zztsda8m4ca.js +175 -0
  38. package/dist/chunks/cloudflare-logo-k0f07zztsda8m4ca.js.map +1 -0
  39. package/dist/chunks/cn-ct4n7r74mh8y0f48.js +26 -0
  40. package/dist/chunks/cn-ct4n7r74mh8y0f48.js.map +1 -0
  41. package/dist/chunks/code-fm5rpi47v6cj9o8o.js +61 -0
  42. package/dist/chunks/code-fm5rpi47v6cj9o8o.js.map +1 -0
  43. package/dist/chunks/collapsible-ndvmgo29s5iqfcor.js +76 -0
  44. package/dist/chunks/collapsible-ndvmgo29s5iqfcor.js.map +1 -0
  45. package/dist/chunks/combobox-i38w67netm8ukw4f.js +408 -0
  46. package/dist/chunks/combobox-i38w67netm8ukw4f.js.map +1 -0
  47. package/dist/chunks/command-palette-fe5cjfdgsg3t17vq.js +403 -0
  48. package/dist/chunks/command-palette-fe5cjfdgsg3t17vq.js.map +1 -0
  49. package/dist/chunks/core-oowp00biqxe3hvjc.js +5806 -0
  50. package/dist/chunks/core-oowp00biqxe3hvjc.js.map +1 -0
  51. package/dist/chunks/css-d1mi3wy1sl3fzekh.js +8 -0
  52. package/dist/chunks/css-d1mi3wy1sl3fzekh.js.map +1 -0
  53. package/dist/chunks/date-picker-81mc3zrsmobm3ydm.js +2921 -0
  54. package/dist/chunks/date-picker-81mc3zrsmobm3ydm.js.map +1 -0
  55. package/dist/chunks/date-range-picker-c8ttrfaos9mb1w5n.js +408 -0
  56. package/dist/chunks/date-range-picker-c8ttrfaos9mb1w5n.js.map +1 -0
  57. package/dist/chunks/dialog-m4go8xof25fospqo.js +134 -0
  58. package/dist/chunks/dialog-m4go8xof25fospqo.js.map +1 -0
  59. package/dist/chunks/diff-cpj1h9lg0bw716mj.js +8 -0
  60. package/dist/chunks/diff-cpj1h9lg0bw716mj.js.map +1 -0
  61. package/dist/chunks/dropdown-j5uht8mn4z7xc9fc.js +313 -0
  62. package/dist/chunks/dropdown-j5uht8mn4z7xc9fc.js.map +1 -0
  63. package/dist/chunks/empty-kazxr0248zjemw6n.js +94 -0
  64. package/dist/chunks/empty-kazxr0248zjemw6n.js.map +1 -0
  65. package/dist/chunks/engine-javascript-iqcmg6wi2pjun29k.js +2637 -0
  66. package/dist/chunks/engine-javascript-iqcmg6wi2pjun29k.js.map +1 -0
  67. package/dist/chunks/engine-oniguruma-g75h8oxao68cjmhg.js +295 -0
  68. package/dist/chunks/engine-oniguruma-g75h8oxao68cjmhg.js.map +1 -0
  69. package/dist/chunks/field-fe5m8z3vbpvtctbe.js +77 -0
  70. package/dist/chunks/field-fe5m8z3vbpvtctbe.js.map +1 -0
  71. package/dist/chunks/github-light-ulev8flhimfg79ob.js +6 -0
  72. package/dist/chunks/github-light-ulev8flhimfg79ob.js.map +1 -0
  73. package/dist/chunks/graphql-ft2h47erta7isqn4.js +16 -0
  74. package/dist/chunks/graphql-ft2h47erta7isqn4.js.map +1 -0
  75. package/dist/chunks/grid-enlbb88vucgeq1np.js +128 -0
  76. package/dist/chunks/grid-enlbb88vucgeq1np.js.map +1 -0
  77. package/dist/chunks/hcl-hcu7d6ja6t540ijn.js +8 -0
  78. package/dist/chunks/hcl-hcu7d6ja6t540ijn.js.map +1 -0
  79. package/dist/chunks/html-kl304jmqj4jxj777.js +12 -0
  80. package/dist/chunks/html-kl304jmqj4jxj777.js.map +1 -0
  81. package/dist/chunks/input-area-ciw85g3fno06t4tw.js +78 -0
  82. package/dist/chunks/input-area-ciw85g3fno06t4tw.js.map +1 -0
  83. package/dist/chunks/input-group-mo7tq7jr19hmgor5.js +505 -0
  84. package/dist/chunks/input-group-mo7tq7jr19hmgor5.js.map +1 -0
  85. package/dist/chunks/input-i5nefqk213n4z7pr.js +130 -0
  86. package/dist/chunks/input-i5nefqk213n4z7pr.js.map +1 -0
  87. package/dist/chunks/javascript-hhx3avh9uv2o27ay.js +8 -0
  88. package/dist/chunks/javascript-hhx3avh9uv2o27ay.js.map +1 -0
  89. package/dist/chunks/json-jovp9qemdkp5cziz.js +8 -0
  90. package/dist/chunks/json-jovp9qemdkp5cziz.js.map +1 -0
  91. package/dist/chunks/jsonc-jbkkgjer6ispw2u3.js +8 -0
  92. package/dist/chunks/jsonc-jbkkgjer6ispw2u3.js.map +1 -0
  93. package/dist/chunks/jsx-ij885l2li2lzfoss.js +8 -0
  94. package/dist/chunks/jsx-ij885l2li2lzfoss.js.map +1 -0
  95. package/dist/chunks/label-fcho4757rbdess0c.js +68 -0
  96. package/dist/chunks/label-fcho4757rbdess0c.js.map +1 -0
  97. package/dist/chunks/layer-card-kzu48dhzxm3e9p4u.js +47 -0
  98. package/dist/chunks/layer-card-kzu48dhzxm3e9p4u.js.map +1 -0
  99. package/dist/chunks/link-j2gu5dr3nr4i4yf0.js +95 -0
  100. package/dist/chunks/link-j2gu5dr3nr4i4yf0.js.map +1 -0
  101. package/dist/chunks/link-provider-bgljdgs4hs438h0u.js +22 -0
  102. package/dist/chunks/link-provider-bgljdgs4hs438h0u.js.map +1 -0
  103. package/dist/chunks/loader-cxzp72mn53lzbv9c.js +109 -0
  104. package/dist/chunks/loader-cxzp72mn53lzbv9c.js.map +1 -0
  105. package/dist/chunks/markdown-n2vyyq7l68fy32wc.js +8 -0
  106. package/dist/chunks/markdown-n2vyyq7l68fy32wc.js.map +1 -0
  107. package/dist/chunks/menubar-ir5gbjmsizsddz7g.js +98 -0
  108. package/dist/chunks/menubar-ir5gbjmsizsddz7g.js.map +1 -0
  109. package/dist/chunks/meter-o5yd7ctjf80vvyjx.js +51 -0
  110. package/dist/chunks/meter-o5yd7ctjf80vvyjx.js.map +1 -0
  111. package/dist/chunks/pagination-bryw6rohfr7mm3km.js +266 -0
  112. package/dist/chunks/pagination-bryw6rohfr7mm3km.js.map +1 -0
  113. package/dist/chunks/popover-elxcmvv7mu7m7uk4.js +181 -0
  114. package/dist/chunks/popover-elxcmvv7mu7m7uk4.js.map +1 -0
  115. package/dist/chunks/portal-provider-off76og7tjyz96ys.js +18 -0
  116. package/dist/chunks/portal-provider-off76og7tjyz96ys.js.map +1 -0
  117. package/dist/chunks/python-gg755pb8oe9ra1d1.js +8 -0
  118. package/dist/chunks/python-gg755pb8oe9ra1d1.js.map +1 -0
  119. package/dist/chunks/radio-newyq331uk4lltr6.js +226 -0
  120. package/dist/chunks/radio-newyq331uk4lltr6.js.map +1 -0
  121. package/dist/chunks/resolve-variant-t8jcltsizeg29ege.js +11 -0
  122. package/dist/chunks/resolve-variant-t8jcltsizeg29ege.js.map +1 -0
  123. package/dist/chunks/select-h5480mbro0ypxu0b.js +237 -0
  124. package/dist/chunks/select-h5480mbro0ypxu0b.js.map +1 -0
  125. package/dist/chunks/sensitive-input-lqugq6uvx0lkpu0u.js +273 -0
  126. package/dist/chunks/sensitive-input-lqugq6uvx0lkpu0u.js.map +1 -0
  127. package/dist/chunks/sidebar-noz668nhdu2gso12.js +1144 -0
  128. package/dist/chunks/sidebar-noz668nhdu2gso12.js.map +1 -0
  129. package/dist/chunks/skeleton-line-epxenksfesr2fkcv.js +33 -0
  130. package/dist/chunks/skeleton-line-epxenksfesr2fkcv.js.map +1 -0
  131. package/dist/chunks/sql-ovukp5mrfunfk5tv.js +8 -0
  132. package/dist/chunks/sql-ovukp5mrfunfk5tv.js.map +1 -0
  133. package/dist/chunks/surface-cyxme7mlr49l33f8.js +29 -0
  134. package/dist/chunks/surface-cyxme7mlr49l33f8.js.map +1 -0
  135. package/dist/chunks/switch-bigo96fyjlh7ivbi.js +256 -0
  136. package/dist/chunks/switch-bigo96fyjlh7ivbi.js.map +1 -0
  137. package/dist/chunks/table-mwcmwp6a80zvyrxw.js +208 -0
  138. package/dist/chunks/table-mwcmwp6a80zvyrxw.js.map +1 -0
  139. package/dist/chunks/table-of-contents-gkuvkr2w6lbhi7wt.js +106 -0
  140. package/dist/chunks/table-of-contents-gkuvkr2w6lbhi7wt.js.map +1 -0
  141. package/dist/chunks/tabs-e4pcjkw94kpe35x0.js +177 -0
  142. package/dist/chunks/tabs-e4pcjkw94kpe35x0.js.map +1 -0
  143. package/dist/chunks/text-oxsrbmjmfq99ue85.js +103 -0
  144. package/dist/chunks/text-oxsrbmjmfq99ue85.js.map +1 -0
  145. package/dist/chunks/toast-ivr4097bstjcjotf.js +370 -0
  146. package/dist/chunks/toast-ivr4097bstjcjotf.js.map +1 -0
  147. package/dist/chunks/toml-nczb2z9n0o23o3ci.js +8 -0
  148. package/dist/chunks/toml-nczb2z9n0o23o3ci.js.map +1 -0
  149. package/dist/chunks/tooltip-ncaia8n1lavkyw8n.js +103 -0
  150. package/dist/chunks/tooltip-ncaia8n1lavkyw8n.js.map +1 -0
  151. package/dist/chunks/tsx-ehy8lrzet6v54zur.js +8 -0
  152. package/dist/chunks/tsx-ehy8lrzet6v54zur.js.map +1 -0
  153. package/dist/chunks/typescript-k4ggjrxhrhcdni6u.js +8 -0
  154. package/dist/chunks/typescript-k4ggjrxhrhcdni6u.js.map +1 -0
  155. package/dist/chunks/vendor-base-ui-bgl9g5nkvqy3tn36.js +24690 -0
  156. package/dist/chunks/vendor-base-ui-bgl9g5nkvqy3tn36.js.map +1 -0
  157. package/dist/chunks/vendor-floating-ui-dn8xswn8036udsqq.js +1311 -0
  158. package/dist/chunks/vendor-floating-ui-dn8xswn8036udsqq.js.map +1 -0
  159. package/dist/chunks/vendor-styling-gobnkhsy0rva4qd3.js +2775 -0
  160. package/dist/chunks/vendor-styling-gobnkhsy0rva4qd3.js.map +1 -0
  161. package/dist/chunks/vendor-utils-m5h2xu7s2rs3pgk5.js +217 -0
  162. package/dist/chunks/vendor-utils-m5h2xu7s2rs3pgk5.js.map +1 -0
  163. package/dist/chunks/vesper-ebfu9ns65f2v830s.js +6 -0
  164. package/dist/chunks/vesper-ebfu9ns65f2v830s.js.map +1 -0
  165. package/dist/chunks/wasm-oj22f8usru9h7dzg.js +9 -0
  166. package/dist/chunks/wasm-oj22f8usru9h7dzg.js.map +1 -0
  167. package/dist/chunks/yaml-e2v22lr79tss2brj.js +8 -0
  168. package/dist/chunks/yaml-e2v22lr79tss2brj.js.map +1 -0
  169. package/dist/code/server.js +88 -0
  170. package/dist/code/server.js.map +1 -0
  171. package/dist/code.js +256 -0
  172. package/dist/code.js.map +1 -0
  173. package/dist/command-line/cli.js +850 -0
  174. package/dist/command-line/commands/add.js +282 -0
  175. package/dist/command-line/commands/ai.js +22 -0
  176. package/dist/command-line/commands/blocks.js +61 -0
  177. package/dist/command-line/commands/doc.js +167 -0
  178. package/dist/command-line/commands/init.js +95 -0
  179. package/dist/command-line/commands/ls.js +53 -0
  180. package/dist/components/autocomplete.js +9 -0
  181. package/dist/components/autocomplete.js.map +1 -0
  182. package/dist/components/badge.js +7 -0
  183. package/dist/components/badge.js.map +1 -0
  184. package/dist/components/banner.js +7 -0
  185. package/dist/components/banner.js.map +1 -0
  186. package/dist/components/breadcrumbs.js +9 -0
  187. package/dist/components/breadcrumbs.js.map +1 -0
  188. package/dist/components/button.js +9 -0
  189. package/dist/components/button.js.map +1 -0
  190. package/dist/components/chart.js +10 -0
  191. package/dist/components/chart.js.map +1 -0
  192. package/dist/components/checkbox.js +8 -0
  193. package/dist/components/checkbox.js.map +1 -0
  194. package/dist/components/clipboard-text.js +6 -0
  195. package/dist/components/clipboard-text.js.map +1 -0
  196. package/dist/components/cloudflare-logo.js +10 -0
  197. package/dist/components/cloudflare-logo.js.map +1 -0
  198. package/dist/components/code.js +7 -0
  199. package/dist/components/code.js.map +1 -0
  200. package/dist/components/collapsible.js +6 -0
  201. package/dist/components/collapsible.js.map +1 -0
  202. package/dist/components/combobox.js +6 -0
  203. package/dist/components/combobox.js.map +1 -0
  204. package/dist/components/command-palette.js +8 -0
  205. package/dist/components/command-palette.js.map +1 -0
  206. package/dist/components/date-picker.js +6 -0
  207. package/dist/components/date-picker.js.map +1 -0
  208. package/dist/components/date-range-picker.js +6 -0
  209. package/dist/components/date-range-picker.js.map +1 -0
  210. package/dist/components/dialog.js +11 -0
  211. package/dist/components/dialog.js.map +1 -0
  212. package/dist/components/dropdown.js +6 -0
  213. package/dist/components/dropdown.js.map +1 -0
  214. package/dist/components/empty.js +9 -0
  215. package/dist/components/empty.js.map +1 -0
  216. package/dist/components/field.js +10 -0
  217. package/dist/components/field.js.map +1 -0
  218. package/dist/components/flow.js +5831 -0
  219. package/dist/components/flow.js.map +1 -0
  220. package/dist/components/grid.js +11 -0
  221. package/dist/components/grid.js.map +1 -0
  222. package/dist/components/input-group.js +8 -0
  223. package/dist/components/input-group.js.map +1 -0
  224. package/dist/components/input.js +14 -0
  225. package/dist/components/input.js.map +1 -0
  226. package/dist/components/label.js +10 -0
  227. package/dist/components/label.js.map +1 -0
  228. package/dist/components/layer-card.js +6 -0
  229. package/dist/components/layer-card.js.map +1 -0
  230. package/dist/components/link.js +9 -0
  231. package/dist/components/link.js.map +1 -0
  232. package/dist/components/loader.js +8 -0
  233. package/dist/components/loader.js.map +1 -0
  234. package/dist/components/menubar.js +7 -0
  235. package/dist/components/menubar.js.map +1 -0
  236. package/dist/components/meter.js +6 -0
  237. package/dist/components/meter.js.map +1 -0
  238. package/dist/components/pagination.js +6 -0
  239. package/dist/components/pagination.js.map +1 -0
  240. package/dist/components/popover.js +14 -0
  241. package/dist/components/popover.js.map +1 -0
  242. package/dist/components/radio.js +10 -0
  243. package/dist/components/radio.js.map +1 -0
  244. package/dist/components/select.js +6 -0
  245. package/dist/components/select.js.map +1 -0
  246. package/dist/components/sensitive-input.js +8 -0
  247. package/dist/components/sensitive-input.js.map +1 -0
  248. package/dist/components/sidebar.js +34 -0
  249. package/dist/components/sidebar.js.map +1 -0
  250. package/dist/components/surface.js +6 -0
  251. package/dist/components/surface.js.map +1 -0
  252. package/dist/components/switch.js +8 -0
  253. package/dist/components/switch.js.map +1 -0
  254. package/dist/components/table-of-contents.js +8 -0
  255. package/dist/components/table-of-contents.js.map +1 -0
  256. package/dist/components/table.js +8 -0
  257. package/dist/components/table.js.map +1 -0
  258. package/dist/components/tabs.js +6 -0
  259. package/dist/components/tabs.js.map +1 -0
  260. package/dist/components/text.js +6 -0
  261. package/dist/components/text.js.map +1 -0
  262. package/dist/components/toast.js +11 -0
  263. package/dist/components/toast.js.map +1 -0
  264. package/dist/components/tooltip.js +7 -0
  265. package/dist/components/tooltip.js.map +1 -0
  266. package/dist/index.js +344 -0
  267. package/dist/index.js.map +1 -0
  268. package/dist/primitives/accordion.js +6 -0
  269. package/dist/primitives/accordion.js.map +1 -0
  270. package/dist/primitives/alert-dialog.js +6 -0
  271. package/dist/primitives/alert-dialog.js.map +1 -0
  272. package/dist/primitives/autocomplete.js +6 -0
  273. package/dist/primitives/autocomplete.js.map +1 -0
  274. package/dist/primitives/avatar.js +6 -0
  275. package/dist/primitives/avatar.js.map +1 -0
  276. package/dist/primitives/button.js +6 -0
  277. package/dist/primitives/button.js.map +1 -0
  278. package/dist/primitives/checkbox-group.js +6 -0
  279. package/dist/primitives/checkbox-group.js.map +1 -0
  280. package/dist/primitives/checkbox.js +6 -0
  281. package/dist/primitives/checkbox.js.map +1 -0
  282. package/dist/primitives/collapsible.js +6 -0
  283. package/dist/primitives/collapsible.js.map +1 -0
  284. package/dist/primitives/combobox.js +6 -0
  285. package/dist/primitives/combobox.js.map +1 -0
  286. package/dist/primitives/context-menu.js +6 -0
  287. package/dist/primitives/context-menu.js.map +1 -0
  288. package/dist/primitives/csp-provider.js +6 -0
  289. package/dist/primitives/csp-provider.js.map +1 -0
  290. package/dist/primitives/dialog.js +6 -0
  291. package/dist/primitives/dialog.js.map +1 -0
  292. package/dist/primitives/direction-provider.js +7 -0
  293. package/dist/primitives/direction-provider.js.map +1 -0
  294. package/dist/primitives/drawer.js +6 -0
  295. package/dist/primitives/drawer.js.map +1 -0
  296. package/dist/primitives/field.js +6 -0
  297. package/dist/primitives/field.js.map +1 -0
  298. package/dist/primitives/fieldset.js +6 -0
  299. package/dist/primitives/fieldset.js.map +1 -0
  300. package/dist/primitives/form.js +6 -0
  301. package/dist/primitives/form.js.map +1 -0
  302. package/dist/primitives/input.js +6 -0
  303. package/dist/primitives/input.js.map +1 -0
  304. package/dist/primitives/menu.js +6 -0
  305. package/dist/primitives/menu.js.map +1 -0
  306. package/dist/primitives/menubar.js +6 -0
  307. package/dist/primitives/menubar.js.map +1 -0
  308. package/dist/primitives/meter.js +6 -0
  309. package/dist/primitives/meter.js.map +1 -0
  310. package/dist/primitives/navigation-menu.js +6 -0
  311. package/dist/primitives/navigation-menu.js.map +1 -0
  312. package/dist/primitives/number-field.js +6 -0
  313. package/dist/primitives/number-field.js.map +1 -0
  314. package/dist/primitives/otp-field.js +6 -0
  315. package/dist/primitives/otp-field.js.map +1 -0
  316. package/dist/primitives/popover.js +6 -0
  317. package/dist/primitives/popover.js.map +1 -0
  318. package/dist/primitives/preview-card.js +6 -0
  319. package/dist/primitives/preview-card.js.map +1 -0
  320. package/dist/primitives/progress.js +6 -0
  321. package/dist/primitives/progress.js.map +1 -0
  322. package/dist/primitives/radio-group.js +6 -0
  323. package/dist/primitives/radio-group.js.map +1 -0
  324. package/dist/primitives/radio.js +6 -0
  325. package/dist/primitives/radio.js.map +1 -0
  326. package/dist/primitives/scroll-area.js +6 -0
  327. package/dist/primitives/scroll-area.js.map +1 -0
  328. package/dist/primitives/select.js +6 -0
  329. package/dist/primitives/select.js.map +1 -0
  330. package/dist/primitives/separator.js +6 -0
  331. package/dist/primitives/separator.js.map +1 -0
  332. package/dist/primitives/slider.js +6 -0
  333. package/dist/primitives/slider.js.map +1 -0
  334. package/dist/primitives/switch.js +6 -0
  335. package/dist/primitives/switch.js.map +1 -0
  336. package/dist/primitives/tabs.js +6 -0
  337. package/dist/primitives/tabs.js.map +1 -0
  338. package/dist/primitives/toast.js +6 -0
  339. package/dist/primitives/toast.js.map +1 -0
  340. package/dist/primitives/toggle-group.js +6 -0
  341. package/dist/primitives/toggle-group.js.map +1 -0
  342. package/dist/primitives/toggle.js +6 -0
  343. package/dist/primitives/toggle.js.map +1 -0
  344. package/dist/primitives/toolbar.js +6 -0
  345. package/dist/primitives/toolbar.js.map +1 -0
  346. package/dist/primitives/tooltip.js +6 -0
  347. package/dist/primitives/tooltip.js.map +1 -0
  348. package/dist/primitives.js +46 -0
  349. package/dist/primitives.js.map +1 -0
  350. package/dist/registry.js +2 -0
  351. package/dist/registry.js.map +1 -0
  352. package/dist/scripts/theme-generator/config.d.ts +6 -0
  353. package/dist/scripts/theme-generator/config.d.ts.map +1 -0
  354. package/dist/scripts/theme-generator/config.js +629 -0
  355. package/dist/scripts/theme-generator/config.js.map +1 -0
  356. package/dist/scripts/theme-generator/generate-css.d.ts +31 -0
  357. package/dist/scripts/theme-generator/generate-css.d.ts.map +1 -0
  358. package/dist/scripts/theme-generator/index.d.ts +13 -0
  359. package/dist/scripts/theme-generator/index.d.ts.map +1 -0
  360. package/dist/scripts/theme-generator/migrate.d.ts +56 -0
  361. package/dist/scripts/theme-generator/migrate.d.ts.map +1 -0
  362. package/dist/scripts/theme-generator/types.d.ts +82 -0
  363. package/dist/scripts/theme-generator/types.d.ts.map +1 -0
  364. package/dist/scripts/theme-generator/types.js +2 -0
  365. package/dist/scripts/theme-generator/types.js.map +1 -0
  366. package/dist/src/blocks/delete-resource/delete-resource.d.ts +46 -0
  367. package/dist/src/blocks/delete-resource/delete-resource.d.ts.map +1 -0
  368. package/dist/src/blocks/delete-resource/index.d.ts +2 -0
  369. package/dist/src/blocks/delete-resource/index.d.ts.map +1 -0
  370. package/dist/src/blocks/page-header/index.d.ts +2 -0
  371. package/dist/src/blocks/page-header/index.d.ts.map +1 -0
  372. package/dist/src/blocks/page-header/page-header.d.ts +38 -0
  373. package/dist/src/blocks/page-header/page-header.d.ts.map +1 -0
  374. package/dist/src/blocks/resource-list/index.d.ts +2 -0
  375. package/dist/src/blocks/resource-list/index.d.ts.map +1 -0
  376. package/dist/src/blocks/resource-list/resource-list.d.ts +18 -0
  377. package/dist/src/blocks/resource-list/resource-list.d.ts.map +1 -0
  378. package/dist/src/catalog/catalog.d.ts +75 -0
  379. package/dist/src/catalog/catalog.d.ts.map +1 -0
  380. package/dist/src/catalog/data.d.ts +44 -0
  381. package/dist/src/catalog/data.d.ts.map +1 -0
  382. package/dist/src/catalog/index.d.ts +39 -0
  383. package/dist/src/catalog/index.d.ts.map +1 -0
  384. package/dist/src/catalog/types.d.ts +226 -0
  385. package/dist/src/catalog/types.d.ts.map +1 -0
  386. package/dist/src/catalog/visibility.d.ts +37 -0
  387. package/dist/src/catalog/visibility.d.ts.map +1 -0
  388. package/dist/src/code/code-highlighted.d.ts +32 -0
  389. package/dist/src/code/code-highlighted.d.ts.map +1 -0
  390. package/dist/src/code/context.d.ts +16 -0
  391. package/dist/src/code/context.d.ts.map +1 -0
  392. package/dist/src/code/index.d.ts +32 -0
  393. package/dist/src/code/index.d.ts.map +1 -0
  394. package/dist/src/code/provider.d.ts +13 -0
  395. package/dist/src/code/provider.d.ts.map +1 -0
  396. package/dist/src/code/server.d.ts +95 -0
  397. package/dist/src/code/server.d.ts.map +1 -0
  398. package/dist/src/code/types.d.ts +130 -0
  399. package/dist/src/code/types.d.ts.map +1 -0
  400. package/dist/src/code/use-shiki-highlighter.d.ts +36 -0
  401. package/dist/src/code/use-shiki-highlighter.d.ts.map +1 -0
  402. package/dist/src/command-line/build-cli.d.ts +7 -0
  403. package/dist/src/command-line/build-cli.d.ts.map +1 -0
  404. package/dist/src/command-line/cli.d.ts +13 -0
  405. package/dist/src/command-line/cli.d.ts.map +1 -0
  406. package/dist/src/command-line/commands/add.d.ts +10 -0
  407. package/dist/src/command-line/commands/add.d.ts.map +1 -0
  408. package/dist/src/command-line/commands/ai.d.ts +10 -0
  409. package/dist/src/command-line/commands/ai.d.ts.map +1 -0
  410. package/dist/src/command-line/commands/blocks.d.ts +10 -0
  411. package/dist/src/command-line/commands/blocks.d.ts.map +1 -0
  412. package/dist/src/command-line/commands/doc.d.ts +14 -0
  413. package/dist/src/command-line/commands/doc.d.ts.map +1 -0
  414. package/dist/src/command-line/commands/init.d.ts +18 -0
  415. package/dist/src/command-line/commands/init.d.ts.map +1 -0
  416. package/dist/src/command-line/commands/ls.d.ts +10 -0
  417. package/dist/src/command-line/commands/ls.d.ts.map +1 -0
  418. package/dist/src/command-line/commands/migrate.d.ts +10 -0
  419. package/dist/src/command-line/commands/migrate.d.ts.map +1 -0
  420. package/dist/src/command-line/utils/config.d.ts +42 -0
  421. package/dist/src/command-line/utils/config.d.ts.map +1 -0
  422. package/dist/src/command-line/utils/transformer.d.ts +21 -0
  423. package/dist/src/command-line/utils/transformer.d.ts.map +1 -0
  424. package/dist/src/components/autocomplete/autocomplete.d.ts +181 -0
  425. package/dist/src/components/autocomplete/autocomplete.d.ts.map +1 -0
  426. package/dist/src/components/autocomplete/index.d.ts +3 -0
  427. package/dist/src/components/autocomplete/index.d.ts.map +1 -0
  428. package/dist/src/components/badge/badge.d.ts +180 -0
  429. package/dist/src/components/badge/badge.d.ts.map +1 -0
  430. package/dist/src/components/badge/index.d.ts +2 -0
  431. package/dist/src/components/badge/index.d.ts.map +1 -0
  432. package/dist/src/components/banner/banner.d.ts +106 -0
  433. package/dist/src/components/banner/banner.d.ts.map +1 -0
  434. package/dist/src/components/banner/index.d.ts +2 -0
  435. package/dist/src/components/banner/index.d.ts.map +1 -0
  436. package/dist/src/components/breadcrumbs/breadcrumbs.d.ts +78 -0
  437. package/dist/src/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  438. package/dist/src/components/breadcrumbs/index.d.ts +2 -0
  439. package/dist/src/components/breadcrumbs/index.d.ts.map +1 -0
  440. package/dist/src/components/button/button.d.ts +214 -0
  441. package/dist/src/components/button/button.d.ts.map +1 -0
  442. package/dist/src/components/button/index.d.ts +2 -0
  443. package/dist/src/components/button/index.d.ts.map +1 -0
  444. package/dist/src/components/chart/Color.d.ts +91 -0
  445. package/dist/src/components/chart/Color.d.ts.map +1 -0
  446. package/dist/src/components/chart/EChart.d.ts +159 -0
  447. package/dist/src/components/chart/EChart.d.ts.map +1 -0
  448. package/dist/src/components/chart/Legend.d.ts +51 -0
  449. package/dist/src/components/chart/Legend.d.ts.map +1 -0
  450. package/dist/src/components/chart/SankeyChart.d.ts +98 -0
  451. package/dist/src/components/chart/SankeyChart.d.ts.map +1 -0
  452. package/dist/src/components/chart/TimeseriesChart.d.ts +181 -0
  453. package/dist/src/components/chart/TimeseriesChart.d.ts.map +1 -0
  454. package/dist/src/components/chart/index.d.ts +6 -0
  455. package/dist/src/components/chart/index.d.ts.map +1 -0
  456. package/dist/src/components/checkbox/checkbox.d.ts +197 -0
  457. package/dist/src/components/checkbox/checkbox.d.ts.map +1 -0
  458. package/dist/src/components/checkbox/index.d.ts +2 -0
  459. package/dist/src/components/checkbox/index.d.ts.map +1 -0
  460. package/dist/src/components/clipboard-text/clipboard-text.d.ts +88 -0
  461. package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +1 -0
  462. package/dist/src/components/clipboard-text/index.d.ts +2 -0
  463. package/dist/src/components/clipboard-text/index.d.ts.map +1 -0
  464. package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts +133 -0
  465. package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts.map +1 -0
  466. package/dist/src/components/cloudflare-logo/index.d.ts +2 -0
  467. package/dist/src/components/cloudflare-logo/index.d.ts.map +1 -0
  468. package/dist/src/components/code/code.d.ts +189 -0
  469. package/dist/src/components/code/code.d.ts.map +1 -0
  470. package/dist/src/components/code/index.d.ts +4 -0
  471. package/dist/src/components/code/index.d.ts.map +1 -0
  472. package/dist/src/components/collapsible/collapsible.d.ts +109 -0
  473. package/dist/src/components/collapsible/collapsible.d.ts.map +1 -0
  474. package/dist/src/components/collapsible/index.d.ts +2 -0
  475. package/dist/src/components/collapsible/index.d.ts.map +1 -0
  476. package/dist/src/components/combobox/combobox.d.ts +246 -0
  477. package/dist/src/components/combobox/combobox.d.ts.map +1 -0
  478. package/dist/src/components/combobox/index.d.ts +3 -0
  479. package/dist/src/components/combobox/index.d.ts.map +1 -0
  480. package/dist/src/components/command-palette/command-palette.d.ts +258 -0
  481. package/dist/src/components/command-palette/command-palette.d.ts.map +1 -0
  482. package/dist/src/components/command-palette/index.d.ts +3 -0
  483. package/dist/src/components/command-palette/index.d.ts.map +1 -0
  484. package/dist/src/components/command-palette/types.d.ts +168 -0
  485. package/dist/src/components/command-palette/types.d.ts.map +1 -0
  486. package/dist/src/components/date-picker/date-picker.d.ts +65 -0
  487. package/dist/src/components/date-picker/date-picker.d.ts.map +1 -0
  488. package/dist/src/components/date-picker/index.d.ts +4 -0
  489. package/dist/src/components/date-picker/index.d.ts.map +1 -0
  490. package/dist/src/components/date-range-picker/date-range-picker.d.ts +125 -0
  491. package/dist/src/components/date-range-picker/date-range-picker.d.ts.map +1 -0
  492. package/dist/src/components/date-range-picker/index.d.ts +5 -0
  493. package/dist/src/components/date-range-picker/index.d.ts.map +1 -0
  494. package/dist/src/components/dialog/dialog.d.ts +242 -0
  495. package/dist/src/components/dialog/dialog.d.ts.map +1 -0
  496. package/dist/src/components/dialog/index.d.ts +2 -0
  497. package/dist/src/components/dialog/index.d.ts.map +1 -0
  498. package/dist/src/components/dropdown/dropdown.d.ts +116 -0
  499. package/dist/src/components/dropdown/dropdown.d.ts.map +1 -0
  500. package/dist/src/components/dropdown/index.d.ts +2 -0
  501. package/dist/src/components/dropdown/index.d.ts.map +1 -0
  502. package/dist/src/components/empty/empty.d.ts +69 -0
  503. package/dist/src/components/empty/empty.d.ts.map +1 -0
  504. package/dist/src/components/empty/index.d.ts +2 -0
  505. package/dist/src/components/empty/index.d.ts.map +1 -0
  506. package/dist/src/components/field/field.d.ts +89 -0
  507. package/dist/src/components/field/field.d.ts.map +1 -0
  508. package/dist/src/components/field/index.d.ts +2 -0
  509. package/dist/src/components/field/index.d.ts.map +1 -0
  510. package/dist/src/components/flow/connectors.d.ts +41 -0
  511. package/dist/src/components/flow/connectors.d.ts.map +1 -0
  512. package/dist/src/components/flow/diagram.d.ts +96 -0
  513. package/dist/src/components/flow/diagram.d.ts.map +1 -0
  514. package/dist/src/components/flow/index.d.ts +26 -0
  515. package/dist/src/components/flow/index.d.ts.map +1 -0
  516. package/dist/src/components/flow/node.d.ts +61 -0
  517. package/dist/src/components/flow/node.d.ts.map +1 -0
  518. package/dist/src/components/flow/parallel.d.ts +13 -0
  519. package/dist/src/components/flow/parallel.d.ts.map +1 -0
  520. package/dist/src/components/flow/use-children.d.ts +87 -0
  521. package/dist/src/components/flow/use-children.d.ts.map +1 -0
  522. package/dist/src/components/grid/grid.d.ts +135 -0
  523. package/dist/src/components/grid/grid.d.ts.map +1 -0
  524. package/dist/src/components/grid/index.d.ts +2 -0
  525. package/dist/src/components/grid/index.d.ts.map +1 -0
  526. package/dist/src/components/input/index.d.ts +19 -0
  527. package/dist/src/components/input/index.d.ts.map +1 -0
  528. package/dist/src/components/input/input-area.d.ts +65 -0
  529. package/dist/src/components/input/input-area.d.ts.map +1 -0
  530. package/dist/src/components/input/input.d.ts +175 -0
  531. package/dist/src/components/input/input.d.ts.map +1 -0
  532. package/dist/src/components/input-group/context.d.ts +96 -0
  533. package/dist/src/components/input-group/context.d.ts.map +1 -0
  534. package/dist/src/components/input-group/index.d.ts +2 -0
  535. package/dist/src/components/input-group/index.d.ts.map +1 -0
  536. package/dist/src/components/input-group/input-group-addon.d.ts +15 -0
  537. package/dist/src/components/input-group/input-group-addon.d.ts.map +1 -0
  538. package/dist/src/components/input-group/input-group-button.d.ts +36 -0
  539. package/dist/src/components/input-group/input-group-button.d.ts.map +1 -0
  540. package/dist/src/components/input-group/input-group-input.d.ts +9 -0
  541. package/dist/src/components/input-group/input-group-input.d.ts.map +1 -0
  542. package/dist/src/components/input-group/input-group-suffix.d.ts +13 -0
  543. package/dist/src/components/input-group/input-group-suffix.d.ts.map +1 -0
  544. package/dist/src/components/input-group/input-group.d.ts +43 -0
  545. package/dist/src/components/input-group/input-group.d.ts.map +1 -0
  546. package/dist/src/components/label/index.d.ts +2 -0
  547. package/dist/src/components/label/index.d.ts.map +1 -0
  548. package/dist/src/components/label/label.d.ts +67 -0
  549. package/dist/src/components/label/label.d.ts.map +1 -0
  550. package/dist/src/components/layer-card/index.d.ts +2 -0
  551. package/dist/src/components/layer-card/index.d.ts.map +1 -0
  552. package/dist/src/components/layer-card/layer-card.d.ts +60 -0
  553. package/dist/src/components/layer-card/layer-card.d.ts.map +1 -0
  554. package/dist/src/components/link/index.d.ts +2 -0
  555. package/dist/src/components/link/index.d.ts.map +1 -0
  556. package/dist/src/components/link/link.d.ts +66 -0
  557. package/dist/src/components/link/link.d.ts.map +1 -0
  558. package/dist/src/components/loader/index.d.ts +3 -0
  559. package/dist/src/components/loader/index.d.ts.map +1 -0
  560. package/dist/src/components/loader/loader.d.ts +70 -0
  561. package/dist/src/components/loader/loader.d.ts.map +1 -0
  562. package/dist/src/components/loader/skeleton-line.d.ts +11 -0
  563. package/dist/src/components/loader/skeleton-line.d.ts.map +1 -0
  564. package/dist/src/components/menubar/index.d.ts +3 -0
  565. package/dist/src/components/menubar/index.d.ts.map +1 -0
  566. package/dist/src/components/menubar/menubar.d.ts +66 -0
  567. package/dist/src/components/menubar/menubar.d.ts.map +1 -0
  568. package/dist/src/components/menubar/use-menu-navigation.d.ts +8 -0
  569. package/dist/src/components/menubar/use-menu-navigation.d.ts.map +1 -0
  570. package/dist/src/components/meter/index.d.ts +2 -0
  571. package/dist/src/components/meter/index.d.ts.map +1 -0
  572. package/dist/src/components/meter/meter.d.ts +44 -0
  573. package/dist/src/components/meter/meter.d.ts.map +1 -0
  574. package/dist/src/components/pagination/index.d.ts +2 -0
  575. package/dist/src/components/pagination/index.d.ts.map +1 -0
  576. package/dist/src/components/pagination/pagination.d.ts +241 -0
  577. package/dist/src/components/pagination/pagination.d.ts.map +1 -0
  578. package/dist/src/components/popover/index.d.ts +3 -0
  579. package/dist/src/components/popover/index.d.ts.map +1 -0
  580. package/dist/src/components/popover/popover.d.ts +178 -0
  581. package/dist/src/components/popover/popover.d.ts.map +1 -0
  582. package/dist/src/components/radio/index.d.ts +2 -0
  583. package/dist/src/components/radio/index.d.ts.map +1 -0
  584. package/dist/src/components/radio/radio.d.ts +277 -0
  585. package/dist/src/components/radio/radio.d.ts.map +1 -0
  586. package/dist/src/components/radio/radio.type-spec.d.ts +12 -0
  587. package/dist/src/components/radio/radio.type-spec.d.ts.map +1 -0
  588. package/dist/src/components/select/index.d.ts +2 -0
  589. package/dist/src/components/select/index.d.ts.map +1 -0
  590. package/dist/src/components/select/select.d.ts +288 -0
  591. package/dist/src/components/select/select.d.ts.map +1 -0
  592. package/dist/src/components/sensitive-input/index.d.ts +2 -0
  593. package/dist/src/components/sensitive-input/index.d.ts.map +1 -0
  594. package/dist/src/components/sensitive-input/sensitive-input.d.ts +94 -0
  595. package/dist/src/components/sensitive-input/sensitive-input.d.ts.map +1 -0
  596. package/dist/src/components/sidebar/index.d.ts +2 -0
  597. package/dist/src/components/sidebar/index.d.ts.map +1 -0
  598. package/dist/src/components/sidebar/sidebar.d.ts +581 -0
  599. package/dist/src/components/sidebar/sidebar.d.ts.map +1 -0
  600. package/dist/src/components/surface/index.d.ts +5 -0
  601. package/dist/src/components/surface/index.d.ts.map +1 -0
  602. package/dist/src/components/surface/surface.d.ts +64 -0
  603. package/dist/src/components/surface/surface.d.ts.map +1 -0
  604. package/dist/src/components/switch/index.d.ts +2 -0
  605. package/dist/src/components/switch/index.d.ts.map +1 -0
  606. package/dist/src/components/switch/switch.d.ts +197 -0
  607. package/dist/src/components/switch/switch.d.ts.map +1 -0
  608. package/dist/src/components/table/index.d.ts +2 -0
  609. package/dist/src/components/table/index.d.ts.map +1 -0
  610. package/dist/src/components/table/table.d.ts +138 -0
  611. package/dist/src/components/table/table.d.ts.map +1 -0
  612. package/dist/src/components/table-of-contents/index.d.ts +2 -0
  613. package/dist/src/components/table-of-contents/index.d.ts.map +1 -0
  614. package/dist/src/components/table-of-contents/table-of-contents.d.ts +72 -0
  615. package/dist/src/components/table-of-contents/table-of-contents.d.ts.map +1 -0
  616. package/dist/src/components/tabs/index.d.ts +3 -0
  617. package/dist/src/components/tabs/index.d.ts.map +1 -0
  618. package/dist/src/components/tabs/tabs.d.ts +116 -0
  619. package/dist/src/components/tabs/tabs.d.ts.map +1 -0
  620. package/dist/src/components/text/index.d.ts +2 -0
  621. package/dist/src/components/text/index.d.ts.map +1 -0
  622. package/dist/src/components/text/text.d.ts +214 -0
  623. package/dist/src/components/text/text.d.ts.map +1 -0
  624. package/dist/src/components/text/text.type-spec.d.ts +44 -0
  625. package/dist/src/components/text/text.type-spec.d.ts.map +1 -0
  626. package/dist/src/components/toast/index.d.ts +5 -0
  627. package/dist/src/components/toast/index.d.ts.map +1 -0
  628. package/dist/src/components/toast/toast.d.ts +197 -0
  629. package/dist/src/components/toast/toast.d.ts.map +1 -0
  630. package/dist/src/components/tooltip/index.d.ts +2 -0
  631. package/dist/src/components/tooltip/index.d.ts.map +1 -0
  632. package/dist/src/components/tooltip/tooltip.d.ts +108 -0
  633. package/dist/src/components/tooltip/tooltip.d.ts.map +1 -0
  634. package/dist/src/index.d.ts +84 -0
  635. package/dist/src/index.d.ts.map +1 -0
  636. package/dist/src/primitives/accordion.d.ts +13 -0
  637. package/dist/src/primitives/accordion.d.ts.map +1 -0
  638. package/dist/src/primitives/alert-dialog.d.ts +13 -0
  639. package/dist/src/primitives/alert-dialog.d.ts.map +1 -0
  640. package/dist/src/primitives/autocomplete.d.ts +13 -0
  641. package/dist/src/primitives/autocomplete.d.ts.map +1 -0
  642. package/dist/src/primitives/avatar.d.ts +13 -0
  643. package/dist/src/primitives/avatar.d.ts.map +1 -0
  644. package/dist/src/primitives/button.d.ts +13 -0
  645. package/dist/src/primitives/button.d.ts.map +1 -0
  646. package/dist/src/primitives/checkbox-group.d.ts +13 -0
  647. package/dist/src/primitives/checkbox-group.d.ts.map +1 -0
  648. package/dist/src/primitives/checkbox.d.ts +13 -0
  649. package/dist/src/primitives/checkbox.d.ts.map +1 -0
  650. package/dist/src/primitives/collapsible.d.ts +13 -0
  651. package/dist/src/primitives/collapsible.d.ts.map +1 -0
  652. package/dist/src/primitives/combobox.d.ts +13 -0
  653. package/dist/src/primitives/combobox.d.ts.map +1 -0
  654. package/dist/src/primitives/context-menu.d.ts +13 -0
  655. package/dist/src/primitives/context-menu.d.ts.map +1 -0
  656. package/dist/src/primitives/csp-provider.d.ts +13 -0
  657. package/dist/src/primitives/csp-provider.d.ts.map +1 -0
  658. package/dist/src/primitives/dialog.d.ts +13 -0
  659. package/dist/src/primitives/dialog.d.ts.map +1 -0
  660. package/dist/src/primitives/direction-provider.d.ts +13 -0
  661. package/dist/src/primitives/direction-provider.d.ts.map +1 -0
  662. package/dist/src/primitives/drawer.d.ts +13 -0
  663. package/dist/src/primitives/drawer.d.ts.map +1 -0
  664. package/dist/src/primitives/field.d.ts +13 -0
  665. package/dist/src/primitives/field.d.ts.map +1 -0
  666. package/dist/src/primitives/fieldset.d.ts +13 -0
  667. package/dist/src/primitives/fieldset.d.ts.map +1 -0
  668. package/dist/src/primitives/form.d.ts +13 -0
  669. package/dist/src/primitives/form.d.ts.map +1 -0
  670. package/dist/src/primitives/index.d.ts +55 -0
  671. package/dist/src/primitives/index.d.ts.map +1 -0
  672. package/dist/src/primitives/input.d.ts +13 -0
  673. package/dist/src/primitives/input.d.ts.map +1 -0
  674. package/dist/src/primitives/menu.d.ts +13 -0
  675. package/dist/src/primitives/menu.d.ts.map +1 -0
  676. package/dist/src/primitives/menubar.d.ts +13 -0
  677. package/dist/src/primitives/menubar.d.ts.map +1 -0
  678. package/dist/src/primitives/meter.d.ts +13 -0
  679. package/dist/src/primitives/meter.d.ts.map +1 -0
  680. package/dist/src/primitives/navigation-menu.d.ts +13 -0
  681. package/dist/src/primitives/navigation-menu.d.ts.map +1 -0
  682. package/dist/src/primitives/number-field.d.ts +13 -0
  683. package/dist/src/primitives/number-field.d.ts.map +1 -0
  684. package/dist/src/primitives/otp-field.d.ts +13 -0
  685. package/dist/src/primitives/otp-field.d.ts.map +1 -0
  686. package/dist/src/primitives/popover.d.ts +13 -0
  687. package/dist/src/primitives/popover.d.ts.map +1 -0
  688. package/dist/src/primitives/preview-card.d.ts +13 -0
  689. package/dist/src/primitives/preview-card.d.ts.map +1 -0
  690. package/dist/src/primitives/progress.d.ts +13 -0
  691. package/dist/src/primitives/progress.d.ts.map +1 -0
  692. package/dist/src/primitives/radio-group.d.ts +13 -0
  693. package/dist/src/primitives/radio-group.d.ts.map +1 -0
  694. package/dist/src/primitives/radio.d.ts +13 -0
  695. package/dist/src/primitives/radio.d.ts.map +1 -0
  696. package/dist/src/primitives/scroll-area.d.ts +13 -0
  697. package/dist/src/primitives/scroll-area.d.ts.map +1 -0
  698. package/dist/src/primitives/select.d.ts +13 -0
  699. package/dist/src/primitives/select.d.ts.map +1 -0
  700. package/dist/src/primitives/separator.d.ts +13 -0
  701. package/dist/src/primitives/separator.d.ts.map +1 -0
  702. package/dist/src/primitives/slider.d.ts +13 -0
  703. package/dist/src/primitives/slider.d.ts.map +1 -0
  704. package/dist/src/primitives/switch.d.ts +13 -0
  705. package/dist/src/primitives/switch.d.ts.map +1 -0
  706. package/dist/src/primitives/tabs.d.ts +13 -0
  707. package/dist/src/primitives/tabs.d.ts.map +1 -0
  708. package/dist/src/primitives/toast.d.ts +13 -0
  709. package/dist/src/primitives/toast.d.ts.map +1 -0
  710. package/dist/src/primitives/toggle-group.d.ts +13 -0
  711. package/dist/src/primitives/toggle-group.d.ts.map +1 -0
  712. package/dist/src/primitives/toggle.d.ts +13 -0
  713. package/dist/src/primitives/toggle.d.ts.map +1 -0
  714. package/dist/src/primitives/toolbar.d.ts +13 -0
  715. package/dist/src/primitives/toolbar.d.ts.map +1 -0
  716. package/dist/src/primitives/tooltip.d.ts +13 -0
  717. package/dist/src/primitives/tooltip.d.ts.map +1 -0
  718. package/dist/src/registry/index.d.ts +8 -0
  719. package/dist/src/registry/index.d.ts.map +1 -0
  720. package/dist/src/registry/types.d.ts +191 -0
  721. package/dist/src/registry/types.d.ts.map +1 -0
  722. package/dist/src/utils/cn.d.ts +4 -0
  723. package/dist/src/utils/cn.d.ts.map +1 -0
  724. package/dist/src/utils/index.d.ts +4 -0
  725. package/dist/src/utils/index.d.ts.map +1 -0
  726. package/dist/src/utils/link-provider.d.ts +66 -0
  727. package/dist/src/utils/link-provider.d.ts.map +1 -0
  728. package/dist/src/utils/portal-provider.d.ts +56 -0
  729. package/dist/src/utils/portal-provider.d.ts.map +1 -0
  730. package/dist/src/utils/prop-examples.d.ts +36 -0
  731. package/dist/src/utils/prop-examples.d.ts.map +1 -0
  732. package/dist/src/utils/resolve-variant.d.ts +27 -0
  733. package/dist/src/utils/resolve-variant.d.ts.map +1 -0
  734. package/dist/styles/reki-binding.css +303 -0
  735. package/dist/styles/reki-standalone.css +2 -0
  736. package/dist/styles/reki.css +700 -0
  737. package/dist/styles/theme-fedramp.css +39 -0
  738. package/dist/styles/theme-reki.css +412 -0
  739. package/dist/utils.js +12 -0
  740. package/dist/utils.js.map +1 -0
  741. package/package.json +511 -0
  742. package/scripts/component-registry/cache.ts +123 -0
  743. package/scripts/component-registry/discovery.ts +469 -0
  744. package/scripts/component-registry/example-cleanup.ts +168 -0
  745. package/scripts/component-registry/index.test.ts +987 -0
  746. package/scripts/component-registry/index.ts +970 -0
  747. package/scripts/component-registry/markdown-generator.ts +222 -0
  748. package/scripts/component-registry/metadata.ts +956 -0
  749. package/scripts/component-registry/props-filter.ts +310 -0
  750. package/scripts/component-registry/schema-generator.ts +331 -0
  751. package/scripts/component-registry/sub-components.ts +380 -0
  752. package/scripts/component-registry/types.ts +158 -0
  753. package/scripts/component-registry/utils.ts +280 -0
  754. package/scripts/component-registry/variant-parser.ts +261 -0
  755. package/scripts/css-build.ts +105 -0
  756. package/scripts/generate-primitives.ts +183 -0
  757. package/scripts/theme-generator/config.ts +653 -0
  758. package/scripts/theme-generator/generate-css.test.ts +30 -0
  759. package/scripts/theme-generator/generate-css.ts +351 -0
  760. package/scripts/theme-generator/index.ts +159 -0
  761. package/scripts/theme-generator/migrate.ts +560 -0
  762. package/scripts/theme-generator/types.ts +92 -0
@@ -0,0 +1,2637 @@
1
+ "use client";
2
+ var He = class {
3
+ regexps;
4
+ constructor(e, r = {}) {
5
+ this.patterns = e, this.options = r;
6
+ const { forgiving: t = !1, cache: n, regexConstructor: a } = r;
7
+ if (!a) throw new Error("Option `regexConstructor` is not provided");
8
+ this.regexps = e.map((s) => {
9
+ if (typeof s != "string") return s;
10
+ const o = n?.get(s);
11
+ if (o) {
12
+ if (o instanceof RegExp) return o;
13
+ if (t) return null;
14
+ throw o;
15
+ }
16
+ try {
17
+ const i = a(s);
18
+ return n?.set(s, i), i;
19
+ } catch (i) {
20
+ if (n?.set(s, i), t) return null;
21
+ throw i;
22
+ }
23
+ });
24
+ }
25
+ findNextMatchSync(e, r, t) {
26
+ const n = typeof e == "string" ? e : e.content, a = [];
27
+ function s(o, i, u = 0) {
28
+ return {
29
+ index: o,
30
+ captureIndices: i.indices.map((c) => c == null ? {
31
+ start: 4294967295,
32
+ end: 4294967295,
33
+ length: 0
34
+ } : {
35
+ start: c[0] + u,
36
+ end: c[1] + u,
37
+ length: c[1] - c[0]
38
+ })
39
+ };
40
+ }
41
+ for (let o = 0; o < this.regexps.length; o++) {
42
+ const i = this.regexps[o];
43
+ if (i)
44
+ try {
45
+ i.lastIndex = r;
46
+ const u = i.exec(n);
47
+ if (!u) continue;
48
+ if (u.index === r) return s(o, u, 0);
49
+ a.push([
50
+ o,
51
+ u,
52
+ 0
53
+ ]);
54
+ } catch (u) {
55
+ if (this.options.forgiving) continue;
56
+ throw u;
57
+ }
58
+ }
59
+ if (a.length) {
60
+ const o = Math.min(...a.map((i) => i[1].index));
61
+ for (const [i, u, c] of a) if (u.index === o) return s(i, u, c);
62
+ }
63
+ return null;
64
+ }
65
+ };
66
+ function H(e) {
67
+ if ([...e].length !== 1) throw new Error(`Expected "${e}" to be a single code point`);
68
+ return e.codePointAt(0);
69
+ }
70
+ function yr(e, r, t) {
71
+ return e.has(r) || e.set(r, t), e.get(r);
72
+ }
73
+ const Ce = /* @__PURE__ */ new Set(["alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "word", "xdigit"]), x = String.raw;
74
+ function j(e, r) {
75
+ if (e == null) throw new Error(r ?? "Value expected");
76
+ return e;
77
+ }
78
+ const je = x`\[\^?`, Xe = `c.? | C(?:-.?)?|${x`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${x`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${x`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${x`o\{[^\}]*\}?`}|${x`\d{1,3}`}`, xe = /[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/, K = new RegExp(x`
79
+ \\ (?:
80
+ ${Xe}
81
+ | [gk]<[^>]*>?
82
+ | [gk]'[^']*'?
83
+ | .
84
+ )
85
+ | \( (?:
86
+ \? (?:
87
+ [:=!>({]
88
+ | <[=!]
89
+ | <[^>]*>
90
+ | '[^']*'
91
+ | ~\|?
92
+ | #(?:[^)\\]|\\.?)*
93
+ | [^:)]*[:)]
94
+ )?
95
+ | \*[^\)]*\)?
96
+ )?
97
+ | (?:${xe.source})+
98
+ | ${je}
99
+ | .
100
+ `.replace(/\s+/g, ""), "gsu"), ie = new RegExp(x`
101
+ \\ (?:
102
+ ${Xe}
103
+ | .
104
+ )
105
+ | \[:(?:\^?\p{Alpha}+|\^):\]
106
+ | ${je}
107
+ | &&
108
+ | .
109
+ `.replace(/\s+/g, ""), "gsu");
110
+ function br(e, r = {}) {
111
+ const t = { flags: "", ...r, rules: { captureGroup: !1, singleline: !1, ...r.rules } };
112
+ if (typeof e != "string") throw new Error("String expected as pattern");
113
+ const n = Or(t.flags), a = [n.extended], s = { captureGroup: t.rules.captureGroup, getCurrentModX() {
114
+ return a.at(-1);
115
+ }, numOpenGroups: 0, popModX() {
116
+ a.pop();
117
+ }, pushModX(l) {
118
+ a.push(l);
119
+ }, replaceCurrentModX(l) {
120
+ a[a.length - 1] = l;
121
+ }, singleline: t.rules.singleline };
122
+ let o = [], i;
123
+ for (K.lastIndex = 0; i = K.exec(e); ) {
124
+ const l = Cr(s, e, i[0], K.lastIndex);
125
+ l.tokens ? o.push(...l.tokens) : l.token && o.push(l.token), l.lastIndex !== void 0 && (K.lastIndex = l.lastIndex);
126
+ }
127
+ const u = [];
128
+ let c = 0;
129
+ o.filter((l) => l.type === "GroupOpen").forEach((l) => {
130
+ l.kind === "capturing" ? l.number = ++c : l.raw === "(" && u.push(l);
131
+ }), c || u.forEach((l, f) => {
132
+ l.kind = "capturing", l.number = f + 1;
133
+ });
134
+ const p = c || u.length;
135
+ return { tokens: o.map((l) => l.type === "EscapedNumber" ? Tr(l, p) : l).flat(), flags: n };
136
+ }
137
+ function Cr(e, r, t, n) {
138
+ const [a, s] = t;
139
+ if (t === "[" || t === "[^") {
140
+ const o = xr(r, t, n);
141
+ return { tokens: o.tokens, lastIndex: o.lastIndex };
142
+ }
143
+ if (a === "\\") {
144
+ if ("AbBGyYzZ".includes(s)) return { token: Ie(t, t) };
145
+ if (/^\\g[<']/.test(t)) {
146
+ if (!/^\\g(?:<[^>]+>|'[^']+')$/.test(t)) throw new Error(`Invalid group name "${t}"`);
147
+ return { token: Nr(t) };
148
+ }
149
+ if (/^\\k[<']/.test(t)) {
150
+ if (!/^\\k(?:<[^>]+>|'[^']+')$/.test(t)) throw new Error(`Invalid group name "${t}"`);
151
+ return { token: Qe(t) };
152
+ }
153
+ if (s === "K") return { token: qe("keep", t) };
154
+ if (s === "N" || s === "R") return { token: U("newline", t, { negate: s === "N" }) };
155
+ if (s === "O") return { token: U("any", t) };
156
+ if (s === "X") return { token: U("text_segment", t) };
157
+ const o = Ze(t, { inCharClass: !1 });
158
+ return Array.isArray(o) ? { tokens: o } : { token: o };
159
+ }
160
+ if (a === "(") {
161
+ if (s === "*") return { token: Pr(t) };
162
+ if (t === "(?{") throw new Error(`Unsupported callout "${t}"`);
163
+ if (t.startsWith("(?#")) {
164
+ if (r[n] !== ")") throw new Error('Unclosed comment group "(?#"');
165
+ return { lastIndex: n + 1 };
166
+ }
167
+ if (/^\(\?[-imx]+[:)]$/.test(t)) return { token: Gr(t, e) };
168
+ if (e.pushModX(e.getCurrentModX()), e.numOpenGroups++, t === "(" && !e.captureGroup || t === "(?:") return { token: z("group", t) };
169
+ if (t === "(?>") return { token: z("atomic", t) };
170
+ if (t === "(?=" || t === "(?!" || t === "(?<=" || t === "(?<!") return { token: z(t[2] === "<" ? "lookbehind" : "lookahead", t, { negate: t.endsWith("!") }) };
171
+ if (t === "(" && e.captureGroup || t.startsWith("(?<") && t.endsWith(">") || t.startsWith("(?'") && t.endsWith("'")) return { token: z("capturing", t, { ...t !== "(" && { name: t.slice(3, -1) } }) };
172
+ if (t.startsWith("(?~")) {
173
+ if (t === "(?~|") throw new Error(`Unsupported absence function kind "${t}"`);
174
+ return { token: z("absence_repeater", t) };
175
+ }
176
+ throw t === "(?(" ? new Error(`Unsupported conditional "${t}"`) : new Error(`Invalid or unsupported group option "${t}"`);
177
+ }
178
+ if (t === ")") {
179
+ if (e.popModX(), e.numOpenGroups--, e.numOpenGroups < 0) throw new Error('Unmatched ")"');
180
+ return { token: vr(t) };
181
+ }
182
+ if (e.getCurrentModX()) {
183
+ if (t === "#") {
184
+ const o = r.indexOf(`
185
+ `, n);
186
+ return { lastIndex: o === -1 ? r.length : o };
187
+ }
188
+ if (/^\s$/.test(t)) {
189
+ const o = /\s+/y;
190
+ return o.lastIndex = n, { lastIndex: o.exec(r) ? o.lastIndex : n };
191
+ }
192
+ }
193
+ if (t === ".") return { token: U("dot", t) };
194
+ if (t === "^" || t === "$") {
195
+ const o = e.singleline ? { "^": x`\A`, $: x`\Z` }[t] : t;
196
+ return { token: Ie(o, t) };
197
+ }
198
+ return t === "|" ? { token: $r(t) } : xe.test(t) ? { tokens: Br(t) } : { token: L(H(t), t) };
199
+ }
200
+ function xr(e, r, t) {
201
+ const n = [Se(r[1] === "^", r)];
202
+ let a = 1, s;
203
+ for (ie.lastIndex = t; s = ie.exec(e); ) {
204
+ const o = s[0];
205
+ if (o[0] === "[" && o[1] !== ":") a++, n.push(Se(o[1] === "^", o));
206
+ else if (o === "]") {
207
+ if (n.at(-1).type === "CharacterClassOpen") n.push(L(93, o));
208
+ else if (a--, n.push(Er(o)), !a) break;
209
+ } else {
210
+ const i = kr(o);
211
+ Array.isArray(i) ? n.push(...i) : n.push(i);
212
+ }
213
+ }
214
+ return { tokens: n, lastIndex: ie.lastIndex || e.length };
215
+ }
216
+ function kr(e) {
217
+ if (e[0] === "\\") return Ze(e, { inCharClass: !0 });
218
+ if (e[0] === "[") {
219
+ const r = /\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);
220
+ if (!r || !Ce.has(r.groups.name)) throw new Error(`Invalid POSIX class "${e}"`);
221
+ return U("posix", e, { value: r.groups.name, negate: !!r.groups.negate });
222
+ }
223
+ return e === "-" ? Ar(e) : e === "&&" ? Ir(e) : L(H(e), e);
224
+ }
225
+ function Ze(e, { inCharClass: r }) {
226
+ const t = e[1];
227
+ if (t === "c" || t === "C") return Fr(e);
228
+ if ("dDhHsSwW".includes(t)) return Rr(e);
229
+ if (e.startsWith(x`\o{`)) throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);
230
+ if (/^\\[pP]\{/.test(e)) {
231
+ if (e.length === 3) throw new Error(`Incomplete or invalid Unicode property "${e}"`);
232
+ return Ur(e);
233
+ }
234
+ if (new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}", "u").test(e)) try {
235
+ const n = e.split(/\\x/).slice(1).map((o) => parseInt(o, 16)), a = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }).decode(new Uint8Array(n)), s = new TextEncoder();
236
+ return [...a].map((o) => {
237
+ const i = [...s.encode(o)].map((u) => `\\x${u.toString(16)}`).join("");
238
+ return L(H(o), i);
239
+ });
240
+ } catch {
241
+ throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`);
242
+ }
243
+ if (t === "u" || t === "x") return L(Dr(e), e);
244
+ if (ve.has(t)) return L(ve.get(t), e);
245
+ if (/\d/.test(t)) return Sr(r, e);
246
+ if (e === "\\") throw new Error(x`Incomplete escape "\"`);
247
+ if (t === "M") throw new Error(`Unsupported meta "${e}"`);
248
+ if ([...e].length === 2) return L(e.codePointAt(1), e);
249
+ throw new Error(`Unexpected escape "${e}"`);
250
+ }
251
+ function $r(e) {
252
+ return { type: "Alternator", raw: e };
253
+ }
254
+ function Ie(e, r) {
255
+ return { type: "Assertion", kind: e, raw: r };
256
+ }
257
+ function Qe(e) {
258
+ return { type: "Backreference", raw: e };
259
+ }
260
+ function L(e, r) {
261
+ return { type: "Character", value: e, raw: r };
262
+ }
263
+ function Er(e) {
264
+ return { type: "CharacterClassClose", raw: e };
265
+ }
266
+ function Ar(e) {
267
+ return { type: "CharacterClassHyphen", raw: e };
268
+ }
269
+ function Ir(e) {
270
+ return { type: "CharacterClassIntersector", raw: e };
271
+ }
272
+ function Se(e, r) {
273
+ return { type: "CharacterClassOpen", negate: e, raw: r };
274
+ }
275
+ function U(e, r, t = {}) {
276
+ return { type: "CharacterSet", kind: e, ...t, raw: r };
277
+ }
278
+ function qe(e, r, t = {}) {
279
+ return e === "keep" ? { type: "Directive", kind: e, raw: r } : { type: "Directive", kind: e, flags: j(t.flags), raw: r };
280
+ }
281
+ function Sr(e, r) {
282
+ return { type: "EscapedNumber", inCharClass: e, raw: r };
283
+ }
284
+ function vr(e) {
285
+ return { type: "GroupClose", raw: e };
286
+ }
287
+ function z(e, r, t = {}) {
288
+ return { type: "GroupOpen", kind: e, ...t, raw: r };
289
+ }
290
+ function _r(e, r, t, n) {
291
+ return { type: "NamedCallout", kind: e, tag: r, arguments: t, raw: n };
292
+ }
293
+ function Mr(e, r, t, n) {
294
+ return { type: "Quantifier", kind: e, min: r, max: t, raw: n };
295
+ }
296
+ function Nr(e) {
297
+ return { type: "Subroutine", raw: e };
298
+ }
299
+ const Lr = /* @__PURE__ */ new Set(["COUNT", "CMP", "ERROR", "FAIL", "MAX", "MISMATCH", "SKIP", "TOTAL_COUNT"]), ve = /* @__PURE__ */ new Map([["a", 7], ["b", 8], ["e", 27], ["f", 12], ["n", 10], ["r", 13], ["t", 9], ["v", 11]]);
300
+ function Fr(e) {
301
+ const r = e[1] === "c" ? e[2] : e[3];
302
+ if (!r || !/[A-Za-z]/.test(r)) throw new Error(`Unsupported control character "${e}"`);
303
+ return L(H(r.toUpperCase()) - 64, e);
304
+ }
305
+ function Gr(e, r) {
306
+ let { on: t, off: n } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;
307
+ n ??= "";
308
+ const a = (r.getCurrentModX() || t.includes("x")) && !n.includes("x"), s = Me(t), o = Me(n), i = {};
309
+ if (s && (i.enable = s), o && (i.disable = o), e.endsWith(")")) return r.replaceCurrentModX(a), qe("flags", e, { flags: i });
310
+ if (e.endsWith(":")) return r.pushModX(a), r.numOpenGroups++, z("group", e, { ...(s || o) && { flags: i } });
311
+ throw new Error(`Unexpected flag modifier "${e}"`);
312
+ }
313
+ function Pr(e) {
314
+ const r = /\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);
315
+ if (!r) throw new Error(`Incomplete or invalid named callout "${e}"`);
316
+ const { name: t, tag: n, args: a } = r.groups;
317
+ if (!t) throw new Error(`Invalid named callout "${e}"`);
318
+ if (n === "") throw new Error(`Named callout tag with empty value not allowed "${e}"`);
319
+ const s = a ? a.split(",").filter((p) => p !== "").map((p) => /^[+-]?\d+$/.test(p) ? +p : p) : [], [o, i, u] = s, c = Lr.has(t) ? t.toLowerCase() : "custom";
320
+ switch (c) {
321
+ case "fail":
322
+ case "mismatch":
323
+ case "skip":
324
+ if (s.length > 0) throw new Error(`Named callout arguments not allowed "${s}"`);
325
+ break;
326
+ case "error":
327
+ if (s.length > 1) throw new Error(`Named callout allows only one argument "${s}"`);
328
+ if (typeof o == "string") throw new Error(`Named callout argument must be a number "${o}"`);
329
+ break;
330
+ case "max":
331
+ if (!s.length || s.length > 2) throw new Error(`Named callout must have one or two arguments "${s}"`);
332
+ if (typeof o == "string" && !/^[A-Za-z_]\w*$/.test(o)) throw new Error(`Named callout argument one must be a tag or number "${o}"`);
333
+ if (s.length === 2 && (typeof i == "number" || !/^[<>X]$/.test(i))) throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i}"`);
334
+ break;
335
+ case "count":
336
+ case "total_count":
337
+ if (s.length > 1) throw new Error(`Named callout allows only one argument "${s}"`);
338
+ if (s.length === 1 && (typeof o == "number" || !/^[<>X]$/.test(o))) throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);
339
+ break;
340
+ case "cmp":
341
+ if (s.length !== 3) throw new Error(`Named callout must have three arguments "${s}"`);
342
+ if (typeof o == "string" && !/^[A-Za-z_]\w*$/.test(o)) throw new Error(`Named callout argument one must be a tag or number "${o}"`);
343
+ if (typeof i == "number" || !/^(?:[<>!=]=|[<>])$/.test(i)) throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i}"`);
344
+ if (typeof u == "string" && !/^[A-Za-z_]\w*$/.test(u)) throw new Error(`Named callout argument three must be a tag or number "${u}"`);
345
+ break;
346
+ case "custom":
347
+ throw new Error(`Undefined callout name "${t}"`);
348
+ default:
349
+ throw new Error(`Unexpected named callout kind "${c}"`);
350
+ }
351
+ return _r(c, n ?? null, a?.split(",") ?? null, e);
352
+ }
353
+ function _e(e) {
354
+ let r = null, t, n;
355
+ if (e[0] === "{") {
356
+ const { minStr: a, maxStr: s } = /^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups, o = 1e5;
357
+ if (+a > o || s && +s > o) throw new Error("Quantifier value unsupported in Oniguruma");
358
+ if (t = +a, n = s === void 0 ? +a : s === "" ? 1 / 0 : +s, t > n && (r = "possessive", [t, n] = [n, t]), e.endsWith("?")) {
359
+ if (r === "possessive") throw new Error('Unsupported possessive interval quantifier chain with "?"');
360
+ r = "lazy";
361
+ } else r || (r = "greedy");
362
+ } else t = e[0] === "+" ? 1 : 0, n = e[0] === "?" ? 1 : 1 / 0, r = e[1] === "+" ? "possessive" : e[1] === "?" ? "lazy" : "greedy";
363
+ return Mr(r, t, n, e);
364
+ }
365
+ function Rr(e) {
366
+ const r = e[1].toLowerCase();
367
+ return U({ d: "digit", h: "hex", s: "space", w: "word" }[r], e, { negate: e[1] !== r });
368
+ }
369
+ function Ur(e) {
370
+ const { p: r, neg: t, value: n } = /^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;
371
+ return U("property", e, { value: n, negate: r === "P" && !t || r === "p" && !!t });
372
+ }
373
+ function Me(e) {
374
+ const r = {};
375
+ return e.includes("i") && (r.ignoreCase = !0), e.includes("m") && (r.dotAll = !0), e.includes("x") && (r.extended = !0), Object.keys(r).length ? r : null;
376
+ }
377
+ function Or(e) {
378
+ const r = { ignoreCase: !1, dotAll: !1, extended: !1, digitIsAscii: !1, posixIsAscii: !1, spaceIsAscii: !1, wordIsAscii: !1, textSegmentMode: null };
379
+ for (let t = 0; t < e.length; t++) {
380
+ const n = e[t];
381
+ if (!"imxDPSWy".includes(n)) throw new Error(`Invalid flag "${n}"`);
382
+ if (n === "y") {
383
+ if (!/^y{[gw]}/.test(e.slice(t))) throw new Error('Invalid or unspecified flag "y" mode');
384
+ r.textSegmentMode = e[t + 2] === "g" ? "grapheme" : "word", t += 3;
385
+ continue;
386
+ }
387
+ r[{ i: "ignoreCase", m: "dotAll", x: "extended", D: "digitIsAscii", P: "posixIsAscii", S: "spaceIsAscii", W: "wordIsAscii" }[n]] = !0;
388
+ }
389
+ return r;
390
+ }
391
+ function Dr(e) {
392
+ if (new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))", "u").test(e)) throw new Error(`Incomplete or invalid escape "${e}"`);
393
+ const r = e[2] === "{" ? new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)", "u").exec(e).groups.hex : e.slice(2);
394
+ return parseInt(r, 16);
395
+ }
396
+ function Tr(e, r) {
397
+ const { raw: t, inCharClass: n } = e, a = t.slice(1);
398
+ if (!n && (a !== "0" && a.length === 1 || a[0] !== "0" && +a <= r)) return [Qe(t)];
399
+ const s = [], o = a.match(/^[0-7]+|\d/g);
400
+ for (let i = 0; i < o.length; i++) {
401
+ const u = o[i];
402
+ let c;
403
+ if (i === 0 && u !== "8" && u !== "9") {
404
+ if (c = parseInt(u, 8), c > 127) throw new Error(x`Octal encoded byte above 177 unsupported "${t}"`);
405
+ } else c = H(u);
406
+ s.push(L(c, (i === 0 ? "\\" : "") + u));
407
+ }
408
+ return s;
409
+ }
410
+ function Br(e) {
411
+ const r = [], t = new RegExp(xe, "gy");
412
+ let n;
413
+ for (; n = t.exec(e); ) {
414
+ const a = n[0];
415
+ if (a[0] === "{") {
416
+ const s = /^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);
417
+ if (s) {
418
+ const { min: o, max: i } = s.groups;
419
+ if (+o > +i && a.endsWith("?")) {
420
+ t.lastIndex--, r.push(_e(a.slice(0, -1)));
421
+ continue;
422
+ }
423
+ }
424
+ }
425
+ r.push(_e(a));
426
+ }
427
+ return r;
428
+ }
429
+ function Je(e, r) {
430
+ if (!Array.isArray(e.body)) throw new Error("Expected node with body array");
431
+ if (e.body.length !== 1) return !1;
432
+ const t = e.body[0];
433
+ return !r || Object.keys(r).every((n) => r[n] === t[n]);
434
+ }
435
+ function Vr(e) {
436
+ return zr.has(e.type);
437
+ }
438
+ const zr = /* @__PURE__ */ new Set(["AbsenceFunction", "Backreference", "CapturingGroup", "Character", "CharacterClass", "CharacterSet", "Group", "Quantifier", "Subroutine"]);
439
+ function Ke(e, r = {}) {
440
+ const t = { flags: "", normalizeUnknownPropertyNames: !1, skipBackrefValidation: !1, skipLookbehindValidation: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...r, rules: { captureGroup: !1, singleline: !1, ...r.rules } }, n = br(e, { flags: t.flags, rules: { captureGroup: t.rules.captureGroup, singleline: t.rules.singleline } }), a = (f, g) => {
441
+ const d = n.tokens[s.nextIndex];
442
+ switch (s.parent = f, s.nextIndex++, d.type) {
443
+ case "Alternator":
444
+ return O();
445
+ case "Assertion":
446
+ return Wr(d);
447
+ case "Backreference":
448
+ return Hr(d, s);
449
+ case "Character":
450
+ return ne(d.value, { useLastValid: !!g.isCheckingRangeEnd });
451
+ case "CharacterClassHyphen":
452
+ return jr(d, s, g);
453
+ case "CharacterClassOpen":
454
+ return Xr(d, s, g);
455
+ case "CharacterSet":
456
+ return Zr(d, s);
457
+ case "Directive":
458
+ return et(d.kind, { flags: d.flags });
459
+ case "GroupOpen":
460
+ return Qr(d, s, g);
461
+ case "NamedCallout":
462
+ return tt(d.kind, d.tag, d.arguments);
463
+ case "Quantifier":
464
+ return qr(d, s);
465
+ case "Subroutine":
466
+ return Jr(d, s);
467
+ default:
468
+ throw new Error(`Unexpected token type "${d.type}"`);
469
+ }
470
+ }, s = { capturingGroups: [], hasNumberedRef: !1, namedGroupsByName: /* @__PURE__ */ new Map(), nextIndex: 0, normalizeUnknownPropertyNames: t.normalizeUnknownPropertyNames, parent: null, skipBackrefValidation: t.skipBackrefValidation, skipLookbehindValidation: t.skipLookbehindValidation, skipPropertyNameValidation: t.skipPropertyNameValidation, subroutines: [], tokens: n.tokens, unicodePropertyMap: t.unicodePropertyMap, walk: a }, o = st(rt(n.flags));
471
+ let i = o.body[0];
472
+ for (; s.nextIndex < n.tokens.length; ) {
473
+ const f = a(i, {});
474
+ f.type === "Alternative" ? (o.body.push(f), i = f) : i.body.push(f);
475
+ }
476
+ const { capturingGroups: u, hasNumberedRef: c, namedGroupsByName: p, subroutines: l } = s;
477
+ if (c && p.size && !t.rules.captureGroup) throw new Error("Numbered backref/subroutine not allowed when using named capture");
478
+ for (const { ref: f } of l) if (typeof f == "number") {
479
+ if (f > u.length) throw new Error("Subroutine uses a group number that's not defined");
480
+ f && (u[f - 1].isSubroutined = !0);
481
+ } else if (p.has(f)) {
482
+ if (p.get(f).length > 1) throw new Error(x`Subroutine uses a duplicate group name "\g<${f}>"`);
483
+ p.get(f)[0].isSubroutined = !0;
484
+ } else throw new Error(x`Subroutine uses a group name that's not defined "\g<${f}>"`);
485
+ return o;
486
+ }
487
+ function Wr({ kind: e }) {
488
+ return ge(j({ "^": "line_start", $: "line_end", "\\A": "string_start", "\\b": "word_boundary", "\\B": "word_boundary", "\\G": "search_start", "\\y": "text_segment_boundary", "\\Y": "text_segment_boundary", "\\z": "string_end", "\\Z": "string_end_newline" }[e], `Unexpected assertion kind "${e}"`), { negate: e === x`\B` || e === x`\Y` });
489
+ }
490
+ function Hr({ raw: e }, r) {
491
+ const t = /^\\k[<']/.test(e), n = t ? e.slice(3, -1) : e.slice(1), a = (s, o = !1) => {
492
+ const i = r.capturingGroups.length;
493
+ let u = !1;
494
+ if (s > i) if (r.skipBackrefValidation) u = !0;
495
+ else throw new Error(`Not enough capturing groups defined to the left "${e}"`);
496
+ return r.hasNumberedRef = !0, he(o ? i + 1 - s : s, { orphan: u });
497
+ };
498
+ if (t) {
499
+ const s = /^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);
500
+ if (s) return a(+s.groups.num, !!s.groups.sign);
501
+ if (/[-+]/.test(n)) throw new Error(`Invalid backref name "${e}"`);
502
+ if (!r.namedGroupsByName.has(n)) throw new Error(`Group name not defined to the left "${e}"`);
503
+ return he(n);
504
+ }
505
+ return a(+n);
506
+ }
507
+ function jr(e, r, t) {
508
+ const { tokens: n, walk: a } = r, s = r.parent, o = s.body.at(-1), i = n[r.nextIndex];
509
+ if (!t.isCheckingRangeEnd && o && o.type !== "CharacterClass" && o.type !== "CharacterClassRange" && i && i.type !== "CharacterClassOpen" && i.type !== "CharacterClassClose" && i.type !== "CharacterClassIntersector") {
510
+ const u = a(s, { ...t, isCheckingRangeEnd: !0 });
511
+ if (o.type === "Character" && u.type === "Character") return s.body.pop(), Yr(o, u);
512
+ throw new Error("Invalid character class range");
513
+ }
514
+ return ne(H("-"));
515
+ }
516
+ function Xr({ negate: e }, r, t) {
517
+ const { tokens: n, walk: a } = r, s = n[r.nextIndex], o = [re()];
518
+ let i = Fe(s);
519
+ for (; i.type !== "CharacterClassClose"; ) {
520
+ if (i.type === "CharacterClassIntersector") o.push(re()), r.nextIndex++;
521
+ else {
522
+ const c = o.at(-1);
523
+ c.body.push(a(c, t));
524
+ }
525
+ i = Fe(n[r.nextIndex], s);
526
+ }
527
+ const u = re({ negate: e });
528
+ return o.length === 1 ? u.body = o[0].body : (u.kind = "intersection", u.body = o.map((c) => c.body.length === 1 ? c.body[0] : c)), r.nextIndex++, u;
529
+ }
530
+ function Zr({ kind: e, negate: r, value: t }, n) {
531
+ const { normalizeUnknownPropertyNames: a, skipPropertyNameValidation: s, unicodePropertyMap: o } = n;
532
+ if (e === "property") {
533
+ const i = se(t);
534
+ if (Ce.has(i) && !o?.has(i)) e = "posix", t = i;
535
+ else return W(t, { negate: r, normalizeUnknownPropertyNames: a, skipPropertyNameValidation: s, unicodePropertyMap: o });
536
+ }
537
+ return e === "posix" ? nt(t, { negate: r }) : we(e, { negate: r });
538
+ }
539
+ function Qr(e, r, t) {
540
+ const { tokens: n, capturingGroups: a, namedGroupsByName: s, skipLookbehindValidation: o, walk: i } = r, u = at(e), c = u.type === "AbsenceFunction", p = Le(u), l = p && u.negate;
541
+ if (u.type === "CapturingGroup" && (a.push(u), u.name && yr(s, u.name, []).push(u)), c && t.isInAbsenceFunction) throw new Error("Nested absence function not supported by Oniguruma");
542
+ let f = Ge(n[r.nextIndex]);
543
+ for (; f.type !== "GroupClose"; ) {
544
+ if (f.type === "Alternator") u.body.push(O()), r.nextIndex++;
545
+ else {
546
+ const g = u.body.at(-1), d = i(g, { ...t, isInAbsenceFunction: t.isInAbsenceFunction || c, isInLookbehind: t.isInLookbehind || p, isInNegLookbehind: t.isInNegLookbehind || l });
547
+ if (g.body.push(d), (p || t.isInLookbehind) && !o) {
548
+ const w = "Lookbehind includes a pattern not allowed by Oniguruma";
549
+ if (l || t.isInNegLookbehind) {
550
+ if (Ne(d) || d.type === "CapturingGroup") throw new Error(w);
551
+ } else if (Ne(d) || Le(d) && d.negate) throw new Error(w);
552
+ }
553
+ }
554
+ f = Ge(n[r.nextIndex]);
555
+ }
556
+ return r.nextIndex++, u;
557
+ }
558
+ function qr({ kind: e, min: r, max: t }, n) {
559
+ const a = n.parent, s = a.body.at(-1);
560
+ if (!s || !Vr(s)) throw new Error("Quantifier requires a repeatable token");
561
+ const o = er(e, r, t, s);
562
+ return a.body.pop(), o;
563
+ }
564
+ function Jr({ raw: e }, r) {
565
+ const { capturingGroups: t, subroutines: n } = r;
566
+ let a = e.slice(3, -1);
567
+ const s = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);
568
+ if (s) {
569
+ const i = +s.groups.num, u = t.length;
570
+ if (r.hasNumberedRef = !0, a = { "": i, "+": u + i, "-": u + 1 - i }[s.groups.sign], a < 1) throw new Error("Invalid subroutine number");
571
+ } else a === "0" && (a = 0);
572
+ const o = rr(a);
573
+ return n.push(o), o;
574
+ }
575
+ function Kr(e, r) {
576
+ return { type: "AbsenceFunction", kind: e, body: q(r?.body) };
577
+ }
578
+ function O(e) {
579
+ return { type: "Alternative", body: tr(e?.body) };
580
+ }
581
+ function ge(e, r) {
582
+ const t = { type: "Assertion", kind: e };
583
+ return (e === "word_boundary" || e === "text_segment_boundary") && (t.negate = !!r?.negate), t;
584
+ }
585
+ function he(e, r) {
586
+ const t = !!r?.orphan;
587
+ return { type: "Backreference", ref: e, ...t && { orphan: t } };
588
+ }
589
+ function Ye(e, r) {
590
+ const t = { name: void 0, isSubroutined: !1, ...r };
591
+ if (t.name !== void 0 && !ot(t.name)) throw new Error(`Group name "${t.name}" invalid in Oniguruma`);
592
+ return { type: "CapturingGroup", number: e, ...t.name && { name: t.name }, ...t.isSubroutined && { isSubroutined: t.isSubroutined }, body: q(r?.body) };
593
+ }
594
+ function ne(e, r) {
595
+ const t = { useLastValid: !1, ...r };
596
+ if (e > 1114111) {
597
+ const n = e.toString(16);
598
+ if (t.useLastValid) e = 1114111;
599
+ else throw e > 1310719 ? new Error(`Invalid code point out of range "\\x{${n}}"`) : new Error(`Invalid code point out of range in JS "\\x{${n}}"`);
600
+ }
601
+ return { type: "Character", value: e };
602
+ }
603
+ function re(e) {
604
+ const r = { kind: "union", negate: !1, ...e };
605
+ return { type: "CharacterClass", kind: r.kind, negate: r.negate, body: tr(e?.body) };
606
+ }
607
+ function Yr(e, r) {
608
+ if (r.value < e.value) throw new Error("Character class range out of order");
609
+ return { type: "CharacterClassRange", min: e, max: r };
610
+ }
611
+ function we(e, r) {
612
+ const t = !!r?.negate, n = { type: "CharacterSet", kind: e };
613
+ return (e === "digit" || e === "hex" || e === "newline" || e === "space" || e === "word") && (n.negate = t), (e === "text_segment" || e === "newline" && !t) && (n.variableLength = !0), n;
614
+ }
615
+ function et(e, r = {}) {
616
+ if (e === "keep") return { type: "Directive", kind: e };
617
+ if (e === "flags") return { type: "Directive", kind: e, flags: j(r.flags) };
618
+ throw new Error(`Unexpected directive kind "${e}"`);
619
+ }
620
+ function rt(e) {
621
+ return { type: "Flags", ...e };
622
+ }
623
+ function v(e) {
624
+ const r = e?.atomic, t = e?.flags;
625
+ if (r && t) throw new Error("Atomic group cannot have flags");
626
+ return { type: "Group", ...r && { atomic: r }, ...t && { flags: t }, body: q(e?.body) };
627
+ }
628
+ function R(e) {
629
+ const r = { behind: !1, negate: !1, ...e };
630
+ return { type: "LookaroundAssertion", kind: r.behind ? "lookbehind" : "lookahead", negate: r.negate, body: q(e?.body) };
631
+ }
632
+ function tt(e, r, t) {
633
+ return { type: "NamedCallout", kind: e, tag: r, arguments: t };
634
+ }
635
+ function nt(e, r) {
636
+ const t = !!r?.negate;
637
+ if (!Ce.has(e)) throw new Error(`Invalid POSIX class "${e}"`);
638
+ return { type: "CharacterSet", kind: "posix", value: e, negate: t };
639
+ }
640
+ function er(e, r, t, n) {
641
+ if (r > t) throw new Error("Invalid reversed quantifier range");
642
+ return { type: "Quantifier", kind: e, min: r, max: t, body: n };
643
+ }
644
+ function st(e, r) {
645
+ return { type: "Regex", body: q(r?.body), flags: e };
646
+ }
647
+ function rr(e) {
648
+ return { type: "Subroutine", ref: e };
649
+ }
650
+ function W(e, r) {
651
+ const t = { negate: !1, normalizeUnknownPropertyNames: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...r };
652
+ let n = t.unicodePropertyMap?.get(se(e));
653
+ if (!n) {
654
+ if (t.normalizeUnknownPropertyNames) n = it(e);
655
+ else if (t.unicodePropertyMap && !t.skipPropertyNameValidation) throw new Error(x`Invalid Unicode property "\p{${e}}"`);
656
+ }
657
+ return { type: "CharacterSet", kind: "property", value: n ?? e, negate: t.negate };
658
+ }
659
+ function at({ flags: e, kind: r, name: t, negate: n, number: a }) {
660
+ switch (r) {
661
+ case "absence_repeater":
662
+ return Kr("repeater");
663
+ case "atomic":
664
+ return v({ atomic: !0 });
665
+ case "capturing":
666
+ return Ye(a, { name: t });
667
+ case "group":
668
+ return v({ flags: e });
669
+ case "lookahead":
670
+ case "lookbehind":
671
+ return R({ behind: r === "lookbehind", negate: n });
672
+ default:
673
+ throw new Error(`Unexpected group kind "${r}"`);
674
+ }
675
+ }
676
+ function q(e) {
677
+ if (e === void 0) e = [O()];
678
+ else if (!Array.isArray(e) || !e.length || !e.every((r) => r.type === "Alternative")) throw new Error("Invalid body; expected array of one or more Alternative nodes");
679
+ return e;
680
+ }
681
+ function tr(e) {
682
+ if (e === void 0) e = [];
683
+ else if (!Array.isArray(e) || !e.every((r) => !!r.type)) throw new Error("Invalid body; expected array of nodes");
684
+ return e;
685
+ }
686
+ function Ne(e) {
687
+ return e.type === "LookaroundAssertion" && e.kind === "lookahead";
688
+ }
689
+ function Le(e) {
690
+ return e.type === "LookaroundAssertion" && e.kind === "lookbehind";
691
+ }
692
+ function ot(e) {
693
+ return /^[\p{Alpha}\p{Pc}][^)]*$/u.test(e);
694
+ }
695
+ function it(e) {
696
+ return e.trim().replace(/[- _]+/g, "_").replace(/[A-Z][a-z]+(?=[A-Z])/g, "$&_").replace(/[A-Za-z]+/g, (r) => r[0].toUpperCase() + r.slice(1).toLowerCase());
697
+ }
698
+ function se(e) {
699
+ return e.replace(/[- _]+/g, "").toLowerCase();
700
+ }
701
+ function Fe(e, r) {
702
+ return j(e, `${r?.type === "Character" && r.value === 93 ? "Empty" : "Unclosed"} character class`);
703
+ }
704
+ function Ge(e) {
705
+ return j(e, "Unclosed group");
706
+ }
707
+ function Z(e, r, t = null) {
708
+ function n(s, o) {
709
+ for (let i = 0; i < s.length; i++) {
710
+ const u = a(s[i], o, i, s);
711
+ i = Math.max(-1, i + u);
712
+ }
713
+ }
714
+ function a(s, o = null, i = null, u = null) {
715
+ let c = 0, p = !1;
716
+ const l = { node: s, parent: o, key: i, container: u, root: e, remove() {
717
+ Y(u).splice(Math.max(0, B(i) + c), 1), c--, p = !0;
718
+ }, removeAllNextSiblings() {
719
+ return Y(u).splice(B(i) + 1);
720
+ }, removeAllPrevSiblings() {
721
+ const y = B(i) + c;
722
+ return c -= y, Y(u).splice(0, Math.max(0, y));
723
+ }, replaceWith(y, $ = {}) {
724
+ const E = !!$.traverse;
725
+ u ? u[Math.max(0, B(i) + c)] = y : j(o, "Can't replace root node")[i] = y, E && a(y, o, i, u), p = !0;
726
+ }, replaceWithMultiple(y, $ = {}) {
727
+ const E = !!$.traverse;
728
+ if (Y(u).splice(Math.max(0, B(i) + c), 1, ...y), c += y.length - 1, E) {
729
+ let k = 0;
730
+ for (let A = 0; A < y.length; A++) k += a(y[A], o, B(i) + A + k, u);
731
+ }
732
+ p = !0;
733
+ }, skip() {
734
+ p = !0;
735
+ } }, { type: f } = s, g = r["*"], d = r[f], w = typeof g == "function" ? g : g?.enter, m = typeof d == "function" ? d : d?.enter;
736
+ if (w?.(l, t), m?.(l, t), !p) switch (f) {
737
+ case "AbsenceFunction":
738
+ case "CapturingGroup":
739
+ case "Group":
740
+ n(s.body, s);
741
+ break;
742
+ case "Alternative":
743
+ case "CharacterClass":
744
+ n(s.body, s);
745
+ break;
746
+ case "Assertion":
747
+ case "Backreference":
748
+ case "Character":
749
+ case "CharacterSet":
750
+ case "Directive":
751
+ case "Flags":
752
+ case "NamedCallout":
753
+ case "Subroutine":
754
+ break;
755
+ case "CharacterClassRange":
756
+ a(s.min, s, "min"), a(s.max, s, "max");
757
+ break;
758
+ case "LookaroundAssertion":
759
+ n(s.body, s);
760
+ break;
761
+ case "Quantifier":
762
+ a(s.body, s, "body");
763
+ break;
764
+ case "Regex":
765
+ n(s.body, s), a(s.flags, s, "flags");
766
+ break;
767
+ default:
768
+ throw new Error(`Unexpected node type "${f}"`);
769
+ }
770
+ return d?.exit?.(l, t), g?.exit?.(l, t), c;
771
+ }
772
+ return a(e), e;
773
+ }
774
+ function Y(e) {
775
+ if (!Array.isArray(e)) throw new Error("Container expected");
776
+ return e;
777
+ }
778
+ function B(e) {
779
+ if (typeof e != "number") throw new Error("Numeric key expected");
780
+ return e;
781
+ }
782
+ const ut = String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;
783
+ function ct(e, r) {
784
+ for (let t = 0; t < e.length; t++)
785
+ e[t] >= r && e[t]++;
786
+ }
787
+ function lt(e, r, t, n) {
788
+ return e.slice(0, r) + n + e.slice(r + t.length);
789
+ }
790
+ const S = Object.freeze({
791
+ DEFAULT: "DEFAULT",
792
+ CHAR_CLASS: "CHAR_CLASS"
793
+ });
794
+ function ke(e, r, t, n) {
795
+ const a = new RegExp(String.raw`${r}|(?<$skip>\[\^?|\\?.)`, "gsu"), s = [!1];
796
+ let o = 0, i = "";
797
+ for (const u of e.matchAll(a)) {
798
+ const { 0: c, groups: { $skip: p } } = u;
799
+ if (!p && (!n || n === S.DEFAULT == !o)) {
800
+ t instanceof Function ? i += t(u, {
801
+ context: o ? S.CHAR_CLASS : S.DEFAULT,
802
+ negated: s[s.length - 1]
803
+ }) : i += t;
804
+ continue;
805
+ }
806
+ c[0] === "[" ? (o++, s.push(c[1] === "^")) : c === "]" && o && (o--, s.pop()), i += c;
807
+ }
808
+ return i;
809
+ }
810
+ function nr(e, r, t, n) {
811
+ ke(e, r, t, n);
812
+ }
813
+ function pt(e, r, t = 0, n) {
814
+ if (!new RegExp(r, "su").test(e))
815
+ return null;
816
+ const a = new RegExp(`${r}|(?<$skip>\\\\?.)`, "gsu");
817
+ a.lastIndex = t;
818
+ let s = 0, o;
819
+ for (; o = a.exec(e); ) {
820
+ const { 0: i, groups: { $skip: u } } = o;
821
+ if (!u && (!n || n === S.DEFAULT == !s))
822
+ return o;
823
+ i === "[" ? s++ : i === "]" && s && s--, a.lastIndex == o.index && a.lastIndex++;
824
+ }
825
+ return null;
826
+ }
827
+ function ee(e, r, t) {
828
+ return !!pt(e, r, 0, t);
829
+ }
830
+ function ft(e, r) {
831
+ const t = /\\?./gsu;
832
+ t.lastIndex = r;
833
+ let n = e.length, a = 0, s = 1, o;
834
+ for (; o = t.exec(e); ) {
835
+ const [i] = o;
836
+ if (i === "[")
837
+ a++;
838
+ else if (a)
839
+ i === "]" && a--;
840
+ else if (i === "(")
841
+ s++;
842
+ else if (i === ")" && (s--, !s)) {
843
+ n = o.index;
844
+ break;
845
+ }
846
+ }
847
+ return e.slice(r, n);
848
+ }
849
+ const Pe = new RegExp(String.raw`(?<noncapturingStart>${ut})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`, "gsu");
850
+ function dt(e, r) {
851
+ const t = r?.hiddenCaptures ?? [];
852
+ let n = r?.captureTransfers ?? /* @__PURE__ */ new Map();
853
+ if (!/\(\?>/.test(e))
854
+ return {
855
+ pattern: e,
856
+ captureTransfers: n,
857
+ hiddenCaptures: t
858
+ };
859
+ const a = "(?>", s = "(?:(?=(", o = [0], i = [];
860
+ let u = 0, c = 0, p = NaN, l;
861
+ do {
862
+ l = !1;
863
+ let f = 0, g = 0, d = !1, w;
864
+ for (Pe.lastIndex = Number.isNaN(p) ? 0 : p + s.length; w = Pe.exec(e); ) {
865
+ const { 0: m, index: y, groups: { capturingStart: $, noncapturingStart: E } } = w;
866
+ if (m === "[")
867
+ f++;
868
+ else if (f)
869
+ m === "]" && f--;
870
+ else if (m === a && !d)
871
+ p = y, d = !0;
872
+ else if (d && E)
873
+ g++;
874
+ else if ($)
875
+ d ? g++ : (u++, o.push(u + c));
876
+ else if (m === ")" && d) {
877
+ if (!g) {
878
+ c++;
879
+ const k = u + c;
880
+ if (e = `${e.slice(0, p)}${s}${e.slice(p + a.length, y)}))<$$${k}>)${e.slice(y + 1)}`, l = !0, i.push(k), ct(t, k), n.size) {
881
+ const A = /* @__PURE__ */ new Map();
882
+ n.forEach((J, D) => {
883
+ A.set(
884
+ D >= k ? D + 1 : D,
885
+ J.map((T) => T >= k ? T + 1 : T)
886
+ );
887
+ }), n = A;
888
+ }
889
+ break;
890
+ }
891
+ g--;
892
+ }
893
+ }
894
+ } while (l);
895
+ return t.push(...i), e = ke(
896
+ e,
897
+ String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,
898
+ ({ 0: f, groups: { backrefNum: g, wrappedBackrefNum: d } }) => {
899
+ if (g) {
900
+ const w = +g;
901
+ if (w > o.length - 1)
902
+ throw new Error(`Backref "${f}" greater than number of captures`);
903
+ return `\\${o[w]}`;
904
+ }
905
+ return `\\${d}`;
906
+ },
907
+ S.DEFAULT
908
+ ), {
909
+ pattern: e,
910
+ captureTransfers: n,
911
+ hiddenCaptures: t
912
+ };
913
+ }
914
+ const sr = String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`, ue = new RegExp(String.raw`
915
+ \\(?: \d+
916
+ | c[A-Za-z]
917
+ | [gk]<[^>]+>
918
+ | [pPu]\{[^\}]+\}
919
+ | u[A-Fa-f\d]{4}
920
+ | x[A-Fa-f\d]{2}
921
+ )
922
+ | \((?: \? (?: [:=!>]
923
+ | <(?:[=!]|[^>]+>)
924
+ | [A-Za-z\-]+:
925
+ | \(DEFINE\)
926
+ ))?
927
+ | (?<qBase>${sr})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
928
+ | \\?.
929
+ `.replace(/\s+/g, ""), "gsu");
930
+ function gt(e) {
931
+ if (!new RegExp(`${sr}\\+`).test(e))
932
+ return {
933
+ pattern: e
934
+ };
935
+ const r = [];
936
+ let t = null, n = null, a = "", s = 0, o;
937
+ for (ue.lastIndex = 0; o = ue.exec(e); ) {
938
+ const { 0: i, index: u, groups: { qBase: c, qMod: p, invalidQ: l } } = o;
939
+ if (i === "[")
940
+ s || (n = u), s++;
941
+ else if (i === "]")
942
+ s ? s-- : n = null;
943
+ else if (!s)
944
+ if (p === "+" && a && !a.startsWith("(")) {
945
+ if (l)
946
+ throw new Error(`Invalid quantifier "${i}"`);
947
+ let f = -1;
948
+ if (/^\{\d+\}$/.test(c))
949
+ e = lt(e, u + c.length, p, "");
950
+ else {
951
+ if (a === ")" || a === "]") {
952
+ const g = a === ")" ? t : n;
953
+ if (g === null)
954
+ throw new Error(`Invalid unmatched "${a}"`);
955
+ e = `${e.slice(0, g)}(?>${e.slice(g, u)}${c})${e.slice(u + i.length)}`;
956
+ } else
957
+ e = `${e.slice(0, u - a.length)}(?>${a}${c})${e.slice(u + i.length)}`;
958
+ f += 4;
959
+ }
960
+ ue.lastIndex += f;
961
+ } else i[0] === "(" ? r.push(u) : i === ")" && (t = r.length ? r.pop() : null);
962
+ a = i;
963
+ }
964
+ return {
965
+ pattern: e
966
+ };
967
+ }
968
+ const I = String.raw, ht = I`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`, me = I`\(\?R=(?<rDepth>[^\)]+)\)|${ht}`, ae = I`\(\?<(?![=!])(?<captureName>[^>]+)>`, ar = I`${ae}|(?<unnamed>\()(?!\?)`, P = new RegExp(I`${ae}|${me}|\(\?|\\?.`, "gsu"), ce = "Cannot use multiple overlapping recursions";
969
+ function wt(e, r) {
970
+ const { hiddenCaptures: t, mode: n } = {
971
+ hiddenCaptures: [],
972
+ mode: "plugin",
973
+ ...r
974
+ };
975
+ let a = r?.captureTransfers ?? /* @__PURE__ */ new Map();
976
+ if (!new RegExp(me, "su").test(e))
977
+ return {
978
+ pattern: e,
979
+ captureTransfers: a,
980
+ hiddenCaptures: t
981
+ };
982
+ if (n === "plugin" && ee(e, I`\(\?\(DEFINE\)`, S.DEFAULT))
983
+ throw new Error("DEFINE groups cannot be used with recursion");
984
+ const s = [], o = ee(e, I`\\[1-9]`, S.DEFAULT), i = /* @__PURE__ */ new Map(), u = [];
985
+ let c = !1, p = 0, l = 0, f;
986
+ for (P.lastIndex = 0; f = P.exec(e); ) {
987
+ const { 0: g, groups: { captureName: d, rDepth: w, gRNameOrNum: m, gRDepth: y } } = f;
988
+ if (g === "[")
989
+ p++;
990
+ else if (p)
991
+ g === "]" && p--;
992
+ else if (w) {
993
+ if (Re(w), c)
994
+ throw new Error(ce);
995
+ if (o)
996
+ throw new Error(
997
+ // When used in `external` mode by transpilers other than Regex+, backrefs might have
998
+ // gone through conversion from named to numbered, so avoid a misleading error
999
+ `${n === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with global recursion`
1000
+ );
1001
+ const $ = e.slice(0, f.index), E = e.slice(P.lastIndex);
1002
+ if (ee(E, me, S.DEFAULT))
1003
+ throw new Error(ce);
1004
+ const k = +w - 1;
1005
+ e = Ue(
1006
+ $,
1007
+ E,
1008
+ k,
1009
+ !1,
1010
+ t,
1011
+ s,
1012
+ l
1013
+ ), a = De(
1014
+ a,
1015
+ $,
1016
+ k,
1017
+ s.length,
1018
+ 0,
1019
+ l
1020
+ );
1021
+ break;
1022
+ } else if (m) {
1023
+ Re(y);
1024
+ let $ = !1;
1025
+ for (const X of u)
1026
+ if (X.name === m || X.num === +m) {
1027
+ if ($ = !0, X.hasRecursedWithin)
1028
+ throw new Error(ce);
1029
+ break;
1030
+ }
1031
+ if (!$)
1032
+ throw new Error(I`Recursive \g cannot be used outside the referenced group "${n === "external" ? m : I`\g<${m}&R=${y}>`}"`);
1033
+ const E = i.get(m), k = ft(e, E);
1034
+ if (o && ee(k, I`${ae}|\((?!\?)`, S.DEFAULT))
1035
+ throw new Error(
1036
+ // When used in `external` mode by transpilers other than Regex+, backrefs might have
1037
+ // gone through conversion from named to numbered, so avoid a misleading error
1038
+ `${n === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with recursion of capturing groups`
1039
+ );
1040
+ const A = e.slice(E, f.index), J = k.slice(A.length + g.length), D = s.length, T = +y - 1, Ae = Ue(
1041
+ A,
1042
+ J,
1043
+ T,
1044
+ !0,
1045
+ t,
1046
+ s,
1047
+ l
1048
+ );
1049
+ a = De(
1050
+ a,
1051
+ A,
1052
+ T,
1053
+ s.length - D,
1054
+ D,
1055
+ l
1056
+ );
1057
+ const wr = e.slice(0, E), mr = e.slice(E + k.length);
1058
+ e = `${wr}${Ae}${mr}`, P.lastIndex += Ae.length - g.length - A.length - J.length, u.forEach((X) => X.hasRecursedWithin = !0), c = !0;
1059
+ } else if (d)
1060
+ l++, i.set(String(l), P.lastIndex), i.set(d, P.lastIndex), u.push({
1061
+ num: l,
1062
+ name: d
1063
+ });
1064
+ else if (g[0] === "(") {
1065
+ const $ = g === "(";
1066
+ $ && (l++, i.set(String(l), P.lastIndex)), u.push($ ? { num: l } : {});
1067
+ } else g === ")" && u.pop();
1068
+ }
1069
+ return t.push(...s), {
1070
+ pattern: e,
1071
+ captureTransfers: a,
1072
+ hiddenCaptures: t
1073
+ };
1074
+ }
1075
+ function Re(e) {
1076
+ const r = `Max depth must be integer between 2 and 100; used ${e}`;
1077
+ if (!/^[1-9]\d*$/.test(e))
1078
+ throw new Error(r);
1079
+ if (e = +e, e < 2 || e > 100)
1080
+ throw new Error(r);
1081
+ }
1082
+ function Ue(e, r, t, n, a, s, o) {
1083
+ const i = /* @__PURE__ */ new Set();
1084
+ n && nr(e + r, ae, ({ groups: { captureName: c } }) => {
1085
+ i.add(c);
1086
+ }, S.DEFAULT);
1087
+ const u = [
1088
+ t,
1089
+ n ? i : null,
1090
+ a,
1091
+ s,
1092
+ o
1093
+ ];
1094
+ return `${e}${Oe(`(?:${e}`, "forward", ...u)}(?:)${Oe(`${r})`, "backward", ...u)}${r}`;
1095
+ }
1096
+ function Oe(e, r, t, n, a, s, o) {
1097
+ const u = (p) => r === "forward" ? p + 2 : t - p + 2 - 1;
1098
+ let c = "";
1099
+ for (let p = 0; p < t; p++) {
1100
+ const l = u(p);
1101
+ c += ke(
1102
+ e,
1103
+ I`${ar}|\\k<(?<backref>[^>]+)>`,
1104
+ ({ 0: f, groups: { captureName: g, unnamed: d, backref: w } }) => {
1105
+ if (w && n && !n.has(w))
1106
+ return f;
1107
+ const m = `_$${l}`;
1108
+ if (d || g) {
1109
+ const y = o + s.length + 1;
1110
+ return s.push(y), mt(a, y), d ? f : `(?<${g}${m}>`;
1111
+ }
1112
+ return I`\k<${w}${m}>`;
1113
+ },
1114
+ S.DEFAULT
1115
+ );
1116
+ }
1117
+ return c;
1118
+ }
1119
+ function mt(e, r) {
1120
+ for (let t = 0; t < e.length; t++)
1121
+ e[t] >= r && e[t]++;
1122
+ }
1123
+ function De(e, r, t, n, a, s) {
1124
+ if (e.size && n) {
1125
+ let o = 0;
1126
+ nr(r, ar, () => o++, S.DEFAULT);
1127
+ const i = s - o + a, u = /* @__PURE__ */ new Map();
1128
+ return e.forEach((c, p) => {
1129
+ const l = (n - o * t) / t, f = o * t, g = p > i + o ? p + n : p, d = [];
1130
+ for (const w of c)
1131
+ if (w <= i)
1132
+ d.push(w);
1133
+ else if (w > i + o + l)
1134
+ d.push(w + n);
1135
+ else if (w <= i + o)
1136
+ for (let m = 0; m <= t; m++)
1137
+ d.push(w + o * m);
1138
+ else
1139
+ for (let m = 0; m <= t; m++)
1140
+ d.push(w + f + l * m);
1141
+ u.set(g, d);
1142
+ }), u;
1143
+ }
1144
+ return e;
1145
+ }
1146
+ var C = String.fromCodePoint, h = String.raw, _ = {}, oe = globalThis.RegExp;
1147
+ _.flagGroups = (() => {
1148
+ try {
1149
+ new oe("(?i:)");
1150
+ } catch {
1151
+ return !1;
1152
+ }
1153
+ return !0;
1154
+ })();
1155
+ _.unicodeSets = (() => {
1156
+ try {
1157
+ new oe("[[]]", "v");
1158
+ } catch {
1159
+ return !1;
1160
+ }
1161
+ return !0;
1162
+ })();
1163
+ _.bugFlagVLiteralHyphenIsRange = _.unicodeSets ? (() => {
1164
+ try {
1165
+ new oe(h`[\d\-a]`, "v");
1166
+ } catch {
1167
+ return !0;
1168
+ }
1169
+ return !1;
1170
+ })() : !1;
1171
+ _.bugNestedClassIgnoresNegation = _.unicodeSets && new oe("[[^a]]", "v").test("a");
1172
+ function te(e, { enable: r, disable: t }) {
1173
+ return {
1174
+ dotAll: !t?.dotAll && !!(r?.dotAll || e.dotAll),
1175
+ ignoreCase: !t?.ignoreCase && !!(r?.ignoreCase || e.ignoreCase)
1176
+ };
1177
+ }
1178
+ function Q(e, r, t) {
1179
+ return e.has(r) || e.set(r, t), e.get(r);
1180
+ }
1181
+ function ye(e, r) {
1182
+ return Te[e] >= Te[r];
1183
+ }
1184
+ function yt(e, r) {
1185
+ if (e == null)
1186
+ throw new Error(r ?? "Value expected");
1187
+ return e;
1188
+ }
1189
+ var Te = {
1190
+ ES2025: 2025,
1191
+ ES2024: 2024,
1192
+ ES2018: 2018
1193
+ }, bt = (
1194
+ /** @type {const} */
1195
+ {
1196
+ auto: "auto",
1197
+ ES2025: "ES2025",
1198
+ ES2024: "ES2024",
1199
+ ES2018: "ES2018"
1200
+ }
1201
+ );
1202
+ function or(e = {}) {
1203
+ if ({}.toString.call(e) !== "[object Object]")
1204
+ throw new Error("Unexpected options");
1205
+ if (e.target !== void 0 && !bt[e.target])
1206
+ throw new Error(`Unexpected target "${e.target}"`);
1207
+ const r = {
1208
+ // Sets the level of emulation rigor/strictness.
1209
+ accuracy: "default",
1210
+ // Disables advanced emulation that relies on returning a `RegExp` subclass, resulting in
1211
+ // certain patterns not being emulatable.
1212
+ avoidSubclass: !1,
1213
+ // Oniguruma flags; a string with `i`, `m`, `x`, `D`, `S`, `W`, `y{g}` in any order (all
1214
+ // optional). Oniguruma's `m` is equivalent to JavaScript's `s` (`dotAll`).
1215
+ flags: "",
1216
+ // Include JavaScript flag `g` (`global`) in the result.
1217
+ global: !1,
1218
+ // Include JavaScript flag `d` (`hasIndices`) in the result.
1219
+ hasIndices: !1,
1220
+ // Delay regex construction until first use if the transpiled pattern is at least this length.
1221
+ lazyCompileLength: 1 / 0,
1222
+ // JavaScript version used for generated regexes. Using `auto` detects the best value based on
1223
+ // your environment. Later targets allow faster processing, simpler generated source, and
1224
+ // support for additional features.
1225
+ target: "auto",
1226
+ // Disables minifications that simplify the pattern without changing the meaning.
1227
+ verbose: !1,
1228
+ ...e,
1229
+ // Advanced options that override standard behavior, error checking, and flags when enabled.
1230
+ rules: {
1231
+ // Useful with TextMate grammars that merge backreferences across patterns.
1232
+ allowOrphanBackrefs: !1,
1233
+ // Use ASCII `\b` and `\B`, which increases search performance of generated regexes.
1234
+ asciiWordBoundaries: !1,
1235
+ // Allow unnamed captures and numbered calls (backreferences and subroutines) when using
1236
+ // named capture. This is Oniguruma option `ONIG_OPTION_CAPTURE_GROUP`; on by default in
1237
+ // `vscode-oniguruma`.
1238
+ captureGroup: !1,
1239
+ // Change the recursion depth limit from Oniguruma's `20` to an integer `2`–`20`.
1240
+ recursionLimit: 20,
1241
+ // `^` as `\A`; `$` as`\Z`. Improves search performance of generated regexes without changing
1242
+ // the meaning if searching line by line. This is Oniguruma option `ONIG_OPTION_SINGLELINE`.
1243
+ singleline: !1,
1244
+ ...e.rules
1245
+ }
1246
+ };
1247
+ return r.target === "auto" && (r.target = _.flagGroups ? "ES2025" : _.unicodeSets ? "ES2024" : "ES2018"), r;
1248
+ }
1249
+ var Ct = "[ -\r ]", xt = /* @__PURE__ */ new Set([
1250
+ C(304),
1251
+ // İ
1252
+ C(305)
1253
+ // ı
1254
+ ]), M = h`[\p{L}\p{M}\p{N}\p{Pc}]`;
1255
+ function ir(e) {
1256
+ if (xt.has(e))
1257
+ return [e];
1258
+ const r = /* @__PURE__ */ new Set(), t = e.toLowerCase(), n = t.toUpperCase(), a = Et.get(t), s = kt.get(t), o = $t.get(t);
1259
+ return [...n].length === 1 && r.add(n), o && r.add(o), a && r.add(a), r.add(t), s && r.add(s), [...r];
1260
+ }
1261
+ var $e = /* @__PURE__ */ new Map(
1262
+ `C Other
1263
+ Cc Control cntrl
1264
+ Cf Format
1265
+ Cn Unassigned
1266
+ Co Private_Use
1267
+ Cs Surrogate
1268
+ L Letter
1269
+ LC Cased_Letter
1270
+ Ll Lowercase_Letter
1271
+ Lm Modifier_Letter
1272
+ Lo Other_Letter
1273
+ Lt Titlecase_Letter
1274
+ Lu Uppercase_Letter
1275
+ M Mark Combining_Mark
1276
+ Mc Spacing_Mark
1277
+ Me Enclosing_Mark
1278
+ Mn Nonspacing_Mark
1279
+ N Number
1280
+ Nd Decimal_Number digit
1281
+ Nl Letter_Number
1282
+ No Other_Number
1283
+ P Punctuation punct
1284
+ Pc Connector_Punctuation
1285
+ Pd Dash_Punctuation
1286
+ Pe Close_Punctuation
1287
+ Pf Final_Punctuation
1288
+ Pi Initial_Punctuation
1289
+ Po Other_Punctuation
1290
+ Ps Open_Punctuation
1291
+ S Symbol
1292
+ Sc Currency_Symbol
1293
+ Sk Modifier_Symbol
1294
+ Sm Math_Symbol
1295
+ So Other_Symbol
1296
+ Z Separator
1297
+ Zl Line_Separator
1298
+ Zp Paragraph_Separator
1299
+ Zs Space_Separator
1300
+ ASCII
1301
+ ASCII_Hex_Digit AHex
1302
+ Alphabetic Alpha
1303
+ Any
1304
+ Assigned
1305
+ Bidi_Control Bidi_C
1306
+ Bidi_Mirrored Bidi_M
1307
+ Case_Ignorable CI
1308
+ Cased
1309
+ Changes_When_Casefolded CWCF
1310
+ Changes_When_Casemapped CWCM
1311
+ Changes_When_Lowercased CWL
1312
+ Changes_When_NFKC_Casefolded CWKCF
1313
+ Changes_When_Titlecased CWT
1314
+ Changes_When_Uppercased CWU
1315
+ Dash
1316
+ Default_Ignorable_Code_Point DI
1317
+ Deprecated Dep
1318
+ Diacritic Dia
1319
+ Emoji
1320
+ Emoji_Component EComp
1321
+ Emoji_Modifier EMod
1322
+ Emoji_Modifier_Base EBase
1323
+ Emoji_Presentation EPres
1324
+ Extended_Pictographic ExtPict
1325
+ Extender Ext
1326
+ Grapheme_Base Gr_Base
1327
+ Grapheme_Extend Gr_Ext
1328
+ Hex_Digit Hex
1329
+ IDS_Binary_Operator IDSB
1330
+ IDS_Trinary_Operator IDST
1331
+ ID_Continue IDC
1332
+ ID_Start IDS
1333
+ Ideographic Ideo
1334
+ Join_Control Join_C
1335
+ Logical_Order_Exception LOE
1336
+ Lowercase Lower
1337
+ Math
1338
+ Noncharacter_Code_Point NChar
1339
+ Pattern_Syntax Pat_Syn
1340
+ Pattern_White_Space Pat_WS
1341
+ Quotation_Mark QMark
1342
+ Radical
1343
+ Regional_Indicator RI
1344
+ Sentence_Terminal STerm
1345
+ Soft_Dotted SD
1346
+ Terminal_Punctuation Term
1347
+ Unified_Ideograph UIdeo
1348
+ Uppercase Upper
1349
+ Variation_Selector VS
1350
+ White_Space space
1351
+ XID_Continue XIDC
1352
+ XID_Start XIDS`.split(/\s/).map((e) => [se(e), e])
1353
+ ), kt = /* @__PURE__ */ new Map([
1354
+ ["s", C(383)],
1355
+ // s, ſ
1356
+ [C(383), "s"]
1357
+ // ſ, s
1358
+ ]), $t = /* @__PURE__ */ new Map([
1359
+ [C(223), C(7838)],
1360
+ // ß, ẞ
1361
+ [C(107), C(8490)],
1362
+ // k, K (Kelvin)
1363
+ [C(229), C(8491)],
1364
+ // å, Å (Angstrom)
1365
+ [C(969), C(8486)]
1366
+ // ω, Ω (Ohm)
1367
+ ]), Et = new Map([
1368
+ F(453),
1369
+ F(456),
1370
+ F(459),
1371
+ F(498),
1372
+ ...le(8072, 8079),
1373
+ ...le(8088, 8095),
1374
+ ...le(8104, 8111),
1375
+ F(8124),
1376
+ F(8140),
1377
+ F(8188)
1378
+ ]), At = /* @__PURE__ */ new Map([
1379
+ ["alnum", h`[\p{Alpha}\p{Nd}]`],
1380
+ ["alpha", h`\p{Alpha}`],
1381
+ ["ascii", h`\p{ASCII}`],
1382
+ ["blank", h`[\p{Zs}\t]`],
1383
+ ["cntrl", h`\p{Cc}`],
1384
+ ["digit", h`\p{Nd}`],
1385
+ ["graph", h`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],
1386
+ ["lower", h`\p{Lower}`],
1387
+ ["print", h`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],
1388
+ ["punct", h`[\p{P}\p{S}]`],
1389
+ // Updated value from Onig 6.9.9; changed from Unicode `\p{punct}`
1390
+ ["space", h`\p{space}`],
1391
+ ["upper", h`\p{Upper}`],
1392
+ ["word", h`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],
1393
+ ["xdigit", h`\p{AHex}`]
1394
+ ]);
1395
+ function It(e, r) {
1396
+ const t = [];
1397
+ for (let n = e; n <= r; n++)
1398
+ t.push(n);
1399
+ return t;
1400
+ }
1401
+ function F(e) {
1402
+ const r = C(e);
1403
+ return [r.toLowerCase(), r];
1404
+ }
1405
+ function le(e, r) {
1406
+ return It(e, r).map((t) => F(t));
1407
+ }
1408
+ var ur = /* @__PURE__ */ new Set([
1409
+ "Lower",
1410
+ "Lowercase",
1411
+ "Upper",
1412
+ "Uppercase",
1413
+ "Ll",
1414
+ "Lowercase_Letter",
1415
+ "Lt",
1416
+ "Titlecase_Letter",
1417
+ "Lu",
1418
+ "Uppercase_Letter"
1419
+ // The `Changes_When_*` properties (and their aliases) could be included, but they're very rare.
1420
+ // Some other properties include a handful of chars with specific cases only, but these chars are
1421
+ // generally extreme edge cases and using such properties case insensitively generally produces
1422
+ // undesired behavior anyway
1423
+ ]);
1424
+ function St(e, r) {
1425
+ const t = {
1426
+ // A couple edge cases exist where options `accuracy` and `bestEffortTarget` are used:
1427
+ // - `CharacterSet` kind `text_segment` (`\X`): An exact representation would require heavy
1428
+ // Unicode data; a best-effort approximation requires knowing the target.
1429
+ // - `CharacterSet` kind `posix` with values `graph` and `print`: Their complex Unicode
1430
+ // representations would be hard to change to ASCII versions after the fact in the generator
1431
+ // based on `target`/`accuracy`, so produce the appropriate structure here.
1432
+ accuracy: "default",
1433
+ asciiWordBoundaries: !1,
1434
+ avoidSubclass: !1,
1435
+ bestEffortTarget: "ES2025",
1436
+ ...r
1437
+ };
1438
+ cr(e);
1439
+ const n = {
1440
+ accuracy: t.accuracy,
1441
+ asciiWordBoundaries: t.asciiWordBoundaries,
1442
+ avoidSubclass: t.avoidSubclass,
1443
+ flagDirectivesByAlt: /* @__PURE__ */ new Map(),
1444
+ jsGroupNameMap: /* @__PURE__ */ new Map(),
1445
+ minTargetEs2024: ye(t.bestEffortTarget, "ES2024"),
1446
+ passedLookbehind: !1,
1447
+ strategy: null,
1448
+ // Subroutines can appear before the groups they ref, so collect reffed nodes for a second pass
1449
+ subroutineRefMap: /* @__PURE__ */ new Map(),
1450
+ supportedGNodes: /* @__PURE__ */ new Set(),
1451
+ digitIsAscii: e.flags.digitIsAscii,
1452
+ spaceIsAscii: e.flags.spaceIsAscii,
1453
+ wordIsAscii: e.flags.wordIsAscii
1454
+ };
1455
+ Z(e, vt, n);
1456
+ const a = {
1457
+ dotAll: e.flags.dotAll,
1458
+ ignoreCase: e.flags.ignoreCase
1459
+ }, s = {
1460
+ currentFlags: a,
1461
+ prevFlags: null,
1462
+ globalFlags: a,
1463
+ groupOriginByCopy: /* @__PURE__ */ new Map(),
1464
+ groupsByName: /* @__PURE__ */ new Map(),
1465
+ multiplexCapturesToLeftByRef: /* @__PURE__ */ new Map(),
1466
+ openRefs: /* @__PURE__ */ new Map(),
1467
+ reffedNodesByReferencer: /* @__PURE__ */ new Map(),
1468
+ subroutineRefMap: n.subroutineRefMap
1469
+ };
1470
+ Z(e, _t, s);
1471
+ const o = {
1472
+ groupsByName: s.groupsByName,
1473
+ highestOrphanBackref: 0,
1474
+ numCapturesToLeft: 0,
1475
+ reffedNodesByReferencer: s.reffedNodesByReferencer
1476
+ };
1477
+ return Z(e, Mt, o), e._originMap = s.groupOriginByCopy, e._strategy = n.strategy, e;
1478
+ }
1479
+ var vt = {
1480
+ AbsenceFunction({ node: e, parent: r, replaceWith: t }) {
1481
+ const { body: n, kind: a } = e;
1482
+ if (a === "repeater") {
1483
+ const s = v();
1484
+ s.body[0].body.push(
1485
+ // Insert own alts as `body`
1486
+ R({ negate: !0, body: n }),
1487
+ W("Any")
1488
+ );
1489
+ const o = v();
1490
+ o.body[0].body.push(
1491
+ er("greedy", 0, 1 / 0, s)
1492
+ ), t(b(o, r), { traverse: !0 });
1493
+ } else
1494
+ throw new Error('Unsupported absence function "(?~|"');
1495
+ },
1496
+ Alternative: {
1497
+ enter({ node: e, parent: r, key: t }, { flagDirectivesByAlt: n }) {
1498
+ const a = e.body.filter((s) => s.kind === "flags");
1499
+ for (let s = t + 1; s < r.body.length; s++) {
1500
+ const o = r.body[s];
1501
+ Q(n, o, []).push(...a);
1502
+ }
1503
+ },
1504
+ exit({ node: e }, { flagDirectivesByAlt: r }) {
1505
+ if (r.get(e)?.length) {
1506
+ const t = pr(r.get(e));
1507
+ if (t) {
1508
+ const n = v({ flags: t });
1509
+ n.body[0].body = e.body, e.body = [b(n, e)];
1510
+ }
1511
+ }
1512
+ }
1513
+ },
1514
+ Assertion({ node: e, parent: r, key: t, container: n, root: a, remove: s, replaceWith: o }, i) {
1515
+ const { kind: u, negate: c } = e, { asciiWordBoundaries: p, avoidSubclass: l, supportedGNodes: f, wordIsAscii: g } = i;
1516
+ if (u === "text_segment_boundary")
1517
+ throw new Error(`Unsupported text segment boundary "\\${c ? "Y" : "y"}"`);
1518
+ if (u === "line_end")
1519
+ o(b(R({ body: [
1520
+ O({ body: [ge("string_end")] }),
1521
+ O({ body: [ne(10)] })
1522
+ // `\n`
1523
+ ] }), r));
1524
+ else if (u === "line_start")
1525
+ o(b(N(h`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: !0 }), r));
1526
+ else if (u === "search_start")
1527
+ if (f.has(e))
1528
+ a.flags.sticky = !0, s();
1529
+ else {
1530
+ const d = n[t - 1];
1531
+ if (d && Rt(d))
1532
+ o(b(R({ negate: !0 }), r));
1533
+ else {
1534
+ if (l)
1535
+ throw new Error(h`Uses "\G" in a way that requires a subclass`);
1536
+ o(G(ge("string_start"), r)), i.strategy = "clip_search";
1537
+ }
1538
+ }
1539
+ else if (!(u === "string_end" || u === "string_start")) if (u === "string_end_newline")
1540
+ o(b(N(h`(?=\n?\z)`), r));
1541
+ else if (u === "word_boundary") {
1542
+ if (!g && !p) {
1543
+ const d = `(?:(?<=${M})(?!${M})|(?<!${M})(?=${M}))`, w = `(?:(?<=${M})(?=${M})|(?<!${M})(?!${M}))`;
1544
+ o(b(N(c ? w : d), r));
1545
+ }
1546
+ } else
1547
+ throw new Error(`Unexpected assertion kind "${u}"`);
1548
+ },
1549
+ Backreference({ node: e }, { jsGroupNameMap: r }) {
1550
+ let { ref: t } = e;
1551
+ typeof t == "string" && !fe(t) && (t = pe(t, r), e.ref = t);
1552
+ },
1553
+ CapturingGroup({ node: e }, { jsGroupNameMap: r, subroutineRefMap: t }) {
1554
+ let { name: n } = e;
1555
+ n && !fe(n) && (n = pe(n, r), e.name = n), t.set(e.number, e), n && t.set(n, e);
1556
+ },
1557
+ CharacterClassRange({ node: e, parent: r, replaceWith: t }) {
1558
+ if (r.kind === "intersection") {
1559
+ const n = re({ body: [e] });
1560
+ t(b(n, r), { traverse: !0 });
1561
+ }
1562
+ },
1563
+ CharacterSet({ node: e, parent: r, replaceWith: t }, { accuracy: n, minTargetEs2024: a, digitIsAscii: s, spaceIsAscii: o, wordIsAscii: i }) {
1564
+ const { kind: u, negate: c, value: p } = e;
1565
+ if (s && (u === "digit" || p === "digit")) {
1566
+ t(G(we("digit", { negate: c }), r));
1567
+ return;
1568
+ }
1569
+ if (o && (u === "space" || p === "space")) {
1570
+ t(b(de(N(Ct), c), r));
1571
+ return;
1572
+ }
1573
+ if (i && (u === "word" || p === "word")) {
1574
+ t(G(we("word", { negate: c }), r));
1575
+ return;
1576
+ }
1577
+ if (u === "any")
1578
+ t(G(W("Any"), r));
1579
+ else if (u === "digit")
1580
+ t(G(W("Nd", { negate: c }), r));
1581
+ else if (u !== "dot") if (u === "text_segment") {
1582
+ if (n === "strict")
1583
+ throw new Error(h`Use of "\X" requires non-strict accuracy`);
1584
+ const l = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?", f = h`\p{RI}{2}|${l}(?:\u200D${l})*`;
1585
+ t(b(N(
1586
+ // Close approximation of an extended grapheme cluster; see <unicode.org/reports/tr29/>
1587
+ h`(?>\r\n|${a ? h`\p{RGI_Emoji}` : f}|\P{M}\p{M}*)`,
1588
+ // Allow JS property `RGI_Emoji` through
1589
+ { skipPropertyNameValidation: !0 }
1590
+ ), r));
1591
+ } else if (u === "hex")
1592
+ t(G(W("AHex", { negate: c }), r));
1593
+ else if (u === "newline")
1594
+ t(b(N(c ? `[^
1595
+ ]` : `(?>\r
1596
+ ?|[
1597
+ \v\f…\u2028\u2029])`), r));
1598
+ else if (u === "posix")
1599
+ if (!a && (p === "graph" || p === "print")) {
1600
+ if (n === "strict")
1601
+ throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);
1602
+ let l = {
1603
+ graph: "!-~",
1604
+ print: " -~"
1605
+ }[p];
1606
+ c && (l = `\0-${C(l.codePointAt(0) - 1)}${C(l.codePointAt(2) + 1)}-􏿿`), t(b(N(`[${l}]`), r));
1607
+ } else
1608
+ t(b(de(N(At.get(p)), c), r));
1609
+ else if (u === "property")
1610
+ $e.has(se(p)) || (e.key = "sc");
1611
+ else if (u === "space")
1612
+ t(G(W("space", { negate: c }), r));
1613
+ else if (u === "word")
1614
+ t(b(de(N(M), c), r));
1615
+ else
1616
+ throw new Error(`Unexpected character set kind "${u}"`);
1617
+ },
1618
+ Directive({ node: e, parent: r, root: t, remove: n, replaceWith: a, removeAllPrevSiblings: s, removeAllNextSiblings: o }) {
1619
+ const { kind: i, flags: u } = e;
1620
+ if (i === "flags")
1621
+ if (!u.enable && !u.disable)
1622
+ n();
1623
+ else {
1624
+ const c = v({ flags: u });
1625
+ c.body[0].body = o(), a(b(c, r), { traverse: !0 });
1626
+ }
1627
+ else if (i === "keep") {
1628
+ const c = t.body[0], l = t.body.length === 1 && // Not emulatable if within a `CapturingGroup`
1629
+ Je(c, { type: "Group" }) && c.body[0].body.length === 1 ? c.body[0] : t;
1630
+ if (r.parent !== l || l.body.length > 1)
1631
+ throw new Error(h`Uses "\K" in a way that's unsupported`);
1632
+ const f = R({ behind: !0 });
1633
+ f.body[0].body = s(), a(b(f, r));
1634
+ } else
1635
+ throw new Error(`Unexpected directive kind "${i}"`);
1636
+ },
1637
+ Flags({ node: e, parent: r }) {
1638
+ if (e.posixIsAscii)
1639
+ throw new Error('Unsupported flag "P"');
1640
+ if (e.textSegmentMode === "word")
1641
+ throw new Error('Unsupported flag "y{w}"');
1642
+ [
1643
+ "digitIsAscii",
1644
+ // Flag D
1645
+ "extended",
1646
+ // Flag x
1647
+ "posixIsAscii",
1648
+ // Flag P
1649
+ "spaceIsAscii",
1650
+ // Flag S
1651
+ "wordIsAscii",
1652
+ // Flag W
1653
+ "textSegmentMode"
1654
+ // Flag y{g} or y{w}
1655
+ ].forEach((t) => delete e[t]), Object.assign(e, {
1656
+ // JS flag g; no Onig equiv
1657
+ global: !1,
1658
+ // JS flag d; no Onig equiv
1659
+ hasIndices: !1,
1660
+ // JS flag m; no Onig equiv but its behavior is always on in Onig. Onig's only line break
1661
+ // char is line feed, unlike JS, so this flag isn't used since it would produce inaccurate
1662
+ // results (also allows `^` and `$` to be used in the generator for string start and end)
1663
+ multiline: !1,
1664
+ // JS flag y; no Onig equiv, but used for `\G` emulation
1665
+ sticky: e.sticky ?? !1
1666
+ // Note: Regex+ doesn't allow explicitly adding flags it handles implicitly, so leave out
1667
+ // properties `unicode` (JS flag u) and `unicodeSets` (JS flag v). Keep the existing values
1668
+ // for `ignoreCase` (flag i) and `dotAll` (JS flag s, but Onig flag m)
1669
+ }), r.options = {
1670
+ disable: {
1671
+ // Onig uses different rules for flag x than Regex+, so disable the implicit flag
1672
+ x: !0,
1673
+ // Onig has no flag to control "named capture only" mode but contextually applies its
1674
+ // behavior when named capturing is used, so disable Regex+'s implicit flag for it
1675
+ n: !0
1676
+ },
1677
+ force: {
1678
+ // Always add flag v because we're generating an AST that relies on it (it enables JS
1679
+ // support for Onig features nested classes, intersection, Unicode properties, etc.).
1680
+ // However, the generator might disable flag v based on its `target` option
1681
+ v: !0
1682
+ }
1683
+ };
1684
+ },
1685
+ Group({ node: e }) {
1686
+ if (!e.flags)
1687
+ return;
1688
+ const { enable: r, disable: t } = e.flags;
1689
+ r?.extended && delete r.extended, t?.extended && delete t.extended, r?.dotAll && t?.dotAll && delete r.dotAll, r?.ignoreCase && t?.ignoreCase && delete r.ignoreCase, r && !Object.keys(r).length && delete e.flags.enable, t && !Object.keys(t).length && delete e.flags.disable, !e.flags.enable && !e.flags.disable && delete e.flags;
1690
+ },
1691
+ LookaroundAssertion({ node: e }, r) {
1692
+ const { kind: t } = e;
1693
+ t === "lookbehind" && (r.passedLookbehind = !0);
1694
+ },
1695
+ NamedCallout({ node: e, parent: r, replaceWith: t }) {
1696
+ const { kind: n } = e;
1697
+ if (n === "fail")
1698
+ t(b(R({ negate: !0 }), r));
1699
+ else
1700
+ throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`);
1701
+ },
1702
+ Quantifier({ node: e }) {
1703
+ if (e.body.type === "Quantifier") {
1704
+ const r = v();
1705
+ r.body[0].body.push(e.body), e.body = b(r, e);
1706
+ }
1707
+ },
1708
+ Regex: {
1709
+ enter({ node: e }, { supportedGNodes: r }) {
1710
+ const t = [];
1711
+ let n = !1, a = !1;
1712
+ for (const s of e.body)
1713
+ if (s.body.length === 1 && s.body[0].kind === "search_start")
1714
+ s.body.pop();
1715
+ else {
1716
+ const o = dr(s.body);
1717
+ o ? (n = !0, Array.isArray(o) ? t.push(...o) : t.push(o)) : a = !0;
1718
+ }
1719
+ n && !a && t.forEach((s) => r.add(s));
1720
+ },
1721
+ exit(e, { accuracy: r, passedLookbehind: t, strategy: n }) {
1722
+ if (r === "strict" && t && n)
1723
+ throw new Error(h`Uses "\G" in a way that requires non-strict accuracy`);
1724
+ }
1725
+ },
1726
+ Subroutine({ node: e }, { jsGroupNameMap: r }) {
1727
+ let { ref: t } = e;
1728
+ typeof t == "string" && !fe(t) && (t = pe(t, r), e.ref = t);
1729
+ }
1730
+ }, _t = {
1731
+ Backreference({ node: e }, { multiplexCapturesToLeftByRef: r, reffedNodesByReferencer: t }) {
1732
+ const { orphan: n, ref: a } = e;
1733
+ n || t.set(e, [...r.get(a).map(({ node: s }) => s)]);
1734
+ },
1735
+ CapturingGroup: {
1736
+ enter({
1737
+ node: e,
1738
+ parent: r,
1739
+ replaceWith: t,
1740
+ skip: n
1741
+ }, {
1742
+ groupOriginByCopy: a,
1743
+ groupsByName: s,
1744
+ multiplexCapturesToLeftByRef: o,
1745
+ openRefs: i,
1746
+ reffedNodesByReferencer: u
1747
+ }) {
1748
+ const c = a.get(e);
1749
+ if (c && i.has(e.number)) {
1750
+ const l = G(Be(e.number), r);
1751
+ u.set(l, i.get(e.number)), t(l);
1752
+ return;
1753
+ }
1754
+ i.set(e.number, e), o.set(e.number, []), e.name && Q(o, e.name, []);
1755
+ const p = o.get(e.name ?? e.number);
1756
+ for (let l = 0; l < p.length; l++) {
1757
+ const f = p[l];
1758
+ if (
1759
+ // This group is from subroutine expansion, and there's a multiplex value from either the
1760
+ // origin node or a prior subroutine expansion group with the same origin
1761
+ c === f.node || c && c === f.origin || // This group is not from subroutine expansion, and it comes after a subroutine expansion
1762
+ // group that refers to this group
1763
+ e === f.origin
1764
+ ) {
1765
+ p.splice(l, 1);
1766
+ break;
1767
+ }
1768
+ }
1769
+ if (o.get(e.number).push({ node: e, origin: c }), e.name && o.get(e.name).push({ node: e, origin: c }), e.name) {
1770
+ const l = Q(s, e.name, /* @__PURE__ */ new Map());
1771
+ let f = !1;
1772
+ if (c)
1773
+ f = !0;
1774
+ else
1775
+ for (const g of l.values())
1776
+ if (!g.hasDuplicateNameToRemove) {
1777
+ f = !0;
1778
+ break;
1779
+ }
1780
+ s.get(e.name).set(e, { node: e, hasDuplicateNameToRemove: f });
1781
+ }
1782
+ },
1783
+ exit({ node: e }, { openRefs: r }) {
1784
+ r.delete(e.number);
1785
+ }
1786
+ },
1787
+ Group: {
1788
+ enter({ node: e }, r) {
1789
+ r.prevFlags = r.currentFlags, e.flags && (r.currentFlags = te(r.currentFlags, e.flags));
1790
+ },
1791
+ exit(e, r) {
1792
+ r.currentFlags = r.prevFlags;
1793
+ }
1794
+ },
1795
+ Subroutine({ node: e, parent: r, replaceWith: t }, n) {
1796
+ const { isRecursive: a, ref: s } = e;
1797
+ if (a) {
1798
+ let p = r;
1799
+ for (; (p = p.parent) && !(p.type === "CapturingGroup" && (p.name === s || p.number === s)); )
1800
+ ;
1801
+ n.reffedNodesByReferencer.set(e, p);
1802
+ return;
1803
+ }
1804
+ const o = n.subroutineRefMap.get(s), i = s === 0, u = i ? Be(0) : (
1805
+ // The reffed group might itself contain subroutines, which are expanded during sub-traversal
1806
+ lr(o, n.groupOriginByCopy, null)
1807
+ );
1808
+ let c = u;
1809
+ if (!i) {
1810
+ const p = pr(Ft(
1811
+ o,
1812
+ (f) => f.type === "Group" && !!f.flags
1813
+ )), l = p ? te(n.globalFlags, p) : n.globalFlags;
1814
+ Nt(l, n.currentFlags) || (c = v({
1815
+ flags: Gt(l)
1816
+ }), c.body[0].body.push(u));
1817
+ }
1818
+ t(b(c, r), { traverse: !i });
1819
+ }
1820
+ }, Mt = {
1821
+ Backreference({ node: e, parent: r, replaceWith: t }, n) {
1822
+ if (e.orphan) {
1823
+ n.highestOrphanBackref = Math.max(n.highestOrphanBackref, e.ref);
1824
+ return;
1825
+ }
1826
+ const s = n.reffedNodesByReferencer.get(e).filter((o) => Lt(o, e));
1827
+ if (!s.length)
1828
+ t(b(R({ negate: !0 }), r));
1829
+ else if (s.length > 1) {
1830
+ const o = v({
1831
+ atomic: !0,
1832
+ body: s.reverse().map((i) => O({
1833
+ body: [he(i.number)]
1834
+ }))
1835
+ });
1836
+ t(b(o, r));
1837
+ } else
1838
+ e.ref = s[0].number;
1839
+ },
1840
+ CapturingGroup({ node: e }, r) {
1841
+ e.number = ++r.numCapturesToLeft, e.name && r.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove && delete e.name;
1842
+ },
1843
+ Regex: {
1844
+ exit({ node: e }, r) {
1845
+ const t = Math.max(r.highestOrphanBackref - r.numCapturesToLeft, 0);
1846
+ for (let n = 0; n < t; n++) {
1847
+ const a = Ye();
1848
+ e.body.at(-1).body.push(a);
1849
+ }
1850
+ }
1851
+ },
1852
+ Subroutine({ node: e }, r) {
1853
+ !e.isRecursive || e.ref === 0 || (e.ref = r.reffedNodesByReferencer.get(e).number);
1854
+ }
1855
+ };
1856
+ function cr(e) {
1857
+ Z(e, {
1858
+ "*"({ node: r, parent: t }) {
1859
+ r.parent = t;
1860
+ }
1861
+ });
1862
+ }
1863
+ function Nt(e, r) {
1864
+ return e.dotAll === r.dotAll && e.ignoreCase === r.ignoreCase;
1865
+ }
1866
+ function Lt(e, r) {
1867
+ let t = r;
1868
+ do {
1869
+ if (t.type === "Regex")
1870
+ return !1;
1871
+ if (t.type === "Alternative")
1872
+ continue;
1873
+ if (t === e)
1874
+ return !1;
1875
+ const n = fr(t.parent);
1876
+ for (const a of n) {
1877
+ if (a === t)
1878
+ break;
1879
+ if (a === e || gr(a, e))
1880
+ return !0;
1881
+ }
1882
+ } while (t = t.parent);
1883
+ throw new Error("Unexpected path");
1884
+ }
1885
+ function lr(e, r, t, n) {
1886
+ const a = Array.isArray(e) ? [] : {};
1887
+ for (const [s, o] of Object.entries(e))
1888
+ s === "parent" ? a.parent = Array.isArray(t) ? n : t : o && typeof o == "object" ? a[s] = lr(o, r, a, t) : (s === "type" && o === "CapturingGroup" && r.set(a, r.get(e) ?? e), a[s] = o);
1889
+ return a;
1890
+ }
1891
+ function Be(e) {
1892
+ const r = rr(e);
1893
+ return r.isRecursive = !0, r;
1894
+ }
1895
+ function Ft(e, r) {
1896
+ const t = [];
1897
+ for (; e = e.parent; )
1898
+ (!r || r(e)) && t.push(e);
1899
+ return t;
1900
+ }
1901
+ function pe(e, r) {
1902
+ if (r.has(e))
1903
+ return r.get(e);
1904
+ const t = `$${r.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug, "_")}`;
1905
+ return r.set(e, t), t;
1906
+ }
1907
+ function pr(e) {
1908
+ const r = ["dotAll", "ignoreCase"], t = { enable: {}, disable: {} };
1909
+ return e.forEach(({ flags: n }) => {
1910
+ r.forEach((a) => {
1911
+ n.enable?.[a] && (delete t.disable[a], t.enable[a] = !0), n.disable?.[a] && (t.disable[a] = !0);
1912
+ });
1913
+ }), Object.keys(t.enable).length || delete t.enable, Object.keys(t.disable).length || delete t.disable, t.enable || t.disable ? t : null;
1914
+ }
1915
+ function Gt({ dotAll: e, ignoreCase: r }) {
1916
+ const t = {};
1917
+ return (e || r) && (t.enable = {}, e && (t.enable.dotAll = !0), r && (t.enable.ignoreCase = !0)), (!e || !r) && (t.disable = {}, !e && (t.disable.dotAll = !0), !r && (t.disable.ignoreCase = !0)), t;
1918
+ }
1919
+ function fr(e) {
1920
+ if (!e)
1921
+ throw new Error("Node expected");
1922
+ const { body: r } = e;
1923
+ return Array.isArray(r) ? r : r ? [r] : null;
1924
+ }
1925
+ function dr(e) {
1926
+ const r = e.find((t) => t.kind === "search_start" || Ut(t, { negate: !1 }) || !Pt(t));
1927
+ if (!r)
1928
+ return null;
1929
+ if (r.kind === "search_start")
1930
+ return r;
1931
+ if (r.type === "LookaroundAssertion")
1932
+ return r.body[0].body[0];
1933
+ if (r.type === "CapturingGroup" || r.type === "Group") {
1934
+ const t = [];
1935
+ for (const n of r.body) {
1936
+ const a = dr(n.body);
1937
+ if (!a)
1938
+ return null;
1939
+ Array.isArray(a) ? t.push(...a) : t.push(a);
1940
+ }
1941
+ return t;
1942
+ }
1943
+ return null;
1944
+ }
1945
+ function gr(e, r) {
1946
+ const t = fr(e) ?? [];
1947
+ for (const n of t)
1948
+ if (n === r || gr(n, r))
1949
+ return !0;
1950
+ return !1;
1951
+ }
1952
+ function Pt({ type: e }) {
1953
+ return e === "Assertion" || e === "Directive" || e === "LookaroundAssertion";
1954
+ }
1955
+ function Rt(e) {
1956
+ const r = [
1957
+ "Character",
1958
+ "CharacterClass",
1959
+ "CharacterSet"
1960
+ ];
1961
+ return r.includes(e.type) || e.type === "Quantifier" && e.min && r.includes(e.body.type);
1962
+ }
1963
+ function Ut(e, r) {
1964
+ const t = {
1965
+ negate: null,
1966
+ ...r
1967
+ };
1968
+ return e.type === "LookaroundAssertion" && (t.negate === null || e.negate === t.negate) && e.body.length === 1 && Je(e.body[0], {
1969
+ type: "Assertion",
1970
+ kind: "search_start"
1971
+ });
1972
+ }
1973
+ function fe(e) {
1974
+ return /^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e);
1975
+ }
1976
+ function N(e, r) {
1977
+ const n = Ke(e, {
1978
+ ...r,
1979
+ // Providing a custom set of Unicode property names avoids converting some JS Unicode
1980
+ // properties (ex: `\p{Alpha}`) to Onig POSIX classes
1981
+ unicodePropertyMap: $e
1982
+ }).body;
1983
+ return n.length > 1 || n[0].body.length > 1 ? v({ body: n }) : n[0].body[0];
1984
+ }
1985
+ function de(e, r) {
1986
+ return e.negate = r, e;
1987
+ }
1988
+ function G(e, r) {
1989
+ return e.parent = r, e;
1990
+ }
1991
+ function b(e, r) {
1992
+ return cr(e), e.parent = r, e;
1993
+ }
1994
+ function Ot(e, r) {
1995
+ const t = or(r), n = ye(t.target, "ES2024"), a = ye(t.target, "ES2025"), s = t.rules.recursionLimit;
1996
+ if (!Number.isInteger(s) || s < 2 || s > 20)
1997
+ throw new Error("Invalid recursionLimit; use 2-20");
1998
+ let o = null, i = null;
1999
+ if (!a) {
2000
+ const g = [e.flags.ignoreCase];
2001
+ Z(e, Dt, {
2002
+ getCurrentModI: () => g.at(-1),
2003
+ popModI() {
2004
+ g.pop();
2005
+ },
2006
+ pushModI(d) {
2007
+ g.push(d);
2008
+ },
2009
+ setHasCasedChar() {
2010
+ g.at(-1) ? o = !0 : i = !0;
2011
+ }
2012
+ });
2013
+ }
2014
+ const u = {
2015
+ dotAll: e.flags.dotAll,
2016
+ // - Turn global flag i on if a case insensitive node was used and no case sensitive nodes were
2017
+ // used (to avoid unnecessary node expansion).
2018
+ // - Turn global flag i off if a case sensitive node was used (since case sensitivity can't be
2019
+ // forced without the use of ES2025 flag groups)
2020
+ ignoreCase: !!((e.flags.ignoreCase || o) && !i)
2021
+ };
2022
+ let c = e;
2023
+ const p = {
2024
+ accuracy: t.accuracy,
2025
+ appliedGlobalFlags: u,
2026
+ captureMap: /* @__PURE__ */ new Map(),
2027
+ currentFlags: {
2028
+ dotAll: e.flags.dotAll,
2029
+ ignoreCase: e.flags.ignoreCase
2030
+ },
2031
+ inCharClass: !1,
2032
+ lastNode: c,
2033
+ originMap: e._originMap,
2034
+ recursionLimit: s,
2035
+ useAppliedIgnoreCase: !!(!a && o && i),
2036
+ useFlagMods: a,
2037
+ useFlagV: n,
2038
+ verbose: t.verbose
2039
+ };
2040
+ function l(g) {
2041
+ return p.lastNode = c, c = g, yt(Tt[g.type], `Unexpected node type "${g.type}"`)(g, p, l);
2042
+ }
2043
+ const f = {
2044
+ pattern: e.body.map(l).join("|"),
2045
+ // Could reset `lastNode` at this point via `lastNode = ast`, but it isn't needed by flags
2046
+ flags: l(e.flags),
2047
+ options: { ...e.options }
2048
+ };
2049
+ return n || (delete f.options.force.v, f.options.disable.v = !0, f.options.unicodeSetsPlugin = null), f._captureTransfers = /* @__PURE__ */ new Map(), f._hiddenCaptures = [], p.captureMap.forEach((g, d) => {
2050
+ g.hidden && f._hiddenCaptures.push(d), g.transferTo && Q(f._captureTransfers, g.transferTo, []).push(d);
2051
+ }), f;
2052
+ }
2053
+ var Dt = {
2054
+ "*": {
2055
+ enter({ node: e }, r) {
2056
+ if (ze(e)) {
2057
+ const t = r.getCurrentModI();
2058
+ r.pushModI(
2059
+ e.flags ? te({ ignoreCase: t }, e.flags).ignoreCase : t
2060
+ );
2061
+ }
2062
+ },
2063
+ exit({ node: e }, r) {
2064
+ ze(e) && r.popModI();
2065
+ }
2066
+ },
2067
+ Backreference(e, r) {
2068
+ r.setHasCasedChar();
2069
+ },
2070
+ Character({ node: e }, r) {
2071
+ Ee(C(e.value)) && r.setHasCasedChar();
2072
+ },
2073
+ CharacterClassRange({ node: e, skip: r }, t) {
2074
+ r(), hr(e, { firstOnly: !0 }).length && t.setHasCasedChar();
2075
+ },
2076
+ CharacterSet({ node: e }, r) {
2077
+ e.kind === "property" && ur.has(e.value) && r.setHasCasedChar();
2078
+ }
2079
+ }, Tt = {
2080
+ /**
2081
+ @param {AlternativeNode} node
2082
+ */
2083
+ Alternative({ body: e }, r, t) {
2084
+ return e.map(t).join("");
2085
+ },
2086
+ /**
2087
+ @param {AssertionNode} node
2088
+ */
2089
+ Assertion({ kind: e, negate: r }) {
2090
+ if (e === "string_end")
2091
+ return "$";
2092
+ if (e === "string_start")
2093
+ return "^";
2094
+ if (e === "word_boundary")
2095
+ return r ? h`\B` : h`\b`;
2096
+ throw new Error(`Unexpected assertion kind "${e}"`);
2097
+ },
2098
+ /**
2099
+ @param {BackreferenceNode} node
2100
+ */
2101
+ Backreference({ ref: e }, r) {
2102
+ if (typeof e != "number")
2103
+ throw new Error("Unexpected named backref in transformed AST");
2104
+ if (!r.useFlagMods && r.accuracy === "strict" && r.currentFlags.ignoreCase && !r.captureMap.get(e).ignoreCase)
2105
+ throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");
2106
+ return "\\" + e;
2107
+ },
2108
+ /**
2109
+ @param {CapturingGroupNode} node
2110
+ */
2111
+ CapturingGroup(e, r, t) {
2112
+ const { body: n, name: a, number: s } = e, o = { ignoreCase: r.currentFlags.ignoreCase }, i = r.originMap.get(e);
2113
+ return i && (o.hidden = !0, s > i.number && (o.transferTo = i.number)), r.captureMap.set(s, o), `(${a ? `?<${a}>` : ""}${n.map(t).join("|")})`;
2114
+ },
2115
+ /**
2116
+ @param {CharacterNode} node
2117
+ */
2118
+ Character({ value: e }, r) {
2119
+ const t = C(e), n = V(e, {
2120
+ escDigit: r.lastNode.type === "Backreference",
2121
+ inCharClass: r.inCharClass,
2122
+ useFlagV: r.useFlagV
2123
+ });
2124
+ if (n !== t)
2125
+ return n;
2126
+ if (r.useAppliedIgnoreCase && r.currentFlags.ignoreCase && Ee(t)) {
2127
+ const a = ir(t);
2128
+ return r.inCharClass ? a.join("") : a.length > 1 ? `[${a.join("")}]` : a[0];
2129
+ }
2130
+ return t;
2131
+ },
2132
+ /**
2133
+ @param {CharacterClassNode} node
2134
+ */
2135
+ CharacterClass(e, r, t) {
2136
+ const { kind: n, negate: a, parent: s } = e;
2137
+ let { body: o } = e;
2138
+ if (n === "intersection" && !r.useFlagV)
2139
+ throw new Error("Use of character class intersection requires min target ES2024");
2140
+ _.bugFlagVLiteralHyphenIsRange && r.useFlagV && o.some(We) && (o = [ne(45), ...o.filter((c) => !We(c))]);
2141
+ const i = () => `[${a ? "^" : ""}${o.map(t).join(n === "intersection" ? "&&" : "")}]`;
2142
+ if (!r.inCharClass) {
2143
+ if (
2144
+ // Already established `kind !== 'intersection'` if `!state.useFlagV`; don't check again
2145
+ (!r.useFlagV || _.bugNestedClassIgnoresNegation) && !a
2146
+ ) {
2147
+ const p = o.filter(
2148
+ (l) => l.type === "CharacterClass" && l.kind === "union" && l.negate
2149
+ );
2150
+ if (p.length) {
2151
+ const l = v(), f = l.body[0];
2152
+ return l.parent = s, f.parent = l, o = o.filter((g) => !p.includes(g)), e.body = o, o.length ? (e.parent = f, f.body.push(e)) : l.body.pop(), p.forEach((g) => {
2153
+ const d = O({ body: [g] });
2154
+ g.parent = d, d.parent = l, l.body.push(d);
2155
+ }), t(l);
2156
+ }
2157
+ }
2158
+ r.inCharClass = !0;
2159
+ const c = i();
2160
+ return r.inCharClass = !1, c;
2161
+ }
2162
+ const u = o[0];
2163
+ if (
2164
+ // Already established that the parent is a char class via `inCharClass`; don't check again
2165
+ n === "union" && !a && u && // Allows many nested classes to work with `target` ES2018 which doesn't support nesting
2166
+ ((!r.useFlagV || !r.verbose) && s.kind === "union" && !(_.bugFlagVLiteralHyphenIsRange && r.useFlagV) || !r.verbose && s.kind === "intersection" && // JS doesn't allow intersection with union or ranges
2167
+ o.length === 1 && u.type !== "CharacterClassRange")
2168
+ )
2169
+ return o.map(t).join("");
2170
+ if (!r.useFlagV && s.type === "CharacterClass")
2171
+ throw new Error("Uses nested character class in a way that requires min target ES2024");
2172
+ return i();
2173
+ },
2174
+ /**
2175
+ @param {CharacterClassRangeNode} node
2176
+ */
2177
+ CharacterClassRange(e, r) {
2178
+ const t = e.min.value, n = e.max.value, a = {
2179
+ escDigit: !1,
2180
+ inCharClass: !0,
2181
+ useFlagV: r.useFlagV
2182
+ }, s = V(t, a), o = V(n, a), i = /* @__PURE__ */ new Set();
2183
+ if (r.useAppliedIgnoreCase && r.currentFlags.ignoreCase) {
2184
+ const u = hr(e);
2185
+ Ht(u).forEach((p) => {
2186
+ i.add(
2187
+ Array.isArray(p) ? `${V(p[0], a)}-${V(p[1], a)}` : V(p, a)
2188
+ );
2189
+ });
2190
+ }
2191
+ return `${s}-${o}${[...i].join("")}`;
2192
+ },
2193
+ /**
2194
+ @param {CharacterSetNode} node
2195
+ */
2196
+ CharacterSet({ kind: e, negate: r, value: t, key: n }, a) {
2197
+ if (e === "dot")
2198
+ return a.currentFlags.dotAll ? a.appliedGlobalFlags.dotAll || a.useFlagMods ? "." : "[^]" : (
2199
+ // Onig's only line break char is line feed, unlike JS
2200
+ h`[^\n]`
2201
+ );
2202
+ if (e === "digit")
2203
+ return r ? h`\D` : h`\d`;
2204
+ if (e === "property") {
2205
+ if (a.useAppliedIgnoreCase && a.currentFlags.ignoreCase && ur.has(t))
2206
+ throw new Error(`Unicode property "${t}" can't be case-insensitive when other chars have specific case`);
2207
+ return `${r ? h`\P` : h`\p`}{${n ? `${n}=` : ""}${t}}`;
2208
+ }
2209
+ if (e === "word")
2210
+ return r ? h`\W` : h`\w`;
2211
+ throw new Error(`Unexpected character set kind "${e}"`);
2212
+ },
2213
+ /**
2214
+ @param {FlagsNode} node
2215
+ */
2216
+ Flags(e, r) {
2217
+ return (
2218
+ // The transformer should never turn on the properties for flags d, g, m since Onig doesn't
2219
+ // have equivs. Flag m is never used since Onig uses different line break chars than JS
2220
+ // (node.hasIndices ? 'd' : '') +
2221
+ // (node.global ? 'g' : '') +
2222
+ // (node.multiline ? 'm' : '') +
2223
+ (r.appliedGlobalFlags.ignoreCase ? "i" : "") + (e.dotAll ? "s" : "") + (e.sticky ? "y" : "")
2224
+ );
2225
+ },
2226
+ /**
2227
+ @param {GroupNode} node
2228
+ */
2229
+ Group({ atomic: e, body: r, flags: t, parent: n }, a, s) {
2230
+ const o = a.currentFlags;
2231
+ t && (a.currentFlags = te(o, t));
2232
+ const i = r.map(s).join("|"), u = !a.verbose && r.length === 1 && // Single alt
2233
+ n.type !== "Quantifier" && !e && (!a.useFlagMods || !t) ? i : `(?${jt(e, t, a.useFlagMods)}${i})`;
2234
+ return a.currentFlags = o, u;
2235
+ },
2236
+ /**
2237
+ @param {LookaroundAssertionNode} node
2238
+ */
2239
+ LookaroundAssertion({ body: e, kind: r, negate: t }, n, a) {
2240
+ return `(?${`${r === "lookahead" ? "" : "<"}${t ? "!" : "="}`}${e.map(a).join("|")})`;
2241
+ },
2242
+ /**
2243
+ @param {QuantifierNode} node
2244
+ */
2245
+ Quantifier(e, r, t) {
2246
+ return t(e.body) + Xt(e);
2247
+ },
2248
+ /**
2249
+ @param {SubroutineNode & {isRecursive: true}} node
2250
+ */
2251
+ Subroutine({ isRecursive: e, ref: r }, t) {
2252
+ if (!e)
2253
+ throw new Error("Unexpected non-recursive subroutine in transformed AST");
2254
+ const n = t.recursionLimit;
2255
+ return r === 0 ? `(?R=${n})` : h`\g<${r}&R=${n}>`;
2256
+ }
2257
+ }, Bt = /* @__PURE__ */ new Set([
2258
+ "$",
2259
+ "(",
2260
+ ")",
2261
+ "*",
2262
+ "+",
2263
+ ".",
2264
+ "?",
2265
+ "[",
2266
+ "\\",
2267
+ "]",
2268
+ "^",
2269
+ "{",
2270
+ "|",
2271
+ "}"
2272
+ ]), Vt = /* @__PURE__ */ new Set([
2273
+ "-",
2274
+ "\\",
2275
+ "]",
2276
+ "^",
2277
+ // Literal `[` doesn't require escaping with flag u, but this can help work around regex source
2278
+ // linters and regex syntax processors that expect unescaped `[` to create a nested class
2279
+ "["
2280
+ ]), zt = /* @__PURE__ */ new Set([
2281
+ "(",
2282
+ ")",
2283
+ "-",
2284
+ "/",
2285
+ "[",
2286
+ "\\",
2287
+ "]",
2288
+ "^",
2289
+ "{",
2290
+ "|",
2291
+ "}",
2292
+ // Double punctuators; also includes already-listed `-` and `^`
2293
+ "!",
2294
+ "#",
2295
+ "$",
2296
+ "%",
2297
+ "&",
2298
+ "*",
2299
+ "+",
2300
+ ",",
2301
+ ".",
2302
+ ":",
2303
+ ";",
2304
+ "<",
2305
+ "=",
2306
+ ">",
2307
+ "?",
2308
+ "@",
2309
+ "`",
2310
+ "~"
2311
+ ]), Ve = /* @__PURE__ */ new Map([
2312
+ [9, h`\t`],
2313
+ // horizontal tab
2314
+ [10, h`\n`],
2315
+ // line feed
2316
+ [11, h`\v`],
2317
+ // vertical tab
2318
+ [12, h`\f`],
2319
+ // form feed
2320
+ [13, h`\r`],
2321
+ // carriage return
2322
+ [8232, h`\u2028`],
2323
+ // line separator
2324
+ [8233, h`\u2029`],
2325
+ // paragraph separator
2326
+ [65279, h`\uFEFF`]
2327
+ // ZWNBSP/BOM
2328
+ ]), Wt = new RegExp("^\\p{Cased}$", "u");
2329
+ function Ee(e) {
2330
+ return Wt.test(e);
2331
+ }
2332
+ function hr(e, r) {
2333
+ const t = !!r?.firstOnly, n = e.min.value, a = e.max.value, s = [];
2334
+ if (n < 65 && (a === 65535 || a >= 131071) || n === 65536 && a >= 131071)
2335
+ return s;
2336
+ for (let o = n; o <= a; o++) {
2337
+ const i = C(o);
2338
+ if (!Ee(i))
2339
+ continue;
2340
+ const u = ir(i).filter((c) => {
2341
+ const p = c.codePointAt(0);
2342
+ return p < n || p > a;
2343
+ });
2344
+ if (u.length && (s.push(...u), t))
2345
+ break;
2346
+ }
2347
+ return s;
2348
+ }
2349
+ function V(e, { escDigit: r, inCharClass: t, useFlagV: n }) {
2350
+ if (Ve.has(e))
2351
+ return Ve.get(e);
2352
+ if (
2353
+ // Control chars, etc.; condition modeled on the Chrome developer console's display for strings
2354
+ e < 32 || e > 126 && e < 160 || // Unicode planes 4-16; unassigned, special purpose, and private use area
2355
+ e > 262143 || // Avoid corrupting a preceding backref by immediately following it with a literal digit
2356
+ r && Zt(e)
2357
+ )
2358
+ return e > 255 ? `\\u{${e.toString(16).toUpperCase()}}` : `\\x${e.toString(16).toUpperCase().padStart(2, "0")}`;
2359
+ const a = t ? n ? zt : Vt : Bt, s = C(e);
2360
+ return (a.has(s) ? "\\" : "") + s;
2361
+ }
2362
+ function Ht(e) {
2363
+ const r = e.map((a) => a.codePointAt(0)).sort((a, s) => a - s), t = [];
2364
+ let n = null;
2365
+ for (let a = 0; a < r.length; a++)
2366
+ r[a + 1] === r[a] + 1 ? n ??= r[a] : n === null ? t.push(r[a]) : (t.push([n, r[a]]), n = null);
2367
+ return t;
2368
+ }
2369
+ function jt(e, r, t) {
2370
+ if (e)
2371
+ return ">";
2372
+ let n = "";
2373
+ if (r && t) {
2374
+ const { enable: a, disable: s } = r;
2375
+ n = (a?.ignoreCase ? "i" : "") + (a?.dotAll ? "s" : "") + (s ? "-" : "") + (s?.ignoreCase ? "i" : "") + (s?.dotAll ? "s" : "");
2376
+ }
2377
+ return `${n}:`;
2378
+ }
2379
+ function Xt({ kind: e, max: r, min: t }) {
2380
+ let n;
2381
+ return !t && r === 1 ? n = "?" : !t && r === 1 / 0 ? n = "*" : t === 1 && r === 1 / 0 ? n = "+" : t === r ? n = `{${t}}` : n = `{${t},${r === 1 / 0 ? "" : r}}`, n + {
2382
+ greedy: "",
2383
+ lazy: "?",
2384
+ possessive: "+"
2385
+ }[e];
2386
+ }
2387
+ function ze({ type: e }) {
2388
+ return e === "CapturingGroup" || e === "Group" || e === "LookaroundAssertion";
2389
+ }
2390
+ function Zt(e) {
2391
+ return e > 47 && e < 58;
2392
+ }
2393
+ function We({ type: e, value: r }) {
2394
+ return e === "Character" && r === 45;
2395
+ }
2396
+ var Qt = class be extends RegExp {
2397
+ /**
2398
+ @type {Map<number, {
2399
+ hidden?: true;
2400
+ transferTo?: number;
2401
+ }>}
2402
+ */
2403
+ #r = /* @__PURE__ */ new Map();
2404
+ /**
2405
+ @type {RegExp | EmulatedRegExp | null}
2406
+ */
2407
+ #e = null;
2408
+ /**
2409
+ @type {string}
2410
+ */
2411
+ #n;
2412
+ /**
2413
+ @type {Map<number, string>?}
2414
+ */
2415
+ #t = null;
2416
+ /**
2417
+ @type {string?}
2418
+ */
2419
+ #s = null;
2420
+ /**
2421
+ Can be used to serialize the instance.
2422
+ @type {EmulatedRegExpOptions}
2423
+ */
2424
+ rawOptions = {};
2425
+ // Override the getter with one that works with lazy-compiled regexes
2426
+ get source() {
2427
+ return this.#n || "(?:)";
2428
+ }
2429
+ /**
2430
+ @overload
2431
+ @param {string} pattern
2432
+ @param {string} [flags]
2433
+ @param {EmulatedRegExpOptions} [options]
2434
+ */
2435
+ /**
2436
+ @overload
2437
+ @param {EmulatedRegExp} pattern
2438
+ @param {string} [flags]
2439
+ */
2440
+ constructor(r, t, n) {
2441
+ const a = !!n?.lazyCompile;
2442
+ if (r instanceof RegExp) {
2443
+ if (n)
2444
+ throw new Error("Cannot provide options when copying a regexp");
2445
+ const s = r;
2446
+ super(s, t), this.#n = s.source, s instanceof be && (this.#r = s.#r, this.#t = s.#t, this.#s = s.#s, this.rawOptions = s.rawOptions);
2447
+ } else {
2448
+ const s = {
2449
+ hiddenCaptures: [],
2450
+ strategy: null,
2451
+ transfers: [],
2452
+ ...n
2453
+ };
2454
+ super(a ? "" : r, t), this.#n = r, this.#r = Jt(s.hiddenCaptures, s.transfers), this.#s = s.strategy, this.rawOptions = n ?? {};
2455
+ }
2456
+ a || (this.#e = this);
2457
+ }
2458
+ /**
2459
+ Called internally by all String/RegExp methods that use regexes.
2460
+ @override
2461
+ @param {string} str
2462
+ @returns {RegExpExecArray?}
2463
+ */
2464
+ exec(r) {
2465
+ if (!this.#e) {
2466
+ const { lazyCompile: a, ...s } = this.rawOptions;
2467
+ this.#e = new be(this.#n, this.flags, s);
2468
+ }
2469
+ const t = this.global || this.sticky, n = this.lastIndex;
2470
+ if (this.#s === "clip_search" && t && n) {
2471
+ this.lastIndex = 0;
2472
+ const a = this.#a(r.slice(n));
2473
+ return a && (qt(a, n, r, this.hasIndices), this.lastIndex += n), a;
2474
+ }
2475
+ return this.#a(r);
2476
+ }
2477
+ /**
2478
+ Adds support for hidden and transfer captures.
2479
+ @param {string} str
2480
+ @returns
2481
+ */
2482
+ #a(r) {
2483
+ this.#e.lastIndex = this.lastIndex;
2484
+ const t = super.exec.call(this.#e, r);
2485
+ if (this.lastIndex = this.#e.lastIndex, !t || !this.#r.size)
2486
+ return t;
2487
+ const n = [...t];
2488
+ t.length = 1;
2489
+ let a;
2490
+ this.hasIndices && (a = [...t.indices], t.indices.length = 1);
2491
+ const s = [0];
2492
+ for (let o = 1; o < n.length; o++) {
2493
+ const { hidden: i, transferTo: u } = this.#r.get(o) ?? {};
2494
+ if (i ? s.push(null) : (s.push(t.length), t.push(n[o]), this.hasIndices && t.indices.push(a[o])), u && n[o] !== void 0) {
2495
+ const c = s[u];
2496
+ if (!c)
2497
+ throw new Error(`Invalid capture transfer to "${c}"`);
2498
+ if (t[c] = n[o], this.hasIndices && (t.indices[c] = a[o]), t.groups) {
2499
+ this.#t || (this.#t = Kt(this.source));
2500
+ const p = this.#t.get(u);
2501
+ p && (t.groups[p] = n[o], this.hasIndices && (t.indices.groups[p] = a[o]));
2502
+ }
2503
+ }
2504
+ }
2505
+ return t;
2506
+ }
2507
+ };
2508
+ function qt(e, r, t, n) {
2509
+ if (e.index += r, e.input = t, n) {
2510
+ const a = e.indices;
2511
+ for (let o = 0; o < a.length; o++) {
2512
+ const i = a[o];
2513
+ i && (a[o] = [i[0] + r, i[1] + r]);
2514
+ }
2515
+ const s = a.groups;
2516
+ s && Object.keys(s).forEach((o) => {
2517
+ const i = s[o];
2518
+ i && (s[o] = [i[0] + r, i[1] + r]);
2519
+ });
2520
+ }
2521
+ }
2522
+ function Jt(e, r) {
2523
+ const t = /* @__PURE__ */ new Map();
2524
+ for (const n of e)
2525
+ t.set(n, {
2526
+ hidden: !0
2527
+ });
2528
+ for (const [n, a] of r)
2529
+ for (const s of a)
2530
+ Q(t, s, {}).transferTo = n;
2531
+ return t;
2532
+ }
2533
+ function Kt(e) {
2534
+ const r = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu, t = /* @__PURE__ */ new Map();
2535
+ let n = 0, a = 0, s;
2536
+ for (; s = r.exec(e); ) {
2537
+ const { 0: o, groups: { capture: i, name: u } } = s;
2538
+ o === "[" ? n++ : n ? o === "]" && n-- : i && (a++, u && t.set(a, u));
2539
+ }
2540
+ return t;
2541
+ }
2542
+ function Yt(e, r) {
2543
+ const t = en(e, r);
2544
+ return t.options ? new Qt(t.pattern, t.flags, t.options) : new RegExp(t.pattern, t.flags);
2545
+ }
2546
+ function en(e, r) {
2547
+ const t = or(r), n = Ke(e, {
2548
+ flags: t.flags,
2549
+ normalizeUnknownPropertyNames: !0,
2550
+ rules: {
2551
+ captureGroup: t.rules.captureGroup,
2552
+ singleline: t.rules.singleline
2553
+ },
2554
+ skipBackrefValidation: t.rules.allowOrphanBackrefs,
2555
+ unicodePropertyMap: $e
2556
+ }), a = St(n, {
2557
+ accuracy: t.accuracy,
2558
+ asciiWordBoundaries: t.rules.asciiWordBoundaries,
2559
+ avoidSubclass: t.avoidSubclass,
2560
+ bestEffortTarget: t.target
2561
+ }), s = Ot(a, t), o = wt(s.pattern, {
2562
+ captureTransfers: s._captureTransfers,
2563
+ hiddenCaptures: s._hiddenCaptures,
2564
+ mode: "external"
2565
+ }), i = gt(o.pattern), u = dt(i.pattern, {
2566
+ captureTransfers: o.captureTransfers,
2567
+ hiddenCaptures: o.hiddenCaptures
2568
+ }), c = {
2569
+ pattern: u.pattern,
2570
+ flags: `${t.hasIndices ? "d" : ""}${t.global ? "g" : ""}${s.flags}${s.options.disable.v ? "u" : "v"}`
2571
+ };
2572
+ if (t.avoidSubclass) {
2573
+ if (t.lazyCompileLength !== 1 / 0)
2574
+ throw new Error("Lazy compilation requires subclass");
2575
+ } else {
2576
+ const p = u.hiddenCaptures.sort((d, w) => d - w), l = Array.from(u.captureTransfers), f = a._strategy, g = c.pattern.length >= t.lazyCompileLength;
2577
+ (p.length || l.length || f || g) && (c.options = {
2578
+ ...p.length && { hiddenCaptures: p },
2579
+ ...l.length && { transfers: l },
2580
+ ...f && { strategy: f },
2581
+ ...g && { lazyCompile: g }
2582
+ });
2583
+ }
2584
+ return c;
2585
+ }
2586
+ function rn(e, r) {
2587
+ return Yt(e, {
2588
+ global: !0,
2589
+ hasIndices: !0,
2590
+ lazyCompileLength: 3e3,
2591
+ rules: {
2592
+ allowOrphanBackrefs: !0,
2593
+ asciiWordBoundaries: !0,
2594
+ captureGroup: !0,
2595
+ recursionLimit: 5,
2596
+ singleline: !0
2597
+ },
2598
+ ...r
2599
+ });
2600
+ }
2601
+ function tn(e = {}) {
2602
+ const r = Object.assign({
2603
+ target: "auto",
2604
+ cache: /* @__PURE__ */ new Map()
2605
+ }, e);
2606
+ return r.regexConstructor ||= (t) => rn(t, { target: r.target }), {
2607
+ createScanner(t) {
2608
+ return new He(t, r);
2609
+ },
2610
+ createString(t) {
2611
+ return { content: t };
2612
+ }
2613
+ };
2614
+ }
2615
+ function nn() {
2616
+ const e = {
2617
+ cache: /* @__PURE__ */ new Map(),
2618
+ regexConstructor: () => {
2619
+ throw new Error("JavaScriptRawEngine: only support precompiled grammar");
2620
+ }
2621
+ };
2622
+ return {
2623
+ createScanner(r) {
2624
+ return new He(r, e);
2625
+ },
2626
+ createString(r) {
2627
+ return { content: r };
2628
+ }
2629
+ };
2630
+ }
2631
+ export {
2632
+ He as JavaScriptScanner,
2633
+ nn as createJavaScriptRawEngine,
2634
+ tn as createJavaScriptRegexEngine,
2635
+ rn as defaultJavaScriptRegexConstructor
2636
+ };
2637
+ //# sourceMappingURL=engine-javascript-iqcmg6wi2pjun29k.js.map