@visulima/vis 1.0.5 → 1.0.7

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 (149) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/binx.js +2 -2
  4. package/dist/packem_chunks/CONFIG_FILES.js +1 -1
  5. package/dist/packem_chunks/bloom-status.js +1 -1
  6. package/dist/packem_chunks/bloom-sync.js +1 -1
  7. package/dist/packem_chunks/catalog.js +52 -52
  8. package/dist/packem_chunks/cli-exec.js +1 -1
  9. package/dist/packem_chunks/cli-main.js +216 -217
  10. package/dist/packem_chunks/dispatch.js +1 -1
  11. package/dist/packem_chunks/doctor-probe.js +1 -1
  12. package/dist/packem_chunks/fix.js +1 -1
  13. package/dist/packem_chunks/group-tags.js +1 -1
  14. package/dist/packem_chunks/handler.js +1 -1
  15. package/dist/packem_chunks/handler10.js +1 -1
  16. package/dist/packem_chunks/handler11.js +1 -1
  17. package/dist/packem_chunks/handler12.js +1 -1
  18. package/dist/packem_chunks/handler13.js +1 -1
  19. package/dist/packem_chunks/handler14.js +1 -1
  20. package/dist/packem_chunks/handler15.js +1 -1
  21. package/dist/packem_chunks/handler16.js +1 -1
  22. package/dist/packem_chunks/handler17.js +1 -1
  23. package/dist/packem_chunks/handler18.js +1 -1
  24. package/dist/packem_chunks/handler19.js +1 -1
  25. package/dist/packem_chunks/handler2.js +1 -1
  26. package/dist/packem_chunks/handler20.js +1 -1
  27. package/dist/packem_chunks/handler21.js +1 -1
  28. package/dist/packem_chunks/handler22.js +1 -1
  29. package/dist/packem_chunks/handler23.js +1 -1
  30. package/dist/packem_chunks/handler24.js +1 -1
  31. package/dist/packem_chunks/handler26.js +1 -1
  32. package/dist/packem_chunks/handler27.js +1 -1
  33. package/dist/packem_chunks/handler28.js +3 -3
  34. package/dist/packem_chunks/handler29.js +1 -1
  35. package/dist/packem_chunks/handler3.js +1 -1
  36. package/dist/packem_chunks/handler30.js +1 -1
  37. package/dist/packem_chunks/handler4.js +1 -1
  38. package/dist/packem_chunks/handler5.js +1 -1
  39. package/dist/packem_chunks/handler50.js +2 -2
  40. package/dist/packem_chunks/handler51.js +1 -1
  41. package/dist/packem_chunks/handler53.js +1 -1
  42. package/dist/packem_chunks/handler54.js +1 -1
  43. package/dist/packem_chunks/handler55.js +1 -1
  44. package/dist/packem_chunks/handler58.js +4 -4
  45. package/dist/packem_chunks/handler59.js +1 -1
  46. package/dist/packem_chunks/handler6.js +7 -7
  47. package/dist/packem_chunks/handler60.js +2 -2
  48. package/dist/packem_chunks/handler61.js +1 -1
  49. package/dist/packem_chunks/handler62.js +2 -2
  50. package/dist/packem_chunks/handler63.js +3 -3
  51. package/dist/packem_chunks/handler64.js +3 -3
  52. package/dist/packem_chunks/handler66.js +1 -1
  53. package/dist/packem_chunks/handler67.js +13 -13
  54. package/dist/packem_chunks/handler68.js +4 -4
  55. package/dist/packem_chunks/handler69.js +1 -1
  56. package/dist/packem_chunks/handler7.js +1 -1
  57. package/dist/packem_chunks/handler70.js +4 -4
  58. package/dist/packem_chunks/handler71.js +1 -1
  59. package/dist/packem_chunks/handler72.js +14 -14
  60. package/dist/packem_chunks/handler73.js +1 -1
  61. package/dist/packem_chunks/handler74.js +12 -12
  62. package/dist/packem_chunks/handler75.js +1 -1
  63. package/dist/packem_chunks/handler76.js +1 -1
  64. package/dist/packem_chunks/handler77.js +21 -21
  65. package/dist/packem_chunks/handler78.js +1 -1
  66. package/dist/packem_chunks/handler8.js +1 -1
  67. package/dist/packem_chunks/handler9.js +1 -1
  68. package/dist/packem_chunks/heal-accept.js +1 -1
  69. package/dist/packem_chunks/heal.js +1 -1
  70. package/dist/packem_chunks/help-command.js +17 -17
  71. package/dist/packem_chunks/index3.js +2 -2
  72. package/dist/packem_chunks/keys-refresh.js +1 -1
  73. package/dist/packem_chunks/lean.js +1 -1
  74. package/dist/packem_chunks/list.js +1 -1
  75. package/dist/packem_chunks/loader.js +1 -1
  76. package/dist/packem_chunks/orchestrator.js +1 -1
  77. package/dist/packem_chunks/prompts.js +1 -1
  78. package/dist/packem_chunks/status.js +1 -1
  79. package/dist/packem_chunks/sync.js +1 -1
  80. package/dist/packem_chunks/sync2.js +1 -1
  81. package/dist/packem_chunks/tripwire.js +1 -1
  82. package/dist/packem_chunks/ts-loader.js +9 -22
  83. package/dist/packem_chunks/verify-lockfile.js +2 -2
  84. package/dist/packem_chunks/version-resolver.js +1 -1
  85. package/dist/packem_shared/{affected-shas-BfO3PDJq.js → affected-shas-DkrQVQla.js} +1 -1
  86. package/dist/packem_shared/{ai-analysis-CO7No4rt.js → ai-analysis-DWBi9tSU.js} +3 -3
  87. package/dist/packem_shared/{ai-fix-B4u2zlVG.js → ai-fix-BocGeQu4.js} +1 -1
  88. package/dist/packem_shared/{augment-8z86AwtF.js → augment-BIUGEy1Q.js} +1 -1
  89. package/dist/packem_shared/bin-BZ_m_tag.js +1 -0
  90. package/dist/packem_shared/{build-scripts-D477Ou-x.js → build-scripts-CpTeQE1L.js} +1 -1
  91. package/dist/packem_shared/clean-DWjQl14S.js +1 -0
  92. package/dist/packem_shared/{command-runtime-EWjmSxPj.js → command-runtime-Buz4F5LM.js} +1 -1
  93. package/dist/packem_shared/{cyclonedx-CDWHbD9s.js → cyclonedx-DFlz2HRz.js} +1 -1
  94. package/dist/packem_shared/dependency-scan-173U3WXB.js +1 -0
  95. package/dist/packem_shared/{docker-CD7o1D1o.js → docker-B2h5KRZH.js} +41 -41
  96. package/dist/packem_shared/{env-Cpxa_7UE.js → en-BRcjb70R.js} +11 -11
  97. package/dist/packem_shared/failure-log-C3c5AVfc.js +2 -0
  98. package/dist/packem_shared/glob-DMbPwGSj-DFkUYBco.js +1 -0
  99. package/dist/packem_shared/index-BAe6e0XE.js +1 -0
  100. package/dist/packem_shared/{index-CdTXvj-V.js → index-BtbefKtY.js} +1 -1
  101. package/dist/packem_shared/index-D75r1yKp.js +35 -0
  102. package/dist/packem_shared/{index-DrIMyJSY.js → index-ZfYDID5E.js} +3 -3
  103. package/dist/packem_shared/{index.server-J83sowC4.js → index.server-qvZ-cy29.js} +2 -2
  104. package/dist/packem_shared/{lifecycle-hzwghh5a.js → lifecycle-CG0Ccu4h.js} +1 -1
  105. package/dist/packem_shared/{lockfile-CWcVTdRc.js → lockfile-D_JiWcwS.js} +1 -1
  106. package/dist/packem_shared/{manifests-CaPqgQxW.js → manifests-mFrrpzXW.js} +1 -1
  107. package/dist/packem_shared/{min-release-age-skpcnlpk.js → min-release-age-Cdh1dLz1.js} +1 -1
  108. package/dist/packem_shared/{missing-package-json-_hOp4AW5.js → missing-package-json-sYPP3cm-.js} +1 -1
  109. package/dist/packem_shared/{native-config-sync-CFi1iQNG.js → native-config-sync-DW8549FX.js} +2 -2
  110. package/dist/packem_shared/package-version-DBJLduJL.js +4 -0
  111. package/dist/packem_shared/packument-BFekEvwn.js +1 -0
  112. package/dist/packem_shared/{pm-runner-mVFjedM6.js → pm-runner-D5NWL8yv.js} +1 -1
  113. package/dist/packem_shared/{provenance-CI_WQx7G.js → provenance-ByHgofYo.js} +1 -1
  114. package/dist/packem_shared/{readJsonSync-DuMMeB3s-Cx08VBQg.js → readJsonSync-DuMMeB3s-wlhgSHes.js} +1 -1
  115. package/dist/packem_shared/registry-keys-BCD7Ir8g.js +1 -0
  116. package/dist/packem_shared/{resolve-explicit-DVE9cfkm.js → resolve-explicit-CnEsy-zC.js} +1 -1
  117. package/dist/packem_shared/{resolve-runtime-CGHf-wHz.js → resolve-runtime-Z2n59SEd.js} +1 -1
  118. package/dist/packem_shared/{run-file-Bs_E9O6O.js → run-file-u9hMNu8K.js} +1 -1
  119. package/dist/packem_shared/{runtime-check-pS2XH4BO.js → runtime-check-B1OF152E.js} +1 -1
  120. package/dist/packem_shared/s1ngularity-DkNDQiKU.js +1 -0
  121. package/dist/packem_shared/scan-progress-CHdHWhVw.js +2 -0
  122. package/dist/packem_shared/{selectors-CRgS4bU9.js → selectors-DiZWa7R4.js} +1 -1
  123. package/dist/packem_shared/{signatures-Dp3th1DB.js → signatures-kvrwi3Un.js} +1 -1
  124. package/dist/packem_shared/{target-options-TM6ETDAS.js → target-options-BJIDkfDf.js} +1 -1
  125. package/dist/packem_shared/{toolchain-B5KwUZfq.js → toolchain-CAbopPwK.js} +1 -1
  126. package/dist/packem_shared/{typosquats-C0layQsP.js → typosquats-DWB80Gyv.js} +1 -1
  127. package/dist/packem_shared/use-measured-height-C4jA0yNy.js +1 -0
  128. package/dist/packem_shared/verify-BajubByH.js +1 -0
  129. package/dist/packem_shared/vis-update-app-M3dw6XRC.js +1 -0
  130. package/dist/packem_shared/{watch-BnE1TzYn.js → watch-B8WT65yN.js} +1 -1
  131. package/dist/packem_shared/{watch-loop-Irf3Pm-1.js → watch-loop-CZazUnGB.js} +1 -1
  132. package/dist/runtime/preload.js +1 -1
  133. package/index.d.ts +204 -204
  134. package/index.js +52 -52
  135. package/package.json +37 -37
  136. package/dist/packem_shared/bin-Cv8vsMEo.js +0 -1
  137. package/dist/packem_shared/dependency-scan-P52jY0pU.js +0 -1
  138. package/dist/packem_shared/failure-log-MOhz-TBv.js +0 -2
  139. package/dist/packem_shared/glob-DMbPwGSj-uzODoE-1.js +0 -1
  140. package/dist/packem_shared/index-BAUIIRZJ.js +0 -1
  141. package/dist/packem_shared/index-BVuCxe14.js +0 -22
  142. package/dist/packem_shared/packument-CYxvm590.js +0 -1
  143. package/dist/packem_shared/registry-keys-AGlSEY6R.js +0 -1
  144. package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +0 -1
  145. package/dist/packem_shared/s1ngularity-xmrq5T5r.js +0 -1
  146. package/dist/packem_shared/scan-progress-DQ4TMXcb.js +0 -2
  147. package/dist/packem_shared/use-measured-height-Drobr4fe.js +0 -1
  148. package/dist/packem_shared/verify-Cjo4EBFZ.js +0 -1
  149. package/dist/packem_shared/vis-update-app-qIkyvrd1.js +0 -1
@@ -1,22 +0,0 @@
1
- import{createRequire as Pr}from"node:module";const Ir=Pr(import.meta.url),Et=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fr=t=>{if(typeof Et<"u"&&Et.versions&&Et.versions.node){const[e,r]=Et.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Et.getBuiltinModule(t)}return Ir(t)},{createRequire:B}=Fr("node:module"),ke=0,Gr=4,Ur=Symbol("findUpStop"),eu=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g,jr=/^[A-Z]:\//i,$t=(t="")=>t&&t.replaceAll("\\","/").replace(jr,e=>e.toUpperCase()),zr=/^[/\\]{2}/,Wr=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,pr=/^[A-Z]:$/i,He=/^\/([A-Z]:)?$/i,qr=/.(\.[^./]+)$/,Xr=/^[/\\]|^[a-z]:[/\\]/i,Kr=/\/$/,Qr=()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/",ru="/",fr=(t,e)=>{let r="",o=0,n=-1,s=0,i;for(let u=0;u<=t.length;++u){if(u<t.length)i=t[u];else{if(i==="/")break;i="/"}if(i==="/"){if(!(n===u-1||s===1))if(s===2){if(r.length<2||o!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const a=r.lastIndexOf("/");a===-1?(r="",o=0):(r=r.slice(0,a),o=r.length-1-r.lastIndexOf("/")),n=u,s=0;continue}else if(r.length>0){r="",o=0,n=u,s=0;continue}}e&&(r+=r.length>0?"/..":"..",o=2)}else r.length>0?r+=`/${t.slice(n+1,u)}`:r=t.slice(n+1,u),o=u-n-1;n=u,s=0}else i==="."&&s!==-1?++s:s=-1}return r},bt=t=>Wr.test(t),ce=function(t){if(t.length===0)return".";t=$t(t);const e=zr.exec(t),r=bt(t),o=t.at(-1)==="/";return t=fr(t,!r),t.length===0?r?"/":o?"./":".":(o&&(t+="/"),pr.test(t)&&(t+="/"),e?r?`//${t}`:`//./${t}`:r&&!bt(t)?`/${t}`:t)},Zr=(...t)=>{let e="";for(const r of t)if(r)if(e.length>0){const o=e.at(-1)==="/",n=r[0]==="/";o&&n?e+=r.slice(1):e+=o||n?r:`/${r}`}else e+=r;return ce(e)},vt=function(...t){t=t.map(o=>$t(o));let e="",r=!1;for(let o=t.length-1;o>=-1&&!r;o--){const n=o>=0?t[o]:Qr();!n||n.length===0||(e=`${n}/${e}`,r=bt(n))}return e=fr(e,!r),r&&!bt(e)?`/${e}`:e.length>0?e:"."},su=function(t){return $t(t)},Vr=function(t){return qr.exec($t(t))?.[1]??""},ou=function(t,e){const r=vt(t).replace(He,"$1").split("/"),o=vt(e).replace(He,"$1").split("/");if(o[0][1]===":"&&r[0][1]===":"&&r[0]!==o[0])return o.join("/");const n=Math.min(r.length,o.length);let s=0;for(;s<n&&r[s]===o[s];)s+=1;const i=r.length-s;return[...Array.from({length:i}).fill(".."),...o.slice(s)].join("/")},Ce=t=>{const e=$t(t).replace(Kr,""),r=e.lastIndexOf("/");if(r===-1)return bt(t)?"/":".";const o=e.slice(0,r);return pr.test(o)?`${o}/`:o||(bt(t)?"/":".")},hr=(t,e)=>{const r=$t(t),o=r.slice(r.lastIndexOf("/")+1);if(e&&o.endsWith(e)){if(e===r)return"";const n=o.slice(0,-e.length);if(n.length>0)return n}return o},Yr=function(t){const e=Xr.exec(t)?.[0]?.replaceAll("\\","/")??"",r=hr(t),o=Vr(r);return{base:r,dir:Ce(t),ext:o,name:r.slice(0,r.length-o.length),root:e}},Jr=B(import.meta.url),At=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ts=t=>{if(typeof At<"u"&&At.versions&&At.versions.node){const[e,r]=At.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return At.getBuiltinModule(t)}return Jr(t)},{fileURLToPath:es}=ts("node:url");function rs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Be,Me;function ss(){return Me||(Me=1,Be=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Be}var os=ss();const ns=rs(os);new Set(ns);const is=/^(?:\.?\.[/\\]|\.\.\B)/,nu=t=>is.test(t)||t==="..",ct=t=>$t(t instanceof URL?es(t):t);let us=class extends Error{constructor(e){super(`EEXIST: ${e}`)}get code(){return"EEXIST"}set code(e){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(e){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const pt=t=>{if(!t||!(t instanceof URL)&&typeof t!="string")throw new TypeError("Path must be a non-empty string or URL.")},ls=B(import.meta.url),xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,as=t=>{if(typeof xt<"u"&&xt.versions&&xt.versions.node){const[e,r]=xt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return xt.getBuiltinModule(t)}return ls(t)};as("node:fs/promises");const cs=B(import.meta.url),St=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ps=t=>{if(typeof St<"u"&&St.versions&&St.versions.node){const[e,r]=St.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return St.getBuiltinModule(t)}return cs(t)};ps("node:fs");const pe=t=>{if(t.isFile())return"file";if(t.isDirectory())return"dir";if(t.isSymbolicLink())return"symlink"},fs=B(import.meta.url),wt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hs=t=>{if(typeof wt<"u"&&wt.versions&&wt.versions.node){const[e,r]=wt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return wt.getBuiltinModule(t)}return fs(t)},{lstat:De,mkdir:gs}=hs("node:fs/promises"),uu=async t=>{pt(t);try{const e=await De(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(pe(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await gs(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=await De(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(pe(r))}'`,{cause:e})}},ds=B(import.meta.url),Tt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ys=t=>{if(typeof Tt<"u"&&Tt.versions&&Tt.versions.node){const[e,r]=Tt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Tt.getBuiltinModule(t)}return ds(t)},{lstatSync:Pe,mkdirSync:ms}=ys("node:fs"),lu=t=>{pt(t);try{const e=Pe(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(pe(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{ms(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=Pe(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(pe(r))}'`,{cause:e})}},bs=B(import.meta.url),Rt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$s=t=>{if(typeof Rt<"u"&&Rt.versions&&Rt.versions.node){const[e,r]=Rt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Rt.getBuiltinModule(t)}return bs(t)};$s("node:fs/promises");const vs=B(import.meta.url),_t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Es=t=>{if(typeof _t<"u"&&_t.versions&&_t.versions.node){const[e,r]=_t.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return _t.getBuiltinModule(t)}return vs(t)};Es("node:fs");const As=B(import.meta.url),kt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xs=t=>{if(typeof kt<"u"&&kt.versions&&kt.versions.node){const[e,r]=kt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return kt.getBuiltinModule(t)}return As(t)};xs("node:fs/promises");const Ss=B(import.meta.url),Ct=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ws=t=>{if(typeof Ct<"u"&&Ct.versions&&Ct.versions.node){const[e,r]=Ct.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ct.getBuiltinModule(t)}return Ss(t)};ws("node:fs");const Ts=B(import.meta.url),Ot=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rs=t=>{if(typeof Ot<"u"&&Ot.versions&&Ot.versions.node){const[e,r]=Ot.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ot.getBuiltinModule(t)}return Ts(t)};Rs("node:fs/promises");const _s=B(import.meta.url),Nt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ks=t=>{if(typeof Nt<"u"&&Nt.versions&&Nt.versions.node){const[e,r]=Nt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Nt.getBuiltinModule(t)}return _s(t)};ks("node:fs");B(import.meta.url);let Ie=class extends Error{root;constructor(e,r){super(`${e instanceof Error?e.message:String(e)} for path "${r}"`),this.cause=e,this.root=r}get name(){return"WalkError"}set name(e){throw new Error("Cannot overwrite name of WalkError")}};const Fe=t=>{const e=t.replace(/[$()+\\^]/g,String.raw`\$&`).replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");try{return new RegExp(`^${e}$`)}catch(r){throw new Error(`Invalid glob pattern: ${t}`,{cause:r})}};let Cs=class{name;path;#t;constructor(e,r,o){this.#t=e,this.name=r,this.path=o}isDirectory(){return this.#t.isDirectory()}isFile(){return this.#t.isFile()}isSymbolicLink(){return this.#t.isSymbolicLink()}};const Te=(t,e,r)=>new Cs(t,e,r),ae=(t,e,r,o)=>{if(Array.isArray(e)&&e.length>0&&!e.some(s=>t.endsWith(s)))return!1;const n=t.includes("\\")?t.replaceAll("\\","/"):t;return r&&!r.some(s=>s.test(n))?!1:!o?.some(s=>s.test(n))},Os=B(import.meta.url),Lt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ns=t=>{if(typeof Lt<"u"&&Lt.versions&&Lt.versions.node){const[e,r]=Lt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Lt.getBuiltinModule(t)}return Os(t)};Ns("node:fs/promises");const Ls=B(import.meta.url),Ht=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Hs=t=>{if(typeof Ht<"u"&&Ht.versions&&Ht.versions.node){const[e,r]=Ht.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ht.getBuiltinModule(t)}return Ls(t)},{readdirSync:Bs,realpathSync:Ms,statSync:gr}=Hs("node:fs"),Ds=t=>{const e=ce(t),r=gr(e);return Te(r,hr(e),e)};function*Ps(t,e={}){const{extensions:r,followSymlinks:o=!1,includeDirs:n=!0,includeFiles:s=!0,includeSymlinks:i=!0,match:u,maxDepth:a=Number.POSITIVE_INFINITY,skip:m}=e;if(pt(t),a<0)return;const h=e.visited??new Set,y=u?u.map(g=>typeof g=="string"?Fe(g):g):void 0,A=m?m.map(g=>typeof g=="string"?Fe(g):g):void 0;if(t=vt(ct(t)),n&&ae(t,r,y,A)&&(yield Ds(t)),!(a<1||!ae(t,void 0,void 0,A)))try{const g=Bs(t,{withFileTypes:!0});for(const $ of g){let _=Zr(t,$.name),R=$.isDirectory(),L=$.isFile();if($.isSymbolicLink())if(o){const H=Ms(_);if(h.has(H))continue;_=H;const d=gr(H);R=d.isDirectory(),L=d.isFile()}else if(i&&ae(_,r,y,A)){yield Te($,$.name,ce(_));continue}else continue;R?(o&&h.add(_),yield*Ps(_,{extensions:r,followSymlinks:o,includeDirs:n,includeFiles:s,includeSymlinks:i,match:y,maxDepth:a-1,skip:A,visited:h})):L&&s&&ae(_,r,y,A)&&(yield Te($,$.name,ce(_)))}}catch(g){throw g instanceof Ie?g:new Ie(g,t)}}const Is=B(import.meta.url),Bt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fs=t=>{if(typeof Bt<"u"&&Bt.versions&&Bt.versions.node){const[e,r]=Bt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Bt.getBuiltinModule(t)}return Is(t)};Fs("node:fs/promises");const Gs=B(import.meta.url),Mt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Us=t=>{if(typeof Mt<"u"&&Mt.versions&&Mt.versions.node){const[e,r]=Mt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Mt.getBuiltinModule(t)}return Gs(t)},{statSync:js,lstatSync:zs}=Us("node:fs"),pu=(t,e={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=e.cwd?ct(e.cwd):process.cwd();let o=vt(r);const{root:n}=Yr(o),s=ct(e.stopAt??n),i=vt(o,s),u=e.type??"file",a=function(h){return typeof t=="function"?[t(h)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};e.allowSymlinks??=!0;const m=e.allowSymlinks?js:zs;for(;o&&o!==i&&o!==n;){for(let h of a(o)){if(h===Ur)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=ct(h));const y=bt(h)?h:vt(o,h);try{const A=m(y);if(u==="file"&&A.isFile()||u==="directory"&&A.isDirectory())return y}catch{}}o=Ce(o)}};function Oe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ge={},de,Ue;function fe(){if(Ue)return de;Ue=1;const t="[^\\\\/]",e=Symbol("unignore"),r="\\.",o="\\+",n="\\?",s="\\/",i="(?=.)",u="[^/]",a=`(?:${s}|$)`,m=`(?:^|${s})`,h=`${r}{1,2}${a}`,y=`(?!${r})`,A=`(?!${m}${h})`,g=`(?!${r}{0,1}${a})`,$=`(?!${h})`,_=`[^.${s}]`,R=`${u}*?`,L="/",H={DOT_LITERAL:r,PLUS_LITERAL:o,QMARK_LITERAL:n,SLASH_LITERAL:s,ONE_CHAR:i,QMARK:u,END_ANCHOR:a,DOTS_SLASH:h,NO_DOT:y,NO_DOTS:A,NO_DOT_SLASH:g,NO_DOTS_SLASH:$,QMARK_NO_DOT:_,STAR:R,START_ANCHOR:m,SEP:L},d={...H,SLASH_LITERAL:"[\\\\/]",QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},E={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return de={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:E,UNIGNORE:e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(l){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${l.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(l){return l===!0?d:H}},de}var je;function he(){return je||(je=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:n}=fe();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>o.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(n,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(r,i=>i==="\\"?"":i),t.escapeLast=(s,i,u)=>{const a=s.lastIndexOf(i,u);return a===-1?s:s[a-1]==="\\"?t.escapeLast(s,i,a-1):`${s.slice(0,a)}\\${s.slice(a)}`},t.removePrefix=(s,i={})=>{let u=s;return u.startsWith("./")&&(u=u.slice(2),i.prefix="./"),u},t.wrapOutput=(s,i={},u={})=>{const a=u.contains?"":"^",m=u.contains?"":"$";let h=`${a}(?:${s})${m}`;return i.negated===!0&&(h=`(?:^(?!${h}).*$)`),h},t.basename=(s,{windows:i}={})=>{const u=s.split(i?/[\\/]/:"/"),a=u[u.length-1];return a===""?u[u.length-2]:a}})(Ge)),Ge}var ye,ze;function Ws(){if(ze)return ye;ze=1;const t=he(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:n,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:a,CHAR_LEFT_PARENTHESES:m,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:y,CHAR_QUESTION_MARK:A,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:$,CHAR_RIGHT_SQUARE_BRACKET:_}=fe(),R=H=>H===u||H===o,L=H=>{H.isPrefix!==!0&&(H.depth=H.isGlobstar?1/0:1)};return ye=(H,d)=>{const E=d||{},l=H.length-1,T=E.parts===!0||E.scanToEnd===!0,C=[],S=[],w=[];let x=H,D=-1,G=0,J=0,at=!1,tt=!1,q=!1,et=!1,ft=!1,ot=!1,rt=!1,z=!1,nt=!1,Q=!1,ht=0,Z,k,P={value:"",depth:0,isGlob:!1};const K=()=>D>=l,f=()=>x.charCodeAt(D+1),U=()=>(Z=k,x.charCodeAt(++D));for(;D<l;){k=U();let V;if(k===o){rt=P.backslashes=!0,k=U(),k===a&&(ot=!0);continue}if(ot===!0||k===a){for(ht++;K()!==!0&&(k=U());){if(k===o){rt=P.backslashes=!0,U();continue}if(k===a){ht++;continue}if(ot!==!0&&k===s&&(k=U())===s){if(at=P.isBrace=!0,q=P.isGlob=!0,Q=!0,T===!0)continue;break}if(ot!==!0&&k===n){if(at=P.isBrace=!0,q=P.isGlob=!0,Q=!0,T===!0)continue;break}if(k===g&&(ht--,ht===0)){ot=!1,at=P.isBrace=!0,Q=!0;break}}if(T===!0)continue;break}if(k===u){if(C.push(D),S.push(P),P={value:"",depth:0,isGlob:!1},Q===!0)continue;if(Z===s&&D===G+1){G+=2;continue}J=D+1;continue}if(E.noext!==!0&&(k===y||k===r||k===e||k===A||k===i)&&f()===m){if(q=P.isGlob=!0,et=P.isExtglob=!0,Q=!0,k===i&&D===G&&(nt=!0),T===!0){for(;K()!==!0&&(k=U());){if(k===o){rt=P.backslashes=!0,k=U();continue}if(k===$){q=P.isGlob=!0,Q=!0;break}}continue}break}if(k===e){if(Z===e&&(ft=P.isGlobstar=!0),q=P.isGlob=!0,Q=!0,T===!0)continue;break}if(k===A){if(q=P.isGlob=!0,Q=!0,T===!0)continue;break}if(k===h){for(;K()!==!0&&(V=U());){if(V===o){rt=P.backslashes=!0,U();continue}if(V===_){tt=P.isBracket=!0,q=P.isGlob=!0,Q=!0;break}}if(T===!0)continue;break}if(E.nonegate!==!0&&k===i&&D===G){z=P.negated=!0,G++;continue}if(E.noparen!==!0&&k===m){if(q=P.isGlob=!0,T===!0){for(;K()!==!0&&(k=U());){if(k===m){rt=P.backslashes=!0,k=U();continue}if(k===$){Q=!0;break}}continue}break}if(q===!0){if(Q=!0,T===!0)continue;break}}E.noext===!0&&(et=!1,q=!1);let F=x,gt="",c="";G>0&&(gt=x.slice(0,G),x=x.slice(G),J-=G),F&&q===!0&&J>0?(F=x.slice(0,J),c=x.slice(J)):q===!0?(F="",c=x):F=x,F&&F!==""&&F!=="/"&&F!==x&&R(F.charCodeAt(F.length-1))&&(F=F.slice(0,-1)),E.unescape===!0&&(c&&(c=t.removeBackslashes(c)),F&&rt===!0&&(F=t.removeBackslashes(F)));const p={prefix:gt,input:H,start:G,base:F,glob:c,isBrace:at,isBracket:tt,isGlob:q,isExtglob:et,isGlobstar:ft,negated:z,negatedExtglob:nt};if(E.tokens===!0&&(p.maxDepth=0,R(k)||S.push(P),p.tokens=S),E.parts===!0||E.tokens===!0){let V;for(let M=0;M<C.length;M++){const st=V?V+1:G,it=C[M],Y=H.slice(st,it);E.tokens&&(M===0&&G!==0?(S[M].isPrefix=!0,S[M].value=gt):S[M].value=Y,L(S[M]),p.maxDepth+=S[M].depth),(M!==0||Y!=="")&&w.push(Y),V=it}if(V&&V+1<H.length){const M=H.slice(V+1);w.push(M),E.tokens&&(S[S.length-1].value=M,L(S[S.length-1]),p.maxDepth+=S[S.length-1].depth)}p.slashes=C,p.parts=w}return p},ye}var me,We;function qs(){if(We)return me;We=1;const t=fe(),e=he(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=t,u=(d,E)=>typeof E.expandRange=="function"?E.expandRange(...d,E):(d.sort(),`[${d.join("-")}]`),a=(d,E)=>`Missing ${d}: "${E}" - use "\\\\${E}" to match literal characters`,m=d=>{const E=[];let l=0,T=0,C=0,S="",w=!1;for(const x of d){if(w===!0){S+=x,w=!1;continue}if(x==="\\"){S+=x,w=!0;continue}if(x==='"'){C=C===1?0:1,S+=x;continue}if(C===0){if(x==="[")l++;else if(x==="]"&&l>0)l--;else if(l===0){if(x==="(")T++;else if(x===")"&&T>0)T--;else if(x==="|"&&T===0){E.push(S),S="";continue}}}S+=x}return E.push(S),E},h=d=>{let E=!1;for(const l of d){if(E===!0){E=!1;continue}if(l==="\\"){E=!0;continue}if(/[?*+@!()[\]{}]/.test(l))return!1}return!0},y=d=>{let E=d.trim(),l=!0;for(;l===!0;)l=!1,/^@\([^\\()[\]{}|]+\)$/.test(E)&&(E=E.slice(2,-1),l=!0);if(h(E))return E.replace(/\\(.)/g,"$1")},A=d=>{const E=d.map(y).filter(Boolean);for(let l=0;l<E.length;l++)for(let T=l+1;T<E.length;T++){const C=E[l],S=E[T],w=C[0];if(!(!w||C!==w.repeat(C.length)||S!==w.repeat(S.length))&&(C===S||C.startsWith(S)||S.startsWith(C)))return!0}return!1},g=(d,E=!0)=>{if(d[0]!=="+"&&d[0]!=="*"||d[1]!=="(")return;let l=0,T=0,C=0,S=!1;for(let w=1;w<d.length;w++){const x=d[w];if(S===!0){S=!1;continue}if(x==="\\"){S=!0;continue}if(x==='"'){C=C===1?0:1;continue}if(C!==1){if(x==="["){l++;continue}if(x==="]"&&l>0){l--;continue}if(!(l>0)){if(x==="("){T++;continue}if(x===")"&&(T--,T===0))return E===!0&&w!==d.length-1?void 0:{type:d[0],body:d.slice(2,w),end:w}}}}},$=d=>`${d.length===1?e.escapeRegex(d[0]):`[${d.map(E=>e.escapeRegex(E)).join("")}]`}*`,_=d=>{let E=0;const l=[];for(;E<d.length;){const T=g(d.slice(E),!1);if(!T||T.type!=="*")return;const C=m(T.body).map(w=>w.trim());if(C.length!==1)return;const S=y(C[0]);if(!S||S.length!==1)return;l.push(S),E+=T.end+1}if(!(l.length<1))return l},R=d=>{let E=0,l=d.trim(),T=g(l);for(;T;)E++,l=T.body.trim(),T=g(l);return E},L=(d,E)=>{if(E.maxExtglobRecursion===!1)return{risky:!1};const l=typeof E.maxExtglobRecursion=="number"?E.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,T=m(d).map(x=>x.trim());if(T.length>1&&(T.some(x=>x==="")||T.some(x=>/^[*?]+$/.test(x))||A(T)))return{risky:!0};const C=[];let S=!1,w=!0;for(const x of T){const D=_(x);if(D){S=!0,C.push(...D);continue}const G=y(x);if(G&&G.length===1){C.push(G);continue}if(w=!1,R(x)>l)return{risky:!0}}return S?w?{risky:!0,safeOutput:$([...new Set(C)])}:{risky:!0}:{risky:!1}},H=(d,E)=>{if(typeof d!="string")throw new TypeError("Expected a string");d=i[d]||d;const l={...E},T=typeof l.maxLength=="number"?Math.min(r,l.maxLength):r;let C=d.length;if(C>T)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${T}`);const S={type:"bos",value:"",output:l.prepend||""},w=[S],x=l.capture?"":"?:",D=t.globChars(l.windows),G=t.extglobChars(D),{DOT_LITERAL:J,PLUS_LITERAL:at,SLASH_LITERAL:tt,ONE_CHAR:q,DOTS_SLASH:et,NO_DOT:ft,NO_DOT_SLASH:ot,NO_DOTS_SLASH:rt,QMARK:z,QMARK_NO_DOT:nt,STAR:Q,START_ANCHOR:ht}=D,Z=v=>`(${x}(?:(?!${ht}${v.dot?et:J}).)*?)`,k=l.dot?"":ft,P=l.dot?z:nt;let K=l.bash===!0?Z(l):Q;l.capture&&(K=`(${K})`),typeof l.noext=="boolean"&&(l.noextglob=l.noext);const f={input:d,index:-1,start:0,dot:l.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:w};d=e.removePrefix(d,f),C=d.length;const U=[],F=[],gt=[];let c=S,p;const V=()=>f.index===C-1,M=f.peek=(v=1)=>d[f.index+v],st=f.advance=()=>d[++f.index]||"",it=()=>d.slice(f.index+1),Y=(v="",j=0)=>{f.consumed+=v,f.index+=j},ie=v=>{f.output+=v.output!=null?v.output:v.value,Y(v.value)},Mr=()=>{let v=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)st(),f.start++,v++;return v%2===0?!1:(f.negated=!0,f.start++,!0)},ue=v=>{f[v]++,gt.push(v)},dt=v=>{f[v]--,gt.pop()},O=v=>{if(c.type==="globstar"){const j=f.braces>0&&(v.type==="comma"||v.type==="brace"),b=v.extglob===!0||U.length&&(v.type==="pipe"||v.type==="paren");v.type!=="slash"&&v.type!=="paren"&&!j&&!b&&(f.output=f.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=K,f.output+=c.output)}if(U.length&&v.type!=="paren"&&(U[U.length-1].inner+=v.value),(v.value||v.output)&&ie(v),c&&c.type==="text"&&v.type==="text"){c.output=(c.output||c.value)+v.value,c.value+=v.value;return}v.prev=c,w.push(v),c=v},le=(v,j)=>{const b={...G[j],conditions:1,inner:""};b.prev=c,b.parens=f.parens,b.output=f.output,b.startIndex=f.index,b.tokensIndex=w.length;const N=(l.capture?"(":"")+b.open;ue("parens"),O({type:v,value:j,output:f.output?"":q}),O({type:"paren",extglob:!0,value:st(),output:N}),U.push(b)},Dr=v=>{const j=d.slice(v.startIndex,f.index+1),b=d.slice(v.startIndex+2,f.index),N=L(b,l);if((v.type==="plus"||v.type==="star")&&N.risky){const I=N.safeOutput?(v.output?"":q)+(l.capture?`(${N.safeOutput})`:N.safeOutput):void 0,ut=w[v.tokensIndex];ut.type="text",ut.value=j,ut.output=I||e.escapeRegex(j);for(let lt=v.tokensIndex+1;lt<w.length;lt++)w[lt].value="",w[lt].output="",delete w[lt].suffix;f.output=v.output+ut.output,f.backtrack=!0,O({type:"paren",extglob:!0,value:p,output:""}),dt("parens");return}let W=v.close+(l.capture?")":""),X;if(v.type==="negate"){let I=K;if(v.inner&&v.inner.length>1&&v.inner.includes("/")&&(I=Z(l)),(I!==K||V()||/^\)+$/.test(it()))&&(W=v.close=`)$))${I}`),v.inner.includes("*")&&(X=it())&&/^\.[^\\/.]+$/.test(X)){const ut=H(X,{...E,fastpaths:!1}).output;W=v.close=`)${ut})${I})`}v.prev.type==="bos"&&(f.negatedExtglob=!0)}O({type:"paren",extglob:!0,value:p,output:W}),dt("parens")};if(l.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(d)){let v=!1,j=d.replace(s,(b,N,W,X,I,ut)=>X==="\\"?(v=!0,b):X==="?"?N?N+X+(I?z.repeat(I.length):""):ut===0?P+(I?z.repeat(I.length):""):z.repeat(W.length):X==="."?J.repeat(W.length):X==="*"?N?N+X+(I?K:""):K:N?b:`\\${b}`);return v===!0&&(l.unescape===!0?j=j.replace(/\\/g,""):j=j.replace(/\\+/g,b=>b.length%2===0?"\\\\":b?"\\":"")),j===d&&l.contains===!0?(f.output=d,f):(f.output=e.wrapOutput(j,f,E),f)}for(;!V();){if(p=st(),p==="\0")continue;if(p==="\\"){const b=M();if(b==="/"&&l.bash!==!0||b==="."||b===";")continue;if(!b){p+="\\",O({type:"text",value:p});continue}const N=/^\\+/.exec(it());let W=0;if(N&&N[0].length>2&&(W=N[0].length,f.index+=W,W%2!==0&&(p+="\\")),l.unescape===!0?p=st():p+=st(),f.brackets===0){O({type:"text",value:p});continue}}if(f.brackets>0&&(p!=="]"||c.value==="["||c.value==="[^")){if(l.posix!==!1&&p===":"){const b=c.value.slice(1);if(b.includes("[")&&(c.posix=!0,b.includes(":"))){const N=c.value.lastIndexOf("["),W=c.value.slice(0,N),X=c.value.slice(N+2),I=o[X];if(I){c.value=W+I,f.backtrack=!0,st(),!S.output&&w.indexOf(c)===1&&(S.output=q);continue}}}(p==="["&&M()!==":"||p==="-"&&M()==="]")&&(p=`\\${p}`),p==="]"&&(c.value==="["||c.value==="[^")&&(p=`\\${p}`),l.posix===!0&&p==="!"&&c.value==="["&&(p="^"),c.value+=p,ie({value:p});continue}if(f.quotes===1&&p!=='"'){p=e.escapeRegex(p),c.value+=p,ie({value:p});continue}if(p==='"'){f.quotes=f.quotes===1?0:1,l.keepQuotes===!0&&O({type:"text",value:p});continue}if(p==="("){ue("parens"),O({type:"paren",value:p});continue}if(p===")"){if(f.parens===0&&l.strictBrackets===!0)throw new SyntaxError(a("opening","("));const b=U[U.length-1];if(b&&f.parens===b.parens+1){Dr(U.pop());continue}O({type:"paren",value:p,output:f.parens?")":"\\)"}),dt("parens");continue}if(p==="["){if(l.nobracket===!0||!it().includes("]")){if(l.nobracket!==!0&&l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));p=`\\${p}`}else ue("brackets");O({type:"bracket",value:p});continue}if(p==="]"){if(l.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){O({type:"text",value:p,output:`\\${p}`});continue}if(f.brackets===0){if(l.strictBrackets===!0)throw new SyntaxError(a("opening","["));O({type:"text",value:p,output:`\\${p}`});continue}dt("brackets");const b=c.value.slice(1);if(c.posix!==!0&&b[0]==="^"&&!b.includes("/")&&(p=`/${p}`),c.value+=p,ie({value:p}),l.literalBrackets===!1||e.hasRegexChars(b))continue;const N=e.escapeRegex(c.value);if(f.output=f.output.slice(0,-c.value.length),l.literalBrackets===!0){f.output+=N,c.value=N;continue}c.value=`(${x}${N}|${c.value})`,f.output+=c.value;continue}if(p==="{"&&l.nobrace!==!0){ue("braces");const b={type:"brace",value:p,output:"(",outputIndex:f.output.length,tokensIndex:f.tokens.length};F.push(b),O(b);continue}if(p==="}"){const b=F[F.length-1];if(l.nobrace===!0||!b){O({type:"text",value:p,output:p});continue}let N=")";if(b.dots===!0){const W=w.slice(),X=[];for(let I=W.length-1;I>=0&&(w.pop(),W[I].type!=="brace");I--)W[I].type!=="dots"&&X.unshift(W[I].value);N=u(X,l),f.backtrack=!0}if(b.comma!==!0&&b.dots!==!0){const W=f.output.slice(0,b.outputIndex),X=f.tokens.slice(b.tokensIndex);b.value=b.output="\\{",p=N="\\}",f.output=W;for(const I of X)f.output+=I.output||I.value}O({type:"brace",value:p,output:N}),dt("braces"),F.pop();continue}if(p==="|"){U.length>0&&U[U.length-1].conditions++,O({type:"text",value:p});continue}if(p===","){let b=p;const N=F[F.length-1];N&&gt[gt.length-1]==="braces"&&(N.comma=!0,b="|"),O({type:"comma",value:p,output:b});continue}if(p==="/"){if(c.type==="dot"&&f.index===f.start+1){f.start=f.index+1,f.consumed="",f.output="",w.pop(),c=S;continue}O({type:"slash",value:p,output:tt});continue}if(p==="."){if(f.braces>0&&c.type==="dot"){c.value==="."&&(c.output=J);const b=F[F.length-1];c.type="dots",c.output+=p,c.value+=p,b.dots=!0;continue}if(f.braces+f.parens===0&&c.type!=="bos"&&c.type!=="slash"){O({type:"text",value:p,output:J});continue}O({type:"dot",value:p,output:J});continue}if(p==="?"){if(!(c&&c.value==="(")&&l.noextglob!==!0&&M()==="("&&M(2)!=="?"){le("qmark",p);continue}if(c&&c.type==="paren"){const b=M();let N=p;(c.value==="("&&!/[!=<:]/.test(b)||b==="<"&&!/<([!=]|\w+>)/.test(it()))&&(N=`\\${p}`),O({type:"text",value:p,output:N});continue}if(l.dot!==!0&&(c.type==="slash"||c.type==="bos")){O({type:"qmark",value:p,output:nt});continue}O({type:"qmark",value:p,output:z});continue}if(p==="!"){if(l.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){le("negate",p);continue}if(l.nonegate!==!0&&f.index===0){Mr();continue}}if(p==="+"){if(l.noextglob!==!0&&M()==="("&&M(2)!=="?"){le("plus",p);continue}if(c&&c.value==="("||l.regex===!1){O({type:"plus",value:p,output:at});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||f.parens>0){O({type:"plus",value:p});continue}O({type:"plus",value:at});continue}if(p==="@"){if(l.noextglob!==!0&&M()==="("&&M(2)!=="?"){O({type:"at",extglob:!0,value:p,output:""});continue}O({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);const b=n.exec(it());b&&(p+=b[0],f.index+=b[0].length),O({type:"text",value:p});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=p,c.output=K,f.backtrack=!0,f.globstar=!0,Y(p);continue}let v=it();if(l.noextglob!==!0&&/^\([^?]/.test(v)){le("star",p);continue}if(c.type==="star"){if(l.noglobstar===!0){Y(p);continue}const b=c.prev,N=b.prev,W=b.type==="slash"||b.type==="bos",X=N&&(N.type==="star"||N.type==="globstar");if(l.bash===!0&&(!W||v[0]&&v[0]!=="/")){O({type:"star",value:p,output:""});continue}const I=f.braces>0&&(b.type==="comma"||b.type==="brace"),ut=U.length&&(b.type==="pipe"||b.type==="paren");if(!W&&b.type!=="paren"&&!I&&!ut){O({type:"star",value:p,output:""});continue}for(;v.slice(0,3)==="/**";){const lt=d[f.index+4];if(lt&&lt!=="/")break;v=v.slice(3),Y("/**",3)}if(b.type==="bos"&&V()){c.type="globstar",c.value+=p,c.output=Z(l),f.output=c.output,f.globstar=!0,Y(p);continue}if(b.type==="slash"&&b.prev.type!=="bos"&&!X&&V()){f.output=f.output.slice(0,-(b.output+c.output).length),b.output=`(?:${b.output}`,c.type="globstar",c.output=Z(l)+(l.strictSlashes?")":"|$)"),c.value+=p,f.globstar=!0,f.output+=b.output+c.output,Y(p);continue}if(b.type==="slash"&&b.prev.type!=="bos"&&v[0]==="/"){const lt=v[1]!==void 0?"|$":"";f.output=f.output.slice(0,-(b.output+c.output).length),b.output=`(?:${b.output}`,c.type="globstar",c.output=`${Z(l)}${tt}|${tt}${lt})`,c.value+=p,f.output+=b.output+c.output,f.globstar=!0,Y(p+st()),O({type:"slash",value:"/",output:""});continue}if(b.type==="bos"&&v[0]==="/"){c.type="globstar",c.value+=p,c.output=`(?:^|${tt}|${Z(l)}${tt})`,f.output=c.output,f.globstar=!0,Y(p+st()),O({type:"slash",value:"/",output:""});continue}if(I&&v[0]==="/"){c.type="globstar",c.value+=p,c.output=`(?:^|${tt}|${Z(l)}${tt})`,f.output+=c.output,f.globstar=!0,Y(p+st()),O({type:"slash",value:"/",output:""});continue}f.output=f.output.slice(0,-c.output.length),c.type="globstar",c.output=Z(l),c.value+=p,f.output+=c.output,f.globstar=!0,Y(p);continue}const j={type:"star",value:p,output:K};if(l.bash===!0){j.output=".*?",(c.type==="bos"||c.type==="slash")&&(j.output=k+j.output),O(j);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&l.regex===!0){j.output=p,O(j);continue}(f.index===f.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(f.output+=ot,c.output+=ot):l.dot===!0?(f.output+=rt,c.output+=rt):(f.output+=k,c.output+=k),M()!=="*"&&(f.output+=q,c.output+=q)),O(j)}for(;f.brackets>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));f.output=e.escapeLast(f.output,"["),dt("brackets")}for(;f.parens>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing",")"));f.output=e.escapeLast(f.output,"("),dt("parens")}for(;f.braces>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","}"));f.output=e.escapeLast(f.output,"{"),dt("braces")}if(l.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&O({type:"maybe_slash",value:"",output:`${tt}?`}),f.backtrack===!0){f.output="";for(const v of f.tokens)f.output+=v.output!=null?v.output:v.value,v.suffix&&(f.output+=v.suffix)}return f};return H.fastpaths=(d,E)=>{const l={...E},T=typeof l.maxLength=="number"?Math.min(r,l.maxLength):r,C=d.length;if(C>T)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${T}`);d=i[d]||d;const{DOT_LITERAL:S,SLASH_LITERAL:w,ONE_CHAR:x,DOTS_SLASH:D,NO_DOT:G,NO_DOTS:J,NO_DOTS_SLASH:at,STAR:tt,START_ANCHOR:q}=t.globChars(l.windows),et=l.dot?J:G,ft=l.dot?at:G,ot=l.capture?"":"?:",rt={negated:!1,prefix:""};let z=l.bash===!0?".*?":tt;l.capture&&(z=`(${z})`);const nt=k=>k.noglobstar===!0?z:`(${ot}(?:(?!${q}${k.dot?D:S}).)*?)`,Q=k=>{switch(k){case"*":return`${et}${x}${z}`;case".*":return`${S}${x}${z}`;case"*.*":return`${et}${z}${S}${x}${z}`;case"*/*":return`${et}${z}${w}${x}${ft}${z}`;case"**":return et+nt(l);case"**/*":return`(?:${et}${nt(l)}${w})?${ft}${x}${z}`;case"**/*.*":return`(?:${et}${nt(l)}${w})?${ft}${z}${S}${x}${z}`;case"**/.*":return`(?:${et}${nt(l)}${w})?${S}${x}${z}`;default:{const P=/^(.*?)\.(\w+)$/.exec(k);if(!P)return;const K=Q(P[1]);return K?K+S+P[2]:void 0}}},ht=e.removePrefix(d,rt);let Z=Q(ht);return Z&&l.strictSlashes!==!0&&(Z+=`${w}?`),Z},me=H,me}var be,qe;function Xs(){if(qe)return be;qe=1;const t=Ws(),e=qs(),r=he(),o=fe(),n=i=>i&&typeof i=="object"&&!Array.isArray(i),s=(i,u,a=!1)=>{if(Array.isArray(i)){const R=i.map(L=>s(L,u,a));return L=>{for(const H of R){const d=H(L);if(d)return d}return!1}}const m=n(i)&&i.tokens&&i.input;if(i===""||typeof i!="string"&&!m)throw new TypeError("Expected pattern to be a non-empty string");const h=u||{},y=h.windows,A=m?s.compileRe(i,u):s.makeRe(i,u,!1,!0),g=A.state;delete A.state;let $=()=>!1;if(h.ignore){const R={...u,ignore:null,onMatch:null,onResult:null};$=s(h.ignore,R,a)}const _=(R,L=!1)=>{const{isMatch:H,match:d,output:E}=s.test(R,A,u,{glob:i,posix:y}),l={glob:i,state:g,regex:A,posix:y,input:R,output:E,match:d,isMatch:H};if(typeof h.onResult=="function"&&h.onResult(l),H===!1)return l.isMatch=!1,L?l:!1;t:if($(R)){if(typeof h.onIgnore=="function"&&h.onIgnore(l)===o.UNIGNORE){l.isMatch=!0;break t}return l.isMatch=!1,L?l:!1}return typeof h.onMatch=="function"&&h.onMatch(l),L?l:!0};return a&&(_.state=g),_};return s.test=(i,u,a,{glob:m,posix:h}={})=>{if(typeof i!="string")throw new TypeError("Expected input to be a string");if(i==="")return{isMatch:!1,output:""};const y=a||{},A=y.format||(h?r.toPosixSlashes:null);let g=i===m,$=g&&A?A(i):i;return g===!1&&($=A?A(i):i,g=$===m),(g===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?g=s.matchBase(i,u,a,h):g=u.exec($)),{isMatch:!!g,match:g,output:$}},s.matchBase=(i,u,a,m=a&&a.windows)=>(u instanceof RegExp?u:s.makeRe(u,a)).test(r.basename(i,{windows:m})),s.isMatch=(i,u,a)=>s(u,a)(i),s.parse=(i,u)=>Array.isArray(i)?i.map(a=>s.parse(a,u)):e(i,{...u,fastpaths:!1}),s.scan=(i,u)=>t(i,u),s.compileRe=(i,u,a=!1,m=!1)=>{if(a===!0)return i.output;const h=u||{},y=h.contains?"":"^",A=h.contains?"":"$";let g=`${y}(?:${i.output})${A}`;i&&i.negated===!0&&(g=`^(?!${g}).*$`);const $=s.toRegex(g,u);return m===!0&&($.state=i),$},s.makeRe=(i,u={},a=!1,m=!1)=>{if(!i||typeof i!="string")throw new TypeError("Expected a non-empty string");let h={negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(i[0]==="."||i[0]==="*")&&(h.output=e.fastpaths(i,u)),h.output||(h=e(i,u)),s.compileRe(h,u,a,m)},s.toRegex=(i,u)=>{try{const a=u||{};return new RegExp(i,a.flags||(a.nocase?"i":""))}catch(a){if(u&&u.debug===!0)throw a;return/$^/}},s.constants=o,be=s,be}var $e,Xe;function Ks(){if(Xe)return $e;Xe=1;const t=Xs(),e=he();function r(o,n,s=!1){return n&&(n.windows===null||n.windows===void 0)&&(n={...n,windows:e.isWindows()}),t(o,n,s)}return Object.assign(r,t),$e=r,$e}var Qs=Ks();const yt=Oe(Qs),Zs=B(import.meta.url),Dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oe=t=>{if(typeof Dt<"u"&&Dt.versions&&Dt.versions.node){const[e,r]=Dt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Dt.getBuiltinModule(t)}return Zs(t)},Ke=oe("fs"),Vs={...Ke,default:Ke},{statSync:Ys,stat:Js,realpathSync:to,realpath:eo,readdirSync:ro,readdir:so}=oe("fs"),{sep:dr,basename:oo,dirname:Re,resolve:yr,normalize:no,relative:io,posix:mt,isAbsolute:uo}=oe("path"),{fileURLToPath:lo}=oe("url"),{createRequire:ao}=oe("module");var Qe=ao(import.meta.url);function co(t){let e=no(t);return e.length>1&&e[e.length-1]===dr&&(e=e.substring(0,e.length-1)),e}const po=/[\\/]/g;function mr(t,e){return t.replace(po,e)}const fo=/^[a-z]:[\\/]$/i;function ho(t){return t==="/"||fo.test(t)}function ve(t,e){const{resolvePaths:r,normalizePath:o,pathSeparator:n}=e,s=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=yr(t)),(o||s)&&(t=co(t)),t===".")return"";const i=t[t.length-1]!==n;return mr(i?t+n:t,n)}function br(t,e){return e+t}function go(t,e){return function(r,o){return o.startsWith(t)?o.slice(t.length)+r:mr(io(t,o),e.pathSeparator)+e.pathSeparator+r}}function yo(t){return t}function mo(t,e,r){return e+t+r}function bo(t,e){const{relativePaths:r,includeBasePath:o}=e;return r&&t?go(t,e):o?br:yo}function $o(t){return function(e,r){r.push(e.substring(t.length)||".")}}function vo(t){return function(e,r,o){const n=e.substring(t.length)||".";o.every(s=>s(n,!0))&&r.push(n)}}const Eo=(t,e)=>{e.push(t||".")},Ao=(t,e,r)=>{const o=t||".";r.every(n=>n(o,!0))&&e.push(o)},xo=()=>{};function So(t,e){const{includeDirs:r,filters:o,relativePaths:n}=e;return r?n?o&&o.length?vo(t):$o(t):o&&o.length?Ao:Eo:xo}const wo=(t,e,r,o)=>{o.every(n=>n(t,!1))&&r.files++},To=(t,e,r,o)=>{o.every(n=>n(t,!1))&&e.push(t)},Ro=(t,e,r,o)=>{r.files++},_o=(t,e)=>{e.push(t)},ko=()=>{};function Co(t){const{excludeFiles:e,filters:r,onlyCounts:o}=t;return e?ko:r&&r.length?o?wo:To:o?Ro:_o}const Oo=t=>t,No=()=>[""].slice(0,0);function Lo(t){return t.group?No:Oo}const Ho=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},Bo=()=>{};function Mo(t){return t.group?Ho:Bo}const Do=function(t,e,r){const{queue:o,fs:n,options:{suppressErrors:s}}=e;o.enqueue(),n.realpath(t,(i,u)=>{if(i)return o.dequeue(s?null:i,e);n.stat(u,(a,m)=>{if(a)return o.dequeue(s?null:a,e);if(m.isDirectory()&&$r(t,u,e))return o.dequeue(null,e);r(m,u),o.dequeue(null,e)})})},Po=function(t,e,r){const{queue:o,fs:n,options:{suppressErrors:s}}=e;o.enqueue();try{const i=n.realpathSync(t),u=n.statSync(i);if(u.isDirectory()&&$r(t,i,e))return;r(u,i)}catch(i){if(!s)throw i}};function Io(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Po:Do}function $r(t,e,r){if(r.options.useRealPaths)return Fo(e,r);let o=Re(t),n=1;for(;o!==r.root&&n<2;){const s=r.symlinks.get(o);s&&(s===e||s.startsWith(e)||e.startsWith(s))?n++:o=Re(o)}return r.symlinks.set(t,e),n>1}function Fo(t,e){return e.visited.includes(t+e.options.pathSeparator)}const Go=t=>t.counts,Uo=t=>t.groups,jo=t=>t.paths,zo=t=>t.paths.slice(0,t.options.maxFiles),Wo=(t,e,r)=>(ge(e,r,t.counts,t.options.suppressErrors),null),qo=(t,e,r)=>(ge(e,r,t.paths,t.options.suppressErrors),null),Xo=(t,e,r)=>(ge(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Ko=(t,e,r)=>(ge(e,r,t.groups,t.options.suppressErrors),null);function ge(t,e,r,o){e(t&&!o?t:null,r)}function Qo(t,e){const{onlyCounts:r,group:o,maxFiles:n}=t;return r?e?Go:Wo:o?e?Uo:Ko:n?e?zo:Xo:e?jo:qo}const vr={withFileTypes:!0},Zo=(t,e,r,o,n)=>{if(t.queue.enqueue(),o<0)return t.queue.dequeue(null,t);const{fs:s}=t;t.visited.push(e),t.counts.directories++,s.readdir(e||".",vr,(i,u=[])=>{n(u,r,o),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},Vo=(t,e,r,o,n)=>{const{fs:s}=t;if(o<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=s.readdirSync(e||".",vr)}catch(u){if(!t.options.suppressErrors)throw u}n(i,r,o)};function Yo(t){return t?Vo:Zo}var Jo=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},tn=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},en=class{aborted=!1;abort(){this.aborted=!0}},Er=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,r,o){this.isSynchronous=!o,this.callbackInvoker=Qo(r,this.isSynchronous),this.root=ve(e,r),this.state={root:ho(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new tn,options:r,queue:new Jo((n,s)=>this.callbackInvoker(s,n,o)),symlinks:new Map,visited:[""].slice(0,0),controller:new en,fs:r.fs||Vs},this.joinPath=bo(this.root,r),this.pushDirectory=So(this.root,r),this.pushFile=Co(r),this.getArray=Lo(r),this.groupFiles=Mo(r),this.resolveSymlink=Io(r,this.isSynchronous),this.walkDirectory=Yo(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,r,o)=>{const{paths:n,options:{filters:s,resolveSymlinks:i,excludeSymlinks:u,exclude:a,maxFiles:m,signal:h,useRealPaths:y,pathSeparator:A},controller:g}=this.state;if(g.aborted||h&&h.aborted||m&&n.length>m)return;const $=this.getArray(this.state.paths);for(let _=0;_<e.length;++_){const R=e[_];if(R.isFile()||R.isSymbolicLink()&&!i&&!u){const L=this.joinPath(R.name,r);this.pushFile(L,$,this.state.counts,s)}else if(R.isDirectory()){let L=mo(R.name,r,this.state.options.pathSeparator);if(a&&a(R.name,L))continue;this.pushDirectory(L,n,s),this.walkDirectory(this.state,L,L,o-1,this.walk)}else if(this.resolveSymlink&&R.isSymbolicLink()){let L=br(R.name,r);this.resolveSymlink(L,this.state,(H,d)=>{if(H.isDirectory()){if(d=ve(d,this.state.options),a&&a(R.name,y?d:L+A))return;this.walkDirectory(this.state,d,y?d:L+A,o-1,this.walk)}else{d=y?d:L;const E=oo(d),l=ve(Re(d),this.state.options);d=this.joinPath(E,l),this.pushFile(d,$,this.state.counts,s)}})}}this.groupFiles(this.state.groups,r,$)}};function rn(t,e){return new Promise((r,o)=>{Ar(t,e,(n,s)=>{if(n)return o(n);r(s)})})}function Ar(t,e,r){new Er(t,e,r).start()}function sn(t,e){return new Er(t,e).start()}var Ze=class{constructor(e,r){this.root=e,this.options=r}withPromise(){return rn(this.root,this.options)}withCallback(e){Ar(this.root,this.options,e)}sync(){return sn(this.root,this.options)}};let xr=null;try{Qe.resolve("picomatch"),xr=Qe("picomatch")}catch{}var on=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:dr,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Ze(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Ze(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const r=this.globFunction||xr;if(!r)throw new Error("Please specify a glob function to use glob matching.");var o=this.globCache[t.join("\0")];return o||(o=r(t,...e),this.globCache[t.join("\0")]=o),this.options.filters.push(n=>o(n)),this}};const nn=Array.isArray,Sr=/\\/g,un=/^[A-Za-z]:$/,wr=process.platform==="win32",ln=/^(\/?\.\.)+$/;function Ve(t,e={}){const r=t.length,o=Array(r),n=Array(r);let s,i;for(s=0;s<r;s++){const u=Tr(t[s]);o[s]=u;const a=u.length,m=Array(a);for(i=0;i<a;i++)m[i]=yt(u[i],e);n[s]=m}return u=>{const a=u.split("/");if(a[0]===".."&&ln.test(u))return!0;for(s=0;s<r;s++){const m=o[s],h=n[s],y=a.length,A=Math.min(y,m.length);for(i=0;i<A;){const g=m[i];if(g.includes("/"))return!0;if(!h[i](a[i]))break;if(!e.noglobstar&&g==="**")return!0;i++}if(i===y)return!0}return!1}}const an=/^[A-Z]:\/$/i,cn=wr?t=>an.test(t):t=>t==="/";function Ye(t,e,r){if(t===e||e.startsWith(`${t}/`)){if(r){const n=t.length+ +!cn(t);return(s,i)=>s.slice(n,i?-1:void 0)||"."}const o=e.slice(t.length+1);return o?(n,s)=>{if(n===".")return o;const i=`${o}/${n}`;return s?i.slice(0,-1):i}:(n,s)=>s&&n!=="."?n.slice(0,-1):n}return r?o=>mt.relative(t,o)||".":o=>mt.relative(t,`${e}/${o}`)||"."}function pn(t,e){if(e.startsWith(`${t}/`)){const r=e.slice(t.length+1);return o=>`${r}/${o}`}return r=>{const o=mt.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&o!==""?`${o}/`:o||"."}}function Je(t){return t.replace(un,e=>`${e}/`)}const fn={parts:!0};function Tr(t){var e;const r=yt.scan(t,fn);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}const hn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,gn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,dn=t=>t.replace(hn,"\\$&"),yn=t=>t.replace(gn,"\\$&"),mn=wr?yn:dn;function bn(t,e){const r=yt.scan(t);return r.isGlob||r.negated}function se(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function Rr(t){return typeof t=="string"?[t]:t??[]}const $n=/^(\/?\.\.)+/,vn=/\\(?=[()[\]{}!*+?@|])/g;function Ee(t,e,r,o){var n;const s=e.cwd;let i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1));const u=i.lastIndexOf("/"),a=(u===-1?i:i.slice(u+1)).startsWith("!(");i[i.length-1]!=="*"&&!a&&e.expandDirectories&&(i+="/**");const m=mn(s);i=uo(i.replace(vn,""))?mt.relative(m,i):mt.normalize(i);const h=(n=$n.exec(i))===null||n===void 0?void 0:n[0],y=Tr(i);if(h){const g=(h.length+1)/3;let $=0;const _=m.split("/");for(;$<g&&y[$+g]===_[_.length+$-g];)i=i.slice(0,(g-$-1)*3)+i.slice((g-$)*3+y[$+g].length+1)||".",$++;const R=mt.join(s,h.slice($*3));R[0]!=="."&&r.root.length>R.length&&(r.root=Je(R),r.depthOffset=-g+$)}if(!o&&r.depthOffset>=0){var A;(A=r.commonPath)!==null&&A!==void 0||(r.commonPath=y);const g=[],$=Math.min(r.commonPath.length,y.length);for(let _=0;_<$;_++){const R=y[_];if(R==="**"&&!y[_+1]){g.pop();break}if(_===y.length-1||R!==r.commonPath[_]||bn(R))break;g.push(R)}r.depthOffset=g.length,r.commonPath=g,r.root=Je(g.length>0?mt.join(s,...g):s)}return i}function En(t,e,r){const o=[],n=[],s=[];for(const i of t.ignore)i&&(i[0]!=="!"||i[1]==="("?n.push(Ee(i,t,r,!0)):s.push(i.slice(1)));for(const i of e)i&&(i[0]!=="!"||i[1]==="("?o.push(Ee(i,t,r,!1)):(i[1]!=="!"||i[2]==="(")&&n.push(Ee(i.slice(1),t,r,!0)));return{match:o,ignore:n,unignore:s}}function An(t,e){const r=t.cwd,o={root:r,depthOffset:0},n=En(t,e,o);t.debug&&se("internal processing patterns:",n);const{absolute:s,caseSensitiveMatch:i,debug:u,dot:a,followSymbolicLinks:m,onlyDirectories:h}=t,y=o.root.replace(Sr,""),A={dot:a,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},g=n.unignore.length>0,$=g?yt(n.unignore,A):void 0,_=g?Ve(n.unignore,A):void 0,R=yt(n.match,{...A,ignore:n.ignore,onIgnore:$?w=>$(w.output)&&yt.constants.UNIGNORE:void 0}),L=yt(n.ignore,A),H=Ve(n.match,A),d=Ye(r,y,s),E=s?d:Ye(r,y,!0),l=n.match.length>0&&n.match.every(w=>w==="**"||w==="**/*"),T=n.ignore.length>0||g||!l?(w,x)=>{const D=E(x,!0);return D==="."||_&&_(D)?!1:!H(D)||L(D)}:void 0;let C;t.deep!==void 0&&(C=Math.round(t.deep-o.depthOffset));const S=new on({filters:[u?(w,x)=>{const D=d(w,x),G=R(D);return G&&se(`matched ${D}`),G}:(w,x)=>{const D=d(w,x);return R(D)}],exclude:u&&T?(w,x)=>{const D=T(w,x);return se(`${D?"skipped":"crawling"} ${x}`),D}:T,fs:t.fs,pathSeparator:"/",relativePaths:!s,resolvePaths:s,includeBasePath:s,resolveSymlinks:m,excludeSymlinks:!m,excludeFiles:h,includeDirs:h||!t.onlyFiles,maxDepth:C,signal:t.signal}).crawl(y);return t.debug&&se("internal properties:",{...o,root:y}),[S,r!==y&&!s&&pn(r,y)]}function xn(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}const tr={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Sn(t){const e=Object.assign({},t);for(const r in tr)e[r]===void 0&&Object.assign(e,{[r]:tr[r]});return e.cwd=(e.cwd instanceof URL?lo(e.cwd):yr(e.cwd||process.cwd())).replace(Sr,"/"),e.ignore=Rr(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||so,readdirSync:e.fs.readdirSync||ro,realpath:e.fs.realpath||eo,realpathSync:e.fs.realpathSync||to,stat:e.fs.stat||Js,statSync:e.fs.statSync||Ys}),e.debug&&se("globbing with options:",e),e}function wn(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const o=nn(t)||typeof t=="string",n=Rr((r=o?t:t.patterns)!==null&&r!==void 0?r:"**/*"),s=Sn(o?e:t);return n.length>0?An(s,n):[]}async function gu(t,e){const[r,o]=wn(t,e);return r?xn(await r.withPromise(),o):[]}var Ae,er;function Tn(){if(er)return Ae;er=1;/*!
2
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
3
- *
4
- * Copyright (c) 2014-2016, Jon Schlinkert.
5
- * Licensed under the MIT License.
6
- */return Ae=function(t){if(typeof t!="string"||t==="")return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(e[2])return!0;t=t.slice(e.index+e[0].length)}return!1},Ae}var xe,rr;function _r(){if(rr)return xe;rr=1;/*!
7
- * is-glob <https://github.com/jonschlinkert/is-glob>
8
- *
9
- * Copyright (c) 2014-2017, Jon Schlinkert.
10
- * Released under the MIT License.
11
- */var t=Tn(),e={"{":"}","(":")","[":"]"},r=function(n){if(n[0]==="!")return!0;for(var s=0,i=-2,u=-2,a=-2,m=-2,h=-2;s<n.length;){if(n[s]==="*"||n[s+1]==="?"&&/[\].+)]/.test(n[s])||u!==-1&&n[s]==="["&&n[s+1]!=="]"&&(u<s&&(u=n.indexOf("]",s)),u>s&&(h===-1||h>u||(h=n.indexOf("\\",s),h===-1||h>u)))||a!==-1&&n[s]==="{"&&n[s+1]!=="}"&&(a=n.indexOf("}",s),a>s&&(h=n.indexOf("\\",s),h===-1||h>a))||m!==-1&&n[s]==="("&&n[s+1]==="?"&&/[:!=]/.test(n[s+2])&&n[s+3]!==")"&&(m=n.indexOf(")",s),m>s&&(h=n.indexOf("\\",s),h===-1||h>m))||i!==-1&&n[s]==="("&&n[s+1]!=="|"&&(i<s&&(i=n.indexOf("|",s)),i!==-1&&n[i+1]!==")"&&(m=n.indexOf(")",i),m>i&&(h=n.indexOf("\\",i),h===-1||h>m))))return!0;if(n[s]==="\\"){var y=n[s+1];s+=2;var A=e[y];if(A){var g=n.indexOf(A,s);g!==-1&&(s=g+1)}if(n[s]==="!")return!0}else s++}return!1},o=function(n){if(n[0]==="!")return!0;for(var s=0;s<n.length;){if(/[*?{}()[\]]/.test(n[s]))return!0;if(n[s]==="\\"){var i=n[s+1];s+=2;var u=e[i];if(u){var a=n.indexOf(u,s);a!==-1&&(s=a+1)}if(n[s]==="!")return!0}else s++}return!1};return xe=function(n,s){if(typeof n!="string"||n==="")return!1;if(t(n))return!0;var i=r;return s&&s.strict===!1&&(i=o),i(n)},xe}const Rn=B(import.meta.url),Pt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kr=t=>{if(typeof Pt<"u"&&Pt.versions&&Pt.versions.node){const[e,r]=Pt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Pt.getBuiltinModule(t)}return Rn(t)},_n=kr("path"),kn=kr("os");var Se,sr;function Cn(){if(sr)return Se;sr=1;var t=_r(),e=_n.posix.dirname,r=kn.platform()==="win32",o="/",n=/\\/g,s=/\\([!*?|[\](){}])/g;Se=function(a,m){var h=Object.assign({flipBackslashes:!0},m);h.flipBackslashes&&r&&a.indexOf(o)<0&&(a=a.replace(n,o)),i(a)&&(a+=o),a+="a";do a=e(a);while(u(a));return a.replace(s,"$1")};function i(a){var m=a.slice(-1),h;switch(m){case"}":h="{";break;case"]":h="[";break;default:return!1}var y=a.indexOf(h);return y<0?!1:a.slice(y+1,-1).includes(o)}function u(a){return/\([^()]+$/.test(a)||a[0]==="{"||a[0]==="["||/[^\\][{[]/.test(a)?!0:t(a)}return Se}var On=Cn();Oe(On);const Nn=B(import.meta.url),It=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ln=t=>{if(typeof It<"u"&&It.versions&&It.versions.node){const[e,r]=It.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return It.getBuiltinModule(t)}return Nn(t)},{access:Hn}=Ln("node:fs/promises");async function du(t,e=ke){pt(t),t=ct(t);try{return await Hn(t,e),!0}catch{return!1}}const Bn=B(import.meta.url),Ft=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mn=t=>{if(typeof Ft<"u"&&Ft.versions&&Ft.versions.node){const[e,r]=Ft.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ft.getBuiltinModule(t)}return Bn(t)},{accessSync:Dn}=Mn("node:fs");function _e(t,e=ke){pt(t),t=ct(t);try{return Dn(t,e),!0}catch{return!1}}var Pn=_r();Oe(Pn);const In=B(import.meta.url),Gt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Cr=t=>{if(typeof Gt<"u"&&Gt.versions&&Gt.versions.node){const[e,r]=Gt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Gt.getBuiltinModule(t)}return In(t)};Cr("node:fs/promises");Cr("node:fs");let Fn=class extends Error{constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}},Gn=class extends Error{constructor(e){super(`EPERM: Operation not permitted, ${e}`)}get code(){return"EPERM"}set code(e){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(e){throw new Error("Cannot overwrite name of PermissionError")}};const Or=(t,e)=>{const r=t?.code;return r==="ENOENT"?new Fn(`no such file or directory, open '${e}'`):r==="EACCES"||r==="EPERM"?new Gn(`unable to read the non-readable file: ${e}`):t},Un=B(import.meta.url),Ut=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nr=t=>{if(typeof Ut<"u"&&Ut.versions&&Ut.versions.node){const[e,r]=Ut.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ut.getBuiltinModule(t)}return Un(t)},{readFile:jn}=Nr("node:fs/promises"),{unzip:zn,brotliDecompress:Wn}=Nr("node:zlib"),qn={brotli:Wn,gzip:zn,none:(t,e)=>{e(null,t)}},bu=async(t,e)=>{pt(t),t=ct(t);const{buffer:r,compression:o,encoding:n,flag:s}=e??{};let i;try{i=await jn(t,s?{flag:s}:{})}catch(u){throw Or(u,t)}return await new Promise((u,a)=>{qn[o??"none"](i,(m,h)=>{m?a(m):u(r?h:h.toString(n??"utf8"))})})},Xn=B(import.meta.url),jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lr=t=>{if(typeof jt<"u"&&jt.versions&&jt.versions.node){const[e,r]=jt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return jt.getBuiltinModule(t)}return Xn(t)},{readFileSync:Kn}=Lr("node:fs"),{unzipSync:Qn,brotliDecompressSync:Zn}=Lr("node:zlib"),Vn={brotli:Zn,gzip:Qn,none:t=>t},$u=(t,e)=>{pt(t),t=ct(t);const{buffer:r,compression:o,encoding:n,flag:s}=e??{};let i;try{i=Kn(t,s?{flag:s}:{})}catch(m){throw Or(m,t)}const u=Vn[o??"none"],a=u(i);return r?a:a.toString(n??"utf8")},Yn=B(import.meta.url),zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jn=t=>{if(typeof zt<"u"&&zt.versions&&zt.versions.node){const[e,r]=zt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return zt.getBuiltinModule(t)}return Yn(t)},{createRequire:Hr}=Jn("node:module"),ti=globalThis.process??Object.create(null),or={versions:{}},nr=new Proxy(ti,{get(t,e){if(e in t)return t[e];if(e in or)return or[e]}}),ei=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
12
- `),ri=(t,e,r,o)=>{const n={column:0,line:-1,...t.start},s={...n,...t.end},i=n.line,u=n.column,a=s.line,m=s.column;let h=Math.max(i-(r+1),0),y=Math.min(e.length,a+o);i===-1&&(h=0),a===-1&&(y=e.length);const A=a-i,g={};if(A)for(let $=0;$<=A;$++){const _=$+i;if(!u)g[_]=!0;else if($===0){const R=e[_-1]?.length;g[_]=[u,(R??0)-u+1]}else if($===A)g[_]=[0,m];else{const R=e[_-$]?.length;g[_]=[0,R]}}else u===m?g[i]=u?[u,0]:!0:g[i]=[u,(m??0)-(u??0)];return{end:y,markerLines:g,start:h}},si=nr.platform==="win32"&&!nr.env?.WT_SESSION?">":"❯",vu=(t,e,r)=>{const o={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:$=>$,marker:$=>$,message:$=>$,...r?.color}},n=typeof e.start.column=="number";let s=(t.includes("\r")?ei(t):t).split(`
13
- `);typeof o.tabWidth=="number"&&t.includes(" ")&&(s=s.map($=>$.replaceAll(" "," ".repeat(o.tabWidth))));const{end:i,markerLines:u,start:a}=ri(e,s,o.linesAbove,o.linesBelow),m=String(i).length,{gutter:h,marker:y,message:A}=o.color;let g=s.slice(a,i).map(($,_)=>{const R=a+1+_,L=u[R],H=String(R).padStart(m),d=!u[R+1],E=` ${H}${o.showGutter?" |":""}`;if(L){let l="";if(Array.isArray(L)){const T=$.replaceAll(/[^\t]/g," ").slice(0,Math.max(L[0]-1,0)),C=L[1]||1;l=[`
14
- `,o.prefix+h(E.replaceAll(/\d/g," "))," ",T,y("^").repeat(C)].join(""),d&&o.message&&(l+=` ${A(o.message)}`)}return[o.prefix+y(si),h(E),$.length>0?` ${$}`:"",l].join("")}return`${o.prefix} ${h(E)}${$.length>0?` ${$}`:""}`}).join(`
15
- `);return o.message&&!n&&(g=`${o.prefix+" ".repeat(m+1)+o.message}
16
- ${g}`),g},ir=(t,e)=>{let r=0,o=e.length-2;for(;r<o;){const n=r+(o-r>>1);if(t<e[n])o=n-1;else if(t>=e[n+1])r=n+1;else{r=n;break}}return r},oi=/\n|\r(?!\n)/,ni=t=>t.split(oi).reduce((e,r)=>(e.push(e.at(-1)+r.length+1),e),[0]),Eu=(t,e,r)=>{if(!Array.isArray(t)&&typeof t!="string"||(typeof t=="string"||Array.isArray(t))&&t.length===0)return{column:0,line:0};if(typeof e!="number"||typeof t=="string"&&e>=t.length||Array.isArray(t)&&e+1>=t.at(-1))return{column:0,line:0};if(typeof t=="string"){const n=ni(t),s=ir(e,n);return{column:e-n[s]+1,line:s+1}}const o=ir(e,t);return{column:e-t[o]+1,line:o+1}},ii=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&ii.set("AggregateError",AggregateError);const ui=Hr(import.meta.url),Wt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,li=t=>{if(typeof Wt<"u"&&Wt.versions&&Wt.versions.node){const[e,r]=Wt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Wt.getBuiltinModule(t)}return ui(t)};li("node:util");const ai=Hr(import.meta.url),qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=t=>{if(typeof qt<"u"&&qt.versions&&qt.versions.node){const[e,r]=qt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return qt.getBuiltinModule(t)}return ai(t)};Ne("node:fs");Ne("node:path");Ne("node:url");let Au=class extends Error{fileName;codeFrame;name="JSONError";#t;constructor(e){super(),this.#t=e}get message(){return`${this.#t}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
17
-
18
- ${this.codeFrame}
19
- `:""}`}set message(e){this.#t=e}};const ci=t=>{const e={force:!0,recursive:!0};return t?.maxRetries!==void 0&&(e.maxRetries=t.maxRetries),t?.retryDelay!==void 0&&(e.retryDelay=t.retryDelay),e},pi=B(import.meta.url),Xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Br=t=>{if(typeof Xt<"u"&&Xt.versions&&Xt.versions.node){const[e,r]=Xt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Xt.getBuiltinModule(t)}return pi(t)};Br("node:fs");Br("node:fs/promises");const fi=B(import.meta.url),Kt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hi=t=>{if(typeof Kt<"u"&&Kt.versions&&Kt.versions.node){const[e,r]=Kt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Kt.getBuiltinModule(t)}return fi(t)};hi("node:fs");const gi=B(import.meta.url),Qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,di=t=>{if(typeof Qt<"u"&&Qt.versions&&Qt.versions.node){const[e,r]=Qt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Qt.getBuiltinModule(t)}return gi(t)};di("node:fs/promises");const yi=B(import.meta.url),Zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mi=t=>{if(typeof Zt<"u"&&Zt.versions&&Zt.versions.node){const[e,r]=Zt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Zt.getBuiltinModule(t)}return yi(t)},{rmSync:bi}=mi("node:fs"),Su=(t,e={})=>{pt(t),bi(t,ci(e))};B(import.meta.url);const $i=t=>{if(typeof t!="string"&&!(t instanceof ArrayBuffer)&&!ArrayBuffer.isView(t))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},vi=B(import.meta.url),Vt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ei=t=>{if(typeof Vt<"u"&&Vt.versions&&Vt.versions.node){const[e,r]=Vt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Vt.getBuiltinModule(t)}return vi(t)},{randomBytes:Ai}=Ei("node:crypto"),xi=t=>`${t}.${process.pid.toString(36)}.${Ai(6).toString("hex")}.tmp`,Si=new TextEncoder,wi=t=>{if(t instanceof Uint8Array)return t;if(typeof t=="string")return Si.encode(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t)){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(e)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},Ti=B(import.meta.url),Yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ri=t=>{if(typeof Yt<"u"&&Yt.versions&&Yt.versions.node){const[e,r]=Yt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Yt.getBuiltinModule(t)}return Ti(t)};Ri("node:fs/promises");const _i=B(import.meta.url),Jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ki=t=>{if(typeof Jt<"u"&&Jt.versions&&Jt.versions.node){const[e,r]=Jt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Jt.getBuiltinModule(t)}return _i(t)},{mkdirSync:Ci,writeFileSync:Oi,statSync:Ni,renameSync:ur,chownSync:Li,chmodSync:Hi,unlinkSync:Bi}=ki("node:fs"),Mi=(t,e,r)=>{r={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},pt(t),$i(e),t=ct(t);const o=_e(t,ke);if(o&&!r.overwrite)throw new us(`file already exists, open '${t}'`);const n=xi(t);try{!o&&r.recursive&&Ci(Ce(t),{recursive:!0});let s;if(Oi(n,typeof e=="string"?Buffer.from(e,r.encoding??"utf8"):wi(e),{flag:"wx"}),o&&r.backup&&(s=Ni(t),r.chown??={gid:s.gid,uid:s.uid},ur(t,`${t}.bak`)),r.chown)try{Li(n,r.chown.uid,r.chown.gid)}catch{}Hi(n,s&&!r.mode?s.mode:r.mode??438),ur(n,t)}catch(s){throw new Error(`Failed to write file at: ${t} - ${s.message}`,{cause:s})}finally{_e(n)&&Bi(n)}},Di=/^(?:( )+|\t+)/,ne="space";function lr(t,e,r){return t&&e===ne&&r===1}function ar(t,e){const r=new Map;let o=0,n,s;for(const i of t.split(/\n/g)){if(!i)continue;const u=i.match(Di);if(u===null)o=0,n="";else{const a=u[0].length,m=u[1]?ne:"tab";if(lr(e,m,a))continue;m!==n&&(o=0),n=m;let h=1,y=0;const A=a-o;if(o=a,A===0)h=0,y=1;else{const $=Math.abs(A);if(lr(e,m,$))continue;s=Pi(m,$)}const g=r.get(s);r.set(s,g===void 0?[1,0]:[g[0]+h,g[1]+y])}}return r}function Pi(t,e){return(t===ne?"s":"t")+String(e)}function Ii(t){const e=t[0]==="s"?ne:"tab",r=Number(t.slice(1));return{type:e,amount:r}}function Fi(t){let e,r=0,o=0;for(const[n,[s,i]]of t)(s>r||s===r&&i>o)&&(r=s,o=i,e=n);return e}function Gi(t,e){return(t===ne?" ":" ").repeat(e)}function Ui(t){if(typeof t!="string")throw new TypeError("Expected a string");let e=ar(t,!0);e.size===0&&(e=ar(t,!1));const r=Fi(e);let o,n=0,s="";return r!==void 0&&({type:o,amount:n}=Ii(r),s=Gi(o,n)),{amount:n,type:o,indent:s}}const ji=B(import.meta.url),te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zi=t=>{if(typeof te<"u"&&te.versions&&te.versions.node){const[e,r]=te.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return te.getBuiltinModule(t)}return ji(t)};zi("node:fs/promises");const Wi=B(import.meta.url),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qi=t=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[e,r]=ee.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ee.getBuiltinModule(t)}return Wi(t)},{readFileSync:Xi}=qi("node:fs"),wu=(t,e,r={})=>{const{detectIndent:o,indent:n,replacer:s,stringify:i=JSON.stringify,...u}={indent:" ",...r};let a=n,m=`
20
- `;if(_e(t,Gr))try{const y=Xi(t,"utf8");if(o){const{indent:A}=Ui(y);a=A}m=y.endsWith(`
21
- `)?`
22
- `:""}catch(y){if(y.code!=="ENOENT")throw y}const h=i(e,s,a);Mi(t,`${h}${m}`,u)},Ki=B(import.meta.url),re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Le=t=>{if(typeof re<"u"&&re.versions&&re.versions.node){const[e,r]=re.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return re.getBuiltinModule(t)}return Ki(t)},Qi=Le("fs"),Zi=Le("os"),Vi=Le("path");var we={},cr;function Yi(){if(cr)return we;cr=1;var t=Object.defineProperty,e=(h,y)=>t(h,"name",{value:y,configurable:!0}),r=Qi,o=Zi,n=Vi;const s=e(h=>{let y="";for(let A=0;A<h.length;A+=1){const g=h[A],$=g.toUpperCase();y+=g===$?g.toLowerCase():$}return y},"invertCase"),i=new Map,u=e((h,y)=>{const A=n.join(h,`.is-fs-case-sensitive-test-${process.pid}`);try{return y.writeFileSync(A,""),!y.existsSync(s(A))}finally{try{y.unlinkSync(A)}catch{}}},"checkDirectoryCaseWithWrite"),a=e((h,y,A)=>{try{return u(h,A)}catch(g){if(y===void 0)return u(o.tmpdir(),A);throw g}},"checkDirectoryCaseWithFallback"),m=e((h,y=r,A=!0)=>{const g=h??process.cwd();if(A&&i.has(g))return i.get(g);let $;const _=s(g);return _!==g&&y.existsSync(g)?$=!y.existsSync(_):$=a(g,h,y),A&&i.set(g,$),$},"isFsCaseSensitive");return we.isFsCaseSensitive=m,we}var Ji=Yi();const Tu=Ji.isFsCaseSensitive;export{bt as A,vt as B,pu as F,Ce as H,Ps as I,hr as J,ct as L,wu as O,Mi as T,vu as U,gu as W,lu as a,du as b,bu as c,uu as d,Fn as e,_e as f,ce as g,nu as h,eu as i,Yr as j,Tu as k,Su as l,Zr as m,ru as o,Au as s,$u as v,su as w,ou as y,Eu as z};
@@ -1 +0,0 @@
1
- import{createRequire as b}from"node:module";import{f as w,a as T,m}from"./index-BVuCxe14.js";import{s as j}from"./index-BAUIIRZJ.js";import{g as S}from"./env-Cpxa_7UE.js";import{a as C}from"./readJsonSync-DuMMeB3s-Cx08VBQg.js";const h=b(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,s]=u.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return u.getBuiltinModule(t)}return h(t)},{rmSync:p,writeFileSync:_}=k("node:fs"),f=3,R=1800*1e3,U=15e3,g=()=>m(S(),"packuments"),y=t=>m(g(),`${encodeURIComponent(t)}.json`),$=t=>{const e=y(t);if(w(e))try{const s=C(e);if(s.cacheVersion!==f){p(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){p(e,{force:!0});return}return s.packument}catch{p(e,{force:!0});return}},z=(t,e,s)=>{T(g());const n={cacheVersion:f,createdAt:Date.now(),packument:e,ttlMs:s};_(y(t),JSON.stringify(n),"utf8")},F=t=>{const e={},s=t.versions??{};for(const[c,r]of Object.entries(s)){const i=r.dist,o={version:c};if(r._npmUser!==void 0&&(o._npmUser=r._npmUser),r.maintainers!==void 0&&(o.maintainers=r.maintainers),r.bin!==void 0&&(o.bin=r.bin),i!==void 0){const a={};i.signatures!==void 0&&(a.signatures=i.signatures),i.attestations!==void 0&&(a.attestations=i.attestations),typeof i.integrity=="string"&&(a.integrity=i.integrity),typeof i.tarball=="string"&&(a.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(a.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(a.fileCount=i.fileCount),o.dist=a}r.repository!==void 0&&(o.repository=r.repository),r.license!==void 0&&(o.license=r.license),typeof r.readme=="string"&&(o.readme=r.readme),typeof r.readmeFilename=="string"&&(o.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(o.private=r.private),typeof r.deprecated=="string"&&(o.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(o.scripts=r.scripts),e[c]=o}const n={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(n["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(n.time=t.time),typeof t.readme=="string"&&(n.readme=t.readme),n},M=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},A=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:n}=await import("../packem_chunks/catalog.js").then(o=>o.a3),c=n(e.workspaceRoot),{token:r,url:i}=s(t,c);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},P=async(t,e={})=>{const s=e.cacheTtlMs??R,n=$(t);if(n!==void 0)return n;if(e.offline)return;const c=await A(t,e),r=`${c.url.endsWith("/")?c.url.slice(0,-1):c.url}/${t.replace("/","%2f")}`,i=new AbortController,o=setTimeout(()=>{i.abort()},U),a=()=>{i.abort()};e.signal?.addEventListener("abort",a,{once:!0});try{const d=await fetch(r,{headers:M(c.authToken),signal:i.signal});if(d.status===404)return;if(!d.ok)throw new Error(`Registry returned ${String(d.status)} for ${t}`);const v=await d.json(),l=F(v);return z(t,l,s),l}finally{clearTimeout(o),e.signal?.removeEventListener("abort",a)}},q=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const n=t["dist-tags"]?.[e];return n!==void 0?n:Object.hasOwn(t.versions,e)?e:j.maxSatisfying(s,e)??void 0};export{P as g,q as r};
@@ -1 +0,0 @@
1
- import{createRequire as g}from"node:module";import{f as l,m,a as v}from"./index-BVuCxe14.js";import{g as b}from"./env-Cpxa_7UE.js";import{a as j}from"./readJsonSync-DuMMeB3s-Cx08VBQg.js";const h=g(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return h(e)},{rmSync:u,writeFileSync:k}=_("node:fs"),C=1440*60*1e3,R=15e3,w="https://registry.npmjs.org/-/npm/v1/keys",p=()=>m(b(),"registry-keys"),i=()=>m(p(),"npmjs.json"),A=()=>{const e=i();if(l(e))try{const t=j(e),r=Date.now()-t.createdAt>t.ttlMs;return{entry:t,expired:r}}catch{u(e,{force:!0});return}},M=(e,t)=>{v(p());const r={createdAt:Date.now(),keys:e,ttlMs:t};k(i(),JSON.stringify(r),"utf8")},q=async(e={})=>{const t=e.ttlMs??C,r=e.keysUrl??process.env.VIS_NPM_KEYS_URL??w,s=A();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,d=setTimeout(()=>{n.abort()},R),a=()=>{n.abort()};e.signal?.addEventListener("abort",a,{once:!0});try{const c=await fetch(r,{headers:{Accept:"application/json"},signal:n.signal});if(!c.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const y=await c.json(),f=Array.isArray(y.keys)?y.keys:[];return M(f,t),{fromCache:!1,keys:f}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(d),e.signal?.removeEventListener("abort",a)}},x=()=>{const e=i();return l(e)?(u(e,{force:!0}),!0):!1};export{x as c,q as f};
@@ -1 +0,0 @@
1
- const l=o=>"Deno"in o,n=o=>"Bun"in o,i=()=>{if(l(globalThis)){const o=globalThis.Deno,e=o.execPath();let s=e;try{const{importMeta:r}=globalThis;r?.url&&(s=r.url)}catch{}return[e,s,...o.args]}return n(globalThis)?globalThis.Bun.process.argv:process.argv},a=()=>l(globalThis)?globalThis.Deno.cwd():n(globalThis)?globalThis.Bun.process.cwd():process.cwd(),t=()=>{if(l(globalThis)){const o=globalThis.Deno;return new Proxy(o.env.toObject(),{get:(e,s)=>typeof s=="string"?o.env.get(s):e[s],has:(e,s)=>typeof s=="string"?o.env.has(s):s in e,set:(e,s,r)=>typeof s=="string"?(r===void 0||o.env.set(s,r),!0):!1})}return n(globalThis)?globalThis.Bun.process.env:process.env},h=()=>l(globalThis)?[]:n(globalThis)?globalThis.Bun.process.execArgv:process.execArgv,c=()=>l(globalThis)?globalThis.Deno.execPath():n(globalThis)?globalThis.Bun.process.execPath:process.execPath,g=()=>{if(l(globalThis)){const o=globalThis.Deno.build?.os??"unknown";return o==="windows"?"win32":o}return n(globalThis)?globalThis.Bun.platform??"unknown":process.platform},b=()=>{if(l(globalThis)){const o=globalThis.Deno.build?.arch??"unknown";return o==="x86_64"?"x64":o==="aarch64"?"arm64":o}return n(globalThis)?globalThis.Bun.process.arch:process.arch},T=(o=0)=>{if(l(globalThis))throw globalThis.Deno.exit(o),new Error("Deno exit failed");if(n(globalThis))throw globalThis.Bun.process.exit(o),new Error("Bun exit failed");process.exit(o)},u=(o,e)=>{if(l(globalThis))return()=>{};if(n(globalThis)){try{const r=globalThis.Bun;if(r.process?.on)return r.process.on(o,e),()=>{r.process?.removeListener&&r.process.removeListener(o,e)}}catch{}return()=>{}}const s=process;return s.on(o,e),()=>{s.removeListener(o,e)}};export{a,b,h as c,g,c as h,i,T as p,t,u};
@@ -1 +0,0 @@
1
- import{createRequire as K}from"node:module";import{V,s as A}from"./index.server-J83sowC4.js";import{f as _,a as j,m as $}from"./index-BVuCxe14.js";import{g as x}from"./env-Cpxa_7UE.js";import{m as p,D as g}from"./provenance-CI_WQx7G.js";import{g as b}from"./packument-CYxvm590.js";import{i as w}from"../packem_chunks/cli-main.js";import{a as O}from"./readJsonSync-DuMMeB3s-Cx08VBQg.js";import{s as v}from"./index-BAUIIRZJ.js";const X=K(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=r=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,t]=M.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return M.getBuiltinModule(r)}return X(r)},{rmSync:k,writeFileSync:E}=T("node:fs"),{createHash:Y}=T("node:crypto"),{Resolver:Q}=T("node:dns/promises");class Ye{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const Qe=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(V(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${V("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${A("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(A(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${A("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${A("→")} ${s.suggestedAction}`)}return e},Ze=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),Z=1440*60*1e3,ee=15e3,re="https://api.github.com/repos",B=()=>$(x(),"archived-repo"),H=(r,e)=>$(B(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),te=(r,e)=>{const t=H(r,e);if(_(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){k(t,{force:!0});return}return n}catch{k(t,{force:!0});return}},W=(r,e,t,n)=>{j(B());const s={createdAt:Date.now(),ttlMs:n,...t};E(H(r,e),JSON.stringify(s),"utf8")},ne=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},se=async(r,e,t,n)=>{const s=`${re}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,c=new AbortController,o=setTimeout(()=>{c.abort()},ee),i=()=>{c.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const d=await fetch(s,{headers:a,signal:c.signal});if(d.status===404)return{kind:"missing"};if(!d.ok)return{kind:"transient-error"};const l=await d.json(),u=l.archived===!0,f=typeof l.archived_at=="string"?l.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},ie=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),er=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??Z,s=e.githubToken??process.env.GITHUB_TOKEN,c=e.concurrency??g,o=new Map,i=async(a,d)=>{const l=`${a}/${d}`;let u=o.get(l);return u===void 0&&(u=(async()=>{const f=te(a,d);if(f!==void 0)return f.missing===!0?{archived:!1,kind:"missing"}:{archived:f.archived,archivedAt:f.archivedAt,kind:"ok"};const m=await se(a,d,s,e.signal);return m.kind==="missing"?W(a,d,{archived:!1,missing:!0},n):m.kind==="ok"&&W(a,d,{archived:m.archived===!0,archivedAt:m.archivedAt},n),m})(),o.set(l,u)),u};return(await p(r,c,async({name:a,version:d})=>{if(t.has(a))return;const l=await b(a,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;const u=l.versions[d]??l.versions[ie(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return;const f=ne(u.repository?.url);if(f===void 0)return;const m=await i(f.owner,f.repo);if(m.kind!=="transient-error"){if(m.kind==="missing")return{kind:"missing-repo",owner:f.owner,packageName:a,repo:f.repo};if(m.archived===!0)return{...m.archivedAt===void 0?{}:{archivedAt:m.archivedAt},kind:"archived",owner:f.owner,packageName:a,repo:f.repo}}})).filter(a=>a!==void 0)},oe={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},ae=1440*60*1e3,U=(r,e)=>(r-e)/ae,R=r=>{if(r!==void 0)return r.email??r.name},ce=(r,e,t,n,s)=>{const c=r.time?.[t];if(c===void 0)return;const o=new Date(c).getTime();if(!Number.isFinite(o))return;const i=U(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},de=(r,e,t,n,s)=>{const c=r.versions[t],o=R(c?._npmUser);if(o===void 0)return;const i=Object.keys(r.versions).filter(u=>v.valid(u)!==null).filter(u=>v.lt(u,t));if(i.length===0||i.some(u=>R(r.versions[u]?._npmUser)===o))return;const a=r.time?.[i[0]??""];if(a===void 0)return;const d=new Date(a).getTime();if(!Number.isFinite(d))return;const l=U(n,d);if(!(l<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${l.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},le=(r,e,t,n,s)=>{const c=r.versions[t],o=R(c?._npmUser);if(o===void 0)return;const i=[];for(const[l,u]of Object.entries(r.versions)){if(l===t||R(u._npmUser)!==o)continue;const f=r.time?.[l];if(f===void 0)continue;const m=new Date(f).getTime();Number.isFinite(m)&&i.push(m)}if(i.length===0)return;const a=Math.max(...i),d=U(n,a);if(d>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(d>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},rr=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...oe,...e.thresholds},s=e.now??(()=>Date.now()),c=e.concurrency??g;return(await p(r,c,async({name:o,version:i})=>{if(t.has(o))return[];const a=await b(o,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(a===void 0)return[];const d=s(),l=[],u=ce(a,o,i,d,n);u!==void 0&&l.push(u);const f=de(a,o,i,d,n);f!==void 0&&l.push(f);const m=le(a,o,i,d,n);return m!==void 0&&l.push(m),l})).flat()},ue=1440*60*1e3,fe=15e3,me=20,he=1e4,ve="https://api.npmjs.org/downloads/point/last-month",J=()=>$(x(),"downloads"),q=r=>$(J(),`${encodeURIComponent(r)}.json`),pe=r=>{const e=q(r);if(_(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){k(e,{force:!0});return}return t.downloads}catch{k(e,{force:!0});return}},ge=(r,e,t)=>{j(J());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};E(q(r),JSON.stringify(n),"utf8")},we=async(r,e)=>{const t=`${ve}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},fe),c=()=>{n.abort()};e?.addEventListener("abort",c,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",c)}},tr=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??me,s=e.warnThreshold??he,c=e.cacheTtlMs??ue,o=e.concurrency??g;return(await p(r,o,async i=>{if(t.has(i))return;let a=pe(i);if(a===void 0){const d=await we(i,e.signal);if(d.kind==="no-data"||d.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:i,severity:"warning"};a=d.downloads??0,ge(i,a,c)}if(a<n)return{downloadsLastMonth:a,kind:"below-error",packageName:i,severity:"error"};if(a<s)return{downloadsLastMonth:a,kind:"below-warning",packageName:i,severity:"warning"}})).filter(i=>i!==void 0)},ye=1440*60*1e3,ke=4e3,$e=["1.1.1.1","8.8.8.8"],z=()=>$(x(),"expired-domains"),G=r=>{const e=Y("sha256").update(r).digest("hex").slice(0,12);return $(z(),`${e}.json`)},be=r=>{const e=G(r);if(_(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){k(e,{force:!0});return}return t}catch{k(e,{force:!0});return}},Me=(r,e,t)=>{j(z());const n={createdAt:Date.now(),outcome:e,ttlMs:t};E(G(r),JSON.stringify(n),"utf8")},De=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},Ae=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Re=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Ne=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},Se=async(r,e,t)=>{try{const n=await Re(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Ne(n)?{kind:"expired"}:{kind:"transient-error"}}},Te=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),nr=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(u=>u.toLowerCase())),s=e.cacheTtlMs??ye,c=e.perDomainTimeoutMs??ke,o=e.dnsServers??$e,i=e.concurrency??g,a=e.createResolver===void 0?new Q:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const d=new Map,l=async u=>{let f=d.get(u);return f===void 0&&(f=(async()=>{const m=be(u);if(m!==void 0)return{kind:m.outcome==="ok"?"ok":"expired"};const h=await Se(a,u,c);return h.kind!=="transient-error"&&Me(u,h.kind,s),h})(),d.set(u,f)),f};return(await p(r,i,async({name:u,version:f})=>{if(t.has(u))return[];const m=await b(u,{workspaceRoot:e.workspaceRoot});if(m===void 0)return[];const h=m.versions[f]??m.versions[Te(Object.keys(m.versions),m["dist-tags"]?.latest)??""];if(h===void 0)return[];const N=Ae(h.maintainers,h._npmUser),C=new Set,S=[];for(const D of N){const y=De(D.email);if(y===void 0||n.has(y))continue;const F=`${y}:${D.email??""}`;if(C.has(F))continue;C.add(F);const L=await l(y);L.kind==="expired"?S.push({domain:y,kind:"expired",maintainer:D.email??"",packageName:u,severity:"error"}):L.kind==="transient-error"&&S.push({domain:y,kind:"unresolved",maintainer:D.email??"",packageName:u,severity:"warning"})}return S})).flat()},Ee=["readme","license","repo"],_e=["ERROR: No README data found!","# Security holding package"],je=r=>{const e=r.trim();return e===""?!0:_e.some(t=>e.startsWith(t))},xe=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Oe=(r,e)=>{const t=xe(r,e);if(t===void 0)return"missing-readme";if(je(t))return"placeholder-readme"},Ue=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Ce=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},Fe=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},sr=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??Ee),s=e.concurrency??g;return(await p(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await b(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o]??i.versions[Fe(i)??""];if(a===void 0||a.private===!0)return;const d=[];if(n.has("readme")){const l=Oe(i,a);l!==void 0&&d.push(l)}if(n.has("license")){const l=Ue(a);l!==void 0&&d.push(l)}if(n.has("repo")){const l=Ce(a);l!==void 0&&d.push(l)}if(d.length!==0)return{issues:d,packageName:c,version:o}})).filter(c=>c!==void 0)},I=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},Le=(r,e)=>v.valid(e)?Object.keys(r.versions).filter(t=>v.valid(t)!==null&&v.lt(t,e)).sort((t,n)=>v.lt(t,n)?1:-1)[0]:void 0,ir=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??g;return(await p(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await b(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o];if(a===void 0)return;const d=Le(i,o);if(d===void 0)return;const l=i.versions[d];if(l===void 0)return;const u=I(a.bin,c),f=I(l.bin,c),m=Object.entries(u).filter(([h])=>!(h in f)).filter(([h])=>!n.has(h)).map(([h,N])=>({command:N,name:h}));if(m.length!==0)return{fromVersion:d,newBins:m,packageName:c,toVersion:o}})).filter(c=>c!==void 0)},Ve=["preinstall","install","postinstall"],P=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,We=(r,e)=>{if(v.valid(e)!==null)return Object.keys(r.versions).filter(t=>v.valid(t)!==null&&v.prerelease(t)===null&&v.lt(t,e)).sort((t,n)=>v.lt(t,n)?1:-1)[0]},Ie=(r,e)=>{const t=r??{},n=e??{},s=[];for(const c of Ve){const o=t[c];if(o===void 0||o==="")continue;const i=n[c];i===void 0||i===""?s.push({command:o,hook:c,kind:"introduced"}):i!==o&&s.push({command:o,hook:c,kind:"changed"})}return s},or=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??g;return(await p(r,n,async({name:s,version:c})=>{if(t.has(s))return;const o=await b(s,{workspaceRoot:e.workspaceRoot});if(o?.versions[c]===void 0)return;const i=We(o,c);if(i===void 0||!P(o,i)||P(o,c))return;const a=Ie(o.versions[c]?.scripts,o.versions[i]?.scripts);if(a.length!==0)return{hookChanges:a,packageName:s,priorVersion:i,trustSignal:"provenance-dropped",version:c}})).filter(s=>s!==void 0)};export{Ye as M,or as a,ir as b,sr as c,tr as d,nr as e,er as f,Ze as g,Qe as h,rr as r};
@@ -1,2 +0,0 @@
1
- import{createRequire as _}from"node:module";import{E as h,s as y,I as $,V as T}from"./index.server-J83sowC4.js";import{m as r,n as l,i as a,$ as k,d as j}from"../packem_chunks/catalog.js";import"./env-Cpxa_7UE.js";import{I as S}from"./index-B0EsgdzO.js";import{S as u}from"../packem_chunks/cli-main.js";import{o as v}from"./spinner-DuJJvFTl.js";import{D as x,W as C,T as R,C as I}from"./symbols-DPTlrJ3B.js";const B=_(import.meta.url),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const b=({rows:i})=>r.jsx(l,{flexDirection:"column",children:i.map(t=>{let s;switch(t.status){case"error":{s=r.jsx(a,{color:"red",children:I});break}case"ok":{s=r.jsx(a,{color:"green",children:R});break}case"running":{s=r.jsx(a,{color:"white",children:r.jsx(v,{type:"dots"})});break}case"warn":{s=r.jsx(a,{color:"yellow",children:C});break}default:{s=r.jsx(a,{dimColor:!0,children:x});break}}return r.jsxs(l,{children:[r.jsx(l,{width:3,children:s}),r.jsx(l,{flexGrow:1,children:r.jsx(a,{children:t.label})}),t.summary?r.jsx(l,{children:r.jsxs(a,{dimColor:!0,children:[x," ",t.summary]})}):null]},t.id)})}),E={error:T(u.failure),ok:$(u.success),pending:h(u.dash),skip:h(u.dash),warn:y(u.warning)},M=(i,t,s)=>{const p=s?`${i} ${h(`— ${s}`)}`:i;return` ${E[t]} ${p}
2
- `},H=(i,t={})=>{const s=t.stream??process.stderr,p=typeof s.isTTY=="boolean"&&s.isTTY&&!S,w=t.live??p,o=new Map;for(const e of i)o.set(e.id,{id:e.id,label:e.label,status:"pending"});if(!w||i.length===0)return{finish:(e,n,d)=>{const c=o.get(e);c&&(o.set(e,{...c,status:n,summary:d}),s.write(M(c.label,n,d)))},start:e=>{const n=o.get(e);n&&o.set(e,{...n,status:"running"})},stop:()=>{}};const g=()=>i.map(e=>o.get(e.id));let m=k(j.createElement(b,{rows:g()}),{interactive:!0,patchConsole:!1});const f=()=>{m?.rerender(j.createElement(b,{rows:g()}))};return{finish:(e,n,d)=>{const c=o.get(e);c&&(o.set(e,{...c,status:n,summary:d}),f())},start:e=>{const n=o.get(e);n&&(o.set(e,{...n,status:"running"}),f())},stop:()=>{m&&(f(),m.unmount(),m=void 0)}}};export{H as s};
@@ -1 +0,0 @@
1
- import{createRequire as u}from"node:module";import{r as t,Y as c}from"../packem_chunks/catalog.js";import"./env-Cpxa_7UE.js";const f=u(import.meta.url),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const d=(o,i)=>{const r=t.useRef(null),[s,n]=t.useState(o);return t.useLayoutEffect(()=>{if(!r.current)return;const{height:e}=c(r.current);e>0&&e!==s&&(n(e),i?.(e))}),{measuredHeight:s,ref:r}};export{d as u};
@@ -1 +0,0 @@
1
- import{createRequire as g}from"node:module";import{m as i,f as a,v as d}from"./index-BVuCxe14.js";import"./public-api-WqUCiyIe.js";import{u as j}from"../packem_chunks/ts-loader.js";const h=g(import.meta.url),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=c=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[s,o]=p.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return p.getBuiltinModule(c)}return h(c)},{readdirSync:m}=u("node:fs"),b=[".husky/pre-commit",".vis/hooks/pre-commit",".git/hooks/pre-commit"],v=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],$=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],w=c=>{const s=i(c,"package.json");if(!a(s))return[];let o;try{o=JSON.parse(d(s))}catch{return[]}const e=[];if(o.scripts)for(const[t,n]of Object.entries(o.scripts))typeof n=="string"&&(/\bgitleaks\b/.test(n)&&e.push({detail:`Script "${t}" still invokes gitleaks: ${n}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(n)&&e.push({detail:`Script "${t}" still invokes secretlint: ${n}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(n)&&e.push({detail:`Script "${t}" still invokes syncpack: ${n}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(n)&&e.push({detail:`Script "${t}" still invokes sherif: ${n}`,kind:"script",location:"package.json",tool:"sherif"}));if(o.devDependencies)for(const t of Object.keys(o.devDependencies))(t==="gitleaks"||t==="@gitleaks/cli")&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(t==="secretlint"||t.startsWith("@secretlint/"))&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),t==="syncpack"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),t==="sherif"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return o.sherif&&e.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),e},_=c=>{const s=[];for(const o of b){const e=i(c,o);if(!a(e))continue;const t=d(e);/\bgitleaks\b/.test(t)&&s.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:o,tool:"gitleaks"}),/\bsecretlint\b/.test(t)&&s.push({detail:"secretlint invocation still present in hook",kind:"hook",location:o,tool:"secretlint"}),/\bsyncpack\b/.test(t)&&s.push({detail:"syncpack invocation still present in hook",kind:"hook",location:o,tool:"syncpack"}),/\bsherif\b/.test(t)&&s.push({detail:"sherif invocation still present in hook",kind:"hook",location:o,tool:"sherif"})}return s},D=c=>{const s=[];for(const o of v)a(i(c,o))&&s.push({detail:"secretlint config should be removed after migration",kind:"config",location:o,tool:"secretlint"});for(const o of $)a(i(c,o))&&s.push({detail:"syncpack config should be removed after migration",kind:"config",location:o,tool:"syncpack"});return s},S=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],O=c=>{const s=[],o=e=>{const t=i(c,e);if(!a(t))return;const n=d(t);/\bsyncpack\b/.test(n)&&s.push({detail:"syncpack invocation still present in CI",kind:"ci",location:e,tool:"syncpack"}),/\bsherif\b/.test(n)&&s.push({detail:"sherif invocation still present in CI",kind:"ci",location:e,tool:"sherif"})};for(const e of S){const t=i(c,e);if(a(t)){if(e===".github/workflows"){try{for(const n of m(t))(n.endsWith(".yml")||n.endsWith(".yaml"))&&o(`.github/workflows/${n}`)}catch{}continue}o(e)}}return s},M=c=>{const s=[],o=i(c,"pnpm-workspace.yaml");if(a(o)){let t;try{t=j(o)}catch{t=void 0}if(t&&typeof t=="object"){const n=t.catalog;n&&typeof n.syncpack=="string"&&s.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const l=t.catalogs;if(l&&typeof l=="object")for(const[k,r]of Object.entries(l))r&&typeof r.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${k}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const e=i(c,"package.json");if(a(e)){let t;try{t=JSON.parse(d(e))}catch{return s}const n=t.workspaces;if(n&&typeof n=="object"&&!Array.isArray(n)){const k=n.catalog;k&&typeof k.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const r=n.catalogs;if(r&&typeof r=="object")for(const[y,f]of Object.entries(r))f&&typeof f.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${y}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const l=t.catalog;l&&typeof l.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return s},N=c=>[...w(c),..._(c),...D(c),...O(c),...M(c)],A=(c,s)=>{const o=N(c);if(o.length===0)return s.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];s.warn(`Found ${String(o.length)} unmigrated reference(s):`);for(const e of o)s.warn(` [${e.kind}] ${e.location} — ${e.detail}`);return o};export{N as s,A as v};
@@ -1 +0,0 @@
1
- import{m as e,n as l,i as r,r as g}from"../packem_chunks/catalog.js";import{o as je}from"./spinner-DuJJvFTl.js";import{I as ae,J as ge,_ as me,K as fe,y as ye,M as _,Q as ne}from"../packem_chunks/cli-main.js";import{B as ue}from"./env-Cpxa_7UE.js";import{F as we,a as Ce}from"./tabs-CgxCvjCY.js";import{u as ke}from"./use-measured-height-Drobr4fe.js";const Ve=({current:a,total:t})=>{const{columns:i}=ae(),s=i||80,d=t>0?Math.min(1,a/t):0,h=`${String(Math.round(d*100)).padStart(3)}%`,f=`${String(a)}/${String(t)}`,y=Math.max(10,s-2-h.length-1),p=Math.round(y*d),j=y-p;return e.jsxs(l,{flexDirection:"column",paddingX:1,children:[e.jsxs(l,{children:[e.jsx(je,{type:"dots"}),e.jsx(r,{children:" Checking catalog dependencies "}),e.jsx(r,{dimColor:!0,children:f})]}),e.jsxs(l,{children:[e.jsx(r,{color:"cyan",children:"━".repeat(p)}),e.jsx(r,{dimColor:!0,children:"─".repeat(j)}),e.jsxs(r,{dimColor:!0,children:[" ",h]})]})]})},J=["default","name","updateType","severity"],ce=a=>{const t=a.vulnerabilities?.map(i=>i.severity)??[];return t.includes("CRITICAL")?4:t.includes("HIGH")?3:t.includes("MODERATE")?2:t.includes("LOW")?1:0},de={digest:0,major:3,minor:2,patch:1,pin:0,unknown:0},he=(a,t)=>{if(t==="default")return a;const i=[...a];return t==="name"?i.sort((s,d)=>s.packageName.localeCompare(d.packageName)):t==="updateType"?i.sort((s,d)=>(de[d.updateType]??0)-(de[s.updateType]??0)||s.packageName.localeCompare(d.packageName)):i.sort((s,d)=>ce(d)-ce(s)||s.packageName.localeCompare(d.packageName)),i},Z=a=>`${a.ecosystem}|${a.file}:${String(a.line)}|${a.name}`,A=a=>`${a.catalogName} ${a.packageName}`,Y=a=>{const t=new Map;for(const i of a){const s=t.get(i.catalogName);s?s.push(i):t.set(i.catalogName,[i])}return t},G=(a,t,i)=>{let s=a;if(t!=="all"&&(s=t==="security"?s.filter(d=>d.vulnerabilities&&d.vulnerabilities.length>0||d.socketReport&&d.socketReport.alerts.length>0):s.filter(d=>d.updateType===t)),i){const d=i.toLowerCase();s=s.filter(h=>h.packageName.toLowerCase().includes(d))}return s};class qe{#e;#l=new Set;#t;#s;#i=null;constructor(t,i=null,s=[]){this.#t=t,this.#s=s,i&&(this.#i=new Map(i.recommendations.map(d=>[d.package,d]))),this.#e={aiResult:i,allChecked:!0,applyProgress:null,checkedEcosystemKeys:new Set(s.map(d=>Z(d))),checkedEntries:new Set(t.map(d=>A(d))),ecosystemEntries:s,entries:t,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:Y(t),phase:"browsing",selectedIndex:0,sortMode:"default"}}getSnapshot=()=>this.#e;subscribe=t=>(this.#l.add(t),()=>{this.#l.delete(t)});getFilteredEntries(){return he(G(this.#t,this.#e.filterType,this.#e.filterText),this.#e.sortMode)}setSortMode(t){if(t===this.#e.sortMode)return;const i=this.getFilteredEntries()[this.#e.selectedIndex]?.packageName,s=he(G(this.#t,this.#e.filterType,this.#e.filterText),t),d=i?Math.max(0,s.findIndex(h=>h.packageName===i)):0;this.#r({...this.#e,selectedIndex:d,sortMode:t})}cycleSortMode(){const t=J.indexOf(this.#e.sortMode),i=J[(t+1)%J.length]??"default";this.setSortMode(i)}getRecommendation(t){return this.#i?.get(t)}getCheckedEntries(){return this.#t.filter(t=>this.#e.checkedEntries.has(A(t)))}getCheckedEcosystemEntries(){return this.#s.filter(t=>this.#e.checkedEcosystemKeys.has(Z(t)))}toggleEcosystemCheck(t){const i=new Set(this.#e.checkedEcosystemKeys);i.has(t)?i.delete(t):i.add(t),this.#r({...this.#e,checkedEcosystemKeys:i})}checkAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set(this.#s.map(t=>Z(t)))})}uncheckAllEcosystem(){this.#r({...this.#e,checkedEcosystemKeys:new Set})}setSelectedIndex(t){const i=this.getFilteredEntries(),s=Math.max(0,Math.min(t,i.length-1));s!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:s})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:t})}setFilterType(t){if(t!==this.#e.filterType){const i=G(this.#t,t,this.#e.filterText);this.#r({...this.#e,entries:i,filterType:t,groupedByCatalog:Y(i),selectedIndex:0})}}setFilter(t){const i=G(this.#t,this.#e.filterType,t);this.#r({...this.#e,entries:i,filterText:t,groupedByCatalog:Y(i),selectedIndex:0})}setFilterActive(t){if(t!==this.#e.filterActive)if(t)this.#r({...this.#e,filterActive:!0});else{const i=G(this.#t,this.#e.filterType,"");this.#r({...this.#e,entries:i,filterActive:!1,filterText:"",groupedByCatalog:Y(i),selectedIndex:0})}}toggleCheck(t){const i=A(t),s=new Set(this.#e.checkedEntries);s.has(i)?s.delete(i):s.add(i),this.#r({...this.#e,allChecked:s.size===this.#t.length,checkedEntries:s})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#t.map(t=>A(t)))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const t=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:t.length},phase:"applying"})}updateApplyProgress(t){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:t}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(t){this.#r({...this.#e,error:t,phase:"error"})}#r(t){this.#e=t;for(const i of this.#l)try{i()}catch{}}}const be={major:"red",minor:"yellow",patch:"green"},Te={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Se={critical:"red",high:"red",low:"gray",medium:"yellow"},Ee={critical:"red",high:"red",low:"green",medium:"yellow"},ve={defer:"gray",review:"yellow",skip:"red",update:"green"},Re=({changelogUrl:a,entry:t,focused:i,recommendation:s,scrollRef:d})=>{const h=i?"white":"gray";if(!t)return e.jsx(l,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:e.jsx(r,{dimColor:!0,children:"No package selected"})});const f=be[t.updateType]??"white",y=t.vulnerabilities&&t.vulnerabilities.length>0,p=t.socketReport?.score.overall??0,j=t.socketReport?ue(p):"gray";return e.jsxs(l,{borderColor:h,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsx(l,{flexShrink:0,paddingTop:1,paddingX:2,children:e.jsx(r,{bold:!0,color:"white",children:t.displayName??t.packageName})}),e.jsxs(ge,{flexGrow:1,flexShrink:1,paddingX:2,ref:d,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[e.jsx(r,{}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Current:"})}),e.jsx(r,{children:t.currentRange})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Target:"})}),e.jsx(r,{children:t.newRange}),e.jsxs(r,{bold:!0,color:f,children:[" ","(",t.updateType,")"]})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:"Version:"})}),e.jsx(r,{children:t.targetVersion})]}),e.jsxs(l,{children:[e.jsx(l,{width:12,children:e.jsx(r,{dimColor:!0,children:t.kind==="ecosystem"?"Source:":"Catalog:"})}),e.jsx(r,{color:t.kind==="ecosystem"?"cyan":void 0,children:t.catalogName})]}),t.acceptedRisk&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{color:"gray",children:"── "}),e.jsx(r,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),e.jsxs(l,{flexDirection:"column",paddingLeft:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Reason: "}),e.jsx(r,{children:t.acceptedRisk.reason})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Accepted: "}),e.jsx(r,{children:t.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),y&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"red",children:"SECURITY"}),e.jsx(r,{}),t.vulnerabilities.map(n=>e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{gap:1,children:[e.jsxs(r,{bold:!0,color:Te[n.severity]??"gray",children:["⚠"," ",n.severity]}),e.jsx(r,{bold:!0,children:n.id})]}),e.jsx(l,{paddingLeft:2,children:e.jsx(r,{children:n.summary})}),e.jsxs(l,{gap:2,paddingLeft:2,children:[n.cvssScore!==void 0&&e.jsxs(r,{dimColor:!0,children:["CVSS:",String(n.cvssScore)]}),n.fixedVersions.length>0&&e.jsxs(r,{dimColor:!0,children:["Fixed in:",n.fixedVersions.join(", ")]})]})]},n.id))]}),t.socketReport&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),e.jsx(r,{}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Overall: "}),e.jsxs(r,{bold:!0,color:j,children:[String(Math.round(p*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Supply Chain: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.supplyChain*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Quality: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.quality*100)),"%"]})]})]}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Maintenance: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.maintenance*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Vulnerability: "}),e.jsxs(r,{children:[String(Math.round(t.socketReport.score.vulnerability*100)),"%"]})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"License: "}),e.jsxs(r,{children:[t.socketReport.license||"unknown"," ","(",String(Math.round(t.socketReport.score.license*100)),"%)"]})]})]}),t.socketReport.alerts.length>0&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsxs(r,{bold:!0,color:"yellow",children:["⚠"," ",String(t.socketReport.alerts.length)," ","alert",t.socketReport.alerts.length===1?"":"s",":"]}),t.socketReport.alerts.map(n=>e.jsxs(l,{gap:1,paddingLeft:2,children:[e.jsxs(r,{bold:!0,color:Se[n.severity]??"gray",children:["[",n.severity.toUpperCase(),"]"]}),e.jsx(r,{children:n.type}),e.jsxs(r,{dimColor:!0,children:["(",n.category,")"]})]},n.key))]})]}),s&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"AI ANALYSIS"}),e.jsx(r,{}),e.jsxs(l,{gap:2,children:[e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Action: "}),e.jsx(r,{bold:!0,color:ve[s.action]??"white",children:s.action})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Risk: "}),e.jsx(r,{bold:!0,color:Ee[s.riskLevel]??"white",children:s.riskLevel})]}),e.jsxs(l,{children:[e.jsx(r,{dimColor:!0,children:"Effort: "}),e.jsx(r,{bold:!0,children:s.effort})]})]}),s.reason&&e.jsx(l,{marginTop:1,paddingLeft:2,children:e.jsx(r,{children:s.reason})}),s.breakingChanges.length>0&&e.jsxs(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[e.jsx(r,{bold:!0,color:"yellow",children:"Breaking changes:"}),s.breakingChanges.map((n,I)=>e.jsxs(r,{children:[" ","•"," ",n]},String(I)))]})]}),a&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"CHANGELOG"}),e.jsx(l,{marginTop:1,paddingLeft:2,children:e.jsx(r,{color:"cyan",underline:!0,children:a})})]}),e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"LINKS"}),e.jsx(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:t.kind==="ecosystem"?e.jsx(r,{color:"cyan",underline:!0,children:t.detailUrl??t.displayName??t.packageName}):e.jsxs(r,{color:"cyan",underline:!0,children:["https://npmx.dev/",t.packageName]})})]}),!s&&t.kind!=="ecosystem"&&e.jsxs(l,{flexDirection:"column",marginTop:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"GUIDANCE"}),e.jsxs(l,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[t.updateType==="major"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),e.jsx(r,{dimColor:!0,children:" Review the changelog before updating."}),e.jsx(r,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),t.updateType==="minor"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),e.jsx(r,{dimColor:!0,children:" Generally safe to update."})]}),t.updateType==="patch"&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),e.jsx(r,{dimColor:!0,children:" Safe to update."})]}),!s&&e.jsx(r,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},Ae={major:"red",minor:"yellow",patch:"green"},Ie=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],De=({checked:a,entry:t,isSelected:i})=>{const s=Ae[t.updateType]??"white",d=t.vulnerabilities&&t.vulnerabilities.length>0,h=t.socketReport&&t.socketReport.alerts.length>0,f=!!t.acceptedRisk,y=a?"☑":"☐",p=t.socketReport?`${String(Math.round(t.socketReport.score.overall*100))}%`:"",j=t.socketReport?ue(t.socketReport.score.overall):"gray";return e.jsxs(l,{flexShrink:0,height:1,children:[e.jsx(r,{children:i?">":" "}),e.jsxs(r,{color:a?"white":"gray",children:[" ",y," "]}),d||h?e.jsx(r,{color:f?"gray":"red",children:f?"✓ ":"⚠ "}):e.jsx(r,{children:" "}),e.jsx(l,{flexGrow:1,children:e.jsxs(r,{bold:i,inverse:i,wrap:"truncate",children:[t.displayName??t.packageName,f?" [ack]":""]})}),p&&e.jsxs(r,{color:j,children:[" ",p]}),e.jsxs(r,{dimColor:!0,children:[" ",t.currentRange]}),e.jsxs(r,{dimColor:!0,children:[" ","→"," "]}),e.jsxs(r,{children:[t.newRange," "]}),e.jsx(r,{bold:!0,color:s,children:t.updateType})]})},Me=({count:a,ecosystem:t=!1,name:i})=>e.jsxs(l,{flexShrink:0,height:1,marginTop:1,children:[e.jsxs(r,{color:t?"cyan":void 0,dimColor:!t,children:[t?"◈":"▼"," "]}),e.jsx(r,{bold:!0,color:t?"cyan":"white",children:i.toUpperCase()}),e.jsxs(r,{dimColor:!0,children:[" ","(",a,")"]}),t&&e.jsxs(r,{color:"cyan",dimColor:!0,children:[" ","ci/cd refs"]})]}),Ne=({checkedEntries:a,entries:t,filterActive:i,filteredOutCount:s,filterText:d,filterType:h,focused:f,groupedByCatalog:y,isDryRun:p,onViewportHeightChange:j,scrollOffset:n,selectedIndex:I,totalCatalogEntries:D,totalChecked:E,totalEntries:H,viewportHeight:L})=>{const F=f?"white":"gray",{measuredHeight:m,ref:v}=ke(L,j);let P=0,S=0,M=0,R=0;for(const x of t)x.updateType==="major"?P++:x.updateType==="minor"?S++:M++,(x.vulnerabilities&&x.vulnerabilities.length>0||x.socketReport&&x.socketReport.alerts.length>0)&&R++;const C=[];P>0&&C.push(`${P} major`),S>0&&C.push(`${S} minor`),M>0&&C.push(`${M} patch`),R>0&&C.push(`${R} vulnerable`);const N=C.length>0?` (${C.join(", ")})`:"",w=t.filter(x=>x.kind==="ecosystem").length,k=t.length-w;let $=0;for(const x of t)a.has(A(x))&&$++;const O=[];let U=0;for(const[x,b]of y){O.push(e.jsx(Me,{count:b.length,ecosystem:b[0]?.kind==="ecosystem",name:x},`hdr-${x}`));for(const T of b){const W=U;O.push(e.jsx(De,{checked:a.has(A(T)),entry:T,isSelected:W===I},A(T))),U++}}let B=0;for(const[,x]of y)B+=2+x.length;const V=B>m&&m>0;return e.jsxs(l,{borderColor:F,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[e.jsxs(l,{flexShrink:0,gap:1,paddingX:1,children:[e.jsx(r,{bold:!0,inverse:!0,children:" VIS "}),e.jsxs(r,{wrap:"truncate",children:[w>0?k:H,E>0?`/${E}`:""," ",w>0?"pkgs":"outdated",N,D>E?` · ${D-E} dupes`:""]}),w>0&&e.jsxs(r,{color:"cyan",children:[" ","◈",w," ","ci/cd"]}),!p&&$>0&&e.jsxs(r,{dimColor:!0,children:[" ","—",$," ","selected"]})]}),e.jsx(l,{flexShrink:0,paddingX:1,paddingY:1,children:e.jsx(we,{isFocused:f,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:()=>{},showIndex:!1,value:h,children:Ie.map(({id:x,label:b})=>e.jsx(Ce,{name:x,children:b},x))})}),i&&e.jsxs(l,{flexShrink:0,paddingX:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/ "}),e.jsx(r,{children:d}),e.jsx(r,{inverse:!0,children:" "})]}),s>0&&e.jsx(l,{flexShrink:0,paddingX:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",s," ","package",s===1?"":"s"," ","filtered out by target constraint — press"," ",e.jsx(r,{bold:!0,color:"white",children:"f"})," ","to view"]})}),e.jsxs(l,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:v,children:[e.jsx(l,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:e.jsx(l,{flexDirection:"column",marginTop:-n,children:O})}),V&&e.jsx(l,{flexShrink:0,marginLeft:1,marginRight:1,children:e.jsx(me,{contentHeight:B,placement:"inset",scrollOffset:n,style:"block",viewportHeight:m})})]},`list-${h}-${d}`)]})},Be=100,Le=40,Fe=10,Pe=[],K=["all","major","minor","patch","security"],Xe=({autoExitSeconds:a=0,changelogUrls:t,checkedCount:i=0,filteredOutEntries:s=Pe,isDryRun:d,store:h,totalCatalogEntries:f=0})=>{const{exit:y}=fe(),{columns:p,rows:j}=ae(),n=g.useSyncExternalStore(h.subscribe,h.getSnapshot),[I,D]=g.useState(!1),[E,H]=g.useState(!1),L=g.useRef(null),F=g.useRef(null),m=g.useRef(null),v=g.useRef(null),[P,S]=g.useState(0),[M,R]=g.useState(!1),[C,N]=g.useState(!1),w=g.useMemo(()=>h.getFilteredEntries(),[n.entries,n.filterType,n.filterText,n.sortMode]),k=w[n.selectedIndex]??null,$=k?h.getRecommendation(k.packageName):void 0,O=k&&t?t.get(k.packageName):void 0,U=g.useCallback(o=>{let c=0,u=0;for(const[,Q]of n.groupedByCatalog){c+=2;for(let oe=0;oe<Q.length;oe++){if(u===o)return c;c+=1,u++}}return c},[n.groupedByCatalog]),B=Math.max(1,j-8-(n.filterActive?1:0)),[V,x]=g.useState(B),b=V>0?V:B,T=g.useCallback(o=>{const c=U(o);S(u=>c>u+b-2?Math.max(0,c-b+2):c<u+1?Math.max(0,c-1):u)},[U,b]);if(g.useEffect(()=>{m.current?.scrollToTop()},[k?.packageName]),ye((o,c)=>{if(o==="c"&&c.ctrl){y();return}if(!C){if(E){c.escape||o==="f"||o==="q"?H(!1):c.downArrow||o==="j"?F.current?.scrollBy(1):(c.upArrow||o==="k")&&F.current?.scrollBy(-1);return}if(M){o==="u"||c.return?(R(!1),h.startApply(),y(h.getCheckedEntries())):c.escape||o==="q"?R(!1):c.downArrow||o==="j"?v.current?.scrollBy(1):c.upArrow||o==="k"?v.current?.scrollBy(-1):c.pageDown?v.current?.scrollBy(5):c.pageUp&&v.current?.scrollBy(-5);return}if(I){c.escape||o==="?"?D(!1):o==="q"?(D(!1),N(!0)):c.downArrow||o==="j"?L.current?.scrollBy(1):(c.upArrow||o==="k")&&L.current?.scrollBy(-1);return}if(o==="?"){D(!0);return}if(o==="q"){N(!0);return}if(c.tab){h.setFocusedPanel(n.focusedPanel==="list"?"detail":"list");return}if(n.focusedPanel==="list"&&(c.leftArrow||c.rightArrow)){const u=K.indexOf(n.filterType),Q=c.rightArrow?(u+1)%K.length:(u-1+K.length)%K.length;S(0),m.current?.scrollToTop(),h.setFilterType(K[Q]);return}if(o==="f"&&s.length>0){H(u=>!u);return}if(n.filterActive){if(c.escape){h.setFilterActive(!1);return}if(c.return){h.setFilterActive(!1);return}if(c.backspace){S(0),h.setFilter(n.filterText.slice(0,-1));return}if(o&&!c.ctrl&&!c.meta){S(0),h.setFilter(n.filterText+o);return}return}if(n.focusedPanel==="list"){if(c.downArrow||o==="j"){const u=Math.min(n.selectedIndex+1,w.length-1);h.setSelectedIndex(u),T(u);return}if(c.upArrow||o==="k"){const u=Math.max(n.selectedIndex-1,0);h.setSelectedIndex(u),T(u);return}if(c.pageDown){const u=Math.min(n.selectedIndex+10,w.length-1);h.setSelectedIndex(u),T(u);return}if(c.pageUp){const u=Math.max(n.selectedIndex-10,0);h.setSelectedIndex(u),T(u);return}if(c.home){h.setSelectedIndex(0),S(0);return}if(c.end){const u=w.length-1;h.setSelectedIndex(u),T(u);return}if(o===" "||c.return){k&&h.toggleCheck(k);return}if(o==="a"){h.toggleAll();return}if(o==="s"){h.cycleSortMode(),T(h.getSnapshot().selectedIndex);return}if(o==="/"){h.setFilterActive(!0);return}if(o==="u"&&!d&&n.checkedEntries.size>0){R(!0);return}if(c.rightArrow){h.setFocusedPanel("detail");return}return}if(n.focusedPanel==="detail"){if(c.escape||c.leftArrow){h.setFocusedPanel("list");return}if(c.downArrow||o==="j"){m.current?.scrollBy(1);return}if(c.upArrow||o==="k"){m.current?.scrollBy(-1);return}if(c.pageDown){m.current?.scrollBy(10);return}if(c.pageUp){m.current?.scrollBy(-10);return}if(c.home){m.current?.scrollToTop();return}c.end&&m.current?.scrollToBottom()}}},{isActive:!0}),p<Le||j<Fe)return e.jsx(l,{alignItems:"center",height:j,justifyContent:"center",width:p,children:e.jsxs(r,{color:"yellow",children:["Terminal too small (",p,"x",j,")"]})});const W=p>=Be,q=[e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"q"}),e.jsx(r,{dimColor:!0,children:"QUIT"})]},"q"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"?"}),e.jsx(r,{dimColor:!0,children:"HELP"})]},"?"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"}),e.jsx(r,{dimColor:!0,children:"NAV"})]},"nav"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Space"}),e.jsx(r,{dimColor:!0,children:"CHECK"})]},"sp"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"a"}),e.jsx(r,{dimColor:!0,children:"ALL"})]},"a")];!d&&n.checkedEntries.size>0&&q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"green",children:"u"}),e.jsx(r,{dimColor:!0,children:"APPLY"})]},"u")),s.length>0&&q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"yellow",children:"f"}),e.jsxs(r,{dimColor:!0,children:["FILTERED (",s.length,")"]})]},"fo")),q.push(e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"←→"}),e.jsx(r,{dimColor:!0,children:"FILTER"})]},"lr"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"/"}),e.jsx(r,{dimColor:!0,children:"SEARCH"})]},"f"),e.jsxs(l,{gap:1,children:[e.jsx(r,{bold:!0,color:"white",children:"Tab"}),e.jsx(r,{dimColor:!0,children:"PANEL"})]},"t"));const ee=e.jsx(l,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:e.jsx(l,{flexWrap:"wrap",gap:2,paddingX:1,children:q})}),re=e.jsxs(_,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"?"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:L,title:"KEYBOARD SHORTCUTS",visible:I,width:52,children:[e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),e.jsxs(l,{children:[e.jsx(l,{width:24,children:e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↑","/k"]}),e.jsx(r,{dimColor:!0,children:" Move up"})]})}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","↓","/j"]}),e.jsx(r,{dimColor:!0,children:" Move down"})]})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Tab"]}),e.jsx(r,{dimColor:!0,children:" Switch panel"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","→","/","←"]}),e.jsx(r,{dimColor:!0,children:" Focus detail/list"})]})]}),e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"SELECTION"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","Space"]}),e.jsx(r,{dimColor:!0,children:" Toggle check on package"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","a"]}),e.jsx(r,{dimColor:!0,children:" Toggle check all"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","s"]}),e.jsx(r,{dimColor:!0,children:" Cycle sort (default / name / type / severity)"})]})]}),e.jsxs(l,{flexDirection:"column",marginBottom:1,children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"FILTERS"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","←→"]}),e.jsx(r,{dimColor:!0,children:" Switch filter tab"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","/"]}),e.jsx(r,{dimColor:!0,children:" Text filter"})]}),s.length>0&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","f"]}),e.jsx(r,{dimColor:!0,children:" View filtered-out packages"})]})]}),e.jsxs(l,{flexDirection:"column",children:[e.jsxs(l,{marginBottom:1,children:[e.jsx(r,{dimColor:!0,children:"── "}),e.jsx(r,{bold:!0,color:"white",children:"ACTIONS"})]}),!d&&e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","u"]}),e.jsx(r,{dimColor:!0,children:" Apply selected updates"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","q"]}),e.jsx(r,{dimColor:!0,children:" Quit"})]}),e.jsxs(r,{children:[e.jsxs(r,{bold:!0,color:"white",children:[" ","?"]}),e.jsx(r,{dimColor:!0,children:" Toggle help"})]})]})]}),X=h.getCheckedEntries(),z=X.filter(o=>o.updateType==="major").length,xe=e.jsxs(l,{alignItems:"center",flexDirection:"column",children:[z>0&&e.jsx(l,{marginBottom:1,marginTop:1,children:e.jsxs(r,{color:"yellow",children:["⚠"," ",z," ","major update",z===1?"":"s"," ","— review breaking changes"]})}),e.jsxs(r,{dimColor:!0,children:["Press"," ",e.jsx(r,{bold:!0,color:"white",children:"u"})," ","or"," ",e.jsx(r,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),te=e.jsx(_,{footer:xe,scrollRef:v,title:`Apply ${X.length} update${X.length===1?"":"s"}?`,visible:M,width:70,children:X.map(o=>e.jsxs(l,{gap:1,children:[e.jsxs(r,{children:[" ",o.displayName??o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))}),le=s.length>0?e.jsx(_,{footer:e.jsxs(r,{dimColor:!0,children:[e.jsx(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",e.jsx(r,{bold:!0,color:"white",children:"f"}),"/",e.jsx(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:F,title:`${s.length} PACKAGE${s.length===1?"":"S"} FILTERED BY TARGET`,visible:E,width:70,children:e.jsxs(l,{flexDirection:"column",children:[e.jsx(l,{marginBottom:1,children:e.jsxs(r,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",e.jsx(r,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),s.map(o=>e.jsxs(l,{gap:1,children:[e.jsxs(r,{children:[" ",o.packageName]}),e.jsxs(r,{dimColor:!0,children:[o.currentRange," ","→"," ",o.newRange]}),e.jsx(r,{bold:!0,color:o.updateType==="major"?"red":o.updateType==="minor"?"yellow":"green",children:o.updateType})]},o.packageName))]})}):null,se=e.jsx(Ne,{checkedEntries:n.checkedEntries,entries:w,filterActive:n.filterActive,filteredOutCount:s.length,filterText:n.filterText,filterType:n.filterType,focused:n.focusedPanel==="list",groupedByCatalog:n.groupedByCatalog,isDryRun:d,onViewportHeightChange:x,scrollOffset:P,selectedIndex:n.selectedIndex,totalCatalogEntries:f,totalChecked:i,totalEntries:w.length,viewportHeight:b}),ie=e.jsx(Re,{changelogUrl:O,entry:k,focused:n.focusedPanel==="detail",recommendation:$,scrollRef:m});if(W){const o=Math.floor(p*.35);return e.jsxs(l,{flexDirection:"column",height:j,width:p,children:[e.jsxs(l,{flexDirection:"row",flexGrow:1,children:[e.jsx(l,{flexGrow:1,children:se}),e.jsx(l,{width:o,children:ie})]}),ee,te,le,e.jsx(ne,{autoExitSeconds:a||3,onCancel:()=>{N(!1)},visible:C}),re]})}const pe=Math.floor(j*.55);return e.jsxs(l,{flexDirection:"column",height:j,width:p,children:[e.jsx(l,{height:pe,children:se}),e.jsx(l,{flexGrow:1,children:ie}),ee,te,le,e.jsx(ne,{autoExitSeconds:a||3,onCancel:()=>{N(!1)},visible:C}),re]})};export{qe as U,Xe as b,Z as e,Ve as u};