stacktape 1.0.0-alpha.66 → 1.0.0-alpha.67

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/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- var hJr=Object.create;var mA=Object.defineProperty,yJr=Object.defineProperties,G9e=Object.getOwnPropertyDescriptor,wJr=Object.getOwnPropertyDescriptors,vJr=Object.getOwnPropertyNames,YO=Object.getOwnPropertySymbols,_Jr=Object.getPrototypeOf,Rwe=Object.prototype.hasOwnProperty,H9e=Object.prototype.propertyIsEnumerable;var V9e=(e,t,r)=>t in e?mA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t||(t={}))Rwe.call(t,r)&&V9e(e,r,t[r]);if(YO)for(var r of YO(t))H9e.call(t,r)&&V9e(e,r,t[r]);return e},f=(e,t)=>yJr(e,wJr(t)),X9e=e=>mA(e,"__esModule",{value:!0});var Cgo=typeof require!="undefined"?require:e=>{throw new Error('Dynamic require of "'+e+'" is not supported')};var Ki=(e,t)=>{var r={};for(var n in e)Rwe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&YO)for(var n of YO(e))t.indexOf(n)<0&&H9e.call(e,n)&&(r[n]=e[n]);return r};var Te=(e,t)=>()=>(e&&(t=e(e=0)),t);var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ra=(e,t)=>{X9e(e);for(var r in t)mA(e,r,{get:t[r],enumerable:!0})},bJr=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of vJr(t))!Rwe.call(e,n)&&n!=="default"&&mA(e,n,{get:()=>t[n],enumerable:!(r=G9e(t,n))||r.enumerable});return e},At=e=>bJr(X9e(mA(e!=null?hJr(_Jr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Fv=(e,t,r,n)=>{for(var i=n>1?void 0:n?G9e(t,r):t,s=e.length-1,a;s>=0;s--)(a=e[s])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&mA(t,r,i),i};var SJr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var jm=(e,t,r)=>(SJr(e,t,"read from private field"),r?r.call(e):t.get(e)),jv=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)};var W9e=g((Ago,kwe)=>{"use strict";var CJr=e=>{let t=!1,r=!1,n=!1;for(let i=0;i<e.length;i++){let s=e[i];t&&/[a-zA-Z]/.test(s)&&s.toUpperCase()===s?(e=e.slice(0,i)+"-"+e.slice(i),t=!1,n=r,r=!0,i++):r&&n&&/[a-zA-Z]/.test(s)&&s.toLowerCase()===s?(e=e.slice(0,i-1)+"-"+e.slice(i-1),n=r,r=!1,t=!0):(t=s.toLowerCase()===s&&s.toUpperCase()!==s,n=r,r=s.toUpperCase()===s&&s.toLowerCase()!==s)}return e},K9e=(e,t)=>{if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);let r=i=>t.pascalCase?i.charAt(0).toUpperCase()+i.slice(1):i;return Array.isArray(e)?e=e.map(i=>i.trim()).filter(i=>i.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=CJr(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(i,s)=>s.toUpperCase()).replace(/\d+(\w|$)/g,i=>i.toUpperCase()),r(e))};kwe.exports=K9e;kwe.exports.default=K9e});var Twe=g((Pgo,Q9e)=>{"use strict";Q9e.exports=function(e,t){if(typeof e!="string")throw new TypeError("Expected a string");return t=typeof t=="undefined"?"_":t,e.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+t+"$2").toLowerCase()}});var Z9e=g((xgo,Y9e)=>{Y9e.exports=function(e){if(Array.isArray(e))return e.map(a=>typeof a!="string"?a+"":a);e=e.trim();let t=0,r=null,n=null,i=null,s=[];for(let a=0;a<e.length;a++){if(r=n,n=e.charAt(a),n===" "&&!i){r!==" "&&t++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[t]||(s[t]=""),s[t]+=n}return s}});var aq=g((Rgo,r7e)=>{var ZO=W9e(),EJr=Twe(),JO=require("path"),AJr=Z9e(),PJr=require("util");function J9e(e,t){t=Object.assign(Object.create(null),t),e=AJr(e);let r=xJr(Object.assign(Object.create(null),t.alias)),n=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},t.configuration),i=Object.assign(Object.create(null),t.default),s=t.configObjects||[],a=t.envPrefix,o=n["populate--"],c=o?"--":"_",l=Object.create(null),u=Object.create(null),m=t.__||PJr.format,p={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},h=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,y=new RegExp("^--"+n["negation-prefix"]+"(.+)");[].concat(t.array).filter(Boolean).forEach(function(z){let Q=z.key||z,ge=Object.keys(z).map(function(xe){return{boolean:"bools",string:"strings",number:"numbers"}[xe]}).filter(Boolean).pop();ge&&(p[ge][Q]=!0),p.arrays[Q]=!0,p.keys.push(Q)}),[].concat(t.boolean).filter(Boolean).forEach(function(z){p.bools[z]=!0,p.keys.push(z)}),[].concat(t.string).filter(Boolean).forEach(function(z){p.strings[z]=!0,p.keys.push(z)}),[].concat(t.number).filter(Boolean).forEach(function(z){p.numbers[z]=!0,p.keys.push(z)}),[].concat(t.count).filter(Boolean).forEach(function(z){p.counts[z]=!0,p.keys.push(z)}),[].concat(t.normalize).filter(Boolean).forEach(function(z){p.normalize[z]=!0,p.keys.push(z)}),Object.keys(t.narg||{}).forEach(function(z){p.nargs[z]=t.narg[z],p.keys.push(z)}),Object.keys(t.coerce||{}).forEach(function(z){p.coercions[z]=t.coerce[z],p.keys.push(z)}),Array.isArray(t.config)||typeof t.config=="string"?[].concat(t.config).filter(Boolean).forEach(function(z){p.configs[z]=!0}):Object.keys(t.config||{}).forEach(function(z){p.configs[z]=t.config[z]}),We(t.key,r,t.default,p.arrays),Object.keys(i).forEach(function(z){(p.aliases[z]||[]).forEach(function(Q){i[Q]=i[z]})});let w=null;Rr();let v=[],b=Object.assign(Object.create(null),{_:[]}),A={};for(let z=0;z<e.length;z++){let Q=e[z],ge,xe,je,jt,mr,si;if(Q!=="--"&&ct(Q))b._.push(Q);else if(Q.match(/^--.+=/)||!n["short-option-groups"]&&Q.match(/^-.+=/))jt=Q.match(/^--?([^=]+)=([\s\S]*)$/),nt(jt[1],p.arrays)?z=R(z,jt[1],e,jt[2]):nt(jt[1],p.nargs)!==!1?z=I(z,jt[1],e,jt[2]):F(jt[1],jt[2]);else if(Q.match(y)&&n["boolean-negation"])xe=Q.match(y)[1],F(xe,nt(xe,p.arrays)?[!1]:!1);else if(Q.match(/^--.+/)||!n["short-option-groups"]&&Q.match(/^-[^-]+/))xe=Q.match(/^--?(.+)/)[1],nt(xe,p.arrays)?z=R(z,xe,e):nt(xe,p.nargs)!==!1?z=I(z,xe,e):(mr=e[z+1],mr!==void 0&&(!mr.match(/^-/)||mr.match(h))&&!nt(xe,p.bools)&&!nt(xe,p.counts)||/^(true|false)$/.test(mr)?(F(xe,mr),z++):F(xe,ur(xe)));else if(Q.match(/^-.\..+=/))jt=Q.match(/^-([^=]+)=([\s\S]*)$/),F(jt[1],jt[2]);else if(Q.match(/^-.\..+/)&&!Q.match(h))mr=e[z+1],xe=Q.match(/^-(.\..+)/)[1],mr!==void 0&&!mr.match(/^-/)&&!nt(xe,p.bools)&&!nt(xe,p.counts)?(F(xe,mr),z++):F(xe,ur(xe));else if(Q.match(/^-[^-]+/)&&!Q.match(h)){je=Q.slice(1,-1).split(""),ge=!1;for(let Qn=0;Qn<je.length;Qn++){if(mr=Q.slice(Qn+2),je[Qn+1]&&je[Qn+1]==="="){si=Q.slice(Qn+3),xe=je[Qn],nt(xe,p.arrays)?z=R(z,xe,e,si):nt(xe,p.nargs)!==!1?z=I(z,xe,e,si):F(xe,si),ge=!0;break}if(mr==="-"){F(je[Qn],mr);continue}if(/[A-Za-z]/.test(je[Qn])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(mr)){F(je[Qn],mr),ge=!0;break}if(je[Qn+1]&&je[Qn+1].match(/\W/)){F(je[Qn],mr),ge=!0;break}else F(je[Qn],ur(je[Qn]))}xe=Q.slice(-1)[0],!ge&&xe!=="-"&&(nt(xe,p.arrays)?z=R(z,xe,e):nt(xe,p.nargs)!==!1?z=I(z,xe,e):(mr=e[z+1],mr!==void 0&&(!/^(-|--)[^-]/.test(mr)||mr.match(h))&&!nt(xe,p.bools)&&!nt(xe,p.counts)||/^(true|false)$/.test(mr)?(F(xe,mr),z++):F(xe,ur(xe))))}else if(Q.match(/^-[0-9]$/)&&Q.match(h)&&nt(Q.slice(1),p.bools))xe=Q.slice(1),F(xe,ur(xe));else if(Q==="--"){v=e.slice(z+1);break}else if(n["halt-at-non-option"]){v=e.slice(z);break}else b._.push(H("_",Q))}ie(b,!0),ie(b,!1),ae(b),D(),B(b,p.aliases,i,!0),re(b),n["set-placeholder-key"]&&Pe(b),Object.keys(p.counts).forEach(function(z){ee(b,z.split("."))||F(z,0)}),o&&v.length&&(b[c]=[]),v.forEach(function(z){b[c].push(z)}),n["camel-case-expansion"]&&n["strip-dashed"]&&Object.keys(b).filter(z=>z!=="--"&&z.includes("-")).forEach(z=>{delete b[z]}),n["strip-aliased"]&&[].concat(...Object.keys(r).map(z=>r[z])).forEach(z=>{n["camel-case-expansion"]&&delete b[z.split(".").map(Q=>ZO(Q)).join(".")],delete b[z]});function I(z,Q,ge,xe){let je,jt=nt(Q,p.nargs);if(jt=isNaN(jt)?1:jt,jt===0)return Ue(xe)||(w=Error(m("Argument unexpected for: %s",Q))),F(Q,ur(Q)),z;let mr=Ue(xe)?0:1;if(n["nargs-eats-options"])ge.length-(z+1)+mr<jt&&(w=Error(m("Not enough arguments following: %s",Q))),mr=jt;else{for(je=z+1;je<ge.length&&(!ge[je].match(/^-[^0-9]/)||ge[je].match(h)||ct(ge[je]));je++)mr++;mr<jt&&(w=Error(m("Not enough arguments following: %s",Q)))}let si=Math.min(mr,jt);for(!Ue(xe)&&si>0&&(F(Q,xe),si--),je=z+1;je<si+z+1;je++)F(Q,ge[je]);return z+si}function R(z,Q,ge,xe){let je=[],jt=xe||ge[z+1],mr=nt(Q,p.nargs);if(nt(Q,p.bools)&&!/^(true|false)$/.test(jt))je.push(!0);else if(Ue(jt)||Ue(xe)&&/^-/.test(jt)&&!h.test(jt)&&!ct(jt)){if(i[Q]!==void 0){let si=i[Q];je=Array.isArray(si)?si:[si]}}else{Ue(xe)||je.push(X(Q,xe));for(let si=z+1;si<ge.length&&!(!n["greedy-arrays"]&&je.length>0||mr&&je.length>=mr||(jt=ge[si],/^-/.test(jt)&&!h.test(jt)&&!ct(jt)));si++)z=si,je.push(X(Q,jt))}return(mr&&je.length<mr||isNaN(mr)&&je.length===0)&&(w=Error(m("Not enough arguments following: %s",Q))),F(Q,je),z}function F(z,Q){if(/-/.test(z)&&n["camel-case-expansion"]){let je=z.split(".").map(function(jt){return ZO(jt)}).join(".");J(z,je)}let ge=X(z,Q),xe=z.split(".");Ge(b,xe,ge),p.aliases[z]&&p.aliases[z].forEach(function(je){je=je.split("."),Ge(b,je,ge)}),xe.length>1&&n["dot-notation"]&&(p.aliases[xe[0]]||[]).forEach(function(je){je=je.split(".");let jt=[].concat(xe);jt.shift(),je=je.concat(jt),(p.aliases[z]||[]).includes(je.join("."))||Ge(b,je,ge)}),nt(z,p.normalize)&&!nt(z,p.arrays)&&[z].concat(p.aliases[z]||[]).forEach(function(jt){Object.defineProperty(A,jt,{enumerable:!0,get(){return Q},set(mr){Q=typeof mr=="string"?JO.normalize(mr):mr}})})}function J(z,Q){p.aliases[z]&&p.aliases[z].length||(p.aliases[z]=[Q],l[Q]=!0),p.aliases[Q]&&p.aliases[Q].length||J(Q,z)}function X(z,Q){typeof Q=="string"&&(Q[0]==="'"||Q[0]==='"')&&Q[Q.length-1]===Q[0]&&(Q=Q.substring(1,Q.length-1)),(nt(z,p.bools)||nt(z,p.counts))&&typeof Q=="string"&&(Q=Q==="true");let ge=Array.isArray(Q)?Q.map(function(xe){return H(z,xe)}):H(z,Q);return nt(z,p.counts)&&(Ue(ge)||typeof ge=="boolean")&&(ge=Iwe),nt(z,p.normalize)&&nt(z,p.arrays)&&(Array.isArray(Q)?ge=Q.map(JO.normalize):ge=JO.normalize(Q)),ge}function H(z,Q){return!nt(z,p.strings)&&!nt(z,p.bools)&&!Array.isArray(Q)&&(Nr(Q)&&n["parse-numbers"]&&Number.isSafeInteger(Math.floor(Q))||!Ue(Q)&&nt(z,p.numbers))&&(Q=Number(Q)),Q}function ae(z){let Q=Object.create(null);B(Q,p.aliases,i),Object.keys(p.configs).forEach(function(ge){let xe=z[ge]||Q[ge];if(xe)try{let je=null,jt=JO.resolve(process.cwd(),xe);if(typeof p.configs[ge]=="function"){try{je=p.configs[ge](jt)}catch(mr){je=mr}if(je instanceof Error){w=je;return}}else je=require(jt);le(je)}catch(je){z[ge]&&(w=Error(m("Invalid JSON config file: %s",xe)))}})}function le(z,Q){Object.keys(z).forEach(function(ge){let xe=z[ge],je=Q?Q+"."+ge:ge;typeof xe=="object"&&xe!==null&&!Array.isArray(xe)&&n["dot-notation"]?le(xe,je):(!ee(b,je.split("."))||nt(je,p.arrays)&&n["combine-arrays"])&&F(je,xe)})}function D(){typeof s!="undefined"&&s.forEach(function(z){le(z)})}function ie(z,Q){if(typeof a=="undefined")return;let ge=typeof a=="string"?a:"";Object.keys(process.env).forEach(function(xe){if(ge===""||xe.lastIndexOf(ge,0)===0){let je=xe.split("__").map(function(jt,mr){return mr===0&&(jt=jt.substring(ge.length)),ZO(jt)});(Q&&p.configs[je.join(".")]||!Q)&&!ee(z,je)&&F(je.join("."),process.env[xe])}})}function re(z){let Q,ge=new Set;Object.keys(z).forEach(function(xe){if(!ge.has(xe)&&(Q=nt(xe,p.coercions),typeof Q=="function"))try{let je=H(xe,Q(z[xe]));[].concat(p.aliases[xe]||[],xe).forEach(jt=>{ge.add(jt),z[jt]=je})}catch(je){w=je}})}function Pe(z){return p.keys.forEach(Q=>{~Q.indexOf(".")||typeof z[Q]=="undefined"&&(z[Q]=void 0)}),z}function B(z,Q,ge,xe=!1){Object.keys(ge).forEach(function(je){ee(z,je.split("."))||(Ge(z,je.split("."),ge[je]),xe&&(u[je]=!0),(Q[je]||[]).forEach(function(jt){ee(z,jt.split("."))||Ge(z,jt.split("."),ge[je])}))})}function ee(z,Q){let ge=z;n["dot-notation"]||(Q=[Q.join(".")]),Q.slice(0,-1).forEach(function(je){ge=ge[je]||{}});let xe=Q[Q.length-1];return typeof ge!="object"?!1:xe in ge}function Ge(z,Q,ge){let xe=z;n["dot-notation"]||(Q=[Q.join(".")]),Q.slice(0,-1).forEach(function(Qn,Xi){Qn=t7e(Qn),typeof xe=="object"&&xe[Qn]===void 0&&(xe[Qn]={}),typeof xe[Qn]!="object"||Array.isArray(xe[Qn])?(Array.isArray(xe[Qn])?xe[Qn].push({}):xe[Qn]=[xe[Qn],{}],xe=xe[Qn][xe[Qn].length-1]):xe=xe[Qn]});let je=t7e(Q[Q.length-1]),jt=nt(Q.join("."),p.arrays),mr=Array.isArray(ge),si=n["duplicate-arguments-array"];!si&&nt(je,p.nargs)&&(si=!0,(!Ue(xe[je])&&p.nargs[je]===1||Array.isArray(xe[je])&&xe[je].length===p.nargs[je])&&(xe[je]=void 0)),ge===Iwe?xe[je]=Iwe(xe[je]):Array.isArray(xe[je])?si&&jt&&mr?xe[je]=n["flatten-duplicate-arrays"]?xe[je].concat(ge):(Array.isArray(xe[je][0])?xe[je]:[xe[je]]).concat([ge]):!si&&Boolean(jt)===Boolean(mr)?xe[je]=ge:xe[je]=xe[je].concat([ge]):xe[je]===void 0&&jt?xe[je]=mr?ge:[ge]:si&&!(xe[je]===void 0||nt(je,p.counts)||nt(je,p.bools))?xe[je]=[xe[je],ge]:xe[je]=ge}function We(...z){z.forEach(function(Q){Object.keys(Q||{}).forEach(function(ge){p.aliases[ge]||(p.aliases[ge]=[].concat(r[ge]||[]),p.aliases[ge].concat(ge).forEach(function(xe){if(/-/.test(xe)&&n["camel-case-expansion"]){let je=ZO(xe);je!==ge&&p.aliases[ge].indexOf(je)===-1&&(p.aliases[ge].push(je),l[je]=!0)}}),p.aliases[ge].concat(ge).forEach(function(xe){if(xe.length>1&&/[A-Z]/.test(xe)&&n["camel-case-expansion"]){let je=EJr(xe,"-");je!==ge&&p.aliases[ge].indexOf(je)===-1&&(p.aliases[ge].push(je),l[je]=!0)}}),p.aliases[ge].forEach(function(xe){p.aliases[xe]=[ge].concat(p.aliases[ge].filter(function(je){return xe!==je}))}))})})}function nt(z,Q){let ge=[].concat(p.aliases[z]||[],z),xe=Object.keys(Q),je=ge.find(jt=>xe.includes(jt));return je?Q[je]:!1}function Tt(z){return[].concat(Object.keys(p).map(ge=>p[ge])).some(function(ge){return Array.isArray(ge)?ge.includes(z):ge[z]})}function qt(z,...Q){return[].concat(...Q).some(function(xe){let je=z.match(xe);return je&&Tt(je[1])})}function er(z){if(z.match(h)||!z.match(/^-[^-]+/))return!1;let Q=!0,ge,xe=z.slice(1).split("");for(let je=0;je<xe.length;je++){if(ge=z.slice(je+2),!Tt(xe[je])){Q=!1;break}if(xe[je+1]&&xe[je+1]==="="||ge==="-"||/[A-Za-z]/.test(xe[je])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(ge)||xe[je+1]&&xe[je+1].match(/\W/))break}return Q}function ct(z){return n["unknown-options-as-args"]&&ft(z)}function ft(z){return z.match(h)||er(z)?!1:!qt(z,/^-+([^=]+?)=[\s\S]*$/,y,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ur(z){return!nt(z,p.bools)&&!nt(z,p.counts)&&`${z}`in i?i[z]:pt(sr(z))}function pt(z){return{boolean:!0,string:"",number:void 0,array:[]}[z]}function sr(z){let Q="boolean";return nt(z,p.strings)?Q="string":nt(z,p.numbers)?Q="number":nt(z,p.bools)?Q="boolean":nt(z,p.arrays)&&(Q="array"),Q}function Nr(z){return z==null?!1:typeof z=="number"||/^0x[0-9a-f]+$/i.test(z)?!0:z.length>1&&z[0]==="0"?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(z)}function Ue(z){return z===void 0}function Rr(){Object.keys(p.counts).find(z=>{if(nt(z,p.arrays))return w=Error(m("Invalid configuration: %s, opts.count excludes opts.array.",z)),!0;if(nt(z,p.nargs))return w=Error(m("Invalid configuration: %s, opts.count excludes opts.narg.",z)),!0})}return{argv:Object.assign(A,b),error:w,aliases:Object.assign({},p.aliases),newAliases:Object.assign({},l),defaulted:Object.assign({},u),configuration:n}}function xJr(e){let t=[],r=Object.create(null),n=!0;for(Object.keys(e).forEach(function(i){t.push([].concat(e[i],i))});n;){n=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(o){return t[s].indexOf(o)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),n=!0;break}}return t.forEach(function(i){i=i.filter(function(s,a,o){return o.indexOf(s)===a}),r[i.pop()]=i}),r}function Iwe(e){return e!==void 0?e+1:1}function e7e(e,t){return J9e(e.slice(),t).argv}e7e.detailed=function(e,t){return J9e(e.slice(),t)};function t7e(e){return e==="__proto__"?"___proto___":e}r7e.exports=e7e});var eF,bd,tF,n7e,i7e,s7e,a7e,oq,o7e,c7e,qwe,Dwe,Nwe,l7e,d7e,u7e,$l,Bm,rF,Wb,Lwe,m7e,Bv,Mwe,f7e,cq,lq,p7e,nF,g7e,Uv,h7e,iF,y7e,iu,ua=Te(()=>{eF=["stacktape.yaml","stacktape.yml","stacktape.json","stacktape.ini","stacktape.js","stacktape.ts","stacktape.py"],bd=process.env.DEV_MODE==="true",tF={js:["nodejs14.x","nodejs12.x","nodejs10.x"],ts:["nodejs14.x","nodejs12.x","nodejs10.x"],jsx:["nodejs14.x","nodejs12.x","nodejs10.x"],tsx:["nodejs14.x","nodejs12.x","nodejs10.x"],py:["python3.8","python3.7","python3.6","python2.7"],java:["java11","java8"],rb:["ruby2.5"],go:["go1.x"],cs:["dotnetcore2.1"]},n7e=["js","ts","ts","tsx"],i7e=["js","ts","py"],s7e="stacktape-infrastructure-modules",a7e="eu-west-1",oq="14.17.0",o7e={"nodejs14.x":oq,"nodejs12.x":"12.18.3","nodejs10.x":"10.16.3","nodejs8.10":"8.10"},c7e="https://prod-telemetry.stacktape-dev.com/telemetry",qwe=3,Dwe=["deploy","delete","rollback","init","print-logs","print-config","describe-stack","invoke-local","invoke-cloud","credentials-create","credentials-update","credentials-delete","secret-create","secret-get","secret-delete","userpool-create-user","userpool-get-token","domain-add","compile-template","package-workloads","preview-changes","update-module","sync-bucket","configure-defaults","version","help"],Nwe=4,l7e=800,d7e=10,u7e=10,$l=["profile","region","stage","logFormat","logLevel"],Bm=["configPath","currentWorkingDirectory"],rF={deploy:[...$l,...Bm,"disableDriftDetection","preserveTempFiles","maxThreads","autoConfirmChanges","dockerArgs","mode","noCache"],"invoke-local":[...$l,...Bm,"watch","workload","logOutput","event","jsonEvent","ignoreMissingOutput","preserveTempFiles","port","eventName","nativeExecutable","dockerArgs"],"package-workloads":[...$l,...Bm,"maxThreads"],"print-config":[...$l,...Bm],delete:[...$l,...Bm,"emptyBuckets"],"describe-stack":[...$l,...Bm],help:["command"],version:[],"domain-add":[...$l,"profile","region"],"update-module":["profile","region"],"secret-create":[...$l,"profile","region"],"secret-delete":[...$l,"profile","region"],"secret-get":[...$l,"profile","region"],"credentials-create":[],"credentials-update":[],"credentials-delete":[],rollback:[...$l,"version",...Bm],"compile-template":[...$l,...Bm,"templatePath","preserveTempFiles"],"preview-changes":[...$l,...Bm,"preserveTempFiles"],"print-logs":[...$l,...Bm,"resource","startTime","filter","raw"],init:["projectId"],"userpool-create-user":[...$l,...Bm,"userPoolName"],"userpool-get-token":[...$l,...Bm,"userPoolName","tokenType"],"sync-bucket":["profile","region","logFormat","logLevel","bucketName","sourcePath"],"configure-defaults":[],"invoke-cloud":[]},Wb={event:"e",jsonEvent:"je",stage:"s",configPath:"cp",profile:"p",disableDriftDetection:"ddd",preserveTempFiles:"ptf",region:"r",workload:"wl",resource:"res",watch:"w",logOutput:"lo",command:"cmd",ignoreMissingOutput:"imo",port:"pt",maxThreads:"mt",logFormat:"lf",logLevel:"ll",autoConfirmChanges:"acc",version:"v",templatePath:"tp",filter:"f",startTime:"st",raw:"rw",eventName:"en",nativeExecutable:"ne",dockerArgs:"da",mode:"md",userPoolName:"upn",tokenType:"tt",sourcePath:"sp",bucketName:"bn",currentWorkingDirectory:"cwd",noCache:"nc",emptyBuckets:"eb",projectId:"pi"},Lwe={deploy:`Deploys stack with specified stage to AWS.
1
+ var hJr=Object.create;var mA=Object.defineProperty,yJr=Object.defineProperties,G9e=Object.getOwnPropertyDescriptor,wJr=Object.getOwnPropertyDescriptors,vJr=Object.getOwnPropertyNames,YO=Object.getOwnPropertySymbols,_Jr=Object.getPrototypeOf,Rwe=Object.prototype.hasOwnProperty,H9e=Object.prototype.propertyIsEnumerable;var V9e=(e,t,r)=>t in e?mA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var r in t||(t={}))Rwe.call(t,r)&&V9e(e,r,t[r]);if(YO)for(var r of YO(t))H9e.call(t,r)&&V9e(e,r,t[r]);return e},f=(e,t)=>yJr(e,wJr(t)),X9e=e=>mA(e,"__esModule",{value:!0});var Cgo=typeof require!="undefined"?require:e=>{throw new Error('Dynamic require of "'+e+'" is not supported')};var Ki=(e,t)=>{var r={};for(var n in e)Rwe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&YO)for(var n of YO(e))t.indexOf(n)<0&&H9e.call(e,n)&&(r[n]=e[n]);return r};var Te=(e,t)=>()=>(e&&(t=e(e=0)),t);var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ra=(e,t)=>{X9e(e);for(var r in t)mA(e,r,{get:t[r],enumerable:!0})},bJr=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of vJr(t))!Rwe.call(e,n)&&n!=="default"&&mA(e,n,{get:()=>t[n],enumerable:!(r=G9e(t,n))||r.enumerable});return e},At=e=>bJr(X9e(mA(e!=null?hJr(_Jr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Fv=(e,t,r,n)=>{for(var i=n>1?void 0:n?G9e(t,r):t,s=e.length-1,a;s>=0;s--)(a=e[s])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&mA(t,r,i),i};var SJr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var jm=(e,t,r)=>(SJr(e,t,"read from private field"),r?r.call(e):t.get(e)),jv=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)};var W9e=g((Ago,kwe)=>{"use strict";var CJr=e=>{let t=!1,r=!1,n=!1;for(let i=0;i<e.length;i++){let s=e[i];t&&/[a-zA-Z]/.test(s)&&s.toUpperCase()===s?(e=e.slice(0,i)+"-"+e.slice(i),t=!1,n=r,r=!0,i++):r&&n&&/[a-zA-Z]/.test(s)&&s.toLowerCase()===s?(e=e.slice(0,i-1)+"-"+e.slice(i-1),n=r,r=!1,t=!0):(t=s.toLowerCase()===s&&s.toUpperCase()!==s,n=r,r=s.toUpperCase()===s&&s.toLowerCase()!==s)}return e},K9e=(e,t)=>{if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);let r=i=>t.pascalCase?i.charAt(0).toUpperCase()+i.slice(1):i;return Array.isArray(e)?e=e.map(i=>i.trim()).filter(i=>i.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=CJr(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(i,s)=>s.toUpperCase()).replace(/\d+(\w|$)/g,i=>i.toUpperCase()),r(e))};kwe.exports=K9e;kwe.exports.default=K9e});var Twe=g((Pgo,Q9e)=>{"use strict";Q9e.exports=function(e,t){if(typeof e!="string")throw new TypeError("Expected a string");return t=typeof t=="undefined"?"_":t,e.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+t+"$2").toLowerCase()}});var Z9e=g((xgo,Y9e)=>{Y9e.exports=function(e){if(Array.isArray(e))return e.map(a=>typeof a!="string"?a+"":a);e=e.trim();let t=0,r=null,n=null,i=null,s=[];for(let a=0;a<e.length;a++){if(r=n,n=e.charAt(a),n===" "&&!i){r!==" "&&t++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[t]||(s[t]=""),s[t]+=n}return s}});var aq=g((Rgo,r7e)=>{var ZO=W9e(),EJr=Twe(),JO=require("path"),AJr=Z9e(),PJr=require("util");function J9e(e,t){t=Object.assign(Object.create(null),t),e=AJr(e);let r=xJr(Object.assign(Object.create(null),t.alias)),n=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},t.configuration),i=Object.assign(Object.create(null),t.default),s=t.configObjects||[],a=t.envPrefix,o=n["populate--"],c=o?"--":"_",l=Object.create(null),u=Object.create(null),m=t.__||PJr.format,p={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},h=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,y=new RegExp("^--"+n["negation-prefix"]+"(.+)");[].concat(t.array).filter(Boolean).forEach(function(z){let Q=z.key||z,ge=Object.keys(z).map(function(xe){return{boolean:"bools",string:"strings",number:"numbers"}[xe]}).filter(Boolean).pop();ge&&(p[ge][Q]=!0),p.arrays[Q]=!0,p.keys.push(Q)}),[].concat(t.boolean).filter(Boolean).forEach(function(z){p.bools[z]=!0,p.keys.push(z)}),[].concat(t.string).filter(Boolean).forEach(function(z){p.strings[z]=!0,p.keys.push(z)}),[].concat(t.number).filter(Boolean).forEach(function(z){p.numbers[z]=!0,p.keys.push(z)}),[].concat(t.count).filter(Boolean).forEach(function(z){p.counts[z]=!0,p.keys.push(z)}),[].concat(t.normalize).filter(Boolean).forEach(function(z){p.normalize[z]=!0,p.keys.push(z)}),Object.keys(t.narg||{}).forEach(function(z){p.nargs[z]=t.narg[z],p.keys.push(z)}),Object.keys(t.coerce||{}).forEach(function(z){p.coercions[z]=t.coerce[z],p.keys.push(z)}),Array.isArray(t.config)||typeof t.config=="string"?[].concat(t.config).filter(Boolean).forEach(function(z){p.configs[z]=!0}):Object.keys(t.config||{}).forEach(function(z){p.configs[z]=t.config[z]}),We(t.key,r,t.default,p.arrays),Object.keys(i).forEach(function(z){(p.aliases[z]||[]).forEach(function(Q){i[Q]=i[z]})});let w=null;Rr();let v=[],b=Object.assign(Object.create(null),{_:[]}),A={};for(let z=0;z<e.length;z++){let Q=e[z],ge,xe,je,jt,mr,si;if(Q!=="--"&&ct(Q))b._.push(Q);else if(Q.match(/^--.+=/)||!n["short-option-groups"]&&Q.match(/^-.+=/))jt=Q.match(/^--?([^=]+)=([\s\S]*)$/),nt(jt[1],p.arrays)?z=R(z,jt[1],e,jt[2]):nt(jt[1],p.nargs)!==!1?z=I(z,jt[1],e,jt[2]):F(jt[1],jt[2]);else if(Q.match(y)&&n["boolean-negation"])xe=Q.match(y)[1],F(xe,nt(xe,p.arrays)?[!1]:!1);else if(Q.match(/^--.+/)||!n["short-option-groups"]&&Q.match(/^-[^-]+/))xe=Q.match(/^--?(.+)/)[1],nt(xe,p.arrays)?z=R(z,xe,e):nt(xe,p.nargs)!==!1?z=I(z,xe,e):(mr=e[z+1],mr!==void 0&&(!mr.match(/^-/)||mr.match(h))&&!nt(xe,p.bools)&&!nt(xe,p.counts)||/^(true|false)$/.test(mr)?(F(xe,mr),z++):F(xe,ur(xe)));else if(Q.match(/^-.\..+=/))jt=Q.match(/^-([^=]+)=([\s\S]*)$/),F(jt[1],jt[2]);else if(Q.match(/^-.\..+/)&&!Q.match(h))mr=e[z+1],xe=Q.match(/^-(.\..+)/)[1],mr!==void 0&&!mr.match(/^-/)&&!nt(xe,p.bools)&&!nt(xe,p.counts)?(F(xe,mr),z++):F(xe,ur(xe));else if(Q.match(/^-[^-]+/)&&!Q.match(h)){je=Q.slice(1,-1).split(""),ge=!1;for(let Qn=0;Qn<je.length;Qn++){if(mr=Q.slice(Qn+2),je[Qn+1]&&je[Qn+1]==="="){si=Q.slice(Qn+3),xe=je[Qn],nt(xe,p.arrays)?z=R(z,xe,e,si):nt(xe,p.nargs)!==!1?z=I(z,xe,e,si):F(xe,si),ge=!0;break}if(mr==="-"){F(je[Qn],mr);continue}if(/[A-Za-z]/.test(je[Qn])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(mr)){F(je[Qn],mr),ge=!0;break}if(je[Qn+1]&&je[Qn+1].match(/\W/)){F(je[Qn],mr),ge=!0;break}else F(je[Qn],ur(je[Qn]))}xe=Q.slice(-1)[0],!ge&&xe!=="-"&&(nt(xe,p.arrays)?z=R(z,xe,e):nt(xe,p.nargs)!==!1?z=I(z,xe,e):(mr=e[z+1],mr!==void 0&&(!/^(-|--)[^-]/.test(mr)||mr.match(h))&&!nt(xe,p.bools)&&!nt(xe,p.counts)||/^(true|false)$/.test(mr)?(F(xe,mr),z++):F(xe,ur(xe))))}else if(Q.match(/^-[0-9]$/)&&Q.match(h)&&nt(Q.slice(1),p.bools))xe=Q.slice(1),F(xe,ur(xe));else if(Q==="--"){v=e.slice(z+1);break}else if(n["halt-at-non-option"]){v=e.slice(z);break}else b._.push(H("_",Q))}ie(b,!0),ie(b,!1),ae(b),D(),B(b,p.aliases,i,!0),re(b),n["set-placeholder-key"]&&Pe(b),Object.keys(p.counts).forEach(function(z){ee(b,z.split("."))||F(z,0)}),o&&v.length&&(b[c]=[]),v.forEach(function(z){b[c].push(z)}),n["camel-case-expansion"]&&n["strip-dashed"]&&Object.keys(b).filter(z=>z!=="--"&&z.includes("-")).forEach(z=>{delete b[z]}),n["strip-aliased"]&&[].concat(...Object.keys(r).map(z=>r[z])).forEach(z=>{n["camel-case-expansion"]&&delete b[z.split(".").map(Q=>ZO(Q)).join(".")],delete b[z]});function I(z,Q,ge,xe){let je,jt=nt(Q,p.nargs);if(jt=isNaN(jt)?1:jt,jt===0)return Ue(xe)||(w=Error(m("Argument unexpected for: %s",Q))),F(Q,ur(Q)),z;let mr=Ue(xe)?0:1;if(n["nargs-eats-options"])ge.length-(z+1)+mr<jt&&(w=Error(m("Not enough arguments following: %s",Q))),mr=jt;else{for(je=z+1;je<ge.length&&(!ge[je].match(/^-[^0-9]/)||ge[je].match(h)||ct(ge[je]));je++)mr++;mr<jt&&(w=Error(m("Not enough arguments following: %s",Q)))}let si=Math.min(mr,jt);for(!Ue(xe)&&si>0&&(F(Q,xe),si--),je=z+1;je<si+z+1;je++)F(Q,ge[je]);return z+si}function R(z,Q,ge,xe){let je=[],jt=xe||ge[z+1],mr=nt(Q,p.nargs);if(nt(Q,p.bools)&&!/^(true|false)$/.test(jt))je.push(!0);else if(Ue(jt)||Ue(xe)&&/^-/.test(jt)&&!h.test(jt)&&!ct(jt)){if(i[Q]!==void 0){let si=i[Q];je=Array.isArray(si)?si:[si]}}else{Ue(xe)||je.push(X(Q,xe));for(let si=z+1;si<ge.length&&!(!n["greedy-arrays"]&&je.length>0||mr&&je.length>=mr||(jt=ge[si],/^-/.test(jt)&&!h.test(jt)&&!ct(jt)));si++)z=si,je.push(X(Q,jt))}return(mr&&je.length<mr||isNaN(mr)&&je.length===0)&&(w=Error(m("Not enough arguments following: %s",Q))),F(Q,je),z}function F(z,Q){if(/-/.test(z)&&n["camel-case-expansion"]){let je=z.split(".").map(function(jt){return ZO(jt)}).join(".");J(z,je)}let ge=X(z,Q),xe=z.split(".");Ge(b,xe,ge),p.aliases[z]&&p.aliases[z].forEach(function(je){je=je.split("."),Ge(b,je,ge)}),xe.length>1&&n["dot-notation"]&&(p.aliases[xe[0]]||[]).forEach(function(je){je=je.split(".");let jt=[].concat(xe);jt.shift(),je=je.concat(jt),(p.aliases[z]||[]).includes(je.join("."))||Ge(b,je,ge)}),nt(z,p.normalize)&&!nt(z,p.arrays)&&[z].concat(p.aliases[z]||[]).forEach(function(jt){Object.defineProperty(A,jt,{enumerable:!0,get(){return Q},set(mr){Q=typeof mr=="string"?JO.normalize(mr):mr}})})}function J(z,Q){p.aliases[z]&&p.aliases[z].length||(p.aliases[z]=[Q],l[Q]=!0),p.aliases[Q]&&p.aliases[Q].length||J(Q,z)}function X(z,Q){typeof Q=="string"&&(Q[0]==="'"||Q[0]==='"')&&Q[Q.length-1]===Q[0]&&(Q=Q.substring(1,Q.length-1)),(nt(z,p.bools)||nt(z,p.counts))&&typeof Q=="string"&&(Q=Q==="true");let ge=Array.isArray(Q)?Q.map(function(xe){return H(z,xe)}):H(z,Q);return nt(z,p.counts)&&(Ue(ge)||typeof ge=="boolean")&&(ge=Iwe),nt(z,p.normalize)&&nt(z,p.arrays)&&(Array.isArray(Q)?ge=Q.map(JO.normalize):ge=JO.normalize(Q)),ge}function H(z,Q){return!nt(z,p.strings)&&!nt(z,p.bools)&&!Array.isArray(Q)&&(Nr(Q)&&n["parse-numbers"]&&Number.isSafeInteger(Math.floor(Q))||!Ue(Q)&&nt(z,p.numbers))&&(Q=Number(Q)),Q}function ae(z){let Q=Object.create(null);B(Q,p.aliases,i),Object.keys(p.configs).forEach(function(ge){let xe=z[ge]||Q[ge];if(xe)try{let je=null,jt=JO.resolve(process.cwd(),xe);if(typeof p.configs[ge]=="function"){try{je=p.configs[ge](jt)}catch(mr){je=mr}if(je instanceof Error){w=je;return}}else je=require(jt);le(je)}catch(je){z[ge]&&(w=Error(m("Invalid JSON config file: %s",xe)))}})}function le(z,Q){Object.keys(z).forEach(function(ge){let xe=z[ge],je=Q?Q+"."+ge:ge;typeof xe=="object"&&xe!==null&&!Array.isArray(xe)&&n["dot-notation"]?le(xe,je):(!ee(b,je.split("."))||nt(je,p.arrays)&&n["combine-arrays"])&&F(je,xe)})}function D(){typeof s!="undefined"&&s.forEach(function(z){le(z)})}function ie(z,Q){if(typeof a=="undefined")return;let ge=typeof a=="string"?a:"";Object.keys(process.env).forEach(function(xe){if(ge===""||xe.lastIndexOf(ge,0)===0){let je=xe.split("__").map(function(jt,mr){return mr===0&&(jt=jt.substring(ge.length)),ZO(jt)});(Q&&p.configs[je.join(".")]||!Q)&&!ee(z,je)&&F(je.join("."),process.env[xe])}})}function re(z){let Q,ge=new Set;Object.keys(z).forEach(function(xe){if(!ge.has(xe)&&(Q=nt(xe,p.coercions),typeof Q=="function"))try{let je=H(xe,Q(z[xe]));[].concat(p.aliases[xe]||[],xe).forEach(jt=>{ge.add(jt),z[jt]=je})}catch(je){w=je}})}function Pe(z){return p.keys.forEach(Q=>{~Q.indexOf(".")||typeof z[Q]=="undefined"&&(z[Q]=void 0)}),z}function B(z,Q,ge,xe=!1){Object.keys(ge).forEach(function(je){ee(z,je.split("."))||(Ge(z,je.split("."),ge[je]),xe&&(u[je]=!0),(Q[je]||[]).forEach(function(jt){ee(z,jt.split("."))||Ge(z,jt.split("."),ge[je])}))})}function ee(z,Q){let ge=z;n["dot-notation"]||(Q=[Q.join(".")]),Q.slice(0,-1).forEach(function(je){ge=ge[je]||{}});let xe=Q[Q.length-1];return typeof ge!="object"?!1:xe in ge}function Ge(z,Q,ge){let xe=z;n["dot-notation"]||(Q=[Q.join(".")]),Q.slice(0,-1).forEach(function(Qn,Xi){Qn=t7e(Qn),typeof xe=="object"&&xe[Qn]===void 0&&(xe[Qn]={}),typeof xe[Qn]!="object"||Array.isArray(xe[Qn])?(Array.isArray(xe[Qn])?xe[Qn].push({}):xe[Qn]=[xe[Qn],{}],xe=xe[Qn][xe[Qn].length-1]):xe=xe[Qn]});let je=t7e(Q[Q.length-1]),jt=nt(Q.join("."),p.arrays),mr=Array.isArray(ge),si=n["duplicate-arguments-array"];!si&&nt(je,p.nargs)&&(si=!0,(!Ue(xe[je])&&p.nargs[je]===1||Array.isArray(xe[je])&&xe[je].length===p.nargs[je])&&(xe[je]=void 0)),ge===Iwe?xe[je]=Iwe(xe[je]):Array.isArray(xe[je])?si&&jt&&mr?xe[je]=n["flatten-duplicate-arrays"]?xe[je].concat(ge):(Array.isArray(xe[je][0])?xe[je]:[xe[je]]).concat([ge]):!si&&Boolean(jt)===Boolean(mr)?xe[je]=ge:xe[je]=xe[je].concat([ge]):xe[je]===void 0&&jt?xe[je]=mr?ge:[ge]:si&&!(xe[je]===void 0||nt(je,p.counts)||nt(je,p.bools))?xe[je]=[xe[je],ge]:xe[je]=ge}function We(...z){z.forEach(function(Q){Object.keys(Q||{}).forEach(function(ge){p.aliases[ge]||(p.aliases[ge]=[].concat(r[ge]||[]),p.aliases[ge].concat(ge).forEach(function(xe){if(/-/.test(xe)&&n["camel-case-expansion"]){let je=ZO(xe);je!==ge&&p.aliases[ge].indexOf(je)===-1&&(p.aliases[ge].push(je),l[je]=!0)}}),p.aliases[ge].concat(ge).forEach(function(xe){if(xe.length>1&&/[A-Z]/.test(xe)&&n["camel-case-expansion"]){let je=EJr(xe,"-");je!==ge&&p.aliases[ge].indexOf(je)===-1&&(p.aliases[ge].push(je),l[je]=!0)}}),p.aliases[ge].forEach(function(xe){p.aliases[xe]=[ge].concat(p.aliases[ge].filter(function(je){return xe!==je}))}))})})}function nt(z,Q){let ge=[].concat(p.aliases[z]||[],z),xe=Object.keys(Q),je=ge.find(jt=>xe.includes(jt));return je?Q[je]:!1}function Tt(z){return[].concat(Object.keys(p).map(ge=>p[ge])).some(function(ge){return Array.isArray(ge)?ge.includes(z):ge[z]})}function qt(z,...Q){return[].concat(...Q).some(function(xe){let je=z.match(xe);return je&&Tt(je[1])})}function er(z){if(z.match(h)||!z.match(/^-[^-]+/))return!1;let Q=!0,ge,xe=z.slice(1).split("");for(let je=0;je<xe.length;je++){if(ge=z.slice(je+2),!Tt(xe[je])){Q=!1;break}if(xe[je+1]&&xe[je+1]==="="||ge==="-"||/[A-Za-z]/.test(xe[je])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(ge)||xe[je+1]&&xe[je+1].match(/\W/))break}return Q}function ct(z){return n["unknown-options-as-args"]&&ft(z)}function ft(z){return z.match(h)||er(z)?!1:!qt(z,/^-+([^=]+?)=[\s\S]*$/,y,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ur(z){return!nt(z,p.bools)&&!nt(z,p.counts)&&`${z}`in i?i[z]:pt(sr(z))}function pt(z){return{boolean:!0,string:"",number:void 0,array:[]}[z]}function sr(z){let Q="boolean";return nt(z,p.strings)?Q="string":nt(z,p.numbers)?Q="number":nt(z,p.bools)?Q="boolean":nt(z,p.arrays)&&(Q="array"),Q}function Nr(z){return z==null?!1:typeof z=="number"||/^0x[0-9a-f]+$/i.test(z)?!0:z.length>1&&z[0]==="0"?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(z)}function Ue(z){return z===void 0}function Rr(){Object.keys(p.counts).find(z=>{if(nt(z,p.arrays))return w=Error(m("Invalid configuration: %s, opts.count excludes opts.array.",z)),!0;if(nt(z,p.nargs))return w=Error(m("Invalid configuration: %s, opts.count excludes opts.narg.",z)),!0})}return{argv:Object.assign(A,b),error:w,aliases:Object.assign({},p.aliases),newAliases:Object.assign({},l),defaulted:Object.assign({},u),configuration:n}}function xJr(e){let t=[],r=Object.create(null),n=!0;for(Object.keys(e).forEach(function(i){t.push([].concat(e[i],i))});n;){n=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(o){return t[s].indexOf(o)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),n=!0;break}}return t.forEach(function(i){i=i.filter(function(s,a,o){return o.indexOf(s)===a}),r[i.pop()]=i}),r}function Iwe(e){return e!==void 0?e+1:1}function e7e(e,t){return J9e(e.slice(),t).argv}e7e.detailed=function(e,t){return J9e(e.slice(),t)};function t7e(e){return e==="__proto__"?"___proto___":e}r7e.exports=e7e});var eF,bd,tF,n7e,i7e,s7e,a7e,oq,o7e,c7e,qwe,Dwe,Nwe,l7e,d7e,u7e,$l,Bm,rF,Wb,Lwe,m7e,Bv,Mwe,f7e,cq,lq,p7e,nF,g7e,Uv,h7e,iF,y7e,iu,ua=Te(()=>{eF=["stacktape.yaml","stacktape.yml","stacktape.json","stacktape.ini","stacktape.js","stacktape.ts","stacktape.py"],bd=process.env.DEV_MODE==="true",tF={js:["nodejs14.x","nodejs12.x","nodejs10.x"],ts:["nodejs14.x","nodejs12.x","nodejs10.x"],jsx:["nodejs14.x","nodejs12.x","nodejs10.x"],tsx:["nodejs14.x","nodejs12.x","nodejs10.x"],py:["python3.8","python3.7","python3.6","python2.7"],java:["java11","java8"],rb:["ruby2.5"],go:["go1.x"],cs:["dotnetcore2.1"]},n7e=["js","ts","ts","tsx"],i7e=["js","ts","py"],s7e="stacktape-infrastructure-modules",a7e="eu-west-1",oq="14.17.0",o7e={"nodejs14.x":oq,"nodejs12.x":"12.18.3","nodejs10.x":"10.16.3","nodejs8.10":"8.10"},c7e="https://prod-telemetry.stacktape-dev.com/telemetry",qwe=3,Dwe=["deploy","delete","rollback","init","print-logs","print-config","describe-stack","invoke-local","invoke-cloud","credentials-create","credentials-update","credentials-delete","secret-create","secret-get","secret-delete","userpool-create-user","userpool-get-token","domain-add","compile-template","package-workloads","preview-changes","update-module","sync-bucket","configure-defaults","version","help"],Nwe=4,l7e=1500,d7e=10,u7e=10,$l=["profile","region","stage","logFormat","logLevel"],Bm=["configPath","currentWorkingDirectory"],rF={deploy:[...$l,...Bm,"disableDriftDetection","preserveTempFiles","maxThreads","autoConfirmChanges","dockerArgs","mode","noCache"],"invoke-local":[...$l,...Bm,"watch","workload","logOutput","event","jsonEvent","ignoreMissingOutput","preserveTempFiles","port","eventName","nativeExecutable","dockerArgs"],"package-workloads":[...$l,...Bm,"maxThreads"],"print-config":[...$l,...Bm],delete:[...$l,...Bm,"emptyBuckets"],"describe-stack":[...$l,...Bm],help:["command"],version:[],"domain-add":[...$l,"profile","region"],"update-module":["profile","region"],"secret-create":[...$l,"profile","region"],"secret-delete":[...$l,"profile","region"],"secret-get":[...$l,"profile","region"],"credentials-create":[],"credentials-update":[],"credentials-delete":[],rollback:[...$l,"version",...Bm],"compile-template":[...$l,...Bm,"templatePath","preserveTempFiles"],"preview-changes":[...$l,...Bm,"preserveTempFiles"],"print-logs":[...$l,...Bm,"resource","startTime","filter","raw"],init:["projectId"],"userpool-create-user":[...$l,...Bm,"userPoolName"],"userpool-get-token":[...$l,...Bm,"userPoolName","tokenType"],"sync-bucket":["profile","region","logFormat","logLevel","bucketName","sourcePath"],"configure-defaults":[],"invoke-cloud":[]},Wb={event:"e",jsonEvent:"je",stage:"s",configPath:"cp",profile:"p",disableDriftDetection:"ddd",preserveTempFiles:"ptf",region:"r",workload:"wl",resource:"res",watch:"w",logOutput:"lo",command:"cmd",ignoreMissingOutput:"imo",port:"pt",maxThreads:"mt",logFormat:"lf",logLevel:"ll",autoConfirmChanges:"acc",version:"v",templatePath:"tp",filter:"f",startTime:"st",raw:"rw",eventName:"en",nativeExecutable:"ne",dockerArgs:"da",mode:"md",userPoolName:"upn",tokenType:"tt",sourcePath:"sp",bucketName:"bn",currentWorkingDirectory:"cwd",noCache:"nc",emptyBuckets:"eb",projectId:"pi"},Lwe={deploy:`Deploys stack with specified stage to AWS.
2
2
  If stack doesn't exist, creates new one. If stack already exists, updates it.`,"invoke-local":`Invokes specified workload locally on your system.
3
3
  Emulates live AWS environment as closely as possible. Automatically injects any required parameters.`,"invoke-cloud":"Invokes specified workload in the cloud.","print-config":`Prints parsed configuration to the console.
4
4
  Note that some of the directives might not yet be resolved.`,delete:`Deletes stack with specified stage.
@@ -78,7 +78,7 @@ ${r}`}};var D3s=Math.pow(2,32),D9t=function(){try{return new Function("return 2n
78
78
  `)),typeof e.banner=="string"&&e.banner.length&&(e.banner.slice(-2)===`\r
79
79
  `?this.banner=e.banner:this.banner=e.banner+`\r
80
80
  `)),this.debug("DEBUG: Local ident: "+Q9t(this.config.ident)),this.push(this.config.ident+`\r
81
- `),this._state.incoming.expectedPacket="KEXINIT"}Q3s(Bn,qJ);Bn.prototype.__read=qJ.prototype._read;Bn.prototype._read=function(e){return this._needContinue&&(this._needContinue=!1,this.emit("continue")),this.__read(e)};Bn.prototype.__push=qJ.prototype.push;Bn.prototype.push=function(e,t){var r=this.__push(e,t);return this._needContinue=r===!1,r};Bn.prototype._cleanup=function(e){this.reset(),this.debug("DEBUG: Parser: Malformed packet"),e&&e(new Error("Malformed packet"))};Bn.prototype._transform=function(e,t,r,n){var i=!1,s=!1,a=this._state,o=a.incoming,c=a.outgoing,l=o.expect,u=o.decrypt,m=o.decompress,p=e.length,h=0,y=this.debug,w=this,v=0,b=v,A,I,R,F;for(this.bytesReceived+=p;;){if(l.type!==void 0){if(v>=p)break;if(l.type===rx){h=p-v;var J=l.buf.length-l.ptr;J<=h?(e.copy(l.buf,l.ptr,v,v+J),v+=J,I=l.buf,l.buf=void 0,l.ptr=0,l.type=void 0):(e.copy(l.buf,l.ptr,v),l.ptr+=h,v+=h);continue}else if(l.type===s7t){if(v+=o.search.push(e),l.type!==void 0)continue}else if(l.type===a7t){if(++l.ptr+4>255)return this.reset(),y("DEBUG: Parser: Identification string exceeded 255 characters"),r(new Error("Max identification string size exceeded"));if(e[v]===10)l.type=void 0,b<v&&(l.buf===void 0?l.buf=e.toString("ascii",b,v):l.buf+=e.toString("ascii",b,v)),I=l.buf,l.buf=void 0,++v;else{++v===p&&b<v&&(l.buf===void 0?l.buf=e.toString("ascii",b,v):l.buf+=e.toString("ascii",b,v));continue}}}if(o.status===tx){if(!this.readable)return r();if(this.server)if(!I)y("DEBUG: Parser: IN_INIT (waiting for identification begin)"),XS(this,rx,4);else if(I[0]===83&&I[1]===83&&I[2]===72&&I[3]===45)o.status=vNe,y("DEBUG: Parser: IN_INIT (waiting for rest of identification)");else return this.reset(),y("DEBUG: Parser: Bad identification start"),r(new Error("Bad identification start"));else{y("DEBUG: Parser: IN_INIT");var X=o.search=new Y3s(l$s);X.on("info",function Ue(Rr,z,Q,ge){z&&(o.greeting===void 0?o.greeting=z.toString("binary",Q,ge):o.greeting+=z.toString("binary",Q,ge)),Rr&&(l.type=void 0,o.search.removeListener("info",Ue))}),X.maxMatches=1,XS(this,s7t),o.status=vNe}}else if(o.status===vNe)y("DEBUG: Parser: IN_GREETING"),o.search=void 0,b=v,XS(this,a7t),o.status=n7t;else if(o.status===n7t){y("DEBUG: Parser: IN_HEADER"),I.charCodeAt(I.length-1)===13&&(I=I.slice(0,-1));var H=I.indexOf("-"),ae=I.indexOf(" "),le={greeting:o.greeting,identRaw:"SSH-"+I,versions:{protocol:I.substr(0,H),software:ae===-1?I.substring(H+1):I.substring(H+1,ae)},comments:ae>-1?I.substring(ae+1):void 0};if(o.greeting=void 0,le.versions.protocol!=="1.99"&&le.versions.protocol!=="2.0")return this.reset(),y("DEBUG: Parser: protocol version not supported: "+le.versions.protocol),r(new Error("Protocol version not supported"));if(this.emit("header",le),o.status===tx)return;var D=le.identRaw,ie=le.versions.software;this.debug("DEBUG: Remote ident: "+Q9t(D));for(var re=0,Pe;re<i$s;++re)Pe=r7t[re],typeof Pe[0]=="string"?ie===Pe[0]&&(this.remoteBugs|=Pe[1]):Pe[0].test(ie)&&(this.remoteBugs|=Pe[1]);o.identRaw=D,this.bytesReceived-=p-v,kNe(this,function(){v===p?r():w._transform(e.slice(v),t,r)}),o.status=NJ;return}else if(o.status===NJ)A=u.instance?u.info.blockLen:8,y("DEBUG: Parser: IN_PACKETBEFORE (expecting "+A+")"),XS(this,rx,A,u.buf),o.status=_Ne;else if(o.status===_Ne){if(y("DEBUG: Parser: IN_PACKET"),u.instance?(s=u.info.authLen>0,s||(I=m7t(this,I)),A=u.info.blockLen):(s=!1,A=8),F=ys(I,0,this,r),F===!1)return;var B=o.hmac.info,ee;B?ee=B.actualLen:ee=0;var Ge=F+4+ee,We=this.maxPacketSize;if(m.instance&&(We+=(this.maxPacketSize/16384+1)*5+6),F>We||Ge<16+ee||(F+(s?0:4))%A!=0)return this.disconnect(Da.PROTOCOL_ERROR),y("DEBUG: Parser: Bad packet length ("+Ge+")"),r(new Error("Bad packet length"));o.pktLen=F;var nt=o.pktLen+4-A;if(s?(u.instance.setAAD(I.slice(0,4)),y("DEBUG: Parser: pktLen:"+o.pktLen+",remainLen:"+nt)):(o.padLen=I[4],y("DEBUG: Parser: pktLen:"+o.pktLen+",padLen:"+o.padLen+",remainLen:"+nt)),nt>0)s?o.pktExtra=I.slice(4):o.pktExtra=I.slice(5),XS(this,rx,nt),o.status=bNe;else if(nt<0)o.status=NJ;else{i=!0,o.status=bNe;continue}}else if(o.status===bNe){y("DEBUG: Parser: IN_PACKETDATA"),u.instance?(s=u.info.authLen>0,i?i=!1:s||(I=m7t(this,I))):(s=!1,i=!1);var Tt=o.pktLen-o.padLen-1;if(o.pktExtra?(R=Buffer.allocUnsafe(o.pktExtra.length+I.length),o.pktExtra.copy(R),I.copy(R,o.pktExtra.length),o.payload=R.slice(0,Tt)):(s?R=I.slice(4):R=I.slice(5),o.payload=I.slice(5,5+Tt)),o.hmac.info!==void 0){var qt=u.info.authLen||o.hmac.info.actualLen;y("DEBUG: Parser: HMAC size:"+qt),XS(this,rx,qt,o.hmac.buf),o.status=i7t,o.packet=R}else o.status=SNe;o.pktExtra=void 0,R=void 0}else if(o.status===i7t)if(y("DEBUG: Parser: IN_PACKETDATAVERIFY"),E$s(this,I))y("DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)"),o.status=SNe,o.packet=void 0;else return this.reset(),y("DEBUG: Parser: IN_PACKETDATAVERIFY (Invalid HMAC)"),r(new Error("Invalid HMAC"));else if(o.status===SNe){if(m.instance)if(n)n=!1;else{y("DEBUG: Parser: Decompressing"),m.instance.write(o.payload);var er=[],ct=0;m.instance.on("readable",function(){for(var Ue;Ue=this.read();)er.push(Ue),ct+=Ue.length}).flush(ANe,function(){m.instance.removeAllListeners("readable"),er.length===1?o.payload=er[0]:o.payload=Buffer.concat(er,ct),er=null;var Ue;v===p?Ue=PNe:Ue=e.slice(v),w._transform(Ue,t,r,!0)});return}this.emit("packet");var ft=o.payload[0];if(y!==o7t){var ur="DEBUG: Parser: IN_PACKETDATAAFTER, packet: ",pt=a.authsQueue[0],sr=null;if(c.status===K_&&!(ft<=4||ft>=20&&ft<=49)&&(ur+="(enqueued) "),ft===ir.KEXDH_INIT)switch(a.kex.type){case"group":sr="KEXDH_INIT";break;case"groupex":sr="KEXDH_GEX_REQUEST";break;default:sr="KEXECDH_INIT"}else if(ft===ir.KEXDH_REPLY)switch(a.kex.type){case"group":sr="KEXDH_REPLY";break;case"groupex":sr="KEXDH_GEX_GROUP";break;default:sr="KEXECDH_REPLY"}else ft===ir.KEXDH_GEX_GROUP?sr="KEXDH_GEX_GROUP":ft===ir.KEXDH_GEX_REPLY?sr="KEXDH_GEX_REPLY":ft===60?pt==="password"?sr="USERAUTH_PASSWD_CHANGEREQ":pt==="keyboard-interactive"?sr="USERAUTH_INFO_REQUEST":pt==="publickey"?sr="USERAUTH_PK_OK":sr="UNKNOWN PACKET 60":ft===61&&(pt==="keyboard-interactive"?sr="USERAUTH_INFO_RESPONSE":sr="UNKNOWN PACKET 61");sr===null&&(sr=ir[ft]),ft!==ir.CHANNEL_OPEN&&ft!==ir.CHANNEL_REQUEST&&ft!==ir.CHANNEL_SUCCESS&&ft!==ir.CHANNEL_FAILURE&&ft!==ir.CHANNEL_EOF&&ft!==ir.CHANNEL_CLOSE&&ft!==ir.CHANNEL_DATA&&ft!==ir.CHANNEL_EXTENDED_DATA&&ft!==ir.CHANNEL_WINDOW_ADJUST&&ft!==ir.DISCONNECT&&ft!==ir.USERAUTH_REQUEST&&ft!==ir.GLOBAL_REQUEST&&y(ur+sr)}if(c.status===X_||ft<=4||ft>=20&&ft<=49){if(d7t(this,r)===!1||o.status===tx)return}else if(c.status===K_){if(o.rekeyQueue.length===o$s)return y("DEBUG: Parser: Max incoming re-key queue length reached"),this.disconnect(Da.PROTOCOL_ERROR),r(new Error("Incoming re-key queue length limit reached"));var Nr=o.seqno;++o.seqno>ENe&&(o.seqno=0),o.rekeyQueue.push([Nr,o.payload])}o.status=NJ,o.payload=void 0}I!==void 0&&(I=void 0)}r()};Bn.prototype.reset=function(e){if(this._state){var t=this._state;t.incoming.status=tx,t.outgoing.status=CNe}else this._state={authsQueue:[],hostkeyFormat:void 0,kex:void 0,incoming:{status:tx,expectedPacket:void 0,search:void 0,greeting:void 0,seqno:0,pktLen:void 0,padLen:void 0,pktExtra:void 0,payload:void 0,packet:void 0,kexinit:void 0,identRaw:void 0,rekeyQueue:[],ignoreNext:!1,expect:{amount:void 0,type:void 0,ptr:0,buf:void 0},decrypt:{instance:!1,info:void 0,iv:void 0,key:void 0,buf:void 0,type:void 0},hmac:{info:void 0,key:void 0,buf:void 0,type:!1},decompress:{instance:!1,type:!1}},outgoing:{status:CNe,seqno:0,bufSeqno:Buffer.allocUnsafe(4),rekeyQueue:[],kexinit:void 0,kexsecret:void 0,pubkey:void 0,exchangeHash:void 0,sessionId:void 0,sentNEWKEYS:!1,encrypt:{instance:!1,info:void 0,iv:void 0,key:void 0,type:void 0},hmac:{info:void 0,key:void 0,buf:void 0,type:!1},compress:{instance:!1,type:!1,queue:null}}};e||this.readable&&this.push(null)};Bn.prototype.disconnect=function(e){var t=Buffer.alloc(1+4+4+4);return t[0]=ir.DISCONNECT,Da[e]===void 0&&(e=Da.BY_APPLICATION),Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing DISCONNECT ("+Da[e]+")"),Tn(this,t),this.reset(),!1};Bn.prototype.ping=function(){return this.debug("DEBUG: Outgoing: Writing ping (GLOBAL_REQUEST: keepalive@openssh.com)"),Tn(this,d$s)};Bn.prototype.rekey=function(){var e=this._state.outgoing.status;if(e===K_)throw new Error("A re-key is already in progress");if(e!==X_)throw new Error("Cannot re-key yet");return this.debug("DEBUG: Outgoing: Starting re-key"),kNe(this)};Bn.prototype.requestSuccess=function(e){var t;return Buffer.isBuffer(e)?(t=Buffer.allocUnsafe(1+e.length),t[0]=ir.REQUEST_SUCCESS,e.copy(t,1)):t=m$s,this.debug("DEBUG: Outgoing: Writing REQUEST_SUCCESS"),Tn(this,t)};Bn.prototype.requestFailure=function(){return this.debug("DEBUG: Outgoing: Writing REQUEST_FAILURE"),Tn(this,f$s)};Bn.prototype.channelSuccess=function(e){var t=Buffer.allocUnsafe(1+4);return t[0]=ir.CHANNEL_SUCCESS,Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing CHANNEL_SUCCESS ("+e+")"),Tn(this,t)};Bn.prototype.channelFailure=function(e){var t=Buffer.allocUnsafe(1+4);return t[0]=ir.CHANNEL_FAILURE,Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing CHANNEL_FAILURE ("+e+")"),Tn(this,t)};Bn.prototype.channelEOF=function(e){var t=Buffer.allocUnsafe(1+4);return t[0]=ir.CHANNEL_EOF,Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing CHANNEL_EOF ("+e+")"),Tn(this,t)};Bn.prototype.channelClose=function(e){var t=Buffer.allocUnsafe(1+4);return t[0]=ir.CHANNEL_CLOSE,Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing CHANNEL_CLOSE ("+e+")"),Tn(this,t)};Bn.prototype.channelWindowAdjust=function(e,t){var r=Buffer.allocUnsafe(1+4+4);return r[0]=ir.CHANNEL_WINDOW_ADJUST,Ye(r,e,1),Ye(r,t,5),this.debug("DEBUG: Outgoing: Writing CHANNEL_WINDOW_ADJUST ("+e+", "+t+")"),Tn(this,r)};Bn.prototype.channelData=function(e,t){var r=Buffer.isBuffer(t),n=r?t.length:Buffer.byteLength(t),i=Buffer.allocUnsafe(1+4+4+n);return i[0]=ir.CHANNEL_DATA,Ye(i,e,1),Ye(i,n,5),r?t.copy(i,9):i.write(t,9,n,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_DATA ("+e+")"),Tn(this,i)};Bn.prototype.channelExtData=function(e,t,r){var n=Buffer.isBuffer(t),i=n?t.length:Buffer.byteLength(t),s=Buffer.allocUnsafe(1+4+4+4+i);return s[0]=ir.CHANNEL_EXTENDED_DATA,Ye(s,e,1),Ye(s,r,5),Ye(s,i,9),n?t.copy(s,13):s.write(t,13,i,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_EXTENDED_DATA ("+e+")"),Tn(this,s)};Bn.prototype.channelOpenConfirm=function(e,t,r,n){var i=Buffer.allocUnsafe(1+4+4+4+4);return i[0]=ir.CHANNEL_OPEN_CONFIRMATION,Ye(i,e,1),Ye(i,t,5),Ye(i,r,9),Ye(i,n,13),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN_CONFIRMATION (r:"+e+", l:"+t+")"),Tn(this,i)};Bn.prototype.channelOpenFail=function(e,t,r,n){typeof r!="string"&&(r=""),typeof n!="string"&&(n="");var i=Buffer.byteLength(r),s=Buffer.byteLength(n),a=9,o=Buffer.allocUnsafe(1+4+4+4+i+4+s);return o[0]=ir.CHANNEL_OPEN_FAILURE,Ye(o,e,1),Ye(o,t,5),Ye(o,i,a),a+=4,i&&(o.write(r,a,i,"utf8"),a+=i),Ye(o,s,a),s&&o.write(n,a+=4,s,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN_FAILURE ("+e+")"),Tn(this,o)};Bn.prototype.service=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=Buffer.allocUnsafe(1+4+t);return r[0]=ir.SERVICE_REQUEST,Ye(r,t,1),r.write(e,5,t,"ascii"),this.debug("DEBUG: Outgoing: Writing SERVICE_REQUEST ("+e+")"),Tn(this,r)};Bn.prototype.tcpipForward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(e),i=Buffer.allocUnsafe(1+4+13+1+4+n+4);return i[0]=ir.GLOBAL_REQUEST,Ye(i,13,1),i.write("tcpip-forward",5,13,"ascii"),i[18]=r===void 0||r===!0?1:0,Ye(i,n,19),i.write(e,23,n,"ascii"),Ye(i,t,23+n),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (tcpip-forward)"),Tn(this,i)};Bn.prototype.cancelTcpipForward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(e),i=Buffer.allocUnsafe(1+4+20+1+4+n+4);return i[0]=ir.GLOBAL_REQUEST,Ye(i,20,1),i.write("cancel-tcpip-forward",5,20,"ascii"),i[25]=r===void 0||r===!0?1:0,Ye(i,n,26),i.write(e,30,n,"ascii"),Ye(i,t,30+n),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (cancel-tcpip-forward)"),Tn(this,i)};Bn.prototype.openssh_streamLocalForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(e),n=Buffer.allocUnsafe(1+4+31+1+4+r);return n[0]=ir.GLOBAL_REQUEST,Ye(n,31,1),n.write("streamlocal-forward@openssh.com",5,31,"ascii"),n[36]=t===void 0||t===!0?1:0,Ye(n,r,37),n.write(e,41,r,"utf8"),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),Tn(this,n)};Bn.prototype.openssh_cancelStreamLocalForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(e),n=Buffer.allocUnsafe(1+4+38+1+4+r);return n[0]=ir.GLOBAL_REQUEST,Ye(n,38,1),n.write("cancel-streamlocal-forward@openssh.com",5,38,"ascii"),n[43]=t===void 0||t===!0?1:0,Ye(n,r,44),n.write(e,48,r,"utf8"),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)"),Tn(this,n)};Bn.prototype.directTcpip=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(n.srcIP),s=Buffer.byteLength(n.dstIP),a=29,o=Buffer.allocUnsafe(1+4+12+4+4+4+4+i+4+4+s+4);return o[0]=ir.CHANNEL_OPEN,Ye(o,12,1),o.write("direct-tcpip",5,12,"ascii"),Ye(o,e,17),Ye(o,t,21),Ye(o,r,25),Ye(o,s,a),o.write(n.dstIP,a+=4,s,"ascii"),Ye(o,n.dstPort,a+=s),Ye(o,i,a+=4),o.write(n.srcIP,a+=4,i,"ascii"),Ye(o,n.srcPort,a+=i),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", direct-tcpip)"),Tn(this,o)};Bn.prototype.openssh_directStreamLocal=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(n.socketPath),s=47,a=Buffer.allocUnsafe(1+4+30+4+4+4+4+i+4+4);return a[0]=ir.CHANNEL_OPEN,Ye(a,30,1),a.write("direct-streamlocal@openssh.com",5,30,"ascii"),Ye(a,e,35),Ye(a,t,39),Ye(a,r,43),Ye(a,i,s),a.write(n.socketPath,s+=4,i,"utf8"),a.fill(0,a.length-8),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", direct-streamlocal@openssh.com)"),Tn(this,a)};Bn.prototype.openssh_noMoreSessions=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.allocUnsafe(1+4+28+1);return t[0]=ir.GLOBAL_REQUEST,Ye(t,28,1),t.write("no-more-sessions@openssh.com",5,28,"ascii"),t[33]=e===void 0||e===!0?1:0,this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (no-more-sessions@openssh.com)"),Tn(this,t)};Bn.prototype.session=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.allocUnsafe(1+4+7+4+4+4);return n[0]=ir.CHANNEL_OPEN,Ye(n,7,1),n.write("session",5,7,"ascii"),Ye(n,e,12),Ye(n,t,16),Ye(n,r,20),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", session)"),Tn(this,n)};Bn.prototype.windowChange=function(e,t,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");var s=Buffer.allocUnsafe(1+4+4+13+1+4+4+4+4);return s[0]=ir.CHANNEL_REQUEST,Ye(s,e,1),Ye(s,13,5),s.write("window-change",9,13,"ascii"),s[22]=0,Ye(s,r,23),Ye(s,t,27),Ye(s,i,31),Ye(s,n,35),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", window-change)"),Tn(this,s)};Bn.prototype.pty=function(e,t,r,n,i,s,a,o){if(this.server)throw new Error("Client-only method called in server mode");(!s||!s.length)&&(s="vt100"),a&&!Buffer.isBuffer(a)&&!Array.isArray(a)&&typeof a=="object"&&(a=P$s(a)),(!a||!a.length)&&(a=p$s);var c=s.length,l=a.length,u=21,m=Buffer.allocUnsafe(1+4+4+7+1+4+c+4+4+4+4+4+l);if(m[0]=ir.CHANNEL_REQUEST,Ye(m,e,1),Ye(m,7,5),m.write("pty-req",9,7,"ascii"),m[16]=o===void 0||o===!0?1:0,Ye(m,c,17),m.write(s,21,c,"utf8"),Ye(m,r,u+=c),Ye(m,t,u+=4),Ye(m,i,u+=4),Ye(m,n,u+=4),Ye(m,l,u+=4),u+=4,Array.isArray(a))for(var p=0;p<l;++p)m[u++]=a[p];else Buffer.isBuffer(a)&&a.copy(m,u);return this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", pty-req)"),Tn(this,m)};Bn.prototype.shell=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.allocUnsafe(1+4+4+5+1);return r[0]=ir.CHANNEL_REQUEST,Ye(r,e,1),Ye(r,5,5),r.write("shell",9,5,"ascii"),r[14]=t===void 0||t===!0?1:0,this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", shell)"),Tn(this,r)};Bn.prototype.exec=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.isBuffer(t)?t.length:Buffer.byteLength(t),i=Buffer.allocUnsafe(1+4+4+4+1+4+n);return i[0]=ir.CHANNEL_REQUEST,Ye(i,e,1),Ye(i,4,5),i.write("exec",9,4,"ascii"),i[13]=r===void 0||r===!0?1:0,Ye(i,n,14),Buffer.isBuffer(t)?t.copy(i,18):i.write(t,18,n,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exec)"),Tn(this,i)};Bn.prototype.signal=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");if(t=t.toUpperCase(),t.slice(0,3)==="SIG"&&(t=t.substring(3)),r$s.indexOf(t)===-1)throw new Error("Invalid signal: "+t);var r=t.length,n=Buffer.allocUnsafe(1+4+4+6+1+4+r);return n[0]=ir.CHANNEL_REQUEST,Ye(n,e,1),Ye(n,6,5),n.write("signal",9,6,"ascii"),n[15]=0,Ye(n,r,16),n.write(t,20,r,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", signal)"),Tn(this,n)};Bn.prototype.env=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(t),s=Buffer.isBuffer(r)?r.length:Buffer.byteLength(r),a=Buffer.allocUnsafe(1+4+4+3+1+4+i+4+s);return a[0]=ir.CHANNEL_REQUEST,Ye(a,e,1),Ye(a,3,5),a.write("env",9,3,"ascii"),a[12]=n===void 0||n===!0?1:0,Ye(a,i,13),a.write(t,17,i,"ascii"),Ye(a,s,17+i),Buffer.isBuffer(r)?r.copy(a,17+i+4):a.write(r,17+i+4,s,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", env)"),Tn(this,a)};Bn.prototype.x11Forward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(t.protocol),i=Buffer.byteLength(t.cookie),s=Buffer.allocUnsafe(1+4+4+7+1+1+4+n+4+i+4);s[0]=ir.CHANNEL_REQUEST,Ye(s,e,1),Ye(s,7,5),s.write("x11-req",9,7,"ascii"),s[16]=r===void 0||r===!0?1:0,s[17]=t.single?1:0,Ye(s,n,18);var a=22;return Buffer.isBuffer(t.protocol)?t.protocol.copy(s,a):s.write(t.protocol,a,n,"utf8"),a+=n,Ye(s,i,a),a+=4,Buffer.isBuffer(t.cookie)?t.cookie.copy(s,a):s.write(t.cookie,a,i,"binary"),a+=i,Ye(s,t.screen||0,a),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", x11-req)"),Tn(this,s)};Bn.prototype.subsystem=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(t),i=Buffer.allocUnsafe(1+4+4+9+1+4+n);return i[0]=ir.CHANNEL_REQUEST,Ye(i,e,1),Ye(i,9,5),i.write("subsystem",9,9,"ascii"),i[18]=r===void 0||r===!0?1:0,Ye(i,n,19),i.write(t,23,n,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", subsystem: "+t+")"),Tn(this,i)};Bn.prototype.openssh_agentForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.allocUnsafe(1+4+4+26+1);return r[0]=ir.CHANNEL_REQUEST,Ye(r,e,1),Ye(r,26,5),r.write("auth-agent-req@openssh.com",9,26,"ascii"),r[35]=t===void 0||t===!0?1:0,this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", auth-agent-req@openssh.com)"),Tn(this,r)};Bn.prototype.authPassword=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(e),n=Buffer.byteLength(t),i=0,s=Buffer.allocUnsafe(1+4+r+4+14+4+8+1+4+n);return s[i]=ir.USERAUTH_REQUEST,Ye(s,r,++i),s.write(e,i+=4,r,"utf8"),Ye(s,14,i+=r),s.write("ssh-connection",i+=4,14,"ascii"),Ye(s,8,i+=14),s.write("password",i+=4,8,"ascii"),s[i+=8]=0,Ye(s,n,++i),s.write(t,i+=4,n,"utf8"),this._state.authsQueue.push("password"),this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (password)"),Tn(this,s)};Bn.prototype.authPK=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=this,i=this._state.outgoing,s;typeof t.getPublicSSH=="function"?(s=t.type,t=t.getPublicSSH()):s=t.toString("ascii",4,4+wNe(t,0));var a=Buffer.byteLength(e),o=Buffer.byteLength(s),c=t.length,l=i.sessionId.length,u=0,m=Buffer.allocUnsafe((r?4+l:0)+1+4+a+4+14+4+9+1+4+o+4+c);return r?(Ye(m,l,u),i.sessionId.copy(m,u+=4),m[u+=l]=ir.USERAUTH_REQUEST):m[u]=ir.USERAUTH_REQUEST,Ye(m,a,++u),m.write(e,u+=4,a,"utf8"),Ye(m,14,u+=a),m.write("ssh-connection",u+=4,14,"ascii"),Ye(m,9,u+=14),m.write("publickey",u+=4,9,"ascii"),m[u+=9]=r?1:0,Ye(m,o,++u),m.write(s,u+=4,o,"ascii"),Ye(m,c,u+=o),t.copy(m,u+=4),r?(r(m,function(p){if(p=TNe(p,s),p===!1)throw new Error("Error while converting handshake signature");var h=p.length,y=Buffer.allocUnsafe(1+4+a+4+14+4+9+1+4+o+4+c+4+4+o+4+h);return u=0,y[u]=ir.USERAUTH_REQUEST,Ye(y,a,++u),y.write(e,u+=4,a,"utf8"),Ye(y,14,u+=a),y.write("ssh-connection",u+=4,14,"ascii"),Ye(y,9,u+=14),y.write("publickey",u+=4,9,"ascii"),y[u+=9]=1,Ye(y,o,++u),y.write(s,u+=4,o,"ascii"),Ye(y,c,u+=o),t.copy(y,u+=4),Ye(y,4+o+4+h,u+=c),Ye(y,o,u+=4),y.write(s,u+=4,o,"ascii"),Ye(y,h,u+=o),p.copy(y,u+=4),n._state.authsQueue.push("publickey"),n.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (publickey)"),Tn(n,y)}),!0):(this._state.authsQueue.push("publickey"),this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (publickey -- check)"),Tn(this,m))};Bn.prototype.authHostbased=function(e,t,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");var s=this,a=this._state.outgoing,o;typeof t.getPublicSSH=="function"?(o=t.type,t=t.getPublicSSH()):o=t.toString("ascii",4,4+wNe(t,0));var c=Buffer.byteLength(e),l=Buffer.byteLength(o),u=t.length,m=a.sessionId.length,p=Buffer.byteLength(r),h=Buffer.byteLength(n),y=0,w=Buffer.allocUnsafe(4+m+1+4+c+4+14+4+9+4+l+4+u+4+p+4+h);return Ye(w,m,y),a.sessionId.copy(w,y+=4),w[y+=m]=ir.USERAUTH_REQUEST,Ye(w,c,++y),w.write(e,y+=4,c,"utf8"),Ye(w,14,y+=c),w.write("ssh-connection",y+=4,14,"ascii"),Ye(w,9,y+=14),w.write("hostbased",y+=4,9,"ascii"),Ye(w,l,y+=9),w.write(o,y+=4,l,"ascii"),Ye(w,u,y+=l),t.copy(w,y+=4),Ye(w,p,y+=u),w.write(r,y+=4,p,"ascii"),Ye(w,h,y+=p),w.write(n,y+=4,h,"utf8"),i(w,function(v){if(v=TNe(v,o),v===!1)throw new Error("Error while converting handshake signature");var b=v.length,A=Buffer.allocUnsafe(w.length-m+b);return w.copy(A,0,4+m),Ye(A,b,A.length-b-4),v.copy(A,A.length-b),s._state.authsQueue.push("hostbased"),s.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (hostbased)"),Tn(s,A)}),!0};Bn.prototype.authKeyboard=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=0,n=Buffer.allocUnsafe(1+4+t+4+14+4+20+4+4);return n[r]=ir.USERAUTH_REQUEST,Ye(n,t,++r),n.write(e,r+=4,t,"utf8"),Ye(n,14,r+=t),n.write("ssh-connection",r+=4,14,"ascii"),Ye(n,20,r+=14),n.write("keyboard-interactive",r+=4,20,"ascii"),Ye(n,0,r+=20),Ye(n,0,r+=4),this._state.authsQueue.push("keyboard-interactive"),this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (keyboard-interactive)"),Tn(this,n)};Bn.prototype.authNone=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=0,n=Buffer.allocUnsafe(1+4+t+4+14+4+4);return n[r]=ir.USERAUTH_REQUEST,Ye(n,t,++r),n.write(e,r+=4,t,"utf8"),Ye(n,14,r+=t),n.write("ssh-connection",r+=4,14,"ascii"),Ye(n,4,r+=14),n.write("none",r+=4,4,"ascii"),this._state.authsQueue.push("none"),this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (none)"),Tn(this,n)};Bn.prototype.authInfoRes=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=0,r=0,n,i,s;if(e)for(s=0,i=e.length;s<i;++s)t+=4+Buffer.byteLength(e[s]);var a=Buffer.allocUnsafe(1+4+t);if(a[r++]=ir.USERAUTH_INFO_RESPONSE,Ye(a,e?e.length:0,r),e)for(r+=4,s=0,i=e.length;s<i;++s)n=Buffer.byteLength(e[s]),Ye(a,n,r),r+=4,n&&(a.write(e[s],r,n,"utf8"),r+=n);return this.debug("DEBUG: Outgoing: Writing USERAUTH_INFO_RESPONSE"),Tn(this,a)};Bn.prototype.serviceAccept=function(e){if(!this.server)throw new Error("Server-only method called in client mode");var t=e.length,r=Buffer.allocUnsafe(1+4+t);if(r[0]=ir.SERVICE_ACCEPT,Ye(r,t,1),r.write(e,5,t,"ascii"),this.debug("DEBUG: Outgoing: Writing SERVICE_ACCEPT ("+e+")"),Tn(this,r),this.server&&this.banner&&e==="ssh-userauth"){var n=Buffer.byteLength(this.banner),i=1+4+n+4,s=Buffer.allocUnsafe(i);s[0]=ir.USERAUTH_BANNER,Ye(s,n,1),s.write(this.banner,5,n,"utf8"),s.fill(0,i-4),this.debug("DEBUG: Outgoing: Writing USERAUTH_BANNER"),Tn(this,s),this.banner=void 0}};Bn.prototype.forwardedTcpip=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.boundAddr),s=Buffer.byteLength(n.remoteAddr),a=36+i,o=Buffer.allocUnsafe(1+4+15+4+4+4+4+i+4+4+s+4);return o[0]=ir.CHANNEL_OPEN,Ye(o,15,1),o.write("forwarded-tcpip",5,15,"ascii"),Ye(o,e,20),Ye(o,t,24),Ye(o,r,28),Ye(o,i,32),o.write(n.boundAddr,36,i,"ascii"),Ye(o,n.boundPort,a),Ye(o,s,a+=4),o.write(n.remoteAddr,a+=4,s,"ascii"),Ye(o,n.remotePort,a+=s),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", forwarded-tcpip)"),Tn(this,o)};Bn.prototype.x11=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.originAddr),s=24+i,a=Buffer.allocUnsafe(1+4+3+4+4+4+4+i+4);return a[0]=ir.CHANNEL_OPEN,Ye(a,3,1),a.write("x11",5,3,"ascii"),Ye(a,e,8),Ye(a,t,12),Ye(a,r,16),Ye(a,i,20),a.write(n.originAddr,24,i,"ascii"),Ye(a,n.originPort,s),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", x11)"),Tn(this,a)};Bn.prototype.openssh_authAgent=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");var n=Buffer.allocUnsafe(1+4+22+4+4+4);return n[0]=ir.CHANNEL_OPEN,Ye(n,22,1),n.write("auth-agent@openssh.com",5,22,"ascii"),Ye(n,e,27),Ye(n,t,31),Ye(n,r,35),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", auth-agent@openssh.com)"),Tn(this,n)};Bn.prototype.openssh_forwardedStreamLocal=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.socketPath),s=Buffer.allocUnsafe(1+4+33+4+4+4+4+i+4);return s[0]=ir.CHANNEL_OPEN,Ye(s,33,1),s.write("forwarded-streamlocal@openssh.com",5,33,"ascii"),Ye(s,e,38),Ye(s,t,42),Ye(s,r,46),Ye(s,i,50),s.write(n.socketPath,54,i,"utf8"),Ye(s,0,54+i),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", forwarded-streamlocal@openssh.com)"),Tn(this,s)};Bn.prototype.exitStatus=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=Buffer.allocUnsafe(1+4+4+11+1+4);return r[0]=ir.CHANNEL_REQUEST,Ye(r,e,1),Ye(r,11,5),r.write("exit-status",9,11,"ascii"),r[20]=0,Ye(r,t,21),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exit-status)"),Tn(this,r)};Bn.prototype.exitSignal=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(t),s=n?Buffer.byteLength(n):0,a=25+i,o=Buffer.allocUnsafe(1+4+4+11+1+4+i+1+4+s+4);return o[0]=ir.CHANNEL_REQUEST,Ye(o,e,1),Ye(o,11,5),o.write("exit-signal",9,11,"ascii"),o[20]=0,Ye(o,i,21),o.write(t,25,i,"utf8"),o[a++]=r?1:0,Ye(o,s,a),a+=4,s&&(o.write(n,a,s,"utf8"),a+=s),Ye(o,0,a),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exit-signal)"),Tn(this,o)};Bn.prototype.authFailure=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=this._state.authsQueue;if(!r.length)throw new Error("No auth in progress");var n;if(typeof e=="boolean"&&(t=e,e=void 0),e){n=[];for(var i=0,s=e.length;i<s;++i)e[i].toLowerCase()!=="none"&&n.push(e[i]);n=n.join(",")}else n="";var a=n.length,o=Buffer.allocUnsafe(1+4+a+1);return o[0]=ir.USERAUTH_FAILURE,Ye(o,a,1),o.write(n,5,a,"ascii"),o[5+a]=t===!0?1:0,this._state.authsQueue.shift(),this.debug("DEBUG: Outgoing: Writing USERAUTH_FAILURE"),Tn(this,o)};Bn.prototype.authSuccess=function(){if(!this.server)throw new Error("Server-only method called in client mode");var e=this._state.authsQueue;if(!e.length)throw new Error("No auth in progress");var t=this._state,r=t.outgoing,n=t.incoming;t.authsQueue.shift(),this.debug("DEBUG: Outgoing: Writing USERAUTH_SUCCESS");var i=Tn(this,u$s);return r.compress.type==="zlib@openssh.com"&&(r.compress.instance=VS.createDeflate(nx),r.compress.queue=[]),n.decompress.type==="zlib@openssh.com"&&(n.decompress.instance=VS.createInflate(nx)),i};Bn.prototype.authPKOK=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=this._state.authsQueue;if(!r.length||r[0]!=="publickey")throw new Error('"publickey" auth not in progress');var n=e.length,i=t.length,s=Buffer.allocUnsafe(1+4+n+4+i);return s[0]=ir.USERAUTH_PK_OK,Ye(s,n,1),s.write(e,5,n,"ascii"),Ye(s,i,5+n),t.copy(s,5+n+4),this._state.authsQueue.shift(),this.debug("DEBUG: Outgoing: Writing USERAUTH_PK_OK"),Tn(this,s)};Bn.prototype.authPasswdChg=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=Buffer.byteLength(e),n=t?t.length:0,i=0,s=Buffer.allocUnsafe(1+4+r+4+n);return s[i]=ir.USERAUTH_PASSWD_CHANGEREQ,Ye(s,r,++i),s.write(e,i+=4,r,"utf8"),Ye(s,n,i+=r),n&&s.write(t,i+=4,n,"ascii"),this.debug("DEBUG: Outgoing: Writing USERAUTH_PASSWD_CHANGEREQ"),Tn(this,s)};Bn.prototype.authInfoReq=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");var n=0,i=e?Buffer.byteLength(e):0,s=t?Buffer.byteLength(t):0,a=0,o,c,l,u;for(u=0,l=r.length;u<l;++u)n+=4+Buffer.byteLength(r[u].prompt)+1;var m=Buffer.allocUnsafe(1+4+i+4+s+4+4+n);for(m[a++]=ir.USERAUTH_INFO_REQUEST,Ye(m,i,a),a+=4,e&&(m.write(e,a,i,"utf8"),a+=i),Ye(m,s,a),a+=4,t&&(m.write(t,a,s,"utf8"),a+=s),Ye(m,0,a),a+=4,Ye(m,r.length,a),a+=4,u=0,l=r.length;u<l;++u)c=r[u],o=Buffer.byteLength(c.prompt),Ye(m,o,a),a+=4,o&&(m.write(c.prompt,a,o,"utf8"),a+=o),m[a++]=c.echo?1:0;return this.debug("DEBUG: Outgoing: Writing USERAUTH_INFO_REQUEST"),Tn(this,m)};function g$s(e,t,r,n,i){if(r!==Da.BY_APPLICATION){var s=new Error(n||t);s.code=r,e.emit("error",s)}e.reset()}function h$s(e,t,r){var n=e._state,i=n.outgoing;i.status===X_?(e.debug("DEBUG: Received re-key request"),i.status=K_,i.kexinit=void 0,kNe(e,s)):s();function s(){y$s(e,t,r)===!0&&(e.server?n.incoming.expectedPacket=n.kex.pktInit:n.kex.type==="groupex"?R$s(e):f7t(e))}}function y$s(e,t,r){var n=e._state,i=n.incoming,s=n.outgoing,a=e.debug,o,c,l,u,m;a("DEBUG: Comparing KEXINITs ...");var p=e.config.algorithms,h=p.kex;if(e.remoteBugs&DJ.BAD_DHGEX)for(var y=!1,w=h.length-1;w>=0;--w)h[w].indexOf("group-exchange")!==-1&&(y||(h=h.slice(),y=!0),h.splice(w,1));for(a("DEBUG: (local) KEX algorithms: "+h),a("DEBUG: (remote) KEX algorithms: "+t.algorithms.kex),e.server?(o=h,c=t.algorithms.kex):(o=t.algorithms.kex,c=h),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching key exchange algorithm");var v=new Error("Handshake failed: no matching key exchange algorithm");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}var b=c[m];for(a("DEBUG: KEX algorithm: "+b),r&&(!t.algorithms.kex.length||b!==t.algorithms.kex[0])&&(i.ignoreNext=!0),a("DEBUG: (local) Host key formats: "+p.serverHostKey),a("DEBUG: (remote) Host key formats: "+t.algorithms.srvHostKey),e.server?(o=p.serverHostKey,c=t.algorithms.srvHostKey):(o=t.algorithms.srvHostKey,c=p.serverHostKey),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching host key format");var v=new Error("Handshake failed: no matching host key format");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(n.hostkeyFormat=c[m],a("DEBUG: Host key format: "+n.hostkeyFormat),a("DEBUG: (local) Client->Server ciphers: "+p.cipher),a("DEBUG: (remote) Client->Server ciphers: "+t.algorithms.cs.encrypt),e.server?(o=p.cipher,c=t.algorithms.cs.encrypt):(o=t.algorithms.cs.encrypt,c=p.cipher),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Client->Server cipher");var v=new Error("Handshake failed: no matching client->server cipher");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=i.decrypt.type=c[m]:l=s.encrypt.type=c[m],a("DEBUG: Client->Server Cipher: "+l),a("DEBUG: (local) Server->Client ciphers: "+p.cipher),a("DEBUG: (remote) Server->Client ciphers: "+t.algorithms.sc.encrypt),e.server?(o=p.cipher,c=t.algorithms.sc.encrypt):(o=t.algorithms.sc.encrypt,c=p.cipher),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Server->Client cipher");var v=new Error("Handshake failed: no matching server->client cipher");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=s.encrypt.type=c[m]:l=i.decrypt.type=c[m],a("DEBUG: Server->Client Cipher: "+l),a("DEBUG: (local) Client->Server HMAC algorithms: "+p.hmac),a("DEBUG: (remote) Client->Server HMAC algorithms: "+t.algorithms.cs.mac),e.server?(o=p.hmac,c=t.algorithms.cs.mac):(o=t.algorithms.cs.mac,c=p.hmac),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Client->Server HMAC algorithm");var v=new Error("Handshake failed: no matching client->server HMAC");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=i.hmac.type=c[m]:l=s.hmac.type=c[m],a("DEBUG: Client->Server HMAC algorithm: "+l),a("DEBUG: (local) Server->Client HMAC algorithms: "+p.hmac),a("DEBUG: (remote) Server->Client HMAC algorithms: "+t.algorithms.sc.mac),e.server?(o=p.hmac,c=t.algorithms.sc.mac):(o=t.algorithms.sc.mac,c=p.hmac),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Server->Client HMAC algorithm");var v=new Error("Handshake failed: no matching server->client HMAC");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=s.hmac.type=c[m]:l=i.hmac.type=c[m],a("DEBUG: Server->Client HMAC algorithm: "+l),a("DEBUG: (local) Client->Server compression algorithms: "+p.compress),a("DEBUG: (remote) Client->Server compression algorithms: "+t.algorithms.cs.compress),e.server?(o=p.compress,c=t.algorithms.cs.compress):(o=t.algorithms.cs.compress,c=p.compress),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Client->Server compression algorithm");var v=new Error("Handshake failed: no matching client->server compression algorithm");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=i.decompress.type=c[m]:l=s.compress.type=c[m],a("DEBUG: Client->Server compression algorithm: "+l),a("DEBUG: (local) Server->Client compression algorithms: "+p.compress),a("DEBUG: (remote) Server->Client compression algorithms: "+t.algorithms.sc.compress),e.server?(o=p.compress,c=t.algorithms.sc.compress):(o=t.algorithms.sc.compress,c=p.compress),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Server->Client compression algorithm");var v=new Error("Handshake failed: no matching server->client compression algorithm");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}return e.server?l=s.compress.type=c[m]:l=i.decompress.type=c[m],a("DEBUG: Server->Client compression algorithm: "+l),n.kex=new KS(b),n.kex.generateKeys(),s.pubkey=n.kex.getPublicKey(),!0}function w$s(e,t,r){var n=e._state,i=n.outgoing;n.kex.setDHParams(t,r),n.kex.generateKeys(),i.pubkey=n.kex.getPublicKey(),f7t(e)}function v$s(e,t){x$s(e,t)}function c7t(e,t,r){var n=e._state,i=n.incoming,s=n.outgoing,a=e.debug,o,c;if(r===void 0){i.expectedPacket="NEWKEYS",s.sentNEWKEYS=!1,a("DEBUG: Checking host key format");var l=Pn(t.hostkey,0,"ascii",e);if(l===!1)return!1;if(t.hostkey_format!==n.hostkeyFormat||t.hostkey_format!==l){a("DEBUG: Host key format mismatch"),e.disconnect(Da.KEY_EXCHANGE_FAILED),e.reset();var u=new Error("Handshake failed: host key format mismatch");return u.level="handshake",e.emit("error",u),!1}a("DEBUG: Checking signature format");var m=Pn(t.sig,0,"ascii",e);if(m===!1)return!1;if(t.sig_format!==m){a("DEBUG: Signature format mismatch"),e.disconnect(Da.KEY_EXCHANGE_FAILED),e.reset();var u=new Error("Handshake failed: signature format mismatch");return u.level="handshake",e.emit("error",u),!1}}if(s.status===CNe){if(r===void 0){a("DEBUG: Verifying host fingerprint");var p=!0,h=e.emit("fingerprint",t.hostkey,function(Ge){r===void 0&&(r=!!Ge,p||c7t(e,t,r))});if(p=!1,h&&r===void 0)return}if(r===void 0)a("DEBUG: Host accepted by default (no verification)");else if(r===!0)a("DEBUG: Host accepted (verified)");else{a("DEBUG: Host denied via fingerprint verification"),e.disconnect(Da.KEY_EXCHANGE_FAILED),e.reset();var u=new Error("Handshake failed: host fingerprint verification failed");return u.level="handshake",e.emit("error",u),!1}}if(t.pubkey=n.kex.convertPublicKey(t.pubkey),t.secret=n.kex.computeSecret(t.pubkey),t.secret instanceof Error)return t.secret.message="Error while computing DH secret ("+n.kex.type+"): "+t.secret.message,t.secret.level="handshake",e.emit("error",t.secret),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1;var y=$s.createHash(n.kex.hash),w=Buffer.byteLength(e.config.ident),v=Buffer.byteLength(i.identRaw),b=s.kexinit.length,A=i.kexinit.length,I=t.hostkey.length,R=s.pubkey.length,F=t.pubkey.length,J=t.secret.length,X=w+v+b+A+I+R+F+J+4*8,H,ae,le,D,ie=n.kex.getDHParams();ie&&(le=ie.prime,D=ie.generator,H=le.length,ae=D.length,X+=4*3,X+=4*2,X+=H,X+=ae);var re=0,Pe=Buffer.allocUnsafe(X);Ye(Pe,w,re),re+=4,Pe.write(e.config.ident,re,"utf8"),re+=w,Ye(Pe,v,re),re+=4,Pe.write(i.identRaw,re,"utf8"),re+=v,Ye(Pe,b,re),re+=4,s.kexinit.copy(Pe,re),re+=b,s.kexinit=void 0,Ye(Pe,A,re),re+=4,i.kexinit.copy(Pe,re),re+=A,i.kexinit=void 0,Ye(Pe,I,re),re+=4,t.hostkey.copy(Pe,re),re+=I,ie&&(RNe.slice(1).copy(Pe,re),re+=4*3,Ye(Pe,H,re),re+=4,le.copy(Pe,re),re+=H,Ye(Pe,ae,re),re+=4,D.copy(Pe,re),re+=ae),Ye(Pe,R,re),re+=4,s.pubkey.copy(Pe,re),re+=R,Ye(Pe,F,re),re+=4,t.pubkey.copy(Pe,re),re+=F,Ye(Pe,J,re),re+=4,t.secret.copy(Pe,re),s.exchangeHash=y.update(Pe).digest();var B=Pn(t.sig,t.sig._pos,e);if(B===!1||!(B=J9t(B,t.sig_format,e)))return!1;var ee=e$s(t.hostkey,t.sig_format);if(ee instanceof Error)return!1;if(a("DEBUG: Verifying signature"),ee.verify(s.exchangeHash,B)!==!0){a("DEBUG: Signature verification failed"),e.disconnect(Da.KEY_EXCHANGE_FAILED),e.reset();var u=new Error("Handshake failed: signature verification failed");return u.level="handshake",e.emit("error",u),!1}s.sessionId===void 0&&(s.sessionId=s.exchangeHash),s.kexsecret=t.secret,a("DEBUG: Outgoing: Writing NEWKEYS"),s.status===K_?Tn(e,xNe,void 0,!0):Tn(e,xNe),s.sentNEWKEYS=!0,r!==void 0&&i.expectedPacket===void 0&&l7t(e)}function l7t(e){var t=e._state,r=t.outgoing,n=t.incoming;if(n.expectedPacket=void 0,!!r.sentNEWKEYS){var i=r.kexsecret.length,s=r.encrypt.info=e7t[r.encrypt.type],a=0,o=t.kex.hash,c=Buffer.allocUnsafe(4+i),l,u;if(t.authsQueue=[],Ye(c,i,a),a+=4,r.kexsecret.copy(c,a),r.kexsecret=void 0,s.stream)l=PNe;else{for(l=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"B":"A","ascii").update(r.sessionId).digest();l.length<s.ivLen;)l=Buffer.concat([l,$s.createHash(o).update(c).update(r.exchangeHash).update(l).digest()]);l.length>s.ivLen&&(l=l.slice(0,s.ivLen))}for(u=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"D":"C","ascii").update(r.sessionId).digest();u.length<s.keyLen;)u=Buffer.concat([u,$s.createHash(o).update(c).update(r.exchangeHash).update(u).digest()]);if(u.length>s.keyLen&&(u=u.slice(0,s.keyLen)),s.authLen>0)r.encrypt.iv=l,r.encrypt.key=u,r.encrypt.instance=!0;else{var m=J1[r.encrypt.type];r.encrypt.instance=$s.createCipheriv(m,u,l),r.encrypt.instance.setAutoPadding(!1)}var p=n.decrypt.info=e7t[n.decrypt.type];if(p.stream)l=PNe;else{for(l=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"A":"B","ascii").update(r.sessionId).digest();l.length<p.ivLen;)l=Buffer.concat([l,$s.createHash(o).update(c).update(r.exchangeHash).update(l).digest()]);l.length>p.ivLen&&(l=l.slice(0,p.ivLen))}for(n.decrypt.buf=Buffer.allocUnsafe(p.blockLen),u=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"C":"D","ascii").update(r.sessionId).digest();u.length<p.keyLen;)u=Buffer.concat([u,$s.createHash(o).update(c).update(r.exchangeHash).update(u).digest()]);u.length>p.keyLen&&(u=u.slice(0,p.keyLen));var h=J1[n.decrypt.type];n.decrypt.instance=$s.createDecipheriv(h,u,l),n.decrypt.instance.setAutoPadding(!1),n.decrypt.iv=l,n.decrypt.key=u;var y;s.discardLen>0&&(y=Buffer.alloc(s.discardLen),r.encrypt.instance.update(y)),p.discardLen>0&&((!y||y.length!==p.discardLen)&&(y=Buffer.alloc(s.discardLen)),n.decrypt.instance.update(y));var w=r.hmac.info=t7t[r.hmac.type],v=n.hmac.info=t7t[n.hmac.type];if(s.authLen===0){for(u=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"F":"E","ascii").update(r.sessionId).digest();u.length<w.len;)u=Buffer.concat([u,$s.createHash(o).update(c).update(r.exchangeHash).update(u).digest()]);u.length>w.len&&(u=u.slice(0,w.len)),r.hmac.key=u}else r.hmac.key=void 0;if(p.authLen===0){for(u=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"E":"F","ascii").update(r.sessionId).digest();u.length<v.len;)u=Buffer.concat([u,$s.createHash(o).update(c).update(r.exchangeHash).update(u).digest()]);u.length>v.len&&(u=u.slice(0,v.len)),n.hmac.key=u}else n.hmac.key=void 0;var b=p.authLen||n.hmac.info.actualLen;if((!n.hmac.buf||n.hmac.buf.length!==b)&&(n.hmac.buf=Buffer.allocUnsafe(b)),r.exchangeHash=void 0,r.compress.type==="zlib"?(r.compress.instance=VS.createDeflate(nx),r.compress.queue=[]):r.compress.type==="none"&&(r.compress.instance=!1,r.compress.queue=null),n.decompress.type==="zlib"?n.decompress.instance=VS.createInflate(nx):n.decompress.type==="none"&&(n.decompress.instance=!1),e.bytesSent=e.bytesReceived=0,r.status===K_){r.status=X_;var A=r.rekeyQueue,I=A.length,R=0;for(r.rekeyQueue=[];R<I;++R)Buffer.isBuffer(A[R])?Tn(e,A[R]):Tn(e,A[R][0],A[R][1]);A=n.rekeyQueue,I=A.length,R=0,n.rekeyQueue=[];for(var F=n.seqno;R<I;++R)if(n.seqno=A[R][0],n.payload=A[R][1],d7t(e)===!1||n.status===tx)return;n.seqno=F}else r.status=X_,n.status===_Ne&&(e.debug("DEBUG: Parser: IN_PACKETBEFORE (update) (expecting "+p.blockLen+")"),XS(e,rx,p.blockLen,n.decrypt.buf)),e.emit("ready")}}function MJ(e,t){var r=e._state.kex;if(r)switch(t){case 30:return r.pktInit;case 31:switch(r.type){case"group":return"KEXDH_REPLY";case"groupex":return"KEXDH_GEX_GROUP";default:return"KEXECDH_REPLY"}break;case 33:if(r.type==="groupex")return"KEXDH_GEX_REPLY"}return ir[t]}function d7t(e,t){var r=e._state.incoming,n=e._state.outgoing,i=r.payload,s=r.seqno,a,o,c,l,u,m,p,h,y,w,v,b,A,I;if(++r.seqno>ENe&&(r.seqno=0),r.ignoreNext){e.debug("DEBUG: Parser: Packet ignored"),r.ignoreNext=!1;return}var R=i[0];if(R===void 0)return!1;if(n.status!==X_&&MJ(e,R)!==r.expectedPacket&&R<1&&R>4){e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, expected: "+r.expectedPacket+" but got: "+MJ(e,R)),e.disconnect(Da.PROTOCOL_ERROR);var F=new Error("Received unexpected packet");return F.level="protocol",e.emit("error",F),!1}if(R===ir.CHANNEL_DATA){if(u=ys(i,1,e,t),u===!1||(m=Pn(i,5,e,t,32768),m===!1))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_DATA ("+u+")"),e.emit("CHANNEL_DATA:"+u,m)}else if(R===ir.CHANNEL_EXTENDED_DATA){if(u=ys(i,1,e,t),u===!1)return!1;var J=ys(i,5,e,t);if(J===!1||(m=Pn(i,9,e,t),m===!1))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_EXTENDED_DATA ("+u+")"),e.emit("CHANNEL_EXTENDED_DATA:"+u,J,m)}else if(R===ir.CHANNEL_WINDOW_ADJUST){if(u=ys(i,1,e,t),u===!1)return!1;var X=ys(i,5,e,t);if(X===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_WINDOW_ADJUST ("+u+", "+X+")"),e.emit("CHANNEL_WINDOW_ADJUST:"+u,X)}else if(R===ir.CHANNEL_SUCCESS){if(u=ys(i,1,e,t),u===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_SUCCESS ("+u+")"),e.emit("CHANNEL_SUCCESS:"+u)}else if(R===ir.CHANNEL_FAILURE){if(u=ys(i,1,e,t),u===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_FAILURE ("+u+")"),e.emit("CHANNEL_FAILURE:"+u)}else if(R===ir.CHANNEL_EOF){if(u=ys(i,1,e,t),u===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_EOF ("+u+")"),e.emit("CHANNEL_EOF:"+u)}else if(R===ir.CHANNEL_OPEN){var H=Pn(i,1,"ascii",e,t);if(H===!1||(y=ys(i,i._pos,e,t),y===!1)||(w=ys(i,i._pos+=4,e,t),w===!1)||(v=ys(i,i._pos+=4,e,t),v===!1))return!1;var ae;if(e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_OPEN ("+y+", "+H+")"),H==="forwarded-tcpip"||H==="direct-tcpip"){var le=Pn(i,i._pos+=4,"ascii",e,t);if(le===!1)return!1;var D=ys(i,i._pos,e,t);if(D===!1||(p=Pn(i,i._pos+=4,"ascii",e,t),p===!1)||(h=ys(i,i._pos,e,t),h===!1))return!1;ae={type:H,sender:y,window:w,packetSize:v,data:{destIP:le,destPort:D,srcIP:p,srcPort:h}}}else if(H==="forwarded-streamlocal@openssh.com"||H==="direct-streamlocal@openssh.com"){if(I=Pn(i,i._pos+=4,"utf8",e,t),I===!1)return!1;ae={type:H,sender:y,window:w,packetSize:v,data:{socketPath:I}}}else if(H==="x11"){if(p=Pn(i,i._pos+=4,"ascii",e,t),p===!1||(h=ys(i,i._pos,e,t),h===!1))return!1;ae={type:H,sender:y,window:w,packetSize:v,data:{srcIP:p,srcPort:h}}}else ae={type:H,sender:y,window:w,packetSize:v,data:{}};e.emit("CHANNEL_OPEN",ae)}else if(R===ir.CHANNEL_OPEN_CONFIRMATION){if(b=ys(i,1,e,t),b===!1||(y=ys(i,5,e,t),y===!1)||(w=ys(i,9,e,t),w===!1)||(v=ys(i,13,e,t),v===!1))return!1;l={recipient:b,sender:y,window:w,packetSize:v},i.length>17&&(l.data=i.slice(17)),e.emit("CHANNEL_OPEN_CONFIRMATION:"+l.recipient,l)}else if(R===ir.CHANNEL_OPEN_FAILURE){if(b=ys(i,1,e,t),b===!1)return!1;var ie=ys(i,5,e,t);if(ie===!1||(A=Pn(i,9,"utf8",e,t),A===!1)||(o=Pn(i,i._pos,"utf8",e,t),o===!1))return!1;i._pos=9,l={recipient:b,reasonCode:ie,reason:t$s[ie],description:A,lang:o},e.emit("CHANNEL_OPEN_FAILURE:"+l.recipient,l)}else if(R===ir.CHANNEL_CLOSE){if(u=ys(i,1,e,t),u===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_CLOSE ("+u+")"),e.emit("CHANNEL_CLOSE:"+u)}else if(R!==ir.IGNORE){if(R===ir.DISCONNECT){var re=ys(i,1,e,t);if(re===!1)return!1;var Pe=Da[re];if(A=Pn(i,5,"utf8",e,t),A===!1)return!1;i._pos<i.length&&(o=Pn(i,i._pos,"ascii",e,t)),e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: DISCONNECT ("+Pe+")"),e.emit("DISCONNECT",Pe,re,A,o)}else if(R===ir.DEBUG){if(c=Pn(i,2,"utf8",e,t),c===!1||(o=Pn(i,i._pos,"ascii",e,t),o===!1))return!1;e.emit("DEBUG",c,o)}else if(R===ir.NEWKEYS)e.emit("NEWKEYS");else if(R===ir.SERVICE_REQUEST){if(a=Pn(i,1,"ascii",e,t),a===!1)return!1;e.emit("SERVICE_REQUEST",a)}else if(R===ir.SERVICE_ACCEPT){if(a=Pn(i,1,"ascii",e,t),a===!1)return!1;e.emit("SERVICE_ACCEPT",a)}else if(R===ir.USERAUTH_REQUEST){var B=Pn(i,1,"utf8",e,t);if(B===!1)return!1;var ee=Pn(i,i._pos,"ascii",e,t);if(ee===!1)return!1;var Ge=Pn(i,i._pos,"ascii",e,t);if(Ge===!1)return!1;var We,nt;if(Ge==="password"){if(We=Pn(i,i._pos+1,"utf8",e,t),We===!1)return!1}else if(Ge==="publickey"||Ge==="hostbased"){var Tt,qt,er,ct,ft,ur,pt;if(Ge==="publickey"){if(Tt=i[i._pos++],Tt===void 0)return!1;Tt=Tt!==0}if(qt=Pn(i,i._pos,"ascii",e,t),qt===!1||(er=Pn(i,i._pos,e,t),er===!1))return!1;if(Tt||Ge==="hostbased"){if(Ge==="hostbased"&&(ur=Pn(i,i._pos,"ascii",e,t),ur===!1||(pt=Pn(i,i._pos,"utf8",e,t),pt===!1)))return!1;var sr=i._pos;if(ct=Pn(i,sr,e,t),ct===!1||(ct.length>4+qt.length+4&&ct.toString("ascii",4,4+qt.length)===qt&&(ct=ct.slice(4+qt.length+4)),ct=J9t(ct,qt,e,t),ct===!1))return!1;ft=Buffer.allocUnsafe(4+n.sessionId.length+sr),Ye(ft,n.sessionId.length,0),n.sessionId.copy(ft,4),i.copy(ft,4+n.sessionId.length,0,sr)}else nt="publickey -- check";We={keyAlgo:qt,key:er,signature:ct,blob:ft,localHostname:ur,localUsername:pt}}else if(Ge==="keyboard-interactive"){var Nr=ys(i,i._pos,e,t);if(Nr===!1||(We=Pn(i,i._pos+4+Nr,"utf8",e,t),We===!1))return!1}else Ge!=="none"&&(We=i.slice(i._pos));nt===void 0&&(nt=Ge),e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_REQUEST ("+nt+")"),e._state.authsQueue.push(Ge),e.emit("USERAUTH_REQUEST",B,ee,Ge,We)}else if(R===ir.USERAUTH_SUCCESS)n.compress.type==="zlib@openssh.com"&&(n.compress.instance=VS.createDeflate(nx),n.compress.queue=[]),r.decompress.type==="zlib@openssh.com"&&(r.decompress.instance=VS.createInflate(nx)),e._state.authsQueue.shift(),e.emit("USERAUTH_SUCCESS");else if(R===ir.USERAUTH_FAILURE){var Ue=Pn(i,1,"ascii",e,t);if(Ue===!1)return!1;var Rr=i[i._pos];if(Rr===void 0)return!1;Rr=Rr!==0,Ue=Ue.split(","),e._state.authsQueue.shift(),e.emit("USERAUTH_FAILURE",Ue,Rr)}else if(R===ir.USERAUTH_BANNER){if(c=Pn(i,1,"utf8",e,t),c===!1||(o=Pn(i,i._pos,"utf8",e,t),o===!1))return!1;e.emit("USERAUTH_BANNER",c,o)}else if(R===ir.GLOBAL_REQUEST){var z=Pn(i,1,"ascii",e,t);if(z===!1)return e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: GLOBAL_REQUEST"),!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: GLOBAL_REQUEST ("+z+")");var Q=i[i._pos++];if(Q===void 0)return!1;Q=Q!==0;var ge;if(z==="tcpip-forward"||z==="cancel-tcpip-forward"){var xe=Pn(i,i._pos,"ascii",e,t);if(xe===!1)return!1;var je=ys(i,i._pos,e,t);if(je===!1)return!1;ge={bindAddr:xe,bindPort:je}}else if(z==="streamlocal-forward@openssh.com"||z==="cancel-streamlocal-forward@openssh.com"){if(I=Pn(i,i._pos,"utf8",e,t),I===!1)return!1;ge={socketPath:I}}else z==="no-more-sessions@openssh.com"||(ge=i.slice(i._pos));e.emit("GLOBAL_REQUEST",z,Q,ge)}else if(R===ir.REQUEST_SUCCESS)i.length>1?e.emit("REQUEST_SUCCESS",i.slice(1)):e.emit("REQUEST_SUCCESS");else if(R===ir.REQUEST_FAILURE)e.emit("REQUEST_FAILURE");else if(R!==ir.UNIMPLEMENTED){if(R===ir.KEXINIT)return _$s(e,t);if(R===ir.CHANNEL_REQUEST)return C$s(e,t);if(R>=30&&R<=49)return b$s(e,R,t);if(R>=60&&R<=70)return S$s(e,R,t);var jt=Buffer.allocUnsafe(1+4);jt[0]=ir.UNIMPLEMENTED,Ye(jt,s,1),Tn(e,jt)}}}function _$s(e,t){var r=e._state.incoming,n=r.payload,i={algorithms:{kex:void 0,srvHostKey:void 0,cs:{encrypt:void 0,mac:void 0,compress:void 0},sc:{encrypt:void 0,mac:void 0,compress:void 0}},languages:{cs:void 0,sc:void 0}},s;if(s=th(n,17,e,t),s===!1||(i.algorithms.kex=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.srvHostKey=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.cs.encrypt=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.sc.encrypt=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.cs.mac=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.sc.mac=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.cs.compress=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.sc.compress=s,s=th(n,n._pos,e,t),s===!1)||(i.languages.cs=s,s=th(n,n._pos,e,t),s===!1))return!1;i.languages.sc=s;var a=n._pos<n.length&&n[n._pos]===1;r.kexinit=n,e.emit("KEXINIT",i,a)}function b$s(e,t,r){var n=e._state,i=n.incoming,s=i.payload;if(n.outgoing.status===X_||MJ(e,t)!==i.expectedPacket){e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, expected: "+i.expectedPacket+" but got: "+MJ(e,t)),e.disconnect(Da.PROTOCOL_ERROR);var a=new Error("Received unexpected packet");return a.level="protocol",e.emit("error",a),!1}if(n.kex.type==="groupex"){if(e.server){e.disconnect(Da.PROTOCOL_ERROR);var a=new Error("DH group exchange not supported by server");return a.level="handshake",e.emit("error",a),!1}else if(t===ir.KEXDH_GEX_GROUP){var o=Pn(s,1,e,r);if(o===!1)return!1;var c=Pn(s,s._pos,e,r);if(c===!1)return!1;e.emit("KEXDH_GEX_GROUP",o,c)}else if(t===ir.KEXDH_GEX_REPLY)return u7t(e,r)}else if(t===ir.KEXDH_INIT){var l=Pn(s,1,e,r);if(l===!1)return!1;e.emit("KEXDH_INIT",l)}else if(t===ir.KEXDH_REPLY)return u7t(e,r)}function u7t(e,t){var r=e._state.incoming.payload,n=Pn(r,1,e,t);if(n===!1)return!1;var i=Pn(r,r._pos,e,t);if(i===!1)return!1;var s=Pn(r,r._pos,e,t);if(s===!1)return!1;var a={hostkey:n,hostkey_format:void 0,pubkey:i,sig:s,sig_format:void 0},o=Pn(n,0,"ascii",e,t);if(o===!1)return!1;a.hostkey_format=o;var c=Pn(s,0,"ascii",e,t);if(c===!1)return!1;a.sig_format=c,e.emit("KEXDH_REPLY",a)}function S$s(e,t,r){var n=e._state,i=n.authsQueue[0],s=n.incoming.payload,a,o,c;if(i==="password"){if(t===ir.USERAUTH_PASSWD_CHANGEREQ){if(a=Pn(s,1,"utf8",e,r),a===!1||(o=Pn(s,s._pos,"utf8",e,r),o===!1))return!1;e.emit("USERAUTH_PASSWD_CHANGEREQ",a,o)}}else if(i==="keyboard-interactive"){if(t===ir.USERAUTH_INFO_REQUEST){var l,u,m;if(l=Pn(s,1,"utf8",e,r),l===!1||(u=Pn(s,s._pos,"utf8",e,r),u===!1)||(o=Pn(s,s._pos,"utf8",e,r),o===!1)||(m=ys(s,s._pos,e,r),m===!1))return!1;s._pos+=4;for(var p=[],h=0;h<m;++h){if(c=Pn(s,s._pos,"utf8",e,r),c===!1)return!1;var y=s[s._pos++];if(y===void 0)return!1;y=y!==0,p.push({prompt:c,echo:y})}e.emit("USERAUTH_INFO_REQUEST",l,u,o,p)}else if(t===ir.USERAUTH_INFO_RESPONSE){var w=ys(s,1,e,r);if(w===!1)return!1;s._pos=5;for(var v=[],b=0;b<w;++b){if(c=Pn(s,s._pos,"utf8",e,r),c===!1)return!1;v.push(c)}e.emit("USERAUTH_INFO_RESPONSE",v)}}else if(i==="publickey"){if(t===ir.USERAUTH_PK_OK){var A=e._state.authsQueue;if(!A.length||A[0]!=="publickey")return;A.shift(),e.emit("USERAUTH_PK_OK")}}else if(i!==void 0){e.disconnect(Da.PROTOCOL_ERROR);var I=new Error("Invalid authentication method: "+i);I.level="protocol",e.emit("error",I)}}function C$s(e,t){var r=e._state.incoming.payload,n,i,s,a,o,c,l,u=ys(r,1,e,t);if(u===!1)return!1;var m=Pn(r,5,"ascii",e,t);if(m===!1)return!1;if(m==="exit-status"){var p=ys(r,++r._pos,e,t);if(p===!1)return!1;n={recipient:u,request:m,wantReply:!1,code:p}}else if(m==="exit-signal"){var h;if(e.remoteBugs&DJ.OLD_EXIT){if(l=ys(r,++r._pos,e,t),l===!1)return!1;switch(l){case 1:l="HUP";break;case 2:l="INT";break;case 3:l="QUIT";break;case 6:l="ABRT";break;case 9:l="KILL";break;case 14:l="ALRM";break;case 15:l="TERM";break;default:l="UNKNOWN ("+l+")"}h=!1}else{if(l=Pn(r,++r._pos,"ascii",e,t),l===!1||(h=r[r._pos++],h===void 0))return!1;h=h!==0}var y=Pn(r,r._pos,"utf8",e,t);if(y===!1)return!1;var w=Pn(r,r._pos,"utf8",e,t);if(w===!1)return!1;n={recipient:u,request:m,wantReply:!1,signal:l,coredump:h,description:y,lang:w}}else if(m==="pty-req"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var v=Pn(r,r._pos,"ascii",e,t);if(v===!1||(i=ys(r,r._pos,e,t),i===!1)||(s=ys(r,r._pos+=4,e,t),s===!1)||(a=ys(r,r._pos+=4,e,t),a===!1)||(o=ys(r,r._pos+=4,e,t),o===!1))return!1;var b=Pn(r,r._pos+=4,e,t);if(b===!1)return!1;b=A$s(b),n={recipient:u,request:m,wantReply:c,term:v,cols:i,rows:s,width:a,height:o,modes:b}}else if(m==="window-change"){if(i=ys(r,++r._pos,e,t),i===!1||(s=ys(r,r._pos+=4,e,t),s===!1)||(a=ys(r,r._pos+=4,e,t),a===!1)||(o=ys(r,r._pos+=4,e,t),o===!1))return!1;n={recipient:u,request:m,wantReply:!1,cols:i,rows:s,width:a,height:o}}else if(m==="x11-req"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var A=r[r._pos++];if(A===void 0)return!1;A=A!==0;var I=Pn(r,r._pos,"ascii",e,t);if(I===!1)return!1;var R=Pn(r,r._pos,"binary",e,t);if(R===!1)return!1;var F=ys(r,r._pos,e,t);if(F===!1)return!1;n={recipient:u,request:m,wantReply:c,single:A,protocol:I,cookie:R,screen:F}}else if(m==="env"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var J=Pn(r,r._pos,"utf8",e,t);if(J===!1)return!1;var X=Pn(r,r._pos,"utf8",e,t);if(X===!1)return!1;n={recipient:u,request:m,wantReply:c,key:J,val:X}}else if(m==="shell"){if(c=r[r._pos],c===void 0)return!1;c=c!==0,n={recipient:u,request:m,wantReply:c}}else if(m==="exec"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var H=Pn(r,r._pos,"utf8",e,t);if(H===!1)return!1;n={recipient:u,request:m,wantReply:c,command:H}}else if(m==="subsystem"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var ae=Pn(r,r._pos,"utf8",e,t);if(ae===!1)return!1;n={recipient:u,request:m,wantReply:c,subsystem:ae}}else if(m==="signal"){if(l=Pn(r,++r._pos,"ascii",e,t),l===!1)return!1;n={recipient:u,request:m,wantReply:!1,signal:"SIG"+l}}else if(m==="xon-xoff"){var le=r[++r._pos];if(le===void 0)return!1;le=le!==0,n={recipient:u,request:m,wantReply:!1,clientControl:le}}else if(m==="auth-agent-req@openssh.com"){if(c=r[r._pos],c===void 0)return!1;c=c!==0,n={recipient:u,request:m,wantReply:c}}else{if(c=r[r._pos],c===void 0)return!1;c=c!==0,n={recipient:u,request:m,wantReply:c}}e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_REQUEST ("+u+", "+m+")"),e.emit("CHANNEL_REQUEST:"+u,n)}function E$s(e,t){var r=e._state.incoming,n=r.hmac;if(e.debug("DEBUG: Parser: Verifying MAC"),r.decrypt.info.authLen>0){var i=r.decrypt,s=i.instance;s.setAuthTag(t);var a=s.update(r.packet);return r.payload=a.slice(1,r.packet.length-a[0]),Z9t(i.iv),i.instance=$s.createDecipheriv(J1[i.type],i.key,i.iv),i.instance.setAutoPadding(!1),!0}else{var o=$s.createHmac(J1[n.type],n.key);Ye(LJ,r.seqno,0),Ye(LJ,r.pktLen,4),LJ[8]=r.padLen,o.update(LJ),o.update(r.packet);var c=o.digest();return c.length>r.hmac.info.actualLen&&(c=c.slice(0,r.hmac.info.actualLen)),q$s(c,t)}}function m7t(e,t){var r=e._state.incoming.decrypt.instance;return e.debug("DEBUG: Parser: Decrypting"),r.update(t)}function XS(e,t,r,n){var i=e._state.incoming.expect;i.amount=r,i.type=t,i.ptr=0,n?i.buf=n:r&&(i.buf=Buffer.allocUnsafe(r))}function th(e,t,r,n){var i=Pn(e,t,"ascii",r,n);return i!==!1?i.length?i.split(","):[]:!1}function A$s(e){for(var t={},r=0,n=e.length,i;r<n&&(i=e[r],!(i===ex.TTY_OP_END||ex[i]===void 0||r+5>n));r+=5)t[ex[i]]=wNe(e,r+1);return t}function P$s(e){for(var t=/^\d+$/,r=Object.keys(e),n=0,i=[],s=0,a=r.length,o,c,l;s<a;++s)o=r[s],c=ex[o],c&&!t.test(o)&&typeof e[o]=="number"&&o!=="TTY_OP_END"&&(l=e[o],i[n++]=c,i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=l&255);return i[n]=ex.TTY_OP_END,i}function kNe(e,t){return I$s(16,function(r){var n=e.config.algorithms,i=n.kexBuf;if(e.remoteBugs&DJ.BAD_DHGEX){for(var s=!1,a=n.kex,o=a.length-1;o>=0;--o)a[o].indexOf("group-exchange")!==-1&&(s||(a=a.slice(),s=!0),a.splice(o,1));s&&(i=Buffer.from(a.join(",")))}var c=n.serverHostKeyBuf,l=1+16+4+i.length+4+c.length+2*(4+n.cipherBuf.length)+2*(4+n.hmacBuf.length)+2*(4+n.compressBuf.length)+2*4+1+4,u=Buffer.allocUnsafe(l),m=17;u[0]=ir.KEXINIT,r!==!1&&r.copy(u,1),Ye(u,i.length,m),m+=4,i.copy(u,m),m+=i.length,Ye(u,c.length,m),m+=4,c.copy(u,m),m+=c.length,Ye(u,n.cipherBuf.length,m),m+=4,n.cipherBuf.copy(u,m),m+=n.cipherBuf.length,Ye(u,n.cipherBuf.length,m),m+=4,n.cipherBuf.copy(u,m),m+=n.cipherBuf.length,Ye(u,n.hmacBuf.length,m),m+=4,n.hmacBuf.copy(u,m),m+=n.hmacBuf.length,Ye(u,n.hmacBuf.length,m),m+=4,n.hmacBuf.copy(u,m),m+=n.hmacBuf.length,Ye(u,n.compressBuf.length,m),m+=4,n.compressBuf.copy(u,m),m+=n.compressBuf.length,Ye(u,n.compressBuf.length,m),m+=4,n.compressBuf.copy(u,m),m+=n.compressBuf.length,u.fill(0,u.length-13),e.debug("DEBUG: Outgoing: Writing KEXINIT"),e._state.incoming.expectedPacket="KEXINIT";var p=e._state.outgoing;p.kexinit=u,p.status===X_&&(p.status=K_),Tn(e,u,t,!0)}),!0}function f7t(e){var t=e._state,r=t.outgoing,n=Buffer.allocUnsafe(1+4+r.pubkey.length);return t.incoming.expectedPacket=t.kex.pktReply,t.kex.type==="groupex"?(n[0]=ir.KEXDH_GEX_INIT,e.debug("DEBUG: Outgoing: Writing KEXDH_GEX_INIT")):(n[0]=ir.KEXDH_INIT,t.kex.type==="group"?e.debug("DEBUG: Outgoing: Writing KEXDH_INIT"):e.debug("DEBUG: Outgoing: Writing KEXECDH_INIT")),Ye(n,r.pubkey.length,1),r.pubkey.copy(n,5),Tn(e,n,void 0,!0)}function x$s(e,t){var r=e._state,n=r.outgoing,i=r.incoming,s=e.config.hostKeys[r.hostkeyFormat];Array.isArray(s)&&(s=s[0]);var a=s.getPublicSSH(),o=s.type;t=r.kex.convertPublicKey(t);var c=r.kex.computeSecret(t);if(c instanceof Error)return c.message="Error while computing DH secret ("+r.kex.type+"): "+c.message,c.level="handshake",e.emit("error",c),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1;var l=$s.createHash(r.kex.hash),u=Buffer.byteLength(i.identRaw),m=Buffer.byteLength(e.config.ident),p=i.kexinit.length,h=n.kexinit.length,y=a.length,w=t.length,v=n.pubkey.length,b=c.length,A=u+m+p+h+y+w+v+b+4*8,I,R,F,J,X=r.kex.getDHParams();X&&(F=X.prime,J=X.generator,I=F.length,R=J.length,A+=4*3,A+=4*2,A+=I,A+=R);var H=0,ae=Buffer.allocUnsafe(A);Ye(ae,u,H),H+=4,ae.write(i.identRaw,H,"utf8"),H+=u,Ye(ae,m,H),H+=4,ae.write(e.config.ident,H,"utf8"),H+=m,Ye(ae,p,H),H+=4,i.kexinit.copy(ae,H),H+=p,i.kexinit=void 0,Ye(ae,h,H),H+=4,n.kexinit.copy(ae,H),H+=h,n.kexinit=void 0,Ye(ae,y,H),H+=4,a.copy(ae,H),H+=y,X&&(RNe.slice(1).copy(ae,H),H+=4*3,Ye(ae,I,H),H+=4,F.copy(ae,H),H+=I,Ye(ae,R,H),H+=4,J.copy(ae,H),H+=R),Ye(ae,w,H),H+=4,t.copy(ae,H),H+=w,Ye(ae,v,H),H+=4,n.pubkey.copy(ae,H),H+=v,Ye(ae,b,H),H+=4,c.copy(ae,H),n.exchangeHash=l.update(ae).digest(),n.sessionId===void 0&&(n.sessionId=n.exchangeHash),n.kexsecret=c;var le=s.sign(n.exchangeHash);if(le instanceof Error)return le.message="Error while signing data with host key ("+o+"): "+le.message,le.level="handshake",e.emit("error",le),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1;if(le=TNe(le,o),le===!1)return le.message="Error while converting handshake signature",le.level="handshake",e.emit("error",le),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1;var D=4+o.length+4+le.length,ie=Buffer.allocUnsafe(1+4+y+4+v+4+D);return H=0,ie[H]=ir[r.kex.pktReply],++H,Ye(ie,y,H),H+=4,a.copy(ie,H),H+=y,Ye(ie,v,H),H+=4,n.pubkey.copy(ie,H),H+=v,Ye(ie,D,H),H+=4,Ye(ie,o.length,H),H+=4,ie.write(o,H,o.length,"ascii"),H+=o.length,Ye(ie,le.length,H),H+=4,le.copy(ie,H),r.incoming.expectedPacket="NEWKEYS",e.debug("DEBUG: Outgoing: Writing "+r.kex.pktReply),Tn(e,ie,void 0,!0),n.sentNEWKEYS=!0,e.debug("DEBUG: Outgoing: Writing NEWKEYS"),Tn(e,xNe,void 0,!0)}function R$s(e){return e._state.incoming.expectedPacket="KEXDH_GEX_GROUP",e.debug("DEBUG: Outgoing: Writing KEXDH_GEX_REQUEST"),Tn(e,RNe,void 0,!0)}function p7t(e,t,r){var n=e._state.outgoing.compress.instance;n.write(t),n.flush(ANe,k$s.bind(e,r))}function k$s(e){if(!(this._readableState.ended||this._writableState.ended)){g7t(this,this._state.outgoing.compress.instance.read(),e);var t=this._state.outgoing.compress.queue;t.shift(),t.length>0&&p7t(this,t[0][0],t[0][1])}}function Tn(e,t,r,n){var i=e._state;if(!i)return!1;var s=i.outgoing;if(s.status===K_&&!n)return typeof r=="function"?s.rekeyQueue.push([t,r]):s.rekeyQueue.push(t),!1;if(e._readableState.ended||e._writableState.ended)return!1;if(s.compress.instance){var a=s.compress.queue;return a.push([t,r]),a.length===1&&p7t(e,a[0][0],a[0][1]),!0}else return g7t(e,t,r)}function g7t(e,t,r){var n=e._state,i=n.outgoing,s=i.encrypt,a=i.hmac,o,c,l,u,m;if(o=t.length+9,s.instance!==!1)if(s.info.authLen>0){for(var p=1+t.length+4;p%s.info.blockLen!=0;)++p;c=p-1-t.length,o=4+p}else{var h=s.info.blockLen;o+=(h-1)*o%h,c=o-t.length-5}else o+=7*o%8,c=o-t.length-5;l=Buffer.allocUnsafe(o),Ye(l,o-4,0),l[4]=c,t.copy(l,5),T$s(l,5+t.length,c),a.type!==!1&&a.key&&(u=$s.createHmac(J1[a.type],a.key),Ye(i.bufSeqno,i.seqno,0),u.update(i.bufSeqno),u.update(l),u=u.digest(),u.length>a.info.actualLen&&(u=u.slice(0,a.info.actualLen)));var y=0,w;if(s.instance!==!1)if(s.info.authLen>0){var v=$s.createCipheriv(J1[s.type],s.key,s.iv);v.setAutoPadding(!1);var b=l.slice(0,4);v.setAAD(b),e.push(b),y+=b,w=v.update(l.slice(4)),e.push(w),y+=w.length;var A=v.final();A.length&&(e.push(A),y+=A.length);var I=v.getAuthTag();m=e.push(I),y+=I.length,Z9t(s.iv)}else w=s.instance.update(l),e.push(w),y+=w.length,m=e.push(u),y+=u.length;else m=e.push(l),y=l.length;return e.bytesSent+=y,++i.seqno>ENe&&(i.seqno=0),r&&r(),m}var T$s=function(){return typeof $s.randomFillSync=="function"?$s.randomFillSync:function(t,r,n){var i=$s.randomBytes(n);i.copy(t,r)}}();function I$s(e,t){$s.randomBytes(e,function r(n,i){if(n)return $s.randomBytes(e,r);t&&t(i)})}function TNe(e,t){switch(t){case"ssh-dss":return Z3s(e);case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":return J3s(e)}return e}var q$s=function(){return typeof $s.timingSafeEqual=="function"?function(t,r){return t.length!==r.length?($s.timingSafeEqual(t,t),!1):$s.timingSafeEqual(t,r)}:function(t,r){var n;t.length===r.length?n=0:(n=1,r=t);for(var i=0,s=t.length;i<s;++i)n|=t[i]^r[i];return n===0}}();function KS(e,t){switch(e){case"curve25519-sha256":case"curve25519-sha256@libssh.org":if(!n$s)break;this.type="25519",this.hash="sha256",this.pktInit="KEXECDH_INIT",this.pktReply="KEXECDH_REPLY";return;case"ecdh-sha2-nistp256":this.type="ecdh",this.name="prime256v1",this.hash="sha256",this.pktInit="KEXECDH_INIT",this.pktReply="KEXECDH_REPLY";return;case"ecdh-sha2-nistp384":this.type="ecdh",this.name="secp384r1",this.hash="sha384",this.pktInit="KEXECDH_INIT",this.pktReply="KEXECDH_REPLY";return;case"ecdh-sha2-nistp521":this.type="ecdh",this.name="secp521r1",this.hash="sha512",this.pktInit="KEXECDH_INIT",this.pktReply="KEXECDH_REPLY";return;case"diffie-hellman-group1-sha1":this.type="group",this.name="modp2",this.hash="sha1",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group14-sha1":this.type="group",this.name="modp14",this.hash="sha1",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group14-sha256":this.type="group",this.name="modp14",this.hash="sha256",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group16-sha512":this.type="group",this.name="modp16",this.hash="sha512",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group18-sha512":this.type="group",this.name="modp18",this.hash="sha512",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group-exchange-sha1":this.type="groupex",this.hash="sha1",this.pktInit="KEXDH_GEX_REQ",this.pktReply="KEXDH_GEX_REPLY",this._prime=null,this._generator=null;return;case"diffie-hellman-group-exchange-sha256":this.type="groupex",this.hash="sha256",this.pktInit="KEXDH_GEX_REQ",this.pktReply="KEXDH_GEX_REPLY",this._prime=null,this._generator=null;return}throw new Error("Unsupported key exchange algorithm: "+e)}KS.prototype.setDHParams=function(e,t){if(this.type==="groupex"){if(!Buffer.isBuffer(e))throw new Error("Invalid prime value");if(!Buffer.isBuffer(t))throw new Error("Invalid generator value");this._prime=e,this._generator=t}};KS.prototype.getDHParams=function(){if(this.type==="groupex"&&this._kex)return{prime:zJ(this._kex.getPrime()),generator:zJ(this._kex.getGenerator())}};KS.prototype.generateKeys=function(){switch(this.type){case"25519":this._keys||(this._keys=$s.generateKeyPairSync("x25519"));break;case"ecdh":this._kex||(this._kex=$s.createECDH(this.name),this._public=this._kex.generateKeys());break;case"group":case"groupex":this._kex||(this.name?this._kex=$s.createDiffieHellmanGroup(this.name):this._prime&&this._generator&&(this._kex=$s.createDiffieHellman(this._prime,this._generator)),this._kex&&(this._public=this._kex.generateKeys()));break}};KS.prototype.getPublicKey=function(){this.generateKeys();var e;switch(this.type){case"25519":return e=this._keys.publicKey.export({type:"spki",format:"der"}),e.slice(-32);case"ecdh":case"group":case"groupex":e=this._public;break}if(e)return this.convertPublicKey(e)};KS.prototype.convertPublicKey=function(e){for(var t,r=0,n=e.length;e[r]===0;)++r,--n;switch(this.type){case"25519":if(e.length===32)return e;break;default:if(e[r]&128)return t=Buffer.allocUnsafe(1+n),t[0]=0,e.copy(t,1,r),t}return n!==e.length&&(t=Buffer.allocUnsafe(n),e.copy(t,0,r),e=t),e};KS.prototype.computeSecret=function(e){switch(this.generateKeys(),this.type){case"25519":try{var t=new Y9t.Writer;return t.startSequence(),t.startSequence(),t.writeOID("1.3.101.110"),t.endSequence(),t.startSequence(Y9t.BitString),t.writeByte(0),t._ensure(e.length),e.copy(t._buf,t._offset,0,e.length),t._offset+=e.length,t.endSequence(),t.endSequence(),zJ($s.diffieHellman({privateKey:this._keys.privateKey,publicKey:$s.createPublicKey({key:t.buffer,type:"spki",format:"der"})}))}catch(r){return r}break;case"ecdh":case"group":case"groupex":try{return zJ(this._kex.computeSecret(e))}catch(r){return r}}};function zJ(e){for(var t=0,r=e.length;e[t]===0;)++t,--r;var n;return e[t]&128?(n=Buffer.allocUnsafe(1+r),n[0]=0,e.copy(n,1,t),e=n):r!==e.length&&(n=Buffer.allocUnsafe(r),e.copy(n,0,t),e=n),e}INe.exports=Bn;INe.exports._send=Tn});var OJ=g((S2o,y7t)=>{y7t.exports={SFTPStream:H9t(),SSH2Stream:h7t(),utils:Yg(),constants:yJ()}});var _7t=g(v7t=>{var w7t=require("http").Agent,D$s=require("https").Agent,N$s=require("util").inherits,qNe;[w7t,D$s].forEach(e=>{function t(r,n){if(!(this instanceof t))return new t(r,n);e.call(this,n),this._connectCfg=r,this._defaultSrcIP=n&&n.srcIP||"localhost"}N$s(t,e),t.prototype.createConnection=L$s,v7t[e===w7t?"SSHTTPAgent":"SSHTTPSAgent"]=t});function L$s(e,t){var r=e&&e.localAddress||this._defaultSrcIP,n=e&&e.localPort||0,i=e.host,s=e.port;qNe===void 0&&(qNe=DNe().Client);var a=new qNe,o=!1;a.on("ready",()=>{a.forwardOut(r,n,i,s,(c,l)=>{if(o=!0,c)return a.end(),t(c);l.once("close",()=>{a.end()}),t(null,M$s(l))})}).on("error",t).on("close",()=>{o||t(new Error("Unexpected connection loss"))}).connect(this._connectCfg)}function AN(){}function M$s(e){return e.setKeepAlive=AN,e.setNoDelay=AN,e.setTimeout=AN,e.ref=AN,e.unref=AN,e.destroySoon=e.destroy,e}});var LNe=g((E2o,A7t)=>{var b7t=require("util").inherits,S7t=require("stream").Duplex,z$s=require("stream").Readable,C7t=require("stream").Writable,O$s=OJ().constants.CHANNEL_EXTENDED_DATATYPE.STDERR,F$s=32*1024,PN=2*1024*1024,FJ=PN/2,E7t=["CHANNEL_EOF","CHANNEL_CLOSE","CHANNEL_DATA","CHANNEL_EXTENDED_DATA","CHANNEL_WINDOW_ADJUST","CHANNEL_SUCCESS","CHANNEL_FAILURE","CHANNEL_REQUEST"],j$s=E7t.length;function Pf(e,t,r){var n={highWaterMark:PN,allowHalfOpen:!r||r&&r.allowHalfOpen!==!1};this.allowHalfOpen=n.allowHalfOpen,S7t.call(this,n);var i=this,s=r&&r.server;this.server=s,this.type=e.type,this.subtype=void 0;var a=this.incoming=e.incoming,o=a.id,c=this.outgoing=e.outgoing,l=this._callbacks=[],u,m,p,h,y;this._client=t,this._hasX11=!1;var w=t._channels,v=t._sshstream;function b(){i._waitClientDrain&&(i._waitClientDrain=!1,i._waitWindow||(i._chunk?i._write(i._chunk,null,i._chunkcb):i._chunkcb?i._chunkcb():i._chunkErr?i.stderr._write(i._chunkErr,null,i._chunkcbErr):i._chunkcbErr&&i._chunkcbErr()))}t._sock.on("drain",b),v.once("CHANNEL_EOF:"+o,function(){a.state==="open"&&(a.state="eof",i.readable&&i.push(null),!s&&i.stderr.readable&&i.stderr.push(null))}).once("CHANNEL_CLOSE:"+o,function(){if(a.state!=="closed"){a.state="closed",i.readable&&i.push(null),s&&i.stderr.writable?i.stderr.end():!s&&i.stderr.readable&&i.stderr.push(null),(c.state==="open"||c.state==="eof")&&i.close(),c.state==="closing"&&(c.state="closed"),delete w[o];var R=i._writableState;t._sock.removeListener("drain",b),!R.ending&&!R.finished&&i.end(),i._callbacks=[];for(var F=0;F<l.length;++F)l[F](!0);l=i._callbacks,s?i.readable?i.once("end",function(){i.emit("close")}):i.emit("close"):(i.readable?i.once("end",function(){u===null?i.emit("close",u,m,p,h,y):i.emit("close",u)}):u===null?i.emit("close",u,m,p,h,y):i.emit("close",u),i.stderr.readable?i.stderr.once("end",function(){i.stderr.emit("close")}):i.stderr.emit("close"));for(var F=0;F<j$s;++F)v.removeAllListeners(E7t[F]+":"+o)}}).on("CHANNEL_DATA:"+o,function(R){if(a.window!==0){if(a.window-=R.length,!i.push(R)){i._waitChanDrain=!0;return}a.window<=FJ&&jJ(i)}}).on("CHANNEL_WINDOW_ADJUST:"+o,function(R){c.window+=R,i._waitWindow&&(i._waitWindow=!1,i._waitClientDrain||(i._chunk?i._write(i._chunk,null,i._chunkcb):i._chunkcb?i._chunkcb():i._chunkErr?i.stderr._write(i._chunkErr,null,i._chunkcbErr):i._chunkcbErr&&i._chunkcbErr()))}).on("CHANNEL_SUCCESS:"+o,function(){s?(v._kalast=Date.now(),v._kacnt=0):t._resetKA(),l.length&&l.shift()(!1)}).on("CHANNEL_FAILURE:"+o,function(){s?(v._kalast=Date.now(),v._kacnt=0):t._resetKA(),l.length&&l.shift()(!0)}).on("CHANNEL_REQUEST:"+o,function(R){if(!s){if(R.request==="exit-status"){i.emit("exit",u=R.code);return}else if(R.request==="exit-signal"){i.emit("exit",u=null,m="SIG"+R.signal,p=R.coredump,h=R.description,y=R.lang);return}}R.wantReply&&v.channelFailure(c.id)}),this.stdin=this.stdout=this,s?this.stderr=new NNe(this):(this.stderr=new z$s(n),this.stderr._read=function(R){i._waitChanDrain&&(i._waitChanDrain=!1,a.window<=FJ&&jJ(i))},v.on("CHANNEL_EXTENDED_DATA:"+o,function(R,F){if(a.window!==0){if(a.window-=F.length,!i.stderr.push(F)){i._waitChanDrain=!0;return}a.window<=FJ&&jJ(i)}})),this._waitClientDrain=!1,this._waitWindow=!1,this._waitChanDrain=!1,this._chunk=void 0,this._chunkcb=void 0,this._chunkErr=void 0,this._chunkcbErr=void 0;function A(){i.eof(),(s||!s&&!i.allowHalfOpen)&&i.close(),i.writable=!1}this.on("finish",A).on("prefinish",A);function I(){i.readable=!1}this.on("end",I).on("close",I)}b7t(Pf,S7t);Pf.prototype.eof=function(){var e=!0,t=this.outgoing;return t.state==="open"&&(t.state="eof",e=this._client._sshstream.channelEOF(t.id)),e};Pf.prototype.close=function(){var e=!0,t=this.outgoing;return(t.state==="open"||t.state==="eof")&&(t.state="closing",e=this._client._sshstream.channelClose(t.id)),e};Pf.prototype._read=function(e){this._waitChanDrain&&(this._waitChanDrain=!1,this.incoming.window<=FJ&&jJ(this))};Pf.prototype._write=function(e,t,r){var n=this._client._sshstream,i=this.outgoing,s=i.packetSize,a=i.id,o=i.window,c=e.length,l=0,u,m,p;if(i.state==="open"){for(;c-l>0&&o>0;)if(p=c-l,p>o&&(p=o),p>s&&(p=s),u=n.channelData(a,e.slice(l,l+p)),l+=p,o-=p,!u){this._waitClientDrain=!0,this._chunk=void 0,this._chunkcb=r;break}if(i.window=o,c-l>0){o===0&&(this._waitWindow=!0),l>0?(m=Buffer.allocUnsafe(c-l),e.copy(m,0,l),this._chunk=m):this._chunk=e,this._chunkcb=r;return}this._waitClientDrain||r()}};Pf.prototype.destroy=function(){this.end()};Pf.prototype.setWindow=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");return this.type==="session"&&(this.subtype==="shell"||this.subtype==="exec")&&this.writable&&this.outgoing.state==="open"?this._client._sshstream.windowChange(this.outgoing.id,e,t,r,n):!0};Pf.prototype.signal=function(e){if(this.server)throw new Error("Client-only method called in server mode");return this.type==="session"&&this.writable&&this.outgoing.state==="open"?this._client._sshstream.signal(this.outgoing.id,e):!0};Pf.prototype.exit=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");return this.type==="session"&&this.writable&&this.outgoing.state==="open"?typeof e=="number"?this._client._sshstream.exitStatus(this.outgoing.id,e):this._client._sshstream.exitSignal(this.outgoing.id,e,t,r):!0};Pf.MAX_WINDOW=PN;Pf.PACKET_SIZE=F$s;function jJ(e){if(e.outgoing.state==="closed")return!0;var t=PN-e.incoming.window;return t<=0?!0:(e.incoming.window+=t,e._client._sshstream.channelWindowAdjust(e.outgoing.id,t))}function NNe(e){C7t.call(this,{highWaterMark:PN}),this._channel=e}b7t(NNe,C7t);NNe.prototype._write=function(e,t,r){var n=this._channel,i=n._client._sshstream,s=n.outgoing,a=s.packetSize,o=s.id,c=s.window,l=e.length,u=0,m,p,h;if(n.outgoing.state==="open"){for(;l-u>0&&c>0;)if(h=l-u,h>c&&(h=c),h>a&&(h=a),m=i.channelExtData(o,e.slice(u,u+h),O$s),u+=h,c-=h,!m){n._waitClientDrain=!0,n._chunkErr=void 0,n._chunkcbErr=r;break}if(s.window=c,l-u>0){c===0&&(n._waitWindow=!0),u>0?(p=Buffer.allocUnsafe(l-u),e.copy(p,0,u),n._chunkErr=p):n._chunkErr=e,n._chunkcbErr=r;return}n._waitClientDrain||r()}};A7t.exports=Pf});var ix=g((A2o,P7t)=>{P7t.exports={readUInt32BE:function(t,r){return t[r++]*16777216+t[r++]*65536+t[r++]*256+t[r]},writeUInt32BE:function(t,r,n){return t[n++]=r>>>24,t[n++]=r>>>16,t[n++]=r>>>8,t[n++]=r,n},writeUInt32LE:function(t,r,n){return t[n++]=r,t[n++]=r>>>8,t[n++]=r>>>16,t[n++]=r>>>24,n}}});var j7t=g((P2o,F7t)=>{var x7t=require("net").Socket,B$s=require("events").EventEmitter,U$s=require("util").inherits,$$s=require("path"),R7t=require("fs"),k7t=require("child_process"),T7t=ix().readUInt32BE,BJ=ix().writeUInt32BE,I7t=ix().writeUInt32LE,G$s=11,H$s=12,V$s=13,X$s=14,K$s=5,W$s=/^\!<socket >(\d+) s ([A-Z0-9]{8}\-[A-Z0-9]{8}\-[A-Z0-9]{8}\-[A-Z0-9]{8})/,Q$s=/^[/\\][/\\]\.[/\\]pipe[/\\].+/;F7t.exports=function(e,t,r,n,i){var s,a,o,c,l=0,u=Buffer.isBuffer(t),m,p=0,h=0,y=0,w,v=0,b=!1,A,I;typeof t=="function"&&typeof r=="function"?(A=t,I=r):u?(l=t.length,c=n.length):(i=t,t=void 0);function R(){var le;if(u){var D=9;le=Buffer.allocUnsafe(4+1+4+l+4+c+4),BJ(le,le.length-4,0),le[4]=V$s,BJ(le,l,5),t.copy(le,D),BJ(le,c,D+=l),n.copy(le,D+=4),BJ(le,0,D+=c),s.write(le)}else s.write(Buffer.from([0,0,0,1,G$s]))}function F(le){for(var D=0,ie=le.length;D<ie;++D)if(m===void 0)++p==5&&(m=le[D],p=0);else if(m===X$s){if(!o)h<<=8,h+=le[D],++p==4&&(o=Buffer.allocUnsafe(h),p=0);else if(o[p]=le[D],++p===h)return s.removeAllListeners("data"),s.destroy()}else if(m===H$s)if(w===void 0){if(y<<=8,y+=le[D],++p==4&&(w=new Array(y),p=0,y===0))return s.removeAllListeners("data"),s.destroy()}else if(!t)l<<=8,l+=le[D],++p==4&&(t=Buffer.allocUnsafe(l),p=0);else if(b===!1){if(t[p]=le[D],++p===l&&(w[y-1]=t,l=0,p=0,b=!0,--y==0))return t=void 0,s.removeAllListeners("data"),s.destroy()}else b===!0?(v<<=8,v+=le[D],++p==4&&(p=0,v>0?b=v:(t=void 0,b=!1),v=0)):++p===b&&(b=!1,p=0,t=void 0);else if(m===K$s)return u?a=new Error("Agent unable to sign data"):a=new Error("Unable to retrieve list of keys from agent"),s.removeAllListeners("data"),s.destroy()}function J(le){a=le}function X(){a?i(a):u&&!o||!u&&!w?i(new Error("Unexpected disconnection from agent")):u&&o?i(void 0,o):!u&&w&&i(void 0,w)}if(process.platform==="win32"&&!Q$s.test(e))if(e==="pageant")s=new Y$s;else{var H=!1;R7t.readFile(e,function le(D,ie){if(D){if(H)return i(new Error("Invalid cygwin unix socket path"));k7t.exec('cygpath -w "'+e+'"',function(Nr,Ue,Rr){if(Nr||Ue.length===0)return i(new Error("Invalid cygwin unix socket path"));H=!0,e=Ue.toString().replace(/[\r\n]/g,""),R7t.readFile(e,le)});return}var re;if(re=W$s.exec(ie.toString("ascii"))){let Nr=function(){We=0,Ge="secret",s.write(ee)},Ue=function(Q){We+=Q.length,Ge==="secret"?We===16&&(We=0,Ge="creds",s.write(qt)):Ge==="creds"&&(nt||Tt.push(Q),We===12&&(s.removeListener("connect",Nr),s.removeListener("data",Ue),s.removeListener("close",Rr),nt?(ae(),s.emit("connect")):(nt=!0,qt=Buffer.concat(Tt),I7t(qt,process.pid,0),s.destroy(),z())))},Rr=function(){i(new Error("Problem negotiating cygwin unix socket security"))},z=function(){s=new x7t,s.once("connect",Nr),s.on("data",Ue),s.once("close",Rr),s.connect(Pe)};var pt=Nr,sr=Ue,ft=Rr,ur=z,Pe,B,ee,Ge,We=0,nt=!1,Tt=[],qt=Buffer.allocUnsafe(12),er,ct;for(qt.fill(0),Pe=parseInt(re[1],10),B=re[2].replace(/\-/g,""),ee=Buffer.allocUnsafe(16),er=0,ct=0;ct<32;++er,ct+=2)ee[er]=parseInt(B.substring(ct,ct+2),16);for(er=0;er<16;er+=4)I7t(ee,T7t(ee,er),er);z()}else i(new Error("Malformed cygwin unix socket file"))});return}else s=new x7t;function ae(){if(!A&&!I)s.once("connect",R),s.on("data",F),s.once("error",J),s.once("close",X);else{var le;s.once("connect",function(){le=A();var D=!1;function ie(){D||(s.destroy(),D=!0)}le.once("end",ie).once("close",ie).on("data",function(re){s.write(re)}),s.on("data",function(re){le.write(re)})}),s.once("close",function(){le||I()})}}ae(),s.connect(e)};if(process.platform==="win32"){let e=function(){this.proc=void 0,this.buffer=null};Y$s=e,q7t=10,D7t=11,N7t=12,L7t=13,M7t=14,z7t=15,ww={},O7t=$$s.resolve(__dirname,"..","util/pagent.exe"),ww[q7t]=new Error("Invalid pagent.exe arguments"),ww[D7t]=new Error("Pageant is not running"),ww[N7t]=new Error("pagent.exe could not create an mmap"),ww[L7t]=new Error("pagent.exe could not set mode for stdin"),ww[M7t]=new Error("pagent.exe could not set mode for stdout"),ww[z7t]=new Error("pagent.exe did not get expected input payload"),U$s(e,B$s),e.prototype.write=function(t){if(this.buffer===null?this.buffer=t:this.buffer=Buffer.concat([this.buffer,t],this.buffer.length+t.length),!(this.buffer.length<4)){var r=T7t(this.buffer,0);if(!(this.buffer.length-4<r)){t=this.buffer.slice(0,4+r),this.buffer.length>4+r?this.buffer=this.buffer.slice(4+r):this.buffer=null;var n=this,i,s=!1;i=this.proc=k7t.spawn(O7t,[t.length]),i.stdout.on("data",function(a){n.emit("data",a)}),i.once("error",function(a){s||(s=!0,n.emit("error",a))}),i.once("close",function(a){n.proc=void 0,ww[a]&&!s&&(s=!0,n.emit("error",ww[a])),n.emit("close",s)}),i.stdin.end(t)}}},e.prototype.end=e.prototype.destroy=function(){this.buffer=null,this.proc&&(this.proc.kill(),this.proc=void 0)},e.prototype.connect=function(){this.emit("connect")}}var q7t,D7t,N7t,L7t,M7t,z7t,ww,O7t,Y$s});var $7t=g((x2o,U7t)=>{var Z$s=require("util").inherits,B7t=require("events").EventEmitter;function as(e){var t=this;B7t.call(this),this._stream=e,e.on("error",function(r){t.emit("error",r)}).on("end",function(){t.emit("end")}).on("close",function(){t.emit("close")}).on("continue",function(){t.emit("continue")})}Z$s(as,B7t);as.prototype.end=function(){return this._stream.end()};as.prototype.createReadStream=function(e,t){return this._stream.createReadStream(e,t)};as.prototype.createWriteStream=function(e,t){return this._stream.createWriteStream(e,t)};as.prototype.open=function(e,t,r,n){return this._stream.open(e,t,r,n)};as.prototype.close=function(e,t){return this._stream.close(e,t)};as.prototype.read=function(e,t,r,n,i,s){return this._stream.readData(e,t,r,n,i,s)};as.prototype.write=function(e,t,r,n,i,s){return this._stream.writeData(e,t,r,n,i,s)};as.prototype.fastGet=function(e,t,r,n){return this._stream.fastGet(e,t,r,n)};as.prototype.fastPut=function(e,t,r,n){return this._stream.fastPut(e,t,r,n)};as.prototype.readFile=function(e,t,r){return this._stream.readFile(e,t,r)};as.prototype.writeFile=function(e,t,r,n){return this._stream.writeFile(e,t,r,n)};as.prototype.appendFile=function(e,t,r,n){return this._stream.appendFile(e,t,r,n)};as.prototype.exists=function(e,t){return this._stream.exists(e,t)};as.prototype.unlink=function(e,t){return this._stream.unlink(e,t)};as.prototype.rename=function(e,t,r){return this._stream.rename(e,t,r)};as.prototype.mkdir=function(e,t,r){return this._stream.mkdir(e,t,r)};as.prototype.rmdir=function(e,t){return this._stream.rmdir(e,t)};as.prototype.readdir=function(e,t,r){return this._stream.readdir(e,t,r)};as.prototype.fstat=function(e,t){return this._stream.fstat(e,t)};as.prototype.stat=function(e,t){return this._stream.stat(e,t)};as.prototype.lstat=function(e,t){return this._stream.lstat(e,t)};as.prototype.opendir=function(e,t){return this._stream.opendir(e,t)};as.prototype.setstat=function(e,t,r){return this._stream.setstat(e,t,r)};as.prototype.fsetstat=function(e,t,r){return this._stream.fsetstat(e,t,r)};as.prototype.futimes=function(e,t,r,n){return this._stream.futimes(e,t,r,n)};as.prototype.utimes=function(e,t,r,n){return this._stream.utimes(e,t,r,n)};as.prototype.fchown=function(e,t,r,n){return this._stream.fchown(e,t,r,n)};as.prototype.chown=function(e,t,r,n){return this._stream.chown(e,t,r,n)};as.prototype.fchmod=function(e,t,r){return this._stream.fchmod(e,t,r)};as.prototype.chmod=function(e,t,r){return this._stream.chmod(e,t,r)};as.prototype.readlink=function(e,t){return this._stream.readlink(e,t)};as.prototype.symlink=function(e,t,r){return this._stream.symlink(e,t,r)};as.prototype.realpath=function(e,t){return this._stream.realpath(e,t)};as.prototype.ext_openssh_rename=function(e,t,r){return this._stream.ext_openssh_rename(e,t,r)};as.prototype.ext_openssh_statvfs=function(e,t){return this._stream.ext_openssh_statvfs(e,t)};as.prototype.ext_openssh_fstatvfs=function(e,t){return this._stream.ext_openssh_fstatvfs(e,t)};as.prototype.ext_openssh_hardlink=function(e,t,r){return this._stream.ext_openssh_hardlink(e,t,r)};as.prototype.ext_openssh_fsync=function(e,t){return this._stream.ext_openssh_fsync(e,t)};U7t.exports=as});var V7t=g((R2o,H7t)=>{function G7t(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}function xN(e,t,r){var n=this._streams=[];this._timer=void 0,this._timerInterval=e,this._timerfn=function(){for(var i=Date.now(),s=0,a=n.length,o,c;s<a;++s)if(o=n[s],c=o._kalast,c&&i-c>=t)if(++o._kacnt>r){var l=new Error("Keepalive timeout");l.level="client-timeout",o.emit("error",l),o.disconnect(),G7t(n,s),--s,a=n.length}else o._kalast=i,o.ping()}}xN.prototype.start=function(){this._timer&&this.stop(),this._timer=setInterval(this._timerfn,this._timerInterval)};xN.prototype.stop=function(){this._timer&&(clearInterval(this._timer),this._timer=void 0)};xN.prototype.add=function(e){var t=this._streams,r=this;e.once("end",function(){r.remove(e)}).on("packet",n),t[t.length]=e,n(),this._timer||this.start();function n(){e._kalast=Date.now(),e._kacnt=0}};xN.prototype.remove=function(e){var t=this._streams,r=t.indexOf(e);r>-1&&G7t(t,r),t.length||this.stop()};H7t.exports=xN});var J7t=g((k2o,jNe)=>{var J$s=require("net"),W_=require("events").EventEmitter,El=W_.listenerCount,Q_=require("util").inherits,UJ=OJ(),X7t=UJ.utils.parseKey,eGs=UJ.SSH2Stream,tGs=UJ.SFTPStream,MNe=UJ.constants,RN=MNe.DISCONNECT_REASON,zNe=MNe.CHANNEL_OPEN_FAILURE,kN=MNe.ALGORITHMS,hc=LNe(),rGs=V7t(),nGs=ix().writeUInt32BE,K7t=Math.pow(2,32)-1,iGs=10,$J;function Wo(e,t){if(!(this instanceof Wo))return new Wo(e,t);var r={"ssh-rsa":null,"ssh-dss":null,"ssh-ed25519":null,"ecdsa-sha2-nistp256":null,"ecdsa-sha2-nistp384":null,"ecdsa-sha2-nistp521":null},n=e.hostKeys;if(!Array.isArray(n))throw new Error("hostKeys must be an array");var i;for(i=0;i<n.length;++i){var s;if(Buffer.isBuffer(n[i])||typeof n[i]=="string"?s=X7t(n[i]):s=X7t(n[i].key,n[i].passphrase),s instanceof Error)throw new Error("Cannot parse privateKey: "+s.message);if(Array.isArray(s)&&(s=s[0]),s.getPrivatePEM()===null)throw new Error("privateKey value contains an invalid private key");r[s.type]||(r[s.type]=s)}var a={kex:void 0,kexBuf:void 0,cipher:void 0,cipherBuf:void 0,serverHostKey:void 0,serverHostKeyBuf:void 0,hmac:void 0,hmacBuf:void 0,compress:void 0,compressBuf:void 0};if(typeof e.algorithms=="object"&&e.algorithms!==null){var o,c;if(c=e.algorithms.kex,Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_KEX,i=0;i<c.length;++i)if(o.indexOf(c[i])===-1)throw new Error("Unsupported key exchange algorithm: "+c[i]);a.kex=c}if(c=e.algorithms.cipher,Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_CIPHER,i=0;i<c.length;++i)if(o.indexOf(c[i])===-1)throw new Error("Unsupported cipher algorithm: "+c[i]);a.cipher=c}c=e.algorithms.serverHostKey;var l=!1;if(Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_SERVER_HOST_KEY,i=c.length-1;i>=0;--i){if(o.indexOf(c[i])===-1)throw new Error("Unsupported server host key algorithm: "+c[i]);r[c[i]]||(l||(c=c.slice(),l=!0),c.splice(i,1))}c.length>0&&(a.serverHostKey=c)}if(c=e.algorithms.hmac,Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_HMAC,i=0;i<c.length;++i)if(o.indexOf(c[i])===-1)throw new Error("Unsupported HMAC algorithm: "+c[i]);a.hmac=c}if(c=e.algorithms.compress,Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_COMPRESS,i=0;i<c.length;++i)if(o.indexOf(c[i])===-1)throw new Error("Unsupported compression algorithm: "+c[i]);a.compress=c}}if(a.serverHostKey===void 0){var u=Object.keys(r);for(i=u.length-1;i>=0;--i)r[u[i]]||u.splice(i,1);a.serverHostKey=u}!$J&&Wo.KEEPALIVE_INTERVAL>0&&Wo.KEEPALIVE_CLIENT_INTERVAL>0&&Wo.KEEPALIVE_CLIENT_COUNT_MAX>=0&&($J=new rGs(Wo.KEEPALIVE_INTERVAL,Wo.KEEPALIVE_CLIENT_INTERVAL,Wo.KEEPALIVE_CLIENT_COUNT_MAX));var m=this;W_.call(this),typeof t=="function"&&m.on("connection",t);var p={algorithms:a,hostKeys:r,server:!0},h,y;for(i=0,h=Object.keys(e),y=h.length;i<y;++i){var w=h[i];w==="privateKey"||w==="publicKey"||w==="passphrase"||w==="algorithms"||w==="hostKeys"||w==="server"||(p[w]=e[w])}if(typeof p.debug=="function")var v=p.debug,b=Object.keys(p);this._srv=new J$s.Server(function(A){if(m._connections>=m.maxConnections){A.destroy();return}++m._connections,A.once("close",function(le){--m._connections,X.read()}).on("error",function(le){X.reset(),X.emit("error",le)});var I=p;if(v){I={};for(var R=0,F;R<b.length;++R)F=b[R],I[F]=p[F];var J="["+process.hrtime().join(".")+"] ";I.debug=function(le){v(J+le)}}var X=new eGs(I),H=new Y_(X,A);A.pipe(X).pipe(A);function ae(le){}H.on("error",ae),X.once("header",function(le){if(!X._readableState.ended){if(!El(m,"connection"))return X.disconnect(RN.BY_APPLICATION);H.removeListener("error",ae),m.emit("connection",H,{ip:A.remoteAddress,family:A.remoteFamily,port:A.remotePort,header:le})}})}).on("error",function(A){m.emit("error",A)}).on("listening",function(){m.emit("listening")}).on("close",function(){m.emit("close")}),this._connections=0,this.maxConnections=1/0}Q_(Wo,W_);Wo.prototype.listen=function(){return this._srv.listen.apply(this._srv,arguments),this};Wo.prototype.address=function(){return this._srv.address()};Wo.prototype.getConnections=function(e){this._srv.getConnections(e)};Wo.prototype.close=function(e){return this._srv.close(e),this};Wo.prototype.ref=function(){this._srv.ref()};Wo.prototype.unref=function(){this._srv.unref()};function Y_(e,t){W_.call(this);var r=this;this._sshstream=e;var n=this._channels={};this._curChan=-1,this._sock=t,this.noMoreSessions=!1,this.authenticated=!1,e.on("end",function(){t.resume(),r.emit("end")}).on("close",function(p){r.emit("close",p)}).on("error",function(p){r.emit("error",p)}).on("drain",function(){r.emit("drain")}).on("continue",function(){r.emit("continue")});var i=0,s=!1,a=[],o;e.on("SERVICE_REQUEST",function(p){if(i===0||s||r.authenticated||p!=="ssh-userauth")return e.disconnect(RN.SERVICE_NOT_AVAILABLE);s=!0,e.serviceAccept(p)}).on("USERAUTH_REQUEST",c);function c(p,h,y,w){if(i===0||o&&(o.username!==p||o.service!==h)||y!=="password"&&y!=="publickey"&&y!=="hostbased"&&y!=="keyboard-interactive"&&y!=="none"||a.length===iGs)return e.disconnect(RN.PROTOCOL_ERROR);if(h!=="ssh-connection")return e.disconnect(RN.SERVICE_NOT_AVAILABLE);e._state.authMethod=y;var v;if(y==="keyboard-interactive"?v=new GJ(e,p,h,y,w,l):y==="publickey"?v=new ONe(e,p,h,y,w,l):y==="hostbased"?v=new Q7t(e,p,h,y,w,l):y==="password"?v=new Y7t(e,p,h,y,w,l):y==="none"&&(v=new om(e,p,h,y,l)),o)if(o._initialResponse)o._multistep&&!this._finalResponse&&(o._cleanup&&o._cleanup(),o.emit("abort"));else return a.push(v);o=v,El(r,"authentication")?r.emit("authentication",o):o.reject()}function l(p,h,y,w){o===p&&!r.authenticated&&(h?(e.removeListener("USERAUTH_REQUEST",c),o=void 0,r.authenticated=!0,e.authSuccess(),a=[],r.emit("ready")):(e.authFailure(y,w),a.length&&(o=a.pop(),El(r,"authentication")?r.emit("authentication",o):o.reject())))}var u=[];function m(){for(var p;u.length>0&&u[0].type;)p=u.shift(),p.type==="SUCCESS"&&e.requestSuccess(p.buf),p.type==="FAILURE"&&e.requestFailure()}e.on("GLOBAL_REQUEST",function(p,h,y){var w={type:null,buf:null};function v(R,F){w.type=R,w.buf=F,m()}if(h&&u.push(w),(p==="tcpip-forward"||p==="cancel-tcpip-forward"||p==="no-more-sessions@openssh.com"||p==="streamlocal-forward@openssh.com"||p==="cancel-streamlocal-forward@openssh.com")&&El(r,"request")&&r.authenticated){var b,A;if(h){var I=!1;b=function(R){if(!I){I=!0;var F;p==="tcpip-forward"&&y.bindPort===0&&typeof R=="number"&&(F=Buffer.allocUnsafe(4),nGs(F,R,0)),v("SUCCESS",F)}},A=function(){I||(I=!0,v("FAILURE"))}}if(p==="no-more-sessions@openssh.com"){r.noMoreSessions=!0,b&&b();return}r.emit("request",b,A,p,y)}else h&&v("FAILURE")}),e.on("CHANNEL_OPEN",function(p){if(p.type==="session"&&r.noMoreSessions||!r.authenticated){var h=zNe.ADMINISTRATIVELY_PROHIBITED;return e.channelOpenFail(p.sender,h)}var y=Z7t(r),w,v,b=!1;if(y===!1)return e.channelOpenFail(p.sender,zNe.RESOURCE_SHORTAGE);switch(n[y]=!0,v=function(){if(!b){b=!0,delete n[y];var A=zNe.ADMINISTRATIVELY_PROHIBITED;return e.channelOpenFail(p.sender,A)}},p.type){case"session":El(r,"session")?(w=function(){if(!b)return b=!0,e.channelOpenConfirm(p.sender,y,hc.MAX_WINDOW,hc.PACKET_SIZE),new W7t(r,p,y)},r.emit("session",w,v)):v();break;case"direct-tcpip":El(r,"tcpip")?(w=function(){if(!b){b=!0,e.channelOpenConfirm(p.sender,y,hc.MAX_WINDOW,hc.PACKET_SIZE);var A={type:void 0,incoming:{id:y,window:hc.MAX_WINDOW,packetSize:hc.PACKET_SIZE,state:"open"},outgoing:{id:p.sender,window:p.window,packetSize:p.packetSize,state:"open"}};return new hc(A,r)}},r.emit("tcpip",w,v,p.data)):v();break;case"direct-streamlocal@openssh.com":El(r,"openssh.streamlocal")?(w=function(){if(!b){b=!0,e.channelOpenConfirm(p.sender,y,hc.MAX_WINDOW,hc.PACKET_SIZE);var A={type:void 0,incoming:{id:y,window:hc.MAX_WINDOW,packetSize:hc.PACKET_SIZE,state:"open"},outgoing:{id:p.sender,window:p.window,packetSize:p.packetSize,state:"open"}};return new hc(A,r)}},r.emit("openssh.streamlocal",w,v,p.data)):v();break;default:v()}}),e.on("NEWKEYS",function(){++i>1&&r.emit("rekey")}),$J&&this.once("ready",function(){$J.add(e)})}Q_(Y_,W_);Y_.prototype.end=function(){return this._sshstream.disconnect(RN.BY_APPLICATION)};Y_.prototype.x11=function(e,t,r){var n={originAddr:e,originPort:t};return FNe(this,"x11",n,r)};Y_.prototype.forwardOut=function(e,t,r,n,i){var s={boundAddr:e,boundPort:t,remoteAddr:r,remotePort:n};return FNe(this,"forwarded-tcpip",s,i)};Y_.prototype.openssh_forwardOutStreamLocal=function(e,t){var r={socketPath:e};return FNe(this,"forwarded-streamlocal@openssh.com",r,t)};Y_.prototype.rekey=function(e){var t=this._sshstream,r=!0,n;try{r=t.rekey()}catch(i){n=i}return typeof e=="function"&&(n?process.nextTick(function(){e(n)}):this.once("rekey",e)),r};function W7t(e,t,r){this.subtype=void 0;var n=!1,i=this,s=t.sender,a,o={type:"session",incoming:{id:r,window:hc.MAX_WINDOW,packetSize:hc.PACKET_SIZE,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}};function c(m){var p=!1,h,y;if(m.wantReply&&(m.request!=="shell"&&m.request!=="exec"&&m.request!=="subsystem"&&(h=function(){if(!(p||n||a))return p=!0,e._sshstream.channelSuccess(s)}),y=function(){if(!(p||n||a))return p=!0,e._sshstream.channelFailure(s)}),n){y&&y();return}switch(m.request){case"env":El(i,"env")?i.emit("env",h,y,{key:m.key,val:m.val}):y&&y();break;case"pty-req":El(i,"pty")?i.emit("pty",h,y,{cols:m.cols,rows:m.rows,width:m.width,height:m.height,term:m.term,modes:m.modes}):y&&y();break;case"window-change":El(i,"window-change")?i.emit("window-change",h,y,{cols:m.cols,rows:m.rows,width:m.width,height:m.height}):y&&y();break;case"x11-req":El(i,"x11")?i.emit("x11",h,y,{single:m.single,protocol:m.protocol,cookie:m.cookie,screen:m.screen}):y&&y();break;case"signal":El(i,"signal")?i.emit("signal",h,y,{name:m.signal}):y&&y();break;case"auth-agent-req@openssh.com":El(i,"auth-agent")?i.emit("auth-agent",h,y):y&&y();break;case"shell":El(i,"shell")?(h=function(){if(!(p||n||a))return p=!0,m.wantReply&&e._sshstream.channelSuccess(s),a=new hc(o,e,{server:!0}),a.subtype=i.subtype=m.request,a},i.emit("shell",h,y)):y&&y();break;case"exec":El(i,"exec")?(h=function(){if(!(p||n||a))return p=!0,m.wantReply&&e._sshstream.channelSuccess(s),a=new hc(o,e,{server:!0}),a.subtype=i.subtype=m.request,a},i.emit("exec",h,y,{command:m.command})):y&&y();break;case"subsystem":h=function(){if(!(p||n||a))if(p=!0,m.wantReply&&e._sshstream.channelSuccess(s),a=new hc(o,e,{server:!0}),a.subtype=i.subtype=m.request+":"+m.subsystem,m.subsystem==="sftp"){var w=new tGs({server:!0,debug:e._sshstream.debug});return a.pipe(w).pipe(a),w}else return a},m.subsystem==="sftp"&&El(i,"sftp")?i.emit("sftp",h,y):m.subsystem!=="sftp"&&El(i,"subsystem")?i.emit("subsystem",h,y,{name:m.subsystem}):y&&y();break;default:y&&y()}}function l(){n=!0,i.emit("eof"),i.emit("end")}function u(){n=!0,i.emit("close")}e._sshstream.on("CHANNEL_REQUEST:"+r,c).once("CHANNEL_EOF:"+r,l).once("CHANNEL_CLOSE:"+r,u)}Q_(W7t,W_);function om(e,t,r,n,i){W_.call(this);var s=this;this.username=this.user=t,this.service=r,this.method=n,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=function(a,o,c){s._finalResponse||(s._finalResponse=!0,i(s,a,o,c))},this._stream=e}Q_(om,W_);om.prototype.accept=function(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)};om.prototype.reject=function(e,t){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,e,t)};var sGs=/[ \t\r\n]*,[ \t\r\n]*/g;function GJ(e,t,r,n,i,s){om.call(this,e,t,r,n,s),this._multistep=!0;var a=this;this._cb=void 0,this._onInfoResponse=function(o){if(a._cb){var c=a._cb;a._cb=void 0,c(o)}},this.submethods=i.split(sGs),this.on("abort",function(){a._cb&&a._cb(new Error("Authentication request aborted"))})}Q_(GJ,om);GJ.prototype._cleanup=function(){this._stream.removeListener("USERAUTH_INFO_RESPONSE",this._onInfoResponse)};GJ.prototype.prompt=function(e,t,r,n){Array.isArray(e)||(e=[e]),typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0);for(var i=0;i<e.length;++i)typeof e[i]=="string"&&(e[i]={prompt:e[i],echo:!0});return this._cb=n,this._initialResponse=!0,this._stream.once("USERAUTH_INFO_RESPONSE",this._onInfoResponse),this._stream.authInfoReq(t,r,e)};function ONe(e,t,r,n,i,s){om.call(this,e,t,r,n,s),this.key={algo:i.keyAlgo,data:i.key},this.signature=i.signature;var a;if(this.signature)switch(i.keyAlgo){case"ssh-rsa":case"ssh-dss":a="sha1";break;case"ssh-ed25519":a=null;break;case"ecdsa-sha2-nistp256":a="sha256";break;case"ecdsa-sha2-nistp384":a="sha384";break;case"ecdsa-sha2-nistp521":a="sha512";break}this.sigAlgo=a,this.blob=i.blob}Q_(ONe,om);ONe.prototype.accept=function(){this.signature?om.prototype.accept.call(this):(this._initialResponse=!0,this._stream.authPKOK(this.key.algo,this.key.data))};function Q7t(e,t,r,n,i,s){om.call(this,e,t,r,n,s),this.key={algo:i.keyAlgo,data:i.key},this.signature=i.signature;var a;if(this.signature)switch(i.keyAlgo){case"ssh-rsa":case"ssh-dss":a="sha1";break;case"ssh-ed25519":a=null;break;case"ecdsa-sha2-nistp256":a="sha256";break;case"ecdsa-sha2-nistp384":a="sha384";break;case"ecdsa-sha2-nistp521":a="sha512";break}this.sigAlgo=a,this.blob=i.blob,this.localHostname=i.localHostname,this.localUsername=i.localUsername}Q_(Q7t,om);function Y7t(e,t,r,n,i,s){om.call(this,e,t,r,n,s),this.password=i}Q_(Y7t,om);function FNe(e,t,r,n){var i=Z7t(e),s=hc.MAX_WINDOW,a=hc.PACKET_SIZE,o=!0;if(i===!1)return n(new Error("No free channels available"));typeof r=="function"&&(n=r,r={}),e._channels[i]=!0;var c=e._sshstream;return c.once("CHANNEL_OPEN_CONFIRMATION:"+i,function(l){c.removeAllListeners("CHANNEL_OPEN_FAILURE:"+i);var u={type:t,incoming:{id:i,window:s,packetSize:a,state:"open"},outgoing:{id:l.sender,window:l.window,packetSize:l.packetSize,state:"open"}};n(void 0,new hc(u,e,{server:!0}))}).once("CHANNEL_OPEN_FAILURE:"+i,function(l){c.removeAllListeners("CHANNEL_OPEN_CONFIRMATION:"+i),delete e._channels[i];var u=new Error("(SSH) Channel open failure: "+l.description);u.reason=l.reason,u.lang=l.lang,n(u)}),t==="forwarded-tcpip"?o=c.forwardedTcpip(i,s,a,r):t==="x11"?o=c.x11(i,s,a,r):t==="forwarded-streamlocal@openssh.com"&&(o=c.openssh_forwardedStreamLocal(i,s,a,r)),o}function Z7t(e){if(e._curChan<K7t)return++e._curChan;for(var t=0,r=e._channels;t<K7t;++t)if(!r[t])return t;return!1}Wo.createServer=function(e,t){return new Wo(e,t)};Wo.KEEPALIVE_INTERVAL=1e3;Wo.KEEPALIVE_CLIENT_INTERVAL=15e3;Wo.KEEPALIVE_CLIENT_COUNT_MAX=3;jNe.exports=Wo;jNe.exports.IncomingClient=Y_});var DNe=g((T2o,dXt)=>{var TN=require("crypto"),aGs=require("net").Socket,oGs=require("dns").lookup,eXt=require("events").EventEmitter,cGs=require("util").inherits,lGs=TN.getHashes(),IN=OJ(),dGs=IN.SSH2Stream,BNe=IN.SFTPStream,WS=IN.constants,uGs=WS.BUGS,qN=WS.ALGORITHMS,mGs=WS.EDDSA_SUPPORTED,fGs=IN.utils.parseKey,tXt=_7t(),Z_=LNe(),UNe=j7t(),pGs=$7t(),$Ne=ix().readUInt32BE,rXt=Math.pow(2,32)-1,HJ=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,nXt=function(e){};function Ba(){if(!(this instanceof Ba))return new Ba;eXt.call(this),this.config={host:void 0,port:void 0,localAddress:void 0,localPort:void 0,forceIPv4:void 0,forceIPv6:void 0,keepaliveCountMax:void 0,keepaliveInterval:void 0,readyTimeout:void 0,username:void 0,password:void 0,privateKey:void 0,tryKeyboard:void 0,agent:void 0,allowAgentFwd:void 0,authHandler:void 0,hostHashAlgo:void 0,hostHashCb:void 0,strictVendor:void 0,debug:void 0},this._readyTimeout=void 0,this._channels=void 0,this._callbacks=void 0,this._forwarding=void 0,this._forwardingUnix=void 0,this._acceptX11=void 0,this._agentFwdEnabled=void 0,this._curChan=void 0,this._remoteVer=void 0,this._sshstream=void 0,this._sock=void 0,this._resetKA=void 0}cGs(Ba,eXt);Ba.prototype.connect=function(e){var t=this;if(this._sock&&this._sock.writable){this.once("close",function(){t.connect(e)}),this.end();return}this.config.host=e.hostname||e.host||"localhost",this.config.port=e.port||22,this.config.localAddress=typeof e.localAddress=="string"?e.localAddress:void 0,this.config.localPort=typeof e.localPort=="string"||typeof e.localPort=="number"?e.localPort:void 0,this.config.forceIPv4=e.forceIPv4||!1,this.config.forceIPv6=e.forceIPv6||!1,this.config.keepaliveCountMax=typeof e.keepaliveCountMax=="number"&&e.keepaliveCountMax>=0?e.keepaliveCountMax:3,this.config.keepaliveInterval=typeof e.keepaliveInterval=="number"&&e.keepaliveInterval>0?e.keepaliveInterval:0,this.config.readyTimeout=typeof e.readyTimeout=="number"&&e.readyTimeout>=0?e.readyTimeout:2e4;var r={kex:void 0,kexBuf:void 0,cipher:void 0,cipherBuf:void 0,serverHostKey:void 0,serverHostKeyBuf:void 0,hmac:void 0,hmacBuf:void 0,compress:void 0,compressBuf:void 0},n;if(typeof e.algorithms=="object"&&e.algorithms!==null){var i,s;if(s=e.algorithms.kex,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_KEX,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported key exchange algorithm: "+s[n]);r.kex=s}if(s=e.algorithms.cipher,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_CIPHER,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported cipher algorithm: "+s[n]);r.cipher=s}if(s=e.algorithms.serverHostKey,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_SERVER_HOST_KEY,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported server host key algorithm: "+s[n]);r.serverHostKey=s}if(s=e.algorithms.hmac,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_HMAC,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported HMAC algorithm: "+s[n]);r.hmac=s}if(s=e.algorithms.compress,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_COMPRESS,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported compression algorithm: "+s[n]);r.compress=s}}if(r.compress===void 0&&(e.compress?(r.compress=["zlib@openssh.com","zlib"],e.compress!=="force"&&r.compress.push("none")):e.compress===!1&&(r.compress=["none"])),typeof e.username=="string")this.config.username=e.username;else if(typeof e.user=="string")this.config.username=e.user;else throw new Error("Invalid username");this.config.password=typeof e.password=="string"?e.password:void 0,this.config.privateKey=typeof e.privateKey=="string"||Buffer.isBuffer(e.privateKey)?e.privateKey:void 0,this.config.localHostname=typeof e.localHostname=="string"&&e.localHostname.length?e.localHostname:void 0,this.config.localUsername=typeof e.localUsername=="string"&&e.localUsername.length?e.localUsername:void 0,this.config.tryKeyboard=e.tryKeyboard===!0,this.config.agent=typeof e.agent=="string"&&e.agent.length?e.agent:void 0,this.config.allowAgentFwd=e.agentForward===!0&&this.config.agent!==void 0;var a=this.config.authHandler=typeof e.authHandler=="function"?e.authHandler:void 0;this.config.strictVendor=typeof e.strictVendor=="boolean"?e.strictVendor:!0;var o=this.config.debug=typeof e.debug=="function"?e.debug:nXt;if(e.agentForward===!0&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");var c=this._callbacks=[];this._channels={},this._forwarding={},this._forwardingUnix={},this._acceptX11=0,this._agentFwdEnabled=!1,this._curChan=-1,this._remoteVer=void 0;var l;if(this.config.privateKey){if(l=fGs(this.config.privateKey,e.passphrase),l instanceof Error)throw new Error("Cannot parse privateKey: "+l.message);if(Array.isArray(l)&&(l=l[0]),l.getPrivatePEM()===null)throw new Error("privateKey value does not contain a (valid) private key")}var u=this._sshstream=new dGs({algorithms:r,debug:o===nXt?void 0:o}),m=this._sock=e.sock||new aGs;this._sock.stderr&&typeof this._sock.stderr.resume=="function"&&this._sock.stderr.resume();var p=this.config.keepaliveInterval,h=this.config.keepaliveCountMax,y=0,w;function v(){if(++y>h){if(clearInterval(w),m.readable){var ct=new Error("Keepalive timeout");ct.level="client-timeout",t.emit("error",ct),m.destroy()}return}m.writable?(c.push(b),u.ping()):clearInterval(w)}function b(){p>0&&(y=0,clearInterval(w),m.writable&&(w=setInterval(v,p)))}if(this._resetKA=b,u.on("USERAUTH_BANNER",function(ct){t.emit("banner",ct)}),m.on("connect",function(){o("DEBUG: Client: Connected"),t.emit("connect"),e.sock||u.pipe(m).pipe(u)}).on("timeout",function(){t.emit("timeout")}).on("error",function(ct){clearTimeout(t._readyTimeout),ct.level="client-socket",t.emit("error",ct)}).on("end",function(){u.unpipe(m),clearTimeout(t._readyTimeout),clearInterval(w),t.emit("end")}).on("close",function(){u.unpipe(m),clearTimeout(t._readyTimeout),clearInterval(w),t.emit("close");var ct=c,ft=new Error("No response from server");for(c=t._callbacks=[],n=0;n<ct.length;++n)ct[n](ft);var ur=t._channels,pt=Object.keys(ur);for(t._channels={},n=0;n<pt.length;++n){var sr=u.emit("CHANNEL_OPEN_FAILURE:"+pt[n],ft),Nr=u.emit("CHANNEL_CLOSE:"+pt[n]),Ue;!sr&&!Nr&&(Ue=ur[pt[n]])&&typeof Ue=="function"&&Ue(ft)}}),u.on("drain",function(){t.emit("drain")}).once("header",function(ct){t._remoteVer=ct.versions.software,ct.greeting&&t.emit("greeting",ct.greeting)}).on("continue",function(){t.emit("continue")}).on("error",function(ct){ct.level===void 0?ct.level="protocol":ct.level==="handshake"&&clearTimeout(t._readyTimeout),t.emit("error",ct)}).on("end",function(){m.resume()}),typeof e.hostVerifier=="function"){if(lGs.indexOf(e.hostHash)===-1)throw new Error("Invalid host hash algorithm: "+e.hostHash);var A=e.hostVerifier,I=TN.createHash(e.hostHash);u.once("fingerprint",function(ct,ft){I.update(ct);var ur=A(I.digest("hex"),ft);ur!==void 0&&ft(ur)})}var R,F=null,J=null,X,H=0,ae=["none"];if(this.config.password!==void 0&&ae.push("password"),l!==void 0&&ae.push("publickey"),this.config.agent!==void 0&&ae.push("agent"),this.config.tryKeyboard&&ae.push("keyboard-interactive"),l!==void 0&&this.config.localHostname!==void 0&&this.config.localUsername!==void 0&&ae.push("hostbased"),a===void 0){var le=0;a=function(ft,ur,pt){return le===ae.length?!1:ae[le++]}}var D=!1;function ie(ct){if(D=!0,ct===!1){u.removeListener("USERAUTH_FAILURE",Ge),u.removeListener("USERAUTH_PK_OK",ee);var ft=new Error("All configured authentication methods failed");ft.level="client-authentication",t.emit("error",ft),u.writable&&t.end();return}if(ae.indexOf(ct)===-1)throw new Error("Authentication method not allowed: "+ct);switch(R=ct,R){case"password":u.authPassword(t.config.username,t.config.password);break;case"publickey":u.authPK(t.config.username,l),u.once("USERAUTH_PK_OK",ee);break;case"hostbased":let pt=function(sr,Nr){var Ue=l.sign(sr);if(Ue instanceof Error)return Ue.message="Error while signing data with privateKey: "+Ue.message,Ue.level="client-authentication",t.emit("error",Ue),re();Nr(Ue)};var ur=pt;u.authHostbased(t.config.username,l,t.config.localHostname,t.config.localUsername,pt);break;case"agent":UNe(t.config.agent,function(sr,Nr){if(sr)return sr.level="agent",t.emit("error",sr),X=void 0,re();if(Nr.length===0)return o("DEBUG: Agent: No keys stored in agent"),X=void 0,re();X=Nr,H=0,u.authPK(t.config.username,Nr[0]),u.once("USERAUTH_PK_OK",ee)});break;case"keyboard-interactive":u.authKeyboard(t.config.username),u.on("USERAUTH_INFO_REQUEST",B);break;case"none":u.authNone(t.config.username);break}}function re(){D=!1;var ct=a(J,F,ie);D||ct===void 0||ie(ct)}function Pe(){if(R==="agent"){if(H>=X.length)return;++H>=X.length?(o("DEBUG: Agent: No more keys left to try"),o("DEBUG: Client: agent auth failed"),X=void 0,re()):(o("DEBUG: Agent: Trying key #"+(H+1)),u.authPK(t.config.username,X[H]),u.once("USERAUTH_PK_OK",ee))}}function B(ct,ft,ur,pt){var sr=Array.isArray(pt)?pt.length:0;if(sr===0)return o("DEBUG: Client: Sending automatic USERAUTH_INFO_RESPONSE"),u.authInfoRes();t.emit("keyboard-interactive",ct,ft,ur,pt,function(Nr){u.authInfoRes(Nr)})}function ee(){if(R==="agent"){var ct=X[H],ft=$Ne(ct,0),ur=ct.toString("ascii",4,4+ft),pt=ur.slice(4);switch(ur){case"ssh-rsa":case"ssh-dss":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":break;default:if(mGs&&ur==="ssh-ed25519")break;return o("DEBUG: Agent: Skipping unsupported key type: "+ur),Pe()}u.authPK(t.config.username,ct,function(sr,Nr){UNe(t.config.agent,ct,pt,sr,function(Ue,Rr){if(Ue)Ue.level="agent",t.emit("error",Ue);else{var z=$Ne(Rr,0);if(4+z+4<Rr.length){var Q=Rr.toString("ascii",4,4+z);if(Q!==ur)Ue=new Error("Agent key/signature type mismatch"),Ue.level="agent",t.emit("error",Ue);else return Nr(Rr.slice(4+z+4))}}Pe()})})}else R==="publickey"&&u.authPK(t.config.username,l,function(sr,Nr){var Ue=l.sign(sr);if(Ue instanceof Error)return Ue.message="Error while signing data with privateKey: "+Ue.message,Ue.level="client-authentication",t.emit("error",Ue),re();Nr(Ue)})}function Ge(ct,ft){if(u.removeListener("USERAUTH_PK_OK",ee),u.removeListener("USERAUTH_INFO_REQUEST",B),R==="agent")return o("DEBUG: Client: Agent key #"+(H+1)+" failed"),Pe();o("DEBUG: Client: "+R+" auth failed"),F=ft,J=ct,re()}if(u.once("USERAUTH_SUCCESS",function(){u.removeListener("USERAUTH_FAILURE",Ge),u.removeListener("USERAUTH_INFO_REQUEST",B),b(),clearTimeout(t._readyTimeout),t.emit("ready")}).on("USERAUTH_FAILURE",Ge),u.once("ready",function(){u.service("ssh-userauth"),u.once("SERVICE_ACCEPT",function(ct){ct==="ssh-userauth"&&re()})}),u.on("CHANNEL_OPEN",function(ct){yGs(t,ct)}),u.on("REQUEST_SUCCESS",function(ct){c.length&&c.shift()(!1,ct)}).on("REQUEST_FAILURE",function(){c.length&&c.shift()(!0)}),u.on("GLOBAL_REQUEST",function(ct,ft,ur){ft&&u.requestFailure()}),e.sock)qt(),u.pipe(m).pipe(u);else{let ct=function(){qt(),t._sock.connect({host:We,port:t.config.port,localAddress:t.config.localAddress,localPort:t.config.localPort}),t._sock.setNoDelay(!0),t._sock.setMaxListeners(0),t._sock.setTimeout(typeof e.timeout=="number"?e.timeout:0)};var er=ct,We=this.config.host,nt=this.config.forceIPv4,Tt=this.config.forceIPv6;o("DEBUG: Client: Trying "+We+" on port "+this.config.port+" ..."),!nt&&!Tt||nt&&Tt?ct():oGs(We,nt?4:6,function(ft,ur,pt){if(ft){var sr=new Error("Error while looking up "+(nt?"IPv4":"IPv6")+" address for host "+We+": "+ft);clearTimeout(t._readyTimeout),sr.level="client-dns",t.emit("error",sr),t.emit("close");return}We=ur,ct()})}function qt(){t.config.readyTimeout>0&&(t._readyTimeout=setTimeout(function(){var ct=new Error("Timed out while waiting for handshake");ct.level="client-timeout",t.emit("error",ct),m.destroy()},t.config.readyTimeout))}};Ba.prototype.end=function(){return this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable?this._sshstream.disconnect():!1};Ba.prototype.destroy=function(){this._sock&&this._sock.destroy()};Ba.prototype.exec=function(e,t,r){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");typeof t=="function"&&(r=t,t={});var n=this,i={allowHalfOpen:t.allowHalfOpen!==!1};return sx(this,"session",i,function(s,a){if(s)return r(s);var o=[];function c(l){if(l)return a.close(),r(l);o.length&&o.shift()()}(n.config.allowAgentFwd===!0||t&&t.agentForward===!0&&n.config.agent!==void 0)&&o.push(function(){oXt(a,c)}),typeof t=="object"&&t!==null&&(typeof t.env=="object"&&t.env!==null&&cXt(a,t.env),(typeof t.pty=="object"&&t.pty!==null||t.pty===!0)&&o.push(function(){aXt(a,t.pty,c)}),(typeof t.x11=="object"&&t.x11!==null||t.x11==="number"||t.x11===!0)&&o.push(function(){sXt(a,t.x11,c)})),o.push(function(){hGs(a,e,t,r)}),o.shift()()})};Ba.prototype.shell=function(e,t,r){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var n=this;return typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),e&&(e.x11!==void 0||e.env!==void 0)&&(t=e,e=void 0),sx(this,"session",function(i,s){if(i)return r(i);var a=[];function o(c){if(c)return s.close(),r(c);a.length&&a.shift()()}(n.config.allowAgentFwd===!0||t&&t.agentForward===!0&&n.config.agent!==void 0)&&a.push(function(){oXt(s,o)}),e!==!1&&a.push(function(){aXt(s,e,o)}),typeof t=="object"&&t!==null&&(typeof t.env=="object"&&t.env!==null&&cXt(s,t.env),(typeof t.x11=="object"&&t.x11!==null||t.x11==="number"||t.x11===!0)&&a.push(function(){sXt(s,t.x11,o)})),a.push(function(){gGs(s,r)}),a.shift()()})};Ba.prototype.subsys=function(e,t){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");return sx(this,"session",function(r,n){if(r)return t(r);lXt(n,e,function(i,s){if(i)return t(i);t(void 0,s)})})};Ba.prototype.sftp=function(e){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var t=this;return sx(this,"session",function(r,n){if(r)return e(r);lXt(n,"sftp",function(i,s){if(i)return e(i);var a=t._sshstream._state.incoming.identRaw,o={debug:t.config.debug},c=new BNe(o,a);function l(p){c.removeListener("ready",u),s.removeListener("exit",m),e(p)}function u(){c.removeListener("error",l),s.removeListener("exit",m),e(void 0,new pGs(c))}function m(p,h){c.removeListener("ready",u),c.removeListener("error",l);var y;typeof p=="number"?y="Received exit code "+p+" while establishing SFTP session":y="Received signal "+h+" while establishing SFTP session";var w=new Error(y);w.code=p,w.signal=h,e(w)}c.once("error",l).once("ready",u).once("close",function(){s.end()}),s.once("exit",m),c.pipe(s).pipe(c)})})};Ba.prototype.forwardIn=function(e,t,r){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var n=this,i=typeof r=="function";return i&&this._callbacks.push(function(s,a){if(s)return r(s!==!0?s:new Error("Unable to bind to "+e+":"+t));var o=t;t===0&&a&&a.length>=4&&(o=$Ne(a,0),n._sshstream.remoteBugs&uGs.DYN_RPORT_BUG||(t=o)),n._forwarding[e+":"+t]=o,r(void 0,o)}),this._sshstream.tcpipForward(e,t,i)};Ba.prototype.unforwardIn=function(e,t,r){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var n=this,i=typeof r=="function";return i&&this._callbacks.push(function(s){if(s)return r(s!==!0?s:new Error("Unable to unbind from "+e+":"+t));delete n._forwarding[e+":"+t],r()}),this._sshstream.cancelTcpipForward(e,t,i)};Ba.prototype.forwardOut=function(e,t,r,n,i){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var s={srcIP:e,srcPort:t,dstIP:r,dstPort:n};return sx(this,"direct-tcpip",s,i)};Ba.prototype.openssh_noMoreSessions=function(e){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var t=typeof e=="function";return!this.config.strictVendor||this.config.strictVendor&&HJ.test(this._remoteVer)?(t&&this._callbacks.push(function(r){if(r)return e(r!==!0?r:new Error("Unable to disable future sessions"));e()}),this._sshstream.openssh_noMoreSessions(t)):(t&&process.nextTick(function(){e(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}),!0)};Ba.prototype.openssh_forwardInStreamLocal=function(e,t){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var r=typeof t=="function",n=this;return!this.config.strictVendor||this.config.strictVendor&&HJ.test(this._remoteVer)?(r&&this._callbacks.push(function(i){if(i)return t(i!==!0?i:new Error("Unable to bind to "+e));n._forwardingUnix[e]=!0,t()}),this._sshstream.openssh_streamLocalForward(e,r)):(r&&process.nextTick(function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}),!0)};Ba.prototype.openssh_unforwardInStreamLocal=function(e,t){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var r=typeof t=="function",n=this;return!this.config.strictVendor||this.config.strictVendor&&HJ.test(this._remoteVer)?(r&&this._callbacks.push(function(i){if(i)return t(i!==!0?i:new Error("Unable to unbind on "+e));delete n._forwardingUnix[e],t()}),this._sshstream.openssh_cancelStreamLocalForward(e,r)):(r&&process.nextTick(function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}),!0)};Ba.prototype.openssh_forwardOutStreamLocal=function(e,t){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");if(!this.config.strictVendor||this.config.strictVendor&&HJ.test(this._remoteVer)){var r={socketPath:e};return sx(this,"direct-streamlocal@openssh.com",r,t)}else process.nextTick(function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))});return!0};function sx(e,t,r,n){var i=iXt(e),s=Z_.MAX_WINDOW,a=Z_.PACKET_SIZE,o=!0;if(i===!1)return n(new Error("No free channels available"));typeof r=="function"&&(n=r,r={}),e._channels[i]=n;var c=e._sshstream;return c.once("CHANNEL_OPEN_CONFIRMATION:"+i,l).once("CHANNEL_OPEN_FAILURE:"+i,u).once("CHANNEL_CLOSE:"+i,u),t==="session"?o=c.session(i,s,a):t==="direct-tcpip"?o=c.directTcpip(i,s,a,r):t==="direct-streamlocal@openssh.com"&&(o=c.openssh_directStreamLocal(i,s,a,r)),o;function l(m){c.removeListener("CHANNEL_OPEN_FAILURE:"+i,u),c.removeListener("CHANNEL_CLOSE:"+i,u);var p={type:t,incoming:{id:i,window:s,packetSize:a,state:"open"},outgoing:{id:m.sender,window:m.window,packetSize:m.packetSize,state:"open"}};n(void 0,new Z_(p,e))}function u(m){c.removeListener("CHANNEL_OPEN_CONFIRMATION:"+i,l),c.removeListener("CHANNEL_OPEN_FAILURE:"+i,u),c.removeListener("CHANNEL_CLOSE:"+i,u),delete e._channels[i];var p;m instanceof Error?p=m:typeof m=="object"&&m!==null?(p=new Error("(SSH) Channel open failure: "+m.description),p.reason=m.reason,p.lang=m.lang):(p=new Error("(SSH) Channel open failure: server closed channel unexpectedly"),p.reason=p.lang=""),n(p)}}function iXt(e){if(e._curChan<rXt)return++e._curChan;for(var t=0,r=e._channels;t<rXt;++t)if(!r[t])return t;return!1}function sXt(e,t,r){var n={single:!1,protocol:"MIT-MAGIC-COOKIE-1",cookie:void 0,screen:0};typeof t=="function"?r=t:typeof t=="object"&&t!==null&&(typeof t.single=="boolean"&&(n.single=t.single),typeof t.screen=="number"&&(n.screen=t.screen),typeof t.protocol=="string"&&(n.protocol=t.protocol),typeof t.cookie=="string"?n.cookie=t.cookie:Buffer.isBuffer(t.cookie)&&(n.cookie=t.cookie.toString("hex"))),n.cookie===void 0&&(n.cookie=wGs());var i=typeof r=="function";return e.outgoing.state!=="open"?(i&&r(new Error("Channel is not open")),!0):(i&&e._callbacks.push(function(s){if(s)return r(s!==!0?s:new Error("Unable to request X11"));e._hasX11=!0,++e._client._acceptX11,e.once("close",function(){e._client._acceptX11&&--e._client._acceptX11}),r()}),e._client._sshstream.x11Forward(e.outgoing.id,n,i))}function aXt(e,t,r){var n=24,i=80,s=640,a=480,o="vt100",c=null;typeof t=="function"?r=t:typeof t=="object"&&t!==null&&(typeof t.rows=="number"&&(n=t.rows),typeof t.cols=="number"&&(i=t.cols),typeof t.width=="number"&&(s=t.width),typeof t.height=="number"&&(a=t.height),typeof t.term=="string"&&(o=t.term),typeof t.modes=="object"&&(c=t.modes));var l=typeof r=="function";return e.outgoing.state!=="open"?(l&&r(new Error("Channel is not open")),!0):(l&&e._callbacks.push(function(u){if(u)return r(u!==!0?u:new Error("Unable to request a pseudo-terminal"));r()}),e._client._sshstream.pty(e.outgoing.id,n,i,a,s,o,c,l))}function oXt(e,t){var r=typeof t=="function";return e.outgoing.state!=="open"?(r&&t(new Error("Channel is not open")),!0):e._client._agentFwdEnabled?(r&&t(!1),!0):(e._client._agentFwdEnabled=!0,e._callbacks.push(function(n){if(n){e._client._agentFwdEnabled=!1,r&&t(n!==!0?n:new Error("Unable to request agent forwarding"));return}r&&t()}),e._client._sshstream.openssh_agentForward(e.outgoing.id,!0))}function gGs(e,t){return e.outgoing.state!=="open"?(t(new Error("Channel is not open")),!0):(e._callbacks.push(function(r){if(r)return t(r!==!0?r:new Error("Unable to open shell"));e.subtype="shell",t(void 0,e)}),e._client._sshstream.shell(e.outgoing.id,!0))}function hGs(e,t,r,n){return e.outgoing.state!=="open"?(n(new Error("Channel is not open")),!0):(e._callbacks.push(function(i){if(i)return n(i!==!0?i:new Error("Unable to exec"));e.subtype="exec",e.allowHalfOpen=r.allowHalfOpen!==!1,n(void 0,e)}),e._client._sshstream.exec(e.outgoing.id,t,!0))}function cXt(e,t){if(e.outgoing.state!=="open")return!0;for(var r=!0,n=Object.keys(t||{}),i,s,a=0,o=n.length;a<o;++a)i=n[a],s=t[i],r=e._client._sshstream.env(e.outgoing.id,i,s,!1);return r}function lXt(e,t,r){return e.outgoing.state!=="open"?(r(new Error("Channel is not open")),!0):(e._callbacks.push(function(n){if(n)return r(n!==!0?n:new Error("Unable to start subsystem: "+t));e.subtype="subsystem",r(void 0,e)}),e._client._sshstream.subsystem(e.outgoing.id,t,!0))}function yGs(e,t){var r=!1,n;function i(){var o={type:t.type,incoming:{id:r,window:Z_.MAX_WINDOW,packetSize:Z_.PACKET_SIZE,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},c=new Z_(o,e);return e._sshstream.channelOpenConfirm(t.sender,r,Z_.MAX_WINDOW,Z_.PACKET_SIZE),c}function s(){n===void 0&&(r===!1?n=WS.CHANNEL_OPEN_FAILURE.RESOURCE_SHORTAGE:n=WS.CHANNEL_OPEN_FAILURE.CONNECT_FAILED),e._sshstream.channelOpenFail(t.sender,n,"","")}if(t.type==="forwarded-tcpip"||t.type==="x11"||t.type==="auth-agent@openssh.com"||t.type==="forwarded-streamlocal@openssh.com"){var a=t.type==="forwarded-tcpip"&&e._forwarding[t.data.destIP+":"+t.data.destPort]===void 0||t.type==="forwarded-streamlocal@openssh.com"&&e._forwardingUnix[t.data.socketPath]===void 0||t.type==="x11"&&e._acceptX11===0||t.type==="auth-agent@openssh.com"&&!e._agentFwdEnabled;a?(n=WS.CHANNEL_OPEN_FAILURE.ADMINISTRATIVELY_PROHIBITED,e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: unexpected channel open for: "+t.type)):(r=iXt(e),r===!1?(e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: no channels available"),a=!0):e._channels[r]=!0),a&&s(),r!==!1&&(t.type==="forwarded-tcpip"?(t.data.destPort===0&&(t.data.destPort=e._forwarding[t.data.destIP+":"+t.data.destPort]),e.emit("tcp connection",t.data,i,s)):t.type==="x11"?e.emit("x11",t.data,i,s):t.type==="forwarded-streamlocal@openssh.com"?e.emit("unix connection",t.data,i,s):UNe(e.config.agent,i,s))}else e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: unsupported type: "+t.type),n=WS.CHANNEL_OPEN_FAILURE.UNKNOWN_CHANNEL_TYPE,s()}var wGs=function(){if(typeof TN.randomFillSync=="function"){var e=Buffer.alloc(16);return function(){return TN.randomFillSync(e,0,16),e.toString("hex")}}else return function(){return TN.randomBytes(16).toString("hex")}}();Ba.Client=Ba;Ba.Server=J7t();Ba.utils=IN.utils;Ba.SFTP_STATUS_CODE=BNe.STATUS_CODE;Ba.SFTP_OPEN_MODE=BNe.OPEN_MODE;Ba.HTTPAgent=tXt.SSHTTPAgent;Ba.HTTPSAgent=tXt.SSHTTPSAgent;dXt.exports=Ba});var mXt=g((I2o,uXt)=>{var vGs=DNe().Client,_Gs=require("http");uXt.exports=function(e){var t=new vGs,r=new _Gs.Agent;return r.createConnection=function(n,i){t.once("ready",function(){t.exec("docker system dial-stdio",function(s,a){if(s){t.end(),r.destroy();return}i(null,a),a.once("close",()=>{t.end(),r.destroy()})})}).connect(e),t.once("end",()=>r.destroy())},r}});var GNe=g((q2o,fXt)=>{fXt.exports=require("stream")});var yXt=g((D2o,hXt)=>{"use strict";function pXt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bGs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pXt(Object(r),!0).forEach(function(n){SGs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pXt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SGs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CGs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gXt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function EGs(e,t,r){return t&&gXt(e.prototype,t),r&&gXt(e,r),e}var AGs=require("buffer"),VJ=AGs.Buffer,PGs=require("util"),HNe=PGs.inspect,xGs=HNe&&HNe.custom||"inspect";function RGs(e,t,r){VJ.prototype.copy.call(e,t,r)}hXt.exports=function(){function e(){CGs(this,e),this.head=null,this.tail=null,this.length=0}return EGs(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return VJ.alloc(0);for(var n=VJ.allocUnsafe(r>>>0),i=this.head,s=0;i;)RGs(i.data,n,s),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,s=n.data;for(r-=s.length;n=n.next;){var a=n.data,o=r>a.length?a.length:r;if(o===a.length?s+=a:s+=a.slice(0,r),r-=o,r===0){o===a.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(o));break}++i}return this.length-=i,s}},{key:"_getBuffer",value:function(r){var n=VJ.allocUnsafe(r),i=this.head,s=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var a=i.data,o=r>a.length?a.length:r;if(a.copy(n,n.length-r,0,o),r-=o,r===0){o===a.length?(++s,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(o));break}++s}return this.length-=s,n}},{key:xGs,value:function(r,n){return HNe(this,bGs({},n,{depth:0,customInspect:!1}))}}]),e}()});var XNe=g((N2o,vXt)=>{"use strict";function kGs(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(VNe,this,e)):process.nextTick(VNe,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(XJ,r):(r._writableState.errorEmitted=!0,process.nextTick(wXt,r,s)):process.nextTick(wXt,r,s):t?(process.nextTick(XJ,r),t(s)):process.nextTick(XJ,r)}),this)}function wXt(e,t){VNe(e,t),XJ(e)}function XJ(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function TGs(){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 VNe(e,t){e.emit("error",t)}function IGs(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}vXt.exports={destroy:kGs,undestroy:TGs,errorOrDestroy:IGs}});var J_=g((L2o,SXt)=>{"use strict";var _Xt={};function xf(e,t,r){r||(r=Error);function n(s,a,o){return typeof t=="string"?t:t(s,a,o)}class i extends r{constructor(a,o,c){super(n(a,o,c))}}i.prototype.name=r.name,i.prototype.code=e,_Xt[e]=i}function bXt(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function qGs(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function DGs(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function NGs(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}xf("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);xf("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&qGs(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(DGs(e," argument"))i=`The ${e} ${n} ${bXt(t,"type")}`;else{let s=NGs(e,".")?"property":"argument";i=`The "${e}" ${s} ${n} ${bXt(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);xf("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");xf("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});xf("ERR_STREAM_PREMATURE_CLOSE","Premature close");xf("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});xf("ERR_MULTIPLE_CALLBACK","Callback called multiple times");xf("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");xf("ERR_STREAM_WRITE_AFTER_END","write after end");xf("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);xf("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);xf("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");SXt.exports.codes=_Xt});var KNe=g((M2o,CXt)=>{"use strict";var LGs=J_().codes.ERR_INVALID_OPT_VALUE;function MGs(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function zGs(e,t,r,n){var i=MGs(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new LGs(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}CXt.exports={getHighWaterMark:zGs}});var KJ=g((z2o,EXt)=>{EXt.exports=require("util").deprecate});var YNe=g((O2o,TXt)=>{"use strict";TXt.exports=qo;function AXt(e){var t=this;this.next=null,this.entry=null,this.finish=function(){d6s(t,e)}}var ax;qo.WritableState=DN;var OGs={deprecate:KJ()},PXt=GNe(),WJ=require("buffer").Buffer,FGs=global.Uint8Array||function(){};function jGs(e){return WJ.from(e)}function BGs(e){return WJ.isBuffer(e)||e instanceof FGs}var WNe=XNe(),UGs=KNe(),$Gs=UGs.getHighWaterMark,e0=J_().codes,GGs=e0.ERR_INVALID_ARG_TYPE,HGs=e0.ERR_METHOD_NOT_IMPLEMENTED,VGs=e0.ERR_MULTIPLE_CALLBACK,XGs=e0.ERR_STREAM_CANNOT_PIPE,KGs=e0.ERR_STREAM_DESTROYED,WGs=e0.ERR_STREAM_NULL_VALUES,QGs=e0.ERR_STREAM_WRITE_AFTER_END,YGs=e0.ERR_UNKNOWN_ENCODING,ox=WNe.errorOrDestroy;oc()(qo,PXt);function ZGs(){}function DN(e,t,r){ax=ax||QS(),e=e||{},typeof r!="boolean"&&(r=t instanceof ax),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=$Gs(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){s6s(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new AXt(this)}DN.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(DN.prototype,"buffer",{get:OGs.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}})();var QJ;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(QJ=Function.prototype[Symbol.hasInstance],Object.defineProperty(qo,Symbol.hasInstance,{value:function(t){return QJ.call(this,t)?!0:this!==qo?!1:t&&t._writableState instanceof DN}})):QJ=function(t){return t instanceof this};function qo(e){ax=ax||QS();var t=this instanceof ax;if(!t&&!QJ.call(qo,this))return new qo(e);this._writableState=new DN(e,this,t),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)),PXt.call(this)}qo.prototype.pipe=function(){ox(this,new XGs)};function JGs(e,t){var r=new QGs;ox(e,r),process.nextTick(t,r)}function e6s(e,t,r,n){var i;return r===null?i=new WGs:typeof r!="string"&&!t.objectMode&&(i=new GGs("chunk",["string","Buffer"],r)),i?(ox(e,i),process.nextTick(n,i),!1):!0}qo.prototype.write=function(e,t,r){var n=this._writableState,i=!1,s=!n.objectMode&&BGs(e);return s&&!WJ.isBuffer(e)&&(e=jGs(e)),typeof t=="function"&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=ZGs),n.ending?JGs(this,r):(s||e6s(this,n,e,r))&&(n.pendingcb++,i=r6s(this,n,s,e,t,r)),i};qo.prototype.cork=function(){this._writableState.corked++};qo.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&RXt(this,e))};qo.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 YGs(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(qo.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function t6s(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=WJ.from(t,r)),t}Object.defineProperty(qo.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function r6s(e,t,r,n,i,s){if(!r){var a=t6s(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var o=t.objectMode?1:n.length;t.length+=o;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else QNe(e,t,!1,o,n,i,s);return c}function QNe(e,t,r,n,i,s,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new KGs("write")):r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function n6s(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(NN,e,t),e._writableState.errorEmitted=!0,ox(e,n)):(i(n),e._writableState.errorEmitted=!0,ox(e,n),NN(e,t))}function i6s(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function s6s(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new VGs;if(i6s(r),t)n6s(e,r,n,t,i);else{var s=kXt(r)||e.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&RXt(e,r),n?process.nextTick(xXt,e,r,s,i):xXt(e,r,s,i)}}function xXt(e,t,r,n){r||a6s(e,t),t.pendingcb--,n(),NN(e,t)}function a6s(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function RXt(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,o=!0;r;)i[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;i.allBuffers=o,QNe(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new AXt(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,u=r.callback,m=t.objectMode?1:c.length;if(QNe(e,t,!1,m,c,l,u),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}qo.prototype._write=function(e,t,r){r(new HGs("_write()"))};qo.prototype._writev=null;qo.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||l6s(this,n,r),this};Object.defineProperty(qo.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function kXt(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function o6s(e,t){e._final(function(r){t.pendingcb--,r&&ox(e,r),t.prefinished=!0,e.emit("prefinish"),NN(e,t)})}function c6s(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(o6s,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function NN(e,t){var r=kXt(t);if(r&&(c6s(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function l6s(e,t,r){t.ending=!0,NN(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function d6s(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(qo.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}});qo.prototype.destroy=WNe.destroy;qo.prototype._undestroy=WNe.undestroy;qo.prototype._destroy=function(e,t){t(e)}});var QS=g((F2o,qXt)=>{"use strict";var u6s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};qXt.exports=rh;var IXt=eLe(),ZNe=YNe();oc()(rh,IXt);for(JNe=u6s(ZNe.prototype),YJ=0;YJ<JNe.length;YJ++)ZJ=JNe[YJ],rh.prototype[ZJ]||(rh.prototype[ZJ]=ZNe.prototype[ZJ]);var JNe,ZJ,YJ;function rh(e){if(!(this instanceof rh))return new rh(e);IXt.call(this,e),ZNe.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",m6s)))}Object.defineProperty(rh.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(rh.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(rh.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function m6s(){this._writableState.ended||process.nextTick(f6s,this)}function f6s(e){e.end()}Object.defineProperty(rh.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var JJ=g((j2o,LXt)=>{"use strict";var DXt=J_().codes.ERR_STREAM_PREMATURE_CLOSE;function p6s(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function g6s(){}function h6s(e){return e.setHeader&&typeof e.abort=="function"}function NXt(e,t,r){if(typeof t=="function")return NXt(e,null,t);t||(t={}),r=p6s(r||g6s);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||o()},a=e._writableState&&e._writableState.finished,o=function(){i=!1,a=!0,n||r.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){n=!1,c=!0,i||r.call(e)},u=function(y){r.call(e,y)},m=function(){var y;if(n&&!c)return(!e._readableState||!e._readableState.ended)&&(y=new DXt),r.call(e,y);if(i&&!a)return(!e._writableState||!e._writableState.ended)&&(y=new DXt),r.call(e,y)},p=function(){e.req.on("finish",o)};return h6s(e)?(e.on("complete",o),e.on("abort",m),e.req?p():e.on("request",p)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",l),e.on("finish",o),t.error!==!1&&e.on("error",u),e.on("close",m),function(){e.removeListener("complete",o),e.removeListener("abort",m),e.removeListener("request",p),e.req&&e.req.removeListener("finish",o),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",o),e.removeListener("end",l),e.removeListener("error",u),e.removeListener("close",m)}}LXt.exports=NXt});var zXt=g((B2o,MXt)=>{"use strict";var eee;function t0(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var y6s=JJ(),r0=Symbol("lastResolve"),YS=Symbol("lastReject"),LN=Symbol("error"),tee=Symbol("ended"),ZS=Symbol("lastPromise"),tLe=Symbol("handlePromise"),JS=Symbol("stream");function n0(e,t){return{value:e,done:t}}function w6s(e){var t=e[r0];if(t!==null){var r=e[JS].read();r!==null&&(e[ZS]=null,e[r0]=null,e[YS]=null,t(n0(r,!1)))}}function v6s(e){process.nextTick(w6s,e)}function _6s(e,t){return function(r,n){e.then(function(){if(t[tee]){r(n0(void 0,!0));return}t[tLe](r,n)},n)}}var b6s=Object.getPrototypeOf(function(){}),S6s=Object.setPrototypeOf((eee={get stream(){return this[JS]},next:function(){var t=this,r=this[LN];if(r!==null)return Promise.reject(r);if(this[tee])return Promise.resolve(n0(void 0,!0));if(this[JS].destroyed)return new Promise(function(a,o){process.nextTick(function(){t[LN]?o(t[LN]):a(n0(void 0,!0))})});var n=this[ZS],i;if(n)i=new Promise(_6s(n,this));else{var s=this[JS].read();if(s!==null)return Promise.resolve(n0(s,!1));i=new Promise(this[tLe])}return this[ZS]=i,i}},t0(eee,Symbol.asyncIterator,function(){return this}),t0(eee,"return",function(){var t=this;return new Promise(function(r,n){t[JS].destroy(null,function(i){if(i){n(i);return}r(n0(void 0,!0))})})}),eee),b6s),C6s=function(t){var r,n=Object.create(S6s,(r={},t0(r,JS,{value:t,writable:!0}),t0(r,r0,{value:null,writable:!0}),t0(r,YS,{value:null,writable:!0}),t0(r,LN,{value:null,writable:!0}),t0(r,tee,{value:t._readableState.endEmitted,writable:!0}),t0(r,tLe,{value:function(s,a){var o=n[JS].read();o?(n[ZS]=null,n[r0]=null,n[YS]=null,s(n0(o,!1))):(n[r0]=s,n[YS]=a)},writable:!0}),r));return n[ZS]=null,y6s(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=n[YS];s!==null&&(n[ZS]=null,n[r0]=null,n[YS]=null,s(i)),n[LN]=i;return}var a=n[r0];a!==null&&(n[ZS]=null,n[r0]=null,n[YS]=null,a(n0(void 0,!0))),n[tee]=!0}),t.on("readable",v6s.bind(null,n)),n};MXt.exports=C6s});var BXt=g((U2o,jXt)=>{"use strict";function OXt(e,t,r,n,i,s,a){try{var o=e[s](a),c=o.value}catch(l){r(l);return}o.done?t(c):Promise.resolve(c).then(n,i)}function E6s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var s=e.apply(t,r);function a(c){OXt(s,n,i,a,o,"next",c)}function o(c){OXt(s,n,i,a,o,"throw",c)}a(void 0)})}}function FXt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function A6s(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FXt(Object(r),!0).forEach(function(n){P6s(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FXt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function P6s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x6s=J_().codes.ERR_INVALID_ARG_TYPE;function R6s(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new x6s("iterable",["Iterable"],t);var i=new e(A6s({objectMode:!0},r)),s=!1;i._read=function(){s||(s=!0,a())};function a(){return o.apply(this,arguments)}function o(){return o=E6s(function*(){try{var c=yield n.next(),l=c.value,u=c.done;u?i.push(null):i.push(yield l)?a():s=!1}catch(m){i.destroy(m)}}),o.apply(this,arguments)}return i}jXt.exports=R6s});var eLe=g((G2o,YXt)=>{"use strict";YXt.exports=Ks;var cx;Ks.ReadableState=$Xt;var $2o=require("events").EventEmitter,UXt=function(t,r){return t.listeners(r).length},MN=GNe(),ree=require("buffer").Buffer,k6s=global.Uint8Array||function(){};function T6s(e){return ree.from(e)}function I6s(e){return ree.isBuffer(e)||e instanceof k6s}var rLe=require("util"),_s;rLe&&rLe.debuglog?_s=rLe.debuglog("stream"):_s=function(){};var q6s=yXt(),nLe=XNe(),D6s=KNe(),N6s=D6s.getHighWaterMark,nee=J_().codes,L6s=nee.ERR_INVALID_ARG_TYPE,M6s=nee.ERR_STREAM_PUSH_AFTER_EOF,z6s=nee.ERR_METHOD_NOT_IMPLEMENTED,O6s=nee.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,lx,iLe,sLe;oc()(Ks,MN);var zN=nLe.errorOrDestroy,aLe=["error","close","destroy","pause","resume"];function F6s(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function $Xt(e,t,r){cx=cx||QS(),e=e||{},typeof r!="boolean"&&(r=t instanceof cx),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=N6s(this,e,"readableHighWaterMark",r),this.buffer=new q6s,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.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(lx||(lx=require("string_decoder/").StringDecoder),this.decoder=new lx(e.encoding),this.encoding=e.encoding)}function Ks(e){if(cx=cx||QS(),!(this instanceof Ks))return new Ks(e);var t=this instanceof cx;this._readableState=new $Xt(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),MN.call(this)}Object.defineProperty(Ks.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){!this._readableState||(this._readableState.destroyed=t)}});Ks.prototype.destroy=nLe.destroy;Ks.prototype._undestroy=nLe.undestroy;Ks.prototype._destroy=function(e,t){t(e)};Ks.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=ree.from(e,t),t=""),n=!0),GXt(this,e,t,!1,n)};Ks.prototype.unshift=function(e){return GXt(this,e,null,!0,!1)};function GXt(e,t,r,n,i){_s("readableAddChunk",t);var s=e._readableState;if(t===null)s.reading=!1,U6s(e,s);else{var a;if(i||(a=j6s(s,t)),a)zN(e,a);else if(s.objectMode||t&&t.length>0)if(typeof t!="string"&&!s.objectMode&&Object.getPrototypeOf(t)!==ree.prototype&&(t=T6s(t)),n)s.endEmitted?zN(e,new O6s):oLe(e,s,t,!0);else if(s.ended)zN(e,new M6s);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||t.length!==0?oLe(e,s,t,!1):cLe(e,s)):oLe(e,s,t,!1)}else n||(s.reading=!1,cLe(e,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function oLe(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&iee(e)),cLe(e,t)}function j6s(e,t){var r;return!I6s(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new L6s("chunk",["string","Buffer","Uint8Array"],t)),r}Ks.prototype.isPaused=function(){return this._readableState.flowing===!1};Ks.prototype.setEncoding=function(e){lx||(lx=require("string_decoder/").StringDecoder);var t=new lx(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var HXt=1073741824;function B6s(e){return e>=HXt?e=HXt:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function VXt(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=B6s(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Ks.prototype.read=function(e){_s("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return _s("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?dLe(this):iee(this),null;if(e=VXt(e,t),e===0&&t.ended)return t.length===0&&dLe(this),null;var n=t.needReadable;_s("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,_s("length less than watermark",n)),t.ended||t.reading?(n=!1,_s("reading or ended",n)):n&&(_s("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=VXt(r,t)));var i;return e>0?i=WXt(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&dLe(this)),i!==null&&this.emit("data",i),i};function U6s(e,t){if(_s("onEofChunk"),!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,t.sync?iee(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,XXt(e)))}}function iee(e){var t=e._readableState;_s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(_s("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(XXt,e))}function XXt(e){var t=e._readableState;_s("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,lLe(e)}function cLe(e,t){t.readingMore||(t.readingMore=!0,process.nextTick($6s,e,t))}function $6s(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(_s("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Ks.prototype._read=function(e){zN(this,new z6s("_read()"))};Ks.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,_s("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,s=i?o:w;n.endEmitted?process.nextTick(s):r.once("end",s),e.on("unpipe",a);function a(v,b){_s("onunpipe"),v===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,u())}function o(){_s("onend"),e.end()}var c=G6s(r);e.on("drain",c);var l=!1;function u(){_s("cleanup"),e.removeListener("close",h),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",w),r.removeListener("data",m),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}r.on("data",m);function m(v){_s("ondata");var b=e.write(v);_s("dest.write",b),b===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&QXt(n.pipes,e)!==-1)&&!l&&(_s("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(v){_s("onerror",v),w(),e.removeListener("error",p),UXt(e,"error")===0&&zN(e,v)}F6s(e,"error",p);function h(){e.removeListener("finish",y),w()}e.once("close",h);function y(){_s("onfinish"),e.removeListener("close",h),w()}e.once("finish",y);function w(){_s("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(_s("pipe resume"),r.resume()),e};function G6s(e){return function(){var r=e._readableState;_s("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&UXt(e,"data")&&(r.flowing=!0,lLe(e))}}Ks.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 n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=QXt(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Ks.prototype.on=function(e,t){var r=MN.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,_s("on readable",n.length,n.reading),n.length?iee(this):n.reading||process.nextTick(H6s,this)),r};Ks.prototype.addListener=Ks.prototype.on;Ks.prototype.removeListener=function(e,t){var r=MN.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(KXt,this),r};Ks.prototype.removeAllListeners=function(e){var t=MN.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(KXt,this),t};function KXt(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function H6s(e){_s("readable nexttick read 0"),e.read(0)}Ks.prototype.resume=function(){var e=this._readableState;return e.flowing||(_s("resume"),e.flowing=!e.readableListening,V6s(this,e)),e.paused=!1,this};function V6s(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(X6s,e,t))}function X6s(e,t){_s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),lLe(e),t.flowing&&!t.reading&&e.read(0)}Ks.prototype.pause=function(){return _s("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function lLe(e){var t=e._readableState;for(_s("flow",t.flowing);t.flowing&&e.read()!==null;);}Ks.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(_s("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(_s("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var o=t.push(a);o||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(o){return function(){return e[o].apply(e,arguments)}}(i));for(var s=0;s<aLe.length;s++)e.on(aLe[s],this.emit.bind(this,aLe[s]));return this._read=function(a){_s("wrapped _read",a),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Ks.prototype[Symbol.asyncIterator]=function(){return iLe===void 0&&(iLe=zXt()),iLe(this)});Object.defineProperty(Ks.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Ks.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Ks.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Ks._fromList=WXt;Object.defineProperty(Ks.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function WXt(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.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function dLe(e){var t=e._readableState;_s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(K6s,t,e))}function K6s(e,t){if(_s("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Ks.from=function(e,t){return sLe===void 0&&(sLe=BXt()),sLe(Ks,e,t)});function QXt(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var uLe=g((H2o,JXt)=>{"use strict";JXt.exports=vw;var see=J_().codes,W6s=see.ERR_METHOD_NOT_IMPLEMENTED,Q6s=see.ERR_MULTIPLE_CALLBACK,Y6s=see.ERR_TRANSFORM_ALREADY_TRANSFORMING,Z6s=see.ERR_TRANSFORM_WITH_LENGTH_0,aee=QS();oc()(vw,aee);function J6s(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Q6s);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function vw(e){if(!(this instanceof vw))return new vw(e);aee.call(this,e),this._transformState={afterTransform:J6s.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",e4s)}function e4s(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){ZXt(e,t,r)}):ZXt(this,null,null)}vw.prototype.push=function(e,t){return this._transformState.needTransform=!1,aee.prototype.push.call(this,e,t)};vw.prototype._transform=function(e,t,r){r(new W6s("_transform()"))};vw.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};vw.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};vw.prototype._destroy=function(e,t){aee.prototype._destroy.call(this,e,function(r){t(r)})};function ZXt(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Z6s;if(e._transformState.transforming)throw new Y6s;return e.push(null)}});var rKt=g((V2o,tKt)=>{"use strict";tKt.exports=ON;var eKt=uLe();oc()(ON,eKt);function ON(e){if(!(this instanceof ON))return new ON(e);eKt.call(this,e)}ON.prototype._transform=function(e,t,r){r(null,e)}});var oKt=g((X2o,aKt)=>{"use strict";var mLe;function t4s(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var nKt=J_().codes,r4s=nKt.ERR_MISSING_ARGS,n4s=nKt.ERR_STREAM_DESTROYED;function iKt(e){if(e)throw e}function i4s(e){return e.setHeader&&typeof e.abort=="function"}function s4s(e,t,r,n){n=t4s(n);var i=!1;e.on("close",function(){i=!0}),mLe===void 0&&(mLe=JJ()),mLe(e,{readable:t,writable:r},function(a){if(a)return n(a);i=!0,n()});var s=!1;return function(a){if(!i&&!s){if(s=!0,i4s(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(a||new n4s("pipe"))}}}function sKt(e){e()}function a4s(e,t){return e.pipe(t)}function o4s(e){return!e.length||typeof e[e.length-1]!="function"?iKt:e.pop()}function c4s(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=o4s(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new r4s("streams");var i,s=t.map(function(a,o){var c=o<t.length-1,l=o>0;return s4s(a,c,l,function(u){i||(i=u),u&&s.forEach(sKt),!c&&(s.forEach(sKt),n(i))})});return t.reduce(a4s)}aKt.exports=c4s});var kf=g((Rf,jN)=>{var FN=require("stream");process.env.READABLE_STREAM==="disable"&&FN?(jN.exports=FN.Readable,Object.assign(jN.exports,FN),jN.exports.Stream=FN):(Rf=jN.exports=eLe(),Rf.Stream=FN||Rf,Rf.Readable=Rf,Rf.Writable=YNe(),Rf.Duplex=QS(),Rf.Transform=uLe(),Rf.PassThrough=rKt(),Rf.finished=JJ(),Rf.pipeline=oKt())});var dKt=g((K2o,lKt)=>{lKt.exports=_w;var l4s=require("util"),cKt=kf();l4s.inherits(_w,cKt.Duplex);function _w(e,t,r){var n=this;if(!(n instanceof _w))return new _w(e,t,r);cKt.Duplex.call(n,r),n._output=null,n.connect(e,t)}_w.prototype.connect=function(e,t){var r=this;r.req=e,r._output=t,r.emit("response",t),t.on("data",function(n){r.push(n)||r._output.pause()}),t.on("end",function(){r.push(null)})};_w.prototype._read=function(e){this._output&&this._output.resume()};_w.prototype._write=function(e,t,r){this.req.write(e,t),r()};_w.prototype.end=function(e,t,r){return this._output.socket.destroy(),this.req.end(e,t,r)};_w.prototype.destroy=function(){this.req.destroy(),this._output.socket.destroy()}});var mKt=g((W2o,uKt)=>{var dx=1e3,ux=dx*60,mx=ux*60,eC=mx*24,d4s=eC*7,u4s=eC*365.25;uKt.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return m4s(e);if(r==="number"&&isFinite(e))return t.long?p4s(e):f4s(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function m4s(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*u4s;case"weeks":case"week":case"w":return r*d4s;case"days":case"day":case"d":return r*eC;case"hours":case"hour":case"hrs":case"hr":case"h":return r*mx;case"minutes":case"minute":case"mins":case"min":case"m":return r*ux;case"seconds":case"second":case"secs":case"sec":case"s":return r*dx;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function f4s(e){var t=Math.abs(e);return t>=eC?Math.round(e/eC)+"d":t>=mx?Math.round(e/mx)+"h":t>=ux?Math.round(e/ux)+"m":t>=dx?Math.round(e/dx)+"s":e+"ms"}function p4s(e){var t=Math.abs(e);return t>=eC?oee(e,t,eC,"day"):t>=mx?oee(e,t,mx,"hour"):t>=ux?oee(e,t,ux,"minute"):t>=dx?oee(e,t,dx,"second"):e+" ms"}function oee(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var fLe=g((Q2o,fKt)=>{function g4s(e){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=s,r.enabled=o,r.humanize=mKt(),Object.keys(e).forEach(u=>{r[u]=e[u]}),r.instances=[],r.names=[],r.skips=[],r.formatters={};function t(u){let m=0;for(let p=0;p<u.length;p++)m=(m<<5)-m+u.charCodeAt(p),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=t;function r(u){let m;function p(...h){if(!p.enabled)return;let y=p,w=Number(new Date),v=w-(m||w);y.diff=v,y.prev=m,y.curr=w,m=w,h[0]=r.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let b=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(I,R)=>{if(I==="%%")return I;b++;let F=r.formatters[R];if(typeof F=="function"){let J=h[b];I=F.call(y,J),h.splice(b,1),b--}return I}),r.formatArgs.call(y,h),(y.log||r.log).apply(y,h)}return p.namespace=u,p.enabled=r.enabled(u),p.useColors=r.useColors(),p.color=t(u),p.destroy=n,p.extend=i,typeof r.init=="function"&&r.init(p),r.instances.push(p),p}function n(){let u=r.instances.indexOf(this);return u!==-1?(r.instances.splice(u,1),!0):!1}function i(u,m){let p=r(this.namespace+(typeof m=="undefined"?":":m)+u);return p.log=this.log,p}function s(u){r.save(u),r.names=[],r.skips=[];let m,p=(typeof u=="string"?u:"").split(/[\s,]+/),h=p.length;for(m=0;m<h;m++)!p[m]||(u=p[m].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.substr(1)+"$")):r.names.push(new RegExp("^"+u+"$")));for(m=0;m<r.instances.length;m++){let y=r.instances[m];y.enabled=r.enabled(y.namespace)}}function a(){let u=[...r.names.map(c),...r.skips.map(c).map(m=>"-"+m)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let m,p;for(m=0,p=r.skips.length;m<p;m++)if(r.skips[m].test(u))return!1;for(m=0,p=r.names.length;m<p;m++)if(r.names[m].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}return r.enable(r.load()),r}fKt.exports=g4s});var pKt=g((Tf,cee)=>{Tf.log=w4s;Tf.formatArgs=y4s;Tf.save=v4s;Tf.load=_4s;Tf.useColors=h4s;Tf.storage=b4s();Tf.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function h4s(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function y4s(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+cee.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}function w4s(...e){return typeof console=="object"&&console.log&&console.log(...e)}function v4s(e){try{e?Tf.storage.setItem("debug",e):Tf.storage.removeItem("debug")}catch(t){}}function _4s(){let e;try{e=Tf.storage.getItem("debug")}catch(t){}return!e&&typeof process!="undefined"&&"env"in process&&(e=process.env.DEBUG),e}function b4s(){try{return localStorage}catch(e){}}cee.exports=fLe()(Tf);var{formatters:S4s}=cee.exports;S4s.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var hKt=g((nd,lee)=>{var C4s=require("tty"),pLe=require("util");nd.init=T4s;nd.log=x4s;nd.formatArgs=A4s;nd.save=R4s;nd.load=k4s;nd.useColors=E4s;nd.colors=[6,2,3,4,5,1];try{let e=z1();e&&(e.stderr||e).level>=2&&(nd.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}nd.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function E4s(){return"colors"in nd.inspectOpts?Boolean(nd.inspectOpts.colors):C4s.isatty(process.stderr.fd)}function A4s(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} `;e[0]=s+e[0].split(`
81
+ `),this._state.incoming.expectedPacket="KEXINIT"}Q3s(Bn,qJ);Bn.prototype.__read=qJ.prototype._read;Bn.prototype._read=function(e){return this._needContinue&&(this._needContinue=!1,this.emit("continue")),this.__read(e)};Bn.prototype.__push=qJ.prototype.push;Bn.prototype.push=function(e,t){var r=this.__push(e,t);return this._needContinue=r===!1,r};Bn.prototype._cleanup=function(e){this.reset(),this.debug("DEBUG: Parser: Malformed packet"),e&&e(new Error("Malformed packet"))};Bn.prototype._transform=function(e,t,r,n){var i=!1,s=!1,a=this._state,o=a.incoming,c=a.outgoing,l=o.expect,u=o.decrypt,m=o.decompress,p=e.length,h=0,y=this.debug,w=this,v=0,b=v,A,I,R,F;for(this.bytesReceived+=p;;){if(l.type!==void 0){if(v>=p)break;if(l.type===rx){h=p-v;var J=l.buf.length-l.ptr;J<=h?(e.copy(l.buf,l.ptr,v,v+J),v+=J,I=l.buf,l.buf=void 0,l.ptr=0,l.type=void 0):(e.copy(l.buf,l.ptr,v),l.ptr+=h,v+=h);continue}else if(l.type===s7t){if(v+=o.search.push(e),l.type!==void 0)continue}else if(l.type===a7t){if(++l.ptr+4>255)return this.reset(),y("DEBUG: Parser: Identification string exceeded 255 characters"),r(new Error("Max identification string size exceeded"));if(e[v]===10)l.type=void 0,b<v&&(l.buf===void 0?l.buf=e.toString("ascii",b,v):l.buf+=e.toString("ascii",b,v)),I=l.buf,l.buf=void 0,++v;else{++v===p&&b<v&&(l.buf===void 0?l.buf=e.toString("ascii",b,v):l.buf+=e.toString("ascii",b,v));continue}}}if(o.status===tx){if(!this.readable)return r();if(this.server)if(!I)y("DEBUG: Parser: IN_INIT (waiting for identification begin)"),XS(this,rx,4);else if(I[0]===83&&I[1]===83&&I[2]===72&&I[3]===45)o.status=vNe,y("DEBUG: Parser: IN_INIT (waiting for rest of identification)");else return this.reset(),y("DEBUG: Parser: Bad identification start"),r(new Error("Bad identification start"));else{y("DEBUG: Parser: IN_INIT");var X=o.search=new Y3s(l$s);X.on("info",function Ue(Rr,z,Q,ge){z&&(o.greeting===void 0?o.greeting=z.toString("binary",Q,ge):o.greeting+=z.toString("binary",Q,ge)),Rr&&(l.type=void 0,o.search.removeListener("info",Ue))}),X.maxMatches=1,XS(this,s7t),o.status=vNe}}else if(o.status===vNe)y("DEBUG: Parser: IN_GREETING"),o.search=void 0,b=v,XS(this,a7t),o.status=n7t;else if(o.status===n7t){y("DEBUG: Parser: IN_HEADER"),I.charCodeAt(I.length-1)===13&&(I=I.slice(0,-1));var H=I.indexOf("-"),ae=I.indexOf(" "),le={greeting:o.greeting,identRaw:"SSH-"+I,versions:{protocol:I.substr(0,H),software:ae===-1?I.substring(H+1):I.substring(H+1,ae)},comments:ae>-1?I.substring(ae+1):void 0};if(o.greeting=void 0,le.versions.protocol!=="1.99"&&le.versions.protocol!=="2.0")return this.reset(),y("DEBUG: Parser: protocol version not supported: "+le.versions.protocol),r(new Error("Protocol version not supported"));if(this.emit("header",le),o.status===tx)return;var D=le.identRaw,ie=le.versions.software;this.debug("DEBUG: Remote ident: "+Q9t(D));for(var re=0,Pe;re<i$s;++re)Pe=r7t[re],typeof Pe[0]=="string"?ie===Pe[0]&&(this.remoteBugs|=Pe[1]):Pe[0].test(ie)&&(this.remoteBugs|=Pe[1]);o.identRaw=D,this.bytesReceived-=p-v,kNe(this,function(){v===p?r():w._transform(e.slice(v),t,r)}),o.status=NJ;return}else if(o.status===NJ)A=u.instance?u.info.blockLen:8,y("DEBUG: Parser: IN_PACKETBEFORE (expecting "+A+")"),XS(this,rx,A,u.buf),o.status=_Ne;else if(o.status===_Ne){if(y("DEBUG: Parser: IN_PACKET"),u.instance?(s=u.info.authLen>0,s||(I=m7t(this,I)),A=u.info.blockLen):(s=!1,A=8),F=ys(I,0,this,r),F===!1)return;var B=o.hmac.info,ee;B?ee=B.actualLen:ee=0;var Ge=F+4+ee,We=this.maxPacketSize;if(m.instance&&(We+=(this.maxPacketSize/16384+1)*5+6),F>We||Ge<16+ee||(F+(s?0:4))%A!=0)return this.disconnect(Da.PROTOCOL_ERROR),y("DEBUG: Parser: Bad packet length ("+Ge+")"),r(new Error("Bad packet length"));o.pktLen=F;var nt=o.pktLen+4-A;if(s?(u.instance.setAAD(I.slice(0,4)),y("DEBUG: Parser: pktLen:"+o.pktLen+",remainLen:"+nt)):(o.padLen=I[4],y("DEBUG: Parser: pktLen:"+o.pktLen+",padLen:"+o.padLen+",remainLen:"+nt)),nt>0)s?o.pktExtra=I.slice(4):o.pktExtra=I.slice(5),XS(this,rx,nt),o.status=bNe;else if(nt<0)o.status=NJ;else{i=!0,o.status=bNe;continue}}else if(o.status===bNe){y("DEBUG: Parser: IN_PACKETDATA"),u.instance?(s=u.info.authLen>0,i?i=!1:s||(I=m7t(this,I))):(s=!1,i=!1);var Tt=o.pktLen-o.padLen-1;if(o.pktExtra?(R=Buffer.allocUnsafe(o.pktExtra.length+I.length),o.pktExtra.copy(R),I.copy(R,o.pktExtra.length),o.payload=R.slice(0,Tt)):(s?R=I.slice(4):R=I.slice(5),o.payload=I.slice(5,5+Tt)),o.hmac.info!==void 0){var qt=u.info.authLen||o.hmac.info.actualLen;y("DEBUG: Parser: HMAC size:"+qt),XS(this,rx,qt,o.hmac.buf),o.status=i7t,o.packet=R}else o.status=SNe;o.pktExtra=void 0,R=void 0}else if(o.status===i7t)if(y("DEBUG: Parser: IN_PACKETDATAVERIFY"),E$s(this,I))y("DEBUG: Parser: IN_PACKETDATAVERIFY (Valid HMAC)"),o.status=SNe,o.packet=void 0;else return this.reset(),y("DEBUG: Parser: IN_PACKETDATAVERIFY (Invalid HMAC)"),r(new Error("Invalid HMAC"));else if(o.status===SNe){if(m.instance)if(n)n=!1;else{y("DEBUG: Parser: Decompressing"),m.instance.write(o.payload);var er=[],ct=0;m.instance.on("readable",function(){for(var Ue;Ue=this.read();)er.push(Ue),ct+=Ue.length}).flush(ANe,function(){m.instance.removeAllListeners("readable"),er.length===1?o.payload=er[0]:o.payload=Buffer.concat(er,ct),er=null;var Ue;v===p?Ue=PNe:Ue=e.slice(v),w._transform(Ue,t,r,!0)});return}this.emit("packet");var ft=o.payload[0];if(y!==o7t){var ur="DEBUG: Parser: IN_PACKETDATAAFTER, packet: ",pt=a.authsQueue[0],sr=null;if(c.status===K_&&!(ft<=4||ft>=20&&ft<=49)&&(ur+="(enqueued) "),ft===ir.KEXDH_INIT)switch(a.kex.type){case"group":sr="KEXDH_INIT";break;case"groupex":sr="KEXDH_GEX_REQUEST";break;default:sr="KEXECDH_INIT"}else if(ft===ir.KEXDH_REPLY)switch(a.kex.type){case"group":sr="KEXDH_REPLY";break;case"groupex":sr="KEXDH_GEX_GROUP";break;default:sr="KEXECDH_REPLY"}else ft===ir.KEXDH_GEX_GROUP?sr="KEXDH_GEX_GROUP":ft===ir.KEXDH_GEX_REPLY?sr="KEXDH_GEX_REPLY":ft===60?pt==="password"?sr="USERAUTH_PASSWD_CHANGEREQ":pt==="keyboard-interactive"?sr="USERAUTH_INFO_REQUEST":pt==="publickey"?sr="USERAUTH_PK_OK":sr="UNKNOWN PACKET 60":ft===61&&(pt==="keyboard-interactive"?sr="USERAUTH_INFO_RESPONSE":sr="UNKNOWN PACKET 61");sr===null&&(sr=ir[ft]),ft!==ir.CHANNEL_OPEN&&ft!==ir.CHANNEL_REQUEST&&ft!==ir.CHANNEL_SUCCESS&&ft!==ir.CHANNEL_FAILURE&&ft!==ir.CHANNEL_EOF&&ft!==ir.CHANNEL_CLOSE&&ft!==ir.CHANNEL_DATA&&ft!==ir.CHANNEL_EXTENDED_DATA&&ft!==ir.CHANNEL_WINDOW_ADJUST&&ft!==ir.DISCONNECT&&ft!==ir.USERAUTH_REQUEST&&ft!==ir.GLOBAL_REQUEST&&y(ur+sr)}if(c.status===X_||ft<=4||ft>=20&&ft<=49){if(d7t(this,r)===!1||o.status===tx)return}else if(c.status===K_){if(o.rekeyQueue.length===o$s)return y("DEBUG: Parser: Max incoming re-key queue length reached"),this.disconnect(Da.PROTOCOL_ERROR),r(new Error("Incoming re-key queue length limit reached"));var Nr=o.seqno;++o.seqno>ENe&&(o.seqno=0),o.rekeyQueue.push([Nr,o.payload])}o.status=NJ,o.payload=void 0}I!==void 0&&(I=void 0)}r()};Bn.prototype.reset=function(e){if(this._state){var t=this._state;t.incoming.status=tx,t.outgoing.status=CNe}else this._state={authsQueue:[],hostkeyFormat:void 0,kex:void 0,incoming:{status:tx,expectedPacket:void 0,search:void 0,greeting:void 0,seqno:0,pktLen:void 0,padLen:void 0,pktExtra:void 0,payload:void 0,packet:void 0,kexinit:void 0,identRaw:void 0,rekeyQueue:[],ignoreNext:!1,expect:{amount:void 0,type:void 0,ptr:0,buf:void 0},decrypt:{instance:!1,info:void 0,iv:void 0,key:void 0,buf:void 0,type:void 0},hmac:{info:void 0,key:void 0,buf:void 0,type:!1},decompress:{instance:!1,type:!1}},outgoing:{status:CNe,seqno:0,bufSeqno:Buffer.allocUnsafe(4),rekeyQueue:[],kexinit:void 0,kexsecret:void 0,pubkey:void 0,exchangeHash:void 0,sessionId:void 0,sentNEWKEYS:!1,encrypt:{instance:!1,info:void 0,iv:void 0,key:void 0,type:void 0},hmac:{info:void 0,key:void 0,buf:void 0,type:!1},compress:{instance:!1,type:!1,queue:null}}};e||this.readable&&this.push(null)};Bn.prototype.disconnect=function(e){var t=Buffer.alloc(1+4+4+4);return t[0]=ir.DISCONNECT,Da[e]===void 0&&(e=Da.BY_APPLICATION),Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing DISCONNECT ("+Da[e]+")"),Tn(this,t),this.reset(),!1};Bn.prototype.ping=function(){return this.debug("DEBUG: Outgoing: Writing ping (GLOBAL_REQUEST: keepalive@openssh.com)"),Tn(this,d$s)};Bn.prototype.rekey=function(){var e=this._state.outgoing.status;if(e===K_)throw new Error("A re-key is already in progress");if(e!==X_)throw new Error("Cannot re-key yet");return this.debug("DEBUG: Outgoing: Starting re-key"),kNe(this)};Bn.prototype.requestSuccess=function(e){var t;return Buffer.isBuffer(e)?(t=Buffer.allocUnsafe(1+e.length),t[0]=ir.REQUEST_SUCCESS,e.copy(t,1)):t=m$s,this.debug("DEBUG: Outgoing: Writing REQUEST_SUCCESS"),Tn(this,t)};Bn.prototype.requestFailure=function(){return this.debug("DEBUG: Outgoing: Writing REQUEST_FAILURE"),Tn(this,f$s)};Bn.prototype.channelSuccess=function(e){var t=Buffer.allocUnsafe(1+4);return t[0]=ir.CHANNEL_SUCCESS,Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing CHANNEL_SUCCESS ("+e+")"),Tn(this,t)};Bn.prototype.channelFailure=function(e){var t=Buffer.allocUnsafe(1+4);return t[0]=ir.CHANNEL_FAILURE,Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing CHANNEL_FAILURE ("+e+")"),Tn(this,t)};Bn.prototype.channelEOF=function(e){var t=Buffer.allocUnsafe(1+4);return t[0]=ir.CHANNEL_EOF,Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing CHANNEL_EOF ("+e+")"),Tn(this,t)};Bn.prototype.channelClose=function(e){var t=Buffer.allocUnsafe(1+4);return t[0]=ir.CHANNEL_CLOSE,Ye(t,e,1),this.debug("DEBUG: Outgoing: Writing CHANNEL_CLOSE ("+e+")"),Tn(this,t)};Bn.prototype.channelWindowAdjust=function(e,t){var r=Buffer.allocUnsafe(1+4+4);return r[0]=ir.CHANNEL_WINDOW_ADJUST,Ye(r,e,1),Ye(r,t,5),this.debug("DEBUG: Outgoing: Writing CHANNEL_WINDOW_ADJUST ("+e+", "+t+")"),Tn(this,r)};Bn.prototype.channelData=function(e,t){var r=Buffer.isBuffer(t),n=r?t.length:Buffer.byteLength(t),i=Buffer.allocUnsafe(1+4+4+n);return i[0]=ir.CHANNEL_DATA,Ye(i,e,1),Ye(i,n,5),r?t.copy(i,9):i.write(t,9,n,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_DATA ("+e+")"),Tn(this,i)};Bn.prototype.channelExtData=function(e,t,r){var n=Buffer.isBuffer(t),i=n?t.length:Buffer.byteLength(t),s=Buffer.allocUnsafe(1+4+4+4+i);return s[0]=ir.CHANNEL_EXTENDED_DATA,Ye(s,e,1),Ye(s,r,5),Ye(s,i,9),n?t.copy(s,13):s.write(t,13,i,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_EXTENDED_DATA ("+e+")"),Tn(this,s)};Bn.prototype.channelOpenConfirm=function(e,t,r,n){var i=Buffer.allocUnsafe(1+4+4+4+4);return i[0]=ir.CHANNEL_OPEN_CONFIRMATION,Ye(i,e,1),Ye(i,t,5),Ye(i,r,9),Ye(i,n,13),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN_CONFIRMATION (r:"+e+", l:"+t+")"),Tn(this,i)};Bn.prototype.channelOpenFail=function(e,t,r,n){typeof r!="string"&&(r=""),typeof n!="string"&&(n="");var i=Buffer.byteLength(r),s=Buffer.byteLength(n),a=9,o=Buffer.allocUnsafe(1+4+4+4+i+4+s);return o[0]=ir.CHANNEL_OPEN_FAILURE,Ye(o,e,1),Ye(o,t,5),Ye(o,i,a),a+=4,i&&(o.write(r,a,i,"utf8"),a+=i),Ye(o,s,a),s&&o.write(n,a+=4,s,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN_FAILURE ("+e+")"),Tn(this,o)};Bn.prototype.service=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=Buffer.allocUnsafe(1+4+t);return r[0]=ir.SERVICE_REQUEST,Ye(r,t,1),r.write(e,5,t,"ascii"),this.debug("DEBUG: Outgoing: Writing SERVICE_REQUEST ("+e+")"),Tn(this,r)};Bn.prototype.tcpipForward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(e),i=Buffer.allocUnsafe(1+4+13+1+4+n+4);return i[0]=ir.GLOBAL_REQUEST,Ye(i,13,1),i.write("tcpip-forward",5,13,"ascii"),i[18]=r===void 0||r===!0?1:0,Ye(i,n,19),i.write(e,23,n,"ascii"),Ye(i,t,23+n),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (tcpip-forward)"),Tn(this,i)};Bn.prototype.cancelTcpipForward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(e),i=Buffer.allocUnsafe(1+4+20+1+4+n+4);return i[0]=ir.GLOBAL_REQUEST,Ye(i,20,1),i.write("cancel-tcpip-forward",5,20,"ascii"),i[25]=r===void 0||r===!0?1:0,Ye(i,n,26),i.write(e,30,n,"ascii"),Ye(i,t,30+n),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (cancel-tcpip-forward)"),Tn(this,i)};Bn.prototype.openssh_streamLocalForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(e),n=Buffer.allocUnsafe(1+4+31+1+4+r);return n[0]=ir.GLOBAL_REQUEST,Ye(n,31,1),n.write("streamlocal-forward@openssh.com",5,31,"ascii"),n[36]=t===void 0||t===!0?1:0,Ye(n,r,37),n.write(e,41,r,"utf8"),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),Tn(this,n)};Bn.prototype.openssh_cancelStreamLocalForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(e),n=Buffer.allocUnsafe(1+4+38+1+4+r);return n[0]=ir.GLOBAL_REQUEST,Ye(n,38,1),n.write("cancel-streamlocal-forward@openssh.com",5,38,"ascii"),n[43]=t===void 0||t===!0?1:0,Ye(n,r,44),n.write(e,48,r,"utf8"),this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)"),Tn(this,n)};Bn.prototype.directTcpip=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(n.srcIP),s=Buffer.byteLength(n.dstIP),a=29,o=Buffer.allocUnsafe(1+4+12+4+4+4+4+i+4+4+s+4);return o[0]=ir.CHANNEL_OPEN,Ye(o,12,1),o.write("direct-tcpip",5,12,"ascii"),Ye(o,e,17),Ye(o,t,21),Ye(o,r,25),Ye(o,s,a),o.write(n.dstIP,a+=4,s,"ascii"),Ye(o,n.dstPort,a+=s),Ye(o,i,a+=4),o.write(n.srcIP,a+=4,i,"ascii"),Ye(o,n.srcPort,a+=i),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", direct-tcpip)"),Tn(this,o)};Bn.prototype.openssh_directStreamLocal=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(n.socketPath),s=47,a=Buffer.allocUnsafe(1+4+30+4+4+4+4+i+4+4);return a[0]=ir.CHANNEL_OPEN,Ye(a,30,1),a.write("direct-streamlocal@openssh.com",5,30,"ascii"),Ye(a,e,35),Ye(a,t,39),Ye(a,r,43),Ye(a,i,s),a.write(n.socketPath,s+=4,i,"utf8"),a.fill(0,a.length-8),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", direct-streamlocal@openssh.com)"),Tn(this,a)};Bn.prototype.openssh_noMoreSessions=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.allocUnsafe(1+4+28+1);return t[0]=ir.GLOBAL_REQUEST,Ye(t,28,1),t.write("no-more-sessions@openssh.com",5,28,"ascii"),t[33]=e===void 0||e===!0?1:0,this.debug("DEBUG: Outgoing: Writing GLOBAL_REQUEST (no-more-sessions@openssh.com)"),Tn(this,t)};Bn.prototype.session=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.allocUnsafe(1+4+7+4+4+4);return n[0]=ir.CHANNEL_OPEN,Ye(n,7,1),n.write("session",5,7,"ascii"),Ye(n,e,12),Ye(n,t,16),Ye(n,r,20),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", session)"),Tn(this,n)};Bn.prototype.windowChange=function(e,t,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");var s=Buffer.allocUnsafe(1+4+4+13+1+4+4+4+4);return s[0]=ir.CHANNEL_REQUEST,Ye(s,e,1),Ye(s,13,5),s.write("window-change",9,13,"ascii"),s[22]=0,Ye(s,r,23),Ye(s,t,27),Ye(s,i,31),Ye(s,n,35),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", window-change)"),Tn(this,s)};Bn.prototype.pty=function(e,t,r,n,i,s,a,o){if(this.server)throw new Error("Client-only method called in server mode");(!s||!s.length)&&(s="vt100"),a&&!Buffer.isBuffer(a)&&!Array.isArray(a)&&typeof a=="object"&&(a=P$s(a)),(!a||!a.length)&&(a=p$s);var c=s.length,l=a.length,u=21,m=Buffer.allocUnsafe(1+4+4+7+1+4+c+4+4+4+4+4+l);if(m[0]=ir.CHANNEL_REQUEST,Ye(m,e,1),Ye(m,7,5),m.write("pty-req",9,7,"ascii"),m[16]=o===void 0||o===!0?1:0,Ye(m,c,17),m.write(s,21,c,"utf8"),Ye(m,r,u+=c),Ye(m,t,u+=4),Ye(m,i,u+=4),Ye(m,n,u+=4),Ye(m,l,u+=4),u+=4,Array.isArray(a))for(var p=0;p<l;++p)m[u++]=a[p];else Buffer.isBuffer(a)&&a.copy(m,u);return this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", pty-req)"),Tn(this,m)};Bn.prototype.shell=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.allocUnsafe(1+4+4+5+1);return r[0]=ir.CHANNEL_REQUEST,Ye(r,e,1),Ye(r,5,5),r.write("shell",9,5,"ascii"),r[14]=t===void 0||t===!0?1:0,this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", shell)"),Tn(this,r)};Bn.prototype.exec=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.isBuffer(t)?t.length:Buffer.byteLength(t),i=Buffer.allocUnsafe(1+4+4+4+1+4+n);return i[0]=ir.CHANNEL_REQUEST,Ye(i,e,1),Ye(i,4,5),i.write("exec",9,4,"ascii"),i[13]=r===void 0||r===!0?1:0,Ye(i,n,14),Buffer.isBuffer(t)?t.copy(i,18):i.write(t,18,n,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exec)"),Tn(this,i)};Bn.prototype.signal=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");if(t=t.toUpperCase(),t.slice(0,3)==="SIG"&&(t=t.substring(3)),r$s.indexOf(t)===-1)throw new Error("Invalid signal: "+t);var r=t.length,n=Buffer.allocUnsafe(1+4+4+6+1+4+r);return n[0]=ir.CHANNEL_REQUEST,Ye(n,e,1),Ye(n,6,5),n.write("signal",9,6,"ascii"),n[15]=0,Ye(n,r,16),n.write(t,20,r,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", signal)"),Tn(this,n)};Bn.prototype.env=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");var i=Buffer.byteLength(t),s=Buffer.isBuffer(r)?r.length:Buffer.byteLength(r),a=Buffer.allocUnsafe(1+4+4+3+1+4+i+4+s);return a[0]=ir.CHANNEL_REQUEST,Ye(a,e,1),Ye(a,3,5),a.write("env",9,3,"ascii"),a[12]=n===void 0||n===!0?1:0,Ye(a,i,13),a.write(t,17,i,"ascii"),Ye(a,s,17+i),Buffer.isBuffer(r)?r.copy(a,17+i+4):a.write(r,17+i+4,s,"utf8"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", env)"),Tn(this,a)};Bn.prototype.x11Forward=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(t.protocol),i=Buffer.byteLength(t.cookie),s=Buffer.allocUnsafe(1+4+4+7+1+1+4+n+4+i+4);s[0]=ir.CHANNEL_REQUEST,Ye(s,e,1),Ye(s,7,5),s.write("x11-req",9,7,"ascii"),s[16]=r===void 0||r===!0?1:0,s[17]=t.single?1:0,Ye(s,n,18);var a=22;return Buffer.isBuffer(t.protocol)?t.protocol.copy(s,a):s.write(t.protocol,a,n,"utf8"),a+=n,Ye(s,i,a),a+=4,Buffer.isBuffer(t.cookie)?t.cookie.copy(s,a):s.write(t.cookie,a,i,"binary"),a+=i,Ye(s,t.screen||0,a),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", x11-req)"),Tn(this,s)};Bn.prototype.subsystem=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=Buffer.byteLength(t),i=Buffer.allocUnsafe(1+4+4+9+1+4+n);return i[0]=ir.CHANNEL_REQUEST,Ye(i,e,1),Ye(i,9,5),i.write("subsystem",9,9,"ascii"),i[18]=r===void 0||r===!0?1:0,Ye(i,n,19),i.write(t,23,n,"ascii"),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", subsystem: "+t+")"),Tn(this,i)};Bn.prototype.openssh_agentForward=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.allocUnsafe(1+4+4+26+1);return r[0]=ir.CHANNEL_REQUEST,Ye(r,e,1),Ye(r,26,5),r.write("auth-agent-req@openssh.com",9,26,"ascii"),r[35]=t===void 0||t===!0?1:0,this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", auth-agent-req@openssh.com)"),Tn(this,r)};Bn.prototype.authPassword=function(e,t){if(this.server)throw new Error("Client-only method called in server mode");var r=Buffer.byteLength(e),n=Buffer.byteLength(t),i=0,s=Buffer.allocUnsafe(1+4+r+4+14+4+8+1+4+n);return s[i]=ir.USERAUTH_REQUEST,Ye(s,r,++i),s.write(e,i+=4,r,"utf8"),Ye(s,14,i+=r),s.write("ssh-connection",i+=4,14,"ascii"),Ye(s,8,i+=14),s.write("password",i+=4,8,"ascii"),s[i+=8]=0,Ye(s,n,++i),s.write(t,i+=4,n,"utf8"),this._state.authsQueue.push("password"),this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (password)"),Tn(this,s)};Bn.prototype.authPK=function(e,t,r){if(this.server)throw new Error("Client-only method called in server mode");var n=this,i=this._state.outgoing,s;typeof t.getPublicSSH=="function"?(s=t.type,t=t.getPublicSSH()):s=t.toString("ascii",4,4+wNe(t,0));var a=Buffer.byteLength(e),o=Buffer.byteLength(s),c=t.length,l=i.sessionId.length,u=0,m=Buffer.allocUnsafe((r?4+l:0)+1+4+a+4+14+4+9+1+4+o+4+c);return r?(Ye(m,l,u),i.sessionId.copy(m,u+=4),m[u+=l]=ir.USERAUTH_REQUEST):m[u]=ir.USERAUTH_REQUEST,Ye(m,a,++u),m.write(e,u+=4,a,"utf8"),Ye(m,14,u+=a),m.write("ssh-connection",u+=4,14,"ascii"),Ye(m,9,u+=14),m.write("publickey",u+=4,9,"ascii"),m[u+=9]=r?1:0,Ye(m,o,++u),m.write(s,u+=4,o,"ascii"),Ye(m,c,u+=o),t.copy(m,u+=4),r?(r(m,function(p){if(p=TNe(p,s),p===!1)throw new Error("Error while converting handshake signature");var h=p.length,y=Buffer.allocUnsafe(1+4+a+4+14+4+9+1+4+o+4+c+4+4+o+4+h);return u=0,y[u]=ir.USERAUTH_REQUEST,Ye(y,a,++u),y.write(e,u+=4,a,"utf8"),Ye(y,14,u+=a),y.write("ssh-connection",u+=4,14,"ascii"),Ye(y,9,u+=14),y.write("publickey",u+=4,9,"ascii"),y[u+=9]=1,Ye(y,o,++u),y.write(s,u+=4,o,"ascii"),Ye(y,c,u+=o),t.copy(y,u+=4),Ye(y,4+o+4+h,u+=c),Ye(y,o,u+=4),y.write(s,u+=4,o,"ascii"),Ye(y,h,u+=o),p.copy(y,u+=4),n._state.authsQueue.push("publickey"),n.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (publickey)"),Tn(n,y)}),!0):(this._state.authsQueue.push("publickey"),this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (publickey -- check)"),Tn(this,m))};Bn.prototype.authHostbased=function(e,t,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");var s=this,a=this._state.outgoing,o;typeof t.getPublicSSH=="function"?(o=t.type,t=t.getPublicSSH()):o=t.toString("ascii",4,4+wNe(t,0));var c=Buffer.byteLength(e),l=Buffer.byteLength(o),u=t.length,m=a.sessionId.length,p=Buffer.byteLength(r),h=Buffer.byteLength(n),y=0,w=Buffer.allocUnsafe(4+m+1+4+c+4+14+4+9+4+l+4+u+4+p+4+h);return Ye(w,m,y),a.sessionId.copy(w,y+=4),w[y+=m]=ir.USERAUTH_REQUEST,Ye(w,c,++y),w.write(e,y+=4,c,"utf8"),Ye(w,14,y+=c),w.write("ssh-connection",y+=4,14,"ascii"),Ye(w,9,y+=14),w.write("hostbased",y+=4,9,"ascii"),Ye(w,l,y+=9),w.write(o,y+=4,l,"ascii"),Ye(w,u,y+=l),t.copy(w,y+=4),Ye(w,p,y+=u),w.write(r,y+=4,p,"ascii"),Ye(w,h,y+=p),w.write(n,y+=4,h,"utf8"),i(w,function(v){if(v=TNe(v,o),v===!1)throw new Error("Error while converting handshake signature");var b=v.length,A=Buffer.allocUnsafe(w.length-m+b);return w.copy(A,0,4+m),Ye(A,b,A.length-b-4),v.copy(A,A.length-b),s._state.authsQueue.push("hostbased"),s.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (hostbased)"),Tn(s,A)}),!0};Bn.prototype.authKeyboard=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=0,n=Buffer.allocUnsafe(1+4+t+4+14+4+20+4+4);return n[r]=ir.USERAUTH_REQUEST,Ye(n,t,++r),n.write(e,r+=4,t,"utf8"),Ye(n,14,r+=t),n.write("ssh-connection",r+=4,14,"ascii"),Ye(n,20,r+=14),n.write("keyboard-interactive",r+=4,20,"ascii"),Ye(n,0,r+=20),Ye(n,0,r+=4),this._state.authsQueue.push("keyboard-interactive"),this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (keyboard-interactive)"),Tn(this,n)};Bn.prototype.authNone=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=Buffer.byteLength(e),r=0,n=Buffer.allocUnsafe(1+4+t+4+14+4+4);return n[r]=ir.USERAUTH_REQUEST,Ye(n,t,++r),n.write(e,r+=4,t,"utf8"),Ye(n,14,r+=t),n.write("ssh-connection",r+=4,14,"ascii"),Ye(n,4,r+=14),n.write("none",r+=4,4,"ascii"),this._state.authsQueue.push("none"),this.debug("DEBUG: Outgoing: Writing USERAUTH_REQUEST (none)"),Tn(this,n)};Bn.prototype.authInfoRes=function(e){if(this.server)throw new Error("Client-only method called in server mode");var t=0,r=0,n,i,s;if(e)for(s=0,i=e.length;s<i;++s)t+=4+Buffer.byteLength(e[s]);var a=Buffer.allocUnsafe(1+4+t);if(a[r++]=ir.USERAUTH_INFO_RESPONSE,Ye(a,e?e.length:0,r),e)for(r+=4,s=0,i=e.length;s<i;++s)n=Buffer.byteLength(e[s]),Ye(a,n,r),r+=4,n&&(a.write(e[s],r,n,"utf8"),r+=n);return this.debug("DEBUG: Outgoing: Writing USERAUTH_INFO_RESPONSE"),Tn(this,a)};Bn.prototype.serviceAccept=function(e){if(!this.server)throw new Error("Server-only method called in client mode");var t=e.length,r=Buffer.allocUnsafe(1+4+t);if(r[0]=ir.SERVICE_ACCEPT,Ye(r,t,1),r.write(e,5,t,"ascii"),this.debug("DEBUG: Outgoing: Writing SERVICE_ACCEPT ("+e+")"),Tn(this,r),this.server&&this.banner&&e==="ssh-userauth"){var n=Buffer.byteLength(this.banner),i=1+4+n+4,s=Buffer.allocUnsafe(i);s[0]=ir.USERAUTH_BANNER,Ye(s,n,1),s.write(this.banner,5,n,"utf8"),s.fill(0,i-4),this.debug("DEBUG: Outgoing: Writing USERAUTH_BANNER"),Tn(this,s),this.banner=void 0}};Bn.prototype.forwardedTcpip=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.boundAddr),s=Buffer.byteLength(n.remoteAddr),a=36+i,o=Buffer.allocUnsafe(1+4+15+4+4+4+4+i+4+4+s+4);return o[0]=ir.CHANNEL_OPEN,Ye(o,15,1),o.write("forwarded-tcpip",5,15,"ascii"),Ye(o,e,20),Ye(o,t,24),Ye(o,r,28),Ye(o,i,32),o.write(n.boundAddr,36,i,"ascii"),Ye(o,n.boundPort,a),Ye(o,s,a+=4),o.write(n.remoteAddr,a+=4,s,"ascii"),Ye(o,n.remotePort,a+=s),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", forwarded-tcpip)"),Tn(this,o)};Bn.prototype.x11=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.originAddr),s=24+i,a=Buffer.allocUnsafe(1+4+3+4+4+4+4+i+4);return a[0]=ir.CHANNEL_OPEN,Ye(a,3,1),a.write("x11",5,3,"ascii"),Ye(a,e,8),Ye(a,t,12),Ye(a,r,16),Ye(a,i,20),a.write(n.originAddr,24,i,"ascii"),Ye(a,n.originPort,s),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", x11)"),Tn(this,a)};Bn.prototype.openssh_authAgent=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");var n=Buffer.allocUnsafe(1+4+22+4+4+4);return n[0]=ir.CHANNEL_OPEN,Ye(n,22,1),n.write("auth-agent@openssh.com",5,22,"ascii"),Ye(n,e,27),Ye(n,t,31),Ye(n,r,35),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", auth-agent@openssh.com)"),Tn(this,n)};Bn.prototype.openssh_forwardedStreamLocal=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(n.socketPath),s=Buffer.allocUnsafe(1+4+33+4+4+4+4+i+4);return s[0]=ir.CHANNEL_OPEN,Ye(s,33,1),s.write("forwarded-streamlocal@openssh.com",5,33,"ascii"),Ye(s,e,38),Ye(s,t,42),Ye(s,r,46),Ye(s,i,50),s.write(n.socketPath,54,i,"utf8"),Ye(s,0,54+i),this.debug("DEBUG: Outgoing: Writing CHANNEL_OPEN ("+e+", forwarded-streamlocal@openssh.com)"),Tn(this,s)};Bn.prototype.exitStatus=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=Buffer.allocUnsafe(1+4+4+11+1+4);return r[0]=ir.CHANNEL_REQUEST,Ye(r,e,1),Ye(r,11,5),r.write("exit-status",9,11,"ascii"),r[20]=0,Ye(r,t,21),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exit-status)"),Tn(this,r)};Bn.prototype.exitSignal=function(e,t,r,n){if(!this.server)throw new Error("Server-only method called in client mode");var i=Buffer.byteLength(t),s=n?Buffer.byteLength(n):0,a=25+i,o=Buffer.allocUnsafe(1+4+4+11+1+4+i+1+4+s+4);return o[0]=ir.CHANNEL_REQUEST,Ye(o,e,1),Ye(o,11,5),o.write("exit-signal",9,11,"ascii"),o[20]=0,Ye(o,i,21),o.write(t,25,i,"utf8"),o[a++]=r?1:0,Ye(o,s,a),a+=4,s&&(o.write(n,a,s,"utf8"),a+=s),Ye(o,0,a),this.debug("DEBUG: Outgoing: Writing CHANNEL_REQUEST ("+e+", exit-signal)"),Tn(this,o)};Bn.prototype.authFailure=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=this._state.authsQueue;if(!r.length)throw new Error("No auth in progress");var n;if(typeof e=="boolean"&&(t=e,e=void 0),e){n=[];for(var i=0,s=e.length;i<s;++i)e[i].toLowerCase()!=="none"&&n.push(e[i]);n=n.join(",")}else n="";var a=n.length,o=Buffer.allocUnsafe(1+4+a+1);return o[0]=ir.USERAUTH_FAILURE,Ye(o,a,1),o.write(n,5,a,"ascii"),o[5+a]=t===!0?1:0,this._state.authsQueue.shift(),this.debug("DEBUG: Outgoing: Writing USERAUTH_FAILURE"),Tn(this,o)};Bn.prototype.authSuccess=function(){if(!this.server)throw new Error("Server-only method called in client mode");var e=this._state.authsQueue;if(!e.length)throw new Error("No auth in progress");var t=this._state,r=t.outgoing,n=t.incoming;t.authsQueue.shift(),this.debug("DEBUG: Outgoing: Writing USERAUTH_SUCCESS");var i=Tn(this,u$s);return r.compress.type==="zlib@openssh.com"&&(r.compress.instance=VS.createDeflate(nx),r.compress.queue=[]),n.decompress.type==="zlib@openssh.com"&&(n.decompress.instance=VS.createInflate(nx)),i};Bn.prototype.authPKOK=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=this._state.authsQueue;if(!r.length||r[0]!=="publickey")throw new Error('"publickey" auth not in progress');var n=e.length,i=t.length,s=Buffer.allocUnsafe(1+4+n+4+i);return s[0]=ir.USERAUTH_PK_OK,Ye(s,n,1),s.write(e,5,n,"ascii"),Ye(s,i,5+n),t.copy(s,5+n+4),this._state.authsQueue.shift(),this.debug("DEBUG: Outgoing: Writing USERAUTH_PK_OK"),Tn(this,s)};Bn.prototype.authPasswdChg=function(e,t){if(!this.server)throw new Error("Server-only method called in client mode");var r=Buffer.byteLength(e),n=t?t.length:0,i=0,s=Buffer.allocUnsafe(1+4+r+4+n);return s[i]=ir.USERAUTH_PASSWD_CHANGEREQ,Ye(s,r,++i),s.write(e,i+=4,r,"utf8"),Ye(s,n,i+=r),n&&s.write(t,i+=4,n,"ascii"),this.debug("DEBUG: Outgoing: Writing USERAUTH_PASSWD_CHANGEREQ"),Tn(this,s)};Bn.prototype.authInfoReq=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");var n=0,i=e?Buffer.byteLength(e):0,s=t?Buffer.byteLength(t):0,a=0,o,c,l,u;for(u=0,l=r.length;u<l;++u)n+=4+Buffer.byteLength(r[u].prompt)+1;var m=Buffer.allocUnsafe(1+4+i+4+s+4+4+n);for(m[a++]=ir.USERAUTH_INFO_REQUEST,Ye(m,i,a),a+=4,e&&(m.write(e,a,i,"utf8"),a+=i),Ye(m,s,a),a+=4,t&&(m.write(t,a,s,"utf8"),a+=s),Ye(m,0,a),a+=4,Ye(m,r.length,a),a+=4,u=0,l=r.length;u<l;++u)c=r[u],o=Buffer.byteLength(c.prompt),Ye(m,o,a),a+=4,o&&(m.write(c.prompt,a,o,"utf8"),a+=o),m[a++]=c.echo?1:0;return this.debug("DEBUG: Outgoing: Writing USERAUTH_INFO_REQUEST"),Tn(this,m)};function g$s(e,t,r,n,i){if(r!==Da.BY_APPLICATION){var s=new Error(n||t);s.code=r,e.emit("error",s)}e.reset()}function h$s(e,t,r){var n=e._state,i=n.outgoing;i.status===X_?(e.debug("DEBUG: Received re-key request"),i.status=K_,i.kexinit=void 0,kNe(e,s)):s();function s(){y$s(e,t,r)===!0&&(e.server?n.incoming.expectedPacket=n.kex.pktInit:n.kex.type==="groupex"?R$s(e):f7t(e))}}function y$s(e,t,r){var n=e._state,i=n.incoming,s=n.outgoing,a=e.debug,o,c,l,u,m;a("DEBUG: Comparing KEXINITs ...");var p=e.config.algorithms,h=p.kex;if(e.remoteBugs&DJ.BAD_DHGEX)for(var y=!1,w=h.length-1;w>=0;--w)h[w].indexOf("group-exchange")!==-1&&(y||(h=h.slice(),y=!0),h.splice(w,1));for(a("DEBUG: (local) KEX algorithms: "+h),a("DEBUG: (remote) KEX algorithms: "+t.algorithms.kex),e.server?(o=h,c=t.algorithms.kex):(o=t.algorithms.kex,c=h),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching key exchange algorithm");var v=new Error("Handshake failed: no matching key exchange algorithm");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}var b=c[m];for(a("DEBUG: KEX algorithm: "+b),r&&(!t.algorithms.kex.length||b!==t.algorithms.kex[0])&&(i.ignoreNext=!0),a("DEBUG: (local) Host key formats: "+p.serverHostKey),a("DEBUG: (remote) Host key formats: "+t.algorithms.srvHostKey),e.server?(o=p.serverHostKey,c=t.algorithms.srvHostKey):(o=t.algorithms.srvHostKey,c=p.serverHostKey),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching host key format");var v=new Error("Handshake failed: no matching host key format");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(n.hostkeyFormat=c[m],a("DEBUG: Host key format: "+n.hostkeyFormat),a("DEBUG: (local) Client->Server ciphers: "+p.cipher),a("DEBUG: (remote) Client->Server ciphers: "+t.algorithms.cs.encrypt),e.server?(o=p.cipher,c=t.algorithms.cs.encrypt):(o=t.algorithms.cs.encrypt,c=p.cipher),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Client->Server cipher");var v=new Error("Handshake failed: no matching client->server cipher");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=i.decrypt.type=c[m]:l=s.encrypt.type=c[m],a("DEBUG: Client->Server Cipher: "+l),a("DEBUG: (local) Server->Client ciphers: "+p.cipher),a("DEBUG: (remote) Server->Client ciphers: "+t.algorithms.sc.encrypt),e.server?(o=p.cipher,c=t.algorithms.sc.encrypt):(o=t.algorithms.sc.encrypt,c=p.cipher),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Server->Client cipher");var v=new Error("Handshake failed: no matching server->client cipher");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=s.encrypt.type=c[m]:l=i.decrypt.type=c[m],a("DEBUG: Server->Client Cipher: "+l),a("DEBUG: (local) Client->Server HMAC algorithms: "+p.hmac),a("DEBUG: (remote) Client->Server HMAC algorithms: "+t.algorithms.cs.mac),e.server?(o=p.hmac,c=t.algorithms.cs.mac):(o=t.algorithms.cs.mac,c=p.hmac),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Client->Server HMAC algorithm");var v=new Error("Handshake failed: no matching client->server HMAC");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=i.hmac.type=c[m]:l=s.hmac.type=c[m],a("DEBUG: Client->Server HMAC algorithm: "+l),a("DEBUG: (local) Server->Client HMAC algorithms: "+p.hmac),a("DEBUG: (remote) Server->Client HMAC algorithms: "+t.algorithms.sc.mac),e.server?(o=p.hmac,c=t.algorithms.sc.mac):(o=t.algorithms.sc.mac,c=p.hmac),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Server->Client HMAC algorithm");var v=new Error("Handshake failed: no matching server->client HMAC");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=s.hmac.type=c[m]:l=i.hmac.type=c[m],a("DEBUG: Server->Client HMAC algorithm: "+l),a("DEBUG: (local) Client->Server compression algorithms: "+p.compress),a("DEBUG: (remote) Client->Server compression algorithms: "+t.algorithms.cs.compress),e.server?(o=p.compress,c=t.algorithms.cs.compress):(o=t.algorithms.cs.compress,c=p.compress),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Client->Server compression algorithm");var v=new Error("Handshake failed: no matching client->server compression algorithm");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}for(e.server?l=i.decompress.type=c[m]:l=s.compress.type=c[m],a("DEBUG: Client->Server compression algorithm: "+l),a("DEBUG: (local) Server->Client compression algorithms: "+p.compress),a("DEBUG: (remote) Server->Client compression algorithms: "+t.algorithms.sc.compress),e.server?(o=p.compress,c=t.algorithms.sc.compress):(o=t.algorithms.sc.compress,c=p.compress),m=0,u=c.length;m<u&&o.indexOf(c[m])===-1;++m);if(m===u){a("DEBUG: No matching Server->Client compression algorithm");var v=new Error("Handshake failed: no matching server->client compression algorithm");return v.level="handshake",e.emit("error",v),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1}return e.server?l=s.compress.type=c[m]:l=i.decompress.type=c[m],a("DEBUG: Server->Client compression algorithm: "+l),n.kex=new KS(b),n.kex.generateKeys(),s.pubkey=n.kex.getPublicKey(),!0}function w$s(e,t,r){var n=e._state,i=n.outgoing;n.kex.setDHParams(t,r),n.kex.generateKeys(),i.pubkey=n.kex.getPublicKey(),f7t(e)}function v$s(e,t){x$s(e,t)}function c7t(e,t,r){var n=e._state,i=n.incoming,s=n.outgoing,a=e.debug,o,c;if(r===void 0){i.expectedPacket="NEWKEYS",s.sentNEWKEYS=!1,a("DEBUG: Checking host key format");var l=Pn(t.hostkey,0,"ascii",e);if(l===!1)return!1;if(t.hostkey_format!==n.hostkeyFormat||t.hostkey_format!==l){a("DEBUG: Host key format mismatch"),e.disconnect(Da.KEY_EXCHANGE_FAILED),e.reset();var u=new Error("Handshake failed: host key format mismatch");return u.level="handshake",e.emit("error",u),!1}a("DEBUG: Checking signature format");var m=Pn(t.sig,0,"ascii",e);if(m===!1)return!1;if(t.sig_format!==m){a("DEBUG: Signature format mismatch"),e.disconnect(Da.KEY_EXCHANGE_FAILED),e.reset();var u=new Error("Handshake failed: signature format mismatch");return u.level="handshake",e.emit("error",u),!1}}if(s.status===CNe){if(r===void 0){a("DEBUG: Verifying host fingerprint");var p=!0,h=e.emit("fingerprint",t.hostkey,function(Ge){r===void 0&&(r=!!Ge,p||c7t(e,t,r))});if(p=!1,h&&r===void 0)return}if(r===void 0)a("DEBUG: Host accepted by default (no verification)");else if(r===!0)a("DEBUG: Host accepted (verified)");else{a("DEBUG: Host denied via fingerprint verification"),e.disconnect(Da.KEY_EXCHANGE_FAILED),e.reset();var u=new Error("Handshake failed: host fingerprint verification failed");return u.level="handshake",e.emit("error",u),!1}}if(t.pubkey=n.kex.convertPublicKey(t.pubkey),t.secret=n.kex.computeSecret(t.pubkey),t.secret instanceof Error)return t.secret.message="Error while computing DH secret ("+n.kex.type+"): "+t.secret.message,t.secret.level="handshake",e.emit("error",t.secret),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1;var y=$s.createHash(n.kex.hash),w=Buffer.byteLength(e.config.ident),v=Buffer.byteLength(i.identRaw),b=s.kexinit.length,A=i.kexinit.length,I=t.hostkey.length,R=s.pubkey.length,F=t.pubkey.length,J=t.secret.length,X=w+v+b+A+I+R+F+J+4*8,H,ae,le,D,ie=n.kex.getDHParams();ie&&(le=ie.prime,D=ie.generator,H=le.length,ae=D.length,X+=4*3,X+=4*2,X+=H,X+=ae);var re=0,Pe=Buffer.allocUnsafe(X);Ye(Pe,w,re),re+=4,Pe.write(e.config.ident,re,"utf8"),re+=w,Ye(Pe,v,re),re+=4,Pe.write(i.identRaw,re,"utf8"),re+=v,Ye(Pe,b,re),re+=4,s.kexinit.copy(Pe,re),re+=b,s.kexinit=void 0,Ye(Pe,A,re),re+=4,i.kexinit.copy(Pe,re),re+=A,i.kexinit=void 0,Ye(Pe,I,re),re+=4,t.hostkey.copy(Pe,re),re+=I,ie&&(RNe.slice(1).copy(Pe,re),re+=4*3,Ye(Pe,H,re),re+=4,le.copy(Pe,re),re+=H,Ye(Pe,ae,re),re+=4,D.copy(Pe,re),re+=ae),Ye(Pe,R,re),re+=4,s.pubkey.copy(Pe,re),re+=R,Ye(Pe,F,re),re+=4,t.pubkey.copy(Pe,re),re+=F,Ye(Pe,J,re),re+=4,t.secret.copy(Pe,re),s.exchangeHash=y.update(Pe).digest();var B=Pn(t.sig,t.sig._pos,e);if(B===!1||!(B=J9t(B,t.sig_format,e)))return!1;var ee=e$s(t.hostkey,t.sig_format);if(ee instanceof Error)return!1;if(a("DEBUG: Verifying signature"),ee.verify(s.exchangeHash,B)!==!0){a("DEBUG: Signature verification failed"),e.disconnect(Da.KEY_EXCHANGE_FAILED),e.reset();var u=new Error("Handshake failed: signature verification failed");return u.level="handshake",e.emit("error",u),!1}s.sessionId===void 0&&(s.sessionId=s.exchangeHash),s.kexsecret=t.secret,a("DEBUG: Outgoing: Writing NEWKEYS"),s.status===K_?Tn(e,xNe,void 0,!0):Tn(e,xNe),s.sentNEWKEYS=!0,r!==void 0&&i.expectedPacket===void 0&&l7t(e)}function l7t(e){var t=e._state,r=t.outgoing,n=t.incoming;if(n.expectedPacket=void 0,!!r.sentNEWKEYS){var i=r.kexsecret.length,s=r.encrypt.info=e7t[r.encrypt.type],a=0,o=t.kex.hash,c=Buffer.allocUnsafe(4+i),l,u;if(t.authsQueue=[],Ye(c,i,a),a+=4,r.kexsecret.copy(c,a),r.kexsecret=void 0,s.stream)l=PNe;else{for(l=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"B":"A","ascii").update(r.sessionId).digest();l.length<s.ivLen;)l=Buffer.concat([l,$s.createHash(o).update(c).update(r.exchangeHash).update(l).digest()]);l.length>s.ivLen&&(l=l.slice(0,s.ivLen))}for(u=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"D":"C","ascii").update(r.sessionId).digest();u.length<s.keyLen;)u=Buffer.concat([u,$s.createHash(o).update(c).update(r.exchangeHash).update(u).digest()]);if(u.length>s.keyLen&&(u=u.slice(0,s.keyLen)),s.authLen>0)r.encrypt.iv=l,r.encrypt.key=u,r.encrypt.instance=!0;else{var m=J1[r.encrypt.type];r.encrypt.instance=$s.createCipheriv(m,u,l),r.encrypt.instance.setAutoPadding(!1)}var p=n.decrypt.info=e7t[n.decrypt.type];if(p.stream)l=PNe;else{for(l=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"A":"B","ascii").update(r.sessionId).digest();l.length<p.ivLen;)l=Buffer.concat([l,$s.createHash(o).update(c).update(r.exchangeHash).update(l).digest()]);l.length>p.ivLen&&(l=l.slice(0,p.ivLen))}for(n.decrypt.buf=Buffer.allocUnsafe(p.blockLen),u=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"C":"D","ascii").update(r.sessionId).digest();u.length<p.keyLen;)u=Buffer.concat([u,$s.createHash(o).update(c).update(r.exchangeHash).update(u).digest()]);u.length>p.keyLen&&(u=u.slice(0,p.keyLen));var h=J1[n.decrypt.type];n.decrypt.instance=$s.createDecipheriv(h,u,l),n.decrypt.instance.setAutoPadding(!1),n.decrypt.iv=l,n.decrypt.key=u;var y;s.discardLen>0&&(y=Buffer.alloc(s.discardLen),r.encrypt.instance.update(y)),p.discardLen>0&&((!y||y.length!==p.discardLen)&&(y=Buffer.alloc(s.discardLen)),n.decrypt.instance.update(y));var w=r.hmac.info=t7t[r.hmac.type],v=n.hmac.info=t7t[n.hmac.type];if(s.authLen===0){for(u=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"F":"E","ascii").update(r.sessionId).digest();u.length<w.len;)u=Buffer.concat([u,$s.createHash(o).update(c).update(r.exchangeHash).update(u).digest()]);u.length>w.len&&(u=u.slice(0,w.len)),r.hmac.key=u}else r.hmac.key=void 0;if(p.authLen===0){for(u=$s.createHash(o).update(c).update(r.exchangeHash).update(e.server?"E":"F","ascii").update(r.sessionId).digest();u.length<v.len;)u=Buffer.concat([u,$s.createHash(o).update(c).update(r.exchangeHash).update(u).digest()]);u.length>v.len&&(u=u.slice(0,v.len)),n.hmac.key=u}else n.hmac.key=void 0;var b=p.authLen||n.hmac.info.actualLen;if((!n.hmac.buf||n.hmac.buf.length!==b)&&(n.hmac.buf=Buffer.allocUnsafe(b)),r.exchangeHash=void 0,r.compress.type==="zlib"?(r.compress.instance=VS.createDeflate(nx),r.compress.queue=[]):r.compress.type==="none"&&(r.compress.instance=!1,r.compress.queue=null),n.decompress.type==="zlib"?n.decompress.instance=VS.createInflate(nx):n.decompress.type==="none"&&(n.decompress.instance=!1),e.bytesSent=e.bytesReceived=0,r.status===K_){r.status=X_;var A=r.rekeyQueue,I=A.length,R=0;for(r.rekeyQueue=[];R<I;++R)Buffer.isBuffer(A[R])?Tn(e,A[R]):Tn(e,A[R][0],A[R][1]);A=n.rekeyQueue,I=A.length,R=0,n.rekeyQueue=[];for(var F=n.seqno;R<I;++R)if(n.seqno=A[R][0],n.payload=A[R][1],d7t(e)===!1||n.status===tx)return;n.seqno=F}else r.status=X_,n.status===_Ne&&(e.debug("DEBUG: Parser: IN_PACKETBEFORE (update) (expecting "+p.blockLen+")"),XS(e,rx,p.blockLen,n.decrypt.buf)),e.emit("ready")}}function MJ(e,t){var r=e._state.kex;if(r)switch(t){case 30:return r.pktInit;case 31:switch(r.type){case"group":return"KEXDH_REPLY";case"groupex":return"KEXDH_GEX_GROUP";default:return"KEXECDH_REPLY"}break;case 33:if(r.type==="groupex")return"KEXDH_GEX_REPLY"}return ir[t]}function d7t(e,t){var r=e._state.incoming,n=e._state.outgoing,i=r.payload,s=r.seqno,a,o,c,l,u,m,p,h,y,w,v,b,A,I;if(++r.seqno>ENe&&(r.seqno=0),r.ignoreNext){e.debug("DEBUG: Parser: Packet ignored"),r.ignoreNext=!1;return}var R=i[0];if(R===void 0)return!1;if(n.status!==X_&&MJ(e,R)!==r.expectedPacket&&R<1&&R>4){e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, expected: "+r.expectedPacket+" but got: "+MJ(e,R)),e.disconnect(Da.PROTOCOL_ERROR);var F=new Error("Received unexpected packet");return F.level="protocol",e.emit("error",F),!1}if(R===ir.CHANNEL_DATA){if(u=ys(i,1,e,t),u===!1||(m=Pn(i,5,e,t,32768),m===!1))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_DATA ("+u+")"),e.emit("CHANNEL_DATA:"+u,m)}else if(R===ir.CHANNEL_EXTENDED_DATA){if(u=ys(i,1,e,t),u===!1)return!1;var J=ys(i,5,e,t);if(J===!1||(m=Pn(i,9,e,t),m===!1))return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_EXTENDED_DATA ("+u+")"),e.emit("CHANNEL_EXTENDED_DATA:"+u,J,m)}else if(R===ir.CHANNEL_WINDOW_ADJUST){if(u=ys(i,1,e,t),u===!1)return!1;var X=ys(i,5,e,t);if(X===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_WINDOW_ADJUST ("+u+", "+X+")"),e.emit("CHANNEL_WINDOW_ADJUST:"+u,X)}else if(R===ir.CHANNEL_SUCCESS){if(u=ys(i,1,e,t),u===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_SUCCESS ("+u+")"),e.emit("CHANNEL_SUCCESS:"+u)}else if(R===ir.CHANNEL_FAILURE){if(u=ys(i,1,e,t),u===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_FAILURE ("+u+")"),e.emit("CHANNEL_FAILURE:"+u)}else if(R===ir.CHANNEL_EOF){if(u=ys(i,1,e,t),u===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_EOF ("+u+")"),e.emit("CHANNEL_EOF:"+u)}else if(R===ir.CHANNEL_OPEN){var H=Pn(i,1,"ascii",e,t);if(H===!1||(y=ys(i,i._pos,e,t),y===!1)||(w=ys(i,i._pos+=4,e,t),w===!1)||(v=ys(i,i._pos+=4,e,t),v===!1))return!1;var ae;if(e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_OPEN ("+y+", "+H+")"),H==="forwarded-tcpip"||H==="direct-tcpip"){var le=Pn(i,i._pos+=4,"ascii",e,t);if(le===!1)return!1;var D=ys(i,i._pos,e,t);if(D===!1||(p=Pn(i,i._pos+=4,"ascii",e,t),p===!1)||(h=ys(i,i._pos,e,t),h===!1))return!1;ae={type:H,sender:y,window:w,packetSize:v,data:{destIP:le,destPort:D,srcIP:p,srcPort:h}}}else if(H==="forwarded-streamlocal@openssh.com"||H==="direct-streamlocal@openssh.com"){if(I=Pn(i,i._pos+=4,"utf8",e,t),I===!1)return!1;ae={type:H,sender:y,window:w,packetSize:v,data:{socketPath:I}}}else if(H==="x11"){if(p=Pn(i,i._pos+=4,"ascii",e,t),p===!1||(h=ys(i,i._pos,e,t),h===!1))return!1;ae={type:H,sender:y,window:w,packetSize:v,data:{srcIP:p,srcPort:h}}}else ae={type:H,sender:y,window:w,packetSize:v,data:{}};e.emit("CHANNEL_OPEN",ae)}else if(R===ir.CHANNEL_OPEN_CONFIRMATION){if(b=ys(i,1,e,t),b===!1||(y=ys(i,5,e,t),y===!1)||(w=ys(i,9,e,t),w===!1)||(v=ys(i,13,e,t),v===!1))return!1;l={recipient:b,sender:y,window:w,packetSize:v},i.length>17&&(l.data=i.slice(17)),e.emit("CHANNEL_OPEN_CONFIRMATION:"+l.recipient,l)}else if(R===ir.CHANNEL_OPEN_FAILURE){if(b=ys(i,1,e,t),b===!1)return!1;var ie=ys(i,5,e,t);if(ie===!1||(A=Pn(i,9,"utf8",e,t),A===!1)||(o=Pn(i,i._pos,"utf8",e,t),o===!1))return!1;i._pos=9,l={recipient:b,reasonCode:ie,reason:t$s[ie],description:A,lang:o},e.emit("CHANNEL_OPEN_FAILURE:"+l.recipient,l)}else if(R===ir.CHANNEL_CLOSE){if(u=ys(i,1,e,t),u===!1)return!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_CLOSE ("+u+")"),e.emit("CHANNEL_CLOSE:"+u)}else if(R!==ir.IGNORE){if(R===ir.DISCONNECT){var re=ys(i,1,e,t);if(re===!1)return!1;var Pe=Da[re];if(A=Pn(i,5,"utf8",e,t),A===!1)return!1;i._pos<i.length&&(o=Pn(i,i._pos,"ascii",e,t)),e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: DISCONNECT ("+Pe+")"),e.emit("DISCONNECT",Pe,re,A,o)}else if(R===ir.DEBUG){if(c=Pn(i,2,"utf8",e,t),c===!1||(o=Pn(i,i._pos,"ascii",e,t),o===!1))return!1;e.emit("DEBUG",c,o)}else if(R===ir.NEWKEYS)e.emit("NEWKEYS");else if(R===ir.SERVICE_REQUEST){if(a=Pn(i,1,"ascii",e,t),a===!1)return!1;e.emit("SERVICE_REQUEST",a)}else if(R===ir.SERVICE_ACCEPT){if(a=Pn(i,1,"ascii",e,t),a===!1)return!1;e.emit("SERVICE_ACCEPT",a)}else if(R===ir.USERAUTH_REQUEST){var B=Pn(i,1,"utf8",e,t);if(B===!1)return!1;var ee=Pn(i,i._pos,"ascii",e,t);if(ee===!1)return!1;var Ge=Pn(i,i._pos,"ascii",e,t);if(Ge===!1)return!1;var We,nt;if(Ge==="password"){if(We=Pn(i,i._pos+1,"utf8",e,t),We===!1)return!1}else if(Ge==="publickey"||Ge==="hostbased"){var Tt,qt,er,ct,ft,ur,pt;if(Ge==="publickey"){if(Tt=i[i._pos++],Tt===void 0)return!1;Tt=Tt!==0}if(qt=Pn(i,i._pos,"ascii",e,t),qt===!1||(er=Pn(i,i._pos,e,t),er===!1))return!1;if(Tt||Ge==="hostbased"){if(Ge==="hostbased"&&(ur=Pn(i,i._pos,"ascii",e,t),ur===!1||(pt=Pn(i,i._pos,"utf8",e,t),pt===!1)))return!1;var sr=i._pos;if(ct=Pn(i,sr,e,t),ct===!1||(ct.length>4+qt.length+4&&ct.toString("ascii",4,4+qt.length)===qt&&(ct=ct.slice(4+qt.length+4)),ct=J9t(ct,qt,e,t),ct===!1))return!1;ft=Buffer.allocUnsafe(4+n.sessionId.length+sr),Ye(ft,n.sessionId.length,0),n.sessionId.copy(ft,4),i.copy(ft,4+n.sessionId.length,0,sr)}else nt="publickey -- check";We={keyAlgo:qt,key:er,signature:ct,blob:ft,localHostname:ur,localUsername:pt}}else if(Ge==="keyboard-interactive"){var Nr=ys(i,i._pos,e,t);if(Nr===!1||(We=Pn(i,i._pos+4+Nr,"utf8",e,t),We===!1))return!1}else Ge!=="none"&&(We=i.slice(i._pos));nt===void 0&&(nt=Ge),e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_REQUEST ("+nt+")"),e._state.authsQueue.push(Ge),e.emit("USERAUTH_REQUEST",B,ee,Ge,We)}else if(R===ir.USERAUTH_SUCCESS)n.compress.type==="zlib@openssh.com"&&(n.compress.instance=VS.createDeflate(nx),n.compress.queue=[]),r.decompress.type==="zlib@openssh.com"&&(r.decompress.instance=VS.createInflate(nx)),e._state.authsQueue.shift(),e.emit("USERAUTH_SUCCESS");else if(R===ir.USERAUTH_FAILURE){var Ue=Pn(i,1,"ascii",e,t);if(Ue===!1)return!1;var Rr=i[i._pos];if(Rr===void 0)return!1;Rr=Rr!==0,Ue=Ue.split(","),e._state.authsQueue.shift(),e.emit("USERAUTH_FAILURE",Ue,Rr)}else if(R===ir.USERAUTH_BANNER){if(c=Pn(i,1,"utf8",e,t),c===!1||(o=Pn(i,i._pos,"utf8",e,t),o===!1))return!1;e.emit("USERAUTH_BANNER",c,o)}else if(R===ir.GLOBAL_REQUEST){var z=Pn(i,1,"ascii",e,t);if(z===!1)return e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: GLOBAL_REQUEST"),!1;e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: GLOBAL_REQUEST ("+z+")");var Q=i[i._pos++];if(Q===void 0)return!1;Q=Q!==0;var ge;if(z==="tcpip-forward"||z==="cancel-tcpip-forward"){var xe=Pn(i,i._pos,"ascii",e,t);if(xe===!1)return!1;var je=ys(i,i._pos,e,t);if(je===!1)return!1;ge={bindAddr:xe,bindPort:je}}else if(z==="streamlocal-forward@openssh.com"||z==="cancel-streamlocal-forward@openssh.com"){if(I=Pn(i,i._pos,"utf8",e,t),I===!1)return!1;ge={socketPath:I}}else z==="no-more-sessions@openssh.com"||(ge=i.slice(i._pos));e.emit("GLOBAL_REQUEST",z,Q,ge)}else if(R===ir.REQUEST_SUCCESS)i.length>1?e.emit("REQUEST_SUCCESS",i.slice(1)):e.emit("REQUEST_SUCCESS");else if(R===ir.REQUEST_FAILURE)e.emit("REQUEST_FAILURE");else if(R!==ir.UNIMPLEMENTED){if(R===ir.KEXINIT)return _$s(e,t);if(R===ir.CHANNEL_REQUEST)return C$s(e,t);if(R>=30&&R<=49)return b$s(e,R,t);if(R>=60&&R<=70)return S$s(e,R,t);var jt=Buffer.allocUnsafe(1+4);jt[0]=ir.UNIMPLEMENTED,Ye(jt,s,1),Tn(e,jt)}}}function _$s(e,t){var r=e._state.incoming,n=r.payload,i={algorithms:{kex:void 0,srvHostKey:void 0,cs:{encrypt:void 0,mac:void 0,compress:void 0},sc:{encrypt:void 0,mac:void 0,compress:void 0}},languages:{cs:void 0,sc:void 0}},s;if(s=th(n,17,e,t),s===!1||(i.algorithms.kex=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.srvHostKey=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.cs.encrypt=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.sc.encrypt=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.cs.mac=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.sc.mac=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.cs.compress=s,s=th(n,n._pos,e,t),s===!1)||(i.algorithms.sc.compress=s,s=th(n,n._pos,e,t),s===!1)||(i.languages.cs=s,s=th(n,n._pos,e,t),s===!1))return!1;i.languages.sc=s;var a=n._pos<n.length&&n[n._pos]===1;r.kexinit=n,e.emit("KEXINIT",i,a)}function b$s(e,t,r){var n=e._state,i=n.incoming,s=i.payload;if(n.outgoing.status===X_||MJ(e,t)!==i.expectedPacket){e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, expected: "+i.expectedPacket+" but got: "+MJ(e,t)),e.disconnect(Da.PROTOCOL_ERROR);var a=new Error("Received unexpected packet");return a.level="protocol",e.emit("error",a),!1}if(n.kex.type==="groupex"){if(e.server){e.disconnect(Da.PROTOCOL_ERROR);var a=new Error("DH group exchange not supported by server");return a.level="handshake",e.emit("error",a),!1}else if(t===ir.KEXDH_GEX_GROUP){var o=Pn(s,1,e,r);if(o===!1)return!1;var c=Pn(s,s._pos,e,r);if(c===!1)return!1;e.emit("KEXDH_GEX_GROUP",o,c)}else if(t===ir.KEXDH_GEX_REPLY)return u7t(e,r)}else if(t===ir.KEXDH_INIT){var l=Pn(s,1,e,r);if(l===!1)return!1;e.emit("KEXDH_INIT",l)}else if(t===ir.KEXDH_REPLY)return u7t(e,r)}function u7t(e,t){var r=e._state.incoming.payload,n=Pn(r,1,e,t);if(n===!1)return!1;var i=Pn(r,r._pos,e,t);if(i===!1)return!1;var s=Pn(r,r._pos,e,t);if(s===!1)return!1;var a={hostkey:n,hostkey_format:void 0,pubkey:i,sig:s,sig_format:void 0},o=Pn(n,0,"ascii",e,t);if(o===!1)return!1;a.hostkey_format=o;var c=Pn(s,0,"ascii",e,t);if(c===!1)return!1;a.sig_format=c,e.emit("KEXDH_REPLY",a)}function S$s(e,t,r){var n=e._state,i=n.authsQueue[0],s=n.incoming.payload,a,o,c;if(i==="password"){if(t===ir.USERAUTH_PASSWD_CHANGEREQ){if(a=Pn(s,1,"utf8",e,r),a===!1||(o=Pn(s,s._pos,"utf8",e,r),o===!1))return!1;e.emit("USERAUTH_PASSWD_CHANGEREQ",a,o)}}else if(i==="keyboard-interactive"){if(t===ir.USERAUTH_INFO_REQUEST){var l,u,m;if(l=Pn(s,1,"utf8",e,r),l===!1||(u=Pn(s,s._pos,"utf8",e,r),u===!1)||(o=Pn(s,s._pos,"utf8",e,r),o===!1)||(m=ys(s,s._pos,e,r),m===!1))return!1;s._pos+=4;for(var p=[],h=0;h<m;++h){if(c=Pn(s,s._pos,"utf8",e,r),c===!1)return!1;var y=s[s._pos++];if(y===void 0)return!1;y=y!==0,p.push({prompt:c,echo:y})}e.emit("USERAUTH_INFO_REQUEST",l,u,o,p)}else if(t===ir.USERAUTH_INFO_RESPONSE){var w=ys(s,1,e,r);if(w===!1)return!1;s._pos=5;for(var v=[],b=0;b<w;++b){if(c=Pn(s,s._pos,"utf8",e,r),c===!1)return!1;v.push(c)}e.emit("USERAUTH_INFO_RESPONSE",v)}}else if(i==="publickey"){if(t===ir.USERAUTH_PK_OK){var A=e._state.authsQueue;if(!A.length||A[0]!=="publickey")return;A.shift(),e.emit("USERAUTH_PK_OK")}}else if(i!==void 0){e.disconnect(Da.PROTOCOL_ERROR);var I=new Error("Invalid authentication method: "+i);I.level="protocol",e.emit("error",I)}}function C$s(e,t){var r=e._state.incoming.payload,n,i,s,a,o,c,l,u=ys(r,1,e,t);if(u===!1)return!1;var m=Pn(r,5,"ascii",e,t);if(m===!1)return!1;if(m==="exit-status"){var p=ys(r,++r._pos,e,t);if(p===!1)return!1;n={recipient:u,request:m,wantReply:!1,code:p}}else if(m==="exit-signal"){var h;if(e.remoteBugs&DJ.OLD_EXIT){if(l=ys(r,++r._pos,e,t),l===!1)return!1;switch(l){case 1:l="HUP";break;case 2:l="INT";break;case 3:l="QUIT";break;case 6:l="ABRT";break;case 9:l="KILL";break;case 14:l="ALRM";break;case 15:l="TERM";break;default:l="UNKNOWN ("+l+")"}h=!1}else{if(l=Pn(r,++r._pos,"ascii",e,t),l===!1||(h=r[r._pos++],h===void 0))return!1;h=h!==0}var y=Pn(r,r._pos,"utf8",e,t);if(y===!1)return!1;var w=Pn(r,r._pos,"utf8",e,t);if(w===!1)return!1;n={recipient:u,request:m,wantReply:!1,signal:l,coredump:h,description:y,lang:w}}else if(m==="pty-req"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var v=Pn(r,r._pos,"ascii",e,t);if(v===!1||(i=ys(r,r._pos,e,t),i===!1)||(s=ys(r,r._pos+=4,e,t),s===!1)||(a=ys(r,r._pos+=4,e,t),a===!1)||(o=ys(r,r._pos+=4,e,t),o===!1))return!1;var b=Pn(r,r._pos+=4,e,t);if(b===!1)return!1;b=A$s(b),n={recipient:u,request:m,wantReply:c,term:v,cols:i,rows:s,width:a,height:o,modes:b}}else if(m==="window-change"){if(i=ys(r,++r._pos,e,t),i===!1||(s=ys(r,r._pos+=4,e,t),s===!1)||(a=ys(r,r._pos+=4,e,t),a===!1)||(o=ys(r,r._pos+=4,e,t),o===!1))return!1;n={recipient:u,request:m,wantReply:!1,cols:i,rows:s,width:a,height:o}}else if(m==="x11-req"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var A=r[r._pos++];if(A===void 0)return!1;A=A!==0;var I=Pn(r,r._pos,"ascii",e,t);if(I===!1)return!1;var R=Pn(r,r._pos,"binary",e,t);if(R===!1)return!1;var F=ys(r,r._pos,e,t);if(F===!1)return!1;n={recipient:u,request:m,wantReply:c,single:A,protocol:I,cookie:R,screen:F}}else if(m==="env"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var J=Pn(r,r._pos,"utf8",e,t);if(J===!1)return!1;var X=Pn(r,r._pos,"utf8",e,t);if(X===!1)return!1;n={recipient:u,request:m,wantReply:c,key:J,val:X}}else if(m==="shell"){if(c=r[r._pos],c===void 0)return!1;c=c!==0,n={recipient:u,request:m,wantReply:c}}else if(m==="exec"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var H=Pn(r,r._pos,"utf8",e,t);if(H===!1)return!1;n={recipient:u,request:m,wantReply:c,command:H}}else if(m==="subsystem"){if(c=r[r._pos++],c===void 0)return!1;c=c!==0;var ae=Pn(r,r._pos,"utf8",e,t);if(ae===!1)return!1;n={recipient:u,request:m,wantReply:c,subsystem:ae}}else if(m==="signal"){if(l=Pn(r,++r._pos,"ascii",e,t),l===!1)return!1;n={recipient:u,request:m,wantReply:!1,signal:"SIG"+l}}else if(m==="xon-xoff"){var le=r[++r._pos];if(le===void 0)return!1;le=le!==0,n={recipient:u,request:m,wantReply:!1,clientControl:le}}else if(m==="auth-agent-req@openssh.com"){if(c=r[r._pos],c===void 0)return!1;c=c!==0,n={recipient:u,request:m,wantReply:c}}else{if(c=r[r._pos],c===void 0)return!1;c=c!==0,n={recipient:u,request:m,wantReply:c}}e.debug("DEBUG: Parser: IN_PACKETDATAAFTER, packet: CHANNEL_REQUEST ("+u+", "+m+")"),e.emit("CHANNEL_REQUEST:"+u,n)}function E$s(e,t){var r=e._state.incoming,n=r.hmac;if(e.debug("DEBUG: Parser: Verifying MAC"),r.decrypt.info.authLen>0){var i=r.decrypt,s=i.instance;s.setAuthTag(t);var a=s.update(r.packet);return r.payload=a.slice(1,r.packet.length-a[0]),Z9t(i.iv),i.instance=$s.createDecipheriv(J1[i.type],i.key,i.iv),i.instance.setAutoPadding(!1),!0}else{var o=$s.createHmac(J1[n.type],n.key);Ye(LJ,r.seqno,0),Ye(LJ,r.pktLen,4),LJ[8]=r.padLen,o.update(LJ),o.update(r.packet);var c=o.digest();return c.length>r.hmac.info.actualLen&&(c=c.slice(0,r.hmac.info.actualLen)),q$s(c,t)}}function m7t(e,t){var r=e._state.incoming.decrypt.instance;return e.debug("DEBUG: Parser: Decrypting"),r.update(t)}function XS(e,t,r,n){var i=e._state.incoming.expect;i.amount=r,i.type=t,i.ptr=0,n?i.buf=n:r&&(i.buf=Buffer.allocUnsafe(r))}function th(e,t,r,n){var i=Pn(e,t,"ascii",r,n);return i!==!1?i.length?i.split(","):[]:!1}function A$s(e){for(var t={},r=0,n=e.length,i;r<n&&(i=e[r],!(i===ex.TTY_OP_END||ex[i]===void 0||r+5>n));r+=5)t[ex[i]]=wNe(e,r+1);return t}function P$s(e){for(var t=/^\d+$/,r=Object.keys(e),n=0,i=[],s=0,a=r.length,o,c,l;s<a;++s)o=r[s],c=ex[o],c&&!t.test(o)&&typeof e[o]=="number"&&o!=="TTY_OP_END"&&(l=e[o],i[n++]=c,i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=l&255);return i[n]=ex.TTY_OP_END,i}function kNe(e,t){return I$s(16,function(r){var n=e.config.algorithms,i=n.kexBuf;if(e.remoteBugs&DJ.BAD_DHGEX){for(var s=!1,a=n.kex,o=a.length-1;o>=0;--o)a[o].indexOf("group-exchange")!==-1&&(s||(a=a.slice(),s=!0),a.splice(o,1));s&&(i=Buffer.from(a.join(",")))}var c=n.serverHostKeyBuf,l=1+16+4+i.length+4+c.length+2*(4+n.cipherBuf.length)+2*(4+n.hmacBuf.length)+2*(4+n.compressBuf.length)+2*4+1+4,u=Buffer.allocUnsafe(l),m=17;u[0]=ir.KEXINIT,r!==!1&&r.copy(u,1),Ye(u,i.length,m),m+=4,i.copy(u,m),m+=i.length,Ye(u,c.length,m),m+=4,c.copy(u,m),m+=c.length,Ye(u,n.cipherBuf.length,m),m+=4,n.cipherBuf.copy(u,m),m+=n.cipherBuf.length,Ye(u,n.cipherBuf.length,m),m+=4,n.cipherBuf.copy(u,m),m+=n.cipherBuf.length,Ye(u,n.hmacBuf.length,m),m+=4,n.hmacBuf.copy(u,m),m+=n.hmacBuf.length,Ye(u,n.hmacBuf.length,m),m+=4,n.hmacBuf.copy(u,m),m+=n.hmacBuf.length,Ye(u,n.compressBuf.length,m),m+=4,n.compressBuf.copy(u,m),m+=n.compressBuf.length,Ye(u,n.compressBuf.length,m),m+=4,n.compressBuf.copy(u,m),m+=n.compressBuf.length,u.fill(0,u.length-13),e.debug("DEBUG: Outgoing: Writing KEXINIT"),e._state.incoming.expectedPacket="KEXINIT";var p=e._state.outgoing;p.kexinit=u,p.status===X_&&(p.status=K_),Tn(e,u,t,!0)}),!0}function f7t(e){var t=e._state,r=t.outgoing,n=Buffer.allocUnsafe(1+4+r.pubkey.length);return t.incoming.expectedPacket=t.kex.pktReply,t.kex.type==="groupex"?(n[0]=ir.KEXDH_GEX_INIT,e.debug("DEBUG: Outgoing: Writing KEXDH_GEX_INIT")):(n[0]=ir.KEXDH_INIT,t.kex.type==="group"?e.debug("DEBUG: Outgoing: Writing KEXDH_INIT"):e.debug("DEBUG: Outgoing: Writing KEXECDH_INIT")),Ye(n,r.pubkey.length,1),r.pubkey.copy(n,5),Tn(e,n,void 0,!0)}function x$s(e,t){var r=e._state,n=r.outgoing,i=r.incoming,s=e.config.hostKeys[r.hostkeyFormat];Array.isArray(s)&&(s=s[0]);var a=s.getPublicSSH(),o=s.type;t=r.kex.convertPublicKey(t);var c=r.kex.computeSecret(t);if(c instanceof Error)return c.message="Error while computing DH secret ("+r.kex.type+"): "+c.message,c.level="handshake",e.emit("error",c),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1;var l=$s.createHash(r.kex.hash),u=Buffer.byteLength(i.identRaw),m=Buffer.byteLength(e.config.ident),p=i.kexinit.length,h=n.kexinit.length,y=a.length,w=t.length,v=n.pubkey.length,b=c.length,A=u+m+p+h+y+w+v+b+4*8,I,R,F,J,X=r.kex.getDHParams();X&&(F=X.prime,J=X.generator,I=F.length,R=J.length,A+=4*3,A+=4*2,A+=I,A+=R);var H=0,ae=Buffer.allocUnsafe(A);Ye(ae,u,H),H+=4,ae.write(i.identRaw,H,"utf8"),H+=u,Ye(ae,m,H),H+=4,ae.write(e.config.ident,H,"utf8"),H+=m,Ye(ae,p,H),H+=4,i.kexinit.copy(ae,H),H+=p,i.kexinit=void 0,Ye(ae,h,H),H+=4,n.kexinit.copy(ae,H),H+=h,n.kexinit=void 0,Ye(ae,y,H),H+=4,a.copy(ae,H),H+=y,X&&(RNe.slice(1).copy(ae,H),H+=4*3,Ye(ae,I,H),H+=4,F.copy(ae,H),H+=I,Ye(ae,R,H),H+=4,J.copy(ae,H),H+=R),Ye(ae,w,H),H+=4,t.copy(ae,H),H+=w,Ye(ae,v,H),H+=4,n.pubkey.copy(ae,H),H+=v,Ye(ae,b,H),H+=4,c.copy(ae,H),n.exchangeHash=l.update(ae).digest(),n.sessionId===void 0&&(n.sessionId=n.exchangeHash),n.kexsecret=c;var le=s.sign(n.exchangeHash);if(le instanceof Error)return le.message="Error while signing data with host key ("+o+"): "+le.message,le.level="handshake",e.emit("error",le),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1;if(le=TNe(le,o),le===!1)return le.message="Error while converting handshake signature",le.level="handshake",e.emit("error",le),e.disconnect(Da.KEY_EXCHANGE_FAILED),!1;var D=4+o.length+4+le.length,ie=Buffer.allocUnsafe(1+4+y+4+v+4+D);return H=0,ie[H]=ir[r.kex.pktReply],++H,Ye(ie,y,H),H+=4,a.copy(ie,H),H+=y,Ye(ie,v,H),H+=4,n.pubkey.copy(ie,H),H+=v,Ye(ie,D,H),H+=4,Ye(ie,o.length,H),H+=4,ie.write(o,H,o.length,"ascii"),H+=o.length,Ye(ie,le.length,H),H+=4,le.copy(ie,H),r.incoming.expectedPacket="NEWKEYS",e.debug("DEBUG: Outgoing: Writing "+r.kex.pktReply),Tn(e,ie,void 0,!0),n.sentNEWKEYS=!0,e.debug("DEBUG: Outgoing: Writing NEWKEYS"),Tn(e,xNe,void 0,!0)}function R$s(e){return e._state.incoming.expectedPacket="KEXDH_GEX_GROUP",e.debug("DEBUG: Outgoing: Writing KEXDH_GEX_REQUEST"),Tn(e,RNe,void 0,!0)}function p7t(e,t,r){var n=e._state.outgoing.compress.instance;n.write(t),n.flush(ANe,k$s.bind(e,r))}function k$s(e){if(!(this._readableState.ended||this._writableState.ended)){g7t(this,this._state.outgoing.compress.instance.read(),e);var t=this._state.outgoing.compress.queue;t.shift(),t.length>0&&p7t(this,t[0][0],t[0][1])}}function Tn(e,t,r,n){var i=e._state;if(!i)return!1;var s=i.outgoing;if(s.status===K_&&!n)return typeof r=="function"?s.rekeyQueue.push([t,r]):s.rekeyQueue.push(t),!1;if(e._readableState.ended||e._writableState.ended)return!1;if(s.compress.instance){var a=s.compress.queue;return a.push([t,r]),a.length===1&&p7t(e,a[0][0],a[0][1]),!0}else return g7t(e,t,r)}function g7t(e,t,r){var n=e._state,i=n.outgoing,s=i.encrypt,a=i.hmac,o,c,l,u,m;if(o=t.length+9,s.instance!==!1)if(s.info.authLen>0){for(var p=1+t.length+4;p%s.info.blockLen!=0;)++p;c=p-1-t.length,o=4+p}else{var h=s.info.blockLen;o+=(h-1)*o%h,c=o-t.length-5}else o+=7*o%8,c=o-t.length-5;l=Buffer.allocUnsafe(o),Ye(l,o-4,0),l[4]=c,t.copy(l,5),T$s(l,5+t.length,c),a.type!==!1&&a.key&&(u=$s.createHmac(J1[a.type],a.key),Ye(i.bufSeqno,i.seqno,0),u.update(i.bufSeqno),u.update(l),u=u.digest(),u.length>a.info.actualLen&&(u=u.slice(0,a.info.actualLen)));var y=0,w;if(s.instance!==!1)if(s.info.authLen>0){var v=$s.createCipheriv(J1[s.type],s.key,s.iv);v.setAutoPadding(!1);var b=l.slice(0,4);v.setAAD(b),e.push(b),y+=b,w=v.update(l.slice(4)),e.push(w),y+=w.length;var A=v.final();A.length&&(e.push(A),y+=A.length);var I=v.getAuthTag();m=e.push(I),y+=I.length,Z9t(s.iv)}else w=s.instance.update(l),e.push(w),y+=w.length,m=e.push(u),y+=u.length;else m=e.push(l),y=l.length;return e.bytesSent+=y,++i.seqno>ENe&&(i.seqno=0),r&&r(),m}var T$s=function(){return typeof $s.randomFillSync=="function"?$s.randomFillSync:function(t,r,n){var i=$s.randomBytes(n);i.copy(t,r)}}();function I$s(e,t){$s.randomBytes(e,function r(n,i){if(n)return $s.randomBytes(e,r);t&&t(i)})}function TNe(e,t){switch(t){case"ssh-dss":return Z3s(e);case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":return J3s(e)}return e}var q$s=function(){return typeof $s.timingSafeEqual=="function"?function(t,r){return t.length!==r.length?($s.timingSafeEqual(t,t),!1):$s.timingSafeEqual(t,r)}:function(t,r){var n;t.length===r.length?n=0:(n=1,r=t);for(var i=0,s=t.length;i<s;++i)n|=t[i]^r[i];return n===0}}();function KS(e,t){switch(e){case"curve25519-sha256":case"curve25519-sha256@libssh.org":if(!n$s)break;this.type="25519",this.hash="sha256",this.pktInit="KEXECDH_INIT",this.pktReply="KEXECDH_REPLY";return;case"ecdh-sha2-nistp256":this.type="ecdh",this.name="prime256v1",this.hash="sha256",this.pktInit="KEXECDH_INIT",this.pktReply="KEXECDH_REPLY";return;case"ecdh-sha2-nistp384":this.type="ecdh",this.name="secp384r1",this.hash="sha384",this.pktInit="KEXECDH_INIT",this.pktReply="KEXECDH_REPLY";return;case"ecdh-sha2-nistp521":this.type="ecdh",this.name="secp521r1",this.hash="sha512",this.pktInit="KEXECDH_INIT",this.pktReply="KEXECDH_REPLY";return;case"diffie-hellman-group1-sha1":this.type="group",this.name="modp2",this.hash="sha1",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group14-sha1":this.type="group",this.name="modp14",this.hash="sha1",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group14-sha256":this.type="group",this.name="modp14",this.hash="sha256",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group16-sha512":this.type="group",this.name="modp16",this.hash="sha512",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group18-sha512":this.type="group",this.name="modp18",this.hash="sha512",this.pktInit="KEXDH_INIT",this.pktReply="KEXDH_REPLY";return;case"diffie-hellman-group-exchange-sha1":this.type="groupex",this.hash="sha1",this.pktInit="KEXDH_GEX_REQ",this.pktReply="KEXDH_GEX_REPLY",this._prime=null,this._generator=null;return;case"diffie-hellman-group-exchange-sha256":this.type="groupex",this.hash="sha256",this.pktInit="KEXDH_GEX_REQ",this.pktReply="KEXDH_GEX_REPLY",this._prime=null,this._generator=null;return}throw new Error("Unsupported key exchange algorithm: "+e)}KS.prototype.setDHParams=function(e,t){if(this.type==="groupex"){if(!Buffer.isBuffer(e))throw new Error("Invalid prime value");if(!Buffer.isBuffer(t))throw new Error("Invalid generator value");this._prime=e,this._generator=t}};KS.prototype.getDHParams=function(){if(this.type==="groupex"&&this._kex)return{prime:zJ(this._kex.getPrime()),generator:zJ(this._kex.getGenerator())}};KS.prototype.generateKeys=function(){switch(this.type){case"25519":this._keys||(this._keys=$s.generateKeyPairSync("x25519"));break;case"ecdh":this._kex||(this._kex=$s.createECDH(this.name),this._public=this._kex.generateKeys());break;case"group":case"groupex":this._kex||(this.name?this._kex=$s.createDiffieHellmanGroup(this.name):this._prime&&this._generator&&(this._kex=$s.createDiffieHellman(this._prime,this._generator)),this._kex&&(this._public=this._kex.generateKeys()));break}};KS.prototype.getPublicKey=function(){this.generateKeys();var e;switch(this.type){case"25519":return e=this._keys.publicKey.export({type:"spki",format:"der"}),e.slice(-32);case"ecdh":case"group":case"groupex":e=this._public;break}if(e)return this.convertPublicKey(e)};KS.prototype.convertPublicKey=function(e){for(var t,r=0,n=e.length;e[r]===0;)++r,--n;switch(this.type){case"25519":if(e.length===32)return e;break;default:if(e[r]&128)return t=Buffer.allocUnsafe(1+n),t[0]=0,e.copy(t,1,r),t}return n!==e.length&&(t=Buffer.allocUnsafe(n),e.copy(t,0,r),e=t),e};KS.prototype.computeSecret=function(e){switch(this.generateKeys(),this.type){case"25519":try{var t=new Y9t.Writer;return t.startSequence(),t.startSequence(),t.writeOID("1.3.101.110"),t.endSequence(),t.startSequence(Y9t.BitString),t.writeByte(0),t._ensure(e.length),e.copy(t._buf,t._offset,0,e.length),t._offset+=e.length,t.endSequence(),t.endSequence(),zJ($s.diffieHellman({privateKey:this._keys.privateKey,publicKey:$s.createPublicKey({key:t.buffer,type:"spki",format:"der"})}))}catch(r){return r}break;case"ecdh":case"group":case"groupex":try{return zJ(this._kex.computeSecret(e))}catch(r){return r}}};function zJ(e){for(var t=0,r=e.length;e[t]===0;)++t,--r;var n;return e[t]&128?(n=Buffer.allocUnsafe(1+r),n[0]=0,e.copy(n,1,t),e=n):r!==e.length&&(n=Buffer.allocUnsafe(r),e.copy(n,0,t),e=n),e}INe.exports=Bn;INe.exports._send=Tn});var OJ=g((S2o,y7t)=>{y7t.exports={SFTPStream:H9t(),SSH2Stream:h7t(),utils:Yg(),constants:yJ()}});var _7t=g(v7t=>{var w7t=require("http").Agent,D$s=require("https").Agent,N$s=require("util").inherits,qNe;[w7t,D$s].forEach(e=>{function t(r,n){if(!(this instanceof t))return new t(r,n);e.call(this,n),this._connectCfg=r,this._defaultSrcIP=n&&n.srcIP||"localhost"}N$s(t,e),t.prototype.createConnection=L$s,v7t[e===w7t?"SSHTTPAgent":"SSHTTPSAgent"]=t});function L$s(e,t){var r=e&&e.localAddress||this._defaultSrcIP,n=e&&e.localPort||0,i=e.host,s=e.port;qNe===void 0&&(qNe=DNe().Client);var a=new qNe,o=!1;a.on("ready",()=>{a.forwardOut(r,n,i,s,(c,l)=>{if(o=!0,c)return a.end(),t(c);l.once("close",()=>{a.end()}),t(null,M$s(l))})}).on("error",t).on("close",()=>{o||t(new Error("Unexpected connection loss"))}).connect(this._connectCfg)}function AN(){}function M$s(e){return e.setKeepAlive=AN,e.setNoDelay=AN,e.setTimeout=AN,e.ref=AN,e.unref=AN,e.destroySoon=e.destroy,e}});var LNe=g((E2o,A7t)=>{var b7t=require("util").inherits,S7t=require("stream").Duplex,z$s=require("stream").Readable,C7t=require("stream").Writable,O$s=OJ().constants.CHANNEL_EXTENDED_DATATYPE.STDERR,F$s=32*1024,PN=2*1024*1024,FJ=PN/2,E7t=["CHANNEL_EOF","CHANNEL_CLOSE","CHANNEL_DATA","CHANNEL_EXTENDED_DATA","CHANNEL_WINDOW_ADJUST","CHANNEL_SUCCESS","CHANNEL_FAILURE","CHANNEL_REQUEST"],j$s=E7t.length;function Pf(e,t,r){var n={highWaterMark:PN,allowHalfOpen:!r||r&&r.allowHalfOpen!==!1};this.allowHalfOpen=n.allowHalfOpen,S7t.call(this,n);var i=this,s=r&&r.server;this.server=s,this.type=e.type,this.subtype=void 0;var a=this.incoming=e.incoming,o=a.id,c=this.outgoing=e.outgoing,l=this._callbacks=[],u,m,p,h,y;this._client=t,this._hasX11=!1;var w=t._channels,v=t._sshstream;function b(){i._waitClientDrain&&(i._waitClientDrain=!1,i._waitWindow||(i._chunk?i._write(i._chunk,null,i._chunkcb):i._chunkcb?i._chunkcb():i._chunkErr?i.stderr._write(i._chunkErr,null,i._chunkcbErr):i._chunkcbErr&&i._chunkcbErr()))}t._sock.on("drain",b),v.once("CHANNEL_EOF:"+o,function(){a.state==="open"&&(a.state="eof",i.readable&&i.push(null),!s&&i.stderr.readable&&i.stderr.push(null))}).once("CHANNEL_CLOSE:"+o,function(){if(a.state!=="closed"){a.state="closed",i.readable&&i.push(null),s&&i.stderr.writable?i.stderr.end():!s&&i.stderr.readable&&i.stderr.push(null),(c.state==="open"||c.state==="eof")&&i.close(),c.state==="closing"&&(c.state="closed"),delete w[o];var R=i._writableState;t._sock.removeListener("drain",b),!R.ending&&!R.finished&&i.end(),i._callbacks=[];for(var F=0;F<l.length;++F)l[F](!0);l=i._callbacks,s?i.readable?i.once("end",function(){i.emit("close")}):i.emit("close"):(i.readable?i.once("end",function(){u===null?i.emit("close",u,m,p,h,y):i.emit("close",u)}):u===null?i.emit("close",u,m,p,h,y):i.emit("close",u),i.stderr.readable?i.stderr.once("end",function(){i.stderr.emit("close")}):i.stderr.emit("close"));for(var F=0;F<j$s;++F)v.removeAllListeners(E7t[F]+":"+o)}}).on("CHANNEL_DATA:"+o,function(R){if(a.window!==0){if(a.window-=R.length,!i.push(R)){i._waitChanDrain=!0;return}a.window<=FJ&&jJ(i)}}).on("CHANNEL_WINDOW_ADJUST:"+o,function(R){c.window+=R,i._waitWindow&&(i._waitWindow=!1,i._waitClientDrain||(i._chunk?i._write(i._chunk,null,i._chunkcb):i._chunkcb?i._chunkcb():i._chunkErr?i.stderr._write(i._chunkErr,null,i._chunkcbErr):i._chunkcbErr&&i._chunkcbErr()))}).on("CHANNEL_SUCCESS:"+o,function(){s?(v._kalast=Date.now(),v._kacnt=0):t._resetKA(),l.length&&l.shift()(!1)}).on("CHANNEL_FAILURE:"+o,function(){s?(v._kalast=Date.now(),v._kacnt=0):t._resetKA(),l.length&&l.shift()(!0)}).on("CHANNEL_REQUEST:"+o,function(R){if(!s){if(R.request==="exit-status"){i.emit("exit",u=R.code);return}else if(R.request==="exit-signal"){i.emit("exit",u=null,m="SIG"+R.signal,p=R.coredump,h=R.description,y=R.lang);return}}R.wantReply&&v.channelFailure(c.id)}),this.stdin=this.stdout=this,s?this.stderr=new NNe(this):(this.stderr=new z$s(n),this.stderr._read=function(R){i._waitChanDrain&&(i._waitChanDrain=!1,a.window<=FJ&&jJ(i))},v.on("CHANNEL_EXTENDED_DATA:"+o,function(R,F){if(a.window!==0){if(a.window-=F.length,!i.stderr.push(F)){i._waitChanDrain=!0;return}a.window<=FJ&&jJ(i)}})),this._waitClientDrain=!1,this._waitWindow=!1,this._waitChanDrain=!1,this._chunk=void 0,this._chunkcb=void 0,this._chunkErr=void 0,this._chunkcbErr=void 0;function A(){i.eof(),(s||!s&&!i.allowHalfOpen)&&i.close(),i.writable=!1}this.on("finish",A).on("prefinish",A);function I(){i.readable=!1}this.on("end",I).on("close",I)}b7t(Pf,S7t);Pf.prototype.eof=function(){var e=!0,t=this.outgoing;return t.state==="open"&&(t.state="eof",e=this._client._sshstream.channelEOF(t.id)),e};Pf.prototype.close=function(){var e=!0,t=this.outgoing;return(t.state==="open"||t.state==="eof")&&(t.state="closing",e=this._client._sshstream.channelClose(t.id)),e};Pf.prototype._read=function(e){this._waitChanDrain&&(this._waitChanDrain=!1,this.incoming.window<=FJ&&jJ(this))};Pf.prototype._write=function(e,t,r){var n=this._client._sshstream,i=this.outgoing,s=i.packetSize,a=i.id,o=i.window,c=e.length,l=0,u,m,p;if(i.state==="open"){for(;c-l>0&&o>0;)if(p=c-l,p>o&&(p=o),p>s&&(p=s),u=n.channelData(a,e.slice(l,l+p)),l+=p,o-=p,!u){this._waitClientDrain=!0,this._chunk=void 0,this._chunkcb=r;break}if(i.window=o,c-l>0){o===0&&(this._waitWindow=!0),l>0?(m=Buffer.allocUnsafe(c-l),e.copy(m,0,l),this._chunk=m):this._chunk=e,this._chunkcb=r;return}this._waitClientDrain||r()}};Pf.prototype.destroy=function(){this.end()};Pf.prototype.setWindow=function(e,t,r,n){if(this.server)throw new Error("Client-only method called in server mode");return this.type==="session"&&(this.subtype==="shell"||this.subtype==="exec")&&this.writable&&this.outgoing.state==="open"?this._client._sshstream.windowChange(this.outgoing.id,e,t,r,n):!0};Pf.prototype.signal=function(e){if(this.server)throw new Error("Client-only method called in server mode");return this.type==="session"&&this.writable&&this.outgoing.state==="open"?this._client._sshstream.signal(this.outgoing.id,e):!0};Pf.prototype.exit=function(e,t,r){if(!this.server)throw new Error("Server-only method called in client mode");return this.type==="session"&&this.writable&&this.outgoing.state==="open"?typeof e=="number"?this._client._sshstream.exitStatus(this.outgoing.id,e):this._client._sshstream.exitSignal(this.outgoing.id,e,t,r):!0};Pf.MAX_WINDOW=PN;Pf.PACKET_SIZE=F$s;function jJ(e){if(e.outgoing.state==="closed")return!0;var t=PN-e.incoming.window;return t<=0?!0:(e.incoming.window+=t,e._client._sshstream.channelWindowAdjust(e.outgoing.id,t))}function NNe(e){C7t.call(this,{highWaterMark:PN}),this._channel=e}b7t(NNe,C7t);NNe.prototype._write=function(e,t,r){var n=this._channel,i=n._client._sshstream,s=n.outgoing,a=s.packetSize,o=s.id,c=s.window,l=e.length,u=0,m,p,h;if(n.outgoing.state==="open"){for(;l-u>0&&c>0;)if(h=l-u,h>c&&(h=c),h>a&&(h=a),m=i.channelExtData(o,e.slice(u,u+h),O$s),u+=h,c-=h,!m){n._waitClientDrain=!0,n._chunkErr=void 0,n._chunkcbErr=r;break}if(s.window=c,l-u>0){c===0&&(n._waitWindow=!0),u>0?(p=Buffer.allocUnsafe(l-u),e.copy(p,0,u),n._chunkErr=p):n._chunkErr=e,n._chunkcbErr=r;return}n._waitClientDrain||r()}};A7t.exports=Pf});var ix=g((A2o,P7t)=>{P7t.exports={readUInt32BE:function(t,r){return t[r++]*16777216+t[r++]*65536+t[r++]*256+t[r]},writeUInt32BE:function(t,r,n){return t[n++]=r>>>24,t[n++]=r>>>16,t[n++]=r>>>8,t[n++]=r,n},writeUInt32LE:function(t,r,n){return t[n++]=r,t[n++]=r>>>8,t[n++]=r>>>16,t[n++]=r>>>24,n}}});var j7t=g((P2o,F7t)=>{var x7t=require("net").Socket,B$s=require("events").EventEmitter,U$s=require("util").inherits,$$s=require("path"),R7t=require("fs"),k7t=require("child_process"),T7t=ix().readUInt32BE,BJ=ix().writeUInt32BE,I7t=ix().writeUInt32LE,G$s=11,H$s=12,V$s=13,X$s=14,K$s=5,W$s=/^\!<socket >(\d+) s ([A-Z0-9]{8}\-[A-Z0-9]{8}\-[A-Z0-9]{8}\-[A-Z0-9]{8})/,Q$s=/^[/\\][/\\]\.[/\\]pipe[/\\].+/;F7t.exports=function(e,t,r,n,i){var s,a,o,c,l=0,u=Buffer.isBuffer(t),m,p=0,h=0,y=0,w,v=0,b=!1,A,I;typeof t=="function"&&typeof r=="function"?(A=t,I=r):u?(l=t.length,c=n.length):(i=t,t=void 0);function R(){var le;if(u){var D=9;le=Buffer.allocUnsafe(4+1+4+l+4+c+4),BJ(le,le.length-4,0),le[4]=V$s,BJ(le,l,5),t.copy(le,D),BJ(le,c,D+=l),n.copy(le,D+=4),BJ(le,0,D+=c),s.write(le)}else s.write(Buffer.from([0,0,0,1,G$s]))}function F(le){for(var D=0,ie=le.length;D<ie;++D)if(m===void 0)++p==5&&(m=le[D],p=0);else if(m===X$s){if(!o)h<<=8,h+=le[D],++p==4&&(o=Buffer.allocUnsafe(h),p=0);else if(o[p]=le[D],++p===h)return s.removeAllListeners("data"),s.destroy()}else if(m===H$s)if(w===void 0){if(y<<=8,y+=le[D],++p==4&&(w=new Array(y),p=0,y===0))return s.removeAllListeners("data"),s.destroy()}else if(!t)l<<=8,l+=le[D],++p==4&&(t=Buffer.allocUnsafe(l),p=0);else if(b===!1){if(t[p]=le[D],++p===l&&(w[y-1]=t,l=0,p=0,b=!0,--y==0))return t=void 0,s.removeAllListeners("data"),s.destroy()}else b===!0?(v<<=8,v+=le[D],++p==4&&(p=0,v>0?b=v:(t=void 0,b=!1),v=0)):++p===b&&(b=!1,p=0,t=void 0);else if(m===K$s)return u?a=new Error("Agent unable to sign data"):a=new Error("Unable to retrieve list of keys from agent"),s.removeAllListeners("data"),s.destroy()}function J(le){a=le}function X(){a?i(a):u&&!o||!u&&!w?i(new Error("Unexpected disconnection from agent")):u&&o?i(void 0,o):!u&&w&&i(void 0,w)}if(process.platform==="win32"&&!Q$s.test(e))if(e==="pageant")s=new Y$s;else{var H=!1;R7t.readFile(e,function le(D,ie){if(D){if(H)return i(new Error("Invalid cygwin unix socket path"));k7t.exec('cygpath -w "'+e+'"',function(Nr,Ue,Rr){if(Nr||Ue.length===0)return i(new Error("Invalid cygwin unix socket path"));H=!0,e=Ue.toString().replace(/[\r\n]/g,""),R7t.readFile(e,le)});return}var re;if(re=W$s.exec(ie.toString("ascii"))){let Nr=function(){We=0,Ge="secret",s.write(ee)},Ue=function(Q){We+=Q.length,Ge==="secret"?We===16&&(We=0,Ge="creds",s.write(qt)):Ge==="creds"&&(nt||Tt.push(Q),We===12&&(s.removeListener("connect",Nr),s.removeListener("data",Ue),s.removeListener("close",Rr),nt?(ae(),s.emit("connect")):(nt=!0,qt=Buffer.concat(Tt),I7t(qt,process.pid,0),s.destroy(),z())))},Rr=function(){i(new Error("Problem negotiating cygwin unix socket security"))},z=function(){s=new x7t,s.once("connect",Nr),s.on("data",Ue),s.once("close",Rr),s.connect(Pe)};var ur=Nr,pt=Ue,ft=Rr,sr=z,Pe,B,ee,Ge,We=0,nt=!1,Tt=[],qt=Buffer.allocUnsafe(12),er,ct;for(qt.fill(0),Pe=parseInt(re[1],10),B=re[2].replace(/\-/g,""),ee=Buffer.allocUnsafe(16),er=0,ct=0;ct<32;++er,ct+=2)ee[er]=parseInt(B.substring(ct,ct+2),16);for(er=0;er<16;er+=4)I7t(ee,T7t(ee,er),er);z()}else i(new Error("Malformed cygwin unix socket file"))});return}else s=new x7t;function ae(){if(!A&&!I)s.once("connect",R),s.on("data",F),s.once("error",J),s.once("close",X);else{var le;s.once("connect",function(){le=A();var D=!1;function ie(){D||(s.destroy(),D=!0)}le.once("end",ie).once("close",ie).on("data",function(re){s.write(re)}),s.on("data",function(re){le.write(re)})}),s.once("close",function(){le||I()})}}ae(),s.connect(e)};if(process.platform==="win32"){let e=function(){this.proc=void 0,this.buffer=null};Y$s=e,q7t=10,D7t=11,N7t=12,L7t=13,M7t=14,z7t=15,ww={},O7t=$$s.resolve(__dirname,"..","util/pagent.exe"),ww[q7t]=new Error("Invalid pagent.exe arguments"),ww[D7t]=new Error("Pageant is not running"),ww[N7t]=new Error("pagent.exe could not create an mmap"),ww[L7t]=new Error("pagent.exe could not set mode for stdin"),ww[M7t]=new Error("pagent.exe could not set mode for stdout"),ww[z7t]=new Error("pagent.exe did not get expected input payload"),U$s(e,B$s),e.prototype.write=function(t){if(this.buffer===null?this.buffer=t:this.buffer=Buffer.concat([this.buffer,t],this.buffer.length+t.length),!(this.buffer.length<4)){var r=T7t(this.buffer,0);if(!(this.buffer.length-4<r)){t=this.buffer.slice(0,4+r),this.buffer.length>4+r?this.buffer=this.buffer.slice(4+r):this.buffer=null;var n=this,i,s=!1;i=this.proc=k7t.spawn(O7t,[t.length]),i.stdout.on("data",function(a){n.emit("data",a)}),i.once("error",function(a){s||(s=!0,n.emit("error",a))}),i.once("close",function(a){n.proc=void 0,ww[a]&&!s&&(s=!0,n.emit("error",ww[a])),n.emit("close",s)}),i.stdin.end(t)}}},e.prototype.end=e.prototype.destroy=function(){this.buffer=null,this.proc&&(this.proc.kill(),this.proc=void 0)},e.prototype.connect=function(){this.emit("connect")}}var q7t,D7t,N7t,L7t,M7t,z7t,ww,O7t,Y$s});var $7t=g((x2o,U7t)=>{var Z$s=require("util").inherits,B7t=require("events").EventEmitter;function as(e){var t=this;B7t.call(this),this._stream=e,e.on("error",function(r){t.emit("error",r)}).on("end",function(){t.emit("end")}).on("close",function(){t.emit("close")}).on("continue",function(){t.emit("continue")})}Z$s(as,B7t);as.prototype.end=function(){return this._stream.end()};as.prototype.createReadStream=function(e,t){return this._stream.createReadStream(e,t)};as.prototype.createWriteStream=function(e,t){return this._stream.createWriteStream(e,t)};as.prototype.open=function(e,t,r,n){return this._stream.open(e,t,r,n)};as.prototype.close=function(e,t){return this._stream.close(e,t)};as.prototype.read=function(e,t,r,n,i,s){return this._stream.readData(e,t,r,n,i,s)};as.prototype.write=function(e,t,r,n,i,s){return this._stream.writeData(e,t,r,n,i,s)};as.prototype.fastGet=function(e,t,r,n){return this._stream.fastGet(e,t,r,n)};as.prototype.fastPut=function(e,t,r,n){return this._stream.fastPut(e,t,r,n)};as.prototype.readFile=function(e,t,r){return this._stream.readFile(e,t,r)};as.prototype.writeFile=function(e,t,r,n){return this._stream.writeFile(e,t,r,n)};as.prototype.appendFile=function(e,t,r,n){return this._stream.appendFile(e,t,r,n)};as.prototype.exists=function(e,t){return this._stream.exists(e,t)};as.prototype.unlink=function(e,t){return this._stream.unlink(e,t)};as.prototype.rename=function(e,t,r){return this._stream.rename(e,t,r)};as.prototype.mkdir=function(e,t,r){return this._stream.mkdir(e,t,r)};as.prototype.rmdir=function(e,t){return this._stream.rmdir(e,t)};as.prototype.readdir=function(e,t,r){return this._stream.readdir(e,t,r)};as.prototype.fstat=function(e,t){return this._stream.fstat(e,t)};as.prototype.stat=function(e,t){return this._stream.stat(e,t)};as.prototype.lstat=function(e,t){return this._stream.lstat(e,t)};as.prototype.opendir=function(e,t){return this._stream.opendir(e,t)};as.prototype.setstat=function(e,t,r){return this._stream.setstat(e,t,r)};as.prototype.fsetstat=function(e,t,r){return this._stream.fsetstat(e,t,r)};as.prototype.futimes=function(e,t,r,n){return this._stream.futimes(e,t,r,n)};as.prototype.utimes=function(e,t,r,n){return this._stream.utimes(e,t,r,n)};as.prototype.fchown=function(e,t,r,n){return this._stream.fchown(e,t,r,n)};as.prototype.chown=function(e,t,r,n){return this._stream.chown(e,t,r,n)};as.prototype.fchmod=function(e,t,r){return this._stream.fchmod(e,t,r)};as.prototype.chmod=function(e,t,r){return this._stream.chmod(e,t,r)};as.prototype.readlink=function(e,t){return this._stream.readlink(e,t)};as.prototype.symlink=function(e,t,r){return this._stream.symlink(e,t,r)};as.prototype.realpath=function(e,t){return this._stream.realpath(e,t)};as.prototype.ext_openssh_rename=function(e,t,r){return this._stream.ext_openssh_rename(e,t,r)};as.prototype.ext_openssh_statvfs=function(e,t){return this._stream.ext_openssh_statvfs(e,t)};as.prototype.ext_openssh_fstatvfs=function(e,t){return this._stream.ext_openssh_fstatvfs(e,t)};as.prototype.ext_openssh_hardlink=function(e,t,r){return this._stream.ext_openssh_hardlink(e,t,r)};as.prototype.ext_openssh_fsync=function(e,t){return this._stream.ext_openssh_fsync(e,t)};U7t.exports=as});var V7t=g((R2o,H7t)=>{function G7t(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}function xN(e,t,r){var n=this._streams=[];this._timer=void 0,this._timerInterval=e,this._timerfn=function(){for(var i=Date.now(),s=0,a=n.length,o,c;s<a;++s)if(o=n[s],c=o._kalast,c&&i-c>=t)if(++o._kacnt>r){var l=new Error("Keepalive timeout");l.level="client-timeout",o.emit("error",l),o.disconnect(),G7t(n,s),--s,a=n.length}else o._kalast=i,o.ping()}}xN.prototype.start=function(){this._timer&&this.stop(),this._timer=setInterval(this._timerfn,this._timerInterval)};xN.prototype.stop=function(){this._timer&&(clearInterval(this._timer),this._timer=void 0)};xN.prototype.add=function(e){var t=this._streams,r=this;e.once("end",function(){r.remove(e)}).on("packet",n),t[t.length]=e,n(),this._timer||this.start();function n(){e._kalast=Date.now(),e._kacnt=0}};xN.prototype.remove=function(e){var t=this._streams,r=t.indexOf(e);r>-1&&G7t(t,r),t.length||this.stop()};H7t.exports=xN});var J7t=g((k2o,jNe)=>{var J$s=require("net"),W_=require("events").EventEmitter,El=W_.listenerCount,Q_=require("util").inherits,UJ=OJ(),X7t=UJ.utils.parseKey,eGs=UJ.SSH2Stream,tGs=UJ.SFTPStream,MNe=UJ.constants,RN=MNe.DISCONNECT_REASON,zNe=MNe.CHANNEL_OPEN_FAILURE,kN=MNe.ALGORITHMS,hc=LNe(),rGs=V7t(),nGs=ix().writeUInt32BE,K7t=Math.pow(2,32)-1,iGs=10,$J;function Wo(e,t){if(!(this instanceof Wo))return new Wo(e,t);var r={"ssh-rsa":null,"ssh-dss":null,"ssh-ed25519":null,"ecdsa-sha2-nistp256":null,"ecdsa-sha2-nistp384":null,"ecdsa-sha2-nistp521":null},n=e.hostKeys;if(!Array.isArray(n))throw new Error("hostKeys must be an array");var i;for(i=0;i<n.length;++i){var s;if(Buffer.isBuffer(n[i])||typeof n[i]=="string"?s=X7t(n[i]):s=X7t(n[i].key,n[i].passphrase),s instanceof Error)throw new Error("Cannot parse privateKey: "+s.message);if(Array.isArray(s)&&(s=s[0]),s.getPrivatePEM()===null)throw new Error("privateKey value contains an invalid private key");r[s.type]||(r[s.type]=s)}var a={kex:void 0,kexBuf:void 0,cipher:void 0,cipherBuf:void 0,serverHostKey:void 0,serverHostKeyBuf:void 0,hmac:void 0,hmacBuf:void 0,compress:void 0,compressBuf:void 0};if(typeof e.algorithms=="object"&&e.algorithms!==null){var o,c;if(c=e.algorithms.kex,Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_KEX,i=0;i<c.length;++i)if(o.indexOf(c[i])===-1)throw new Error("Unsupported key exchange algorithm: "+c[i]);a.kex=c}if(c=e.algorithms.cipher,Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_CIPHER,i=0;i<c.length;++i)if(o.indexOf(c[i])===-1)throw new Error("Unsupported cipher algorithm: "+c[i]);a.cipher=c}c=e.algorithms.serverHostKey;var l=!1;if(Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_SERVER_HOST_KEY,i=c.length-1;i>=0;--i){if(o.indexOf(c[i])===-1)throw new Error("Unsupported server host key algorithm: "+c[i]);r[c[i]]||(l||(c=c.slice(),l=!0),c.splice(i,1))}c.length>0&&(a.serverHostKey=c)}if(c=e.algorithms.hmac,Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_HMAC,i=0;i<c.length;++i)if(o.indexOf(c[i])===-1)throw new Error("Unsupported HMAC algorithm: "+c[i]);a.hmac=c}if(c=e.algorithms.compress,Array.isArray(c)&&c.length>0){for(o=kN.SUPPORTED_COMPRESS,i=0;i<c.length;++i)if(o.indexOf(c[i])===-1)throw new Error("Unsupported compression algorithm: "+c[i]);a.compress=c}}if(a.serverHostKey===void 0){var u=Object.keys(r);for(i=u.length-1;i>=0;--i)r[u[i]]||u.splice(i,1);a.serverHostKey=u}!$J&&Wo.KEEPALIVE_INTERVAL>0&&Wo.KEEPALIVE_CLIENT_INTERVAL>0&&Wo.KEEPALIVE_CLIENT_COUNT_MAX>=0&&($J=new rGs(Wo.KEEPALIVE_INTERVAL,Wo.KEEPALIVE_CLIENT_INTERVAL,Wo.KEEPALIVE_CLIENT_COUNT_MAX));var m=this;W_.call(this),typeof t=="function"&&m.on("connection",t);var p={algorithms:a,hostKeys:r,server:!0},h,y;for(i=0,h=Object.keys(e),y=h.length;i<y;++i){var w=h[i];w==="privateKey"||w==="publicKey"||w==="passphrase"||w==="algorithms"||w==="hostKeys"||w==="server"||(p[w]=e[w])}if(typeof p.debug=="function")var v=p.debug,b=Object.keys(p);this._srv=new J$s.Server(function(A){if(m._connections>=m.maxConnections){A.destroy();return}++m._connections,A.once("close",function(le){--m._connections,X.read()}).on("error",function(le){X.reset(),X.emit("error",le)});var I=p;if(v){I={};for(var R=0,F;R<b.length;++R)F=b[R],I[F]=p[F];var J="["+process.hrtime().join(".")+"] ";I.debug=function(le){v(J+le)}}var X=new eGs(I),H=new Y_(X,A);A.pipe(X).pipe(A);function ae(le){}H.on("error",ae),X.once("header",function(le){if(!X._readableState.ended){if(!El(m,"connection"))return X.disconnect(RN.BY_APPLICATION);H.removeListener("error",ae),m.emit("connection",H,{ip:A.remoteAddress,family:A.remoteFamily,port:A.remotePort,header:le})}})}).on("error",function(A){m.emit("error",A)}).on("listening",function(){m.emit("listening")}).on("close",function(){m.emit("close")}),this._connections=0,this.maxConnections=1/0}Q_(Wo,W_);Wo.prototype.listen=function(){return this._srv.listen.apply(this._srv,arguments),this};Wo.prototype.address=function(){return this._srv.address()};Wo.prototype.getConnections=function(e){this._srv.getConnections(e)};Wo.prototype.close=function(e){return this._srv.close(e),this};Wo.prototype.ref=function(){this._srv.ref()};Wo.prototype.unref=function(){this._srv.unref()};function Y_(e,t){W_.call(this);var r=this;this._sshstream=e;var n=this._channels={};this._curChan=-1,this._sock=t,this.noMoreSessions=!1,this.authenticated=!1,e.on("end",function(){t.resume(),r.emit("end")}).on("close",function(p){r.emit("close",p)}).on("error",function(p){r.emit("error",p)}).on("drain",function(){r.emit("drain")}).on("continue",function(){r.emit("continue")});var i=0,s=!1,a=[],o;e.on("SERVICE_REQUEST",function(p){if(i===0||s||r.authenticated||p!=="ssh-userauth")return e.disconnect(RN.SERVICE_NOT_AVAILABLE);s=!0,e.serviceAccept(p)}).on("USERAUTH_REQUEST",c);function c(p,h,y,w){if(i===0||o&&(o.username!==p||o.service!==h)||y!=="password"&&y!=="publickey"&&y!=="hostbased"&&y!=="keyboard-interactive"&&y!=="none"||a.length===iGs)return e.disconnect(RN.PROTOCOL_ERROR);if(h!=="ssh-connection")return e.disconnect(RN.SERVICE_NOT_AVAILABLE);e._state.authMethod=y;var v;if(y==="keyboard-interactive"?v=new GJ(e,p,h,y,w,l):y==="publickey"?v=new ONe(e,p,h,y,w,l):y==="hostbased"?v=new Q7t(e,p,h,y,w,l):y==="password"?v=new Y7t(e,p,h,y,w,l):y==="none"&&(v=new om(e,p,h,y,l)),o)if(o._initialResponse)o._multistep&&!this._finalResponse&&(o._cleanup&&o._cleanup(),o.emit("abort"));else return a.push(v);o=v,El(r,"authentication")?r.emit("authentication",o):o.reject()}function l(p,h,y,w){o===p&&!r.authenticated&&(h?(e.removeListener("USERAUTH_REQUEST",c),o=void 0,r.authenticated=!0,e.authSuccess(),a=[],r.emit("ready")):(e.authFailure(y,w),a.length&&(o=a.pop(),El(r,"authentication")?r.emit("authentication",o):o.reject())))}var u=[];function m(){for(var p;u.length>0&&u[0].type;)p=u.shift(),p.type==="SUCCESS"&&e.requestSuccess(p.buf),p.type==="FAILURE"&&e.requestFailure()}e.on("GLOBAL_REQUEST",function(p,h,y){var w={type:null,buf:null};function v(R,F){w.type=R,w.buf=F,m()}if(h&&u.push(w),(p==="tcpip-forward"||p==="cancel-tcpip-forward"||p==="no-more-sessions@openssh.com"||p==="streamlocal-forward@openssh.com"||p==="cancel-streamlocal-forward@openssh.com")&&El(r,"request")&&r.authenticated){var b,A;if(h){var I=!1;b=function(R){if(!I){I=!0;var F;p==="tcpip-forward"&&y.bindPort===0&&typeof R=="number"&&(F=Buffer.allocUnsafe(4),nGs(F,R,0)),v("SUCCESS",F)}},A=function(){I||(I=!0,v("FAILURE"))}}if(p==="no-more-sessions@openssh.com"){r.noMoreSessions=!0,b&&b();return}r.emit("request",b,A,p,y)}else h&&v("FAILURE")}),e.on("CHANNEL_OPEN",function(p){if(p.type==="session"&&r.noMoreSessions||!r.authenticated){var h=zNe.ADMINISTRATIVELY_PROHIBITED;return e.channelOpenFail(p.sender,h)}var y=Z7t(r),w,v,b=!1;if(y===!1)return e.channelOpenFail(p.sender,zNe.RESOURCE_SHORTAGE);switch(n[y]=!0,v=function(){if(!b){b=!0,delete n[y];var A=zNe.ADMINISTRATIVELY_PROHIBITED;return e.channelOpenFail(p.sender,A)}},p.type){case"session":El(r,"session")?(w=function(){if(!b)return b=!0,e.channelOpenConfirm(p.sender,y,hc.MAX_WINDOW,hc.PACKET_SIZE),new W7t(r,p,y)},r.emit("session",w,v)):v();break;case"direct-tcpip":El(r,"tcpip")?(w=function(){if(!b){b=!0,e.channelOpenConfirm(p.sender,y,hc.MAX_WINDOW,hc.PACKET_SIZE);var A={type:void 0,incoming:{id:y,window:hc.MAX_WINDOW,packetSize:hc.PACKET_SIZE,state:"open"},outgoing:{id:p.sender,window:p.window,packetSize:p.packetSize,state:"open"}};return new hc(A,r)}},r.emit("tcpip",w,v,p.data)):v();break;case"direct-streamlocal@openssh.com":El(r,"openssh.streamlocal")?(w=function(){if(!b){b=!0,e.channelOpenConfirm(p.sender,y,hc.MAX_WINDOW,hc.PACKET_SIZE);var A={type:void 0,incoming:{id:y,window:hc.MAX_WINDOW,packetSize:hc.PACKET_SIZE,state:"open"},outgoing:{id:p.sender,window:p.window,packetSize:p.packetSize,state:"open"}};return new hc(A,r)}},r.emit("openssh.streamlocal",w,v,p.data)):v();break;default:v()}}),e.on("NEWKEYS",function(){++i>1&&r.emit("rekey")}),$J&&this.once("ready",function(){$J.add(e)})}Q_(Y_,W_);Y_.prototype.end=function(){return this._sshstream.disconnect(RN.BY_APPLICATION)};Y_.prototype.x11=function(e,t,r){var n={originAddr:e,originPort:t};return FNe(this,"x11",n,r)};Y_.prototype.forwardOut=function(e,t,r,n,i){var s={boundAddr:e,boundPort:t,remoteAddr:r,remotePort:n};return FNe(this,"forwarded-tcpip",s,i)};Y_.prototype.openssh_forwardOutStreamLocal=function(e,t){var r={socketPath:e};return FNe(this,"forwarded-streamlocal@openssh.com",r,t)};Y_.prototype.rekey=function(e){var t=this._sshstream,r=!0,n;try{r=t.rekey()}catch(i){n=i}return typeof e=="function"&&(n?process.nextTick(function(){e(n)}):this.once("rekey",e)),r};function W7t(e,t,r){this.subtype=void 0;var n=!1,i=this,s=t.sender,a,o={type:"session",incoming:{id:r,window:hc.MAX_WINDOW,packetSize:hc.PACKET_SIZE,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}};function c(m){var p=!1,h,y;if(m.wantReply&&(m.request!=="shell"&&m.request!=="exec"&&m.request!=="subsystem"&&(h=function(){if(!(p||n||a))return p=!0,e._sshstream.channelSuccess(s)}),y=function(){if(!(p||n||a))return p=!0,e._sshstream.channelFailure(s)}),n){y&&y();return}switch(m.request){case"env":El(i,"env")?i.emit("env",h,y,{key:m.key,val:m.val}):y&&y();break;case"pty-req":El(i,"pty")?i.emit("pty",h,y,{cols:m.cols,rows:m.rows,width:m.width,height:m.height,term:m.term,modes:m.modes}):y&&y();break;case"window-change":El(i,"window-change")?i.emit("window-change",h,y,{cols:m.cols,rows:m.rows,width:m.width,height:m.height}):y&&y();break;case"x11-req":El(i,"x11")?i.emit("x11",h,y,{single:m.single,protocol:m.protocol,cookie:m.cookie,screen:m.screen}):y&&y();break;case"signal":El(i,"signal")?i.emit("signal",h,y,{name:m.signal}):y&&y();break;case"auth-agent-req@openssh.com":El(i,"auth-agent")?i.emit("auth-agent",h,y):y&&y();break;case"shell":El(i,"shell")?(h=function(){if(!(p||n||a))return p=!0,m.wantReply&&e._sshstream.channelSuccess(s),a=new hc(o,e,{server:!0}),a.subtype=i.subtype=m.request,a},i.emit("shell",h,y)):y&&y();break;case"exec":El(i,"exec")?(h=function(){if(!(p||n||a))return p=!0,m.wantReply&&e._sshstream.channelSuccess(s),a=new hc(o,e,{server:!0}),a.subtype=i.subtype=m.request,a},i.emit("exec",h,y,{command:m.command})):y&&y();break;case"subsystem":h=function(){if(!(p||n||a))if(p=!0,m.wantReply&&e._sshstream.channelSuccess(s),a=new hc(o,e,{server:!0}),a.subtype=i.subtype=m.request+":"+m.subsystem,m.subsystem==="sftp"){var w=new tGs({server:!0,debug:e._sshstream.debug});return a.pipe(w).pipe(a),w}else return a},m.subsystem==="sftp"&&El(i,"sftp")?i.emit("sftp",h,y):m.subsystem!=="sftp"&&El(i,"subsystem")?i.emit("subsystem",h,y,{name:m.subsystem}):y&&y();break;default:y&&y()}}function l(){n=!0,i.emit("eof"),i.emit("end")}function u(){n=!0,i.emit("close")}e._sshstream.on("CHANNEL_REQUEST:"+r,c).once("CHANNEL_EOF:"+r,l).once("CHANNEL_CLOSE:"+r,u)}Q_(W7t,W_);function om(e,t,r,n,i){W_.call(this);var s=this;this.username=this.user=t,this.service=r,this.method=n,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=function(a,o,c){s._finalResponse||(s._finalResponse=!0,i(s,a,o,c))},this._stream=e}Q_(om,W_);om.prototype.accept=function(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)};om.prototype.reject=function(e,t){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,e,t)};var sGs=/[ \t\r\n]*,[ \t\r\n]*/g;function GJ(e,t,r,n,i,s){om.call(this,e,t,r,n,s),this._multistep=!0;var a=this;this._cb=void 0,this._onInfoResponse=function(o){if(a._cb){var c=a._cb;a._cb=void 0,c(o)}},this.submethods=i.split(sGs),this.on("abort",function(){a._cb&&a._cb(new Error("Authentication request aborted"))})}Q_(GJ,om);GJ.prototype._cleanup=function(){this._stream.removeListener("USERAUTH_INFO_RESPONSE",this._onInfoResponse)};GJ.prototype.prompt=function(e,t,r,n){Array.isArray(e)||(e=[e]),typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0);for(var i=0;i<e.length;++i)typeof e[i]=="string"&&(e[i]={prompt:e[i],echo:!0});return this._cb=n,this._initialResponse=!0,this._stream.once("USERAUTH_INFO_RESPONSE",this._onInfoResponse),this._stream.authInfoReq(t,r,e)};function ONe(e,t,r,n,i,s){om.call(this,e,t,r,n,s),this.key={algo:i.keyAlgo,data:i.key},this.signature=i.signature;var a;if(this.signature)switch(i.keyAlgo){case"ssh-rsa":case"ssh-dss":a="sha1";break;case"ssh-ed25519":a=null;break;case"ecdsa-sha2-nistp256":a="sha256";break;case"ecdsa-sha2-nistp384":a="sha384";break;case"ecdsa-sha2-nistp521":a="sha512";break}this.sigAlgo=a,this.blob=i.blob}Q_(ONe,om);ONe.prototype.accept=function(){this.signature?om.prototype.accept.call(this):(this._initialResponse=!0,this._stream.authPKOK(this.key.algo,this.key.data))};function Q7t(e,t,r,n,i,s){om.call(this,e,t,r,n,s),this.key={algo:i.keyAlgo,data:i.key},this.signature=i.signature;var a;if(this.signature)switch(i.keyAlgo){case"ssh-rsa":case"ssh-dss":a="sha1";break;case"ssh-ed25519":a=null;break;case"ecdsa-sha2-nistp256":a="sha256";break;case"ecdsa-sha2-nistp384":a="sha384";break;case"ecdsa-sha2-nistp521":a="sha512";break}this.sigAlgo=a,this.blob=i.blob,this.localHostname=i.localHostname,this.localUsername=i.localUsername}Q_(Q7t,om);function Y7t(e,t,r,n,i,s){om.call(this,e,t,r,n,s),this.password=i}Q_(Y7t,om);function FNe(e,t,r,n){var i=Z7t(e),s=hc.MAX_WINDOW,a=hc.PACKET_SIZE,o=!0;if(i===!1)return n(new Error("No free channels available"));typeof r=="function"&&(n=r,r={}),e._channels[i]=!0;var c=e._sshstream;return c.once("CHANNEL_OPEN_CONFIRMATION:"+i,function(l){c.removeAllListeners("CHANNEL_OPEN_FAILURE:"+i);var u={type:t,incoming:{id:i,window:s,packetSize:a,state:"open"},outgoing:{id:l.sender,window:l.window,packetSize:l.packetSize,state:"open"}};n(void 0,new hc(u,e,{server:!0}))}).once("CHANNEL_OPEN_FAILURE:"+i,function(l){c.removeAllListeners("CHANNEL_OPEN_CONFIRMATION:"+i),delete e._channels[i];var u=new Error("(SSH) Channel open failure: "+l.description);u.reason=l.reason,u.lang=l.lang,n(u)}),t==="forwarded-tcpip"?o=c.forwardedTcpip(i,s,a,r):t==="x11"?o=c.x11(i,s,a,r):t==="forwarded-streamlocal@openssh.com"&&(o=c.openssh_forwardedStreamLocal(i,s,a,r)),o}function Z7t(e){if(e._curChan<K7t)return++e._curChan;for(var t=0,r=e._channels;t<K7t;++t)if(!r[t])return t;return!1}Wo.createServer=function(e,t){return new Wo(e,t)};Wo.KEEPALIVE_INTERVAL=1e3;Wo.KEEPALIVE_CLIENT_INTERVAL=15e3;Wo.KEEPALIVE_CLIENT_COUNT_MAX=3;jNe.exports=Wo;jNe.exports.IncomingClient=Y_});var DNe=g((T2o,dXt)=>{var TN=require("crypto"),aGs=require("net").Socket,oGs=require("dns").lookup,eXt=require("events").EventEmitter,cGs=require("util").inherits,lGs=TN.getHashes(),IN=OJ(),dGs=IN.SSH2Stream,BNe=IN.SFTPStream,WS=IN.constants,uGs=WS.BUGS,qN=WS.ALGORITHMS,mGs=WS.EDDSA_SUPPORTED,fGs=IN.utils.parseKey,tXt=_7t(),Z_=LNe(),UNe=j7t(),pGs=$7t(),$Ne=ix().readUInt32BE,rXt=Math.pow(2,32)-1,HJ=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,nXt=function(e){};function Ba(){if(!(this instanceof Ba))return new Ba;eXt.call(this),this.config={host:void 0,port:void 0,localAddress:void 0,localPort:void 0,forceIPv4:void 0,forceIPv6:void 0,keepaliveCountMax:void 0,keepaliveInterval:void 0,readyTimeout:void 0,username:void 0,password:void 0,privateKey:void 0,tryKeyboard:void 0,agent:void 0,allowAgentFwd:void 0,authHandler:void 0,hostHashAlgo:void 0,hostHashCb:void 0,strictVendor:void 0,debug:void 0},this._readyTimeout=void 0,this._channels=void 0,this._callbacks=void 0,this._forwarding=void 0,this._forwardingUnix=void 0,this._acceptX11=void 0,this._agentFwdEnabled=void 0,this._curChan=void 0,this._remoteVer=void 0,this._sshstream=void 0,this._sock=void 0,this._resetKA=void 0}cGs(Ba,eXt);Ba.prototype.connect=function(e){var t=this;if(this._sock&&this._sock.writable){this.once("close",function(){t.connect(e)}),this.end();return}this.config.host=e.hostname||e.host||"localhost",this.config.port=e.port||22,this.config.localAddress=typeof e.localAddress=="string"?e.localAddress:void 0,this.config.localPort=typeof e.localPort=="string"||typeof e.localPort=="number"?e.localPort:void 0,this.config.forceIPv4=e.forceIPv4||!1,this.config.forceIPv6=e.forceIPv6||!1,this.config.keepaliveCountMax=typeof e.keepaliveCountMax=="number"&&e.keepaliveCountMax>=0?e.keepaliveCountMax:3,this.config.keepaliveInterval=typeof e.keepaliveInterval=="number"&&e.keepaliveInterval>0?e.keepaliveInterval:0,this.config.readyTimeout=typeof e.readyTimeout=="number"&&e.readyTimeout>=0?e.readyTimeout:2e4;var r={kex:void 0,kexBuf:void 0,cipher:void 0,cipherBuf:void 0,serverHostKey:void 0,serverHostKeyBuf:void 0,hmac:void 0,hmacBuf:void 0,compress:void 0,compressBuf:void 0},n;if(typeof e.algorithms=="object"&&e.algorithms!==null){var i,s;if(s=e.algorithms.kex,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_KEX,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported key exchange algorithm: "+s[n]);r.kex=s}if(s=e.algorithms.cipher,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_CIPHER,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported cipher algorithm: "+s[n]);r.cipher=s}if(s=e.algorithms.serverHostKey,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_SERVER_HOST_KEY,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported server host key algorithm: "+s[n]);r.serverHostKey=s}if(s=e.algorithms.hmac,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_HMAC,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported HMAC algorithm: "+s[n]);r.hmac=s}if(s=e.algorithms.compress,Array.isArray(s)&&s.length>0){for(i=qN.SUPPORTED_COMPRESS,n=0;n<s.length;++n)if(i.indexOf(s[n])===-1)throw new Error("Unsupported compression algorithm: "+s[n]);r.compress=s}}if(r.compress===void 0&&(e.compress?(r.compress=["zlib@openssh.com","zlib"],e.compress!=="force"&&r.compress.push("none")):e.compress===!1&&(r.compress=["none"])),typeof e.username=="string")this.config.username=e.username;else if(typeof e.user=="string")this.config.username=e.user;else throw new Error("Invalid username");this.config.password=typeof e.password=="string"?e.password:void 0,this.config.privateKey=typeof e.privateKey=="string"||Buffer.isBuffer(e.privateKey)?e.privateKey:void 0,this.config.localHostname=typeof e.localHostname=="string"&&e.localHostname.length?e.localHostname:void 0,this.config.localUsername=typeof e.localUsername=="string"&&e.localUsername.length?e.localUsername:void 0,this.config.tryKeyboard=e.tryKeyboard===!0,this.config.agent=typeof e.agent=="string"&&e.agent.length?e.agent:void 0,this.config.allowAgentFwd=e.agentForward===!0&&this.config.agent!==void 0;var a=this.config.authHandler=typeof e.authHandler=="function"?e.authHandler:void 0;this.config.strictVendor=typeof e.strictVendor=="boolean"?e.strictVendor:!0;var o=this.config.debug=typeof e.debug=="function"?e.debug:nXt;if(e.agentForward===!0&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");var c=this._callbacks=[];this._channels={},this._forwarding={},this._forwardingUnix={},this._acceptX11=0,this._agentFwdEnabled=!1,this._curChan=-1,this._remoteVer=void 0;var l;if(this.config.privateKey){if(l=fGs(this.config.privateKey,e.passphrase),l instanceof Error)throw new Error("Cannot parse privateKey: "+l.message);if(Array.isArray(l)&&(l=l[0]),l.getPrivatePEM()===null)throw new Error("privateKey value does not contain a (valid) private key")}var u=this._sshstream=new dGs({algorithms:r,debug:o===nXt?void 0:o}),m=this._sock=e.sock||new aGs;this._sock.stderr&&typeof this._sock.stderr.resume=="function"&&this._sock.stderr.resume();var p=this.config.keepaliveInterval,h=this.config.keepaliveCountMax,y=0,w;function v(){if(++y>h){if(clearInterval(w),m.readable){var ct=new Error("Keepalive timeout");ct.level="client-timeout",t.emit("error",ct),m.destroy()}return}m.writable?(c.push(b),u.ping()):clearInterval(w)}function b(){p>0&&(y=0,clearInterval(w),m.writable&&(w=setInterval(v,p)))}if(this._resetKA=b,u.on("USERAUTH_BANNER",function(ct){t.emit("banner",ct)}),m.on("connect",function(){o("DEBUG: Client: Connected"),t.emit("connect"),e.sock||u.pipe(m).pipe(u)}).on("timeout",function(){t.emit("timeout")}).on("error",function(ct){clearTimeout(t._readyTimeout),ct.level="client-socket",t.emit("error",ct)}).on("end",function(){u.unpipe(m),clearTimeout(t._readyTimeout),clearInterval(w),t.emit("end")}).on("close",function(){u.unpipe(m),clearTimeout(t._readyTimeout),clearInterval(w),t.emit("close");var ct=c,ft=new Error("No response from server");for(c=t._callbacks=[],n=0;n<ct.length;++n)ct[n](ft);var ur=t._channels,pt=Object.keys(ur);for(t._channels={},n=0;n<pt.length;++n){var sr=u.emit("CHANNEL_OPEN_FAILURE:"+pt[n],ft),Nr=u.emit("CHANNEL_CLOSE:"+pt[n]),Ue;!sr&&!Nr&&(Ue=ur[pt[n]])&&typeof Ue=="function"&&Ue(ft)}}),u.on("drain",function(){t.emit("drain")}).once("header",function(ct){t._remoteVer=ct.versions.software,ct.greeting&&t.emit("greeting",ct.greeting)}).on("continue",function(){t.emit("continue")}).on("error",function(ct){ct.level===void 0?ct.level="protocol":ct.level==="handshake"&&clearTimeout(t._readyTimeout),t.emit("error",ct)}).on("end",function(){m.resume()}),typeof e.hostVerifier=="function"){if(lGs.indexOf(e.hostHash)===-1)throw new Error("Invalid host hash algorithm: "+e.hostHash);var A=e.hostVerifier,I=TN.createHash(e.hostHash);u.once("fingerprint",function(ct,ft){I.update(ct);var ur=A(I.digest("hex"),ft);ur!==void 0&&ft(ur)})}var R,F=null,J=null,X,H=0,ae=["none"];if(this.config.password!==void 0&&ae.push("password"),l!==void 0&&ae.push("publickey"),this.config.agent!==void 0&&ae.push("agent"),this.config.tryKeyboard&&ae.push("keyboard-interactive"),l!==void 0&&this.config.localHostname!==void 0&&this.config.localUsername!==void 0&&ae.push("hostbased"),a===void 0){var le=0;a=function(ft,ur,pt){return le===ae.length?!1:ae[le++]}}var D=!1;function ie(ct){if(D=!0,ct===!1){u.removeListener("USERAUTH_FAILURE",Ge),u.removeListener("USERAUTH_PK_OK",ee);var ft=new Error("All configured authentication methods failed");ft.level="client-authentication",t.emit("error",ft),u.writable&&t.end();return}if(ae.indexOf(ct)===-1)throw new Error("Authentication method not allowed: "+ct);switch(R=ct,R){case"password":u.authPassword(t.config.username,t.config.password);break;case"publickey":u.authPK(t.config.username,l),u.once("USERAUTH_PK_OK",ee);break;case"hostbased":let pt=function(sr,Nr){var Ue=l.sign(sr);if(Ue instanceof Error)return Ue.message="Error while signing data with privateKey: "+Ue.message,Ue.level="client-authentication",t.emit("error",Ue),re();Nr(Ue)};var ur=pt;u.authHostbased(t.config.username,l,t.config.localHostname,t.config.localUsername,pt);break;case"agent":UNe(t.config.agent,function(sr,Nr){if(sr)return sr.level="agent",t.emit("error",sr),X=void 0,re();if(Nr.length===0)return o("DEBUG: Agent: No keys stored in agent"),X=void 0,re();X=Nr,H=0,u.authPK(t.config.username,Nr[0]),u.once("USERAUTH_PK_OK",ee)});break;case"keyboard-interactive":u.authKeyboard(t.config.username),u.on("USERAUTH_INFO_REQUEST",B);break;case"none":u.authNone(t.config.username);break}}function re(){D=!1;var ct=a(J,F,ie);D||ct===void 0||ie(ct)}function Pe(){if(R==="agent"){if(H>=X.length)return;++H>=X.length?(o("DEBUG: Agent: No more keys left to try"),o("DEBUG: Client: agent auth failed"),X=void 0,re()):(o("DEBUG: Agent: Trying key #"+(H+1)),u.authPK(t.config.username,X[H]),u.once("USERAUTH_PK_OK",ee))}}function B(ct,ft,ur,pt){var sr=Array.isArray(pt)?pt.length:0;if(sr===0)return o("DEBUG: Client: Sending automatic USERAUTH_INFO_RESPONSE"),u.authInfoRes();t.emit("keyboard-interactive",ct,ft,ur,pt,function(Nr){u.authInfoRes(Nr)})}function ee(){if(R==="agent"){var ct=X[H],ft=$Ne(ct,0),ur=ct.toString("ascii",4,4+ft),pt=ur.slice(4);switch(ur){case"ssh-rsa":case"ssh-dss":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":break;default:if(mGs&&ur==="ssh-ed25519")break;return o("DEBUG: Agent: Skipping unsupported key type: "+ur),Pe()}u.authPK(t.config.username,ct,function(sr,Nr){UNe(t.config.agent,ct,pt,sr,function(Ue,Rr){if(Ue)Ue.level="agent",t.emit("error",Ue);else{var z=$Ne(Rr,0);if(4+z+4<Rr.length){var Q=Rr.toString("ascii",4,4+z);if(Q!==ur)Ue=new Error("Agent key/signature type mismatch"),Ue.level="agent",t.emit("error",Ue);else return Nr(Rr.slice(4+z+4))}}Pe()})})}else R==="publickey"&&u.authPK(t.config.username,l,function(sr,Nr){var Ue=l.sign(sr);if(Ue instanceof Error)return Ue.message="Error while signing data with privateKey: "+Ue.message,Ue.level="client-authentication",t.emit("error",Ue),re();Nr(Ue)})}function Ge(ct,ft){if(u.removeListener("USERAUTH_PK_OK",ee),u.removeListener("USERAUTH_INFO_REQUEST",B),R==="agent")return o("DEBUG: Client: Agent key #"+(H+1)+" failed"),Pe();o("DEBUG: Client: "+R+" auth failed"),F=ft,J=ct,re()}if(u.once("USERAUTH_SUCCESS",function(){u.removeListener("USERAUTH_FAILURE",Ge),u.removeListener("USERAUTH_INFO_REQUEST",B),b(),clearTimeout(t._readyTimeout),t.emit("ready")}).on("USERAUTH_FAILURE",Ge),u.once("ready",function(){u.service("ssh-userauth"),u.once("SERVICE_ACCEPT",function(ct){ct==="ssh-userauth"&&re()})}),u.on("CHANNEL_OPEN",function(ct){yGs(t,ct)}),u.on("REQUEST_SUCCESS",function(ct){c.length&&c.shift()(!1,ct)}).on("REQUEST_FAILURE",function(){c.length&&c.shift()(!0)}),u.on("GLOBAL_REQUEST",function(ct,ft,ur){ft&&u.requestFailure()}),e.sock)qt(),u.pipe(m).pipe(u);else{let ct=function(){qt(),t._sock.connect({host:We,port:t.config.port,localAddress:t.config.localAddress,localPort:t.config.localPort}),t._sock.setNoDelay(!0),t._sock.setMaxListeners(0),t._sock.setTimeout(typeof e.timeout=="number"?e.timeout:0)};var er=ct,We=this.config.host,nt=this.config.forceIPv4,Tt=this.config.forceIPv6;o("DEBUG: Client: Trying "+We+" on port "+this.config.port+" ..."),!nt&&!Tt||nt&&Tt?ct():oGs(We,nt?4:6,function(ft,ur,pt){if(ft){var sr=new Error("Error while looking up "+(nt?"IPv4":"IPv6")+" address for host "+We+": "+ft);clearTimeout(t._readyTimeout),sr.level="client-dns",t.emit("error",sr),t.emit("close");return}We=ur,ct()})}function qt(){t.config.readyTimeout>0&&(t._readyTimeout=setTimeout(function(){var ct=new Error("Timed out while waiting for handshake");ct.level="client-timeout",t.emit("error",ct),m.destroy()},t.config.readyTimeout))}};Ba.prototype.end=function(){return this._sock&&this._sock.writable&&this._sshstream&&this._sshstream.writable?this._sshstream.disconnect():!1};Ba.prototype.destroy=function(){this._sock&&this._sock.destroy()};Ba.prototype.exec=function(e,t,r){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");typeof t=="function"&&(r=t,t={});var n=this,i={allowHalfOpen:t.allowHalfOpen!==!1};return sx(this,"session",i,function(s,a){if(s)return r(s);var o=[];function c(l){if(l)return a.close(),r(l);o.length&&o.shift()()}(n.config.allowAgentFwd===!0||t&&t.agentForward===!0&&n.config.agent!==void 0)&&o.push(function(){oXt(a,c)}),typeof t=="object"&&t!==null&&(typeof t.env=="object"&&t.env!==null&&cXt(a,t.env),(typeof t.pty=="object"&&t.pty!==null||t.pty===!0)&&o.push(function(){aXt(a,t.pty,c)}),(typeof t.x11=="object"&&t.x11!==null||t.x11==="number"||t.x11===!0)&&o.push(function(){sXt(a,t.x11,c)})),o.push(function(){hGs(a,e,t,r)}),o.shift()()})};Ba.prototype.shell=function(e,t,r){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var n=this;return typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),e&&(e.x11!==void 0||e.env!==void 0)&&(t=e,e=void 0),sx(this,"session",function(i,s){if(i)return r(i);var a=[];function o(c){if(c)return s.close(),r(c);a.length&&a.shift()()}(n.config.allowAgentFwd===!0||t&&t.agentForward===!0&&n.config.agent!==void 0)&&a.push(function(){oXt(s,o)}),e!==!1&&a.push(function(){aXt(s,e,o)}),typeof t=="object"&&t!==null&&(typeof t.env=="object"&&t.env!==null&&cXt(s,t.env),(typeof t.x11=="object"&&t.x11!==null||t.x11==="number"||t.x11===!0)&&a.push(function(){sXt(s,t.x11,o)})),a.push(function(){gGs(s,r)}),a.shift()()})};Ba.prototype.subsys=function(e,t){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");return sx(this,"session",function(r,n){if(r)return t(r);lXt(n,e,function(i,s){if(i)return t(i);t(void 0,s)})})};Ba.prototype.sftp=function(e){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var t=this;return sx(this,"session",function(r,n){if(r)return e(r);lXt(n,"sftp",function(i,s){if(i)return e(i);var a=t._sshstream._state.incoming.identRaw,o={debug:t.config.debug},c=new BNe(o,a);function l(p){c.removeListener("ready",u),s.removeListener("exit",m),e(p)}function u(){c.removeListener("error",l),s.removeListener("exit",m),e(void 0,new pGs(c))}function m(p,h){c.removeListener("ready",u),c.removeListener("error",l);var y;typeof p=="number"?y="Received exit code "+p+" while establishing SFTP session":y="Received signal "+h+" while establishing SFTP session";var w=new Error(y);w.code=p,w.signal=h,e(w)}c.once("error",l).once("ready",u).once("close",function(){s.end()}),s.once("exit",m),c.pipe(s).pipe(c)})})};Ba.prototype.forwardIn=function(e,t,r){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var n=this,i=typeof r=="function";return i&&this._callbacks.push(function(s,a){if(s)return r(s!==!0?s:new Error("Unable to bind to "+e+":"+t));var o=t;t===0&&a&&a.length>=4&&(o=$Ne(a,0),n._sshstream.remoteBugs&uGs.DYN_RPORT_BUG||(t=o)),n._forwarding[e+":"+t]=o,r(void 0,o)}),this._sshstream.tcpipForward(e,t,i)};Ba.prototype.unforwardIn=function(e,t,r){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var n=this,i=typeof r=="function";return i&&this._callbacks.push(function(s){if(s)return r(s!==!0?s:new Error("Unable to unbind from "+e+":"+t));delete n._forwarding[e+":"+t],r()}),this._sshstream.cancelTcpipForward(e,t,i)};Ba.prototype.forwardOut=function(e,t,r,n,i){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var s={srcIP:e,srcPort:t,dstIP:r,dstPort:n};return sx(this,"direct-tcpip",s,i)};Ba.prototype.openssh_noMoreSessions=function(e){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var t=typeof e=="function";return!this.config.strictVendor||this.config.strictVendor&&HJ.test(this._remoteVer)?(t&&this._callbacks.push(function(r){if(r)return e(r!==!0?r:new Error("Unable to disable future sessions"));e()}),this._sshstream.openssh_noMoreSessions(t)):(t&&process.nextTick(function(){e(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}),!0)};Ba.prototype.openssh_forwardInStreamLocal=function(e,t){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var r=typeof t=="function",n=this;return!this.config.strictVendor||this.config.strictVendor&&HJ.test(this._remoteVer)?(r&&this._callbacks.push(function(i){if(i)return t(i!==!0?i:new Error("Unable to bind to "+e));n._forwardingUnix[e]=!0,t()}),this._sshstream.openssh_streamLocalForward(e,r)):(r&&process.nextTick(function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}),!0)};Ba.prototype.openssh_unforwardInStreamLocal=function(e,t){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");var r=typeof t=="function",n=this;return!this.config.strictVendor||this.config.strictVendor&&HJ.test(this._remoteVer)?(r&&this._callbacks.push(function(i){if(i)return t(i!==!0?i:new Error("Unable to unbind on "+e));delete n._forwardingUnix[e],t()}),this._sshstream.openssh_cancelStreamLocalForward(e,r)):(r&&process.nextTick(function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}),!0)};Ba.prototype.openssh_forwardOutStreamLocal=function(e,t){if(!this._sock||!this._sock.writable||!this._sshstream||!this._sshstream.writable)throw new Error("Not connected");if(!this.config.strictVendor||this.config.strictVendor&&HJ.test(this._remoteVer)){var r={socketPath:e};return sx(this,"direct-streamlocal@openssh.com",r,t)}else process.nextTick(function(){t(new Error("strictVendor enabled and server is not OpenSSH or compatible version"))});return!0};function sx(e,t,r,n){var i=iXt(e),s=Z_.MAX_WINDOW,a=Z_.PACKET_SIZE,o=!0;if(i===!1)return n(new Error("No free channels available"));typeof r=="function"&&(n=r,r={}),e._channels[i]=n;var c=e._sshstream;return c.once("CHANNEL_OPEN_CONFIRMATION:"+i,l).once("CHANNEL_OPEN_FAILURE:"+i,u).once("CHANNEL_CLOSE:"+i,u),t==="session"?o=c.session(i,s,a):t==="direct-tcpip"?o=c.directTcpip(i,s,a,r):t==="direct-streamlocal@openssh.com"&&(o=c.openssh_directStreamLocal(i,s,a,r)),o;function l(m){c.removeListener("CHANNEL_OPEN_FAILURE:"+i,u),c.removeListener("CHANNEL_CLOSE:"+i,u);var p={type:t,incoming:{id:i,window:s,packetSize:a,state:"open"},outgoing:{id:m.sender,window:m.window,packetSize:m.packetSize,state:"open"}};n(void 0,new Z_(p,e))}function u(m){c.removeListener("CHANNEL_OPEN_CONFIRMATION:"+i,l),c.removeListener("CHANNEL_OPEN_FAILURE:"+i,u),c.removeListener("CHANNEL_CLOSE:"+i,u),delete e._channels[i];var p;m instanceof Error?p=m:typeof m=="object"&&m!==null?(p=new Error("(SSH) Channel open failure: "+m.description),p.reason=m.reason,p.lang=m.lang):(p=new Error("(SSH) Channel open failure: server closed channel unexpectedly"),p.reason=p.lang=""),n(p)}}function iXt(e){if(e._curChan<rXt)return++e._curChan;for(var t=0,r=e._channels;t<rXt;++t)if(!r[t])return t;return!1}function sXt(e,t,r){var n={single:!1,protocol:"MIT-MAGIC-COOKIE-1",cookie:void 0,screen:0};typeof t=="function"?r=t:typeof t=="object"&&t!==null&&(typeof t.single=="boolean"&&(n.single=t.single),typeof t.screen=="number"&&(n.screen=t.screen),typeof t.protocol=="string"&&(n.protocol=t.protocol),typeof t.cookie=="string"?n.cookie=t.cookie:Buffer.isBuffer(t.cookie)&&(n.cookie=t.cookie.toString("hex"))),n.cookie===void 0&&(n.cookie=wGs());var i=typeof r=="function";return e.outgoing.state!=="open"?(i&&r(new Error("Channel is not open")),!0):(i&&e._callbacks.push(function(s){if(s)return r(s!==!0?s:new Error("Unable to request X11"));e._hasX11=!0,++e._client._acceptX11,e.once("close",function(){e._client._acceptX11&&--e._client._acceptX11}),r()}),e._client._sshstream.x11Forward(e.outgoing.id,n,i))}function aXt(e,t,r){var n=24,i=80,s=640,a=480,o="vt100",c=null;typeof t=="function"?r=t:typeof t=="object"&&t!==null&&(typeof t.rows=="number"&&(n=t.rows),typeof t.cols=="number"&&(i=t.cols),typeof t.width=="number"&&(s=t.width),typeof t.height=="number"&&(a=t.height),typeof t.term=="string"&&(o=t.term),typeof t.modes=="object"&&(c=t.modes));var l=typeof r=="function";return e.outgoing.state!=="open"?(l&&r(new Error("Channel is not open")),!0):(l&&e._callbacks.push(function(u){if(u)return r(u!==!0?u:new Error("Unable to request a pseudo-terminal"));r()}),e._client._sshstream.pty(e.outgoing.id,n,i,a,s,o,c,l))}function oXt(e,t){var r=typeof t=="function";return e.outgoing.state!=="open"?(r&&t(new Error("Channel is not open")),!0):e._client._agentFwdEnabled?(r&&t(!1),!0):(e._client._agentFwdEnabled=!0,e._callbacks.push(function(n){if(n){e._client._agentFwdEnabled=!1,r&&t(n!==!0?n:new Error("Unable to request agent forwarding"));return}r&&t()}),e._client._sshstream.openssh_agentForward(e.outgoing.id,!0))}function gGs(e,t){return e.outgoing.state!=="open"?(t(new Error("Channel is not open")),!0):(e._callbacks.push(function(r){if(r)return t(r!==!0?r:new Error("Unable to open shell"));e.subtype="shell",t(void 0,e)}),e._client._sshstream.shell(e.outgoing.id,!0))}function hGs(e,t,r,n){return e.outgoing.state!=="open"?(n(new Error("Channel is not open")),!0):(e._callbacks.push(function(i){if(i)return n(i!==!0?i:new Error("Unable to exec"));e.subtype="exec",e.allowHalfOpen=r.allowHalfOpen!==!1,n(void 0,e)}),e._client._sshstream.exec(e.outgoing.id,t,!0))}function cXt(e,t){if(e.outgoing.state!=="open")return!0;for(var r=!0,n=Object.keys(t||{}),i,s,a=0,o=n.length;a<o;++a)i=n[a],s=t[i],r=e._client._sshstream.env(e.outgoing.id,i,s,!1);return r}function lXt(e,t,r){return e.outgoing.state!=="open"?(r(new Error("Channel is not open")),!0):(e._callbacks.push(function(n){if(n)return r(n!==!0?n:new Error("Unable to start subsystem: "+t));e.subtype="subsystem",r(void 0,e)}),e._client._sshstream.subsystem(e.outgoing.id,t,!0))}function yGs(e,t){var r=!1,n;function i(){var o={type:t.type,incoming:{id:r,window:Z_.MAX_WINDOW,packetSize:Z_.PACKET_SIZE,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},c=new Z_(o,e);return e._sshstream.channelOpenConfirm(t.sender,r,Z_.MAX_WINDOW,Z_.PACKET_SIZE),c}function s(){n===void 0&&(r===!1?n=WS.CHANNEL_OPEN_FAILURE.RESOURCE_SHORTAGE:n=WS.CHANNEL_OPEN_FAILURE.CONNECT_FAILED),e._sshstream.channelOpenFail(t.sender,n,"","")}if(t.type==="forwarded-tcpip"||t.type==="x11"||t.type==="auth-agent@openssh.com"||t.type==="forwarded-streamlocal@openssh.com"){var a=t.type==="forwarded-tcpip"&&e._forwarding[t.data.destIP+":"+t.data.destPort]===void 0||t.type==="forwarded-streamlocal@openssh.com"&&e._forwardingUnix[t.data.socketPath]===void 0||t.type==="x11"&&e._acceptX11===0||t.type==="auth-agent@openssh.com"&&!e._agentFwdEnabled;a?(n=WS.CHANNEL_OPEN_FAILURE.ADMINISTRATIVELY_PROHIBITED,e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: unexpected channel open for: "+t.type)):(r=iXt(e),r===!1?(e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: no channels available"),a=!0):e._channels[r]=!0),a&&s(),r!==!1&&(t.type==="forwarded-tcpip"?(t.data.destPort===0&&(t.data.destPort=e._forwarding[t.data.destIP+":"+t.data.destPort]),e.emit("tcp connection",t.data,i,s)):t.type==="x11"?e.emit("x11",t.data,i,s):t.type==="forwarded-streamlocal@openssh.com"?e.emit("unix connection",t.data,i,s):UNe(e.config.agent,i,s))}else e.config.debug("DEBUG: Client: Automatic rejection of incoming channel open: unsupported type: "+t.type),n=WS.CHANNEL_OPEN_FAILURE.UNKNOWN_CHANNEL_TYPE,s()}var wGs=function(){if(typeof TN.randomFillSync=="function"){var e=Buffer.alloc(16);return function(){return TN.randomFillSync(e,0,16),e.toString("hex")}}else return function(){return TN.randomBytes(16).toString("hex")}}();Ba.Client=Ba;Ba.Server=J7t();Ba.utils=IN.utils;Ba.SFTP_STATUS_CODE=BNe.STATUS_CODE;Ba.SFTP_OPEN_MODE=BNe.OPEN_MODE;Ba.HTTPAgent=tXt.SSHTTPAgent;Ba.HTTPSAgent=tXt.SSHTTPSAgent;dXt.exports=Ba});var mXt=g((I2o,uXt)=>{var vGs=DNe().Client,_Gs=require("http");uXt.exports=function(e){var t=new vGs,r=new _Gs.Agent;return r.createConnection=function(n,i){t.once("ready",function(){t.exec("docker system dial-stdio",function(s,a){if(s){t.end(),r.destroy();return}i(null,a),a.once("close",()=>{t.end(),r.destroy()})})}).connect(e),t.once("end",()=>r.destroy())},r}});var GNe=g((q2o,fXt)=>{fXt.exports=require("stream")});var yXt=g((D2o,hXt)=>{"use strict";function pXt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bGs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pXt(Object(r),!0).forEach(function(n){SGs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pXt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SGs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CGs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gXt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function EGs(e,t,r){return t&&gXt(e.prototype,t),r&&gXt(e,r),e}var AGs=require("buffer"),VJ=AGs.Buffer,PGs=require("util"),HNe=PGs.inspect,xGs=HNe&&HNe.custom||"inspect";function RGs(e,t,r){VJ.prototype.copy.call(e,t,r)}hXt.exports=function(){function e(){CGs(this,e),this.head=null,this.tail=null,this.length=0}return EGs(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return VJ.alloc(0);for(var n=VJ.allocUnsafe(r>>>0),i=this.head,s=0;i;)RGs(i.data,n,s),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,s=n.data;for(r-=s.length;n=n.next;){var a=n.data,o=r>a.length?a.length:r;if(o===a.length?s+=a:s+=a.slice(0,r),r-=o,r===0){o===a.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(o));break}++i}return this.length-=i,s}},{key:"_getBuffer",value:function(r){var n=VJ.allocUnsafe(r),i=this.head,s=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var a=i.data,o=r>a.length?a.length:r;if(a.copy(n,n.length-r,0,o),r-=o,r===0){o===a.length?(++s,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(o));break}++s}return this.length-=s,n}},{key:xGs,value:function(r,n){return HNe(this,bGs({},n,{depth:0,customInspect:!1}))}}]),e}()});var XNe=g((N2o,vXt)=>{"use strict";function kGs(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(VNe,this,e)):process.nextTick(VNe,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(XJ,r):(r._writableState.errorEmitted=!0,process.nextTick(wXt,r,s)):process.nextTick(wXt,r,s):t?(process.nextTick(XJ,r),t(s)):process.nextTick(XJ,r)}),this)}function wXt(e,t){VNe(e,t),XJ(e)}function XJ(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function TGs(){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 VNe(e,t){e.emit("error",t)}function IGs(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}vXt.exports={destroy:kGs,undestroy:TGs,errorOrDestroy:IGs}});var J_=g((L2o,SXt)=>{"use strict";var _Xt={};function xf(e,t,r){r||(r=Error);function n(s,a,o){return typeof t=="string"?t:t(s,a,o)}class i extends r{constructor(a,o,c){super(n(a,o,c))}}i.prototype.name=r.name,i.prototype.code=e,_Xt[e]=i}function bXt(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function qGs(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function DGs(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function NGs(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}xf("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);xf("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&qGs(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(DGs(e," argument"))i=`The ${e} ${n} ${bXt(t,"type")}`;else{let s=NGs(e,".")?"property":"argument";i=`The "${e}" ${s} ${n} ${bXt(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);xf("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");xf("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});xf("ERR_STREAM_PREMATURE_CLOSE","Premature close");xf("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});xf("ERR_MULTIPLE_CALLBACK","Callback called multiple times");xf("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");xf("ERR_STREAM_WRITE_AFTER_END","write after end");xf("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);xf("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);xf("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");SXt.exports.codes=_Xt});var KNe=g((M2o,CXt)=>{"use strict";var LGs=J_().codes.ERR_INVALID_OPT_VALUE;function MGs(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function zGs(e,t,r,n){var i=MGs(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new LGs(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}CXt.exports={getHighWaterMark:zGs}});var KJ=g((z2o,EXt)=>{EXt.exports=require("util").deprecate});var YNe=g((O2o,TXt)=>{"use strict";TXt.exports=qo;function AXt(e){var t=this;this.next=null,this.entry=null,this.finish=function(){d6s(t,e)}}var ax;qo.WritableState=DN;var OGs={deprecate:KJ()},PXt=GNe(),WJ=require("buffer").Buffer,FGs=global.Uint8Array||function(){};function jGs(e){return WJ.from(e)}function BGs(e){return WJ.isBuffer(e)||e instanceof FGs}var WNe=XNe(),UGs=KNe(),$Gs=UGs.getHighWaterMark,e0=J_().codes,GGs=e0.ERR_INVALID_ARG_TYPE,HGs=e0.ERR_METHOD_NOT_IMPLEMENTED,VGs=e0.ERR_MULTIPLE_CALLBACK,XGs=e0.ERR_STREAM_CANNOT_PIPE,KGs=e0.ERR_STREAM_DESTROYED,WGs=e0.ERR_STREAM_NULL_VALUES,QGs=e0.ERR_STREAM_WRITE_AFTER_END,YGs=e0.ERR_UNKNOWN_ENCODING,ox=WNe.errorOrDestroy;oc()(qo,PXt);function ZGs(){}function DN(e,t,r){ax=ax||QS(),e=e||{},typeof r!="boolean"&&(r=t instanceof ax),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=$Gs(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){s6s(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new AXt(this)}DN.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(DN.prototype,"buffer",{get:OGs.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}})();var QJ;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(QJ=Function.prototype[Symbol.hasInstance],Object.defineProperty(qo,Symbol.hasInstance,{value:function(t){return QJ.call(this,t)?!0:this!==qo?!1:t&&t._writableState instanceof DN}})):QJ=function(t){return t instanceof this};function qo(e){ax=ax||QS();var t=this instanceof ax;if(!t&&!QJ.call(qo,this))return new qo(e);this._writableState=new DN(e,this,t),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)),PXt.call(this)}qo.prototype.pipe=function(){ox(this,new XGs)};function JGs(e,t){var r=new QGs;ox(e,r),process.nextTick(t,r)}function e6s(e,t,r,n){var i;return r===null?i=new WGs:typeof r!="string"&&!t.objectMode&&(i=new GGs("chunk",["string","Buffer"],r)),i?(ox(e,i),process.nextTick(n,i),!1):!0}qo.prototype.write=function(e,t,r){var n=this._writableState,i=!1,s=!n.objectMode&&BGs(e);return s&&!WJ.isBuffer(e)&&(e=jGs(e)),typeof t=="function"&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=ZGs),n.ending?JGs(this,r):(s||e6s(this,n,e,r))&&(n.pendingcb++,i=r6s(this,n,s,e,t,r)),i};qo.prototype.cork=function(){this._writableState.corked++};qo.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&RXt(this,e))};qo.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 YGs(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(qo.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function t6s(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=WJ.from(t,r)),t}Object.defineProperty(qo.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function r6s(e,t,r,n,i,s){if(!r){var a=t6s(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var o=t.objectMode?1:n.length;t.length+=o;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else QNe(e,t,!1,o,n,i,s);return c}function QNe(e,t,r,n,i,s,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new KGs("write")):r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function n6s(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(NN,e,t),e._writableState.errorEmitted=!0,ox(e,n)):(i(n),e._writableState.errorEmitted=!0,ox(e,n),NN(e,t))}function i6s(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function s6s(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new VGs;if(i6s(r),t)n6s(e,r,n,t,i);else{var s=kXt(r)||e.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&RXt(e,r),n?process.nextTick(xXt,e,r,s,i):xXt(e,r,s,i)}}function xXt(e,t,r,n){r||a6s(e,t),t.pendingcb--,n(),NN(e,t)}function a6s(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function RXt(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,o=!0;r;)i[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;i.allBuffers=o,QNe(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new AXt(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,u=r.callback,m=t.objectMode?1:c.length;if(QNe(e,t,!1,m,c,l,u),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}qo.prototype._write=function(e,t,r){r(new HGs("_write()"))};qo.prototype._writev=null;qo.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||l6s(this,n,r),this};Object.defineProperty(qo.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function kXt(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function o6s(e,t){e._final(function(r){t.pendingcb--,r&&ox(e,r),t.prefinished=!0,e.emit("prefinish"),NN(e,t)})}function c6s(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(o6s,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function NN(e,t){var r=kXt(t);if(r&&(c6s(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function l6s(e,t,r){t.ending=!0,NN(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function d6s(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(qo.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){!this._writableState||(this._writableState.destroyed=t)}});qo.prototype.destroy=WNe.destroy;qo.prototype._undestroy=WNe.undestroy;qo.prototype._destroy=function(e,t){t(e)}});var QS=g((F2o,qXt)=>{"use strict";var u6s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};qXt.exports=rh;var IXt=eLe(),ZNe=YNe();oc()(rh,IXt);for(JNe=u6s(ZNe.prototype),YJ=0;YJ<JNe.length;YJ++)ZJ=JNe[YJ],rh.prototype[ZJ]||(rh.prototype[ZJ]=ZNe.prototype[ZJ]);var JNe,ZJ,YJ;function rh(e){if(!(this instanceof rh))return new rh(e);IXt.call(this,e),ZNe.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",m6s)))}Object.defineProperty(rh.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(rh.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(rh.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function m6s(){this._writableState.ended||process.nextTick(f6s,this)}function f6s(e){e.end()}Object.defineProperty(rh.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var JJ=g((j2o,LXt)=>{"use strict";var DXt=J_().codes.ERR_STREAM_PREMATURE_CLOSE;function p6s(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function g6s(){}function h6s(e){return e.setHeader&&typeof e.abort=="function"}function NXt(e,t,r){if(typeof t=="function")return NXt(e,null,t);t||(t={}),r=p6s(r||g6s);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||o()},a=e._writableState&&e._writableState.finished,o=function(){i=!1,a=!0,n||r.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){n=!1,c=!0,i||r.call(e)},u=function(y){r.call(e,y)},m=function(){var y;if(n&&!c)return(!e._readableState||!e._readableState.ended)&&(y=new DXt),r.call(e,y);if(i&&!a)return(!e._writableState||!e._writableState.ended)&&(y=new DXt),r.call(e,y)},p=function(){e.req.on("finish",o)};return h6s(e)?(e.on("complete",o),e.on("abort",m),e.req?p():e.on("request",p)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",l),e.on("finish",o),t.error!==!1&&e.on("error",u),e.on("close",m),function(){e.removeListener("complete",o),e.removeListener("abort",m),e.removeListener("request",p),e.req&&e.req.removeListener("finish",o),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",o),e.removeListener("end",l),e.removeListener("error",u),e.removeListener("close",m)}}LXt.exports=NXt});var zXt=g((B2o,MXt)=>{"use strict";var eee;function t0(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var y6s=JJ(),r0=Symbol("lastResolve"),YS=Symbol("lastReject"),LN=Symbol("error"),tee=Symbol("ended"),ZS=Symbol("lastPromise"),tLe=Symbol("handlePromise"),JS=Symbol("stream");function n0(e,t){return{value:e,done:t}}function w6s(e){var t=e[r0];if(t!==null){var r=e[JS].read();r!==null&&(e[ZS]=null,e[r0]=null,e[YS]=null,t(n0(r,!1)))}}function v6s(e){process.nextTick(w6s,e)}function _6s(e,t){return function(r,n){e.then(function(){if(t[tee]){r(n0(void 0,!0));return}t[tLe](r,n)},n)}}var b6s=Object.getPrototypeOf(function(){}),S6s=Object.setPrototypeOf((eee={get stream(){return this[JS]},next:function(){var t=this,r=this[LN];if(r!==null)return Promise.reject(r);if(this[tee])return Promise.resolve(n0(void 0,!0));if(this[JS].destroyed)return new Promise(function(a,o){process.nextTick(function(){t[LN]?o(t[LN]):a(n0(void 0,!0))})});var n=this[ZS],i;if(n)i=new Promise(_6s(n,this));else{var s=this[JS].read();if(s!==null)return Promise.resolve(n0(s,!1));i=new Promise(this[tLe])}return this[ZS]=i,i}},t0(eee,Symbol.asyncIterator,function(){return this}),t0(eee,"return",function(){var t=this;return new Promise(function(r,n){t[JS].destroy(null,function(i){if(i){n(i);return}r(n0(void 0,!0))})})}),eee),b6s),C6s=function(t){var r,n=Object.create(S6s,(r={},t0(r,JS,{value:t,writable:!0}),t0(r,r0,{value:null,writable:!0}),t0(r,YS,{value:null,writable:!0}),t0(r,LN,{value:null,writable:!0}),t0(r,tee,{value:t._readableState.endEmitted,writable:!0}),t0(r,tLe,{value:function(s,a){var o=n[JS].read();o?(n[ZS]=null,n[r0]=null,n[YS]=null,s(n0(o,!1))):(n[r0]=s,n[YS]=a)},writable:!0}),r));return n[ZS]=null,y6s(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=n[YS];s!==null&&(n[ZS]=null,n[r0]=null,n[YS]=null,s(i)),n[LN]=i;return}var a=n[r0];a!==null&&(n[ZS]=null,n[r0]=null,n[YS]=null,a(n0(void 0,!0))),n[tee]=!0}),t.on("readable",v6s.bind(null,n)),n};MXt.exports=C6s});var BXt=g((U2o,jXt)=>{"use strict";function OXt(e,t,r,n,i,s,a){try{var o=e[s](a),c=o.value}catch(l){r(l);return}o.done?t(c):Promise.resolve(c).then(n,i)}function E6s(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var s=e.apply(t,r);function a(c){OXt(s,n,i,a,o,"next",c)}function o(c){OXt(s,n,i,a,o,"throw",c)}a(void 0)})}}function FXt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function A6s(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FXt(Object(r),!0).forEach(function(n){P6s(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FXt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function P6s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x6s=J_().codes.ERR_INVALID_ARG_TYPE;function R6s(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new x6s("iterable",["Iterable"],t);var i=new e(A6s({objectMode:!0},r)),s=!1;i._read=function(){s||(s=!0,a())};function a(){return o.apply(this,arguments)}function o(){return o=E6s(function*(){try{var c=yield n.next(),l=c.value,u=c.done;u?i.push(null):i.push(yield l)?a():s=!1}catch(m){i.destroy(m)}}),o.apply(this,arguments)}return i}jXt.exports=R6s});var eLe=g((G2o,YXt)=>{"use strict";YXt.exports=Ks;var cx;Ks.ReadableState=$Xt;var $2o=require("events").EventEmitter,UXt=function(t,r){return t.listeners(r).length},MN=GNe(),ree=require("buffer").Buffer,k6s=global.Uint8Array||function(){};function T6s(e){return ree.from(e)}function I6s(e){return ree.isBuffer(e)||e instanceof k6s}var rLe=require("util"),_s;rLe&&rLe.debuglog?_s=rLe.debuglog("stream"):_s=function(){};var q6s=yXt(),nLe=XNe(),D6s=KNe(),N6s=D6s.getHighWaterMark,nee=J_().codes,L6s=nee.ERR_INVALID_ARG_TYPE,M6s=nee.ERR_STREAM_PUSH_AFTER_EOF,z6s=nee.ERR_METHOD_NOT_IMPLEMENTED,O6s=nee.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,lx,iLe,sLe;oc()(Ks,MN);var zN=nLe.errorOrDestroy,aLe=["error","close","destroy","pause","resume"];function F6s(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function $Xt(e,t,r){cx=cx||QS(),e=e||{},typeof r!="boolean"&&(r=t instanceof cx),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=N6s(this,e,"readableHighWaterMark",r),this.buffer=new q6s,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.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(lx||(lx=require("string_decoder/").StringDecoder),this.decoder=new lx(e.encoding),this.encoding=e.encoding)}function Ks(e){if(cx=cx||QS(),!(this instanceof Ks))return new Ks(e);var t=this instanceof cx;this._readableState=new $Xt(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),MN.call(this)}Object.defineProperty(Ks.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){!this._readableState||(this._readableState.destroyed=t)}});Ks.prototype.destroy=nLe.destroy;Ks.prototype._undestroy=nLe.undestroy;Ks.prototype._destroy=function(e,t){t(e)};Ks.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=ree.from(e,t),t=""),n=!0),GXt(this,e,t,!1,n)};Ks.prototype.unshift=function(e){return GXt(this,e,null,!0,!1)};function GXt(e,t,r,n,i){_s("readableAddChunk",t);var s=e._readableState;if(t===null)s.reading=!1,U6s(e,s);else{var a;if(i||(a=j6s(s,t)),a)zN(e,a);else if(s.objectMode||t&&t.length>0)if(typeof t!="string"&&!s.objectMode&&Object.getPrototypeOf(t)!==ree.prototype&&(t=T6s(t)),n)s.endEmitted?zN(e,new O6s):oLe(e,s,t,!0);else if(s.ended)zN(e,new M6s);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||t.length!==0?oLe(e,s,t,!1):cLe(e,s)):oLe(e,s,t,!1)}else n||(s.reading=!1,cLe(e,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function oLe(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&iee(e)),cLe(e,t)}function j6s(e,t){var r;return!I6s(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new L6s("chunk",["string","Buffer","Uint8Array"],t)),r}Ks.prototype.isPaused=function(){return this._readableState.flowing===!1};Ks.prototype.setEncoding=function(e){lx||(lx=require("string_decoder/").StringDecoder);var t=new lx(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var HXt=1073741824;function B6s(e){return e>=HXt?e=HXt:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function VXt(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=B6s(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Ks.prototype.read=function(e){_s("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return _s("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?dLe(this):iee(this),null;if(e=VXt(e,t),e===0&&t.ended)return t.length===0&&dLe(this),null;var n=t.needReadable;_s("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,_s("length less than watermark",n)),t.ended||t.reading?(n=!1,_s("reading or ended",n)):n&&(_s("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=VXt(r,t)));var i;return e>0?i=WXt(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&dLe(this)),i!==null&&this.emit("data",i),i};function U6s(e,t){if(_s("onEofChunk"),!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,t.sync?iee(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,XXt(e)))}}function iee(e){var t=e._readableState;_s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(_s("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(XXt,e))}function XXt(e){var t=e._readableState;_s("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,lLe(e)}function cLe(e,t){t.readingMore||(t.readingMore=!0,process.nextTick($6s,e,t))}function $6s(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(_s("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Ks.prototype._read=function(e){zN(this,new z6s("_read()"))};Ks.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,_s("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,s=i?o:w;n.endEmitted?process.nextTick(s):r.once("end",s),e.on("unpipe",a);function a(v,b){_s("onunpipe"),v===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,u())}function o(){_s("onend"),e.end()}var c=G6s(r);e.on("drain",c);var l=!1;function u(){_s("cleanup"),e.removeListener("close",h),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",w),r.removeListener("data",m),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}r.on("data",m);function m(v){_s("ondata");var b=e.write(v);_s("dest.write",b),b===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&QXt(n.pipes,e)!==-1)&&!l&&(_s("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(v){_s("onerror",v),w(),e.removeListener("error",p),UXt(e,"error")===0&&zN(e,v)}F6s(e,"error",p);function h(){e.removeListener("finish",y),w()}e.once("close",h);function y(){_s("onfinish"),e.removeListener("close",h),w()}e.once("finish",y);function w(){_s("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(_s("pipe resume"),r.resume()),e};function G6s(e){return function(){var r=e._readableState;_s("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&UXt(e,"data")&&(r.flowing=!0,lLe(e))}}Ks.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 n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=QXt(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Ks.prototype.on=function(e,t){var r=MN.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,_s("on readable",n.length,n.reading),n.length?iee(this):n.reading||process.nextTick(H6s,this)),r};Ks.prototype.addListener=Ks.prototype.on;Ks.prototype.removeListener=function(e,t){var r=MN.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(KXt,this),r};Ks.prototype.removeAllListeners=function(e){var t=MN.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(KXt,this),t};function KXt(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function H6s(e){_s("readable nexttick read 0"),e.read(0)}Ks.prototype.resume=function(){var e=this._readableState;return e.flowing||(_s("resume"),e.flowing=!e.readableListening,V6s(this,e)),e.paused=!1,this};function V6s(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(X6s,e,t))}function X6s(e,t){_s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),lLe(e),t.flowing&&!t.reading&&e.read(0)}Ks.prototype.pause=function(){return _s("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function lLe(e){var t=e._readableState;for(_s("flow",t.flowing);t.flowing&&e.read()!==null;);}Ks.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(_s("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(_s("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var o=t.push(a);o||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(o){return function(){return e[o].apply(e,arguments)}}(i));for(var s=0;s<aLe.length;s++)e.on(aLe[s],this.emit.bind(this,aLe[s]));return this._read=function(a){_s("wrapped _read",a),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Ks.prototype[Symbol.asyncIterator]=function(){return iLe===void 0&&(iLe=zXt()),iLe(this)});Object.defineProperty(Ks.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Ks.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Ks.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Ks._fromList=WXt;Object.defineProperty(Ks.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function WXt(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.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function dLe(e){var t=e._readableState;_s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(K6s,t,e))}function K6s(e,t){if(_s("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Ks.from=function(e,t){return sLe===void 0&&(sLe=BXt()),sLe(Ks,e,t)});function QXt(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var uLe=g((H2o,JXt)=>{"use strict";JXt.exports=vw;var see=J_().codes,W6s=see.ERR_METHOD_NOT_IMPLEMENTED,Q6s=see.ERR_MULTIPLE_CALLBACK,Y6s=see.ERR_TRANSFORM_ALREADY_TRANSFORMING,Z6s=see.ERR_TRANSFORM_WITH_LENGTH_0,aee=QS();oc()(vw,aee);function J6s(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Q6s);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function vw(e){if(!(this instanceof vw))return new vw(e);aee.call(this,e),this._transformState={afterTransform:J6s.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",e4s)}function e4s(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){ZXt(e,t,r)}):ZXt(this,null,null)}vw.prototype.push=function(e,t){return this._transformState.needTransform=!1,aee.prototype.push.call(this,e,t)};vw.prototype._transform=function(e,t,r){r(new W6s("_transform()"))};vw.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};vw.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};vw.prototype._destroy=function(e,t){aee.prototype._destroy.call(this,e,function(r){t(r)})};function ZXt(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Z6s;if(e._transformState.transforming)throw new Y6s;return e.push(null)}});var rKt=g((V2o,tKt)=>{"use strict";tKt.exports=ON;var eKt=uLe();oc()(ON,eKt);function ON(e){if(!(this instanceof ON))return new ON(e);eKt.call(this,e)}ON.prototype._transform=function(e,t,r){r(null,e)}});var oKt=g((X2o,aKt)=>{"use strict";var mLe;function t4s(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var nKt=J_().codes,r4s=nKt.ERR_MISSING_ARGS,n4s=nKt.ERR_STREAM_DESTROYED;function iKt(e){if(e)throw e}function i4s(e){return e.setHeader&&typeof e.abort=="function"}function s4s(e,t,r,n){n=t4s(n);var i=!1;e.on("close",function(){i=!0}),mLe===void 0&&(mLe=JJ()),mLe(e,{readable:t,writable:r},function(a){if(a)return n(a);i=!0,n()});var s=!1;return function(a){if(!i&&!s){if(s=!0,i4s(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(a||new n4s("pipe"))}}}function sKt(e){e()}function a4s(e,t){return e.pipe(t)}function o4s(e){return!e.length||typeof e[e.length-1]!="function"?iKt:e.pop()}function c4s(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=o4s(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new r4s("streams");var i,s=t.map(function(a,o){var c=o<t.length-1,l=o>0;return s4s(a,c,l,function(u){i||(i=u),u&&s.forEach(sKt),!c&&(s.forEach(sKt),n(i))})});return t.reduce(a4s)}aKt.exports=c4s});var kf=g((Rf,jN)=>{var FN=require("stream");process.env.READABLE_STREAM==="disable"&&FN?(jN.exports=FN.Readable,Object.assign(jN.exports,FN),jN.exports.Stream=FN):(Rf=jN.exports=eLe(),Rf.Stream=FN||Rf,Rf.Readable=Rf,Rf.Writable=YNe(),Rf.Duplex=QS(),Rf.Transform=uLe(),Rf.PassThrough=rKt(),Rf.finished=JJ(),Rf.pipeline=oKt())});var dKt=g((K2o,lKt)=>{lKt.exports=_w;var l4s=require("util"),cKt=kf();l4s.inherits(_w,cKt.Duplex);function _w(e,t,r){var n=this;if(!(n instanceof _w))return new _w(e,t,r);cKt.Duplex.call(n,r),n._output=null,n.connect(e,t)}_w.prototype.connect=function(e,t){var r=this;r.req=e,r._output=t,r.emit("response",t),t.on("data",function(n){r.push(n)||r._output.pause()}),t.on("end",function(){r.push(null)})};_w.prototype._read=function(e){this._output&&this._output.resume()};_w.prototype._write=function(e,t,r){this.req.write(e,t),r()};_w.prototype.end=function(e,t,r){return this._output.socket.destroy(),this.req.end(e,t,r)};_w.prototype.destroy=function(){this.req.destroy(),this._output.socket.destroy()}});var mKt=g((W2o,uKt)=>{var dx=1e3,ux=dx*60,mx=ux*60,eC=mx*24,d4s=eC*7,u4s=eC*365.25;uKt.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return m4s(e);if(r==="number"&&isFinite(e))return t.long?p4s(e):f4s(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function m4s(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*u4s;case"weeks":case"week":case"w":return r*d4s;case"days":case"day":case"d":return r*eC;case"hours":case"hour":case"hrs":case"hr":case"h":return r*mx;case"minutes":case"minute":case"mins":case"min":case"m":return r*ux;case"seconds":case"second":case"secs":case"sec":case"s":return r*dx;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function f4s(e){var t=Math.abs(e);return t>=eC?Math.round(e/eC)+"d":t>=mx?Math.round(e/mx)+"h":t>=ux?Math.round(e/ux)+"m":t>=dx?Math.round(e/dx)+"s":e+"ms"}function p4s(e){var t=Math.abs(e);return t>=eC?oee(e,t,eC,"day"):t>=mx?oee(e,t,mx,"hour"):t>=ux?oee(e,t,ux,"minute"):t>=dx?oee(e,t,dx,"second"):e+" ms"}function oee(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var fLe=g((Q2o,fKt)=>{function g4s(e){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=s,r.enabled=o,r.humanize=mKt(),Object.keys(e).forEach(u=>{r[u]=e[u]}),r.instances=[],r.names=[],r.skips=[],r.formatters={};function t(u){let m=0;for(let p=0;p<u.length;p++)m=(m<<5)-m+u.charCodeAt(p),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=t;function r(u){let m;function p(...h){if(!p.enabled)return;let y=p,w=Number(new Date),v=w-(m||w);y.diff=v,y.prev=m,y.curr=w,m=w,h[0]=r.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let b=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(I,R)=>{if(I==="%%")return I;b++;let F=r.formatters[R];if(typeof F=="function"){let J=h[b];I=F.call(y,J),h.splice(b,1),b--}return I}),r.formatArgs.call(y,h),(y.log||r.log).apply(y,h)}return p.namespace=u,p.enabled=r.enabled(u),p.useColors=r.useColors(),p.color=t(u),p.destroy=n,p.extend=i,typeof r.init=="function"&&r.init(p),r.instances.push(p),p}function n(){let u=r.instances.indexOf(this);return u!==-1?(r.instances.splice(u,1),!0):!1}function i(u,m){let p=r(this.namespace+(typeof m=="undefined"?":":m)+u);return p.log=this.log,p}function s(u){r.save(u),r.names=[],r.skips=[];let m,p=(typeof u=="string"?u:"").split(/[\s,]+/),h=p.length;for(m=0;m<h;m++)!p[m]||(u=p[m].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.substr(1)+"$")):r.names.push(new RegExp("^"+u+"$")));for(m=0;m<r.instances.length;m++){let y=r.instances[m];y.enabled=r.enabled(y.namespace)}}function a(){let u=[...r.names.map(c),...r.skips.map(c).map(m=>"-"+m)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let m,p;for(m=0,p=r.skips.length;m<p;m++)if(r.skips[m].test(u))return!1;for(m=0,p=r.names.length;m<p;m++)if(r.names[m].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}return r.enable(r.load()),r}fKt.exports=g4s});var pKt=g((Tf,cee)=>{Tf.log=w4s;Tf.formatArgs=y4s;Tf.save=v4s;Tf.load=_4s;Tf.useColors=h4s;Tf.storage=b4s();Tf.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function h4s(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function y4s(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+cee.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}function w4s(...e){return typeof console=="object"&&console.log&&console.log(...e)}function v4s(e){try{e?Tf.storage.setItem("debug",e):Tf.storage.removeItem("debug")}catch(t){}}function _4s(){let e;try{e=Tf.storage.getItem("debug")}catch(t){}return!e&&typeof process!="undefined"&&"env"in process&&(e=process.env.DEBUG),e}function b4s(){try{return localStorage}catch(e){}}cee.exports=fLe()(Tf);var{formatters:S4s}=cee.exports;S4s.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var hKt=g((nd,lee)=>{var C4s=require("tty"),pLe=require("util");nd.init=T4s;nd.log=x4s;nd.formatArgs=A4s;nd.save=R4s;nd.load=k4s;nd.useColors=E4s;nd.colors=[6,2,3,4,5,1];try{let e=z1();e&&(e.stderr||e).level>=2&&(nd.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}nd.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function E4s(){return"colors"in nd.inspectOpts?Boolean(nd.inspectOpts.colors):C4s.isatty(process.stderr.fd)}function A4s(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} `;e[0]=s+e[0].split(`
82
82
  `).join(`
83
83
  `+s),e.push(i+"m+"+lee.exports.humanize(this.diff)+"")}else e[0]=P4s()+t+" "+e[0]}function P4s(){return nd.inspectOpts.hideDate?"":new Date().toISOString()+" "}function x4s(...e){return process.stderr.write(pLe.format(...e)+`
84
84
  `)}function R4s(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function k4s(){return process.env.DEBUG}function T4s(e){e.inspectOpts={};let t=Object.keys(nd.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=nd.inspectOpts[t[r]]}lee.exports=fLe()(nd);var{formatters:gKt}=lee.exports;gKt.o=function(e){return this.inspectOpts.colors=this.useColors,pLe.inspect(e,this.inspectOpts).replace(/\s*\n\s*/g," ")};gKt.O=function(e){return this.inspectOpts.colors=this.useColors,pLe.inspect(e,this.inspectOpts)}});var BN=g((Y2o,gLe)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?gLe.exports=pKt():gLe.exports=hKt()});var wKt=g((Z2o,yKt)=>{var I4s=require("fs");yKt.exports=function(e,t,r){t=typeof t!="undefined"?t:`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stacktape",
3
- "version": "1.0.0-alpha.66",
3
+ "version": "1.0.0-alpha.67",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Stacktape - cloud native framework for AWS",
6
6
  "author": "Stacktape team <info@stacktape.com> (https://stacktape.com)",