azureauth 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/install.cjs +1 -1
- package/package.json +4 -4
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var wn=Object.create;var Ae=Object.defineProperty;var En=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var vn=Object.getPrototypeOf,In=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!In.call(e,o)&&o!==n&&Ae(e,o,{get:()=>t[o],enumerable:!(r=En(t,o))||r.enumerable});return e};var g=(e,t,n)=>(n=e!=null?wn(vn(e)):{},Pn(t||!e||!e.__esModule?Ae(n,"default",{value:e,enumerable:!0}):n,e));var Le=d((Kr,je)=>{je.exports=Ne;Ne.sync=Gn;var Re=require("fs");function Cn(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function $e(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:Cn(t,n)}function Ne(e,t,n){Re.stat(e,function(r,o){n(r,r?!1:$e(o,e,t))})}function Gn(e,t){return $e(Re.statSync(e),e,t)}});var Fe=d((Xr,Ue)=>{Ue.exports=Be;Be.sync=On;var ke=require("fs");function Be(e,t,n){ke.stat(e,function(r,o){n(r,r?!1:Me(o,t))})}function On(e,t){return Me(ke.statSync(e),t)}function Me(e,t){return e.isFile()&&An(e,t)}function An(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),f=a|c,h=n&u||n&c&&o===s||n&a&&r===i||n&f&&i===0;return h}});var qe=d((Yr,_e)=>{var Vr=require("fs"),M;process.platform==="win32"||global.TESTING_WINDOWS?M=Le():M=Fe();_e.exports=Q;Q.sync=Rn;function Q(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Q(e,t||{},function(i,s){i?o(i):r(s)})})}M(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function Rn(e,t){try{return M.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var Ve=d((Qr,Xe)=>{var T=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",De=require("path"),$n=T?";":":",He=qe(),ze=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),We=(e,t)=>{let n=t.colon||$n,r=e.match(/\//)||T&&e.match(/\\/)?[""]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=T?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=T?o.split(n):[""];return T&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},Ke=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=We(e,t),s=[],a=u=>new Promise((f,h)=>{if(u===r.length)return t.all&&s.length?f(s):h(ze(e));let m=r[u],S=/^".*"$/.test(m)?m.slice(1,-1):m,y=De.join(S,e),x=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;f(c(x,u,0))}),c=(u,f,h)=>new Promise((m,S)=>{if(h===o.length)return m(a(f+1));let y=o[h];He(u+y,{pathExt:i},(x,E)=>{if(!x&&E)if(t.all)s.push(u+y);else return m(u+y);return m(c(u,f,h+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},Nn=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=We(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=De.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let h=0;h<r.length;h++){let m=f+r[h];try{if(He.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw ze(e)};Xe.exports=Ke;Ke.sync=Nn});var Qe=d((Zr,Z)=>{"use strict";var Ye=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Z.exports=Ye;Z.exports.default=Ye});var tt=d((Jr,et)=>{"use strict";var Ze=require("path"),jn=Ve(),Ln=Qe();function Je(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=jn.sync(e.command,{path:n[Ln({env:n})],pathExt:t?Ze.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Ze.resolve(o?e.options.cwd:"",s)),s}function kn(e){return Je(e)||Je(e,!0)}et.exports=kn});var nt=d((eo,ee)=>{"use strict";var J=/([()\][%!^"`<>&|;, *?])/g;function Bn(e){return e=e.replace(J,"^$1"),e}function Mn(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(J,"^$1"),t&&(e=e.replace(J,"^$1")),e}ee.exports.command=Bn;ee.exports.argument=Mn});var ot=d((to,rt)=>{"use strict";rt.exports=/^#!(.*)/});var st=d((no,it)=>{"use strict";var Un=ot();it.exports=(e="")=>{let t=e.match(Un);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var ct=d((ro,at)=>{"use strict";var te=require("fs"),Fn=st();function _n(e){let n=Buffer.alloc(150),r;try{r=te.openSync(e,"r"),te.readSync(r,n,0,150,0),te.closeSync(r)}catch{}return Fn(n.toString())}at.exports=_n});var dt=d((oo,lt)=>{"use strict";var qn=require("path"),ut=tt(),ft=nt(),Dn=ct(),Hn=process.platform==="win32",zn=/\.(?:com|exe)$/i,Wn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Kn(e){e.file=ut(e);let t=e.file&&Dn(e.file);return t?(e.args.unshift(e.file),e.command=t,ut(e)):e.file}function Xn(e){if(!Hn)return e;let t=Kn(e),n=!zn.test(t);if(e.options.forceShell||n){let r=Wn.test(t);e.command=qn.normalize(e.command),e.command=ft.command(e.command),e.args=e.args.map(i=>ft.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Vn(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Xn(r)}lt.exports=Vn});var ht=d((io,mt)=>{"use strict";var ne=process.platform==="win32";function re(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Yn(e,t){if(!ne)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=pt(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function pt(e,t){return ne&&e===1&&!t.file?re(t.original,"spawn"):null}function Qn(e,t){return ne&&e===1&&!t.file?re(t.original,"spawnSync"):null}mt.exports={hookChildProcess:Yn,verifyENOENT:pt,verifyENOENTSync:Qn,notFoundError:re}});var St=d((so,v)=>{"use strict";var yt=require("child_process"),oe=dt(),ie=ht();function gt(e,t,n){let r=oe(e,t,n),o=yt.spawn(r.command,r.args,r.options);return ie.hookChildProcess(o,r),o}function Zn(e,t,n){let r=oe(e,t,n),o=yt.spawnSync(r.command,r.args,r.options);return o.error=o.error||ie.verifyENOENTSync(o.status,r),o}v.exports=gt;v.exports.spawn=gt;v.exports.sync=Zn;v.exports._parse=oe;v.exports._enoent=ie});var Rt=d((Po,q)=>{q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var kt=d((Co,G)=>{var l=global.process,b=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};b(l)?($t=require("assert"),P=Rt(),Nt=/^win/i.test(l.platform),R=require("events"),typeof R!="function"&&(R=R.EventEmitter),l.__signal_exit_emitter__?p=l.__signal_exit_emitter__:(p=l.__signal_exit_emitter__=new R,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),G.exports=function(e,t){if(!b(global.process))return function(){};$t.equal(typeof e,"function","a callback must be provided for exit handler"),C===!1&&fe();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){p.removeListener(n,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&D()};return p.on(n,e),r},D=function(){!C||!b(global.process)||(C=!1,P.forEach(function(t){try{l.removeListener(t,H[t])}catch{}}),l.emit=z,l.reallyExit=le,p.count-=1)},G.exports.unload=D,w=function(t,n,r){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,n,r))},H={},P.forEach(function(e){H[e]=function(){if(b(global.process)){var n=l.listeners(e);n.length===p.count&&(D(),w("exit",null,e),w("afterexit",null,e),Nt&&e==="SIGHUP"&&(e="SIGINT"),l.kill(l.pid,e))}}}),G.exports.signals=function(){return P},C=!1,fe=function(){C||!b(global.process)||(C=!0,p.count+=1,P=P.filter(function(t){try{return l.on(t,H[t]),!0}catch{return!1}}),l.emit=Lt,l.reallyExit=jt)},G.exports.load=fe,le=l.reallyExit,jt=function(t){b(global.process)&&(l.exitCode=t||0,w("exit",l.exitCode,null),w("afterexit",l.exitCode,null),le.call(l,l.exitCode))},z=l.emit,Lt=function(t,n){if(t==="exit"&&b(global.process)){n!==void 0&&(l.exitCode=n);var r=z.apply(this,arguments);return w("exit",l.exitCode,null),w("afterexit",l.exitCode,null),r}else return z.apply(this,arguments)}):G.exports=function(){return function(){}};var $t,P,Nt,R,p,D,w,H,C,fe,le,jt,z,Lt});var Xt=d(($o,Kt)=>{"use strict";var{PassThrough:Ir}=require("stream");Kt.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new Ir({objectMode:o});n&&i.setEncoding(n);let s=0,a=[];return i.on("data",c=>{a.push(c),o?s=a.length:s+=c.length}),i.getBufferedValue=()=>t?a:r?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var Vt=d((No,$)=>{"use strict";var{constants:Pr}=require("buffer"),Cr=require("stream"),{promisify:Gr}=require("util"),Or=Xt(),Ar=Gr(Cr.pipeline),K=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function me(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=Or(t);return await new Promise((o,i)=>{let s=a=>{a&&r.getBufferedLength()<=Pr.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),i(a)};(async()=>{try{await Ar(e,r),o()}catch(a){s(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new K)})}),r.getBufferedValue()}$.exports=me;$.exports.buffer=(e,t)=>me(e,{...t,encoding:"buffer"});$.exports.array=(e,t)=>me(e,{...t,array:!0});$.exports.MaxBufferError=K});var Qt=d((jo,Yt)=>{"use strict";var{PassThrough:Rr}=require("stream");Yt.exports=function(){var e=[],t=new Rr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var bn=g(require("node:path"),1),Ie=g(require("node:process"),1);var hn=require("node:buffer"),yn=g(require("node:path"),1),Y=g(require("node:child_process"),1),N=g(require("node:process"),1),gn=g(St(),1);function se(e){let t=typeof e=="string"?`
|
|
2
|
+
"use strict";var wn=Object.create;var Ae=Object.defineProperty;var En=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var vn=Object.getPrototypeOf,In=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Pn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!In.call(e,o)&&o!==n&&Ae(e,o,{get:()=>t[o],enumerable:!(r=En(t,o))||r.enumerable});return e};var g=(e,t,n)=>(n=e!=null?wn(vn(e)):{},Pn(t||!e||!e.__esModule?Ae(n,"default",{value:e,enumerable:!0}):n,e));var Le=d((Kr,je)=>{je.exports=Ne;Ne.sync=Gn;var Re=require("fs");function Cn(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function $e(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:Cn(t,n)}function Ne(e,t,n){Re.stat(e,function(r,o){n(r,r?!1:$e(o,e,t))})}function Gn(e,t){return $e(Re.statSync(e),e,t)}});var Fe=d((Xr,Ue)=>{Ue.exports=Be;Be.sync=On;var ke=require("fs");function Be(e,t,n){ke.stat(e,function(r,o){n(r,r?!1:Me(o,t))})}function On(e,t){return Me(ke.statSync(e),t)}function Me(e,t){return e.isFile()&&An(e,t)}function An(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),f=a|c,h=n&u||n&c&&o===s||n&a&&r===i||n&f&&i===0;return h}});var qe=d((Yr,_e)=>{var Vr=require("fs"),M;process.platform==="win32"||global.TESTING_WINDOWS?M=Le():M=Fe();_e.exports=Q;Q.sync=Rn;function Q(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Q(e,t||{},function(i,s){i?o(i):r(s)})})}M(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function Rn(e,t){try{return M.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var Ve=d((Qr,Xe)=>{var T=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",De=require("path"),$n=T?";":":",He=qe(),ze=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),We=(e,t)=>{let n=t.colon||$n,r=e.match(/\//)||T&&e.match(/\\/)?[""]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=T?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=T?o.split(n):[""];return T&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},Ke=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=We(e,t),s=[],a=u=>new Promise((f,h)=>{if(u===r.length)return t.all&&s.length?f(s):h(ze(e));let m=r[u],S=/^".*"$/.test(m)?m.slice(1,-1):m,y=De.join(S,e),x=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;f(c(x,u,0))}),c=(u,f,h)=>new Promise((m,S)=>{if(h===o.length)return m(a(f+1));let y=o[h];He(u+y,{pathExt:i},(x,E)=>{if(!x&&E)if(t.all)s.push(u+y);else return m(u+y);return m(c(u,f,h+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},Nn=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=We(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=De.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let h=0;h<r.length;h++){let m=f+r[h];try{if(He.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw ze(e)};Xe.exports=Ke;Ke.sync=Nn});var Qe=d((Zr,Z)=>{"use strict";var Ye=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Z.exports=Ye;Z.exports.default=Ye});var tt=d((Jr,et)=>{"use strict";var Ze=require("path"),jn=Ve(),Ln=Qe();function Je(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=jn.sync(e.command,{path:n[Ln({env:n})],pathExt:t?Ze.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Ze.resolve(o?e.options.cwd:"",s)),s}function kn(e){return Je(e)||Je(e,!0)}et.exports=kn});var nt=d((eo,ee)=>{"use strict";var J=/([()\][%!^"`<>&|;, *?])/g;function Bn(e){return e=e.replace(J,"^$1"),e}function Mn(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(J,"^$1"),t&&(e=e.replace(J,"^$1")),e}ee.exports.command=Bn;ee.exports.argument=Mn});var ot=d((to,rt)=>{"use strict";rt.exports=/^#!(.*)/});var st=d((no,it)=>{"use strict";var Un=ot();it.exports=(e="")=>{let t=e.match(Un);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var ct=d((ro,at)=>{"use strict";var te=require("fs"),Fn=st();function _n(e){let n=Buffer.alloc(150),r;try{r=te.openSync(e,"r"),te.readSync(r,n,0,150,0),te.closeSync(r)}catch{}return Fn(n.toString())}at.exports=_n});var dt=d((oo,lt)=>{"use strict";var qn=require("path"),ut=tt(),ft=nt(),Dn=ct(),Hn=process.platform==="win32",zn=/\.(?:com|exe)$/i,Wn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Kn(e){e.file=ut(e);let t=e.file&&Dn(e.file);return t?(e.args.unshift(e.file),e.command=t,ut(e)):e.file}function Xn(e){if(!Hn)return e;let t=Kn(e),n=!zn.test(t);if(e.options.forceShell||n){let r=Wn.test(t);e.command=qn.normalize(e.command),e.command=ft.command(e.command),e.args=e.args.map(i=>ft.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Vn(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Xn(r)}lt.exports=Vn});var ht=d((io,mt)=>{"use strict";var ne=process.platform==="win32";function re(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Yn(e,t){if(!ne)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=pt(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function pt(e,t){return ne&&e===1&&!t.file?re(t.original,"spawn"):null}function Qn(e,t){return ne&&e===1&&!t.file?re(t.original,"spawnSync"):null}mt.exports={hookChildProcess:Yn,verifyENOENT:pt,verifyENOENTSync:Qn,notFoundError:re}});var St=d((so,v)=>{"use strict";var yt=require("child_process"),oe=dt(),ie=ht();function gt(e,t,n){let r=oe(e,t,n),o=yt.spawn(r.command,r.args,r.options);return ie.hookChildProcess(o,r),o}function Zn(e,t,n){let r=oe(e,t,n),o=yt.spawnSync(r.command,r.args,r.options);return o.error=o.error||ie.verifyENOENTSync(o.status,r),o}v.exports=gt;v.exports.spawn=gt;v.exports.sync=Zn;v.exports._parse=oe;v.exports._enoent=ie});var Rt=d((Po,q)=>{q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var kt=d((Co,G)=>{var l=global.process,b=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};b(l)?($t=require("assert"),P=Rt(),Nt=/^win/i.test(l.platform),R=require("events"),typeof R!="function"&&(R=R.EventEmitter),l.__signal_exit_emitter__?p=l.__signal_exit_emitter__:(p=l.__signal_exit_emitter__=new R,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),G.exports=function(e,t){if(!b(global.process))return function(){};$t.equal(typeof e,"function","a callback must be provided for exit handler"),C===!1&&fe();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){p.removeListener(n,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&D()};return p.on(n,e),r},D=function(){!C||!b(global.process)||(C=!1,P.forEach(function(t){try{l.removeListener(t,H[t])}catch{}}),l.emit=z,l.reallyExit=le,p.count-=1)},G.exports.unload=D,w=function(t,n,r){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,n,r))},H={},P.forEach(function(e){H[e]=function(){if(b(global.process)){var n=l.listeners(e);n.length===p.count&&(D(),w("exit",null,e),w("afterexit",null,e),Nt&&e==="SIGHUP"&&(e="SIGINT"),l.kill(l.pid,e))}}}),G.exports.signals=function(){return P},C=!1,fe=function(){C||!b(global.process)||(C=!0,p.count+=1,P=P.filter(function(t){try{return l.on(t,H[t]),!0}catch{return!1}}),l.emit=Lt,l.reallyExit=jt)},G.exports.load=fe,le=l.reallyExit,jt=function(t){b(global.process)&&(l.exitCode=t||0,w("exit",l.exitCode,null),w("afterexit",l.exitCode,null),le.call(l,l.exitCode))},z=l.emit,Lt=function(t,n){if(t==="exit"&&b(global.process)){n!==void 0&&(l.exitCode=n);var r=z.apply(this,arguments);return w("exit",l.exitCode,null),w("afterexit",l.exitCode,null),r}else return z.apply(this,arguments)}):G.exports=function(){return function(){}};var $t,P,Nt,R,p,D,w,H,C,fe,le,jt,z,Lt});var Xt=d(($o,Kt)=>{"use strict";var{PassThrough:Ir}=require("stream");Kt.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new Ir({objectMode:o});n&&i.setEncoding(n);let s=0,a=[];return i.on("data",c=>{a.push(c),o?s=a.length:s+=c.length}),i.getBufferedValue=()=>t?a:r?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var Vt=d((No,$)=>{"use strict";var{constants:Pr}=require("buffer"),Cr=require("stream"),{promisify:Gr}=require("util"),Or=Xt(),Ar=Gr(Cr.pipeline),K=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function me(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=Or(t);return await new Promise((o,i)=>{let s=a=>{a&&r.getBufferedLength()<=Pr.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),i(a)};(async()=>{try{await Ar(e,r),o()}catch(a){s(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new K)})}),r.getBufferedValue()}$.exports=me;$.exports.buffer=(e,t)=>me(e,{...t,encoding:"buffer"});$.exports.array=(e,t)=>me(e,{...t,array:!0});$.exports.MaxBufferError=K});var Qt=d((jo,Yt)=>{"use strict";var{PassThrough:Rr}=require("stream");Yt.exports=function(){var e=[],t=new Rr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var bn=g(require("node:path"),1),Ie=g(require("node:process"),1);var hn=require("node:buffer"),yn=g(require("node:path"),1),Y=g(require("node:child_process"),1),N=g(require("node:process"),1),gn=g(St(),1);function se(e){let t=typeof e=="string"?`
|
|
3
3
|
`:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}var O=g(require("node:process"),1),I=g(require("node:path"),1),ae=require("node:url");function U(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}var Jn=({cwd:e=O.default.cwd(),path:t=O.default.env[U()],preferLocal:n=!0,execPath:r=O.default.execPath,addExecPath:o=!0}={})=>{let i=e instanceof URL?(0,ae.fileURLToPath)(e):e,s=I.default.resolve(i),a=[];return n&&er(a,s),o&&tr(a,r,s),[...a,t].join(I.default.delimiter)},er=(e,t)=>{let n;for(;n!==t;)e.push(I.default.join(t,"node_modules/.bin")),n=t,t=I.default.resolve(t,"..")},tr=(e,t,n)=>{let r=t instanceof URL?(0,ae.fileURLToPath)(t):t;e.push(I.default.resolve(n,r,".."))},xt=({env:e=O.default.env,...t}={})=>{e={...e};let n=U({env:e});return t.path=e[n],e[n]=Jn(t),e};var nr=(e,t,n,r)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let o=Object.getOwnPropertyDescriptor(e,n),i=Object.getOwnPropertyDescriptor(t,n);!rr(o,i)&&r||Object.defineProperty(e,n,i)},rr=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},or=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},ir=(e,t)=>`/* Wrapped ${e}*/
|
|
4
4
|
${t}`,sr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ar=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),cr=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=ir.bind(null,r,t.toString());Object.defineProperty(o,"name",ar),Object.defineProperty(e,"toString",{...sr,value:o})};function ce(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let o of Reflect.ownKeys(t))nr(e,t,o,n);return or(e,t),cr(e,t,r),e}var F=new WeakMap,bt=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(F.set(i,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return n};return ce(i,e),F.set(i,r),i};bt.callCount=e=>{if(!F.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return F.get(e)};var wt=bt;var Ot=g(require("node:process"),1);var Ct=require("node:os");var Et=()=>{let e=vt-Tt+1;return Array.from({length:e},ur)},ur=(e,t)=>({name:`SIGRT${t+1}`,number:Tt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Tt=34,vt=64;var Pt=require("node:os");var It=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var ue=()=>{let e=Et();return[...It,...e].map(fr)},fr=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=Pt.constants,a=s!==void 0;return{name:e,number:a?s:t,description:n,supported:a,action:r,forced:o,standard:i}};var lr=()=>{let e=ue();return Object.fromEntries(e.map(dr))},dr=({name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s}],Gt=lr(),pr=()=>{let e=ue(),t=65,n=Array.from({length:t},(r,o)=>mr(o,e));return Object.assign({},...n)},mr=(e,t)=>{let n=hr(e,t);if(n===void 0)return{};let{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}},hr=(e,t)=>{let n=t.find(({name:r})=>Ct.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},wo=pr();var yr=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",A=({stdout:e,stderr:t,all:n,error:r,signal:o,exitCode:i,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:f,parsed:{options:{timeout:h,cwd:m=Ot.default.cwd()}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let S=o===void 0?void 0:Gt[o].description,y=r&&r.code,E=`Command ${yr({timedOut:c,timeout:h,errorCode:y,signal:o,signalDescription:S,exitCode:i,isCanceled:u})}: ${s}`,L=Object.prototype.toString.call(r)==="[object Error]",k=L?`${E}
|
|
5
5
|
${r.message}`:E,B=[k,t,e].filter(Boolean).join(`
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var an=Object.create;var Ce=Object.defineProperty;var cn=Object.getOwnPropertyDescriptor;var un=Object.getOwnPropertyNames;var dn=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var h=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ln=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of un(t))!fn.call(e,o)&&o!==n&&Ce(e,o,{get:()=>t[o],enumerable:!(r=cn(t,o))||r.enumerable});return e};var k=(e,t,n)=>(n=e!=null?an(dn(e)):{},ln(t||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e));var Re=l((Qr,$e)=>{$e.exports=Oe;Oe.sync=mn;var Ae=h("fs");function pn(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Ge(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:pn(t,n)}function Oe(e,t,n){Ae.stat(e,function(r,o){n(r,r?!1:Ge(o,e,t))})}function mn(e,t){return Ge(Ae.statSync(e),e,t)}});var Be=l((Zr,ke)=>{ke.exports=je;je.sync=hn;var Ne=h("fs");function je(e,t,n){Ne.stat(e,function(r,o){n(r,r?!1:Le(o,t))})}function hn(e,t){return Le(Ne.statSync(e),t)}function Le(e,t){return e.isFile()&&gn(e,t)}function gn(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),d=a|c,g=n&u||n&c&&o===s||n&a&&r===i||n&d&&i===0;return g}});var Me=l((eo,Fe)=>{var Jr=h("fs"),B;process.platform==="win32"||global.TESTING_WINDOWS?B=Re():B=Be();Fe.exports=Y;Y.sync=yn;function Y(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Y(e,t||{},function(i,s){i?o(i):r(s)})})}B(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function yn(e,t){try{return B.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var We=l((to,He)=>{var T=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ue=h("path"),Sn=T?";":":",_e=Me(),qe=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),De=(e,t)=>{let n=t.colon||Sn,r=e.match(/\//)||T&&e.match(/\\/)?[""]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=T?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=T?o.split(n):[""];return T&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},ze=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=De(e,t),s=[],a=u=>new Promise((d,g)=>{if(u===r.length)return t.all&&s.length?d(s):g(qe(e));let m=r[u],S=/^".*"$/.test(m)?m.slice(1,-1):m,y=Ue.join(S,e),x=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;d(c(x,u,0))}),c=(u,d,g)=>new Promise((m,S)=>{if(g===o.length)return m(a(d+1));let y=o[g];_e(u+y,{pathExt:i},(x,E)=>{if(!x&&E)if(t.all)s.push(u+y);else return m(u+y);return m(c(u,d,g+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},xn=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=De(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Ue.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let g=0;g<r.length;g++){let m=d+r[g];try{if(_e.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw qe(e)};He.exports=ze;ze.sync=xn});var Xe=l((no,Q)=>{"use strict";var Ke=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Q.exports=Ke;Q.exports.default=Ke});var Ze=l((ro,Qe)=>{"use strict";var Ve=h("path"),bn=We(),wn=Xe();function Ye(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=bn.sync(e.command,{path:n[wn({env:n})],pathExt:t?Ve.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Ve.resolve(o?e.options.cwd:"",s)),s}function En(e){return Ye(e)||Ye(e,!0)}Qe.exports=En});var Je=l((oo,J)=>{"use strict";var Z=/([()\][%!^"`<>&|;, *?])/g;function Tn(e){return e=e.replace(Z,"^$1"),e}function vn(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Z,"^$1"),t&&(e=e.replace(Z,"^$1")),e}J.exports.command=Tn;J.exports.argument=vn});var tt=l((io,et)=>{"use strict";et.exports=/^#!(.*)/});var rt=l((so,nt)=>{"use strict";var In=tt();nt.exports=(e="")=>{let t=e.match(In);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var it=l((ao,ot)=>{"use strict";var ee=h("fs"),Pn=rt();function Cn(e){let n=Buffer.alloc(150),r;try{r=ee.openSync(e,"r"),ee.readSync(r,n,0,150,0),ee.closeSync(r)}catch{}return Pn(n.toString())}ot.exports=Cn});var ut=l((co,ct)=>{"use strict";var An=h("path"),st=Ze(),at=Je(),Gn=it(),On=process.platform==="win32",$n=/\.(?:com|exe)$/i,Rn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Nn(e){e.file=st(e);let t=e.file&&Gn(e.file);return t?(e.args.unshift(e.file),e.command=t,st(e)):e.file}function jn(e){if(!On)return e;let t=Nn(e),n=!$n.test(t);if(e.options.forceShell||n){let r=Rn.test(t);e.command=An.normalize(e.command),e.command=at.command(e.command),e.args=e.args.map(i=>at.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Ln(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:jn(r)}ct.exports=Ln});var lt=l((uo,ft)=>{"use strict";var te=process.platform==="win32";function ne(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function kn(e,t){if(!te)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=dt(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function dt(e,t){return te&&e===1&&!t.file?ne(t.original,"spawn"):null}function Bn(e,t){return te&&e===1&&!t.file?ne(t.original,"spawnSync"):null}ft.exports={hookChildProcess:kn,verifyENOENT:dt,verifyENOENTSync:Bn,notFoundError:ne}});var ht=l((fo,v)=>{"use strict";var pt=h("child_process"),re=ut(),oe=lt();function mt(e,t,n){let r=re(e,t,n),o=pt.spawn(r.command,r.args,r.options);return oe.hookChildProcess(o,r),o}function Fn(e,t,n){let r=re(e,t,n),o=pt.spawnSync(r.command,r.args,r.options);return o.error=o.error||oe.verifyENOENTSync(o.status,r),o}v.exports=mt;v.exports.spawn=mt;v.exports.sync=Fn;v.exports._parse=re;v.exports._enoent=oe});var Pt=l((ko,q)=>{q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var $t=l((Bo,C)=>{var f=global.process,b=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};b(f)?(Ct=h("assert"),I=Pt(),At=/^win/i.test(f.platform),O=h("events"),typeof O!="function"&&(O=O.EventEmitter),f.__signal_exit_emitter__?p=f.__signal_exit_emitter__:(p=f.__signal_exit_emitter__=new O,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),C.exports=function(e,t){if(!b(global.process))return function(){};Ct.equal(typeof e,"function","a callback must be provided for exit handler"),P===!1&&ce();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){p.removeListener(n,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&D()};return p.on(n,e),r},D=function(){!P||!b(global.process)||(P=!1,I.forEach(function(t){try{f.removeListener(t,z[t])}catch{}}),f.emit=H,f.reallyExit=ue,p.count-=1)},C.exports.unload=D,w=function(t,n,r){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,n,r))},z={},I.forEach(function(e){z[e]=function(){if(b(global.process)){var n=f.listeners(e);n.length===p.count&&(D(),w("exit",null,e),w("afterexit",null,e),At&&e==="SIGHUP"&&(e="SIGINT"),f.kill(f.pid,e))}}}),C.exports.signals=function(){return I},P=!1,ce=function(){P||!b(global.process)||(P=!0,p.count+=1,I=I.filter(function(t){try{return f.on(t,z[t]),!0}catch{return!1}}),f.emit=Ot,f.reallyExit=Gt)},C.exports.load=ce,ue=f.reallyExit,Gt=function(t){b(global.process)&&(f.exitCode=t||0,w("exit",f.exitCode,null),w("afterexit",f.exitCode,null),ue.call(f,f.exitCode))},H=f.emit,Ot=function(t,n){if(t==="exit"&&b(global.process)){n!==void 0&&(f.exitCode=n);var r=H.apply(this,arguments);return w("exit",f.exitCode,null),w("afterexit",f.exitCode,null),r}else return H.apply(this,arguments)}):C.exports=function(){return function(){}};var Ct,I,At,O,p,D,w,z,P,ce,ue,Gt,H,Ot});var Ut=l((Ho,Mt)=>{"use strict";var{PassThrough:yr}=h("stream");Mt.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new yr({objectMode:o});n&&i.setEncoding(n);let s=0,a=[];return i.on("data",c=>{a.push(c),o?s=a.length:s+=c.length}),i.getBufferedValue=()=>t?a:r?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var _t=l((Wo,$)=>{"use strict";var{constants:Sr}=h("buffer"),xr=h("stream"),{promisify:br}=h("util"),wr=Ut(),Er=br(xr.pipeline),K=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function le(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=wr(t);return await new Promise((o,i)=>{let s=a=>{a&&r.getBufferedLength()<=Sr.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),i(a)};(async()=>{try{await Er(e,r),o()}catch(a){s(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new K)})}),r.getBufferedValue()}$.exports=le;$.exports.buffer=(e,t)=>le(e,{...t,encoding:"buffer"});$.exports.array=(e,t)=>le(e,{...t,array:!0});$.exports.MaxBufferError=K});var Dt=l((Ko,qt)=>{"use strict";var{PassThrough:Tr}=h("stream");qt.exports=function(){var e=[],t=new Tr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var nn=k(ht(),1);import{Buffer as Ur}from"node:buffer";import _r from"node:path";import we from"node:child_process";import V from"node:process";function ie(e){let t=typeof e=="string"?`
|
|
1
|
+
var an=Object.create;var Ce=Object.defineProperty;var cn=Object.getOwnPropertyDescriptor;var un=Object.getOwnPropertyNames;var dn=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var h=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var l=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ln=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of un(t))!fn.call(e,o)&&o!==n&&Ce(e,o,{get:()=>t[o],enumerable:!(r=cn(t,o))||r.enumerable});return e};var k=(e,t,n)=>(n=e!=null?an(dn(e)):{},ln(t||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e));var Re=l((Qr,$e)=>{$e.exports=Oe;Oe.sync=mn;var Ae=h("fs");function pn(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Ge(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:pn(t,n)}function Oe(e,t,n){Ae.stat(e,function(r,o){n(r,r?!1:Ge(o,e,t))})}function mn(e,t){return Ge(Ae.statSync(e),e,t)}});var Be=l((Zr,ke)=>{ke.exports=je;je.sync=hn;var Ne=h("fs");function je(e,t,n){Ne.stat(e,function(r,o){n(r,r?!1:Le(o,t))})}function hn(e,t){return Le(Ne.statSync(e),t)}function Le(e,t){return e.isFile()&&gn(e,t)}function gn(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),d=a|c,g=n&u||n&c&&o===s||n&a&&r===i||n&d&&i===0;return g}});var Me=l((eo,Fe)=>{var Jr=h("fs"),B;process.platform==="win32"||global.TESTING_WINDOWS?B=Re():B=Be();Fe.exports=Y;Y.sync=yn;function Y(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Y(e,t||{},function(i,s){i?o(i):r(s)})})}B(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function yn(e,t){try{return B.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var We=l((to,He)=>{var T=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ue=h("path"),Sn=T?";":":",_e=Me(),qe=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),De=(e,t)=>{let n=t.colon||Sn,r=e.match(/\//)||T&&e.match(/\\/)?[""]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=T?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=T?o.split(n):[""];return T&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},ze=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=De(e,t),s=[],a=u=>new Promise((d,g)=>{if(u===r.length)return t.all&&s.length?d(s):g(qe(e));let m=r[u],S=/^".*"$/.test(m)?m.slice(1,-1):m,y=Ue.join(S,e),x=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;d(c(x,u,0))}),c=(u,d,g)=>new Promise((m,S)=>{if(g===o.length)return m(a(d+1));let y=o[g];_e(u+y,{pathExt:i},(x,E)=>{if(!x&&E)if(t.all)s.push(u+y);else return m(u+y);return m(c(u,d,g+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},xn=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=De(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Ue.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let g=0;g<r.length;g++){let m=d+r[g];try{if(_e.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw qe(e)};He.exports=ze;ze.sync=xn});var Xe=l((no,Q)=>{"use strict";var Ke=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Q.exports=Ke;Q.exports.default=Ke});var Ze=l((ro,Qe)=>{"use strict";var Ve=h("path"),bn=We(),wn=Xe();function Ye(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=bn.sync(e.command,{path:n[wn({env:n})],pathExt:t?Ve.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Ve.resolve(o?e.options.cwd:"",s)),s}function En(e){return Ye(e)||Ye(e,!0)}Qe.exports=En});var Je=l((oo,J)=>{"use strict";var Z=/([()\][%!^"`<>&|;, *?])/g;function Tn(e){return e=e.replace(Z,"^$1"),e}function vn(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Z,"^$1"),t&&(e=e.replace(Z,"^$1")),e}J.exports.command=Tn;J.exports.argument=vn});var tt=l((io,et)=>{"use strict";et.exports=/^#!(.*)/});var rt=l((so,nt)=>{"use strict";var In=tt();nt.exports=(e="")=>{let t=e.match(In);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var it=l((ao,ot)=>{"use strict";var ee=h("fs"),Pn=rt();function Cn(e){let n=Buffer.alloc(150),r;try{r=ee.openSync(e,"r"),ee.readSync(r,n,0,150,0),ee.closeSync(r)}catch{}return Pn(n.toString())}ot.exports=Cn});var ut=l((co,ct)=>{"use strict";var An=h("path"),st=Ze(),at=Je(),Gn=it(),On=process.platform==="win32",$n=/\.(?:com|exe)$/i,Rn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Nn(e){e.file=st(e);let t=e.file&&Gn(e.file);return t?(e.args.unshift(e.file),e.command=t,st(e)):e.file}function jn(e){if(!On)return e;let t=Nn(e),n=!$n.test(t);if(e.options.forceShell||n){let r=Rn.test(t);e.command=An.normalize(e.command),e.command=at.command(e.command),e.args=e.args.map(i=>at.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Ln(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:jn(r)}ct.exports=Ln});var lt=l((uo,ft)=>{"use strict";var te=process.platform==="win32";function ne(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function kn(e,t){if(!te)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=dt(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function dt(e,t){return te&&e===1&&!t.file?ne(t.original,"spawn"):null}function Bn(e,t){return te&&e===1&&!t.file?ne(t.original,"spawnSync"):null}ft.exports={hookChildProcess:kn,verifyENOENT:dt,verifyENOENTSync:Bn,notFoundError:ne}});var ht=l((fo,v)=>{"use strict";var pt=h("child_process"),re=ut(),oe=lt();function mt(e,t,n){let r=re(e,t,n),o=pt.spawn(r.command,r.args,r.options);return oe.hookChildProcess(o,r),o}function Fn(e,t,n){let r=re(e,t,n),o=pt.spawnSync(r.command,r.args,r.options);return o.error=o.error||oe.verifyENOENTSync(o.status,r),o}v.exports=mt;v.exports.spawn=mt;v.exports.sync=Fn;v.exports._parse=re;v.exports._enoent=oe});var Pt=l((ko,q)=>{q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var $t=l((Bo,C)=>{var f=global.process,b=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};b(f)?(Ct=h("assert"),I=Pt(),At=/^win/i.test(f.platform),O=h("events"),typeof O!="function"&&(O=O.EventEmitter),f.__signal_exit_emitter__?p=f.__signal_exit_emitter__:(p=f.__signal_exit_emitter__=new O,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),C.exports=function(e,t){if(!b(global.process))return function(){};Ct.equal(typeof e,"function","a callback must be provided for exit handler"),P===!1&&ce();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){p.removeListener(n,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&D()};return p.on(n,e),r},D=function(){!P||!b(global.process)||(P=!1,I.forEach(function(t){try{f.removeListener(t,z[t])}catch{}}),f.emit=H,f.reallyExit=ue,p.count-=1)},C.exports.unload=D,w=function(t,n,r){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,n,r))},z={},I.forEach(function(e){z[e]=function(){if(b(global.process)){var n=f.listeners(e);n.length===p.count&&(D(),w("exit",null,e),w("afterexit",null,e),At&&e==="SIGHUP"&&(e="SIGINT"),f.kill(f.pid,e))}}}),C.exports.signals=function(){return I},P=!1,ce=function(){P||!b(global.process)||(P=!0,p.count+=1,I=I.filter(function(t){try{return f.on(t,z[t]),!0}catch{return!1}}),f.emit=Ot,f.reallyExit=Gt)},C.exports.load=ce,ue=f.reallyExit,Gt=function(t){b(global.process)&&(f.exitCode=t||0,w("exit",f.exitCode,null),w("afterexit",f.exitCode,null),ue.call(f,f.exitCode))},H=f.emit,Ot=function(t,n){if(t==="exit"&&b(global.process)){n!==void 0&&(f.exitCode=n);var r=H.apply(this,arguments);return w("exit",f.exitCode,null),w("afterexit",f.exitCode,null),r}else return H.apply(this,arguments)}):C.exports=function(){return function(){}};var Ct,I,At,O,p,D,w,z,P,ce,ue,Gt,H,Ot});var Ut=l((Ho,Mt)=>{"use strict";var{PassThrough:yr}=h("stream");Mt.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new yr({objectMode:o});n&&i.setEncoding(n);let s=0,a=[];return i.on("data",c=>{a.push(c),o?s=a.length:s+=c.length}),i.getBufferedValue=()=>t?a:r?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var _t=l((Wo,$)=>{"use strict";var{constants:Sr}=h("buffer"),xr=h("stream"),{promisify:br}=h("util"),wr=Ut(),Er=br(xr.pipeline),K=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function le(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=wr(t);return await new Promise((o,i)=>{let s=a=>{a&&r.getBufferedLength()<=Sr.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),i(a)};(async()=>{try{await Er(e,r),o()}catch(a){s(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new K)})}),r.getBufferedValue()}$.exports=le;$.exports.buffer=(e,t)=>le(e,{...t,encoding:"buffer"});$.exports.array=(e,t)=>le(e,{...t,array:!0});$.exports.MaxBufferError=K});var Dt=l((Ko,qt)=>{"use strict";var{PassThrough:Tr}=h("stream");qt.exports=function(){var e=[],t=new Tr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var nn=k(ht(),1);import{Buffer as Ur}from"node:buffer";import _r from"node:path";import we from"node:child_process";import V from"node:process";function ie(e){let t=typeof e=="string"?`
|
|
2
2
|
`:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}import M from"node:process";import A from"node:path";import{fileURLToPath as gt}from"node:url";function F(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}var Mn=({cwd:e=M.cwd(),path:t=M.env[F()],preferLocal:n=!0,execPath:r=M.execPath,addExecPath:o=!0}={})=>{let i=e instanceof URL?gt(e):e,s=A.resolve(i),a=[];return n&&Un(a,s),o&&_n(a,r,s),[...a,t].join(A.delimiter)},Un=(e,t)=>{let n;for(;n!==t;)e.push(A.join(t,"node_modules/.bin")),n=t,t=A.resolve(t,"..")},_n=(e,t,n)=>{let r=t instanceof URL?gt(t):t;e.push(A.resolve(n,r,".."))},yt=({env:e=M.env,...t}={})=>{e={...e};let n=F({env:e});return t.path=e[n],e[n]=Mn(t),e};var qn=(e,t,n,r)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let o=Object.getOwnPropertyDescriptor(e,n),i=Object.getOwnPropertyDescriptor(t,n);!Dn(o,i)&&r||Object.defineProperty(e,n,i)},Dn=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},zn=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Hn=(e,t)=>`/* Wrapped ${e}*/
|
|
3
3
|
${t}`,Wn=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Kn=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Xn=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=Hn.bind(null,r,t.toString());Object.defineProperty(o,"name",Kn),Object.defineProperty(e,"toString",{...Wn,value:o})};function se(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let o of Reflect.ownKeys(t))qn(e,t,o,n);return zn(e,t),Xn(e,t,r),e}var U=new WeakMap,St=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(U.set(i,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return n};return se(i,e),U.set(i,r),i};St.callCount=e=>{if(!U.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return U.get(e)};var xt=St;import or from"node:process";import{constants as Zn}from"node:os";var bt=()=>{let e=Et-wt+1;return Array.from({length:e},Vn)},Vn=(e,t)=>({name:`SIGRT${t+1}`,number:wt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),wt=34,Et=64;import{constants as Yn}from"node:os";var Tt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var ae=()=>{let e=bt();return[...Tt,...e].map(Qn)},Qn=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=Yn,a=s!==void 0;return{name:e,number:a?s:t,description:n,supported:a,action:r,forced:o,standard:i}};var Jn=()=>{let e=ae();return Object.fromEntries(e.map(er))},er=({name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s}],vt=Jn(),tr=()=>{let e=ae(),t=65,n=Array.from({length:t},(r,o)=>nr(o,e));return Object.assign({},...n)},nr=(e,t)=>{let n=rr(e,t);if(n===void 0)return{};let{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}},rr=(e,t)=>{let n=t.find(({name:r})=>Zn.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},Oo=tr();var ir=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",G=({stdout:e,stderr:t,all:n,error:r,signal:o,exitCode:i,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:d,parsed:{options:{timeout:g,cwd:m=or.cwd()}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let S=o===void 0?void 0:vt[o].description,y=r&&r.code,E=`Command ${ir({timedOut:c,timeout:g,errorCode:y,signal:o,signalDescription:S,exitCode:i,isCanceled:u})}: ${s}`,N=Object.prototype.toString.call(r)==="[object Error]",j=N?`${E}
|
|
4
4
|
${r.message}`:E,L=[j,t,e].filter(Boolean).join(`
|
package/dist/install.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var pu=Object.create;var kt=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var yu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gu=(e,t)=>{for(var r in t)kt(e,r,{get:t[r],enumerable:!0})},_n=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of yu(t))!_u.call(e,n)&&n!==r&&kt(e,n,{get:()=>t[n],enumerable:!(i=mu(t,n))||i.enumerable});return e};var jt=(e,t,r)=>(r=e!=null?pu(vu(e)):{},_n(t||!e||!e.__esModule?kt(r,"default",{value:e,enumerable:!0}):r,e)),wu=e=>_n(kt({},"__esModule",{value:!0}),e);var Sn=d(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.DownloaderHelper=Ie.DH_STATES=void 0;var Wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu=(function(){function e(t,r){for(var i,n=0;n<r.length;n++)i=r[n],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}})(),Eu=require("fs"),V=Nt(Eu),De=require("url"),Su=require("path"),Fe=Nt(Su),Au=require("http"),gn=Nt(Au),Fu=require("https"),wn=Nt(Fu),Ou=require("events");function Nt(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Ru(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Pu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var En=Ie.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"},Gh=Ie.DownloaderHelper=(function(e){function t(r,i){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};Ru(this,t);var o=bn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{captureRejections:!0}));return o.__validate(r,i)?(o.url=o.requestURL=r.trim(),o.state=En.IDLE,o.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},o.__opts=Object.assign({},o.__defaultOpts),o.__pipes=[],o.__total=0,o.__downloaded=0,o.__progress=0,o.__retryCount=0,o.__retryTimeout=null,o.__resumeRetryCount=0,o.__states=En,o.__promise=null,o.__request=null,o.__response=null,o.__isAborted=!1,o.__isResumed=!1,o.__isResumable=!1,o.__isRedirected=!1,o.__destFolder=i,o.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},o.__fileName="",o.__filePath="",o.updateOptions(n),o):bn(o)}return Pu(t,e),bu(t,[{key:"start",value:function(){var i=this,n=function(){return new Promise(function(o,a){i.__promise={resolve:o,reject:a},i.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(o){var a=o.name,s=o.total,f=i.__opts.override;if(i.__opts.override=!0,i.__filePath=i.__getFilePath(a),i.__opts.override=f,i.__filePath&&V.existsSync(i.__filePath)){var c=i.__getFilesizeInBytes(i.__filePath);return c===s?n():i.resumeFromFile(i.__filePath,{total:s,fileName:a})}return n()}):n()}},{key:"pause",value:function(){var i=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(n){return n.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return i.__setState(i.__states.PAUSED),i.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var i=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var n=function(){return new Promise(function(o,a){V.access(i.__filePath,function(s){return s?(i.__emitStop(),o(!0)):void V.unlink(i.__filePath,function(f){return f?(i.__setState(i.__states.FAILED),i.emit("error",f),a(f)):(i.__emitStop(),void o(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return i.__opts.removeOnStop?n():(i.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(i){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:i,options:n}),i}},{key:"unpipe",value:function(){var i=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,o=function(s){return i.__response?i.__response.unpipe(s):s.unpipe()};if(n){var a=this.__pipes.find(function(s){return s.stream===n});return void(a&&(o(n),this.__pipes=this.__pipes.filter(function(s){return s.stream!==n})))}this.__pipes.forEach(function(s){return o(s.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(i){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,i),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=n||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var i=this;return new Promise(function(n,o){var a=function(f){i.__initProtocol(f);var c=Object.assign({},i.__headers);c.hasOwnProperty("range")&&delete c.range;var l=i.__getReqOptions("HEAD",f,c);return Object.assign({},i.__reqOptions,l)},s=function(f,c){var l=i.__protocol.request(c,function(x){if(i.__isRequireRedirect(x)){var u=/^https?:\/\//.test(x.headers.location)?x.headers.location:new De.URL(x.headers.location,f).href;return i.emit("redirected",u,f),s(u,a(u))}return x.statusCode===200?void n({name:i.__getFileNameFromHeaders(x.headers,x),total:parseInt(x.headers["content-length"])||null}):o(new Error("Response status was "+x.statusCode))});l.on("error",function(x){return o(x)}),l.on("timeout",function(){return o(new Error("timeout"))}),l.on("uncaughtException",function(x){return o(x)}),l.end()};s(i.url,a(i.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(i){var n=this,o=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=i,(o.total&&o.fileName?Promise.resolve({name:o.fileName,total:o.total}):this.getTotalSize()).then(function(a){var s=a.name,f=a.total;return n.__total=o.total||f,n.__fileName=o.fileName||s,n.__downloaded=o.downloaded||n.__getFilesizeInBytes(n.__filePath),n.__reqOptions.headers.range="bytes="+n.__downloaded+"-",n.__isResumed=!0,n.__isResumable=!0,n.__setState(n.__states.RESUMED),n.emit("resume",n.__isResumed),new Promise(function(c,l){n.__promise={resolve:c,reject:l},n.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var i=this.__promise.resolve;return this.__promise=null,i(!0)}}},{key:"__downloadRequest",value:function(i,n){var o=this;return this.__protocol.request(this.__reqOptions,function(a){if(o.__response=a,o.__isResumed||(o.__total=parseInt(a.headers["content-length"])||null,o.__resetStats()),o.__isRequireRedirect(a)){var s=/^https?:\/\//.test(a.headers.location)?a.headers.location:new De.URL(a.headers.location,o.url).href;return o.__isRedirected=!0,o.__initProtocol(s),o.emit("redirected",s,o.url),o.__start()}if(a.statusCode!==200&&a.statusCode!==206){var f=new Error("Response status was "+a.statusCode);return f.status=a.statusCode||0,f.body=a.body||"",o.__setState(o.__states.FAILED),o.emit("error",f),n(f)}(o.__opts.forceResume||a.headers.hasOwnProperty("accept-ranges")&&a.headers["accept-ranges"]!=="none")&&(o.__isResumable=!0),o.__startDownload(a,i,n)})}},{key:"__startDownload",value:function(i,n,o){var a=this,s=i;if(this.__isResumed)this.__fileStream=V.createWriteStream(this.__filePath,{flags:"a"});else{var f=this.__getFileNameFromHeaders(i.headers);if(this.__filePath=this.__getFilePath(f),this.__fileName=this.__filePath.split(Fe.sep).pop(),V.existsSync(this.__filePath)){var c=this.__getFilesizeInBytes(this.__filePath),l=this.__total?this.__total:0;if(Wr(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||c>=l))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:c}),this.__setState(this.__states.SKIPPED),n(!0)}this.__fileStream=V.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,s.on("data",function(x){return a.__calculateStats(x.length)}),this.__pipes.forEach(function(x){s.pipe(x.stream,x.options),s=x.stream}),s.pipe(this.__fileStream),s.on("error",this.__onError(n,o)),this.__fileStream.on("finish",this.__onFinished(n,o)),this.__fileStream.on("error",this.__onError(n,o))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(i){return 300<i.statusCode&&400>i.statusCode&&i.headers.hasOwnProperty("location")&&i.headers.location}},{key:"__onFinished",value:function(i,n){var o=this;return function(){o.__fileStream.close(function(a){if(a)return n(a);if(o.__hasFinished()){var s=!!o.__total&&o.__downloaded!==o.__total;if(s&&o.__isResumable&&o.__opts.resumeOnIncomplete&&o.__resumeRetryCount<=o.__opts.resumeOnIncompleteMaxRetry)return o.__resumeRetryCount++,o.emit("warning",new Error("uncomplete download, retrying")),o.resume();o.__setState(o.__states.FINISHED),o.__pipes=[],o.emit("end",{fileName:o.__fileName,filePath:o.__filePath,totalSize:o.__total,incomplete:s,onDiskSize:o.__getFilesizeInBytes(o.__filePath),downloadedSize:o.__downloaded})}return i(o.__downloaded===o.__total)})}}},{key:"__closeFileStream",value:function(){var i=this;return this.__fileStream?new Promise(function(n,o){i.__fileStream.close(function(a){return a?o(a):n(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(i,n){var o=this,a=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function(s){return o.__pipes=[],a&&o.__requestAbort(),o.state===o.__states.STOPPED||o.state===o.__states.FAILED?void 0:o.__opts.retry?o.__retry(s).catch(function(f){o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("error",f||s),n(f||s)})}):o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("error",s),n(s)})}}},{key:"__retry",value:function(){var i=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||Wr(this.__opts.retry)!=="object")return Promise.reject(n||new Error("wrong retry options"));var o=this.__opts.retry,a=o.delay,s=a===void 0?0:a,f=o.maxRetries,c=f===void 0?999:f;return this.__retryCount>=c?Promise.reject(n||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,n),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(l){return l.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(l){return i.__retryTimeout=setTimeout(function(){return l(0<i.__downloaded?i.resume():i.__start())},s)})}))}},{key:"__onTimeout",value:function(i,n){var o=this;return function(){return o.__requestAbort(),o.__opts.retry?o.__retry(new Error("timeout")).catch(function(a){o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),a?n(a):(o.emit("timeout"),n(new Error("timeout")))})}):o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("timeout"),n(new Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(i,n){var o="",a=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,s=/.*filename="(.*?)";?/i,f=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,c=i.hasOwnProperty("content-disposition"),l=c?i["content-disposition"].match(a):null,x=!c||l?null:i["content-disposition"].match(s),u=!c||l||x?null:i["content-disposition"].match(f);return c&&(l||x||u)?(o=i["content-disposition"],o=o.trim(),l?o=l[1]:x?o=x[1]:u&&(o=u[1]),o=o.replace(/[/\\]/g,"")):0<Fe.basename(new De.URL(this.requestURL).pathname).length?o=Fe.basename(new De.URL(this.requestURL).pathname):o=new De.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(o,n):o.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(i){var n=Fe.join(this.__destFolder,i),o=n;return this.__opts.override||this.state===this.__states.RESUMED||(o=this.__uniqFileNameSync(o),n!==o&&this.emit("renamed",{path:o,fileName:o.split(Fe.sep).pop(),prevPath:n,prevFileName:n.split(Fe.sep).pop()})),o}},{key:"__getFileNameFromOpts",value:function(i,n){if(!this.__opts.fileName)return i;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var o=Fe.join(this.__destFolder,i);return n&&n.headers||this.__response&&this.__response.headers?this.__opts.fileName(i,o,(n||this.__response).headers["content-type"]):this.__opts.fileName(i,o)}if(Wr(this.__opts.fileName)==="object"){var a=this.__opts.fileName,s=a.name,f=!!a.hasOwnProperty("ext")&&a.ext;if(typeof f=="string")return s+"."+f;if(typeof f=="boolean"){if(f)return s;var c=i.includes(".")?i.split(".").pop():"";return c===""?s:s+"."+c}}return i}},{key:"__calculateStats",value:function(i){var n=new Date,o=n-this.__statsEstimate.time,a=n-this.__statsEstimate.throttleTime,s=this.__total||0;i&&(this.__downloaded+=i,this.__progress=s===0?0:100*(this.__downloaded/s),(this.__downloaded===s||1e3<o)&&(this.__statsEstimate.time=n,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===s||a>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=n,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(i){this.state=i,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(i,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},a=new De.URL(n),s={protocol:a.protocol,host:a.hostname,port:a.port,path:a.pathname+a.search,method:i};return o&&(s.headers=o),s}},{key:"__getFilesizeInBytes",value:function(i){try{var n=V.statSync(i,{throwIfNoEntry:!1}),o=n.size||0;return o}catch(a){this.emit("warning",a)}return 0}},{key:"__validate",value:function(i,n){if(typeof i!="string")throw new Error("URL should be an string");if(i.trim()==="")throw new Error("URL couldn't be empty");if(typeof n!="string")throw new Error("Destination Folder should be an string");if(n.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!V.existsSync(n))throw new Error("Destination Folder must exist");var o=V.statSync(n);if(!o.isDirectory())throw new Error("Destination Folder must be a directory");try{V.accessSync(n,V.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(i){var n=this.__getReqOptions(this.__opts.method,i,this.__headers);this.requestURL=i,-1<i.indexOf("https://")?(this.__protocol=wn,n.agent=new wn.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpsRequestOptions)):(this.__protocol=gn,n.agent=new gn.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(i){if(typeof i!="string"||i==="")return i;try{V.accessSync(i,V.F_OK);var n=i.match(/(.*)(\([0-9]+\))(\..*)$/),o=n?n[1].trim():i,a=n?parseInt(n[2].replace(/\(|\)/,"")):0,s=i.split(".").pop();return s!==i&&0<s.length?(s="."+s,o=o.replace(s,"")):s="",this.__uniqFileNameSync(o+" ("+ ++a+")"+s)}catch{return i}}},{key:"__removeFile",value:function(){var i=this;return new Promise(function(n){return i.__fileStream?void i.__fileStream.close(function(o){return o&&i.emit("warning",o),i.__opts.removeOnFail?V.access(i.__filePath,function(a){return a?n():void V.unlink(i.__filePath,function(s){s&&i.emit("warning",o),n()})}):void n()}):n()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),t})(Ou.EventEmitter)});var Fn=d((Zh,An)=>{var ye=require("constants"),Tu=process.cwd,Ut=null,Bu=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ut||(Ut=Tu.call(process)),Ut};try{process.cwd()}catch{}typeof process.chdir=="function"&&($r=process.chdir,process.chdir=function(e){Ut=null,$r.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,$r));var $r;An.exports=Cu;function Cu(e){ye.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=f(e.statSync),e.fstatSync=f(e.fstatSync),e.lstatSync=f(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,x,u){u&&process.nextTick(u)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,x,u,h){h&&process.nextTick(h)},e.lchownSync=function(){}),Bu==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(l){function x(u,h,m){var y=Date.now(),p=0;l(u,h,function _(g){if(g&&(g.code==="EACCES"||g.code==="EPERM"||g.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){e.stat(h,function(E,N){E&&E.code==="ENOENT"?l(u,h,_):m(g)})},p),p<100&&(p+=10);return}m&&m(g)})}return Object.setPrototypeOf&&Object.setPrototypeOf(x,l),x})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(l){function x(u,h,m,y,p,_){var g;if(_&&typeof _=="function"){var E=0;g=function(N,R,J){if(N&&N.code==="EAGAIN"&&E<10)return E++,l.call(e,u,h,m,y,p,g);_.apply(this,arguments)}}return l.call(e,u,h,m,y,p,g)}return Object.setPrototypeOf&&Object.setPrototypeOf(x,l),x})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(l){return function(x,u,h,m,y){for(var p=0;;)try{return l.call(e,x,u,h,m,y)}catch(_){if(_.code==="EAGAIN"&&p<10){p++;continue}throw _}}})(e.readSync);function t(l){l.lchmod=function(x,u,h){l.open(x,ye.O_WRONLY|ye.O_SYMLINK,u,function(m,y){if(m){h&&h(m);return}l.fchmod(y,u,function(p){l.close(y,function(_){h&&h(p||_)})})})},l.lchmodSync=function(x,u){var h=l.openSync(x,ye.O_WRONLY|ye.O_SYMLINK,u),m=!0,y;try{y=l.fchmodSync(h,u),m=!1}finally{if(m)try{l.closeSync(h)}catch{}else l.closeSync(h)}return y}}function r(l){ye.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(x,u,h,m){l.open(x,ye.O_SYMLINK,function(y,p){if(y){m&&m(y);return}l.futimes(p,u,h,function(_){l.close(p,function(g){m&&m(_||g)})})})},l.lutimesSync=function(x,u,h){var m=l.openSync(x,ye.O_SYMLINK),y,p=!0;try{y=l.futimesSync(m,u,h),p=!1}finally{if(p)try{l.closeSync(m)}catch{}else l.closeSync(m)}return y}):l.futimes&&(l.lutimes=function(x,u,h,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function i(l){return l&&function(x,u,h){return l.call(e,x,u,function(m){c(m)&&(m=null),h&&h.apply(this,arguments)})}}function n(l){return l&&function(x,u){try{return l.call(e,x,u)}catch(h){if(!c(h))throw h}}}function o(l){return l&&function(x,u,h,m){return l.call(e,x,u,h,function(y){c(y)&&(y=null),m&&m.apply(this,arguments)})}}function a(l){return l&&function(x,u,h){try{return l.call(e,x,u,h)}catch(m){if(!c(m))throw m}}}function s(l){return l&&function(x,u,h){typeof u=="function"&&(h=u,u=null);function m(y,p){p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),h&&h.apply(this,arguments)}return u?l.call(e,x,u,m):l.call(e,x,m)}}function f(l){return l&&function(x,u){var h=u?l.call(e,x,u):l.call(e,x);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function c(l){if(!l||l.code==="ENOSYS")return!0;var x=!process.getuid||process.getuid()!==0;return!!(x&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Pn=d((Kh,Rn)=>{var On=require("stream").Stream;Rn.exports=qu;function qu(e){return{ReadStream:t,WriteStream:r};function t(i,n){if(!(this instanceof t))return new t(i,n);On.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var a=Object.keys(n),s=0,f=a.length;s<f;s++){var c=a[s];this[c]=n[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(l,x){if(l){o.emit("error",l),o.readable=!1;return}o.fd=x,o.emit("open",x),o._read()})}function r(i,n){if(!(this instanceof r))return new r(i,n);On.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),a=0,s=o.length;a<s;a++){var f=o[a];this[f]=n[f]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Bn=d((Vh,Tn)=>{"use strict";Tn.exports=Iu;var Du=Object.getPrototypeOf||function(e){return e.__proto__};function Iu(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Du(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var In=d((Xh,Yr)=>{var U=require("fs"),ku=Fn(),ju=Pn(),Nu=Bn(),Lt=require("util"),H,Mt;typeof Symbol=="function"&&typeof Symbol.for=="function"?(H=Symbol.for("graceful-fs.queue"),Mt=Symbol.for("graceful-fs.previous")):(H="___graceful-fs.queue",Mt="___graceful-fs.previous");function Uu(){}function Dn(e,t){Object.defineProperty(e,H,{get:function(){return t}})}var Oe=Uu;Lt.debuglog?Oe=Lt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Oe=function(){var e=Lt.format.apply(Lt,arguments);e="GFS4: "+e.split(/\n/).join(`
|
|
1
|
+
"use strict";var pu=Object.create;var kt=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var yu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},gu=(e,t)=>{for(var r in t)kt(e,r,{get:t[r],enumerable:!0})},_n=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of yu(t))!_u.call(e,n)&&n!==r&&kt(e,n,{get:()=>t[n],enumerable:!(i=mu(t,n))||i.enumerable});return e};var jt=(e,t,r)=>(r=e!=null?pu(vu(e)):{},_n(t||!e||!e.__esModule?kt(r,"default",{value:e,enumerable:!0}):r,e)),wu=e=>_n(kt({},"__esModule",{value:!0}),e);var Sn=d(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.DownloaderHelper=Ie.DH_STATES=void 0;var Wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu=(function(){function e(t,r){for(var i,n=0;n<r.length;n++)i=r[n],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}})(),Eu=require("fs"),V=Nt(Eu),De=require("url"),Su=require("path"),Fe=Nt(Su),Au=require("http"),gn=Nt(Au),Fu=require("https"),wn=Nt(Fu),Ou=require("events");function Nt(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Ru(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Pu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var En=Ie.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"},Gh=Ie.DownloaderHelper=(function(e){function t(r,i){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};Ru(this,t);var o=bn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{captureRejections:!0}));return o.__validate(r,i)?(o.url=o.requestURL=r.trim(),o.state=En.IDLE,o.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},o.__opts=Object.assign({},o.__defaultOpts),o.__pipes=[],o.__total=0,o.__downloaded=0,o.__progress=0,o.__retryCount=0,o.__retryTimeout=null,o.__resumeRetryCount=0,o.__states=En,o.__promise=null,o.__request=null,o.__response=null,o.__isAborted=!1,o.__isResumed=!1,o.__isResumable=!1,o.__isRedirected=!1,o.__destFolder=i,o.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},o.__fileName="",o.__filePath="",o.updateOptions(n),o):bn(o)}return Pu(t,e),bu(t,[{key:"start",value:function(){var i=this,n=function(){return new Promise(function(o,a){i.__promise={resolve:o,reject:a},i.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(o){var a=o.name,s=o.total,f=i.__opts.override;if(i.__opts.override=!0,i.__filePath=i.__getFilePath(a),i.__opts.override=f,i.__filePath&&V.existsSync(i.__filePath)){var c=i.__getFilesizeInBytes(i.__filePath);return c===s?n():i.resumeFromFile(i.__filePath,{total:s,fileName:a})}return n()}):n()}},{key:"pause",value:function(){var i=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(n){return n.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return i.__setState(i.__states.PAUSED),i.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var i=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var n=function(){return new Promise(function(o,a){V.access(i.__filePath,function(s){return s?(i.__emitStop(),o(!0)):void V.unlink(i.__filePath,function(f){return f?(i.__setState(i.__states.FAILED),i.emit("error",f),a(f)):(i.__emitStop(),void o(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return i.__opts.removeOnStop?n():(i.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(i){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:i,options:n}),i}},{key:"unpipe",value:function(){var i=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,o=function(s){return i.__response?i.__response.unpipe(s):s.unpipe()};if(n){var a=this.__pipes.find(function(s){return s.stream===n});return void(a&&(o(n),this.__pipes=this.__pipes.filter(function(s){return s.stream!==n})))}this.__pipes.forEach(function(s){return o(s.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(i){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,i),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=n||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var i=this;return new Promise(function(n,o){var a=function(f){i.__initProtocol(f);var c=Object.assign({},i.__headers);c.hasOwnProperty("range")&&delete c.range;var l=i.__getReqOptions("HEAD",f,c);return Object.assign({},i.__reqOptions,l)},s=function(f,c){var l=i.__protocol.request(c,function(x){if(i.__isRequireRedirect(x)){var u=/^https?:\/\//.test(x.headers.location)?x.headers.location:new De.URL(x.headers.location,f).href;return i.emit("redirected",u,f),s(u,a(u))}return x.statusCode===200?void n({name:i.__getFileNameFromHeaders(x.headers,x),total:parseInt(x.headers["content-length"])||null}):o(new Error("Response status was "+x.statusCode))});l.on("error",function(x){return o(x)}),l.on("timeout",function(){return o(new Error("timeout"))}),l.on("uncaughtException",function(x){return o(x)}),l.end()};s(i.url,a(i.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(i){var n=this,o=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=i,(o.total&&o.fileName?Promise.resolve({name:o.fileName,total:o.total}):this.getTotalSize()).then(function(a){var s=a.name,f=a.total;return n.__total=o.total||f,n.__fileName=o.fileName||s,n.__downloaded=o.downloaded||n.__getFilesizeInBytes(n.__filePath),n.__reqOptions.headers.range="bytes="+n.__downloaded+"-",n.__isResumed=!0,n.__isResumable=!0,n.__setState(n.__states.RESUMED),n.emit("resume",n.__isResumed),new Promise(function(c,l){n.__promise={resolve:c,reject:l},n.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var i=this.__promise.resolve;return this.__promise=null,i(!0)}}},{key:"__downloadRequest",value:function(i,n){var o=this;return this.__protocol.request(this.__reqOptions,function(a){if(o.__response=a,o.__isResumed||(o.__total=parseInt(a.headers["content-length"])||null,o.__resetStats()),o.__isRequireRedirect(a)){var s=/^https?:\/\//.test(a.headers.location)?a.headers.location:new De.URL(a.headers.location,o.url).href;return o.__isRedirected=!0,o.__initProtocol(s),o.emit("redirected",s,o.url),o.__start()}if(a.statusCode!==200&&a.statusCode!==206){var f=new Error("Response status was "+a.statusCode);return f.status=a.statusCode||0,f.body=a.body||"",o.__setState(o.__states.FAILED),o.emit("error",f),n(f)}(o.__opts.forceResume||a.headers.hasOwnProperty("accept-ranges")&&a.headers["accept-ranges"]!=="none")&&(o.__isResumable=!0),o.__startDownload(a,i,n)})}},{key:"__startDownload",value:function(i,n,o){var a=this,s=i;if(this.__isResumed)this.__fileStream=V.createWriteStream(this.__filePath,{flags:"a"});else{var f=this.__getFileNameFromHeaders(i.headers);if(this.__filePath=this.__getFilePath(f),this.__fileName=this.__filePath.split(Fe.sep).pop(),V.existsSync(this.__filePath)){var c=this.__getFilesizeInBytes(this.__filePath),l=this.__total?this.__total:0;if(Wr(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||c>=l))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:c}),this.__setState(this.__states.SKIPPED),n(!0)}this.__fileStream=V.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,s.on("data",function(x){return a.__calculateStats(x.length)}),this.__pipes.forEach(function(x){s.pipe(x.stream,x.options),s=x.stream}),s.pipe(this.__fileStream),s.on("error",this.__onError(n,o)),this.__fileStream.on("finish",this.__onFinished(n,o)),this.__fileStream.on("error",this.__onError(n,o))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(i){return 300<i.statusCode&&400>i.statusCode&&i.headers.hasOwnProperty("location")&&i.headers.location}},{key:"__onFinished",value:function(i,n){var o=this;return function(){o.__fileStream.close(function(a){if(a)return n(a);if(o.__hasFinished()){var s=!!o.__total&&o.__downloaded!==o.__total;if(s&&o.__isResumable&&o.__opts.resumeOnIncomplete&&o.__resumeRetryCount<=o.__opts.resumeOnIncompleteMaxRetry)return o.__resumeRetryCount++,o.emit("warning",new Error("uncomplete download, retrying")),o.resume();o.__setState(o.__states.FINISHED),o.__pipes=[],o.emit("end",{fileName:o.__fileName,filePath:o.__filePath,totalSize:o.__total,incomplete:s,onDiskSize:o.__getFilesizeInBytes(o.__filePath),downloadedSize:o.__downloaded})}return i(o.__downloaded===o.__total)})}}},{key:"__closeFileStream",value:function(){var i=this;return this.__fileStream?new Promise(function(n,o){i.__fileStream.close(function(a){return a?o(a):n(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(i,n){var o=this,a=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function(s){return o.__pipes=[],a&&o.__requestAbort(),o.state===o.__states.STOPPED||o.state===o.__states.FAILED?void 0:o.__opts.retry?o.__retry(s).catch(function(f){o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("error",f||s),n(f||s)})}):o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("error",s),n(s)})}}},{key:"__retry",value:function(){var i=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||Wr(this.__opts.retry)!=="object")return Promise.reject(n||new Error("wrong retry options"));var o=this.__opts.retry,a=o.delay,s=a===void 0?0:a,f=o.maxRetries,c=f===void 0?999:f;return this.__retryCount>=c?Promise.reject(n||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,n),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(l){return l.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(l){return i.__retryTimeout=setTimeout(function(){return l(0<i.__downloaded?i.resume():i.__start())},s)})}))}},{key:"__onTimeout",value:function(i,n){var o=this;return function(){return o.__requestAbort(),o.__opts.retry?o.__retry(new Error("timeout")).catch(function(a){o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),a?n(a):(o.emit("timeout"),n(new Error("timeout")))})}):o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("timeout"),n(new Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(i,n){var o="",a=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,s=/.*filename="(.*?)";?/i,f=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,c=i.hasOwnProperty("content-disposition"),l=c?i["content-disposition"].match(a):null,x=!c||l?null:i["content-disposition"].match(s),u=!c||l||x?null:i["content-disposition"].match(f);return c&&(l||x||u)?(o=i["content-disposition"],o=o.trim(),l?o=l[1]:x?o=x[1]:u&&(o=u[1]),o=o.replace(/[/\\]/g,"")):0<Fe.basename(new De.URL(this.requestURL).pathname).length?o=Fe.basename(new De.URL(this.requestURL).pathname):o=new De.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(o,n):o.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(i){var n=Fe.join(this.__destFolder,i),o=n;return this.__opts.override||this.state===this.__states.RESUMED||(o=this.__uniqFileNameSync(o),n!==o&&this.emit("renamed",{path:o,fileName:o.split(Fe.sep).pop(),prevPath:n,prevFileName:n.split(Fe.sep).pop()})),o}},{key:"__getFileNameFromOpts",value:function(i,n){if(!this.__opts.fileName)return i;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var o=Fe.join(this.__destFolder,i);return n&&n.headers||this.__response&&this.__response.headers?this.__opts.fileName(i,o,(n||this.__response).headers["content-type"]):this.__opts.fileName(i,o)}if(Wr(this.__opts.fileName)==="object"){var a=this.__opts.fileName,s=a.name,f=!!a.hasOwnProperty("ext")&&a.ext;if(typeof f=="string")return s+"."+f;if(typeof f=="boolean"){if(f)return s;var c=i.includes(".")?i.split(".").pop():"";return c===""?s:s+"."+c}}return i}},{key:"__calculateStats",value:function(i){var n=new Date,o=n-this.__statsEstimate.time,a=n-this.__statsEstimate.throttleTime,s=this.__total||0;i&&(this.__downloaded+=i,this.__progress=s===0?0:100*(this.__downloaded/s),(this.__downloaded===s||1e3<o)&&(this.__statsEstimate.time=n,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===s||a>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=n,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(i){this.state=i,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(i,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},a=new De.URL(n),s={protocol:a.protocol,host:a.hostname,port:a.port,path:a.pathname+a.search,method:i};return o&&(s.headers=o),s}},{key:"__getFilesizeInBytes",value:function(i){try{var n=V.statSync(i,{throwIfNoEntry:!1}),o=n.size||0;return o}catch(a){this.emit("warning",a)}return 0}},{key:"__validate",value:function(i,n){if(typeof i!="string")throw new Error("URL should be an string");if(i.trim()==="")throw new Error("URL couldn't be empty");if(typeof n!="string")throw new Error("Destination Folder should be an string");if(n.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!V.existsSync(n))throw new Error("Destination Folder must exist");var o=V.statSync(n);if(!o.isDirectory())throw new Error("Destination Folder must be a directory");try{V.accessSync(n,V.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(i){var n=this.__getReqOptions(this.__opts.method,i,this.__headers);this.requestURL=i,-1<i.indexOf("https://")?(this.__protocol=wn,n.agent=new wn.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpsRequestOptions)):(this.__protocol=gn,n.agent=new gn.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(i){if(typeof i!="string"||i==="")return i;try{V.accessSync(i,V.F_OK);var n=i.match(/(.*)(\([0-9]+\))(\..*)$/),o=n?n[1].trim():i,a=n?parseInt(n[2].replace(/\(|\)/,"")):0,s=i.split(".").pop();return s!==i&&0<s.length?(s="."+s,o=o.replace(s,"")):s="",this.__uniqFileNameSync(o+" ("+ ++a+")"+s)}catch{return i}}},{key:"__removeFile",value:function(){var i=this;return new Promise(function(n){return i.__fileStream?void i.__fileStream.close(function(o){return o&&i.emit("warning",o),i.__opts.removeOnFail?V.access(i.__filePath,function(a){return a?n():void V.unlink(i.__filePath,function(s){s&&i.emit("warning",o),n()})}):void n()}):n()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),t})(Ou.EventEmitter)});var Fn=d((Zh,An)=>{var ye=require("constants"),Tu=process.cwd,Ut=null,Bu=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ut||(Ut=Tu.call(process)),Ut};try{process.cwd()}catch{}typeof process.chdir=="function"&&($r=process.chdir,process.chdir=function(e){Ut=null,$r.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,$r));var $r;An.exports=Cu;function Cu(e){ye.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=f(e.statSync),e.fstatSync=f(e.fstatSync),e.lstatSync=f(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,x,u){u&&process.nextTick(u)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,x,u,h){h&&process.nextTick(h)},e.lchownSync=function(){}),Bu==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(l){function x(u,h,m){var y=Date.now(),p=0;l(u,h,function _(g){if(g&&(g.code==="EACCES"||g.code==="EPERM"||g.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){e.stat(h,function(E,N){E&&E.code==="ENOENT"?l(u,h,_):m(g)})},p),p<100&&(p+=10);return}m&&m(g)})}return Object.setPrototypeOf&&Object.setPrototypeOf(x,l),x})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(l){function x(u,h,m,y,p,_){var g;if(_&&typeof _=="function"){var E=0;g=function(N,R,J){if(N&&N.code==="EAGAIN"&&E<10)return E++,l.call(e,u,h,m,y,p,g);_.apply(this,arguments)}}return l.call(e,u,h,m,y,p,g)}return Object.setPrototypeOf&&Object.setPrototypeOf(x,l),x})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(l){return function(x,u,h,m,y){for(var p=0;;)try{return l.call(e,x,u,h,m,y)}catch(_){if(_.code==="EAGAIN"&&p<10){p++;continue}throw _}}})(e.readSync);function t(l){l.lchmod=function(x,u,h){l.open(x,ye.O_WRONLY|ye.O_SYMLINK,u,function(m,y){if(m){h&&h(m);return}l.fchmod(y,u,function(p){l.close(y,function(_){h&&h(p||_)})})})},l.lchmodSync=function(x,u){var h=l.openSync(x,ye.O_WRONLY|ye.O_SYMLINK,u),m=!0,y;try{y=l.fchmodSync(h,u),m=!1}finally{if(m)try{l.closeSync(h)}catch{}else l.closeSync(h)}return y}}function r(l){ye.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(x,u,h,m){l.open(x,ye.O_SYMLINK,function(y,p){if(y){m&&m(y);return}l.futimes(p,u,h,function(_){l.close(p,function(g){m&&m(_||g)})})})},l.lutimesSync=function(x,u,h){var m=l.openSync(x,ye.O_SYMLINK),y,p=!0;try{y=l.futimesSync(m,u,h),p=!1}finally{if(p)try{l.closeSync(m)}catch{}else l.closeSync(m)}return y}):l.futimes&&(l.lutimes=function(x,u,h,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function i(l){return l&&function(x,u,h){return l.call(e,x,u,function(m){c(m)&&(m=null),h&&h.apply(this,arguments)})}}function n(l){return l&&function(x,u){try{return l.call(e,x,u)}catch(h){if(!c(h))throw h}}}function o(l){return l&&function(x,u,h,m){return l.call(e,x,u,h,function(y){c(y)&&(y=null),m&&m.apply(this,arguments)})}}function a(l){return l&&function(x,u,h){try{return l.call(e,x,u,h)}catch(m){if(!c(m))throw m}}}function s(l){return l&&function(x,u,h){typeof u=="function"&&(h=u,u=null);function m(y,p){p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),h&&h.apply(this,arguments)}return u?l.call(e,x,u,m):l.call(e,x,m)}}function f(l){return l&&function(x,u){var h=u?l.call(e,x,u):l.call(e,x);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function c(l){if(!l||l.code==="ENOSYS")return!0;var x=!process.getuid||process.getuid()!==0;return!!(x&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Pn=d((Kh,Rn)=>{var On=require("stream").Stream;Rn.exports=qu;function qu(e){return{ReadStream:t,WriteStream:r};function t(i,n){if(!(this instanceof t))return new t(i,n);On.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var a=Object.keys(n),s=0,f=a.length;s<f;s++){var c=a[s];this[c]=n[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(l,x){if(l){o.emit("error",l),o.readable=!1;return}o.fd=x,o.emit("open",x),o._read()})}function r(i,n){if(!(this instanceof r))return new r(i,n);On.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),a=0,s=o.length;a<s;a++){var f=o[a];this[f]=n[f]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Bn=d((Vh,Tn)=>{"use strict";Tn.exports=Iu;var Du=Object.getPrototypeOf||function(e){return e.__proto__};function Iu(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Du(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var In=d((Xh,Yr)=>{var U=require("fs"),ku=Fn(),ju=Pn(),Nu=Bn(),Lt=require("util"),H,Mt;typeof Symbol=="function"&&typeof Symbol.for=="function"?(H=Symbol.for("graceful-fs.queue"),Mt=Symbol.for("graceful-fs.previous")):(H="___graceful-fs.queue",Mt="___graceful-fs.previous");function Uu(){}function Dn(e,t){Object.defineProperty(e,H,{get:function(){return t}})}var Oe=Uu;Lt.debuglog?Oe=Lt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Oe=function(){var e=Lt.format.apply(Lt,arguments);e="GFS4: "+e.split(/\n/).join(`
|
|
2
2
|
GFS4: `),console.error(e)});U[H]||(Cn=global[H]||[],Dn(U,Cn),U.close=(function(e){function t(r,i){return e.call(U,r,function(n){n||qn(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,Mt,{value:e}),t})(U.close),U.closeSync=(function(e){function t(r){e.apply(U,arguments),qn()}return Object.defineProperty(t,Mt,{value:e}),t})(U.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Oe(U[H]),require("assert").equal(U[H].length,0)}));var Cn;global[H]||Dn(global,U[H]);Yr.exports=Hr(Nu(U));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!U.__patched&&(Yr.exports=Hr(U),U.__patched=!0);function Hr(e){ku(e),e.gracefulify=Hr,e.createReadStream=R,e.createWriteStream=J;var t=e.readFile;e.readFile=r;function r(v,w,b){return typeof w=="function"&&(b=w,w=null),C(v,w,b);function C(q,B,A,F){return t(q,B,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ke([C,[q,B,A],O,F||Date.now(),Date.now()]):typeof A=="function"&&A.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=n;function n(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return i(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=a);function a(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return o(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=f);function f(v,w,b,C){return typeof b=="function"&&(C=b,b=0),q(v,w,b,C);function q(B,A,F,O,M){return s(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var c=e.readdir;e.readdir=x;var l=/^v[0-5]\./;function x(v,w,b){typeof w=="function"&&(b=w,w=null);var C=l.test(process.version)?function(A,F,O,M){return c(A,q(A,F,O,M))}:function(A,F,O,M){return c(A,F,q(A,F,O,M))};return C(v,w,b);function q(B,A,F,O){return function(M,T){M&&(M.code==="EMFILE"||M.code==="ENFILE")?ke([C,[B,A,F],M,O||Date.now(),Date.now()]):(T&&T.sort&&T.sort(),typeof F=="function"&&F.call(this,M,T))}}}if(process.version.substr(0,4)==="v0.8"){var u=ju(e);_=u.ReadStream,E=u.WriteStream}var h=e.ReadStream;h&&(_.prototype=Object.create(h.prototype),_.prototype.open=g);var m=e.WriteStream;m&&(E.prototype=Object.create(m.prototype),E.prototype.open=N),Object.defineProperty(e,"ReadStream",{get:function(){return _},set:function(v){_=v},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return E},set:function(v){E=v},enumerable:!0,configurable:!0});var y=_;Object.defineProperty(e,"FileReadStream",{get:function(){return y},set:function(v){y=v},enumerable:!0,configurable:!0});var p=E;Object.defineProperty(e,"FileWriteStream",{get:function(){return p},set:function(v){p=v},enumerable:!0,configurable:!0});function _(v,w){return this instanceof _?(h.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function g(){var v=this;z(v.path,v.flags,v.mode,function(w,b){w?(v.autoClose&&v.destroy(),v.emit("error",w)):(v.fd=b,v.emit("open",b),v.read())})}function E(v,w){return this instanceof E?(m.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function N(){var v=this;z(v.path,v.flags,v.mode,function(w,b){w?(v.destroy(),v.emit("error",w)):(v.fd=b,v.emit("open",b))})}function R(v,w){return new e.ReadStream(v,w)}function J(v,w){return new e.WriteStream(v,w)}var j=e.open;e.open=z;function z(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return j(B,A,F,function(T,D){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}return e}function ke(e){Oe("ENQUEUE",e[0].name,e[1]),U[H].push(e),Gr()}var zt;function qn(){for(var e=Date.now(),t=0;t<U[H].length;++t)U[H][t].length>2&&(U[H][t][3]=e,U[H][t][4]=e);Gr()}function Gr(){if(clearTimeout(zt),zt=void 0,U[H].length!==0){var e=U[H].shift(),t=e[0],r=e[1],i=e[2],n=e[3],o=e[4];if(n===void 0)Oe("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-n>=6e4){Oe("TIMEOUT",t.name,r);var a=r.pop();typeof a=="function"&&a.call(null,i)}else{var s=Date.now()-o,f=Math.max(o-n,1),c=Math.min(f*1.2,100);s>=c?(Oe("RETRY",t.name,r),t.apply(null,r.concat([n]))):U[H].push(e)}zt===void 0&&(zt=setTimeout(Gr,0))}}});var Zr=d((Jh,kn)=>{"use strict";kn.exports=e=>{let t=new Uint8Array(e);if(!(t&&t.length>1))return null;let r=(i,n)=>{n=Object.assign({offset:0},n);for(let o=0;o<i.length;o++)if(i[o]!==t[o+n.offset])return!1;return!0};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(r([80,75,3,4])&&r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r([80,75,3,4])&&r([77,69,84,65,45,73,78,70,47,109,111,122,105,108,108,97,46,114,115,97],{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(r([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8))return{ext:"zip",mime:"application/zip"};if(r([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(t[6]===0||t[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([0,0,0])&&(t[3]===24||t[3]===32)&&r([102,116,121,112],{offset:4})||r([51,103,112,53])||r([0,0,0,28,102,116,121,112,109,112,52,50])&&r([109,112,52,49,109,112,52,50,105,115,111,109],{offset:16})||r([0,0,0,28,102,116,121,112,105,115,111,109])||r([0,0,0,28,102,116,121,112,109,112,52,50,0,0,0,0]))return{ext:"mp4",mime:"video/mp4"};if(r([0,0,0,28,102,116,121,112,77,52,86]))return{ext:"m4v",mime:"video/x-m4v"};if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){let i=t.subarray(4,4100),n=i.findIndex((o,a,s)=>s[a]===66&&s[a+1]===130);if(n>=0){let o=n+3,a=s=>Array.from(s).every((f,c)=>i[o+c]===f.charCodeAt(0));if(a("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(a("webm"))return{ext:"webm",mime:"video/webm"}}}return r([0,0,0,20,102,116,121,112,113,116,32,32])||r([102,114,101,101],{offset:4})||r([102,116,121,112,113,116,32,32],{offset:4})||r([109,100,97,116],{offset:4})||r([119,105,100,101],{offset:4})?{ext:"mov",mime:"video/quicktime"}:r([82,73,70,70])&&r([65,86,73],{offset:8})?{ext:"avi",mime:"video/x-msvideo"}:r([48,38,178,117,142,102,207,17,166,217])?{ext:"wmv",mime:"video/x-ms-wmv"}:r([0,0,1,186])?{ext:"mpg",mime:"video/mpeg"}:r([73,68,51])||r([255,251])?{ext:"mp3",mime:"audio/mpeg"}:r([102,116,121,112,77,52,65],{offset:4})||r([77,52,65,32])?{ext:"m4a",mime:"audio/m4a"}:r([79,112,117,115,72,101,97,100],{offset:28})?{ext:"opus",mime:"audio/opus"}:r([79,103,103,83])?{ext:"ogg",mime:"audio/ogg"}:r([102,76,97,67])?{ext:"flac",mime:"audio/x-flac"}:r([82,73,70,70])&&r([87,65,86,69],{offset:8})?{ext:"wav",mime:"audio/x-wav"}:r([35,33,65,77,82,10])?{ext:"amr",mime:"audio/amr"}:r([37,80,68,70])?{ext:"pdf",mime:"application/pdf"}:r([77,90])?{ext:"exe",mime:"application/x-msdownload"}:(t[0]===67||t[0]===70)&&r([87,83],{offset:1})?{ext:"swf",mime:"application/x-shockwave-flash"}:r([123,92,114,116,102])?{ext:"rtf",mime:"application/rtf"}:r([0,97,115,109])?{ext:"wasm",mime:"application/wasm"}:r([119,79,70,70])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff",mime:"font/woff"}:r([119,79,70,50])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff2",mime:"font/woff2"}:r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8}))?{ext:"eot",mime:"application/octet-stream"}:r([0,1,0,0,0])?{ext:"ttf",mime:"font/ttf"}:r([79,84,84,79,0])?{ext:"otf",mime:"font/otf"}:r([0,0,1,0])?{ext:"ico",mime:"image/x-icon"}:r([70,76,86,1])?{ext:"flv",mime:"video/x-flv"}:r([37,33])?{ext:"ps",mime:"application/postscript"}:r([253,55,122,88,90,0])?{ext:"xz",mime:"application/x-xz"}:r([83,81,76,105])?{ext:"sqlite",mime:"application/x-sqlite3"}:r([78,69,83,26])?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:r([67,114,50,52])?{ext:"crx",mime:"application/x-google-chrome-extension"}:r([77,83,67,70])||r([73,83,99,40])?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:r([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])?{ext:"deb",mime:"application/x-deb"}:r([33,60,97,114,99,104,62])?{ext:"ar",mime:"application/x-unix-archive"}:r([237,171,238,219])?{ext:"rpm",mime:"application/x-rpm"}:r([31,160])||r([31,157])?{ext:"Z",mime:"application/x-compress"}:r([76,90,73,80])?{ext:"lz",mime:"application/x-lzip"}:r([208,207,17,224,161,177,26,225])?{ext:"msi",mime:"application/x-msi"}:r([6,14,43,52,2,5,1,1,13,1,2,1,1,2])?{ext:"mxf",mime:"application/mxf"}:r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196}))?{ext:"mts",mime:"video/mp2t"}:r([66,76,69,78,68,69,82])?{ext:"blend",mime:"application/x-blender"}:r([66,80,71,251])?{ext:"bpg",mime:"image/bpg"}:null}});var Wt=d((Qh,jn)=>{"use strict";var ue=jn.exports=function(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"};ue.writable=function(e){return ue(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"};ue.readable=function(e){return ue(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object"};ue.duplex=function(e){return ue.writable(e)&&ue.readable(e)};ue.transform=function(e){return ue.duplex(e)&&typeof e._transform=="function"&&typeof e._transformState=="object"}});var ft=d((ep,Kr)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Kr.exports={nextTick:Lu}:Kr.exports=process;function Lu(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,a;switch(n){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(n-1),a=0;a<o.length;)o[a++]=arguments[a];return process.nextTick(function(){e.apply(null,o)})}}});var Un=d((tp,Nn)=>{var zu={}.toString;Nn.exports=Array.isArray||function(e){return zu.call(e)=="[object Array]"}});var Vr=d((rp,Ln)=>{Ln.exports=require("stream")});var ut=d((Xr,Mn)=>{var $t=require("buffer"),le=$t.Buffer;function zn(e,t){for(var r in e)t[r]=e[r]}le.from&&le.alloc&&le.allocUnsafe&&le.allocUnsafeSlow?Mn.exports=$t:(zn($t,Xr),Xr.Buffer=je);function je(e,t,r){return le(e,t,r)}zn(le,je);je.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return le(e,t,r)};je.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=le(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};je.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return le(e)};je.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return $t.SlowBuffer(e)}});var Ne=d(K=>{function Mu(e){return Array.isArray?Array.isArray(e):Ht(e)==="[object Array]"}K.isArray=Mu;function Wu(e){return typeof e=="boolean"}K.isBoolean=Wu;function $u(e){return e===null}K.isNull=$u;function Hu(e){return e==null}K.isNullOrUndefined=Hu;function Gu(e){return typeof e=="number"}K.isNumber=Gu;function Yu(e){return typeof e=="string"}K.isString=Yu;function Zu(e){return typeof e=="symbol"}K.isSymbol=Zu;function Ku(e){return e===void 0}K.isUndefined=Ku;function Vu(e){return Ht(e)==="[object RegExp]"}K.isRegExp=Vu;function Xu(e){return typeof e=="object"&&e!==null}K.isObject=Xu;function Ju(e){return Ht(e)==="[object Date]"}K.isDate=Ju;function Qu(e){return Ht(e)==="[object Error]"||e instanceof Error}K.isError=Qu;function el(e){return typeof e=="function"}K.isFunction=el;function tl(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}K.isPrimitive=tl;K.isBuffer=require("buffer").Buffer.isBuffer;function Ht(e){return Object.prototype.toString.call(e)}});var Wn=d((np,Jr)=>{typeof Object.create=="function"?Jr.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Jr.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var Ue=d((op,ei)=>{try{if(Qr=require("util"),typeof Qr.inherits!="function")throw"";ei.exports=Qr.inherits}catch{ei.exports=Wn()}var Qr});var Hn=d((ap,ti)=>{"use strict";function rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $n=ut().Buffer,lt=require("util");function il(e,t,r){e.copy(t,r)}ti.exports=(function(){function e(){rl(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return $n.alloc(0);for(var i=$n.allocUnsafe(r>>>0),n=this.head,o=0;n;)il(n.data,i,o),o+=n.data.length,n=n.next;return i},e})();lt&<.inspect&<.inspect.custom&&(ti.exports.prototype[lt.inspect.custom]=function(){var e=lt.inspect({length:this.length});return this.constructor.name+" "+e})});var ri=d((sp,Gn)=>{"use strict";var Gt=ft();function nl(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Gt.nextTick(Yt,this,e)):Gt.nextTick(Yt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,Gt.nextTick(Yt,r,o)):Gt.nextTick(Yt,r,o):t&&t(o)}),this)}function ol(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Yt(e,t){e.emit("error",t)}Gn.exports={destroy:nl,undestroy:ol}});var Zn=d((fp,Yn)=>{Yn.exports=require("util").deprecate});var ni=d((up,ro)=>{"use strict";var Re=ft();ro.exports=W;function Vn(e){var t=this;this.next=null,this.entry=null,this.finish=function(){El(t,e)}}var al=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Re.nextTick,Le;W.WritableState=xt;var Xn=Object.create(Ne());Xn.inherits=Ue();var sl={deprecate:Zn()},Jn=Vr(),Kt=ut().Buffer,fl=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ul(e){return Kt.from(e)}function ll(e){return Kt.isBuffer(e)||e instanceof fl}var Qn=ri();Xn.inherits(W,Jn);function cl(){}function xt(e,t){Le=Le||Pe(),e=e||{};var r=t instanceof Le;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){vl(t,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Vn(this)}xt.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(xt.prototype,"buffer",{get:sl.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Zt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Zt=Function.prototype[Symbol.hasInstance],Object.defineProperty(W,Symbol.hasInstance,{value:function(e){return Zt.call(this,e)?!0:this!==W?!1:e&&e._writableState instanceof xt}})):Zt=function(e){return e instanceof this};function W(e){if(Le=Le||Pe(),!Zt.call(W,this)&&!(this instanceof Le))return new W(e);this._writableState=new xt(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),Jn.call(this)}W.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function xl(e,t){var r=new Error("write after end");e.emit("error",r),Re.nextTick(t,r)}function dl(e,t,r,i){var n=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),Re.nextTick(i,o),n=!1),n}W.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&ll(e);return o&&!Kt.isBuffer(e)&&(e=ul(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=cl),i.ended?xl(this,r):(o||dl(this,i,e,r))&&(i.pendingcb++,n=pl(this,i,o,e,t,r)),n};W.prototype.cork=function(){var e=this._writableState;e.corked++};W.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&eo(this,e))};W.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function hl(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Kt.from(t,r)),t}Object.defineProperty(W.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pl(e,t,r,i,n,o){if(!r){var a=hl(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else ii(e,t,!1,s,i,n,o);return f}function ii(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function ml(e,t,r,i,n){--t.pendingcb,r?(Re.nextTick(n,i),Re.nextTick(ct,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),ct(e,t))}function yl(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function vl(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(yl(r),t)ml(e,r,i,t,n);else{var o=to(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&eo(e,r),i?al(Kn,e,r,o,n):Kn(e,r,o,n)}}function Kn(e,t,r,i){r||_l(e,t),t.pendingcb--,i(),ct(e,t)}function _l(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function eo(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,ii(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new Vn(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback,x=t.objectMode?1:f.length;if(ii(e,t,!1,x,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}W.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};W.prototype._writev=null;W.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||bl(this,i,r)};function to(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function gl(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),ct(e,t)})}function wl(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Re.nextTick(gl,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function ct(e,t){var r=to(t);return r&&(wl(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function bl(e,t,r){t.ending=!0,ct(e,t),r&&(t.finished?Re.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function El(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(W.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});W.prototype.destroy=Qn.destroy;W.prototype._undestroy=Qn.undestroy;W.prototype._destroy=function(e,t){this.end(),t(e)}});var Pe=d((lp,ao)=>{"use strict";var io=ft(),Sl=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};ao.exports=ce;var no=Object.create(Ne());no.inherits=Ue();var oo=si(),ai=ni();no.inherits(ce,oo);for(oi=Sl(ai.prototype),Vt=0;Vt<oi.length;Vt++)Xt=oi[Vt],ce.prototype[Xt]||(ce.prototype[Xt]=ai.prototype[Xt]);var oi,Xt,Vt;function ce(e){if(!(this instanceof ce))return new ce(e);oo.call(this,e),ai.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",Al)}Object.defineProperty(ce.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Al(){this.allowHalfOpen||this._writableState.ended||io.nextTick(Fl,this)}function Fl(e){e.end()}Object.defineProperty(ce.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});ce.prototype._destroy=function(e,t){this.push(null),this.end(),io.nextTick(t,e)}});var li=d(fo=>{"use strict";var ui=ut().Buffer,so=ui.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ol(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Rl(e){var t=Ol(e);if(typeof t!="string"&&(ui.isEncoding===so||!so(e)))throw new Error("Unknown encoding: "+e);return t||e}fo.StringDecoder=dt;function dt(e){this.encoding=Rl(e);var t;switch(this.encoding){case"utf16le":this.text=Dl,this.end=Il,t=4;break;case"utf8":this.fillLast=Bl,t=4;break;case"base64":this.text=kl,this.end=jl,t=3;break;default:this.write=Nl,this.end=Ul;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ui.allocUnsafe(t)}dt.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};dt.prototype.end=ql;dt.prototype.text=Cl;dt.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function fi(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Pl(e,t,r){var i=t.length-1;if(i<r)return 0;var n=fi(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=fi(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=fi(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function Tl(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Bl(e){var t=this.lastTotal-this.lastNeed,r=Tl(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Cl(e,t){var r=Pl(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function ql(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Dl(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Il(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function kl(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function jl(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Nl(e){return e.toString(this.encoding)}function Ul(e){return e&&e.length?this.write(e):""}});var si=d((dp,wo)=>{"use strict";var Me=ft();wo.exports=I;var Ll=Un(),ht;I.ReadableState=mo;var xp=require("events").EventEmitter,xo=function(e,t){return e.listeners(t).length},pi=Vr(),pt=ut().Buffer,zl=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Ml(e){return pt.from(e)}function Wl(e){return pt.isBuffer(e)||e instanceof zl}var ho=Object.create(Ne());ho.inherits=Ue();var ci=require("util"),P=void 0;ci&&ci.debuglog?P=ci.debuglog("stream"):P=function(){};var $l=Hn(),po=ri(),ze;ho.inherits(I,pi);var xi=["error","close","destroy","pause","resume"];function Hl(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Ll(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function mo(e,t){ht=ht||Pe(),e=e||{};var r=t instanceof ht;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new $l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(ze||(ze=li().StringDecoder),this.decoder=new ze(e.encoding),this.encoding=e.encoding)}function I(e){if(ht=ht||Pe(),!(this instanceof I))return new I(e);this._readableState=new mo(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),pi.call(this)}Object.defineProperty(I.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});I.prototype.destroy=po.destroy;I.prototype._undestroy=po.undestroy;I.prototype._destroy=function(e,t){this.push(null),t(e)};I.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=pt.from(e,t),t=""),i=!0),yo(this,e,t,!1,i)};I.prototype.unshift=function(e){return yo(this,e,null,!0,!1)};function yo(e,t,r,i,n){var o=e._readableState;if(t===null)o.reading=!1,Kl(e,o);else{var a;n||(a=Gl(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==pt.prototype&&(t=Ml(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):di(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?di(e,o,t,!1):vo(e,o)):di(e,o,t,!1))):i||(o.reading=!1)}return Yl(o)}function di(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Jt(e)),vo(e,t)}function Gl(e,t){var r;return!Wl(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function Yl(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}I.prototype.isPaused=function(){return this._readableState.flowing===!1};I.prototype.setEncoding=function(e){return ze||(ze=li().StringDecoder),this._readableState.decoder=new ze(e),this._readableState.encoding=e,this};var uo=8388608;function Zl(e){return e>=uo?e=uo:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function lo(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Zl(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}I.prototype.read=function(e){P("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return P("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?hi(this):Jt(this),null;if(e=lo(e,t),e===0&&t.ended)return t.length===0&&hi(this),null;var i=t.needReadable;P("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,P("length less than watermark",i)),t.ended||t.reading?(i=!1,P("reading or ended",i)):i&&(P("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=lo(r,t)));var n;return e>0?n=_o(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&hi(this)),n!==null&&this.emit("data",n),n};function Kl(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,Jt(e)}}function Jt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Me.nextTick(co,e):co(e))}function co(e){P("emit readable"),e.emit("readable"),mi(e)}function vo(e,t){t.readingMore||(t.readingMore=!0,Me.nextTick(Vl,e,t))}function Vl(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(P("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}I.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};I.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,P("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=n?s:p;i.endEmitted?Me.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(_,g){P("onunpipe"),_===r&&g&&g.hasUnpiped===!1&&(g.hasUnpiped=!0,l())}function s(){P("onend"),e.end()}var f=Xl(r);e.on("drain",f);var c=!1;function l(){P("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",p),r.removeListener("data",u),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}var x=!1;r.on("data",u);function u(_){P("ondata"),x=!1;var g=e.write(_);g===!1&&!x&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&go(i.pipes,e)!==-1)&&!c&&(P("false write response, pause",i.awaitDrain),i.awaitDrain++,x=!0),r.pause())}function h(_){P("onerror",_),p(),e.removeListener("error",h),xo(e,"error")===0&&e.emit("error",_)}Hl(e,"error",h);function m(){e.removeListener("finish",y),p()}e.once("close",m);function y(){P("onfinish"),e.removeListener("close",m),p()}e.once("finish",y);function p(){P("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(P("pipe resume"),r.resume()),e};function Xl(e){return function(){var t=e._readableState;P("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&xo(e,"data")&&(t.flowing=!0,mi(e))}}I.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=go(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};I.prototype.on=function(e,t){var r=pi.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&Jt(this):Me.nextTick(Jl,this))}return r};I.prototype.addListener=I.prototype.on;function Jl(e){P("readable nexttick read 0"),e.read(0)}I.prototype.resume=function(){var e=this._readableState;return e.flowing||(P("resume"),e.flowing=!0,Ql(this,e)),this};function Ql(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick(ec,e,t))}function ec(e,t){t.reading||(P("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),mi(e),t.flowing&&!t.reading&&e.read(0)}I.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function mi(e){var t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}I.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(P("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(P("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(a){return function(){return e[a].apply(e,arguments)}})(n));for(var o=0;o<xi.length;o++)e.on(xi[o],this.emit.bind(this,xi[o]));return this._read=function(a){P("wrapped _read",a),i&&(i=!1,e.resume())},this};Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});I._fromList=_o;function _o(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=tc(e,t.buffer,t.decoder),r}function tc(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?rc(e,t):ic(e,t),i}function rc(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?n+=o:n+=o.slice(0,e),e-=a,e===0){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function ic(e,t){var r=pt.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(a));break}++n}return t.length-=n,r}function hi(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Me.nextTick(nc,t,e))}function nc(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function go(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var yi=d((hp,So)=>{"use strict";So.exports=xe;var Qt=Pe(),Eo=Object.create(Ne());Eo.inherits=Ue();Eo.inherits(xe,Qt);function oc(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function xe(e){if(!(this instanceof xe))return new xe(e);Qt.call(this,e),this._transformState={afterTransform:oc.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",ac)}function ac(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){bo(e,t,r)}):bo(this,null,null)}xe.prototype.push=function(e,t){return this._transformState.needTransform=!1,Qt.prototype.push.call(this,e,t)};xe.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};xe.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};xe.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};xe.prototype._destroy=function(e,t){var r=this;Qt.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function bo(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Ro=d((pp,Oo)=>{"use strict";Oo.exports=mt;var Ao=yi(),Fo=Object.create(Ne());Fo.inherits=Ue();Fo.inherits(mt,Ao);function mt(e){if(!(this instanceof mt))return new mt(e);Ao.call(this,e)}mt.prototype._transform=function(e,t,r){r(null,e)}});var We=d((G,er)=>{var ie=require("stream");process.env.READABLE_STREAM==="disable"&&ie?(er.exports=ie,G=er.exports=ie.Readable,G.Readable=ie.Readable,G.Writable=ie.Writable,G.Duplex=ie.Duplex,G.Transform=ie.Transform,G.PassThrough=ie.PassThrough,G.Stream=ie):(G=er.exports=si(),G.Stream=ie||G,G.Readable=G,G.Writable=ni(),G.Duplex=Pe(),G.Transform=yi(),G.PassThrough=Ro())});var To=d((mp,Po)=>{Po.exports=We().Duplex});var _i=d((vi,Co)=>{var tr=require("buffer"),ne=tr.Buffer;function Bo(e,t){for(var r in e)t[r]=e[r]}ne.from&&ne.alloc&&ne.allocUnsafe&&ne.allocUnsafeSlow?Co.exports=tr:(Bo(tr,vi),vi.Buffer=Te);function Te(e,t,r){return ne(e,t,r)}Te.prototype=Object.create(ne.prototype);Bo(ne,Te);Te.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ne(e,t,r)};Te.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=ne(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Te.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ne(e)};Te.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return tr.SlowBuffer(e)}});var Do=d((yp,qo)=>{var gi=To(),sc=require("util"),$e=_i().Buffer;function L(e){if(!(this instanceof L))return new L(e);if(this._bufs=[],this.length=0,typeof e=="function"){this._callback=e;var t=function(i){this._callback&&(this._callback(i),this._callback=null)}.bind(this);this.on("pipe",function(i){i.on("error",t)}),this.on("unpipe",function(i){i.removeListener("error",t)})}else this.append(e);gi.call(this)}sc.inherits(L,gi);L.prototype._offset=function(t){var r=0,i=0,n;if(t===0)return[0,0];for(;i<this._bufs.length;i++){if(n=r+this._bufs[i].length,t<n||i==this._bufs.length-1)return[i,t-r];r=n}};L.prototype.append=function(t){var r=0;if($e.isBuffer(t))this._appendBuffer(t);else if(Array.isArray(t))for(;r<t.length;r++)this.append(t[r]);else if(t instanceof L)for(;r<t._bufs.length;r++)this.append(t._bufs[r]);else t!=null&&(typeof t=="number"&&(t=t.toString()),this._appendBuffer($e.from(t)));return this};L.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length};L.prototype._write=function(t,r,i){this._appendBuffer(t),typeof i=="function"&&i()};L.prototype._read=function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)};L.prototype.end=function(t){gi.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)};L.prototype.get=function(t){return this.slice(t,t+1)[0]};L.prototype.slice=function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)};L.prototype.copy=function(t,r,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return t||$e.alloc(0);var o=!!t,a=this._offset(i),s=n-i,f=s,c=o&&r||0,l=a[1],x,u;if(i===0&&n==this.length){if(!o)return this._bufs.length===1?this._bufs[0]:$e.concat(this._bufs,this.length);for(u=0;u<this._bufs.length;u++)this._bufs[u].copy(t,c),c+=this._bufs[u].length;return t}if(f<=this._bufs[a[0]].length-l)return o?this._bufs[a[0]].copy(t,r,l,l+f):this._bufs[a[0]].slice(l,l+f);for(o||(t=$e.allocUnsafe(s)),u=a[0];u<this._bufs.length;u++){if(x=this._bufs[u].length-l,f>x)this._bufs[u].copy(t,c,l),c+=x;else{this._bufs[u].copy(t,c,l,l+f),c+=x;break}f-=x,l&&(l=0)}return t.length>c?t.slice(0,c):t};L.prototype.shallowSlice=function(t,r){t=t||0,r=r||this.length,t<0&&(t+=this.length),r<0&&(r+=this.length);var i=this._offset(t),n=this._offset(r),o=this._bufs.slice(i[0],n[0]+1);return n[1]==0?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),i[1]!=0&&(o[0]=o[0].slice(i[1])),new L(o)};L.prototype.toString=function(t,r,i){return this.slice(r,i).toString(t)};L.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this};L.prototype.duplicate=function(){for(var t=0,r=new L;t<this._bufs.length;t++)r.append(this._bufs[t]);return r};L.prototype.destroy=function(){this._bufs.length=0,this.length=0,this.push(null)};(function(){var e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1};for(var t in e)(function(r){L.prototype[r]=function(i){return this.slice(i,i+e[r])[r](0)}})(t)})();qo.exports=L});var ko=d((vp,Io)=>{Io.exports=uc;var fc=Object.prototype.hasOwnProperty;function uc(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)fc.call(r,i)&&(e[i]=r[i])}return e}});var No=d((_p,jo)=>{var lc={}.toString;jo.exports=Array.isArray||function(e){return lc.call(e)=="[object Array]"}});var He=d((gp,Uo)=>{"use strict";Uo.exports=TypeError});var wi=d((wp,Lo)=>{"use strict";Lo.exports=Object});var Mo=d((bp,zo)=>{"use strict";zo.exports=Error});var $o=d((Ep,Wo)=>{"use strict";Wo.exports=EvalError});var Go=d((Sp,Ho)=>{"use strict";Ho.exports=RangeError});var Zo=d((Ap,Yo)=>{"use strict";Yo.exports=ReferenceError});var bi=d((Fp,Ko)=>{"use strict";Ko.exports=SyntaxError});var Xo=d((Op,Vo)=>{"use strict";Vo.exports=URIError});var Qo=d((Rp,Jo)=>{"use strict";Jo.exports=Math.abs});var ta=d((Pp,ea)=>{"use strict";ea.exports=Math.floor});var ia=d((Tp,ra)=>{"use strict";ra.exports=Math.max});var oa=d((Bp,na)=>{"use strict";na.exports=Math.min});var sa=d((Cp,aa)=>{"use strict";aa.exports=Math.pow});var ua=d((qp,fa)=>{"use strict";fa.exports=Math.round});var ca=d((Dp,la)=>{"use strict";la.exports=Number.isNaN||function(t){return t!==t}});var da=d((Ip,xa)=>{"use strict";var cc=ca();xa.exports=function(t){return cc(t)||t===0?t:t<0?-1:1}});var pa=d((kp,ha)=>{"use strict";ha.exports=Object.getOwnPropertyDescriptor});var Ge=d((jp,ma)=>{"use strict";var rr=pa();if(rr)try{rr([],"length")}catch{rr=null}ma.exports=rr});var yt=d((Np,ya)=>{"use strict";var ir=Object.defineProperty||!1;if(ir)try{ir({},"a",{value:1})}catch{ir=!1}ya.exports=ir});var Ei=d((Up,va)=>{"use strict";va.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[r]=n;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==n||s.enumerable!==!0)return!1}return!0}});var wa=d((Lp,ga)=>{"use strict";var _a=typeof Symbol<"u"&&Symbol,xc=Ei();ga.exports=function(){return typeof _a!="function"||typeof Symbol!="function"||typeof _a("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:xc()}});var Si=d((zp,ba)=>{"use strict";ba.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Ai=d((Mp,Ea)=>{"use strict";var dc=wi();Ea.exports=dc.getPrototypeOf||null});var Fa=d((Wp,Aa)=>{"use strict";var hc="Function.prototype.bind called on incompatible ",pc=Object.prototype.toString,mc=Math.max,yc="[object Function]",Sa=function(t,r){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<r.length;o+=1)i[o+t.length]=r[o];return i},vc=function(t,r){for(var i=[],n=r||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},_c=function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r};Aa.exports=function(t){var r=this;if(typeof r!="function"||pc.apply(r)!==yc)throw new TypeError(hc+r);for(var i=vc(arguments,1),n,o=function(){if(this instanceof n){var l=r.apply(this,Sa(i,arguments));return Object(l)===l?l:this}return r.apply(t,Sa(i,arguments))},a=mc(0,r.length-i.length),s=[],f=0;f<a;f++)s[f]="$"+f;if(n=Function("binder","return function ("+_c(s,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=function(){};c.prototype=r.prototype,n.prototype=new c,c.prototype=null}return n}});var Ye=d(($p,Oa)=>{"use strict";var gc=Fa();Oa.exports=Function.prototype.bind||gc});var nr=d((Hp,Ra)=>{"use strict";Ra.exports=Function.prototype.call});var or=d((Gp,Pa)=>{"use strict";Pa.exports=Function.prototype.apply});var Ba=d((Yp,Ta)=>{"use strict";Ta.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Fi=d((Zp,Ca)=>{"use strict";var wc=Ye(),bc=or(),Ec=nr(),Sc=Ba();Ca.exports=Sc||wc.call(Ec,bc)});var ar=d((Kp,qa)=>{"use strict";var Ac=Ye(),Fc=He(),Oc=nr(),Rc=Fi();qa.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new Fc("a function is required");return Rc(Ac,Oc,t)}});var Ua=d((Vp,Na)=>{"use strict";var Pc=ar(),Da=Ge(),ka;try{ka=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Oi=!!ka&&Da&&Da(Object.prototype,"__proto__"),ja=Object,Ia=ja.getPrototypeOf;Na.exports=Oi&&typeof Oi.get=="function"?Pc([Oi.get]):typeof Ia=="function"?function(t){return Ia(t==null?t:ja(t))}:!1});var Ri=d((Xp,Wa)=>{"use strict";var La=Si(),za=Ai(),Ma=Ua();Wa.exports=La?function(t){return La(t)}:za?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return za(t)}:Ma?function(t){return Ma(t)}:null});var Ha=d((Jp,$a)=>{"use strict";var Tc=async function(){}.constructor;$a.exports=()=>Tc});var Ya=d((Qp,Ga)=>{"use strict";var Bc=function*(){}.constructor;Ga.exports=()=>Bc});var Ka=d((em,Za)=>{"use strict";var Cc=async function*(){}.constructor;Za.exports=()=>Cc});var Xa=d((tm,Va)=>{"use strict";var qc=Function.prototype.call,Dc=Object.prototype.hasOwnProperty,Ic=Ye();Va.exports=Ic.call(qc,Dc)});var Ti=d((rm,rs)=>{"use strict";var S,kc=wi(),jc=Mo(),Nc=$o(),Uc=Go(),Lc=Zo(),Xe=bi(),Ve=He(),zc=Xo(),Mc=Qo(),Wc=ta(),$c=ia(),Hc=oa(),Gc=sa(),Yc=ua(),Zc=da(),vt=Ge(),Kc=yt(),Pi=function(){throw new Ve},Vc=vt?(function(){try{return arguments.callee,Pi}catch{try{return vt(arguments,"callee").get}catch{return Pi}}})():Pi,Ze=wa()(),$=Ri(),Xc=Ai(),Jc=Si(),ts=or(),_t=nr(),Ke={},Qc=typeof Uint8Array>"u"||!$?S:$(Uint8Array),Be={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?S:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?S:ArrayBuffer,"%ArrayIteratorPrototype%":Ze&&$?$([][Symbol.iterator]()):S,"%AsyncFromSyncIteratorPrototype%":S,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?S:Atomics,"%BigInt%":typeof BigInt>"u"?S:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?S:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?S:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?S:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jc,"%eval%":eval,"%EvalError%":Nc,"%Float16Array%":typeof Float16Array>"u"?S:Float16Array,"%Float32Array%":typeof Float32Array>"u"?S:Float32Array,"%Float64Array%":typeof Float64Array>"u"?S:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?S:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?S:Int8Array,"%Int16Array%":typeof Int16Array>"u"?S:Int16Array,"%Int32Array%":typeof Int32Array>"u"?S:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ze&&$?$($([][Symbol.iterator]())):S,"%JSON%":typeof JSON=="object"?JSON:S,"%Map%":typeof Map>"u"?S:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ze||!$?S:$(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":kc,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?S:Promise,"%Proxy%":typeof Proxy>"u"?S:Proxy,"%RangeError%":Uc,"%ReferenceError%":Lc,"%Reflect%":typeof Reflect>"u"?S:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?S:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ze||!$?S:$(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?S:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ze&&$?$(""[Symbol.iterator]()):S,"%Symbol%":Ze?Symbol:S,"%SyntaxError%":Xe,"%ThrowTypeError%":Vc,"%TypedArray%":Qc,"%TypeError%":Ve,"%Uint8Array%":typeof Uint8Array>"u"?S:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?S:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?S:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?S:Uint32Array,"%URIError%":zc,"%WeakMap%":typeof WeakMap>"u"?S:WeakMap,"%WeakRef%":typeof WeakRef>"u"?S:WeakRef,"%WeakSet%":typeof WeakSet>"u"?S:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":ts,"%Object.defineProperty%":Kc,"%Object.getPrototypeOf%":Xc,"%Math.abs%":Mc,"%Math.floor%":Wc,"%Math.max%":$c,"%Math.min%":Hc,"%Math.pow%":Gc,"%Math.round%":Yc,"%Math.sign%":Zc,"%Reflect.getPrototypeOf%":Jc};if($)try{null.error}catch(e){Ja=$($(e)),Be["%Error.prototype%"]=Ja}var Ja,ex=Ha(),tx=Ya(),rx=Ka(),ix=function e(t){var r;if(t==="%AsyncFunction%")r=ex()||void 0;else if(t==="%GeneratorFunction%")r=tx()||void 0;else if(t==="%AsyncGeneratorFunction%")r=rx()||void 0;else if(t==="%AsyncGenerator%"){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=e("%AsyncGenerator%");n&&$&&(r=$(n.prototype))}return Be[t]=r,r},Qa={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gt=Ye(),sr=Xa(),nx=gt.call(_t,Array.prototype.concat),ox=gt.call(ts,Array.prototype.splice),es=gt.call(_t,String.prototype.replace),fr=gt.call(_t,String.prototype.slice),ax=gt.call(_t,RegExp.prototype.exec),sx=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fx=/\\(\\)?/g,ux=function(t){var r=fr(t,0,1),i=fr(t,-1);if(r==="%"&&i!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var n=[];return es(t,sx,function(o,a,s,f){n[n.length]=s?es(f,fx,"$1"):a||o}),n},lx=function(t,r){var i=t,n;if(sr(Qa,i)&&(n=Qa[i],i="%"+n[0]+"%"),sr(Be,i)){var o=Be[i];if(o===Ke&&(o=ix(i)),typeof o>"u"&&!r)throw new Ve("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new Xe("intrinsic "+t+" does not exist!")};rs.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Ve("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ve('"allowMissing" argument must be a boolean');if(ax(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=ux(t),n=i.length>0?i[0]:"",o=lx("%"+n+"%",r),a=o.name,s=o.value,f=!1,c=o.alias;c&&(n=c[0],ox(i,nx([0,1],c)));for(var l=1,x=!0;l<i.length;l+=1){var u=i[l],h=fr(u,0,1),m=fr(u,-1);if((h==='"'||h==="'"||h==="`"||m==='"'||m==="'"||m==="`")&&h!==m)throw new Xe("property names with quotes must have matching quotes");if((u==="constructor"||!x)&&(f=!0),n+="."+u,a="%"+n+"%",sr(Be,a))s=Be[a];else if(s!=null){if(!(u in s)){if(!r)throw new Ve("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&l+1>=i.length){var y=vt(s,u);x=!!y,x&&"get"in y&&!("originalValue"in y.get)?s=y.get:s=s[u]}else x=sr(s,u),s=s[u];x&&!f&&(Be[a]=s)}}return s}});var Bi=d((im,os)=>{"use strict";var is=Ti(),ns=ar(),cx=ns([is("%String.prototype.indexOf%")]);os.exports=function(t,r){var i=is(t,!!r);return typeof i=="function"&&cx(t,".prototype.")>-1?ns([i]):i}});var us=d((nm,fs)=>{"use strict";var ss=Function.prototype.toString,Je=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,qi,ur;if(typeof Je=="function"&&typeof Object.defineProperty=="function")try{qi=Object.defineProperty({},"length",{get:function(){throw ur}}),ur={},Je(function(){throw 42},null,qi)}catch(e){e!==ur&&(Je=null)}else Je=null;var xx=/^\s*class\b/,Di=function(t){try{var r=ss.call(t);return xx.test(r)}catch{return!1}},Ci=function(t){try{return Di(t)?!1:(ss.call(t),!0)}catch{return!1}},lr=Object.prototype.toString,dx="[object Object]",hx="[object Function]",px="[object GeneratorFunction]",mx="[object HTMLAllCollection]",yx="[object HTML document.all class]",vx="[object HTMLCollection]",_x=typeof Symbol=="function"&&!!Symbol.toStringTag,gx=!(0 in[,]),Ii=function(){return!1};typeof document=="object"&&(as=document.all,lr.call(as)===lr.call(document.all)&&(Ii=function(t){if((gx||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=lr.call(t);return(r===mx||r===yx||r===vx||r===dx)&&t("")==null}catch{}return!1}));var as;fs.exports=Je?function(t){if(Ii(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Je(t,null,qi)}catch(r){if(r!==ur)return!1}return!Di(t)&&Ci(t)}:function(t){if(Ii(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(_x)return Ci(t);if(Di(t))return!1;var r=lr.call(t);return r!==hx&&r!==px&&!/^\[object HTML/.test(r)?!1:Ci(t)}});var xs=d((om,cs)=>{"use strict";var wx=us(),bx=Object.prototype.toString,ls=Object.prototype.hasOwnProperty,Ex=function(t,r,i){for(var n=0,o=t.length;n<o;n++)ls.call(t,n)&&(i==null?r(t[n],n,t):r.call(i,t[n],n,t))},Sx=function(t,r,i){for(var n=0,o=t.length;n<o;n++)i==null?r(t.charAt(n),n,t):r.call(i,t.charAt(n),n,t)},Ax=function(t,r,i){for(var n in t)ls.call(t,n)&&(i==null?r(t[n],n,t):r.call(i,t[n],n,t))};function Fx(e){return bx.call(e)==="[object Array]"}cs.exports=function(t,r,i){if(!wx(r))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),Fx(t)?Ex(t,r,n):typeof t=="string"?Sx(t,r,n):Ax(t,r,n)}});var hs=d((am,ds)=>{"use strict";ds.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var ms=d((sm,ps)=>{"use strict";var ki=hs(),Ox=typeof globalThis>"u"?global:globalThis;ps.exports=function(){for(var t=[],r=0;r<ki.length;r++)typeof Ox[ki[r]]=="function"&&(t[t.length]=ki[r]);return t}});var gs=d((fm,_s)=>{"use strict";var ys=yt(),Rx=bi(),Qe=He(),vs=Ge();_s.exports=function(t,r,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Qe("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Qe("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qe("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qe("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qe("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qe("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,f=!!vs&&vs(t,r);if(ys)ys(t,r,{configurable:a===null&&f?f.configurable:!a,enumerable:n===null&&f?f.enumerable:!n,value:i,writable:o===null&&f?f.writable:!o});else if(s||!n&&!o&&!a)t[r]=i;else throw new Rx("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Es=d((um,bs)=>{"use strict";var ji=yt(),ws=function(){return!!ji};ws.hasArrayLengthDefineBug=function(){if(!ji)return null;try{return ji([],"length",{value:1}).length!==1}catch{return!0}};bs.exports=ws});var Rs=d((lm,Os)=>{"use strict";var Px=Ti(),Ss=gs(),Tx=Es()(),As=Ge(),Fs=He(),Bx=Px("%Math.floor%");Os.exports=function(t,r){if(typeof t!="function")throw new Fs("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Bx(r)!==r)throw new Fs("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&As){var a=As(t,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(Tx?Ss(t,"length",r,!0,!0):Ss(t,"length",r)),t}});var Ts=d((cm,Ps)=>{"use strict";var Cx=Ye(),qx=or(),Dx=Fi();Ps.exports=function(){return Dx(Cx,qx,arguments)}});var qs=d((xm,cr)=>{"use strict";var Ix=Rs(),Bs=yt(),kx=ar(),Cs=Ts();cr.exports=function(t){var r=kx(arguments),i=t.length-(arguments.length-1);return Ix(r,1+(i>0?i:0),!0)};Bs?Bs(cr.exports,"apply",{value:Cs}):cr.exports.apply=Cs});var Is=d((dm,Ds)=>{"use strict";var jx=Ei();Ds.exports=function(){return jx()&&!!Symbol.toStringTag}});var Ls=d((hm,Us)=>{"use strict";var hr=xs(),Nx=ms(),ks=qs(),Ui=Bi(),dr=Ge(),xr=Ri(),Ux=Ui("Object.prototype.toString"),Ns=Is()(),js=typeof globalThis>"u"?global:globalThis,Ni=Nx(),Li=Ui("String.prototype.slice"),Lx=Ui("Array.prototype.indexOf",!0)||function(t,r){for(var i=0;i<t.length;i+=1)if(t[i]===r)return i;return-1},pr={__proto__:null};Ns&&dr&&xr?hr(Ni,function(e){var t=new js[e];if(Symbol.toStringTag in t&&xr){var r=xr(t),i=dr(r,Symbol.toStringTag);if(!i&&r){var n=xr(r);i=dr(n,Symbol.toStringTag)}pr["$"+e]=ks(i.get)}}):hr(Ni,function(e){var t=new js[e],r=t.slice||t.set;r&&(pr["$"+e]=ks(r))});var zx=function(t){var r=!1;return hr(pr,function(i,n){if(!r)try{"$"+i(t)===n&&(r=Li(n,1))}catch{}}),r},Mx=function(t){var r=!1;return hr(pr,function(i,n){if(!r)try{i(t),r=Li(n,1)}catch{}}),r};Us.exports=function(t){if(!t||typeof t!="object")return!1;if(!Ns){var r=Li(Ux(t),8,-1);return Lx(Ni,r)>-1?r:r!=="Object"?!1:Mx(t)}return dr?zx(t):null}});var Ms=d((pm,zs)=>{"use strict";var Wx=Ls();zs.exports=function(t){return!!Wx(t)}});var $s=d((mm,Ws)=>{"use strict";var $x=He(),Hx=Bi(),Gx=Hx("TypedArray.prototype.buffer",!0),Yx=Ms();Ws.exports=Gx||function(t){if(!Yx(t))throw new $x("Not a Typed Array");return t.buffer}});var zi=d((ym,Gs)=>{"use strict";var te=_i().Buffer,Zx=No(),Kx=$s(),Vx=ArrayBuffer.isView||function(t){try{return Kx(t),!0}catch{return!1}},Xx=typeof Uint8Array<"u",Hs=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Jx=Hs&&(te.prototype instanceof Uint8Array||te.TYPED_ARRAY_SUPPORT);Gs.exports=function(t,r){if(te.isBuffer(t))return t.constructor&&!("isBuffer"in t)?te.from(t):t;if(typeof t=="string")return te.from(t,r);if(Hs&&Vx(t)){if(t.byteLength===0)return te.alloc(0);if(Jx){var i=te.from(t.buffer,t.byteOffset,t.byteLength);if(i.byteLength===t.byteLength)return i}var n=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=te.from(n);if(o.length===t.byteLength)return o}if(Xx&&t instanceof Uint8Array)return te.from(t);var a=Zx(t);if(a)for(var s=0;s<t.length;s+=1){var f=t[s];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||te.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return te.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var Zs=d((vm,Ys)=>{var Qx=(function(){try{if(!Buffer.isEncoding("latin1"))return!1;var e=Buffer.alloc?Buffer.alloc(4):new Buffer(4);return e.fill("ab","ucs2"),e.toString("hex")==="61006200"}catch{return!1}})();function ed(e){return e.length===1&&e.charCodeAt(0)<256}function mr(e,t,r,i){if(r<0||i>e.length)throw new RangeError("Out of range index");return r=r>>>0,i=i===void 0?e.length:i>>>0,i>r&&e.fill(t,r,i),e}function td(e,t,r,i){if(r<0||i>e.length)throw new RangeError("Out of range index");if(i<=r)return e;r=r>>>0,i=i===void 0?e.length:i>>>0;for(var n=r,o=t.length;n<=i-o;)t.copy(e,n),n+=o;return n!==i&&t.copy(e,n,0,i-n),e}function rd(e,t,r,i,n){if(Qx)return e.fill(t,r,i,n);if(typeof t=="number")return mr(e,t,r,i);if(typeof t=="string"){if(typeof r=="string"?(n=r,r=0,i=e.length):typeof i=="string"&&(n=i,i=e.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(n==="latin1"&&(n="binary"),typeof n=="string"&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(t==="")return mr(e,0,r,i);if(ed(t))return mr(e,t.charCodeAt(0),r,i);t=new Buffer(t,n)}return Buffer.isBuffer(t)?td(e,t,r,i):mr(e,0,r,i)}Ys.exports=rd});var Vs=d((_m,Ks)=>{function id(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative');return Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e)}Ks.exports=id});var Mi=d((gm,Js)=>{var Xs=Zs(),nd=Vs();Js.exports=function(t,r,i){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');if(Buffer.alloc)return Buffer.alloc(t,r,i);var n=nd(t);return t===0?n:r===void 0?Xs(n,0):(typeof i!="string"&&(i=void 0),Xs(n,r,i))}});var $i=d(tt=>{var od=zi(),ad=Mi(),sd="0000000000000000000",fd="7777777777777777777",Qs=48,ud="ustar\x0000",ld=parseInt("7777",8),cd=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},xd=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},dd=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},ef=function(e,t,r,i){for(;r<i;r++)if(e[r]===t)return r;return i},tf=function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var i=156;i<512;i++)t+=e[i];return t},ve=function(e,t){return e=e.toString(8),e.length>t?fd.slice(0,t)+" ":sd.slice(0,t-e.length)+e+" "};function hd(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=!1,i=[],n=e.length-1;n>0;n--){var o=e[n];t?i.push(o):r&&o===0?i.push(0):r?(r=!1,i.push(256-o)):i.push(255-o)}var a=0,s=i.length;for(n=0;n<s;n++)a+=i[n]*Math.pow(256,n);return t?a:-1*a}var _e=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return hd(e);for(;t<e.length&&e[t]===32;)t++;for(var i=cd(ef(e,32,t,e.length),e.length,e.length);t<i&&e[t]===0;)t++;return i===t?0:parseInt(e.slice(t,i).toString(),8)},et=function(e,t,r,i){return e.slice(t,ef(e,0,t,t+r)).toString(i)},Wi=function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e};tt.decodeLongPath=function(e,t){return et(e,0,e.length,t)};tt.encodePax=function(e){var t="";e.name&&(t+=Wi(" path="+e.name+`
|
|
3
3
|
`)),e.linkname&&(t+=Wi(" linkpath="+e.linkname+`
|
|
4
4
|
`));var r=e.pax;if(r)for(var i in r)t+=Wi(" "+i+"="+r[i]+`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azureauth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "node-azure auth wrapps the AzureAuth CLI wrapper for performing AAD Authentication",
|
|
5
5
|
"bin": "./scripts/azureauth.cjs",
|
|
6
6
|
"repository": {
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@types/decompress": "^4.2.7",
|
|
41
41
|
"@types/node": "^20.17.28",
|
|
42
42
|
"decompress": "^4.2.1",
|
|
43
|
-
"esbuild": "^0.
|
|
43
|
+
"esbuild": "^0.28.1",
|
|
44
44
|
"execa": "^7.2.0",
|
|
45
45
|
"node-downloader-helper": "^2.1.9",
|
|
46
46
|
"prettier": "^3.5.3",
|
|
47
47
|
"typescript": "^5.8.2",
|
|
48
|
-
"vite": "
|
|
49
|
-
"vitest": "^
|
|
48
|
+
"vite": "^6.4.2",
|
|
49
|
+
"vitest": "^4.1.0"
|
|
50
50
|
}
|
|
51
51
|
}
|