just-bash 2.15.0-executor.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (642) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +38 -2
  3. package/dist/Bash.d.ts +23 -82
  4. package/dist/bin/chunks/awk2-CKPJ75GN.js +2 -0
  5. package/dist/bin/chunks/base64-I3CXGD2Q.js +2 -0
  6. package/dist/bin/chunks/bash-UYSJL7VA.js +2 -0
  7. package/dist/bin/chunks/cat-3TMJDECR.js +2 -0
  8. package/dist/bin/chunks/chunk-24DJ4XAS.js +18 -0
  9. package/dist/bin/chunks/{chunk-DOXYBGNA.js → chunk-2ACK45YF.js} +4 -4
  10. package/dist/bin/chunks/chunk-2GZSSMV3.js +14 -0
  11. package/dist/bin/chunks/{chunk-WXMBDX4P.js → chunk-2TMMAY52.js} +7 -7
  12. package/dist/bin/chunks/chunk-575DV2PL.js +9 -0
  13. package/dist/bin/chunks/chunk-5DFR7VRU.js +13 -0
  14. package/dist/bin/chunks/chunk-63XSH3IT.js +2 -0
  15. package/dist/bin/{shell/chunks/chunk-N43DJTSI.js → chunks/chunk-6CW6ATOU.js} +1 -1
  16. package/dist/bin/chunks/chunk-6NYAJMTL.js +14 -0
  17. package/dist/bin/chunks/chunk-6ZKYK7PO.js +63 -0
  18. package/dist/bin/chunks/chunk-7FOU5QKD.js +11 -0
  19. package/dist/bin/chunks/chunk-7RSTZI3G.js +9 -0
  20. package/dist/bin/chunks/{chunk-SGA7Y45Z.js → chunk-A65XLABI.js} +5 -5
  21. package/dist/bin/chunks/{chunk-YLE2OYY6.js → chunk-A6CAHGYF.js} +1 -1
  22. package/dist/bin/{shell/chunks/chunk-XKPFI566.js → chunks/chunk-AM6HJVBI.js} +17 -17
  23. package/dist/bin/chunks/chunk-AQBEVPZP.js +6 -0
  24. package/dist/bin/chunks/chunk-AX3QU3MP.js +6 -0
  25. package/dist/bin/chunks/chunk-B4CUXR3Q.js +33 -0
  26. package/dist/bin/chunks/{chunk-NLBRLRWD.js → chunk-B5DAHNDY.js} +1 -1
  27. package/dist/bin/chunks/chunk-BEWZWAXH.js +8 -0
  28. package/dist/bin/{shell/chunks/chunk-SE4C7FJY.js → chunks/chunk-C6FRS5UB.js} +13 -13
  29. package/dist/bin/chunks/chunk-CUYKY2BK.js +5 -0
  30. package/dist/bin/chunks/chunk-D3JRD3JF.js +36 -0
  31. package/dist/bin/chunks/chunk-D6DORGK7.js +16 -0
  32. package/dist/bin/chunks/{chunk-SXB55JOI.js → chunk-DH7TPGPX.js} +1 -1
  33. package/dist/bin/chunks/chunk-FU7JHPYW.js +9 -0
  34. package/dist/bin/chunks/chunk-G36D7WFF.js +6 -0
  35. package/dist/bin/chunks/chunk-GQQLQPZG.js +7 -0
  36. package/dist/bin/chunks/chunk-HIVPP3AM.js +17 -0
  37. package/dist/bin/{shell/chunks/chunk-NAX7MTAR.js → chunks/chunk-I3X57RP5.js} +6 -6
  38. package/dist/bin/chunks/chunk-IZ3AT2KX.js +19 -0
  39. package/dist/bin/chunks/chunk-KHOBXZFG.js +12 -0
  40. package/dist/bin/chunks/chunk-KMFPV7SR.js +6 -0
  41. package/dist/bin/chunks/chunk-KX2PR2HV.js +16 -0
  42. package/dist/bin/chunks/{chunk-54G6AE72.js → chunk-LCJRVV55.js} +1 -1
  43. package/dist/bin/chunks/chunk-M33SULGQ.js +9 -0
  44. package/dist/bin/chunks/{chunk-3Y32LPNT.js → chunk-M3T6XOXC.js} +1 -1
  45. package/dist/bin/chunks/chunk-MWKPB24E.js +11 -0
  46. package/dist/bin/chunks/chunk-NN2DBOAZ.js +5 -0
  47. package/dist/bin/chunks/{chunk-RMQC3GS7.js → chunk-NOGXKS2G.js} +23 -23
  48. package/dist/bin/chunks/chunk-NTW6IA45.js +2 -0
  49. package/dist/bin/{shell/chunks/chunk-7BORMNPQ.js → chunks/chunk-NWG67HAQ.js} +1 -1
  50. package/dist/bin/chunks/{chunk-A3HQTYHR.js → chunk-P43NQKUN.js} +1 -1
  51. package/dist/bin/chunks/chunk-PHZPFNDZ.js +287 -0
  52. package/dist/bin/chunks/chunk-RX22J4AC.js +14 -0
  53. package/dist/bin/chunks/chunk-S7KZBLGH.js +3 -0
  54. package/dist/bin/{shell/chunks/chunk-ZO5PSLKR.js → chunks/chunk-SDOJRQF5.js} +1 -1
  55. package/dist/bin/chunks/chunk-UFJFAFSS.js +28 -0
  56. package/dist/bin/chunks/chunk-UMYJNWPA.js +140 -0
  57. package/dist/bin/chunks/chunk-UO7ZJYDM.js +11 -0
  58. package/dist/bin/chunks/{chunk-THNL3XFF.js → chunk-VECTAALH.js} +1 -1
  59. package/dist/bin/chunks/chunk-VRU3NTQB.js +3 -0
  60. package/dist/bin/chunks/chunk-WJ3HZK2S.js +5 -0
  61. package/dist/bin/chunks/chunk-WLBA7L7U.js +23 -0
  62. package/dist/bin/{shell/chunks/chunk-SXRVLCZ4.js → chunks/chunk-WRYJHXRE.js} +1 -1
  63. package/dist/bin/chunks/chunk-XZEAAOBW.js +8 -0
  64. package/dist/bin/{shell/chunks/chunk-SDLWFYVT.js → chunks/chunk-YMQY74O7.js} +13 -13
  65. package/dist/bin/chunks/chunk-ZNMFCOTS.js +10 -0
  66. package/dist/bin/chunks/{chunk-GOJZHH3L.js → chunk-ZO3PBKJB.js} +3 -3
  67. package/dist/bin/chunks/column-MTXKQLJH.js +2 -0
  68. package/dist/bin/chunks/comm-YZHVF2XN.js +2 -0
  69. package/dist/bin/chunks/{curl-SRTMGOVV.js → curl-2DCNBIKJ.js} +8 -8
  70. package/dist/bin/chunks/cut-MWPHE25M.js +2 -0
  71. package/dist/bin/chunks/diff-EINZHDTZ.js +2 -0
  72. package/dist/bin/chunks/env-NK55NKL6.js +2 -0
  73. package/dist/bin/chunks/expand-47QQBMM5.js +2 -0
  74. package/dist/bin/{shell/chunks/expansion-2RO5M3QC.js → chunks/expansion-H3VFC532.js} +1 -1
  75. package/dist/bin/chunks/{expr-4CJYC4LY.js → expr-VPJ77DR7.js} +1 -1
  76. package/dist/bin/{shell/chunks/file-D5YKS5NV.js → chunks/file-MMSHRWCJ.js} +1 -1
  77. package/dist/bin/chunks/find-O2KKT6KZ.js +2 -0
  78. package/dist/bin/chunks/flag-coverage-FHFMNAV6.js +2 -0
  79. package/dist/bin/chunks/fold-QC27S46O.js +2 -0
  80. package/dist/bin/chunks/grep-3X5B47DW.js +2 -0
  81. package/dist/bin/chunks/gzip-VYBZGPTA.js +2 -0
  82. package/dist/bin/chunks/head-BM7J6BEI.js +2 -0
  83. package/dist/bin/chunks/html-to-markdown-G2FXKDLR.js +2 -0
  84. package/dist/bin/chunks/join-5J5VA3I7.js +2 -0
  85. package/dist/bin/chunks/jq-HYQ3KMGL.js +2 -0
  86. package/dist/bin/chunks/js-exec-LZPKIZ5V.js +97 -0
  87. package/dist/bin/chunks/js-exec-worker.js +27 -185
  88. package/dist/bin/chunks/{ls-G2PXHSNX.js → ls-WONXDVOX.js} +1 -1
  89. package/dist/bin/chunks/md5sum-GVZ66MRR.js +2 -0
  90. package/dist/bin/chunks/nl-XLPXDHHK.js +2 -0
  91. package/dist/bin/chunks/od-CRBL7ZML.js +2 -0
  92. package/dist/bin/chunks/paste-7MEIW3PG.js +2 -0
  93. package/dist/bin/chunks/{printf-P3QVL4IO.js → printf-NA7DYZBO.js} +1 -1
  94. package/dist/bin/chunks/python3-BBQ4SVHU.js +12 -0
  95. package/dist/bin/chunks/rev-6LTZEDBA.js +2 -0
  96. package/dist/bin/chunks/rg-UPQTBQZR.js +2 -0
  97. package/dist/bin/chunks/sed-OKEUW2KT.js +2 -0
  98. package/dist/bin/chunks/sha1sum-HFI2SRA4.js +2 -0
  99. package/dist/bin/chunks/sha256sum-N44D3OCP.js +2 -0
  100. package/dist/bin/chunks/sort-ES3NRFJA.js +2 -0
  101. package/dist/bin/chunks/split-QFBCCUR5.js +2 -0
  102. package/dist/bin/chunks/sqlite3-V4SEWTIR.js +2 -0
  103. package/dist/bin/chunks/sqlite3-worker.js +1728 -0
  104. package/dist/bin/chunks/strings-YGI6HF5M.js +2 -0
  105. package/dist/bin/chunks/tac-HWXFWOGO.js +2 -0
  106. package/dist/bin/chunks/tail-YX6MELZ5.js +2 -0
  107. package/dist/bin/chunks/tar-UO62YC6N.js +2 -0
  108. package/dist/bin/chunks/tee-XKJM7HV7.js +2 -0
  109. package/dist/bin/chunks/time-RPVNTV72.js +2 -0
  110. package/dist/bin/chunks/timeout-4QMASFQG.js +2 -0
  111. package/dist/bin/chunks/tr-A6IXSBQX.js +2 -0
  112. package/dist/bin/chunks/unexpand-UCJETXUX.js +2 -0
  113. package/dist/bin/chunks/uniq-2KXDTNDX.js +2 -0
  114. package/dist/bin/chunks/wc-KTXPMRYY.js +2 -0
  115. package/dist/bin/chunks/worker.js +28 -9
  116. package/dist/bin/chunks/xan-IHA7IHBM.js +2 -0
  117. package/dist/bin/chunks/xan-view-JFFJAU35.js +2 -0
  118. package/dist/bin/chunks/xargs-EWL5DXR3.js +2 -0
  119. package/dist/bin/chunks/yq-LDGFI4EM.js +2 -0
  120. package/dist/bin/just-bash.js +292 -292
  121. package/dist/bin/shell/chunks/awk2-CKPJ75GN.js +2 -0
  122. package/dist/bin/shell/chunks/base64-I3CXGD2Q.js +2 -0
  123. package/dist/bin/shell/chunks/bash-UYSJL7VA.js +2 -0
  124. package/dist/bin/shell/chunks/cat-3TMJDECR.js +2 -0
  125. package/dist/bin/shell/chunks/chunk-24DJ4XAS.js +18 -0
  126. package/dist/bin/shell/chunks/{chunk-DOXYBGNA.js → chunk-2ACK45YF.js} +4 -4
  127. package/dist/bin/shell/chunks/chunk-2GZSSMV3.js +14 -0
  128. package/dist/bin/shell/chunks/{chunk-WXMBDX4P.js → chunk-2TMMAY52.js} +7 -7
  129. package/dist/bin/shell/chunks/chunk-575DV2PL.js +9 -0
  130. package/dist/bin/shell/chunks/chunk-5DFR7VRU.js +13 -0
  131. package/dist/bin/shell/chunks/chunk-63XSH3IT.js +2 -0
  132. package/dist/bin/{chunks/chunk-N43DJTSI.js → shell/chunks/chunk-6CW6ATOU.js} +1 -1
  133. package/dist/bin/shell/chunks/chunk-6NYAJMTL.js +14 -0
  134. package/dist/bin/shell/chunks/chunk-6ZKYK7PO.js +63 -0
  135. package/dist/bin/shell/chunks/chunk-7FOU5QKD.js +11 -0
  136. package/dist/bin/shell/chunks/chunk-7RSTZI3G.js +9 -0
  137. package/dist/bin/shell/chunks/{chunk-SGA7Y45Z.js → chunk-A65XLABI.js} +5 -5
  138. package/dist/bin/shell/chunks/{chunk-YLE2OYY6.js → chunk-A6CAHGYF.js} +1 -1
  139. package/dist/bin/{chunks/chunk-XKPFI566.js → shell/chunks/chunk-AM6HJVBI.js} +17 -17
  140. package/dist/bin/shell/chunks/chunk-AQBEVPZP.js +6 -0
  141. package/dist/bin/shell/chunks/chunk-AX3QU3MP.js +6 -0
  142. package/dist/bin/shell/chunks/chunk-B4CUXR3Q.js +33 -0
  143. package/dist/bin/shell/chunks/{chunk-NLBRLRWD.js → chunk-B5DAHNDY.js} +1 -1
  144. package/dist/bin/shell/chunks/chunk-BEWZWAXH.js +8 -0
  145. package/dist/bin/{chunks/chunk-SE4C7FJY.js → shell/chunks/chunk-C6FRS5UB.js} +13 -13
  146. package/dist/bin/shell/chunks/chunk-CUYKY2BK.js +5 -0
  147. package/dist/bin/shell/chunks/chunk-D3JRD3JF.js +36 -0
  148. package/dist/bin/shell/chunks/chunk-D6DORGK7.js +16 -0
  149. package/dist/bin/shell/chunks/{chunk-SXB55JOI.js → chunk-DH7TPGPX.js} +1 -1
  150. package/dist/bin/shell/chunks/chunk-FU7JHPYW.js +9 -0
  151. package/dist/bin/shell/chunks/chunk-G36D7WFF.js +6 -0
  152. package/dist/bin/shell/chunks/chunk-GQQLQPZG.js +7 -0
  153. package/dist/bin/shell/chunks/chunk-HIVPP3AM.js +17 -0
  154. package/dist/bin/{chunks/chunk-NAX7MTAR.js → shell/chunks/chunk-I3X57RP5.js} +6 -6
  155. package/dist/bin/shell/chunks/chunk-IZ3AT2KX.js +19 -0
  156. package/dist/bin/shell/chunks/chunk-KHOBXZFG.js +12 -0
  157. package/dist/bin/shell/chunks/chunk-KMFPV7SR.js +6 -0
  158. package/dist/bin/shell/chunks/chunk-KX2PR2HV.js +16 -0
  159. package/dist/bin/shell/chunks/{chunk-54G6AE72.js → chunk-LCJRVV55.js} +1 -1
  160. package/dist/bin/shell/chunks/chunk-M33SULGQ.js +9 -0
  161. package/dist/bin/shell/chunks/{chunk-3Y32LPNT.js → chunk-M3T6XOXC.js} +1 -1
  162. package/dist/bin/shell/chunks/chunk-MWKPB24E.js +11 -0
  163. package/dist/bin/shell/chunks/chunk-NN2DBOAZ.js +5 -0
  164. package/dist/bin/shell/chunks/{chunk-RMQC3GS7.js → chunk-NOGXKS2G.js} +23 -23
  165. package/dist/bin/shell/chunks/chunk-NTW6IA45.js +2 -0
  166. package/dist/bin/{chunks/chunk-7BORMNPQ.js → shell/chunks/chunk-NWG67HAQ.js} +1 -1
  167. package/dist/bin/shell/chunks/{chunk-A3HQTYHR.js → chunk-P43NQKUN.js} +1 -1
  168. package/dist/bin/shell/chunks/chunk-PHZPFNDZ.js +287 -0
  169. package/dist/bin/shell/chunks/chunk-RX22J4AC.js +14 -0
  170. package/dist/bin/shell/chunks/chunk-S7KZBLGH.js +3 -0
  171. package/dist/bin/{chunks/chunk-ZO5PSLKR.js → shell/chunks/chunk-SDOJRQF5.js} +1 -1
  172. package/dist/bin/shell/chunks/chunk-UFJFAFSS.js +28 -0
  173. package/dist/bin/shell/chunks/chunk-UMYJNWPA.js +140 -0
  174. package/dist/bin/shell/chunks/chunk-UO7ZJYDM.js +11 -0
  175. package/dist/bin/shell/chunks/{chunk-THNL3XFF.js → chunk-VECTAALH.js} +1 -1
  176. package/dist/bin/shell/chunks/chunk-VRU3NTQB.js +3 -0
  177. package/dist/bin/shell/chunks/chunk-WJ3HZK2S.js +5 -0
  178. package/dist/bin/shell/chunks/chunk-WLBA7L7U.js +23 -0
  179. package/dist/bin/{chunks/chunk-SXRVLCZ4.js → shell/chunks/chunk-WRYJHXRE.js} +1 -1
  180. package/dist/bin/shell/chunks/chunk-XZEAAOBW.js +8 -0
  181. package/dist/bin/{chunks/chunk-SDLWFYVT.js → shell/chunks/chunk-YMQY74O7.js} +13 -13
  182. package/dist/bin/shell/chunks/chunk-ZNMFCOTS.js +10 -0
  183. package/dist/bin/shell/chunks/{chunk-GOJZHH3L.js → chunk-ZO3PBKJB.js} +3 -3
  184. package/dist/bin/shell/chunks/column-MTXKQLJH.js +2 -0
  185. package/dist/bin/shell/chunks/comm-YZHVF2XN.js +2 -0
  186. package/dist/bin/shell/chunks/{curl-SRTMGOVV.js → curl-2DCNBIKJ.js} +8 -8
  187. package/dist/bin/shell/chunks/cut-MWPHE25M.js +2 -0
  188. package/dist/bin/shell/chunks/diff-EINZHDTZ.js +2 -0
  189. package/dist/bin/shell/chunks/env-NK55NKL6.js +2 -0
  190. package/dist/bin/shell/chunks/expand-47QQBMM5.js +2 -0
  191. package/dist/bin/{chunks/expansion-2RO5M3QC.js → shell/chunks/expansion-H3VFC532.js} +1 -1
  192. package/dist/bin/shell/chunks/{expr-4CJYC4LY.js → expr-VPJ77DR7.js} +1 -1
  193. package/dist/bin/{chunks/file-D5YKS5NV.js → shell/chunks/file-MMSHRWCJ.js} +1 -1
  194. package/dist/bin/shell/chunks/find-O2KKT6KZ.js +2 -0
  195. package/dist/bin/shell/chunks/flag-coverage-FHFMNAV6.js +2 -0
  196. package/dist/bin/shell/chunks/fold-QC27S46O.js +2 -0
  197. package/dist/bin/shell/chunks/grep-3X5B47DW.js +2 -0
  198. package/dist/bin/shell/chunks/gzip-VYBZGPTA.js +2 -0
  199. package/dist/bin/shell/chunks/head-BM7J6BEI.js +2 -0
  200. package/dist/bin/shell/chunks/html-to-markdown-G2FXKDLR.js +2 -0
  201. package/dist/bin/shell/chunks/join-5J5VA3I7.js +2 -0
  202. package/dist/bin/shell/chunks/jq-HYQ3KMGL.js +2 -0
  203. package/dist/bin/shell/chunks/js-exec-LZPKIZ5V.js +97 -0
  204. package/dist/bin/shell/chunks/{ls-G2PXHSNX.js → ls-WONXDVOX.js} +1 -1
  205. package/dist/bin/shell/chunks/md5sum-GVZ66MRR.js +2 -0
  206. package/dist/bin/shell/chunks/nl-XLPXDHHK.js +2 -0
  207. package/dist/bin/shell/chunks/od-CRBL7ZML.js +2 -0
  208. package/dist/bin/shell/chunks/paste-7MEIW3PG.js +2 -0
  209. package/dist/bin/shell/chunks/{printf-P3QVL4IO.js → printf-NA7DYZBO.js} +1 -1
  210. package/dist/bin/shell/chunks/python3-BBQ4SVHU.js +12 -0
  211. package/dist/bin/shell/chunks/rev-6LTZEDBA.js +2 -0
  212. package/dist/bin/shell/chunks/rg-UPQTBQZR.js +2 -0
  213. package/dist/bin/shell/chunks/sed-OKEUW2KT.js +2 -0
  214. package/dist/bin/shell/chunks/sha1sum-HFI2SRA4.js +2 -0
  215. package/dist/bin/shell/chunks/sha256sum-N44D3OCP.js +2 -0
  216. package/dist/bin/shell/chunks/sort-ES3NRFJA.js +2 -0
  217. package/dist/bin/shell/chunks/split-QFBCCUR5.js +2 -0
  218. package/dist/bin/shell/chunks/sqlite3-V4SEWTIR.js +2 -0
  219. package/dist/bin/shell/chunks/strings-YGI6HF5M.js +2 -0
  220. package/dist/bin/shell/chunks/tac-HWXFWOGO.js +2 -0
  221. package/dist/bin/shell/chunks/tail-YX6MELZ5.js +2 -0
  222. package/dist/bin/shell/chunks/tar-UO62YC6N.js +2 -0
  223. package/dist/bin/shell/chunks/tee-XKJM7HV7.js +2 -0
  224. package/dist/bin/shell/chunks/time-RPVNTV72.js +2 -0
  225. package/dist/bin/shell/chunks/timeout-4QMASFQG.js +2 -0
  226. package/dist/bin/shell/chunks/tr-A6IXSBQX.js +2 -0
  227. package/dist/bin/shell/chunks/unexpand-UCJETXUX.js +2 -0
  228. package/dist/bin/shell/chunks/uniq-2KXDTNDX.js +2 -0
  229. package/dist/bin/shell/chunks/wc-KTXPMRYY.js +2 -0
  230. package/dist/bin/shell/chunks/xan-IHA7IHBM.js +2 -0
  231. package/dist/bin/shell/chunks/xan-view-JFFJAU35.js +2 -0
  232. package/dist/bin/shell/chunks/xargs-EWL5DXR3.js +2 -0
  233. package/dist/bin/shell/chunks/yq-LDGFI4EM.js +2 -0
  234. package/dist/bin/shell/shell.js +274 -274
  235. package/dist/browser.d.ts +1 -0
  236. package/dist/bundle/browser.js +676 -674
  237. package/dist/bundle/chunks/awk2-RXRC54TM.js +1 -0
  238. package/dist/bundle/chunks/base64-FJOOBRMC.js +1 -0
  239. package/dist/bundle/chunks/bash-4WLDO24C.js +1 -0
  240. package/dist/bundle/chunks/cat-VQEWZT5O.js +1 -0
  241. package/dist/bundle/chunks/chunk-2TRDZQLB.js +17 -0
  242. package/dist/bundle/chunks/chunk-5DI2YNX7.js +10 -0
  243. package/dist/bundle/chunks/chunk-6N5CMDSQ.js +9 -0
  244. package/dist/bundle/chunks/{chunk-F23WWYKW.js → chunk-7P5JCWX5.js} +5 -5
  245. package/dist/bundle/chunks/chunk-7RIQPKJE.js +2 -0
  246. package/dist/bundle/chunks/{chunk-APT7OOP2.js → chunk-7ZUB672J.js} +1 -1
  247. package/dist/bundle/chunks/chunk-AH77CRWX.js +1 -0
  248. package/dist/bundle/chunks/{chunk-YNYSPYQ5.js → chunk-B74TABJS.js} +13 -13
  249. package/dist/bundle/chunks/{chunk-QJ7O6ZN3.js → chunk-BAXBSHE5.js} +3 -3
  250. package/dist/bundle/chunks/{chunk-FEIOJCZD.js → chunk-BGSUD5R5.js} +1 -1
  251. package/dist/bundle/chunks/chunk-CHRGJY5U.js +10 -0
  252. package/dist/bundle/chunks/chunk-CYJSRRNG.js +4 -0
  253. package/dist/bundle/chunks/chunk-CZYXTGMR.js +139 -0
  254. package/dist/bundle/chunks/{chunk-OL3S66CO.js → chunk-DFS4EHCX.js} +23 -23
  255. package/dist/bundle/chunks/chunk-DIB23V32.js +8 -0
  256. package/dist/bundle/chunks/chunk-DMJSDIQO.js +6 -0
  257. package/dist/bundle/chunks/chunk-DRGAV7ST.js +11 -0
  258. package/dist/bundle/chunks/chunk-DZCB42NK.js +2 -0
  259. package/dist/bundle/chunks/{chunk-DCAAORBQ.js → chunk-EIUAYBIC.js} +1 -1
  260. package/dist/bundle/chunks/chunk-G22IYMH5.js +16 -0
  261. package/dist/bundle/chunks/chunk-GFPLGF6W.js +5 -0
  262. package/dist/bundle/chunks/chunk-HCKS7PTH.js +10 -0
  263. package/dist/bundle/chunks/{chunk-5V6VZH6T.js → chunk-HKY7IG73.js} +1 -1
  264. package/dist/bundle/chunks/chunk-HL6NGDO2.js +22 -0
  265. package/dist/bundle/chunks/chunk-IIJDG7QW.js +13 -0
  266. package/dist/bundle/chunks/{chunk-Z6LRHWXI.js → chunk-JKZMQVSS.js} +7 -7
  267. package/dist/bundle/chunks/chunk-JMNW4NXI.js +8 -0
  268. package/dist/bundle/chunks/{chunk-LPQPILI2.js → chunk-K6LIBGJA.js} +1 -1
  269. package/dist/bundle/chunks/chunk-KBZ5NVXE.js +5 -0
  270. package/dist/bundle/chunks/chunk-KK2SFKTN.js +13 -0
  271. package/dist/bundle/chunks/{chunk-BBXLRYSX.js → chunk-KRBPSX3W.js} +1 -1
  272. package/dist/bundle/chunks/{chunk-LTZRCH7N.js → chunk-LBUR6QMO.js} +1 -1
  273. package/dist/bundle/chunks/chunk-MBDW4C5R.js +8 -0
  274. package/dist/bundle/chunks/chunk-MIV7TH6W.js +32 -0
  275. package/dist/bundle/chunks/chunk-MOLNCDQJ.js +5 -0
  276. package/dist/bundle/chunks/chunk-NUY2ZGZL.js +286 -0
  277. package/dist/bundle/chunks/chunk-OYFKMNOH.js +4 -0
  278. package/dist/bundle/chunks/{chunk-62RKD26F.js → chunk-Q7DN34BC.js} +6 -6
  279. package/dist/bundle/chunks/chunk-R6VWJ2ZL.js +1 -0
  280. package/dist/bundle/chunks/chunk-RGAX6VXO.js +6 -0
  281. package/dist/bundle/chunks/chunk-RHD3NWJY.js +15 -0
  282. package/dist/bundle/chunks/chunk-S7CS4O3M.js +5 -0
  283. package/dist/bundle/chunks/chunk-SFQDTSOG.js +8 -0
  284. package/dist/bundle/chunks/{chunk-J642UCRS.js → chunk-SNN4IESC.js} +1 -1
  285. package/dist/bundle/chunks/{chunk-64BAICW3.js → chunk-T6RP4YO5.js} +1 -1
  286. package/dist/bundle/chunks/chunk-TWHVX65V.js +4 -0
  287. package/dist/bundle/chunks/chunk-U2ATS66X.js +4 -0
  288. package/dist/bundle/chunks/chunk-UGMTY5A7.js +15 -0
  289. package/dist/bundle/chunks/chunk-UKBVVIW7.js +62 -0
  290. package/dist/bundle/chunks/chunk-USP7VSKV.js +12 -0
  291. package/dist/bundle/chunks/{chunk-OARHFVLG.js → chunk-UTKQPLMD.js} +13 -13
  292. package/dist/bundle/chunks/{chunk-YFG2CMIF.js → chunk-V5MWI2OL.js} +1 -1
  293. package/dist/bundle/chunks/{chunk-XKQRETAK.js → chunk-WEZK5ELQ.js} +1 -1
  294. package/dist/bundle/chunks/{chunk-YTNYSM6T.js → chunk-WURK7XMI.js} +4 -4
  295. package/dist/bundle/chunks/chunk-WZG5CB4V.js +7 -0
  296. package/dist/bundle/chunks/chunk-XUZRLD2X.js +35 -0
  297. package/dist/bundle/chunks/chunk-YDILEREV.js +7 -0
  298. package/dist/bundle/chunks/chunk-YXVMSFJA.js +13 -0
  299. package/dist/bundle/chunks/column-DCCLCHUR.js +1 -0
  300. package/dist/bundle/chunks/comm-AXP77KC4.js +1 -0
  301. package/dist/bundle/chunks/{curl-COE4TZE6.js → curl-47BFPSFW.js} +8 -8
  302. package/dist/bundle/chunks/cut-RBX7IXC7.js +1 -0
  303. package/dist/bundle/chunks/diff-AYXX5MI5.js +1 -0
  304. package/dist/bundle/chunks/env-GBSZDQLS.js +1 -0
  305. package/dist/bundle/chunks/expand-UMGRCDTC.js +1 -0
  306. package/dist/bundle/chunks/{expansion-ENLSRCXJ.js → expansion-VBDYWVZR.js} +1 -1
  307. package/dist/bundle/chunks/{expr-5T3UU5KE.js → expr-YYCVMXE3.js} +1 -1
  308. package/dist/bundle/chunks/{file-ZIGAJ4YS.js → file-IGDTDPLG.js} +1 -1
  309. package/dist/bundle/chunks/find-DH2ALKQS.js +1 -0
  310. package/dist/bundle/chunks/flag-coverage-WZWBNOJT.js +1 -0
  311. package/dist/bundle/chunks/fold-V23GDLZD.js +1 -0
  312. package/dist/bundle/chunks/grep-7CE2SS3X.js +1 -0
  313. package/dist/bundle/chunks/gzip-EVI6YRMT.js +1 -0
  314. package/dist/bundle/chunks/head-FG33BE3W.js +1 -0
  315. package/dist/bundle/chunks/html-to-markdown-AQHC3PHD.js +1 -0
  316. package/dist/bundle/chunks/join-TLHD7S7W.js +1 -0
  317. package/dist/bundle/chunks/jq-OKCSVTHN.js +1 -0
  318. package/dist/bundle/chunks/js-exec-2U7NEXAP.js +96 -0
  319. package/dist/bundle/chunks/js-exec-worker.js +27 -185
  320. package/dist/bundle/chunks/md5sum-XMCB7L5Z.js +1 -0
  321. package/dist/bundle/chunks/nl-LBU6FPPF.js +1 -0
  322. package/dist/bundle/chunks/od-O6TPXWVX.js +1 -0
  323. package/dist/bundle/chunks/paste-HIF3YKHC.js +1 -0
  324. package/dist/bundle/chunks/python3-ZR6W2FR3.js +11 -0
  325. package/dist/bundle/chunks/rev-SKETTPXH.js +1 -0
  326. package/dist/bundle/chunks/rg-GMXITNCP.js +1 -0
  327. package/dist/bundle/chunks/sed-YRQXQDMQ.js +1 -0
  328. package/dist/bundle/chunks/sha1sum-ZHNS7PS4.js +1 -0
  329. package/dist/bundle/chunks/sha256sum-YWE2HB65.js +1 -0
  330. package/dist/bundle/chunks/sort-5KALNK6P.js +1 -0
  331. package/dist/bundle/chunks/split-4CXZNBGE.js +1 -0
  332. package/dist/bundle/chunks/sqlite3-FXN2MHWU.js +1 -0
  333. package/dist/bundle/chunks/sqlite3-worker.js +1728 -0
  334. package/dist/bundle/chunks/strings-7VYWRFIZ.js +1 -0
  335. package/dist/bundle/chunks/tac-74F3WHUM.js +1 -0
  336. package/dist/bundle/chunks/tail-EDLAF4WW.js +1 -0
  337. package/dist/bundle/chunks/tar-RKYTUGDT.js +1 -0
  338. package/dist/bundle/chunks/tee-DUMXETDQ.js +1 -0
  339. package/dist/bundle/chunks/time-U22WPHDM.js +1 -0
  340. package/dist/bundle/chunks/timeout-PWE4AOYD.js +1 -0
  341. package/dist/bundle/chunks/tr-2QSZN4JB.js +1 -0
  342. package/dist/bundle/chunks/unexpand-ZTD2RXS2.js +1 -0
  343. package/dist/bundle/chunks/uniq-DCP6SV3B.js +1 -0
  344. package/dist/bundle/chunks/wc-J6YO4AFR.js +1 -0
  345. package/dist/bundle/chunks/worker.js +28 -9
  346. package/dist/bundle/chunks/xan-74G4ZYYZ.js +1 -0
  347. package/dist/bundle/chunks/xan-view-FLG5O7II.js +1 -0
  348. package/dist/bundle/chunks/xargs-LB2QOP6N.js +1 -0
  349. package/dist/bundle/chunks/yq-4NJ2P5VT.js +1 -0
  350. package/dist/bundle/index.cjs +983 -981
  351. package/dist/bundle/index.js +271 -271
  352. package/dist/commands/js-exec/{worker.d.ts → js-exec-worker.d.ts} +4 -10
  353. package/dist/commands/js-exec/js-exec.d.ts +1 -19
  354. package/dist/commands/search-engine/matcher.d.ts +6 -0
  355. package/dist/commands/search-engine/regex.d.ts +13 -0
  356. package/dist/commands/sqlite3/sqlite3.d.ts +1 -0
  357. package/dist/commands/sqlite3/worker.js +1728 -0
  358. package/dist/commands/tar/bzip2-compress.d.ts +17 -0
  359. package/dist/commands/worker-bridge/sync-backend.d.ts +2 -1
  360. package/dist/encoding.d.ts +115 -0
  361. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +2 -0
  362. package/dist/fs/interface.d.ts +23 -1
  363. package/dist/fs/mountable-fs/mountable-fs.d.ts +2 -0
  364. package/dist/fs/overlay-fs/overlay-fs.d.ts +2 -0
  365. package/dist/fs/read-write-fs/read-write-fs.d.ts +2 -0
  366. package/dist/index.d.cts +2 -0
  367. package/dist/index.d.ts +2 -0
  368. package/dist/interpreter/interpreter.d.ts +2 -2
  369. package/dist/interpreter/types.d.ts +3 -3
  370. package/dist/network/dns-pin.d.ts +43 -0
  371. package/dist/network/types.d.ts +2 -1
  372. package/dist/types.d.ts +48 -10
  373. package/dist/utils/file-reader.d.ts +12 -5
  374. package/package.json +36 -40
  375. package/vendor/cpython-emscripten/python.wasm +0 -0
  376. package/dist/bin/chunks/awk2-VTJMI54B.js +0 -2
  377. package/dist/bin/chunks/base64-43M2R3GA.js +0 -2
  378. package/dist/bin/chunks/bash-6ZHZ6BX7.js +0 -2
  379. package/dist/bin/chunks/cat-XZIJZXKP.js +0 -2
  380. package/dist/bin/chunks/chunk-26NO42TF.js +0 -14
  381. package/dist/bin/chunks/chunk-5G2VOPPJ.js +0 -7
  382. package/dist/bin/chunks/chunk-5WFYIUU2.js +0 -3
  383. package/dist/bin/chunks/chunk-AAW7UMPO.js +0 -9
  384. package/dist/bin/chunks/chunk-B3RU2PUI.js +0 -140
  385. package/dist/bin/chunks/chunk-CGE2EHYP.js +0 -5
  386. package/dist/bin/chunks/chunk-CM4532DS.js +0 -36
  387. package/dist/bin/chunks/chunk-CQG2HEAL.js +0 -5
  388. package/dist/bin/chunks/chunk-EUXCM6C4.js +0 -12
  389. package/dist/bin/chunks/chunk-F3LGZXLQ.js +0 -9
  390. package/dist/bin/chunks/chunk-FA2CHD73.js +0 -16
  391. package/dist/bin/chunks/chunk-FLPVVSN5.js +0 -5
  392. package/dist/bin/chunks/chunk-FSZWFMB4.js +0 -16
  393. package/dist/bin/chunks/chunk-G43H2WGH.js +0 -17
  394. package/dist/bin/chunks/chunk-GO6FXSC4.js +0 -6
  395. package/dist/bin/chunks/chunk-GZHFXDDO.js +0 -10
  396. package/dist/bin/chunks/chunk-HJEHIH4P.js +0 -33
  397. package/dist/bin/chunks/chunk-JQBC3FXE.js +0 -8
  398. package/dist/bin/chunks/chunk-L2JBII6Z.js +0 -287
  399. package/dist/bin/chunks/chunk-LGJM5YFT.js +0 -17
  400. package/dist/bin/chunks/chunk-LMK6G2HH.js +0 -8
  401. package/dist/bin/chunks/chunk-MNMRGJJM.js +0 -11
  402. package/dist/bin/chunks/chunk-MRP4ZCD7.js +0 -6
  403. package/dist/bin/chunks/chunk-MXVNCVD6.js +0 -30
  404. package/dist/bin/chunks/chunk-MY5PY2PL.js +0 -2
  405. package/dist/bin/chunks/chunk-N5OTVT4F.js +0 -23
  406. package/dist/bin/chunks/chunk-OBI37ZY4.js +0 -9
  407. package/dist/bin/chunks/chunk-P6GNZPVW.js +0 -19
  408. package/dist/bin/chunks/chunk-RJSAGJQJ.js +0 -11
  409. package/dist/bin/chunks/chunk-ROJPSS6N.js +0 -3
  410. package/dist/bin/chunks/chunk-S7OHMN3F.js +0 -6
  411. package/dist/bin/chunks/chunk-VHUYNUT7.js +0 -13
  412. package/dist/bin/chunks/chunk-WS6P4H4S.js +0 -63
  413. package/dist/bin/chunks/chunk-WWZVR5NN.js +0 -6
  414. package/dist/bin/chunks/chunk-YEKSVVRC.js +0 -11
  415. package/dist/bin/chunks/chunk-YFPDB4PH.js +0 -9
  416. package/dist/bin/chunks/chunk-ZA4HUKJ3.js +0 -13
  417. package/dist/bin/chunks/chunk-ZKC5HQYO.js +0 -14
  418. package/dist/bin/chunks/column-XGV32UPN.js +0 -2
  419. package/dist/bin/chunks/comm-R3F3Z5DX.js +0 -2
  420. package/dist/bin/chunks/cut-5EY2XPXX.js +0 -2
  421. package/dist/bin/chunks/diff-LE7GMFZD.js +0 -2
  422. package/dist/bin/chunks/env-NTPN5QYM.js +0 -2
  423. package/dist/bin/chunks/expand-26XPP5KB.js +0 -2
  424. package/dist/bin/chunks/find-GAYRV4IF.js +0 -2
  425. package/dist/bin/chunks/flag-coverage-LBMWMYOO.js +0 -2
  426. package/dist/bin/chunks/fold-XSVNTAWH.js +0 -2
  427. package/dist/bin/chunks/grep-OZJTRD4D.js +0 -2
  428. package/dist/bin/chunks/gzip-LHOO65AN.js +0 -2
  429. package/dist/bin/chunks/head-YMNRW3F3.js +0 -2
  430. package/dist/bin/chunks/html-to-markdown-WVZA3MCP.js +0 -2
  431. package/dist/bin/chunks/join-Y4Q5WVVE.js +0 -2
  432. package/dist/bin/chunks/jq-FIV5Q5T4.js +0 -2
  433. package/dist/bin/chunks/js-exec-6UJKEL4G.js +0 -97
  434. package/dist/bin/chunks/md5sum-NCLXV2S3.js +0 -2
  435. package/dist/bin/chunks/nl-XH3L75DR.js +0 -2
  436. package/dist/bin/chunks/od-52FBC34W.js +0 -2
  437. package/dist/bin/chunks/paste-3UVLMQ2K.js +0 -2
  438. package/dist/bin/chunks/python3-QOJU2POC.js +0 -12
  439. package/dist/bin/chunks/rev-UHEPS2UL.js +0 -2
  440. package/dist/bin/chunks/rg-C6KMBFNG.js +0 -2
  441. package/dist/bin/chunks/sed-HALRQZKY.js +0 -2
  442. package/dist/bin/chunks/sha1sum-BHNJ5ALF.js +0 -2
  443. package/dist/bin/chunks/sha256sum-HJJ3NJ5L.js +0 -2
  444. package/dist/bin/chunks/sort-7GENYU2I.js +0 -2
  445. package/dist/bin/chunks/split-YWV64TJH.js +0 -2
  446. package/dist/bin/chunks/sqlite3-CVNFMP3Z.js +0 -2
  447. package/dist/bin/chunks/strings-XXKZCWY5.js +0 -2
  448. package/dist/bin/chunks/tac-T42SKDDI.js +0 -2
  449. package/dist/bin/chunks/tail-V537TDFR.js +0 -2
  450. package/dist/bin/chunks/tar-TOWX2TDU.js +0 -2
  451. package/dist/bin/chunks/tee-HK2SYCAR.js +0 -2
  452. package/dist/bin/chunks/time-5R4QWCYF.js +0 -2
  453. package/dist/bin/chunks/timeout-Z24MNWOP.js +0 -2
  454. package/dist/bin/chunks/tr-4FPGAEVB.js +0 -2
  455. package/dist/bin/chunks/unexpand-OYZ7KOYR.js +0 -2
  456. package/dist/bin/chunks/uniq-TMSAIZM3.js +0 -2
  457. package/dist/bin/chunks/wc-ZIV3TFVG.js +0 -2
  458. package/dist/bin/chunks/xan-MOZFJGMY.js +0 -2
  459. package/dist/bin/chunks/xan-view-5SZBYPLG.js +0 -2
  460. package/dist/bin/chunks/xargs-SCYIFXOW.js +0 -2
  461. package/dist/bin/chunks/yq-Q47JUWL6.js +0 -2
  462. package/dist/bin/shell/chunks/awk2-VTJMI54B.js +0 -2
  463. package/dist/bin/shell/chunks/base64-43M2R3GA.js +0 -2
  464. package/dist/bin/shell/chunks/bash-6ZHZ6BX7.js +0 -2
  465. package/dist/bin/shell/chunks/cat-XZIJZXKP.js +0 -2
  466. package/dist/bin/shell/chunks/chunk-26NO42TF.js +0 -14
  467. package/dist/bin/shell/chunks/chunk-5G2VOPPJ.js +0 -7
  468. package/dist/bin/shell/chunks/chunk-5WFYIUU2.js +0 -3
  469. package/dist/bin/shell/chunks/chunk-AAW7UMPO.js +0 -9
  470. package/dist/bin/shell/chunks/chunk-B3RU2PUI.js +0 -140
  471. package/dist/bin/shell/chunks/chunk-CGE2EHYP.js +0 -5
  472. package/dist/bin/shell/chunks/chunk-CM4532DS.js +0 -36
  473. package/dist/bin/shell/chunks/chunk-CQG2HEAL.js +0 -5
  474. package/dist/bin/shell/chunks/chunk-D64U2VGQ.js +0 -2
  475. package/dist/bin/shell/chunks/chunk-EUXCM6C4.js +0 -12
  476. package/dist/bin/shell/chunks/chunk-F3LGZXLQ.js +0 -9
  477. package/dist/bin/shell/chunks/chunk-FA2CHD73.js +0 -16
  478. package/dist/bin/shell/chunks/chunk-FLPVVSN5.js +0 -5
  479. package/dist/bin/shell/chunks/chunk-FSZWFMB4.js +0 -16
  480. package/dist/bin/shell/chunks/chunk-G43H2WGH.js +0 -17
  481. package/dist/bin/shell/chunks/chunk-GO6FXSC4.js +0 -6
  482. package/dist/bin/shell/chunks/chunk-GZHFXDDO.js +0 -10
  483. package/dist/bin/shell/chunks/chunk-HJEHIH4P.js +0 -33
  484. package/dist/bin/shell/chunks/chunk-JQBC3FXE.js +0 -8
  485. package/dist/bin/shell/chunks/chunk-L2JBII6Z.js +0 -287
  486. package/dist/bin/shell/chunks/chunk-LGJM5YFT.js +0 -17
  487. package/dist/bin/shell/chunks/chunk-LMK6G2HH.js +0 -8
  488. package/dist/bin/shell/chunks/chunk-MNMRGJJM.js +0 -11
  489. package/dist/bin/shell/chunks/chunk-MRP4ZCD7.js +0 -6
  490. package/dist/bin/shell/chunks/chunk-MXVNCVD6.js +0 -30
  491. package/dist/bin/shell/chunks/chunk-N5OTVT4F.js +0 -23
  492. package/dist/bin/shell/chunks/chunk-OBI37ZY4.js +0 -9
  493. package/dist/bin/shell/chunks/chunk-P6GNZPVW.js +0 -19
  494. package/dist/bin/shell/chunks/chunk-RJSAGJQJ.js +0 -11
  495. package/dist/bin/shell/chunks/chunk-ROJPSS6N.js +0 -3
  496. package/dist/bin/shell/chunks/chunk-S7OHMN3F.js +0 -6
  497. package/dist/bin/shell/chunks/chunk-VHUYNUT7.js +0 -13
  498. package/dist/bin/shell/chunks/chunk-WS6P4H4S.js +0 -63
  499. package/dist/bin/shell/chunks/chunk-WWZVR5NN.js +0 -6
  500. package/dist/bin/shell/chunks/chunk-YEKSVVRC.js +0 -11
  501. package/dist/bin/shell/chunks/chunk-YFPDB4PH.js +0 -9
  502. package/dist/bin/shell/chunks/chunk-ZA4HUKJ3.js +0 -13
  503. package/dist/bin/shell/chunks/chunk-ZKC5HQYO.js +0 -14
  504. package/dist/bin/shell/chunks/column-XGV32UPN.js +0 -2
  505. package/dist/bin/shell/chunks/comm-R3F3Z5DX.js +0 -2
  506. package/dist/bin/shell/chunks/cut-5EY2XPXX.js +0 -2
  507. package/dist/bin/shell/chunks/diff-LE7GMFZD.js +0 -2
  508. package/dist/bin/shell/chunks/env-NTPN5QYM.js +0 -2
  509. package/dist/bin/shell/chunks/expand-26XPP5KB.js +0 -2
  510. package/dist/bin/shell/chunks/find-GAYRV4IF.js +0 -2
  511. package/dist/bin/shell/chunks/flag-coverage-LBMWMYOO.js +0 -2
  512. package/dist/bin/shell/chunks/fold-XSVNTAWH.js +0 -2
  513. package/dist/bin/shell/chunks/grep-OZJTRD4D.js +0 -2
  514. package/dist/bin/shell/chunks/gzip-LHOO65AN.js +0 -2
  515. package/dist/bin/shell/chunks/head-YMNRW3F3.js +0 -2
  516. package/dist/bin/shell/chunks/html-to-markdown-WVZA3MCP.js +0 -2
  517. package/dist/bin/shell/chunks/join-Y4Q5WVVE.js +0 -2
  518. package/dist/bin/shell/chunks/jq-FIV5Q5T4.js +0 -2
  519. package/dist/bin/shell/chunks/js-exec-H26D5H6V.js +0 -97
  520. package/dist/bin/shell/chunks/md5sum-NCLXV2S3.js +0 -2
  521. package/dist/bin/shell/chunks/nl-XH3L75DR.js +0 -2
  522. package/dist/bin/shell/chunks/od-52FBC34W.js +0 -2
  523. package/dist/bin/shell/chunks/paste-3UVLMQ2K.js +0 -2
  524. package/dist/bin/shell/chunks/python3-O4VTP6TD.js +0 -12
  525. package/dist/bin/shell/chunks/rev-UHEPS2UL.js +0 -2
  526. package/dist/bin/shell/chunks/rg-C6KMBFNG.js +0 -2
  527. package/dist/bin/shell/chunks/sed-HALRQZKY.js +0 -2
  528. package/dist/bin/shell/chunks/sha1sum-BHNJ5ALF.js +0 -2
  529. package/dist/bin/shell/chunks/sha256sum-HJJ3NJ5L.js +0 -2
  530. package/dist/bin/shell/chunks/sort-7GENYU2I.js +0 -2
  531. package/dist/bin/shell/chunks/split-YWV64TJH.js +0 -2
  532. package/dist/bin/shell/chunks/sqlite3-CVNFMP3Z.js +0 -2
  533. package/dist/bin/shell/chunks/strings-XXKZCWY5.js +0 -2
  534. package/dist/bin/shell/chunks/tac-T42SKDDI.js +0 -2
  535. package/dist/bin/shell/chunks/tail-V537TDFR.js +0 -2
  536. package/dist/bin/shell/chunks/tar-TOWX2TDU.js +0 -2
  537. package/dist/bin/shell/chunks/tee-HK2SYCAR.js +0 -2
  538. package/dist/bin/shell/chunks/time-5R4QWCYF.js +0 -2
  539. package/dist/bin/shell/chunks/timeout-Z24MNWOP.js +0 -2
  540. package/dist/bin/shell/chunks/tr-4FPGAEVB.js +0 -2
  541. package/dist/bin/shell/chunks/unexpand-OYZ7KOYR.js +0 -2
  542. package/dist/bin/shell/chunks/uniq-TMSAIZM3.js +0 -2
  543. package/dist/bin/shell/chunks/wc-ZIV3TFVG.js +0 -2
  544. package/dist/bin/shell/chunks/xan-MOZFJGMY.js +0 -2
  545. package/dist/bin/shell/chunks/xan-view-5SZBYPLG.js +0 -2
  546. package/dist/bin/shell/chunks/xargs-SCYIFXOW.js +0 -2
  547. package/dist/bin/shell/chunks/yq-Q47JUWL6.js +0 -2
  548. package/dist/bundle/chunks/awk2-POPGKRAI.js +0 -1
  549. package/dist/bundle/chunks/base64-4YMZCVJ5.js +0 -1
  550. package/dist/bundle/chunks/bash-IJWYRKFO.js +0 -1
  551. package/dist/bundle/chunks/cat-RDUMLXKC.js +0 -1
  552. package/dist/bundle/chunks/chunk-55VFSPNA.js +0 -2
  553. package/dist/bundle/chunks/chunk-7L36YK2X.js +0 -2
  554. package/dist/bundle/chunks/chunk-A7ICOL4V.js +0 -13
  555. package/dist/bundle/chunks/chunk-B6O2PIY4.js +0 -10
  556. package/dist/bundle/chunks/chunk-CR5AFCPT.js +0 -22
  557. package/dist/bundle/chunks/chunk-D4J545R4.js +0 -11
  558. package/dist/bundle/chunks/chunk-D6CWQ5DW.js +0 -5
  559. package/dist/bundle/chunks/chunk-EIZGF4BS.js +0 -8
  560. package/dist/bundle/chunks/chunk-F55TLFGB.js +0 -9
  561. package/dist/bundle/chunks/chunk-GXVXFKBA.js +0 -5
  562. package/dist/bundle/chunks/chunk-HDQ56CKY.js +0 -15
  563. package/dist/bundle/chunks/chunk-HWBSOZZR.js +0 -35
  564. package/dist/bundle/chunks/chunk-JVPRLUMK.js +0 -7
  565. package/dist/bundle/chunks/chunk-KMEYNNUA.js +0 -15
  566. package/dist/bundle/chunks/chunk-LWEGUNWT.js +0 -7
  567. package/dist/bundle/chunks/chunk-MDLLFABN.js +0 -4
  568. package/dist/bundle/chunks/chunk-MHTUABJP.js +0 -8
  569. package/dist/bundle/chunks/chunk-MYE6AGBJ.js +0 -16
  570. package/dist/bundle/chunks/chunk-NAERJDUW.js +0 -8
  571. package/dist/bundle/chunks/chunk-NYQYO467.js +0 -32
  572. package/dist/bundle/chunks/chunk-PP6PSHAB.js +0 -4
  573. package/dist/bundle/chunks/chunk-PYSFUGCK.js +0 -10
  574. package/dist/bundle/chunks/chunk-QCDB2VPH.js +0 -6
  575. package/dist/bundle/chunks/chunk-SDNKECQQ.js +0 -5
  576. package/dist/bundle/chunks/chunk-TLSUDHID.js +0 -6
  577. package/dist/bundle/chunks/chunk-TOMNU26N.js +0 -4
  578. package/dist/bundle/chunks/chunk-TXBZCHCQ.js +0 -5
  579. package/dist/bundle/chunks/chunk-UNYNJIFU.js +0 -139
  580. package/dist/bundle/chunks/chunk-VJFXDYWH.js +0 -10
  581. package/dist/bundle/chunks/chunk-VLGZJRPG.js +0 -16
  582. package/dist/bundle/chunks/chunk-VYOJP4TV.js +0 -13
  583. package/dist/bundle/chunks/chunk-WKFATFPP.js +0 -4
  584. package/dist/bundle/chunks/chunk-XHM67O4N.js +0 -1
  585. package/dist/bundle/chunks/chunk-XORM457F.js +0 -286
  586. package/dist/bundle/chunks/chunk-YCFVLTST.js +0 -12
  587. package/dist/bundle/chunks/chunk-YS3AZT3J.js +0 -8
  588. package/dist/bundle/chunks/chunk-Z7JVV2SM.js +0 -12
  589. package/dist/bundle/chunks/chunk-ZXL7TQLN.js +0 -62
  590. package/dist/bundle/chunks/column-WLPMMSTS.js +0 -1
  591. package/dist/bundle/chunks/comm-5SLSESQG.js +0 -1
  592. package/dist/bundle/chunks/cut-OPC3VAGB.js +0 -1
  593. package/dist/bundle/chunks/diff-HJF2MPDN.js +0 -1
  594. package/dist/bundle/chunks/env-5EPCWSXR.js +0 -1
  595. package/dist/bundle/chunks/expand-DTNXU4LQ.js +0 -1
  596. package/dist/bundle/chunks/find-TPUOAIUQ.js +0 -1
  597. package/dist/bundle/chunks/flag-coverage-LMTH7T5F.js +0 -1
  598. package/dist/bundle/chunks/fold-LDSORVYE.js +0 -1
  599. package/dist/bundle/chunks/grep-3AIAIJVR.js +0 -1
  600. package/dist/bundle/chunks/gzip-AQXSGOVS.js +0 -1
  601. package/dist/bundle/chunks/head-HT2B6D2J.js +0 -1
  602. package/dist/bundle/chunks/html-to-markdown-TFCECAGV.js +0 -1
  603. package/dist/bundle/chunks/join-GG2LDHE5.js +0 -1
  604. package/dist/bundle/chunks/jq-ODXZBPLY.js +0 -1
  605. package/dist/bundle/chunks/js-exec-OOPTBRNB.js +0 -96
  606. package/dist/bundle/chunks/md5sum-INMIK4DX.js +0 -1
  607. package/dist/bundle/chunks/nl-U5YJDM32.js +0 -1
  608. package/dist/bundle/chunks/od-VJEF2UR5.js +0 -1
  609. package/dist/bundle/chunks/paste-7N6AFSDS.js +0 -1
  610. package/dist/bundle/chunks/python3-5F2XPEW4.js +0 -11
  611. package/dist/bundle/chunks/rev-XOSYPP45.js +0 -1
  612. package/dist/bundle/chunks/rg-FOQSCCX3.js +0 -1
  613. package/dist/bundle/chunks/sed-VFTTATXJ.js +0 -1
  614. package/dist/bundle/chunks/sha1sum-VJPNLNU6.js +0 -1
  615. package/dist/bundle/chunks/sha256sum-PI32XWXY.js +0 -1
  616. package/dist/bundle/chunks/sort-DCNRDA7U.js +0 -1
  617. package/dist/bundle/chunks/split-SITCSYCZ.js +0 -1
  618. package/dist/bundle/chunks/sqlite3-56UMWEY3.js +0 -1
  619. package/dist/bundle/chunks/strings-7PLOGTPD.js +0 -1
  620. package/dist/bundle/chunks/tac-SJGXQ4T2.js +0 -1
  621. package/dist/bundle/chunks/tail-S5ULNTJU.js +0 -1
  622. package/dist/bundle/chunks/tar-232RCEFK.js +0 -1
  623. package/dist/bundle/chunks/tee-O7VXZDCO.js +0 -1
  624. package/dist/bundle/chunks/time-DEUO3QV2.js +0 -1
  625. package/dist/bundle/chunks/timeout-VRKMCG72.js +0 -1
  626. package/dist/bundle/chunks/tr-2HXZRDSW.js +0 -1
  627. package/dist/bundle/chunks/unexpand-RGTMIGZM.js +0 -1
  628. package/dist/bundle/chunks/uniq-SUNANL47.js +0 -1
  629. package/dist/bundle/chunks/wc-TQB3VNOX.js +0 -1
  630. package/dist/bundle/chunks/xan-BXDXYEIB.js +0 -1
  631. package/dist/bundle/chunks/xan-view-ECQUO7AJ.js +0 -1
  632. package/dist/bundle/chunks/xargs-I6EZUCYF.js +0 -1
  633. package/dist/bundle/chunks/yq-MJMAR36V.js +0 -1
  634. package/dist/commands/js-exec/executor-adapter.d.ts +0 -66
  635. package/dist/executor-init.d.ts +0 -10
  636. package/vendor/executor/executor-sdk-bundle.d.mts +0 -18
  637. package/vendor/executor/executor-sdk-bundle.mjs +0 -972
  638. /package/dist/bin/chunks/{chunk-QSDVMMYI.js → chunk-4CFAYBLV.js} +0 -0
  639. /package/dist/bin/chunks/{chunk-ND23BJUM.js → chunk-LCDPWJBA.js} +0 -0
  640. /package/dist/bin/shell/chunks/{chunk-QSDVMMYI.js → chunk-4CFAYBLV.js} +0 -0
  641. /package/dist/bin/shell/chunks/{chunk-ND23BJUM.js → chunk-LCDPWJBA.js} +0 -0
  642. /package/dist/bundle/chunks/{chunk-SYMJJMQ4.js → chunk-PXTK5WE2.js} +0 -0
@@ -1,16 +1,16 @@
1
- import{a as W,b as U}from"./chunk-24IMIIXA.js";import{a as I}from"./chunk-5QMZ5MUS.js";import{a as A}from"./chunk-YNYSPYQ5.js";import{k}from"./chunk-GFQRA5P5.js";import{a as L}from"./chunk-3THT3N7L.js";import{a as ee,b as te,c as P}from"./chunk-74CEPOFO.js";var z=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]);function H(i){let e="",t=0,n=!1;for(;t<i.length;){if(i[t]==="["&&!n){if(i[t+1]==="["&&i[t+2]===":"){let s=i.indexOf(":]]",t+3);if(s!==-1){let a=i.slice(t+3,s),r=z.get(a);if(r){e+=`[${r}]`,t=s+3;continue}}}if(i[t+1]==="^"&&i[t+2]==="["&&i[t+3]===":"){let s=i.indexOf(":]]",t+4);if(s!==-1){let a=i.slice(t+4,s),r=z.get(a);if(r){e+=`[^${r}]`,t=s+3;continue}}}e+="[",t++,n=!0,t<i.length&&i[t]==="^"&&(e+="^",t++),t<i.length&&i[t]==="]"&&(e+="\\]",t++);continue}if(n){if(i[t]==="]"){e+="]",t++,n=!1;continue}if(i[t]==="["&&i[t+1]===":"){let s=i.indexOf(":]",t+2);if(s!==-1){let a=i.slice(t+2,s),r=z.get(a);if(r){e+=r,t=s+2;continue}}}if(i[t]==="\\"&&t+1<i.length){e+=i[t]+i[t+1],t+=2;continue}e+=i[t],t++;continue}if(i[t]==="\\"&&t+1<i.length){let s=i[t+1];if(s==="+"||s==="?"||s==="|"){e+=s,t+=2;continue}if(s==="("||s===")"){e+=s,t+=2;continue}if(s==="{"||s==="}"){e+=s,t+=2;continue}if(s==="t"){e+=" ",t+=2;continue}if(s==="n"){e+=`
2
- `,t+=2;continue}if(s==="r"){e+="\r",t+=2;continue}e+=i[t]+s,t+=2;continue}if(i[t]==="+"||i[t]==="?"||i[t]==="|"||i[t]==="("||i[t]===")"){e+=`\\${i[t]}`,t++;continue}if(i[t]==="^"&&!(e===""||e.endsWith("("))){e+="\\^",t++;continue}if(i[t]==="$"){let s=t===i.length-1,a=t+2<i.length&&i[t+1]==="\\"&&i[t+2]===")";if(!s&&!a){e+="\\$",t++;continue}}e+=i[t],t++}return e}function V(i){let e="",t=!1;for(let n=0;n<i.length;n++)i[n]==="["&&!t?(t=!0,e+="[",n++,n<i.length&&i[n]==="^"&&(e+="^",n++),n<i.length&&i[n]==="]"&&(e+="]",n++),n--):i[n]==="]"&&t?(t=!1,e+="]"):!t&&i[n]==="{"&&i[n+1]===","?(e+="{0,",n++):e+=i[n];return e}function ne(i){let e="";for(let t=0;t<i.length;t++){let n=i[t],s=n.charCodeAt(0);n==="\\"?e+="\\\\":n===" "?e+="\\t":n===`
1
+ import{a as U,b as z}from"./chunk-24IMIIXA.js";import{a as I}from"./chunk-5QMZ5MUS.js";import{a as A}from"./chunk-B74TABJS.js";import{c as P}from"./chunk-AH77CRWX.js";import{k}from"./chunk-GFQRA5P5.js";import{a as L}from"./chunk-3THT3N7L.js";import{a as te,b as ne,c as W}from"./chunk-74CEPOFO.js";var H=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]);function V(i){let e="",t=0,n=!1;for(;t<i.length;){if(i[t]==="["&&!n){if(i[t+1]==="["&&i[t+2]===":"){let s=i.indexOf(":]]",t+3);if(s!==-1){let a=i.slice(t+3,s),r=H.get(a);if(r){e+=`[${r}]`,t=s+3;continue}}}if(i[t+1]==="^"&&i[t+2]==="["&&i[t+3]===":"){let s=i.indexOf(":]]",t+4);if(s!==-1){let a=i.slice(t+4,s),r=H.get(a);if(r){e+=`[^${r}]`,t=s+3;continue}}}e+="[",t++,n=!0,t<i.length&&i[t]==="^"&&(e+="^",t++),t<i.length&&i[t]==="]"&&(e+="\\]",t++);continue}if(n){if(i[t]==="]"){e+="]",t++,n=!1;continue}if(i[t]==="["&&i[t+1]===":"){let s=i.indexOf(":]",t+2);if(s!==-1){let a=i.slice(t+2,s),r=H.get(a);if(r){e+=r,t=s+2;continue}}}if(i[t]==="\\"&&t+1<i.length){e+=i[t]+i[t+1],t+=2;continue}e+=i[t],t++;continue}if(i[t]==="\\"&&t+1<i.length){let s=i[t+1];if(s==="+"||s==="?"||s==="|"){e+=s,t+=2;continue}if(s==="("||s===")"){e+=s,t+=2;continue}if(s==="{"||s==="}"){e+=s,t+=2;continue}if(s==="t"){e+=" ",t+=2;continue}if(s==="n"){e+=`
2
+ `,t+=2;continue}if(s==="r"){e+="\r",t+=2;continue}e+=i[t]+s,t+=2;continue}if(i[t]==="+"||i[t]==="?"||i[t]==="|"||i[t]==="("||i[t]===")"){e+=`\\${i[t]}`,t++;continue}if(i[t]==="^"&&!(e===""||e.endsWith("("))){e+="\\^",t++;continue}if(i[t]==="$"){let s=t===i.length-1,a=t+2<i.length&&i[t+1]==="\\"&&i[t+2]===")";if(!s&&!a){e+="\\$",t++;continue}}e+=i[t],t++}return e}function X(i){let e="",t=!1;for(let n=0;n<i.length;n++)i[n]==="["&&!t?(t=!0,e+="[",n++,n<i.length&&i[n]==="^"&&(e+="^",n++),n<i.length&&i[n]==="]"&&(e+="]",n++),n--):i[n]==="]"&&t?(t=!1,e+="]"):!t&&i[n]==="{"&&i[n+1]===","?(e+="{0,",n++):e+=i[n];return e}function ie(i){let e="";for(let t=0;t<i.length;t++){let n=i[t],s=n.charCodeAt(0);n==="\\"?e+="\\\\":n===" "?e+="\\t":n===`
3
3
  `?e+=`$
4
- `:n==="\r"?e+="\\r":n==="\x07"?e+="\\a":n==="\b"?e+="\\b":n==="\f"?e+="\\f":n==="\v"?e+="\\v":s<32||s>=127?e+=`\\${s.toString(8).padStart(3,"0")}`:e+=n}return`${e}$`}var de=1e4;function se(i,e,t){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:i,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:e,pendingFileReads:[],pendingFileWrites:[],rangeStates:t||new Map,linesConsumedInCycle:0}}function pe(i){return typeof i=="object"&&"first"in i&&"step"in i}function me(i){return typeof i=="object"&&"offset"in i}function N(i,e,t,n,s){if(i==="$")return e===t;if(typeof i=="number")return e===i;if(pe(i)){let{first:a,step:r}=i;return r===0?e===a:(e-a)%r===0&&e>=a}if(typeof i=="object"&&"pattern"in i)try{let a=i.pattern;a===""&&s?.lastPattern?a=s.lastPattern:a!==""&&s&&(s.lastPattern=a);let r=V(H(a));return A(r).test(n)}catch{return!1}return!1}function X(i){let e=t=>t===void 0?"undefined":t==="$"?"$":typeof t=="number"?String(t):"pattern"in t?`/${t.pattern}/`:"first"in t?`${t.first}~${t.step}`:"unknown";return`${e(i.start)},${e(i.end)}`}function ge(i,e,t,n,s,a){if(!i||!i.start&&!i.end)return!0;let r=i.start,l=i.end;if(r!==void 0&&l===void 0)return N(r,e,t,n,a);if(r!==void 0&&l!==void 0){let c=typeof r=="object"&&"pattern"in r,f=typeof l=="object"&&"pattern"in l,p=me(l);if(p&&s){let g=X(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active){let E=d.startLine||e;return e>=E+l.offset&&(d.active=!1,s.set(g,d)),!0}else return N(r,e,t,n,a)?(d.active=!0,d.startLine=e,s.set(g,d),l.offset===0&&(d.active=!1,s.set(g,d)),!0):!1}if(!c&&!f&&!p){let g=typeof r=="number"?r:r==="$"?t:1,d=typeof l=="number"?l:t;if(g<=d)return e>=g&&e<=d;if(s){let E=X(i),u=s.get(E);return u||(u={active:!1},s.set(E,u)),!u.completed&&e>=g?(u.completed=!0,s.set(E,u),!0):!1}return!1}if(s){let g=X(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active)return N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0;{if(d.completed)return!1;let E=!1;return typeof r=="number"?E=e>=r:E=N(r,e,t,n,a),E?(d.active=!0,d.startLine=e,s.set(g,d),N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0):!1}}return N(r,e,t,n,a)}return!0}function w(i,e,t,n,s,a){let r=ge(i,e,t,n,s,a);return i?.negated?!r:r}function be(i,e,t,n){let s="",a=0,r=!1;for(;a<=i.length;){e.lastIndex=a;let l=e.exec(i);if(!l){s+=i.slice(a);break}if(l.index!==a){s+=i.slice(a,l.index),a=l.index,r=!1;continue}let c=l[0],f=l.slice(1);if(r&&c.length===0){if(a<i.length)s+=i[a],a++;else break;r=!1;continue}if(s+=n(c,f),r=!1,c.length===0)if(a<i.length)s+=i[a],a++;else break;else a+=c.length,r=!0}return s}function G(i,e,t){let n="",s=0;for(;s<i.length;){if(i[s]==="\\"&&s+1<i.length){let a=i[s+1];if(a==="&"){n+="&",s+=2;continue}if(a==="n"){n+=`
5
- `,s+=2;continue}if(a==="t"){n+=" ",s+=2;continue}if(a==="r"){n+="\r",s+=2;continue}let r=parseInt(a,10);if(r===0){n+=e,s+=2;continue}if(r>=1&&r<=9){n+=t[r-1]||"",s+=2;continue}n+=a,s+=2;continue}if(i[s]==="&"){n+=e,s++;continue}n+=i[s],s++}return n}function ie(i,e,t){if(e>0&&i.length>e)throw new k(`sed: ${t} size limit exceeded (${e} bytes)`,"string_length")}function Ee(i,e,t){let{lineNumber:n,totalLines:s,patternSpace:a}=e;if(i.type==="label"){e.coverage?.hit(`sed:cmd:${i.type}`);return}if(w(i.address,n,s,a,e.rangeStates,e))switch(e.coverage?.hit(`sed:cmd:${i.type}`),i.type){case"substitute":{let r=i,l="";r.global&&(l+="g"),r.ignoreCase&&(l+="i");let c=r.pattern;c===""&&e.lastPattern?c=e.lastPattern:c!==""&&(e.lastPattern=c);let f=V(r.extendedRegex?c:H(c));try{let p=A(f,l),x=p.test(e.patternSpace);if(p.lastIndex=0,x){if(e.substitutionMade=!0,r.nthOccurrence&&r.nthOccurrence>0&&!r.global){let g=0,d=r.nthOccurrence,E=A(f,`g${r.ignoreCase?"i":""}`);e.patternSpace=E.replace(e.patternSpace,(u,...h)=>{if(g++,g===d){let b=h.slice(0,-2);return G(r.replacement,u,b)}return u})}else if(r.global){let g=A(f,`g${r.ignoreCase?"i":""}`);e.patternSpace=be(e.patternSpace,g,r.replacement,(d,E)=>G(r.replacement,d,E))}else e.patternSpace=p.replace(e.patternSpace,(g,...d)=>{let E=d.slice(0,-2);return G(r.replacement,g,E)});r.printOnMatch&&e.lineNumberOutput.push(e.patternSpace)}}catch{}break}case"print":e.lineNumberOutput.push(e.patternSpace);break;case"printFirstLine":{let r=e.patternSpace.indexOf(`
4
+ `:n==="\r"?e+="\\r":n==="\x07"?e+="\\a":n==="\b"?e+="\\b":n==="\f"?e+="\\f":n==="\v"?e+="\\v":s<32||s>=127?e+=`\\${s.toString(8).padStart(3,"0")}`:e+=n}return`${e}$`}var pe=1e4;function re(i,e,t){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:i,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:e,pendingFileReads:[],pendingFileWrites:[],rangeStates:t||new Map,linesConsumedInCycle:0}}function me(i){return typeof i=="object"&&"first"in i&&"step"in i}function ge(i){return typeof i=="object"&&"offset"in i}function N(i,e,t,n,s){if(i==="$")return e===t;if(typeof i=="number")return e===i;if(me(i)){let{first:a,step:r}=i;return r===0?e===a:(e-a)%r===0&&e>=a}if(typeof i=="object"&&"pattern"in i)try{let a=i.pattern;a===""&&s?.lastPattern?a=s.lastPattern:a!==""&&s&&(s.lastPattern=a);let r=X(V(a));return A(r).test(n)}catch{return!1}return!1}function G(i){let e=t=>t===void 0?"undefined":t==="$"?"$":typeof t=="number"?String(t):"pattern"in t?`/${t.pattern}/`:"first"in t?`${t.first}~${t.step}`:"unknown";return`${e(i.start)},${e(i.end)}`}function be(i,e,t,n,s,a){if(!i||!i.start&&!i.end)return!0;let r=i.start,l=i.end;if(r!==void 0&&l===void 0)return N(r,e,t,n,a);if(r!==void 0&&l!==void 0){let c=typeof r=="object"&&"pattern"in r,f=typeof l=="object"&&"pattern"in l,p=ge(l);if(p&&s){let g=G(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active){let E=d.startLine||e;return e>=E+l.offset&&(d.active=!1,s.set(g,d)),!0}else return N(r,e,t,n,a)?(d.active=!0,d.startLine=e,s.set(g,d),l.offset===0&&(d.active=!1,s.set(g,d)),!0):!1}if(!c&&!f&&!p){let g=typeof r=="number"?r:r==="$"?t:1,d=typeof l=="number"?l:t;if(g<=d)return e>=g&&e<=d;if(s){let E=G(i),u=s.get(E);return u||(u={active:!1},s.set(E,u)),!u.completed&&e>=g?(u.completed=!0,s.set(E,u),!0):!1}return!1}if(s){let g=G(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active)return N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0;{if(d.completed)return!1;let E=!1;return typeof r=="number"?E=e>=r:E=N(r,e,t,n,a),E?(d.active=!0,d.startLine=e,s.set(g,d),N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0):!1}}return N(r,e,t,n,a)}return!0}function w(i,e,t,n,s,a){let r=be(i,e,t,n,s,a);return i?.negated?!r:r}function Ee(i,e,t,n){let s="",a=0,r=!1;for(;a<=i.length;){e.lastIndex=a;let l=e.exec(i);if(!l){s+=i.slice(a);break}if(l.index!==a){s+=i.slice(a,l.index),a=l.index,r=!1;continue}let c=l[0],f=l.slice(1);if(r&&c.length===0){if(a<i.length)s+=i[a],a++;else break;r=!1;continue}if(s+=n(c,f),r=!1,c.length===0)if(a<i.length)s+=i[a],a++;else break;else a+=c.length,r=!0}return s}function j(i,e,t){let n="",s=0;for(;s<i.length;){if(i[s]==="\\"&&s+1<i.length){let a=i[s+1];if(a==="&"){n+="&",s+=2;continue}if(a==="n"){n+=`
5
+ `,s+=2;continue}if(a==="t"){n+=" ",s+=2;continue}if(a==="r"){n+="\r",s+=2;continue}let r=parseInt(a,10);if(r===0){n+=e,s+=2;continue}if(r>=1&&r<=9){n+=t[r-1]||"",s+=2;continue}n+=a,s+=2;continue}if(i[s]==="&"){n+=e,s++;continue}n+=i[s],s++}return n}function se(i,e,t){if(e>0&&i.length>e)throw new k(`sed: ${t} size limit exceeded (${e} bytes)`,"string_length")}function ve(i,e,t){let{lineNumber:n,totalLines:s,patternSpace:a}=e;if(i.type==="label"){e.coverage?.hit(`sed:cmd:${i.type}`);return}if(w(i.address,n,s,a,e.rangeStates,e))switch(e.coverage?.hit(`sed:cmd:${i.type}`),i.type){case"substitute":{let r=i,l="";r.global&&(l+="g"),r.ignoreCase&&(l+="i");let c=r.pattern;c===""&&e.lastPattern?c=e.lastPattern:c!==""&&(e.lastPattern=c);let f=X(r.extendedRegex?c:V(c));try{let p=A(f,l),x=p.test(e.patternSpace);if(p.lastIndex=0,x){if(e.substitutionMade=!0,r.nthOccurrence&&r.nthOccurrence>0&&!r.global){let g=0,d=r.nthOccurrence,E=A(f,`g${r.ignoreCase?"i":""}`);e.patternSpace=E.replace(e.patternSpace,(u,...h)=>{if(g++,g===d){let b=h.slice(0,-2);return j(r.replacement,u,b)}return u})}else if(r.global){let g=A(f,`g${r.ignoreCase?"i":""}`);e.patternSpace=Ee(e.patternSpace,g,r.replacement,(d,E)=>j(r.replacement,d,E))}else e.patternSpace=p.replace(e.patternSpace,(g,...d)=>{let E=d.slice(0,-2);return j(r.replacement,g,E)});r.printOnMatch&&e.lineNumberOutput.push(e.patternSpace)}}catch{}break}case"print":e.lineNumberOutput.push(e.patternSpace);break;case"printFirstLine":{let r=e.patternSpace.indexOf(`
6
6
  `);r!==-1?e.lineNumberOutput.push(e.patternSpace.slice(0,r)):e.lineNumberOutput.push(e.patternSpace);break}case"delete":e.deleted=!0;break;case"deleteFirstLine":{let r=e.patternSpace.indexOf(`
7
7
  `);r!==-1?(e.patternSpace=e.patternSpace.slice(r+1),e.restartCycle=!0,e.inDRestartedCycle=!0):e.deleted=!0;break}case"zap":e.patternSpace="";break;case"append":e.appendBuffer.push(i.text);break;case"insert":e.appendBuffer.unshift(`__INSERT__${i.text}`);break;case"change":e.deleted=!0,e.changedText=i.text;break;case"hold":e.holdSpace=e.patternSpace;break;case"holdAppend":e.holdSpace?e.holdSpace+=`
8
- ${e.patternSpace}`:e.holdSpace=e.patternSpace,ie(e.holdSpace,t?.maxStringLength??0,"hold space");break;case"get":e.patternSpace=e.holdSpace;break;case"getAppend":e.patternSpace+=`
9
- ${e.holdSpace}`,ie(e.patternSpace,t?.maxStringLength??0,"pattern space");break;case"exchange":{let r=e.patternSpace;e.patternSpace=e.holdSpace,e.holdSpace=r;break}case"next":e.printed=!0;break;case"quit":e.quit=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"quitSilent":e.quit=!0,e.quitSilent=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"list":{let r=ne(e.patternSpace);e.lineNumberOutput.push(r);break}case"printFilename":e.currentFilename&&e.lineNumberOutput.push(e.currentFilename);break;case"version":{let r=[4,8,0];if(i.minVersion){let l=i.minVersion.split("."),c=[],f=!1;for(let p of l){let x=parseInt(p,10);if(Number.isNaN(x)||x<0){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: invalid version string: ${i.minVersion}`,f=!0;break}c.push(x)}if(!f){for(;c.length<3;)c.push(0);for(let p=0;p<3;p++){if(c[p]>r[p]){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: this is not GNU sed version ${i.minVersion}`;break}if(c[p]<r[p])break}}}break}case"readFile":e.pendingFileReads.push({filename:i.filename,wholeFile:!0});break;case"readFileLine":e.pendingFileReads.push({filename:i.filename,wholeFile:!1});break;case"writeFile":e.pendingFileWrites.push({filename:i.filename,content:`${e.patternSpace}
8
+ ${e.patternSpace}`:e.holdSpace=e.patternSpace,se(e.holdSpace,t?.maxStringLength??0,"hold space");break;case"get":e.patternSpace=e.holdSpace;break;case"getAppend":e.patternSpace+=`
9
+ ${e.holdSpace}`,se(e.patternSpace,t?.maxStringLength??0,"pattern space");break;case"exchange":{let r=e.patternSpace;e.patternSpace=e.holdSpace,e.holdSpace=r;break}case"next":e.printed=!0;break;case"quit":e.quit=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"quitSilent":e.quit=!0,e.quitSilent=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"list":{let r=ie(e.patternSpace);e.lineNumberOutput.push(r);break}case"printFilename":e.currentFilename&&e.lineNumberOutput.push(e.currentFilename);break;case"version":{let r=[4,8,0];if(i.minVersion){let l=i.minVersion.split("."),c=[],f=!1;for(let p of l){let x=parseInt(p,10);if(Number.isNaN(x)||x<0){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: invalid version string: ${i.minVersion}`,f=!0;break}c.push(x)}if(!f){for(;c.length<3;)c.push(0);for(let p=0;p<3;p++){if(c[p]>r[p]){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: this is not GNU sed version ${i.minVersion}`;break}if(c[p]<r[p])break}}}break}case"readFile":e.pendingFileReads.push({filename:i.filename,wholeFile:!0});break;case"readFileLine":e.pendingFileReads.push({filename:i.filename,wholeFile:!1});break;case"writeFile":e.pendingFileWrites.push({filename:i.filename,content:`${e.patternSpace}
10
10
  `});break;case"writeFirstLine":{let r=e.patternSpace.indexOf(`
11
11
  `),l=r!==-1?e.patternSpace.slice(0,r):e.patternSpace;e.pendingFileWrites.push({filename:i.filename,content:`${l}
12
- `});break}case"execute":e.errorMessage="sed: e command (shell execution) is not supported in sandboxed environment",e.quit=!0;break;case"transliterate":e.patternSpace=ve(e.patternSpace,i);break;case"lineNumber":e.lineNumberOutput.push(String(e.lineNumber));break;case"branch":break;case"branchOnSubst":break;case"branchOnNoSubst":break;case"group":break}}function ve(i,e){let t="";for(let n of i){let s=e.source.indexOf(n);s!==-1?t+=e.dest[s]:t+=n}return t}function j(i,e,t,n){let s=new Map;for(let c=0;c<i.length;c++){let f=i[c];f.type==="label"&&s.set(f.name,c)}let a=n?.maxIterations??de,r=0,l=0;for(;l<i.length;){if(r++,r>a)throw new k(`sed: command execution exceeded maximum iterations (${a})`,"iterations");if(e.deleted||e.quit||e.quitSilent||e.restartCycle)break;let c=i[l];if(c.type==="next"){if(w(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:next"),e.nCommandOutput.push(e.patternSpace),t&&t.currentLineIndex+e.linesConsumedInCycle+1<t.lines.length){e.linesConsumedInCycle++;let f=t.lines[t.currentLineIndex+e.linesConsumedInCycle];e.patternSpace=f,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1,e.substitutionMade=!1}else{e.quit=!0,e.deleted=!0;break}l++;continue}if(c.type==="nextAppend"){if(w(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:nextAppend"),t&&t.currentLineIndex+e.linesConsumedInCycle+1<t.lines.length){e.linesConsumedInCycle++;let f=t.lines[t.currentLineIndex+e.linesConsumedInCycle];e.patternSpace+=`
13
- ${f}`,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;break}l++;continue}if(c.type==="branch"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)){if(e.coverage?.hit("sed:cmd:branch"),f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="branchOnSubst"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnSubst"),e.substitutionMade)){if(e.substitutionMade=!1,f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="branchOnNoSubst"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnNoSubst"),!e.substitutionMade)){if(f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="group"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:group"),j(f.commands,e,t,n),e.branchRequest)){let p=s.get(e.branchRequest);if(p!==void 0){e.branchRequest=void 0,l=p;continue}break}l++;continue}Ee(c,e,n),l++}return e.linesConsumedInCycle}var o;(function(i){i.NUMBER="NUMBER",i.DOLLAR="DOLLAR",i.PATTERN="PATTERN",i.STEP="STEP",i.RELATIVE_OFFSET="RELATIVE_OFFSET",i.LBRACE="LBRACE",i.RBRACE="RBRACE",i.SEMICOLON="SEMICOLON",i.NEWLINE="NEWLINE",i.COMMA="COMMA",i.NEGATION="NEGATION",i.COMMAND="COMMAND",i.SUBSTITUTE="SUBSTITUTE",i.TRANSLITERATE="TRANSLITERATE",i.LABEL_DEF="LABEL_DEF",i.BRANCH="BRANCH",i.BRANCH_ON_SUBST="BRANCH_ON_SUBST",i.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",i.TEXT_CMD="TEXT_CMD",i.FILE_READ="FILE_READ",i.FILE_READ_LINE="FILE_READ_LINE",i.FILE_WRITE="FILE_WRITE",i.FILE_WRITE_LINE="FILE_WRITE_LINE",i.EXECUTE="EXECUTE",i.VERSION="VERSION",i.EOF="EOF",i.ERROR="ERROR"})(o||(o={}));var _=class{input;pos=0;line=1;column=1;constructor(e){this.input=e}tokenize(){let e=[];for(;this.pos<this.input.length;){let t=this.nextToken();t&&e.push(t)}return e.push(this.makeToken(o.EOF,"")),e}makeToken(e,t,n){return{type:e,value:t,line:this.line,column:this.column,...n}}peek(e=0){return this.input[this.pos+e]||""}advance(){let e=this.input[this.pos++]||"";return e===`
12
+ `});break}case"execute":e.errorMessage="sed: e command (shell execution) is not supported in sandboxed environment",e.quit=!0;break;case"transliterate":e.patternSpace=Ce(e.patternSpace,i);break;case"lineNumber":e.lineNumberOutput.push(String(e.lineNumber));break;case"branch":break;case"branchOnSubst":break;case"branchOnNoSubst":break;case"group":break}}function Ce(i,e){let t="";for(let n of i){let s=e.source.indexOf(n);s!==-1?t+=e.dest[s]:t+=n}return t}function Z(i,e,t,n){let s=new Map;for(let c=0;c<i.length;c++){let f=i[c];f.type==="label"&&s.set(f.name,c)}let a=n?.maxIterations??pe,r=0,l=0;for(;l<i.length;){if(r++,r>a)throw new k(`sed: command execution exceeded maximum iterations (${a})`,"iterations");if(e.deleted||e.quit||e.quitSilent||e.restartCycle)break;let c=i[l];if(c.type==="next"){if(w(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:next"),e.nCommandOutput.push(e.patternSpace),t&&t.currentLineIndex+e.linesConsumedInCycle+1<t.lines.length){e.linesConsumedInCycle++;let f=t.lines[t.currentLineIndex+e.linesConsumedInCycle];e.patternSpace=f,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1,e.substitutionMade=!1}else{e.quit=!0,e.deleted=!0;break}l++;continue}if(c.type==="nextAppend"){if(w(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:nextAppend"),t&&t.currentLineIndex+e.linesConsumedInCycle+1<t.lines.length){e.linesConsumedInCycle++;let f=t.lines[t.currentLineIndex+e.linesConsumedInCycle];e.patternSpace+=`
13
+ ${f}`,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;break}l++;continue}if(c.type==="branch"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)){if(e.coverage?.hit("sed:cmd:branch"),f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="branchOnSubst"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnSubst"),e.substitutionMade)){if(e.substitutionMade=!1,f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="branchOnNoSubst"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnNoSubst"),!e.substitutionMade)){if(f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="group"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:group"),Z(f.commands,e,t,n),e.branchRequest)){let p=s.get(e.branchRequest);if(p!==void 0){e.branchRequest=void 0,l=p;continue}break}l++;continue}ve(c,e,n),l++}return e.linesConsumedInCycle}var o;(function(i){i.NUMBER="NUMBER",i.DOLLAR="DOLLAR",i.PATTERN="PATTERN",i.STEP="STEP",i.RELATIVE_OFFSET="RELATIVE_OFFSET",i.LBRACE="LBRACE",i.RBRACE="RBRACE",i.SEMICOLON="SEMICOLON",i.NEWLINE="NEWLINE",i.COMMA="COMMA",i.NEGATION="NEGATION",i.COMMAND="COMMAND",i.SUBSTITUTE="SUBSTITUTE",i.TRANSLITERATE="TRANSLITERATE",i.LABEL_DEF="LABEL_DEF",i.BRANCH="BRANCH",i.BRANCH_ON_SUBST="BRANCH_ON_SUBST",i.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",i.TEXT_CMD="TEXT_CMD",i.FILE_READ="FILE_READ",i.FILE_READ_LINE="FILE_READ_LINE",i.FILE_WRITE="FILE_WRITE",i.FILE_WRITE_LINE="FILE_WRITE_LINE",i.EXECUTE="EXECUTE",i.VERSION="VERSION",i.EOF="EOF",i.ERROR="ERROR"})(o||(o={}));var _=class{input;pos=0;line=1;column=1;constructor(e){this.input=e}tokenize(){let e=[];for(;this.pos<this.input.length;){let t=this.nextToken();t&&e.push(t)}return e.push(this.makeToken(o.EOF,"")),e}makeToken(e,t,n){return{type:e,value:t,line:this.line,column:this.column,...n}}peek(e=0){return this.input[this.pos+e]||""}advance(){let e=this.input[this.pos++]||"";return e===`
14
14
  `?(this.line++,this.column=1):this.column++,e}readEscapedString(e){let t="";for(;this.pos<this.input.length&&this.peek()!==e;)if(this.peek()==="\\"){this.advance();let n=this.advance();n==="n"?t+=`
15
15
  `:n==="t"?t+=" ":t+=n}else{if(this.peek()===`
16
16
  `)return null;t+=this.advance()}return t}skipWhitespace(){for(;this.pos<this.input.length;){let e=this.peek();if(e===" "||e===" "||e==="\r")this.advance();else if(e==="#")for(;this.pos<this.input.length&&this.peek()!==`
@@ -38,9 +38,9 @@ ${f}`,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;br
38
38
  `||r===";"||r==="}"||r==="{")break;a+=this.advance()}return{type:e,value:t,label:a||void 0,line:n,column:s}}readVersion(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
39
39
  `||s===";"||s==="}"||s==="{")break;n+=this.advance()}return{type:o.VERSION,value:"v",label:n||void 0,line:e,column:t}}readFileCommand(e,t,n,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let a="";for(;this.pos<this.input.length;){let r=this.peek();if(r===`
40
40
  `||r===";")break;a+=this.advance()}return{type:e,value:t,filename:a.trim(),line:n,column:s}}readExecute(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
41
- `||s===";")break;n+=this.advance()}return{type:o.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var Z=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new _(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(o.NEWLINE)||this.check(o.SEMICOLON)){this.advance();continue}let s=this.pos,a=this.parseCommand();if(a.error)return{commands:[],error:a.error};if(a.command&&e.push(a.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(o.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(o.NEWLINE)||this.check(o.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case o.COMMAND:return this.parseSimpleCommand(n,t);case o.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case o.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case o.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case o.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case o.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case o.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case o.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case o.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case o.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case o.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case o.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case o.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case o.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case o.LBRACE:return this.parseGroup(t);case o.RBRACE:return{command:null};case o.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,a=n.match(/(\d+)/);return a&&(s=parseInt(a[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(o.RBRACE);){if(this.check(o.NEWLINE)||this.check(o.SEMICOLON)){this.advance();continue}let n=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&t.push(s.command),this.pos===n&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(o.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(o.COMMA))return{error:"expected context address"};let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(o.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(o.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case o.NUMBER:return this.advance(),e.value;case o.DOLLAR:return this.advance(),"$";case o.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case o.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case o.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:o.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===o.EOF}};function re(i,e=!1){let t=!1,n=!1,s=[];for(let c=0;c<i.length;c++){let f=i[c];if(s.length===0&&c===0){let p=f.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let x=p[1].toLowerCase();x.includes("n")&&(t=!0),x.includes("r")&&(n=!0),f=f.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
41
+ `||s===";")break;n+=this.advance()}return{type:o.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var K=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new _(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(o.NEWLINE)||this.check(o.SEMICOLON)){this.advance();continue}let s=this.pos,a=this.parseCommand();if(a.error)return{commands:[],error:a.error};if(a.command&&e.push(a.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(o.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(o.NEWLINE)||this.check(o.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case o.COMMAND:return this.parseSimpleCommand(n,t);case o.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case o.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case o.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case o.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case o.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case o.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case o.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case o.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case o.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case o.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case o.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case o.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case o.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case o.LBRACE:return this.parseGroup(t);case o.RBRACE:return{command:null};case o.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,a=n.match(/(\d+)/);return a&&(s=parseInt(a[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(o.RBRACE);){if(this.check(o.NEWLINE)||this.check(o.SEMICOLON)){this.advance();continue}let n=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&t.push(s.command),this.pos===n&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(o.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(o.COMMA))return{error:"expected context address"};let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(o.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(o.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case o.NUMBER:return this.advance(),e.value;case o.DOLLAR:return this.advance(),"$";case o.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case o.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case o.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:o.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===o.EOF}};function ae(i,e=!1){let t=!1,n=!1,s=[];for(let c=0;c<i.length;c++){let f=i[c];if(s.length===0&&c===0){let p=f.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let x=p[1].toLowerCase();x.includes("n")&&(t=!0),x.includes("r")&&(n=!0),f=f.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
42
42
  ${f}`}else s.push(f)}let a=s.join(`
43
- `),l=new Z([a],e||n).parse();if(!l.error&&l.commands.length>0){let c=Ce(l.commands);if(c)return{commands:[],error:c,silentMode:t,extendedRegexMode:n}}return{...l,silentMode:t,extendedRegexMode:n}}function Ce(i){let e=new Set;ae(i,e);let t=ce(i,e);if(t)return`undefined label '${t}'`}function ae(i,e){for(let t of i)t.type==="label"?e.add(t.name):t.type==="group"&&ae(t.commands,e)}function ce(i,e){for(let t of i){if((t.type==="branch"||t.type==="branchOnSubst"||t.type==="branchOnNoSubst")&&t.label&&!e.has(t.label))return t.label;if(t.type==="group"){let n=ce(t.commands,e);if(n)return n}}}var xe={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
43
+ `),l=new K([a],e||n).parse();if(!l.error&&l.commands.length>0){let c=xe(l.commands);if(c)return{commands:[],error:c,silentMode:t,extendedRegexMode:n}}return{...l,silentMode:t,extendedRegexMode:n}}function xe(i){let e=new Set;ce(i,e);let t=oe(i,e);if(t)return`undefined label '${t}'`}function ce(i,e){for(let t of i)t.type==="label"?e.add(t.name):t.type==="group"&&ce(t.commands,e)}function oe(i,e){for(let t of i){if((t.type==="branch"||t.type==="branchOnSubst"||t.type==="branchOnNoSubst")&&t.label&&!e.has(t.label))return t.label;if(t.type==="group"){let n=oe(t.commands,e);if(n)return n}}}var ke={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
44
44
  s/regexp/replacement/[flags] substitute
45
45
  d delete pattern space
46
46
  p print pattern space
@@ -69,31 +69,31 @@ Addresses:
69
69
  $ last line
70
70
  /regexp/ lines matching regexp
71
71
  N,M range from line N to M
72
- first~step every step-th line starting at first`};async function K(i,e,t,n={}){let{limits:s,filename:a,fs:r,cwd:l,coverage:c,requireDefenseContext:f}=n;W(f,"sed","processing entry");let p=(R,m)=>U(f,"sed",R,m),x=i.endsWith(`
72
+ first~step every step-th line starting at first`};async function Q(i,e,t,n={}){let{limits:s,filename:a,fs:r,cwd:l,coverage:c,requireDefenseContext:f}=n;U(f,"sed","processing entry");let p=(R,m)=>z(f,"sed",R,m),x=i.endsWith(`
73
73
  `),g=i.split(`
74
- `);g.length>0&&g[g.length-1]===""&&g.pop();let d=g.length,E="",u,h=!1,b=s?.maxStringLength??0,v=R=>{if(E+=R,b>0&&E.length>b)throw new k(`sed: output size limit exceeded (${b} bytes)`,"string_length")},O="",Q,oe=new Map,T=new Map,B=new Map,D=new Map,le=s?{maxIterations:s.maxSedIterations,maxStringLength:b}:void 0;for(let R=0;R<g.length;R++){let m={...se(d,a,oe),patternSpace:g[R],holdSpace:O,lastPattern:Q,lineNumber:R+1,totalLines:d,substitutionMade:!1,coverage:c},F={lines:g,currentLineIndex:R},J=0,ue=1e4;m.linesConsumedInCycle=0;do{if(J++,J>ue)break;if(m.restartCycle=!1,m.pendingFileReads=[],m.pendingFileWrites=[],j(e,m,F,le),r&&l){for(let C of m.pendingFileReads){let S=r.resolvePath(l,C.filename);try{if(C.wholeFile){let y=await p("read command file",()=>r.readFile(S));m.appendBuffer.push(y.replace(/\n$/,""))}else{if(!T.has(S)){let fe=await p("read command file line cache",()=>r.readFile(S));T.set(S,fe.split(`
75
- `)),B.set(S,0)}let y=T.get(S),M=B.get(S);y&&M!==void 0&&M<y.length&&(m.appendBuffer.push(y[M]),B.set(S,M+1))}}catch(y){if(y instanceof I)throw y}}for(let C of m.pendingFileWrites){let S=r.resolvePath(l,C.filename),y=D.get(S)||"";D.set(S,y+C.content)}}}while(m.restartCycle&&!m.deleted&&!m.quit&&!m.quitSilent);if(R+=m.linesConsumedInCycle,O=m.holdSpace,Q=m.lastPattern,!t)for(let C of m.nCommandOutput)v(`${C}
76
- `);let he=m.lineNumberOutput.length>0;for(let C of m.lineNumberOutput)v(`${C}
77
- `);let Y=[],q=[];for(let C of m.appendBuffer)C.startsWith("__INSERT__")?Y.push(C.slice(10)):q.push(C);for(let C of Y)v(`${C}
74
+ `);g.length>0&&g[g.length-1]===""&&g.pop();let d=g.length,E="",u,h=!1,b=s?.maxStringLength??0,v=R=>{if(E+=R,b>0&&E.length>b)throw new k(`sed: output size limit exceeded (${b} bytes)`,"string_length")},O="",J,le=new Map,T=new Map,B=new Map,D=new Map,ue=s?{maxIterations:s.maxSedIterations,maxStringLength:b}:void 0;for(let R=0;R<g.length;R++){let m={...re(d,a,le),patternSpace:g[R],holdSpace:O,lastPattern:J,lineNumber:R+1,totalLines:d,substitutionMade:!1,coverage:c},F={lines:g,currentLineIndex:R},Y=0,he=1e4;m.linesConsumedInCycle=0;do{if(Y++,Y>he)break;if(m.restartCycle=!1,m.pendingFileReads=[],m.pendingFileWrites=[],Z(e,m,F,ue),r&&l){for(let C of m.pendingFileReads){let S=r.resolvePath(l,C.filename);try{if(C.wholeFile){let y=await p("read command file",()=>r.readFile(S));m.appendBuffer.push(y.replace(/\n$/,""))}else{if(!T.has(S)){let de=await p("read command file line cache",()=>r.readFile(S));T.set(S,de.split(`
75
+ `)),B.set(S,0)}let y=T.get(S),M=B.get(S);y&&M!==void 0&&M<y.length&&(m.appendBuffer.push(y[M]),B.set(S,M+1))}}catch(y){if(y instanceof I)throw y}}for(let C of m.pendingFileWrites){let S=r.resolvePath(l,C.filename),y=D.get(S)||"";D.set(S,y+C.content)}}}while(m.restartCycle&&!m.deleted&&!m.quit&&!m.quitSilent);if(R+=m.linesConsumedInCycle,O=m.holdSpace,J=m.lastPattern,!t)for(let C of m.nCommandOutput)v(`${C}
76
+ `);let fe=m.lineNumberOutput.length>0;for(let C of m.lineNumberOutput)v(`${C}
77
+ `);let ee=[],q=[];for(let C of m.appendBuffer)C.startsWith("__INSERT__")?ee.push(C.slice(10)):q.push(C);for(let C of ee)v(`${C}
78
78
  `);let $=!1;!m.deleted&&!m.quitSilent?t?m.printed&&(v(`${m.patternSpace}
79
79
  `),$=!0):(v(`${m.patternSpace}
80
80
  `),$=!0):m.changedText!==void 0&&(v(`${m.changedText}
81
81
  `),$=!0);for(let C of q)v(`${C}
82
- `);if(h=(he||$)&&q.length===0,m.quit||m.quitSilent){if(m.exitCode!==void 0&&(u=m.exitCode),m.errorMessage)return{output:"",exitCode:u||1,errorMessage:m.errorMessage};break}}if(r&&l)for(let[R,m]of D)try{await p("flush pending file writes",()=>r.writeFile(R,m))}catch(F){if(F instanceof I)throw F}return!x&&h&&E.endsWith(`
83
- `)&&(E=E.slice(0,-1)),{output:E,exitCode:u}}var De={name:"sed",async execute(i,e){W(e.requireDefenseContext,"sed","execution entry");let t=(u,h)=>U(e.requireDefenseContext,"sed",u,h);if(te(i))return ee(xe);let n=[],s=[],a=!1,r=!1,l=!1,c=[];for(let u=0;u<i.length;u++){let h=i[u];if(h==="-n"||h==="--quiet"||h==="--silent")a=!0;else if(h==="-i"||h==="--in-place")r=!0;else if(h.startsWith("-i"))r=!0;else if(h==="-E"||h==="-r"||h==="--regexp-extended")l=!0;else if(h==="-e")u+1<i.length&&n.push(i[++u]);else if(h==="-f")u+1<i.length&&s.push(i[++u]);else{if(h.startsWith("--"))return P("sed",h);if(h==="-")c.push(h);else if(h.startsWith("-")&&h.length>1){for(let b of h.slice(1))if(b!=="n"&&b!=="e"&&b!=="f"&&b!=="i"&&b!=="E"&&b!=="r")return P("sed",`-${b}`);h.includes("n")&&(a=!0),h.includes("i")&&(r=!0),(h.includes("E")||h.includes("r"))&&(l=!0),h.includes("e")&&!h.includes("n")&&!h.includes("i")&&u+1<i.length&&n.push(i[++u]),h.includes("f")&&!h.includes("e")&&u+1<i.length&&s.push(i[++u])}else!h.startsWith("-")&&n.length===0&&s.length===0?n.push(h):h.startsWith("-")||c.push(h)}}for(let u of s){let h=e.fs.resolvePath(e.cwd,u);try{let b=await t("script file read",()=>e.fs.readFile(h));for(let v of b.split(`
82
+ `);if(h=(fe||$)&&q.length===0,m.quit||m.quitSilent){if(m.exitCode!==void 0&&(u=m.exitCode),m.errorMessage)return{output:"",exitCode:u||1,errorMessage:m.errorMessage};break}}if(r&&l)for(let[R,m]of D)try{await p("flush pending file writes",()=>r.writeFile(R,m))}catch(F){if(F instanceof I)throw F}return!x&&h&&E.endsWith(`
83
+ `)&&(E=E.slice(0,-1)),{output:E,exitCode:u}}var Pe={name:"sed",async execute(i,e){U(e.requireDefenseContext,"sed","execution entry");let t=(u,h)=>z(e.requireDefenseContext,"sed",u,h);if(ne(i))return te(ke);let n=[],s=[],a=!1,r=!1,l=!1,c=[];for(let u=0;u<i.length;u++){let h=i[u];if(h==="-n"||h==="--quiet"||h==="--silent")a=!0;else if(h==="-i"||h==="--in-place")r=!0;else if(h.startsWith("-i"))r=!0;else if(h==="-E"||h==="-r"||h==="--regexp-extended")l=!0;else if(h==="-e")u+1<i.length&&n.push(i[++u]);else if(h==="-f")u+1<i.length&&s.push(i[++u]);else{if(h.startsWith("--"))return W("sed",h);if(h==="-")c.push(h);else if(h.startsWith("-")&&h.length>1){for(let b of h.slice(1))if(b!=="n"&&b!=="e"&&b!=="f"&&b!=="i"&&b!=="E"&&b!=="r")return W("sed",`-${b}`);h.includes("n")&&(a=!0),h.includes("i")&&(r=!0),(h.includes("E")||h.includes("r"))&&(l=!0),h.includes("e")&&!h.includes("n")&&!h.includes("i")&&u+1<i.length&&n.push(i[++u]),h.includes("f")&&!h.includes("e")&&u+1<i.length&&s.push(i[++u])}else!h.startsWith("-")&&n.length===0&&s.length===0?n.push(h):h.startsWith("-")||c.push(h)}}for(let u of s){let h=e.fs.resolvePath(e.cwd,u);try{let b=await t("script file read",()=>e.fs.readFile(h));for(let v of b.split(`
84
84
  `)){let O=v.trim();O&&!O.startsWith("#")&&n.push(O)}}catch(b){if(b instanceof I)throw b;return{stdout:"",stderr:`sed: couldn't open file ${u}: No such file or directory
85
85
  `,exitCode:1}}}if(n.length===0)return{stdout:"",stderr:`sed: no script specified
86
- `,exitCode:1};let{commands:f,error:p,silentMode:x}=re(n,l);if(p)return{stdout:"",stderr:`sed: ${p}
86
+ `,exitCode:1};let{commands:f,error:p,silentMode:x}=ae(n,l);if(p)return{stdout:"",stderr:`sed: ${p}
87
87
  `,exitCode:1};let g=!!(a||x);if(r){if(c.length===0)return{stdout:"",stderr:`sed: -i requires at least one file argument
88
- `,exitCode:1};for(let u of c){if(u==="-")continue;let h=e.fs.resolvePath(e.cwd,u);try{let b=await t("in-place input read",()=>e.fs.readFile(h)),v=await t("in-place processing",()=>K(b,f,g,{limits:e.limits,filename:u,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));if(v.errorMessage)return{stdout:"",stderr:`${v.errorMessage}
88
+ `,exitCode:1};for(let u of c){if(u==="-")continue;let h=e.fs.resolvePath(e.cwd,u);try{let b=await t("in-place input read",()=>e.fs.readFile(h)),v=await t("in-place processing",()=>Q(b,f,g,{limits:e.limits,filename:u,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));if(v.errorMessage)return{stdout:"",stderr:`${v.errorMessage}
89
89
  `,exitCode:v.exitCode??1};await t("in-place output write",()=>e.fs.writeFile(h,v.output))}catch(b){if(b instanceof I)throw b;return b instanceof k?{stdout:"",stderr:`sed: ${L(b.message)}
90
90
  `,exitCode:k.EXIT_CODE}:{stdout:"",stderr:`sed: ${u}: No such file or directory
91
- `,exitCode:1}}}return{stdout:"",stderr:"",exitCode:0}}let d="";if(c.length===0){d=e.stdin;try{let u=await t("stdin processing",()=>K(d,f,g,{limits:e.limits,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));return{stdout:u.output,stderr:u.errorMessage?`${u.errorMessage}
91
+ `,exitCode:1}}}return{stdout:"",stderr:"",exitCode:0}}let d="";if(c.length===0){d=P(e.stdin);try{let u=await t("stdin processing",()=>Q(d,f,g,{limits:e.limits,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));return{stdout:u.output,stderr:u.errorMessage?`${u.errorMessage}
92
92
  `:"",exitCode:u.exitCode??0}}catch(u){if(u instanceof I)throw u;if(u instanceof k)return{stdout:"",stderr:`sed: ${L(u.message)}
93
- `,exitCode:k.EXIT_CODE};throw u}}let E=!1;for(let u of c){let h;if(u==="-")E?h="":(h=e.stdin,E=!0);else{let b=e.fs.resolvePath(e.cwd,u);try{h=await t("input file read",()=>e.fs.readFile(b))}catch(v){if(v instanceof I)throw v;return v instanceof k?{stdout:"",stderr:`sed: ${L(v.message)}
93
+ `,exitCode:k.EXIT_CODE};throw u}}let E=!1;for(let u of c){let h;if(u==="-")E?h="":(h=P(e.stdin),E=!0);else{let b=e.fs.resolvePath(e.cwd,u);try{h=await t("input file read",()=>e.fs.readFile(b))}catch(v){if(v instanceof I)throw v;return v instanceof k?{stdout:"",stderr:`sed: ${L(v.message)}
94
94
  `,exitCode:k.EXIT_CODE}:{stdout:"",stderr:`sed: ${u}: No such file or directory
95
95
  `,exitCode:1}}}d.length>0&&h.length>0&&!d.endsWith(`
96
96
  `)&&(d+=`
97
- `),d+=h}try{let u=await t("final processing",()=>K(d,f,g,{limits:e.limits,filename:c.length===1?c[0]:void 0,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));return{stdout:u.output,stderr:u.errorMessage?`${u.errorMessage}
97
+ `),d+=h}try{let u=await t("final processing",()=>Q(d,f,g,{limits:e.limits,filename:c.length===1?c[0]:void 0,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));return{stdout:u.output,stderr:u.errorMessage?`${u.errorMessage}
98
98
  `:"",exitCode:u.exitCode??0}}catch(u){if(u instanceof I)throw u;if(u instanceof k)return{stdout:"",stderr:`sed: ${L(u.message)}
99
- `,exitCode:k.EXIT_CODE};throw u}}},qe={name:"sed",flags:[{flag:"-n",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-E",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{De as a,qe as b};
99
+ `,exitCode:k.EXIT_CODE};throw u}}},We={name:"sed",flags:[{flag:"-n",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-E",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{Pe as a,We as b};
@@ -0,0 +1,8 @@
1
+ async function c(e,t){if(e.length>0&&e[0]!=="-"){let i=t.fs.resolvePath(t.cwd,e[0]);try{let o=(await t.fs.readFile(i)).split(`
2
+ `);o[o.length-1]===""&&o.pop();let r=o.reverse();return{stdout:r.length>0?`${r.join(`
3
+ `)}
4
+ `:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${e[0]}: No such file or directory
5
+ `,exitCode:1}}}let n=t.stdin.split(`
6
+ `);n[n.length-1]===""&&n.pop();let s=n.reverse();return{stdout:s.length>0?`${s.join(`
7
+ `)}
8
+ `:"",stderr:"",exitCode:0}}var u={name:"tac",execute:c},f={name:"tac",flags:[],stdinType:"text",needsFiles:!0};export{u as a,f as b};
@@ -0,0 +1,6 @@
1
+ import{c as f}from"./chunk-AH77CRWX.js";import{a,b as c,c as d}from"./chunk-74CEPOFO.js";var u={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]};function p(r){return Array.from(r).reverse().join("")}var g={name:"rev",execute:async(r,s)=>{if(c(r))return a(u);let o=[];for(let e of r)if(e==="--"){let t=r.indexOf(e);o.push(...r.slice(t+1));break}else{if(e.startsWith("-")&&e!=="-")return d("rev",e);o.push(e)}let n="",l=e=>{let t=e.split(`
2
+ `),i=e.endsWith(`
3
+ `)&&t[t.length-1]==="";return i&&t.pop(),t.map(p).join(`
4
+ `)+(i?`
5
+ `:"")};if(o.length===0){let e=f(s.stdin)??"";n=l(e)}else for(let e of o)if(e==="-"){let t=f(s.stdin)??"";n+=l(t)}else{let t=s.fs.resolvePath(s.cwd,e),i=await s.fs.readFile(t);if(i===null)return{exitCode:1,stdout:n,stderr:`rev: ${e}: No such file or directory
6
+ `};n+=l(i)}return{exitCode:0,stdout:n,stderr:""}}},y={name:"rev",flags:[],stdinType:"text",needsFiles:!0};export{g as a,y as b};
@@ -0,0 +1,11 @@
1
+ import{c as p}from"./chunk-AH77CRWX.js";import{a as h,b as w,c as b}from"./chunk-74CEPOFO.js";var g={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};function y(s,r,n){return n?new TextEncoder().encode(s).length:s===" "?8-r%8:s==="\b"?-1:1}function N(s,r){if(s.length===0)return s;let{width:n,breakAtSpaces:u,countBytes:i}=r,l=[],e="",t=0,o=-1,f=0;for(let c=0;c<s.length;c++){let a=s[c],d=y(a,t,i);t+d>n&&e.length>0?u&&o>=0?(l.push(e.slice(0,o+1)),e=e.slice(o+1)+a,t=t-f-1+d,o=-1,f=0):(l.push(e),e=a,t=d,o=-1,f=0):(e+=a,t+=d,(a===" "||a===" ")&&(o=e.length-1,f=t-d))}return e.length>0&&l.push(e),l.join(`
2
+ `)}function m(s,r){if(s==="")return"";let n=s.split(`
3
+ `),u=s.endsWith(`
4
+ `)&&n[n.length-1]==="";return u&&n.pop(),n.map(l=>N(l,r)).join(`
5
+ `)+(u?`
6
+ `:"")}var I={name:"fold",execute:async(s,r)=>{if(w(s))return h(g);let n={width:80,breakAtSpaces:!1,countBytes:!1},u=[],i=0;for(;i<s.length;){let e=s[i];if(e==="-w"&&i+1<s.length){let t=parseInt(s[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${s[i+1]}'
7
+ `};n.width=t,i+=2}else if(e.startsWith("-w")&&e.length>2){let t=parseInt(e.slice(2),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${e.slice(2)}'
8
+ `};n.width=t,i++}else if(e==="-s")n.breakAtSpaces=!0,i++;else if(e==="-b")n.countBytes=!0,i++;else if(e==="-bs"||e==="-sb")n.breakAtSpaces=!0,n.countBytes=!0,i++;else if(e.match(/^-[sb]+w\d+$/)){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=e.replace(/^-[sb]+w/,""),o=parseInt(t,10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${t}'
9
+ `};n.width=o,i++}else if(e.match(/^-[sb]+w$/)&&i+1<s.length){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=parseInt(s[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${s[i+1]}'
10
+ `};n.width=t,i+=2}else if(e==="--"){u.push(...s.slice(i+1));break}else if(e.startsWith("-")&&e!=="-"){let t=e.slice(1),o=!1;for(let f of t)if(f==="s")n.breakAtSpaces=!0;else if(f==="b")n.countBytes=!0;else{o=!0;break}if(o)return b("fold",e);i++}else u.push(e),i++}let l="";if(u.length===0){let e=p(r.stdin)??"";l=m(e,n)}else for(let e of u){let t=r.fs.resolvePath(r.cwd,e),o=await r.fs.readFile(t);if(o===null)return{exitCode:1,stdout:l,stderr:`fold: ${e}: No such file or directory
11
+ `};l+=m(o,n)}return{exitCode:0,stdout:l,stderr:""}}},C={name:"fold",flags:[{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"boolean"},{flag:"-b",type:"boolean"}],stdinType:"text",needsFiles:!0};export{I as a,C as b};
@@ -0,0 +1,2 @@
1
+ import{e as u,f as m}from"./chunk-AH77CRWX.js";async function w(t,n,s){let{cmdName:r,allowStdinMarker:d=!0,stopOnError:i=!1,batchSize:f=100}=s;if(n.length===0)return{files:[{filename:"",content:t.stdin}],stderr:"",exitCode:0};let a=[],c="",l=0;for(let o=0;o<n.length;o+=f){let h=n.slice(o,o+f),p=await Promise.all(h.map(async e=>{if(d&&e==="-")return{filename:"-",content:t.stdin,error:null};try{let C=t.fs.resolvePath(t.cwd,e),y=await m(t.fs,C);return{filename:e,content:y,error:null}}catch{return{filename:e,content:u,error:`${r}: ${e}: No such file or directory
2
+ `}}}));for(let e of p)if(e.error){if(c+=e.error,l=1,i)return{files:a,stderr:c,exitCode:l}}else a.push({filename:e.filename,content:e.content})}return{files:a,stderr:c,exitCode:l}}async function T(t,n,s){let r=await w(t,n,{...s,stopOnError:!0});return r.exitCode!==0?{ok:!1,error:{stdout:"",stderr:r.stderr,exitCode:r.exitCode}}:{ok:!0,content:r.files.map(i=>i.content).join("")}}export{w as a,T as b};
@@ -1 +1 @@
1
- import{a as l,b as n,d as s}from"./chunk-HDQ56CKY.js";import{a,b as i}from"./chunk-74CEPOFO.js";var m={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},d={name:"tail",async execute(t,r){if(i(t))return a(m);let e=l(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:f}=e.options;return n(r,e.options,"tail",u=>s(u,o,p,f??!1))}},c={name:"tail",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{d as a,c as b};
1
+ import{a as l,b as n,d as s}from"./chunk-UGMTY5A7.js";import{a,b as i}from"./chunk-74CEPOFO.js";var m={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},d={name:"tail",async execute(t,r){if(i(t))return a(m);let e=l(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:f}=e.options;return n(r,e.options,"tail",u=>s(u,o,p,f??!1))}},c={name:"tail",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{d as a,c as b};
@@ -0,0 +1,16 @@
1
+ import{f as a}from"./chunk-AH77CRWX.js";import{a as d,b as h,c as p}from"./chunk-74CEPOFO.js";var k={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},m=1e5;function b(s){let l=s.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!l)return null;let e=Number.parseInt(l[1],10);if(Number.isNaN(e)||e<1)return null;let u=(l[2]||"").toUpperCase(),o=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return o===void 0?null:e*o}function g(s,l,e){if(l)return s.toString().padStart(e,"0");let u="abcdefghijklmnopqrstuvwxyz",t="",o=s;for(let r=0;r<e;r++)t=u[o%26]+t,o=Math.floor(o/26);return t}function C(s,l){let e=s.split(`
2
+ `),u=s.endsWith(`
3
+ `)&&e[e.length-1]==="";u&&e.pop();let t=[];for(let o=0;o<e.length;o+=l){let r=e.slice(o,o+l),c=o+l>=e.length&&!u?r.join(`
4
+ `):`${r.join(`
5
+ `)}
6
+ `;t.push({content:c,hasContent:!0})}return t}function S(s,l){let u=new TextEncoder().encode(s),t=new TextDecoder,o=[];for(let r=0;r<u.length;r+=l){let f=u.slice(r,r+l);o.push({content:t.decode(f),hasContent:f.length>0})}return o}function v(s,l){let u=new TextEncoder().encode(s),t=new TextDecoder,o=[],r=Math.ceil(u.length/l);for(let f=0;f<l;f++){let c=f*r,i=Math.min(c+r,u.length),n=u.slice(c,i);o.push({content:t.decode(n),hasContent:n.length>0})}return o}var F={name:"split",execute:async(s,l)=>{if(h(s))return d(k);let e={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],t=0;for(;t<s.length;){let i=s[t];if(i==="-l"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${s[t+1]}'
7
+ `};e.mode="lines",e.lines=n,t+=2}else if(i.match(/^-l\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${i.slice(2)}'
8
+ `};e.mode="lines",e.lines=n,t++}else if(i==="-b"&&t+1<s.length){let n=b(s[t+1]);if(n===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${s[t+1]}'
9
+ `};e.mode="bytes",e.bytes=n,t+=2}else if(i.match(/^-b.+$/)){let n=b(i.slice(2));if(n===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${i.slice(2)}'
10
+ `};e.mode="bytes",e.bytes=n,t++}else if(i==="-n"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${s[t+1]}'
11
+ `};e.mode="chunks",e.chunks=n,t+=2}else if(i.match(/^-n\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${i.slice(2)}'
12
+ `};e.mode="chunks",e.chunks=n,t++}else if(i==="-a"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${s[t+1]}'
13
+ `};e.suffixLength=n,t+=2}else if(i.match(/^-a\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${i.slice(2)}'
14
+ `};e.suffixLength=n,t++}else if(i==="-d"||i==="--numeric-suffixes")e.useNumericSuffix=!0,t++;else if(i.startsWith("--additional-suffix="))e.additionalSuffix=i.slice(20),t++;else if(i==="--additional-suffix"&&t+1<s.length)e.additionalSuffix=s[t+1],t+=2;else if(i==="--"){u.push(...s.slice(t+1));break}else{if(i.startsWith("-")&&i!=="-")return p("split",i);u.push(i),t++}}let o="-",r="x";u.length>=1&&(o=u[0]),u.length>=2&&(r=u[1]);let f;if(o==="-")f=l.stdin??"";else{let i=l.fs.resolvePath(l.cwd,o);try{let n=await a(l.fs,i);f=n}catch{return{exitCode:1,stdout:"",stderr:`split: ${o}: No such file or directory
15
+ `}}}if(f==="")return{exitCode:0,stdout:"",stderr:""};let c;switch(e.mode){case"lines":c=C(f,e.lines);break;case"bytes":c=S(f,e.bytes);break;case"chunks":c=v(f,e.chunks);break;default:return e.mode}if(c.length>m)return{exitCode:1,stdout:"",stderr:`split: too many output files (${c.length}), limit is ${m}
16
+ `};for(let i=0;i<c.length;i++){let n=c[i];if(!n.hasContent)continue;let x=g(i,e.useNumericSuffix,e.suffixLength),N=`${r}${x}${e.additionalSuffix}`,y=l.fs.resolvePath(l.cwd,N);await l.fs.writeFile(y,n.content,"binary")}return{exitCode:0,stdout:"",stderr:""}}},E={name:"split",flags:[{flag:"-l",type:"value",valueHint:"number"},{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-d",type:"boolean"},{flag:"-a",type:"value",valueHint:"number"}],needsFiles:!0};export{F as a,E as b};
@@ -0,0 +1,5 @@
1
+ import{c as u}from"./chunk-OJDRYQWQ.js";import{c as l}from"./chunk-AH77CRWX.js";import{a as d,b as h}from"./chunk-74CEPOFO.js";var m={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},F={name:"bash",async execute(t,e){if(h(t))return d(m);if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"bash",c=t.slice(3);return r(s,n,c,e)}if(t.length===0){let s=l(e.stdin);return s.trim()?r(s,"bash",[],e):{stdout:"",stderr:"",exitCode:0}}let o=t[0],i=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,o),n=await e.fs.readFile(s);return r(n,o,i,e)}catch{return{stdout:"",stderr:`bash: ${o}: No such file or directory
2
+ `,exitCode:127}}}},P={name:"sh",async execute(t,e){if(h(t))return d({...m,name:"sh",summary:"execute shell commands or scripts (POSIX shell)"});if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"sh",c=t.slice(3);return r(s,n,c,e)}if(t.length===0){let s=l(e.stdin);return s.trim()?r(s,"sh",[],e):{stdout:"",stderr:"",exitCode:0}}let o=t[0],i=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,o),n=await e.fs.readFile(s);return r(n,o,i,e)}catch{return{stdout:"",stderr:`sh: ${o}: No such file or directory
3
+ `,exitCode:127}}}};async function r(t,e,o,i){if(!i.exec)return{stdout:"",stderr:`bash: internal error: exec function not available
4
+ `,exitCode:1};let s=u(i.exportedEnv||{},{0:e,"#":String(o.length),"@":o.join(" "),"*":o.join(" ")});o.forEach((a,p)=>{s[String(p+1)]=a});let n=t;if(n.startsWith("#!")){let a=n.indexOf(`
5
+ `);a!==-1&&(n=n.slice(a+1))}return await i.exec(n,{env:s,cwd:i.cwd,stdin:i.stdin,stdinKind:"bytes",signal:i.signal})}var T={name:"bash",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"},v={name:"sh",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"};export{F as a,P as b,T as c,v as d};
@@ -0,0 +1,10 @@
1
+ import{c as g}from"./chunk-AH77CRWX.js";import{a as b,b as m,c as v}from"./chunk-74CEPOFO.js";var L={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};function f(s){let i=s.split(",").map(o=>o.trim()),e=[];for(let o of i){let n=parseInt(o,10);if(Number.isNaN(n)||n<1)return null;e.push(n)}for(let o=1;o<e.length;o++)if(e[o]<=e[o-1])return null;return e}function C(s,i){if(i.length===1){let e=i[0];return s+(e-s%e)}for(let e of i)if(e>s)return e;if(i.length>=2){let e=i[i.length-1]-i[i.length-2],o=i[i.length-1],n=Math.floor((s-o)/e)+1;return o+n*e}return-1}function N(s,i){let{tabStops:e,allBlanks:o}=i,n="",a=0,t="",l=0,u=!0,d=()=>{if(t.length===0)return;let r=l+t.length;if(!o&&!u){n+=t,t="";return}let p=l,c="";for(;p<r;){let h=C(p,e);if(h<=r&&h>p)c+=" ",p=h;else break}let x=r-p;x>0&&(c+=" ".repeat(x)),n+=c,t=""};for(let r of s)r===" "?(t.length===0&&(l=a),t+=r,a++):r===" "?(d(),n+=r,a=C(a,e)):(d(),n+=r,a++,u=!1);return d(),n}function k(s,i){if(s==="")return"";let e=s.split(`
2
+ `),o=s.endsWith(`
3
+ `)&&e[e.length-1]==="";return o&&e.pop(),e.map(a=>N(a,i)).join(`
4
+ `)+(o?`
5
+ `:"")}var I={name:"unexpand",execute:async(s,i)=>{if(m(s))return b(L);let e={tabStops:[8],allBlanks:!1},o=[],n=0;for(;n<s.length;){let t=s[n];if(t==="-t"&&n+1<s.length){let l=f(s[n+1]);if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
6
+ `};e.tabStops=l,n+=2}else if(t.startsWith("-t")&&t.length>2){let l=f(t.slice(2));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(2)}'
7
+ `};e.tabStops=l,n++}else if(t==="--tabs"&&n+1<s.length){let l=f(s[n+1]);if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
8
+ `};e.tabStops=l,n+=2}else if(t.startsWith("--tabs=")){let l=f(t.slice(7));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(7)}'
9
+ `};e.tabStops=l,n++}else if(t==="-a"||t==="--all")e.allBlanks=!0,n++;else if(t==="--"){o.push(...s.slice(n+1));break}else{if(t.startsWith("-")&&t!=="-")return v("unexpand",t);o.push(t),n++}}let a="";if(o.length===0){let t=g(i.stdin)??"";a=k(t,e)}else for(let t of o){let l=i.fs.resolvePath(i.cwd,t),u=await i.fs.readFile(l);if(u===null)return{exitCode:1,stdout:a,stderr:`unexpand: ${t}: No such file or directory
10
+ `};a+=k(u,e)}return{exitCode:0,stdout:a,stderr:""}}},T={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0};export{I as a,T as b};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-EIZGF4BS.js";var a=s("sha256sum","sha256","compute SHA256 message digest"),m={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b};
1
+ import{a as s}from"./chunk-JMNW4NXI.js";var a=s("sha256sum","sha256","compute SHA256 message digest"),m={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b};
@@ -0,0 +1,22 @@
1
+ import{a as Ue,b as Re,c as ge}from"./chunk-74CEPOFO.js";import{a as re,c as L,e as Le}from"./chunk-DXB73IDG.js";var _e=L(ye=>{ye.read=function(i,e,t,r,n){var o,s,a=n*8-r-1,m=(1<<a)-1,f=m>>1,c=-7,p=t?n-1:0,u=t?-1:1,d=i[e+p];for(p+=u,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=o*256+i[e+p],p+=u,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=s*256+i[e+p],p+=u,c-=8);if(o===0)o=1-f;else{if(o===m)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-f}return(d?-1:1)*s*Math.pow(2,o-r)};ye.write=function(i,e,t,r,n,o){var s,a,m,f=o*8-n-1,c=(1<<f)-1,p=c>>1,u=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,B=r?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+p>=1?e+=u/m:e+=u*Math.pow(2,1-p),e*m>=2&&(s++,m/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(e*m-1)*Math.pow(2,n),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,n),s=0));n>=8;i[t+d]=a&255,d+=B,a/=256,n-=8);for(s=s<<n|a,f+=n;f>0;i[t+d]=s&255,d+=B,s/=256,f-=8);i[t+d-B]|=k*128}});var Je=L((cn,He)=>{var H=1e3,J=H*60,X=J*60,$=X*24,qt=$*7,Ht=$*365.25;He.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return Jt(i);if(t==="number"&&isFinite(i))return e.long?Qt(i):Xt(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function Jt(i){if(i=String(i),!(i.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*Ht;case"weeks":case"week":case"w":return t*qt;case"days":case"day":case"d":return t*$;case"hours":case"hour":case"hrs":case"hr":case"h":return t*X;case"minutes":case"minute":case"mins":case"min":case"m":return t*J;case"seconds":case"second":case"secs":case"sec":case"s":return t*H;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Xt(i){var e=Math.abs(i);return e>=$?Math.round(i/$)+"d":e>=X?Math.round(i/X)+"h":e>=J?Math.round(i/J)+"m":e>=H?Math.round(i/H)+"s":i+"ms"}function Qt(i){var e=Math.abs(i);return e>=$?fe(i,e,$,"day"):e>=X?fe(i,e,X,"hour"):e>=J?fe(i,e,J,"minute"):e>=H?fe(i,e,H,"second"):i+" ms"}function fe(i,e,t,r){var n=e>=t*1.5;return Math.round(i/t)+" "+r+(n?"s":"")}});var Ce=L((fn,Xe)=>{function Yt(i){t.debug=t,t.default=t,t.coerce=m,t.disable=s,t.enable=n,t.enabled=a,t.humanize=Je(),t.destroy=f,Object.keys(i).forEach(c=>{t[c]=i[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let p=0;for(let u=0;u<c.length;u++)p=(p<<5)-p+c.charCodeAt(u),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(c){let p,u=null,d,B;function k(...E){if(!k.enabled)return;let P=k,te=Number(new Date),It=te-(p||te);P.diff=It,P.prev=p,P.curr=te,p=te,E[0]=t.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let ie=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(he,Bt)=>{if(he==="%%")return"%";ie++;let Me=t.formatters[Bt];if(typeof Me=="function"){let Dt=E[ie];he=Me.call(P,Dt),E.splice(ie,1),ie--}return he}),t.formatArgs.call(P,E),(P.log||t.log).apply(P,E)}return k.namespace=c,k.useColors=t.useColors(),k.color=t.selectColor(c),k.extend=r,k.destroy=t.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>u!==null?u:(d!==t.namespaces&&(d=t.namespaces,B=t.enabled(c)),B),set:E=>{u=E}}),typeof t.init=="function"&&t.init(k),k}function r(c,p){let u=t(this.namespace+(typeof p>"u"?":":p)+c);return u.log=this.log,u}function n(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let p=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let u of p)u[0]==="-"?t.skips.push(u.slice(1)):t.names.push(u)}function o(c,p){let u=0,d=0,B=-1,k=0;for(;u<c.length;)if(d<p.length&&(p[d]===c[u]||p[d]==="*"))p[d]==="*"?(B=d,k=u,d++):(u++,d++);else if(B!==-1)d=B+1,k++,u=k;else return!1;for(;d<p.length&&p[d]==="*";)d++;return d===p.length}function s(){let c=[...t.names,...t.skips.map(p=>"-"+p)].join(",");return t.enable(""),c}function a(c){for(let p of t.skips)if(o(c,p))return!1;for(let p of t.names)if(o(c,p))return!0;return!1}function m(c){return c instanceof Error?c.stack||c.message:c}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Xe.exports=Yt});var Qe=L((F,pe)=>{F.formatArgs=ei;F.save=ti;F.load=ii;F.useColors=Kt;F.storage=ri();F.destroy=(()=>{let i=!1;return()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();F.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Kt(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let i;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ei(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+pe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,r=0;i[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(r=t))}),i.splice(r,0,e)}F.log=console.debug||console.log||(()=>{});function ti(i){try{i?F.storage.setItem("debug",i):F.storage.removeItem("debug")}catch{}}function ii(){let i;try{i=F.storage.getItem("debug")||F.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function ri(){try{return localStorage}catch{}}pe.exports=Ce()(F);var{formatters:ni}=pe.exports;ni.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ke=L((pn,Ye)=>{"use strict";Ye.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}});var it=L((mn,tt)=>{"use strict";var oi=re("os"),et=re("tty"),T=Ke(),{env:w}=process,U;T("no-color")||T("no-colors")||T("color=false")||T("color=never")?U=0:(T("color")||T("colors")||T("color=true")||T("color=always"))&&(U=1);"FORCE_COLOR"in w&&(w.FORCE_COLOR==="true"?U=1:w.FORCE_COLOR==="false"?U=0:U=w.FORCE_COLOR.length===0?1:Math.min(parseInt(w.FORCE_COLOR,10),3));function Se(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function Fe(i,e){if(U===0)return 0;if(T("color=16m")||T("color=full")||T("color=truecolor"))return 3;if(T("color=256"))return 2;if(i&&!e&&U===void 0)return 0;let t=U||0;if(w.TERM==="dumb")return t;if(process.platform==="win32"){let r=oi.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in w)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in w)||w.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in w)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(w.TEAMCITY_VERSION)?1:0;if(w.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in w){let r=parseInt((w.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(w.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(w.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(w.TERM)||"COLORTERM"in w?1:t}function si(i){let e=Fe(i,i&&i.isTTY);return Se(e)}tt.exports={supportsColor:si,stdout:Se(Fe(!0,et.isatty(1))),stderr:Se(Fe(!0,et.isatty(2)))}});var nt=L((y,ue)=>{var ai=re("tty"),me=re("util");y.init=di;y.log=mi;y.formatArgs=fi;y.save=ui;y.load=li;y.useColors=ci;y.destroy=me.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");y.colors=[6,2,3,4,5,1];try{let i=it();i&&(i.stderr||i).level>=2&&(y.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}y.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,o)=>o.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),i[t]=r,i},{});function ci(){return"colors"in y.inspectOpts?!!y.inspectOpts.colors:ai.isatty(process.stderr.fd)}function fi(i){let{namespace:e,useColors:t}=this;if(t){let r=this.color,n="\x1B[3"+(r<8?r:"8;5;"+r),o=` ${n};1m${e} \x1B[0m`;i[0]=o+i[0].split(`
2
+ `).join(`
3
+ `+o),i.push(n+"m+"+ue.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=pi()+e+" "+i[0]}function pi(){return y.inspectOpts.hideDate?"":new Date().toISOString()+" "}function mi(...i){return process.stderr.write(me.formatWithOptions(y.inspectOpts,...i)+`
4
+ `)}function ui(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function li(){return process.env.DEBUG}function di(i){i.inspectOpts={};let e=Object.keys(y.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=y.inspectOpts[e[t]]}ue.exports=Ce()(y);var{formatters:rt}=ue.exports;rt.o=function(i){return this.inspectOpts.colors=this.useColors,me.inspect(i,this.inspectOpts).split(`
5
+ `).map(e=>e.trim()).join(" ")};rt.O=function(i){return this.inspectOpts.colors=this.useColors,me.inspect(i,this.inspectOpts)}});var ot=L((un,Ee)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ee.exports=Qe():Ee.exports=nt()});var Ot="End-Of-Stream",l=class extends Error{constructor(){super(Ot),this.name="EndOfStreamError"}},N=class extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}};var j=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){let r=await this.read(e,t);return this.peekQueue.push(e.subarray(0,r)),r}async read(e,t=!1){if(e.length===0)return 0;let r=this.readFromPeekBuffer(e);if(this.endOfStream||(r+=await this.readRemainderFromStream(e.subarray(r),t)),r===0&&!t)throw new l;return r}readFromPeekBuffer(e){let t=e.length,r=0;for(;this.peekQueue.length>0&&t>0;){let n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");let o=Math.min(n.length,t);e.set(n.subarray(0,o),r),r+=o,t-=o,o<n.length&&this.peekQueue.push(n.subarray(o))}return r}async readRemainderFromStream(e,t){let r=0;for(;r<e.length&&!this.endOfStream;){if(this.interrupted)throw new N;let n=await this.readFromStream(e.subarray(r),t);if(n===0)break;r+=n}if(!t&&r<e.length)throw new l;return r}};var ne=class extends j{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}};var Q=class extends ne{async readFromStream(e,t){if(e.length===0)return 0;let r=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value),r.value.length):0}};var Z=class extends j{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){let r=Math.min(t.length,e.length);return e.set(t.subarray(0,r)),r<t.length?this.buffer=t.subarray(r):this.buffer=null,r}async readFromStream(e,t){if(e.length===0)return 0;let r=0;for(this.buffer&&(r+=this.writeChunk(e,this.buffer));r<e.length&&!this.endOfStream;){let n=await this.reader.read();if(n.done){this.endOfStream=!0;break}n.value&&(r+=this.writeChunk(e.subarray(r),n.value))}if(!t&&r===0&&this.endOfStream)throw new l;return r}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}};function we(i){try{let e=i.getReader({mode:"byob"});return e instanceof ReadableStreamDefaultReader?new Z(e):new Q(e)}catch(e){if(e instanceof TypeError)return new Z(i.getReader());throw e}}var A=class{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(e,t=this.position){let r=new Uint8Array(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new l;return e.get(r,0)}async peekToken(e,t=this.position){let r=new Uint8Array(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new l;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new l;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new l;return e.get(this.numBuffer,0)}async ignore(e){if(e<0)throw new RangeError("ignore length must be \u2265 0 bytes");if(this.fileInfo.size!==void 0){let t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&t.position!==void 0&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}};var Mt=256e3,oe=class extends A{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){let r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r.length===0)return 0;let o=await this.streamReader.read(e.subarray(0,r.length),r.mayBeLess);if(this.position+=o,(!t||!t.mayBeLess)&&o<r.length)throw new l;return o}async peekBuffer(e,t){let r=this.normalizeOptions(e,t),n=0;if(r.position){let o=r.position-this.position;if(o>0){let s=new Uint8Array(r.length+o);return n=await this.peekBuffer(s,{mayBeLess:r.mayBeLess}),e.set(s.subarray(o)),n-o}if(o<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e.subarray(0,r.length),r.mayBeLess)}catch(o){if(t?.mayBeLess&&o instanceof l)return 0;throw o}if(!r.mayBeLess&&n<r.length)throw new l}return n}async ignore(e){if(e<0)throw new RangeError("ignore length must be \u2265 0 bytes");let t=Math.min(Mt,e),r=new Uint8Array(t),n=0;for(;n<e;){let o=e-n,s=await this.readBuffer(r,{length:Math.min(t,o)});if(s<0)return s;n+=s}return n}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}};var se=class extends A{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){t?.position&&(this.position=t.position);let r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){let r=this.normalizeOptions(e,t),n=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new l;return e.set(this.uint8Array.subarray(r.position,r.position+n)),n}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}};var ae=class extends A{constructor(e,t){super(t),this.blob=e,this.fileInfo={...t?.fileInfo??{},size:e.size,mimeType:e.type}}async readBuffer(e,t){t?.position&&(this.position=t.position);let r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){let r=this.normalizeOptions(e,t),n=Math.min(this.blob.size-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new l;let o=await this.blob.slice(r.position,r.position+n).arrayBuffer();return e.set(new Uint8Array(o)),n}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}};function Pe(i,e){let t=we(i),r=e??{},n=r.onClose;return r.onClose=async()=>{if(await t.close(),n)return n()},new oe(t,r)}function Ne(i,e){return new se(i,e)}function je(i,e){return new ae(i,e)}import{open as Ut}from"node:fs/promises";var V=class i extends A{static async fromFile(e){let t=await Ut(e,"r"),r=await t.stat();return new i(t,{fileInfo:{path:e,size:r.size}})}constructor(e,t){super(t),this.fileHandle=e,this.fileInfo=t.fileInfo}async readBuffer(e,t){let r=this.normalizeOptions(e,t);if(this.position=r.position,r.length===0)return 0;let n=await this.fileHandle.read(e,0,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new l;return n.bytesRead}async peekBuffer(e,t){let r=this.normalizeOptions(e,t),n=await this.fileHandle.read(e,0,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new l;return n.bytesRead}async close(){return await this.fileHandle.close(),super.close()}setPosition(e){this.position=e}supportsRandomAccess(){return!0}};var tn=V.fromFile;var Ge=Le(_e(),1);var $e={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},Pt={};for(let[i,e]of Object.entries($e))Pt[e]=Number.parseInt(i,10);var ce;function Nt(){if(!(typeof globalThis.TextDecoder>"u"))return ce??(ce=new globalThis.TextDecoder("utf-8"))}var q=32*1024,I=65533;function We(i,e="utf-8"){switch(e.toLowerCase()){case"utf-8":case"utf8":{let t=Nt();return t?t.decode(i):_t(i)}case"utf-16le":return $t(i);case"us-ascii":case"ascii":return Wt(i);case"latin1":case"iso-8859-1":return Gt(i);case"windows-1252":return Zt(i);default:throw new RangeError(`Encoding '${e}' not supported`)}}function ke(i,e){e.length!==0&&(i.push(String.fromCharCode.apply(null,e)),e.length=0)}function g(i,e,t){e.push(t),e.length>=q&&ke(i,e)}function jt(i,e,t){if(t<=65535){g(i,e,t);return}t-=65536,g(i,e,55296+(t>>10)),g(i,e,56320+(t&1023))}function _t(i){let e=[],t=[],r=0;for(i.length>=3&&i[0]===239&&i[1]===187&&i[2]===191&&(r=3);r<i.length;){let n=i[r];if(n<=127){g(e,t,n),r++;continue}if(n<194||n>244){g(e,t,I),r++;continue}if(n<=223){if(r+1>=i.length){g(e,t,I),r++;continue}let c=i[r+1];if((c&192)!==128){g(e,t,I),r++;continue}let p=(n&31)<<6|c&63;g(e,t,p),r+=2;continue}if(n<=239){if(r+2>=i.length){g(e,t,I),r++;continue}let c=i[r+1],p=i[r+2];if(!((c&192)===128&&(p&192)===128&&!(n===224&&c<160)&&!(n===237&&c>=160))){g(e,t,I),r++;continue}let d=(n&15)<<12|(c&63)<<6|p&63;g(e,t,d),r+=3;continue}if(r+3>=i.length){g(e,t,I),r++;continue}let o=i[r+1],s=i[r+2],a=i[r+3];if(!((o&192)===128&&(s&192)===128&&(a&192)===128&&!(n===240&&o<144)&&!(n===244&&o>143))){g(e,t,I),r++;continue}let f=(n&7)<<18|(o&63)<<12|(s&63)<<6|a&63;jt(e,t,f),r+=4}return ke(e,t),e.join("")}function $t(i){let e=[],t=[],r=i.length,n=0;for(;n+1<r;){let o=i[n]|i[n+1]<<8;if(n+=2,o>=55296&&o<=56319){if(n+1<r){let s=i[n]|i[n+1]<<8;s>=56320&&s<=57343?(g(e,t,o),g(e,t,s),n+=2):g(e,t,I)}else g(e,t,I);continue}if(o>=56320&&o<=57343){g(e,t,I);continue}g(e,t,o)}return n<r&&g(e,t,I),ke(e,t),e.join("")}function Wt(i){let e=[];for(let t=0;t<i.length;t+=q){let r=Math.min(i.length,t+q),n=new Array(r-t);for(let o=t,s=0;o<r;o++,s++)n[s]=i[o]&127;e.push(String.fromCharCode.apply(null,n))}return e.join("")}function Gt(i){let e=[];for(let t=0;t<i.length;t+=q){let r=Math.min(i.length,t+q),n=new Array(r-t);for(let o=t,s=0;o<r;o++,s++)n[s]=i[o];e.push(String.fromCharCode.apply(null,n))}return e.join("")}function Zt(i){let e=[],t="";for(let r=0;r<i.length;r++){let n=i[r],o=n>=128&&n<=159?$e[n]:void 0;t+=o??String.fromCharCode(n),t.length>=q&&(e.push(t),t="")}return t&&e.push(t),e.join("")}function C(i){return new DataView(i.buffer,i.byteOffset)}var Ze={len:1,get(i,e){return C(i).getUint8(e)},put(i,e,t){return C(i).setUint8(e,t),e+1}},h={len:2,get(i,e){return C(i).getUint16(e,!0)},put(i,e,t){return C(i).setUint16(e,t,!0),e+2}},_={len:2,get(i,e){return C(i).getUint16(e)},put(i,e,t){return C(i).setUint16(e,t),e+2}};var x={len:4,get(i,e){return C(i).getUint32(e,!0)},put(i,e,t){return C(i).setUint32(e,t,!0),e+4}},be={len:4,get(i,e){return C(i).getUint32(e)},put(i,e,t){return C(i).setUint32(e,t),e+4}};var Ve={len:4,get(i,e){return C(i).getInt32(e)},put(i,e,t){return C(i).setInt32(e,t),e+4}};var qe={len:8,get(i,e){return C(i).getBigUint64(e,!0)},put(i,e,t){return C(i).setBigUint64(e,t,!0),e+8}};var S=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){let r=e.subarray(t,t+this.len);return We(r,this.encoding)}};var ft=Le(ot(),1);var W={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},Te={get(i){return{signature:x.get(i,0),compressedSize:x.get(i,8),uncompressedSize:x.get(i,12)}},len:16},st={get(i){let e=h.get(i,6);return{signature:x.get(i,0),minVersion:h.get(i,4),dataDescriptor:!!(e&8),compressedMethod:h.get(i,8),compressedSize:x.get(i,18),uncompressedSize:x.get(i,22),filenameLength:h.get(i,26),extraFieldLength:h.get(i,28),filename:null}},len:30},at={get(i){return{signature:x.get(i,0),nrOfThisDisk:h.get(i,4),nrOfThisDiskWithTheStart:h.get(i,6),nrOfEntriesOnThisDisk:h.get(i,8),nrOfEntriesOfSize:h.get(i,10),sizeOfCd:x.get(i,12),offsetOfStartOfCd:x.get(i,16),zipFileCommentLength:h.get(i,20)}},len:22},ct={get(i){let e=h.get(i,8);return{signature:x.get(i,0),minVersion:h.get(i,6),dataDescriptor:!!(e&8),compressedMethod:h.get(i,10),compressedSize:x.get(i,20),uncompressedSize:x.get(i,24),filenameLength:h.get(i,28),extraFieldLength:h.get(i,30),fileCommentLength:h.get(i,32),relativeOffsetOfLocalHeader:x.get(i,42),filename:null}},len:46};function pt(i){let e=new Uint8Array(x.len);return x.put(e,0,i),e}var D=(0,ft.default)("tokenizer:inflate"),ve=256*1024,xi=pt(W.DataDescriptor),le=pt(W.EndOfCentralDirectory),G=class i{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(ve)}async isZip(){return await this.peekSignature()===W.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(x)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),r=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(r,{position:e.fileInfo.size-t});for(let n=r.length-4;n>=0;n--)if(r[n]===le[0]&&r[n+1]===le[1]&&r[n+2]===le[2]&&r[n+3]===le[3])return e.fileInfo.size-t+n;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){D("Cannot reading central-directory without random-read support");return}D("Reading central-directory...");let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){D("Central-directory 32-bit signature found");let r=await this.tokenizer.readToken(at,t),n=[];this.tokenizer.setPosition(r.offsetOfStartOfCd);for(let o=0;o<r.nrOfEntriesOfSize;++o){let s=await this.tokenizer.readToken(ct);if(s.signature!==W.CentralFileHeader)throw new Error("Expected Central-File-Header signature");s.filename=await this.tokenizer.readToken(new S(s.filenameLength,"utf-8")),await this.tokenizer.ignore(s.extraFieldLength),await this.tokenizer.ignore(s.fileCommentLength),n.push(s),D(`Add central-directory file-entry: n=${o+1}/${n.length}: filename=${n[o].filename}`)}return this.tokenizer.setPosition(e),n}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let r=!1;do{let n=await this.readLocalFileHeader();if(!n)break;let o=e(n);r=!!o.stop;let s;if(await this.tokenizer.ignore(n.extraFieldLength),n.dataDescriptor&&n.compressedSize===0){let a=[],m=ve;D("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let f=-1;for(;f<0&&m===ve;){m=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),f=hi(this.syncBuffer.subarray(0,m),xi);let c=f>=0?f:m;if(o.handler){let p=new Uint8Array(c);await this.tokenizer.readBuffer(p),a.push(p)}else await this.tokenizer.ignore(c)}D(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),o.handler&&await this.inflate(n,gi(a),o.handler)}else o.handler?(D(`Reading compressed-file-data: ${n.compressedSize} bytes`),s=new Uint8Array(n.compressedSize),await this.tokenizer.readBuffer(s),await this.inflate(n,s,o.handler)):(D(`Ignoring compressed-file-data: ${n.compressedSize} bytes`),await this.tokenizer.ignore(n.compressedSize));if(D(`Reading data-descriptor at pos=${this.tokenizer.position}`),n.dataDescriptor&&(await this.tokenizer.readToken(Te)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-Te.len}`)}while(!r)}async iterateOverCentralDirectory(e,t){for(let r of e){let n=t(r);if(n.handler){this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader);let o=await this.readLocalFileHeader();if(o){await this.tokenizer.ignore(o.extraFieldLength);let s=new Uint8Array(r.compressedSize);await this.tokenizer.readBuffer(s),await this.inflate(o,s,n.handler)}}if(n.stop)break}}async inflate(e,t,r){if(e.compressedMethod===0)return r(t);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);D(`Decompress filename=${e.filename}, compressed-size=${t.length}`);let n=await i.decompressDeflateRaw(t);return r(n)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(o){o.enqueue(e),o.close()}}),r=new DecompressionStream("deflate-raw"),n=t.pipeThrough(r);try{let s=await new Response(n).arrayBuffer();return new Uint8Array(s)}catch(o){let s=o instanceof Error?`Failed to deflate ZIP entry: ${o.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(s)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(x);if(e===W.LocalFileHeader){let t=await this.tokenizer.readToken(st);return t.filename=await this.tokenizer.readToken(new S(t.filenameLength,"utf-8")),t}if(e===W.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}};function hi(i,e){let t=i.length,r=e.length;if(r>t)return-1;for(let n=0;n<=t-r;n++){let o=!0;for(let s=0;s<r;s++)if(i[n+s]!==e[s]){o=!1;break}if(o)return n}return-1}function gi(i){let e=i.reduce((n,o)=>n+o.length,0),t=new Uint8Array(e),r=0;for(let n of i)t.set(n,r),r+=n.length;return t}var Y=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let r=new Uint8Array(1024),n=await e.readBuffer(r,{mayBeLess:!0});if(n===0){t.close();return}t.enqueue(r.subarray(0,n))}}).pipeThrough(new DecompressionStream("gzip"))}};var Cn={utf8:new globalThis.TextDecoder("utf8")};var Sn=new globalThis.TextEncoder;var Fn=Array.from({length:256},(i,e)=>e.toString(16).padStart(2,"0"));function Ae(i){let{byteLength:e}=i;if(e===6)return i.getUint16(0)*2**32+i.getUint32(2);if(e===5)return i.getUint8(0)*2**32+i.getUint32(1);if(e===4)return i.getUint32(0);if(e===3)return i.getUint8(0)*2**16+i.getUint16(1);if(e===2)return i.getUint16(0);if(e===1)return i.getUint8(0)}function mt(i,e){if(e==="utf-16le"){let t=[];for(let r=0;r<i.length;r++){let n=i.charCodeAt(r);t.push(n&255,n>>8&255)}return t}if(e==="utf-16be"){let t=[];for(let r=0;r<i.length;r++){let n=i.charCodeAt(r);t.push(n>>8&255,n&255)}return t}return[...i].map(t=>t.charCodeAt(0))}function ut(i,e=0){let t=Number.parseInt(new S(6).get(i,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let r=256;for(let n=e;n<e+148;n++)r+=i[n];for(let n=e+156;n<e+512;n++)r+=i[n];return t===r}var lt={get:(i,e)=>i[e+3]&127|i[e+2]<<7|i[e+1]<<14|i[e]<<21,len:4};var dt=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],xt=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"];var K=4100,wi=K-2,z=1024*1024,ht=1024,yi=2**31-1,v=16*1024*1024,xe=z,gt=z,ki=v,bi=1,wt=100,Ie=v,yt=64,kt=xe,Ci=256,Si=512,Fi=v,Ei=512,Ti=512,bt=256,Ct=xe,St=xe,vi=xe,Ft=v,Ai=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),Ii=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],Bi=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),M=class extends Error{};function Di(i){let e=i?.streamReader;if(e?.constructor?.name!=="WebStreamByobReader")return i;let{reader:t}=e,r=async()=>{await t.cancel(),t.releaseLock()};return e.close=r,e.abort=async()=>{e.interrupted=!0,await r()},i}function Oe(i,e,t){if(!Number.isFinite(i)||i<0||i>e)throw new M(`${t} has invalid size ${i} (maximum ${e} bytes)`);return i}async function R(i,e,{maximumLength:t=v,reason:r="skip"}={}){let n=Oe(e,t,r);await i.ignore(n)}async function Be(i,e,t,{maximumLength:r=e.length,reason:n="read"}={}){let o=t?.length??e.length,s=Oe(o,r,n);return i.readBuffer(e,{...t,length:s})}async function Oi(i,{maximumLength:e=z}={}){let n=new ReadableStream({start(f){f.enqueue(i),f.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),o=[],s=0;try{for(;;){let{done:f,value:c}=await n.read();if(f)break;if(s+=c.length,s>e)throw await n.cancel(),new Error(`ZIP entry decompressed data exceeds ${e} bytes`);o.push(c)}}finally{n.releaseLock()}let a=new Uint8Array(s),m=0;for(let f of o)a.set(f,m),m+=f.length;return a}var At=134695760,de=16,zi=de-1;function Mi(i,e){if(i.length<de)return-1;let t=i.length-de;for(let r=0;r<=t;r++)if(x.get(i,r)===At&&x.get(i,r+8)===e+r)return r;return-1}function Li(i){return(i.codePointAt(0)&32)!==0}function Ui(i,e){let t=new Uint8Array(e),r=0;for(let n of i)t.set(n,r),r+=n.length;return t}async function Ri(i,{shouldBuffer:e,maximumLength:t=z}={}){let{syncBuffer:r}=i,{length:n}=r,o=[],s=0;for(;;){let a=await i.tokenizer.peekBuffer(r,{mayBeLess:!0}),m=Mi(r.subarray(0,a),s),f=m>=0?0:a===n?Math.min(zi,a-1):0,c=m>=0?m:a-f;if(c===0)break;if(s+=c,s>t)throw new Error(`ZIP entry compressed data exceeds ${t} bytes`);if(e){let p=new Uint8Array(c);await i.tokenizer.readBuffer(p),o.push(p)}else await i.tokenizer.ignore(c);if(m>=0)break}if(b(i.tokenizer)||(i.knownSizeDescriptorScannedBytes+=s),!!e)return Ui(o,s)}function Pi(i,e){return b(i.tokenizer)?Math.max(0,v-(i.tokenizer.position-e)):Math.max(0,z-i.knownSizeDescriptorScannedBytes)}async function Ni(i,e,{shouldBuffer:t,maximumDescriptorLength:r=z}={}){if(e.dataDescriptor&&e.compressedSize===0)return Ri(i,{shouldBuffer:t,maximumLength:r});if(!t){await R(i.tokenizer,e.compressedSize,{maximumLength:b(i.tokenizer)?z:i.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let n=Zi(i.tokenizer);if(!Number.isFinite(e.compressedSize)||e.compressedSize<0||e.compressedSize>n)throw new Error(`ZIP entry compressed data exceeds ${n} bytes`);let o=new Uint8Array(e.compressedSize);return await i.tokenizer.readBuffer(o),o}G.prototype.inflate=async function(i,e,t){if(i.compressedMethod===0)return t(e);if(i.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${i.compressedMethod}`);let r=await Oi(e,{maximumLength:z});return t(r)};G.prototype.unzip=async function(i){let e=!1,t=0,r=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(ee(this.tokenizer,r,v))throw new M(`ZIP stream probing exceeds ${v} bytes`);let n=await this.readLocalFileHeader();if(!n)break;if(t++,t>ht)throw new Error(`ZIP entry count exceeds ${ht}`);let o=i(n);e=!!o.stop,await this.tokenizer.ignore(n.extraFieldLength);let s=await Ni(this,n,{shouldBuffer:!!o.handler,maximumDescriptorLength:Math.min(z,Pi(this,r))});if(o.handler&&await this.inflate(n,s,o.handler),n.dataDescriptor){let a=new Uint8Array(de);if(await this.tokenizer.readBuffer(a),x.get(a,0)!==At)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-a.length}`)}if(ee(this.tokenizer,r,v))throw new M(`ZIP stream probing exceeds ${v} bytes`)}while(!e)};function ji(i,e){let t=i.getReader(),r=0,n=!1,o=!1,s=async a=>{n||o||(o=!0,await t.cancel(a))};return new ReadableStream({async pull(a){if(r>=e){a.close(),await s();return}let{done:m,value:f}=await t.read();if(m||!f){n=!0,a.close();return}let c=e-r;if(f.length>c){a.enqueue(f.subarray(0,c)),r+=c,a.close(),await s();return}a.enqueue(f),r+=f.length},async cancel(a){await s(a)}})}async function ze(i,e){return new De(e).fromBuffer(i)}function Et(i){switch(i=i.toLowerCase(),i){case"application/epub+zip":return{ext:"epub",mime:i};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:i};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:i};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:i};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:i};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:i};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:i};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:i};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:i};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:i};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:i};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:i};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:i};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:i};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:i};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:i};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function O(i,e,t){t={offset:0,...t};for(let[r,n]of e.entries())if(t.mask){if(n!==(t.mask[r]&i[r+t.offset]))return!1}else if(n!==i[r+t.offset])return!1;return!0}function _i(i){return Number.isFinite(i)?Math.max(1,Math.trunc(i)):K}function $i(i,e,t){return t===void 0?i.read(e):(t.throwIfAborted(),new Promise((r,n)=>{let o=()=>{t.removeEventListener("abort",s)},s=()=>{let a=t.reason;o(),(async()=>{try{await i.cancel(a)}catch{}})(),n(a)};t.addEventListener("abort",s,{once:!0}),(async()=>{try{let a=await i.read(e);o(),r(a)}catch(a){o(),n(a)}})()}))}function Wi(i){return Number.isFinite(i)?Math.max(0,Math.min(wi,Math.trunc(i))):0}function Gi(i){return Number.isFinite(i)?Math.max(0,i):Number.MAX_SAFE_INTEGER}function b(i){let e=i.fileInfo.size;return!Number.isFinite(e)||e===Number.MAX_SAFE_INTEGER}function ee(i,e,t){return b(i)&&i.position-e>t}function Zi(i){let e=i.fileInfo.size,t=Number.isFinite(e)?Math.max(0,e-i.position):Number.MAX_SAFE_INTEGER;return Math.min(t,yi)}function Vi(i){if(i instanceof l||i instanceof M)return!0;if(!(i instanceof Error))return!1;if(Ai.has(i.message)||Bi.has(i.code))return!0;for(let e of Ii)if(i.message.startsWith(e))return!0;return!1}function Tt(i,e=z){let t=[i.compressedSize,i.uncompressedSize];for(let r of t)if(!Number.isFinite(r)||r<0||r>e)return!1;return!0}function qi(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function Hi(i,e){e.startsWith("word/")&&(i.hasWordDirectory=!0),e.startsWith("ppt/")&&(i.hasPresentationDirectory=!0),e.startsWith("xl/")&&(i.hasSpreadsheetDirectory=!0),e.startsWith("3D/")&&e.endsWith(".model")&&(i.hasThreeDimensionalModelEntry=!0)}function vt(i){if(!(!i.hasContentTypesEntry||i.hasUnparseableContentTypes||i.isParsingContentTypes||i.hasParsedContentTypesEntry)){if(i.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(i.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(i.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(i.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function Ji(i){let e=i.indexOf('.main+xml"');if(e===-1){let n="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return i.includes(`ContentType="${n}"`)?n:void 0}let t=i.slice(0,e),r=t.lastIndexOf('"');return t.slice(r+1)}var De=class i{constructor(e){let t=Wi(e?.mpegOffsetTolerance);this.options={...e,mpegOffsetTolerance:t},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(e){return Di(Pe(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let r=e.position;for(let n of this.detectors){let o;try{o=await n.detect(e)}catch(s){if(s instanceof l||s instanceof M)return;throw s}if(o)return o;if(r!==e.position)return}}async fromTokenizer(e){try{return await this.parseTokenizer(e)}finally{await e.close()}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(Ne(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=je(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();let t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){let r=_i(t?.sampleSize??K),n,o,s=e.getReader({mode:"byob"});try{let{value:f,done:c}=await $i(s,new Uint8Array(r),this.options.signal);if(o=f,!c&&f)try{n=await this.fromBuffer(f.subarray(0,r))}catch(p){if(!(p instanceof l))throw p;n=void 0}o=f}finally{s.releaseLock()}let a=new TransformStream({async start(f){f.enqueue(o)},transform(f,c){c.enqueue(f)}}),m=e.pipeThrough(a);return m.fileType=n,m}async detectGzip(e){if(this.gzipProbeDepth>=bi)return{ext:"gz",mime:"application/gzip"};let t=new Y(e),r=ji(t.inflate(),ki),n=b(e),o,s,a,m;if(n){let f=new AbortController;o=setTimeout(()=>{f.abort(new DOMException(`Operation timed out after ${wt} ms`,"TimeoutError"))},wt),s=this.options.signal===void 0?f.signal:AbortSignal.any([this.options.signal,f.signal]),a=new i({...this.options,signal:s}),a.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{m=await(a??this).fromStream(r)}catch(f){if(f?.name==="AbortError"&&s?.reason?.name!=="TimeoutError")throw f}finally{clearTimeout(o),n||this.gzipProbeDepth--}return m?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return O(this.buffer,e,t)}checkString(e,t){return this.check(mt(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(K),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,b(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=bt?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(e));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(e);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await R(e,6,{maximumLength:6,reason:"ID3 header prefix"});let t=await e.readToken(lt),r=b(e);if(!Number.isFinite(t)||t<0||r&&(t>Ie||e.position+t>Ie))return;if(e.position+t>e.fileInfo.size)return r?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await R(e,t,{maximumLength:r?Ie:e.fileInfo.size,reason:"ID3 payload"})}catch(n){if(n instanceof l)return;throw n}return this.detectionReentryCount>=bt?void 0:(this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let t,r=qi();try{await new G(e).unzip(n=>{Hi(r,n.filename);let o=n.filename==="[Content_Types].xml",s=vt(r);if(!o&&s)return t=s,{stop:!0};switch(n.filename){case"META-INF/mozilla.rsa":return t={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return t={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return Tt(n,gt)?{async handler(a){let m=new TextDecoder("utf-8").decode(a).trim();t=Et(m)},stop:!0}:{};case"[Content_Types].xml":return r.hasContentTypesEntry=!0,Tt(n,gt)?(r.isParsingContentTypes=!0,{async handler(a){let m=new TextDecoder("utf-8").decode(a),f=Ji(m);f&&(t=Et(f)),r.hasParsedContentTypesEntry=!0,r.isParsingContentTypes=!1},stop:!0}):(r.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(n.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(n){if(!Vi(n))throw n;r.isParsingContentTypes&&(r.isParsingContentTypes=!1,r.hasUnparseableContentTypes=!0)}return t??vt(r)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),O(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:O(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:O(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:O(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:O(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:O(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let t=await this.readTiffHeader(!1);if(t)return t}if(this.check([77,77])){let t=await this.readTiffHeader(!0);if(t)return t}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function t(){let m=await e.peekNumber(Ze),f=128,c=0;for(;(m&f)===0&&f!==0;)++c,f>>=1;let p=new Uint8Array(c+1);return await Be(e,p,void 0,{maximumLength:p.length,reason:"EBML field"}),p}async function r(){let m=await t(),f=await t();f[0]^=128>>f.length-1;let c=Math.min(6,f.length),p=new DataView(m.buffer),u=new DataView(f.buffer,f.length-c,c);return{id:Ae(p),len:Ae(u)}}async function n(m){let f=0;for(;m>0;){if(f++,f>Ci||ee(e,s,v))return;let c=e.position,p=await r();if(p.id===17026){if(p.len>yt)return;let u=Oe(p.len,yt,"EBML DocType");return(await e.readToken(new S(u))).replaceAll(/\00.*$/g,"")}if(b(e)&&(!Number.isFinite(p.len)||p.len<0||p.len>kt)||(await R(e,p.len,{maximumLength:b(e)?kt:e.fileInfo.size,reason:"EBML payload"}),--m,e.position<=c))return}}let o=await r(),s=e.position;switch(await n(o.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let t=be.get(this.buffer,4),r=_.get(this.buffer,6);if(t>0&&t<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(r>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let t=new S(4,"latin1").get(this.buffer,2);if(t.match("^d*")&&t>=1e3&&t<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),await e.readToken(new S(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
6
+ `,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let t={ext:"png",mime:"image/png"},r={ext:"apng",mime:"image/apng"};await e.ignore(8);async function n(){return{length:await e.readToken(Ve),type:await e.readToken(new S(4,"latin1"))}}let o=b(e),s=e.position,a=0,m=!1;do{if(a++,a>Si||ee(e,s,Fi))break;let f=e.position,c=await n();if(c.length<0)return;if(c.type==="IHDR"){if(c.length!==13)return;m=!0}switch(c.type){case"IDAT":return t;case"acTL":return r;default:if(!m&&c.type!=="CgBI")return;if(o&&c.length>Ct)return m&&Li(c.type)?t:void 0;try{await R(e,c.length+4,{maximumLength:o?Ct+4:e.fileInfo.size,reason:"PNG chunk payload"})}catch(p){if(!o&&(p instanceof M||p instanceof l))return t;throw p}}if(e.position<=f)break}while(e.position+8<e.fileInfo.size);return t}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let t=new S(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(t){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
7
+ `))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){let t=!1;try{async function r(){let a=new Uint8Array(16);return await Be(e,a,void 0,{maximumLength:a.length,reason:"ASF header GUID"}),{id:a,size:Number(await e.readToken(qe))}}await R(e,30,{maximumLength:30,reason:"ASF header prelude"});let n=b(e),o=e.position,s=0;for(;e.position+24<e.fileInfo.size&&(s++,!(s>Ei||ee(e,o,v)));){let a=e.position,m=await r(),f=m.size-24;if(!Number.isFinite(f)||f<0){t=!0;break}if(O(m.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let c=new Uint8Array(16);if(f-=await Be(e,c,void 0,{maximumLength:c.length,reason:"ASF stream type GUID"}),O(c,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(O(c,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(n&&f>St){t=!0;break}if(await R(e,f,{maximumLength:n?St:e.fileInfo.size,reason:"ASF header payload"}),e.position<=a){t=!0;break}}}catch(r){if(r instanceof l||r instanceof M)b(e)&&(t=!0);else throw r}return t?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new S(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let t=new DataView(this.buffer.buffer).getUint32(12,!0);if(t>12&&this.buffer.length>=t+16)try{let r=new TextDecoder().decode(this.buffer.subarray(16,t+16));if(JSON.parse(r).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&ut(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let t="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:t})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:t})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString(`Windows Registry Editor Version 5.00\r
8
+ `,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async e=>{this.buffer=new Uint8Array(K);let t=Gi(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let r=0;r<=this.options.mpegOffsetTolerance;++r){let n=this.scanMpeg(r);if(n)return n}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?_:h);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?_:h);if(!(t>Ti)&&!(b(this.tokenizer)&&2+t*12>Ft))for(let r=0;r<t;++r){let n=await this.readTiffTag(e);if(n)return n}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},r=(e?_:h).get(this.buffer,2),n=(e?be:x).get(this.buffer,4);if(r===42){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){let a=(e?_:h).get(this.buffer,8),m=(e?_:h).get(this.buffer,10);if(a===28&&m===254||a===31&&m===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(b(this.tokenizer)&&n>vi)return t;let o=b(this.tokenizer)?Ft:this.tokenizer.fileInfo.size;try{await R(this.tokenizer,n,{maximumLength:o,reason:"TIFF IFD offset"})}catch(a){if(a instanceof l)return;throw a}let s;try{s=await this.readTiffIFD(e)}catch(a){if(a instanceof l)return;throw a}return s??t}if(r===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},Xi=new Set(dt),Qi=new Set(xt);var Yi={name:"file",summary:"determine file type",usage:"file [OPTION]... FILE...",options:["-b, --brief do not prepend filenames to output","-i, --mime output MIME type strings","-L, --dereference follow symlinks"," --help display this help and exit"]},Ki=new Map([[".js",{description:"JavaScript source",mime:"text/javascript"}],[".mjs",{description:"JavaScript module",mime:"text/javascript"}],[".cjs",{description:"CommonJS module",mime:"text/javascript"}],[".ts",{description:"TypeScript source",mime:"text/typescript"}],[".tsx",{description:"TypeScript JSX source",mime:"text/typescript"}],[".jsx",{description:"JavaScript JSX source",mime:"text/javascript"}],[".py",{description:"Python script",mime:"text/x-python"}],[".rb",{description:"Ruby script",mime:"text/x-ruby"}],[".go",{description:"Go source",mime:"text/x-go"}],[".rs",{description:"Rust source",mime:"text/x-rust"}],[".c",{description:"C source",mime:"text/x-c"}],[".h",{description:"C header",mime:"text/x-c"}],[".cpp",{description:"C++ source",mime:"text/x-c++"}],[".hpp",{description:"C++ header",mime:"text/x-c++"}],[".java",{description:"Java source",mime:"text/x-java"}],[".sh",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".bash",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".zsh",{description:"Zsh shell script",mime:"text/x-shellscript"}],[".json",{description:"JSON data",mime:"application/json"}],[".yaml",{description:"YAML data",mime:"text/yaml"}],[".yml",{description:"YAML data",mime:"text/yaml"}],[".xml",{description:"XML document",mime:"application/xml"}],[".csv",{description:"CSV text",mime:"text/csv"}],[".toml",{description:"TOML data",mime:"text/toml"}],[".html",{description:"HTML document",mime:"text/html"}],[".htm",{description:"HTML document",mime:"text/html"}],[".css",{description:"CSS stylesheet",mime:"text/css"}],[".svg",{description:"SVG image",mime:"image/svg+xml"}],[".md",{description:"Markdown document",mime:"text/markdown"}],[".markdown",{description:"Markdown document",mime:"text/markdown"}],[".txt",{description:"ASCII text",mime:"text/plain"}],[".rst",{description:"reStructuredText",mime:"text/x-rst"}],[".env",{description:"ASCII text",mime:"text/plain"}],[".gitignore",{description:"ASCII text",mime:"text/plain"}],[".dockerignore",{description:"ASCII text",mime:"text/plain"}]]),er=new Map([["jpg","JPEG image data"],["jpeg","JPEG image data"],["png","PNG image data"],["gif","GIF image data"],["webp","WebP image data"],["bmp","PC bitmap"],["ico","MS Windows icon resource"],["tif","TIFF image data"],["tiff","TIFF image data"],["psd","Adobe Photoshop Document"],["avif","AVIF image"],["heic","HEIC image"],["heif","HEIF image"],["jxl","JPEG XL image"],["icns","Mac OS X icon"],["svg","SVG Scalable Vector Graphics image"],["pdf","PDF document"],["epub","EPUB document"],["mobi","Mobipocket E-book"],["djvu","DjVu document"],["zip","Zip archive data"],["gz","gzip compressed data"],["gzip","gzip compressed data"],["bz2","bzip2 compressed data"],["xz","XZ compressed data"],["tar","POSIX tar archive"],["rar","RAR archive data"],["7z","7-zip archive data"],["lz","lzip compressed data"],["lzma","LZMA compressed data"],["zst","Zstandard compressed data"],["cab","Microsoft Cabinet archive"],["ar","Unix ar archive"],["rpm","RPM package"],["deb","Debian binary package"],["apk","Android Package"],["dmg","Apple disk image"],["iso","ISO 9660 CD-ROM filesystem data"],["vhd","Microsoft Virtual Hard Disk"],["vhdx","Microsoft Virtual Hard Disk (new format)"],["qcow2","QEMU QCOW Image"],["mp3","Audio file with ID3"],["m4a","MPEG-4 audio"],["aac","AAC audio"],["wav","RIFF (little-endian) data, WAVE audio"],["flac","FLAC audio bitstream data"],["ogg","Ogg data"],["oga","Ogg audio"],["opus","Ogg Opus audio"],["aiff","AIFF audio"],["wma","Windows Media Audio"],["amr","AMR audio"],["mid","MIDI audio"],["midi","MIDI audio"],["ape","Monkey's Audio"],["mp4","ISO Media, MPEG-4"],["m4v","MPEG-4 video"],["webm","WebM"],["avi","RIFF (little-endian) data, AVI"],["mov","ISO Media, Apple QuickTime movie"],["mkv","Matroska data"],["wmv","Windows Media Video"],["flv","Flash Video"],["3gp","3GPP multimedia"],["3g2","3GPP2 multimedia"],["ogv","Ogg video"],["mts","MPEG transport stream"],["m2ts","MPEG transport stream"],["ts","MPEG transport stream"],["mpg","MPEG video"],["mpeg","MPEG video"],["exe","PE32 executable"],["dll","PE32 DLL"],["elf","ELF executable"],["mach","Mach-O executable"],["wasm","WebAssembly (wasm) binary module"],["dex","Android Dalvik executable"],["class","Java class file"],["swf","Adobe Flash"],["doc","Microsoft Word Document"],["docx","Microsoft Word 2007+ Document"],["xls","Microsoft Excel Spreadsheet"],["xlsx","Microsoft Excel 2007+ Spreadsheet"],["ppt","Microsoft PowerPoint Presentation"],["pptx","Microsoft PowerPoint 2007+ Presentation"],["odt","OpenDocument Text"],["ods","OpenDocument Spreadsheet"],["odp","OpenDocument Presentation"],["ttf","TrueType Font"],["otf","OpenType Font"],["woff","Web Open Font Format"],["woff2","Web Open Font Format 2"],["eot","Embedded OpenType font"],["stl","Stereolithography CAD"],["obj","Wavefront 3D Object"],["gltf","GL Transmission Format"],["glb","GL Transmission Format (binary)"],["sqlite","SQLite 3.x database"],["mdb","Microsoft Access Database"],["xml","XML document"],["json","JSON data"],["macho","Mach-O binary"],["ics","iCalendar data"],["vcf","vCard data"],["msi","Microsoft Installer"],["ps","PostScript"],["ai","Adobe Illustrator"],["indd","Adobe InDesign"],["sketch","Sketch design file"],["fig","Figma design file"],["xd","Adobe XD"],["blend","Blender"],["fbx","Autodesk FBX"],["lnk","MS Windows shortcut"],["alias","Mac OS alias"],["torrent","BitTorrent file"],["pcap","pcap capture file"],["arrow","Apache Arrow"],["parquet","Apache Parquet"]]);function tr(i,e){let t=er.get(i);if(t)return t;let[r,n]=e.split("/"),o=n?.split("+")[0]?.replace(/-/g," ")||i;switch(r){case"image":return`${o.toUpperCase()} image data`;case"audio":return`${o.toUpperCase()} audio`;case"video":return`${o.toUpperCase()} video`;case"font":return`${o} font`;case"model":return`${o} 3D model`;case"application":return n?.includes("zip")||n?.includes("compressed")?`${o} archive data`:n?.includes("executable")?`${o} executable`:`${i.toUpperCase()} data`;default:return`${i.toUpperCase()} data`}}function ir(i){let e=i.split("/").pop()||i;if(e.startsWith(".")&&!e.includes(".",1))return e;let t=e.lastIndexOf(".");return t===-1||t===0?"":e.slice(t).toLowerCase()}function rr(i,e){if(i.startsWith("#!")){let f=i.split(`
9
+ `)[0];return f.includes("python")?{description:"Python script, ASCII text executable",mime:"text/x-python"}:f.includes("node")||f.includes("bun")||f.includes("deno")?{description:"JavaScript script, ASCII text executable",mime:"text/javascript"}:f.includes("bash")?{description:"Bourne-Again shell script, ASCII text executable",mime:"text/x-shellscript"}:f.includes("sh")?{description:"POSIX shell script, ASCII text executable",mime:"text/x-shellscript"}:f.includes("ruby")?{description:"Ruby script, ASCII text executable",mime:"text/x-ruby"}:f.includes("perl")?{description:"Perl script, ASCII text executable",mime:"text/x-perl"}:{description:"script, ASCII text executable",mime:"text/plain"}}let t=i.trimStart();if(t.startsWith("<?xml"))return{description:"XML document",mime:"application/xml"};if(t.startsWith("<!DOCTYPE html")||t.toLowerCase().startsWith("<html"))return{description:"HTML document",mime:"text/html"};let r=i.includes(`\r
10
+ `),n=i.includes("\r")&&!r,o="";r?o=", with CRLF line terminators":n&&(o=", with CR line terminators");let s=ir(e),a=s?Ki.get(s):void 0;if(a)return a.mime.startsWith("text/")&&o?{description:`${a.description}${o}`,mime:a.mime}:a;let m=!1;for(let f=0;f<Math.min(i.length,8192);f++)if(i.charCodeAt(f)>127){m=!0;break}return m?{description:`UTF-8 Unicode text${o}`,mime:"text/plain; charset=utf-8"}:{description:`ASCII text${o}`,mime:"text/plain"}}async function nr(i,e){if(e.length===0)return{description:"empty",mime:"inode/x-empty"};let t=await ze(e);if(t)return{description:tr(t.ext,t.mime),mime:t.mime};let r=new TextDecoder("utf-8",{fatal:!1}).decode(e);return rr(r,i)}var _n={name:"file",async execute(i,e){if(Re(i))return Ue(Yi);let t=!1,r=!1,n=[];for(let a of i)if(a.startsWith("--")){if(a==="--brief")t=!0;else if(a==="--mime"||a==="--mime-type")r=!0;else if(a!=="--dereference")return ge("file",a)}else if(a.startsWith("-")&&a!=="-"){for(let m of a.slice(1))if(m==="b")t=!0;else if(m==="i")r=!0;else if(m!=="L")return ge("file",`-${m}`)}else n.push(a);if(n.length===0)return{stdout:"",stderr:`Usage: file [-bLi] FILE...
11
+ `,exitCode:1};let o="",s=0;for(let a of n)try{let m=e.fs.resolvePath(e.cwd,a);if((await e.fs.stat(m)).isDirectory){let d=r?"inode/directory":"directory";o+=t?`${d}
12
+ `:`${a}: ${d}
13
+ `;continue}let c=await e.fs.readFileBuffer(m),p=await nr(a,c),u=r?p.mime:p.description;o+=t?`${u}
14
+ `:`${a}: ${u}
15
+ `}catch{o+=t?`cannot open
16
+ `:`${a}: cannot open (No such file or directory)
17
+ `,s=1}return{stdout:o,stderr:"",exitCode:s}}},$n={name:"file",flags:[{flag:"-b",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{_n as a,$n as b};
18
+ /*! Bundled license information:
19
+
20
+ ieee754/index.js:
21
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
22
+ */