sliccy 6.162.0 → 6.162.2

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 (119) hide show
  1. package/dist/ui/.vite/manifest.json +171 -171
  2. package/dist/ui/assets/{account-store-D-2d-wgE.js → account-store-BTnettEj.js} +1 -1
  3. package/dist/ui/assets/{account-store-BwJF_V2e.js → account-store-Sk5UDEo6.js} +1 -1
  4. package/dist/ui/assets/{adobe-CwwqYoOU.js → adobe-BCa4KDD7.js} +1 -1
  5. package/dist/ui/assets/{adobe-CjbAgmPl.js → adobe-DOpgBqBG.js} +1 -1
  6. package/dist/ui/assets/{agent-bridge-BVKW1qEQ.js → agent-bridge-B4uuTZmj.js} +1 -1
  7. package/dist/ui/assets/{agent-panels-CgbsDe7X.js → agent-panels-DDdDdmZs.js} +1 -1
  8. package/dist/ui/assets/{apply-layout-DwcfGHFm.js → apply-layout-DHWEDHF_.js} +1 -1
  9. package/dist/ui/assets/{apps-DevRtS09.js → apps-wZ3-bkZW.js} +1 -1
  10. package/dist/ui/assets/{azure-openai-JgQOdxTB.js → azure-openai-BysAog0J.js} +1 -1
  11. package/dist/ui/assets/{azure-openai-BliiJJ3h.js → azure-openai-D3whGm5u.js} +1 -1
  12. package/dist/ui/assets/{backend-hostfs-BeGMZ35g.js → backend-hostfs-zL9x1f7S.js} +1 -1
  13. package/dist/ui/assets/{budget-usage-source-DtWNqYUy.js → budget-usage-source-BoAqOZIN.js} +1 -1
  14. package/dist/ui/assets/{cdp-Bt4Tc7Bs.js → cdp-DSKwtHPM.js} +1 -1
  15. package/dist/ui/assets/{cerebras-B22qDyni.js → cerebras-BI2a9ROv.js} +1 -1
  16. package/dist/ui/assets/{cerebras-CjBby1u2.js → cerebras-Dqcrt7Aq.js} +1 -1
  17. package/dist/ui/assets/{composer-speech-BYeMN2uA.js → composer-speech-CIH3Fy9C.js} +1 -1
  18. package/dist/ui/assets/{connect-surface-CHdfpKbm.js → connect-surface-BOchc2DI.js} +1 -1
  19. package/dist/ui/assets/{directed-approval-DgyI3qOn.js → directed-approval-4q2MgZBA.js} +1 -1
  20. package/dist/ui/assets/{ensure-speech-assets-B3Nm2ohf.js → ensure-speech-assets-DjpK4rMz.js} +1 -1
  21. package/dist/ui/assets/{fs-CAQbIrYC.js → fs-DVCrh9Uh.js} +1 -1
  22. package/dist/ui/assets/{fs-CCWZwfa6.js → fs-DYCpHCsx.js} +2 -2
  23. package/dist/ui/assets/{github-CUN_AUAu.js → github-B66PAjmH.js} +2 -2
  24. package/dist/ui/assets/{github-DqE3SYB2.js → github-CZJWU4J-.js} +1 -1
  25. package/dist/ui/assets/{github-auth-E8mpeEdU.js → github-auth-hHO45d89.js} +1 -1
  26. package/dist/ui/assets/{github-copilot-BuEa5EIS.js → github-copilot-DbhYmOMT.js} +1 -1
  27. package/dist/ui/assets/{github-copilot-u9f-sT4d.js → github-copilot-dk9F5Txq.js} +1 -1
  28. package/dist/ui/assets/{github-install-BO46TS1H.js → github-install-DLABucPY.js} +1 -1
  29. package/dist/ui/assets/{github-zip-DeYRWuaP.js → github-zip-Dl4FpHW9.js} +1 -1
  30. package/dist/ui/assets/{hear-Ow1sQFnW.js → hear-fqS0ovJt.js} +1 -1
  31. package/dist/ui/assets/{help-7-ZCR2Cf.js → help-DwEjFjUu.js} +1 -1
  32. package/dist/ui/assets/{installer-DoomA9a4.js → installer-Bx3wzcu7.js} +1 -1
  33. package/dist/ui/assets/{js-realm-worker-DRvMA0wv.js → js-realm-worker-vBoEVkUT.js} +1 -1
  34. package/dist/ui/assets/{kernel-worker-BOn7PAWS.js → kernel-worker-Cl5srBeR.js} +33 -33
  35. package/dist/ui/assets/{local-llm-B7QocwR-.js → local-llm-DZsHXl_L.js} +1 -1
  36. package/dist/ui/assets/{local-llm-ws8kUvz8.js → local-llm-uTHY5Ual.js} +1 -1
  37. package/dist/ui/assets/{main-C3kY4qwt.js → main-DXWS1IVz.js} +3 -3
  38. package/dist/ui/assets/{main-cherry-CXJmoiKT.js → main-cherry-C4idCKAq.js} +1 -1
  39. package/dist/ui/assets/{memory-curation-seam-BeoDnTPF.js → memory-curation-seam-DxC-fV7O.js} +1 -1
  40. package/dist/ui/assets/{mount-DLXo0YLf.js → mount-DUrrmQJz.js} +3 -3
  41. package/dist/ui/assets/{mount-recovery-LNDCBESm.js → mount-recovery-CX8fQNbn.js} +1 -1
  42. package/dist/ui/assets/{mount-eaKpsekX.js → mount-z8VSx_cW.js} +1 -1
  43. package/dist/ui/assets/{new-session-BR07Cwue.js → new-session-DXlnfPbx.js} +2 -2
  44. package/dist/ui/assets/{oauth-bootstrap-CU5n9CrT.js → oauth-bootstrap-CLaikNyP.js} +2 -2
  45. package/dist/ui/assets/{onboarding-orchestrator-DlvPySOw.js → onboarding-orchestrator-ax5TRJvn.js} +1 -1
  46. package/dist/ui/assets/{openai-codex-DVTuUFEt.js → openai-codex-01ikBVlh.js} +1 -1
  47. package/dist/ui/assets/{openai-codex-zNStwguM.js → openai-codex-CBXZx51K.js} +1 -1
  48. package/dist/ui/assets/{openrouter-AATG6x2d.js → openrouter-CkIxEjzK.js} +1 -1
  49. package/dist/ui/assets/{openrouter-RXJx-CYE.js → openrouter-DYHHMkMT.js} +1 -1
  50. package/dist/ui/assets/{openrouter-free-BgEXTfii.js → openrouter-free-BicCGu0d.js} +1 -1
  51. package/dist/ui/assets/{openrouter-free-3g-OS9Vd.js → openrouter-free-D45Gbej5.js} +1 -1
  52. package/dist/ui/assets/{openrouter-oauth-6T6RMMKm.js → openrouter-oauth-BqCdKSGz.js} +1 -1
  53. package/dist/ui/assets/{openrouter-oauth-BrunARs4.js → openrouter-oauth-lmyBK61J.js} +1 -1
  54. package/dist/ui/assets/{opfs-mount-DqcCV6-e.js → opfs-mount-Duu5vA7T.js} +1 -1
  55. package/dist/ui/assets/{panel-rpc-handlers-C-ZrezVh.js → panel-rpc-handlers-Ds8LHs3W.js} +2 -2
  56. package/dist/ui/assets/{panelize-shell-Dqtsa7Xq.js → panelize-shell-C_Ae1Hog.js} +1 -1
  57. package/dist/ui/assets/{pi-edit-execution-DqI6084r.js → pi-edit-execution-ChKOzrBi.js} +1 -1
  58. package/dist/ui/assets/{provider-DEvcJ1Rc.js → provider-DKUNteWE.js} +1 -1
  59. package/dist/ui/assets/{provider-BzyjK17E.js → provider-DNXXUHXM.js} +2 -2
  60. package/dist/ui/assets/provider-settings-CdCRajf8.js +1 -0
  61. package/dist/ui/assets/provider-store-access-BnNcfup5.js +1 -0
  62. package/dist/ui/assets/provider-store-access-DIZUbP1h.js +1 -0
  63. package/dist/ui/assets/{providers-DgV0i5wM.js → providers-ZfM6F0Jd.js} +1 -1
  64. package/dist/ui/assets/{providers-yJqf8FSl.js → providers-mhaGOEhg.js} +2 -2
  65. package/dist/ui/assets/{quick-llm-C0pknm6K.js → quick-llm-CzaiPeIX.js} +1 -1
  66. package/dist/ui/assets/{recovery-screen-Drmpqp_Z.js → recovery-screen-DzML0nu6.js} +1 -1
  67. package/dist/ui/assets/{run-DsHniFDx.js → run-BcHdnyi5.js} +1 -1
  68. package/dist/ui/assets/{run-CokQiUCf.js → run-C2sZqFNl.js} +2 -2
  69. package/dist/ui/assets/{run-BaLqrV2X.js → run-hg0l0lzS.js} +1 -1
  70. package/dist/ui/assets/{session-jsonl-r3PC72gG.js → session-jsonl-2bEZy533.js} +1 -1
  71. package/dist/ui/assets/{setup-feature-flags-remote-DvyEZpD7.js → setup-feature-flags-remote-C6aGg72k.js} +1 -1
  72. package/dist/ui/assets/{silent-renew-backoff-GAYBElLu.js → silent-renew-backoff-B_D6IKIG.js} +1 -1
  73. package/dist/ui/assets/{skills-83dSm0AA.js → skills-YHej2APa.js} +1 -1
  74. package/dist/ui/assets/slicc-version-OhzwE5Qg.js +1 -0
  75. package/dist/ui/assets/{snapshot-features-CH_5YuGq.js → snapshot-features-ByG3dCcO.js} +1 -1
  76. package/dist/ui/assets/{snapshot-DIIE5zIj.js → snapshot-j9UvXs9r.js} +1 -1
  77. package/dist/ui/assets/{soundscape-CzP0cXwy.js → soundscape-CSdo0dZb.js} +1 -1
  78. package/dist/ui/assets/{speak-BYzFS7Ty.js → speak-Dm5sVk4x.js} +1 -1
  79. package/dist/ui/assets/{sprinkle-manager-BLUZduNz.js → sprinkle-manager-BhHKrAMI.js} +1 -1
  80. package/dist/ui/assets/{sprinkle-renderer-Cb03w_WD.js → sprinkle-renderer-ZzrznyqG.js} +1 -1
  81. package/dist/ui/assets/{state-Bj9Ub2SV.js → state-ClF3Z0cR.js} +1 -1
  82. package/dist/ui/assets/{store-8BTj1fD_.js → store-CMIl8X5U.js} +1 -1
  83. package/dist/ui/assets/{store-tmEfD0Rj.js → store-DIH0PKGB.js} +1 -1
  84. package/dist/ui/assets/{sudo-DAoppDTf.js → sudo-CAFiBjMN.js} +1 -1
  85. package/dist/ui/assets/{sync-dialog-BWiv-UZX.js → sync-dialog-BfaspJmv.js} +1 -1
  86. package/dist/ui/assets/{transformers-env-CZ7GObfi.js → transformers-env-wmaHugLi.js} +1 -1
  87. package/dist/ui/assets/{tray-sidecar-2VKSK6f1.js → tray-sidecar-B1D_KZcU.js} +1 -1
  88. package/dist/ui/assets/{upgrade-detection-CPCrBCMa.js → upgrade-detection-D_R30C4c.js} +1 -1
  89. package/dist/ui/assets/{upskill-lick-skip-CfQOyKFq.js → upskill-lick-skip-Lvb6bebl.js} +1 -1
  90. package/dist/ui/assets/{voice-reply-CkUBH04W.js → voice-reply-CV22AFT5.js} +1 -1
  91. package/dist/ui/assets/{wc-attach-LnXYOiuQ.js → wc-attach-DRX8nZSN.js} +2 -2
  92. package/dist/ui/assets/{wc-extension-BiiJ1PC-.js → wc-extension-tF3XW_b8.js} +2 -2
  93. package/dist/ui/assets/{wc-follower-BPYn7Q3s.js → wc-follower-ClirqqpZ.js} +3 -3
  94. package/dist/ui/assets/{wc-follower-oauth-CCa8xLk0.js → wc-follower-oauth-ByNTSq5L.js} +1 -1
  95. package/dist/ui/assets/{wc-gelatiere-C1nVt4q0.js → wc-gelatiere-Cs1F609G.js} +1 -1
  96. package/dist/ui/assets/{wc-live-yBrQM63g.js → wc-live-BgjOFihF.js} +5 -5
  97. package/dist/ui/assets/{wc-nav-DwwSSgiM.js → wc-nav-CRy2Vt0U.js} +2 -2
  98. package/dist/ui/assets/{wc-onboarding-COGCiwOu.js → wc-onboarding-BY7ojkX0.js} +2 -2
  99. package/dist/ui/assets/{wc-placeholder-DYKS2mOy.js → wc-placeholder-B0ZCFAzV.js} +3 -3
  100. package/dist/ui/assets/{wc-secret-request-5YT8-1DJ.js → wc-secret-request-DYq17svG.js} +1 -1
  101. package/dist/ui/assets/{wc-settings-C91SZgPn.js → wc-settings-CSViFPTR.js} +3 -3
  102. package/dist/ui/assets/{wc-shell-Bk_epkuk.js → wc-shell-o3khNlbt.js} +3 -3
  103. package/dist/ui/assets/{wc-shortcut-config-Bs4LcqFL.js → wc-shortcut-config-CUW0ZF38.js} +1 -1
  104. package/dist/ui/assets/{wc-shortcuts-CkiPB7Y_.js → wc-shortcuts-CR8LRvqx.js} +1 -1
  105. package/dist/ui/assets/{wc-sprinkles-B8NqZJDQ.js → wc-sprinkles-aprFPdiB.js} +2 -2
  106. package/dist/ui/assets/{wc-transcript-export-BU4kXlKC.js → wc-transcript-export-B__1zmXE.js} +2 -2
  107. package/dist/ui/assets/{wc-tray-DZnAKRIm.js → wc-tray-XUqrQf3G.js} +4 -4
  108. package/dist/ui/assets/welcome-detection-DjbcOWy2.js +1 -0
  109. package/dist/ui/assets/{whisper-session-BetvCfEP.js → whisper-session-5GqtYZRf.js} +2 -2
  110. package/dist/ui/assets/{xai-grok-DjlUbdZA.js → xai-grok-Byv1S7IW.js} +1 -1
  111. package/dist/ui/assets/{xai-grok-BF8jP9SN.js → xai-grok-DIwN-DXC.js} +1 -1
  112. package/dist/ui/index.html +3 -3
  113. package/dist/ui/packages/webapp/index.html +3 -3
  114. package/package.json +1 -1
  115. package/dist/ui/assets/provider-settings-CnvkRFSY.js +0 -1
  116. package/dist/ui/assets/provider-store-access-DFdeZeqD.js +0 -1
  117. package/dist/ui/assets/provider-store-access-Dwd6xV_i.js +0 -1
  118. package/dist/ui/assets/slicc-version-C0gkt5sw.js +0 -1
  119. package/dist/ui/assets/welcome-detection-Cd3WyOoe.js +0 -1
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{i as t}from"./fetch-body-CuwTaJC_.js";import{a as n}from"./types-Dzr0qYl3.js";import{a as r,c as i,l as a,o,r as s,s as c,t as l,u}from"./github-zip-DeYRWuaP.js";import{i as d,o as f,r as p}from"./provenance-DdmsQ3Nr.js";async function m(){try{let e=(typeof window<`u`?window:globalThis).__slicc_reloadSkills;if(typeof e==`function`){await e();return}typeof chrome<`u`&&chrome?.runtime?.sendMessage&&chrome.runtime.sendMessage({source:`panel`,payload:{type:`reload-skills`}})}catch{}}async function h(){try{let e=globalThis.__slicc_sprinkleManager;typeof e?.openNewAutoOpenSprinkles==`function`&&await e.openNewAutoOpenSprinkles()}catch{}}async function g(){await h(),await m()}async function _(e,t,r,o,s=!1,c){let l=`${n}/${t}`,d=!1;try{if(await o.stat(l),!s)return{ok:!1,error:`skill "${t}" already exists (use --force to overwrite)`};d=!0,await u(o,l,await v(o,t))}catch{}let p=e.replace(/^\/|\/$/g,``),m=p?p+`/`:``;await o.mkdir(l,{recursive:!0});let h=0,g=[];try{for(let[e,t]of Object.entries(r)){if(!e.startsWith(m))continue;let n=e.slice(m.length);if(!n||e.endsWith(`/`)||!await a(o,l,n)||!i(n))continue;let r=`${l}/${n}`,s=r.substring(0,r.lastIndexOf(`/`));s!==l&&await o.mkdir(s,{recursive:!0}),await o.writeFile(r,t),g.push(n),h++}}catch(e){throw await y(o,l,d),e}return h===0?(await y(o,l,d),{ok:!1,error:`no files found for skill "${t}" in ZIP`}):(c&&await f(o,t,{...c,skill:t,files:g.sort()}),{ok:!0})}async function v(e,t){let n=await p(e,t);return n?.files?.length?new Set(n.files):void 0}async function y(e,t,n){if(n){await u(e,t).catch(()=>!1);return}await e.rm(t,{recursive:!0}).catch(()=>{})}var b=e({installFromGitHub:()=>w,listGitHubSkills:()=>S,parseGitHubRef:()=>T,parseGitHubUrl:()=>x});function x(e){let t=e.match(/github\.com\/([^/?#]+)\/([^/?#]+)/);return t?{owner:t[1],repo:t[2].replace(/\.git$/,``)}:null}async function S(e,n,i,a,o,l){if(o){let t=await s(e,n,o,l);if(t.status===`ok`){let e=r(t.files),n=[],i=a?a.replace(/^\/|\/$/g,``)+`/`:``;for(let t of Object.keys(e))if(t.startsWith(i)&&(t.split(`/`).pop()||``)===`SKILL.md`){let e=t.replace(/\/SKILL\.md$/,``),r=e.split(`/`).pop()||e;n.push({name:r,path:e})}return{skills:n}}}let u=[];async function d(r){let a=`https://api.github.com/repos/${e}/${n}/contents/${r}`,o=l?`${a}?ref=${encodeURIComponent(l)}`:a,s=await i.request(o);if(s.status!==200)throw Error(c(s,`${e}/${n}${r?`/${r}`:``}`,i.hasToken));let f=t(s.body);for(let e of f)if(e.type===`file`&&e.name===`SKILL.md`){let t=e.path.replace(`/SKILL.md`,``),n=t.split(`/`).pop()||t;u.push({name:n,path:t})}else e.type===`dir`&&await d(e.path)}try{return await d(a||``),{skills:u}}catch(e){return{skills:[],error:e instanceof Error?e.message:String(e)}}}async function C(e,t,n,r,i,a,o,s){let c=await d(t,n,a,o,!0,r.replace(/^\/+|\/+$/g,``));await f(e,i,{kind:`github`,source:`${t}/${n}`,skill:i,ref:a,path:r.replace(/^\/|\/$/g,``),sha:c,files:s})}async function w(e,i,a,d,f,p,_=!1,b,x){let S=!1;try{let w=`${n}/${d}`;try{if(await f.stat(w),!_)return{stdout:``,stderr:`upskill: skill "${d}" already exists (use --force to overwrite)\n`,exitCode:1};S=!0,await u(f,w,await v(f,d))}catch{}if(b){let t=await s(e,i,b,x);if(t.status===`ok`){let n=r(t.files),s=a.replace(/^\/|\/$/g,``)+`/`;await f.mkdir(w,{recursive:!0});let c=await o(n,s,w,f);if(c.length>0)return await C(f,e,i,a,d,x,p,c),await h(),await m(),{stdout:`Installed skill "${d}" from ${e}/${i}\n`,stderr:``,exitCode:0}}}let T=`https://api.github.com/repos/${e}/${i}/contents/${a}`,E=x?`${T}?ref=${encodeURIComponent(x)}`:T,D=await p.request(E);if(D.status!==200)return{stdout:``,stderr:`upskill: ${c(D,`${e}/${i}/${a}`,p.hasToken)}\n`,exitCode:1};let O=t(D.body);await f.mkdir(w,{recursive:!0});let k;try{k=await l(O,w,e,i,x,f,p)}catch(e){throw await y(f,w,S),e}return await C(f,e,i,a,d,x,p,k),await g(),{stdout:`Installed skill "${d}" from ${e}/${i}\n`,stderr:``,exitCode:0}}catch(e){return{stdout:``,stderr:`upskill: failed to install from GitHub: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}function T(e){let t=e.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?(?:\/tree\/([^/]+?)(?:\/(.+?))?)?\/?$/);if(t)return{owner:t[1],repo:t[2],branch:t[3],path:t[4]};let n=e.match(/^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)(?:@([a-zA-Z0-9_./-]+))?$/);return n?{owner:n[1],repo:n[2],branch:n[3]}:null}export{x as a,g as c,T as i,w as n,_ as o,S as r,v as s,b as t};
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{i as t}from"./fetch-body-CuwTaJC_.js";import{a as n}from"./types-Dzr0qYl3.js";import{a as r,c as i,l as a,o,r as s,s as c,t as l,u}from"./github-zip-Dl4FpHW9.js";import{i as d,o as f,r as p}from"./provenance-DdmsQ3Nr.js";async function m(){try{let e=(typeof window<`u`?window:globalThis).__slicc_reloadSkills;if(typeof e==`function`){await e();return}typeof chrome<`u`&&chrome?.runtime?.sendMessage&&chrome.runtime.sendMessage({source:`panel`,payload:{type:`reload-skills`}})}catch{}}async function h(){try{let e=globalThis.__slicc_sprinkleManager;typeof e?.openNewAutoOpenSprinkles==`function`&&await e.openNewAutoOpenSprinkles()}catch{}}async function g(){await h(),await m()}async function _(e,t,r,o,s=!1,c){let l=`${n}/${t}`,d=!1;try{if(await o.stat(l),!s)return{ok:!1,error:`skill "${t}" already exists (use --force to overwrite)`};d=!0,await u(o,l,await v(o,t))}catch{}let p=e.replace(/^\/|\/$/g,``),m=p?p+`/`:``;await o.mkdir(l,{recursive:!0});let h=0,g=[];try{for(let[e,t]of Object.entries(r)){if(!e.startsWith(m))continue;let n=e.slice(m.length);if(!n||e.endsWith(`/`)||!await a(o,l,n)||!i(n))continue;let r=`${l}/${n}`,s=r.substring(0,r.lastIndexOf(`/`));s!==l&&await o.mkdir(s,{recursive:!0}),await o.writeFile(r,t),g.push(n),h++}}catch(e){throw await y(o,l,d),e}return h===0?(await y(o,l,d),{ok:!1,error:`no files found for skill "${t}" in ZIP`}):(c&&await f(o,t,{...c,skill:t,files:g.sort()}),{ok:!0})}async function v(e,t){let n=await p(e,t);return n?.files?.length?new Set(n.files):void 0}async function y(e,t,n){if(n){await u(e,t).catch(()=>!1);return}await e.rm(t,{recursive:!0}).catch(()=>{})}var b=e({installFromGitHub:()=>w,listGitHubSkills:()=>S,parseGitHubRef:()=>T,parseGitHubUrl:()=>x});function x(e){let t=e.match(/github\.com\/([^/?#]+)\/([^/?#]+)/);return t?{owner:t[1],repo:t[2].replace(/\.git$/,``)}:null}async function S(e,n,i,a,o,l){if(o){let t=await s(e,n,o,l);if(t.status===`ok`){let e=r(t.files),n=[],i=a?a.replace(/^\/|\/$/g,``)+`/`:``;for(let t of Object.keys(e))if(t.startsWith(i)&&(t.split(`/`).pop()||``)===`SKILL.md`){let e=t.replace(/\/SKILL\.md$/,``),r=e.split(`/`).pop()||e;n.push({name:r,path:e})}return{skills:n}}}let u=[];async function d(r){let a=`https://api.github.com/repos/${e}/${n}/contents/${r}`,o=l?`${a}?ref=${encodeURIComponent(l)}`:a,s=await i.request(o);if(s.status!==200)throw Error(c(s,`${e}/${n}${r?`/${r}`:``}`,i.hasToken));let f=t(s.body);for(let e of f)if(e.type===`file`&&e.name===`SKILL.md`){let t=e.path.replace(`/SKILL.md`,``),n=t.split(`/`).pop()||t;u.push({name:n,path:t})}else e.type===`dir`&&await d(e.path)}try{return await d(a||``),{skills:u}}catch(e){return{skills:[],error:e instanceof Error?e.message:String(e)}}}async function C(e,t,n,r,i,a,o,s){let c=await d(t,n,a,o,!0,r.replace(/^\/+|\/+$/g,``));await f(e,i,{kind:`github`,source:`${t}/${n}`,skill:i,ref:a,path:r.replace(/^\/|\/$/g,``),sha:c,files:s})}async function w(e,i,a,d,f,p,_=!1,b,x){let S=!1;try{let w=`${n}/${d}`;try{if(await f.stat(w),!_)return{stdout:``,stderr:`upskill: skill "${d}" already exists (use --force to overwrite)\n`,exitCode:1};S=!0,await u(f,w,await v(f,d))}catch{}if(b){let t=await s(e,i,b,x);if(t.status===`ok`){let n=r(t.files),s=a.replace(/^\/|\/$/g,``)+`/`;await f.mkdir(w,{recursive:!0});let c=await o(n,s,w,f);if(c.length>0)return await C(f,e,i,a,d,x,p,c),await h(),await m(),{stdout:`Installed skill "${d}" from ${e}/${i}\n`,stderr:``,exitCode:0}}}let T=`https://api.github.com/repos/${e}/${i}/contents/${a}`,E=x?`${T}?ref=${encodeURIComponent(x)}`:T,D=await p.request(E);if(D.status!==200)return{stdout:``,stderr:`upskill: ${c(D,`${e}/${i}/${a}`,p.hasToken)}\n`,exitCode:1};let O=t(D.body);await f.mkdir(w,{recursive:!0});let k;try{k=await l(O,w,e,i,x,f,p)}catch(e){throw await y(f,w,S),e}return await C(f,e,i,a,d,x,p,k),await g(),{stdout:`Installed skill "${d}" from ${e}/${i}\n`,stderr:``,exitCode:0}}catch(e){return{stdout:``,stderr:`upskill: failed to install from GitHub: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}function T(e){let t=e.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?(?:\/tree\/([^/]+?)(?:\/(.+?))?)?\/?$/);if(t)return{owner:t[1],repo:t[2],branch:t[3],path:t[4]};let n=e.match(/^([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)(?:@([a-zA-Z0-9_./-]+))?$/);return n?{owner:n[1],repo:n[2],branch:n[3]}:null}export{x as a,g as c,T as i,w as n,_ as o,S as r,v as s,b as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{i as t}from"./binary-cache-bSOhqXB1.js";import{i as n,n as r,r as i}from"./fetch-body-CuwTaJC_.js";import{r as a}from"./browser-2rCVqcqy.js";import{i as o,n as s}from"./github-auth-E8mpeEdU.js";function c(e){return e.split(`/`).some(e=>e.startsWith(`.`))}async function l(e,t,n){return!c(n)||!await e.exists(`${t}/${n}`)}async function u(e,t,n,r=``){let i;try{i=await e.readDir(t)}catch{return!1}let a=!1;for(let o of i){let i=`${t}/${o.name}`,s=r?`${r}/${o.name}`:o.name;if(o.name.startsWith(`.`)){a=!0;continue}o.type===`directory`?await u(e,i,n,s)?a=!0:await e.rm(i,{recursive:!0}):n&&!n.has(s)?a=!0:await e.rm(i)}return a}async function d(e,t,n=!1,r=``){let i;try{i=await e.readDir(t)}catch{return[]}let a=[];for(let o of i){if(!n&&o.name.startsWith(`.`))continue;let i=r?`${r}/${o.name}`:o.name;o.type===`directory`?a.push(...await d(e,`${t}/${o.name}`,n,i)):a.push(i)}return a.sort()}function f(e){return!e||e.startsWith(`/`)||e.includes(`\0`)||e.includes(`\\`)||/^[A-Za-z]:/.test(e)?!1:!e.split(`/`).some(e=>e===``||e===`.`||e===`..`)}function p(e){let t=r(e);if(!t)return;try{let e=JSON.parse(t);if(typeof e.message==`string`&&e.message.trim())return e.message.trim()}catch{}let n=t.trim();if(n)return n.slice(0,200)}function m(e,t,n){let r=p(e.body),i=r?` GitHub said: ${r}`:``,a=s(e.headers,`retry-after`),o=s(e.headers,`x-ratelimit-remaining`),c=r?.toLowerCase()??``;if(e.status===429||o===`0`||c.includes(`rate limit`))return n?`GitHub rate-limited access to ${t} (HTTP ${e.status}). The configured github.token was used, so retry later${a?` after about ${a} seconds`:``}.${i}`:`GitHub rate-limited anonymous access to ${t} (HTTP ${e.status}). This often happens on shared VPNs or corporate egress IPs because unauthenticated GitHub API requests are limited per IP. Configure a token with: git config github.token <PAT>, then retry. You can also retry off VPN or later.${i}`;if(e.status===401)return n?`GitHub rejected the configured github.token while accessing ${t} (HTTP 401). Update it with: git config github.token <PAT>, then retry.${i}`:`GitHub requires authentication to access ${t} (HTTP 401). Configure a token with: git config github.token <PAT>, then retry.${i}`;if(e.status===404)return`GitHub could not find ${t} (HTTP 404). Check the repository, path, and permissions.${i}`;if(e.status===403)return n?`GitHub denied access to ${t} (HTTP 403). Check that your github.token can access this repository or retry later if GitHub is throttling requests.${i}`:`GitHub denied anonymous access to ${t} (HTTP 403). If this repo is public on a shared VPN, you may have hit GitHub's shared IP limit; otherwise the repository or path may require authentication. Configure a token with: git config github.token <PAT>, then retry.${i}`;let l=e.statusText?` ${e.statusText}`:``;return`GitHub request for ${t} failed (HTTP ${e.status}${l}).${i}`}var h=e({downloadGitHubDir:()=>b,fetchGitHubDirFiles:()=>y,fetchRepoZip:()=>g,stripZipPrefix:()=>_,writeZipFilesToDir:()=>v});async function g(e,n,r,s=`main`){let c=`https://codeload.github.com/${e}/${n}/zip/refs/heads/${s}`,l;try{l=await r(c,{headers:{"User-Agent":`slicc-upskill`}})}catch(e){return{status:`error`,message:o(e,c)}}if(l.status===404)return s===`main`?g(e,n,r,`master`):{status:`error`,message:`codeload returned HTTP 404`};if(l.status!==200)return{status:`error`,message:`codeload returned HTTP ${l.status}`};let u=t(c);u||=i(l.body);try{return{status:`ok`,files:a(u)}}catch(e){return{status:`error`,message:`failed to unzip: ${e instanceof Error?e.message:String(e)}`}}}function _(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.indexOf(`/`);if(e<0)continue;let i=n.slice(e+1);i&&(t[i]=r)}return t}async function v(e,t,n,r,i=!0){let a=[];for(let[o,s]of Object.entries(e)){if(!o.startsWith(t))continue;let e=o.slice(t.length);if(o.endsWith(`/`)||!f(e)||i&&!await l(r,n,e))continue;let c=`${n}/${e}`,u=c.substring(0,c.lastIndexOf(`/`));u!==n&&await r.mkdir(u,{recursive:!0}),await r.writeFile(c,s),a.push(e)}return a.sort()}async function y(e,r,a,o,s,c=new Map,l=``){let u=`https://api.github.com/repos/${e}/${r}/contents/${a}`,d=o?`${u}?ref=${encodeURIComponent(o)}`:u,p=await s.request(d);if(p.status!==200)throw Error(m(p,`${e}/${r}${a?`/${a}`:``}`,s.hasToken));for(let a of n(p.body)){let n=l?`${l}/${a.name}`:a.name;if(f(n)){if(a.type===`file`&&a.download_url){let o=await s.request(a.download_url,`*/*`);if(o.status!==200)throw Error(m(o,`${e}/${r}/${a.path}`,s.hasToken));let l=t(a.download_url);c.set(n,l??i(o.body))}else a.type===`dir`&&await y(e,r,a.path,o,s,c,n)}}return c}async function b(e,r,i,a,o,s,l,u=[],d=``){for(let p of e){let e=d?`${d}/${p.name}`:p.name;if(f(e)){if(p.type===`file`&&p.download_url){if(c(e)&&await s.exists(`${r}/${p.name}`))continue;let n=await l.request(p.download_url,`*/*`);if(n.status!==200)throw Error(m(n,`${i}/${a}/${p.path}`,l.hasToken));let o=t(p.download_url);await s.writeFile(`${r}/${p.name}`,o??n.body),u.push(e)}else if(p.type===`dir`){let t=`https://api.github.com/repos/${i}/${a}/contents/${p.path}`,c=o?`${t}?ref=${encodeURIComponent(o)}`:t,d=await l.request(c);if(d.status!==200)throw Error(m(d,`${i}/${a}/${p.path}`,l.hasToken));let f=n(d.body);await s.mkdir(`${r}/${p.name}`,{recursive:!0}),await b(f,`${r}/${p.name}`,i,a,o,s,l,u,e)}}}return u.sort()}export{_ as a,f as c,c as d,d as f,h as i,l,y as n,v as o,g as r,m as s,b as t,u};
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{i as t}from"./binary-cache-bSOhqXB1.js";import{i as n,n as r,r as i}from"./fetch-body-CuwTaJC_.js";import{r as a}from"./browser-2rCVqcqy.js";import{i as o,n as s}from"./github-auth-hHO45d89.js";function c(e){return e.split(`/`).some(e=>e.startsWith(`.`))}async function l(e,t,n){return!c(n)||!await e.exists(`${t}/${n}`)}async function u(e,t,n,r=``){let i;try{i=await e.readDir(t)}catch{return!1}let a=!1;for(let o of i){let i=`${t}/${o.name}`,s=r?`${r}/${o.name}`:o.name;if(o.name.startsWith(`.`)){a=!0;continue}o.type===`directory`?await u(e,i,n,s)?a=!0:await e.rm(i,{recursive:!0}):n&&!n.has(s)?a=!0:await e.rm(i)}return a}async function d(e,t,n=!1,r=``){let i;try{i=await e.readDir(t)}catch{return[]}let a=[];for(let o of i){if(!n&&o.name.startsWith(`.`))continue;let i=r?`${r}/${o.name}`:o.name;o.type===`directory`?a.push(...await d(e,`${t}/${o.name}`,n,i)):a.push(i)}return a.sort()}function f(e){return!e||e.startsWith(`/`)||e.includes(`\0`)||e.includes(`\\`)||/^[A-Za-z]:/.test(e)?!1:!e.split(`/`).some(e=>e===``||e===`.`||e===`..`)}function p(e){let t=r(e);if(!t)return;try{let e=JSON.parse(t);if(typeof e.message==`string`&&e.message.trim())return e.message.trim()}catch{}let n=t.trim();if(n)return n.slice(0,200)}function m(e,t,n){let r=p(e.body),i=r?` GitHub said: ${r}`:``,a=s(e.headers,`retry-after`),o=s(e.headers,`x-ratelimit-remaining`),c=r?.toLowerCase()??``;if(e.status===429||o===`0`||c.includes(`rate limit`))return n?`GitHub rate-limited access to ${t} (HTTP ${e.status}). The configured github.token was used, so retry later${a?` after about ${a} seconds`:``}.${i}`:`GitHub rate-limited anonymous access to ${t} (HTTP ${e.status}). This often happens on shared VPNs or corporate egress IPs because unauthenticated GitHub API requests are limited per IP. Configure a token with: git config github.token <PAT>, then retry. You can also retry off VPN or later.${i}`;if(e.status===401)return n?`GitHub rejected the configured github.token while accessing ${t} (HTTP 401). Update it with: git config github.token <PAT>, then retry.${i}`:`GitHub requires authentication to access ${t} (HTTP 401). Configure a token with: git config github.token <PAT>, then retry.${i}`;if(e.status===404)return`GitHub could not find ${t} (HTTP 404). Check the repository, path, and permissions.${i}`;if(e.status===403)return n?`GitHub denied access to ${t} (HTTP 403). Check that your github.token can access this repository or retry later if GitHub is throttling requests.${i}`:`GitHub denied anonymous access to ${t} (HTTP 403). If this repo is public on a shared VPN, you may have hit GitHub's shared IP limit; otherwise the repository or path may require authentication. Configure a token with: git config github.token <PAT>, then retry.${i}`;let l=e.statusText?` ${e.statusText}`:``;return`GitHub request for ${t} failed (HTTP ${e.status}${l}).${i}`}var h=e({downloadGitHubDir:()=>b,fetchGitHubDirFiles:()=>y,fetchRepoZip:()=>g,stripZipPrefix:()=>_,writeZipFilesToDir:()=>v});async function g(e,n,r,s=`main`){let c=`https://codeload.github.com/${e}/${n}/zip/refs/heads/${s}`,l;try{l=await r(c,{headers:{"User-Agent":`slicc-upskill`}})}catch(e){return{status:`error`,message:o(e,c)}}if(l.status===404)return s===`main`?g(e,n,r,`master`):{status:`error`,message:`codeload returned HTTP 404`};if(l.status!==200)return{status:`error`,message:`codeload returned HTTP ${l.status}`};let u=t(c);u||=i(l.body);try{return{status:`ok`,files:a(u)}}catch(e){return{status:`error`,message:`failed to unzip: ${e instanceof Error?e.message:String(e)}`}}}function _(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.indexOf(`/`);if(e<0)continue;let i=n.slice(e+1);i&&(t[i]=r)}return t}async function v(e,t,n,r,i=!0){let a=[];for(let[o,s]of Object.entries(e)){if(!o.startsWith(t))continue;let e=o.slice(t.length);if(o.endsWith(`/`)||!f(e)||i&&!await l(r,n,e))continue;let c=`${n}/${e}`,u=c.substring(0,c.lastIndexOf(`/`));u!==n&&await r.mkdir(u,{recursive:!0}),await r.writeFile(c,s),a.push(e)}return a.sort()}async function y(e,r,a,o,s,c=new Map,l=``){let u=`https://api.github.com/repos/${e}/${r}/contents/${a}`,d=o?`${u}?ref=${encodeURIComponent(o)}`:u,p=await s.request(d);if(p.status!==200)throw Error(m(p,`${e}/${r}${a?`/${a}`:``}`,s.hasToken));for(let a of n(p.body)){let n=l?`${l}/${a.name}`:a.name;if(f(n)){if(a.type===`file`&&a.download_url){let o=await s.request(a.download_url,`*/*`);if(o.status!==200)throw Error(m(o,`${e}/${r}/${a.path}`,s.hasToken));let l=t(a.download_url);c.set(n,l??i(o.body))}else a.type===`dir`&&await y(e,r,a.path,o,s,c,n)}}return c}async function b(e,r,i,a,o,s,l,u=[],d=``){for(let p of e){let e=d?`${d}/${p.name}`:p.name;if(f(e)){if(p.type===`file`&&p.download_url){if(c(e)&&await s.exists(`${r}/${p.name}`))continue;let n=await l.request(p.download_url,`*/*`);if(n.status!==200)throw Error(m(n,`${i}/${a}/${p.path}`,l.hasToken));let o=t(p.download_url);await s.writeFile(`${r}/${p.name}`,o??n.body),u.push(e)}else if(p.type===`dir`){let t=`https://api.github.com/repos/${i}/${a}/contents/${p.path}`,c=o?`${t}?ref=${encodeURIComponent(o)}`:t,d=await l.request(c);if(d.status!==200)throw Error(m(d,`${i}/${a}/${p.path}`,l.hasToken));let f=n(d.body);await s.mkdir(`${r}/${p.name}`,{recursive:!0}),await b(f,`${r}/${p.name}`,i,a,o,s,l,u,e)}}}return u.sort()}export{_ as a,f as c,c as d,d as f,h as i,l,y as n,v as o,g as r,m as s,b as t,u};
@@ -1 +1 @@
1
- import{t as e}from"./logger-DDBAeTLF.js";import{t}from"./permissions-surface-registry-CilCRwhh.js";import{a as n,i as r,n as i,o as a,r as o}from"./whisper-session-BetvCfEP.js";var s=e(`speech:hear`),c={};function l(){return c.getPermissionSurface?c.getPermissionSurface():t()||null}var u=3e4;function d(){if(typeof window>`u`)return null;let{SpeechRecognition:e,webkitSpeechRecognition:t}=window;return e??t??null}var f=class extends Error{code;constructor(e){super(p(e)),this.name=`SpeechRecognitionError`,this.code=e}};function p(e){switch(e){case`network`:case`service-not-allowed`:return"builtin speech recognition is unsupported in this browser (no Web Speech cloud backend) — use `hear --engine enhanced`";case`not-allowed`:return`microphone permission denied for builtin speech recognition`;case`audio-capture`:return`no microphone available for builtin speech recognition`;case`no-speech`:return`no speech detected`;case`aborted`:return`speech recognition aborted`;default:return`speech recognition error: ${e}`}}function m(e){return e instanceof f&&(e.code===`network`||e.code===`service-not-allowed`)}function h(e,t){let n=d();return n?new Promise((r,i)=>{let a=Date.now(),o=()=>Date.now()-a,c=new n;c.continuous=!1,c.interimResults=!1,e&&(c.lang=e),s.debug(`builtinOnce: recognizer constructed`,{lang:e??`(browser default)`,timeoutMs:t});let l=``,u=!1,d=setTimeout(()=>{s.debug(`builtinOnce: timeout reached — stopping recognizer`,{elapsedMs:o()});try{c.stop()}catch{}},t);c.onstart=()=>s.debug(`builtinOnce: onstart (recognition service active)`,{elapsedMs:o()}),c.onaudiostart=()=>s.debug(`builtinOnce: onaudiostart (capturing audio)`,{elapsedMs:o()}),c.onspeechstart=()=>s.debug(`builtinOnce: onspeechstart (speech detected)`,{elapsedMs:o()}),c.onspeechend=()=>s.debug(`builtinOnce: onspeechend (speech ended)`,{elapsedMs:o()}),c.onnomatch=()=>s.debug(`builtinOnce: onnomatch (no recognizable speech)`,{elapsedMs:o()}),c.onresult=e=>{let t=[];for(let n=0;n<e.results.length;n++)t.push(e.results[n][0]?.transcript??``);l=t.join(` `).trim(),s.debug(`builtinOnce: onresult`,{elapsedMs:o(),resultCount:e.results.length,transcriptLength:l.length})},c.onerror=e=>{if(e.error===`no-speech`||e.error===`aborted`){s.debug(`builtinOnce: onerror (non-fatal — ends with empty transcript)`,{elapsedMs:o(),code:e.error});return}u=!0,clearTimeout(d),s.error(`builtinOnce: onerror (fatal)`,{elapsedMs:o(),code:e.error}),i(new f(e.error))},c.onend=()=>{clearTimeout(d),u?s.debug(`builtinOnce: onend after fatal error (already rejected)`,{elapsedMs:o()}):(s.debug(`builtinOnce: onend — resolving`,{elapsedMs:o(),transcriptLength:l.length,empty:l.length===0}),r(l))},s.debug(`builtinOnce: calling recognizer.start()`,{elapsedMs:o()}),c.start()}):Promise.reject(Error(`speech recognition unavailable in this environment`))}async function g(e){let t={audio:!e||{deviceId:{exact:e}}},n=l();if(n){s.debug(`acquireMicrophoneStream: requesting microphone via permission surface`,{hasDeviceId:!!e});let r=await n.prompt({kinds:[`microphone`],description:`The hear command needs your microphone to transcribe speech.`,requestOptions:{microphone:{constraints:t}},skipIfGranted:!0});if(r.status!==`granted`){s.error(`acquireMicrophoneStream: microphone permission not granted`,{status:r.status,reason:r.reason});let e=r.message?`: ${r.message}`:``;throw Error(`microphone permission ${r.reason??r.status}${e}`)}let i=r.grants.find(e=>e.kind===`microphone`);if(!i)throw s.error(`acquireMicrophoneStream: permission granted without a microphone stream`),Error(`microphone permission granted without a stream`);return s.debug(`acquireMicrophoneStream: microphone stream acquired via surface`),i.stream}if(!navigator.mediaDevices?.getUserMedia)throw s.error(`acquireMicrophoneStream: getUserMedia unavailable in this realm`),Error(`microphone capture unavailable in this realm`);s.debug(`acquireMicrophoneStream: no permission surface; calling getUserMedia directly`);try{let e=await navigator.mediaDevices.getUserMedia(t);return s.debug(`acquireMicrophoneStream: getUserMedia succeeded (direct)`),e}catch(e){throw s.error(`acquireMicrophoneStream: getUserMedia failed (direct)`,e),e}}async function _(e){let t=await g(e),n=new MediaRecorder(t),r=[];n.ondataavailable=e=>{e.data.size>0&&r.push(e.data)},n.start(500);let i=()=>{for(let e of t.getTracks())e.stop()};return{stop:()=>new Promise(e=>{n.onstop=()=>{i(),e(r.length?new Blob(r,{type:n.mimeType||`audio/webm`}):null)};try{n.stop()}catch{i(),e(null)}}),cancel:()=>{try{n.stop()}catch{}i()}}}async function v(e){if(!l())return s.debug(`primeBuiltinPermission: no permission surface; recognizer drives its own prompt`),null;s.debug(`primeBuiltinPermission: priming microphone grant via permission surface`,{hasDeviceId:!!e});let t=await g(e);return s.debug(`primeBuiltinPermission: microphone primed; holding stream open for recognizer`),t}function y(e){if(e){for(let t of e.getTracks())t.stop();s.debug(`primeBuiltinPermission: released primed microphone stream`)}}async function b(e,t){let n=await _(e.deviceId),a=``;try{a=await h(e.lang,t)}catch(e){s.warn(`builtin endpointing failed; transcribing captured audio anyway`,e)}let c=await n.stop();if(!c)return{transcript:a,engine:`builtin`};try{let t=await r(),n=await o(await c.arrayBuffer()),a=await t.transcribe(n,{language:i(e.lang)});if(a)return{transcript:a,engine:`enhanced`}}catch(e){s.warn(`whisper transcription failed; falling back to builtin text`,e)}return{transcript:a,engine:`builtin`}}async function x(e={}){let t=e.timeoutMs??u,n=e.engine??`auto`,r=a()===`ready`;if(n===`enhanced`&&!r)throw s.error(`hearCapture: enhanced engine requested but whisper is not ready`),Error("enhanced engine not ready — run `hear --warmup` (check progress with `hear --status`)");let i=n!==`builtin`&&r;if(s.debug(`hearCapture: engine dispatch`,{requested:n,enhancedReady:r,resolved:i?`enhanced`:`builtin`}),i)return b(e,t);let o=await v(e.deviceId);try{let n=await h(e.lang,t);return s.debug(`hearCapture: builtin recognition produced a transcript`),{transcript:n,engine:`builtin`}}catch(n){if(!m(n))throw s.error(`hearCapture: builtin recognition failed`,n),n;if(r)return s.debug(`hearCapture: builtin unsupported in this browser; falling back to enhanced whisper`),y(o),o=null,b(e,t);throw s.error(`hearCapture: builtin unsupported and whisper not ready`,{code:n.code}),n}finally{y(o)}}async function S(e,t){let n=await r(),a=await o(e);return{transcript:await n.transcribe(a,{language:i(t)}),engine:`enhanced`}}function C(){let e=n();return{state:a(),...e?{loaded:e.loaded,total:e.total,etaSeconds:e.etaSeconds}:{}}}function w(){return r().catch(()=>{}),C()}export{x as hearCapture,C as hearStatus,S as hearTranscribe,w as hearWarmup};
1
+ import{t as e}from"./logger-DDBAeTLF.js";import{t}from"./permissions-surface-registry-CilCRwhh.js";import{a as n,i as r,n as i,o as a,r as o}from"./whisper-session-5GqtYZRf.js";var s=e(`speech:hear`),c={};function l(){return c.getPermissionSurface?c.getPermissionSurface():t()||null}var u=3e4;function d(){if(typeof window>`u`)return null;let{SpeechRecognition:e,webkitSpeechRecognition:t}=window;return e??t??null}var f=class extends Error{code;constructor(e){super(p(e)),this.name=`SpeechRecognitionError`,this.code=e}};function p(e){switch(e){case`network`:case`service-not-allowed`:return"builtin speech recognition is unsupported in this browser (no Web Speech cloud backend) — use `hear --engine enhanced`";case`not-allowed`:return`microphone permission denied for builtin speech recognition`;case`audio-capture`:return`no microphone available for builtin speech recognition`;case`no-speech`:return`no speech detected`;case`aborted`:return`speech recognition aborted`;default:return`speech recognition error: ${e}`}}function m(e){return e instanceof f&&(e.code===`network`||e.code===`service-not-allowed`)}function h(e,t){let n=d();return n?new Promise((r,i)=>{let a=Date.now(),o=()=>Date.now()-a,c=new n;c.continuous=!1,c.interimResults=!1,e&&(c.lang=e),s.debug(`builtinOnce: recognizer constructed`,{lang:e??`(browser default)`,timeoutMs:t});let l=``,u=!1,d=setTimeout(()=>{s.debug(`builtinOnce: timeout reached — stopping recognizer`,{elapsedMs:o()});try{c.stop()}catch{}},t);c.onstart=()=>s.debug(`builtinOnce: onstart (recognition service active)`,{elapsedMs:o()}),c.onaudiostart=()=>s.debug(`builtinOnce: onaudiostart (capturing audio)`,{elapsedMs:o()}),c.onspeechstart=()=>s.debug(`builtinOnce: onspeechstart (speech detected)`,{elapsedMs:o()}),c.onspeechend=()=>s.debug(`builtinOnce: onspeechend (speech ended)`,{elapsedMs:o()}),c.onnomatch=()=>s.debug(`builtinOnce: onnomatch (no recognizable speech)`,{elapsedMs:o()}),c.onresult=e=>{let t=[];for(let n=0;n<e.results.length;n++)t.push(e.results[n][0]?.transcript??``);l=t.join(` `).trim(),s.debug(`builtinOnce: onresult`,{elapsedMs:o(),resultCount:e.results.length,transcriptLength:l.length})},c.onerror=e=>{if(e.error===`no-speech`||e.error===`aborted`){s.debug(`builtinOnce: onerror (non-fatal — ends with empty transcript)`,{elapsedMs:o(),code:e.error});return}u=!0,clearTimeout(d),s.error(`builtinOnce: onerror (fatal)`,{elapsedMs:o(),code:e.error}),i(new f(e.error))},c.onend=()=>{clearTimeout(d),u?s.debug(`builtinOnce: onend after fatal error (already rejected)`,{elapsedMs:o()}):(s.debug(`builtinOnce: onend — resolving`,{elapsedMs:o(),transcriptLength:l.length,empty:l.length===0}),r(l))},s.debug(`builtinOnce: calling recognizer.start()`,{elapsedMs:o()}),c.start()}):Promise.reject(Error(`speech recognition unavailable in this environment`))}async function g(e){let t={audio:!e||{deviceId:{exact:e}}},n=l();if(n){s.debug(`acquireMicrophoneStream: requesting microphone via permission surface`,{hasDeviceId:!!e});let r=await n.prompt({kinds:[`microphone`],description:`The hear command needs your microphone to transcribe speech.`,requestOptions:{microphone:{constraints:t}},skipIfGranted:!0});if(r.status!==`granted`){s.error(`acquireMicrophoneStream: microphone permission not granted`,{status:r.status,reason:r.reason});let e=r.message?`: ${r.message}`:``;throw Error(`microphone permission ${r.reason??r.status}${e}`)}let i=r.grants.find(e=>e.kind===`microphone`);if(!i)throw s.error(`acquireMicrophoneStream: permission granted without a microphone stream`),Error(`microphone permission granted without a stream`);return s.debug(`acquireMicrophoneStream: microphone stream acquired via surface`),i.stream}if(!navigator.mediaDevices?.getUserMedia)throw s.error(`acquireMicrophoneStream: getUserMedia unavailable in this realm`),Error(`microphone capture unavailable in this realm`);s.debug(`acquireMicrophoneStream: no permission surface; calling getUserMedia directly`);try{let e=await navigator.mediaDevices.getUserMedia(t);return s.debug(`acquireMicrophoneStream: getUserMedia succeeded (direct)`),e}catch(e){throw s.error(`acquireMicrophoneStream: getUserMedia failed (direct)`,e),e}}async function _(e){let t=await g(e),n=new MediaRecorder(t),r=[];n.ondataavailable=e=>{e.data.size>0&&r.push(e.data)},n.start(500);let i=()=>{for(let e of t.getTracks())e.stop()};return{stop:()=>new Promise(e=>{n.onstop=()=>{i(),e(r.length?new Blob(r,{type:n.mimeType||`audio/webm`}):null)};try{n.stop()}catch{i(),e(null)}}),cancel:()=>{try{n.stop()}catch{}i()}}}async function v(e){if(!l())return s.debug(`primeBuiltinPermission: no permission surface; recognizer drives its own prompt`),null;s.debug(`primeBuiltinPermission: priming microphone grant via permission surface`,{hasDeviceId:!!e});let t=await g(e);return s.debug(`primeBuiltinPermission: microphone primed; holding stream open for recognizer`),t}function y(e){if(e){for(let t of e.getTracks())t.stop();s.debug(`primeBuiltinPermission: released primed microphone stream`)}}async function b(e,t){let n=await _(e.deviceId),a=``;try{a=await h(e.lang,t)}catch(e){s.warn(`builtin endpointing failed; transcribing captured audio anyway`,e)}let c=await n.stop();if(!c)return{transcript:a,engine:`builtin`};try{let t=await r(),n=await o(await c.arrayBuffer()),a=await t.transcribe(n,{language:i(e.lang)});if(a)return{transcript:a,engine:`enhanced`}}catch(e){s.warn(`whisper transcription failed; falling back to builtin text`,e)}return{transcript:a,engine:`builtin`}}async function x(e={}){let t=e.timeoutMs??u,n=e.engine??`auto`,r=a()===`ready`;if(n===`enhanced`&&!r)throw s.error(`hearCapture: enhanced engine requested but whisper is not ready`),Error("enhanced engine not ready — run `hear --warmup` (check progress with `hear --status`)");let i=n!==`builtin`&&r;if(s.debug(`hearCapture: engine dispatch`,{requested:n,enhancedReady:r,resolved:i?`enhanced`:`builtin`}),i)return b(e,t);let o=await v(e.deviceId);try{let n=await h(e.lang,t);return s.debug(`hearCapture: builtin recognition produced a transcript`),{transcript:n,engine:`builtin`}}catch(n){if(!m(n))throw s.error(`hearCapture: builtin recognition failed`,n),n;if(r)return s.debug(`hearCapture: builtin unsupported in this browser; falling back to enhanced whisper`),y(o),o=null,b(e,t);throw s.error(`hearCapture: builtin unsupported and whisper not ready`,{code:n.code}),n}finally{y(o)}}async function S(e,t){let n=await r(),a=await o(e);return{transcript:await n.transcribe(a,{language:i(t)}),engine:`enhanced`}}function C(){let e=n();return{state:a(),...e?{loaded:e.loaded,total:e.total,etaSeconds:e.etaSeconds}:{}}}function w(){return r().catch(()=>{}),C()}export{x as hearCapture,C as hearStatus,S as hearTranscribe,w as hearWarmup};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./subcommand-help-CgO7wRS5.js";import{r as t}from"./state-Bj9Ub2SV.js";function n(e){return`Usage: ${e} <command> [args...]
1
+ import{r as e}from"./subcommand-help-CgO7wRS5.js";import{r as t}from"./state-ClF3Z0cR.js";function n(e){return`Usage: ${e} <command> [args...]
2
2
 
3
3
  Most commands operate on a tab and REQUIRE --tab=<targetId>. There is no
4
4
  implicit "current tab" — run "${e} tab-list" to get tab IDs.
@@ -1,4 +1,4 @@
1
- import{t as e}from"./types-D8gIX-W-.js";import"./fs-CAQbIrYC.js";import{n as t,t as n}from"./browser-2rCVqcqy.js";import{A as r,D as i,E as a,M as o,O as s,T as c,j as l,k as u,w as d}from"./shared-C_68vn79.js";const f=`https://${[`huggingface`,`co`].join(`.`)}`;function p(e){let t=e?.trim();if(!t)return f;try{let e=new URL(t);return e.protocol!==`http:`&&e.protocol!==`https:`?f:e.href.replace(/\/+$/,``)}catch{return f}}function m(e,t,n){return`${e}/api/models/${t}/tree/${n}?recursive=true`}function h(e,t,n,r){return`${e}/${t}/resolve/${n}/${r}`}function g(e){try{return new URL(e).host}catch{return e}}async function _(e,t,n){try{return await e(t,n)}catch(e){let n=e instanceof Error?e.message:String(e);throw Error(`request to ${g(t)} failed (${n}); check the bridge fetch-proxy is reachable`)}}async function v(e,t,n,r=f){let i=await _(e,m(r,t,n),{method:`GET`});if(i.status<200||i.status>=300)throw Error(`HF API ${i.status} ${i.statusText} for ${t}@${n}`);let a=new TextDecoder(`utf-8`).decode(i.body);return JSON.parse(a).filter(e=>e.type===`file`).map(e=>({path:e.path,size:typeof e.size==`number`?e.size:0}))}async function y(e,t){let n=t.lastIndexOf(`/`);if(n<=0)return;let r=t.slice(0,n);await e.mkdir(r,{recursive:!0})}async function ee(e,t,n,r,i,a,o,s,c){let l=`${a}/${i}`;if(!o&&await t.exists(l))try{let e=await t.stat(l);if(c===void 0||c<=0||e.size===c)return{status:`skipped`,bytes:e.size??0}}catch{}let u=await _(e,h(s,n,r,i),{method:`GET`});if(u.status<200||u.status>=300)throw Error(`HTTP ${u.status} ${u.statusText} for ${i}`);return await y(t,l),await t.writeFile(l,u.body),{status:`downloaded`,bytes:u.body.byteLength}}function te(e,t,n){let r=t??`/workspace/models/${e}`;return(r.startsWith(`/`)?r:`${n.replace(/\/+$/,``)}/${r}`).replace(/\/+$/,``)}var ne=class extends Error{file;constructor(e,t){super(t instanceof Error?t.message:String(t)),this.name=`HfFileDownloadError`,this.file=e}};async function re(e){let t=e.revision??`main`,n=e.force??!1,r=p(e.endpoint),i=e.files??[],a=new Map;if(i.length===0){let n=await v(e.fetch,e.repo,t,r);if(n.length===0)throw Error(`repo ${e.repo}@${t} has no files`);i=n.map(e=>e.path);for(let e of n)a.set(e.path,e.size);let o=n.reduce((e,t)=>e+t.size,0);e.progress?.onListed?.({files:i,totalBytes:o})}await e.fs.mkdir(e.targetDir,{recursive:!0});let o=0,s=0,c=0;for(let l=0;l<i.length;l++){let u=i[l],d;try{d=await ee(e.fetch,e.fs,e.repo,t,u,e.targetDir,n,r,a.get(u))}catch(e){throw new ne(u,e)}c+=d.bytes,d.status===`downloaded`?o+=1:s+=1,e.progress?.onFile?.({file:u,status:d.status,bytes:d.bytes,index:l+1,total:i.length})}return{repo:e.repo,revision:t,targetDir:e.targetDir,files:i,downloaded:o,skipped:s,totalBytes:c}}function b(e,...t){return`/${[e,...t].join(`/`).split(`/`).filter(e=>e.length>0).join(`/`)}`}function ie(e){let t=JSON.stringify(e);return[`// ${s}`,`const { start } = require('sliccy:exec');`,`const __bin = ${t};`,`const __argv = ['ipx', '--global', __bin, ...process.argv.slice(2)];`,`const __stdin = typeof stdin !== 'undefined' ? stdin : undefined;`,`const __h = start(__argv, __stdin !== undefined ? { stdin: __stdin } : undefined);`,`__h.stdin.end();`,`const __r = await __h.done;`,`if (__r.stdout) process.stdout.write(__r.stdout);`,`if (__r.stderr) process.stderr.write(__r.stderr);`,`process.exit(__r.exitCode);`,``].join(`
1
+ import{t as e}from"./types-D8gIX-W-.js";import"./fs-DVCrh9Uh.js";import{n as t,t as n}from"./browser-2rCVqcqy.js";import{A as r,D as i,E as a,M as o,O as s,T as c,j as l,k as u,w as d}from"./shared-C_68vn79.js";const f=`https://${[`huggingface`,`co`].join(`.`)}`;function p(e){let t=e?.trim();if(!t)return f;try{let e=new URL(t);return e.protocol!==`http:`&&e.protocol!==`https:`?f:e.href.replace(/\/+$/,``)}catch{return f}}function m(e,t,n){return`${e}/api/models/${t}/tree/${n}?recursive=true`}function h(e,t,n,r){return`${e}/${t}/resolve/${n}/${r}`}function g(e){try{return new URL(e).host}catch{return e}}async function _(e,t,n){try{return await e(t,n)}catch(e){let n=e instanceof Error?e.message:String(e);throw Error(`request to ${g(t)} failed (${n}); check the bridge fetch-proxy is reachable`)}}async function v(e,t,n,r=f){let i=await _(e,m(r,t,n),{method:`GET`});if(i.status<200||i.status>=300)throw Error(`HF API ${i.status} ${i.statusText} for ${t}@${n}`);let a=new TextDecoder(`utf-8`).decode(i.body);return JSON.parse(a).filter(e=>e.type===`file`).map(e=>({path:e.path,size:typeof e.size==`number`?e.size:0}))}async function y(e,t){let n=t.lastIndexOf(`/`);if(n<=0)return;let r=t.slice(0,n);await e.mkdir(r,{recursive:!0})}async function ee(e,t,n,r,i,a,o,s,c){let l=`${a}/${i}`;if(!o&&await t.exists(l))try{let e=await t.stat(l);if(c===void 0||c<=0||e.size===c)return{status:`skipped`,bytes:e.size??0}}catch{}let u=await _(e,h(s,n,r,i),{method:`GET`});if(u.status<200||u.status>=300)throw Error(`HTTP ${u.status} ${u.statusText} for ${i}`);return await y(t,l),await t.writeFile(l,u.body),{status:`downloaded`,bytes:u.body.byteLength}}function te(e,t,n){let r=t??`/workspace/models/${e}`;return(r.startsWith(`/`)?r:`${n.replace(/\/+$/,``)}/${r}`).replace(/\/+$/,``)}var ne=class extends Error{file;constructor(e,t){super(t instanceof Error?t.message:String(t)),this.name=`HfFileDownloadError`,this.file=e}};async function re(e){let t=e.revision??`main`,n=e.force??!1,r=p(e.endpoint),i=e.files??[],a=new Map;if(i.length===0){let n=await v(e.fetch,e.repo,t,r);if(n.length===0)throw Error(`repo ${e.repo}@${t} has no files`);i=n.map(e=>e.path);for(let e of n)a.set(e.path,e.size);let o=n.reduce((e,t)=>e+t.size,0);e.progress?.onListed?.({files:i,totalBytes:o})}await e.fs.mkdir(e.targetDir,{recursive:!0});let o=0,s=0,c=0;for(let l=0;l<i.length;l++){let u=i[l],d;try{d=await ee(e.fetch,e.fs,e.repo,t,u,e.targetDir,n,r,a.get(u))}catch(e){throw new ne(u,e)}c+=d.bytes,d.status===`downloaded`?o+=1:s+=1,e.progress?.onFile?.({file:u,status:d.status,bytes:d.bytes,index:l+1,total:i.length})}return{repo:e.repo,revision:t,targetDir:e.targetDir,files:i,downloaded:o,skipped:s,totalBytes:c}}function b(e,...t){return`/${[e,...t].join(`/`).split(`/`).filter(e=>e.length>0).join(`/`)}`}function ie(e){let t=JSON.stringify(e);return[`// ${s}`,`const { start } = require('sliccy:exec');`,`const __bin = ${t};`,`const __argv = ['ipx', '--global', __bin, ...process.argv.slice(2)];`,`const __stdin = typeof stdin !== 'undefined' ? stdin : undefined;`,`const __h = start(__argv, __stdin !== undefined ? { stdin: __stdin } : undefined);`,`__h.stdin.end();`,`const __r = await __h.done;`,`if (__r.stdout) process.stdout.write(__r.stdout);`,`if (__r.stderr) process.stderr.write(__r.stderr);`,`process.exit(__r.exitCode);`,``].join(`
2
2
  `)}var ae=class extends Error{binName;path;constructor(e,t){super(`ipk: refusing to overwrite user script at ${t} (bin '${e}')`),this.binName=e,this.path=t,this.name=`GlobalBinCollisionError`}};async function x(e,t){if(t.size!==0){await e.exists(`/shared/bin`)||await e.mkdir(u,{recursive:!0});for(let n of t){if(!n||n.includes(`/`))continue;let t=b(u,`${n}.jsh`);if(await e.exists(t)&&!await S(e,t))throw new ae(n,t)}}}async function S(e,t){try{let n=await e.readFile(t);return(typeof n==`string`?n:new TextDecoder().decode(n)).includes(s)}catch{return!1}}async function C(e,t){if(!await e.exists(`/shared/bin`)){if(t.size===0)return;await e.mkdir(u,{recursive:!0})}let n=[];try{n=await e.readDir(u)}catch{n=[]}for(let r of n){if(r.type!==`file`||!r.name.endsWith(`.jsh`))continue;let n=r.name.slice(0,-4);if(t.has(n))continue;let i=b(u,r.name);await S(e,i)&&await e.rm(i)}for(let n of t){if(!n||n.includes(`/`))continue;let t=b(u,`${n}.jsh`);if(await e.exists(t)&&!await S(e,t))throw new ae(n,t);await e.writeFile(t,ie(n))}}const oe={0:`file`,1:`hardLink`,2:`symbolicLink`,3:`characterDevice`,4:`blockDevice`,5:`directory`,6:`fifo`,7:`contiguousFile`,g:`globalExtendedHeader`,x:`extendedHeader`,D:`gnuDirectory`,I:`gnuInodeMetadata`,K:`gnuLongLinkName`,L:`gnuLongFileName`,N:`gnuOldLongFileName`,M:`gnuMultiVolume`,S:`gnuSparseFile`,E:`gnuExtendedSparse`,A:`solarisAcl`,V:`solarisVolumeLabel`,X:`solarisOldExtendedHeader`};function se(e,t){let n=e.buffer||e,r=[],i=0,a,o;for(;i<n.byteLength-512;){let e=w(n,i,100);if(e.length===0)break;if(a){let t=a.path||a.linkpath;t&&(e=t)}let s=w(n,i+100,8).trim(),c=Number.parseInt(w(n,i+108,8)),l=Number.parseInt(w(n,i+116,8)),u=le(n,i+124,12),d=512+512*Math.trunc(u/512)+(u%512?512:0),f=le(n,i+136,12),p=w(n,i+156,1)||`0`,m=oe[p]||p;switch(m){case`extendedHeader`:case`globalExtendedHeader`:{let e=ue(new Uint8Array(n,i+512,u));m===`extendedHeader`?a=e:(a=void 0,o={...o,...e}),i+=d;continue}case`gnuLongFileName`:case`gnuOldLongFileName`:case`gnuLongLinkName`:a={path:w(n,i+512,u)},i+=d;continue}let h=w(n,i+265,32),g=w(n,i+297,32);e=ce(e);let _={name:e,type:m,size:u,attrs:{...o,...a,mode:s,uid:c,gid:l,mtime:f,user:h,group:g}};if(a=void 0,t?.filter&&!t.filter(_)){i+=d;continue}if(t?.metaOnly){r.push(_),i+=d;continue}let v=u===0?void 0:new Uint8Array(n,i+512,u);r.push({..._,data:v,get text(){return new TextDecoder().decode(this.data)}}),i+=d}return r}function ce(e){let t=e.replace(/\\/g,`/`);t=t.replace(/^[a-zA-Z]:\//,``),t=t.replace(/^\/+/,``);let n=t.startsWith(`./`),r=t.split(`/`),i=[];for(let e of r)e===`..`?i.pop():e!==`.`&&e!==``&&i.push(e);let a=i.join(`/`);return n&&!a.startsWith(`./`)&&(a=`./`+a),e.endsWith(`/`)&&!a.endsWith(`/`)&&(a+=`/`),a}function w(e,t,n){let r=new Uint8Array(e,t,n),i=r.indexOf(0);return new TextDecoder().decode(i===-1?r:r.slice(0,i))}function le(e,t,n){let r=new Uint8Array(e,t,n),i=``;for(let e=0;e<n;e++)i+=String.fromCodePoint(r[e]);return Number.parseInt(i,8)}function ue(e){let t=new TextDecoder().decode(e),n={};for(let e of t.split(`
3
3
  `)){let t=e.split(` `)[1]?.split(`=`);t&&(n[t[0]]=t[1])}return n}function de(e,t={}){let n=e.map(e=>{let t=fe(e.data);return{...e,data:t,size:t?.length||0}}),r=0;for(let t=0;t<e.length;t++){let e=n[t].data?.length??0;r+=512+512*Math.trunc(e/512),e%512&&(r+=512)}let i=10240*Math.trunc(r/10240);r%10240&&(i+=10240);let a=new ArrayBuffer(i),o=0;for(let e of n){let n=!e.data;T(a,e.name,o,100),T(a,E(e.attrs?.mode??t.attrs?.mode??(n?`775`:`664`),7),o+100,8),T(a,E((e.attrs?.uid??t.attrs?.uid??1e3).toString(8),7),o+108,8),T(a,E((e.attrs?.gid??t.attrs?.gid??1e3).toString(8),7),o+116,8),T(a,E(e.size.toString(8),11),o+124,12);let r=e.attrs?.mtime??t.attrs?.mtime??Date.now();T(a,E(Math.trunc(r/1e3).toString(8),11),o+136,12),T(a,n?`5`:`0`,o+156,1),T(a,`ustar`,o+257,6),T(a,`00`,o+263,2),T(a,e.attrs?.user??t.attrs?.user??``,o+265,32),T(a,e.attrs?.group??t.attrs?.group??``,o+297,32),T(a,` `,o+148,8);let i=new Uint8Array(a,o,512),s=0;for(let e=0;e<512;e++)s+=i[e];if(T(a,s.toString(8),o+148,8),!n){let t=new Uint8Array(a,o+512,e.size);for(let n=0;n<e.size;n++)t[n]=e.data[n];o+=512*Math.trunc(e.size/512),e.size%512&&(o+=512)}o+=512}return new Uint8Array(a)}function T(e,t,n,r){let i=new Uint8Array(e,n,r),a=new TextEncoder().encodeInto(t,i).written;for(let e=a;e<r;e++)i[e]=0}function E(e,t){return String(e).padStart(t,`0`)}function fe(e){if(e!=null)return typeof e==`string`?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):e}function pe(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e:new Uint8Array(e)}function D(e){if(!(e instanceof Uint8Array))throw Error(`gunzip: input must be a Uint8Array`);if(e.length<18||e[0]!==31||e[1]!==139)throw Error(`gunzip: input is not a valid gzip stream (bad magic)`);try{return n(e)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`gunzip: failed to decompress (${t})`)}}function me(e){if(!(e instanceof Uint8Array))throw Error(`gzip: input must be a Uint8Array`);try{return t(e)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`gzip: failed to compress (${t})`)}}function he(e){if(!Array.isArray(e))throw Error(`writeTar: entries must be an array`);try{return de(e.map(e=>({name:e.path,...e.directory?{}:{data:e.bytes}})))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`writeTar: failed to create tar archive (${t})`)}}function ge(e){return e.startsWith(`package/`)?e.slice(8):e}function O(e,t,n){let r=new Uint8Array(e,t,n),i=r.indexOf(0);return new TextDecoder().decode(i===-1?r:r.subarray(0,i))}function _e(e,t,n){let r=new Uint8Array(e,t,n),i=``;for(let e=0;e<n;e++)i+=String.fromCodePoint(r[e]);return Number.parseInt(i,8)}function ve(e,t,n){let r=new TextDecoder().decode(new Uint8Array(e,t,n)),i,a;for(let e of r.split(`
4
4
  `)){let t=e.split(` `)[1]?.split(`=`);t&&(t[0]===`path`?i=t[1]:t[0]===`linkpath`&&(a=t[1]))}return i||a}function ye(e){let t=e.replace(/\\/g,`/`);t=t.replace(/^[a-zA-Z]:\//,``),t=t.replace(/^\/+/,``);let n=t.startsWith(`./`),r=t.split(`/`),i=[];for(let e of r)e===`..`?i.pop():e!==`.`&&e!==``&&i.push(e);let a=i.join(`/`);return n&&!a.startsWith(`./`)&&(a=`./`+a),e.endsWith(`/`)&&!a.endsWith(`/`)&&(a+=`/`),a}function be(e,t){let n=e.buffer,r=[],i=0,a;for(;i<n.byteLength-512;){let e=O(n,i,100);if(e.length===0)break;let o=_e(n,i+124,12),s=512+512*Math.trunc(o/512)+(o%512?512:0),c=O(n,i+156,1)||`0`;if(c===`x`||c===`g`){a=c===`x`?ve(n,i+512,o):void 0,i+=s;continue}if(c===`L`||c===`N`||c===`K`){a=O(n,i+512,o),i+=s;continue}let l;if(a)l=a;else{let t=O(n,i+345,155);l=t.length>0?`${t}/${e}`:e}r.push(t?l:ye(l)),a=void 0,i+=s}return r}function k(e,t={}){if(!(e instanceof Uint8Array))throw Error(`readTar: input must be a Uint8Array`);let n=pe(e),r;try{r=se(n)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`readTar: failed to parse tar archive (${t})`)}let i=t.stripNpmPrefix??!0,a=t.includeDirectories??!1,o=be(n,t.preserveRawPaths??!1),s=o.length===r.length;if(t.preserveRawPaths&&!s)throw Error(`readTar: raw path resolution did not align with archive entries`);let c=[];return r.forEach((e,t)=>{let n=e.type===`directory`;if(!n&&e.type!==`file`&&e.type!==`contiguousFile`||n&&!a)return;let r=s?o[t]:e.name;c.push({path:i?ge(r):r,bytes:e.data?e.data.slice():new Uint8Array,...n?{directory:!0}:{}})}),c}function A(e){let t=(e??``).trim();if(!t)throw Error(`ipk: package spec is required`);if(t.startsWith(`@`)){let e=t.indexOf(`/`);if(e===-1)throw Error(`ipk: scoped spec '${t}' is missing a name (expected @scope/name)`);let n=t.slice(e+1),r=n.indexOf(`@`),i=t.slice(0,e);return r===-1?{name:`${i}/${n}`,range:``}:{name:`${i}/${n.slice(0,r)}`,range:n.slice(r+1)}}let n=t.indexOf(`@`);return n===-1?{name:t,range:``}:{name:t.slice(0,n),range:t.slice(n+1)}}function j(e,...t){return`/${[e,...t].join(`/`).split(`/`).filter(e=>e.length>0).join(`/`)}`}function M(e,t){if(t.startsWith(`@`)){let[n,r]=t.split(`/`,2);return j(e,n,r)}return j(e,t)}async function N(e,t){await e.mkdir(t,{recursive:!0})}async function P(e,t){await e.exists(t)&&await e.rm(t,{recursive:!0})}function xe(e){return`^${e}`}function Se(e,t){let n=e.range.trim();return n===``||n===`*`||n===`latest`||/^[A-Za-z][A-Za-z0-9_-]*$/.test(n)?xe(t):n}async function Ce(e,t,n){for(let r of n){if(!r.path)continue;let n=r.path.replace(/\\/g,`/`).replace(/^\/+/,``);if(n.split(`/`).some(e=>e===`..`))throw Error(`installer: refusing to extract entry escaping package root: ${r.path}`);let i=j(t,n),a=i.lastIndexOf(`/`);a>0&&await N(e,i.slice(0,a)),await e.writeFile(i,r.bytes)}}async function F(t,n,r){let i;try{i=await t.readFile(n)}catch(t){if(t instanceof e&&t.code===`ENOENT`)return r;throw t}return JSON.parse(i)}async function I(t,n,r){let i;try{i=await t.readFile(n)}catch(t){if(t instanceof e&&t.code===`ENOENT`)return r;throw t}if(!i?.trim())return r;try{return JSON.parse(i)}catch{return r}}const L=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`];function R(e,t){return e!==void 0&&Object.hasOwn(e,t)}function z(e,t,n){return n||R(e.devDependencies,t)?`devDependencies`:R(e.optionalDependencies,t)?`optionalDependencies`:R(e.peerDependencies,t)?`peerDependencies`:`dependencies`}function we(e,t){let n=e[z(e,t,!1)]?.[t];return typeof n==`string`&&n.trim()!==``?n:void 0}function Te(e,t){if(e.range.trim()!==``)return e;let n=we(t,e.name);return n===void 0?e:{name:e.name,range:n}}function Ee(e,t){let n={dependencies:{...e.dependencies??{}},devDependencies:{...e.devDependencies??{}},optionalDependencies:{...e.optionalDependencies??{}},peerDependencies:{...e.peerDependencies??{}}},r=new Set;for(let e of t){for(let t of L)delete n[t][e.name];n[e.section][e.name]=e.range,r.add(e.section)}let i={...e};for(let t of L)(e[t]!==void 0||r.has(t))&&(i[t]=n[t]);return i}function B(e,t){let n=new Map;return{supplier:async r=>{let i=n.get(r);return i||(i=await c(r,e,{timeoutMs:t}),n.set(r,i),i)},cache:n}}async function De(e,t,n){let r=[],a=[],o=new Set;for(let s of e){let e;try{e=A(s)}catch(e){a.push({spec:s,error:V(e)});continue}if(n&&(e=Te(e,n)),o.has(e.name)){let t=r.findIndex(t=>t.parsed.name===e.name);t>=0&&r.splice(t,1)}try{let n=await t(e.name);i(n,e.range)}catch(e){a.push({spec:s,error:V(e)});continue}r.push({spec:s,parsed:e}),o.add(e.name)}return{directs:r,errors:a}}function V(e){return e instanceof Error?e:Error(String(e))}async function H(e,t,n,r,i){let o=M(t,n.name),s=j(o,`package.json`),c=!1;if(await e.exists(s)&&(await I(e,s,null))?.version===n.version&&(c=!0),!c){let t=k(D(await a(n.resolved,r,{timeoutMs:i})));await P(e,o),await N(e,o);try{await Ce(e,o,t)}catch(t){throw await P(e,o),t}}let l=Object.keys(n.dependencies);if(l.length>0){let t=j(o,`node_modules`);await N(e,t);for(let a of l)await H(e,t,n.dependencies[a],r,i)}}async function U(e,t,n,r,i){let a=Object.keys(n.root);if(a.length!==0){await N(e,t);for(let o of a)await H(e,t,n.root[o],r,i)}}function Oe(e){if(e.startsWith(`@`)){let t=e.indexOf(`/`);if(t!==-1)return e.slice(t+1)}return e}function W(e,t){return typeof e==`string`?{[Oe(t)]:e}:e}function ke(e){return e.replace(/^\.\//,``).replace(/^\/+/,``)}function Ae(e){return`#!/usr/bin/env node\nrequire(${JSON.stringify(e)});\n`}async function G(e,t){let n=[];return await K(e,t,0,n),n}async function K(e,t,n,r){if(!await e.exists(t))return;let i;try{i=await e.readDir(t)}catch{return}for(let a of i){if(a.type!==`directory`||a.name===`.bin`)continue;if(a.name.startsWith(`@`)){let i=j(t,a.name),o;try{o=await e.readDir(i)}catch{continue}for(let t of o){if(t.type!==`directory`)continue;let o=`${a.name}/${t.name}`;await q(e,j(i,t.name),o,n,r)}continue}let i=a.name;await q(e,j(t,a.name),i,n,r)}}async function q(e,t,n,r,i){let a=await I(e,j(t,`package.json`),null);if(a?.bin!==void 0&&a.bin!==null){let e=W(a.bin,n);for(let[a,o]of Object.entries(e))typeof a==`string`&&a.length!==0&&typeof o==`string`&&o.length!==0&&i.push({binName:a,pkgName:n,installDir:t,binPath:o,depth:r})}await K(e,j(t,`node_modules`),r+1,i)}function J(e){let t=new Map;for(let n of e){let e=t.get(n.binName);if(!e){t.set(n.binName,n);continue}(n.depth<e.depth||n.depth===e.depth&&n.pkgName<e.pkgName)&&t.set(n.binName,n)}return t}function je(e,t,n,r){let i=M(e,t.name);if(t.bin!==void 0&&t.bin!==null){let e=W(t.bin,t.name);for(let[a,o]of Object.entries(e))typeof a==`string`&&a.length!==0&&typeof o==`string`&&o.length!==0&&r.push({binName:a,pkgName:t.name,installDir:i,binPath:o,depth:n})}let a=j(i,`node_modules`);for(let e of Object.values(t.dependencies))je(a,e,n+1,r)}function Me(e,t){let n=[];for(let r of Object.values(e.root))je(t,r,0,n);return n}function Ne(e,t){return new Set(J(Me(e,t)).keys())}function Pe(e,t,n){return`..${t.slice(e.length)}/${ke(n)}`}async function Y(e,t){let n=J(await G(e,t)),r=j(t,`.bin`);if(await e.exists(r)){let t;try{t=await e.readDir(r)}catch{t=[]}for(let i of t)i.type===`file`&&(n.has(i.name)||await e.rm(j(r,i.name)))}if(n.size!==0){await N(e,r);for(let i of n.values()){let n=j(r,i.binName),a=Ae(Pe(t,i.installDir,i.binPath));await e.writeFile(n,a)}}}async function Fe(e,t,n){let r=j(t,`package.json`),i=Ee(await F(e,r,{}),n);return await e.writeFile(r,`${JSON.stringify(i,null,2)}\n`),r}async function Ie(e,t){let{fs:n,fetch:i,cwd:a,timeoutMs:o,global:s=!1,saveDev:c=!1}=t;if(e.length===0)return{results:[],errors:[]};let u=s?l:a,f=await F(n,j(u,`package.json`),{}),{supplier:p}=B(i,o),{directs:m,errors:h}=await De(e,p,f);if(m.length===0)return{results:[],errors:h};let g={};if(s)for(let e of Q(f))g[e.name]=e.range;for(let e of m)g[e.parsed.name]=e.parsed.range;let _=await d({rootDependencies:g,fetchPackument:p}),v=s?r:j(a,`node_modules`);if(s&&(await $(n,v,new Set(Object.keys(_.root))),await x(n,Ne(_,v))),await U(n,v,_,i,o),await Y(n,v),s){let e=J(await G(n,v));await C(n,new Set(e.keys()))}let y=await Fe(n,u,m.map(e=>{let t=_.root[e.parsed.name];if(!t)throw Error(`installer: resolved node missing for ${e.parsed.name}`);return{name:e.parsed.name,range:Se(e.parsed,t.version),section:z(f,e.parsed.name,c)}}));return{results:m.map(e=>{let t=_.root[e.parsed.name],n=M(v,e.parsed.name);return{ok:!0,name:e.parsed.name,version:t.version,installPath:n,range:Se(e.parsed,t.version),manifestPath:y}}),errors:h}}var X=class extends Error{constructor(e){super(`no package.json found at ${e} (run 'ipk install <pkg>' to create one, or add a package.json)`),this.name=`ManifestNotFoundError`}};function Z(e,t){if(!(!t||typeof t!=`object`))for(let[n,r]of Object.entries(t))typeof n==`string`&&typeof r==`string`&&e.set(n,r)}function Le(e){let t=new Map;return Z(t,e.devDependencies),Z(t,e.dependencies),Array.from(t.entries()).map(([e,t])=>({name:e,range:t}))}function Q(e){let t=new Map;return Z(t,e.dependencies),Z(t,e.peerDependencies),Z(t,e.optionalDependencies),Z(t,e.devDependencies),Array.from(t.entries()).map(([e,t])=>({name:e,range:t}))}async function Re(e){let{fs:t,fetch:n,cwd:r,timeoutMs:a}=e,o=j(r,`package.json`);if(!await t.exists(o))throw new X(o);let s=Le(await F(t,o,{}));if(s.length===0)return{results:[],errors:[],empty:!0};let{supplier:c}=B(n,a),l=[],u=[];for(let e of s)try{let t=await c(e.name);i(t,e.range),l.push(e)}catch(t){u.push({spec:`${e.name}@${e.range}`,error:V(t)})}if(l.length===0)return{results:[],errors:u,empty:!1};let f={};for(let e of l)f[e.name]=e.range;let p=await d({rootDependencies:f,fetchPackument:c}),m=j(r,`node_modules`);return await U(t,m,p,n,a),await Y(t,m),{results:l.map(e=>{let t=p.root[e.name];return t?{ok:!0,name:e.name,version:t.version,installPath:M(m,e.name),range:e.range,manifestPath:o}:null}).filter(e=>e!==null),errors:u,empty:!1}}function ze(e,t){return L.some(n=>R(e[n],t))}function Be(e,t){let n={...e};for(let r of L){let i={...e[r]??{}};for(let e of t)delete i[e];e[r]!==void 0&&(n[r]=i)}return n}async function Ve(e,t,n){await e.writeFile(t,`${JSON.stringify(n,null,2)}\n`)}async function $(e,t,n){if(!await e.exists(t))return;let r;try{r=await e.readDir(t)}catch{return}for(let i of r)if(i.name!==`.bin`&&i.type===`directory`){if(i.name.startsWith(`@`)){let r=j(t,i.name),a;try{a=await e.readDir(r)}catch{continue}for(let t of a){if(t.type!==`directory`)continue;let a=`${i.name}/${t.name}`;n.has(a)||await P(e,j(r,t.name))}continue}n.has(i.name)||await P(e,j(t,i.name))}}async function He(e,t,n,i){let a=Q(i??await F(e,o,{}));if(a.length===0){await P(e,r),await C(e,new Set);return}let{supplier:s}=B(t,n),c={};for(let e of a)c[e.name]=e.range;let l=await d({rootDependencies:c,fetchPackument:s});await $(e,r,new Set(Object.keys(l.root))),await x(e,Ne(l,r)),await U(e,r,l,t,n),await Y(e,r);let u=J(await G(e,r));await C(e,new Set(u.keys()))}async function Ue(e,t){let{fs:n,fetch:r,cwd:i,timeoutMs:a,global:o=!1}=t;if(e.length===0)return{results:[],errors:[]};let s=new Set,c=[];for(let t of e)try{s.add(A(t).name)}catch(e){c.push({spec:t,error:V(e)})}if(s.size===0)return{results:[],errors:c};let u=j(o?l:i,`package.json`);if(!await n.exists(u)){for(let t of e)c.push({spec:t,error:new X(u)});return{results:[],errors:c}}let d=await F(n,u,{}),f=[];for(let e of s)f.push({name:e,removed:ze(d,e)});let p=Be(d,s);try{o?await He(n,r,a,p):await We(n,r,i,a,p)}catch(t){return c.push({spec:e.join(` `),error:V(t)}),{results:f,errors:c}}return await Ve(n,u,p),{results:f,errors:c}}async function We(e,t,n,r,i){let a=j(n,`package.json`),o=Q(i??await F(e,a,{})),s=j(n,`node_modules`);if(o.length===0){await P(e,s);return}let{supplier:c}=B(t,r),l={};for(let e of o)l[e.name]=e.range;let u=await d({rootDependencies:l,fetchPackument:c});await $(e,s,new Set(Object.keys(u.root))),await U(e,s,u,t,r),await Y(e,s)}async function Ge(e){let t=Q(await F(e,o,{})),n=[];for(let i of t){let t=await I(e,j(M(r,i.name),`package.json`),{});n.push({name:i.name,version:typeof t.version==`string`?t.version:`?`,range:i.range})}return n.sort((e,t)=>e.name.localeCompare(t.name)),n}async function Ke(e,t){let n=j(t,`package.json`);if(!await e.exists(n))return[];let r=Q(await F(e,n,{})),i=j(t,`node_modules`),a=[];for(let t of r){let n=await I(e,j(M(i,t.name),`package.json`),{});a.push({name:t.name,version:typeof n.version==`string`?n.version:`?`,range:t.range})}return a.sort((e,t)=>e.name.localeCompare(t.name)),a}export{Ke as a,me as c,ne as d,re as f,Ge as i,k as l,Re as n,Ue as o,te as p,Ie as r,D as s,X as t,he as u};
@@ -7,7 +7,7 @@ e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=
7
7
  * @author Feross Aboukhadijeh <https://feross.org>
8
8
  * @license MIT
9
9
  */
10
- let r=t(),i=n(),a=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=l,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;let o=2147483647;e.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=s(),!l.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function c(e){if(e>o)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return p(e)}return u(e,t,n)}l.poolSize=8192;function u(e,t,n){if(typeof e==`string`)return m(e,t);if(ArrayBuffer.isView(e))return g(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return _(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return l.from(r,t,n);let i=v(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return l.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}l.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function d(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function f(e,t,n){return d(e),e<=0||t===void 0?c(e):typeof n==`string`?c(e).fill(t,n):c(e).fill(t)}l.alloc=function(e,t,n){return f(e,t,n)};function p(e){return d(e),c(e<0?0:y(e)|0)}l.allocUnsafe=function(e){return p(e)},l.allocUnsafeSlow=function(e){return p(e)};function m(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!l.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=x(e,t)|0,r=c(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function h(e){let t=e.length<0?0:y(e.length)|0,n=c(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function g(e){if(N(e,Uint8Array)){let t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return h(e)}function _(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function v(e){if(l.isBuffer(e)){let t=y(e.length)|0,n=c(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||De(e.length)?c(0):h(e);if(e.type===`Buffer`&&Array.isArray(e.data))return h(e.data)}function y(e){if(e>=o)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+o.toString(16)+` bytes`);return e|0}function b(e){return+e!=e&&(e=0),l.alloc(+e)}l.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==l.prototype},l.compare=function(e,t){if(N(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},l.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return l.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=l.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(N(t,Uint8Array))i+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(l.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function x(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return Se(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return Te(e).length;default:if(i)return r?-1:Se(e).length;t=(``+t).toLowerCase(),i=!0}}l.byteLength=x;function S(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return ce(this,t,n);case`utf8`:case`utf-8`:return re(this,t,n);case`ascii`:return oe(this,t,n);case`latin1`:case`binary`:return se(this,t,n);case`base64`:return ne(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return le(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}l.prototype._isBuffer=!0;function C(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}l.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)C(this,t,t+1);return this},l.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},l.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},l.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?re(this,0,e):S.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||l.compare(this,e)===0},l.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(N(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,s=Math.min(a,o),c=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<s;++e)if(c[e]!==u[e]){a=c[e],o=u[e];break}return a<o?-1:+(o<a)};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,De(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(i)n=0;else return-1}if(typeof t==`string`&&(t=l.from(t,r)),l.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}l.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},l.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(De(r))return o;e[n+o]=r}return o}function D(e,t,n,r){return Ee(Se(t,e.length-n),e,n,r)}function O(e,t,n,r){return Ee(Ce(t),e,n,r)}function ee(e,t,n,r){return Ee(Te(t),e,n,r)}function te(e,t,n,r){return Ee(we(t,e.length-n),e,n,r)}l.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return ee(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return te(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function ne(e,t,n){return t===0&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function re(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return ae(r)}let ie=4096;function ae(e){let t=e.length;if(t<=ie)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ie));return n}function oe(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function se(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ce(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=Oe[e[r]];return i}function le(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}l.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r};function k(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=P(function(e){e>>>=0,ve(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ye(e,this.length-8);let r=t+this[++e]*256+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*256+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),l.prototype.readBigUInt64BE=P(function(e){e>>>=0,ve(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ye(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*256+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*256+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},l.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=P(function(e){e>>>=0,ve(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ye(e,this.length-8);let r=this[e+4]+this[e+5]*256+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*2**16+this[++e]*2**24)}),l.prototype.readBigInt64BE=P(function(e){e>>>=0,ve(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ye(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*256+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*256+n)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!1,52,8)};function A(e,t,n,r,i,a){if(!l.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;A(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;A(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,255,0),this[t]=e&255,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ue(e,t,n,r,i){M(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function de(e,t,n,r,i){M(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}l.prototype.writeBigUInt64LE=P(function(e,t=0){return ue(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),l.prototype.writeBigUInt64BE=P(function(e,t=0){return de(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);A(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);A(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},l.prototype.writeBigInt64LE=P(function(e,t=0){return ue(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),l.prototype.writeBigInt64BE=P(function(e,t=0){return de(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function fe(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function pe(e,t,n,r,a){return t=+t,n>>>=0,a||fe(e,t,n,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,n,r,23,4),n+4}l.prototype.writeFloatLE=function(e,t,n){return pe(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return pe(this,e,t,!1,n)};function me(e,t,n,r,a){return t=+t,n>>>=0,a||fe(e,t,n,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,n,r,52,8),n+8}l.prototype.writeDoubleLE=function(e,t,n){return me(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return me(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!l.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=l.isBuffer(e)?e:l.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let he={};function ge(e,t,n){he[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ge(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),ge(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),ge(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=j(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function j(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function _e(e,t,n){ve(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&ye(t,e.length-(n+1))}function M(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new he.ERR_OUT_OF_RANGE(`value`,i,e)}_e(r,i,a)}function ve(e,t){if(typeof e!=`number`)throw new he.ERR_INVALID_ARG_TYPE(t,`number`,e)}function ye(e,t,n){throw Math.floor(e)===e?t<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(ve(e,n),new he.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let be=/[^+/0-9A-Za-z-_]/g;function xe(e){if(e=e.split(`=`)[0],e=e.trim().replace(be,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function Se(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function Ce(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function we(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Te(e){return r.toByteArray(xe(e))}function Ee(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function N(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function De(e){return e!==e}let Oe=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function P(e){return typeof BigInt>`u`?ke:e}function ke(){throw Error(`BigInt not supported`)}})),i=r();globalThis.Buffer===void 0&&(globalThis.Buffer=i.Buffer);function a(){return{version:`6.162.0`,releasedAt:`2026-09-16T21:49:20Z`,buildId:`6.162.0-mu4mvfxb`}}function o(e){if(!e||e===`/`)return`/`;e.startsWith(`/`)||(e=`/`+e);let t=e.split(`/`),n=[];for(let e of t)e!==``&&e!==`.`&&(e===`..`?n.pop():n.push(e));return`/`+n.join(`/`)}function s(e){let t=o(e);if(t===`/`)return`/`;let n=t.lastIndexOf(`/`);return n===0?`/`:t.slice(0,n)}function c(e){return Object.assign(Error(`ENOENT: no such file or directory, '${e}'`),{code:`ENOENT`})}function l(e){return Object.assign(Error(`ENOSYNC: file too large for sync access, '${e}' — use async readFile() instead`),{code:`ENOSYNC`})}function u(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var d=class{tree=new Map;initialPaths=new Set;initialContent=new Map;initialKind=new Map;mkdtempCounter=0;tombstones=new Set;removedDirs=new Set;touched=!1;constructor(e){this.loadSnapshot(e)}loadSnapshot(e){this.tree=new Map,this.tombstones=new Set,this.removedDirs=new Set,this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map,this.tree.set(`/`,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(`/`),this.initialKind.set(`/`,`directory`);for(let t of e.entries){let e=o(t.path);this.tree.set(e,{content:t.content,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,symlinkTarget:t.symlinkTarget,truncated:t.truncated,size:t.size}),this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}for(let t of e.entries){let e=s(o(t.path));for(;e!==`/`&&!this.tree.has(e);)this.tree.set(e,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(e),this.initialKind.set(e,`directory`),e=s(e)}}wasUsed(){return this.touched}applySnapshot(e){this.loadSnapshot(e)}applySnapshotPreservingMutations(e){let t=this.getMutations();this.loadSnapshot(e);for(let e of t.deleted){if(this.tree.get(e)?.isDirectory){let t=e===`/`?`/`:e+`/`;for(let n of Array.from(this.tree.keys()))n!==e&&n.startsWith(t)&&this.tree.delete(n)}this.tree.delete(e)}for(let e of t.created)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink,symlinkTarget:e.symlinkTarget});for(let e of t.modified)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:!1})}invalidate(){this.loadSnapshot({entries:[]})}resetBaseline(){this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map;for(let[e,t]of this.tree.entries())this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}entryKind(e){return e.isSymbolicLink?`symlink`:e.isDirectory?`directory`:`file`}resolveEntry(e,t=!1){let n=o(e),r=n.split(`/`).filter(Boolean),i=[],a=new Set,c=0;if(r.length===0){let e=this.tree.get(`/`);return e?{path:`/`,entry:e}:void 0}for(;r.length>0;){let e=r.shift(),l=`/${[...i,e].join(`/`)}`,u=this.tree.get(l);if(!u)return;let d=r.length===0;if(u.isSymbolicLink&&!(t&&d)){if(a.has(l)||c++===40)throw Object.assign(Error(`ELOOP: too many symbolic links, '${n}'`),{code:`ELOOP`});a.add(l);let e=u.symlinkTarget??``;r=[...o(e.startsWith(`/`)?e:`${s(l)}/${e}`).split(`/`).filter(Boolean),...r],i=[];continue}if(!d&&!u.isDirectory)return;if(i.push(e),d)return{path:l,entry:u}}}ensureParentDirs(e){let t=s(e);t!==`/`&&(this.tree.has(t)||this.mkdir(t,!0,!0))}isPartial(e){return this.tree.get(o(e))?.partial===!0}commitWrite(e,t){this.writeFile(e,t);let n=o(e);for(this.initialContent.set(n,t);n!==`/`;){let e=this.tree.get(n);e&&(this.initialPaths.add(n),this.initialKind.set(n,this.entryKind(e))),n=s(n)}}readFile(e){this.touched=!0;let t=o(e),n=this.resolveEntry(t)?.entry;if(!n||n.isDirectory)throw c(t);if(n.truncated)throw l(t);return n.content}writeFile(e,t){this.touched=!0;let n=o(e);this.ensureParentDirs(n),this.tree.set(n,{content:t,isDirectory:!1}),this.tombstones.delete(n),this.removedDirs.delete(n)}exists(e){this.touched=!0;let t=o(e);return this.tree.has(t)}stat(e){this.touched=!0;let t=o(e),n=this.resolveEntry(t);if(!n)throw c(t);return this.toStat(n.entry)}lstat(e){this.touched=!0;let t=o(e),n=this.resolveEntry(t,!0);if(!n)throw c(t);return this.toStat(n.entry)}toStat(e){return{isFile:!e.isDirectory&&!e.isSymbolicLink,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink===!0,size:e.isDirectory?0:e.size??e.content.byteLength}}readdir(e){this.touched=!0;let t=o(e),n=this.resolveEntry(t);if(!n?.entry.isDirectory)throw c(t);let r=n.path===`/`?`/`:n.path+`/`,i=new Set;for(let e of this.tree.keys()){if(e===t||e===`/`||!e.startsWith(r))continue;let n=e.slice(r.length).split(`/`)[0];n&&i.add(n)}return Array.from(i)}mkdir(e,t,n=!1){this.touched=!0;let r=o(e);if(this.tree.has(r)){if(this.tree.get(r).isDirectory)return;throw Object.assign(Error(`EEXIST: file already exists, '${r}'`),{code:`EEXIST`})}let i=s(r);if(i!==`/`&&!this.tree.has(i)){if(!t)throw c(r);this.mkdir(i,!0,n)}this.tree.set(r,{content:new Uint8Array,isDirectory:!0,...n?{partial:!0}:{}}),this.tombstones.delete(r),this.removedDirs.delete(r)}rm(e,t){this.touched=!0;let n=o(e),r=this.tree.get(n);if(!r)throw c(n);if(r.isDirectory&&!r.isSymbolicLink){let e=n===`/`?`/`:n+`/`,r=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));if(r.length>0&&!t)throw Object.assign(Error(`ENOTEMPTY: directory not empty, '${n}'`),{code:`ENOTEMPTY`});for(let e of r)this.tree.delete(e),this.tombstones.add(e);t&&this.removedDirs.add(n)}this.tree.delete(n),this.tombstones.add(n)}copyFile(e,t){this.touched=!0;let n=o(e),r=this.tree.get(n);if(!r||r.isDirectory)throw c(n);if(r.truncated)throw l(n);let i=o(t);this.ensureParentDirs(i),this.tree.set(i,{content:r.content.slice(),isDirectory:!1}),this.tombstones.delete(i),this.removedDirs.delete(i)}rename(e,t){this.touched=!0;let n=o(e),r=this.tree.get(n);if(!r)throw c(n);let i=o(t);if(r.isDirectory){let e=n===`/`?`/`:n+`/`,t=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n);for(let e of t){let t=this.tree.get(e),r=i+e.slice(n.length);this.tree.set(r,t),this.tree.delete(e)}this.tombstones.add(n),this.removedDirs.add(n),this.tombstones.delete(i),this.removedDirs.delete(i);return}this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n),this.tombstones.add(n),this.tombstones.delete(i),this.removedDirs.delete(i)}unlink(e){this.touched=!0;let t=o(e),n=this.tree.get(t);if(!n)throw c(t);if(n.isDirectory&&!n.isSymbolicLink)throw Object.assign(Error(`EISDIR: illegal operation on a directory, unlink '${t}'`),{code:`EISDIR`});this.tree.delete(t),this.tombstones.add(t)}markRemoved(e,t=!1){this.touched=!0;let n=o(e);this.tombstones.add(n),t&&this.removedDirs.add(n)}isTombstoned(e){let t=o(e);if(this.tombstones.has(t))return!0;for(let e of this.removedDirs)if(t===e||t.startsWith(`${e}/`))return!0;return!1}mkdtemp(e){this.touched=!0;for(let t=0;t<100;t++){let t=`_${String(this.mkdtempCounter).padStart(6,`0`)}`;this.mkdtempCounter++;let n=o(e+t);if(!this.tree.has(n))return this.mkdir(n,!0),n}throw Error(`mkdtemp: failed to create unique directory after 100 attempts`)}getMutations(){let e=[],t=[],n=[];for(let[r,i]of this.tree.entries()){if(r===`/`)continue;if(!this.initialPaths.has(r)){e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}let a=this.initialKind.get(r);if(a!==void 0&&a!==this.entryKind(i)){n.push(r),e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}if(!i.isDirectory&&!i.isSymbolicLink){let e=this.initialContent.get(r);e&&!u(e,i.content)&&t.push({path:r,content:i.content})}}for(let e of this.initialPaths)e!==`/`&&(this.tree.has(e)||n.push(e));return{created:e,modified:t,deleted:n}}};function f(){return globalThis.Buffer}function p(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function m(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function h(e,t){return Object.assign(Error(`EBADF: bad file descriptor, ${e} ${String(t)}`),{code:`EBADF`})}function g(e){return e===`/dev/stdin`||e===`/dev/stdout`||e===`/dev/stderr`}function _(e){if(e===0||e===`/dev/stdin`)return 0;if(e===1||e===`/dev/stdout`)return 1;if(e===2||e===`/dev/stderr`)return 2}function v(e,t){let n=_(e);if(n===0)return!0;if(n!==void 0||typeof e==`number`)throw h(t,e);return!1}function y(e,t,n){let r=_(t);if(r===1)return e.writeStdout;if(r===2)return e.writeStderr;if(r!==void 0||typeof t==`number`)throw h(n,t)}function b(e){return typeof e==`string`?e:m(re(e))}function x(e,t){if(t===`utf8`||t===`utf-8`)return new TextDecoder().decode(e);let n=f();return n?n.from(e):e}function S(e){return typeof e==`string`?e:e?.encoding}function C(){return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,isCharacterDevice:()=>!0,size:0}}function w(e,t){if(!t)return;let n={readFile:e.readFile,readFileBinary:e.readFileBinary,writeFile:e.writeFile,writeFileBinary:e.writeFileBinary,appendFile:e.appendFile,access:e.access,exists:e.exists,stat:e.stat};e.readFile=async(e,r)=>{if(!v(e,`read`))return n.readFile(e,r);let i=S(r);if(i===null||i===`buffer`){let e=f(),n=t.readStdinBytes();return e?e.from(n):n}return new TextDecoder().decode(t.readStdinBytes())},e.readFileBinary=async e=>v(e,`read`)?t.readStdinBytes():n.readFileBinary(e),e.writeFile=async(e,r)=>{let i=y(t,e,`write`);return i?(i(b(r)),!0):n.writeFile(e,r)},e.writeFileBinary=async(e,r)=>{let i=y(t,e,`write`);return i?(i(m(r)),!0):n.writeFileBinary(e,r)},e.appendFile=async(e,r)=>{let i=y(t,e,`append`);if(!i)return n.appendFile(e,r);i(b(r))},e.access=async e=>{if(!g(e))return n.access(e)},e.exists=async e=>g(e)||n.exists(e),e.stat=async e=>g(e)?{isFile:!0,isDirectory:!1,size:0}:n.stat(e)}function T(e,t,n){function r(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return e instanceof ArrayBuffer?new Uint8Array(e):new TextEncoder().encode(typeof e==`string`?e:String(e))}async function i(t,n){let r=typeof n==`string`?n:n?.encoding;if(r===null||r===`buffer`){let n=await e.call(`vfs`,`readFileBinary`,[t]),r=f();return r?r.from(n instanceof Uint8Array?n:new Uint8Array(n)):n}return e.call(`vfs`,`readFile`,[t])}async function a(t,n){return typeof n==`string`?e.call(`vfs`,`writeFile`,[t,n]):e.call(`vfs`,`writeFileBinary`,[t,r(n)])}async function o(t,n){if(typeof n==`string`){await e.call(`vfs`,`appendFile`,[t,n]);return}await e.call(`vfs`,`appendFile`,[t,r(n)])}async function s(t,n,r){let i=await e.call(`vfs`,`stat`,[t]);if(i.isFile){let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]);return}if(!i.isDirectory||!r?.recursive)throw Error(`cp: '${t}' is a directory (use {recursive: true})`);await l(n);let a=await e.call(`vfs`,`readDir`,[t]);for(let e of a)await s(`${t}/${e}`,`${n}/${e}`,r)}async function c(t,n){if(n?.force&&!await e.call(`vfs`,`exists`,[t]))return!0;if((await e.call(`vfs`,`stat`,[t])).isFile)return e.call(`vfs`,`rm`,[t]);if(!n?.recursive)throw Error(`rm: '${t}' is a directory (use {recursive: true})`);let r=await e.call(`vfs`,`readDir`,[t]);for(let e of r)await c(`${t}/${e}`,n);return e.call(`vfs`,`rm`,[t])}async function l(t){await e.call(`vfs`,`mkdir`,[t])}async function u(t){for(let n=0;n<5;n++){let n=`${t}${Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,6)}`;if(!await e.call(`vfs`,`exists`,[n]))return await e.call(`vfs`,`mkdir`,[n]),n}throw Error(`mkdtemp: failed to create unique directory after 5 attempts`)}async function d(t,n){try{await e.call(`vfs`,`rename`,[t,n])}catch{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]),await e.call(`vfs`,`rm`,[t])}}async function p(t){if(!await e.call(`vfs`,`exists`,[t]))throw Object.assign(Error(`ENOENT: no such file or directory, access '${t}'`),{code:`ENOENT`})}let m={readFile:i,readFileBinary:t=>e.call(`vfs`,`readFileBinary`,[t]),writeFile:a,writeFileBinary:(t,n)=>e.call(`vfs`,`writeFileBinary`,[t,n]),appendFile:o,cp:s,rm:c,readDir:t=>e.call(`vfs`,`readDir`,[t]),readdir:t=>e.call(`vfs`,`readDir`,[t]),exists:t=>e.call(`vfs`,`exists`,[t]),stat:t=>e.call(`vfs`,`stat`,[t]),mkdir:(t,n)=>e.call(`vfs`,`mkdir`,[t]),mkdtemp:u,rename:d,access:p,unlink:t=>e.call(`vfs`,`rm`,[t]),rmdir:t=>e.call(`vfs`,`rm`,[t]),copyFile:async(t,n)=>{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r])},fetchToFile:async(n,r)=>{let i=await t(n);if(!i.ok)throw Error(`fetch ${i.status} ${i.statusText}`);let a=new Uint8Array(await i.arrayBuffer());return await e.call(`vfs`,`writeFileBinary`,[r,a]),a.byteLength},promises:null};return w(m,n),m.promises=m,m}function E(e,t,n=``){return Object.assign(Error(`${e}: sync-fs, ${n?`${n} `:``}'${t}'`),{code:e})}function D(e,t,n,r={},i){let a=r.recursive===!0;try{return r.requireFile?e.unlink(n):e.rm(n,a),i?.(n),!0}catch(e){if(e?.code!==`ENOENT`)throw e}let o=t;if(!o?.rm||e.isTombstoned(n))return!1;try{if(!o.exists(n))return!1}catch{return!1}return o.rm(n),e.markRemoved(n,a),!0}function O(e){let{syncFs:t,bridge:n,resolve:r,existsResolved:i,lstatResolved:a,statResolved:o,readBytes:s,writeThrough:c,persistDelete:l}=e,u=(e,r)=>D(t,n,e,r,l);return{rmSync(e,t){let n=r(e);if(!(t?.force&&!i(n))&&!u(n,{recursive:t?.recursive===!0})&&!t?.force)throw E(`ENOENT`,n,`rm`)},rmdirSync(e,t){let n=r(e);if(i(n)&&!a(n).isDirectory)throw E(`ENOTDIR`,n,`rmdir`);if(!u(n,{recursive:t?.recursive===!0}))throw E(`ENOENT`,n,`rmdir`)},unlinkSync(e){let t=r(e);if(!u(t,{requireFile:!0}))throw E(`ENOENT`,t,`unlink`)},renameSync(e,i){let a=r(e),l=r(i);try{t.rename(a,l);return}catch(e){if(e?.code!==`ENOENT`)throw e}if(!n||t.isTombstoned(a))throw E(`ENOENT`,a,`rename`);if(o(a).isDirectory)throw E(`EISDIR`,a,`rename`);if(c(l,s(a)),!u(a,{requireFile:!0}))throw E(`ENOENT`,a,`rename`)}}}function ee(e,t){if(!t)return;let n={readFileSync:e.readFileSync,writeFileSync:e.writeFileSync,appendFileSync:e.appendFileSync,existsSync:e.existsSync,accessSync:e.accessSync,statSync:e.statSync,lstatSync:e.lstatSync};e.readFileSync=(e,r)=>v(e,`read`)?x(t.readStdinBytes(),S(r)):n.readFileSync(e,r),e.writeFileSync=(e,r)=>{let i=y(t,e,`write`);i?i(b(r)):n.writeFileSync(e,r)},e.appendFileSync=(e,r)=>{let i=y(t,e,`append`);i?i(b(r)):n.appendFileSync(e,r)},e.existsSync=e=>g(e)||n.existsSync(e),e.accessSync=e=>{g(e)||n.accessSync(e)},e.statSync=e=>g(e)?C():n.statSync(e),e.lstatSync=e=>g(e)?C():n.lstatSync(e)}function te(e,t,n,r){let i=t=>e===`/`?`/${t}`:`${e}/${t}`,a=new Set(n);for(let e of t)a.add(e);for(let e of a)r(i(e))&&a.delete(e);return[...a]}function ne(e,t,n){let r=t=>e.isTombstoned(t);try{let i=e.readdir(n);if(!t||!e.isPartial(n)||r(n))return i;try{return te(n,i,t.readdir(n),r)}catch(e){if(e?.code===`ENOENT`)return i;throw e}}catch(e){let i=e?.code;if(!t||r(n)||i!==`ENOENT`)throw e;return te(n,[],t.readdir(n),r)}}function re(e){if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new TextEncoder().encode(String(e))}function ie(e,t,n,r,i){t?(t.writeFile(r,i),e.commitWrite(r,i)):(e.writeFile(r,i),n?.write?.(r,i))}function ae(e,t,n,r,i){function a(e){return o(e.startsWith(`/`)?e:t+(t.endsWith(`/`)?``:`/`)+e)}function s(t){try{return e.readFile(t)}catch(r){let i=r?.code;if(n&&!e.isTombstoned(t)&&(i===`ENOENT`||i===`ENOSYNC`))return n.readFile(t);throw r}}let c=(t,r)=>ie(e,n,i,t,r);function l(t){if(e.exists(t))return!0;if(!n||e.isTombstoned(t))return!1;try{return n.exists(t)}catch{return!1}}function u(t){try{return e.stat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.stat(t)}}function d(t){try{return e.lstat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.lstat(t)}}let f=e=>({isFile:()=>e.isFile,isDirectory:()=>e.isDirectory,isSymbolicLink:()=>e.isSymbolicLink===!0,isCharacterDevice:()=>!1,size:e.size}),p=(e,t)=>e===`/`?`/${t}`:`${e}/${t}`;function m(t,r){if(!u(t).isDirectory){c(r,s(t));return}e.mkdir(r,!0);for(let i of ne(e,n,t))m(p(t,i),p(r,i))}let h={...O({syncFs:e,bridge:n,persistDelete:i?.delete,resolve:a,existsResolved:l,statResolved:u,lstatResolved:d,readBytes:s,writeThrough:c}),readFileSync(e,t){return x(s(a(e)),S(t))},writeFileSync(e,t){c(a(e),re(t))},appendFileSync(e,t){let n=a(e),r=new Uint8Array;try{r=s(n)}catch(e){if(e?.code!==`ENOENT`)throw e}let i=re(t),o=new Uint8Array(r.byteLength+i.byteLength);o.set(r),o.set(i,r.byteLength),c(n,o)},truncateSync(e,t=0){let n=a(e),r=s(n),i=new Uint8Array(t);i.set(r.subarray(0,Math.min(t,r.byteLength))),c(n,i)},existsSync(e){return l(a(e))},accessSync(e){let t=a(e);if(!l(t))throw E(`ENOENT`,t,`access`)},mkdirSync(t,n){e.mkdir(a(t),n?.recursive)},statSync:e=>f(u(a(e))),lstatSync:e=>f(d(a(e))),realpathSync(e){let t=a(e);if(!l(t))throw E(`ENOENT`,t,`realpath`);return t},readdirSync(t){return ne(e,n,a(t))},copyFileSync(e,t){c(a(t),s(a(e)))},cpSync(e,t){m(a(e),a(t))},chmodSync(e){let t=a(e);if(!l(t))throw E(`ENOENT`,t,`chmod`)},mkdtempSync(t){return e.mkdtemp(a(t))}};return ee(h,r),h}function oe(e){let t=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}},n=(e,t,n)=>t===void 0?`${e(`Error:`)} ${n}\n`:t===``?`${e(n)}\n`:`${e(`${t}:`)} ${n}\n`,r=(t,n)=>t===void 0?`${e.color.yellow(`Warning:`)} ${n}\n`:t===``?`${e.color.yellow(n)}\n`:`${e.color.yellow(`${t}:`)} ${n}\n`;return{die(r,i){let a=typeof i==`number`?i:i?.exitCode??1,o=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0,s=t(r);throw e.writeStderr(n(e.color.red,o,s)),e.exit(a),Error(`unreachable`)},out(t){if(typeof t==`string`){e.writeStdout(t.endsWith(`
10
+ let r=t(),i=n(),a=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=l,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;let o=2147483647;e.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=s(),!l.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function c(e){if(e>o)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return p(e)}return u(e,t,n)}l.poolSize=8192;function u(e,t,n){if(typeof e==`string`)return m(e,t);if(ArrayBuffer.isView(e))return g(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return _(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return l.from(r,t,n);let i=v(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return l.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}l.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function d(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function f(e,t,n){return d(e),e<=0||t===void 0?c(e):typeof n==`string`?c(e).fill(t,n):c(e).fill(t)}l.alloc=function(e,t,n){return f(e,t,n)};function p(e){return d(e),c(e<0?0:y(e)|0)}l.allocUnsafe=function(e){return p(e)},l.allocUnsafeSlow=function(e){return p(e)};function m(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!l.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=x(e,t)|0,r=c(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function h(e){let t=e.length<0?0:y(e.length)|0,n=c(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function g(e){if(N(e,Uint8Array)){let t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return h(e)}function _(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function v(e){if(l.isBuffer(e)){let t=y(e.length)|0,n=c(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||De(e.length)?c(0):h(e);if(e.type===`Buffer`&&Array.isArray(e.data))return h(e.data)}function y(e){if(e>=o)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+o.toString(16)+` bytes`);return e|0}function b(e){return+e!=e&&(e=0),l.alloc(+e)}l.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==l.prototype},l.compare=function(e,t){if(N(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},l.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return l.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=l.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(N(t,Uint8Array))i+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(l.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function x(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return Se(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return Te(e).length;default:if(i)return r?-1:Se(e).length;t=(``+t).toLowerCase(),i=!0}}l.byteLength=x;function S(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return ce(this,t,n);case`utf8`:case`utf-8`:return re(this,t,n);case`ascii`:return oe(this,t,n);case`latin1`:case`binary`:return se(this,t,n);case`base64`:return ne(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return le(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}l.prototype._isBuffer=!0;function C(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}l.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)C(this,t,t+1);return this},l.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},l.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},l.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?re(this,0,e):S.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||l.compare(this,e)===0},l.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(N(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,s=Math.min(a,o),c=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<s;++e)if(c[e]!==u[e]){a=c[e],o=u[e];break}return a<o?-1:+(o<a)};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,De(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(i)n=0;else return-1}if(typeof t==`string`&&(t=l.from(t,r)),l.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}l.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},l.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(De(r))return o;e[n+o]=r}return o}function D(e,t,n,r){return Ee(Se(t,e.length-n),e,n,r)}function O(e,t,n,r){return Ee(Ce(t),e,n,r)}function ee(e,t,n,r){return Ee(Te(t),e,n,r)}function te(e,t,n,r){return Ee(we(t,e.length-n),e,n,r)}l.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return ee(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return te(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function ne(e,t,n){return t===0&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function re(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return ae(r)}let ie=4096;function ae(e){let t=e.length;if(t<=ie)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ie));return n}function oe(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function se(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function ce(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=Oe[e[r]];return i}function le(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}l.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r};function k(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=P(function(e){e>>>=0,ve(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ye(e,this.length-8);let r=t+this[++e]*256+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*256+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),l.prototype.readBigUInt64BE=P(function(e){e>>>=0,ve(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ye(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*256+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*256+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},l.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=P(function(e){e>>>=0,ve(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ye(e,this.length-8);let r=this[e+4]+this[e+5]*256+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*2**16+this[++e]*2**24)}),l.prototype.readBigInt64BE=P(function(e){e>>>=0,ve(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ye(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*256+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*256+n)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!1,52,8)};function A(e,t,n,r,i,a){if(!l.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;A(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;A(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,255,0),this[t]=e&255,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ue(e,t,n,r,i){M(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function de(e,t,n,r,i){M(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}l.prototype.writeBigUInt64LE=P(function(e,t=0){return ue(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),l.prototype.writeBigUInt64BE=P(function(e,t=0){return de(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);A(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);A(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},l.prototype.writeBigInt64LE=P(function(e,t=0){return ue(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),l.prototype.writeBigInt64BE=P(function(e,t=0){return de(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function fe(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function pe(e,t,n,r,a){return t=+t,n>>>=0,a||fe(e,t,n,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,n,r,23,4),n+4}l.prototype.writeFloatLE=function(e,t,n){return pe(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return pe(this,e,t,!1,n)};function me(e,t,n,r,a){return t=+t,n>>>=0,a||fe(e,t,n,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,n,r,52,8),n+8}l.prototype.writeDoubleLE=function(e,t,n){return me(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return me(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!l.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=l.isBuffer(e)?e:l.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let he={};function ge(e,t,n){he[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ge(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),ge(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),ge(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=j(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function j(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function _e(e,t,n){ve(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&ye(t,e.length-(n+1))}function M(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new he.ERR_OUT_OF_RANGE(`value`,i,e)}_e(r,i,a)}function ve(e,t){if(typeof e!=`number`)throw new he.ERR_INVALID_ARG_TYPE(t,`number`,e)}function ye(e,t,n){throw Math.floor(e)===e?t<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(ve(e,n),new he.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let be=/[^+/0-9A-Za-z-_]/g;function xe(e){if(e=e.split(`=`)[0],e=e.trim().replace(be,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function Se(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function Ce(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function we(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Te(e){return r.toByteArray(xe(e))}function Ee(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function N(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function De(e){return e!==e}let Oe=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function P(e){return typeof BigInt>`u`?ke:e}function ke(){throw Error(`BigInt not supported`)}})),i=r();globalThis.Buffer===void 0&&(globalThis.Buffer=i.Buffer);function a(){return{version:`6.162.2`,releasedAt:`2026-09-17T00:26:16Z`,buildId:`6.162.2-mu4sha0n`}}function o(e){if(!e||e===`/`)return`/`;e.startsWith(`/`)||(e=`/`+e);let t=e.split(`/`),n=[];for(let e of t)e!==``&&e!==`.`&&(e===`..`?n.pop():n.push(e));return`/`+n.join(`/`)}function s(e){let t=o(e);if(t===`/`)return`/`;let n=t.lastIndexOf(`/`);return n===0?`/`:t.slice(0,n)}function c(e){return Object.assign(Error(`ENOENT: no such file or directory, '${e}'`),{code:`ENOENT`})}function l(e){return Object.assign(Error(`ENOSYNC: file too large for sync access, '${e}' — use async readFile() instead`),{code:`ENOSYNC`})}function u(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var d=class{tree=new Map;initialPaths=new Set;initialContent=new Map;initialKind=new Map;mkdtempCounter=0;tombstones=new Set;removedDirs=new Set;touched=!1;constructor(e){this.loadSnapshot(e)}loadSnapshot(e){this.tree=new Map,this.tombstones=new Set,this.removedDirs=new Set,this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map,this.tree.set(`/`,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(`/`),this.initialKind.set(`/`,`directory`);for(let t of e.entries){let e=o(t.path);this.tree.set(e,{content:t.content,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,symlinkTarget:t.symlinkTarget,truncated:t.truncated,size:t.size}),this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}for(let t of e.entries){let e=s(o(t.path));for(;e!==`/`&&!this.tree.has(e);)this.tree.set(e,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(e),this.initialKind.set(e,`directory`),e=s(e)}}wasUsed(){return this.touched}applySnapshot(e){this.loadSnapshot(e)}applySnapshotPreservingMutations(e){let t=this.getMutations();this.loadSnapshot(e);for(let e of t.deleted){if(this.tree.get(e)?.isDirectory){let t=e===`/`?`/`:e+`/`;for(let n of Array.from(this.tree.keys()))n!==e&&n.startsWith(t)&&this.tree.delete(n)}this.tree.delete(e)}for(let e of t.created)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink,symlinkTarget:e.symlinkTarget});for(let e of t.modified)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:!1})}invalidate(){this.loadSnapshot({entries:[]})}resetBaseline(){this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map;for(let[e,t]of this.tree.entries())this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}entryKind(e){return e.isSymbolicLink?`symlink`:e.isDirectory?`directory`:`file`}resolveEntry(e,t=!1){let n=o(e),r=n.split(`/`).filter(Boolean),i=[],a=new Set,c=0;if(r.length===0){let e=this.tree.get(`/`);return e?{path:`/`,entry:e}:void 0}for(;r.length>0;){let e=r.shift(),l=`/${[...i,e].join(`/`)}`,u=this.tree.get(l);if(!u)return;let d=r.length===0;if(u.isSymbolicLink&&!(t&&d)){if(a.has(l)||c++===40)throw Object.assign(Error(`ELOOP: too many symbolic links, '${n}'`),{code:`ELOOP`});a.add(l);let e=u.symlinkTarget??``;r=[...o(e.startsWith(`/`)?e:`${s(l)}/${e}`).split(`/`).filter(Boolean),...r],i=[];continue}if(!d&&!u.isDirectory)return;if(i.push(e),d)return{path:l,entry:u}}}ensureParentDirs(e){let t=s(e);t!==`/`&&(this.tree.has(t)||this.mkdir(t,!0,!0))}isPartial(e){return this.tree.get(o(e))?.partial===!0}commitWrite(e,t){this.writeFile(e,t);let n=o(e);for(this.initialContent.set(n,t);n!==`/`;){let e=this.tree.get(n);e&&(this.initialPaths.add(n),this.initialKind.set(n,this.entryKind(e))),n=s(n)}}readFile(e){this.touched=!0;let t=o(e),n=this.resolveEntry(t)?.entry;if(!n||n.isDirectory)throw c(t);if(n.truncated)throw l(t);return n.content}writeFile(e,t){this.touched=!0;let n=o(e);this.ensureParentDirs(n),this.tree.set(n,{content:t,isDirectory:!1}),this.tombstones.delete(n),this.removedDirs.delete(n)}exists(e){this.touched=!0;let t=o(e);return this.tree.has(t)}stat(e){this.touched=!0;let t=o(e),n=this.resolveEntry(t);if(!n)throw c(t);return this.toStat(n.entry)}lstat(e){this.touched=!0;let t=o(e),n=this.resolveEntry(t,!0);if(!n)throw c(t);return this.toStat(n.entry)}toStat(e){return{isFile:!e.isDirectory&&!e.isSymbolicLink,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink===!0,size:e.isDirectory?0:e.size??e.content.byteLength}}readdir(e){this.touched=!0;let t=o(e),n=this.resolveEntry(t);if(!n?.entry.isDirectory)throw c(t);let r=n.path===`/`?`/`:n.path+`/`,i=new Set;for(let e of this.tree.keys()){if(e===t||e===`/`||!e.startsWith(r))continue;let n=e.slice(r.length).split(`/`)[0];n&&i.add(n)}return Array.from(i)}mkdir(e,t,n=!1){this.touched=!0;let r=o(e);if(this.tree.has(r)){if(this.tree.get(r).isDirectory)return;throw Object.assign(Error(`EEXIST: file already exists, '${r}'`),{code:`EEXIST`})}let i=s(r);if(i!==`/`&&!this.tree.has(i)){if(!t)throw c(r);this.mkdir(i,!0,n)}this.tree.set(r,{content:new Uint8Array,isDirectory:!0,...n?{partial:!0}:{}}),this.tombstones.delete(r),this.removedDirs.delete(r)}rm(e,t){this.touched=!0;let n=o(e),r=this.tree.get(n);if(!r)throw c(n);if(r.isDirectory&&!r.isSymbolicLink){let e=n===`/`?`/`:n+`/`,r=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));if(r.length>0&&!t)throw Object.assign(Error(`ENOTEMPTY: directory not empty, '${n}'`),{code:`ENOTEMPTY`});for(let e of r)this.tree.delete(e),this.tombstones.add(e);t&&this.removedDirs.add(n)}this.tree.delete(n),this.tombstones.add(n)}copyFile(e,t){this.touched=!0;let n=o(e),r=this.tree.get(n);if(!r||r.isDirectory)throw c(n);if(r.truncated)throw l(n);let i=o(t);this.ensureParentDirs(i),this.tree.set(i,{content:r.content.slice(),isDirectory:!1}),this.tombstones.delete(i),this.removedDirs.delete(i)}rename(e,t){this.touched=!0;let n=o(e),r=this.tree.get(n);if(!r)throw c(n);let i=o(t);if(r.isDirectory){let e=n===`/`?`/`:n+`/`,t=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n);for(let e of t){let t=this.tree.get(e),r=i+e.slice(n.length);this.tree.set(r,t),this.tree.delete(e)}this.tombstones.add(n),this.removedDirs.add(n),this.tombstones.delete(i),this.removedDirs.delete(i);return}this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n),this.tombstones.add(n),this.tombstones.delete(i),this.removedDirs.delete(i)}unlink(e){this.touched=!0;let t=o(e),n=this.tree.get(t);if(!n)throw c(t);if(n.isDirectory&&!n.isSymbolicLink)throw Object.assign(Error(`EISDIR: illegal operation on a directory, unlink '${t}'`),{code:`EISDIR`});this.tree.delete(t),this.tombstones.add(t)}markRemoved(e,t=!1){this.touched=!0;let n=o(e);this.tombstones.add(n),t&&this.removedDirs.add(n)}isTombstoned(e){let t=o(e);if(this.tombstones.has(t))return!0;for(let e of this.removedDirs)if(t===e||t.startsWith(`${e}/`))return!0;return!1}mkdtemp(e){this.touched=!0;for(let t=0;t<100;t++){let t=`_${String(this.mkdtempCounter).padStart(6,`0`)}`;this.mkdtempCounter++;let n=o(e+t);if(!this.tree.has(n))return this.mkdir(n,!0),n}throw Error(`mkdtemp: failed to create unique directory after 100 attempts`)}getMutations(){let e=[],t=[],n=[];for(let[r,i]of this.tree.entries()){if(r===`/`)continue;if(!this.initialPaths.has(r)){e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}let a=this.initialKind.get(r);if(a!==void 0&&a!==this.entryKind(i)){n.push(r),e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}if(!i.isDirectory&&!i.isSymbolicLink){let e=this.initialContent.get(r);e&&!u(e,i.content)&&t.push({path:r,content:i.content})}}for(let e of this.initialPaths)e!==`/`&&(this.tree.has(e)||n.push(e));return{created:e,modified:t,deleted:n}}};function f(){return globalThis.Buffer}function p(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function m(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function h(e,t){return Object.assign(Error(`EBADF: bad file descriptor, ${e} ${String(t)}`),{code:`EBADF`})}function g(e){return e===`/dev/stdin`||e===`/dev/stdout`||e===`/dev/stderr`}function _(e){if(e===0||e===`/dev/stdin`)return 0;if(e===1||e===`/dev/stdout`)return 1;if(e===2||e===`/dev/stderr`)return 2}function v(e,t){let n=_(e);if(n===0)return!0;if(n!==void 0||typeof e==`number`)throw h(t,e);return!1}function y(e,t,n){let r=_(t);if(r===1)return e.writeStdout;if(r===2)return e.writeStderr;if(r!==void 0||typeof t==`number`)throw h(n,t)}function b(e){return typeof e==`string`?e:m(re(e))}function x(e,t){if(t===`utf8`||t===`utf-8`)return new TextDecoder().decode(e);let n=f();return n?n.from(e):e}function S(e){return typeof e==`string`?e:e?.encoding}function C(){return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,isCharacterDevice:()=>!0,size:0}}function w(e,t){if(!t)return;let n={readFile:e.readFile,readFileBinary:e.readFileBinary,writeFile:e.writeFile,writeFileBinary:e.writeFileBinary,appendFile:e.appendFile,access:e.access,exists:e.exists,stat:e.stat};e.readFile=async(e,r)=>{if(!v(e,`read`))return n.readFile(e,r);let i=S(r);if(i===null||i===`buffer`){let e=f(),n=t.readStdinBytes();return e?e.from(n):n}return new TextDecoder().decode(t.readStdinBytes())},e.readFileBinary=async e=>v(e,`read`)?t.readStdinBytes():n.readFileBinary(e),e.writeFile=async(e,r)=>{let i=y(t,e,`write`);return i?(i(b(r)),!0):n.writeFile(e,r)},e.writeFileBinary=async(e,r)=>{let i=y(t,e,`write`);return i?(i(m(r)),!0):n.writeFileBinary(e,r)},e.appendFile=async(e,r)=>{let i=y(t,e,`append`);if(!i)return n.appendFile(e,r);i(b(r))},e.access=async e=>{if(!g(e))return n.access(e)},e.exists=async e=>g(e)||n.exists(e),e.stat=async e=>g(e)?{isFile:!0,isDirectory:!1,size:0}:n.stat(e)}function T(e,t,n){function r(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return e instanceof ArrayBuffer?new Uint8Array(e):new TextEncoder().encode(typeof e==`string`?e:String(e))}async function i(t,n){let r=typeof n==`string`?n:n?.encoding;if(r===null||r===`buffer`){let n=await e.call(`vfs`,`readFileBinary`,[t]),r=f();return r?r.from(n instanceof Uint8Array?n:new Uint8Array(n)):n}return e.call(`vfs`,`readFile`,[t])}async function a(t,n){return typeof n==`string`?e.call(`vfs`,`writeFile`,[t,n]):e.call(`vfs`,`writeFileBinary`,[t,r(n)])}async function o(t,n){if(typeof n==`string`){await e.call(`vfs`,`appendFile`,[t,n]);return}await e.call(`vfs`,`appendFile`,[t,r(n)])}async function s(t,n,r){let i=await e.call(`vfs`,`stat`,[t]);if(i.isFile){let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]);return}if(!i.isDirectory||!r?.recursive)throw Error(`cp: '${t}' is a directory (use {recursive: true})`);await l(n);let a=await e.call(`vfs`,`readDir`,[t]);for(let e of a)await s(`${t}/${e}`,`${n}/${e}`,r)}async function c(t,n){if(n?.force&&!await e.call(`vfs`,`exists`,[t]))return!0;if((await e.call(`vfs`,`stat`,[t])).isFile)return e.call(`vfs`,`rm`,[t]);if(!n?.recursive)throw Error(`rm: '${t}' is a directory (use {recursive: true})`);let r=await e.call(`vfs`,`readDir`,[t]);for(let e of r)await c(`${t}/${e}`,n);return e.call(`vfs`,`rm`,[t])}async function l(t){await e.call(`vfs`,`mkdir`,[t])}async function u(t){for(let n=0;n<5;n++){let n=`${t}${Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,6)}`;if(!await e.call(`vfs`,`exists`,[n]))return await e.call(`vfs`,`mkdir`,[n]),n}throw Error(`mkdtemp: failed to create unique directory after 5 attempts`)}async function d(t,n){try{await e.call(`vfs`,`rename`,[t,n])}catch{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]),await e.call(`vfs`,`rm`,[t])}}async function p(t){if(!await e.call(`vfs`,`exists`,[t]))throw Object.assign(Error(`ENOENT: no such file or directory, access '${t}'`),{code:`ENOENT`})}let m={readFile:i,readFileBinary:t=>e.call(`vfs`,`readFileBinary`,[t]),writeFile:a,writeFileBinary:(t,n)=>e.call(`vfs`,`writeFileBinary`,[t,n]),appendFile:o,cp:s,rm:c,readDir:t=>e.call(`vfs`,`readDir`,[t]),readdir:t=>e.call(`vfs`,`readDir`,[t]),exists:t=>e.call(`vfs`,`exists`,[t]),stat:t=>e.call(`vfs`,`stat`,[t]),mkdir:(t,n)=>e.call(`vfs`,`mkdir`,[t]),mkdtemp:u,rename:d,access:p,unlink:t=>e.call(`vfs`,`rm`,[t]),rmdir:t=>e.call(`vfs`,`rm`,[t]),copyFile:async(t,n)=>{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r])},fetchToFile:async(n,r)=>{let i=await t(n);if(!i.ok)throw Error(`fetch ${i.status} ${i.statusText}`);let a=new Uint8Array(await i.arrayBuffer());return await e.call(`vfs`,`writeFileBinary`,[r,a]),a.byteLength},promises:null};return w(m,n),m.promises=m,m}function E(e,t,n=``){return Object.assign(Error(`${e}: sync-fs, ${n?`${n} `:``}'${t}'`),{code:e})}function D(e,t,n,r={},i){let a=r.recursive===!0;try{return r.requireFile?e.unlink(n):e.rm(n,a),i?.(n),!0}catch(e){if(e?.code!==`ENOENT`)throw e}let o=t;if(!o?.rm||e.isTombstoned(n))return!1;try{if(!o.exists(n))return!1}catch{return!1}return o.rm(n),e.markRemoved(n,a),!0}function O(e){let{syncFs:t,bridge:n,resolve:r,existsResolved:i,lstatResolved:a,statResolved:o,readBytes:s,writeThrough:c,persistDelete:l}=e,u=(e,r)=>D(t,n,e,r,l);return{rmSync(e,t){let n=r(e);if(!(t?.force&&!i(n))&&!u(n,{recursive:t?.recursive===!0})&&!t?.force)throw E(`ENOENT`,n,`rm`)},rmdirSync(e,t){let n=r(e);if(i(n)&&!a(n).isDirectory)throw E(`ENOTDIR`,n,`rmdir`);if(!u(n,{recursive:t?.recursive===!0}))throw E(`ENOENT`,n,`rmdir`)},unlinkSync(e){let t=r(e);if(!u(t,{requireFile:!0}))throw E(`ENOENT`,t,`unlink`)},renameSync(e,i){let a=r(e),l=r(i);try{t.rename(a,l);return}catch(e){if(e?.code!==`ENOENT`)throw e}if(!n||t.isTombstoned(a))throw E(`ENOENT`,a,`rename`);if(o(a).isDirectory)throw E(`EISDIR`,a,`rename`);if(c(l,s(a)),!u(a,{requireFile:!0}))throw E(`ENOENT`,a,`rename`)}}}function ee(e,t){if(!t)return;let n={readFileSync:e.readFileSync,writeFileSync:e.writeFileSync,appendFileSync:e.appendFileSync,existsSync:e.existsSync,accessSync:e.accessSync,statSync:e.statSync,lstatSync:e.lstatSync};e.readFileSync=(e,r)=>v(e,`read`)?x(t.readStdinBytes(),S(r)):n.readFileSync(e,r),e.writeFileSync=(e,r)=>{let i=y(t,e,`write`);i?i(b(r)):n.writeFileSync(e,r)},e.appendFileSync=(e,r)=>{let i=y(t,e,`append`);i?i(b(r)):n.appendFileSync(e,r)},e.existsSync=e=>g(e)||n.existsSync(e),e.accessSync=e=>{g(e)||n.accessSync(e)},e.statSync=e=>g(e)?C():n.statSync(e),e.lstatSync=e=>g(e)?C():n.lstatSync(e)}function te(e,t,n,r){let i=t=>e===`/`?`/${t}`:`${e}/${t}`,a=new Set(n);for(let e of t)a.add(e);for(let e of a)r(i(e))&&a.delete(e);return[...a]}function ne(e,t,n){let r=t=>e.isTombstoned(t);try{let i=e.readdir(n);if(!t||!e.isPartial(n)||r(n))return i;try{return te(n,i,t.readdir(n),r)}catch(e){if(e?.code===`ENOENT`)return i;throw e}}catch(e){let i=e?.code;if(!t||r(n)||i!==`ENOENT`)throw e;return te(n,[],t.readdir(n),r)}}function re(e){if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new TextEncoder().encode(String(e))}function ie(e,t,n,r,i){t?(t.writeFile(r,i),e.commitWrite(r,i)):(e.writeFile(r,i),n?.write?.(r,i))}function ae(e,t,n,r,i){function a(e){return o(e.startsWith(`/`)?e:t+(t.endsWith(`/`)?``:`/`)+e)}function s(t){try{return e.readFile(t)}catch(r){let i=r?.code;if(n&&!e.isTombstoned(t)&&(i===`ENOENT`||i===`ENOSYNC`))return n.readFile(t);throw r}}let c=(t,r)=>ie(e,n,i,t,r);function l(t){if(e.exists(t))return!0;if(!n||e.isTombstoned(t))return!1;try{return n.exists(t)}catch{return!1}}function u(t){try{return e.stat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.stat(t)}}function d(t){try{return e.lstat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.lstat(t)}}let f=e=>({isFile:()=>e.isFile,isDirectory:()=>e.isDirectory,isSymbolicLink:()=>e.isSymbolicLink===!0,isCharacterDevice:()=>!1,size:e.size}),p=(e,t)=>e===`/`?`/${t}`:`${e}/${t}`;function m(t,r){if(!u(t).isDirectory){c(r,s(t));return}e.mkdir(r,!0);for(let i of ne(e,n,t))m(p(t,i),p(r,i))}let h={...O({syncFs:e,bridge:n,persistDelete:i?.delete,resolve:a,existsResolved:l,statResolved:u,lstatResolved:d,readBytes:s,writeThrough:c}),readFileSync(e,t){return x(s(a(e)),S(t))},writeFileSync(e,t){c(a(e),re(t))},appendFileSync(e,t){let n=a(e),r=new Uint8Array;try{r=s(n)}catch(e){if(e?.code!==`ENOENT`)throw e}let i=re(t),o=new Uint8Array(r.byteLength+i.byteLength);o.set(r),o.set(i,r.byteLength),c(n,o)},truncateSync(e,t=0){let n=a(e),r=s(n),i=new Uint8Array(t);i.set(r.subarray(0,Math.min(t,r.byteLength))),c(n,i)},existsSync(e){return l(a(e))},accessSync(e){let t=a(e);if(!l(t))throw E(`ENOENT`,t,`access`)},mkdirSync(t,n){e.mkdir(a(t),n?.recursive)},statSync:e=>f(u(a(e))),lstatSync:e=>f(d(a(e))),realpathSync(e){let t=a(e);if(!l(t))throw E(`ENOENT`,t,`realpath`);return t},readdirSync(t){return ne(e,n,a(t))},copyFileSync(e,t){c(a(t),s(a(e)))},cpSync(e,t){m(a(e),a(t))},chmodSync(e){let t=a(e);if(!l(t))throw E(`ENOENT`,t,`chmod`)},mkdtempSync(t){return e.mkdtemp(a(t))}};return ee(h,r),h}function oe(e){let t=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}},n=(e,t,n)=>t===void 0?`${e(`Error:`)} ${n}\n`:t===``?`${e(n)}\n`:`${e(`${t}:`)} ${n}\n`,r=(t,n)=>t===void 0?`${e.color.yellow(`Warning:`)} ${n}\n`:t===``?`${e.color.yellow(n)}\n`:`${e.color.yellow(`${t}:`)} ${n}\n`;return{die(r,i){let a=typeof i==`number`?i:i?.exitCode??1,o=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0,s=t(r);throw e.writeStderr(n(e.color.red,o,s)),e.exit(a),Error(`unreachable`)},out(t){if(typeof t==`string`){e.writeStdout(t.endsWith(`
11
11
  `)?t:`${t}\n`);return}try{e.writeStdout(`${JSON.stringify(t,null,2)}\n`)}catch{e.writeStdout(`${String(t)}\n`)}},warn(n,i){let a=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0;e.writeStderr(r(a,t(n)))},help(t){throw e.writeStdout(t.endsWith(`
12
12
  `)?t:`${t}\n`),e.exit(0),Error(`unreachable`)}}}const se={reset:`\x1B[0m`,green:`\x1B[32m`,red:`\x1B[31m`,yellow:`\x1B[33m`,gray:`\x1B[90m`,bold:`\x1B[1m`,cyan:`\x1B[36m`,dim:`\x1B[2m`};function ce(e){let t=e.isTTY&&!e.noColor,n=e=>n=>t?`${e}${n}${se.reset}`:String(n);return{enabled:t,green:n(se.green),red:n(se.red),yellow:n(se.yellow),gray:n(se.gray),bold:n(se.bold),cyan:n(se.cyan),dim:n(se.dim)}}const le=/\u001b\[[0-9;]*m/g;function k(e){return e.replace(le,``)}function A(e){return k(e).length}function ue(e,t){let n=String(e??``);return t<=0?``:A(n)<=t?n:t<=1?n.slice(0,t):`${k(n).slice(0,t-1)}…`}function de(e,t){let n=String(e??``),r=A(n);return r===t?n:r>t?ue(n,t):n+` `.repeat(t-r)}function fe(e,t){if(!e.length)return``;let n=Math.max(...e.map(e=>e.length)),r=[];for(let i=0;i<n;i++)if(t&&t[i]!==void 0)r[i]=t[i];else{let t=0;for(let n of e){let e=i<n.length?String(n[i]??``):``;t=Math.max(t,A(e))}r[i]=t}return e.map(e=>r.map((t,n)=>de(n<e.length?String(e[n]??``):``,t)).join(` `).replace(/\s+$/,``)).join(`
13
13
  `)}function pe(e){return e instanceof Date?e:new Date(e)}function me(e){return e<10?`0${e}`:String(e)}function he(e,t=`short`){let n=pe(e);if(Number.isNaN(n.getTime()))return String(e);if(t===`iso`)return n.toISOString();if(t===`locale`)return new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}).format(n);if(t===`human`){let e=Date.now()-n.getTime(),t=Math.abs(e);if(t<6e4)return e>=0?`just now`:`in a moment`;let r=(t,n)=>e>=0?`${t} ${n}${t===1?``:`s`} ago`:`in ${t} ${n}${t===1?``:`s`}`;return t<36e5?r(Math.round(t/6e4),`minute`):t<864e5?r(Math.round(t/36e5),`hour`):t<26298e5?r(Math.round(t/864e5),`day`):t<315576e5?r(Math.round(t/26298e5),`month`):r(Math.round(t/315576e5),`year`)}return`${n.getFullYear()}-${me(n.getMonth()+1)}-${me(n.getDate())}`}const ge={trunc:ue,col:de,table:fe,date:he};var j=class extends Error{actual;expected;operator;generatedMessage;code;constructor(e={}){let t=!e.message;super(e.message||`${_e(e.actual)} ${e.operator||`!=`} ${_e(e.expected)}`),this.name=`AssertionError`,this.actual=e.actual,this.expected=e.expected,this.operator=e.operator||``,this.generatedMessage=t,this.code=`ERR_ASSERTION`}};function _e(e){if(typeof e==`string`)return JSON.stringify(e);if(e==null)return String(e);if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function M(e,t){return e instanceof Error?e:typeof e==`string`?new j({message:e}):t()}function ve(e,t,n,r){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!be(e[i],t[i],n,r))return!1;return!0}function ye(e,t,n,r){let i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(let a of i)if(!Object.prototype.hasOwnProperty.call(t,a)||!be(Reflect.get(e,a),Reflect.get(t,a),n,r))return!1;return!0}function be(e,t,n,r){if((n?Object.is(e,t):e===t)||!n&&e==t)return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;let i=e,a=t;return n&&Object.getPrototypeOf(i)!==Object.getPrototypeOf(a)?!1:r.get(i)===a||(r.set(i,a),Array.isArray(e)===Array.isArray(t)?Array.isArray(e)&&Array.isArray(t)?ve(e,t,n,r):ye(i,a,n,r):!1)}function xe(e,t){try{if(e instanceof t)return!0}catch{}try{return!!t(e)}catch{return!1}}function Se(e,t){for(let[n,r]of Object.entries(t)){let t=Reflect.get(e,n);if(r instanceof RegExp){if(typeof t!=`string`||!r.test(t))return!1}else if(t!==r)return!1}return!0}function Ce(e,t){if(t===void 0)return!0;if(t instanceof RegExp){let n=e instanceof Error?e.message:String(e);return t.test(n)}return typeof t==`function`?xe(e,t):t&&typeof t==`object`?!e||typeof e!=`object`?!1:Se(e,t):!1}function we(e){let t=(e,t)=>{if(!e)throw M(t,()=>new j({message:`The expression evaluated to a falsy value`,actual:e,expected:!0,operator:`==`}))},n=((e,n)=>t(e,n)),r=(e,t,n)=>{if(!Object.is(e,t))throw M(n,()=>new j({actual:e,expected:t,operator:`strictEqual`}))},i=(t,n,i)=>{if(e){r(t,n,i);return}if(t!=n)throw M(i,()=>new j({actual:t,expected:n,operator:`==`}))},a=(e,t,n)=>{if(Object.is(e,t))throw M(n,()=>new j({actual:e,expected:t,operator:`notStrictEqual`}))},o=(t,n,r)=>{if(e){a(t,n,r);return}if(t==n)throw M(r,()=>new j({actual:t,expected:n,operator:`!=`}))},s=(e,t,n)=>{if(!be(e,t,!0,new WeakMap))throw M(n,()=>new j({actual:e,expected:t,operator:`deepStrictEqual`}))},c=(t,n,r)=>{if(e){s(t,n,r);return}if(!be(t,n,!1,new WeakMap))throw M(r,()=>new j({actual:t,expected:n,operator:`deepEqual`}))},l=(e,t,n)=>{if(be(e,t,!0,new WeakMap))throw M(n,()=>new j({actual:e,expected:t,operator:`notDeepStrictEqual`}))};return n.ok=t,n.equal=i,n.notEqual=o,n.strictEqual=r,n.notStrictEqual=a,n.deepEqual=c,n.deepStrictEqual=s,n.notDeepEqual=(t,n,r)=>{if(e){l(t,n,r);return}if(be(t,n,!1,new WeakMap))throw M(r,()=>new j({actual:t,expected:n,operator:`notDeepEqual`}))},n.notDeepStrictEqual=l,n.throws=(e,t,n)=>{let r,i=!1;try{e()}catch(e){r=e,i=!0}if(!i)throw M(typeof t==`string`?t:n,()=>new j({message:`Missing expected exception`,operator:`throws`}));if(!(typeof t==`string`||t instanceof Error)&&!Ce(r,t))throw M(n,()=>new j({message:`Got unwanted exception`,actual:r,operator:`throws`}))},n.doesNotThrow=(e,t)=>{try{e()}catch(e){throw M(t,()=>new j({message:`Got unwanted exception`,actual:e,operator:`doesNotThrow`}))}},n.fail=e=>{throw M(e,()=>new j({message:`Failed`,operator:`fail`}))},n.AssertionError=j,n}const Te=we(!0);Te.strict=Te;const Ee=we(!1);Ee.strict=Te;function N(e,t){let n=globalThis.Buffer;if(!n)throw Error(`crypto.createHash: Buffer is unavailable in this environment`);return t?n.from(e,t):n.from(e)}var De=class{_events=new Map;on(e,t){let n=this._events.get(e);return n?n.push(t):this._events.set(e,[t]),this}addListener(e,t){return this.on(e,t)}off(e,t){let n=this._events.get(e);if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&this._events.delete(e)}return this}removeListener(e,t){return this.off(e,t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}emit(e,...t){let n=this._events.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}removeAllListeners(e){return e===void 0?this._events.clear():this._events.delete(e),this}listenerCount(e){return this._events.get(e)?.length??0}listeners(e){return[...this._events.get(e)??[]]}};const Oe=Object.assign(De,{EventEmitter:De,default:De});var P=class{_events=new Map;closeScheduled=!1;writable=!0;readable=!0;on(e,t){let n=this._events.get(e);return n?n.push(t):this._events.set(e,[t]),this}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){let n=this._events.get(e);if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}return this}emit(e,...t){let n=this._events.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}pipe(e){return this.on(`data`,t=>e.write(t)),this.once(`end`,()=>e.end()),e}closeOnDestroy(){return this.closeScheduled?this:(this.closeScheduled=!0,queueMicrotask(()=>this.emit(`close`)),this)}removeListener(e,t){return this.off(e,t)}removeAllListeners(){return this._events.clear(),this}},ke=class extends P{read(){return null}destroy(){return this.closeOnDestroy()}},Ae=class extends P{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}destroy(){return this.closeOnDestroy()}},je=class extends P{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}read(){return null}destroy(){return this.closeOnDestroy()}};const Me={Readable:ke,Writable:Ae,Transform:je,PassThrough:class extends je{},Stream:P},Ne=Symbol.for(`nodejs.util.inspect.custom`),Pe=Symbol.for(`nodejs.util.promisify.custom`);function Fe(e){return`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\n/g,`\\n`)}'`}function Ie(e){if(e===null)return`null`;let t=typeof e;if(t===`string`)return Fe(e);if(t===`number`)return Object.is(e,-0)?`-0`:String(e);if(t===`bigint`)return`${String(e)}n`;if(t===`boolean`||t===`undefined`)return String(e);if(t===`symbol`)return e.toString();if(t===`function`){let t=e.name;return t?`[Function: ${t}]`:`[Function (anonymous)]`}return null}function Le(e){return e instanceof RegExp?e.toString():e instanceof Date?Number.isNaN(e.getTime())?`Invalid Date`:e.toISOString():e instanceof Error?e.stack||`${e.name}: ${e.message}`:null}function Re(e,t,n){if(Array.isArray(e))return e.length===0?`[]`:`[ ${e.map(e=>ze(e,t+1,n)).join(`, `)} ]`;if(e instanceof Map){let r=[...e].map(([e,r])=>`${ze(e,t+1,n)} => ${ze(r,t+1,n)}`);return`Map(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}if(e instanceof Set){let r=[...e].map(e=>ze(e,t+1,n));return`Set(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}let r=Object.keys(e),i=e.constructor?e.constructor.name:``,a=i&&i!==`Object`?`${i} `:``;return r.length===0?`${a}{}`:`${a}{ ${r.map(r=>`${/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(r)?r:Fe(r)}: ${ze(e[r],t+1,n)}`).join(`, `)} }`}function ze(e,t,n){let r=Ie(e);if(r!==null)return r;let i=e,a=Le(i);if(a!==null)return a;let o=i[Ne];if(typeof o==`function`)try{return String(o.call(i,n.maxDepth,n.opts))}catch{}if(n.seen.has(e))return`[Circular *1]`;if(n.maxDepth!==null&&t>n.maxDepth)return Array.isArray(e)?`[Array]`:`[Object]`;n.seen.add(e);try{return Re(i,t,n)}finally{n.seen.delete(e)}}function Be(e,t={}){let n=t.depth===void 0?2:t.depth;return ze(e,0,{seen:new Set,maxDepth:n,opts:t})}function Ve(e,t,n,r){if(e===`%%`)return`%`;if(n.i>=t.length)return e;let i=t[n.i];switch(e){case`%s`:return n.i++,typeof i==`string`?i:typeof i==`bigint`?`${String(i)}n`:i==null||typeof i==`number`||typeof i==`boolean`?String(i):Be(i,{depth:r.depth===void 0?2:r.depth});case`%d`:return n.i++,typeof i==`bigint`?`${String(i)}n`:Number.isNaN(Number(i))?`NaN`:String(Number(i));case`%i`:return n.i++,typeof i==`bigint`?`${String(i)}n`:String(Number.parseInt(i,10));case`%f`:return n.i++,String(typeof i==`bigint`?i:Number.parseFloat(i));case`%j`:n.i++;try{return JSON.stringify(i)??`undefined`}catch{return`[Circular]`}case`%o`:return n.i++,Be(i,{depth:4});case`%O`:return n.i++,Be(i,{depth:null});case`%c`:return n.i++,``;default:return e}}function He(e,...t){let n=t[0];if(typeof n!=`string`)return t.map(e=>typeof e==`string`?e:Be(e)).join(` `);let r={i:1},i=n.replace(/%[sdifjoOc%]/g,n=>Ve(n,t,r,e));for(;r.i<t.length;r.i++){let e=t[r.i];i+=` ${typeof e==`string`?e:Be(e)}`}return i}function Ue(...e){return He({},...e)}function We(e,t){if(e==null)throw TypeError(`The constructor to "inherits" must not be null or undefined`);if(t==null)throw TypeError(`The super constructor to "inherits" must not be null or undefined`);if(t.prototype===void 0)throw TypeError(`The super constructor to "inherits" must have a prototype`);e.super_=t,Object.setPrototypeOf(e.prototype,t.prototype)}function Ge(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type function`);let t=e[Pe];if(t){if(typeof t!=`function`)throw TypeError(`The [util.promisify.custom] property must be of type function`);return t}function n(...t){return new Promise((n,r)=>{e.call(this,...t,(e,...t)=>{if(e){r(e);return}n(t.length>1?t:t[0])})})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n}function Ke(e){return function(t,n,r){if(typeof t!=`function`)throw TypeError(`The "fn" argument must be of type function`);let i=!1;function a(...a){return i||(i=!0,e(r?`[${r}] DeprecationWarning: ${n}`:`DeprecationWarning: ${n}`)),new.target?Reflect.construct(t,a,new.target):t.apply(this,a)}return Object.setPrototypeOf(a,Object.getPrototypeOf(t)),t.prototype&&(a.prototype=t.prototype),a}}const qe=Be;qe.custom=Ne;const Je=Ge;Je.custom=Pe;function Ye(e){return{format:Ue,formatWithOptions:He,inspect:qe,inherits:We,promisify:Je,deprecate:Ke(e)}}const Xe=Ye(()=>{});let Ze=1;function Qe(e){if(typeof e==`string`)return e;if(ArrayBuffer.isView(e)){let t=e;return new TextDecoder().decode(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}return e==null?``:String(e)}function $e(e,t,n){return Object.assign(TypeError(`The "${e}" argument must be of type ${t}. Received ${n===null?`null`:Array.isArray(n)?`array`:typeof n}`),{code:`ERR_INVALID_ARG_TYPE`})}function et(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))throw $e(`options.env`,`object`,e);let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(typeof r!=`string`)throw $e(`options.env[${n}]`,`string`,r);t[n]=r}return t}function tt(e){if(e!==void 0){if(typeof e!=`string`)throw $e(`options.cwd`,`string`,e);return e}}function nt(e,t){return t===void 0||t===`utf8`||t===`utf-8`?e:t===`buffer`||t===null?N(e):N(e).toString(t)}function rt(e,t){if(e.length===0)return nt(``,t);if(typeof e[0]==`string`)return e.join(``);let n=globalThis.Buffer;return n?n.concat(e):e[0]}function it(e,t,n){t.length>0&&e.emit(`data`,nt(t,n)),e.readable=!1,e.emit(`end`)}function at(e){let t=e=>{typeof e==`function`&&queueMicrotask(e)};return{writable:!0,write(n,r,i){return e.stdin.write(Qe(n)),t(typeof r==`function`?r:i),!0},end(n,r,i){n!==void 0&&typeof n!=`function`&&e.stdin.write(Qe(n)),e.stdin.end(),this.writable=!1,t(typeof n==`function`?n:typeof r==`function`?r:i)}}}var ot=class extends De{stdout;stderr;stdin;pid;exitCode=null;signalCode=null;killed=!1;spawnfile;spawnargs;handle;constructor(e,t,n,r){super(),this.handle=e,this.pid=Ze++,this.spawnfile=n,this.spawnargs=r,this.stdout=new ke,this.stderr=new ke,this.stdin=at(e),e.done.then(e=>this.finish(e,t),e=>this.emit(`error`,e instanceof Error?e:Error(String(e))))}finish(e,t){it(this.stdout,e.stdout,t),it(this.stderr,e.stderr,t),this.exitCode=e.exitCode;let n=this.killed?null:e.exitCode,r=this.killed?this.signalCode:null;this.emit(`exit`,n,r),this.emit(`close`,n,r)}kill(e=`SIGTERM`){return this.killed=!0,this.signalCode=e,this.handle.kill(e).catch(()=>{}),!0}};function st(e){let t=(t,n,r)=>{if(!e)throw Error(`child_process.${t} is not available in this browser realm (no synchronous bridge — the page has no controlling Service Worker). Use the async form instead: await promisify(${t.replace(/Sync$/,``)})(…).`);return e.run(n,r)},n=e=>{let t=tt(e.cwd),n=et(e.env);return{...e.input===void 0?{}:{input:Qe(e.input)},...e.timeout===void 0?{}:{timeout:e.timeout},...t===void 0?{}:{cwd:t},...n===void 0?{}:{env:n}}},r=(e,r,i,a)=>{let o=a.encoding===void 0?`buffer`:a.encoding,s=t(e,r,n(a)),c=nt(s.stdout,o),l=nt(s.stderr,o);if(s.exitCode===0)return c;throw Object.assign(Error(`Command failed: ${i}\n${s.stderr}`),{status:s.exitCode,signal:null,stdout:c,stderr:l,output:[null,c,l],pid:Ze++})},i=(e,t)=>({args:Array.isArray(e)?e:[],options:(Array.isArray(e)?t:e)??{}});return{execSync:(e,t={})=>r(`execSync`,e,e,t),execFileSync:(e,t,n)=>{let{args:a,options:o}=i(t,n),s=[e,...a];return r(`execFileSync`,s,s.join(` `),o)},spawnSync:(e,r,a)=>{let{args:o,options:s}=i(r,a),c=s.encoding===void 0?`buffer`:s.encoding,l=Ze++,u=s.shell?`${e}${o.length?` ${o.join(` `)}`:``}`:[e,...o],d;try{d=t(`spawnSync`,u,n(s))}catch(e){if(e instanceof TypeError)throw e;let t=nt(``,c);return{pid:l,status:null,signal:null,stdout:t,stderr:t,output:[null,t,t],error:e instanceof Error?e:Error(String(e))}}let f=nt(d.stdout,c),p=nt(d.stderr,c);return{pid:l,status:d.exitCode,signal:null,stdout:f,stderr:p,output:[null,f,p]}}}}function ct(e,t){let n=(t,n,r,i,a)=>{let o=tt(n.cwd),s=et(n.env),c={...o===void 0?{}:{cwd:o},...s===void 0?{}:{env:s}},l=e.start(t,c),u=new ot(l,r,i,a);return n.input!==void 0&&u.stdin.write(Qe(n.input)),queueMicrotask(()=>l.stdin.end()),u},r=(e,t,n,r)=>{if(typeof r!=`function`)return;let i=[],a=[];e.stdout.on(`data`,e=>i.push(e)),e.stderr.on(`data`,e=>a.push(e)),e.once(`error`,e=>r(e,rt(i,t),rt(a,t))),e.once(`close`,(o,s)=>{let c=rt(i,t),l=rt(a,t);if(o===0){r(null,c,l);return}r(Object.assign(Error(`Command failed: ${n}\n${Qe(l)}`),{code:o===null?void 0:o,killed:e.killed,signal:s??null,cmd:n}),c,l)})},i=(e,t,i)=>{let a=typeof t==`function`?t:i,o=t&&typeof t==`object`?t:{},s=o.encoding===void 0?`utf8`:o.encoding,c=n(e,o,s,e,[]);return r(c,s,e,a),c},a=(e,t,i,a)=>{let o=[],s={},c;Array.isArray(t)?(o=t,typeof i==`function`?c=i:(s=i??{},c=typeof a==`function`?a:void 0)):typeof t==`function`?c=t:t&&typeof t==`object`&&(s=t,c=typeof i==`function`?i:void 0);let l=s.encoding===void 0?`utf8`:s.encoding,u=[e,...o],d=n(u,s,l,e,o);return r(d,l,u.join(` `),c),d},o=(e,t,r)=>{let i=[],a={};Array.isArray(t)?(i=t,a=r??{}):t&&typeof t==`object`&&(a=t);let o=a.encoding===void 0?`buffer`:a.encoding,s=a.shell?`${e}${i.length?` ${i.join(` `)}`:``}`:[e,...i];return n(s,a,o,e,i)},s=(e,t)=>new Promise((n,r)=>{i(e,t,(e,t,i)=>{if(e){r(Object.assign(e,{stdout:t,stderr:i}));return}n({stdout:t,stderr:i})})}),c=(e,t,n)=>new Promise((r,i)=>{a(e,Array.isArray(t)?t:[],Array.isArray(t)?n:t,(e,t,n)=>{if(e){i(Object.assign(e,{stdout:t,stderr:n}));return}r({stdout:t,stderr:n})})}),l=e=>()=>{throw Error(`child_process.${e} is not available in the browser realm`)},u=st(t),d=(e,t)=>{Object.defineProperty(e,Pe,{value:t,enumerable:!1,configurable:!0})};return d(i,s),d(a,c),{exec:i,execFile:a,spawn:o,execSync:u.execSync,spawnSync:u.spawnSync,execFileSync:u.execFileSync,fork:l(`fork`),ChildProcess:ot}}function lt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var ut={exports:{}};