azureauth 0.4.6 → 0.5.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/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
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(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$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,"spawn");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
+ `: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
+ ${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
+ ${r.message}`:E,L=[j,t,e].filter(Boolean).join(`
5
+ `);return N?(r.originalMessage=r.message,r.message=L):r=new Error(L),r.shortMessage=j,r.command=s,r.escapedCommand=a,r.exitCode=i,r.signal=o,r.signalDescription=S,r.stdout=e,r.stderr=t,r.cwd=m,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=u,r.killed=d&&!c,r};var _=["stdin","stdout","stderr"],sr=e=>_.some(t=>e[t]!==void 0),It=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return _.map(r=>e[r]);if(sr(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${_.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,_.length);return Array.from({length:n},(r,o)=>t[o])};var Rt=k($t(),1);import ar from"node:os";var cr=1e3*5,Nt=(e,t="SIGTERM",n={})=>{let r=e(t);return ur(e,t,n,r),r},ur=(e,t,n,r)=>{if(!dr(t,n,r))return;let o=lr(n),i=setTimeout(()=>{e("SIGKILL")},o);i.unref&&i.unref()},dr=(e,{forceKillAfterTimeout:t},n)=>fr(e)&&t!==!1&&n,fr=e=>e===ar.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",lr=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return cr;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},jt=(e,t)=>{e.kill()&&(t.isCanceled=!0)},pr=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Lt=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let o,i=new Promise((a,c)=>{o=setTimeout(()=>{pr(e,n,c)},t)}),s=r.finally(()=>{clearTimeout(o)});return Promise.race([i,s])},kt=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Bt=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let o=(0,Rt.default)(()=>{e.kill()});return r.finally(()=>{o()})};import{createWriteStream as mr}from"node:fs";import{ChildProcess as hr}from"node:child_process";function W(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function de(e){return W(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}var gr=e=>e instanceof hr&&typeof e.then=="function",fe=(e,t,n)=>{if(typeof n=="string")return e[t].pipe(mr(n)),e;if(de(n))return e[t].pipe(n),e;if(!gr(n))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!de(n.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(n.stdin),n},Ft=e=>{e.stdout!==null&&(e.pipeStdout=fe.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=fe.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=fe.bind(void 0,e,"all"))};import{createReadStream as vr,readFileSync as Ir}from"node:fs";var he=k(_t(),1),zt=k(Dt(),1),Ht=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Pr=({input:e,inputFile:t})=>typeof t!="string"?e:(Ht(e),Ir(t)),Wt=e=>{let t=Pr(e);if(W(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},Cr=({input:e,inputFile:t})=>typeof t!="string"?e:(Ht(e),vr(t)),Kt=(e,t)=>{let n=Cr(t);n!==void 0&&(W(n)?n.pipe(e.stdin):e.stdin.end(n))},Xt=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=(0,zt.default)();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},pe=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(n){return n.bufferedData}}},me=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?(0,he.default)(e,{encoding:t,maxBuffer:r}):he.default.buffer(e,{maxBuffer:r})},Vt=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:o,maxBuffer:i},s)=>{let a=me(e,{encoding:r,buffer:o,maxBuffer:i}),c=me(t,{encoding:r,buffer:o,maxBuffer:i}),u=me(n,{encoding:r,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,a,c,u])}catch(d){return Promise.all([{error:d,signal:d.signal,timedOut:d.timedOut},pe(e,a),pe(t,c),pe(n,u)])}};var Ar=(async()=>{})().constructor.prototype,Gr=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ar,e)]),ge=(e,t)=>{for(let[n,r]of Gr){let o=typeof t=="function"?(...i)=>Reflect.apply(r.value,t(),i):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:o})}},Yt=e=>new Promise((t,n)=>{e.on("exit",(r,o)=>{t({exitCode:r,signal:o})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});import{Buffer as Or}from"node:buffer";import{ChildProcess as $r}from"node:child_process";var Jt=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Rr=/^[\w.-]+$/,Nr=/"/g,jr=e=>typeof e!="string"||Rr.test(e)?e:`"${e.replace(Nr,'\\"')}"`,ye=(e,t)=>Jt(e,t).join(" "),Se=(e,t)=>Jt(e,t).map(n=>jr(n)).join(" "),Lr=/ +/g;var Qt=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(t==="object"&&e!==null&&!(e instanceof $r)&&"stdout"in e){let n=typeof e.stdout;if(n==="string")return e.stdout;if(Or.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${n}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},Zt=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e[e.length-1]}${t[0]}`,...t.slice(1)],kr=({templates:e,expressions:t,tokens:n,index:r,template:o})=>{let i=o??e.raw[r],s=i.split(Lr).filter(Boolean),a=Zt(n,s,i.startsWith(" "));if(r===t.length)return a;let c=t[r],u=Array.isArray(c)?c.map(d=>Qt(d)):[Qt(c)];return Zt(a,u,i.endsWith(" "))},xe=(e,t)=>{let n=[];for(let[r,o]of e.entries())n=kr({templates:e,expressions:t,tokens:n,index:r,template:o});return n};import{debuglog as Br}from"node:util";import Fr from"node:process";var en=Br("execa").enabled,X=(e,t)=>String(e).padStart(t,"0"),Mr=()=>{let e=new Date;return`${X(e.getHours(),2)}:${X(e.getMinutes(),2)}:${X(e.getSeconds(),2)}.${X(e.getMilliseconds(),3)}`},be=(e,{verbose:t})=>{t&&Fr.stderr.write(`[${Mr()}] ${e}
6
+ `)};var qr=1e3*1e3*100,Dr=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:o})=>{let i=t?{...V.env,...e}:e;return n?yt({env:i,cwd:r,execPath:o}):i},rn=(e,t,n={})=>{let r=nn.default._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:qr,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||V.cwd(),execPath:V.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:en,...n},n.env=Dr(n),n.stdio=It(n),V.platform==="win32"&&_r.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},R=(e,t,n)=>typeof t!="string"&&!Ur.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?ie(t):t;function Ee(e,t,n){let r=rn(e,t,n),o=ye(e,t),i=Se(e,t);be(i,r.options),kt(r.options);let s;try{s=we.spawn(r.file,r.args,r.options)}catch(S){let y=new we.ChildProcess,x=Promise.reject(G({error:S,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return ge(y,x),y}let a=Yt(s),c=Lt(s,r.options,a),u=Bt(s,r.options,c),d={isCanceled:!1};s.kill=Nt.bind(null,s.kill.bind(s)),s.cancel=jt.bind(null,s,d);let m=xt(async()=>{let[{error:S,exitCode:y,signal:x,timedOut:E},N,j,L]=await Vt(s,r.options,u),Te=R(r.options,N),ve=R(r.options,j),Ie=R(r.options,L);if(S||y!==0||x!==null){let Pe=G({error:S,exitCode:y,signal:x,stdout:Te,stderr:ve,all:Ie,command:o,escapedCommand:i,parsed:r,timedOut:E,isCanceled:d.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:s.killed});if(!r.options.reject)return Pe;throw Pe}return{command:o,escapedCommand:i,exitCode:0,stdout:Te,stderr:ve,all:Ie,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Kt(s,r.options),s.all=Xt(s,r.options),Ft(s),ge(s,m),s}function zr(e,t,n){let r=rn(e,t,n),o=ye(e,t),i=Se(e,t);be(i,r.options);let s=Wt(r.options),a;try{a=we.spawnSync(r.file,r.args,{...r.options,input:s})}catch(d){throw G({error:d,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let c=R(r.options,a.stdout,a.error),u=R(r.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){let d=G({stdout:c,stderr:u,error:a.error,signal:a.signal,exitCode:a.status,command:o,escapedCommand:i,parsed:r,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:!1,killed:a.signal!==null});if(!r.options.reject)return d;throw d}return{command:o,escapedCommand:i,exitCode:0,stdout:c,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var Hr=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},tn=(e={})=>({preferLocal:!0,...Hr(e),...e});function on(e){function t(n,...r){if(!Array.isArray(n))return on({...e,...n});let[o,...i]=xe(n,r);return Ee(o,i,tn(e))}return t.sync=(n,...r)=>{if(!Array.isArray(n))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[o,...i]=xe(n,r);return zr(o,i,tn(e))},t}var wi=on();import Wr from"node:path";import Kr from"node:process";var sn=()=>{let e=Wr.join(__dirname,"..","bin","azureauth","azureauth");return Kr.platform==="win32"&&(e=e+".exe"),e};var Xr=e=>{let t=["ado","pat",`--prompt-hint "${e.promptHint}"`,`--organization "${e.organization}"`,`--display-name "${e.displayName}"`,...e.scope.map(n=>`--scope ${n}`)];return e.output?t.push(`--output ${e.output}`):t.push("--output json"),e.mode&&t.push(`--mode "${e.mode}"`),e.domain&&t.push(`--domain "${e.domain}"`),e.timeout&&t.push(`--timeout ${e.timeout}`),t},Vr=async e=>{let t=Xr(e);try{let n=await Ee(sn(),t);return e.output==="json"?JSON.parse(n.stdout):n.stdout}catch(n){throw new Error("Failed to get Ado Pat: "+n.message)}};export{Vr as adoPat};
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,30 @@
1
+ "use strict";var us=Object.create;var vt=Object.defineProperty;var ls=Object.getOwnPropertyDescriptor;var cs=Object.getOwnPropertyNames;var xs=Object.getPrototypeOf,ds=Object.prototype.hasOwnProperty;var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hs=(e,t)=>{for(var r in t)vt(e,r,{get:t[r],enumerable:!0})},gi=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of cs(t))!ds.call(e,n)&&n!==r&&vt(e,n,{get:()=>t[n],enumerable:!(i=ls(t,n))||i.enumerable});return e};var gt=(e,t,r)=>(r=e!=null?us(xs(e)):{},gi(t||!e||!e.__esModule?vt(r,"default",{value:e,enumerable:!0}):r,e)),ps=e=>gi(vt({},"__esModule",{value:!0}),e);var Fi=m(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.DownloaderHelper=Ce.DH_STATES=void 0;var xr=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},ms=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}}(),_s=require("fs"),Y=wt(_s),Be=require("url"),ys=require("path"),Ee=wt(ys),vs=require("http"),wi=wt(vs),gs=require("https"),bi=wt(gs),ws=require("events");function wt(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 bs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ei(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 Es(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 Si=Ce.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"},Ju=Ce.DownloaderHelper=function(e){function t(r,i){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};bs(this,t);var a=Ei(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{captureRejections:!0}));return a.__validate(r,i)?(a.url=a.requestURL=r.trim(),a.state=Si.IDLE,a.__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},a.__opts=Object.assign({},a.__defaultOpts),a.__pipes=[],a.__total=0,a.__downloaded=0,a.__progress=0,a.__retryCount=0,a.__retryTimeout=null,a.__resumeRetryCount=0,a.__states=Si,a.__promise=null,a.__request=null,a.__response=null,a.__isAborted=!1,a.__isResumed=!1,a.__isResumable=!1,a.__isRedirected=!1,a.__destFolder=i,a.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},a.__fileName="",a.__filePath="",a.updateOptions(n),a):Ei(a)}return Es(t,e),ms(t,[{key:"start",value:function(){var i=this,n=function(){return new Promise(function(a,o){i.__promise={resolve:a,reject:o},i.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(a){var o=a.name,s=a.total,u=i.__opts.override;if(i.__opts.override=!0,i.__filePath=i.__getFilePath(o),i.__opts.override=u,i.__filePath&&Y.existsSync(i.__filePath)){var x=i.__getFilesizeInBytes(i.__filePath);return x===s?n():i.resumeFromFile(i.__filePath,{total:s,fileName:o})}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(a,o){Y.access(i.__filePath,function(s){return s?(i.__emitStop(),a(!0)):void Y.unlink(i.__filePath,function(u){return u?(i.__setState(i.__states.FAILED),i.emit("error",u),o(u)):(i.__emitStop(),void a(!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,a=function(s){return i.__response?i.__response.unpipe(s):s.unpipe()};if(n){var o=this.__pipes.find(function(s){return s.stream===n});return void(o&&(a(n),this.__pipes=this.__pipes.filter(function(s){return s.stream!==n})))}this.__pipes.forEach(function(s){return a(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,a){var o=function(u){i.__initProtocol(u);var x=Object.assign({},i.__headers);x.hasOwnProperty("range")&&delete x.range;var l=i.__getReqOptions("HEAD",u,x);return Object.assign({},i.__reqOptions,l)},s=function(u,x){var l=i.__protocol.request(x,function(c){if(i.__isRequireRedirect(c)){var f=/^https?:\/\//.test(c.headers.location)?c.headers.location:new Be.URL(c.headers.location,u).href;return i.emit("redirected",f,u),s(f,o(f))}return c.statusCode===200?void n({name:i.__getFileNameFromHeaders(c.headers,c),total:parseInt(c.headers["content-length"])||null}):a(new Error("Response status was "+c.statusCode))});l.on("error",function(c){return a(c)}),l.on("timeout",function(){return a(new Error("timeout"))}),l.on("uncaughtException",function(c){return a(c)}),l.end()};s(i.url,o(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,a=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=i,(a.total&&a.fileName?Promise.resolve({name:a.fileName,total:a.total}):this.getTotalSize()).then(function(o){var s=o.name,u=o.total;return n.__total=a.total||u,n.__fileName=a.fileName||s,n.__downloaded=a.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(x,l){n.__promise={resolve:x,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 a=this;return this.__protocol.request(this.__reqOptions,function(o){if(a.__response=o,a.__isResumed||(a.__total=parseInt(o.headers["content-length"])||null,a.__resetStats()),a.__isRequireRedirect(o)){var s=/^https?:\/\//.test(o.headers.location)?o.headers.location:new Be.URL(o.headers.location,a.url).href;return a.__isRedirected=!0,a.__initProtocol(s),a.emit("redirected",s,a.url),a.__start()}if(o.statusCode!==200&&o.statusCode!==206){var u=new Error("Response status was "+o.statusCode);return u.status=o.statusCode||0,u.body=o.body||"",a.__setState(a.__states.FAILED),a.emit("error",u),n(u)}(a.__opts.forceResume||o.headers.hasOwnProperty("accept-ranges")&&o.headers["accept-ranges"]!=="none")&&(a.__isResumable=!0),a.__startDownload(o,i,n)})}},{key:"__startDownload",value:function(i,n,a){var o=this,s=i;if(this.__isResumed)this.__fileStream=Y.createWriteStream(this.__filePath,{flags:"a"});else{var u=this.__getFileNameFromHeaders(i.headers);if(this.__filePath=this.__getFilePath(u),this.__fileName=this.__filePath.split(Ee.sep).pop(),Y.existsSync(this.__filePath)){var x=this.__getFilesizeInBytes(this.__filePath),l=this.__total?this.__total:0;if(xr(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||x>=l))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:x}),this.__setState(this.__states.SKIPPED),n(!0)}this.__fileStream=Y.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(c){return o.__calculateStats(c.length)}),this.__pipes.forEach(function(c){s.pipe(c.stream,c.options),s=c.stream}),s.pipe(this.__fileStream),s.on("error",this.__onError(n,a)),this.__fileStream.on("finish",this.__onFinished(n,a)),this.__fileStream.on("error",this.__onError(n,a))}},{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 a=this;return function(){a.__fileStream.close(function(o){if(o)return n(o);if(a.__hasFinished()){var s=!!a.__total&&a.__downloaded!==a.__total;if(s&&a.__isResumable&&a.__opts.resumeOnIncomplete&&a.__resumeRetryCount<=a.__opts.resumeOnIncompleteMaxRetry)return a.__resumeRetryCount++,a.emit("warning",new Error("uncomplete download, retrying")),a.resume();a.__setState(a.__states.FINISHED),a.__pipes=[],a.emit("end",{fileName:a.__fileName,filePath:a.__filePath,totalSize:a.__total,incomplete:s,onDiskSize:a.__getFilesizeInBytes(a.__filePath),downloadedSize:a.__downloaded})}return i(a.__downloaded===a.__total)})}}},{key:"__closeFileStream",value:function(){var i=this;return this.__fileStream?new Promise(function(n,a){i.__fileStream.close(function(o){return o?a(o):n(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(i,n){var a=this,o=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function(s){return a.__pipes=[],o&&a.__requestAbort(),a.state===a.__states.STOPPED||a.state===a.__states.FAILED?void 0:a.__opts.retry?a.__retry(s).catch(function(u){a.__removeFile().finally(function(){a.__setState(a.__states.FAILED),a.emit("error",u||s),n(u||s)})}):a.__removeFile().finally(function(){a.__setState(a.__states.FAILED),a.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||xr(this.__opts.retry)!=="object")return Promise.reject(n||new Error("wrong retry options"));var a=this.__opts.retry,o=a.delay,s=o===void 0?0:o,u=a.maxRetries,x=u===void 0?999:u;return this.__retryCount>=x?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 a=this;return function(){return a.__requestAbort(),a.__opts.retry?a.__retry(new Error("timeout")).catch(function(o){a.__removeFile().finally(function(){a.__setState(a.__states.FAILED),o?n(o):(a.emit("timeout"),n(new Error("timeout")))})}):a.__removeFile().finally(function(){a.__setState(a.__states.FAILED),a.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 a="",o=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,s=/.*filename="(.*?)";?/i,u=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,x=i.hasOwnProperty("content-disposition"),l=x?i["content-disposition"].match(o):null,c=!x||l?null:i["content-disposition"].match(s),f=!x||l||c?null:i["content-disposition"].match(u);return x&&(l||c||f)?(a=i["content-disposition"],a=a.trim(),l?a=l[1]:c?a=c[1]:f&&(a=f[1]),a=a.replace(/[/\\]/g,"")):0<Ee.basename(new Be.URL(this.requestURL).pathname).length?a=Ee.basename(new Be.URL(this.requestURL).pathname):a=new Be.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(a,n):a.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(i){var n=Ee.join(this.__destFolder,i),a=n;return this.__opts.override||this.state===this.__states.RESUMED||(a=this.__uniqFileNameSync(a),n!==a&&this.emit("renamed",{path:a,fileName:a.split(Ee.sep).pop(),prevPath:n,prevFileName:n.split(Ee.sep).pop()})),a}},{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 a=Ee.join(this.__destFolder,i);return n&&n.headers||this.__response&&this.__response.headers?this.__opts.fileName(i,a,(n||this.__response).headers["content-type"]):this.__opts.fileName(i,a)}if(xr(this.__opts.fileName)==="object"){var o=this.__opts.fileName,s=o.name,u=!!o.hasOwnProperty("ext")&&o.ext;if(typeof u=="string")return s+"."+u;if(typeof u=="boolean"){if(u)return s;var x=i.includes(".")?i.split(".").pop():"";return x===""?s:s+"."+x}}return i}},{key:"__calculateStats",value:function(i){var n=new Date,a=n-this.__statsEstimate.time,o=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<a)&&(this.__statsEstimate.time=n,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===s||o>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 a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},o=new Be.URL(n),s={protocol:o.protocol,host:o.hostname,port:o.port,path:o.pathname+o.search,method:i};return a&&(s.headers=a),s}},{key:"__getFilesizeInBytes",value:function(i){try{var n=Y.statSync(i,{throwIfNoEntry:!1}),a=n.size||0;return a}catch(o){this.emit("warning",o)}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(!Y.existsSync(n))throw new Error("Destination Folder must exist");var a=Y.statSync(n);if(!a.isDirectory())throw new Error("Destination Folder must be a directory");try{Y.accessSync(n,Y.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=bi,n.agent=new bi.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpsRequestOptions)):(this.__protocol=wi,n.agent=new wi.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(i){if(typeof i!="string"||i==="")return i;try{Y.accessSync(i,Y.F_OK);var n=i.match(/(.*)(\([0-9]+\))(\..*)$/),a=n?n[1].trim():i,o=n?parseInt(n[2].replace(/\(|\)/,"")):0,s=i.split(".").pop();return s!==i&&0<s.length?(s="."+s,a=a.replace(s,"")):s="",this.__uniqFileNameSync(a+" ("+ ++o+")"+s)}catch{return i}}},{key:"__removeFile",value:function(){var i=this;return new Promise(function(n){return i.__fileStream?void i.__fileStream.close(function(a){return a&&i.emit("warning",a),i.__opts.removeOnFail?Y.access(i.__filePath,function(o){return o?n():void Y.unlink(i.__filePath,function(s){s&&i.emit("warning",a),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}(ws.EventEmitter)});var Oi=m((tl,Ri)=>{var he=require("constants"),Ss=process.cwd,bt=null,Fs=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return bt||(bt=Ss.call(process)),bt};try{process.cwd()}catch{}typeof process.chdir=="function"&&(dr=process.chdir,process.chdir=function(e){bt=null,dr.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,dr));var dr;Ri.exports=Rs;function Rs(e){he.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(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=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,c,f){f&&process.nextTick(f)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,c,f,h){h&&process.nextTick(h)},e.lchownSync=function(){}),Fs==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(l){function c(f,h,p){var _=Date.now(),d=0;l(f,h,function v(g){if(g&&(g.code==="EACCES"||g.code==="EPERM"||g.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){e.stat(h,function(E,z){E&&E.code==="ENOENT"?l(f,h,v):p(g)})},d),d<100&&(d+=10);return}p&&p(g)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,l),c}(e.rename)),e.read=typeof e.read!="function"?e.read:function(l){function c(f,h,p,_,d,v){var g;if(v&&typeof v=="function"){var E=0;g=function(z,O,X){if(z&&z.code==="EAGAIN"&&E<10)return E++,l.call(e,f,h,p,_,d,g);v.apply(this,arguments)}}return l.call(e,f,h,p,_,d,g)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,l),c}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(l){return function(c,f,h,p,_){for(var d=0;;)try{return l.call(e,c,f,h,p,_)}catch(v){if(v.code==="EAGAIN"&&d<10){d++;continue}throw v}}}(e.readSync);function t(l){l.lchmod=function(c,f,h){l.open(c,he.O_WRONLY|he.O_SYMLINK,f,function(p,_){if(p){h&&h(p);return}l.fchmod(_,f,function(d){l.close(_,function(v){h&&h(d||v)})})})},l.lchmodSync=function(c,f){var h=l.openSync(c,he.O_WRONLY|he.O_SYMLINK,f),p=!0,_;try{_=l.fchmodSync(h,f),p=!1}finally{if(p)try{l.closeSync(h)}catch{}else l.closeSync(h)}return _}}function r(l){he.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(c,f,h,p){l.open(c,he.O_SYMLINK,function(_,d){if(_){p&&p(_);return}l.futimes(d,f,h,function(v){l.close(d,function(g){p&&p(v||g)})})})},l.lutimesSync=function(c,f,h){var p=l.openSync(c,he.O_SYMLINK),_,d=!0;try{_=l.futimesSync(p,f,h),d=!1}finally{if(d)try{l.closeSync(p)}catch{}else l.closeSync(p)}return _}):l.futimes&&(l.lutimes=function(c,f,h,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function i(l){return l&&function(c,f,h){return l.call(e,c,f,function(p){x(p)&&(p=null),h&&h.apply(this,arguments)})}}function n(l){return l&&function(c,f){try{return l.call(e,c,f)}catch(h){if(!x(h))throw h}}}function a(l){return l&&function(c,f,h,p){return l.call(e,c,f,h,function(_){x(_)&&(_=null),p&&p.apply(this,arguments)})}}function o(l){return l&&function(c,f,h){try{return l.call(e,c,f,h)}catch(p){if(!x(p))throw p}}}function s(l){return l&&function(c,f,h){typeof f=="function"&&(h=f,f=null);function p(_,d){d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),h&&h.apply(this,arguments)}return f?l.call(e,c,f,p):l.call(e,c,p)}}function u(l){return l&&function(c,f){var h=f?l.call(e,c,f):l.call(e,c);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function x(l){if(!l||l.code==="ENOSYS")return!0;var c=!process.getuid||process.getuid()!==0;return!!(c&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Bi=m((rl,Ti)=>{var Ai=require("stream").Stream;Ti.exports=Os;function Os(e){return{ReadStream:t,WriteStream:r};function t(i,n){if(!(this instanceof t))return new t(i,n);Ai.call(this);var a=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 o=Object.keys(n),s=0,u=o.length;s<u;s++){var x=o[s];this[x]=n[x]}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(){a._read()});return}e.open(this.path,this.flags,this.mode,function(l,c){if(l){a.emit("error",l),a.readable=!1;return}a.fd=c,a.emit("open",c),a._read()})}function r(i,n){if(!(this instanceof r))return new r(i,n);Ai.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 a=Object.keys(n),o=0,s=a.length;o<s;o++){var u=a[o];this[u]=n[u]}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 Di=m((il,Ci)=>{"use strict";Ci.exports=Ts;var As=Object.getPrototypeOf||function(e){return e.__proto__};function Ts(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:As(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var Ii=m((nl,mr)=>{var N=require("fs"),Bs=Oi(),Cs=Bi(),Ds=Di(),Et=require("util"),W,Ft;typeof Symbol=="function"&&typeof Symbol.for=="function"?(W=Symbol.for("graceful-fs.queue"),Ft=Symbol.for("graceful-fs.previous")):(W="___graceful-fs.queue",Ft="___graceful-fs.previous");function Ps(){}function ki(e,t){Object.defineProperty(e,W,{get:function(){return t}})}var Se=Ps;Et.debuglog?Se=Et.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Se=function(){var e=Et.format.apply(Et,arguments);e="GFS4: "+e.split(/\n/).join(`
2
+ GFS4: `),console.error(e)});N[W]||(Pi=global[W]||[],ki(N,Pi),N.close=function(e){function t(r,i){return e.call(N,r,function(n){n||qi(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,Ft,{value:e}),t}(N.close),N.closeSync=function(e){function t(r){e.apply(N,arguments),qi()}return Object.defineProperty(t,Ft,{value:e}),t}(N.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Se(N[W]),require("assert").equal(N[W].length,0)}));var Pi;global[W]||ki(global,N[W]);mr.exports=hr(Ds(N));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!N.__patched&&(mr.exports=hr(N),N.__patched=!0);function hr(e){Bs(e),e.gracefulify=hr,e.createReadStream=O,e.createWriteStream=X;var t=e.readFile;e.readFile=r;function r(y,w,b){return typeof w=="function"&&(b=w,w=null),C(y,w,b);function C(D,B,S,F){return t(D,B,function(R){R&&(R.code==="EMFILE"||R.code==="ENFILE")?De([C,[D,B,S],R,F||Date.now(),Date.now()]):typeof S=="function"&&S.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=n;function n(y,w,b,C){return typeof b=="function"&&(C=b,b=null),D(y,w,b,C);function D(B,S,F,R,M){return i(B,S,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?De([D,[B,S,F,R],T,M||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=o);function o(y,w,b,C){return typeof b=="function"&&(C=b,b=null),D(y,w,b,C);function D(B,S,F,R,M){return a(B,S,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?De([D,[B,S,F,R],T,M||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=u);function u(y,w,b,C){return typeof b=="function"&&(C=b,b=0),D(y,w,b,C);function D(B,S,F,R,M){return s(B,S,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?De([D,[B,S,F,R],T,M||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments)})}}var x=e.readdir;e.readdir=c;var l=/^v[0-5]\./;function c(y,w,b){typeof w=="function"&&(b=w,w=null);var C=l.test(process.version)?function(S,F,R,M){return x(S,D(S,F,R,M))}:function(S,F,R,M){return x(S,F,D(S,F,R,M))};return C(y,w,b);function D(B,S,F,R){return function(M,T){M&&(M.code==="EMFILE"||M.code==="ENFILE")?De([C,[B,S,F],M,R||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 f=Cs(e);v=f.ReadStream,E=f.WriteStream}var h=e.ReadStream;h&&(v.prototype=Object.create(h.prototype),v.prototype.open=g);var p=e.WriteStream;p&&(E.prototype=Object.create(p.prototype),E.prototype.open=z),Object.defineProperty(e,"ReadStream",{get:function(){return v},set:function(y){v=y},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return E},set:function(y){E=y},enumerable:!0,configurable:!0});var _=v;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(y){_=y},enumerable:!0,configurable:!0});var d=E;Object.defineProperty(e,"FileWriteStream",{get:function(){return d},set:function(y){d=y},enumerable:!0,configurable:!0});function v(y,w){return this instanceof v?(h.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function g(){var y=this;j(y.path,y.flags,y.mode,function(w,b){w?(y.autoClose&&y.destroy(),y.emit("error",w)):(y.fd=b,y.emit("open",b),y.read())})}function E(y,w){return this instanceof E?(p.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function z(){var y=this;j(y.path,y.flags,y.mode,function(w,b){w?(y.destroy(),y.emit("error",w)):(y.fd=b,y.emit("open",b))})}function O(y,w){return new e.ReadStream(y,w)}function X(y,w){return new e.WriteStream(y,w)}var I=e.open;e.open=j;function j(y,w,b,C){return typeof b=="function"&&(C=b,b=null),D(y,w,b,C);function D(B,S,F,R,M){return I(B,S,F,function(T,P){T&&(T.code==="EMFILE"||T.code==="ENFILE")?De([D,[B,S,F,R],T,M||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments)})}}return e}function De(e){Se("ENQUEUE",e[0].name,e[1]),N[W].push(e),pr()}var St;function qi(){for(var e=Date.now(),t=0;t<N[W].length;++t)N[W][t].length>2&&(N[W][t][3]=e,N[W][t][4]=e);pr()}function pr(){if(clearTimeout(St),St=void 0,N[W].length!==0){var e=N[W].shift(),t=e[0],r=e[1],i=e[2],n=e[3],a=e[4];if(n===void 0)Se("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-n>=6e4){Se("TIMEOUT",t.name,r);var o=r.pop();typeof o=="function"&&o.call(null,i)}else{var s=Date.now()-a,u=Math.max(a-n,1),x=Math.min(u*1.2,100);s>=x?(Se("RETRY",t.name,r),t.apply(null,r.concat([n]))):N[W].push(e)}St===void 0&&(St=setTimeout(pr,0))}}});var _r=m((al,zi)=>{"use strict";zi.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 a=0;a<i.length;a++)if(i[a]!==t[a+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((a,o,s)=>s[o]===66&&s[o+1]===130);if(n>=0){let a=n+3,o=s=>Array.from(s).every((u,x)=>i[a+x]===u.charCodeAt(0));if(o("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(o("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 Rt=m((ol,Ni)=>{"use strict";var oe=Ni.exports=function(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"};oe.writable=function(e){return oe(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"};oe.readable=function(e){return oe(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object"};oe.duplex=function(e){return oe.writable(e)&&oe.readable(e)};oe.transform=function(e){return oe.duplex(e)&&typeof e._transform=="function"&&typeof e._transformState=="object"}});var Ke=m((sl,yr)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?yr.exports={nextTick:qs}:yr.exports=process;function qs(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,a,o;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(a=new Array(n-1),o=0;o<a.length;)a[o++]=arguments[o];return process.nextTick(function(){e.apply(null,a)})}}});var ji=m((fl,Li)=>{var ks={}.toString;Li.exports=Array.isArray||function(e){return ks.call(e)=="[object Array]"}});var vr=m((ul,Mi)=>{Mi.exports=require("stream")});var Xe=m((gr,Wi)=>{var Ot=require("buffer"),se=Ot.Buffer;function Ui(e,t){for(var r in e)t[r]=e[r]}se.from&&se.alloc&&se.allocUnsafe&&se.allocUnsafeSlow?Wi.exports=Ot:(Ui(Ot,gr),gr.Buffer=Pe);function Pe(e,t,r){return se(e,t,r)}Ui(se,Pe);Pe.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return se(e,t,r)};Pe.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=se(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Pe.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return se(e)};Pe.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ot.SlowBuffer(e)}});var qe=m(Z=>{function Is(e){return Array.isArray?Array.isArray(e):At(e)==="[object Array]"}Z.isArray=Is;function zs(e){return typeof e=="boolean"}Z.isBoolean=zs;function Ns(e){return e===null}Z.isNull=Ns;function Ls(e){return e==null}Z.isNullOrUndefined=Ls;function js(e){return typeof e=="number"}Z.isNumber=js;function Ms(e){return typeof e=="string"}Z.isString=Ms;function Us(e){return typeof e=="symbol"}Z.isSymbol=Us;function Ws(e){return e===void 0}Z.isUndefined=Ws;function Hs(e){return At(e)==="[object RegExp]"}Z.isRegExp=Hs;function $s(e){return typeof e=="object"&&e!==null}Z.isObject=$s;function Gs(e){return At(e)==="[object Date]"}Z.isDate=Gs;function Zs(e){return At(e)==="[object Error]"||e instanceof Error}Z.isError=Zs;function Ys(e){return typeof e=="function"}Z.isFunction=Ys;function Ks(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}Z.isPrimitive=Ks;Z.isBuffer=require("buffer").Buffer.isBuffer;function At(e){return Object.prototype.toString.call(e)}});var Hi=m((cl,wr)=>{typeof Object.create=="function"?wr.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:wr.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 ke=m((xl,Er)=>{try{if(br=require("util"),typeof br.inherits!="function")throw"";Er.exports=br.inherits}catch{Er.exports=Hi()}var br});var Gi=m((dl,Sr)=>{"use strict";function Xs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $i=Xe().Buffer,Ve=require("util");function Vs(e,t,r){e.copy(t,r)}Sr.exports=function(){function e(){Xs(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 $i.alloc(0);for(var i=$i.allocUnsafe(r>>>0),n=this.head,a=0;n;)Vs(n.data,i,a),a+=n.data.length,n=n.next;return i},e}();Ve&&Ve.inspect&&Ve.inspect.custom&&(Sr.exports.prototype[Ve.inspect.custom]=function(){var e=Ve.inspect({length:this.length});return this.constructor.name+" "+e})});var Fr=m((hl,Zi)=>{"use strict";var Tt=Ke();function Qs(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,Tt.nextTick(Bt,this,e)):Tt.nextTick(Bt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,Tt.nextTick(Bt,r,a)):Tt.nextTick(Bt,r,a):t&&t(a)}),this)}function Js(){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 Bt(e,t){e.emit("error",t)}Zi.exports={destroy:Qs,undestroy:Js}});var Ki=m((pl,Yi)=>{Yi.exports=require("util").deprecate});var Or=m((ml,nn)=>{"use strict";var Fe=Ke();nn.exports=U;function Vi(e){var t=this;this.next=null,this.entry=null,this.finish=function(){_0(t,e)}}var e0=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Fe.nextTick,Ie;U.WritableState=Je;var Qi=Object.create(qe());Qi.inherits=ke();var t0={deprecate:Ki()},Ji=vr(),Dt=Xe().Buffer,r0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i0(e){return Dt.from(e)}function n0(e){return Dt.isBuffer(e)||e instanceof r0}var en=Fr();Qi.inherits(U,Ji);function a0(){}function Je(e,t){Ie=Ie||Re(),e=e||{};var r=t instanceof Ie;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,a=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=a,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 o=e.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){x0(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 Vi(this)}Je.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Je.prototype,"buffer",{get:t0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Ct;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ct=Function.prototype[Symbol.hasInstance],Object.defineProperty(U,Symbol.hasInstance,{value:function(e){return Ct.call(this,e)?!0:this!==U?!1:e&&e._writableState instanceof Je}})):Ct=function(e){return e instanceof this};function U(e){if(Ie=Ie||Re(),!Ct.call(U,this)&&!(this instanceof Ie))return new U(e);this._writableState=new Je(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)),Ji.call(this)}U.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function o0(e,t){var r=new Error("write after end");e.emit("error",r),Fe.nextTick(t,r)}function s0(e,t,r,i){var n=!0,a=!1;return r===null?a=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),Fe.nextTick(i,a),n=!1),n}U.prototype.write=function(e,t,r){var i=this._writableState,n=!1,a=!i.objectMode&&n0(e);return a&&!Dt.isBuffer(e)&&(e=i0(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=a0),i.ended?o0(this,r):(a||s0(this,i,e,r))&&(i.pendingcb++,n=u0(this,i,a,e,t,r)),n};U.prototype.cork=function(){var e=this._writableState;e.corked++};U.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&tn(this,e))};U.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 f0(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Dt.from(t,r)),t}Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function u0(e,t,r,i,n,a){if(!r){var o=f0(t,i,n);i!==o&&(r=!0,n="buffer",i=o)}var s=t.objectMode?1:i.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var x=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:a,next:null},x?x.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Rr(e,t,!1,s,i,n,a);return u}function Rr(e,t,r,i,n,a,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,a,t.onwrite),t.sync=!1}function l0(e,t,r,i,n){--t.pendingcb,r?(Fe.nextTick(n,i),Fe.nextTick(Qe,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),Qe(e,t))}function c0(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function x0(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(c0(r),t)l0(e,r,i,t,n);else{var a=rn(r);!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&tn(e,r),i?e0(Xi,e,r,a,n):Xi(e,r,a,n)}}function Xi(e,t,r,i){r||d0(e,t),t.pendingcb--,i(),Qe(e,t)}function d0(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function tn(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,Rr(e,t,!0,t.length,n,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Vi(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,x=r.encoding,l=r.callback,c=t.objectMode?1:u.length;if(Rr(e,t,!1,c,u,x,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}U.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};U.prototype._writev=null;U.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||m0(this,i,r)};function rn(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function h0(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),Qe(e,t)})}function p0(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Fe.nextTick(h0,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Qe(e,t){var r=rn(t);return r&&(p0(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function m0(e,t,r){t.ending=!0,Qe(e,t),r&&(t.finished?Fe.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function _0(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(U.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});U.prototype.destroy=en.destroy;U.prototype._undestroy=en.undestroy;U.prototype._destroy=function(e,t){this.end(),t(e)}});var Re=m((_l,fn)=>{"use strict";var an=Ke(),y0=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};fn.exports=fe;var on=Object.create(qe());on.inherits=ke();var sn=Br(),Tr=Or();on.inherits(fe,sn);for(Ar=y0(Tr.prototype),Pt=0;Pt<Ar.length;Pt++)qt=Ar[Pt],fe.prototype[qt]||(fe.prototype[qt]=Tr.prototype[qt]);var Ar,qt,Pt;function fe(e){if(!(this instanceof fe))return new fe(e);sn.call(this,e),Tr.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",v0)}Object.defineProperty(fe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function v0(){this.allowHalfOpen||this._writableState.ended||an.nextTick(g0,this)}function g0(e){e.end()}Object.defineProperty(fe.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)}});fe.prototype._destroy=function(e,t){this.push(null),this.end(),an.nextTick(t,e)}});var Pr=m(ln=>{"use strict";var Dr=Xe().Buffer,un=Dr.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 w0(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 b0(e){var t=w0(e);if(typeof t!="string"&&(Dr.isEncoding===un||!un(e)))throw new Error("Unknown encoding: "+e);return t||e}ln.StringDecoder=et;function et(e){this.encoding=b0(e);var t;switch(this.encoding){case"utf16le":this.text=A0,this.end=T0,t=4;break;case"utf8":this.fillLast=F0,t=4;break;case"base64":this.text=B0,this.end=C0,t=3;break;default:this.write=D0,this.end=P0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Dr.allocUnsafe(t)}et.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||""};et.prototype.end=O0;et.prototype.text=R0;et.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 Cr(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function E0(e,t,r){var i=t.length-1;if(i<r)return 0;var n=Cr(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=Cr(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=Cr(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function S0(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 F0(e){var t=this.lastTotal-this.lastNeed,r=S0(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 R0(e,t){var r=E0(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 O0(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function A0(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 T0(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 B0(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 C0(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function D0(e){return e.toString(this.encoding)}function P0(e){return e&&e.length?this.write(e):""}});var Br=m((gl,bn)=>{"use strict";var Ne=Ke();bn.exports=q;var q0=ji(),tt;q.ReadableState=_n;var vl=require("events").EventEmitter,hn=function(e,t){return e.listeners(t).length},Nr=vr(),rt=Xe().Buffer,k0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function I0(e){return rt.from(e)}function z0(e){return rt.isBuffer(e)||e instanceof k0}var pn=Object.create(qe());pn.inherits=ke();var qr=require("util"),A=void 0;qr&&qr.debuglog?A=qr.debuglog("stream"):A=function(){};var N0=Gi(),mn=Fr(),ze;pn.inherits(q,Nr);var kr=["error","close","destroy","pause","resume"];function L0(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):q0(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function _n(e,t){tt=tt||Re(),e=e||{};var r=t instanceof tt;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,a=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new N0,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=Pr().StringDecoder),this.decoder=new ze(e.encoding),this.encoding=e.encoding)}function q(e){if(tt=tt||Re(),!(this instanceof q))return new q(e);this._readableState=new _n(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Nr.call(this)}Object.defineProperty(q.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});q.prototype.destroy=mn.destroy;q.prototype._undestroy=mn.undestroy;q.prototype._destroy=function(e,t){this.push(null),t(e)};q.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=rt.from(e,t),t=""),i=!0),yn(this,e,t,!1,i)};q.prototype.unshift=function(e){return yn(this,e,null,!0,!1)};function yn(e,t,r,i,n){var a=e._readableState;if(t===null)a.reading=!1,W0(e,a);else{var o;n||(o=j0(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==rt.prototype&&(t=I0(t)),i?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):Ir(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Ir(e,a,t,!1):vn(e,a)):Ir(e,a,t,!1))):i||(a.reading=!1)}return M0(a)}function Ir(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&&kt(e)),vn(e,t)}function j0(e,t){var r;return!z0(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function M0(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}q.prototype.isPaused=function(){return this._readableState.flowing===!1};q.prototype.setEncoding=function(e){return ze||(ze=Pr().StringDecoder),this._readableState.decoder=new ze(e),this._readableState.encoding=e,this};var cn=8388608;function U0(e){return e>=cn?e=cn:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function xn(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=U0(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}q.prototype.read=function(e){A("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 A("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?zr(this):kt(this),null;if(e=xn(e,t),e===0&&t.ended)return t.length===0&&zr(this),null;var i=t.needReadable;A("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,A("length less than watermark",i)),t.ended||t.reading?(i=!1,A("reading or ended",i)):i&&(A("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=xn(r,t)));var n;return e>0?n=gn(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&&zr(this)),n!==null&&this.emit("data",n),n};function W0(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,kt(e)}}function kt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(A("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ne.nextTick(dn,e):dn(e))}function dn(e){A("emit readable"),e.emit("readable"),Lr(e)}function vn(e,t){t.readingMore||(t.readingMore=!0,Ne.nextTick(H0,e,t))}function H0(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(A("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}q.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};q.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,A("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=n?s:d;i.endEmitted?Ne.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(v,g){A("onunpipe"),v===r&&g&&g.hasUnpiped===!1&&(g.hasUnpiped=!0,l())}function s(){A("onend"),e.end()}var u=$0(r);e.on("drain",u);var x=!1;function l(){A("cleanup"),e.removeListener("close",p),e.removeListener("finish",_),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",d),r.removeListener("data",f),x=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}var c=!1;r.on("data",f);function f(v){A("ondata"),c=!1;var g=e.write(v);g===!1&&!c&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&wn(i.pipes,e)!==-1)&&!x&&(A("false write response, pause",i.awaitDrain),i.awaitDrain++,c=!0),r.pause())}function h(v){A("onerror",v),d(),e.removeListener("error",h),hn(e,"error")===0&&e.emit("error",v)}L0(e,"error",h);function p(){e.removeListener("finish",_),d()}e.once("close",p);function _(){A("onfinish"),e.removeListener("close",p),d()}e.once("finish",_);function d(){A("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(A("pipe resume"),r.resume()),e};function $0(e){return function(){var t=e._readableState;A("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&hn(e,"data")&&(t.flowing=!0,Lr(e))}}q.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 a=0;a<n;a++)i[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=wn(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};q.prototype.on=function(e,t){var r=Nr.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&&kt(this):Ne.nextTick(G0,this))}return r};q.prototype.addListener=q.prototype.on;function G0(e){A("readable nexttick read 0"),e.read(0)}q.prototype.resume=function(){var e=this._readableState;return e.flowing||(A("resume"),e.flowing=!0,Z0(this,e)),this};function Z0(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Ne.nextTick(Y0,e,t))}function Y0(e,t){t.reading||(A("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Lr(e),t.flowing&&!t.reading&&e.read(0)}q.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(A("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Lr(e){var t=e._readableState;for(A("flow",t.flowing);t.flowing&&e.read()!==null;);}q.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(A("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(A("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=function(o){return function(){return e[o].apply(e,arguments)}}(n));for(var a=0;a<kr.length;a++)e.on(kr[a],this.emit.bind(this,kr[a]));return this._read=function(o){A("wrapped _read",o),i&&(i=!1,e.resume())},this};Object.defineProperty(q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});q._fromList=gn;function gn(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=K0(e,t.buffer,t.decoder),r}function K0(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?X0(e,t):V0(e,t),i}function X0(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),e-=o,e===0){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}function V0(e,t){var r=rt.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),e-=o,e===0){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=a.slice(o));break}++n}return t.length-=n,r}function zr(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ne.nextTick(Q0,t,e))}function Q0(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function wn(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var jr=m((wl,Fn)=>{"use strict";Fn.exports=ue;var It=Re(),Sn=Object.create(qe());Sn.inherits=ke();Sn.inherits(ue,It);function J0(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 ue(e){if(!(this instanceof ue))return new ue(e);It.call(this,e),this._transformState={afterTransform:J0.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",ef)}function ef(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){En(e,t,r)}):En(this,null,null)}ue.prototype.push=function(e,t){return this._transformState.needTransform=!1,It.prototype.push.call(this,e,t)};ue.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};ue.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)}};ue.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};ue.prototype._destroy=function(e,t){var r=this;It.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function En(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 Tn=m((bl,An)=>{"use strict";An.exports=it;var Rn=jr(),On=Object.create(qe());On.inherits=ke();On.inherits(it,Rn);function it(e){if(!(this instanceof it))return new it(e);Rn.call(this,e)}it.prototype._transform=function(e,t,r){r(null,e)}});var Le=m((H,zt)=>{var ee=require("stream");process.env.READABLE_STREAM==="disable"&&ee?(zt.exports=ee,H=zt.exports=ee.Readable,H.Readable=ee.Readable,H.Writable=ee.Writable,H.Duplex=ee.Duplex,H.Transform=ee.Transform,H.PassThrough=ee.PassThrough,H.Stream=ee):(H=zt.exports=Br(),H.Stream=ee||H,H.Readable=H,H.Writable=Or(),H.Duplex=Re(),H.Transform=jr(),H.PassThrough=Tn())});var Cn=m((El,Bn)=>{Bn.exports=Le().Duplex});var qn=m((Mr,Pn)=>{var Nt=require("buffer"),te=Nt.Buffer;function Dn(e,t){for(var r in e)t[r]=e[r]}te.from&&te.alloc&&te.allocUnsafe&&te.allocUnsafeSlow?Pn.exports=Nt:(Dn(Nt,Mr),Mr.Buffer=Oe);function Oe(e,t,r){return te(e,t,r)}Oe.prototype=Object.create(te.prototype);Dn(te,Oe);Oe.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return te(e,t,r)};Oe.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=te(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Oe.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return te(e)};Oe.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Nt.SlowBuffer(e)}});var In=m((Sl,kn)=>{var Ur=Cn(),tf=require("util"),je=qn().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);Ur.call(this)}tf.inherits(L,Ur);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(je.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(je.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){Ur.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||je.alloc(0);var a=!!t,o=this._offset(i),s=n-i,u=s,x=a&&r||0,l=o[1],c,f;if(i===0&&n==this.length){if(!a)return this._bufs.length===1?this._bufs[0]:je.concat(this._bufs,this.length);for(f=0;f<this._bufs.length;f++)this._bufs[f].copy(t,x),x+=this._bufs[f].length;return t}if(u<=this._bufs[o[0]].length-l)return a?this._bufs[o[0]].copy(t,r,l,l+u):this._bufs[o[0]].slice(l,l+u);for(a||(t=je.allocUnsafe(s)),f=o[0];f<this._bufs.length;f++){if(c=this._bufs[f].length-l,u>c)this._bufs[f].copy(t,x,l),x+=c;else{this._bufs[f].copy(t,x,l,l+u),x+=c;break}u-=c,l&&(l=0)}return t.length>x?t.slice(0,x):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),a=this._bufs.slice(i[0],n[0]+1);return n[1]==0?a.pop():a[a.length-1]=a[a.length-1].slice(0,n[1]),i[1]!=0&&(a[0]=a[0].slice(i[1])),new L(a)};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)})();kn.exports=L});var Nn=m((Fl,zn)=>{zn.exports=nf;var rf=Object.prototype.hasOwnProperty;function nf(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)rf.call(r,i)&&(e[i]=r[i])}return e}});var Wr=m((Rl,jn)=>{jn.exports=of;var Ln=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from:af;function af(e,t){return new Buffer(e,t)}function of(e,t){if(Buffer.isBuffer(e))return e;if(typeof e=="string")return Ln(e,t);if(Array.isArray(e))return Ln(e);throw new Error("Input should be a buffer or a string")}});var Un=m((Ol,Mn)=>{var sf=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 ff(e){return e.length===1&&e.charCodeAt(0)<256}function Lt(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 uf(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,a=t.length;n<=i-a;)t.copy(e,n),n+=a;return n!==i&&t.copy(e,n,0,i-n),e}function lf(e,t,r,i,n){if(sf)return e.fill(t,r,i,n);if(typeof t=="number")return Lt(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 Lt(e,0,r,i);if(ff(t))return Lt(e,t.charCodeAt(0),r,i);t=new Buffer(t,n)}return Buffer.isBuffer(t)?uf(e,t,r,i):Lt(e,0,r,i)}Mn.exports=lf});var Hn=m((Al,Wn)=>{function cf(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)}Wn.exports=cf});var Hr=m((Tl,Gn)=>{var $n=Un(),xf=Hn();Gn.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=xf(t);return t===0?n:r===void 0?$n(n,0):(typeof i!="string"&&(i=void 0),$n(n,r,i))}});var Gr=m(Ue=>{var df=Wr(),hf=Hr(),pf="0000000000000000000",mf="7777777777777777777",Zn=48,_f="ustar\x0000",yf=parseInt("7777",8),vf=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},gf=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},wf=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},Yn=function(e,t,r,i){for(;r<i;r++)if(e[r]===t)return r;return i},Kn=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},pe=function(e,t){return e=e.toString(8),e.length>t?mf.slice(0,t)+" ":pf.slice(0,t-e.length)+e+" "};function bf(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 a=e[n];t?i.push(a):r&&a===0?i.push(0):r?(r=!1,i.push(256-a)):i.push(255-a)}var o=0,s=i.length;for(n=0;n<s;n++)o+=i[n]*Math.pow(256,n);return t?o:-1*o}var me=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return bf(e);for(;t<e.length&&e[t]===32;)t++;for(var i=vf(Yn(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)},Me=function(e,t,r,i){return e.slice(t,Yn(e,0,t,t+r)).toString(i)},$r=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};Ue.decodeLongPath=function(e,t){return Me(e,0,e.length,t)};Ue.encodePax=function(e){var t="";e.name&&(t+=$r(" path="+e.name+`
3
+ `)),e.linkname&&(t+=$r(" linkpath="+e.linkname+`
4
+ `));var r=e.pax;if(r)for(var i in r)t+=$r(" "+i+"="+r[i]+`
5
+ `);return df(t)};Ue.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var i=parseInt(e.slice(0,r).toString(),10);if(!i)return t;var n=e.slice(r+1,i-1).toString(),a=n.indexOf("=");if(a===-1)return t;t[n.slice(0,a)]=n.slice(a+1),e=e.slice(i)}return t};Ue.encode=function(e){var t=hf(512),r=e.name,i="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(i)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(pe(e.mode&yf,6),100),t.write(pe(e.uid,6),108),t.write(pe(e.gid,6),116),t.write(pe(e.size,11),124),t.write(pe(e.mtime.getTime()/1e3|0,11),136),t[156]=Zn+wf(e.type),e.linkname&&t.write(e.linkname,157),t.write(_f,257),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(pe(e.devmajor||0,6),329),t.write(pe(e.devminor||0,6),337),i&&t.write(i,345),t.write(pe(Kn(t),6),148),t)};Ue.decode=function(e,t){var r=e[156]===0?0:e[156]-Zn,i=Me(e,0,100,t),n=me(e,100,8),a=me(e,108,8),o=me(e,116,8),s=me(e,124,12),u=me(e,136,12),x=gf(r),l=e[157]===0?null:Me(e,157,100,t),c=Me(e,265,32),f=Me(e,297,32),h=me(e,329,8),p=me(e,337,8);e[345]&&(i=Me(e,345,155,t)+"/"+i),r===0&&i&&i[i.length-1]==="/"&&(r=5);var _=Kn(e);if(_===8*32)return null;if(_!==me(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");return{name:i,mode:n,uid:a,gid:o,size:s,mtime:new Date(1e3*u),type:x,linkname:l,uname:c,gname:f,devmajor:h,devminor:p}}});var ra=m((Cl,ta)=>{var Vn=require("util"),Ef=In(),Sf=Nn(),nt=Gr(),Qn=Le().Writable,Jn=Le().PassThrough,ea=function(){},Xn=function(e){return e&=511,e&&512-e},Ff=function(e,t){var r=new jt(e,t);return r.end(),r},Rf=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},jt=function(e,t){this._parent=e,this.offset=t,Jn.call(this)};Vn.inherits(jt,Jn);jt.prototype.destroy=function(e){this._parent.destroy(e)};var le=function(e){if(!(this instanceof le))return new le(e);Qn.call(this,e),e=e||{},this._offset=0,this._buffer=Ef(),this._missing=0,this._partial=!1,this._onparse=ea,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,i=function(){t._continue()},n=function(f){if(t._locked=!1,f)return t.destroy(f);t._stream||i()},a=function(){t._stream=null;var f=Xn(t._header.size);f?t._parse(f,o):t._parse(512,c),t._locked||i()},o=function(){t._buffer.consume(Xn(t._header.size)),t._parse(512,c),i()},s=function(){var f=t._header.size;t._paxGlobal=nt.decodePax(r.slice(0,f)),r.consume(f),a()},u=function(){var f=t._header.size;t._pax=nt.decodePax(r.slice(0,f)),t._paxGlobal&&(t._pax=Sf(t._paxGlobal,t._pax)),r.consume(f),a()},x=function(){var f=t._header.size;this._gnuLongPath=nt.decodeLongPath(r.slice(0,f),e.filenameEncoding),r.consume(f),a()},l=function(){var f=t._header.size;this._gnuLongLinkPath=nt.decodeLongPath(r.slice(0,f),e.filenameEncoding),r.consume(f),a()},c=function(){var f=t._offset,h;try{h=t._header=nt.decode(r.slice(0,512),e.filenameEncoding)}catch(p){t.emit("error",p)}if(r.consume(512),!h){t._parse(512,c),i();return}if(h.type==="gnu-long-path"){t._parse(h.size,x),i();return}if(h.type==="gnu-long-link-path"){t._parse(h.size,l),i();return}if(h.type==="pax-global-header"){t._parse(h.size,s),i();return}if(h.type==="pax-header"){t._parse(h.size,u),i();return}if(t._gnuLongPath&&(h.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(h.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=h=Rf(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,c),t.emit("entry",h,Ff(t,f),n);return}t._stream=new jt(t,f),t.emit("entry",h,t._stream,n),t._parse(h.size,a),i()};this._onheader=c,this._parse(512,c)};Vn.inherits(le,Qn);le.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};le.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};le.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=ea,this._overflow?this._write(this._overflow,void 0,e):e()}};le.prototype._write=function(e,t,r){if(!this._destroyed){var i=this._stream,n=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,i?i.write(e,r):(n.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>a&&(o=e.slice(a),e=e.slice(0,a)),i?i.end(e):n.append(e),this._overflow=o,this._onparse()}};le.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};ta.exports=le});var na=m((Dl,ia)=>{ia.exports=require("fs").constants||require("constants")});var sa=m((Pl,oa)=>{oa.exports=aa;function aa(e,t){if(e&&t)return aa(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(i){r[i]=e[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var a=e.apply(this,i),o=i[i.length-1];return typeof a=="function"&&a!==o&&Object.keys(o).forEach(function(s){a[s]=o[s]}),a}}});var la=m((ql,Zr)=>{var fa=sa();Zr.exports=fa(Mt);Zr.exports.strict=fa(ua);Mt.proto=Mt(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Mt(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return ua(this)},configurable:!0})});function Mt(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function ua(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var da=m((kl,xa)=>{var Of=la(),Af=function(){},Tf=function(e){return e.setHeader&&typeof e.abort=="function"},Bf=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},ca=function(e,t,r){if(typeof t=="function")return ca(e,null,t);t||(t={}),r=Of(r||Af);var i=e._writableState,n=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||x()},x=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},c=function(d){r.call(e,d?new Error("exited with error code: "+d):null)},f=function(d){r.call(e,d)},h=function(){process.nextTick(p)},p=function(){if(!s){if(a&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"));if(o&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"))}},_=function(){e.req.on("finish",x)};return Tf(e)?(e.on("complete",x),e.on("abort",h),e.req?_():e.on("request",_)):o&&!i&&(e.on("end",u),e.on("close",u)),Bf(e)&&e.on("exit",c),e.on("end",l),e.on("finish",x),t.error!==!1&&e.on("error",f),e.on("close",h),function(){s=!0,e.removeListener("complete",x),e.removeListener("abort",h),e.removeListener("request",_),e.req&&e.req.removeListener("finish",x),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",x),e.removeListener("exit",c),e.removeListener("end",l),e.removeListener("error",f),e.removeListener("close",h)}};xa.exports=ca});var ya=m((Il,_a)=>{var We=na(),ha=da(),Wt=require("util"),Cf=Hr(),Df=Wr(),pa=Le().Readable,He=Le().Writable,Pf=require("string_decoder").StringDecoder,Ut=Gr(),qf=parseInt("755",8),kf=parseInt("644",8),ma=Cf(1024),Kr=function(){},Yr=function(e,t){t&=511,t&&e.push(ma.slice(0,512-t))};function If(e){switch(e&We.S_IFMT){case We.S_IFBLK:return"block-device";case We.S_IFCHR:return"character-device";case We.S_IFDIR:return"directory";case We.S_IFIFO:return"fifo";case We.S_IFLNK:return"symlink"}return"file"}var Ht=function(e){He.call(this),this.written=0,this._to=e,this._destroyed=!1};Wt.inherits(Ht,He);Ht.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};Ht.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var $t=function(){He.call(this),this.linkname="",this._decoder=new Pf("utf-8"),this._destroyed=!1};Wt.inherits($t,He);$t.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};$t.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var at=function(){He.call(this),this._destroyed=!1};Wt.inherits(at,He);at.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};at.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var re=function(e){if(!(this instanceof re))return new re(e);pa.call(this,e),this._drain=Kr,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};Wt.inherits(re,pa);re.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=Kr);var i=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=If(e.mode)),e.mode||(e.mode=e.type==="directory"?qf:kf),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Df(t)),Buffer.isBuffer(t))return e.size=t.length,this._encode(e),this.push(t),Yr(i,e.size),process.nextTick(r),new at;if(e.type==="symlink"&&!e.linkname){var n=new $t;return ha(n,function(o){if(o)return i.destroy(),r(o);e.linkname=n.linkname,i._encode(e),r()}),n}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new at;var a=new Ht(this);return this._stream=a,ha(a,function(o){if(i._stream=null,o)return i.destroy(),r(o);if(a.written!==e.size)return i.destroy(),r(new Error("size mismatch"));Yr(i,e.size),i._finalizing&&i.finalize(),r()}),a}};re.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(ma),this.push(null))};re.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};re.prototype._encode=function(e){if(!e.pax){var t=Ut.encode(e);if(t){this.push(t);return}}this._encodePax(e)};re.prototype._encodePax=function(e){var t=Ut.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(Ut.encode(r)),this.push(t),Yr(this,t.length),r.size=e.size,r.type=e.type,this.push(Ut.encode(r))};re.prototype._read=function(e){var t=this._drain;this._drain=Kr,t()};_a.exports=re});var va=m(Xr=>{Xr.extract=ra();Xr.pack=ya()});var Gt=m((Nl,wa)=>{"use strict";var ga=_r(),zf=Rt(),Nf=va();wa.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!zf(e))return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`));if(Buffer.isBuffer(e)&&(!ga(e)||ga(e).ext!=="tar"))return Promise.resolve([]);let t=Nf.extract(),r=[];t.on("entry",(n,a,o)=>{let s=[];a.on("data",u=>s.push(u)),a.on("end",()=>{let u={data:Buffer.concat(s),mode:n.mode,mtime:n.mtime,path:n.name,type:n.type};(n.type==="symlink"||n.type==="link")&&(u.linkname=n.linkname),r.push(u),o()})});let i=new Promise((n,a)=>{Buffer.isBuffer(e)||e.on("error",a),t.on("finish",()=>n(r)),t.on("error",a)});return t.then=i.then.bind(i),t.catch=i.catch.bind(i),Buffer.isBuffer(e)?t.end(e):e.pipe(t),t}});var Ea=m((Ll,ba)=>{"use strict";var $e=e=>Array.from(e).map(t=>t.charCodeAt(0)),Lf=$e("META-INF/mozilla.rsa"),jf=$e("[Content_Types].xml"),Mf=$e("_rels/.rels");ba.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 a=0;a<i.length;a++)if(n.mask){if(i[a]!==(n.mask[a]&t[a+n.offset]))return!1}else if(i[a]!==t[a+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])){if(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(Lf,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(r(jf,{offset:30})||r(Mf,{offset:30})){let i=t.subarray(4,2004),n=o=>o.findIndex((s,u,x)=>x[u]===80&&x[u+1]===75&&x[u+2]===3&&x[u+3]===4),a=n(i);if(a!==-1){let o=t.subarray(a+8,a+8+1e3),s=n(o);if(s!==-1){let u=8+a+s+30;if(r($e("word/"),{offset:u}))return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(r($e("ppt/"),{offset:u}))return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(r($e("xl/"),{offset:u}))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}}}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([51,103,112,53])||r([0,0,0])&&r([102,116,121,112],{offset:4})&&(r([109,112,52,49],{offset:8})||r([109,112,52,50],{offset:8})||r([105,115,111,109],{offset:8})||r([105,115,111,50],{offset:8})||r([109,109,112,52],{offset:8})||r([77,52,86],{offset:8})||r([100,97,115,104],{offset:8})))return{ext:"mp4",mime:"video/mp4"};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((a,o,s)=>s[o]===66&&s[o+1]===130);if(n!==-1){let a=n+3,o=s=>Array.from(s).every((u,x)=>i[a+x]===u.charCodeAt(0));if(o("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(o("webm"))return{ext:"webm",mime:"video/webm"}}}if(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}))return{ext:"mov",mime:"video/quicktime"};if(r([82,73,70,70])&&r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/x-msvideo"};if(r([48,38,178,117,142,102,207,17,166,217]))return{ext:"wmv",mime:"video/x-ms-wmv"};if(r([0,0,1,186]))return{ext:"mpg",mime:"video/mpeg"};for(let i=0;i<2&&i<t.length-16;i++)if(r([73,68,51],{offset:i})||r([255,226],{offset:i,mask:[255,226]}))return{ext:"mp3",mime:"audio/mpeg"};return 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 Ra=m((jl,Fa)=>{var Sa=[0,1,3,7,15,31,63,127,255],ot=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};ot.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)};ot.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=Sa[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var i=r-e;t|=(this.curByte&Sa[e]<<i)>>i,this.bitOffset+=e,e=0}}return t};ot.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1};ot.prototype.pi=function(){var e=new Buffer(6),t;for(t=0;t<e.length;t++)e[t]=this.read(8);return e.toString("hex")};Fa.exports=ot});var Aa=m((Ml,Oa)=>{var Ae=function(){};Ae.prototype.readByte=function(){throw new Error("abstract method readByte() not implemented")};Ae.prototype.read=function(e,t,r){for(var i=0;i<r;){var n=this.readByte();if(n<0)return i===0?-1:i;e[t++]=n,i++}return i};Ae.prototype.seek=function(e){throw new Error("abstract method seek() not implemented")};Ae.prototype.writeByte=function(e){throw new Error("abstract method readByte() not implemented")};Ae.prototype.write=function(e,t,r){var i;for(i=0;i<r;i++)this.writeByte(e[t++]);return r};Ae.prototype.flush=function(){};Oa.exports=Ae});var Ba=m((Ul,Ta)=>{Ta.exports=function(){var e=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]),t=function(){var r=4294967295;this.getCRC=function(){return~r>>>0},this.updateCRC=function(i){r=r<<8^e[(r>>>24^i)&255]},this.updateCRCRun=function(i,n){for(;n-- >0;)r=r<<8^e[(r>>>24^i)&255]}};return t}()});var Ca=m((Wl,Uf)=>{Uf.exports={name:"seek-bzip",version:"1.0.6",contributors:["C. Scott Ananian (http://cscott.net)","Eli Skeggs","Kevin Kwok","Rob Landley (http://landley.net)"],description:"a pure-JavaScript Node.JS module for random-access decoding bzip2 data",main:"./lib/index.js",repository:{type:"git",url:"https://github.com/cscott/seek-bzip.git"},license:"MIT",bin:{"seek-bunzip":"./bin/seek-bunzip","seek-table":"./bin/seek-bzip-table"},directories:{test:"test"},dependencies:{commander:"^2.8.1"},devDependencies:{fibers:"~1.0.6",mocha:"~2.2.5"},scripts:{test:"mocha"}}});var La=m((Hl,Na)=>{var Wf=Ra(),st=Aa(),ka=Ba(),Ia=Ca(),Zt=20,Da=258,Pa=0,Hf=1,$f=2,Gf=6,Zf=50,Yf="314159265359",Kf="177245385090",qa=function(e,t){var r=e[t],i;for(i=t;i>0;i--)e[i]=e[i-1];return e[0]=r,r},k={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},_e={};_e[k.LAST_BLOCK]="Bad file checksum";_e[k.NOT_BZIP_DATA]="Not bzip data";_e[k.UNEXPECTED_INPUT_EOF]="Unexpected input EOF";_e[k.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF";_e[k.DATA_ERROR]="Data error";_e[k.OUT_OF_MEMORY]="Out of memory";_e[k.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var $=function(e,t){var r=_e[e]||"unknown error";t&&(r+=": "+t);var i=new TypeError(r);throw i.errorCode=e,i},K=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};K.prototype._init_block=function(){var e=this._get_next_block();return e?(this.blockCRC=new ka,!0):(this.writeCount=-1,!1)};K.prototype._start_bunzip=function(e,t){var r=new Buffer(4);(e.read(r,0,4)!==4||String.fromCharCode(r[0],r[1],r[2])!=="BZh")&&$(k.NOT_BZIP_DATA,"bad magic");var i=r[3]-48;(i<1||i>9)&&$(k.NOT_BZIP_DATA,"level out of range"),this.reader=new Wf(e),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=t,this.streamCRC=0};K.prototype._get_next_block=function(){var e,t,r,i=this.reader,n=i.pi();if(n===Kf)return!1;n!==Yf&&$(k.NOT_BZIP_DATA),this.targetBlockCRC=i.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,i.read(1)&&$(k.OBSOLETE_INPUT);var a=i.read(24);a>this.dbufSize&&$(k.DATA_ERROR,"initial position out of bounds");var o=i.read(16),s=new Buffer(256),u=0;for(e=0;e<16;e++)if(o&1<<15-e){var x=e*16;for(r=i.read(16),t=0;t<16;t++)r&1<<15-t&&(s[u++]=x+t)}var l=i.read(3);(l<$f||l>Gf)&&$(k.DATA_ERROR);var c=i.read(15);c===0&&$(k.DATA_ERROR);var f=new Buffer(256);for(e=0;e<l;e++)f[e]=e;var h=new Buffer(c);for(e=0;e<c;e++){for(t=0;i.read(1);t++)t>=l&&$(k.DATA_ERROR);h[e]=qa(f,t)}var p=u+2,_=[],d;for(t=0;t<l;t++){var v=new Buffer(p),g=new Uint16Array(Zt+1);for(o=i.read(5),e=0;e<p;e++){for(;(o<1||o>Zt)&&$(k.DATA_ERROR),!!i.read(1);)i.read(1)?o--:o++;v[e]=o}var E,z;for(E=z=v[0],e=1;e<p;e++)v[e]>z?z=v[e]:v[e]<E&&(E=v[e]);d={},_.push(d),d.permute=new Uint16Array(Da),d.limit=new Uint32Array(Zt+2),d.base=new Uint32Array(Zt+1),d.minLen=E,d.maxLen=z;var O=0;for(e=E;e<=z;e++)for(g[e]=d.limit[e]=0,o=0;o<p;o++)v[o]===e&&(d.permute[O++]=o);for(e=0;e<p;e++)g[v[e]]++;for(O=o=0,e=E;e<z;e++)O+=g[e],d.limit[e]=O-1,O<<=1,o+=g[e],d.base[e+1]=O-o;d.limit[z+1]=Number.MAX_VALUE,d.limit[z]=O+g[z]-1,d.base[E]=0}var X=new Uint32Array(256);for(e=0;e<256;e++)f[e]=e;var I=0,j=0,y=0,w,b=this.dbuf=new Uint32Array(this.dbufSize);for(p=0;;){for(p--||(p=Zf-1,y>=c&&$(k.DATA_ERROR),d=_[h[y++]]),e=d.minLen,t=i.read(e);e>d.maxLen&&$(k.DATA_ERROR),!(t<=d.limit[e]);e++)t=t<<1|i.read(1);t-=d.base[e],(t<0||t>=Da)&&$(k.DATA_ERROR);var C=d.permute[t];if(C===Pa||C===Hf){I||(I=1,o=0),C===Pa?o+=I:o+=2*I,I<<=1;continue}if(I)for(I=0,j+o>this.dbufSize&&$(k.DATA_ERROR),w=s[f[0]],X[w]+=o;o--;)b[j++]=w;if(C>u)break;j>=this.dbufSize&&$(k.DATA_ERROR),e=C-1,w=qa(f,e),w=s[w],X[w]++,b[j++]=w}for((a<0||a>=j)&&$(k.DATA_ERROR),t=0,e=0;e<256;e++)r=t+X[e],X[e]=t,t=r;for(e=0;e<j;e++)w=b[e]&255,b[X[w]]|=e<<8,X[w]++;var D=0,B=0,S=0;return j&&(D=b[a],B=D&255,D>>=8,S=-1),this.writePos=D,this.writeCurrent=B,this.writeCount=j,this.writeRun=S,!0};K.prototype._read_bunzip=function(e,t){var r,i,n;if(this.writeCount<0)return 0;for(var a=0,o=this.dbuf,s=this.writePos,u=this.writeCurrent,x=this.writeCount,l=this.outputsize,c=this.writeRun;x;){for(x--,i=u,s=o[s],u=s&255,s>>=8,c++===3?(r=u,n=i,u=-1):(r=1,n=u),this.blockCRC.updateCRCRun(n,r);r--;)this.outputStream.writeByte(n),this.nextoutput++;u!=i&&(c=0)}return this.writeCount=x,this.blockCRC.getCRC()!==this.targetBlockCRC&&$(k.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var Vr=function(e){if("readByte"in e)return e;var t=new st;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(r){this.pos=r},t.eof=function(){return this.pos>=e.length},t},za=function(e){var t=new st,r=!0;if(e)if(typeof e=="number")t.buffer=new Buffer(e),r=!1;else{if("writeByte"in e)return e;t.buffer=e,r=!1}else t.buffer=new Buffer(16384);return t.pos=0,t.writeByte=function(i){if(r&&this.pos>=this.buffer.length){var n=new Buffer(this.buffer.length*2);this.buffer.copy(n),this.buffer=n}this.buffer[this.pos++]=i},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!r)throw new TypeError("outputsize does not match decoded input");var i=new Buffer(this.pos);this.buffer.copy(i,0,0,this.pos),this.buffer=i}return this.buffer},t._coerced=!0,t};K.Err=k;K.decode=function(e,t,r){for(var i=Vr(e),n=za(t),a=new K(i,n);!("eof"in i&&i.eof());)if(a._init_block())a._read_bunzip();else{var o=a.reader.read(32)>>>0;if(o!==a.streamCRC&&$(k.DATA_ERROR,"Bad stream CRC (got "+a.streamCRC.toString(16)+" expected "+o.toString(16)+")"),r&&"eof"in i&&!i.eof())a._start_bunzip(i,n);else break}if("getBuffer"in n)return n.getBuffer()};K.decodeBlock=function(e,t,r){var i=Vr(e),n=za(r),a=new K(i,n);a.reader.seek(t);var o=a._get_next_block();if(o&&(a.blockCRC=new ka,a.writeCopies=0,a._read_bunzip()),"getBuffer"in n)return n.getBuffer()};K.table=function(e,t,r){var i=new st;i.delegate=Vr(e),i.pos=0,i.readByte=function(){return this.pos++,this.delegate.readByte()},i.delegate.eof&&(i.eof=i.delegate.eof.bind(i.delegate));var n=new st;n.pos=0,n.writeByte=function(){this.pos++};for(var a=new K(i,n),o=a.dbufSize;!("eof"in i&&i.eof());){var s=i.pos*8+a.reader.bitOffset;if(a.reader.hasByte&&(s-=8),a._init_block()){var u=n.pos;a._read_bunzip(),t(s,n.pos-u)}else{var x=a.reader.read(32);if(r&&"eof"in i&&!i.eof())a._start_bunzip(i,n),console.assert(a.dbufSize===o,"shouldn't change block size within multistream file");else break}}};K.Stream=st;K.version=Ia.version;K.license=Ia.license;Na.exports=K});var Ua=m((ja,Ma)=>{var Xf=require("stream");ja=Ma.exports=Qr;Qr.through=Qr;function Qr(e,t,r){e=e||function(l){this.queue(l)},t=t||function(){this.queue(null)};var i=!1,n=!1,a=[],o=!1,s=new Xf;s.readable=s.writable=!0,s.paused=!1,s.autoDestroy=!(r&&r.autoDestroy===!1),s.write=function(l){return e.call(this,l),!s.paused};function u(){for(;a.length&&!s.paused;){var l=a.shift();if(l===null)return s.emit("end");s.emit("data",l)}}s.queue=s.push=function(l){return o||(l===null&&(o=!0),a.push(l),u()),s},s.on("end",function(){s.readable=!1,!s.writable&&s.autoDestroy&&process.nextTick(function(){s.destroy()})});function x(){s.writable=!1,t.call(s),!s.readable&&s.autoDestroy&&s.destroy()}return s.end=function(l){if(!i)return i=!0,arguments.length&&s.write(l),x(),s},s.destroy=function(){if(!n)return n=!0,i=!0,a.length=0,s.writable=s.readable=!1,s.emit("close"),s},s.pause=function(){if(!s.paused)return s.paused=!0,s},s.resume=function(){return s.paused&&(s.paused=!1,s.emit("resume")),u(),s.paused||s.emit("drain"),s},s}});var Ha=m(($l,Wa)=>{function Jr(e){this.name="Bzip2Error",this.message=e,this.stack=new Error().stack}Jr.prototype=new Error;var G={Error:function(e){throw new Jr(e)}},ie={};ie.Bzip2Error=Jr;ie.crcTable=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];ie.array=function(e){var t=0,r=0,i=[0,1,3,7,15,31,63,127,255];return function(n){for(var a=0;n>0;){var o=8-t;n>=o?(a<<=o,a|=i[o]&e[r++],t=0,n-=o):(a<<=n,a|=(e[r]&i[n]<<8-n-t)>>8-n-t,t+=n,n=0)}return a}};ie.simple=function(e,t){var r=ie.array(e),i=ie.header(r),n=!1,a=1e5*i,o=new Int32Array(a);do n=ie.decompress(r,t,o,a);while(!n)};ie.header=function(e){this.byteCount=new Int32Array(256),this.symToByte=new Uint8Array(256),this.mtfSymbol=new Int32Array(256),this.selectors=new Uint8Array(32768),e(8*3)!=4348520&&G.Error("No magic number found");var t=e(8)-48;return(t<1||t>9)&&G.Error("Not a BZIP archive"),t};ie.decompress=function(e,t,r,i,n){for(var a=20,o=258,s=0,u=1,x=50,l=-1,c="",f=0;f<6;f++)c+=e(8).toString(16);if(c=="177245385090"){var h=e(32)|0;return h!==n&&G.Error("Error in bzip2: crc32 do not match"),e(null),null}c!="314159265359"&&G.Error("eek not valid bzip data");var p=e(32)|0;e(1)&&G.Error("unsupported obsolete version");var _=e(24);_>i&&G.Error("Initial position larger than buffer size");var d=e(16),v=0;for(f=0;f<16;f++)if(d&1<<15-f){var g=e(16);for(P=0;P<16;P++)g&1<<15-P&&(this.symToByte[v++]=16*f+P)}var E=e(3);(E<2||E>6)&&G.Error("another error");var z=e(15);z==0&&G.Error("meh");for(var f=0;f<E;f++)this.mtfSymbol[f]=f;for(var f=0;f<z;f++){for(var P=0;e(1);P++)P>=E&&G.Error("whoops another error");for(var O=this.mtfSymbol[P],g=P-1;g>=0;g--)this.mtfSymbol[g+1]=this.mtfSymbol[g];this.mtfSymbol[0]=O,this.selectors[f]=O}for(var R=v+2,X=[],I=new Uint8Array(o),j=new Uint16Array(a+1),y,P=0;P<E;P++){d=e(5);for(var f=0;f<R;f++){for(;(d<1||d>a)&&G.Error("I gave up a while ago on writing error messages"),!!e(1);)e(1)?d--:d++;I[f]=d}var w,b;w=b=I[0];for(var f=1;f<R;f++)I[f]>b?b=I[f]:I[f]<w&&(w=I[f]);y=X[P]={},y.permute=new Int32Array(o),y.limit=new Int32Array(a+1),y.base=new Int32Array(a+1),y.minLen=w,y.maxLen=b;for(var C=y.base,D=y.limit,B=0,f=w;f<=b;f++)for(var d=0;d<R;d++)I[d]==f&&(y.permute[B++]=d);for(f=w;f<=b;f++)j[f]=D[f]=0;for(f=0;f<R;f++)j[I[f]]++;for(B=d=0,f=w;f<b;f++)B+=j[f],D[f]=B-1,B<<=1,C[f+1]=B-(d+=j[f]);D[b]=B+j[b]-1,C[w]=0}for(var f=0;f<256;f++)this.mtfSymbol[f]=f,this.byteCount[f]=0;var S,F,R,M;for(S=F=R=M=0;;){for(R--||(R=x-1,M>=z&&G.Error("meow i'm a kitty, that's an error"),y=X[this.selectors[M++]],C=y.base,D=y.limit),f=y.minLen,P=e(f);f>y.maxLen&&G.Error("rawr i'm a dinosaur"),!(P<=D[f]);)f++,P=P<<1|e(1);P-=C[f],(P<0||P>=o)&&G.Error("moo i'm a cow");var T=y.permute[P];if(T==s||T==u){S||(S=1,d=0),T==s?d+=S:d+=2*S,S<<=1;continue}if(S)for(S=0,F+d>i&&G.Error("Boom."),O=this.symToByte[this.mtfSymbol[0]],this.byteCount[O]+=d;d--;)r[F++]=O;if(T>v)break;F>=i&&G.Error("I can't think of anything. Error"),f=T-1,O=this.mtfSymbol[f];for(var g=f-1;g>=0;g--)this.mtfSymbol[g+1]=this.mtfSymbol[g];this.mtfSymbol[0]=O,O=this.symToByte[O],this.byteCount[O]++,r[F++]=O}(_<0||_>=F)&&G.Error("I'm a monkey and I'm throwing something at someone, namely you");for(var P=0,f=0;f<256;f++)g=P+this.byteCount[f],this.byteCount[f]=P,P=g;for(var f=0;f<F;f++)O=r[f]&255,r[this.byteCount[O]]|=f<<8,this.byteCount[O]++;var we=0,be=0,ur=0;F&&(we=r[_],be=we&255,we>>=8,ur=-1),F=F;for(var lr,cr,yt;F;){for(F--,cr=be,we=r[we],be=we&255,we>>=8,ur++==3?(lr=be,yt=cr,be=-1):(lr=1,yt=be);lr--;)l=(l<<8^this.crcTable[(l>>24^yt)&255])&4294967295,t(yt);be!=cr&&(ur=0)}return l=(l^-1)>>>0,(l|0)!=(p|0)&&G.Error("Error in bzip2: crc32 do not match"),n=(l^(n<<1|n>>>31))&4294967295,n};Wa.exports=ie});var Za=m((Gl,Ga)=>{var $a=[0,1,3,7,15,31,63,127,255];Ga.exports=function(t){var r=0,i=0,n=t(),a=function(o){if(o===null&&r!=0){r=0,i++;return}for(var s=0;o>0;){i>=n.length&&(i=0,n=t());var u=8-r;r===0&&o>0&&a.bytesRead++,o>=u?(s<<=u,s|=$a[u]&n[i++],r=0,o-=u):(s<<=o,s|=(n[i]&$a[o]<<8-o-r)>>8-o-r,r+=o,o=0)}return s};return a.bytesRead=0,a}});var Xa=m((Zl,Ka)=>{var Vf=Ua(),Ya=Ha(),Qf=Za();Ka.exports=Jf;function Jf(){var e=[],t=0,r=0,i=!1,n=!1,a=null,o=null;function s(l){if(r){var c=1e5*r,f=new Int32Array(c),h=[],p=function(_){h.push(_)};return o=Ya.decompress(a,p,f,c,o),o===null?(r=0,!1):(l(Buffer.from(h)),!0)}else return r=Ya.header(a),o=0,!0}var u=0;function x(l){if(!i)try{return s(function(c){l.queue(c),c!==null&&(u+=c.length)})}catch(c){return l.emit("error",c),i=!0,!1}}return Vf(function(c){for(e.push(c),t+=c.length,a===null&&(a=Qf(function(){return e.shift()}));!i&&t-a.bytesRead+1>=(25e3+1e5*r||4);)x(this)},function(c){for(;!i&&a&&t>a.bytesRead;)x(this);i||(o!==null&&this.emit("error",new Error("input stream ended prematurely")),this.queue(null))})}});var eo=m((Yl,Ja)=>{"use strict";var Va=Gt(),Qa=Ea(),eu=Rt(),tu=La(),ru=Xa();Ja.exports=()=>e=>!Buffer.isBuffer(e)&&!eu(e)?Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`)):Buffer.isBuffer(e)&&(!Qa(e)||Qa(e).ext!=="bz2")?Promise.resolve([]):Buffer.isBuffer(e)?Va()(tu.decode(e)):Va()(e.pipe(ru()))});var io=m((Kl,ro)=>{"use strict";var iu=require("zlib"),nu=Gt(),to=_r(),au=Rt();ro.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!au(e))return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`));if(Buffer.isBuffer(e)&&(!to(e)||to(e).ext!=="gz"))return Promise.resolve([]);let t=iu.createGunzip(),r=nu()(t);return Buffer.isBuffer(e)?t.end(e):e.pipe(t),r}});var ao=m((Xl,no)=>{"use strict";no.exports=function(e){return e&&e.length>1?e[0]===255&&e[1]===216&&e[2]===255?{ext:"jpg",mime:"image/jpeg"}:e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71?{ext:"png",mime:"image/png"}:e[0]===71&&e[1]===73&&e[2]===70?{ext:"gif",mime:"image/gif"}:e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80?{ext:"webp",mime:"image/webp"}:e[0]===70&&e[1]===76&&e[2]===73&&e[3]===70?{ext:"flif",mime:"image/flif"}:(e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42)&&e[8]===67&&e[9]===82?{ext:"cr2",mime:"image/x-canon-cr2"}:e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42?{ext:"tif",mime:"image/tiff"}:e[0]===66&&e[1]===77?{ext:"bmp",mime:"image/bmp"}:e[0]===73&&e[1]===73&&e[2]===188?{ext:"jxr",mime:"image/vnd.ms-photo"}:e[0]===56&&e[1]===66&&e[2]===80&&e[3]===83?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===109&&e[31]===105&&e[32]===109&&e[33]===101&&e[34]===116&&e[35]===121&&e[36]===112&&e[37]===101&&e[38]===97&&e[39]===112&&e[40]===112&&e[41]===108&&e[42]===105&&e[43]===99&&e[44]===97&&e[45]===116&&e[46]===105&&e[47]===111&&e[48]===110&&e[49]===47&&e[50]===101&&e[51]===112&&e[52]===117&&e[53]===98&&e[54]===43&&e[55]===122&&e[56]===105&&e[57]===112?{ext:"epub",mime:"application/epub+zip"}:e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===77&&e[31]===69&&e[32]===84&&e[33]===65&&e[34]===45&&e[35]===73&&e[36]===78&&e[37]===70&&e[38]===47&&e[39]===109&&e[40]===111&&e[41]===122&&e[42]===105&&e[43]===108&&e[44]===108&&e[45]===97&&e[46]===46&&e[47]===114&&e[48]===115&&e[49]===97?{ext:"xpi",mime:"application/x-xpinstall"}:e[0]===80&&e[1]===75&&(e[2]===3||e[2]===5||e[2]===7)&&(e[3]===4||e[3]===6||e[3]===8)?{ext:"zip",mime:"application/zip"}:e[257]===117&&e[258]===115&&e[259]===116&&e[260]===97&&e[261]===114?{ext:"tar",mime:"application/x-tar"}:e[0]===82&&e[1]===97&&e[2]===114&&e[3]===33&&e[4]===26&&e[5]===7&&(e[6]===0||e[6]===1)?{ext:"rar",mime:"application/x-rar-compressed"}:e[0]===31&&e[1]===139&&e[2]===8?{ext:"gz",mime:"application/gzip"}:e[0]===66&&e[1]===90&&e[2]===104?{ext:"bz2",mime:"application/x-bzip2"}:e[0]===55&&e[1]===122&&e[2]===188&&e[3]===175&&e[4]===39&&e[5]===28?{ext:"7z",mime:"application/x-7z-compressed"}:e[0]===120&&e[1]===1?{ext:"dmg",mime:"application/x-apple-diskimage"}:e[0]===0&&e[1]===0&&e[2]===0&&(e[3]===24||e[3]===32)&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112||e[0]===51&&e[1]===103&&e[2]===112&&e[3]===53||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[16]===109&&e[17]===112&&e[18]===52&&e[19]===49&&e[20]===109&&e[21]===112&&e[22]===52&&e[23]===50&&e[24]===105&&e[25]===115&&e[26]===111&&e[27]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===105&&e[9]===115&&e[10]===111&&e[11]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===0?{ext:"mp4",mime:"video/mp4"}:e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===86?{ext:"m4v",mime:"video/x-m4v"}:e[0]===77&&e[1]===84&&e[2]===104&&e[3]===100?{ext:"mid",mime:"audio/midi"}:e[31]===109&&e[32]===97&&e[33]===116&&e[34]===114&&e[35]===111&&e[36]===115&&e[37]===107&&e[38]===97?{ext:"mkv",mime:"video/x-matroska"}:e[0]===26&&e[1]===69&&e[2]===223&&e[3]===163?{ext:"webm",mime:"video/webm"}:e[0]===0&&e[1]===0&&e[2]===0&&e[3]===20&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112?{ext:"mov",mime:"video/quicktime"}:e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===65&&e[9]===86&&e[10]===73?{ext:"avi",mime:"video/x-msvideo"}:e[0]===48&&e[1]===38&&e[2]===178&&e[3]===117&&e[4]===142&&e[5]===102&&e[6]===207&&e[7]===17&&e[8]===166&&e[9]===217?{ext:"wmv",mime:"video/x-ms-wmv"}:e[0]===0&&e[1]===0&&e[2]===1&&e[3].toString(16)[0]==="b"?{ext:"mpg",mime:"video/mpeg"}:e[0]===73&&e[1]===68&&e[2]===51||e[0]===255&&e[1]===251?{ext:"mp3",mime:"audio/mpeg"}:e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===65||e[0]===77&&e[1]===52&&e[2]===65&&e[3]===32?{ext:"m4a",mime:"audio/m4a"}:e[28]===79&&e[29]===112&&e[30]===117&&e[31]===115&&e[32]===72&&e[33]===101&&e[34]===97&&e[35]===100?{ext:"opus",mime:"audio/opus"}:e[0]===79&&e[1]===103&&e[2]===103&&e[3]===83?{ext:"ogg",mime:"audio/ogg"}:e[0]===102&&e[1]===76&&e[2]===97&&e[3]===67?{ext:"flac",mime:"audio/x-flac"}:e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===65&&e[10]===86&&e[11]===69?{ext:"wav",mime:"audio/x-wav"}:e[0]===35&&e[1]===33&&e[2]===65&&e[3]===77&&e[4]===82&&e[5]===10?{ext:"amr",mime:"audio/amr"}:e[0]===37&&e[1]===80&&e[2]===68&&e[3]===70?{ext:"pdf",mime:"application/pdf"}:e[0]===77&&e[1]===90?{ext:"exe",mime:"application/x-msdownload"}:(e[0]===67||e[0]===70)&&e[1]===87&&e[2]===83?{ext:"swf",mime:"application/x-shockwave-flash"}:e[0]===123&&e[1]===92&&e[2]===114&&e[3]===116&&e[4]===102?{ext:"rtf",mime:"application/rtf"}:e[0]===119&&e[1]===79&&e[2]===70&&e[3]===70&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)?{ext:"woff",mime:"application/font-woff"}:e[0]===119&&e[1]===79&&e[2]===70&&e[3]===50&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)?{ext:"woff2",mime:"application/font-woff"}:e[34]===76&&e[35]===80&&(e[8]===0&&e[9]===0&&e[10]===1||e[8]===1&&e[9]===0&&e[10]===2||e[8]===2&&e[9]===0&&e[10]===2)?{ext:"eot",mime:"application/octet-stream"}:e[0]===0&&e[1]===1&&e[2]===0&&e[3]===0&&e[4]===0?{ext:"ttf",mime:"application/font-sfnt"}:e[0]===79&&e[1]===84&&e[2]===84&&e[3]===79&&e[4]===0?{ext:"otf",mime:"application/font-sfnt"}:e[0]===0&&e[1]===0&&e[2]===1&&e[3]===0?{ext:"ico",mime:"image/x-icon"}:e[0]===70&&e[1]===76&&e[2]===86&&e[3]===1?{ext:"flv",mime:"video/x-flv"}:e[0]===37&&e[1]===33?{ext:"ps",mime:"application/postscript"}:e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0?{ext:"xz",mime:"application/x-xz"}:e[0]===83&&e[1]===81&&e[2]===76&&e[3]===105?{ext:"sqlite",mime:"application/x-sqlite3"}:e[0]===78&&e[1]===69&&e[2]===83&&e[3]===26?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:e[0]===67&&e[1]===114&&e[2]===50&&e[3]===52?{ext:"crx",mime:"application/x-google-chrome-extension"}:e[0]===77&&e[1]===83&&e[2]===67&&e[3]===70||e[0]===73&&e[1]===83&&e[2]===99&&e[3]===40?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62&&e[7]===10&&e[8]===100&&e[9]===101&&e[10]===98&&e[11]===105&&e[12]===97&&e[13]===110&&e[14]===45&&e[15]===98&&e[16]===105&&e[17]===110&&e[18]===97&&e[19]===114&&e[20]===121?{ext:"deb",mime:"application/x-deb"}:e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62?{ext:"ar",mime:"application/x-unix-archive"}:e[0]===237&&e[1]===171&&e[2]===238&&e[3]===219?{ext:"rpm",mime:"application/x-rpm"}:e[0]===31&&e[1]===160||e[0]===31&&e[1]===157?{ext:"Z",mime:"application/x-compress"}:e[0]===76&&e[1]===90&&e[2]===73&&e[3]===80?{ext:"lz",mime:"application/x-lzip"}:e[0]===208&&e[1]===207&&e[2]===17&&e[3]===224&&e[4]===161&&e[5]===177&&e[6]===26&&e[7]===225?{ext:"msi",mime:"application/x-msi"}:null:null}});var ho=m((Vl,xo)=>{"use strict";var ti="pending",oo="settled",Yt="fulfilled",Kt="rejected",ou=function(){},so=typeof global<"u"&&typeof global.process<"u"&&typeof global.process.emit=="function",su=typeof setImmediate>"u"?setTimeout:setImmediate,ft=[],ei;function fu(){for(var e=0;e<ft.length;e++)ft[e][0](ft[e][1]);ft=[],ei=!1}function Xt(e,t){ft.push([e,t]),ei||(ei=!0,su(fu,0))}function uu(e,t){function r(n){ri(t,n)}function i(n){ut(t,n)}try{e(r,i)}catch(n){i(n)}}function fo(e){var t=e.owner,r=t._state,i=t._data,n=e[r],a=e.then;if(typeof n=="function"){r=Yt;try{i=n(i)}catch(o){ut(a,o)}}uo(a,i)||(r===Yt&&ri(a,i),r===Kt&&ut(a,i))}function uo(e,t){var r;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&(typeof t=="function"||typeof t=="object")){var i=t.then;if(typeof i=="function")return i.call(t,function(n){r||(r=!0,t===n?lo(e,n):ri(e,n))},function(n){r||(r=!0,ut(e,n))}),!0}}catch(n){return r||ut(e,n),!0}return!1}function ri(e,t){(e===t||!uo(e,t))&&lo(e,t)}function lo(e,t){e._state===ti&&(e._state=oo,e._data=t,Xt(lu,e))}function ut(e,t){e._state===ti&&(e._state=oo,e._data=t,Xt(cu,e))}function co(e){e._then=e._then.forEach(fo)}function lu(e){e._state=Yt,co(e)}function cu(e){e._state=Kt,co(e),!e._handled&&so&&global.process.emit("unhandledRejection",e._data,e)}function xu(e){global.process.emit("rejectionHandled",e)}function V(e){if(typeof e!="function")throw new TypeError("Promise resolver "+e+" is not a function");if(!(this instanceof V))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],uu(e,this)}V.prototype={constructor:V,_state:ti,_then:null,_data:void 0,_handled:!1,then:function(e,t){var r={owner:this,then:new this.constructor(ou),fulfilled:e,rejected:t};return(t||e)&&!this._handled&&(this._handled=!0,this._state===Kt&&so&&Xt(xu,this)),this._state===Yt||this._state===Kt?Xt(fo,r):this._then.push(r),r.then},catch:function(e){return this.then(null,e)}};V.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new V(function(t,r){var i=[],n=0;function a(u){return n++,function(x){i[u]=x,--n||t(i)}}for(var o=0,s;o<e.length;o++)s=e[o],s&&typeof s.then=="function"?s.then(a(o),r):i[o]=s;n||t(i)})};V.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new V(function(t,r){for(var i=0,n;i<e.length;i++)n=e[i],n&&typeof n.then=="function"?n.then(t,r):t(n)})};V.resolve=function(e){return e&&typeof e=="object"&&e.constructor===V?e:new V(function(t){t(e)})};V.reject=function(e){return new V(function(t,r){r(e)})};xo.exports=V});var mo=m((Ql,po)=>{"use strict";po.exports=typeof Promise=="function"?Promise:ho()});var ii=m((Jl,yo)=>{"use strict";var _o=Object.getOwnPropertySymbols,du=Object.prototype.hasOwnProperty,hu=Object.prototype.propertyIsEnumerable;function pu(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function mu(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(a){n[a]=a}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}yo.exports=mu()?Object.assign:function(e,t){for(var r,i=pu(e),n,a=1;a<arguments.length;a++){r=Object(arguments[a]);for(var o in r)du.call(r,o)&&(i[o]=r[o]);if(_o){n=_o(r);for(var s=0;s<n.length;s++)hu.call(r,n[s])&&(i[n[s]]=r[n[s]])}}return i}});var go=m((ec,vo)=>{var _u=require("stream").PassThrough,yu=ii();vo.exports=function(e){e=yu({},e);var t=e.array,r=e.encoding,i=r==="buffer",n=!1;t?n=!(r||i):r=r||"utf8",i&&(r=null);var a=0,o=[],s=new _u({objectMode:n});return r&&s.setEncoding(r),s.on("data",function(u){o.push(u),n?a=o.length:a+=u.length}),s.getBufferedValue=function(){return t?o:i?Buffer.concat(o,a):o.join("")},s.getBufferedLength=function(){return a},s}});var bo=m((tc,Vt)=>{"use strict";var wo=mo(),ni=ii(),vu=go();function ai(e,t){if(!e)return wo.reject(new Error("Expected a stream"));t=ni({maxBuffer:1/0},t);var r=t.maxBuffer,i,n,a=new wo(function(o,s){i=vu(t),e.once("error",u),e.pipe(i),i.on("data",function(){i.getBufferedLength()>r&&s(new Error("maxBuffer exceeded"))}),i.once("error",u),i.on("end",o),n=function(){e.unpipe&&e.unpipe(i)};function u(x){x&&(x.bufferedData=i.getBufferedValue()),s(x)}});return a.then(n,n),a.then(function(){return i.getBufferedValue()})}Vt.exports=ai;Vt.exports.buffer=function(e,t){return ai(e,ni({},t,{encoding:"buffer"}))};Vt.exports.array=function(e,t){return ai(e,ni({},t,{array:!0}))}});var oi=m((rc,Fo)=>{"use strict";var Eo=function(e,t,r){return function(){for(var i=this,n=new Array(arguments.length),a=0;a<arguments.length;a++)n[a]=arguments[a];return new t(function(o,s){n.push(function(u,x){if(u)s(u);else if(r.multiArgs){for(var l=new Array(arguments.length-1),c=1;c<arguments.length;c++)l[c-1]=arguments[c];o(l)}else o(x)}),e.apply(i,n)})}},So=Fo.exports=function(e,t,r){typeof t!="function"&&(r=t,t=Promise),r=r||{},r.exclude=r.exclude||[/.+Sync$/];var i=function(a){var o=function(s){return typeof s=="string"?a===s:s.test(a)};return r.include?r.include.some(o):!r.exclude.some(o)},n=typeof e=="function"?function(){return r.excludeMain?e.apply(this,arguments):Eo(e,t,r).apply(this,arguments)}:{};return Object.keys(e).reduce(function(a,o){var s=e[o];return a[o]=typeof s=="function"&&i(o)?Eo(s,t,r):s,a},n)};So.all=So});var To=m((ic,Ao)=>{Ao.exports=Qt;function Qt(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}Qt.prototype.go=function(e){this.pending<this.max?Oo(this,e):this.waiting.push(e)};Qt.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)};Qt.prototype.hold=function(){return Ro(this)};function Ro(e){e.pending+=1;var t=!1;return r;function r(n){if(t)throw new Error("callback called twice");if(t=!0,e.error=e.error||n,e.pending-=1,e.waiting.length>0&&e.pending<e.max)Oo(e,e.waiting.shift());else if(e.pending===0){var a=e.listeners;e.listeners=[],a.forEach(i)}}function i(n){n(e.error)}}function Oo(e,t){t(Ro(e))}});var Co=m(ct=>{var lt=require("fs"),Jt=require("util"),si=require("stream"),Bo=si.Readable,fi=si.Writable,gu=si.PassThrough,wu=To(),er=require("events").EventEmitter;ct.createFromBuffer=bu;ct.createFromFd=Eu;ct.BufferSlicer=xe;ct.FdSlicer=ce;Jt.inherits(ce,er);function ce(e,t){t=t||{},er.call(this),this.fd=e,this.pend=new wu,this.pend.max=1,this.refCount=0,this.autoClose=!!t.autoClose}ce.prototype.read=function(e,t,r,i,n){var a=this;a.pend.go(function(o){lt.read(a.fd,e,t,r,i,function(s,u,x){o(),n(s,u,x)})})};ce.prototype.write=function(e,t,r,i,n){var a=this;a.pend.go(function(o){lt.write(a.fd,e,t,r,i,function(s,u,x){o(),n(s,u,x)})})};ce.prototype.createReadStream=function(e){return new tr(this,e)};ce.prototype.createWriteStream=function(e){return new rr(this,e)};ce.prototype.ref=function(){this.refCount+=1};ce.prototype.unref=function(){var e=this;if(e.refCount-=1,e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.autoClose&&lt.close(e.fd,t);function t(r){r?e.emit("error",r):e.emit("close")}};Jt.inherits(tr,Bo);function tr(e,t){t=t||{},Bo.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start,this.destroyed=!1}tr.prototype._read=function(e){var t=this;if(!t.destroyed){var r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.destroyed=!0,t.push(null),t.context.unref();return}t.context.pend.go(function(i){if(t.destroyed)return i();var n=new Buffer(r);lt.read(t.context.fd,n,0,r,t.pos,function(a,o){a?t.destroy(a):o===0?(t.destroyed=!0,t.push(null),t.context.unref()):(t.pos+=o,t.push(n.slice(0,o))),i()})})}};tr.prototype.destroy=function(e){this.destroyed||(e=e||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",e),this.context.unref())};Jt.inherits(rr,fi);function rr(e,t){t=t||{},fi.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end==null?1/0:+t.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}rr.prototype._write=function(e,t,r){var i=this;if(!i.destroyed){if(i.pos+e.length>i.endOffset){var n=new Error("maximum file length exceeded");n.code="ETOOBIG",i.destroy(),r(n);return}i.context.pend.go(function(a){if(i.destroyed)return a();lt.write(i.context.fd,e,0,e.length,i.pos,function(o,s){o?(i.destroy(),a(),r(o)):(i.bytesWritten+=s,i.pos+=s,i.emit("progress"),a(),r())})})}};rr.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())};Jt.inherits(xe,er);function xe(e,t){er.call(this),t=t||{},this.refCount=0,this.buffer=e,this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}xe.prototype.read=function(e,t,r,i,n){var a=i+r,o=a-this.buffer.length,s=o>0?o:r;this.buffer.copy(e,t,i,a),setImmediate(function(){n(null,s)})};xe.prototype.write=function(e,t,r,i,n){e.copy(this.buffer,i,t,t+r),setImmediate(function(){n(null,r,e)})};xe.prototype.createReadStream=function(e){e=e||{};var t=new gu(e);t.destroyed=!1,t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var r=this.buffer.slice(t.start,t.pos),i=0;;){var n=i+this.maxChunkSize;if(n>=r.length){i<r.length&&t.write(r.slice(i,r.length));break}t.write(r.slice(i,n)),i=n}return t.end(),t.destroy=function(){t.destroyed=!0},t};xe.prototype.createWriteStream=function(e){var t=this;e=e||{};var r=new fi(e);return r.start=e.start||0,r.endOffset=e.end==null?this.buffer.length:+e.end,r.bytesWritten=0,r.pos=r.start,r.destroyed=!1,r._write=function(i,n,a){if(!r.destroyed){var o=r.pos+i.length;if(o>r.endOffset){var s=new Error("maximum file length exceeded");s.code="ETOOBIG",r.destroyed=!0,a(s);return}i.copy(t.buffer,r.pos,0,i.length),r.bytesWritten+=i.length,r.pos=o,r.emit("progress"),a()}},r.destroy=function(){r.destroyed=!0},r};xe.prototype.ref=function(){this.refCount+=1};xe.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function bu(e,t){return new xe(e,t)}function Eu(e,t){return new ce(e,t)}});var qo=m((ac,Po)=>{var ye=require("buffer").Buffer,ui=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(ui=new Int32Array(ui));function Do(e){if(ye.isBuffer(e))return e;var t=typeof ye.alloc=="function"&&typeof ye.from=="function";if(typeof e=="number")return t?ye.alloc(e):new ye(e);if(typeof e=="string")return t?ye.from(e):new ye(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function Su(e){var t=Do(4);return t.writeInt32BE(e,0),t}function li(e,t){e=Do(e),ye.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=~~t^-1,i=0;i<e.length;i++)r=ui[(r^e[i])&255]^r>>>8;return r^-1}function ci(){return Su(li.apply(null,arguments))}ci.signed=function(){return li.apply(null,arguments)};ci.unsigned=function(){return li.apply(null,arguments)>>>0};Po.exports=ci});var Mo=m(ae=>{var xi=require("fs"),Fu=require("zlib"),ko=Co(),Ru=qo(),ar=require("util"),or=require("events").EventEmitter,Io=require("stream").Transform,di=require("stream").PassThrough,Ou=require("stream").Writable;ae.open=Au;ae.fromFd=zo;ae.fromBuffer=Tu;ae.fromRandomAccessReader=hi;ae.dosDateTimeToDate=Lo;ae.validateFileName=jo;ae.ZipFile=ve;ae.Entry=xt;ae.RandomAccessReader=ge;function Au(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!0),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),r==null&&(r=nr),xi.open(e,"r",function(i,n){if(i)return r(i);zo(n,t,function(a,o){a&&xi.close(n,nr),r(a,o)})})}function zo(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!1),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),r==null&&(r=nr),xi.fstat(e,function(i,n){if(i)return r(i);var a=ko.createFromFd(e,{autoClose:!0});hi(a,n.size,t,r)})}function Tu(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose=!1,t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1);var i=ko.createFromBuffer(e,{maxChunkSize:65536});hi(i,e.length,t,r)}function hi(e,t,r,i){typeof r=="function"&&(i=r,r=null),r==null&&(r={}),r.autoClose==null&&(r.autoClose=!0),r.lazyEntries==null&&(r.lazyEntries=!1),r.decodeStrings==null&&(r.decodeStrings=!0);var n=!!r.decodeStrings;if(r.validateEntrySizes==null&&(r.validateEntrySizes=!0),r.strictFileNames==null&&(r.strictFileNames=!1),i==null&&(i=nr),typeof t!="number")throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");e.ref();var a=22,o=65535,s=Math.min(a+o,t),u=ne(s),x=t-u.length;Ge(e,u,0,s,x,function(l){if(l)return i(l);for(var c=s-a;c>=0;c-=1)if(u.readUInt32LE(c)===101010256){var f=u.slice(c),h=f.readUInt16LE(4);if(h!==0)return i(new Error("multi-disk zip files are not supported: found disk number: "+h));var p=f.readUInt16LE(10),_=f.readUInt32LE(16),d=f.readUInt16LE(20),v=f.length-a;if(d!==v)return i(new Error("invalid comment length. expected: "+v+". found: "+d));var g=n?ir(f,22,f.length,!1):f.slice(22);if(!(p===65535||_===4294967295))return i(null,new ve(e,_,t,p,g,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames));var E=ne(20),z=x+c-E.length;Ge(e,E,0,E.length,z,function(O){if(O)return i(O);if(E.readUInt32LE(0)!==117853008)return i(new Error("invalid zip64 end of central directory locator signature"));var X=Ze(E,8),I=ne(56);Ge(e,I,0,I.length,X,function(j){return j?i(j):I.readUInt32LE(0)!==101075792?i(new Error("invalid zip64 end of central directory record signature")):(p=Ze(I,32),_=Ze(I,48),i(null,new ve(e,_,t,p,g,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames)))})});return}i(new Error("end of central directory record signature not found"))})}ar.inherits(ve,or);function ve(e,t,r,i,n,a,o,s,u,x){var l=this;or.call(l),l.reader=e,l.reader.on("error",function(c){No(l,c)}),l.reader.once("close",function(){l.emit("close")}),l.readEntryCursor=t,l.fileSize=r,l.entryCount=i,l.comment=n,l.entriesRead=0,l.autoClose=!!a,l.lazyEntries=!!o,l.decodeStrings=!!s,l.validateEntrySizes=!!u,l.strictFileNames=!!x,l.isOpen=!0,l.emittedError=!1,l.lazyEntries||l._readEntry()}ve.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function J(e,t){e.autoClose&&e.close(),No(e,t)}function No(e,t){e.emittedError||(e.emittedError=!0,e.emit("error",t))}ve.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};ve.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit("end")});return}if(!e.emittedError){var t=ne(46);Ge(e.reader,t,0,t.length,e.readEntryCursor,function(r){if(r)return J(e,r);if(!e.emittedError){var i=new xt,n=t.readUInt32LE(0);if(n!==33639248)return J(e,new Error("invalid central directory file header signature: 0x"+n.toString(16)));if(i.versionMadeBy=t.readUInt16LE(4),i.versionNeededToExtract=t.readUInt16LE(6),i.generalPurposeBitFlag=t.readUInt16LE(8),i.compressionMethod=t.readUInt16LE(10),i.lastModFileTime=t.readUInt16LE(12),i.lastModFileDate=t.readUInt16LE(14),i.crc32=t.readUInt32LE(16),i.compressedSize=t.readUInt32LE(20),i.uncompressedSize=t.readUInt32LE(24),i.fileNameLength=t.readUInt16LE(28),i.extraFieldLength=t.readUInt16LE(30),i.fileCommentLength=t.readUInt16LE(32),i.internalFileAttributes=t.readUInt16LE(36),i.externalFileAttributes=t.readUInt32LE(38),i.relativeOffsetOfLocalHeader=t.readUInt32LE(42),i.generalPurposeBitFlag&64)return J(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46,t=ne(i.fileNameLength+i.extraFieldLength+i.fileCommentLength),Ge(e.reader,t,0,t.length,e.readEntryCursor,function(a){if(a)return J(e,a);if(!e.emittedError){var o=(i.generalPurposeBitFlag&2048)!==0;i.fileName=e.decodeStrings?ir(t,0,i.fileNameLength,o):t.slice(0,i.fileNameLength);var s=i.fileNameLength+i.extraFieldLength,u=t.slice(i.fileNameLength,s);i.extraFields=[];for(var x=0;x<u.length-3;){var l=u.readUInt16LE(x+0),c=u.readUInt16LE(x+2),f=x+4,h=f+c;if(h>u.length)return J(e,new Error("extra field length exceeds extra field buffer size"));var p=ne(c);u.copy(p,0,f,h),i.extraFields.push({id:l,data:p}),x=h}if(i.fileComment=e.decodeStrings?ir(t,s,s+i.fileCommentLength,o):t.slice(s,s+i.fileCommentLength),i.comment=i.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1,i.uncompressedSize===4294967295||i.compressedSize===4294967295||i.relativeOffsetOfLocalHeader===4294967295){for(var _=null,x=0;x<i.extraFields.length;x++){var d=i.extraFields[x];if(d.id===1){_=d.data;break}}if(_==null)return J(e,new Error("expected zip64 extended information extra field"));var v=0;if(i.uncompressedSize===4294967295){if(v+8>_.length)return J(e,new Error("zip64 extended information extra field does not include uncompressed size"));i.uncompressedSize=Ze(_,v),v+=8}if(i.compressedSize===4294967295){if(v+8>_.length)return J(e,new Error("zip64 extended information extra field does not include compressed size"));i.compressedSize=Ze(_,v),v+=8}if(i.relativeOffsetOfLocalHeader===4294967295){if(v+8>_.length)return J(e,new Error("zip64 extended information extra field does not include relative header offset"));i.relativeOffsetOfLocalHeader=Ze(_,v),v+=8}}if(e.decodeStrings)for(var x=0;x<i.extraFields.length;x++){var d=i.extraFields[x];if(d.id===28789){if(d.data.length<6||d.data.readUInt8(0)!==1)continue;var g=d.data.readUInt32LE(1);if(Ru.unsigned(t.slice(0,i.fileNameLength))!==g)continue;i.fileName=ir(d.data,5,d.data.length,!0);break}}if(e.validateEntrySizes&&i.compressionMethod===0){var E=i.uncompressedSize;if(i.isEncrypted()&&(E+=12),i.compressedSize!==E){var z="compressed/uncompressed size mismatch for stored file: "+i.compressedSize+" != "+i.uncompressedSize;return J(e,new Error(z))}}if(e.decodeStrings){e.strictFileNames||(i.fileName=i.fileName.replace(/\\/g,"/"));var O=jo(i.fileName,e.validateFileNameOptions);if(O!=null)return J(e,new Error(O))}e.emit("entry",i),e.lazyEntries||e._readEntry()}})}})}};ve.prototype.openReadStream=function(e,t,r){var i=this,n=0,a=e.compressedSize;if(r==null)r=t,t={};else{if(t.decrypt!=null){if(!e.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(t.decrypt!==!1)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}if(t.decompress!=null){if(!e.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!(t.decompress===!1||t.decompress===!0))throw new Error("invalid options.decompress value: "+t.decompress)}if(t.start!=null||t.end!=null){if(e.isCompressed()&&t.decompress!==!1)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(e.isEncrypted()&&t.decrypt!==!1)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(t.start!=null){if(n=t.start,n<0)throw new Error("options.start < 0");if(n>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(t.end!=null){if(a=t.end,a<0)throw new Error("options.end < 0");if(a>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(a<n)throw new Error("options.end < options.start")}}if(!i.isOpen)return r(new Error("closed"));if(e.isEncrypted()&&t.decrypt!==!1)return r(new Error("entry is encrypted, and options.decrypt !== false"));i.reader.ref();var o=ne(30);Ge(i.reader,o,0,o.length,e.relativeOffsetOfLocalHeader,function(s){try{if(s)return r(s);var u=o.readUInt32LE(0);if(u!==67324752)return r(new Error("invalid local file header signature: 0x"+u.toString(16)));var x=o.readUInt16LE(26),l=o.readUInt16LE(28),c=e.relativeOffsetOfLocalHeader+o.length+x+l,f;if(e.compressionMethod===0)f=!1;else if(e.compressionMethod===8)f=t.decompress!=null?t.decompress:!0;else return r(new Error("unsupported compression method: "+e.compressionMethod));var h=c,p=h+e.compressedSize;if(e.compressedSize!==0&&p>i.fileSize)return r(new Error("file data overflows file bounds: "+h+" + "+e.compressedSize+" > "+i.fileSize));var _=i.reader.createReadStream({start:h+n,end:h+a}),d=_;if(f){var v=!1,g=Fu.createInflateRaw();_.on("error",function(E){setImmediate(function(){v||g.emit("error",E)})}),_.pipe(g),i.validateEntrySizes?(d=new dt(e.uncompressedSize),g.on("error",function(E){setImmediate(function(){v||d.emit("error",E)})}),g.pipe(d)):d=g,d.destroy=function(){v=!0,g!==d&&g.unpipe(d),_.unpipe(g),_.destroy()}}r(null,d)}finally{i.reader.unref()}})};function xt(){}xt.prototype.getLastModDate=function(){return Lo(this.lastModFileDate,this.lastModFileTime)};xt.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};xt.prototype.isCompressed=function(){return this.compressionMethod===8};function Lo(e,t){var r=e&31,i=(e>>5&15)-1,n=(e>>9&127)+1980,a=0,o=(t&31)*2,s=t>>5&63,u=t>>11&31;return new Date(n,i,r,u,s,o,a)}function jo(e){return e.indexOf("\\")!==-1?"invalid characters in fileName: "+e:/^[a-zA-Z]:/.test(e)||/^\//.test(e)?"absolute path: "+e:e.split("/").indexOf("..")!==-1?"invalid relative path: "+e:null}function Ge(e,t,r,i,n,a){if(i===0)return setImmediate(function(){a(null,ne(0))});e.read(t,r,i,n,function(o,s){if(o)return a(o);if(s<i)return a(new Error("unexpected EOF"));a()})}ar.inherits(dt,Io);function dt(e){Io.call(this),this.actualByteCount=0,this.expectedByteCount=e}dt.prototype._transform=function(e,t,r){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var i="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return r(new Error(i))}r(null,e)};dt.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()};ar.inherits(ge,or);function ge(){or.call(this),this.refCount=0}ge.prototype.ref=function(){this.refCount+=1};ge.prototype.unref=function(){var e=this;if(e.refCount-=1,e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.close(t);function t(r){if(r)return e.emit("error",r);e.emit("close")}};ge.prototype.createReadStream=function(e){var t=e.start,r=e.end;if(t===r){var i=new di;return setImmediate(function(){i.end()}),i}var n=this._readStreamForRange(t,r),a=!1,o=new sr(this);n.on("error",function(u){setImmediate(function(){a||o.emit("error",u)})}),o.destroy=function(){n.unpipe(o),o.unref(),n.destroy()};var s=new dt(r-t);return o.on("error",function(u){setImmediate(function(){a||s.emit("error",u)})}),s.destroy=function(){a=!0,o.unpipe(s),o.destroy()},n.pipe(o).pipe(s)};ge.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")};ge.prototype.read=function(e,t,r,i,n){var a=this.createReadStream({start:i,end:i+r}),o=new Ou,s=0;o._write=function(u,x,l){u.copy(e,t+s,0,u.length),s+=u.length,l()},o.on("finish",n),a.on("error",function(u){n(u)}),a.pipe(o)};ge.prototype.close=function(e){setImmediate(e)};ar.inherits(sr,di);function sr(e){di.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}sr.prototype._flush=function(e){this.unref(),e()};sr.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var Bu="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";function ir(e,t,r,i){if(i)return e.toString("utf8",t,r);for(var n="",a=t;a<r;a++)n+=Bu[e[a]];return n}function Ze(e,t){var r=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return i*4294967296+r}var ne;typeof Buffer.allocUnsafe=="function"?ne=function(e){return Buffer.allocUnsafe(e)}:ne=function(e){return new Buffer(e)};function nr(e){if(e)throw e}});var $o=m((sc,Ho)=>{"use strict";var Uo=ao(),Cu=bo(),Wo=oi(),Du=Mo(),Pu=(e,t)=>{let a=e.versionMadeBy>>8;return(t&61440)===40960?"symlink":(t&61440)===16384||a===0&&e.externalFileAttributes===16?"directory":"file"},qu=(e,t)=>{let r={mode:e.externalFileAttributes>>16&65535,mtime:e.getLastModDate(),path:e.fileName};return r.type=Pu(e,r.mode),r.mode===0&&r.type==="directory"&&(r.mode=493),r.mode===0&&(r.mode=420),Wo(t.openReadStream.bind(t))(e).then(Cu.buffer).then(i=>(r.data=i,r.type==="symlink"&&(r.linkname=i.toString()),r)).catch(i=>{throw t.close(),i})},ku=e=>new Promise((t,r)=>{let i=[];e.readEntry(),e.on("entry",n=>{qu(n,e).catch(r).then(a=>{i.push(a),e.readEntry()})}),e.on("error",r),e.on("end",()=>t(i))});Ho.exports=()=>e=>Buffer.isBuffer(e)?!Uo(e)||Uo(e).ext!=="zip"?Promise.resolve([]):Wo(Du.fromBuffer)(e,{lazyEntries:!0}).then(ku):Promise.reject(new TypeError(`Expected a Buffer, got ${typeof e}`))});var Yo=m((fc,Zo)=>{"use strict";var Go=(e,t)=>function(){let r=t.promiseModule,i=new Array(arguments.length);for(let n=0;n<arguments.length;n++)i[n]=arguments[n];return new r((n,a)=>{t.errorFirst?i.push(function(o,s){if(t.multiArgs){let u=new Array(arguments.length-1);for(let x=1;x<arguments.length;x++)u[x-1]=arguments[x];o?(u.unshift(o),a(u)):n(u)}else o?a(o):n(s)}):i.push(function(o){if(t.multiArgs){let s=new Array(arguments.length-1);for(let u=0;u<arguments.length;u++)s[u]=arguments[u];n(s)}else n(o)}),e.apply(this,i)})};Zo.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=n=>{let a=o=>typeof o=="string"?n===o:o.test(n);return t.include?t.include.some(a):!t.exclude.some(a)},i;typeof e=="function"?i=function(){return t.excludeMain?e.apply(this,arguments):Go(e,t).apply(this,arguments)}:i=Object.create(Object.getPrototypeOf(e));for(let n in e){let a=e[n];i[n]=typeof a=="function"&&r(n)?Go(a,t):a}return i}});var Qo=m((uc,pi)=>{"use strict";var Iu=require("fs"),Te=require("path"),Ko=Yo(),Xo={mode:511&~process.umask(),fs:Iu},Vo=e=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Te.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}};pi.exports=(e,t)=>Promise.resolve().then(()=>{Vo(e),t=Object.assign({},Xo,t);let r=Ko(t.fs.mkdir),i=Ko(t.fs.stat),n=a=>r(a,t.mode).then(()=>a).catch(o=>{if(o.code==="ENOENT"){if(o.message.includes("null bytes")||Te.dirname(a)===a)throw o;return n(Te.dirname(a)).then(()=>n(a))}return i(a).then(s=>s.isDirectory()?a:Promise.reject()).catch(()=>{throw o})});return n(Te.resolve(e))});pi.exports.sync=(e,t)=>{Vo(e),t=Object.assign({},Xo,t);let r=i=>{try{t.fs.mkdirSync(i,t.mode)}catch(n){if(n.code==="ENOENT"){if(n.message.includes("null bytes")||Te.dirname(i)===i)throw n;return r(Te.dirname(i)),r(i)}try{if(!t.fs.statSync(i).isDirectory())throw new Error("The path is not a directory")}catch{throw n}}return i};return r(Te.resolve(e))}});var es=m((lc,Jo)=>{"use strict";Jo.exports=function(t,r){if(r){if(typeof r!="object")throw new TypeError(String(r)+" is not an object. Expected an object that has boolean `includeZero` property.");if("includeZero"in r){if(typeof r.includeZero!="boolean")throw new TypeError(String(r.includeZero)+" is neither true nor false. `includeZero` option must be a Boolean value.");if(r.includeZero&&t===0)return!0}}return Number.isSafeInteger(t)&&t>=1}});var rs=m((cc,ts)=>{"use strict";var ht=require("path"),pt=require("util"),zu=es();ts.exports=function(t,r,i){if(typeof t!="string")throw new TypeError(pt.inspect(t)+" is not a string. First argument to strip-dirs must be a path string.");if(ht.posix.isAbsolute(t)||ht.win32.isAbsolute(t))throw new Error(`${t} is an absolute path. strip-dirs requires a relative path.`);if(!zu(r,{includeZero:!0}))throw new Error("The Second argument of strip-dirs must be a natural number or 0, but received "+pt.inspect(r)+".");if(i){if(typeof i!="object")throw new TypeError(pt.inspect(i)+" is not an object. Expected an object with a boolean `disallowOverflow` property.");if(Array.isArray(i))throw new TypeError(pt.inspect(i)+" is an array. Expected an object with a boolean `disallowOverflow` property.");if("disallowOverflow"in i&&typeof i.disallowOverflow!="boolean")throw new TypeError(pt.inspect(i.disallowOverflow)+" is neither true nor false. `disallowOverflow` option must be a Boolean value.")}else i={disallowOverflow:!1};let n=ht.normalize(t).split(ht.sep);if(n.length>1&&n[0]==="."&&n.shift(),r>n.length-1){if(i.disallowOverflow)throw new RangeError("Cannot strip more directories than there are.");r=n.length-1}return ht.join.apply(null,n.slice(r))}});var ns=m((xc,is)=>{"use strict";var fr=require("path"),Nu=Ii(),Lu=Gt(),ju=eo(),Mu=io(),Uu=$o(),mi=Qo(),Wu=oi(),Hu=rs(),Q=Wu(Nu),$u=(e,t)=>t.plugins.length===0?Promise.resolve([]):Promise.all(t.plugins.map(r=>r(e,t))).then(r=>r.reduce((i,n)=>i.concat(n))),_i=(e,t)=>Q.realpath(e).catch(r=>{let i=fr.dirname(e);return _i(i,t)}).then(r=>{if(r.indexOf(t)!==0)throw new Error("Refusing to create a directory outside the output path.");return mi(e).then(Q.realpath)}),Gu=(e,t)=>Q.readlink(e).catch(r=>null).then(r=>{if(r)throw new Error("Refusing to write into a symlink");return t}),Zu=(e,t,r)=>$u(e,r).then(i=>(r.strip>0&&(i=i.map(n=>(n.path=Hu(n.path,r.strip),n)).filter(n=>n.path!==".")),typeof r.filter=="function"&&(i=i.filter(r.filter)),typeof r.map=="function"&&(i=i.map(r.map)),t?Promise.all(i.map(n=>{let a=fr.join(t,n.path),o=n.mode&~process.umask(),s=new Date;return n.type==="directory"?mi(t).then(u=>Q.realpath(u)).then(u=>_i(a,u)).then(()=>Q.utimes(a,s,n.mtime)).then(()=>n):mi(t).then(u=>Q.realpath(u)).then(u=>_i(fr.dirname(a),u).then(()=>u)).then(u=>n.type==="file"?Gu(a,u):u).then(u=>Q.realpath(fr.dirname(a)).then(x=>{if(x.indexOf(u)!==0)throw new Error("Refusing to write outside output directory: "+x)})).then(()=>n.type==="link"||n.type==="symlink"&&process.platform==="win32"?Q.link(n.linkname,a):n.type==="symlink"?Q.symlink(n.linkname,a):Q.writeFile(a,n.data,{mode:o})).then(()=>n.type==="file"&&Q.utimes(a,s,n.mtime)).then(()=>n)})):i));is.exports=(e,t,r)=>typeof e!="string"&&!Buffer.isBuffer(e)?Promise.reject(new TypeError("Input file required")):(typeof t=="object"&&(r=t,t=null),r=Object.assign({plugins:[Lu(),ju(),Mu(),Uu()]},r),(typeof e=="string"?Q.readFile(e):Promise.resolve(e)).then(n=>Zu(n,t,r)))});var Vu={};hs(Vu,{AZUREAUTH_NAME:()=>vi,install:()=>fs});module.exports=ps(Vu);var Ye=gt(require("node:path"),1),de=gt(require("node:fs"),1),os=gt(Fi(),1),ss=gt(ns(),1),Yu="0.8.4";async function Ku(e,t){let r=new os.DownloaderHelper(e,t);return new Promise((i,n)=>{r.on("end",()=>i()),r.on("error",a=>n(a)),r.on("progress.throttled",a=>{let o=a.progress<100?a.progress.toPrecision(2):100;console.info(`Downloaded: ${o}%`)}),r.start()})}var _t=process.platform,as=process.arch,mt={name:"azureauth",url:"https://github.com/AzureAD/microsoft-authentication-cli/releases/download/",version:Yu},yi={def:"azureauth",win32:"azureauth.exe",linux:"azureauth.exe"},vi=_t in yi?yi[_t]:yi.def,fs=async()=>{let e=Ye.default.join(__dirname,"..","bin"),t=i=>{try{return de.default.existsSync(i)}catch{return!1}};if(de.default.existsSync(e)||(de.default.mkdirSync(e,{recursive:!0}),console.info(`${e} directory was created`)),t(Ye.default.join(e,"azureauth",vi))){console.log("azureauth is already installed");return}let r={win32:{x64:`azureauth-${mt.version}-win10-x64.zip`},darwin:{x64:`azureauth-${mt.version}-osx-x64.tar.gz`,arm64:`azureauth-${mt.version}-osx-arm64.tar.gz`}};if(_t in r){let i="";if(as in r[_t])i=r[_t][as];else throw new Error("Arch is not supported in azureauth");let n=`${mt.url}${mt.version}/${i}`,a=Ye.default.join(e,"azureauth"),o=Ye.default.join(e,i);console.log(`Downloading azureauth from ${n}`);try{await Ku(n,e)}catch(u){throw new Error(`Download failed: ${u.message}`)}console.log(`Downloaded in ${e}`),de.default.mkdirSync(a,{recursive:!0});let s=Ye.default.join(a,vi);await(0,ss.default)(o,a),t(s)&&(de.default.chmodSync(s,de.default.constants.S_IXUSR||64),de.default.chmodSync(s,493)),console.log(`Unzipped in ${o}`),de.default.unlinkSync(o)}};async function Xu(){for(let t=0;t<3;t++){try{await fs();break}catch(r){console.log(`Install failed: ${r.message}`)}if(t===2)throw new Error("Install failed after 3 attempts")}}Xu().catch(e=>{console.error(e),process.exit(1)});0&&(module.exports={AZUREAUTH_NAME,install});
6
+ /*! Bundled license information:
7
+
8
+ safe-buffer/index.js:
9
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
10
+
11
+ object-assign/index.js:
12
+ (*
13
+ object-assign
14
+ (c) Sindre Sorhus
15
+ @license MIT
16
+ *)
17
+
18
+ is-natural-number/index.js:
19
+ (*!
20
+ * is-natural-number.js | MIT (c) Shinnosuke Watanabe
21
+ * https://github.com/shinnn/is-natural-number.js
22
+ *)
23
+
24
+ strip-dirs/index.js:
25
+ (*!
26
+ * strip-dirs | MIT (c) Shinnosuke Watanabe
27
+ * https://github.com/shinnn/node-strip-dirs
28
+ *)
29
+ */
30
+ //# sourceMappingURL=install.cjs.map
package/package.json CHANGED
@@ -1,22 +1,31 @@
1
1
  {
2
2
  "name": "azureauth",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
4
4
  "description": "node-azure auth wrapps the AzureAuth CLI wrapper for performing AAD Authentication",
5
5
  "bin": {
6
- "azureauth": "./cli.js"
6
+ "azureauth": "./bin/cli.js"
7
7
  },
8
8
  "repository": {
9
- "url": "https://github.com/jcreamer898/node-azureauth"
9
+ "url": "https://github.com/microsoft/ado-npm-auth"
10
10
  },
11
- "main": "lib/index.js",
11
+ "main": "dist/index.js",
12
12
  "type": "module",
13
13
  "scripts": {
14
14
  "build": "tsc",
15
- "format": "prettier --write src/**/*.ts && prettier --write ./cli.js",
15
+ "bundle": "npm run bundleInstall && npm run bundleCli && npm run bundleIndex",
16
+ "bundleInstall": "esbuild --sourcemap --bundle --minify --platform=node --outfile=dist/install.cjs src/install.ts",
17
+ "bundleCli": "esbuild --sourcemap --bundle --minify --platform=node cli.js --outfile=dist/cli.cjs",
18
+ "bundleIndex": "esbuild --sourcemap --bundle --minify --platform=node --format=esm src/index.ts --outfile=dist/index.js",
19
+ "lint": "prettier --check src/**/*.ts ./cli.js ",
16
20
  "start": "tsc --watch",
17
- "test": "vitest src",
18
- "postinstall": "node ./scripts/install.js"
21
+ "test": "vitest run src",
22
+ "postinstall": "node ./scripts/install.cjs"
19
23
  },
24
+ "files": [
25
+ "dist/install.cjs",
26
+ "dist/cli.js",
27
+ "dist/index.js"
28
+ ],
20
29
  "keywords": [
21
30
  "node",
22
31
  "azureauth",
@@ -25,17 +34,17 @@
25
34
  "authentication"
26
35
  ],
27
36
  "author": "Jonathan Creamer",
28
- "license": "ISC",
29
- "dependencies": {
37
+ "license": "MIT",
38
+ "devDependencies": {
39
+ "@types/node": "^20.12.7",
40
+ "@types/decompress": "^4.2.7",
30
41
  "decompress": "^4.2.1",
42
+ "esbuild": "^0.23.1",
31
43
  "execa": "^7.2.0",
32
- "node-downloader-helper": "^2.1.9"
33
- },
34
- "devDependencies": {
35
- "@types/node": "^20.5.0",
36
- "prettier": "^3.0.2",
37
- "typescript": "^5.1.6",
38
- "vitest": "^0.34.1",
39
- "vite": "^4.4.9"
44
+ "node-downloader-helper": "^2.1.9",
45
+ "prettier": "^3.2.5",
46
+ "typescript": "^5.4.5",
47
+ "vitest": "^2.0.5",
48
+ "vite": "^5.2.8"
40
49
  }
41
50
  }
package/.prettierrc DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "tabWidth": 2
3
- }
package/cli.js DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import path from "node:path";
3
- import process from "node:process";
4
- import { execa } from "execa";
5
- import { fileURLToPath } from "url";
6
-
7
- const __dirname = fileURLToPath(new URL(".", import.meta.url));
8
-
9
- let azureauth = path.join(__dirname, "bin", "azureauth", "azureauth");
10
-
11
- if (process.platform === "win32") {
12
- azureauth = azureauth + ".exe";
13
- }
14
-
15
- execa(azureauth, process.argv.slice(2), { stdio: "inherit" });
package/examples/pat.js DELETED
@@ -1,14 +0,0 @@
1
- import { adoPat } from "../lib/index.js";
2
-
3
- const name = "feed-name";
4
-
5
- const pat = await adoPat({
6
- promptHint: `${name} .npmrc PAT`,
7
- organization: "your-organization-name-here",
8
- displayName: `${name}-npmrc-pat`,
9
- scope: ["vso.packaging"],
10
- timeout: "30",
11
- output: "json",
12
- });
13
-
14
- console.log(pat);
@@ -1,135 +0,0 @@
1
- import path from "path";
2
- import fs from "fs";
3
- import { DownloaderHelper } from "node-downloader-helper";
4
- import decompress from "decompress";
5
- import { fileURLToPath } from "url";
6
-
7
- const __dirname = fileURLToPath(new URL(".", import.meta.url));
8
- const AZURE_AUTH_VERSION = "0.8.4";
9
-
10
- async function download(url, saveDirectory) {
11
- const downloader = new DownloaderHelper(url, saveDirectory);
12
- return new Promise((resolve, reject) => {
13
- downloader.on("end", () => resolve());
14
- downloader.on("error", (err) => reject(err));
15
- downloader.on("progress.throttled", (downloadEvents) => {
16
- const percentageComplete =
17
- downloadEvents.progress < 100
18
- ? downloadEvents.progress.toPrecision(2)
19
- : 100;
20
- console.info(`Downloaded: ${percentageComplete}%`);
21
- });
22
- downloader.start();
23
- });
24
- }
25
-
26
- const platform = process.platform;
27
- const arch = process.arch;
28
-
29
- const AZUREAUTH_INFO = {
30
- name: "azureauth",
31
- // https://github.com/AzureAD/microsoft-authentication-cli/releases/download/${AZUREAUTH_INFO.version}/azureauth-${AZUREAUTH_INFO.version}-osx-arm64.tar.gz
32
- // https://github.com/AzureAD/microsoft-authentication-cli/releases/download/${AZUREAUTH_INFO.version}/azureauth-${AZUREAUTH_INFO.version}-osx-x64.tar.gz
33
- // https://github.com/AzureAD/microsoft-authentication-cli/releases/download/${AZUREAUTH_INFO.version}/azureauth-${AZUREAUTH_INFO.version}-win10-x64.zip
34
- url: "https://github.com/AzureAD/microsoft-authentication-cli/releases/download/",
35
- version: AZURE_AUTH_VERSION,
36
- };
37
-
38
- const AZUREAUTH_NAME_MAP = {
39
- def: "azureauth",
40
- win32: "azureauth.exe",
41
- linux: "azureauth.exe",
42
- };
43
-
44
- export const AZUREAUTH_NAME =
45
- platform in AZUREAUTH_NAME_MAP
46
- ? AZUREAUTH_NAME_MAP[platform]
47
- : AZUREAUTH_NAME_MAP.def;
48
-
49
- export const install = async () => {
50
- const OUTPUT_DIR = path.join(__dirname, "..", "bin");
51
- const fileExist = (path) => {
52
- try {
53
- return fs.existsSync(path);
54
- } catch (err) {
55
- return false;
56
- }
57
- };
58
-
59
- if (!fs.existsSync(OUTPUT_DIR)) {
60
- fs.mkdirSync(OUTPUT_DIR, { recursive: true });
61
- console.info(`${OUTPUT_DIR} directory was created`);
62
- }
63
-
64
- if (fileExist(path.join(OUTPUT_DIR, "azureauth", AZUREAUTH_NAME))) {
65
- console.log("azureauth is already installed");
66
- return;
67
- }
68
- // if platform is missing, download source instead of executable
69
- const DOWNLOAD_MAP = {
70
- win32: {
71
- x64: `azureauth-${AZUREAUTH_INFO.version}-win10-x64.zip`,
72
- },
73
- darwin: {
74
- x64: `azureauth-${AZUREAUTH_INFO.version}-osx-x64.tar.gz`,
75
- arm64: `azureauth-${AZUREAUTH_INFO.version}-osx-arm64.tar.gz`,
76
- },
77
- // TODO: support linux when the binaries are available
78
- // linux: {
79
- // def: "azureauth.exe",
80
- // x64: "azureauth-${AZUREAUTH_INFO.version}-win10-x64.zip",
81
- // },
82
- };
83
- if (platform in DOWNLOAD_MAP) {
84
- // download the executable
85
- let filename = "";
86
- if (arch in DOWNLOAD_MAP[platform]) {
87
- filename = DOWNLOAD_MAP[platform][arch];
88
- } else {
89
- throw new Error("Arch is not supported in azureauth");
90
- }
91
- const url = `${AZUREAUTH_INFO.url}${AZUREAUTH_INFO.version}/${filename}`;
92
- const distPath = path.join(OUTPUT_DIR, "azureauth");
93
- const archivePath = path.join(OUTPUT_DIR, filename);
94
-
95
- console.log(`Downloading azureauth from ${url}`);
96
- try {
97
- await download(url, OUTPUT_DIR);
98
- } catch (err) {
99
- throw new Error(`Download failed: ${err.message}`);
100
- }
101
- console.log(`Downloaded in ${OUTPUT_DIR}`);
102
-
103
- // Make a dir to uncompress the zip or tar into
104
- fs.mkdirSync(distPath, {
105
- recursive: true,
106
- });
107
-
108
- const binaryPath = path.join(distPath, AZUREAUTH_NAME);
109
-
110
- await decompress(archivePath, distPath);
111
-
112
- if (fileExist(binaryPath)) {
113
- fs.chmodSync(binaryPath, fs.constants.S_IXUSR || 0o100);
114
- // Huan(202111): we need the read permission so that the build system can pack the node_modules/ folder,
115
- // i.e. build with Heroku CI/CD, docker build, etc.
116
- fs.chmodSync(binaryPath, 0o755);
117
- }
118
-
119
- console.log(`Unzipped in ${archivePath}`);
120
- fs.unlinkSync(archivePath);
121
- }
122
- };
123
-
124
- const MAX_RETRIES = 3;
125
- for (let i = 0; i < MAX_RETRIES; i++) {
126
- try {
127
- await install();
128
- break; // success, so exit the loop
129
- } catch (err) {
130
- console.log(`Install failed: ${err.message}`);
131
- }
132
- if (i === MAX_RETRIES - 1) {
133
- throw new Error(`Install failed after ${MAX_RETRIES} attempts`);
134
- }
135
- }
package/tsconfig.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "ESNext",
4
- "composite": true,
5
- "target": "ES2019",
6
- "rootDir": "src",
7
- "outDir": "lib",
8
- "incremental": true,
9
- "tsBuildInfoFile": "lib/.tsbuildinfo",
10
- "lib": ["ES2019", "dom"],
11
- "jsx": "react",
12
- "declaration": true,
13
- "declarationMap": true,
14
- "sourceMap": true,
15
- "experimentalDecorators": true,
16
- "moduleResolution": "node",
17
- "strict": true,
18
- "noFallthroughCasesInSwitch": true,
19
- "noImplicitReturns": true,
20
- "noUnusedLocals": true,
21
- "noUnusedParameters": true,
22
- "forceConsistentCasingInFileNames": true,
23
- "importHelpers": true,
24
- "esModuleInterop": true,
25
- "downlevelIteration": true
26
- },
27
- "include": ["./src"],
28
- "references": []
29
- }